The Massa's standard NFT implementation wrapper.

Remarks

This class can be used to wrap a smart contract implementing Massa standard NFT. All the serialization/deserialization will handled here.

Example

const NFT = new NFTWrapper(NFTaddr);
NFT.transfer('1x', 1);

Hierarchy

  • NFTWrapper

Constructors

  • Wraps a smart contract exposing standard none fungible token.

    Parameters

    • at: Address

      Address of the contract

    Returns NFTWrapper

Properties

_origin: Address

Methods

  • Approve an address to transfer a token

    Parameters

    • tokenId: number

      Token ID

    • address: string

      address to approve

    Returns void

  • generate an event with the base URI (external link written in NFT where pictures or others a stored)

    Returns string

  • Generate an event with the current counter, if 10 NFT minted, returns 10.

    Returns number

  • Get the approved address(es) of a token

    Returns

    an array of the approved address(es)

    Parameters

    • tokenId: number

      Token ID

    Returns string[]

  • The addressTo becomes the owner of the next token (if current tokenID = 10, will mint 11 ) Check if max supply is not reached

    Parameters

    • addressTo: string

      address that will receive the minted token

    Returns void

  • Generate an event with the NFT's name

    Returns string

  • Generate an event with the owner of a tokenID

    Parameters

    • tokenId: number

      Token ID

    Returns Address

  • Generate an event with the NFT's symbol

    Returns string

  • generate an event with the token URI (external link written in NFT where pictures or others are stored)

    Parameters

    • tokenId: number

      Token ID

    Returns string

  • Generate an event with the max supply

    Returns number

  • Transfer a chosen token from the caller to the toAddress. Check first the caller owns the token.

    Parameters

    • toAddress: string

      recipient address

    • tokenId: number

      Token ID

    Returns void

  • Transfer a chosen token from the fromAddress to the toAddress.

    Remarks

    caller must be an approved address

    Parameters

    • fromAddress: string

      address of the owner

    • toAddress: string

      address of the recipient

    • tokenId: number

      Token ID

    Returns void

Generated using TypeDoc