Types
Types used by bridge classes.
IDepositTransaction
Represents a bridge deposit transaction.
interface IDepositTransaction {
// The address of the token to deposit.
token: Address;
// The amount of the token to deposit.
amount: BigNumberish;
// The address that will receive the deposited tokens on L2.
to?: Address;
// Currently is not used. If the ETH value passed with the transaction is not explicitly stated in the overrides, this field will be equal to the tip the operator will receive on top of the base cost of the transaction.
operatorTip?: BigNumberish;
// The address of the bridge contract to be used.
bridgeAddress: Address;
// Whether or not should the token approval be performed under the hood. Set this flag to `true` if you bridge an ERC20 token and didn't call the `approveERC20` function beforehand.
approveERC20?: boolean;
// Maximum amount of L2 gas that transaction can consume during execution on L2.
l2GasLimit?: BigNumberish;
// The L2 gas price for each published L1 calldata byte.
gasPerPubdataByte?: BigNumberish;
// The address on L2 that will receive the refund for the transaction. If the transaction fails, it will also be the address to receive l2Value.
refundRecipient?: Address;
// Ethers overrides (https://docs.ethers.org/v6/api/contract/#Overrides). Transaction's overrides which may be used to pass L1 `gasLimit`, `gasPrice`, `value`, etc.
overrides?: Overrides;
// Ethers overrides (https://docs.ethers.org/v6/api/contract/#Overrides). Transaction's overrides which may be used to pass L1 `gasLimit`, `gasPrice`, `value`, etc.
approveOverrides?: Overrides;
}
IWithdrawTransaction
Represents a bridge withdraw transaction.
interface IWithdrawTransaction {
// The address of the token to withdraw.
token: Address;
// The amount of the token to withdraw.
amount: BigNumberish;
// The address of the recipient on L1.
to?: Address;
// The address of the bridge contract to be used.
bridgeAddress: Address;
// Paymaster parameters for the transaction.
paymasterParams?: PaymasterParams;
// Ethers overrides (https://docs.ethers.org/v6/api/contract/#Overrides). Transaction's overrides which may be used to pass L1 `gasLimit`, `gasPrice`, `value`, etc.
overrides?: Overrides;
// Whether or not should the token approval be performed under the hood. Set this flag to `true` if you bridge an ERC20 token and didn't call the `approveERC20` function beforehand.
approveERC20?: boolean;
// Ethers overrides (https://docs.ethers.org/v6/api/contract/#Overrides). Transaction's overrides which may be used to pass L1 `gasLimit`, `gasPrice`, `value`, etc.
approveOverrides?: Overrides;
}
FinalizeL1DepositParams
Contains parameters for finalizing the L2 -> L1 deposit transaction. Pre V26 withdrawals were special kind of transaction, but starting from v26 any cross-chain token movement is called a deposit, regardless of direction.
type FinalizeL1DepositParams = {
chainId: BigNumberish;
l2BatchNumber: BigNumberish;
l2MessageIndex: BigNumberish;
l2Sender: AddressLike;
l2TxNumberInBatch: BigNumberish;
message: BytesLike;
merkleProof: BytesLike[];
}