Skip to content

Instantly share code, notes, and snippets.

@jarrodlilkendey
Created April 21, 2022 05:28
Show Gist options
  • Save jarrodlilkendey/9994787660ba311f018c1b6e9a5e99eb to your computer and use it in GitHub Desktop.
Save jarrodlilkendey/9994787660ba311f018c1b6e9a5e99eb to your computer and use it in GitHub Desktop.
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