Module: message/L2ToL1Message
L2ToL1Message
Base functionality for L2->L1 messages
Extended By
Methods
getL2ToL1Events()
static getL2ToL1Events(
l2Provider,
filter,
position?,
destination?,
hash?,
indexInBatch?): Promise< Object[] >
Get event logs for L2ToL1 transactions.
Parameters
Parameter | Type | Description |
---|---|---|
l2Provider | Provider | |
filter | object | Block range filter |
filter.fromBlock | BlockTag | - |
filter.toBlock ? | BlockTag | - |
position ? | BigNumber | The batchnumber indexed field was removed in nitro and a position indexed field was added. For pre-nitro events the value passed in here will be used to find events with the same batchnumber. For post nitro events it will be used to find events with the same position. |
destination ? | string | The L1 destination of the L2ToL1 message |
hash ? | BigNumber | The uniqueId indexed field was removed in nitro and a hash indexed field was added. For pre-nitro events the value passed in here will be used to find events with the same uniqueId. For post nitro events it will be used to find events with the same hash. |
indexInBatch ? | BigNumber | The index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro |
Returns
Promise
\< Object
[] >
Any classic and nitro events that match the provided filters.
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:93
L2ToL1MessageReader
Provides read-only access for l2-to-l1-messages
Extends
Methods
getFirstExecutableBlock()
getFirstExecutableBlock(l2Provider): Promise< null | BigNumber >
Estimates the L1 block number in which this L2 to L1 tx will be available for execution. If the message can or already has been executed, this returns null
Parameters
Parameter | Type | Description |
---|---|---|
l2Provider | Provider |
Returns
Promise
\< null
| BigNumber
>
expected L1 block number where the L2 to L1 message will be executable. Returns null if the message can or already has been executed
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:249
status()
status(l2Provider): Promise< L2ToL1MessageStatus >
Get the status of this message In order to check if the message has been executed proof info must be provided.
Parameters
Parameter | Type |
---|---|
l2Provider | Provider |
Returns
Promise
\< L2ToL1MessageStatus
>
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:217
waitUntilReadyToExecute()
waitUntilReadyToExecute(l2Provider, retryDelay = 500): Promise< void >
Waits until the outbox entry has been created, and will not return until it has been. WARNING: Outbox entries are only created when the corresponding node is confirmed. Which can take 1 week+, so waiting here could be a very long operation.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
l2Provider | Provider | undefined | - |
retryDelay | number | 500 |
Returns
Promise
\< void
>
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:230
getL2ToL1Events()
static getL2ToL1Events(
l2Provider,
filter,
position?,
destination?,
hash?,
indexInBatch?): Promise< Object[] >
Get event logs for L2ToL1 transactions.
Parameters
Parameter | Type | Description |
---|---|---|
l2Provider | Provider | |
filter | object | Block range filter |
filter.fromBlock | BlockTag | - |
filter.toBlock ? | BlockTag | - |
position ? | BigNumber | The batchnumber indexed field was removed in nitro and a position indexed field was added. For pre-nitro events the value passed in here will be used to find events with the same batchnumber. For post nitro events it will be used to find events with the same position. |
destination ? | string | The L1 destination of the L2ToL1 message |
hash ? | BigNumber | The uniqueId indexed field was removed in nitro and a hash indexed field was added. For pre-nitro events the value passed in here will be used to find events with the same uniqueId. For post nitro events it will be used to find events with the same hash. |
indexInBatch ? | BigNumber | The index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro |
Returns
Promise
\< Object
[] >
Any classic and nitro events that match the provided filters.
Inherited from
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:93
L2ToL1MessageWriter
Provides read and write access for l2-to-l1-messages
Extends
Methods
execute()
execute(l2Provider, overrides?): Promise< ContractTransaction >
Executes the L2ToL1Message on L1. Will throw an error if the outbox entry has not been created, which happens when the corresponding assertion is confirmed.
Parameters
Parameter | Type |
---|---|
l2Provider | Provider |
overrides ? | Overrides |
Returns
Promise
\< ContractTransaction
>
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:285
getFirstExecutableBlock()
getFirstExecutableBlock(l2Provider): Promise< null | BigNumber >
Estimates the L1 block number in which this L2 to L1 tx will be available for execution. If the message can or already has been executed, this returns null
Parameters
Parameter | Type | Description |
---|---|---|
l2Provider | Provider |
Returns
Promise
\< null
| BigNumber
>
expected L1 block number where the L2 to L1 message will be executable. Returns null if the message can or already has been executed
Inherited from
L2ToL1MessageReader
.getFirstExecutableBlock
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:249
status()
status(l2Provider): Promise< L2ToL1MessageStatus >
Get the status of this message In order to check if the message has been executed proof info must be provided.
Parameters
Parameter | Type |
---|---|
l2Provider | Provider |
Returns
Promise
\< L2ToL1MessageStatus
>
Inherited from
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:217
waitUntilReadyToExecute()
waitUntilReadyToExecute(l2Provider, retryDelay = 500): Promise< void >
Waits until the outbox entry has been created, and will not return until it has been. WARNING: Outbox entries are only created when the corresponding node is confirmed. Which can take 1 week+, so waiting here could be a very long operation.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
l2Provider | Provider | undefined | - |
retryDelay | number | 500 |
Returns
Promise
\< void
>
Inherited from
L2ToL1MessageReader
.waitUntilReadyToExecute
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:230
getL2ToL1Events()
static getL2ToL1Events(
l2Provider,
filter,
position?,
destination?,
hash?,
indexInBatch?): Promise< Object[] >
Get event logs for L2ToL1 transactions.
Parameters
Parameter | Type | Description |
---|---|---|
l2Provider | Provider | |
filter | object | Block range filter |
filter.fromBlock | BlockTag | - |
filter.toBlock ? | BlockTag | - |
position ? | BigNumber | The batchnumber indexed field was removed in nitro and a position indexed field was added. For pre-nitro events the value passed in here will be used to find events with the same batchnumber. For post nitro events it will be used to find events with the same position. |
destination ? | string | The L1 destination of the L2ToL1 message |
hash ? | BigNumber | The uniqueId indexed field was removed in nitro and a hash indexed field was added. For pre-nitro events the value passed in here will be used to find events with the same uniqueId. For post nitro events it will be used to find events with the same hash. |
indexInBatch ? | BigNumber | The index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro |
Returns
Promise
\< Object
[] >
Any classic and nitro events that match the provided filters.
Inherited from
L2ToL1MessageReader
.getL2ToL1Events
Source
arbitrum-sdk/src/lib/message/L2ToL1Message.ts:93
L2ToL1MessageReaderOrWriter
L2ToL1MessageReaderOrWriter: <T> T extends Provider ? L2ToL1MessageReader : L2ToL1MessageWriter
Conditional type for Signer or Provider. If T is of type Provider then L2ToL1MessageReaderOrWriter\<T> will be of type L2ToL1MessageReader. If T is of type Signer then L2ToL1MessageReaderOrWriter\<T> will be of type L2ToL1MessageWriter.
Type parameters
Parameter |
---|
T extends SignerOrProvider |