Skip to main content

Module: inbox/inbox

InboxTools

Tools for interacting with the inbox and bridge contracts

Properties

PropertyTypeDescription
private readonly parentChainProviderProviderParent chain provider

Methods

estimateArbitrumGas()

private estimateArbitrumGas(childChainTransactionRequest, childChainProvider): Promise< GasComponentsWithChildChainPart >

We should use nodeInterface to get the gas estimate is because we are making a delayed inbox message which doesn't need parentChain calldata gas fee part.

Parameters
ParameterType
childChainTransactionRequestRequiredTransactionRequestType
childChainProviderProvider
Returns

Promise< GasComponentsWithChildChainPart >

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:122


findFirstBlockBelow()

private findFirstBlockBelow(blockNumber, blockTimestamp): Promise< Block >

Find the first (or close to first) block whose number is below the provided number, and whose timestamp is below the provided timestamp

Parameters
ParameterTypeDescription
blockNumbernumber
blockTimestampnumber
Returns

Promise< Block >

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:82


forceInclude()

forceInclude&lt;T&gt;(messageDeliveredEvent?, overrides?): Promise< T extends ForceInclusionParams ? ContractTransaction : null | ContractTransaction >

Force includes all eligible messages in the delayed inbox. The inbox contract doesn't allow a message to be force-included until after a delay period has been completed.

Type parameters
Parameter
T extends undefined | ForceInclusionParams
Parameters
ParameterTypeDescription
messageDeliveredEvent?TProvide this to include all messages up to this one. Responsibility is on the caller to check the eligibility of this event.
overrides?Overrides-
Returns

Promise< T extends ForceInclusionParams ? ContractTransaction : null | ContractTransaction >

The force include transaction, or null if no eligible message were found for inclusion

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:308


getEventsAndIncreaseRange()

private getEventsAndIncreaseRange(
bridge,
searchRangeBlocks,
maxSearchRangeBlocks,
rangeMultiplier): Promise< FetchedEvent< MessageDeliveredEvent >[] >

Look for force includable events in the search range blocks, if no events are found the search range is increased incrementally up to the max search range blocks.

Parameters
ParameterTypeDescription
bridgeBridge
searchRangeBlocksnumber
maxSearchRangeBlocksnumber
rangeMultipliernumber-
Returns

Promise< FetchedEvent< MessageDeliveredEvent >[] >

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:208


getForceIncludableBlockRange()

private getForceIncludableBlockRange(blockNumberRangeSize): Promise< {endBlock: number; startBlock: number;} >

Get a range of blocks within messages eligible for force inclusion emitted events

Parameters
ParameterTypeDescription
blockNumberRangeSizenumber
Returns

Promise< {endBlock: number; startBlock: number;} >

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:154


getForceIncludableEvent()

getForceIncludableEvent(
maxSearchRangeBlocks = ...,
startSearchRangeBlocks = 100,
rangeMultiplier = 2): Promise< null | ForceInclusionParams >

Find the event of the latest message that can be force include

Parameters
ParameterTypeDefault valueDescription
maxSearchRangeBlocksnumberundefinedThe max range of blocks to search in.
Defaults to 3 * 6545 ( = ~3 days) prior to the first eligible block
startSearchRangeBlocksnumber100The start range of block to search in.
Moves incrementally up to the maxSearchRangeBlocks. Defaults to 100;
rangeMultipliernumber2The multiplier to use when increasing the block range
Defaults to 2.
Returns

Promise< null | ForceInclusionParams >

Null if non can be found.

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:259


sendChildChainSignedTx()

sendChildChainSignedTx(signedTx): Promise< null | ContractTransaction >

Send Child Chain signed tx using delayed inbox, which won't alias the sender's address It will be automatically included by the sequencer on Chain, if it isn't included within 24 hours, you can force include it

Parameters
ParameterTypeDescription
signedTxstringA signed transaction which can be sent directly to chain,
you can call inboxTools.signChainMessage to get.
Returns

Promise< null | ContractTransaction >

The parentChain delayed inbox's transaction itself.

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:353


signChildChainTx()

signChildChainTx(txRequest, childChainSigner): Promise< string >

Sign a transaction with msg.to, msg.value and msg.data. You can use this as a helper to call inboxTools.sendChainSignedMessage above.

Parameters
ParameterTypeDescription
txRequestRequiredTransactionRequestType-
childChainSignerSignerethers Signer type, used to sign Chain transaction
Returns

Promise< string >

The parentChain delayed inbox's transaction signed data.

Source

arbitrum-sdk/src/lib/inbox/inbox.ts:381