Implements

Constructors

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

    Parameters

    • Optional init: 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;
}[] = []

Type declaration

  • fileSize: number
  • fileType: string
  • originalUrl: string
  • thumbnailUrl: string
  • url: string
nftImgUrl: string = ''
nonce: number = 0
overrideDataMarshal: string = ''
overrideDataMarshalChainId: string = ''
owner: string = ''
royalties: number = 0
supply: Value = 0
title: string = ''
tokenIdentifier: string = ''
tokenName: string = ''
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;
      }
      • Optional asDeputyOnAppointerAddr?: string
      • Optional fwdAllHeaders?: boolean
      • Optional fwdHeaderKeys?: string
      • Optional fwdHeaderMapLookup?: {
            [key: string]: any;
        }
        • [key: string]: any
      • Optional nestedIdxToStream?: number
      • signableMessage: SignableMessage
      • signedMessage: string
      • Optional stream?: 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;
      }
      • Optional asDeputyOnAppointerAddr?: string
      • Optional fwdAllHeaders?: boolean
      • Optional fwdHeaderKeys?: string
      • fwdHeaderMapLookup: {
            [key: string]: any;
        }
        • [key: string]: any
      • mvxNativeAuthMaxExpirySeconds: number
      • mvxNativeAuthOrigins: string[]
      • Optional nestedIdxToStream?: number
      • Optional stream?: 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
      • Optional tokenIdentifier?: 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

    • Optional collections: 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

Generated using TypeDoc