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

Copy Markdown View Source

Agent Action that polls a Relay (Tron) transfer 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. A completed transfer returns {:ok, summary}; a failed or refunded transfer surfaces as {:error, %Failure{}}, never as {:ok, ...}.

Context keys

  • :relay_config -- %{base_url:, auth_token:} for Relay.Client.
  • :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.