get_onramp_url
The ONE fiat-to-crypto onramp tool. The backend picks the right provider based on baseCurrency — agents should NOT think about which provider to use. Use this whenever the user wants to deposit fiat / buy crypto / top up / add funds — e.g. 'I want to buy USDC', 'top up my wallet with $100', 'deposit ₹1000', 'add ₹5000 USDC', 'buy USDC with INR', 'onramp $50', 'add funds with UPI/IMPS', 'add funds with credit card', 'buy ETH on Base', 'get USDT with INR'.
Provider routing (handled server-side, do not mention to the user unless they ask):
baseCurrency = 'inr' → Onramp.money (UPI / IMPS / RTGS, India-first)
anything else / default → Moonpay (global cards & bank transfers)
Wallet address defaults to the caller's Privy-provisioned wallet for the chosen chain (EVM by default; Solana when chain=solana). Email is auto-pulled from Privy on the Moonpay branch. Returns { provider, url, ... } — hand the URL to the user to open in browser/iframe.
INR (Onramp.money) coin × network matrix — when baseCurrency='inr' pass a chain matching one of these or the call rejects:
usdt → ethereum, polygon, bsc, tron
usdc → polygon, bsc (NOT ethereum, NOT solana)
busd → bsc
matic → polygon
bnb → bsc
eth → ethereum, polygon
sol → solana
If the user asks for a pair outside this matrix on INR, propose a supported chain — e.g. 'buy USDC with INR on Ethereum' → polygon is the only INR option for USDC, suggest that.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_onramp_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Destination chain. For INR/Onramp.money: ethereum, polygon, bsc, tron, solana. For non-INR/Moonpay: also base, arbitrum, optimism. | |
| theme | No | Moonpay branch only. | |
| amount | No | Fiat amount the user will spend, in baseCurrency units. e.g. 1000 with baseCurrency=inr = ₹1000; 100 with usd = $100. | |
| currency | No | Crypto symbol — usdc, usdt, eth, sol, btc, etc. Mapped to provider-specific code on the backend. | |
| colorCode | No | Moonpay branch only. | |
| coinAmount | No | Onramp.money branch only: target crypto amount (alternative to fiat `amount`). Wins if both are passed. | |
| redirectURL | No | URL the provider redirects the user to after a successful purchase. Must be https and on an origin this deployment allowlists — anything else is refused, since the URL is signed and the provider honours the redirect on our authority. | |
| baseCurrency | No | ISO-4217 fiat code, lowercased. **THIS IS THE ROUTING KEY** — "inr" → Onramp.money (UPI/IMPS), anything else → Moonpay. Default "usd". | |
| currencyCode | No | Moonpay-only direct override (e.g. "usdc_polygon"). Ignored on the Onramp.money branch. | |
| paymentMethod | No | Onramp.money branch only: 1 = UPI/Instant, 2 = IMPS/Bank. Skip to let the user pick on the form. | |
| walletAddress | No | Destination wallet. Optional — defaults to the caller's Privy wallet for the chain. |