Implementation of the Sender interface that can be used to send requests to a snap through the snap JSON-RPC API.

Implements

Constructors

Methods

Constructors

Methods

  • Send a request to the snap and return the response.

    Parameters

    • request: {
          id: null | string | number;
          jsonrpc: "2.0";
          method: string;
          params?: Json[] | Record<string, Json>;
      }

      The JSON-RPC request to send to the snap.

      • id: null | string | number
      • jsonrpc: "2.0"
      • method: string
      • Optional params?: Json[] | Record<string, Json>

    Returns Promise<Json>

    A promise that resolves to the response of the request.