Skip to content

Commit

Permalink
feat: implement DataNftType to abstract methods from the attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Feb 8, 2024
1 parent f4a232d commit fa558e4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datanft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import {
ErrNetworkConfig,
ErrTooManyItems
} from './errors';
import { NftType, ViewDataReturnType } from './interfaces';
import { DataNftType, NftType, ViewDataReturnType } from './interfaces';
import BigNumber from 'bignumber.js';

export class DataNft {
export class DataNft implements DataNftType {
readonly tokenIdentifier: string = '';
readonly nftImgUrl: string = '';
readonly dataPreview: string = '';
Expand Down
23 changes: 23 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import BigNumber from 'bignumber.js';

export interface NftType {
identifier: string;
collection: string;
Expand Down Expand Up @@ -44,6 +46,27 @@ export interface NftType {
}[];
}

export interface DataNftType {
readonly tokenIdentifier: string;
readonly nftImgUrl: string;
readonly dataPreview: string;
readonly dataStream: string;
readonly dataMarshal: string;
readonly tokenName: string;
readonly creator: string;
readonly creationTime: Date;
readonly supply: number | BigNumber.Value;
readonly description: string;
readonly title: string;
readonly royalties: number;
readonly nonce: number;
readonly collection: string;
readonly balance: number | BigNumber.Value;
readonly owner: string;
readonly overrideDataMarshal: string;
readonly overrideDataMarshalChainId: string;
}

export enum NftEnumType {
NonFungibleESDT = 'NonFungibleESDT',
SemiFungibleESDT = 'SemiFungibleESDT',
Expand Down

0 comments on commit fa558e4

Please sign in to comment.