[@node-fi/sdk-core](../README.md) / [Exports](../modules.md) / PricedToken

# Class: PricedToken

A wrapper around the base token, gives access to the current price of the token

## Hierarchy

- [`Token`](Token.md)

  ↳ **`PricedToken`**

## Table of contents

### Constructors

- [constructor](PricedToken.md#constructor)

### Properties

- [address](PricedToken.md#address)
- [chainId](PricedToken.md#chainid)
- [decimals](PricedToken.md#decimals)
- [imageUri](PricedToken.md#imageuri)
- [name](PricedToken.md#name)
- [price](PricedToken.md#price)
- [symbol](PricedToken.md#symbol)

### Methods

- [equals](PricedToken.md#equals)
- [loadDetails](PricedToken.md#loaddetails)
- [send](PricedToken.md#send)
- [sortsBefore](PricedToken.md#sortsbefore)
- [toJSON](PricedToken.md#tojson)
- [isSerializedToken](PricedToken.md#isserializedtoken)
- [parseJson](PricedToken.md#parsejson)

## Constructors

### constructor

• **new PricedToken**(`chainId`, `address`, `decimals`, `price`, `symbol?`, `name?`)

#### Parameters

| Name | Type |
| :------ | :------ |
| `chainId` | [`ChainId`](../enums/ChainId.md) |
| `address` | `string` |
| `decimals` | `number` |
| `price` | `number` |
| `symbol?` | `string` |
| `name?` | `string` |

#### Overrides

[Token](Token.md).[constructor](Token.md#constructor)

#### Defined in

[Tokens/PricedToken.ts:11](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/PricedToken.ts#L11)

## Properties

### address

• `Readonly` **address**: `string`

#### Inherited from

[Token](Token.md).[address](Token.md#address)

#### Defined in

[Tokens/Token.ts:38](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L38)

___

### chainId

• `Readonly` **chainId**: [`ChainId`](../enums/ChainId.md)

#### Inherited from

[Token](Token.md).[chainId](Token.md#chainid)

#### Defined in

[Tokens/Token.ts:37](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L37)

___

### decimals

• **decimals**: `number`

#### Inherited from

[Token](Token.md).[decimals](Token.md#decimals)

#### Defined in

[Tokens/Token.ts:30](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L30)

___

### imageUri

• `Optional` **imageUri**: `string`

#### Inherited from

[Token](Token.md).[imageUri](Token.md#imageuri)

#### Defined in

[Tokens/Token.ts:33](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L33)

___

### name

• `Optional` **name**: `string`

#### Inherited from

[Token](Token.md).[name](Token.md#name)

#### Defined in

[Tokens/Token.ts:32](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L32)

___

### price

• **price**: `number`

#### Defined in

[Tokens/PricedToken.ts:9](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/PricedToken.ts#L9)

___

### symbol

• `Optional` **symbol**: `string`

#### Inherited from

[Token](Token.md).[symbol](Token.md#symbol)

#### Defined in

[Tokens/Token.ts:31](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L31)

## Methods

### equals

▸ **equals**(`other`): `boolean`

Returns true if the two tokens are equivalent, i.e. have the same chainId and address.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `other` | [`Token`](Token.md) | other token to compare |

#### Returns

`boolean`

#### Inherited from

[Token](Token.md).[equals](Token.md#equals)

#### Defined in

[Tokens/Token.ts:140](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L140)

___

### loadDetails

▸ **loadDetails**(): `Promise`<`void`\>

#### Returns

`Promise`<`void`\>

#### Inherited from

[Token](Token.md).[loadDetails](Token.md#loaddetails)

#### Defined in

[Tokens/Token.ts:62](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L62)

___

### send

▸ **send**(`amount`, `from`, `to`, `opt?`): `Promise`<`TransactionReceipt`\>

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `amount` | `BigNumber` | amount, in wei, of the token to send |
| `from` | [`Wallet`](Wallet.md) | the wallet where the tokens will be sent from |
| `to` | `string` | the address of the recipient of the tokens |
| `opt?` | [`TransactionOptions`](../interfaces/TransactionOptions.md) | - |

#### Returns

`Promise`<`TransactionReceipt`\>

transaction receipt of the transfer

#### Inherited from

[Token](Token.md).[send](Token.md#send)

#### Defined in

[Tokens/Token.ts:117](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L117)

___

### sortsBefore

▸ **sortsBefore**(`other`): `boolean`

Returns true if the address of this token sorts before the address of the other token

**`Throws`**

if the tokens have the same address

**`Throws`**

if the tokens are on different chains

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `other` | [`Token`](Token.md) | other token to compare |

#### Returns

`boolean`

#### Inherited from

[Token](Token.md).[sortsBefore](Token.md#sortsbefore)

#### Defined in

[Tokens/Token.ts:154](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L154)

___

### toJSON

▸ **toJSON**(): `Object`

#### Returns

`Object`

| Name | Type |
| :------ | :------ |
| `_type` | `string` |
| `address` | `string` |
| `chainId` | [`ChainId`](../enums/ChainId.md) |
| `decimals` | `number` |
| `imageUri` | `undefined` \| `string` |
| `name` | `undefined` \| `string` |
| `symbol` | `undefined` \| `string` |

#### Inherited from

[Token](Token.md).[toJSON](Token.md#tojson)

#### Defined in

[Tokens/Token.ts:87](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L87)

___

### isSerializedToken

▸ `Static` **isSerializedToken**(`obj?`): obj is SerializedToken

#### Parameters

| Name | Type |
| :------ | :------ |
| `obj?` | `Record`<`string`, `any`\> |

#### Returns

obj is SerializedToken

#### Inherited from

[Token](Token.md).[isSerializedToken](Token.md#isserializedtoken)

#### Defined in

[Tokens/Token.ts:73](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L73)

___

### parseJson

▸ `Static` **parseJson**(`__namedParameters`): [`Token`](Token.md)

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `SerializedToken` |

#### Returns

[`Token`](Token.md)

#### Inherited from

[Token](Token.md).[parseJson](Token.md#parsejson)

#### Defined in

[Tokens/Token.ts:77](https://github.com/Node-Fi/SDK-Core/blob/1f4f819/src/Tokens/Token.ts#L77)
