Raxol.Payments.Riddler.Client (Raxol Payments v0.2.0)

Copy Markdown View Source

Elixir client for the Riddler Commerce API.

Wraps the five Commerce endpoints with typed request/response schemas:

Configuration

config = %{
  base_url: "https://riddler.example.com",
  api_key: "bearer-token-here"
}

{:ok, chains} = Riddler.Client.get_chains(config)

Summary

Functions

List supported chains.

Get a cross-chain transfer quote.

List supported routes.

Get order status by ID.

Submit a signed order.

Types

config()

@type config() :: %{base_url: String.t(), api_key: String.t()}

error()

@type error() :: {:error, {:http, integer(), term()}} | {:error, term()}

Functions

get_chains(config)

@spec get_chains(config()) ::
  {:ok, [Raxol.Payments.Riddler.Schemas.Chain.t()]} | error()

List supported chains.

get_quote(config, request)

@spec get_quote(config(), Raxol.Payments.Riddler.Schemas.QuoteRequest.t()) ::
  {:ok, Raxol.Payments.Riddler.Schemas.QuoteResponse.t()} | error()

Get a cross-chain transfer quote.

get_routes(config)

@spec get_routes(config()) ::
  {:ok, [Raxol.Payments.Riddler.Schemas.Route.t()]} | error()

List supported routes.

get_status(config, order_id)

@spec get_status(config(), String.t()) ::
  {:ok, Raxol.Payments.Riddler.Schemas.OrderStatus.t()} | error()

Get order status by ID.

submit_order(config, request)

@spec submit_order(config(), Raxol.Payments.Riddler.Schemas.OrderRequest.t()) ::
  {:ok, map()} | error()

Submit a signed order.