diff --git a/src/handlers/icp/index.ts b/src/handlers/icp/index.ts index 2689f507..ef81fcdb 100644 --- a/src/handlers/icp/index.ts +++ b/src/handlers/icp/index.ts @@ -119,10 +119,12 @@ export async function icpHandler({ return { tokenId: tid.toString(), uri: metadata, - native: md, + native: { + amount: 1n, + md, + }, collectionIdent: contract, type: "NFT", - amount: 1n, } as const; }), ); diff --git a/src/handlers/icp/types.ts b/src/handlers/icp/types.ts index 56365cf2..50d468ec 100644 --- a/src/handlers/icp/types.ts +++ b/src/handlers/icp/types.ts @@ -52,4 +52,4 @@ export type TICPHandler = TSingularNftChain< string > & ReadClaimed721Event & - TNFTList<[string, Value][], null>; + TNFTList<{ md: [string, Value][] }, null>; diff --git a/src/handlers/secret/index.ts b/src/handlers/secret/index.ts index 7d706b29..da9093ab 100644 --- a/src/handlers/secret/index.ts +++ b/src/handlers/secret/index.ts @@ -60,10 +60,10 @@ export function secretHandler({ uri: tokenInfo.all_nft_info.info?.token_uri || "", tokenId: token, type: "NFT", - amount: 1n, native: { contract: contract, contractHash: ea.codeHash || "", + amount: 1n, tokenId: token, viewingKey: ea.viewingKey, metadata: tokenInfo.all_nft_info.info?.token_uri || "", @@ -118,12 +118,12 @@ export function secretHandler({ tokenInfo.token_id_private_info.token_id_info.public_metadata .token_uri || "", tokenId: token.token_id, - amount: BigInt(token.amount), type: "SFT", native: { contract: contract, contractHash: ea.codeHash || "", tokenId: token, + amount: BigInt(token.amount), viewingKey: ea.viewingKey, metadata: tokenInfo.token_id_private_info.token_id_info.public_metadata diff --git a/src/handlers/types/chain.ts b/src/handlers/types/chain.ts index b391b92b..76f97fac 100644 --- a/src/handlers/types/chain.ts +++ b/src/handlers/types/chain.ts @@ -379,10 +379,11 @@ export type TNFTList = { }; export type TokenInfo = { - readonly native: RawTokenInfo; + readonly native: { + amount: bigint; + } & RawTokenInfo; readonly uri: string; readonly collectionIdent: string; readonly tokenId: string; readonly type: "NFT" | "SFT"; - readonly amount: bigint; };