Skip to main content

ethBridger

Classes

EthBridger

Bridger for moving ETH back and forth between L1 to L2

Extends

  • AssetBridger<EthDepositParams | EthDepositToParams | L1ToL2TxReqAndSigner, EthWithdrawParams | L2ToL1TxReqAndSigner>

Methods

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

Check the signer/provider matches the l1Network, throws if not

Parameters
ParameterTypeDescription
sopSignerOrProvider
Returns

Promise<void>

Inherited from

AssetBridger . checkL1Network

Source

assetBridger/assetBridger.ts:48

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

Check the signer/provider matches the l2Network, throws if not

Parameters
ParameterTypeDescription
sopSignerOrProvider
Returns

Promise<void>

Inherited from

AssetBridger . checkL2Network

Source

assetBridger/assetBridger.ts:56

deposit()
deposit(params: EthDepositParams | L1ToL2TxReqAndSigner): Promise<L1EthDepositTransaction>

Deposit ETH from L1 onto L2

Parameters
ParameterTypeDescription
paramsEthDepositParams | L1ToL2TxReqAndSigner
Returns

Promise<L1EthDepositTransaction>

Overrides

AssetBridger . deposit

Source

assetBridger/ethBridger.ts:179

depositTo()
depositTo(params: EthDepositToParams | L1ToL2TransactionRequest & object & object): Promise<L1ContractCallTransaction>

Deposit ETH from L1 onto a different L2 address

Parameters
ParameterTypeDescription
paramsEthDepositToParams | L1ToL2TransactionRequest & object & object
Returns

Promise<L1ContractCallTransaction>

Source

assetBridger/ethBridger.ts:231

getDepositRequest()
getDepositRequest(params: EthDepositRequestParams): Promise<OmitTyped<L1ToL2TransactionRequest, "retryableData">>

Get a transaction request for an eth deposit

Parameters
ParameterTypeDescription
paramsEthDepositRequestParams
Returns

Promise <OmitTyped <L1ToL2TransactionRequest, "retryableData">>

Source

assetBridger/ethBridger.ts:149

getDepositToRequest()
getDepositToRequest(params: EthDepositToRequestParams): Promise<L1ToL2TransactionRequest>

Get a transaction request for an ETH deposit to a different L2 address using Retryables

Parameters
ParameterTypeDescription
paramsEthDepositToRequestParams
Returns

Promise <L1ToL2TransactionRequest>

Source

assetBridger/ethBridger.ts:204

getWithdrawalRequest()
getWithdrawalRequest(params: EthWithdrawParams): Promise<L2ToL1TransactionRequest>

Get a transaction request for an eth withdrawal

Parameters
ParameterTypeDescription
paramsEthWithdrawParams
Returns

Promise <L2ToL1TransactionRequest>

Source

assetBridger/ethBridger.ts:260

withdraw()
withdraw(params: L2ToL1TxReqAndSigner | EthWithdrawParams & object): Promise<L2ContractTransaction>

Withdraw ETH from L2 onto L1

Parameters
ParameterTypeDescription
paramsL2ToL1TxReqAndSigner | EthWithdrawParams & object
Returns

Promise<L2ContractTransaction>

Overrides

AssetBridger . withdraw

Source

assetBridger/ethBridger.ts:290

fromProvider()
static fromProvider(l2Provider: Provider): Promise<EthBridger>

Instantiates a new EthBridger from an L2 Provider

Parameters
ParameterTypeDescription
l2ProviderProvider
Returns

Promise <EthBridger>

Source

assetBridger/ethBridger.ts:140