Skip to main content

L2ToL1MessageNitro

Classes

L2ToL1MessageNitro

Base functionality for nitro L2->L1 messages

Extended by

Methods

fromEvent()
static fromEvent<T>(
l1SignerOrProvider: T,
event: object,
l1Provider?: Provider): L2ToL1MessageReaderOrWriterNitro<T>

Instantiates a new L2ToL1MessageWriterNitro or L2ToL1MessageReaderNitro object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
l1SignerOrProviderTSigner or provider to be used for executing or reading the L2-to-L1 message.
eventobjectThe event containing the data of the L2-to-L1 message.
event.arbBlockNumBigNumber-
event.caller?string-
event.callvalue?BigNumber-
event.data?string-
event.destination?string-
event.ethBlockNum?BigNumber-
event.hash?BigNumber-
event.position?BigNumber-
event.timestamp?BigNumber-
l1Provider?ProviderOptional. Used to override the Provider which is attached to l1SignerOrProvider in case you need more control. This will be a required parameter in a future major version update.
Returns

L2ToL1MessageReaderOrWriterNitro<T>

Source

message/L2ToL1MessageNitro.ts:136


L2ToL1MessageReaderNitro

Provides read-only access nitro for l2-to-l1-messages

Extends

Extended by

Methods

getFirstExecutableBlock()
getFirstExecutableBlock(l2Provider: Provider): 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

message/L2ToL1MessageNitro.ts:419

hasExecuted()
protected hasExecuted(l2Provider: Provider): Promise<boolean>

Check if this message has already been executed in the Outbox

Parameters
ParameterType
l2ProviderProvider
Returns

Promise<boolean>

Source

message/L2ToL1MessageNitro.ts:207

status()
status(l2Provider: Provider): 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

message/L2ToL1MessageNitro.ts:222

waitUntilReadyToExecute()
waitUntilReadyToExecute(l2Provider: Provider, retryDelay: number): Promise<CONFIRMED | EXECUTED>

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<CONFIRMED | EXECUTED>

outbox entry status (either executed or confirmed but not pending)

Source

message/L2ToL1MessageNitro.ts:397

fromEvent()
static fromEvent<T>(
l1SignerOrProvider: T,
event: object,
l1Provider?: Provider): L2ToL1MessageReaderOrWriterNitro<T>

Instantiates a new L2ToL1MessageWriterNitro or L2ToL1MessageReaderNitro object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
l1SignerOrProviderTSigner or provider to be used for executing or reading the L2-to-L1 message.
eventobjectThe event containing the data of the L2-to-L1 message.
event.arbBlockNumBigNumber-
event.caller?string-
event.callvalue?BigNumber-
event.data?string-
event.destination?string-
event.ethBlockNum?BigNumber-
event.hash?BigNumber-
event.position?BigNumber-
event.timestamp?BigNumber-
l1Provider?ProviderOptional. Used to override the Provider which is attached to l1SignerOrProvider in case you need more control. This will be a required parameter in a future major version update.
Returns

L2ToL1MessageReaderOrWriterNitro<T>

Inherited from

L2ToL1MessageNitro . fromEvent

Source

message/L2ToL1MessageNitro.ts:136


L2ToL1MessageWriterNitro

Provides read and write access for nitro l2-to-l1-messages

Extends

Constructors

new L2ToL1MessageWriterNitro()
new L2ToL1MessageWriterNitro(
l1Signer: Signer,
event: object,
l1Provider?: Provider): L2ToL1MessageWriterNitro

Instantiates a new L2ToL1MessageWriterNitro object.

Parameters
ParameterTypeDescription
l1SignerSignerThe signer to be used for executing the L2-to-L1 message.
eventobjectThe event containing the data of the L2-to-L1 message.
event.arbBlockNumBigNumber-
event.caller?string-
event.callvalue?BigNumber-
event.data?string-
event.destination?string-
event.ethBlockNum?BigNumber-
event.hash?BigNumber-
event.position?BigNumber-
event.timestamp?BigNumber-
l1Provider?ProviderOptional. Used to override the Provider which is attached to l1Signer in case you need more control. This will be a required parameter in a future major version update.
Returns

L2ToL1MessageWriterNitro

Overrides

L2ToL1MessageReaderNitro.constructor

Source

message/L2ToL1MessageNitro.ts:514

Properties

PropertyModifierTypeDescription
l1SignerprivateSignerThe signer to be used for executing the L2-to-L1 message.

Methods

execute()
execute(l2Provider: Provider, overrides?: 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

message/L2ToL1MessageNitro.ts:528

getFirstExecutableBlock()
getFirstExecutableBlock(l2Provider: Provider): 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

message/L2ToL1MessageNitro.ts:419

hasExecuted()
protected hasExecuted(l2Provider: Provider): Promise<boolean>

Check if this message has already been executed in the Outbox

Parameters
ParameterType
l2ProviderProvider
Returns

Promise<boolean>

Inherited from

L2ToL1MessageReaderNitro . hasExecuted

Source

message/L2ToL1MessageNitro.ts:207

status()
status(l2Provider: Provider): 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

message/L2ToL1MessageNitro.ts:222

waitUntilReadyToExecute()
waitUntilReadyToExecute(l2Provider: Provider, retryDelay: number): Promise<CONFIRMED | EXECUTED>

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<CONFIRMED | EXECUTED>

outbox entry status (either executed or confirmed but not pending)

Inherited from

L2ToL1MessageReaderNitro . waitUntilReadyToExecute

Source

message/L2ToL1MessageNitro.ts:397

fromEvent()
static fromEvent<T>(
l1SignerOrProvider: T,
event: object,
l1Provider?: Provider): L2ToL1MessageReaderOrWriterNitro<T>

Instantiates a new L2ToL1MessageWriterNitro or L2ToL1MessageReaderNitro object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
l1SignerOrProviderTSigner or provider to be used for executing or reading the L2-to-L1 message.
eventobjectThe event containing the data of the L2-to-L1 message.
event.arbBlockNumBigNumber-
event.caller?string-
event.callvalue?BigNumber-
event.data?string-
event.destination?string-
event.ethBlockNum?BigNumber-
event.hash?BigNumber-
event.position?BigNumber-
event.timestamp?BigNumber-
l1Provider?ProviderOptional. Used to override the Provider which is attached to l1SignerOrProvider in case you need more control. This will be a required parameter in a future major version update.
Returns

L2ToL1MessageReaderOrWriterNitro<T>

Inherited from

L2ToL1MessageReaderNitro . fromEvent

Source

message/L2ToL1MessageNitro.ts:136

Type Aliases

L2ToL1MessageReaderOrWriterNitro<T>

type L2ToL1MessageReaderOrWriterNitro<T>: 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

Type parameter
T extends SignerOrProvider

Source

message/L2ToL1MessageNitro.ts:57