WhiteSwap
  • About WhiteSwap
  • Protocol Overview
    • How WhiteSwap Works
    • Eсosystem Participants
    • Smart Contracts
    • Glossary
  • Core Concepts
    • Swaps
    • Pools
    • Flash Swaps
    • Oracles
    • Farming
    • WSD Staking
  • Advanced Topics
    • Fees
    • Pricing
    • Understanding Returns
    • Security
    • Research
  • Governance
    • Overview
    • Process
    • Glossary
  • Governance Token
    • Introducing WSD
    • Allocation & Vesting
    • Community Treasury
  • Developer Guides
    • Token Listing
    • Javascript SDK
      • SDK Quick Start
      • Fetching Data
      • Pricing
      • Trading
      • Pair Addresses
  • Reference
    • API
      • API Overview
      • Entities
      • Queries
    • SDK
      • Getting Started
      • Token
      • Pair
      • Route
      • Trade
      • Fractions
      • Fetcher
      • Other Exports
    • Smart Contracts
Powered by GitBook
On this page
  • Example
  • Properties
  • chainId
  • address
  • decimals
  • symbol
  • name
  • Methods
  • equals
  • sortsBefore

Was this helpful?

  1. Reference
  2. SDK

Token

PreviousGetting StartedNextPair

Last updated 4 years ago

Was this helpful?

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

The Token entity represents an ERC20 token at a specific address on a specific chain.

Example

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

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

Properties

chainId

chainId: ChainId

See .

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.

ChainId