Version: 0.17.1

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:#

NameType
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:#

NameTypeDescription
rawTxRawTxObjectRaw 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:#

NameTypeDescription
ethWrapperAddressstringAddress 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:#

NameTypeDefault valueDescription
ethWrapperAddressstring-Address of the ETH wrapper contract.
filterEventFilterOptions{}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:#

NameTypeDefault valueDescription
ethWrapperAddressstring-Address of ETH wrapper contract.
valuenumber | string-Amount of ETH to deposit/wrap.
optionsTxOptions{}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:#

NameTypeDefault valueDescription
ethWrapperAddressstring-Address of ETH wrapper contract.
receiverAddressstring-Address of receiver of transfer.
valuenumber | string-Amount of wrapped ETH to transfer.
optionsTxOptions{}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:#

NameTypeDefault valueDescription
ethWrapperAddressstring-Address of ETH wrapper contract.
valuenumber | string-Amount of ETH to withdraw/unwrap.
optionsTxOptions{}Transaction options. See TxOptions for more information.

Returns: Promise<TxObject>