• Send a message to another peer using a given path (list of node addresses that should relay our message through network). If no path is given, HOPR will attempt to find a path.

    Parameters

    • payload: {
          apiEndpoint: string | URL;
          apiToken: string;
          body: string;
          destination?: string;
          hops?: number;
          path?: string[];
          peerId?: string;
          tag: number;
          timeout?: number;
      }
      • apiEndpoint: string | URL

        The API endpoint for authentication.

      • apiToken: string

        The API token for authentication.

      • body: string
      • Optional destination?: string
      • Optional hops?: number
      • Optional path?: string[]
      • Optional peerId?: string
      • tag: number
      • Optional timeout?: number

        optional timeout for the requests

    Returns Promise<string>

    • A promise that resolves to the sent message.