Skip to main content

assetBridger

Classes

abstract AssetBridger<DepositParams, WithdrawParams>

Base for bridging assets from parent-to-child and back

Extended by

Type parameters

Type parameter
DepositParams
WithdrawParams

Properties

PropertyModifierTypeDescription
nativeToken?readonlystringIn case of a chain that uses ETH as its native/gas token, this is either undefined or the zero address

In case of a chain that uses an ERC-20 token from the parent network as its native/gas token, this is the address of said token on the parent network

Accessors

nativeTokenIsEth
get protected nativeTokenIsEth(): boolean

Whether the chain uses ETH as its native/gas token

Returns

boolean

Source

assetBridger/assetBridger.ts:71

Methods

checkChildNetwork()
protected checkChildNetwork(sop: SignerOrProvider): Promise<void>

Check the signer/provider matches the child network, throws if not

Parameters
ParameterTypeDescription
sopSignerOrProvider
Returns

Promise<void>

Source

assetBridger/assetBridger.ts:60

checkParentNetwork()
protected checkParentNetwork(sop: SignerOrProvider): Promise<void>

Check the signer/provider matches the parent network, throws if not

Parameters
ParameterTypeDescription
sopSignerOrProvider
Returns

Promise<void>

Source

assetBridger/assetBridger.ts:49

deposit()
abstract deposit(params: DepositParams): Promise<ParentContractTransaction<ParentTransactionReceipt>>

Transfer assets from parent-to-child

Parameters
ParameterTypeDescription
paramsDepositParams
Returns

Promise<ParentContractTransaction<ParentTransactionReceipt>>

Source

assetBridger/assetBridger.ts:79

withdraw()
abstract withdraw(params: WithdrawParams): Promise<ChildContractTransaction>

Transfer assets from child-to-parent

Parameters
ParameterTypeDescription
paramsWithdrawParams
Returns

Promise<ChildContractTransaction>

Source

assetBridger/assetBridger.ts:87