Module: assetBridger/assetBridger
AssetBridger
Base for bridging assets from l1 to l2 and back
Extended By
Type parameters
Parameter | Description |
---|---|
DepositParams | Object with information to execute a deposit. For an example, see Erc20Bridger.Erc20DepositParams |
WithdrawParams | Object with information to execute a withdraw. For an example, see Erc20Bridger.Erc20WithdrawParams |
Constructors
constructor()
new AssetBridger<DepositParams, WithdrawParams>(l2Network): AssetBridger< DepositParams, WithdrawParams >
Throws
ArbSdkError if l2Network
does not have a correspondant L1 network in l1Networks
Type parameters
Parameter | Description |
---|---|
DepositParams | Object with information to execute a deposit. For an example, see Erc20Bridger.Erc20DepositParams |
WithdrawParams | Object with information to execute a withdraw. For an example, see Erc20Bridger.Erc20WithdrawParams |
Parameters
Parameter | Type | Description |
---|---|---|
l2Network | L2Network | L2 network this bridger will operate with |
Returns
AssetBridger
\< DepositParams
, WithdrawParams
>
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:48
Properties
Property | Type | Description |
---|---|---|
readonly l1Network | L1Network | L1 network this bridger will operate with |
readonly l2Network | L2Network | L2 network this bridger will operate with |
Methods
checkL1Network()
protected checkL1Network(sop): Promise< void >
Check the signer/provider matches the l1Network
Remarks
Only ethers is allowed for the signer or provider object
Parameters
Parameter | Type | Description |
---|---|---|
sop | SignerOrProvider | Signer or Provider from ethers |
Returns
Promise
\< void
>
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:65
checkL2Network()
protected checkL2Network(sop): Promise< void >
Check the signer/provider matches the l2Network
Remarks
Only ethers is allowed for the signer or provider object
Parameters
Parameter | Type | Description |
---|---|---|
sop | SignerOrProvider | Signer or Provider from ethers |
Returns
Promise
\< void
>
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:77
deposit()
abstract deposit(params): Promise< L1ContractTransaction< L1TransactionReceipt > >
Transfer assets from L1 to L2
Remarks
The actual content of the DepositParams object will depend on the child class used. For example, the parameters needed in Erc20Bridger are different than in EthBridger as the processes to transfer ERC20 assets is different than the process to transfer ETH.
Parameters
Parameter | Type | Description |
---|---|---|
params | DepositParams | Parameters needed to execute a deposit |
Returns
Promise
\< L1ContractTransaction
\< L1TransactionReceipt
> >
Response object for a transaction sent to an L1 contract
Source
arbitrum-sdk/src/lib/assetBridger/assetBridger.ts:92
withdraw()
abstract withdraw(params): Promise< L2ContractTransaction >
Transfer assets from L2 to L1
Remarks
The actual content of the WithdrawParams object will depend on the child class used. For example, the parameters needed in Erc20Bridger are different than in EthBridger as the processes to transfer ERC20 assets is different than the process to transfer ETH.
Parameters
Parameter | Type | Description |
---|---|---|
params | WithdrawParams | Parameters needed to execute a withdraw |
Returns
Promise
\< L2ContractTransaction
>
Response object for a transaction sent to an L2 contract