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

Copy Markdown View Source

Client for Riddler's Relay API: the Tron cross-chain rail.

Relay settles transfers where one leg is Tron. It is deposit-address based, so the client never signs anything: it requests a quote (which returns a Riddler-managed deposit address), the user sends funds to that address, and the client polls status until terminal. Riddler is the single solver behind it.

Endpoints

Configuration

config = %{base_url: "https://riddler.example.com", auth_token: "token"}

Summary

Functions

Start execution of a quoted transfer. Returns the initial status.

Request a Tron cross-chain quote with a deposit address.

Get transfer status by id.

Types

config()

@type config() :: %{
  :base_url => String.t(),
  :auth_token => String.t(),
  optional(:req_options) => keyword()
}

error()

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

Functions

execute(config, request)

@spec execute(config(), Raxol.Payments.Relay.Schemas.ExecuteRequest.t()) ::
  {:ok, Raxol.Payments.Relay.Schemas.StatusResponse.t()} | error()

Start execution of a quoted transfer. Returns the initial status.

get_quote(config, request)

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

Request a Tron cross-chain quote with a deposit address.

get_status(config, transfer_id)

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

Get transfer status by id.