Options for the provider.
Optional bridge address list.
Optional contract address overrides.
Optional number of blocks before a deposit is confirmed.
Optional estimated block time in seconds for the L1 chain.
Chain ID for the L1 chain.
Signer or Provider for the L1 chain, or a JSON-RPC url.
Chain ID for the L2 chain.
Signer or Provider for the L2 chain, or a JSON-RPC url.
List of custom bridges for the given network.
Contract objects attached to their respective providers and addresses.
Number of blocks before a deposit is considered confirmed.
Object that holds the functions that estimates the gas required for a given transaction. Follows the pattern used by ethers.js.
Estimated average L1 block time in seconds.
Chain ID for the L1 network.
Provider connected to the L1 chain.
Chain ID for the L2 network.
Provider connected to the L2 chain.
Object that holds the functions that generate transactions to be signed by the user. Follows the pattern used by ethers.js.
Provider connected to the L1 chain.
Signer connected to the L1 chain.
Provider connected to the L2 chain.
Signer connected to the L2 chain.
Queries the account's approval amount for a given L1 token.
Amount of tokens approved for deposits from the account.
Approves a deposit into the L2 chain.
Transaction response for the approval transaction.
Deposits some ERC20 tokens into the L2 chain.
Transaction response for the deposit transaction.
Deposits some ETH into the L2 chain.
Transaction response for the deposit transaction.
Estimates the amount of gas required to fully execute a given message on L2. Only applies to L1 => L2 messages. You would supply this gas limit when sending the message to L2.
Estimates L2 gas limit.
Returns the estimated amount of time before the message can be executed. When this is a message being sent to L1, this will return the estimated time until the message will complete its challenge period. When this is a message being sent to L2, this will return the estimated amount of time until the message will be picked up and executed on L2.
Estimated amount of time remaining (in seconds) before the message can be executed.
Finalizes a cross chain message that was sent from L2 to L1. Only applicable for L2 to L1 messages. Will throw an error if the message has not completed its challenge period yet.
Transaction response for the finalization transaction.
Finds the appropriate bridge adapter for a given L1<>L2 token pair. Will throw if no bridges support the token pair or if more than one bridge supports the token pair.
The appropriate bridge adapter for the given token pair.
Queries the current challenge period in seconds from the StateCommitmentChain.
Current challenge period in seconds.
Gets all deposits for a given address.
All deposit token bridge messages sent by the given address.
Generates the proof required to finalize an L2 to L1 message.
Proof that can be used to finalize the message.
Finds the receipt of the transaction that executed a particular cross chain message.
CrossChainMessage receipt including receipt of the transaction that relayed the given message.
Returns the state root that corresponds to a given message. This is the state root for the block in which the transaction was included, as published to the StateCommitmentChain. If the state root for the given message has not been published yet, this function returns null.
State root for the block in which the message was created.
Retrieves the status of a particular message as an enum.
Status of the message.
Retrieves all cross chain messages sent within a given transaction.
All cross chain messages sent within the transaction.
Returns the StateBatchAppended event that was emitted when the batch with a given index was created. Returns null if no such event exists (the batch has not been submitted).
StateBatchAppended event for the batch, or null if no such batch exists.
Returns the StateBatchAppended event for the batch that includes the transaction with the given index. Returns null if no such event exists.
StateBatchAppended event for the batch that includes the given transaction by index.
Returns information about the state root batch that included the state root for the given transaction by index. Returns null if no such state root has been published yet.
State root batch for the given transaction index, or null if none exists yet.
Gets all withdrawals for a given address.
All withdrawal token bridge messages sent by the given address.
Resends a given cross chain message with a different gas limit. Only applies to L1 to L2 messages. If provided an L2 to L1 message, this function will throw an error.
Transaction response for the message resending transaction.
Sends a given cross chain message. Where the message is sent depends on the direction attached to the message itself.
Transaction response for the message sending transaction.
Resolves a MessageLike into a CrossChainMessage object. Unlike other coercion functions, this function is stateful and requires making additional requests. For now I'm going to keep this function here, but we could consider putting a similar function inside of utils/coercion.ts if people want to use this without having to create an entire CrossChainProvider object.
Message coerced into a CrossChainMessage.
Waits for a message to be executed and returns the receipt of the transaction that executed the given message.
CrossChainMessage receipt including receipt of the transaction that relayed the given message.
Waits until the status of a given message changes to the expected status. Note that if the status of the given message changes to a status that implies the expected status, this will still return. If the status of the message changes to a status that exclues the expected status, this will throw an error.
Withdraws some ERC20 tokens back to the L1 chain.
Transaction response for the withdraw transaction.
Withdraws some ETH back to the L1 chain.
Transaction response for the withdraw transaction.
Generated using TypeDoc
Creates a new CrossChainProvider instance.