Class TokenClient

Class for creating, minting and managing minting NFT collections and tokens

Hierarchy

  • TokenClient

Constructors

Properties

aptosClient: AptosClient

Methods

  • Removes a token from pending claims list

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount which will remove token from pending list

    • receiver: MaybeHexString

      Hex-encoded 32 byte Aptos account address which had to claim token

    • creator: MaybeHexString

      Hex-encoded 32 byte Aptos account address which created a token

    • collectionName: string

      Name of collection where token is strored

    • name: string

      Token name

    • property_version: number = 0

      the version of token PropertyMap with a default value 0.

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Claims a token on specified account

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount which will claim token

    • sender: MaybeHexString

      Hex-encoded 32 byte Aptos account address which holds a token

    • creator: MaybeHexString

      Hex-encoded 32 byte Aptos account address which created a token

    • collectionName: string

      Name of collection where token is stored

    • name: string

      Token name

    • property_version: number = 0

      the version of token PropertyMap with a default value 0.

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Creates a new NFT collection within the specified account

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount where collection will be created

    • name: string

      Collection name

    • description: string

      Collection description

    • uri: string

      URL to additional info about collection

    • maxAmount: AnyNumber = MAX_U64_BIG_INT

      Maximum number of token_data allowed within this collection

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Creates a new NFT within the specified account

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount where token will be created

    • collectionName: string

      Name of collection, that token belongs to

    • name: string

      Token name

    • description: string

      Token description

    • supply: number

      Token supply

    • uri: string

      URL to additional info about token

    • max: AnyNumber = MAX_U64_BIG_INT

      The maxium of tokens can be minted from this token

    • royalty_payee_address: MaybeHexString = ...

      the address to receive the royalty, the address can be a shared account address.

    • royalty_points_denominator: number = 0

      the denominator for calculating royalty

    • royalty_points_numerator: number = 0

      the numerator for calculating royalty

    • property_keys: string[] = []

      the property keys for storing on-chain properties

    • property_values: string[] = []

      the property values to be stored on-chain

    • property_types: string[] = []

      the type of property values

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Creates a new NFT within the specified account

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount where token will be created

    • collectionName: string

      Name of collection, that token belongs to

    • name: string

      Token name

    • description: string

      Token description

    • supply: AnyNumber

      Token supply

    • uri: string

      URL to additional info about token

    • max: AnyNumber = MAX_U64_BIG_INT

      The maxium of tokens can be minted from this token

    • royalty_payee_address: MaybeHexString = ...

      the address to receive the royalty, the address can be a shared account address.

    • royalty_points_denominator: AnyNumber = 0

      the denominator for calculating royalty

    • royalty_points_numerator: AnyNumber = 0

      the numerator for calculating royalty

    • property_keys: string[] = []

      the property keys for storing on-chain properties

    • property_values: Uint8Array[] = []

      the property values to be stored on-chain

    • property_types: string[] = []

      the type of property values

    • mutability_config: boolean[] = ...

      configs which field is mutable

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Directly transfer the specified amount of tokens from account to receiver using a single multi signature transaction.

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • sender: AptosAccount

      AptosAccount where token from which tokens will be transfered

    • receiver: AptosAccount

      Hex-encoded 32 byte Aptos account address to which tokens will be transfered

    • creator: MaybeHexString

      Hex-encoded 32 byte Aptos account address to which created tokens

    • collectionName: string

      Name of collection where token is stored

    • name: string

      Token name

    • amount: AnyNumber

      Amount of tokens which will be transfered

    • propertyVersion: AnyNumber = 0
    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Queries collection data

    Returns

    Collection data in below format

     Collection {
    // Describes the collection
    description: string,
    // Unique name within this creators account for this collection
    name: string,
    // URL for additional information/media
    uri: string,
    // Total number of distinct Tokens tracked by the collection
    count: number,
    // Optional maximum number of tokens allowed within this collections
    maximum: number
    }

    Parameters

    • creator: MaybeHexString

      Hex-encoded 32 byte Aptos account address which created a collection

    • collectionName: string

      Collection name

    Returns Promise<any>

  • Queries token data from collection

    Returns

    Token data in below format

    TokenData {
    // Unique name within this creators account for this Token's collection
    collection: string;
    // Describes this Token
    description: string;
    // The name of this Token
    name: string;
    // Optional maximum number of this type of Token.
    maximum: number;
    // Total number of this type of Token
    supply: number;
    /// URL for additional information / media
    uri: string;
    }

    Parameters

    • creator: MaybeHexString

      Hex-encoded 32 byte Aptos account address which created a token

    • collectionName: string

      Name of collection, which holds a token

    • tokenName: string

      Token name

    Returns Promise<TokenData>

  • Queries token balance for a token account

    Example

    {
    creator: '0x1',
    collection: 'Some collection',
    name: 'Awesome token'
    }

    Returns

    Token object in below format

    Token {
    id: TokenId;
    value: number;
    }

    Parameters

    • account: MaybeHexString

      Hex-encoded 32 byte Aptos account address which created a token

    • tokenId: TokenId

      token id

      TODO: Update this:

    Returns Promise<Token>

  • creator mutates the properties of the tokens

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount who modifies the token properties

    • tokenOwner: HexString

      the address of account owning the token

    • creator: HexString

      the creator of the token

    • collection_name: string

      the name of the token collection

    • tokenName: string

      the name of created token

    • propertyVersion: AnyNumber

      the property_version of the token to be modified

    • amount: AnyNumber

      the number of tokens to be modified

    • keys: string[]
    • values: Uint8Array[]
    • types: string[]
    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

  • Transfers specified amount of tokens from account to receiver

    Returns

    The hash of the transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount where token from which tokens will be transfered

    • receiver: MaybeHexString

      Hex-encoded 32 byte Aptos account address to which tokens will be transfered

    • creator: MaybeHexString

      Hex-encoded 32 byte Aptos account address to which created tokens

    • collectionName: string

      Name of collection where token is stored

    • name: string

      Token name

    • amount: number

      Amount of tokens which will be transfered

    • property_version: number = 0

      the version of token PropertyMap with a default value 0.

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

Generated using TypeDoc