Token

The Token entity represents an ERC-20 token at a specific address on the Celo blockchain.

Constructor

constructor(chainId: ChainId, address: string, decimals: number, symbol?: string, name?: string)

Example

import { ChainId, Token } from '@tradegen/sdk'

const token = new Token(ChainId.MAINNET, '0x000000000000000000000000000000000000CE10', 18, 'CGLD', 'CELO 2')

Properties

  • chainId: The chain on which the token is stored (mainnet, Alfajores, Baklava)

  • address: The token's address

  • decimals: Number of decimals the token uses

  • symbol (optional): Symbol of the token

  • name (optional): Name of the token

Methods

equals

Checks if the current instance is equal to another (has an identical chainId and address).

equals(other: Token): boolean

Last updated