Module: assetBridger/ethBridger
EthBridger
Bridger for moving ETH back and forth between parent and child chain
Extends
AssetBridger
<EthDepositParams
|EthDepositToParams
|ParentToChildTxReqAndSigner
,EthWithdrawParams
|ChildToParentTxReqAndSigner
>
Properties
Property | Type | Description |
---|---|---|
nativeToken ? | string | In case of a chain that uses ETH as its native/gas token, this is either undefined or the zero addressIn case of a chain that uses an ERC-20 token from the parent chain as its native/gas token, this is the address of said token on the parent chain |
Accessors
nativeTokenIsEth
protected get nativeTokenIsEth(): boolean
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:68
Inherited from
Methods
approveGasToken()
approveGasToken(params): Promise< TransactionResponse >
Approves the custom gas token to be spent by the Inbox on the parent chain.
Parameters
Parameter | Type | Description |
---|---|---|
params | WithParentSigner < ApproveGasTokenParamsOrTxRequest > |
Returns
Promise
< TransactionResponse
>
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:219
checkChildChain()
protected checkChildChain(sop): Promise< void >
Check the signer/provider matches the childChain, throws if not
Parameters
Parameter | Type | Description |
---|---|---|
sop | SignerOrProvider |
Returns
Promise
< void
>
Inherited from
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:60
checkParentChain()
protected checkParentChain(sop): Promise< void >
Check the signer/provider matches the parentChain, throws if not
Parameters
Parameter | Type | Description |
---|---|---|
sop | SignerOrProvider |
Returns
Promise
< void
>
Inherited from
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:49
deposit()
deposit(params): Promise< ParentEthDepositTransaction >
Deposit ETH from Parent onto Child chain
Parameters
Parameter | Type | Description |
---|---|---|
params | EthDepositParams | ParentToChildTxReqAndSigner |
Returns
Promise
< ParentEthDepositTransaction
>
Overrides
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:287
depositTo()
depositTo(params): Promise< ParentContractCallTransaction >
Deposit ETH from parent chain onto a different child chain address
Parameters
Parameter | Type | Description |
---|---|---|
params | EthDepositToParams | ParentToChildTransactionRequest & {overrides : Overrides ; parentSigner : Signer ;} & {childProvider : Provider ;} |
Returns
Promise
< ParentContractCallTransaction
>
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:339
getApproveGasTokenRequest()
getApproveGasTokenRequest(params?): Required< Pick< TransactionRequest, "data" | "value" | "to" > >
Creates a transaction request for approving the custom gas token to be spent by the inbox on the parent chain
Parameters
Parameter | Type | Description |
---|---|---|
params ? | ApproveGasTokenParams |
Returns
Required
< Pick
< TransactionRequest
, "data"
| "value"
| "to"
> >
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:191
getDepositRequest()
getDepositRequest(params): Promise< OmitTyped< ParentToChildTransactionRequest, "retryableData" > >
Gets tx request for depositing ETH or custom gas token
Parameters
Parameter | Type | Description |
---|---|---|
params | EthDepositRequestParams |
Returns
Promise
< OmitTyped
< ParentToChildTransactionRequest
, "retryableData"
> >
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:268
getDepositRequestData()
private getDepositRequestData(params): string
Gets transaction calldata for a tx request for depositing ETH or custom gas token
Parameters
Parameter | Type | Description |
---|---|---|
params | EthDepositRequestParams |
Returns
string
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:241
getDepositToRequest()
getDepositToRequest(params): Promise< ParentToChildTransactionRequest >
Get a transaction request for an ETH deposit to a different child chain address using Retryables
Parameters
Parameter | Type | Description |
---|---|---|
params | EthDepositToRequestParams |
Returns
Promise
< ParentToChildTransactionRequest
>
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:312
getWithdrawalRequest()
getWithdrawalRequest(params): Promise< ChildToParentTransactionRequest >
Get a transaction request for an eth withdrawal
Parameters
Parameter | Type | Description |
---|---|---|
params | EthWithdrawParams |
Returns
Promise
< ChildToParentTransactionRequest
>
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:368
isApproveGasTokenParams()
private isApproveGasTokenParams(params): params is WithParentSigner<ApproveGasTokenParams>
Asserts that the provided argument is of type ApproveGasTokenParams
and not ApproveGasTokenTxRequest
.
Parameters
Parameter | Type | Description |
---|---|---|
params | ApproveGasTokenParamsOrTxRequest |
Returns
params is WithParentSigner<ApproveGasTokenParams>
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:181
withdraw()
withdraw(params): Promise< ChildContractTransaction >
Withdraw ETH from child chain onto parent chain
Parameters
Parameter | Type | Description |
---|---|---|
params | ChildToParentTxReqAndSigner | EthWithdrawParams & {childSigner : Signer ;} |
Returns
Promise
< ChildContractTransaction
>
Overrides
Source
arbitrum-sdk/src/lib/assetBridger/ethBridger.ts:404
fromProvider()
static fromProvider(childProvider): Promise< EthBridger >
Instantiates a new EthBridger from a child chain Provider
Parameters
Parameter | Type | Description |
---|---|---|
childProvider | Provider |
Returns
Promise
< EthBridger
>