Module: message/ChildToParentMessage
ChildToParentMessage
Base functionality for Chain->ParentChain messages
Extended By
Methods
fromEvent()
static fromEvent<T>(
parentChainSignerOrProvider,
event,
parentChainProvider?): ChildToParentMessageReaderOrWriter< T >
Instantiates a new ChildToParentMessageWriter
or ChildToParentMessageReader
object.
Type parameters
Parameter |
---|
T extends SignerOrProvider |
Parameters
Parameter | Type | Description |
---|---|---|
parentChainSignerOrProvider | T | - |
event | ChildToParentTransactionEvent | The event containing the data of the Chain-to-ParentChain message. |
parentChainProvider ? | Provider | - |
Returns
ChildToParentMessageReaderOrWriter
< T
>
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:76
getChildToParentEvents()
static getChildToParentEvents(
childChainProvider,
filter,
position?,
destination?,
hash?,
indexInBatch?): Promise< Object[] >
Get event logs for ChildToParent transactions.
Parameters
Parameter | Type | Description |
---|---|---|
childChainProvider | Provider | |
filter | object | Block range filter |
filter.fromBlock | BlockTag | - |
filter.toBlock ? | BlockTag | - |
position ? | BigNumber | The 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 ? | string | The ParentChain destination of the ChildToParent message |
hash ? | BigNumber | The 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 ? | BigNumber | The index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro |
Returns
Promise
< Object
[] >
Any classic and nitro events that match the provided filters.
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:109
ChildToParentMessageReader
Provides read-only access for Chain-to-ParentChain-messages
Extends
Methods
getFirstExecutableBlock()
getFirstExecutableBlock(childChainProvider): 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
Parameter | Type | Description |
---|---|---|
childChainProvider | Provider |
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
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:277
status()
status(childChainProvider): Promise< ChildToParentMessageStatus >
Get the status of this message In order to check if the message has been executed proof info must be provided.
Parameters
Parameter | Type |
---|---|
childChainProvider | Provider |
Returns
Promise
< ChildToParentMessageStatus
>
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:237
waitUntilReadyToExecute()
waitUntilReadyToExecute(childChainProvider, retryDelay = 500): 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
Parameter | Type | Default value | Description |
---|---|---|---|
childChainProvider | Provider | undefined | - |
retryDelay | number | 500 |
Returns
Promise
< CONFIRMED
| EXECUTED
>
outbox entry status (either executed or confirmed but not pending)
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:253
fromEvent()
static fromEvent<T>(
parentChainSignerOrProvider,
event,
parentChainProvider?): ChildToParentMessageReaderOrWriter< T >
Instantiates a new ChildToParentMessageWriter
or ChildToParentMessageReader
object.
Type parameters
Parameter |
---|
T extends SignerOrProvider |
Parameters
Parameter | Type | Description |
---|---|---|
parentChainSignerOrProvider | T | - |
event | ChildToParentTransactionEvent | The event containing the data of the Chain-to-ParentChain message. |
parentChainProvider ? | Provider | - |
Returns
ChildToParentMessageReaderOrWriter
< T
>
Inherited from
ChildToParentMessage
.fromEvent
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:76
getChildToParentEvents()
static getChildToParentEvents(
childChainProvider,
filter,
position?,
destination?,
hash?,
indexInBatch?): Promise< Object[] >
Get event logs for ChildToParent transactions.
Parameters
Parameter | Type | Description |
---|---|---|
childChainProvider | Provider | |
filter | object | Block range filter |
filter.fromBlock | BlockTag | - |
filter.toBlock ? | BlockTag | - |
position ? | BigNumber | The 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 ? | string | The ParentChain destination of the ChildToParent message |
hash ? | BigNumber | The 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 ? | BigNumber | The index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro |
Returns
Promise
< Object
[] >
Any classic and nitro events that match the provided filters.
Inherited from
ChildToParentMessage
.getChildToParentEvents
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:109
ChildToParentMessageWriter
Provides read and write access for Chain-to-ParentChain-messages
Extends
Constructors
constructor()
new ChildToParentMessageWriter(
parentChainSigner,
event,
parentChainProvider?): ChildToParentMessageWriter
Instantiates a new ChildToParentMessageWriter
object.
Parameters
Parameter | Type | Description |
---|---|---|
parentChainSigner | Signer | - |
event | ChildToParentTransactionEvent | The event containing the data of the Chain-to-ParentChain message. |
parentChainProvider ? | Provider | - |
Returns
Overrides
ChildToParentMessageReader.constructor
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:300
Methods
execute()
execute(childChainProvider, 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
Parameter | Type |
---|---|
childChainProvider | Provider |
overrides ? | Overrides |
Returns
Promise
< ContractTransaction
>
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:329
getFirstExecutableBlock()
getFirstExecutableBlock(childChainProvider): 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
Parameter | Type | Description |
---|---|---|
childChainProvider | Provider |
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
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:277
status()
status(childChainProvider): Promise< ChildToParentMessageStatus >
Get the status of this message In order to check if the message has been executed proof info must be provided.
Parameters
Parameter | Type |
---|---|
childChainProvider | Provider |
Returns
Promise
< ChildToParentMessageStatus
>
Inherited from
ChildToParentMessageReader
.status
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:237
waitUntilReadyToExecute()
waitUntilReadyToExecute(childChainProvider, retryDelay = 500): 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
Parameter | Type | Default value | Description |
---|---|---|---|
childChainProvider | Provider | undefined | - |
retryDelay | number | 500 |
Returns
Promise
< CONFIRMED
| EXECUTED
>
outbox entry status (either executed or confirmed but not pending)
Inherited from
ChildToParentMessageReader
.waitUntilReadyToExecute
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:253
fromEvent()
static fromEvent<T>(
parentChainSignerOrProvider,
event,
parentChainProvider?): ChildToParentMessageReaderOrWriter< T >
Instantiates a new ChildToParentMessageWriter
or ChildToParentMessageReader
object.
Type parameters
Parameter |
---|
T extends SignerOrProvider |
Parameters
Parameter | Type | Description |
---|---|---|
parentChainSignerOrProvider | T | - |
event | ChildToParentTransactionEvent | The event containing the data of the Chain-to-ParentChain message. |
parentChainProvider ? | Provider | - |
Returns
ChildToParentMessageReaderOrWriter
< T
>
Inherited from
ChildToParentMessageReader
.fromEvent
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:76
getChildToParentEvents()
static getChildToParentEvents(
childChainProvider,
filter,
position?,
destination?,
hash?,
indexInBatch?): Promise< Object[] >
Get event logs for ChildToParent transactions.
Parameters
Parameter | Type | Description |
---|---|---|
childChainProvider | Provider | |
filter | object | Block range filter |
filter.fromBlock | BlockTag | - |
filter.toBlock ? | BlockTag | - |
position ? | BigNumber | The 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 ? | string | The ParentChain destination of the ChildToParent message |
hash ? | BigNumber | The 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 ? | BigNumber | The index in the batch, only valid for pre-nitro events. This parameter is ignored post-nitro |
Returns
Promise
< Object
[] >
Any classic and nitro events that match the provided filters.
Inherited from
ChildToParentMessageReader
.getChildToParentEvents
Source
arbitrum-sdk/src/lib/message/ChildToParentMessage.ts:109
ChildToParentMessageReaderOrWriter
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
Parameter |
---|
T extends SignerOrProvider |