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

Specifies expected behaviour of an HTTP client.

Summary

Types

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

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()
) :: success_response() | error_response()