Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PeristentTokenRoyalty

Hierarchy

  • PeristentTokenRoyalty

Index

Constructors

Methods

Constructors

constructor

  • Parameters

    • prefix: string

      A prefix to use for every key of this map

    Returns PeristentTokenRoyalty

Methods

add

  • Add royalty details of a token

    Basic usage example:

    Assume we need add the royalty object TR1 to the token with the token id = jenny911038,

    const persistent_tokens_royalty = new PeristentTokenRoyalty('ptr');
    const token_royalty = persistent_tokens_royalty.add('jenny911038' , TR1 );
    

    Parameters

    • tokenId: TokenId

      Id of the token

    • tokenRoyalty: TokenRoyalty

      Royalty object of the token to be added

    Returns TokenRoyalty

    Saved royalty object of the token

get

  • Get token royalty for a given token ID

    Basic usage example:

    Assume we need to get the royalty of the token with token id = jenny911038,

    const persistent_tokens_royalty = new PeristentTokenRoyalty('ptr');
    const token_royalty = persistent_tokens_royalty.get("jenny911038");
    

    Parameters

    • token_id: TokenId

      ID of token to retrieve token royalty details

    Returns TokenRoyalty | null

    Token Royalty object if exists, otherwise null

Generated using TypeDoc