Skip to content

request_payout — send funds out to a user‑provided address

Available via MCP and HTTP API.

  • MCP: call request_payout with to_address, amount (smallest units), and a unique payout_id.
  • HTTP: call POST /api/payouts (see Create payout) and surface any approvalUrl to the user.

Purpose
Initiates a payout from the FluxA wallet to an external address (for example, when an agent needs to send some USDC back to the user or to another party).

What it does

  • Validates the destination address and amount.
  • Ensures the Agent ID is configured and that the jwt is valid or refreshed.
  • Calls the FluxA Wallet API to create a payout in Base USDC (network and token are fixed in the current implementation).
  • Records an audit entry and returns a payout object, which may require explicit user approval via a URL.

Typical agent usage

  • When the user requests a withdrawal or a one‑off transfer from their FluxA wallet, the agent:
    • collects the destination to_address,
    • computes the amount in the smallest token units (no decimals), and
    • generates a unique payout_id for tracking.
  • Calls request_payout with those values.
  • If the response status is pending_authorization and includes an approvalUrl, the agent should:
    • present that URL to the user and ask them to open it, and
    • optionally poll get_payout_status until the payout is confirmed or failed.

Key inputs

  • to_address — destination EVM address (must be a valid Base address).
  • amount — integer string in smallest units (e.g., "1000000" for 1.0 USDC if 6 decimals).
  • payout_id — a unique identifier the agent can use to correlate subsequent status checks.

Common failures and remedies

  • pending_authorization — Present the returned approvalUrl to the user, then poll status.
  • invalid address / amount — Validate to_address (0x‑prefixed EVM) and use integer strings for amount.
  • failed with retryable errors — Poll status; the worker may retry broadcasts automatically.

Released under the MIT License.