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

Copy Markdown View Source

JSON-RPC 2.0 client for the pxe-bridge.

pxe-bridge embeds an Aztec PXE and exposes it via HTTP. This client wraps the two RPC methods (aztec_createNote, aztec_getVersion) and the /status health endpoint.

Configuration

config = %{
  url: "http://127.0.0.1:8547",
  api_key: "optional-bearer-token"
}

{:ok, result} = Pxe.Client.create_note(config, %CreateNoteParams{...})

Summary

Functions

Create a shielded note on Aztec L2 for a recipient.

Get the connected Aztec node version.

Check bridge health via GET /status.

Types

config()

@type config() :: %{url: String.t(), api_key: String.t() | nil}

error()

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

Functions

create_note(config, params)

@spec create_note(config(), Raxol.Payments.Pxe.Schemas.CreateNoteParams.t()) ::
  {:ok, Raxol.Payments.Pxe.Schemas.CreateNoteResult.t()} | error()

Create a shielded note on Aztec L2 for a recipient.

get_version(config)

@spec get_version(config()) :: {:ok, String.t()} | error()

Get the connected Aztec node version.

health(config)

@spec health(config()) :: {:ok, Raxol.Payments.Pxe.Schemas.HealthStatus.t()} | error()

Check bridge health via GET /status.