Purple Flea unifies USDC payments across six chains behind a single API key. Deposit once,
spend anywhere. Pay other agents, withdraw referral commissions, and convert any token to USDC
automatically — all programmatically, no web UI required.
Gas is abstracted: For USDC transfers, Purple Flea covers gas costs and deducts
a small fee from the transfer amount. Your agent never needs to hold native tokens (ETH, MATIC, SOL, TRX)
to send payments. One API key, six chains, zero gas management.
Ethereum
Base
Polygon
Arbitrum
Tron
Solana
Supported Chains
Six chains. One API key.
Every Purple Flea account has a USDC deposit address on each supported chain. Deposits on any chain
are credited to your unified account balance. Transfers out can be sent on any chain your recipient
prefers.
Chain
Chain ID / Network
USDC Contract
Avg finality
Gas fee (abstracted)
Ethereum
chainId: 1
0xA0b86991c6218...
~12s
0.15% min $0.10
Base
chainId: 8453
0x833589fCD6eDb...
~2s
0.05% min $0.01
Polygon
chainId: 137
0x3c499c542cEF5...
~2s
0.05% min $0.01
Arbitrum
chainId: 42161
0xaf88d065e77c8...
~1s
0.05% min $0.01
Tron
mainnet
TEkxiTehnzSmse...
~3s
0.05% min $0.01
Solana
mainnet-beta
EPjFWdd5AufqSS...
~0.4s
0.05% min $0.01
Recommended chain for agent payments: Base or Arbitrum offer the best combination
of speed, low fees, and EVM compatibility. Solana is fastest for high-frequency micropayments.
Tron USDC (TRC-20) is widely used in Asia-focused agent networks.
Deposit Flow
Getting a deposit address
Every Purple Flea product API exposes a /balance endpoint that returns your current
USDC balance and a unique deposit address for each chain. Send USDC to any of these addresses
and it is credited to your account automatically within one confirmation.
1
Fetch your deposit addresses
Call GET /v1/balance on any product API. The response includes a deposit_addresses map with one address per chain.
2
Send USDC to the chain address of your choice
Use your wallet, exchange, or another agent's POST /v1/transfer call to send native USDC to the address. Native USDC only — not bridged variants.
3
Balance credited automatically
After one on-chain confirmation, the deposit is credited to your Purple Flea account. Available for trading, betting, domain purchases, or transfers immediately.
The same /balance endpoint works across all product APIs using the same API key:
casino, trading, wallet, and domains share a unified balance. You do not need to fund each
product separately.
Use POST /v1/transfer to send USDC from your Purple Flea account to any address
on any supported chain. Specify the chain, destination address, and amount. Purple Flea handles
the on-chain transaction and returns a receipt with the transaction hash.
POST/v1/transferSend USDC to any address on any supported chain
POST/v1/transfer/batchSend to multiple addresses in a single API call
GET/v1/transfersList transfer history with status and tx hashes
GET/v1/transfers/{id}Get a single transfer with full receipt
Or use webhooks: Instead of polling for transfer confirmation, register a webhook
for the transfer.confirmed event on /webhook-api.
Your agent will be notified within milliseconds of on-chain confirmation.
Batch Payments
Pay multiple agents in one call
POST /v1/transfer/batch accepts an array of up to 100 recipients. All transfers
in a batch are processed atomically on-chain where possible (e.g., single Solana transaction,
multicall on EVM chains). The fee applies per transfer but batching reduces processing overhead.
If your agent holds ETH, SOL, BTC, or any other token instead of USDC, you can set
"auto_convert": true on any transfer. Purple Flea will swap the required
amount of your native token to USDC at the best available rate via DEX routing, then
execute the transfer. The swap fee and transfer fee are both deducted from the proceeds.
curl -X POST https://api.purpleflea.com/v1/transfer \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"chain": "ethereum",
"to_address": "0xRecipientAddress...",
"amount": 50.00,
"auto_convert": true,
"from_token": "ETH"
}'
# What happens behind the scenes:
# 1. Purple Flea checks your ETH balance (e.g., 0.05 ETH @ $3000 = $150)
# 2. Calculates ETH needed for $50 USDC + swap fee + transfer fee
# 3. Swaps exactly that amount via Uniswap v3 (best rate)
# 4. Sends $50 USDC (minus transfer fee) to recipient
# 5. Returns combined receipt with swap_tx_hash + transfer_tx_hash
{
"transfer_id": "txfr_01HXYZ_CONV",
"status": "confirmed",
"amount_sent": 50.00,
"fee_deducted": 0.525,
"amount_received": 49.475,
"from_token": "ETH",
"eth_spent": 0.01725,
"swap_rate": 2898.55,
"swap_tx_hash": "0x9f1a2b...",
"transfer_tx_hash": "0x7c3d4e..."
}
Slippage note: Auto-conversion uses a default 0.5% slippage tolerance.
For large amounts (>$1,000 equivalent), set "max_slippage_pct": 1.0 to avoid
failed conversions on thin markets. For micropayments, the default is fine.
Referral Commissions
Withdrawing your referral earnings
Every time a referred agent generates a fee, your commission is credited to your Purple Flea
account instantly. You can check your accumulated balance and withdraw to any address at any time.
There is no minimum withdrawal, no lock-up period, and no expiry on earned commissions.
GET/v1/referralsSummary: total earned, pending, by source API
GET/v1/referrals/historyPer-event commission history with timestamps
POST/v1/referrals/withdrawWithdraw commissions to external address
Automated withdrawal pattern: Combine with webhooks. Subscribe to referral.earned
events (see /webhook-api). When the event payload shows
cumulative_earned_usd exceeding your threshold, call POST /v1/referrals/withdraw
automatically. No manual monitoring required.
Code Examples
Complete payment flows
Python — Pay another agent and verify receipt
pay_agent.py
import requests
import time
API_KEY = "sk_live_your_api_key_here"
BASE_URL = "https://api.purpleflea.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
def pay_agent(to_address: str, amount_usd: float, chain: str = "base", memo: str = "") -> dict:
"""Send USDC to another agent and wait for confirmation."""
# 1. Check we have enough balance
balance_resp = requests.get(f"{BASE_URL}/v1/balance", headers=HEADERS)
balance_resp.raise_for_status()
available = balance_resp.json()["usdc_balance"]
if available < amount_usd:
raise ValueError(f"Insufficient balance: have ${available:.2f}, need ${amount_usd:.2f}")
# 2. Submit transfer
transfer_resp = requests.post(
f"{BASE_URL}/v1/transfer",
headers=HEADERS,
json={
"chain": chain,
"to_address": to_address,
"amount": amount_usd,
"memo": memo,
}
)
transfer_resp.raise_for_status()
transfer = transfer_resp.json()
transfer_id = transfer["transfer_id"]
print(f"Submitted: {transfer_id}, tx: {transfer['tx_hash']}")
# 3. Poll for confirmation (or use webhooks instead)
for attempt in range(30):
time.sleep(2)
status_resp = requests.get(
f"{BASE_URL}/v1/transfers/{transfer_id}",
headers=HEADERS
)
status = status_resp.json()
if status["status"] == "confirmed":
print(f"Confirmed in block {status['block_number']}")
print(f"Explorer: {transfer['block_explorer_url']}")
return status
elif status["status"] == "failed":
raise RuntimeError(f"Transfer failed: {status.get('error')}")
raise TimeoutError("Transfer not confirmed within 60 seconds")
def withdraw_referral_earnings(to_address: str, chain: str = "base") -> dict:
"""Withdraw all available referral commissions."""
# Check balance
resp = requests.get(f"{BASE_URL}/v1/referrals", headers=HEADERS)
resp.raise_for_status()
data = resp.json()
available = data["available_to_withdraw_usd"]
if available < 1.0:
print(f"Only ${available:.2f} available, skipping")
return {}
# Withdraw
withdraw_resp = requests.post(
f"{BASE_URL}/v1/referrals/withdraw",
headers=HEADERS,
json={"chain": chain, "to_address": to_address, "amount": available}
)
withdraw_resp.raise_for_status()
result = withdraw_resp.json()
print(f"Withdrew ${result['amount']:.2f} → {result['tx_hash']}")
return result
# Example usage
if __name__ == "__main__":
receipt = pay_agent(
to_address="0xOtherAgent123...",
amount_usd=15.00,
chain="base",
memo="november_compute_fees"
)
print(f"Payment complete: ${receipt['amount_sent']:.2f} USDC sent")
withdraw_referral_earnings("0xMyWallet...", chain="base")
Node.js — Batch payment to multiple agents
batchPayments.js
import fetch from 'node-fetch';
const API_KEY = 'sk_live_your_api_key_here';
const BASE_URL = 'https://api.purpleflea.com';
const headers = { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' };
/**
* Pay multiple agents at once. Splits recipients by chain for atomic batching.
* @param {Array<{address: string, amount: number, chain: string, memo?: string}>} payments
*/
async function batchPayAgents(payments) {
// Group by chain for efficient batching
const byChain = payments.reduce((acc, p) => {
(acc[p.chain] ??= []).push({ to_address: p.address, amount: p.amount, memo: p.memo });
return acc;
}, {});
const results = [];
for (const [chain, transfers] of Object.entries(byChain)) {
console.log(`Sending ${transfers.length} payments on ${chain}...`);
const resp = await fetch(`${BASE_URL}/v1/transfer/batch`, {
method: 'POST',
headers,
body: JSON.stringify({ chain, transfers })
});
if (!resp.ok) {
const err = await resp.json();
throw new Error(`Batch failed on ${chain}: ${JSON.stringify(err)}`);
}
const batch = await resp.json();
console.log(`Batch ${batch.batch_id}: ${batch.transfer_count} transfers, total $${batch.total_amount}`);
results.push(batch);
}
return results;
}
async function checkBalance() {
const resp = await fetch(`${BASE_URL}/v1/balance`, { headers });
const data = await resp.json();
return data.usdc_balance;
}
// Example: pay a team of specialized agents their monthly fees
async function payAgentTeam() {
const balance = await checkBalance();
console.log(`Current balance: $${balance.toFixed(2)} USDC`);
const teamPayments = [
{ address: '0xDataOracle_Alpha...', amount: 20.00, chain: 'base', memo: 'data_oracle_nov' },
{ address: '0xSignalGen_Beta...', amount: 15.00, chain: 'base', memo: 'signal_gen_nov' },
{ address: '0xRiskMgr_Gamma...', amount: 12.50, chain: 'arbitrum', memo: 'risk_mgr_nov' },
{ address: 'SolanaAgentPubkey...', amount: 8.00, chain: 'solana', memo: 'solana_agent_nov' },
{ address: 'TronAgentAddr...', amount: 5.00, chain: 'tron', memo: 'tron_agent_nov' },
];
const totalNeeded = teamPayments.reduce((sum, p) => sum + p.amount, 0);
if (balance < totalNeeded) {
throw new Error(`Insufficient balance: have $${balance}, need $${totalNeeded}`);
}
const results = await batchPayAgents(teamPayments);
const totalSent = results.reduce((sum, b) => sum + b.total_amount, 0);
const totalFees = results.reduce((sum, b) => sum + b.total_fees, 0);
console.log(`Done. Sent: $${totalSent.toFixed(2)}, Fees: $${totalFees.toFixed(4)}`);
return results;
}
payAgentTeam().catch(console.error);
Gas Abstraction
How gas-free USDC transfers work
Normally, sending USDC on-chain requires the sender to hold native tokens for gas: ETH on Ethereum/Base/Arbitrum,
MATIC on Polygon, TRX on Tron, SOL on Solana. This is a significant friction point for agents that
operate exclusively in USDC.
Purple Flea solves this with a gas relay model. When you call POST /v1/transfer,
Purple Flea submits the transaction from its own gas wallet, paying the network fee on your behalf.
The cost is recouped by deducting a small percentage from the transfer amount.
🏭
No native token required
Your agent only needs to hold USDC. Never worry about ETH, MATIC, SOL, or TRX balance management.
💰
Fee deducted from amount
The fee (0.05%–0.15% depending on chain) is taken from the transfer amount, not billed separately. Predictable economics.
⚡
Same speed as native transfers
Purple Flea uses pre-funded gas wallets per chain. No waiting for gas to be acquired. Transactions submit within 200ms of your API call.
📋
Receipt with tx hash
Every transfer returns a transaction hash and block explorer link. Payments are fully verifiable on-chain. Receipts are permanent.
🔄
Cross-chain in one call
Specify any destination chain per transfer. If your recipient is on Tron and you are funding from Base, Purple Flea handles the routing.
🔒
No custody risk
Transfers are processed in <10 seconds. Purple Flea does not hold your funds between API call and settlement — the gas relay model does not require pre-funding your balance with Purple Flea.