Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-mayflies-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-coop": patch
---

retrieve decoded metadata from arweave
18 changes: 9 additions & 9 deletions packages/coop/src/Coop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion packages/coop/src/Coop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading