Skip to main content

ChildToParentMessage

Classes

ChildToParentMessage

Defined in: message/ChildToParentMessage.ts:60

Base functionality for Child-to-Parent messages

Extended by

Methods

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

Defined in: message/ChildToParentMessage.ts:76

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader 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.
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
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

ChildToParentMessageReaderOrWriter<T>

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

Defined in: message/ChildToParentMessage.ts:109

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childProviderProvider
filter{ fromBlock: BlockTag; toBlock: BlockTag; }Block 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.


ChildToParentMessageReader

Defined in: message/ChildToParentMessage.ts:201

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

Extends

Extended by

Methods

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

Defined in: message/ChildToParentMessage.ts:273

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<BigNumber | null>

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

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

Defined in: message/ChildToParentMessage.ts:237

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>

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

Defined in: message/ChildToParentMessage.ts:252

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)

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

Defined in: message/ChildToParentMessage.ts:76

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader 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.
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
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

ChildToParentMessageReaderOrWriter<T>

Inherited from

ChildToParentMessage.fromEvent

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

Defined in: message/ChildToParentMessage.ts:109

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childProviderProvider
filter{ fromBlock: BlockTag; toBlock: BlockTag; }Block 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


ChildToParentMessageWriter

Defined in: message/ChildToParentMessage.ts:285

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

Extends

Constructors

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

Defined in: message/ChildToParentMessage.ts:296

Instantiates a new ChildToParentMessageWriter object.

Parameters
ParameterTypeDescription
parentSignerSignerThe signer to be used for executing the Child-to-Parent message.
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
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

ChildToParentMessageWriter

Overrides
ChildToParentMessageReader.constructor

Methods

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

Defined in: message/ChildToParentMessage.ts:325

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>

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

Defined in: message/ChildToParentMessage.ts:273

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<BigNumber | null>

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

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

Defined in: message/ChildToParentMessage.ts:237

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

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

Defined in: message/ChildToParentMessage.ts:252

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

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

Defined in: message/ChildToParentMessage.ts:76

Instantiates a new ChildToParentMessageWriter or ChildToParentMessageReader 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.
eventChildToParentTransactionEventThe event containing the data of the Child-to-Parent message.
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

ChildToParentMessageReaderOrWriter<T>

Inherited from

ChildToParentMessageReader.fromEvent

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

Defined in: message/ChildToParentMessage.ts:109

Get event logs for ChildToParent transactions.

Parameters
ParameterTypeDescription
childProviderProvider
filter{ fromBlock: BlockTag; toBlock: BlockTag; }Block 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

Type Aliases

ChildToParentMessageReaderOrWriter

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

Defined in: message/ChildToParentMessage.ts:54

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