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 (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambertkevin committed Apr 8, 2022
1 parent adff6b7 commit 22f5d82
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cli/src/commands/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ export default {
}
) =>
scan(opts).pipe(
switchMap(async (account) =>
account.nfts?.length
switchMap(async (account) => {
const { currencyId } = decodeAccountId(account.id);
const currency = getCryptoCurrencyById(currencyId);
const currencyBridge = getCurrencyBridge(currency);
const { nftResolvers } = currencyBridge;

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

Expand Down

0 comments on commit 22f5d82

Please sign in to comment.