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

### Properties

- contract
- contractAddress
- signerAddress

### Methods

- addressOf
- entry
- totalTokens

## Constructors

### constructor

- new TokenRegistry(contractAddress: string, signerAddress?: string): TokenRegistry

- - Defined in src/app/_eth/token-registry.ts:26

  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

- Defined in src/app/_eth/token-registry.ts:22

The instance of the token registry contract.

### contractAddress

contractAddress: string

- Defined in src/app/_eth/token-registry.ts:24

The deployed token registry contract's address.

### signerAddress

signerAddress: string

- Defined in src/app/_eth/token-registry.ts:26

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

## Methods

### addressOf

- addressOf(identifier: string): Promise<string>

- - Defined in src/app/_eth/token-registry.ts:57

  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>

- - Defined in src/app/_eth/token-registry.ts:75

  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>

- - Defined in src/app/_eth/token-registry.ts:91

  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