diff --git a/cli/src/commands/sync.ts b/cli/src/commands/sync.ts index 58c60a77b8..1f8e58ad5c 100644 --- a/cli/src/commands/sync.ts +++ b/cli/src/commands/sync.ts @@ -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, });