Created
April 21, 2022 05:28
-
-
Save jarrodlilkendey/9994787660ba311f018c1b6e9a5e99eb 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 { token } = require('./config.json'); | |
const ethers = require('ethers'); | |
const { Client, Intents, MessageEmbed, MessageAttachment } = require('discord.js'); | |
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); | |
const client = new Client({ intents: [Intents.FLAGS.GUILDS] }); | |
client.once('ready', async () => { | |
console.log('Ready!', Date.now()); | |
aavegotchiDiamond.on("GotchiLendingAdd", async (listingId) => { | |
const lendingInfo = await aavegotchiDiamond.getGotchiLendingListingInfo(listingId); | |
}); | |
}); | |
client.login(token); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment