API Reference
API reference for @tetherto/wdk-protocol-lending-aave-evm
Class: AaveProtocolEvm
Main class for Aave V3 lending on EVM.
Constructor
new AaveProtocolEvm(account)Parameters:
account:WalletAccountEvm | WalletAccountReadOnlyEvm | WalletAccountEvmErc4337 | WalletAccountReadOnlyEvmErc4337
Example:
const aave = new AaveProtocolEvm(account)Methods
supply(options, config?)
Add tokens to the pool
Promise<{hash: string, fee: bigint, approveHash?: string, resetAllowanceHash?: string}>
quoteSupply(options, config?)
Estimate cost to add tokens
Promise<{fee: bigint}>
withdraw(options, config?)
Remove tokens from the pool
Promise<{hash: string, fee: bigint}>
quoteWithdraw(options, config?)
Estimate cost to withdraw
Promise<{fee: bigint}>
borrow(options, config?)
Borrow tokens
Promise<{hash: string, fee: bigint}>
quoteBorrow(options, config?)
Estimate borrowing cost
Promise<{fee: bigint}>
repay(options, config?)
Repay borrowed tokens
Promise<{hash: string, fee: bigint}>
quoteRepay(options, config?)
Estimate repayment cost
Promise<{fee: bigint}>
setUseReserveAsCollateral(token, use, config?)
Toggle token as collateral
Promise<{hash: string, fee: bigint}>
setUserEMode(categoryId, config?)
Set user eMode
Promise<{hash: string, fee: bigint}>
getAccountData(account?)
Read account stats
Promise<{ totalCollateralBase: bigint, totalDebtBase: bigint, availableBorrowsBase: bigint, currentLiquidationThreshold: bigint, ltv: bigint, healthFactor: bigint }>
supply(options, config?)
supply(options, config?)Add tokens to the pool.
Options:
token(string): token addressamount(bigint): amount in base unitsonBehalfOf(string, optional)
Returns:
May include
approveHashandresetAllowanceHashfor standard accounts (e.g., USD₮ allowance reset on Ethereum mainnet)
Example:
quoteSupply(options, config?)
quoteSupply(options, config?)Estimate fee to add tokens.
withdraw(options, config?)
withdraw(options, config?)Remove tokens from the pool.
Options:
token(string)amount(bigint)to(string, optional)
quoteWithdraw(options, config?)
quoteWithdraw(options, config?)Estimate fee to withdraw tokens.
borrow(options, config?)
borrow(options, config?)Borrow tokens.
Options:
token(string)amount(bigint)onBehalfOf(string, optional)
quoteBorrow(options, config?)
quoteBorrow(options, config?)Estimate fee to borrow tokens.
repay(options, config?)
repay(options, config?)Repay borrowed tokens.
Options:
token(string)amount(bigint)onBehalfOf(string, optional)
Returns:
For standard accounts, may include
approveHash/resetAllowanceHashwhen applicable.
quoteRepay(options, config?)
quoteRepay(options, config?)Estimate fee to repay borrowed tokens.
setUseReserveAsCollateral(token, use, config?)
setUseReserveAsCollateral(token, use, config?)Toggle token as collateral for the user.
setUserEMode(categoryId, config?)
setUserEMode(categoryId, config?)Set user eMode category.
getAccountData(account?)
getAccountData(account?)Read account stats like total collateral, debt, and health.
Returns the following structure:
ERC‑4337 Config (optional)
paymasterToken(string): token used to pay gas when sponsored.
Rules & Notes
tokenmust be a valid (non‑zero) addressamount> 0 and in token base units (use BigInt)onBehalfOf/to(if set) must be valid, non‑zero addressesA provider is required to read/send transactions
For USD₮ on mainnet, allowance may be reset to 0 then set again before actions

