Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Fix new architecture nftsResolvers in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
lambertkevin committed Apr 8, 2022
1 parent b75eeef commit 996f742
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cli/src/commands/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@ export default {
const { currencyId } = decodeAccountId(account.id);
const currency = getCryptoCurrencyById(currencyId);
const currencyBridge = getCurrencyBridge(currency);
const { nftMetadataResolver } = currencyBridge;
const { nftsResolvers } = currencyBridge;

return account.nfts?.length && nftMetadataResolver
return account.nfts?.length && nftsResolvers?.nftMetadata
? {
...account,
nfts: await Promise.all(
account.nfts.map(async (nft) => {
const { result: metadata } = await nftMetadataResolver({
contract: nft.contract,
tokenId: nft.tokenId,
currencyId: nft.currencyId,
});
const { result: metadata } = await nftsResolvers?.nftMetadata(
{
contract: nft.contract,
tokenId: nft.tokenId,
currencyId: nft.currencyId,
}
);

return { ...nft, metadata };
})
Expand Down

1 comment on commit 996f742

@github-actions
Copy link

@github-actions github-actions bot commented on 996f742 Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.
To be able to merge in develop branch, you need to:

  • pass the CI
  • have a dev review
  • have a QA review

Please sign in to comment.