@dojima-wallet/solver-modules
Version:
Modules of different protocols for solvers
120 lines (119 loc) • 5.62 kB
TypeScript
import { InterestRate, ChainId } from "@aave/contract-helpers";
import { ethers, BigNumberish } from "ethers";
import * as markets from "@bgd-labs/aave-address-book";
export declare class AaveV3Client {
private provider;
private signer;
private chain;
private erc20Service;
private erc2612Service;
constructor(privateKey: string, chain: string);
getChainId(): ChainId;
getRpcUrl(): string;
getMarketAddresses(): typeof markets.AaveV3Ethereum | typeof markets.AaveV3Sepolia | typeof markets.AaveV3OptimismSepolia | typeof markets.AaveV3ArbitrumSepolia;
getFormattedReserves(): Promise<(import("@aave/contract-helpers").ReserveDataHumanized & import("@aave/math-utils").FormatReserveUSDResponse)[]>;
getFormattedUserSummary(userAddress: string): Promise<import("@aave/math-utils").FormatUserSummaryResponse<{
liquidityRate: string;
variableBorrowRate: string;
originalId: number;
id: string;
underlyingAsset: string;
name: string;
symbol: string;
decimals: number;
baseLTVasCollateral: string;
reserveLiquidationThreshold: string;
reserveLiquidationBonus: string;
reserveFactor: string;
usageAsCollateralEnabled: boolean;
borrowingEnabled: boolean;
isActive: boolean;
isFrozen: boolean;
liquidityIndex: string;
variableBorrowIndex: string;
lastUpdateTimestamp: number;
aTokenAddress: string;
variableDebtTokenAddress: string;
interestRateStrategyAddress: string;
availableLiquidity: string;
totalScaledVariableDebt: string;
priceInMarketReferenceCurrency: string;
priceOracle: string;
variableRateSlope1: string;
variableRateSlope2: string;
baseVariableBorrowRate: string;
optimalUsageRatio: string;
isPaused: boolean;
isSiloedBorrowing: boolean;
accruedToTreasury: string;
unbacked: string;
isolationModeTotalDebt: string;
flashLoanEnabled: boolean;
debtCeiling: string;
debtCeilingDecimals: number;
borrowCap: string;
supplyCap: string;
borrowableInIsolation: boolean;
virtualAccActive: boolean;
virtualUnderlyingBalance: string;
} & import("@aave/math-utils").FormatReserveUSDResponse>>;
getReserveIncentives(): Promise<import("@aave/contract-helpers").ReservesIncentiveDataHumanized[]>;
getUserIncentives(userAddress: string): Promise<import("@aave/contract-helpers").UserReservesIncentivesDataHumanized[]>;
getApprovedAmount(token: string): Promise<ethers.BigNumber>;
generateApprovalTx(token: string, amount: string): Promise<ethers.PopulatedTransaction>;
generateSupplyTx(token: string, amount: string): Promise<ethers.PopulatedTransaction>;
generateSupplyWithPermitTx(token: string, amount: string, signature: string, deadline: string): Promise<ethers.PopulatedTransaction>;
signERC20Approval(token: string, amount: string, deadline: string): Promise<any>;
generateSupplySignatureRequest(token: string, amount: string): Promise<{
types: {
EIP712Domain: {
name: string;
type: string;
}[];
Permit: {
name: string;
type: string;
}[];
};
primaryType: string;
domain: {
name: string;
version: string;
chainId: number;
verifyingContract: string;
};
message: {
owner: string;
spender: "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" | "0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951" | "0xb50201558B00496A145fE76f7424749556E326D8" | "0xBfC91D59fdAA134A4ED45f7B584cAf96D7792Eff";
value: string;
nonce: number;
deadline: string;
};
deadline: string;
}>;
supplyBundle(reserve: string, amount: string, onBehalfOf?: string): Promise<any>;
repay(reserve: string, amount: string, interestRateMode?: InterestRate, onBehalfOf?: string): Promise<string>;
repayWithAToken(reserve: string, amount: string, interestRateMode?: InterestRate): Promise<string>;
borrow(reserve: string, amount: string, interestRateMode?: InterestRate, onBehalfOf?: string): Promise<string>;
withdraw(reserve: string, amount: string, aTokenAddress: string, onBehalfOf?: string): Promise<string>;
swapBorrowRateMode(reserve: string, interestRateMode: InterestRate): Promise<string>;
setUsageAsCollateral(reserve: string, usageAsCollateral: boolean): Promise<string>;
liquidationCall(liquidatedUser: string, debtReserve: string, collateralReserve: string, purchaseAmount: string, getAToken?: boolean): Promise<string>;
supplyWithPermit(reserve: string, amount: string, signature: string, onBehalfOf?: string): Promise<string>;
repayWithPermit(reserve: string, amount: string, interestRateMode: InterestRate, signature: string, onBehalfOf?: string): Promise<string>;
setUserEMode(categoryId: number): Promise<string>;
getAllWalletBalances(walletAddress: string): Promise<{
[key: string]: {
symbol: string;
balance: string;
address: string;
};
}>;
private getWethContract;
/**
* Wrap ETH into WETH. Emits the WrapEth event when the transaction is prompted.
* @param options Parameters for wrapping ETH
* @returns Promise that resolves when the wrap is complete
*/
wrapETH(amountInEth: BigNumberish): Promise<any>;
}