# Token

```
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 <a href="#example" id="example"></a>

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

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

## Properties <a href="#properties" id="properties"></a>

### chainId <a href="#chainid" id="chainid"></a>

```
chainId: ChainId
```

See [ChainId](/reference/sdk/other-exports.md#chainid).

### address <a href="#address" id="address"></a>

```
address: string
```

### decimals <a href="#decimals" id="decimals"></a>

```
decimals: number
```

### symbol <a href="#symbol" id="symbol"></a>

```
symbol?: string
```

### name <a href="#name" id="name"></a>

```
name?: string
```

## Methods <a href="#methods" id="methods"></a>

### equals <a href="#equals" id="equals"></a>

```
equals(other: Token): boolean
```

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

### sortsBefore <a href="#sortsbefore" id="sortsbefore"></a>

```
sortsBefore(other: Token): boolean
```

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ws.exchange/reference/sdk/token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
