Skip to content

Commit 19177a1

Browse files
committed
feat: use arweave for metadata retrieval
1 parent 8fbf74c commit 19177a1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/coop/src/Coop.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ describe('simulateMint function', () => {
154154
})
155155

156156
describe('getExternalUrl function', () => {
157-
// test('should return correct url for mint w/tokenId', async () => {
158-
// const params = {
159-
// chainId: Chains.BASE,
160-
// contractAddress: getAddress('0x7caC19A3aC8aD29F2C1CEA4ad0a16135b969C52c'),
161-
// tokenId: 1,
162-
// }
163-
// const result = await getExternalUrl(params)
164-
// expect(result).toBe('https://cooprecords.xyz')
165-
// })
157+
test('should return correct url for mint w/tokenId', async () => {
158+
const params = {
159+
chainId: Chains.BASE,
160+
contractAddress: getAddress('0x7caC19A3aC8aD29F2C1CEA4ad0a16135b969C52c'),
161+
tokenId: 1,
162+
}
163+
const result = await getExternalUrl(params)
164+
expect(result).toBe('https://cooprecords.xyz/aszewo/messy')
165+
})
166166

167167
test('should return fallback url if error occurs', async () => {
168168
const params = {

packages/coop/src/Coop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const getExternalUrl = async (
206206
const uri = await getUri(client, contractAddress, tokenId)
207207
const cid = uri.split('/').slice(2).join('/')
208208

209-
const { data } = await axios.get(`https://dweb.link/ipfs/${cid}`)
209+
const { data } = await axios.get(`https://arweave.net/${cid}`)
210210

211211
return data.external_url ?? 'https://cooprecords.xyz'
212212
} catch (error) {

0 commit comments

Comments
 (0)