Last active
April 21, 2022 05:12
-
-
Save jarrodlilkendey/881376b0ab92d055a7ab6951673ae179 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const abi = require("./abi.json"); | |
const ethers = require('ethers'); | |
require('dotenv').config(); | |
const network = { | |
name: "polygon", | |
chainId: 137, | |
_defaultProvider: (providers) => new providers.JsonRpcProvider(process.env.ALCHEMY_URL) | |
}; | |
const provider = ethers.getDefaultProvider(network); | |
const aavegotchiDiamond = new ethers.Contract('0x86935F11C86623deC8a25696E1C19a8659CbF95d', abi, provider); | |
aavegotchiDiamond.on("GotchiLendingAdd", async (listingId) => { | |
console.log("GotchiLendingAdd", listingId); | |
const lendingInfo = await aavegotchiDiamond.getGotchiLendingListingInfo(listingId); | |
console.log("lendingInfo", lendingInfo); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment