Function peekAllMessages

  • Peek the list of messages currently present in the nodes message inbox, filtered by tag, and optionally by timestamp (epoch in milliseconds). The messages are not removed from the inbox.

    Parameters

    • payload: {
          apiEndpoint: string | URL;
          apiToken: string;
          tag?: null | number;
          timeout?: number;
      }
      • apiEndpoint: string | URL

        The API endpoint for authentication.

      • apiToken: string

        The API token for authentication.

      • Optional tag?: null | number
      • Optional timeout?: number

        optional timeout for the requests

    Returns Promise<{
        messages: {
            body: string;
            receivedAt: number;
            tag: number;
        }[];
    }>

    • A promise that resolves to the list of messages currently present in the nodes message inbox.