From a9ab05b53222dc0d765eba212ea4ef61bbf5c478 Mon Sep 17 00:00:00 2001 From: Bucur David Date: Tue, 14 May 2024 13:05:26 +0300 Subject: [PATCH] feat: add data nft type to DataNft object --- src/common/utils.ts | 1 + src/datanft.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/utils.ts b/src/common/utils.ts index 8d75524..16c94d1 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -179,6 +179,7 @@ export function parseDataNft(value: NftType): DataNft { : value.type === NftEnumType.NonFungibleESDT ? 1 : 0, + type: value.type, royalties: value.royalties !== null ? value.royalties / 100 : 0, nonce: value.nonce, collection: value.collection, diff --git a/src/datanft.ts b/src/datanft.ts index e628e9d..17954e8 100644 --- a/src/datanft.ts +++ b/src/datanft.ts @@ -27,7 +27,12 @@ import { ErrNetworkConfig, ErrTooManyItems } from './errors'; -import { DataNftType, NftType, ViewDataReturnType } from './interfaces'; +import { + DataNftType, + NftEnumType, + NftType, + ViewDataReturnType +} from './interfaces'; import BigNumber from 'bignumber.js'; export class DataNft implements DataNftType { @@ -46,11 +51,13 @@ export class DataNft implements DataNftType { readonly nonce: number = 0; readonly collection: string = ''; readonly balance: BigNumber.Value = 0; + readonly type: NftEnumType = NftEnumType.SemiFungibleESDT; readonly owner: string = ''; // works if tokenIdentifier is an NFT readonly overrideDataMarshal: string = ''; readonly overrideDataMarshalChainId: string = ''; readonly isDataNFTPH: boolean = false; readonly extraAssets: string[] = []; + readonly media: { url: string; originalUrl: string;