Class: EthWrapper
"EthWrapper".EthWrapper
The class EthWrapper contains all methods for depositing, withdrawing and transferring wrapped ETH.
#
Hierarchy- EthWrapper
#
Constructors#
constructor+ new EthWrapper(params
: { provider: TLProvider ; transaction: Transaction ; user: User }): EthWrapper
Defined in src/EthWrapper.ts:27
#
Parameters:Name | Type |
---|---|
params | { provider: TLProvider ; transaction: Transaction ; user: User } |
Returns: EthWrapper
#
Methods#
confirmâ–¸ confirm(rawTx
: RawTxObject): Promise<string>
Defined in src/EthWrapper.ts:161
Signs a raw transaction object as returned by prepTransfer
, prepDeposit
or prepWithdraw
and sends the signed transaction.
#
Parameters:Name | Type | Description |
---|---|---|
rawTx | RawTxObject | Raw transaction object. |
Returns: Promise<string>
#
getAddressesâ–¸ getAddresses(): Promise<string[]>
Defined in src/EthWrapper.ts:42
Returns all known ETH wrapper contract addresses from the relay server.
Returns: Promise<string[]>
#
getBalanceâ–¸ getBalance(ethWrapperAddress
: string): Promise<Amount>
Defined in src/EthWrapper.ts:50
Returns the amount of already wrapped ETH on the given ETH wrapper contract.
#
Parameters:Name | Type | Description |
---|---|---|
ethWrapperAddress | string | Address of ETH wrapper contract. |
Returns: Promise<Amount>
#
getLogsâ–¸ getLogs(ethWrapperAddress
: string, filter?
: EventFilterOptions): Promise<AnyTokenEvent[]>
Defined in src/EthWrapper.ts:172
Returns event logs of the ETH wrapper contract for the loaded user.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
ethWrapperAddress | string | - | Address of the ETH wrapper contract. |
filter | EventFilterOptions | {} | Event filter object. See EventFilterOptions for more information. |
Returns: Promise<AnyTokenEvent[]>
#
prepDepositâ–¸ prepDeposit(ethWrapperAddress
: string, value
: number | string, options?
: TxOptions): Promise<TxObject>
Defined in src/EthWrapper.ts:101
Prepares an ethereum transaction object for depositing/wrapping ETH.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
ethWrapperAddress | string | - | Address of ETH wrapper contract. |
value | number | string | - | Amount of ETH to deposit/wrap. |
options | TxOptions | {} | Transaction options. See TxOptions for more information. |
Returns: Promise<TxObject>
#
prepTransferâ–¸ prepTransfer(ethWrapperAddress
: string, receiverAddress
: string, value
: number | string, options?
: TxOptions): Promise<TxObject>
Defined in src/EthWrapper.ts:66
Prepares an ethereum transaction object for transferring wrapped ETH where the loaded user is the sender.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
ethWrapperAddress | string | - | Address of ETH wrapper contract. |
receiverAddress | string | - | Address of receiver of transfer. |
value | number | string | - | Amount of wrapped ETH to transfer. |
options | TxOptions | {} | Transaction options. See TxOptions for more information. |
Returns: Promise<TxObject>
#
prepWithdrawâ–¸ prepWithdraw(ethWrapperAddress
: string, value
: number | string, options?
: TxOptions): Promise<TxObject>
Defined in src/EthWrapper.ts:133
Prepares an ethereum transaction object for withdrawing/unwrapping ETH.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
ethWrapperAddress | string | - | Address of ETH wrapper contract. |
value | number | string | - | Amount of ETH to withdraw/unwrap. |
options | TxOptions | {} | Transaction options. See TxOptions for more information. |
Returns: Promise<TxObject>