Skip to main content

inbox

Classes

InboxTools

Tools for interacting with the inbox and bridge contracts

Methods

forceInclude()
forceInclude<T>(messageDeliveredEvent?: T, overrides?: Overrides): Promise<T extends ForceInclusionParams ? ContractTransaction : null | ContractTransaction>

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

Type Parameters
Type 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

Defined in

inbox/inbox.ts:304

getForceIncludableEvent()
getForceIncludableEvent(
maxSearchRangeBlocks: number,
startSearchRangeBlocks: number,
rangeMultipler: number): Promise<null | ForceInclusionParams>

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

Parameters
ParameterTypeDefault valueDescription
maxSearchRangeBlocksnumber...The max range of blocks to search in. Defaults to 3 * 6545 ( = ~3 days) prior to the first eligble block
startSearchRangeBlocksnumber100The start range of block to search in. Moves incrementally up to the maxSearchRangeBlocks. Defaults to 100;
rangeMultiplernumber2-
Returns

Promise<null | ForceInclusionParams>

Null if non can be found.

Defined in

inbox/inbox.ts:255

sendL2SignedTx()
sendL2SignedTx(signedTx: string): Promise<null | ContractTransaction>

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

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

Promise<null | ContractTransaction>

The l1 delayed inbox's transaction itself.

Defined in

inbox/inbox.ts:349

signL2Tx()
signL2Tx(txRequest: RequiredTransactionRequestType, l2Signer: Signer): Promise<string>

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

Parameters
ParameterTypeDescription
txRequestRequiredTransactionRequestType-
l2SignerSignerethers Signer type, used to sign l2 transaction
Returns

Promise<string>

The l1 delayed inbox's transaction signed data.

Defined in

inbox/inbox.ts:377