Skip to content

Latest commit

 

History

History
67 lines (43 loc) · 1.04 KB

token.md

File metadata and controls

67 lines (43 loc) · 1.04 KB

Token

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

The Token entity represents an ERC-20 token at a specific address on a specific chain.

Example

import { ChainId, Token } from '10k_swap-sdk'

const token = new Token(ChainId.MAINNET, '0x0000000000000000000000000000000000000000000000000000000000000001', 18, 'HOT', 'Caffeine')

Properties

chainId

chainId: ChainId

See ChainId

address

address: string

decimals

decimals: number

symbol

symbol?: string

name

name?: string

Methods

equals

equals(other: Token): boolean

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

sortsBefore

sortsBefore(other: Token): boolean

Checks if the current instance sorts before another, by address.