Skip to content

Commit

Permalink
Fixed assetDID in claimer response
Browse files Browse the repository at this point in the history
  • Loading branch information
smakhtin committed Jul 4, 2024
1 parent 4e08cc9 commit 42b218c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
12 changes: 10 additions & 2 deletions apps/api/src/routes/claims/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ export const collections: Collections = {
externalId: '3019',
metadata: {
description: 'The Dotphin POAP Collection is a series of unique badges.',
imagePrefix: 'ipfs://QmXzECuBhrG2xy6ewRJCivZFiTYeuvoAosTjRADhuHaoUA',
imagePrefix:
'https://real.myfilebase.com/ipfs/QmXzECuBhrG2xy6ewRJCivZFiTYeuvoAosTjRADhuHaoUA',
name: 'Dotphin POAP Test',
attributes: [
[
{ trait_type: 'element', value: 'air' },
{ trait_type: 'event', value: 'polkadot-decoded-2024' },
{ trait_type: 'eventId', value: 'polkadot-decoded-2024' },
{
trait_type: 'eventURL',
value: 'https://decoded.polkadot.network/', //TODO: Check if there any updated event URL
},
{ trait_type: 'country', value: 'Belgium' },
{ trait_type: 'city', value: 'Brussels' },
{ trait_type: 'virtual', value: 'false' },
],
],
},
Expand Down
18 changes: 12 additions & 6 deletions apps/api/src/routes/claims/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,21 @@ app.post(
);
}

return c.json({
...parsedMintResponse,
assetDID: createAssetDID(
if (parsedMintResponse.onChain.tokenId) {
const assetDID = createAssetDID(
collectionConfig.network,
collectionConfig.tokenStandard,
collectionConfig.externalId,
parsedMintResponse.onChain.tokenId || '' //TODO: Separate success or pending response parsers so tokeId is defined
),
});
parsedMintResponse.onChain.tokenId
);

return c.json({
...parsedMintResponse,
assetDID,
});
}

return c.json(parsedMintResponse);
}
default:
return c.json({ error: true, message: 'Network not supported' }, 400);
Expand Down

0 comments on commit 42b218c

Please sign in to comment.