View Source Soroban.RPC.Request (Soroban v0.12.0)

A module to work with Soroban RPC requests. Requests are composed in a functional manner. The request does not happen until it is configured and passed to perform/1.

Summary

Types

@type endpoint() :: String.t()
@type headers() :: [{binary(), binary()}]
@type opts() :: Keyword.t()
@type params() :: map() | nil
@type parsed_response() ::
  {:ok, struct()}
  | {:error, Soroban.RPC.Error.t()}
  | {:error, Soroban.RPC.HTTPError.t()}
@type response() ::
  {:ok, map()}
  | {:error, Soroban.RPC.Error.t()}
  | {:error, Soroban.RPC.HTTPError.t()}
@type t() :: %Soroban.RPC.Request{
  endpoint: endpoint(),
  headers: headers(),
  params: params(),
  url: url()
}
@type url() :: String.t()

Functions

Link to this function

add_headers(request, headers)

View Source
@spec add_headers(request :: t(), headers :: headers()) :: t()
Link to this function

add_params(request, params)

View Source
@spec add_params(request :: t(), params :: params()) :: t()
Link to this function

new(endpoint, opts \\ [])

View Source
@spec new(endpoint :: endpoint(), opts :: opts()) :: t()
@spec perform(request :: t()) :: response()
@spec results(response :: response(), opts :: opts()) :: parsed_response()