Skip to main content

Interface: ReadWriteToken

A base class for read-only models.

Hierarchy

Implemented by

Properties

address

address: `0x${string}`

Inherited from

ReadToken.address

Defined in

packages/hyperdrive-js-core/src/token/ReadToken.ts:5


contractFactory

contractFactory: ReadWriteContractFactory

Overrides

ReadWriteModel.contractFactory

Defined in

packages/hyperdrive-js-core/src/token/ReadWriteToken.ts:7


name

name: string

Inherited from

ReadWriteModel.name

Defined in

packages/hyperdrive-js-core/src/model/ReadModel.ts:27


network

network: Network

Inherited from

ReadWriteModel.network

Defined in

packages/hyperdrive-js-core/src/model/ReadModel.ts:28

Methods

approve

approve(«destructured»): Promise<`0x${string}`>

Give a spending allowance to a given spender.

Parameters

NameType
«destructured»Object
› amountbigint
› options?ContractWriteOptions
› owner?`0x${string}`
› spender`0x${string}`

Returns

Promise<`0x${string}`>

The transaction hash.

Defined in

packages/hyperdrive-js-core/src/token/ReadWriteToken.ts:15


getAllowance

getAllowance(«destructured»): Promise<bigint>

Get the spending allowance of a given spender for a given owner of this token.

Parameters

NameType
«destructured»Object
› options?ContractReadOptions
› owner`0x${string}`
› spender`0x${string}`

Returns

Promise<bigint>

Inherited from

ReadToken.getAllowance

Defined in

packages/hyperdrive-js-core/src/token/ReadToken.ts:26


getBalanceOf

getBalanceOf(«destructured»): Promise<bigint>

Get the token balance of a given address

Parameters

NameType
«destructured»Object
› account`0x${string}`
› options?ContractReadOptions

Returns

Promise<bigint>

Inherited from

ReadToken.getBalanceOf

Defined in

packages/hyperdrive-js-core/src/token/ReadToken.ts:39


getDecimals

getDecimals(): Promise<number>

Get the number of decimal places this token uses.

Returns

Promise<number>

Inherited from

ReadToken.getDecimals

Defined in

packages/hyperdrive-js-core/src/token/ReadToken.ts:20


getName

getName(): Promise<string>

Get the name of this token

Returns

Promise<string>

Inherited from

ReadToken.getName

Defined in

packages/hyperdrive-js-core/src/token/ReadToken.ts:10


getSymbol

getSymbol(): Promise<string>

Get the symbol for this token.

Returns

Promise<string>

Inherited from

ReadToken.getSymbol

Defined in

packages/hyperdrive-js-core/src/token/ReadToken.ts:15