From 996f7420435939e6dc3e9207777f4c09b03b6c95 Mon Sep 17 00:00:00 2001 From: lambertkevin Date: Fri, 8 Apr 2022 12:13:20 +0200 Subject: [PATCH] Fix new architecture nftsResolvers in cli --- cli/src/commands/sync.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cli/src/commands/sync.ts b/cli/src/commands/sync.ts index 308a86abb3..ccaf3fdaa6 100644 --- a/cli/src/commands/sync.ts +++ b/cli/src/commands/sync.ts @@ -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 }; })