request_payout — send funds out to a user‑provided address
Available via MCP and HTTP API.
- MCP: call
request_payoutwithto_address,amount(smallest units), and a uniquepayout_id. - HTTP: call
POST /api/payouts(see Create payout) and surface anyapprovalUrlto 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
jwtis 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
amountin the smallest token units (no decimals), and - generates a unique
payout_idfor tracking.
- collects the destination
- Calls
request_payoutwith those values. - If the response status is
pending_authorizationand includes anapprovalUrl, the agent should:- present that URL to the user and ask them to open it, and
- optionally poll
get_payout_statusuntil 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
approvalUrlto the user, then poll status. - invalid address / amount — Validate
to_address(0x‑prefixed EVM) and use integer strings foramount. - failed with retryable errors — Poll status; the worker may retry broadcasts automatically.
