Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PersistentTokens

Index

Constructors

constructor

  • Parameters

    • prefix: string

      A prefix to use for every key of this map

    Returns PersistentTokens

Accessors

number_of_tokens

  • get number_of_tokens(): u128
  • Number of tokens stored in the contract. TODO not sure _tmap.lenght can represent up to u128 values

    Returns u128

Methods

add

  • add(tokenId: TokenId, token: Token, accountId: AccountId): Token
  • Parameters

    • tokenId: TokenId

      Id of new token

    • token: Token

      Token to be added

    • accountId: AccountId

      Owner of the token

    Returns Token

    added token

burn

  • burn(tokenId: TokenId, accountId: AccountId): void
  • Burn a token

    Parameters

    • tokenId: TokenId
    • accountId: AccountId

    Returns void

get

  • get(token_id: TokenId): Token
  • Parameters

    • token_id: TokenId

      ID of token to retrieve from _map

    Returns Token

has

  • has(token_id: TokenId): bool
  • Parameters

    • token_id: TokenId

      ID of token to check if exists

    Returns bool

keys

  • keys(start: i32, end: i32): TokenId[]
  • Parameters

    • start: i32
    • end: i32

    Returns TokenId[]

    an array of tokenId

remove

  • remove(tokenId: TokenId, accountId: AccountId): void
  • Remove a token from a user's token set.

    Parameters

    • tokenId: TokenId
    • accountId: AccountId

    Returns void

supply_for_owner

  • supply_for_owner(accountId: AccountId): string
  • Parameters

    • accountId: AccountId

      ID of account to retrieve supply

    Returns string

    string token supply of AccountId

tokens_for_owner

  • tokens_for_owner(accountId: AccountId): TokenId[]
  • Parameters

    • accountId: AccountId

      ID of account to retrieve tokens for

    Returns TokenId[]

    an array of tokenId for owner

Generated using TypeDoc