Skip to main content

Class: ReadWriteEth

A base class for read-only models.

Hierarchy

Implements

Constructors

constructor

new ReadWriteEth(options): ReadWriteEth

Parameters

NameType
optionsReadWriteEthOptions

Returns

ReadWriteEth

Overrides

ReadEth.constructor

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadWriteEth.ts:12

Properties

address

address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"

Implementation of

ReadWriteToken.address

Inherited from

ReadEth.address

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadEth.ts:9


contractFactory

contractFactory: ReadWriteContractFactory

Implementation of

ReadWriteToken.contractFactory

Overrides

ReadEth.contractFactory

Defined in

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


name

name: string

Implementation of

ReadWriteToken.name

Inherited from

ReadEth.name

Defined in

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


network

network: Network

Implementation of

ReadWriteToken.network

Inherited from

ReadEth.network

Defined in

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


address

Static address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"

Inherited from

ReadEth.address

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadEth.ts:8

Methods

approve

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

This method is not available for the native ETH token.

Returns

Promise<`0x${string}`>

Throws

A MethodNotImplementedError

Implementation of

ReadWriteToken.approve

Defined in

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


getAllowance

getAllowance(): Promise<bigint>

Returns

Promise<bigint>

Remarks

Native ETH does not require allowances as it is sent directly as the message value when used in Hyperdrive. This method returns a maximum value to indicate the absence of an allowance mechanism for ETH.

Implementation of

ReadWriteToken.getAllowance

Inherited from

ReadEth.getAllowance

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadEth.ts:33


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>

Implementation of

ReadWriteToken.getBalanceOf

Inherited from

ReadEth.getBalanceOf

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadEth.ts:38


getDecimals

getDecimals(): Promise<number>

Get the number of decimal places this token uses.

Returns

Promise<number>

Implementation of

ReadWriteToken.getDecimals

Inherited from

ReadEth.getDecimals

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadEth.ts:23


getName

getName(): Promise<string>

Get the name of this token

Returns

Promise<string>

Implementation of

ReadWriteToken.getName

Inherited from

ReadEth.getName

Defined in

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


getSymbol

getSymbol(): Promise<string>

Get the symbol for this token.

Returns

Promise<string>

Implementation of

ReadWriteToken.getSymbol

Inherited from

ReadEth.getSymbol

Defined in

packages/hyperdrive-js-core/src/token/eth/ReadEth.ts:19