Options
All
  • Public
  • Public/Protected
  • All
Menu

Provides an instance of the token registry contract. Allows querying of tokens that have been registered as valid tokens in the network.

remarks

This is our interface to the token registry contract.

Hierarchy

  • TokenRegistry

Index

Constructors

constructor

  • new TokenRegistry(contractAddress: string, signerAddress?: string): TokenRegistry
  • Create a connection to the deployed token registry contract.

    Parameters

    • contractAddress: string

      The deployed token registry contract's address.

    • Optional signerAddress: string

      The account address of the account that deployed the token registry contract.

    Returns TokenRegistry

Properties

contract

contract: any

The instance of the token registry contract.

contractAddress

contractAddress: string

The deployed token registry contract's address.

signerAddress

signerAddress: string

The account address of the account that deployed the token registry contract.

Methods

addressOf

  • addressOf(identifier: string): Promise<string>
  • Returns the address of the token with a given identifier.

    async
    example

    Prints the address of the token with the identifier 'sarafu':

    console.log(await addressOf('sarafu'));
    

    Parameters

    • identifier: string

      The name or identifier of the token to be fetched from the token registry.

    Returns Promise<string>

    The address of the token assigned the specified identifier in the token registry.

entry

  • entry(serial: number): Promise<string>
  • Returns the address of a token with the given serial in the token registry.

    async
    example

    Prints the address of the token with the serial '2':

    console.log(await entry(2));
    

    Parameters

    • serial: number

      The serial number of the token to be fetched.

    Returns Promise<string>

    The address of the token with the specified serial number.

totalTokens

  • totalTokens(): Promise<number>
  • Returns the total number of tokens that have been registered in the network.

    async
    example

    Prints the total number of registered tokens:

    console.log(await totalTokens());
    

    Returns Promise<number>

    The total number of registered tokens.

Generated using TypeDoc