API Reference
API reference for @tetherto/wdk-protocol-lending-aave-evm
Class: AaveProtocolEvm
Main class for Aave V3 lending on EVM.
new AaveProtocolEvm(account)
Parameters:
account: WalletAccountEvm | WalletAccountReadOnlyEvm | WalletAccountEvmErc4337 | WalletAccountReadOnlyEvmErc4337
Example:
const aave = new AaveProtocolEvm(account)
Promise<{hash: string, fee: bigint, approveHash?: string, resetAllowanceHash?: string}>
quoteSupply(options, config?)
Estimate cost to add tokens
withdraw(options, config?)
Remove tokens from the pool
Promise<{hash: string, fee: bigint}>
quoteWithdraw(options, config?)
Estimate cost to withdraw
Promise<{hash: string, fee: bigint}>
quoteBorrow(options, config?)
Promise<{hash: string, fee: bigint}>
quoteRepay(options, config?)
setUseReserveAsCollateral(token, use, config?)
Toggle token as collateral
Promise<{hash: string, fee: bigint}>
setUserEMode(categoryId, config?)
Promise<{hash: string, fee: bigint}>
Promise<{ totalCollateralBase: bigint, totalDebtBase: bigint, availableBorrowsBase: bigint, currentLiquidationThreshold: bigint, ltv: bigint, healthFactor: bigint }>
supply(options, config?)
Add tokens to the pool.
Options:
token (string): token address
amount (bigint): amount in base units
onBehalfOf (string, optional)
Returns:
May include approveHash and resetAllowanceHash for standard accounts (e.g., USD₮ allowance reset on Ethereum mainnet)
Example:
quoteSupply(options, config?)
Estimate fee to add tokens.
withdraw(options, config?)
Remove tokens from the pool.
Options:
quoteWithdraw(options, config?)
Estimate fee to withdraw tokens.
borrow(options, config?)
Borrow tokens.
Options:
onBehalfOf (string, optional)
quoteBorrow(options, config?)
Estimate fee to borrow tokens.
repay(options, config?)
Repay borrowed tokens.
Options:
onBehalfOf (string, optional)
Returns:
For standard accounts, may include approveHash / resetAllowanceHash when applicable.
quoteRepay(options, config?)
Estimate fee to repay borrowed tokens.
setUseReserveAsCollateral(token, use, config?)
Toggle token as collateral for the user.
setUserEMode(categoryId, config?)
Set user eMode category.
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.
token must be a valid (non‑zero) address
amount > 0 and in token base units (use BigInt)
onBehalfOf/to (if set) must be valid, non‑zero addresses
A provider is required to read/send transactions
For USD₮ on mainnet, allowance may be reset to 0 then set again before actions
Get started with WDK in a Node.js environment
WDK Lending Aave EVM Protocol Configuration
Get started with WDK's Lending Aave EVM Protocol configuration
WDK Lending Aave EVM Protocol Usage
Get started with WDK's Lending Aave EVM Protocol usage
Connect with developers, ask questions, share your projects
Report bugs, request features, and get technical help
For sensitive or private matters, contact our team directly