This bot sends sales data to @lootproject's Discord server.
- Create an
.env
file and set the following secrets:
CONTRACT_ADDRESS= # Smart contract address (0x...)
PROVIDER_URL= # For example Alchemy or Infura URL
DISCORD_WEBHOOK_URL= # Discord Webhook URL (Server Settings -> Integrations -> Webhooks)
- Install dependencies:
npm install
- Run:
npm start
This bot works by listening to the Transfer
event on a smart contract.
This approach has the following advantages:
- provides a near real-time experience (events are emitted after a block is created)
- doesn't abuse the OpenSea API by periodically fetching it
- relying on a simple callback results in cleaner code
abi.json
is from the Loot Pojectloot.json
&rare.json
is from dhof-loot
/workspace/node_modules/@ethersproject/logger/src.ts/index.ts:225
const error: any = new Error(message);
^
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.4.5)