Class: EthBridger
assetBridger/ethBridger.EthBridger
Bridger for moving ETH back and forth between L1 to L2
Hierarchy
AssetBridger
<EthDepositParams
|EthDepositToParams
|L1ToL2TxReqAndSigner
,EthWithdrawParams
|L2ToL1TxReqAndSigner
>↳
EthBridger
Methods
checkL1Network
Protected
checkL1Network(sop
): Promise
<void
>
Check the signer/provider matches the l1Network, throws if not
Parameters
Name | Type |
---|---|
sop | SignerOrProvider |
Returns
Promise
<void
>
Inherited from
Defined in
src/lib/assetBridger/assetBridger.ts:48
checkL2Network
Protected
checkL2Network(sop
): Promise
<void
>
Check the signer/provider matches the l2Network, throws if not
Parameters
Name | Type |
---|---|
sop | SignerOrProvider |
Returns
Promise
<void
>
Inherited from
Defined in
src/lib/assetBridger/assetBridger.ts:56
deposit
deposit(params
): Promise
<L1EthDepositTransaction
>
Deposit ETH from L1 onto L2
Parameters
Name | Type |
---|---|
params | EthDepositParams | L1ToL2TxReqAndSigner |
Returns
Promise
<L1EthDepositTransaction
>
Overrides
Defined in
src/lib/assetBridger/ethBridger.ts:179
depositTo
depositTo(params
): Promise
<L1ContractCallTransaction
>
Deposit ETH from L1 onto a different L2 address
Parameters
Name | Type |
---|---|
params | EthDepositToParams | L1ToL2TransactionRequest & { l1Signer : Signer ; overrides? : Overrides } & { l2Provider : Provider } |
Returns
Promise
<L1ContractCallTransaction
>
Defined in
src/lib/assetBridger/ethBridger.ts:231
getDepositRequest
getDepositRequest(params
): Promise
<OmitTyped
<L1ToL2TransactionRequest
, "retryableData"
>>
Get a transaction request for an eth deposit
Parameters
Name | Type |
---|---|
params | EthDepositRequestParams |
Returns
Promise
<OmitTyped
<L1ToL2TransactionRequest
, "retryableData"
>>
Defined in
src/lib/assetBridger/ethBridger.ts:149
getDepositToRequest
getDepositToRequest(params
): Promise
<L1ToL2TransactionRequest
>
Get a transaction request for an ETH deposit to a different L2 address using Retryables
Parameters
Name | Type |
---|---|
params | EthDepositToRequestParams |
Returns
Promise
<L1ToL2TransactionRequest
>
Defined in
src/lib/assetBridger/ethBridger.ts:204
getWithdrawalRequest
getWithdrawalRequest(params
): Promise
<L2ToL1TransactionRequest
>
Get a transaction request for an eth withdrawal
Parameters
Name | Type |
---|---|
params | EthWithdrawParams |
Returns
Promise
<L2ToL1TransactionRequest
>
Defined in
src/lib/assetBridger/ethBridger.ts:260
withdraw
withdraw(params
): Promise
<L2ContractTransaction
>
Withdraw ETH from L2 onto L1
Parameters
Name | Type |
---|---|
params | L2ToL1TxReqAndSigner | EthWithdrawParams & { l2Signer : Signer } |
Returns
Promise
<L2ContractTransaction
>
Overrides
Defined in
src/lib/assetBridger/ethBridger.ts:290
fromProvider
Static
fromProvider(l2Provider
): Promise
<EthBridger
>
Instantiates a new EthBridger from an L2 Provider
Parameters
Name | Type |
---|---|
l2Provider | Provider |
Returns
Promise
<EthBridger
>