diff --git a/.changeset/chilled-mayflies-poke.md b/.changeset/chilled-mayflies-poke.md new file mode 100644 index 000000000..05818d8ea --- /dev/null +++ b/.changeset/chilled-mayflies-poke.md @@ -0,0 +1,5 @@ +--- +"@rabbitholegg/questdk-plugin-coop": patch +--- + +retrieve decoded metadata from arweave diff --git a/packages/coop/src/Coop.test.ts b/packages/coop/src/Coop.test.ts index 94969e5c0..fdebef56a 100644 --- a/packages/coop/src/Coop.test.ts +++ b/packages/coop/src/Coop.test.ts @@ -154,15 +154,15 @@ describe('simulateMint function', () => { }) describe('getExternalUrl function', () => { - // test('should return correct url for mint w/tokenId', async () => { - // const params = { - // chainId: Chains.BASE, - // contractAddress: getAddress('0x7caC19A3aC8aD29F2C1CEA4ad0a16135b969C52c'), - // tokenId: 1, - // } - // const result = await getExternalUrl(params) - // expect(result).toBe('https://cooprecords.xyz') - // }) + test('should return correct url for mint w/tokenId', async () => { + const params = { + chainId: Chains.BASE, + contractAddress: getAddress('0x7caC19A3aC8aD29F2C1CEA4ad0a16135b969C52c'), + tokenId: 1, + } + const result = await getExternalUrl(params) + expect(result).toBe('https://cooprecords.xyz/aszewo/messy') + }) test('should return fallback url if error occurs', async () => { const params = { diff --git a/packages/coop/src/Coop.ts b/packages/coop/src/Coop.ts index 3db2b61d7..b5f7cc81d 100644 --- a/packages/coop/src/Coop.ts +++ b/packages/coop/src/Coop.ts @@ -206,7 +206,7 @@ export const getExternalUrl = async ( const uri = await getUri(client, contractAddress, tokenId) const cid = uri.split('/').slice(2).join('/') - const { data } = await axios.get(`https://dweb.link/ipfs/${cid}`) + const { data } = await axios.get(`https://arweave.net/${cid}`) return data.external_url ?? 'https://cooprecords.xyz' } catch (error) {