Usage
How to install and use @tetherto/wdk-protocol-lending-aave-evm on EVM
Installation
npm install @tetherto/wdk-protocol-lending-aave-evmQuick Start
Setting Up the Lending Service
import AaveProtocolEvm from '@tetherto/wdk-protocol-lending-aave-evm'
import { WalletAccountEvm } from '@tetherto/wdk-wallet-evm'
// Create account (m/44'/60'/0'/0/0)
const account = new WalletAccountEvm(seedPhrase, "0'/0/0", {
provider: 'https://ethereum-rpc.publicnode.com'
})
// Create lending service
const aave = new AaveProtocolEvm(account)Supply / Withdraw / Borrow / Repay
// Supply 1,000,000 base units (token decimals dependent)
await aave.supply({ token: 'TOKEN_ADDRESS', amount: 1000000n })
// Withdraw
await aave.withdraw({ token: 'TOKEN_ADDRESS', amount: 1000000n })
// Borrow
await aave.borrow({ token: 'TOKEN_ADDRESS', amount: 1000000n })
// Repay
await aave.repay({ token: 'TOKEN_ADDRESS', amount: 1000000n })
