ourzora / nft-metadata

generic nft metadata parsers
MIT License
65 stars 13 forks source link

Default cloudflare provider seems to be partially broken #42

Open 0xprincess opened 2 years ago

0xprincess commented 2 years ago

I discovered that a particular nft contact wasn't picked up by a zora indexer, so I thought that maybe this library has an issue. (I didn't notice a warning that contracts are manually added at that moment)

But also turned out that this library fails to fetch a metadata with default provider, but succeed using public infura endpoint.

How to test: 1) Code below fails (default provider)

import {Agent} from '@zoralabs/nft-metadata';
import ethers from 'ethers'

const parser = new Agent({
    network: 'rinkeby',
    timeout: 60 * 1000,
})

parser.fetchMetadata('0xC4773942224af8F06c04C1aE88D96A455798854D', '1').then((data) => {
    console.log(data);
})

2) Code below works (infura provider)

import {Agent} from '@zoralabs/nft-metadata';
import ethers from 'ethers'

const parser = new Agent({
    network: 'rinkeby',
    timeout: 60 * 1000,
    provider: new ethers.providers.JsonRpcProvider('https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', 4)
})

parser.fetchMetadata('0xC4773942224af8F06c04C1aE88D96A455798854D', '1').then((data) => {
    console.log(data);
})
0xprincess commented 2 years ago

So if you're using this provider for fetching metadata on the indexer side, please consider changing it.

iainnash commented 2 years ago

@0xprincess Great point! We're using a different provider on the indexer side. What contract were you having issues with?