Skip to main content

ChildToParentMessage

Classes

ChildToParentMessage

Base functionality for Child-to-Parent messages

Extended by

Methods

fromEvent()
static fromEvent<T>(
parentSignerOrProvider: T,
event: ChildToParentTransactionEvent,
parentProvider?: Provider): ChildToParentMessageReaderOrWriter<T>

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentSignerOrProviderT-
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
parentProvider?Provider-
Returns

ChildToParentMessageReaderOrWriter<T>

Source

message/ChildToParentMessage.ts:76

getChildToParentEvents()
static getChildToParentEvents(
childProvider: Provider,
filter: object,
position?: BigNumber,
destination?: string,
hash?: BigNumber,
indexInBatch?: BigNumber): Promise<ChildToParentTransactionEvent & object[]>

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childProviderProvider
filterobjectBlock range filter
filter.fromBlockBlockTag-
filter.toBlock?BlockTag-
position?BigNumberThe 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?stringThe parent destination of the ChildToParent message
hash?BigNumberThe 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?BigNumberThe index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro
Returns

Promise<ChildToParentTransactionEvent & object[]>

Any classic and nitro events that match the provided filters.

Source

message/ChildToParentMessage.ts:109


ChildToParentMessageReader

Provides read-only access for Child-to-Parent messages

Extends

Extended by

Methods

getFirstExecutableBlock()
getFirstExecutableBlock(childProvider: Provider): Promise<null | BigNumber>

Estimates the Parent block number in which this Child-to-Parent 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 block number where the Child-to-Parent message will be executable. Returns null if the message can or already has been executed

Source

message/ChildToParentMessage.ts:273

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/ChildToParentMessage.ts:237

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/ChildToParentMessage.ts:252

fromEvent()
static fromEvent<T>(
parentSignerOrProvider: T,
event: ChildToParentTransactionEvent,
parentProvider?: Provider): ChildToParentMessageReaderOrWriter<T>

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentSignerOrProviderT-
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
parentProvider?Provider-
Returns

ChildToParentMessageReaderOrWriter<T>

Inherited from

ChildToParentMessage . fromEvent

Source

message/ChildToParentMessage.ts:76

getChildToParentEvents()
static getChildToParentEvents(
childProvider: Provider,
filter: object,
position?: BigNumber,
destination?: string,
hash?: BigNumber,
indexInBatch?: BigNumber): Promise<ChildToParentTransactionEvent & object[]>

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childProviderProvider
filterobjectBlock range filter
filter.fromBlockBlockTag-
filter.toBlock?BlockTag-
position?BigNumberThe 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?stringThe parent destination of the ChildToParent message
hash?BigNumberThe 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?BigNumberThe index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro
Returns

Promise<ChildToParentTransactionEvent & object[]>

Any classic and nitro events that match the provided filters.

Inherited from

ChildToParentMessage . getChildToParentEvents

Source

message/ChildToParentMessage.ts:109


ChildToParentMessageWriter

Provides read and write access for Child-to-Parent messages

Extends

Constructors

new ChildToParentMessageWriter()
new ChildToParentMessageWriter(
parentSigner: Signer,
event: ChildToParentTransactionEvent,
parentProvider?: Provider): ChildToParentMessageWriter

Instantiates a new ChildToParentMessageWriter object.

Parameters
ParameterTypeDescription
parentSignerSigner-
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
parentProvider?Provider-
Returns

ChildToParentMessageWriter

Overrides

ChildToParentMessageReader.constructor

Source

message/ChildToParentMessage.ts:296

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/ChildToParentMessage.ts:325

getFirstExecutableBlock()
getFirstExecutableBlock(childProvider: Provider): Promise<null | BigNumber>

Estimates the Parent block number in which this Child-to-Parent 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 block number where the Child-to-Parent message will be executable. Returns null if the message can or already has been executed

Inherited from

ChildToParentMessageReader . getFirstExecutableBlock

Source

message/ChildToParentMessage.ts:273

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

ChildToParentMessageReader . status

Source

message/ChildToParentMessage.ts:237

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

ChildToParentMessageReader . waitUntilReadyToExecute

Source

message/ChildToParentMessage.ts:252

fromEvent()
static fromEvent<T>(
parentSignerOrProvider: T,
event: ChildToParentTransactionEvent,
parentProvider?: Provider): ChildToParentMessageReaderOrWriter<T>

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentSignerOrProviderT-
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
parentProvider?Provider-
Returns

ChildToParentMessageReaderOrWriter<T>

Inherited from

ChildToParentMessageReader . fromEvent

Source

message/ChildToParentMessage.ts:76

getChildToParentEvents()
static getChildToParentEvents(
childProvider: Provider,
filter: object,
position?: BigNumber,
destination?: string,
hash?: BigNumber,
indexInBatch?: BigNumber): Promise<ChildToParentTransactionEvent & object[]>

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childProviderProvider
filterobjectBlock range filter
filter.fromBlockBlockTag-
filter.toBlock?BlockTag-
position?BigNumberThe 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?stringThe parent destination of the ChildToParent message
hash?BigNumberThe 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?BigNumberThe index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro
Returns

Promise<ChildToParentTransactionEvent & object[]>

Any classic and nitro events that match the provided filters.

Inherited from

ChildToParentMessageReader . getChildToParentEvents

Source

message/ChildToParentMessage.ts:109

Type Aliases

ChildToParentMessageReaderOrWriter<T>

type ChildToParentMessageReaderOrWriter<T>: T extends Provider ? ChildToParentMessageReader : ChildToParentMessageWriter;

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/ChildToParentMessage.ts:54