From 9ef3fa939f13211219cc41dd3d31e47969abd1be Mon Sep 17 00:00:00 2001 From: D Date: Tue, 27 Aug 2024 12:42:07 +0500 Subject: [PATCH] chore(tezos): fix fetching metadata --- src/contractsTypes/tezos/NFT.types.ts | 16 +++++++++------- src/handler/tezos/utils/nftData.ts | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/contractsTypes/tezos/NFT.types.ts b/src/contractsTypes/tezos/NFT.types.ts index 606dc6cd..154bb248 100644 --- a/src/contractsTypes/tezos/NFT.types.ts +++ b/src/contractsTypes/tezos/NFT.types.ts @@ -13,13 +13,15 @@ export type Storage = { }, Array >; - token_metadata: BigMap< - nat, - { - token_id: nat; - token_info: MMap; - } - >; + tokens: { + token_metadata: BigMap< + nat, + { + token_id: nat; + token_info: MMap; + } + > + }; metadata: BigMap; admin: address; }; diff --git a/src/handler/tezos/utils/nftData.ts b/src/handler/tezos/utils/nftData.ts index dbd4cbbc..97a7517a 100644 --- a/src/handler/tezos/utils/nftData.ts +++ b/src/handler/tezos/utils/nftData.ts @@ -16,7 +16,7 @@ export default async function nftData( const tokenMetaData = await ( await nftContract.storage() - ).token_metadata.get(tas.nat(tokenId.toString())); + ).tokens.token_metadata.get(tas.nat(tokenId.toString())); const metaDataInHex = tokenMetaData.token_info.get(""); return bytesToString(metaDataInHex); };