Raxol.Payments.Actions.Payments.PollXochiStatus (Raxol Payments v0.2.0)

Copy Markdown View Source

Agent Action that polls a Xochi intent until it reaches a terminal status.

It never signs or moves funds, so it does not authorize a spend. It does reconcile the execute-time budget reservation at a terminal status: a refund releases it (SpendGate.release_by_intent/2, idempotent), any other terminal status forgets the tag while the spend stands. Pass the same :ledger and :agent_id used for the execute for this to take effect; without them it is a no-op and the reservation is left untouched.

Context keys

  • :xochi_config -- %{base_url:, auth:} for Xochi.Client (e.g. auth: {:mandate, agent_wallet}; see Xochi.Client for all auth modes).
  • :ledger, :agent_id -- optional; the Ledger and key from the execute, so a refund releases that reservation. See SpendGate.

Summary

Functions

Validate input, run the action, validate output.

Generate an LLM tool definition for this action.

Functions

call(params, context \\ %{})

Validate input, run the action, validate output.

Returns {:ok, result}, {:ok, result, commands}, or {:error, reason}.

to_tool_definition()

Generate an LLM tool definition for this action.