Class: ReadWriteErc4626
Hierarchy
-
ReadErc4626Mixin
&ReadWriteErc20
<this
>↳
ReadWriteErc4626
Constructors
constructor
• new ReadWriteErc4626(options
): ReadWriteErc4626
Parameters
Name | Type |
---|---|
options | ReadWriteErc20Options |
Returns
Inherited from
readErc4626Mixin(ReadWriteErc20).constructor
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:18
Properties
contract
• contract: CachedReadWriteContract
<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(ReadWriteErc20).contract
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:15
contractFactory
• contractFactory: ReadWriteContractFactory
Inherited from
readErc4626Mixin(ReadWriteErc20).contractFactory
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:16
erc4626Contract
• erc4626Contract: CachedReadWriteContract
<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"
}]>
Overrides
readErc4626Mixin(ReadWriteErc20).erc4626Contract
Defined in
packages/hyperdrive-js-core/src/token/erc4626/ReadWriteErc4626.ts:7
name
• name: string
Inherited from
readErc4626Mixin(ReadWriteErc20).name
Defined in
packages/hyperdrive-js-core/src/model/ReadModel.ts:27
network
• network: Network
Inherited from
readErc4626Mixin(ReadWriteErc20).network
Defined in
packages/hyperdrive-js-core/src/model/ReadModel.ts:28
Accessors
address
• get
address(): `0x${string}`
Returns
`0x${string}`
Inherited from
readErc4626Mixin(ReadWriteErc20).address
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:28
namespace
• get
namespace(): undefined
| string
Returns
undefined
| string
Inherited from
readErc4626Mixin(ReadWriteErc20).namespace
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:31
Methods
approve
▸ approve(«destructured»
): Promise
<`0x${string}`>
Parameters
Name | Type |
---|---|
«destructured» | Object |
› amount | bigint |
› options? | ContractWriteOptions |
› owner? | `0x${string}` |
› spender | `0x${string}` |
Returns
Promise
<`0x${string}`>
Inherited from
readErc4626Mixin(ReadWriteErc20).approve
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:25
convertToAssets
▸ convertToAssets(«destructured»
): Promise
<bigint
>
Convert a shares amount to an assets amount.
Parameters
Name | Type |
---|---|
«destructured» | Object |
› options? | ContractReadOptions |
› sharesAmount | bigint |
Returns
Promise
<bigint
>
Inherited from
readErc4626Mixin(ReadWriteErc20).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
Name | Type |
---|---|
«destructured» | Object |
› assetsAmount | bigint |
› options? | ContractReadOptions |
Returns
Promise
<bigint
>
Inherited from
readErc4626Mixin(ReadWriteErc20).convertToShares
Defined in
packages/hyperdrive-js-core/src/token/erc4626/ReadErc4626.ts:33
getAllowance
▸ getAllowance(«destructured»
): Promise
<bigint
>
Parameters
Name | Type |
---|---|
«destructured» | Object |
› options? | ContractReadOptions |
› owner | `0x${string}` |
› spender | `0x${string}` |
Returns
Promise
<bigint
>
Inherited from
readErc4626Mixin(ReadWriteErc20).getAllowance
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:47
getBalanceOf
▸ getBalanceOf(«destructured»
): Promise
<bigint
>
Parameters
Name | Type |
---|---|
«destructured» | Object |
› account | `0x${string}` |
› options? | ContractReadOptions |
Returns
Promise
<bigint
>
Inherited from
readErc4626Mixin(ReadWriteErc20).getBalanceOf
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:59
getDecimals
▸ getDecimals(): Promise
<number
>
Returns
Promise
<number
>
Inherited from
readErc4626Mixin(ReadWriteErc20).getDecimals
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:43
getName
▸ getName(): Promise
<string
>
Returns
Promise
<string
>
Inherited from
readErc4626Mixin(ReadWriteErc20).getName
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:35
getSymbol
▸ getSymbol(): Promise
<string
>
Returns
Promise
<string
>
Inherited from
readErc4626Mixin(ReadWriteErc20).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
Name | Type |
---|---|
options? | ContractReadOptions |
Returns
Promise
<bigint
>
Inherited from
readErc4626Mixin(ReadWriteErc20).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
Name | Type |
---|---|
options? | ContractReadOptions |
Returns
Promise
<bigint
>
Inherited from
readErc4626Mixin(ReadWriteErc20).getTotalSupply
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:72