Skip to main content

Module: message/L2ToL1MessageNitro

L2ToL1MessageNitro

Base functionality for nitro L2->L1 messages

Extended By


L2ToL1MessageReaderNitro

Provides read-only access nitro 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
ParameterTypeDescription
l2ProviderProvider
Returns

Promise\< null | BigNumber >

expected L1 block number where the L2 to L1 message will be executable. Returns null if the message can be or already has been executed

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:316


hasExecuted()

protected hasExecuted(l2Provider): Promise< boolean >

Check if this message has already been executed in the Outbox

Parameters
ParameterType
l2ProviderProvider
Returns

Promise\< boolean >

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:139


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
ParameterType
l2ProviderProvider
Returns

Promise\< L2ToL1MessageStatus >

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:154


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
ParameterTypeDefault valueDescription
l2ProviderProviderundefined-
retryDelaynumber500
Returns

Promise\< void >

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:294


L2ToL1MessageWriterNitro

Provides read and write access for nitro 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
ParameterType
l2ProviderProvider
overrides?Overrides
Returns

Promise\< ContractTransaction >

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:417


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
ParameterTypeDescription
l2ProviderProvider
Returns

Promise\< null | BigNumber >

expected L1 block number where the L2 to L1 message will be executable. Returns null if the message can be or already has been executed

Inherited from

L2ToL1MessageReaderNitro.getFirstExecutableBlock

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:316


hasExecuted()

protected hasExecuted(l2Provider): Promise< boolean >

Check if this message has already been executed in the Outbox

Parameters
ParameterType
l2ProviderProvider
Returns

Promise\< boolean >

Inherited from

L2ToL1MessageReaderNitro.hasExecuted

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:139


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
ParameterType
l2ProviderProvider
Returns

Promise\< L2ToL1MessageStatus >

Inherited from

L2ToL1MessageReaderNitro.status

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:154


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
ParameterTypeDefault valueDescription
l2ProviderProviderundefined-
retryDelaynumber500
Returns

Promise\< void >

Inherited from

L2ToL1MessageReaderNitro.waitUntilReadyToExecute

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:294


L2ToL1MessageReaderOrWriterNitro

L2ToL1MessageReaderOrWriterNitro: &lt;T&gt; T extends Provider ? L2ToL1MessageReaderNitro : L2ToL1MessageWriterNitro

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

Source

arbitrum-sdk/src/lib/message/L2ToL1MessageNitro.ts:56