You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.3 KiB
62 lines
1.3 KiB
import type { providers } from 'ethers';
|
|
|
|
// TODO consider reconciling with SDK's MessageStatus
|
|
export enum MessageStatus {
|
|
Unknown = 'unknown',
|
|
Pending = 'pending',
|
|
Delivered = 'delivered',
|
|
Failing = 'failing',
|
|
}
|
|
|
|
export interface MessageTxStub {
|
|
timestamp: number;
|
|
hash: string;
|
|
from: Address;
|
|
}
|
|
|
|
export interface MessageTx extends MessageTxStub {
|
|
to: Address;
|
|
blockHash: string;
|
|
blockNumber: number;
|
|
mailbox: Address;
|
|
nonce: number;
|
|
gasLimit: number;
|
|
gasPrice: number;
|
|
effectiveGasPrice;
|
|
gasUsed: number;
|
|
cumulativeGasUsed: number;
|
|
maxFeePerGas: number;
|
|
maxPriorityPerGas: number;
|
|
}
|
|
|
|
export interface MessageStub {
|
|
status: MessageStatus;
|
|
id: string; // Database id
|
|
msgId: string; // Message hash
|
|
nonce: number; // formerly leafIndex
|
|
sender: Address;
|
|
recipient: Address;
|
|
originChainId: ChainId;
|
|
originDomainId: number;
|
|
destinationChainId: ChainId;
|
|
destinationDomainId: number;
|
|
origin: MessageTxStub;
|
|
destination?: MessageTxStub;
|
|
isPiMsg?: boolean;
|
|
}
|
|
|
|
export interface Message extends MessageStub {
|
|
body: string;
|
|
decodedBody?: string;
|
|
origin: MessageTx;
|
|
destination?: MessageTx;
|
|
totalGasAmount?: string;
|
|
totalPayment?: string;
|
|
numPayments?: number;
|
|
}
|
|
|
|
export interface ExtendedLog extends providers.Log {
|
|
timestamp?: number;
|
|
from?: Address;
|
|
to?: Address;
|
|
}
|
|
|