Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NomadMessage<T>

A deserialized Nomad message.

Type parameters

Hierarchy

  • NomadMessage

Index

Constructors

Properties

cache: EventCache
context: T
home: Home
message: ParsedMessage
replica: Replica

Accessors

  • get body(): string
  • get bodyHash(): string
  • get committedRoot(): string
  • get destination(): number
  • get destinationAndNonce(): BigNumber
  • get from(): number
  • get leaf(): string
  • get leafIndex(): BigNumber
  • get nonce(): number
  • get origin(): number
  • get receipt(): TransactionReceipt
  • get recipient(): string
  • get sender(): string
  • get transactionHash(): string

Methods

  • confirmAt(): Promise<BigNumber>
  • Returns the timestamp after which it is possible to process this message.

    Note: return the timestamp after which it is possible to process messages within an Update. The timestamp is most relevant during the time AFTER the Update has been Relayed to the Replica and BEFORE the message in question has been Processed.

    Considerations:

    • the timestamp will be 0 if the Update has not been relayed to the Replica
    • after the Update has been relayed to the Replica, the timestamp will be non-zero forever (even after all messages in the Update have been processed)
    • if the timestamp is in the future, the challenge period has not elapsed yet; messages in the Update cannot be processed yet
    • if the timestamp is in the past, this does not necessarily mean that all messages in the Update have been processed

    Returns Promise<BigNumber>

    The timestamp at which a message can confirm

  • delivered(): Promise<boolean>
  • wait(opts?: { pollTime?: number }): Promise<void>
  • Returns a promise that resolves when the message has been delivered.

    WARNING: May never resolve. Oftern takes hours to resolve.

    Parameters

    • Optional opts: { pollTime?: number }

      Polling options.

      • Optional pollTime?: number

    Returns Promise<void>

  • baseFromReceipt<T>(context: T, nameOrDomain: string | number, receipt: TransactionReceipt): NomadMessage<T>[]
  • baseFromTransactionHash<T>(context: T, nameOrDomain: string | number, transactionHash: string): Promise<NomadMessage<T>[]>
  • baseSingleFromReceipt<T>(context: T, nameOrDomain: string | number, receipt: TransactionReceipt): NomadMessage<T>
  • Instantiate EXACTLY one message from a receipt.

    throws

    if there is not EXACTLY 1 dispatch in the receipt

    Type parameters

    Parameters

    • context: T

      the NomadContext object to use

    • nameOrDomain: string | number

      the domain on which the receipt was logged

    • receipt: TransactionReceipt

      the receipt

    Returns NomadMessage<T>

    an array of NomadMessage objects

  • baseSingleFromTransactionHash<T>(context: T, nameOrDomain: string | number, transactionHash: string): Promise<NomadMessage<T>>
  • Instantiate EXACTLY one message from a transaction has.

    throws

    if there is no receipt for the TX, or if not EXACTLY 1 dispatch in the receipt

    Type parameters

    Parameters

    • context: T

      the NomadContext object to use

    • nameOrDomain: string | number

      the domain on which the receipt was logged

    • transactionHash: string

    Returns Promise<NomadMessage<T>>

    an array of NomadMessage objects

Generated using TypeDoc