Skip to main content

ChildToParentMessage

Classes

ChildToParentMessage

Base functionality for Chain->ParentChain messages

Extended by

Methods

fromEvent()
static fromEvent<T>(
parentChainSignerOrProvider: T,
event: ChildToParentTransactionEvent,
parentChainProvider?: Provider): ChildToParentMessageReaderOrWriter<T>

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentChainSignerOrProviderT-
eventChildToParentTransactionEventThe event containing the data of the Chain-to-ParentChain message.
parentChainProvider?Provider-
Returns

ChildToParentMessageReaderOrWriter<T>

Source

message/ChildToParentMessage.ts:76

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

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childChainProviderProvider
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 ParentChain 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 Chain-to-ParentChain-messages

Extends

Extended by

Methods

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

Estimates the ParentChain block number in which this Chain to ParentChain tx will be available for execution. If the message can or already has been executed, this returns null

Parameters
ParameterTypeDescription
childChainProviderProvider
Returns

Promise<null | BigNumber>

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

Source

message/ChildToParentMessage.ts:277

status()
status(childChainProvider: 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
childChainProviderProvider
Returns

Promise<ChildToParentMessageStatus>

Source

message/ChildToParentMessage.ts:237

waitUntilReadyToExecute()
waitUntilReadyToExecute(childChainProvider: 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
childChainProviderProviderundefined-
retryDelaynumber500
Returns

Promise<CONFIRMED | EXECUTED>

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

Source

message/ChildToParentMessage.ts:253

fromEvent()
static fromEvent<T>(
parentChainSignerOrProvider: T,
event: ChildToParentTransactionEvent,
parentChainProvider?: Provider): ChildToParentMessageReaderOrWriter<T>

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentChainSignerOrProviderT-
eventChildToParentTransactionEventThe event containing the data of the Chain-to-ParentChain message.
parentChainProvider?Provider-
Returns

ChildToParentMessageReaderOrWriter<T>

Inherited from

ChildToParentMessage . fromEvent

Source

message/ChildToParentMessage.ts:76

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

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childChainProviderProvider
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 ParentChain 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 Chain-to-ParentChain-messages

Extends

Constructors

new ChildToParentMessageWriter()
new ChildToParentMessageWriter(
parentChainSigner: Signer,
event: ChildToParentTransactionEvent,
parentChainProvider?: Provider): ChildToParentMessageWriter

Instantiates a new ChildToParentMessageWriter object.

Parameters
ParameterTypeDescription
parentChainSignerSigner-
eventChildToParentTransactionEventThe event containing the data of the Chain-to-ParentChain message.
parentChainProvider?Provider-
Returns

ChildToParentMessageWriter

Overrides

ChildToParentMessageReader.constructor

Source

message/ChildToParentMessage.ts:300

Methods

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

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

Parameters
ParameterType
childChainProviderProvider
overrides?Overrides
Returns

Promise<ContractTransaction>

Source

message/ChildToParentMessage.ts:329

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

Estimates the ParentChain block number in which this Chain to ParentChain tx will be available for execution. If the message can or already has been executed, this returns null

Parameters
ParameterTypeDescription
childChainProviderProvider
Returns

Promise<null | BigNumber>

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

Inherited from

ChildToParentMessageReader . getFirstExecutableBlock

Source

message/ChildToParentMessage.ts:277

status()
status(childChainProvider: 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
childChainProviderProvider
Returns

Promise<ChildToParentMessageStatus>

Inherited from

ChildToParentMessageReader . status

Source

message/ChildToParentMessage.ts:237

waitUntilReadyToExecute()
waitUntilReadyToExecute(childChainProvider: 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
childChainProviderProviderundefined-
retryDelaynumber500
Returns

Promise<CONFIRMED | EXECUTED>

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

Inherited from

ChildToParentMessageReader . waitUntilReadyToExecute

Source

message/ChildToParentMessage.ts:253

fromEvent()
static fromEvent<T>(
parentChainSignerOrProvider: T,
event: ChildToParentTransactionEvent,
parentChainProvider?: Provider): ChildToParentMessageReaderOrWriter<T>

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader object.

Type parameters
Type parameter
T extends SignerOrProvider
Parameters
ParameterTypeDescription
parentChainSignerOrProviderT-
eventChildToParentTransactionEventThe event containing the data of the Chain-to-ParentChain message.
parentChainProvider?Provider-
Returns

ChildToParentMessageReaderOrWriter<T>

Inherited from

ChildToParentMessageReader . fromEvent

Source

message/ChildToParentMessage.ts:76

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

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childChainProviderProvider
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 ParentChain 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