• Opens a HOPR channel given a payload that specifies the API endpoint of the HOPR node, the peerId, and the amount of HOPR tokens to be staked in the channel.

    This operation may take more than 5 minutes to complete as it involves on-chain operations.

    Parameters

    • payload: {
          amount: string;
          apiEndpoint: string | URL;
          apiToken: string;
          destination?: string;
          peerAddress?: string;
          timeout?: number;
      }
      • amount: string
      • apiEndpoint: string | URL

        The API endpoint for authentication.

      • apiToken: string

        The API token for authentication.

      • Optional destination?: string
      • Optional peerAddress?: string
      • Optional timeout?: number

        optional timeout for the requests

    Returns Promise<{
        channelId: string;
        transactionReceipt: string;
    }>

    A Promise that resolves with the response of the open channel operation.

    Throws

    APIError - If the operation fails. The error object contains the status code and the error message.