Skip to main content

Class: ReadErc4626

Hierarchy

  • ReadErc4626Mixin & ReadErc20<this>

    ReadErc4626

Constructors

constructor

new ReadErc4626(«destructured»): ReadErc4626

Parameters

NameType
«destructured»ReadErc20Options

Returns

ReadErc4626

Inherited from

readErc4626Mixin(ReadErc20).constructor

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:11

Properties

contract

contract: CachedReadContract<readonly [{ inputs: readonly [{ internalType: "address" ; name: "owner" ; type: "address" }, { internalType: "address" ; name: "spender" ; type: "address" }] ; name: "allowance" ; outputs: readonly [{ internalType: "uint256" ; name: "" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "spender" ; type: "address" }, { internalType: "uint256" ; name: "amount" ; type: "uint256" }] ; name: "approve" ; outputs: readonly [{ internalType: "bool" ; name: "" ; type: "bool" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "account" ; type: "address" }] ; name: "balanceOf" ; outputs: readonly [{ internalType: "uint256" ; name: "" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "decimals" ; outputs: readonly [{ internalType: "uint8" ; name: "" ; type: "uint8" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "name" ; outputs: readonly [{ internalType: "string" ; name: "" ; type: "string" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "symbol" ; outputs: readonly [{ internalType: "string" ; name: "" ; type: "string" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "totalSupply" ; outputs: readonly [{ internalType: "uint256" ; name: "" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "to" ; type: "address" }, { internalType: "uint256" ; name: "amount" ; type: "uint256" }] ; name: "transfer" ; outputs: readonly [{ internalType: "bool" ; name: "" ; type: "bool" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "from" ; type: "address" }, { internalType: "address" ; name: "to" ; type: "address" }, { internalType: "uint256" ; name: "amount" ; type: "uint256" }] ; name: "transferFrom" ; outputs: readonly [{ internalType: "bool" ; name: "" ; type: "bool" }] ; stateMutability: "nonpayable" ; type: "function" }, { anonymous: false ; inputs: readonly [{ indexed: true ; internalType: "address" ; name: "owner" ; type: "address" }, { indexed: true ; internalType: "address" ; name: "spender" ; type: "address" }, { indexed: false ; internalType: "uint256" ; name: "value" ; type: "uint256" }] ; name: "Approval" ; type: "event" }, { anonymous: false ; inputs: readonly [{ indexed: true ; internalType: "address" ; name: "from" ; type: "address" }, { indexed: true ; internalType: "address" ; name: "to" ; type: "address" }, { indexed: false ; internalType: "uint256" ; name: "value" ; type: "uint256" }] ; name: "Transfer" ; type: "event" }]>

Inherited from

readErc4626Mixin(ReadErc20).contract

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:9


contractFactory

contractFactory: ReadContractFactory

Inherited from

readErc4626Mixin(ReadErc20).contractFactory

Defined in

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


erc4626Contract

erc4626Contract: CachedReadContract<readonly [{ inputs: readonly [{ internalType: "address" ; name: "owner" ; type: "address" }, { internalType: "address" ; name: "spender" ; type: "address" }] ; name: "allowance" ; outputs: readonly [{ internalType: "uint256" ; name: "" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "spender" ; type: "address" }, { internalType: "uint256" ; name: "amount" ; type: "uint256" }] ; name: "approve" ; outputs: readonly [{ internalType: "bool" ; name: "" ; type: "bool" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [] ; name: "asset" ; outputs: readonly [{ internalType: "address" ; name: "asset" ; type: "address" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "account" ; type: "address" }] ; name: "balanceOf" ; outputs: readonly [{ internalType: "uint256" ; name: "" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; name: "convertToAssets" ; outputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; name: "convertToShares" ; outputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "decimals" ; outputs: readonly [{ internalType: "uint8" ; name: "" ; type: "uint8" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }, { internalType: "address" ; name: "receiver" ; type: "address" }] ; name: "deposit" ; outputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "owner" ; type: "address" }] ; name: "maxDeposit" ; outputs: readonly [{ internalType: "uint256" ; name: "maxAssets" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "owner" ; type: "address" }] ; name: "maxMint" ; outputs: readonly [{ internalType: "uint256" ; name: "maxShares" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "owner" ; type: "address" }] ; name: "maxRedeem" ; outputs: readonly [{ internalType: "uint256" ; name: "maxShares" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "owner" ; type: "address" }] ; name: "maxWithdraw" ; outputs: readonly [{ internalType: "uint256" ; name: "maxAssets" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }, { internalType: "address" ; name: "receiver" ; type: "address" }] ; name: "mint" ; outputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [] ; name: "name" ; outputs: readonly [{ internalType: "string" ; name: "" ; type: "string" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; name: "previewDeposit" ; outputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; name: "previewMint" ; outputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; name: "previewRedeem" ; outputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; name: "previewWithdraw" ; outputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }, { internalType: "address" ; name: "receiver" ; type: "address" }, { internalType: "address" ; name: "owner" ; type: "address" }] ; name: "redeem" ; outputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [] ; name: "symbol" ; outputs: readonly [{ internalType: "string" ; name: "" ; type: "string" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "totalAssets" ; outputs: readonly [{ internalType: "uint256" ; name: "totalAssets" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [] ; name: "totalSupply" ; outputs: readonly [{ internalType: "uint256" ; name: "" ; type: "uint256" }] ; stateMutability: "view" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "to" ; type: "address" }, { internalType: "uint256" ; name: "amount" ; type: "uint256" }] ; name: "transfer" ; outputs: readonly [{ internalType: "bool" ; name: "" ; type: "bool" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [{ internalType: "address" ; name: "from" ; type: "address" }, { internalType: "address" ; name: "to" ; type: "address" }, { internalType: "uint256" ; name: "amount" ; type: "uint256" }] ; name: "transferFrom" ; outputs: readonly [{ internalType: "bool" ; name: "" ; type: "bool" }] ; stateMutability: "nonpayable" ; type: "function" }, { inputs: readonly [{ internalType: "uint256" ; name: "assets" ; type: "uint256" }, { internalType: "address" ; name: "receiver" ; type: "address" }, { internalType: "address" ; name: "owner" ; type: "address" }] ; name: "withdraw" ; outputs: readonly [{ internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; stateMutability: "nonpayable" ; type: "function" }, { anonymous: false ; inputs: readonly [{ indexed: true ; internalType: "address" ; name: "owner" ; type: "address" }, { indexed: true ; internalType: "address" ; name: "spender" ; type: "address" }, { indexed: false ; internalType: "uint256" ; name: "value" ; type: "uint256" }] ; name: "Approval" ; type: "event" }, { anonymous: false ; inputs: readonly [{ indexed: true ; internalType: "address" ; name: "sender" ; type: "address" }, { indexed: true ; internalType: "address" ; name: "receiver" ; type: "address" }, { indexed: false ; internalType: "uint256" ; name: "assets" ; type: "uint256" }, { indexed: false ; internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; name: "Deposit" ; type: "event" }, { anonymous: false ; inputs: readonly [{ indexed: true ; internalType: "address" ; name: "from" ; type: "address" }, { indexed: true ; internalType: "address" ; name: "to" ; type: "address" }, { indexed: false ; internalType: "uint256" ; name: "value" ; type: "uint256" }] ; name: "Transfer" ; type: "event" }, { anonymous: false ; inputs: readonly [{ indexed: true ; internalType: "address" ; name: "sender" ; type: "address" }, { indexed: true ; internalType: "address" ; name: "receiver" ; type: "address" }, { indexed: false ; internalType: "uint256" ; name: "assets" ; type: "uint256" }, { indexed: false ; internalType: "uint256" ; name: "shares" ; type: "uint256" }] ; name: "Withdraw" ; type: "event" }]>

Inherited from

readErc4626Mixin(ReadErc20).erc4626Contract

Defined in

packages/hyperdrive-js-core/src/token/erc4626/ReadErc4626.ts:12


name

name: string

Inherited from

readErc4626Mixin(ReadErc20).name

Defined in

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


network

network: Network

Inherited from

readErc4626Mixin(ReadErc20).network

Defined in

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

Accessors

address

get address(): `0x${string}`

Returns

`0x${string}`

Inherited from

readErc4626Mixin(ReadErc20).address

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:28


namespace

get namespace(): undefined | string

Returns

undefined | string

Inherited from

readErc4626Mixin(ReadErc20).namespace

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:31

Methods

convertToAssets

convertToAssets(«destructured»): Promise<bigint>

Convert a shares amount to an assets amount.

Parameters

NameType
«destructured»Object
› options?ContractReadOptions
› sharesAmountbigint

Returns

Promise<bigint>

Inherited from

readErc4626Mixin(ReadErc20).convertToAssets

Defined in

packages/hyperdrive-js-core/src/token/erc4626/ReadErc4626.ts:22


convertToShares

convertToShares(«destructured»): Promise<bigint>

Convert an assets amount to a shares amount.

Parameters

NameType
«destructured»Object
› assetsAmountbigint
› options?ContractReadOptions

Returns

Promise<bigint>

Inherited from

readErc4626Mixin(ReadErc20).convertToShares

Defined in

packages/hyperdrive-js-core/src/token/erc4626/ReadErc4626.ts:33


getAllowance

getAllowance(«destructured»): Promise<bigint>

Parameters

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

Returns

Promise<bigint>

Inherited from

readErc4626Mixin(ReadErc20).getAllowance

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:47


getBalanceOf

getBalanceOf(«destructured»): Promise<bigint>

Parameters

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

Returns

Promise<bigint>

Inherited from

readErc4626Mixin(ReadErc20).getBalanceOf

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:59


getDecimals

getDecimals(): Promise<number>

Returns

Promise<number>

Inherited from

readErc4626Mixin(ReadErc20).getDecimals

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:43


getName

getName(): Promise<string>

Returns

Promise<string>

Inherited from

readErc4626Mixin(ReadErc20).getName

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:35


getSymbol

getSymbol(): Promise<string>

Returns

Promise<string>

Inherited from

readErc4626Mixin(ReadErc20).getSymbol

Defined in

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


getTotalAssets

getTotalAssets(options?): Promise<bigint>

Get the total supply of assets in the vault.

Parameters

NameType
options?ContractReadOptions

Returns

Promise<bigint>

Inherited from

readErc4626Mixin(ReadErc20).getTotalAssets

Defined in

packages/hyperdrive-js-core/src/token/erc4626/ReadErc4626.ts:17


getTotalSupply

getTotalSupply(options?): Promise<bigint>

Get the total supply of the token.

Parameters

NameType
options?ContractReadOptions

Returns

Promise<bigint>

Inherited from

readErc4626Mixin(ReadErc20).getTotalSupply

Defined in

packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:72