Skip to main content

L1ToL2Message

Classes

EthDepositMessage

A message for Eth deposits from L1 to L2

Constructors

new EthDepositMessage()
new EthDepositMessage(
l2Provider: Provider,
l2ChainId: number,
messageNumber: BigNumber,
from: string,
to: string,
value: BigNumber): EthDepositMessage
Parameters
ParameterTypeDescription
l2ProviderProvider
l2ChainIdnumber
messageNumberBigNumber
fromstring-
tostringRecipient address of the ETH on L2
valueBigNumber
Returns

EthDepositMessage

Source

message/L1ToL2Message.ts:823

Properties

PropertyModifierTypeDescription
l2ChainIdreadonlynumber-
l2ProviderprivateProvider-
messageNumberreadonlyBigNumber-
toreadonlystringRecipient address of the ETH on L2
valuereadonlyBigNumber-

Methods

fromEventComponents()
static fromEventComponents(
l2Provider: Provider,
messageNumber: BigNumber,
senderAddr: string,
inboxMessageEventData: string): Promise<EthDepositMessage>

Create an EthDepositMessage from data emitted in event when calling ethDeposit on Inbox.sol

Parameters
ParameterTypeDescription
l2ProviderProvider
messageNumberBigNumberThe message number in the Inbox.InboxMessageDelivered event
senderAddrstringThe sender address from Bridge.MessageDelivered event
inboxMessageEventDatastringThe data field from the Inbox.InboxMessageDelivered event
Returns

Promise <EthDepositMessage>

Source

message/L1ToL2Message.ts:794

parseEthDepositData()
static private parseEthDepositData(eventData: string): object

Parse the data field in event InboxMessageDelivered(uint256 indexed messageNum, bytes data);

Parameters
ParameterTypeDescription
eventDatastring
Returns

object

destination and amount

MemberType
tostring
valueBigNumber
Source

message/L1ToL2Message.ts:773

Type Aliases

L1ToL2MessageReaderOrWriter<T>

type L1ToL2MessageReaderOrWriter<T>: T extends Provider ? L1ToL2MessageReader : L1ToL2MessageWriter;

Conditional type for Signer or Provider. If T is of type Provider then L1ToL2MessageReaderOrWriter<T> will be of type L1ToL2MessageReader. If T is of type Signer then L1ToL2MessageReaderOrWriter<T> will be of type L1ToL2MessageWriter.

Type parameters

Type parameter
T extends SignerOrProvider

Source

message/L1ToL2Message.ts:94


L1ToL2MessageWaitResult

type L1ToL2MessageWaitResult: object | object;

If the status is redeemed an l2TxReceipt is populated. For all other statuses l2TxReceipt is not populated

Source

message/L1ToL2Message.ts:236