Implements

Constructors

  • Creates an instance of DataNft. Can be partially initialized.

    Parameters

    • Optionalinit: Partial<DataNft>

      Partial

    Returns DataNft

Properties

balance: Value = 0
collection: string = ''
creationTime: Date = ...
creator: string = ''
dataMarshal: string = ''
dataPreview: string = ''
dataStream: string = ''
description: string = ''
extraAssets: string[] = []
isDataNFTPH: boolean = false
media: {
    fileSize: number;
    fileType: string;
    originalUrl: string;
    thumbnailUrl: string;
    url: string;
}[] = []
metadataFile: string = ''
nftImgUrl: string = ''
nonce: number = 0
overrideDataMarshal: string = ''
overrideDataMarshalChainId: string = ''
owner: string = ''
royalties: number = 0
supply: Value = 0
title: string = ''
tokenIdentifier: string = ''
tokenName: string = ''
type: NftEnumType = NftEnumType.SemiFungibleESDT
apiConfiguration: string
env: string
networkConfiguration: Config

Methods

  • Gets the message to sign from the data marshal of the DataNft

    Returns Promise<string>

  • Returns an array of {address:string,balance:number} representing the addresses that own the token

    Returns Promise<{
        address: string;
        balance: number;
    }[]>

  • Update any attributes for DataNft

    Parameters

    Returns void

  • Method to get the data via the Data Marshal.

    Parameters

    • p: {
          asDeputyOnAppointerAddr?: string;
          fwdAllHeaders?: boolean;
          fwdHeaderKeys?: string;
          fwdHeaderMapLookup?: {
              [key: string]: any;
          };
          nestedIdxToStream?: number;
          signableMessage: SignableMessage;
          signedMessage: string;
          stream?: boolean;
      }
      • OptionalasDeputyOnAppointerAddr?: string
      • OptionalfwdAllHeaders?: boolean
      • OptionalfwdHeaderKeys?: string
      • OptionalfwdHeaderMapLookup?: {
            [key: string]: any;
        }
        • [key: string]: any
      • OptionalnestedIdxToStream?: number
      • signableMessage: SignableMessage
      • signedMessage: string
      • Optionalstream?: boolean

    Returns Promise<ViewDataReturnType>

  • Method to get the data from the data marshal by authenticating and authorizing via MultiversX Native Auth. This has a better UX as it does not need a manually signed signableMessage

    Parameters

    • p: {
          asDeputyOnAppointerAddr?: string;
          fwdAllHeaders?: boolean;
          fwdHeaderKeys?: string;
          fwdHeaderMapLookup: {
              [key: string]: any;
          };
          mvxNativeAuthMaxExpirySeconds: number;
          mvxNativeAuthOrigins: string[];
          nestedIdxToStream?: number;
          stream?: boolean;
      }
      • OptionalasDeputyOnAppointerAddr?: string
      • OptionalfwdAllHeaders?: boolean
      • OptionalfwdHeaderKeys?: string
      • fwdHeaderMapLookup: {
            [key: string]: any;
        }
        • [key: string]: any
      • mvxNativeAuthMaxExpirySeconds: number
      • mvxNativeAuthOrigins: string[]
      • OptionalnestedIdxToStream?: number
      • Optionalstream?: boolean

    Returns Promise<ViewDataReturnType>

  • Creates a DataNft calling the API and also decoding the attributes.

    Not useful for creating an array of DataNft, because it calls the API every single time.

    Parameters

    • token: {
          nonce: number;
          tokenIdentifier?: string;
      }

      Object should have a nonce property representing the token nonce. An optional tokenIdentifier property can be provided to specify the token identifier. If not provided, the default token identifier based on the EnvironmentsEnum

      • nonce: number
      • OptionaltokenIdentifier?: string

    Returns Promise<DataNft>

  • Creates a DataNft or an array of DataNft from either a single NFT details API response or an array of NFT details API response.

    Parameters

    • payload: NftType | NftType[]

      NFT details API response, can be a single item or an array of items

    Returns DataNft[]

  • Creates an array of DataNfts by calling the API and decoding the attributes.

    Parameters

    • tokens: {
          nonce: number;
          tokenIdentifier?: string;
      }[]

      An array of objects containing token nonces and optional token identifiers. Each object should have a nonce property representing the token nonce. An optional tokenIdentifier property can be provided to specify the token identifier. If not provided, the default token identifier based on the EnvironmentsEnum

    Returns Promise<DataNft[]>

    An array of DataNft objects

  • Static method to decode the attributes of a DataNft

    Parameters

    • attributes: any

      Attributes of the DataNft

    Returns Partial<DataNft>

  • Returns an array of DataNft objects owned by the address

    Parameters

    • address: string

      the address to query

    • Optionalcollections: string[]

      the collection identifiers to query. If not provided, the default collection identifier based on the EnvironmentsEnum

    Returns Promise<DataNft[]>

  • Sets the network configuration for the DataNft class.

    Parameters

    • env: string

      'devnet' | 'mainnet' | 'testnet'

    Returns void