Class: ReadWriteErc20
A base class for read-only models.
Hierarchy
-
↳
ReadWriteErc20
Implements
Constructors
constructor
• new ReadWriteErc20(options
): ReadWriteErc20
Parameters
Name | Type |
---|---|
options | ReadWriteErc20Options |
Returns
Overrides
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"
}]>
Overrides
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:15
contractFactory
• contractFactory: ReadWriteContractFactory
Implementation of
ReadWriteToken.contractFactory
Overrides
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:16
name
• name: string
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/model/ReadModel.ts:27
network
• network: Network
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/model/ReadModel.ts:28
Accessors
address
• get
address(): `0x${string}`
Returns
`0x${string}`
Implementation of
Inherited from
ReadErc20.address
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:28
namespace
• get
namespace(): undefined
| string
Returns
undefined
| string
Inherited from
ReadErc20.namespace
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:31
Methods
approve
▸ approve(«destructured»
): Promise
<`0x${string}`>
Give a spending allowance to a given spender.
Parameters
Name | Type |
---|---|
«destructured» | Object |
› amount | bigint |
› options? | ContractWriteOptions |
› owner? | `0x${string}` |
› spender | `0x${string}` |
Returns
Promise
<`0x${string}`>
The transaction hash.
Implementation of
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadWriteErc20.ts:25
getAllowance
▸ getAllowance(«destructured»
): Promise
<bigint
>
Get the spending allowance of a given spender for a given owner of this token.
Parameters
Name | Type |
---|---|
«destructured» | Object |
› options? | ContractReadOptions |
› owner | `0x${string}` |
› spender | `0x${string}` |
Returns
Promise
<bigint
>
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:47
getBalanceOf
▸ getBalanceOf(«destructured»
): Promise
<bigint
>
Get the token balance of a given address
Parameters
Name | Type |
---|---|
«destructured» | Object |
› account | `0x${string}` |
› options? | ContractReadOptions |
Returns
Promise
<bigint
>
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:59
getDecimals
▸ getDecimals(): Promise
<number
>
Get the number of decimal places this token uses.
Returns
Promise
<number
>
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:43
getName
▸ getName(): Promise
<string
>
Get the name of this token
Returns
Promise
<string
>
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:35
getSymbol
▸ getSymbol(): Promise
<string
>
Get the symbol for this token.
Returns
Promise
<string
>
Implementation of
Inherited from
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:39
getTotalSupply
▸ getTotalSupply(options?
): Promise
<bigint
>
Get the total supply of the token.
Parameters
Name | Type |
---|---|
options? | ContractReadOptions |
Returns
Promise
<bigint
>
Inherited from
Defined in
packages/hyperdrive-js-core/src/token/erc20/ReadErc20.ts:72