{"openapi":"3.1.0","info":{"title":"MERX x402 API","version":"2.0.0","description":"TRON payment infrastructure for AI agents. Send and receive USDT, USDC, USDD with automatic energy, monitor wallets with less than 3s detection, access real-time blockchain data. TRON x402 facilitator with full stablecoin coverage and Base USDC bridge. Three settlement schemes: exact, exact_permit, exact_gasfree (TIP-712 permit through MERX GasFreeController). First TRON entry in coinbase/x402 ecosystem registry.","x-guidance":"Use GET /x402/tron/prices for market data. Use POST /x402/tron/estimate before sending tokens. Use POST /x402/tron/send for TRC20 transfers with automatic energy provisioning. Use POST /x402/tron/watch for persistent address monitoring. All endpoints cost $0.01 per call. Pay with USDC on Base or USDT/USDC/USDD on TRON."},"servers":[{"url":"https://merx.exchange"}],"paths":{"/x402/tron/prices":{"get":{"summary":"Live energy prices from TRON providers","description":"Real-time energy and bandwidth prices aggregated from multiple TRON energy providers. Updated every 30 seconds.","tags":["TRON","Energy","Prices"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"price_sun":{"type":"integer"},"available":{"type":"integer"}}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"parameters":[{"name":"resource","in":"query","required":false,"schema":{"type":"string","enum":["ENERGY","BANDWIDTH"]},"description":"Filter by resource type (default: all)"}]}},"/x402/tron/account/{address}":{"get":{"summary":"TRON account resources and balance","description":"Get energy, bandwidth, TRX balance, and TRC20 token balances for any TRON address.","tags":["TRON","Account"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"address":{"type":"string"},"balance":{"type":"integer"},"energy_limit":{"type":"integer"},"bandwidth_limit":{"type":"integer"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^T[1-9A-HJ-NP-Za-km-z]{33}$"},"description":"TRON address (T...)"}]}},"/x402/tron/estimate":{"post":{"summary":"TRON transaction energy and bandwidth estimation","description":"Simulate a TRON transaction and return exact energy and bandwidth requirements.","tags":["TRON","Energy","Estimation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["operation"],"properties":{"operation":{"type":"string","enum":["trc20_transfer","trx_transfer","custom"]},"to":{"type":"string"},"amount":{"type":"string"},"contract":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"energy_needed":{"type":"integer"},"bandwidth_needed":{"type":"integer"},"cost_trx":{"type":"string"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/swap/quote":{"post":{"summary":"TRON SunSwap V2 token swap quote","description":"Get a swap quote from SunSwap V2 DEX with price impact estimation.","tags":["TRON","DEX","Trading"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to","amount"],"properties":{"from":{"type":"string","description":"Source token symbol or contract"},"to":{"type":"string","description":"Target token symbol or contract"},"amount":{"type":"string","description":"Amount to swap"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"amount_out":{"type":"string"},"price_impact":{"type":"string"},"rate":{"type":"string"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/network":{"get":{"summary":"TRON network parameters","description":"Current TRON chain parameters including energy price, bandwidth cost, maintenance schedule.","tags":["TRON","Network"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["full","summary"]},"description":"Response format (default: full)"}]}},"/x402/tron/invoice":{"post":{"summary":"TRON TRC20 payment invoice","description":"Create a TRC20 payment invoice with payment link and automatic detection.","tags":["Payments","Invoice"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount_usdt"],"properties":{"amount_usdt":{"type":"string"},"description":{"type":"string"},"pay_to_address":{"type":"string"},"expires_in_seconds":{"type":"integer","default":3600}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"invoice_id":{"type":"string"},"payment_url":{"type":"string"},"pay_to_address":{"type":"string"},"qr_data":{"type":"string"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/watch":{"post":{"summary":"Watch TRON address for transfers (24h)","description":"Create a persistent 24-hour watch on any TRON address. Fires webhook on matching TRC20 transfers. Sub-3-second detection.","tags":["Payments","Monitoring"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","webhook_url"],"properties":{"address":{"type":"string"},"event_types":{"type":"array","items":{"type":"string","enum":["usdt_incoming","usdc_incoming","usdd_incoming","trc20_incoming"]}},"token_contract":{"type":"string"},"min_amount":{"type":"string"},"webhook_url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"watch_id":{"type":"string"},"expires_at":{"type":"string"},"status":{"type":"string"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/receive":{"post":{"summary":"TRON incoming TRC20 payment detection","description":"One-time watch for a specific payment amount. Fires webhook when payment detected (<3 seconds).","tags":["Payments","Detection"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expected_amount"],"properties":{"expected_amount":{"type":"string"},"token_contract":{"type":"string"},"tolerance_pct":{"type":"number","default":0},"timeout_seconds":{"type":"integer","default":300},"webhook_url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"payment_id":{"type":"string"},"watch_address":{"type":"string"},"expires_at":{"type":"string"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/send":{"post":{"summary":"TRON TRC20 send with automatic energy","description":"Send any TRC20 token. MERX estimates energy and bandwidth, purchases deficit from cheapest provider, broadcasts pre-signed TX.","tags":["Payments","Transfer"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","amount_usdt","signed_tx"],"properties":{"to":{"type":"string"},"amount_usdt":{"type":"string"},"signed_tx":{"type":"string"},"memo":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"txid":{"type":"string"},"status":{"type":"string"},"resources":{"type":"object"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001","max":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/send/batch":{"post":{"summary":"TRON batch TRC20 send to multiple addresses","description":"Send to up to 50 TRON addresses in one call.","tags":["Payments","Transfer","Batch"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["transfers"],"properties":{"transfers":{"type":"array","maxItems":50,"items":{"type":"object","required":["to","amount","signed_tx"],"properties":{"to":{"type":"string"},"amount":{"type":"string"},"signed_tx":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001","max":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/swap/execute":{"post":{"summary":"TRON SunSwap V2 token swap execution","description":"Execute a token swap with automatic energy provisioning.","tags":["TRON","DEX","Trading"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from_token","to_token","amount"],"properties":{"from_token":{"type":"string"},"to_token":{"type":"string"},"amount":{"type":"string"},"slippage_pct":{"type":"number","default":0.5}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"txid":{"type":"string"},"amount_out":{"type":"string"}}}}}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001","max":"0.01"},"protocols":[{"x402":{}}]}}},"/x402/tron/rpc/{method}":{"post":{"summary":"TRON RPC call via dedicated node","description":"Direct RPC call to MERX TRON Lite FullNode. Sub-5ms latency. Whitelisted methods: getnowblock, getaccount, getaccountresource, gettransactionbyid, gettransactioninfobyid, getcontractinfo, triggerconstantcontract, getchainparameters, getblockbynum.","tags":["TRON","RPC","Infrastructure"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"RPC request body (varies by method)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"RPC response (varies by method)"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"parameters":[{"name":"method","in":"path","required":true,"schema":{"type":"string","enum":["wallet/getnowblock","wallet/getaccount","wallet/getaccountresource","wallet/gettransactionbyid","wallet/gettransactioninfobyid","wallet/getcontractinfo","wallet/triggerconstantcontract","wallet/getchainparameters","wallet/getblockbynum"]},"description":"TRON RPC method"}]}}}}