Skip to main content

ChildToParentMessageClassic

Classes

ChildToParentMessageReaderClassic

Defined in: message/ChildToParentMessageClassic.ts:190

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

Extended by

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
batchNumberreadonlyBigNumberundefinedThe number of the batch this message is part ofChildToParentMessageClassic.batchNumbermessage/ChildToParentMessageClassic.ts:108
indexInBatchreadonlyBigNumberundefinedThe index of this message in the batchChildToParentMessageClassic.indexInBatchmessage/ChildToParentMessageClassic.ts:113
outboxAddressprotectedstring | nullnullContains the classic outbox address, or set to zero address if this network did not have a classic outbox deployed-message/ChildToParentMessageClassic.ts:203

Methods

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

Defined in: message/ChildToParentMessageClassic.ts:386

Estimates the Parent Chain block number in which this Child-to-Parent tx will be available for execution

Parameters
ParameterTypeDescription
childProviderProvider
Returns

Promise<BigNumber | null>

Always returns null for classic chainToParentChain messages since they can be executed in any block now.

getOutboxAddress()
protected getOutboxAddress(childProvider: Provider, batchNumber: number): Promise<string>;

Defined in: message/ChildToParentMessageClassic.ts:211

Classic had 2 outboxes, we need to find the correct one for the provided batch number

Parameters
ParameterTypeDescription
childProviderProvider
batchNumbernumber
Returns

Promise<string>

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

Defined in: message/ChildToParentMessageClassic.ts:301

Check if given outbox message has already been executed

Parameters
ParameterType
childProviderProvider
Returns

Promise<boolean>

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

Defined in: message/ChildToParentMessageClassic.ts:339

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

Parameters
ParameterTypeDescription
childProviderProvider
Returns

Promise<ChildToParentMessageStatus>

tryGetProof()
tryGetProof(childProvider: Provider): Promise<MessageBatchProofInfo | null>;

Defined in: message/ChildToParentMessageClassic.ts:285

Get the execution proof for this message. Returns null if the batch does not exist yet.

Parameters
ParameterTypeDescription
childProviderProvider
Returns

Promise<MessageBatchProofInfo | null>

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

Defined in: message/ChildToParentMessageClassic.ts:364

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)

fromBatchNumber()
static fromBatchNumber<T>(
parentSignerOrProvider: T,
batchNumber: BigNumber,
indexInBatch: BigNumber,
parentProvider?: Provider): ChildToParentMessageReaderOrWriterClassic<T>;

Defined in: message/ChildToParentMessageClassic.ts:128

Instantiates a new ChildToParentMessageWriterClassic or ChildToParentMessageReaderClassic 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.
batchNumberBigNumberThe number of the batch containing the Child-to-Parent message.
indexInBatchBigNumberThe index of the Child-to-Parent message within the batch.
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

ChildToParentMessageReaderOrWriterClassic<T>

Inherited from
ChildToParentMessageClassic.fromBatchNumber

ChildToParentMessageWriterClassic

Defined in: message/ChildToParentMessageClassic.ts:397

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

Extends

Constructors

Constructor
new ChildToParentMessageWriterClassic(
parentSigner: Signer,
batchNumber: BigNumber,
indexInBatch: BigNumber,
parentProvider?: Provider): ChildToParentMessageWriterClassic;

Defined in: message/ChildToParentMessageClassic.ts:406

Instantiates a new ChildToParentMessageWriterClassic object.

Parameters
ParameterTypeDescription
parentSignerSignerThe signer to be used for executing the Child-to-Parent message.
batchNumberBigNumberThe number of the batch containing the Child-to-Parent message.
indexInBatchBigNumberThe index of the Child-to-Parent message within the batch.
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

ChildToParentMessageWriterClassic

Overrides
ChildToParentMessageReaderClassic.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
batchNumberreadonlyBigNumberundefinedThe number of the batch this message is part ofChildToParentMessageReaderClassic.batchNumbermessage/ChildToParentMessageClassic.ts:108
indexInBatchreadonlyBigNumberundefinedThe index of this message in the batchChildToParentMessageReaderClassic.indexInBatchmessage/ChildToParentMessageClassic.ts:113
outboxAddressprotectedstring | nullnullContains the classic outbox address, or set to zero address if this network did not have a classic outbox deployedChildToParentMessageReaderClassic.outboxAddressmessage/ChildToParentMessageClassic.ts:203

Methods

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

Defined in: message/ChildToParentMessageClassic.ts:421

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/ChildToParentMessageClassic.ts:386

Estimates the Parent Chain block number in which this Child-to-Parent tx will be available for execution

Parameters
ParameterTypeDescription
childProviderProvider
Returns

Promise<BigNumber | null>

Always returns null for classic chainToParentChain messages since they can be executed in any block now.

Inherited from

ChildToParentMessageReaderClassic.getFirstExecutableBlock

getOutboxAddress()
protected getOutboxAddress(childProvider: Provider, batchNumber: number): Promise<string>;

Defined in: message/ChildToParentMessageClassic.ts:211

Classic had 2 outboxes, we need to find the correct one for the provided batch number

Parameters
ParameterTypeDescription
childProviderProvider
batchNumbernumber
Returns

Promise<string>

Inherited from

ChildToParentMessageReaderClassic.getOutboxAddress

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

Defined in: message/ChildToParentMessageClassic.ts:301

Check if given outbox message has already been executed

Parameters
ParameterType
childProviderProvider
Returns

Promise<boolean>

Inherited from

ChildToParentMessageReaderClassic.hasExecuted

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

Defined in: message/ChildToParentMessageClassic.ts:339

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

Parameters
ParameterTypeDescription
childProviderProvider
Returns

Promise<ChildToParentMessageStatus>

Inherited from

ChildToParentMessageReaderClassic.status

tryGetProof()
tryGetProof(childProvider: Provider): Promise<MessageBatchProofInfo | null>;

Defined in: message/ChildToParentMessageClassic.ts:285

Get the execution proof for this message. Returns null if the batch does not exist yet.

Parameters
ParameterTypeDescription
childProviderProvider
Returns

Promise<MessageBatchProofInfo | null>

Inherited from

ChildToParentMessageReaderClassic.tryGetProof

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

Defined in: message/ChildToParentMessageClassic.ts:364

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

ChildToParentMessageReaderClassic.waitUntilOutboxEntryCreated

fromBatchNumber()
static fromBatchNumber<T>(
parentSignerOrProvider: T,
batchNumber: BigNumber,
indexInBatch: BigNumber,
parentProvider?: Provider): ChildToParentMessageReaderOrWriterClassic<T>;

Defined in: message/ChildToParentMessageClassic.ts:128

Instantiates a new ChildToParentMessageWriterClassic or ChildToParentMessageReaderClassic 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.
batchNumberBigNumberThe number of the batch containing the Child-to-Parent message.
indexInBatchBigNumberThe index of the Child-to-Parent message within the batch.
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

ChildToParentMessageReaderOrWriterClassic<T>

Inherited from

ChildToParentMessageReaderClassic.fromBatchNumber

Type Aliases

ChildToParentMessageReaderOrWriterClassic

type ChildToParentMessageReaderOrWriterClassic<T> = T extends Provider ? ChildToParentMessageReaderClassic : ChildToParentMessageWriterClassic;

Defined in: message/ChildToParentMessageClassic.ts:98

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