Skip to content

Commit

Permalink
feat: add data nft type to DataNft object
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed May 14, 2024
1 parent 58184b6 commit a9ab05b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 8 additions & 1 deletion src/datanft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit a9ab05b

Please sign in to comment.