Skip to main content

ChildToParentMessageNitro

Classes

ChildToParentMessageNitro

Base functionality for nitro Child->Parent messages

Extended by

Methods

fromEvent()
static fromEvent<T>(
parentSignerOrProvider: T,
event: object,
parentProvider?: Provider): ChildToParentMessageReaderOrWriterNitro<T>

Instantiates a new ChildToParentMessageWriterNitro or ChildToParentMessageReaderNitro object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentSignerOrProviderTSigner or provider to be used for executing or reading the Child-to-Parent message.
eventobjectThe event containing the data of the Child-to-Parent 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-
parentProvider?ProviderOptional. Used to override the Provider which is attached to parentSignerOrProvider in case you need more control. This will be a required parameter in a future major version update.
Returns

ChildToParentMessageReaderOrWriterNitro<T>

Source

message/ChildToParentMessageNitro.ts:148


ChildToParentMessageReaderNitro

Provides read-only access nitro for child-to-parent-messages

Extends

Extended by

Methods

getFirstExecutableBlock()
getFirstExecutableBlock(childProvider: 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
childProviderProvider
Returns

Promise<null | BigNumber>

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

Source

message/ChildToParentMessageNitro.ts:596

getRollupAndUpdateNetwork()
private getRollupAndUpdateNetwork(arbitrumNetwork: ArbitrumNetwork): Promise<RollupUserLogic | BoldRollupUserLogic>

If the local network is not currently bold, checks if the remote network is bold and if so updates the local network with a new rollup address

Parameters
ParameterTypeDescription
arbitrumNetworkArbitrumNetwork
Returns

Promise<RollupUserLogic | BoldRollupUserLogic>

The rollup contract, bold or legacy

Source

message/ChildToParentMessageNitro.ts:567

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

Check if this message has already been executed in the Outbox

Parameters
ParameterType
childProviderProvider
Returns

Promise<boolean>

Source

message/ChildToParentMessageNitro.ts:225

isBold()
private isBold(arbitrumNetwork: ArbitrumNetwork, parentProvider: Provider): Promise<undefined | string>

Check whether the provided network has a BoLD rollup

Parameters
ParameterTypeDescription
arbitrumNetworkArbitrumNetwork
parentProviderProvider
Returns

Promise<undefined | string>

Source

message/ChildToParentMessageNitro.ts:531

status()
status(childProvider: Provider): Promise<ChildToParentMessageStatus>

Get the status of this message In order to check if the message has been executed proof info must be provided.

Parameters
ParameterType
childProviderProvider
Returns

Promise<ChildToParentMessageStatus>

Source

message/ChildToParentMessageNitro.ts:240

waitUntilReadyToExecute()
waitUntilReadyToExecute(childProvider: 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
childProviderProviderundefined-
retryDelaynumber500
Returns

Promise<CONFIRMED | EXECUTED>

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

Source

message/ChildToParentMessageNitro.ts:507

fromEvent()
static fromEvent<T>(
parentSignerOrProvider: T,
event: object,
parentProvider?: Provider): ChildToParentMessageReaderOrWriterNitro<T>

Instantiates a new ChildToParentMessageWriterNitro or ChildToParentMessageReaderNitro object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentSignerOrProviderTSigner or provider to be used for executing or reading the Child-to-Parent message.
eventobjectThe event containing the data of the Child-to-Parent 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-
parentProvider?ProviderOptional. Used to override the Provider which is attached to parentSignerOrProvider in case you need more control. This will be a required parameter in a future major version update.
Returns

ChildToParentMessageReaderOrWriterNitro<T>

Inherited from

ChildToParentMessageNitro . fromEvent

Source

message/ChildToParentMessageNitro.ts:148


ChildToParentMessageWriterNitro

Provides read and write access for nitro child-to-Parent-messages

Extends

Constructors

new ChildToParentMessageWriterNitro()
new ChildToParentMessageWriterNitro(
parentSigner: Signer,
event: object,
parentProvider?: Provider): ChildToParentMessageWriterNitro

Instantiates a new ChildToParentMessageWriterNitro object.

Parameters
ParameterTypeDescription
parentSignerSignerThe signer to be used for executing the Child-to-Parent message.
eventobjectThe event containing the data of the Child-to-Parent 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-
parentProvider?ProviderOptional. Used to override the Provider which is attached to parentSigner in case you need more control. This will be a required parameter in a future major version update.
Returns

ChildToParentMessageWriterNitro

Overrides

ChildToParentMessageReaderNitro.constructor

Source

message/ChildToParentMessageNitro.ts:724

Properties

PropertyModifierTypeDescription
parentSignerprivateSignerThe signer to be used for executing the Child-to-Parent message.

Methods

execute()
execute(childProvider: Provider, overrides?: Overrides): Promise<ContractTransaction>

Executes the ChildToParentMessage on Parent Chain. Will throw an error if the outbox entry has not been created, which happens when the corresponding assertion is confirmed.

Parameters
ParameterType
childProviderProvider
overrides?Overrides
Returns

Promise<ContractTransaction>

Source

message/ChildToParentMessageNitro.ts:738

getFirstExecutableBlock()
getFirstExecutableBlock(childProvider: 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
childProviderProvider
Returns

Promise<null | BigNumber>

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

Inherited from

ChildToParentMessageReaderNitro . getFirstExecutableBlock

Source

message/ChildToParentMessageNitro.ts:596

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

Check if this message has already been executed in the Outbox

Parameters
ParameterType
childProviderProvider
Returns

Promise<boolean>

Inherited from

ChildToParentMessageReaderNitro . hasExecuted

Source

message/ChildToParentMessageNitro.ts:225

status()
status(childProvider: Provider): Promise<ChildToParentMessageStatus>

Get the status of this message In order to check if the message has been executed proof info must be provided.

Parameters
ParameterType
childProviderProvider
Returns

Promise<ChildToParentMessageStatus>

Inherited from

ChildToParentMessageReaderNitro . status

Source

message/ChildToParentMessageNitro.ts:240

waitUntilReadyToExecute()
waitUntilReadyToExecute(childProvider: 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
childProviderProviderundefined-
retryDelaynumber500
Returns

Promise<CONFIRMED | EXECUTED>

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

Inherited from

ChildToParentMessageReaderNitro . waitUntilReadyToExecute

Source

message/ChildToParentMessageNitro.ts:507

fromEvent()
static fromEvent<T>(
parentSignerOrProvider: T,
event: object,
parentProvider?: Provider): ChildToParentMessageReaderOrWriterNitro<T>

Instantiates a new ChildToParentMessageWriterNitro or ChildToParentMessageReaderNitro object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentSignerOrProviderTSigner or provider to be used for executing or reading the Child-to-Parent message.
eventobjectThe event containing the data of the Child-to-Parent 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-
parentProvider?ProviderOptional. Used to override the Provider which is attached to parentSignerOrProvider in case you need more control. This will be a required parameter in a future major version update.
Returns

ChildToParentMessageReaderOrWriterNitro<T>

Inherited from

ChildToParentMessageReaderNitro . fromEvent

Source

message/ChildToParentMessageNitro.ts:148

Type Aliases

ChildToParentMessageReaderOrWriterNitro<T>

type ChildToParentMessageReaderOrWriterNitro<T>: T extends Provider ? ChildToParentMessageReaderNitro : ChildToParentMessageWriterNitro;

Conditional type for Signer or Provider. If T is of type Provider then ChildToParentMessageReaderOrWriter<T> will be of type ChildToParentMessageReader. If T is of type Signer then ChildToParentMessageReaderOrWriter<T> will be of type ChildToParentMessageWriter.

Type parameters

Type parameter
T extends SignerOrProvider

Source

message/ChildToParentMessageNitro.ts:64