View Source Soroban.RPC.Client.Spec behaviour (Soroban v0.3.0)

Specifies expected behaviour of an HTTP client.

Link to this section Summary

Link to this section Types

@type endpoint() :: String.t()
@type headers() :: [{binary(), binary()}, ...]
@type options() :: Keyword.t()
@type params() :: map() | nil
@type response() :: {:ok, map()}
@type response_error() :: {:error, Soroban.RPC.Error.t()}

Link to this section Callbacks

Link to this callback

request(endpoint, url, headers, params, options)

View Source
@callback request(
  endpoint :: endpoint(),
  url :: binary(),
  headers :: headers(),
  params :: params(),
  options :: options()
) :: response() | response_error()