import { BigNumber, providers } from 'ethers'; import { Inbox, Outbox } from '@abacus-network/core'; import { types } from '@abacus-network/utils'; import { MultiProvider } from '../providers/MultiProvider'; import { ChainName, NameOrDomain } from '../types'; import { AbacusCore } from './AbacusCore'; import { AnnotatedDispatch, AnnotatedLifecycleEvent, AnnotatedProcess } from './events'; export declare const resolveDomain: (nameOrDomain: NameOrDomain) => ChainName; export declare const resolveId: (nameOrDomain: NameOrDomain) => number; export declare const resolveNetworks: (message: types.ParsedMessage) => { origin: ChainName; destination: ChainName; }; export declare type AbacusStatus = { status: MessageStatus; events: AnnotatedLifecycleEvent[]; }; export declare enum MessageStatus { Dispatched = 0, Included = 1, Relayed = 2, Processed = 3 } export declare enum InboxMessageStatus { None = 0, Proven = 1, Processed = 2 } export declare type EventCache = { process?: AnnotatedProcess; }; /** * A deserialized Abacus message. */ export declare class AbacusMessage { readonly dispatch: AnnotatedDispatch; readonly message: types.ParsedMessage; readonly outbox: Outbox; readonly inbox: Inbox; readonly multiProvider: MultiProvider; readonly core: AbacusCore; protected cache: EventCache; constructor(multiProvider: MultiProvider, core: AbacusCore, dispatch: AnnotatedDispatch); /** * The receipt of the TX that dispatched this message */ get receipt(): providers.TransactionReceipt; /** * Instantiate one or more messages from a receipt. * * @param core the {@link AbacusCore} object to use * @param nameOrDomain the domain on which the receipt was logged * @param receipt the receipt * @returns an array of {@link AbacusMessage} objects */ static fromReceipt(multiProvider: MultiProvider, core: AbacusCore, nameOrDomain: NameOrDomain, receipt: providers.TransactionReceipt): AbacusMessage[]; /** * Instantiate EXACTLY one message from a receipt. * * @param core the {@link AbacusCore} object to use * @param nameOrDomain the domain on which the receipt was logged * @param receipt the receipt * @returns an array of {@link AbacusMessage} objects * @throws if there is not EXACTLY 1 dispatch in the receipt */ static singleFromReceipt(multiProvider: MultiProvider, core: AbacusCore, nameOrDomain: NameOrDomain, receipt: providers.TransactionReceipt): AbacusMessage; /** * Instantiate one or more messages from a tx hash. * * @param core the {@link AbacusCore} object to use * @param nameOrDomain the domain on which the receipt was logged * @param receipt the receipt * @returns an array of {@link AbacusMessage} objects * @throws if there is no receipt for the TX */ static fromTransactionHash(multiProvider: MultiProvider, core: AbacusCore, nameOrDomain: NameOrDomain, transactionHash: string): Promise; /** * Instantiate EXACTLY one message from a transaction has. * * @param core the {@link AbacusCore} object to use * @param nameOrDomain the domain on which the receipt was logged * @param receipt the receipt * @returns an array of {@link AbacusMessage} objects * @throws if there is no receipt for the TX, or if not EXACTLY 1 dispatch in * the receipt */ static singleFromTransactionHash(multiProvider: MultiProvider, core: AbacusCore, nameOrDomain: NameOrDomain, transactionHash: string): Promise; /** * Get the Inbox `Process` event associated with this message (if any) * * @returns An {@link AnnotatedProcess} (if any) */ getProcess(): Promise; /** * Get all lifecycle events associated with this message * * @returns An array of {@link AnnotatedLifecycleEvent} objects */ events(): Promise; /** * Retrieve the inbox status of this message. * * @returns The {@link InboxMessageStatus} corresponding to the solidity * status of the message. */ inboxStatus(): Promise; /** * Checks whether the message has been delivered. * * @returns true if processed, else false. */ delivered(): Promise; /** * Returns a promise that resolves when the message has been delivered. * * WARNING: May never resolve. Oftern takes hours to resolve. * * @param opts Polling options. */ wait(opts?: { pollTime?: number; }): Promise; /** * The domain from which the message was sent. */ get origin(): number; get originName(): ChainName; /** * The identifier for the sender of this message */ get sender(): string; /** * The destination domain for this message */ get destination(): number; get destinationName(): ChainName; /** * The identifer for the recipient for this message */ get recipient(): string; /** * The message body */ get body(): string; /** * The keccak256 hash of the message body */ get bodyHash(): string; /** * The hash of the transaction that dispatched this message */ get transactionHash(): string; /** * The messageHash committed to the tree in the Outbox contract. */ get leaf(): string; /** * The index of the leaf in the contract. */ get leafIndex(): BigNumber; } //# sourceMappingURL=message.d.ts.map