Initialize PoolBundle and LendingPoolBundle
masterNew transaction methods are accessed via PoolBundle (for V3) and LendingPoolBundle (for V2) objects. These objects require an ethers provider and a configuration object containing the market's POOL and WETH_GATEWAY addresses.
To initialize them, use the addresses provided by @bgd-labs/aave-address-book.
const { PoolBundle, LendingPoolBundle } = require("@aave/contract-helpers");
const markets = require("@bgd-labs/aave-address-book");
// For V3
const poolBundle = new PoolBundle(provider, {
POOL: markets[marketKey].POOL,
WETH_GATEWAY: markets[marketKey].WETH_GATEWAY,
});
// For V2
const poolBundle = new LendingPoolBundle(provider, {
LENDING_POOL: markets[marketKey].POOL,
WETH_GATEWAY: markets[marketKey].WETH_GATEWAY,
});