@moonpay/cli 0.6.27 → 0.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-AYAAQSBK.js +31 -0
- package/dist/index.js +7 -7
- package/dist/mcp-NGQW4C74.js +2 -0
- package/package.json +2 -3
- package/dist/chunk-K4KO6VY7.js +0 -33
- package/dist/mcp-C2P2VCTT.js +0 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{a as qe,b as Oe,c as Ne,d as Le,e as Be,f as ae,g as u,h,i as We,j as D,k as se,l as ce,n as Ve,p as g,q as z,r as Fe,s as q}from"./chunk-WLQU5BOQ.js";import{readFileSync as sn}from"fs";import{join as cn}from"path";import{homedir as pn}from"os";var _e="0.6.29",ln="X-CLI-Version",dn="X-Agent-Id",K;function un(){if(K!==void 0)return K;try{K=JSON.parse(sn(cn(pn(),".config","moonpay","consent.json"),"utf-8")).agentId??null}catch{K=null}return K??null}function A(){let e={"Content-Type":"application/json",[ln]:_e},t=un();return t&&(e[dn]=t),e}import*as l from"fs";import*as He from"os";import*as X from"path";var J=X.join(He.homedir(),".config","moonpay"),we=X.join(J,"config.json"),Y=X.join(J,"credentials.json"),G=X.join(J,".credentials.lock"),Se={baseUrl:"https://agents.moonpay.com"};function ke(){l.existsSync(J)||l.mkdirSync(J,{recursive:!0,mode:448})}function Me(e,t,n){let i=e+`.tmp.${process.pid}`;l.writeFileSync(i,t,{encoding:"utf-8",mode:n}),l.renameSync(i,e)}var mn=3e4;function hn(){ke();try{let e=l.openSync(G,l.constants.O_CREAT|l.constants.O_EXCL|l.constants.O_WRONLY,384);l.writeSync(e,JSON.stringify({pid:process.pid,ts:Date.now()})),l.closeSync(e)}catch(e){if(e.code!=="EEXIST")throw e;try{let t=JSON.parse(l.readFileSync(G,"utf-8"));if(Date.now()-t.ts<mn)return null}catch{}try{l.unlinkSync(G)}catch{}try{let t=l.openSync(G,l.constants.O_CREAT|l.constants.O_EXCL|l.constants.O_WRONLY,384);l.writeSync(t,JSON.stringify({pid:process.pid,ts:Date.now()})),l.closeSync(t)}catch{return null}}return()=>{try{l.unlinkSync(G)}catch{}}}function ze(){if(!l.existsSync(we))return null;try{let e=JSON.parse(l.readFileSync(we,"utf-8"));return e.baseUrl?e:null}catch{return null}}function pe(){let e=ze();return e||(fn(Se),Se)}function O(){if(!l.existsSync(Y))return null;let e=Le();if(!e)return null;try{let t=JSON.parse(l.readFileSync(Y,"utf-8")),n=qe.parse(t),i=Ne(n,e),r=JSON.parse(i);return!r.accessToken||!r.baseUrl?null:r}catch{return null}}function ve(e){let t=Be(),n=Oe(JSON.stringify(e),t);ke(),Me(Y,JSON.stringify(n,null,2),384)}function fn(e){ke(),Me(we,JSON.stringify(e,null,2),384)}function Ke(){l.existsSync(Y)&&l.unlinkSync(Y)}function v(){let e=ze(),t=O();return e?.baseUrl??t?.baseUrl??Se.baseUrl}async function Te(e,t,n){let i=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(15e3),headers:A(),body:JSON.stringify(n)}),r=await i.json();if(!i.ok){let o=r;throw new Error(o?.error??`${t} failed (${i.status})`)}return r}async function Pe(e){if(!e.refreshToken)throw new Error("No refresh token available");let t=hn();if(!t){await new Promise(i=>setTimeout(i,2e3));let n=O();if(n&&n.expiresAt>Date.now())return n;throw new Error("Token refresh failed (concurrent refresh in progress)")}try{let n=O();if(n&&n.expiresAt>Date.now()+6e4)return n;let i=await Te(e.baseUrl,"refresh",{refreshToken:e.refreshToken}),r={accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:i.expiresAt*1e3,baseUrl:e.baseUrl};return ve(r),r}finally{t()}}var yn=300*1e3;async function N(){let e=O();if(!e)return null;if(Date.now()>=e.expiresAt-yn){if(e.refreshToken)try{return(await Pe(e)).accessToken}catch{return null}return null}return e.accessToken}async function je(e,t,n){let i=await N(),r=A();i&&(r.Authorization=`Bearer ${i}`);let o=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:r,body:JSON.stringify(n)});if(o.status===401&&i){let d=O();if(d?.refreshToken)try{let _=await Pe(d);o=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:{...A(),Authorization:`Bearer ${_.accessToken}`},body:JSON.stringify(n)})}catch{}}if(o.status===401)throw new Error("This command requires a MoonPay CLI account. Run `moonpay login` first.");let c=await o.text();if(!c){if(o.status===429){let d=i?" Run `mp upgrade` to increase your rate limit.":" Log in with `mp login` for higher limits.";throw new Error(`Rate limit exceeded.${d}`)}throw new Error(`Empty response from server (${o.status})`)}let p;try{p=JSON.parse(c)}catch{throw new Error(`Unexpected response from server (${o.status})`)}if(o.status<200||o.status>=300){let d=p;throw new Error(d?.error??`Tool call failed (${o.status})`)}return p}async function w(e,t,n){return await je(e,t,n)}var Ni=[{name:"buy",description:"Buy crypto with fiat via MoonPay. Returns a checkout URL to complete the purchase.",inputSchema:{$ref:"#/definitions/buy_input",definitions:{buy_input:{type:"object",properties:{token:{type:"string",enum:["btc","pol_polygon","sol","trx","usdc","usdc_arbitrum","usdc_base","usdc_optimism","usdc_sol","usdc_polygon","usdt_trx","eth","eth_polygon","eth_optimism","eth_base","eth_arbitrum"],description:"MoonPay currency code: sol (Solana), usdc_sol (USDC on Solana), eth (Ethereum), usdc (USDC on Ethereum), usdc_base (USDC on Base), trx (TRX on Tron), usdt_trx (USDT on Tron), etc."},amount:{type:"number",description:"Amount in USD to spend. For example, 50 means $50 worth of the selected token."},wallet:{type:"string",description:"Destination wallet address to receive tokens (must match the chain for the selected token)"},email:{type:["string","null"],description:"Buyer email to pre-fill on the checkout page"}},required:["token","amount","wallet","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/buy_output",definitions:{buy_output:{type:"object",properties:{url:{type:"string",description:"MoonPay checkout URL \u2014 open in browser to complete purchase"}},required:["url"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_create",description:"Create a new deposit link that generates multi-chain deposit addresses. Anyone can send crypto to these addresses from Solana, Ethereum, Bitcoin, or Tron \u2014 it automatically converts to the specified stablecoin and settles to the destination wallet and chain.",inputSchema:{$ref:"#/definitions/deposit_create_input",definitions:{deposit_create_input:{type:"object",properties:{name:{type:"string",description:"Human-readable label for this deposit link (e.g. 'Treasury Base USDC')"},wallet:{type:"string",description:"Destination wallet address where USDC will be delivered"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","bnb"],description:"Blockchain of the destination wallet"},token:{type:"string",enum:["USDC","USDC.e","USDT"],description:"Token to receive. USDC.e (bridged USDC) is only available on Polygon."}},required:["name","wallet","chain","token"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_create_output",definitions:{deposit_create_output:{type:"object",properties:{id:{type:"string",description:"Unique deposit ID \u2014 use with deposit_transaction_list to check incoming payments"},destinationWallet:{type:"string",description:"Wallet address that will receive the stablecoin"},destinationChain:{type:"string",description:"Chain where the stablecoin will be delivered"},customerToken:{type:"string",description:"Token to check deposit transactions \u2014 pass to deposit_transaction_list"},depositUrl:{type:"string",description:"Shareable URL \u2014 open in browser or share with senders to deposit funds"},wallets:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address to send funds to"},chain:{type:"string",description:"Chain this address is on (solana, ethereum, bitcoin, tron)"},qrCode:{type:"string",description:"URL to a QR code image for the deposit address"}},required:["address","chain","qrCode"],additionalProperties:!1},description:"Deposit addresses across all supported chains \u2014 send any token to any of these"},instructions:{type:"string",description:"Human-readable instructions explaining how to use the deposit"}},required:["id","destinationWallet","destinationChain","customerToken","depositUrl","wallets","instructions"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_retrieve",description:"Retrieve details of a deposit by ID. Returns the deposit name, status, destination wallet, and deposit addresses.",inputSchema:{$ref:"#/definitions/deposit_retrieve_input",definitions:{deposit_retrieve_input:{type:"object",properties:{id:{type:"string",description:"Deposit ID returned from deposit_create"}},required:["id"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_retrieve_output",definitions:{deposit_retrieve_output:{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string"},destinationWallet:{type:["string","null"]},depositUrl:{type:"string"}},required:["id","name","status","destinationWallet","depositUrl"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_transaction_list",description:"List transactions for a deposit. Pass the deposit id from deposit_create to check incoming payment status.",inputSchema:{$ref:"#/definitions/deposit_transaction_list_input",definitions:{deposit_transaction_list_input:{type:"object",properties:{id:{type:"string",description:"Deposit ID returned from deposit_create"}},required:["id"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_transaction_list_output",definitions:{deposit_transaction_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},amount:{type:"number"},token:{type:"string"},from:{type:"string"},status:{type:"string"},settledAmount:{type:["number","null"]},settledCurrency:{type:["string","null"]},timestamp:{type:"string"}},required:["id","amount","token","from","status","settledAmount","settledCurrency","timestamp"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"feedback_create",description:"Submit feedback, a bug report, or a feature request. Requires authentication.",inputSchema:{$ref:"#/definitions/feedback_create_input",definitions:{feedback_create_input:{type:"object",properties:{type:{type:"string",enum:["bug","feature","general"],description:"Type of feedback: bug, feature, or general"},message:{type:"string",minLength:1,maxLength:280,description:"Your feedback message"}},required:["type","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/feedback_create_output",definitions:{feedback_create_output:{type:"object",properties:{id:{type:"string",description:"Feedback ID"},message:{type:"string",description:"Confirmation message"}},required:["id","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"login",description:"Send a verification code to the provided email to sign in or create an account. Requires an hCaptcha token.",inputSchema:{$ref:"#/definitions/login_input",definitions:{login_input:{type:"object",properties:{email:{type:"string",format:"email",description:"The email of the user to login"},captchaToken:{type:"string",description:"hCaptcha response token"}},required:["email","captchaToken"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/login_output",definitions:{login_output:{type:"object",properties:{email:{type:"string",description:"The email the OTP was sent to"}},required:["email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"refresh",description:"Refresh an expired access token using a refresh token.",inputSchema:{$ref:"#/definitions/refresh_input",definitions:{refresh_input:{type:"object",properties:{refreshToken:{type:"string",description:"The refresh token from a previous login"}},required:["refreshToken"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/refresh_output",definitions:{refresh_output:{type:"object",properties:{accessToken:{type:"string"},refreshToken:{type:"string"},expiresAt:{type:"number"}},required:["accessToken","refreshToken","expiresAt"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"swaps_transaction_build",description:"Build a swap or bridge transaction. Returns an unsigned transaction with a human-readable message, amounts, exchange rate, and estimated time. Supports same-chain swaps and cross-chain bridges. Accepts UI amounts (e.g. 0.1 SOL) \u2014 decimal conversion is handled automatically.",inputSchema:{$ref:"#/definitions/swaps_transaction_build_input",definitions:{swaps_transaction_build_input:{type:"object",properties:{from:{type:"object",properties:{wallet:{type:"string",description:"Source wallet address (Solana pubkey or EVM 0x address)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Source blockchain"},token:{type:"string",description:"Source token address (mint on Solana, contract on EVM). Use native token address for SOL/ETH."},amount:{type:["number","null"],description:"Amount to swap (exact-in). Null for exact-out."}},required:["wallet","chain","token","amount"],additionalProperties:!1,description:"Source: wallet, chain, token, amount"},to:{type:"object",properties:{wallet:{type:"string",description:"Destination wallet address. Same as source wallet for same-chain swaps."},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Destination blockchain"},token:{type:"string",description:"Destination token address (mint on Solana, contract on EVM)"},amount:{type:["number","null"],description:"Amount to receive (exact-out). Null for exact-in."}},required:["wallet","chain","token","amount"],additionalProperties:!1,description:"Destination: wallet, chain, token, amount"}},required:["from","to"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/swaps_transaction_build_output",definitions:{swaps_transaction_build_output:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID for tracking"},transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Contract address"},data:{type:"string",description:"Calldata"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1}],description:"Unsigned transaction"},message:{type:"string",description:"Human-readable description (e.g. Swap 0.1 SOL \u2192 42.5 USDC on Solana)"},amountIn:{type:"object",properties:{amount:{type:"number",description:"Human-readable amount (e.g. 1.5)"},raw:{type:"string",description:"Raw amount in smallest unit (e.g. wei, lamports)"},symbol:{type:"string"},usd:{type:["number","null"]}},required:["amount","raw","symbol","usd"],additionalProperties:!1},amountOut:{type:"object",properties:{amount:{type:"number",description:"Human-readable amount (e.g. 1.5)"},raw:{type:"string",description:"Raw amount in smallest unit (e.g. wei, lamports)"},symbol:{type:"string"},usd:{type:["number","null"]}},required:["amount","raw","symbol","usd"],additionalProperties:!1},exchangeRate:{type:"number",description:"Exchange rate (amountOut / amountIn)"},estimatedTime:{type:["number","null"],description:"Estimated completion time in seconds"},requiresApproval:{type:"boolean",description:"Whether an ERC20 approval transaction is needed first"}},required:["transactionId","transaction","message","amountIn","amountOut","exchangeRate","estimatedTime","requiresApproval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_balance_list",description:"List all token balances held in a wallet, including amount owned, current value in USD, and token details. Shows the complete token portfolio.",inputSchema:{$ref:"#/definitions/token_balance_list_input",definitions:{token_balance_list_input:{type:"object",properties:{wallet:{type:"string",description:"Wallet address to check token balances for"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to check balances on (e.g. 'solana', 'ethereum', 'base')"}},required:["wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_balance_list_output",definitions:{token_balance_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},balance:{type:"object",properties:{amount:{type:"number",description:"Number of tokens owned"},value:{type:"number",description:"Total value of the token in USD"},price:{type:"number",description:"Current price of the token"}},required:["amount","value","price"],additionalProperties:!1}},required:["address","name","symbol","chain","decimals","balance"],additionalProperties:!1},description:"Array of all tokens in the wallet with their balances and current values"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_retrieve",description:"Get detailed token information including market data, price changes, volume, trades, and holder statistics by token address",inputSchema:{$ref:"#/definitions/token_retrieve_input",definitions:{token_retrieve_input:{type:"object",properties:{token:{type:"string",description:"Address of the token to retrieve"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain network where the token exists"}},required:["token","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_retrieve_output",definitions:{token_retrieve_output:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_search",description:"Search for tokens by name, symbol, or address. Returns matching tokens with their market data including price, volume, and liquidity.",inputSchema:{$ref:"#/definitions/token_search_input",definitions:{token_search_input:{type:"object",properties:{query:{type:"string",description:"Search term - can be token name (e.g. 'Bitcoin'), symbol (e.g. 'BTC'), or partial match"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to search on (e.g. 'solana', 'ethereum', 'base')"},limit:{type:["number","null"],description:"Maximum number of results to return (optional, defaults to 5)"}},required:["query","chain","limit"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_search_output",definitions:{token_search_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1},description:"Array of tokens matching the search query with their market data"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_transfer",description:"Build an unsigned transfer transaction. Returns a transaction ready for signing. Handles both native and token transfers.",inputSchema:{$ref:"#/definitions/token_transfer_input",definitions:{token_transfer_input:{type:"object",properties:{wallet:{type:"string",description:"Sender wallet address (Solana pubkey or EVM 0x address)"},token:{type:"string",description:"Token address (mint on Solana, contract on EVM). Use native token address for SOL/ETH."},to:{type:"string",description:"Recipient wallet address or name"},amount:{type:"number",description:"Amount to transfer in human-readable units (e.g. 1.5)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to execute the transfer on"}},required:["wallet","token","to","amount","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_transfer_output",definitions:{token_transfer_output:{type:"object",properties:{transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Recipient or contract address"},data:{type:"string",description:"Calldata (0x for native transfers)"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1}]},message:{type:"string",description:"Human-readable description of the transfer"}},required:["transaction","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_trending_list",description:"Get currently trending tokens on a blockchain. Perfect for discovering what's hot right now.",inputSchema:{$ref:"#/definitions/token_trending_list_input",definitions:{token_trending_list_input:{type:"object",properties:{chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to get trending tokens from (e.g. 'solana', 'ethereum', 'base')"},limit:{type:"integer",minimum:1,description:"Number of results per page"},page:{type:"integer",minimum:1,description:"Page number (starts at 1)"}},required:["chain","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_trending_list_output",definitions:{token_trending_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1},description:"Array of trending tokens with their market data"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_list",description:"List swap and bridge transaction history for a wallet.",inputSchema:{$ref:"#/definitions/transaction_list_input",definitions:{transaction_list_input:{type:"object",properties:{wallet:{type:"string",description:"Wallet address that signed and sent the transactions"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain the wallet is on"}},required:["wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_list_output",definitions:{transaction_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{transactionId:{type:"string",description:"Transaction tracking ID"},status:{type:"string",description:"Current status: pending, success, or failed"},type:{type:"string",enum:["swap","bridge"],description:"Transaction type"},from:{type:"object",properties:{chain:{type:"string",description:"Source blockchain"},token:{type:"string",description:"Source token symbol"},amount:{type:["number","null"],description:"Amount sent"},txHash:{type:"string",description:"Source chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},to:{type:"object",properties:{chain:{type:"string",description:"Destination blockchain"},token:{type:"string",description:"Destination token symbol"},amount:{type:["number","null"],description:"Amount received"},txHash:{type:["string","null"],description:"Destination chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},usd:{type:["number","null"],description:"USD value of the transaction"},bridgeTime:{type:["number","null"],description:"Bridge completion time in seconds"}},required:["transactionId","status","type","from","to","usd","bridgeTime"],additionalProperties:!1},description:"List of swap/bridge transactions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_register",description:"Register a broadcast transaction for tracking. Call after transaction_send to enable status tracking via transaction_retrieve.",inputSchema:{$ref:"#/definitions/transaction_register_input",definitions:{transaction_register_input:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID from swaps_transaction_build"},transactionHash:{type:"string",description:"Transaction hash/signature after broadcasting"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain where the transaction was broadcast"}},required:["transactionId","transactionHash","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_register_output",definitions:{transaction_register_output:{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_retrieve",description:"Get the status and details of a transaction by its ID.",inputSchema:{$ref:"#/definitions/transaction_retrieve_input",definitions:{transaction_retrieve_input:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID from swaps_transaction_build or transaction_register"}},required:["transactionId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_retrieve_output",definitions:{transaction_retrieve_output:{type:"object",properties:{transactionId:{type:"string",description:"Transaction tracking ID"},status:{type:"string",description:"Current status: pending, success, or failed"},type:{type:"string",enum:["swap","bridge"],description:"Transaction type"},from:{type:"object",properties:{chain:{type:"string",description:"Source blockchain"},token:{type:"string",description:"Source token symbol"},amount:{type:["number","null"],description:"Amount sent"},txHash:{type:"string",description:"Source chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},to:{type:"object",properties:{chain:{type:"string",description:"Destination blockchain"},token:{type:"string",description:"Destination token symbol"},amount:{type:["number","null"],description:"Amount received"},txHash:{type:["string","null"],description:"Destination chain transaction hash. Null while bridge is in progress."}},required:["chain","token","amount","txHash"],additionalProperties:!1},usd:{type:["number","null"],description:"USD value of the transaction"},bridgeTime:{type:["number","null"],description:"Bridge completion time in seconds. Null for same-chain swaps."}},required:["transactionId","status","type","from","to","usd","bridgeTime"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_send",description:"Broadcast a signed transaction to the network. Supports Solana, EVM chains, and Bitcoin.",inputSchema:{$ref:"#/definitions/transaction_send_input",definitions:{transaction_send_input:{type:"object",properties:{transaction:{type:"string",description:"Signed transaction: base64-encoded for Solana, hex-encoded (0x...) for EVM, raw hex for Bitcoin"},message:{type:"string",description:"Human-readable message describing the transaction"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to broadcast on"}},required:["transaction","message","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_send_output",definitions:{transaction_send_output:{type:"object",properties:{signature:{type:"string",description:"Transaction signature/hash. Absent if broadcast failed."},message:{type:"string",description:"Result message or error description"}},required:["message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"user_retrieve",description:"Get the currently authenticated user",inputSchema:{$ref:"#/definitions/user_retrieve_input",definitions:{user_retrieve_input:{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/user_retrieve_output",definitions:{user_retrieve_output:{type:"object",properties:{id:{type:"string",description:"User ID"},email:{type:["string","null"],description:"User email address"}},required:["id","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"verify",description:"Verify a login code for the user.",inputSchema:{$ref:"#/definitions/verify_input",definitions:{verify_input:{type:"object",properties:{code:{type:"string",pattern:"^\\d{6}$",description:"The code to verify"},email:{type:"string",format:"email",description:"The email the OTP was sent to"}},required:["code","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/verify_output",definitions:{verify_output:{type:"object",properties:{accessToken:{type:"string"},refreshToken:{type:"string"},expiresAt:{type:"number"}},required:["accessToken","refreshToken","expiresAt"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_agreement_accept",description:"Accept a required legal agreement. Pass the content ID from virtual-account_agreement_list to mark the agreement as accepted.",inputSchema:{$ref:"#/definitions/virtual-account_agreement_accept_input",definitions:{"virtual-account_agreement_accept_input":{type:"object",properties:{contentId:{type:"string",description:"Content ID from virtual-account_agreement_list"}},required:["contentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_agreement_accept_output",definitions:{"virtual-account_agreement_accept_output":{type:"object",properties:{id:{type:"string",description:"Signing record ID"},contentId:{type:["string","null"],description:"Content ID of the accepted agreement"},documentId:{type:["string","null"],description:"Document ID"}},required:["id","contentId","documentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_agreement_list",description:"List legal agreements. By default shows pending agreements that must be accepted to activate the account. Use status=accepted to see previously accepted agreements.",inputSchema:{$ref:"#/definitions/virtual-account_agreement_list_input",definitions:{"virtual-account_agreement_list_input":{type:"object",properties:{status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"null"}],description:"Filter: pending (need to accept, default) or accepted (already signed)"},country:{type:["string","null"],description:"Country code for terms (e.g. USA, GBR). Defaults to USA."}},required:["status","country"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_agreement_list_output",definitions:{"virtual-account_agreement_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Content ID \u2014 pass to virtual-account_agreement_accept to accept"},name:{type:"string",description:"Document name (e.g. 'USA Terms and Conditions')"},url:{type:"string",description:"URL to view the document"}},required:["id","name","url"],additionalProperties:!1},description:"List of agreements"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_create",description:"Create a virtual account and start KYC verification",inputSchema:{$ref:"#/definitions/virtual-account_create_input",definitions:{"virtual-account_create_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_create_output",definitions:{"virtual-account_create_output":{type:"object",properties:{id:{type:"string"},email:{type:"string"},customerType:{type:"string",enum:["Person","Business"]},status:{type:"string",enum:["UserRequired","SigningsRequired","IdentificationRequired","Active","Suspended"]},nextStep:{type:["string","null"]}},required:["id","email","customerType","status","nextStep"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_kyc_continue",description:"Get the current KYC verification status and URL. Use this to check progress or get the verification link again.",inputSchema:{$ref:"#/definitions/virtual-account_kyc_continue_input",definitions:{"virtual-account_kyc_continue_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_kyc_continue_output",definitions:{"virtual-account_kyc_continue_output":{type:"object",properties:{id:{type:"string",description:"Identification record ID"},status:{type:"string",enum:["Pending","Processed","PendingReview","Approved","Declined","Expired"],description:"KYC status: Pending, Processed, PendingReview, Approved, Declined, or Expired"},url:{type:["string","null"],description:"URL to complete KYC verification. Null if already submitted."}},required:["id","status","url"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_kyc_restart",description:"Restart KYC verification. Creates a fresh verification link. Only available when account status is IdentificationRequired.",inputSchema:{$ref:"#/definitions/virtual-account_kyc_restart_input",definitions:{"virtual-account_kyc_restart_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_kyc_restart_output",definitions:{"virtual-account_kyc_restart_output":{type:"object",properties:{id:{type:"string",description:"Identification record ID"},status:{type:"string",enum:["Pending","Processed","PendingReview","Approved","Declined","Expired"],description:"KYC status: Pending, Processed, PendingReview, Approved, Declined, or Expired"},url:{type:["string","null"],description:"URL to complete KYC verification. Null if already submitted."},message:{type:["string","null"],description:"Instructions for the user"}},required:["id","status","url","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_create",description:"Create a fiat-to-stablecoin onramp. Returns a deposit account (bank IBAN or account number) where the user sends fiat. Incoming fiat is automatically converted to stablecoin and sent to the registered wallet.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_create_input",definitions:{"virtual-account_onramp_create_input":{type:"object",properties:{name:{type:"string",description:"A label for this onramp (e.g. 'My USD onramp')"},fiat:{type:"string",enum:["USD","EUR"],description:"Fiat currency: usd or eur"},stablecoin:{type:"string",enum:["USDC","USDT","EURC"],description:"Target stablecoin: usdc, usdt, or eurc"},wallet:{type:"string",description:"Registered wallet address (must be registered via virtual-account_wallet_register first)"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"],description:"Blockchain to receive stablecoin on (Solana, Ethereum, Polygon, Arbitrum, Base)"}},required:["name","fiat","stablecoin","wallet","blockchain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_create_output",definitions:{"virtual-account_onramp_create_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_delete",description:"Cancel an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_delete_input",definitions:{"virtual-account_onramp_delete_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp to cancel"}},required:["onrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_delete_output",definitions:{"virtual-account_onramp_delete_output":{type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_list",description:"List all fiat-to-stablecoin onramps. Shows each onramp's deposit account details, status, and destination wallet.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_list_input",definitions:{"virtual-account_onramp_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_list_output",definitions:{"virtual-account_onramp_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1},description:"List of configured onramps"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_payment_create",description:"Create an open banking payment link for an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_create_input",definitions:{"virtual-account_onramp_payment_create_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp"},amount:{type:"string",description:"The amount to pay"},fiat:{type:"string",enum:["USD","EUR"],description:"The fiat currency (USD or EUR)"}},required:["onrampId","amount","fiat"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_create_output",definitions:{"virtual-account_onramp_payment_create_output":{type:"object",properties:{id:{type:"string"},paymentLink:{type:["string","null"]},status:{type:"string",enum:["Pending","Ready","Processing","Completed","Failed"]}},required:["id","paymentLink","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_payment_retrieve",description:"Get the status of an open banking payment",inputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_retrieve_input",definitions:{"virtual-account_onramp_payment_retrieve_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp this payment belongs to"},paymentId:{type:"string",format:"uuid",description:"The ID of the payment to retrieve"}},required:["onrampId","paymentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_retrieve_output",definitions:{"virtual-account_onramp_payment_retrieve_output":{type:"object",properties:{id:{type:"string"},paymentLink:{type:["string","null"]},status:{type:"string",enum:["Pending","Ready","Processing","Completed","Failed"]}},required:["id","paymentLink","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_retrieve",description:"Get onramp details and banking info",inputSchema:{$ref:"#/definitions/virtual-account_onramp_retrieve_input",definitions:{"virtual-account_onramp_retrieve_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp to retrieve"}},required:["onrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_retrieve_output",definitions:{"virtual-account_onramp_retrieve_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_retrieve",description:"Get your virtual account status",inputSchema:{$ref:"#/definitions/virtual-account_retrieve_input",definitions:{"virtual-account_retrieve_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_retrieve_output",definitions:{"virtual-account_retrieve_output":{type:"object",properties:{id:{type:"string"},email:{type:"string"},customerType:{type:"string",enum:["Person","Business"]},status:{type:"string",enum:["UserRequired","SigningsRequired","IdentificationRequired","Active","Suspended"]},nextStep:{type:["string","null"]}},required:["id","email","customerType","status","nextStep"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_transaction_list",description:"List fiat-to-stablecoin conversion transactions. Shows status, fiat amount sent, and stablecoin amount received for each conversion.",inputSchema:{$ref:"#/definitions/virtual-account_transaction_list_input",definitions:{"virtual-account_transaction_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_transaction_list_output",definitions:{"virtual-account_transaction_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Transaction ID"},state:{type:"string",enum:["Pending","PayoutPending","Payout","PayoutCompleted","Completed","Failed","InAmlReview","AmlRejected","AmountRejected"],description:"Transaction state (e.g. pending, completed, failed)"},sourceAmount:{type:"string",description:"Fiat amount sent (e.g. '100.00 USD')"},destinationAmount:{type:"string",description:"Stablecoin amount received (e.g. '99.50 USDC')"},createdAt:{type:"string",format:"date-time",description:"Transaction creation timestamp"}},required:["id","state","sourceAmount","destinationAmount","createdAt"],additionalProperties:!1},description:"List of onramp conversion transactions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_list",description:"List wallets registered for the virtual account. Only registered wallets can receive onramp payouts.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_list_input",definitions:{"virtual-account_wallet_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_list_output",definitions:{"virtual-account_wallet_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},address:{type:"string"},blockchain:{type:"string"}},required:["id","address","blockchain"],additionalProperties:!1},description:"List of registered wallets"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_register",description:"Register a wallet by submitting a signed proof-of-ownership message. The wallet can then be used as a destination for onramp payouts.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_register_input",definitions:{"virtual-account_wallet_register_input":{type:"object",properties:{wallet:{type:"string",description:"Wallet address to register"},message:{type:"string",description:"Verification message from virtual-account_wallet_registration-message_create"},signature:{type:"string",description:"Signature of the message, signed by the wallet's private key"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain for wallet registration (solana, ethereum, polygon, base, arbitrum)"}},required:["wallet","message","signature","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_register_output",definitions:{"virtual-account_wallet_register_output":{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_registration-message_create",description:"Generate a proof-of-ownership message for wallet registration. The message must be signed by the wallet's private key and submitted via virtual-account_wallet_register.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_registration-message_create_input",definitions:{"virtual-account_wallet_registration-message_create_input":{type:"object",properties:{wallet:{type:"string",description:"Wallet address to register"}},required:["wallet"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_registration-message_create_output",definitions:{"virtual-account_wallet_registration-message_create_output":{type:"object",properties:{message:{type:"string",description:"Message to sign with the wallet's private key"}},required:["message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}}];var bn="https://www.moonpay.com/legal/terms_of_use_europe_hypermint",_n="https://www.moonpay.com/legal/privacy_policy",wn="https://swaps.xyz/terms",le=` Terms of Use: ${bn}
|
|
3
|
+
Privacy Policy: ${_n}
|
|
4
|
+
Swaps by: ${wn}`;import*as Je from"fs";import*as Ye from"os";import*as Xe from"path";var a=e=>e,s=(e,t)=>({schema:e,handler:async n=>{let i=e.input.parse(n),r=await t(i);return e.output.parse(r)}});import{z as Z}from"zod";var Ge=a({name:"consent_check",description:"Check whether the MoonPay Terms of Use have been accepted. Throws if not accepted.",input:Z.object({}),output:Z.object({accepted:Z.literal(!0),tosVersion:Z.string(),acceptedAt:Z.string()})});var Sn=Xe.join(Ye.homedir(),".config","moonpay","consent.json"),Ze=s(Ge,async()=>{let e=null;try{e=JSON.parse(Je.readFileSync(Sn,"utf-8"))}catch{}if(!e||e.tosVersion!=="1.2")throw new Error(`Terms of Service not yet accepted. Run \`mp consent accept\` first.
|
|
5
|
+
|
|
6
|
+
${le}`);return{accepted:!0,tosVersion:e.tosVersion,acceptedAt:e.acceptedAt}});import{generateMnemonic as kn}from"@scure/bip39";import{wordlist as vn}from"@scure/bip39/wordlists/english";import{z as L}from"zod";var Qe=a({name:"wallet_create",description:"Create a new multi-chain HD wallet. Generates a BIP39 mnemonic and derives addresses for Solana, Ethereum, Bitcoin, and Tron. The mnemonic is copied to clipboard (interactive) or omitted (headless). Keys are encrypted with a random key stored in the OS keychain.",input:L.object({name:L.string().describe("Wallet name")}),output:L.object({name:L.string(),addresses:L.record(u,L.string())})});var et=s(Qe,async e=>{let t=kn(vn,256),n=ae(t);return z({name:e.name,type:"hd",mnemonic:t,addresses:n,createdAt:new Date().toISOString()}),{name:e.name,addresses:D(n)}});import{createInterface as Tn}from"readline";import{validateMnemonic as nt}from"@scure/bip39";import{wordlist as it}from"@scure/bip39/wordlists/english";import{Keypair as Pn}from"@solana/web3.js";import jn from"bs58";import{privateKeyToAccount as xn}from"viem/accounts";import{z as R}from"zod";var tt=a({name:"wallet_import",description:"Import a wallet from a BIP39 mnemonic (HD, all chains) or a single private key (one chain). Provide either --mnemonic or --key, not both.",input:R.object({name:R.string().describe("Wallet name"),mnemonic:R.string().nullable().describe("BIP39 mnemonic seed phrase (for HD wallet import)"),key:R.string().nullable().describe("Private key: base58 for Solana, hex for EVM/Bitcoin"),chain:u.nullable().describe("Chain for single-key import (default solana)")}),output:R.object({name:R.string(),type:R.enum(["hd","imported"]),addresses:We})});function Cn(e){return new Promise((t,n)=>{if(!process.stdin.isTTY){n(new Error("Interactive import requires a terminal. Pass --mnemonic or --key instead."));return}let i=Tn({input:process.stdin,output:process.stderr});process.stderr.write(e),process.stdin.setRawMode(!0);let r="",o=c=>{let p=c.toString();p===`
|
|
7
|
+
`||p==="\r"?(process.stdin.setRawMode(!1),process.stdin.removeListener("data",o),process.stderr.write(`
|
|
8
|
+
`),i.close(),t(r.trim())):p===""?(process.stdin.setRawMode(!1),i.close(),process.exit(0)):p==="\x7F"||p==="\b"?r=r.slice(0,-1):r+=p};process.stdin.on("data",o)})}function An(e){let t=e.split(/\s+/);return t.length>=12&&t.length<=24&&nt(e,it)?"mnemonic":"key"}var rt=s(tt,async e=>{if(e.mnemonic&&e.key)throw new Error("Provide either --mnemonic or --key, not both.");let t=e.mnemonic,n=e.key;if(!t&&!n){let p=await Cn("Paste your mnemonic or private key (hidden): ");if(!p)throw new Error("No input provided.");An(p)==="mnemonic"?t=p:n=p}if(t){let p=t.trim().toLowerCase();if(!nt(p,it))throw new Error("Invalid BIP39 mnemonic.");let d=ae(p);return z({name:e.name,type:"hd",mnemonic:p,addresses:d,createdAt:new Date().toISOString()}),{name:e.name,type:"hd",addresses:d}}let i=e.chain?h[e.chain]:"solana",r=n??"",o,c;if(i==="solana")try{let p=jn.decode(r);o=Pn.fromSecretKey(p).publicKey.toBase58(),c=r}catch{throw new Error("Invalid Solana private key. Expected base58-encoded secret key.")}else if(i==="ethereum"){if(c=r.startsWith("0x")?r.slice(2):r,!/^[0-9a-fA-F]{64}$/.test(c))throw new Error("Invalid EVM private key. Expected 64-character hex string.");o=xn(`0x${c}`).address}else throw new Error(`Single-key import for ${i} is not yet supported. Use a mnemonic instead.`);return z({name:e.name,type:"imported",chain:i,privateKey:c,addresses:{[i]:o},createdAt:new Date().toISOString()}),{name:e.name,type:"imported",addresses:{[i]:o}}});import{z as ot}from"zod";var at=a({name:"wallet_list",description:"List all local wallets",input:ot.object({}),output:ot.array(se)});var st=s(at,async()=>ce().map(t=>({name:t.name,type:t.type,addresses:D(t.addresses),createdAt:t.createdAt})));import{z as ct}from"zod";var pt=a({name:"wallet_retrieve",description:"Get details of a specific wallet",input:ct.object({wallet:ct.string().describe("Wallet name or address")}),output:se});var j=s(pt,async e=>{let t=g(e.wallet);return{name:t.name,type:t.type,addresses:D(t.addresses),createdAt:t.createdAt}});import{z as B}from"zod";var lt=a({name:"wallet_delete",description:"Permanently delete a local wallet. This removes the private key file and cannot be undone.",input:B.object({wallet:B.string().describe("Name or address of the wallet to delete"),confirm:B.boolean().describe("Must be true to confirm deletion")}),output:B.object({name:B.string().describe("Name of the deleted wallet"),deleted:B.literal(!0)})});var dt=s(lt,async e=>{if(!e.confirm)throw new Error("Back up your wallet before deleting! Run `mp wallet export "+e.wallet+"` to save your recovery phrase, then re-run with --confirm to permanently delete.");let t=g(e.wallet);return Fe(t.name),{name:t.name,deleted:!0}});import{z as W}from"zod";var ut=a({name:"wallet_rename",description:"Rename a local wallet.",input:W.object({wallet:W.string().describe("Current name or address of the wallet"),name:W.string().describe("New name for the wallet")}),output:W.object({oldName:W.string(),newName:W.string()})});var mt=s(ut,async e=>{let n=g(e.wallet).name;if(n===e.name)return{oldName:n,newName:e.name};if(ce().some(r=>r.name===e.name))throw new Error(`Wallet "${e.name}" already exists`);return Ve(r=>{let o=r.find(c=>c.name===n);if(!o)throw new Error(`Wallet "${n}" not found`);o.name=e.name}),{oldName:n,newName:e.name}});import{z as ue}from"zod";var ht=a({name:"wallet_export",description:"Export wallet secret (mnemonic or private key). Interactive only \u2014 cannot be run by agents or piped.",input:ue.object({wallet:ue.string().describe("Wallet name")}),output:ue.object({exported:ue.literal(!0)})});var ft=s(ht,async e=>{if(!process.stdout.isTTY)throw new Error(`Wallet export requires an interactive terminal.
|
|
9
|
+
Run this command directly in your terminal: mp wallet export `+e.wallet);let t=g(e.wallet);return t.type==="hd"?(process.stderr.write(`
|
|
10
|
+
Mnemonic for "${t.name}":
|
|
11
|
+
|
|
12
|
+
`),process.stderr.write(` ${t.mnemonic}
|
|
13
|
+
|
|
14
|
+
`),process.stderr.write(`Write this down and store it securely.
|
|
15
|
+
|
|
16
|
+
`)):(process.stderr.write(`
|
|
17
|
+
Private key for "${t.name}" (${t.chain}):
|
|
18
|
+
|
|
19
|
+
`),process.stderr.write(` ${t.privateKey}
|
|
20
|
+
|
|
21
|
+
`)),{exported:!0}});import{createHash as In}from"crypto";import{Keypair as $n,VersionedTransaction as Rn}from"@solana/web3.js";import{privateKeyToAccount as En}from"viem/accounts";import{parseTransaction as Un}from"viem";import{createPublicClient as Dn,http as qn}from"viem";import*as f from"viem/chains";import*as gt from"tiny-secp256k1";import{z as Q}from"zod";var yt=a({name:"transaction_sign",description:"Sign a transaction with a local wallet. Supports Solana (VersionedTransaction), EVM (RLP-encoded), and Bitcoin (PSBT) transactions.",input:Q.object({wallet:Q.string().describe("Wallet name or address"),chain:u.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),transaction:Q.string().describe("Base64-encoded unsigned transaction")}),output:Q.object({transaction:Q.string().describe("Base64-encoded signed transaction")})});var On={1:f.mainnet,137:f.polygon,42161:f.arbitrum,8453:f.base,10:f.optimism,56:f.bsc,43114:f.avalanche},Nn={137:"https://polygon-bor-rpc.publicnode.com",42161:"https://arbitrum-one-rpc.publicnode.com",10:"https://optimism-rpc.publicnode.com",8453:"https://base-rpc.publicnode.com",56:"https://bsc-rpc.publicnode.com",43114:"https://avalanche-c-chain-rpc.publicnode.com"},E=s(yt,async e=>{let t=g(e.wallet),n=e.chain,i=h[n],{privateKey:r}=q(t,n);switch(i){case"solana":return Ln(r,e.transaction.trim());case"ethereum":return Bn(r,e.transaction.trim());case"tron":return Wn(r,e.transaction.trim());case"bitcoin":return Vn(r,e.transaction.trim())}});function Ln(e,t){let n=Buffer.from(t,"base64"),i=Rn.deserialize(n),r=$n.fromSecretKey(e);return i.sign([r]),{transaction:Buffer.from(i.serialize()).toString("base64")}}async function Bn(e,t){let n=En(`0x${Buffer.from(e).toString("hex")}`);if(t.startsWith("{")){let{to:c,data:p,value:d,chainId:_}=JSON.parse(t),y=On[_]??f.mainnet,m=Nn[_],C=Dn({chain:y,transport:qn(m)}),M=await C.getTransactionCount({address:n.address}),re=await C.estimateFeesPerGas(),oe=await C.estimateGas({account:n.address,to:c,data:p,value:BigInt(d??"0")});return{transaction:await n.signTransaction({to:c,data:p,value:BigInt(d??"0"),chainId:_,nonce:M,gas:oe,maxFeePerGas:re.maxFeePerGas,maxPriorityFeePerGas:re.maxPriorityFeePerGas,type:"eip1559"})}}let i=t.startsWith("0x")?t:`0x${Buffer.from(t,"base64").toString("hex")}`,r=Un(i);return{transaction:await n.signTransaction(r)}}function Wn(e,t){let n=Buffer.from(t.startsWith("0x")?t.slice(2):t,"hex"),i=In("sha256").update(n).digest(),r=gt.sign(i,e);if(!r)throw new Error("Tron transaction signing failed");return{transaction:Buffer.from(r).toString("hex")}}async function Vn(e,t){let n=await import("bitcoinjs-lib"),i=(await import("ecpair")).default,r=await import("tiny-secp256k1"),c=i(r).fromPrivateKey(Buffer.from(e)),p=n.Psbt.fromBase64(t);return p.signAllInputs(c),p.finalizeAllInputs(),{transaction:p.toBase64()}}import{createHash as _t}from"crypto";import{Keypair as Fn}from"@solana/web3.js";import Hn from"bs58";import Mn from"tweetnacl";import*as xe from"tiny-secp256k1";import{keccak_256 as zn}from"@noble/hashes/sha3";import{privateKeyToAccount as Kn}from"viem/accounts";import{z as ee}from"zod";var bt=a({name:"message_sign",description:"Sign a message with a local wallet. Supports Solana (ed25519), EVM (EIP-191 personal sign), and Bitcoin (secp256k1 ECDSA).",input:ee.object({wallet:ee.string().describe("Wallet address or name to sign with"),chain:u.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),message:ee.string().describe("Message text to sign")}),output:ee.object({signature:ee.string().describe("Signature: base58 for Solana, hex (0x-prefixed) for EVM/Bitcoin")})});var me=s(bt,async e=>{let t=g(e.wallet),n=e.chain,i=h[n],{privateKey:r}=q(t,n),o=Buffer.from(e.message,"utf8");switch(i){case"solana":return Gn(r,o);case"ethereum":return Jn(r,e.message);case"tron":return Yn(r,e.message);case"bitcoin":return Xn(r,o)}});function Gn(e,t){let n=Fn.fromSecretKey(e),i=Mn.sign.detached(t,n.secretKey);return{signature:Hn.encode(i)}}async function Jn(e,t){return{signature:await Kn(`0x${Buffer.from(e).toString("hex")}`).signMessage({message:t})}}function Yn(e,t){let n=Buffer.from(t,"utf8"),i=Buffer.from(`TRON Signed Message:
|
|
22
|
+
${n.length}`,"utf8"),r=zn(Buffer.concat([i,n])),o=xe.sign(r,e);if(!o)throw new Error("Tron message signing failed");return{signature:"0x"+Buffer.from(o).toString("hex")}}function Xn(e,t){let n=_t("sha256").update(t).digest(),i=_t("sha256").update(n).digest(),r=xe.sign(i,e);if(!r)throw new Error("Bitcoin message signing failed");return{signature:"0x"+Buffer.from(r).toString("hex")}}import Zn from"https";import{z as S}from"zod";var wt=a({name:"bitcoin_balance_retrieve",description:"Get the BTC balance of a Bitcoin address. Returns confirmed and unconfirmed balances in BTC and satoshis.",input:S.object({wallet:S.string().describe("Bitcoin address (bc1...) or wallet name")}),output:S.object({address:S.string().describe("Bitcoin address"),confirmed:S.object({btc:S.string().describe("Confirmed balance in BTC"),sats:S.number().describe("Confirmed balance in satoshis")}),unconfirmed:S.object({btc:S.string().describe("Unconfirmed (pending) balance in BTC"),sats:S.number().describe("Unconfirmed (pending) balance in satoshis")}),total:S.object({btc:S.string().describe("Total balance in BTC"),sats:S.number().describe("Total balance in satoshis")})})});var Qn=1e8;function Ce(e){return(e/Qn).toFixed(8)}function ei(e){return new Promise((t,n)=>{Zn.get(e,{headers:{"User-Agent":"moonpay-cli"}},i=>{if(i.statusCode!==200){n(new Error(`HTTP ${i.statusCode} from ${e}`)),i.resume();return}let r="";i.on("data",o=>r+=o),i.on("end",()=>{try{t(JSON.parse(r))}catch{n(new Error("Invalid JSON response"))}})}).on("error",n)})}var St=s(wt,async e=>{let t=e.wallet;if(!t.startsWith("bc1")&&!t.startsWith("1")&&!t.startsWith("3")){let{findWalletOrThrow:c}=await import("./store-XV77WYWO.js"),d=c(t).addresses.bitcoin;if(!d)throw new Error(`Wallet "${t}" has no Bitcoin address. It may be an imported single-chain wallet.`);t=d}let n=await ei(`https://mempool.space/api/address/${encodeURIComponent(t)}`),i=n.chain_stats.funded_txo_sum-n.chain_stats.spent_txo_sum,r=n.mempool_stats.funded_txo_sum-n.mempool_stats.spent_txo_sum,o=i+r;return{address:t,confirmed:{btc:Ce(i),sats:i},unconfirmed:{btc:Ce(r),sats:r},total:{btc:Ce(o),sats:o}}});import{readdirSync as ti,readFileSync as kt,existsSync as Ae,mkdirSync as ni,cpSync as ii}from"fs";import{join as V,dirname as ri}from"path";import{homedir as oi}from"os";import{fileURLToPath as ai}from"url";function Ie(){let e=ai(import.meta.url),t=ri(e);return V(t,"..","skills")}function si(){return V(oi(),".claude","skills")}function $e(){let e=Ie();return Ae(e)?ti(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&t.name.startsWith("moonpay-")).map(t=>{let i=kt(V(e,t.name,"SKILL.md"),"utf-8").match(/^description:\s*(.+)$/m);return{name:t.name,description:i?.[1]?.replace(/^["']|["']$/g,"")??""}}).sort((t,n)=>t.name.localeCompare(n.name)):[]}function vt(e){if(/[/\\]|\.\./.test(e))throw new Error(`Invalid skill name: "${e}"`);let t=V(Ie(),e,"SKILL.md");if(!Ae(t))throw new Error(`Skill "${e}" not found. Run \`mp skill list\` to see available skills.`);return kt(t,"utf-8")}function Tt(e,t){let n=Ie(),i=t??si(),r=$e();return ni(i,{recursive:!0}),r.map(o=>{let c=V(i,o.name);return Ae(c)&&!e?{name:o.name,installed:!1}:(ii(V(n,o.name),c,{recursive:!0,force:!0}),{name:o.name,installed:!0})})}import{z as te}from"zod";var Pt=a({name:"skill_list",description:"List available AI skills for Claude Code and other agents",input:te.object({}),output:te.array(te.object({name:te.string(),description:te.string()}))});var jt=s(Pt,async()=>$e());import{z as ne}from"zod";var xt=a({name:"skill_retrieve",description:"Get the full instructions for a specific skill",input:ne.object({name:ne.string().describe("Skill name (e.g. moonpay-swap-tokens)")}),output:ne.object({name:ne.string(),content:ne.string()})});var Ct=s(xt,async e=>({name:e.name,content:vt(e.name)}));import{z as U}from"zod";var At=a({name:"skill_install",description:"Install AI skills for Claude Code. Defaults to ~/.claude/skills/, or specify --dir for a custom location (e.g. project-local, ~/.agents/skills).",input:U.object({force:U.boolean().describe("Overwrite existing skills"),dir:U.string().nullable().describe("Target directory to install skills into (default: ~/.claude/skills/)")}),output:U.array(U.object({name:U.string(),installed:U.boolean()}))});var It=s(At,async e=>Tt(e.force,e.dir??void 0));import{encodeFunctionData as ci}from"viem";import{z as k}from"zod";var $t=a({name:"token_bridge",description:"Bridge tokens across chains. Builds, signs locally, broadcasts, and registers.",input:k.object({from:k.object({wallet:k.string().describe("Local wallet name to sign with"),chain:u.describe("Source chain"),token:k.string().describe("Source token address"),amount:k.coerce.number().nullable().describe("Amount to send (exact-in). Null for exact-out.")}),to:k.object({wallet:k.string().nullable().describe("Destination wallet name or address (defaults to from wallet)"),chain:u.describe("Destination chain"),token:k.string().describe("Destination token address"),amount:k.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:k.object({signature:k.string().describe("Transaction hash/signature"),message:k.string().describe("Human-readable bridge description")})});var pi=[{name:"approve",type:"function",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],he=s($t,async e=>{if(!e.from.amount&&!e.to.amount)throw new Error("Provide either from.amount or to.amount.");let t=v(),n=await j.handler({wallet:e.from.wallet}),i=n.addresses[h[e.from.chain]];if(!i)throw new Error(`Wallet "${n.name}" has no address on ${e.from.chain}.`);let r=i;if(e.to.wallet)try{r=(await j.handler({wallet:e.to.wallet})).addresses[h[e.to.chain]]??e.to.wallet}catch{r=e.to.wallet}else e.from.chain!==e.to.chain&&(r=n.addresses[h[e.to.chain]]??i);let o={from:{wallet:i,chain:e.from.chain,token:e.from.token,amount:e.from.amount},to:{wallet:r,chain:e.to.chain,token:e.to.token,amount:e.to.amount}},c=await w(t,"swaps_transaction_build",o),p=c.transaction;if(c.requiresApproval&&"to"in p){let{to:m,chainId:C}=p,M={type:"evm",to:e.from.token,data:ci({abi:pi,functionName:"approve",args:[m,BigInt(c.amountIn.raw)]}),value:"0",chainId:C},{transaction:re}=await E.handler({wallet:n.name,chain:e.from.chain,transaction:JSON.stringify(M)}),oe=await w(t,"transaction_send",{transaction:re,message:`Approve ${c.amountIn.symbol}`,chain:e.from.chain});if(!oe.signature)throw new Error(`Approval failed: ${oe.message}`);process.stderr.write(`Approval sent. Waiting for confirmation...
|
|
23
|
+
`),await new Promise(De=>setTimeout(De,5e3)),c=await w(t,"swaps_transaction_build",o)}let d="base64"in c.transaction?c.transaction.base64:JSON.stringify(c.transaction),{transaction:_}=await E.handler({wallet:n.name,chain:e.from.chain,transaction:d}),y=await w(t,"transaction_send",{transaction:_,message:c.message,chain:e.from.chain});if(!y.signature)throw new Error(`Transaction send failed: ${y.message}`);try{await w(t,"transaction_register",{transactionId:c.transactionId,transactionHash:y.signature,chain:e.from.chain})}catch{}return{signature:y.signature,message:c.message}});import{z as T}from"zod";var Rt=a({name:"token_swap",description:"Swap tokens on the same chain. Builds, signs locally, broadcasts, and registers.",input:T.object({wallet:T.string().describe("Local wallet name to sign with"),chain:u.describe("Chain to swap on"),from:T.object({token:T.string().describe("Input token address (selling)"),amount:T.coerce.number().nullable().describe("Amount to sell (exact-in). Null for exact-out.")}),to:T.object({token:T.string().describe("Output token address (buying)"),amount:T.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:T.object({signature:T.string().describe("Transaction hash/signature"),message:T.string().describe("Human-readable swap description")})});var Et=s(Rt,async e=>he.handler({from:{wallet:e.wallet,chain:e.chain,token:e.from.token,amount:e.from.amount},to:{wallet:null,chain:e.chain,token:e.to.token,amount:e.to.amount}}));import{z as I}from"zod";var Ut=a({name:"token_transfer",description:"Transfer tokens to another wallet on the same chain. Builds, signs locally, and broadcasts.",input:I.object({wallet:I.string().describe("Local wallet name to sign with"),chain:u.describe("Chain to transfer on"),token:I.string().describe("Token address to transfer"),amount:I.coerce.number().describe("Amount to transfer"),to:I.string().describe("Recipient wallet name or address")}),output:I.object({signature:I.string().describe("Transaction hash/signature"),message:I.string().describe("Human-readable transfer description")})});var Dt=s(Ut,async e=>{let t=v(),n=await j.handler({wallet:e.wallet}),i=n.addresses[h[e.chain]];if(!i)throw new Error(`Wallet "${n.name}" has no address on ${e.chain}.`);let r=e.to;try{r=(await j.handler({wallet:e.to})).addresses[h[e.chain]]??e.to}catch{}let o=await w(t,"token_transfer",{wallet:i,token:e.token,to:r,amount:e.amount,chain:e.chain}),c="base64"in o.transaction?o.transaction.base64:JSON.stringify(o.transaction),{transaction:p}=await E.handler({wallet:n.name,chain:e.chain,transaction:c}),d=await w(t,"transaction_send",{transaction:p,message:o.message,chain:e.chain});if(!d.signature)throw new Error(`Transaction send failed: ${d.message}`);return{signature:d.signature,message:o.message}});import{Keypair as li,VersionedTransaction as di,VersionedMessage as ui}from"@solana/web3.js";import Ot from"axios";import{wrapAxiosWithPayment as Nt}from"@x402/axios";import{x402Client as Lt}from"@x402/core/client";import{ExactSvmScheme as mi}from"@x402/svm";import{registerExactEvmScheme as hi}from"@x402/evm/exact/client";import{toClientEvmSigner as fi}from"@x402/evm";import{privateKeyToAccount as yi}from"viem/accounts";import{createPublicClient as gi,http as bi}from"viem";import*as P from"viem/chains";import{z as b}from"zod";var qt=a({name:"x402_request",description:"Make an HTTP request to an x402-protected endpoint. Automatically handles payment when a 402 Payment Required response is received, signing the payment transaction with the local wallet.",input:b.object({method:b.enum(["GET","POST","PUT","PATCH","DELETE"]).describe("HTTP method"),url:b.string().url().refine(e=>e.startsWith("https://"),{message:"URL must use HTTPS"}).refine(e=>{try{return!new URL(e).hostname.match(/^(localhost|127\.|10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|169\.254\.|0\.0\.0\.0|\[::1\])/)}catch{return!1}},{message:"URL must not target private/internal addresses"}).describe("Full HTTPS URL of the x402-protected endpoint (e.g., 'https://agents.moonpay.com/x402/upgrade')"),body:b.record(b.any()).nullable().describe("Request body (for POST, PUT, PATCH)"),params:b.record(b.any()).nullable().describe("Query parameters"),wallet:b.string().describe("Wallet name or address to pay with"),chain:b.enum(["solana","base","ethereum","arbitrum","polygon","optimism"]).nullable().describe("Chain to pay from (default: solana). Use an EVM chain like 'base' to pay with an EVM wallet.")}),output:b.object({status:b.number().describe("HTTP status code"),data:b.any().describe("Response data"),headers:b.record(b.any()).describe("Response headers")})});var _i="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",wi={ethereum:P.mainnet,base:P.base,polygon:P.polygon,arbitrum:P.arbitrum,optimism:P.optimism};function Si(e,t){let n=li.fromSecretKey(t),i={address:e,signTransactions:async c=>c.map(p=>{let d=new Uint8Array(p.messageBytes),_=ui.deserialize(d),y=Object.keys(p.signatures).length,m=new di(_,new Array(y).fill(new Uint8Array(64)));m.sign([n]);let C=_.staticAccountKeys.findIndex(M=>M.toBase58()===e);if(C===-1)throw new Error(`Wallet ${e} is not a signer for this transaction`);return{[e]:m.signatures[C]}})},r=new Lt,o=new mi(i);return r.register(_i,o),r.registerV1("solana",o),Nt(Ot.create(),r)}function ki(e,t){let n=yi(`0x${Buffer.from(e).toString("hex")}`),i=wi[t]??P.base,r=gi({chain:i,transport:bi()}),o=fi(n,r),c=new Lt;return hi(c,{signer:o}),Nt(Ot.create(),c)}var fe=s(qt,async({method:e,url:t,body:n,params:i,wallet:r,chain:o})=>{let c=g(r),p=o??"solana",{privateKey:d,address:_}=q(c,p),y=p==="solana"?Si(_,d):ki(d,p),m;switch(e){case"GET":m=await y.get(t,{params:i});break;case"POST":m=await y.post(t,n||{},{params:i});break;case"PUT":m=await y.put(t,n||{},{params:i});break;case"PATCH":m=await y.patch(t,n||{},{params:i});break;case"DELETE":m=await y.delete(t,{params:i});break;default:throw new Error(`Unsupported HTTP method: ${e}`)}return{status:m.status,data:m.data,headers:m.headers}});import{z as F}from"zod";var Bt=a({name:"virtual-account_wallet_register",description:"Register a local wallet with your virtual account. Creates the verification message, signs it locally, and registers in one step.",input:F.object({wallet:F.string().describe("Local wallet name"),chain:u.describe("Chain to register (solana, ethereum, etc.)")}),output:F.object({success:F.literal(!0),address:F.string().describe("Registered wallet address"),chain:F.string().describe("Chain registered on")})});var Wt=s(Bt,async e=>{let t=v(),n=e.chain,i=await j.handler({wallet:e.wallet}),r=h[n],o=i.addresses[r];if(!o)throw new Error(`Wallet "${i.name}" has no ${r} address.`);let{message:c}=await je(t,"virtual-account_wallet_registration-message_create",{wallet:o}),{signature:p}=await me.handler({wallet:i.name,chain:n,message:c});return await w(t,"virtual-account_wallet_register",{wallet:o,message:c,signature:p,chain:n}),{success:!0,address:o,chain:n}});import*as x from"fs";import*as zt from"os";import*as Ue from"path";import*as Kt from"crypto";import{z as ye}from"zod";var Vt=a({name:"consent_accept",description:"Accept the MoonPay Terms of Use. Required before using any CLI command.",input:ye.object({}),output:ye.object({tosVersion:ye.string(),acceptedAt:ye.string()})});import*as ge from"os";var Ft=3e3;function Ht(e){let t=v(),n=JSON.stringify({agentId:e.agentId,tosVersion:e.tosVersion,cliVersion:e.cliVersion,nodeVersion:process.version,os:ge.platform(),arch:ge.arch()});fetch(`${t}/api/tools/cli_activation_create`,{method:"POST",headers:A(),body:n,signal:AbortSignal.timeout(Ft)}).catch(()=>{})}async function Mt(e){let t=v(),n=await N();n&&fetch(`${t}/api/tools/cli_activation_update`,{method:"POST",headers:{...A(),Authorization:`Bearer ${n}`},body:JSON.stringify({agentId:e}),signal:AbortSignal.timeout(Ft)}).catch(()=>{})}var Re=Ue.join(zt.homedir(),".config","moonpay"),Ee=Ue.join(Re,"consent.json");function vi(){try{return JSON.parse(x.readFileSync(Ee,"utf-8"))}catch{return null}}var Gt=s(Vt,async()=>{x.existsSync(Re)||x.mkdirSync(Re,{recursive:!0,mode:448});let t=vi()?.agentId??Kt.randomUUID(),n=new Date().toISOString(),i={tosVersion:"1.2",acceptedAt:n,agentId:t},r=Ee+`.tmp.${process.pid}`;return x.writeFileSync(r,JSON.stringify(i,null,2),{encoding:"utf-8",mode:384}),x.renameSync(r,Ee),process.stderr.write(`
|
|
24
|
+
By using this CLI, you agree to:
|
|
25
|
+
${le}
|
|
26
|
+
|
|
27
|
+
`),Ht({agentId:t,tosVersion:"1.2",cliVersion:_e}),{tosVersion:i.tosVersion,acceptedAt:i.acceptedAt}});import{z as ie}from"zod";var Jt=a({name:"login",description:"Send a login verification code to your email.",input:ie.object({email:ie.string().describe("Email address")}),output:ie.object({email:ie.string(),message:ie.string()})});var Yt=s(Jt,async e=>{let{baseUrl:t}=pe(),n=`${t}/login?email=${encodeURIComponent(e.email)}`;return{email:e.email,message:`Open this link to verify:
|
|
28
|
+
|
|
29
|
+
${n}
|
|
30
|
+
|
|
31
|
+
Then run: mp verify --email ${e.email} --code <code>`}});import*as Zt from"fs";import*as Qt from"os";import*as en from"path";import{z as H}from"zod";var Xt=a({name:"verify",description:"Verify login code and store encrypted credentials.",input:H.object({email:H.string().describe("Email address"),code:H.string().describe("Verification code")}),output:H.object({email:H.string(),message:H.string()})});var Ti=en.join(Qt.homedir(),".config","moonpay","consent.json");function Pi(){try{return JSON.parse(Zt.readFileSync(Ti,"utf-8")).agentId??null}catch{return null}}var tn=s(Xt,async e=>{let{baseUrl:t}=pe(),n=await Te(t,"verify",{email:e.email,code:e.code}),i={accessToken:n.accessToken,refreshToken:n.refreshToken,expiresAt:n.expiresAt*1e3,baseUrl:t};ve(i);let r=Pi();return r&&Mt(r).catch(()=>{}),{email:e.email,message:"Logged in successfully."}});import{z as be}from"zod";var nn=a({name:"logout",description:"Log out and clear stored credentials.",input:be.object({}),output:be.object({success:be.literal(!0),message:be.string()})});var rn=s(nn,async()=>(Ke(),{success:!0,message:"Logged out."}));import{z as $}from"zod";var on=a({name:"upgrade",description:"Purchase a rate limit upgrade via x402. Increases your API rate limit. Requires login and a funded wallet.",input:$.object({duration:$.enum(["day","month"]).describe("Upgrade duration: day ($1 USDC, 24h) or month ($20 USDC, 30 days)"),wallet:$.string().describe("Wallet name or address to pay with"),chain:$.enum(["solana","base"]).describe("Chain to pay from. x402 payments accepted on Solana and Base.")}),output:$.object({duration:$.string(),expiresAt:$.string().describe("When the upgrade expires"),message:$.string()})});var an=s(on,async e=>{if(!await N())throw new Error("Login required to upgrade. Run `mp login` first.");let n=v(),i=await w(n,"user_retrieve",{}),r=await fe.handler({method:"POST",url:`${n}/x402/upgrade`,body:{userId:i.id,duration:e.duration},params:null,wallet:e.wallet,chain:e.chain});if(r.status>=400){let o=r.data?.error??"Upgrade failed";throw new Error(o)}return r.data});var qc=[et,rt,st,j,dt,mt,ft,E,me,St,jt,Ct,It,Et,he,Dt,fe,Wt,Gt,Ze,Yt,tn,rn,an];export{_e as a,v as b,je as c,Ni as d,le as e,Ze as f,qc as g};
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as
|
|
4
|
-
`):e.map(r=>{if(typeof r!="object"||r===null)return`${n}- ${O(r)}`;let o=Object.entries(r),a=[],[c,f]=o[0];N(f)?a.push(`${n}- ${p.bold(c)}: ${O(f)}`):(a.push(`${n}- ${p.bold(c)}:`),a.push(
|
|
3
|
+
import{a as S,b as A,c as J,d as j,e as R,f as _,g as k}from"./chunk-AYAAQSBK.js";import"./chunk-WLQU5BOQ.js";import{Command as X}from"commander";var M=!process.env.NO_COLOR&&process.stdout.isTTY===!0;function $(e){return t=>M?`${e}${t}\x1B[0m`:t}var p={bold:$("\x1B[1m"),dim:$("\x1B[2m"),green:$("\x1B[32m"),yellow:$("\x1B[33m"),cyan:$("\x1B[36m"),red:$("\x1B[31m")};function N(e){if(e==null)return!0;let t=typeof e;return t==="string"||t==="number"||t==="boolean"}function O(e){return e==null?"-":String(e)}function C(e,t=0){let n=" ".repeat(t);return N(e)?`${n}${O(e)}`:Array.isArray(e)?e.length===0?`${n}${p.dim("(empty)")}`:e.every(N)?e.map(r=>`${n}- ${O(r)}`).join(`
|
|
4
|
+
`):e.map(r=>{if(typeof r!="object"||r===null)return`${n}- ${O(r)}`;let o=Object.entries(r),a=[],[c,f]=o[0];N(f)?a.push(`${n}- ${p.bold(c)}: ${O(f)}`):(a.push(`${n}- ${p.bold(c)}:`),a.push(C(f,t+2)));for(let[m,y]of o.slice(1))N(y)?a.push(`${n} ${p.bold(m)}: ${O(y)}`):(a.push(`${n} ${p.bold(m)}:`),a.push(C(y,t+2)));return a.join(`
|
|
5
5
|
`)}).join(`
|
|
6
6
|
|
|
7
7
|
`):typeof e=="object"&&e!==null?Object.entries(e).map(([o,a])=>N(a)?`${n}${p.bold(o)}: ${O(a)}`:`${n}${p.bold(o)}:
|
|
8
|
-
${
|
|
9
|
-
`):""}function
|
|
10
|
-
`)}function P(e){let t=null,n=
|
|
8
|
+
${C(a,t+1)}`).join(`
|
|
9
|
+
`):""}function q(e){if(typeof e!="object"||e===null)return e;let t=e;return"data"in t?t.data:"items"in t&&Array.isArray(t.items)&&Object.keys(t).filter(r=>r!=="items").length===0?t.items:e}function v(e,t){return t==="json"?JSON.stringify(e,null,2):C(q(e))}import{readFileSync as Y,writeFileSync as z,mkdirSync as H}from"fs";import{join as K}from"path";import{homedir as B}from"os";var x=K(B(),".config","moonpay"),E=K(x,"update-check.json"),G=1440*60*1e3,V=3e3;function W(){try{let e=Y(E,"utf-8");return JSON.parse(e)}catch{return null}}function Q(e){try{H(x,{recursive:!0}),z(E,JSON.stringify(e))}catch{}}function T(e,t){let n=e.split(".").map(Number),r=t.split(".").map(Number);for(let o=0;o<3;o++){if((n[o]??0)>(r[o]??0))return!0;if((n[o]??0)<(r[o]??0))return!1}return!1}function F(e,t){return["",p.yellow(`Update available: ${e} \u2192 ${t}`),p.dim("Run `npm i -g @moonpay/cli` to update."),""].join(`
|
|
10
|
+
`)}function P(e){let t=null,n=W();if(n&&Date.now()-n.checkedAt<G)return T(n.latest,e)&&(t=F(e,n.latest)),()=>t;let r=new AbortController,o=setTimeout(()=>r.abort(),V);return fetch("https://registry.npmjs.org/@moonpay%2fcli/latest",{signal:r.signal}).then(a=>a.json()).then(a=>{let c=a.version;c&&(Q({latest:c,checkedAt:Date.now()}),T(c,e)&&(t=F(e,c)))}).catch(()=>{}).finally(()=>clearTimeout(o)),()=>t}var ee=P(S),h=new X;h.name("moonpay").description(`MoonPay CLI \u2014 the crypto onramp for AI agents
|
|
11
11
|
|
|
12
12
|
Your agents need money. MoonPay gives them wallets, funds, and tools
|
|
13
13
|
to buy, swap, bridge, and transact \u2014 all from the command line.
|
|
14
14
|
|
|
15
15
|
Run \`mp skill install\` to install AI skills for Claude Code.
|
|
16
16
|
|
|
17
|
-
`+
|
|
18
|
-
`)),
|
|
17
|
+
`+R).version(S).option("--json","Output as JSON instead of YAML");function ne(){return h.opts().json?"json":"yaml"}function I(e){console.log(v(e,ne()))}function L(){let e=ee();e&&process.stderr.write(e)}h.command("mcp").description("Start MCP server over stdio (for Claude Desktop, Claude Code, etc.)").action(async()=>{let{startMcpServer:e}=await import("./mcp-NGQW4C74.js");await e()});function D(e,t){let n=e;for(let r of t){let o=n.commands.find(a=>a.name()===r);o||(o=n.command(r)),n=o}return n}function U(e,t=""){let n=[];for(let[r,o]of Object.entries(e)){let a=t?`${t}-${r}`:r,c=o;for(;c._def.typeName==="ZodEffects";)c=c._def.schema;let f=c;f._def.typeName==="ZodNullable"&&(f=f._def.innerType),f._def.typeName==="ZodObject"&&f.shape?n.push(...U(f.shape,a)):n.push({flatKey:a,field:o,path:a.split("-")})}return n}function te(e,t){let n={};for(let{flatKey:r,path:o}of t){let a=r.replace(/-([a-z])/g,(f,m)=>m.toUpperCase()),c=a in e?e[a]:e[r];if(o.length===1)n[o[0]]=c;else{let f=n;for(let m=0;m<o.length-1;m++)(!f[o[m]]||typeof f[o[m]]!="object")&&(f[o[m]]={}),f=f[o[m]];f[o[o.length-1]]=c}}return n}function re(e,t){for(let n of t){let r=n.schema.name.split("_"),o=r.pop(),c=D(e,r).command(o).description(n.schema.description),f=n.schema.input.shape??{},m=U(f),y=[],b=[],w=[];for(let{flatKey:u,field:i}of m){let s=i.description??u,l=i;for(;l._def.typeName==="ZodEffects";)l=l._def.schema;let g=l._def.typeName,d=l;d._def.typeName==="ZodNullable"&&(d=d._def.innerType),d._def.typeName==="ZodNumber"&&b.push(u),d._def.typeName==="ZodRecord"&&w.push(u),g==="ZodBoolean"?c.option(`--${u}`,s,!1):g==="ZodNullable"?(c.option(`--${u} <${u}>`,s),y.push(u)):c.requiredOption(`--${u} <${u}>`,s)}c.action(async u=>{n.schema.name.startsWith("consent_")||await _.handler({});for(let s of y){let l=s.replace(/-([a-z])/g,(g,d)=>d.toUpperCase());u[l]===void 0&&(u[l]=null)}for(let s of b){let l=s.replace(/-([a-z])/g,(g,d)=>d.toUpperCase());u[l]!=null&&typeof u[l]=="string"&&(u[l]=Number(u[l]))}for(let s of w){let l=s.replace(/-([a-z])/g,(g,d)=>d.toUpperCase());if(typeof u[l]=="string")try{u[l]=JSON.parse(u[l])}catch{console.error(`Invalid JSON for --${s}`),process.exit(1)}}let i=te(u,m);try{let s=await n.handler(i);I(s)}catch(s){console.error(s.message),process.exit(1)}})}}function oe(e){if(e.$ref&&e.definitions){let t=e.$ref.replace("#/definitions/","");return e.definitions[t]}return e}function se(e){return Array.isArray(e.type)?e.type.includes("null"):e.anyOf?e.anyOf.some(t=>t.type==="null"):!1}function ie(e){return Array.isArray(e.type)?e.type.includes("object"):e.anyOf?e.anyOf.some(t=>t.type==="object"):e.type==="object"}function ae(e){return Array.isArray(e.type)?e.type.some(t=>t==="number"||t==="integer"):e.anyOf?e.anyOf.some(t=>t.type==="number"||t.type==="integer"):e.type==="number"||e.type==="integer"}var Z=new Set(["swaps_transaction_build","token_transfer","transaction_register"]);function ce(e,t){for(let n of t){if(Z.has(n.name))continue;let r=n.name.split("_"),o=r.pop(),a=D(e,r);if(a.commands.find(i=>i.name()===o))continue;let c=a.command(o).description(n.description),f=oe(n.inputSchema),m=f.properties??{},y=new Set(f.required??[]),b=[],w=[],u=[];for(let[i,s]of Object.entries(m)){let l=s.description??i,g=se(s),d=ie(s);ae(s)&&w.push(i),d?(u.push(i),y.has(i)&&!g?c.requiredOption(`--${i} <json>`,`${l} (as JSON)`):(c.option(`--${i} <json>`,`${l} (as JSON)`),b.push(i))):g||!y.has(i)?(c.option(`--${i} <${i}>`,l),b.push(i)):c.requiredOption(`--${i} <${i}>`,l)}c.action(async i=>{await _.handler({});for(let s of b)i[s]===void 0&&(i[s]=null);for(let s of w)i[s]!=null&&typeof i[s]=="string"&&(i[s]=Number(i[s]));for(let s of u)if(typeof i[s]=="string")try{i[s]=JSON.parse(i[s])}catch{console.error(`Invalid JSON for --${s}`),process.exit(1)}try{let s=A(),l=await J(s,n.name,i);I(l),L()}catch(s){console.error(s.message),process.exit(1)}})}}re(h,k);ce(h,j);h.command("tools").description("List available tools").action(()=>{let e=[...k.map(n=>({name:n.schema.name,description:n.schema.description})),...j.filter(n=>!k.some(r=>r.schema.name===n.name)&&!Z.has(n.name)).map(n=>({name:n.name,description:n.description}))].sort((n,r)=>n.name.localeCompare(r.name)),t=[];for(let n of e){let r=n.name.replace(/_/g," ");t.push(` ${p.green(r.padEnd(28))} ${p.dim(n.description)}`)}t.push(""),t.push(p.dim(`${e.length} tools`)),console.log(t.join(`
|
|
18
|
+
`)),L()});h.parse();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{b as u,c as f,d,g as l}from"./chunk-AYAAQSBK.js";import"./chunk-WLQU5BOQ.js";import{Server as R}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as x}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as T,ListToolsRequestSchema as v}from"@modelcontextprotocol/sdk/types.js";import{zodToJsonSchema as N}from"zod-to-json-schema";var y=new Map(l.map(s=>[s.schema.name,s]));function q(s){let n=s.inputSchema;if(n.$ref&&n.definitions){let p=n.$ref.replace("#/definitions/","");return n.definitions[p]??n}return n}async function C(){let s=new R({name:"moonpay",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),n=l.map(e=>({name:e.schema.name,description:e.schema.description,inputSchema:N(e.schema.input)})),p=new Map;for(let e of d){if(y.has(e.name))continue;let t=q(e);p.set(e.name,t.properties??{}),n.push({name:e.name,description:e.description,inputSchema:{type:"object",properties:t.properties??{},...t.required?{required:t.required}:{},...t.additionalProperties!==void 0?{additionalProperties:t.additionalProperties}:{}}})}let h=new Map(n.map(e=>[e.name,e]));s.setRequestHandler(v,async()=>({tools:n.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema}))})),s.setRequestHandler(T,async e=>{let{name:t,arguments:o={}}=e.params;if(!h.has(t))return{content:[{type:"text",text:`Unknown tool: ${t}`}],isError:!0};try{let i=y.get(t);if(i){let c=i.schema.input.shape??{};for(let[m,a]of Object.entries(c))o[m]===void 0&&a._def.typeName==="ZodNullable"&&(o[m]=null);let r=await i.handler(o);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}let S=p.get(t)??{};for(let[c,r]of Object.entries(S))o[c]===void 0&&(Array.isArray(r.type)?r.type.includes("null"):r.anyOf?.some(O=>O.type==="null"))&&(o[c]=null),(r.type==="number"||r.type==="integer"||Array.isArray(r.type)&&r.type.some(a=>a==="number"||a==="integer")||r.anyOf?.some(a=>a.type==="number"||a.type==="integer"))&&typeof o[c]=="string"&&(o[c]=Number(o[c]));let b=u(),w=await f(b,t,o);return{content:[{type:"text",text:JSON.stringify(w,null,2)}]}}catch(i){return{content:[{type:"text",text:i instanceof Error?i.message:String(i)}],isError:!0}}});let g=new x;await s.connect(g)}export{C as startMcpServer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonpay/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.29",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"mp": "dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "tsup",
|
|
18
|
+
"build": "tsup && node dist/index.js --version",
|
|
19
19
|
"dev": "tsx src/index.ts",
|
|
20
20
|
"test": "jest"
|
|
21
21
|
},
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"commander": "^12.1.0",
|
|
36
36
|
"ecpair": "^3.0.1",
|
|
37
37
|
"ed25519-hd-key": "^1.3.0",
|
|
38
|
-
"qrcode-terminal": "^0.12.0",
|
|
39
38
|
"tiny-secp256k1": "^2.2.4",
|
|
40
39
|
"tweetnacl": "^1.0.3",
|
|
41
40
|
"viem": "^2.46.2",
|
package/dist/chunk-K4KO6VY7.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
import{a as Ne,b as Le,c as Be,d as We,e as Ve,f as se,g as m,h as y,i as Fe,j as D,k as ce,l as pe,n as He,p as b,q as K,r as ze,s as O}from"./chunk-WLQU5BOQ.js";import*as l from"fs";import*as Ke from"os";import*as Z from"path";import{readFileSync as un}from"fs";import{join as mn}from"path";import{homedir as hn}from"os";import{createRequire as fn}from"module";var yn=fn(import.meta.url),gn=yn("../package.json"),A=gn.version,I="X-CLI-Version",Se="X-Agent-Id",G;function Me(){if(G!==void 0)return G;try{G=JSON.parse(un(mn(hn(),".config","moonpay","consent.json"),"utf-8")).agentId??null}catch{G=null}return G??null}var Y=Z.join(Ke.homedir(),".config","moonpay"),ve=Z.join(Y,"config.json"),X=Z.join(Y,"credentials.json"),J=Z.join(Y,".credentials.lock"),ke={baseUrl:"https://agents.moonpay.com"};function Te(){l.existsSync(Y)||l.mkdirSync(Y,{recursive:!0,mode:448})}function Ge(e,t,n){let r=e+`.tmp.${process.pid}`;l.writeFileSync(r,t,{encoding:"utf-8",mode:n}),l.renameSync(r,e)}var bn=3e4;function _n(){Te();try{let e=l.openSync(J,l.constants.O_CREAT|l.constants.O_EXCL|l.constants.O_WRONLY,384);l.writeSync(e,JSON.stringify({pid:process.pid,ts:Date.now()})),l.closeSync(e)}catch(e){if(e.code!=="EEXIST")throw e;try{let t=JSON.parse(l.readFileSync(J,"utf-8"));if(Date.now()-t.ts<bn)return null}catch{}try{l.unlinkSync(J)}catch{}try{let t=l.openSync(J,l.constants.O_CREAT|l.constants.O_EXCL|l.constants.O_WRONLY,384);l.writeSync(t,JSON.stringify({pid:process.pid,ts:Date.now()})),l.closeSync(t)}catch{return null}}return()=>{try{l.unlinkSync(J)}catch{}}}function Je(){if(!l.existsSync(ve))return null;try{let e=JSON.parse(l.readFileSync(ve,"utf-8"));return e.baseUrl?e:null}catch{return null}}function le(){let e=Je();return e||(wn(ke),ke)}function N(){if(!l.existsSync(X))return null;let e=We();if(!e)return null;try{let t=JSON.parse(l.readFileSync(X,"utf-8")),n=Ne.parse(t),r=Be(n,e),i=JSON.parse(r);return!i.accessToken||!i.baseUrl?null:i}catch{return null}}function Pe(e){let t=Ve(),n=Le(JSON.stringify(e),t);Te(),Ge(X,JSON.stringify(n,null,2),384)}function wn(e){Te(),Ge(ve,JSON.stringify(e,null,2),384)}function Ye(){l.existsSync(X)&&l.unlinkSync(X)}function k(){let e=Je(),t=N();return e?.baseUrl??t?.baseUrl??ke.baseUrl}async function je(e,t,n){let r=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(15e3),headers:{"Content-Type":"application/json",[I]:A},body:JSON.stringify(n)}),i=await r.json();if(!r.ok){let o=i;throw new Error(o?.error??`${t} failed (${r.status})`)}return i}async function xe(e){if(!e.refreshToken)throw new Error("No refresh token available");let t=_n();if(!t){await new Promise(r=>setTimeout(r,2e3));let n=N();if(n&&n.expiresAt>Date.now())return n;throw new Error("Token refresh failed (concurrent refresh in progress)")}try{let n=N();if(n&&n.expiresAt>Date.now()+6e4)return n;let r=await je(e.baseUrl,"refresh",{refreshToken:e.refreshToken}),i={accessToken:r.accessToken,refreshToken:r.refreshToken,expiresAt:r.expiresAt*1e3,baseUrl:e.baseUrl};return Pe(i),i}finally{t()}}var Sn=300*1e3;async function L(){let e=N();if(!e)return null;if(Date.now()>=e.expiresAt-Sn){if(e.refreshToken)try{return(await xe(e)).accessToken}catch{return null}return null}return e.accessToken}async function Ce(e,t,n){let r=await L(),i={"Content-Type":"application/json",[I]:A},o=Me();o&&(i[Se]=o),r&&(i.Authorization=`Bearer ${r}`);let a=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:i,body:JSON.stringify(n)});if(a.status===401&&r){let u=N();if(u?.refreshToken)try{let h=await xe(u);a=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:{"Content-Type":"application/json",[I]:A,...o?{[Se]:o}:{},Authorization:`Bearer ${h.accessToken}`},body:JSON.stringify(n)})}catch{}}if(a.status===401)throw new Error("This command requires a MoonPay CLI account. Run `moonpay login` first.");let p=await a.text();if(!p){if(a.status===429){let u=r?" Run `mp upgrade` to increase your rate limit.":" Log in with `mp login` for higher limits.";throw new Error(`Rate limit exceeded.${u}`)}throw new Error(`Empty response from server (${a.status})`)}let d;try{d=JSON.parse(p)}catch{throw new Error(`Unexpected response from server (${a.status})`)}if(a.status<200||a.status>=300){let u=d;throw new Error(u?.error??`Tool call failed (${a.status})`)}return d}async function w(e,t,n){return await Ce(e,t,n)}var Yr=[{name:"buy",description:"Buy crypto with fiat via MoonPay. Returns a checkout URL to complete the purchase.",inputSchema:{$ref:"#/definitions/buy_input",definitions:{buy_input:{type:"object",properties:{token:{type:"string",enum:["btc","pol_polygon","sol","trx","usdc","usdc_arbitrum","usdc_base","usdc_optimism","usdc_sol","usdc_polygon","usdt_trx","eth","eth_polygon","eth_optimism","eth_base","eth_arbitrum"],description:"MoonPay currency code: sol (Solana), usdc_sol (USDC on Solana), eth (Ethereum), usdc (USDC on Ethereum), usdc_base (USDC on Base), trx (TRX on Tron), usdt_trx (USDT on Tron), etc."},amount:{type:"number",description:"Amount in USD to spend. For example, 50 means $50 worth of the selected token."},wallet:{type:"string",description:"Destination wallet address to receive tokens (must match the chain for the selected token)"},email:{type:["string","null"],description:"Buyer email to pre-fill on the checkout page"}},required:["token","amount","wallet","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/buy_output",definitions:{buy_output:{type:"object",properties:{url:{type:"string",description:"MoonPay checkout URL \u2014 open in browser to complete purchase"}},required:["url"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_create",description:"Create a new deposit link that generates multi-chain deposit addresses. Anyone can send crypto to these addresses from Solana, Ethereum, Bitcoin, or Tron \u2014 it automatically converts to the specified stablecoin and settles to the destination wallet and chain.",inputSchema:{$ref:"#/definitions/deposit_create_input",definitions:{deposit_create_input:{type:"object",properties:{name:{type:"string",description:"Human-readable label for this deposit link (e.g. 'Treasury Base USDC')"},wallet:{type:"string",description:"Destination wallet address where USDC will be delivered"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","bnb"],description:"Blockchain of the destination wallet"},token:{type:"string",enum:["USDC","USDC.e","USDT"],description:"Token to receive. USDC.e (bridged USDC) is only available on Polygon."}},required:["name","wallet","chain","token"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_create_output",definitions:{deposit_create_output:{type:"object",properties:{id:{type:"string",description:"Unique deposit ID \u2014 use with deposit_transaction_list to check incoming payments"},destinationWallet:{type:"string",description:"Wallet address that will receive the stablecoin"},destinationChain:{type:"string",description:"Chain where the stablecoin will be delivered"},customerToken:{type:"string",description:"Token to check deposit transactions \u2014 pass to deposit_transaction_list"},depositUrl:{type:"string",description:"Shareable URL \u2014 open in browser or share with senders to deposit funds"},wallets:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address to send funds to"},chain:{type:"string",description:"Chain this address is on (solana, ethereum, bitcoin, tron)"},qrCode:{type:"string",description:"URL to a QR code image for the deposit address"}},required:["address","chain","qrCode"],additionalProperties:!1},description:"Deposit addresses across all supported chains \u2014 send any token to any of these"},instructions:{type:"string",description:"Human-readable instructions explaining how to use the deposit"}},required:["id","destinationWallet","destinationChain","customerToken","depositUrl","wallets","instructions"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_retrieve",description:"Retrieve details of a deposit by ID. Returns the deposit name, status, destination wallet, and deposit addresses.",inputSchema:{$ref:"#/definitions/deposit_retrieve_input",definitions:{deposit_retrieve_input:{type:"object",properties:{id:{type:"string",description:"Deposit ID returned from deposit_create"}},required:["id"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_retrieve_output",definitions:{deposit_retrieve_output:{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string"},destinationWallet:{type:["string","null"]},depositUrl:{type:"string"}},required:["id","name","status","destinationWallet","depositUrl"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_transaction_list",description:"List transactions for a deposit. Pass the deposit id from deposit_create to check incoming payment status.",inputSchema:{$ref:"#/definitions/deposit_transaction_list_input",definitions:{deposit_transaction_list_input:{type:"object",properties:{id:{type:"string",description:"Deposit ID returned from deposit_create"}},required:["id"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_transaction_list_output",definitions:{deposit_transaction_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},amount:{type:"number"},token:{type:"string"},from:{type:"string"},status:{type:"string"},settledAmount:{type:["number","null"]},settledCurrency:{type:["string","null"]},timestamp:{type:"string"}},required:["id","amount","token","from","status","settledAmount","settledCurrency","timestamp"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"feedback_create",description:"Submit feedback, a bug report, or a feature request. Requires authentication.",inputSchema:{$ref:"#/definitions/feedback_create_input",definitions:{feedback_create_input:{type:"object",properties:{type:{type:"string",enum:["bug","feature","general"],description:"Type of feedback: bug, feature, or general"},message:{type:"string",minLength:1,maxLength:280,description:"Your feedback message"}},required:["type","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/feedback_create_output",definitions:{feedback_create_output:{type:"object",properties:{id:{type:"string",description:"Feedback ID"},message:{type:"string",description:"Confirmation message"}},required:["id","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"login",description:"Send a verification code to the provided email to sign in or create an account. Requires an hCaptcha token.",inputSchema:{$ref:"#/definitions/login_input",definitions:{login_input:{type:"object",properties:{email:{type:"string",format:"email",description:"The email of the user to login"},captchaToken:{type:"string",description:"hCaptcha response token"}},required:["email","captchaToken"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/login_output",definitions:{login_output:{type:"object",properties:{email:{type:"string",description:"The email the OTP was sent to"}},required:["email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"refresh",description:"Refresh an expired access token using a refresh token.",inputSchema:{$ref:"#/definitions/refresh_input",definitions:{refresh_input:{type:"object",properties:{refreshToken:{type:"string",description:"The refresh token from a previous login"}},required:["refreshToken"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/refresh_output",definitions:{refresh_output:{type:"object",properties:{accessToken:{type:"string"},refreshToken:{type:"string"},expiresAt:{type:"number"}},required:["accessToken","refreshToken","expiresAt"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"swaps_transaction_build",description:"Build a swap or bridge transaction. Returns an unsigned transaction with a human-readable message, amounts, exchange rate, and estimated time. Supports same-chain swaps and cross-chain bridges. Accepts UI amounts (e.g. 0.1 SOL) \u2014 decimal conversion is handled automatically.",inputSchema:{$ref:"#/definitions/swaps_transaction_build_input",definitions:{swaps_transaction_build_input:{type:"object",properties:{from:{type:"object",properties:{wallet:{type:"string",description:"Source wallet address (Solana pubkey or EVM 0x address)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Source blockchain"},token:{type:"string",description:"Source token address (mint on Solana, contract on EVM). Use native token address for SOL/ETH."},amount:{type:["number","null"],description:"Amount to swap (exact-in). Null for exact-out."}},required:["wallet","chain","token","amount"],additionalProperties:!1,description:"Source: wallet, chain, token, amount"},to:{type:"object",properties:{wallet:{type:"string",description:"Destination wallet address. Same as source wallet for same-chain swaps."},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Destination blockchain"},token:{type:"string",description:"Destination token address (mint on Solana, contract on EVM)"},amount:{type:["number","null"],description:"Amount to receive (exact-out). Null for exact-in."}},required:["wallet","chain","token","amount"],additionalProperties:!1,description:"Destination: wallet, chain, token, amount"}},required:["from","to"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/swaps_transaction_build_output",definitions:{swaps_transaction_build_output:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID for tracking"},transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Contract address"},data:{type:"string",description:"Calldata"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1}],description:"Unsigned transaction"},message:{type:"string",description:"Human-readable description (e.g. Swap 0.1 SOL \u2192 42.5 USDC on Solana)"},amountIn:{type:"object",properties:{amount:{type:"number",description:"Human-readable amount (e.g. 1.5)"},raw:{type:"string",description:"Raw amount in smallest unit (e.g. wei, lamports)"},symbol:{type:"string"},usd:{type:["number","null"]}},required:["amount","raw","symbol","usd"],additionalProperties:!1},amountOut:{type:"object",properties:{amount:{type:"number",description:"Human-readable amount (e.g. 1.5)"},raw:{type:"string",description:"Raw amount in smallest unit (e.g. wei, lamports)"},symbol:{type:"string"},usd:{type:["number","null"]}},required:["amount","raw","symbol","usd"],additionalProperties:!1},exchangeRate:{type:"number",description:"Exchange rate (amountOut / amountIn)"},estimatedTime:{type:["number","null"],description:"Estimated completion time in seconds"},requiresApproval:{type:"boolean",description:"Whether an ERC20 approval transaction is needed first"}},required:["transactionId","transaction","message","amountIn","amountOut","exchangeRate","estimatedTime","requiresApproval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_balance_list",description:"List all token balances held in a wallet, including amount owned, current value in USD, and token details. Shows the complete token portfolio.",inputSchema:{$ref:"#/definitions/token_balance_list_input",definitions:{token_balance_list_input:{type:"object",properties:{wallet:{type:"string",description:"Wallet address to check token balances for"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to check balances on (e.g. 'solana', 'ethereum', 'base')"}},required:["wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_balance_list_output",definitions:{token_balance_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},balance:{type:"object",properties:{amount:{type:"number",description:"Number of tokens owned"},value:{type:"number",description:"Total value of the token in USD"},price:{type:"number",description:"Current price of the token"}},required:["amount","value","price"],additionalProperties:!1}},required:["address","name","symbol","chain","decimals","balance"],additionalProperties:!1},description:"Array of all tokens in the wallet with their balances and current values"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_retrieve",description:"Get detailed token information including market data, price changes, volume, trades, and holder statistics by token address",inputSchema:{$ref:"#/definitions/token_retrieve_input",definitions:{token_retrieve_input:{type:"object",properties:{token:{type:"string",description:"Address of the token to retrieve"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain network where the token exists"}},required:["token","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_retrieve_output",definitions:{token_retrieve_output:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_search",description:"Search for tokens by name, symbol, or address. Returns matching tokens with their market data including price, volume, and liquidity.",inputSchema:{$ref:"#/definitions/token_search_input",definitions:{token_search_input:{type:"object",properties:{query:{type:"string",description:"Search term - can be token name (e.g. 'Bitcoin'), symbol (e.g. 'BTC'), or partial match"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to search on (e.g. 'solana', 'ethereum', 'base')"},limit:{type:["number","null"],description:"Maximum number of results to return (optional, defaults to 5)"}},required:["query","chain","limit"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_search_output",definitions:{token_search_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1},description:"Array of tokens matching the search query with their market data"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_transfer",description:"Build an unsigned transfer transaction. Returns a transaction ready for signing. Handles both native and token transfers.",inputSchema:{$ref:"#/definitions/token_transfer_input",definitions:{token_transfer_input:{type:"object",properties:{wallet:{type:"string",description:"Sender wallet address (Solana pubkey or EVM 0x address)"},token:{type:"string",description:"Token address (mint on Solana, contract on EVM). Use native token address for SOL/ETH."},to:{type:"string",description:"Recipient wallet address or name"},amount:{type:"number",description:"Amount to transfer in human-readable units (e.g. 1.5)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to execute the transfer on"}},required:["wallet","token","to","amount","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_transfer_output",definitions:{token_transfer_output:{type:"object",properties:{transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Recipient or contract address"},data:{type:"string",description:"Calldata (0x for native transfers)"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1}]},message:{type:"string",description:"Human-readable description of the transfer"}},required:["transaction","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_trending_list",description:"Get currently trending tokens on a blockchain. Perfect for discovering what's hot right now.",inputSchema:{$ref:"#/definitions/token_trending_list_input",definitions:{token_trending_list_input:{type:"object",properties:{chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to get trending tokens from (e.g. 'solana', 'ethereum', 'base')"},limit:{type:"integer",minimum:1,description:"Number of results per page"},page:{type:"integer",minimum:1,description:"Page number (starts at 1)"}},required:["chain","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_trending_list_output",definitions:{token_trending_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1},description:"Array of trending tokens with their market data"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_list",description:"List swap and bridge transaction history for a wallet.",inputSchema:{$ref:"#/definitions/transaction_list_input",definitions:{transaction_list_input:{type:"object",properties:{wallet:{type:"string",description:"Wallet address that signed and sent the transactions"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain the wallet is on"}},required:["wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_list_output",definitions:{transaction_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{transactionId:{type:"string",description:"Transaction tracking ID"},status:{type:"string",description:"Current status: pending, success, or failed"},type:{type:"string",enum:["swap","bridge"],description:"Transaction type"},from:{type:"object",properties:{chain:{type:"string",description:"Source blockchain"},token:{type:"string",description:"Source token symbol"},amount:{type:["number","null"],description:"Amount sent"},txHash:{type:"string",description:"Source chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},to:{type:"object",properties:{chain:{type:"string",description:"Destination blockchain"},token:{type:"string",description:"Destination token symbol"},amount:{type:["number","null"],description:"Amount received"},txHash:{type:["string","null"],description:"Destination chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},usd:{type:["number","null"],description:"USD value of the transaction"},bridgeTime:{type:["number","null"],description:"Bridge completion time in seconds"}},required:["transactionId","status","type","from","to","usd","bridgeTime"],additionalProperties:!1},description:"List of swap/bridge transactions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_register",description:"Register a broadcast transaction for tracking. Call after transaction_send to enable status tracking via transaction_retrieve.",inputSchema:{$ref:"#/definitions/transaction_register_input",definitions:{transaction_register_input:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID from swaps_transaction_build"},transactionHash:{type:"string",description:"Transaction hash/signature after broadcasting"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain where the transaction was broadcast"}},required:["transactionId","transactionHash","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_register_output",definitions:{transaction_register_output:{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_retrieve",description:"Get the status and details of a transaction by its ID.",inputSchema:{$ref:"#/definitions/transaction_retrieve_input",definitions:{transaction_retrieve_input:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID from swaps_transaction_build or transaction_register"}},required:["transactionId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_retrieve_output",definitions:{transaction_retrieve_output:{type:"object",properties:{transactionId:{type:"string",description:"Transaction tracking ID"},status:{type:"string",description:"Current status: pending, success, or failed"},type:{type:"string",enum:["swap","bridge"],description:"Transaction type"},from:{type:"object",properties:{chain:{type:"string",description:"Source blockchain"},token:{type:"string",description:"Source token symbol"},amount:{type:["number","null"],description:"Amount sent"},txHash:{type:"string",description:"Source chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},to:{type:"object",properties:{chain:{type:"string",description:"Destination blockchain"},token:{type:"string",description:"Destination token symbol"},amount:{type:["number","null"],description:"Amount received"},txHash:{type:["string","null"],description:"Destination chain transaction hash. Null while bridge is in progress."}},required:["chain","token","amount","txHash"],additionalProperties:!1},usd:{type:["number","null"],description:"USD value of the transaction"},bridgeTime:{type:["number","null"],description:"Bridge completion time in seconds. Null for same-chain swaps."}},required:["transactionId","status","type","from","to","usd","bridgeTime"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_send",description:"Broadcast a signed transaction to the network. Supports Solana, EVM chains, and Bitcoin.",inputSchema:{$ref:"#/definitions/transaction_send_input",definitions:{transaction_send_input:{type:"object",properties:{transaction:{type:"string",description:"Signed transaction: base64-encoded for Solana, hex-encoded (0x...) for EVM, raw hex for Bitcoin"},message:{type:"string",description:"Human-readable message describing the transaction"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to broadcast on"}},required:["transaction","message","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_send_output",definitions:{transaction_send_output:{type:"object",properties:{signature:{type:"string",description:"Transaction signature/hash. Absent if broadcast failed."},message:{type:"string",description:"Result message or error description"}},required:["message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"user_retrieve",description:"Get the currently authenticated user",inputSchema:{$ref:"#/definitions/user_retrieve_input",definitions:{user_retrieve_input:{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/user_retrieve_output",definitions:{user_retrieve_output:{type:"object",properties:{id:{type:"string",description:"User ID"},email:{type:["string","null"],description:"User email address"}},required:["id","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"verify",description:"Verify a login code for the user.",inputSchema:{$ref:"#/definitions/verify_input",definitions:{verify_input:{type:"object",properties:{code:{type:"string",pattern:"^\\d{6}$",description:"The code to verify"},email:{type:"string",format:"email",description:"The email the OTP was sent to"}},required:["code","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/verify_output",definitions:{verify_output:{type:"object",properties:{accessToken:{type:"string"},refreshToken:{type:"string"},expiresAt:{type:"number"}},required:["accessToken","refreshToken","expiresAt"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_agreement_accept",description:"Accept a required legal agreement. Pass the content ID from virtual-account_agreement_list to mark the agreement as accepted.",inputSchema:{$ref:"#/definitions/virtual-account_agreement_accept_input",definitions:{"virtual-account_agreement_accept_input":{type:"object",properties:{contentId:{type:"string",description:"Content ID from virtual-account_agreement_list"}},required:["contentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_agreement_accept_output",definitions:{"virtual-account_agreement_accept_output":{type:"object",properties:{id:{type:"string",description:"Signing record ID"},contentId:{type:["string","null"],description:"Content ID of the accepted agreement"},documentId:{type:["string","null"],description:"Document ID"}},required:["id","contentId","documentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_agreement_list",description:"List legal agreements. By default shows pending agreements that must be accepted to activate the account. Use status=accepted to see previously accepted agreements.",inputSchema:{$ref:"#/definitions/virtual-account_agreement_list_input",definitions:{"virtual-account_agreement_list_input":{type:"object",properties:{status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"null"}],description:"Filter: pending (need to accept, default) or accepted (already signed)"},country:{type:["string","null"],description:"Country code for terms (e.g. USA, GBR). Defaults to USA."}},required:["status","country"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_agreement_list_output",definitions:{"virtual-account_agreement_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Content ID \u2014 pass to virtual-account_agreement_accept to accept"},name:{type:"string",description:"Document name (e.g. 'USA Terms and Conditions')"},url:{type:"string",description:"URL to view the document"}},required:["id","name","url"],additionalProperties:!1},description:"List of agreements"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_create",description:"Create a virtual account and start KYC verification",inputSchema:{$ref:"#/definitions/virtual-account_create_input",definitions:{"virtual-account_create_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_create_output",definitions:{"virtual-account_create_output":{type:"object",properties:{id:{type:"string"},email:{type:"string"},customerType:{type:"string",enum:["Person","Business"]},status:{type:"string",enum:["UserRequired","SigningsRequired","IdentificationRequired","Active","Suspended"]},nextStep:{type:["string","null"]}},required:["id","email","customerType","status","nextStep"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_kyc_continue",description:"Get the current KYC verification status and URL. Use this to check progress or get the verification link again.",inputSchema:{$ref:"#/definitions/virtual-account_kyc_continue_input",definitions:{"virtual-account_kyc_continue_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_kyc_continue_output",definitions:{"virtual-account_kyc_continue_output":{type:"object",properties:{id:{type:"string",description:"Identification record ID"},status:{type:"string",enum:["Pending","Processed","PendingReview","Approved","Declined","Expired"],description:"KYC status: Pending, Processed, PendingReview, Approved, Declined, or Expired"},url:{type:["string","null"],description:"URL to complete KYC verification. Null if already submitted."}},required:["id","status","url"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_kyc_restart",description:"Restart KYC verification. Creates a fresh verification link. Only available when account status is IdentificationRequired.",inputSchema:{$ref:"#/definitions/virtual-account_kyc_restart_input",definitions:{"virtual-account_kyc_restart_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_kyc_restart_output",definitions:{"virtual-account_kyc_restart_output":{type:"object",properties:{id:{type:"string",description:"Identification record ID"},status:{type:"string",enum:["Pending","Processed","PendingReview","Approved","Declined","Expired"],description:"KYC status: Pending, Processed, PendingReview, Approved, Declined, or Expired"},url:{type:["string","null"],description:"URL to complete KYC verification. Null if already submitted."},message:{type:["string","null"],description:"Instructions for the user"}},required:["id","status","url","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_create",description:"Create a fiat-to-stablecoin onramp. Returns a deposit account (bank IBAN or account number) where the user sends fiat. Incoming fiat is automatically converted to stablecoin and sent to the registered wallet.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_create_input",definitions:{"virtual-account_onramp_create_input":{type:"object",properties:{name:{type:"string",description:"A label for this onramp (e.g. 'My USD onramp')"},fiat:{type:"string",enum:["USD","EUR"],description:"Fiat currency: usd or eur"},stablecoin:{type:"string",enum:["USDC","USDT","EURC"],description:"Target stablecoin: usdc, usdt, or eurc"},wallet:{type:"string",description:"Registered wallet address (must be registered via virtual-account_wallet_register first)"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"],description:"Blockchain to receive stablecoin on (Solana, Ethereum, Polygon, Arbitrum, Base)"}},required:["name","fiat","stablecoin","wallet","blockchain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_create_output",definitions:{"virtual-account_onramp_create_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_delete",description:"Cancel an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_delete_input",definitions:{"virtual-account_onramp_delete_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp to cancel"}},required:["onrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_delete_output",definitions:{"virtual-account_onramp_delete_output":{type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_list",description:"List all fiat-to-stablecoin onramps. Shows each onramp's deposit account details, status, and destination wallet.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_list_input",definitions:{"virtual-account_onramp_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_list_output",definitions:{"virtual-account_onramp_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1},description:"List of configured onramps"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_payment_create",description:"Create an open banking payment link for an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_create_input",definitions:{"virtual-account_onramp_payment_create_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp"},amount:{type:"string",description:"The amount to pay"},fiat:{type:"string",enum:["USD","EUR"],description:"The fiat currency (USD or EUR)"}},required:["onrampId","amount","fiat"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_create_output",definitions:{"virtual-account_onramp_payment_create_output":{type:"object",properties:{id:{type:"string"},paymentLink:{type:["string","null"]},status:{type:"string",enum:["Pending","Ready","Processing","Completed","Failed"]}},required:["id","paymentLink","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_payment_retrieve",description:"Get the status of an open banking payment",inputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_retrieve_input",definitions:{"virtual-account_onramp_payment_retrieve_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp this payment belongs to"},paymentId:{type:"string",format:"uuid",description:"The ID of the payment to retrieve"}},required:["onrampId","paymentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_retrieve_output",definitions:{"virtual-account_onramp_payment_retrieve_output":{type:"object",properties:{id:{type:"string"},paymentLink:{type:["string","null"]},status:{type:"string",enum:["Pending","Ready","Processing","Completed","Failed"]}},required:["id","paymentLink","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_retrieve",description:"Get onramp details and banking info",inputSchema:{$ref:"#/definitions/virtual-account_onramp_retrieve_input",definitions:{"virtual-account_onramp_retrieve_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp to retrieve"}},required:["onrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_retrieve_output",definitions:{"virtual-account_onramp_retrieve_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_retrieve",description:"Get your virtual account status",inputSchema:{$ref:"#/definitions/virtual-account_retrieve_input",definitions:{"virtual-account_retrieve_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_retrieve_output",definitions:{"virtual-account_retrieve_output":{type:"object",properties:{id:{type:"string"},email:{type:"string"},customerType:{type:"string",enum:["Person","Business"]},status:{type:"string",enum:["UserRequired","SigningsRequired","IdentificationRequired","Active","Suspended"]},nextStep:{type:["string","null"]}},required:["id","email","customerType","status","nextStep"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_transaction_list",description:"List fiat-to-stablecoin conversion transactions. Shows status, fiat amount sent, and stablecoin amount received for each conversion.",inputSchema:{$ref:"#/definitions/virtual-account_transaction_list_input",definitions:{"virtual-account_transaction_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_transaction_list_output",definitions:{"virtual-account_transaction_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Transaction ID"},state:{type:"string",enum:["Pending","PayoutPending","Payout","PayoutCompleted","Completed","Failed","InAmlReview","AmlRejected","AmountRejected"],description:"Transaction state (e.g. pending, completed, failed)"},sourceAmount:{type:"string",description:"Fiat amount sent (e.g. '100.00 USD')"},destinationAmount:{type:"string",description:"Stablecoin amount received (e.g. '99.50 USDC')"},createdAt:{type:"string",format:"date-time",description:"Transaction creation timestamp"}},required:["id","state","sourceAmount","destinationAmount","createdAt"],additionalProperties:!1},description:"List of onramp conversion transactions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_list",description:"List wallets registered for the virtual account. Only registered wallets can receive onramp payouts.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_list_input",definitions:{"virtual-account_wallet_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_list_output",definitions:{"virtual-account_wallet_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},address:{type:"string"},blockchain:{type:"string"}},required:["id","address","blockchain"],additionalProperties:!1},description:"List of registered wallets"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_register",description:"Register a wallet by submitting a signed proof-of-ownership message. The wallet can then be used as a destination for onramp payouts.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_register_input",definitions:{"virtual-account_wallet_register_input":{type:"object",properties:{wallet:{type:"string",description:"Wallet address to register"},message:{type:"string",description:"Verification message from virtual-account_wallet_registration-message_create"},signature:{type:"string",description:"Signature of the message, signed by the wallet's private key"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain for wallet registration (solana, ethereum, polygon, base, arbitrum)"}},required:["wallet","message","signature","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_register_output",definitions:{"virtual-account_wallet_register_output":{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_registration-message_create",description:"Generate a proof-of-ownership message for wallet registration. The message must be signed by the wallet's private key and submitted via virtual-account_wallet_register.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_registration-message_create_input",definitions:{"virtual-account_wallet_registration-message_create_input":{type:"object",properties:{wallet:{type:"string",description:"Wallet address to register"}},required:["wallet"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_registration-message_create_output",definitions:{"virtual-account_wallet_registration-message_create_output":{type:"object",properties:{message:{type:"string",description:"Message to sign with the wallet's private key"}},required:["message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}}];var kn="https://www.moonpay.com/legal/terms_of_use_europe_hypermint",Tn="https://www.moonpay.com/legal/privacy_policy",Pn="https://swaps.xyz/terms",de=` Terms of Use: ${kn}
|
|
3
|
-
Privacy Policy: ${Tn}
|
|
4
|
-
Swaps by: ${Pn}`;import*as Ze from"fs";import*as Qe from"os";import*as et from"path";var s=e=>e,c=(e,t)=>({schema:e,handler:async n=>{let r=e.input.parse(n),i=await t(r);return e.output.parse(i)}});import{z as Q}from"zod";var Xe=s({name:"consent_check",description:"Check whether the MoonPay Terms of Use have been accepted. Throws if not accepted.",input:Q.object({}),output:Q.object({accepted:Q.literal(!0),tosVersion:Q.string(),acceptedAt:Q.string()})});var jn=et.join(Qe.homedir(),".config","moonpay","consent.json"),tt=c(Xe,async()=>{let e=null;try{e=JSON.parse(Ze.readFileSync(jn,"utf-8"))}catch{}if(!e||e.tosVersion!=="1.2")throw new Error(`Terms of Service not yet accepted. Run \`mp consent accept\` first.
|
|
5
|
-
|
|
6
|
-
${de}`);return{accepted:!0,tosVersion:e.tosVersion,acceptedAt:e.acceptedAt}});import{generateMnemonic as xn}from"@scure/bip39";import{wordlist as Cn}from"@scure/bip39/wordlists/english";import{z as B}from"zod";var nt=s({name:"wallet_create",description:"Create a new multi-chain HD wallet. Generates a BIP39 mnemonic and derives addresses for Solana, Ethereum, Bitcoin, and Tron. The mnemonic is copied to clipboard (interactive) or omitted (headless). Keys are encrypted with a random key stored in the OS keychain.",input:B.object({name:B.string().describe("Wallet name")}),output:B.object({name:B.string(),addresses:B.record(m,B.string())})});var rt=c(nt,async e=>{let t=xn(Cn,256),n=se(t);return K({name:e.name,type:"hd",mnemonic:t,addresses:n,createdAt:new Date().toISOString()}),{name:e.name,addresses:D(n)}});import{createInterface as An}from"readline";import{validateMnemonic as ot}from"@scure/bip39";import{wordlist as at}from"@scure/bip39/wordlists/english";import{Keypair as In}from"@solana/web3.js";import $n from"bs58";import{privateKeyToAccount as Rn}from"viem/accounts";import{z as E}from"zod";var it=s({name:"wallet_import",description:"Import a wallet from a BIP39 mnemonic (HD, all chains) or a single private key (one chain). Provide either --mnemonic or --key, not both.",input:E.object({name:E.string().describe("Wallet name"),mnemonic:E.string().nullable().describe("BIP39 mnemonic seed phrase (for HD wallet import)"),key:E.string().nullable().describe("Private key: base58 for Solana, hex for EVM/Bitcoin"),chain:m.nullable().describe("Chain for single-key import (default solana)")}),output:E.object({name:E.string(),type:E.enum(["hd","imported"]),addresses:Fe})});function En(e){return new Promise((t,n)=>{if(!process.stdin.isTTY){n(new Error("Interactive import requires a terminal. Pass --mnemonic or --key instead."));return}let r=An({input:process.stdin,output:process.stderr});process.stderr.write(e),process.stdin.setRawMode(!0);let i="",o=a=>{let p=a.toString();p===`
|
|
7
|
-
`||p==="\r"?(process.stdin.setRawMode(!1),process.stdin.removeListener("data",o),process.stderr.write(`
|
|
8
|
-
`),r.close(),t(i.trim())):p===""?(process.stdin.setRawMode(!1),r.close(),process.exit(0)):p==="\x7F"||p==="\b"?i=i.slice(0,-1):i+=p};process.stdin.on("data",o)})}function qn(e){let t=e.split(/\s+/);return t.length>=12&&t.length<=24&&ot(e,at)?"mnemonic":"key"}var st=c(it,async e=>{if(e.mnemonic&&e.key)throw new Error("Provide either --mnemonic or --key, not both.");let t=e.mnemonic,n=e.key;if(!t&&!n){let p=await En("Paste your mnemonic or private key (hidden): ");if(!p)throw new Error("No input provided.");qn(p)==="mnemonic"?t=p:n=p}if(t){let p=t.trim().toLowerCase();if(!ot(p,at))throw new Error("Invalid BIP39 mnemonic.");let d=se(p);return K({name:e.name,type:"hd",mnemonic:p,addresses:d,createdAt:new Date().toISOString()}),{name:e.name,type:"hd",addresses:d}}let r=e.chain?y[e.chain]:"solana",i=n??"",o,a;if(r==="solana")try{let p=$n.decode(i);o=In.fromSecretKey(p).publicKey.toBase58(),a=i}catch{throw new Error("Invalid Solana private key. Expected base58-encoded secret key.")}else if(r==="ethereum"){if(a=i.startsWith("0x")?i.slice(2):i,!/^[0-9a-fA-F]{64}$/.test(a))throw new Error("Invalid EVM private key. Expected 64-character hex string.");o=Rn(`0x${a}`).address}else throw new Error(`Single-key import for ${r} is not yet supported. Use a mnemonic instead.`);return K({name:e.name,type:"imported",chain:r,privateKey:a,addresses:{[r]:o},createdAt:new Date().toISOString()}),{name:e.name,type:"imported",addresses:{[r]:o}}});import{z as ct}from"zod";var pt=s({name:"wallet_list",description:"List all local wallets",input:ct.object({}),output:ct.array(ce)});var lt=c(pt,async()=>pe().map(t=>({name:t.name,type:t.type,addresses:D(t.addresses),createdAt:t.createdAt})));import{z as dt}from"zod";var ut=s({name:"wallet_retrieve",description:"Get details of a specific wallet",input:dt.object({wallet:dt.string().describe("Wallet name or address")}),output:ce});var j=c(ut,async e=>{let t=b(e.wallet);return{name:t.name,type:t.type,addresses:D(t.addresses),createdAt:t.createdAt}});import{z as W}from"zod";var mt=s({name:"wallet_delete",description:"Permanently delete a local wallet. This removes the private key file and cannot be undone.",input:W.object({wallet:W.string().describe("Name or address of the wallet to delete"),confirm:W.boolean().describe("Must be true to confirm deletion")}),output:W.object({name:W.string().describe("Name of the deleted wallet"),deleted:W.literal(!0)})});var ht=c(mt,async e=>{if(!e.confirm)throw new Error("Back up your wallet before deleting! Run `mp wallet export "+e.wallet+"` to save your recovery phrase, then re-run with --confirm to permanently delete.");let t=b(e.wallet);return ze(t.name),{name:t.name,deleted:!0}});import{z as V}from"zod";var ft=s({name:"wallet_rename",description:"Rename a local wallet.",input:V.object({wallet:V.string().describe("Current name or address of the wallet"),name:V.string().describe("New name for the wallet")}),output:V.object({oldName:V.string(),newName:V.string()})});var yt=c(ft,async e=>{let n=b(e.wallet).name;if(n===e.name)return{oldName:n,newName:e.name};if(pe().some(i=>i.name===e.name))throw new Error(`Wallet "${e.name}" already exists`);return He(i=>{let o=i.find(a=>a.name===n);if(!o)throw new Error(`Wallet "${n}" not found`);o.name=e.name}),{oldName:n,newName:e.name}});import{z as me}from"zod";var gt=s({name:"wallet_export",description:"Export wallet secret (mnemonic or private key). Interactive only \u2014 cannot be run by agents or piped.",input:me.object({wallet:me.string().describe("Wallet name")}),output:me.object({exported:me.literal(!0)})});var bt=c(gt,async e=>{if(!process.stdout.isTTY)throw new Error(`Wallet export requires an interactive terminal.
|
|
9
|
-
Run this command directly in your terminal: mp wallet export `+e.wallet);let t=b(e.wallet);return t.type==="hd"?(process.stderr.write(`
|
|
10
|
-
Mnemonic for "${t.name}":
|
|
11
|
-
|
|
12
|
-
`),process.stderr.write(` ${t.mnemonic}
|
|
13
|
-
|
|
14
|
-
`),process.stderr.write(`Write this down and store it securely.
|
|
15
|
-
|
|
16
|
-
`)):(process.stderr.write(`
|
|
17
|
-
Private key for "${t.name}" (${t.chain}):
|
|
18
|
-
|
|
19
|
-
`),process.stderr.write(` ${t.privateKey}
|
|
20
|
-
|
|
21
|
-
`)),{exported:!0}});import{createHash as Un}from"crypto";import{Keypair as Dn,VersionedTransaction as On}from"@solana/web3.js";import{privateKeyToAccount as Nn}from"viem/accounts";import{parseTransaction as Ln}from"viem";import{createPublicClient as Bn,http as Wn}from"viem";import*as g from"viem/chains";import*as wt from"tiny-secp256k1";import{z as ee}from"zod";var _t=s({name:"transaction_sign",description:"Sign a transaction with a local wallet. Supports Solana (VersionedTransaction), EVM (RLP-encoded), and Bitcoin (PSBT) transactions.",input:ee.object({wallet:ee.string().describe("Wallet name or address"),chain:m.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),transaction:ee.string().describe("Base64-encoded unsigned transaction")}),output:ee.object({transaction:ee.string().describe("Base64-encoded signed transaction")})});var Vn={1:g.mainnet,137:g.polygon,42161:g.arbitrum,8453:g.base,10:g.optimism,56:g.bsc,43114:g.avalanche},Fn={137:"https://polygon-bor-rpc.publicnode.com",42161:"https://arbitrum-one-rpc.publicnode.com",10:"https://optimism-rpc.publicnode.com",8453:"https://base-rpc.publicnode.com",56:"https://bsc-rpc.publicnode.com",43114:"https://avalanche-c-chain-rpc.publicnode.com"},q=c(_t,async e=>{let t=b(e.wallet),n=e.chain,r=y[n],{privateKey:i}=O(t,n);switch(r){case"solana":return Hn(i,e.transaction.trim());case"ethereum":return zn(i,e.transaction.trim());case"tron":return Mn(i,e.transaction.trim());case"bitcoin":return Kn(i,e.transaction.trim())}});function Hn(e,t){let n=Buffer.from(t,"base64"),r=On.deserialize(n),i=Dn.fromSecretKey(e);return r.sign([i]),{transaction:Buffer.from(r.serialize()).toString("base64")}}async function zn(e,t){let n=Nn(`0x${Buffer.from(e).toString("hex")}`);if(t.startsWith("{")){let{to:a,data:p,value:d,chainId:u}=JSON.parse(t),h=Vn[u]??g.mainnet,f=Fn[u],C=Bn({chain:h,transport:Wn(f)}),M=await C.getTransactionCount({address:n.address}),oe=await C.estimateFeesPerGas(),ae=await C.estimateGas({account:n.address,to:a,data:p,value:BigInt(d??"0")});return{transaction:await n.signTransaction({to:a,data:p,value:BigInt(d??"0"),chainId:u,nonce:M,gas:ae,maxFeePerGas:oe.maxFeePerGas,maxPriorityFeePerGas:oe.maxPriorityFeePerGas,type:"eip1559"})}}let r=t.startsWith("0x")?t:`0x${Buffer.from(t,"base64").toString("hex")}`,i=Ln(r);return{transaction:await n.signTransaction(i)}}function Mn(e,t){let n=Buffer.from(t.startsWith("0x")?t.slice(2):t,"hex"),r=Un("sha256").update(n).digest(),i=wt.sign(r,e);if(!i)throw new Error("Tron transaction signing failed");return{transaction:Buffer.from(i).toString("hex")}}async function Kn(e,t){let n=await import("bitcoinjs-lib"),r=(await import("ecpair")).default,i=await import("tiny-secp256k1"),a=r(i).fromPrivateKey(Buffer.from(e)),p=n.Psbt.fromBase64(t);return p.signAllInputs(a),p.finalizeAllInputs(),{transaction:p.toBase64()}}import{createHash as vt}from"crypto";import{Keypair as Gn}from"@solana/web3.js";import Jn from"bs58";import Yn from"tweetnacl";import*as Ae from"tiny-secp256k1";import{keccak_256 as Xn}from"@noble/hashes/sha3";import{privateKeyToAccount as Zn}from"viem/accounts";import{z as te}from"zod";var St=s({name:"message_sign",description:"Sign a message with a local wallet. Supports Solana (ed25519), EVM (EIP-191 personal sign), and Bitcoin (secp256k1 ECDSA).",input:te.object({wallet:te.string().describe("Wallet address or name to sign with"),chain:m.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),message:te.string().describe("Message text to sign")}),output:te.object({signature:te.string().describe("Signature: base58 for Solana, hex (0x-prefixed) for EVM/Bitcoin")})});var he=c(St,async e=>{let t=b(e.wallet),n=e.chain,r=y[n],{privateKey:i}=O(t,n),o=Buffer.from(e.message,"utf8");switch(r){case"solana":return Qn(i,o);case"ethereum":return er(i,e.message);case"tron":return tr(i,e.message);case"bitcoin":return nr(i,o)}});function Qn(e,t){let n=Gn.fromSecretKey(e),r=Yn.sign.detached(t,n.secretKey);return{signature:Jn.encode(r)}}async function er(e,t){return{signature:await Zn(`0x${Buffer.from(e).toString("hex")}`).signMessage({message:t})}}function tr(e,t){let n=Buffer.from(t,"utf8"),r=Buffer.from(`TRON Signed Message:
|
|
22
|
-
${n.length}`,"utf8"),i=Xn(Buffer.concat([r,n])),o=Ae.sign(i,e);if(!o)throw new Error("Tron message signing failed");return{signature:"0x"+Buffer.from(o).toString("hex")}}function nr(e,t){let n=vt("sha256").update(t).digest(),r=vt("sha256").update(n).digest(),i=Ae.sign(r,e);if(!i)throw new Error("Bitcoin message signing failed");return{signature:"0x"+Buffer.from(i).toString("hex")}}import rr from"https";import{z as S}from"zod";var kt=s({name:"bitcoin_balance_retrieve",description:"Get the BTC balance of a Bitcoin address. Returns confirmed and unconfirmed balances in BTC and satoshis.",input:S.object({wallet:S.string().describe("Bitcoin address (bc1...) or wallet name")}),output:S.object({address:S.string().describe("Bitcoin address"),confirmed:S.object({btc:S.string().describe("Confirmed balance in BTC"),sats:S.number().describe("Confirmed balance in satoshis")}),unconfirmed:S.object({btc:S.string().describe("Unconfirmed (pending) balance in BTC"),sats:S.number().describe("Unconfirmed (pending) balance in satoshis")}),total:S.object({btc:S.string().describe("Total balance in BTC"),sats:S.number().describe("Total balance in satoshis")})})});var ir=1e8;function Ie(e){return(e/ir).toFixed(8)}function or(e){return new Promise((t,n)=>{rr.get(e,{headers:{"User-Agent":"moonpay-cli"}},r=>{if(r.statusCode!==200){n(new Error(`HTTP ${r.statusCode} from ${e}`)),r.resume();return}let i="";r.on("data",o=>i+=o),r.on("end",()=>{try{t(JSON.parse(i))}catch{n(new Error("Invalid JSON response"))}})}).on("error",n)})}var Tt=c(kt,async e=>{let t=e.wallet;if(!t.startsWith("bc1")&&!t.startsWith("1")&&!t.startsWith("3")){let{findWalletOrThrow:a}=await import("./store-XV77WYWO.js"),d=a(t).addresses.bitcoin;if(!d)throw new Error(`Wallet "${t}" has no Bitcoin address. It may be an imported single-chain wallet.`);t=d}let n=await or(`https://mempool.space/api/address/${encodeURIComponent(t)}`),r=n.chain_stats.funded_txo_sum-n.chain_stats.spent_txo_sum,i=n.mempool_stats.funded_txo_sum-n.mempool_stats.spent_txo_sum,o=r+i;return{address:t,confirmed:{btc:Ie(r),sats:r},unconfirmed:{btc:Ie(i),sats:i},total:{btc:Ie(o),sats:o}}});import{readdirSync as ar,readFileSync as Pt,existsSync as $e,mkdirSync as sr,cpSync as cr}from"fs";import{join as F,dirname as pr}from"path";import{homedir as lr}from"os";import{fileURLToPath as dr}from"url";function Re(){let e=dr(import.meta.url),t=pr(e);return F(t,"..","skills")}function ur(){return F(lr(),".claude","skills")}function Ee(){let e=Re();return $e(e)?ar(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&t.name.startsWith("moonpay-")).map(t=>{let r=Pt(F(e,t.name,"SKILL.md"),"utf-8").match(/^description:\s*(.+)$/m);return{name:t.name,description:r?.[1]?.replace(/^["']|["']$/g,"")??""}}).sort((t,n)=>t.name.localeCompare(n.name)):[]}function jt(e){if(/[/\\]|\.\./.test(e))throw new Error(`Invalid skill name: "${e}"`);let t=F(Re(),e,"SKILL.md");if(!$e(t))throw new Error(`Skill "${e}" not found. Run \`mp skill list\` to see available skills.`);return Pt(t,"utf-8")}function xt(e,t){let n=Re(),r=t??ur(),i=Ee();return sr(r,{recursive:!0}),i.map(o=>{let a=F(r,o.name);return $e(a)&&!e?{name:o.name,installed:!1}:(cr(F(n,o.name),a,{recursive:!0,force:!0}),{name:o.name,installed:!0})})}import{z as ne}from"zod";var Ct=s({name:"skill_list",description:"List available AI skills for Claude Code and other agents",input:ne.object({}),output:ne.array(ne.object({name:ne.string(),description:ne.string()}))});var At=c(Ct,async()=>Ee());import{z as re}from"zod";var It=s({name:"skill_retrieve",description:"Get the full instructions for a specific skill",input:re.object({name:re.string().describe("Skill name (e.g. moonpay-swap-tokens)")}),output:re.object({name:re.string(),content:re.string()})});var $t=c(It,async e=>({name:e.name,content:jt(e.name)}));import{z as U}from"zod";var Rt=s({name:"skill_install",description:"Install AI skills for Claude Code. Defaults to ~/.claude/skills/, or specify --dir for a custom location (e.g. project-local, ~/.agents/skills).",input:U.object({force:U.boolean().describe("Overwrite existing skills"),dir:U.string().nullable().describe("Target directory to install skills into (default: ~/.claude/skills/)")}),output:U.array(U.object({name:U.string(),installed:U.boolean()}))});var Et=c(Rt,async e=>xt(e.force,e.dir??void 0));import{encodeFunctionData as mr}from"viem";import{z as v}from"zod";var qt=s({name:"token_bridge",description:"Bridge tokens across chains. Builds, signs locally, broadcasts, and registers.",input:v.object({from:v.object({wallet:v.string().describe("Local wallet name to sign with"),chain:m.describe("Source chain"),token:v.string().describe("Source token address"),amount:v.coerce.number().nullable().describe("Amount to send (exact-in). Null for exact-out.")}),to:v.object({wallet:v.string().nullable().describe("Destination wallet name or address (defaults to from wallet)"),chain:m.describe("Destination chain"),token:v.string().describe("Destination token address"),amount:v.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:v.object({signature:v.string().describe("Transaction hash/signature"),message:v.string().describe("Human-readable bridge description")})});var hr=[{name:"approve",type:"function",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],fe=c(qt,async e=>{if(!e.from.amount&&!e.to.amount)throw new Error("Provide either from.amount or to.amount.");let t=k(),n=await j.handler({wallet:e.from.wallet}),r=n.addresses[y[e.from.chain]];if(!r)throw new Error(`Wallet "${n.name}" has no address on ${e.from.chain}.`);let i=r;if(e.to.wallet)try{i=(await j.handler({wallet:e.to.wallet})).addresses[y[e.to.chain]]??e.to.wallet}catch{i=e.to.wallet}else e.from.chain!==e.to.chain&&(i=n.addresses[y[e.to.chain]]??r);let o={from:{wallet:r,chain:e.from.chain,token:e.from.token,amount:e.from.amount},to:{wallet:i,chain:e.to.chain,token:e.to.token,amount:e.to.amount}},a=await w(t,"swaps_transaction_build",o),p=a.transaction;if(a.requiresApproval&&"to"in p){let{to:f,chainId:C}=p,M={type:"evm",to:e.from.token,data:mr({abi:hr,functionName:"approve",args:[f,BigInt(a.amountIn.raw)]}),value:"0",chainId:C},{transaction:oe}=await q.handler({wallet:n.name,chain:e.from.chain,transaction:JSON.stringify(M)}),ae=await w(t,"transaction_send",{transaction:oe,message:`Approve ${a.amountIn.symbol}`,chain:e.from.chain});if(!ae.signature)throw new Error(`Approval failed: ${ae.message}`);process.stderr.write(`Approval sent. Waiting for confirmation...
|
|
23
|
-
`),await new Promise(Oe=>setTimeout(Oe,5e3)),a=await w(t,"swaps_transaction_build",o)}let d="base64"in a.transaction?a.transaction.base64:JSON.stringify(a.transaction),{transaction:u}=await q.handler({wallet:n.name,chain:e.from.chain,transaction:d}),h=await w(t,"transaction_send",{transaction:u,message:a.message,chain:e.from.chain});if(!h.signature)throw new Error(`Transaction send failed: ${h.message}`);try{await w(t,"transaction_register",{transactionId:a.transactionId,transactionHash:h.signature,chain:e.from.chain})}catch{}return{signature:h.signature,message:a.message}});import{z as T}from"zod";var Ut=s({name:"token_swap",description:"Swap tokens on the same chain. Builds, signs locally, broadcasts, and registers.",input:T.object({wallet:T.string().describe("Local wallet name to sign with"),chain:m.describe("Chain to swap on"),from:T.object({token:T.string().describe("Input token address (selling)"),amount:T.coerce.number().nullable().describe("Amount to sell (exact-in). Null for exact-out.")}),to:T.object({token:T.string().describe("Output token address (buying)"),amount:T.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:T.object({signature:T.string().describe("Transaction hash/signature"),message:T.string().describe("Human-readable swap description")})});var Dt=c(Ut,async e=>fe.handler({from:{wallet:e.wallet,chain:e.chain,token:e.from.token,amount:e.from.amount},to:{wallet:null,chain:e.chain,token:e.to.token,amount:e.to.amount}}));import{z as $}from"zod";var Ot=s({name:"token_transfer",description:"Transfer tokens to another wallet on the same chain. Builds, signs locally, and broadcasts.",input:$.object({wallet:$.string().describe("Local wallet name to sign with"),chain:m.describe("Chain to transfer on"),token:$.string().describe("Token address to transfer"),amount:$.coerce.number().describe("Amount to transfer"),to:$.string().describe("Recipient wallet name or address")}),output:$.object({signature:$.string().describe("Transaction hash/signature"),message:$.string().describe("Human-readable transfer description")})});var Nt=c(Ot,async e=>{let t=k(),n=await j.handler({wallet:e.wallet}),r=n.addresses[y[e.chain]];if(!r)throw new Error(`Wallet "${n.name}" has no address on ${e.chain}.`);let i=e.to;try{i=(await j.handler({wallet:e.to})).addresses[y[e.chain]]??e.to}catch{}let o=await w(t,"token_transfer",{wallet:r,token:e.token,to:i,amount:e.amount,chain:e.chain}),a="base64"in o.transaction?o.transaction.base64:JSON.stringify(o.transaction),{transaction:p}=await q.handler({wallet:n.name,chain:e.chain,transaction:a}),d=await w(t,"transaction_send",{transaction:p,message:o.message,chain:e.chain});if(!d.signature)throw new Error(`Transaction send failed: ${d.message}`);return{signature:d.signature,message:o.message}});import{Keypair as fr,VersionedTransaction as yr,VersionedMessage as gr}from"@solana/web3.js";import Bt from"axios";import{wrapAxiosWithPayment as Wt}from"@x402/axios";import{x402Client as Vt}from"@x402/core/client";import{ExactSvmScheme as br}from"@x402/svm";import{registerExactEvmScheme as _r}from"@x402/evm/exact/client";import{toClientEvmSigner as wr}from"@x402/evm";import{privateKeyToAccount as Sr}from"viem/accounts";import{createPublicClient as vr,http as kr}from"viem";import*as P from"viem/chains";import{z as _}from"zod";var Lt=s({name:"x402_request",description:"Make an HTTP request to an x402-protected endpoint. Automatically handles payment when a 402 Payment Required response is received, signing the payment transaction with the local wallet.",input:_.object({method:_.enum(["GET","POST","PUT","PATCH","DELETE"]).describe("HTTP method"),url:_.string().url().refine(e=>e.startsWith("https://"),{message:"URL must use HTTPS"}).refine(e=>{try{return!new URL(e).hostname.match(/^(localhost|127\.|10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|169\.254\.|0\.0\.0\.0|\[::1\])/)}catch{return!1}},{message:"URL must not target private/internal addresses"}).describe("Full HTTPS URL of the x402-protected endpoint (e.g., 'https://agents.moonpay.com/x402/upgrade')"),body:_.record(_.any()).nullable().describe("Request body (for POST, PUT, PATCH)"),params:_.record(_.any()).nullable().describe("Query parameters"),wallet:_.string().describe("Wallet name or address to pay with"),chain:_.enum(["solana","base","ethereum","arbitrum","polygon","optimism"]).nullable().describe("Chain to pay from (default: solana). Use an EVM chain like 'base' to pay with an EVM wallet.")}),output:_.object({status:_.number().describe("HTTP status code"),data:_.any().describe("Response data"),headers:_.record(_.any()).describe("Response headers")})});var Tr="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",Pr={ethereum:P.mainnet,base:P.base,polygon:P.polygon,arbitrum:P.arbitrum,optimism:P.optimism};function jr(e,t){let n=fr.fromSecretKey(t),r={address:e,signTransactions:async a=>a.map(p=>{let d=new Uint8Array(p.messageBytes),u=gr.deserialize(d),h=Object.keys(p.signatures).length,f=new yr(u,new Array(h).fill(new Uint8Array(64)));f.sign([n]);let C=u.staticAccountKeys.findIndex(M=>M.toBase58()===e);if(C===-1)throw new Error(`Wallet ${e} is not a signer for this transaction`);return{[e]:f.signatures[C]}})},i=new Vt,o=new br(r);return i.register(Tr,o),i.registerV1("solana",o),Wt(Bt.create(),i)}function xr(e,t){let n=Sr(`0x${Buffer.from(e).toString("hex")}`),r=Pr[t]??P.base,i=vr({chain:r,transport:kr()}),o=wr(n,i),a=new Vt;return _r(a,{signer:o}),Wt(Bt.create(),a)}var ye=c(Lt,async({method:e,url:t,body:n,params:r,wallet:i,chain:o})=>{let a=b(i),p=o??"solana",{privateKey:d,address:u}=O(a,p),h=p==="solana"?jr(u,d):xr(d,p),f;switch(e){case"GET":f=await h.get(t,{params:r});break;case"POST":f=await h.post(t,n||{},{params:r});break;case"PUT":f=await h.put(t,n||{},{params:r});break;case"PATCH":f=await h.patch(t,n||{},{params:r});break;case"DELETE":f=await h.delete(t,{params:r});break;default:throw new Error(`Unsupported HTTP method: ${e}`)}return{status:f.status,data:f.data,headers:f.headers}});import{z as H}from"zod";var Ft=s({name:"virtual-account_wallet_register",description:"Register a local wallet with your virtual account. Creates the verification message, signs it locally, and registers in one step.",input:H.object({wallet:H.string().describe("Local wallet name"),chain:m.describe("Chain to register (solana, ethereum, etc.)")}),output:H.object({success:H.literal(!0),address:H.string().describe("Registered wallet address"),chain:H.string().describe("Chain registered on")})});var Ht=c(Ft,async e=>{let t=k(),n=e.chain,r=await j.handler({wallet:e.wallet}),i=y[n],o=r.addresses[i];if(!o)throw new Error(`Wallet "${r.name}" has no ${i} address.`);let{message:a}=await Ce(t,"virtual-account_wallet_registration-message_create",{wallet:o}),{signature:p}=await he.handler({wallet:r.name,chain:n,message:a});return await w(t,"virtual-account_wallet_register",{wallet:o,message:a,signature:p,chain:n}),{success:!0,address:o,chain:n}});import*as x from"fs";import*as Jt from"os";import*as De from"path";import*as Yt from"crypto";import{createRequire as Cr}from"module";import{z as ge}from"zod";var zt=s({name:"consent_accept",description:"Accept the MoonPay Terms of Use. Required before using any CLI command.",input:ge.object({}),output:ge.object({tosVersion:ge.string(),acceptedAt:ge.string()})});import*as be from"os";var Mt=3e3;function Kt(e){let t=k(),n=JSON.stringify({agentId:e.agentId,tosVersion:e.tosVersion,cliVersion:e.cliVersion,nodeVersion:process.version,os:be.platform(),arch:be.arch()});fetch(`${t}/api/tools/cli_activation_create`,{method:"POST",headers:{"Content-Type":"application/json",[I]:A},body:n,signal:AbortSignal.timeout(Mt)}).catch(()=>{})}async function Gt(e){let t=k(),n=await L();n&&fetch(`${t}/api/tools/cli_activation_update`,{method:"POST",headers:{"Content-Type":"application/json",[I]:A,Authorization:`Bearer ${n}`},body:JSON.stringify({agentId:e}),signal:AbortSignal.timeout(Mt)}).catch(()=>{})}var Ar=Cr(import.meta.url),{version:Ir}=Ar("../../../../package.json"),qe=De.join(Jt.homedir(),".config","moonpay"),Ue=De.join(qe,"consent.json");function $r(){try{return JSON.parse(x.readFileSync(Ue,"utf-8"))}catch{return null}}var Xt=c(zt,async()=>{x.existsSync(qe)||x.mkdirSync(qe,{recursive:!0,mode:448});let t=$r()?.agentId??Yt.randomUUID(),n=new Date().toISOString(),r={tosVersion:"1.2",acceptedAt:n,agentId:t},i=Ue+`.tmp.${process.pid}`;return x.writeFileSync(i,JSON.stringify(r,null,2),{encoding:"utf-8",mode:384}),x.renameSync(i,Ue),process.stderr.write(`
|
|
24
|
-
By using this CLI, you agree to:
|
|
25
|
-
${de}
|
|
26
|
-
|
|
27
|
-
`),Kt({agentId:t,tosVersion:"1.2",cliVersion:Ir}),{tosVersion:r.tosVersion,acceptedAt:r.acceptedAt}});import{z as ie}from"zod";var Zt=s({name:"login",description:"Send a login verification code to your email.",input:ie.object({email:ie.string().describe("Email address")}),output:ie.object({email:ie.string(),message:ie.string()})});var Qt=c(Zt,async e=>{let{baseUrl:t}=le(),n=`${t}/login?email=${encodeURIComponent(e.email)}`;return{email:e.email,message:`Open this link to verify:
|
|
28
|
-
|
|
29
|
-
${n}
|
|
30
|
-
|
|
31
|
-
Then run: mp verify --email ${e.email} --code <code>`}});import*as tn from"fs";import*as nn from"os";import*as rn from"path";import{z}from"zod";var en=s({name:"verify",description:"Verify login code and store encrypted credentials.",input:z.object({email:z.string().describe("Email address"),code:z.string().describe("Verification code")}),output:z.object({email:z.string(),message:z.string()})});var Rr=rn.join(nn.homedir(),".config","moonpay","consent.json");function Er(){try{return JSON.parse(tn.readFileSync(Rr,"utf-8")).agentId??null}catch{return null}}var on=c(en,async e=>{let{baseUrl:t}=le(),n=await je(t,"verify",{email:e.email,code:e.code}),r={accessToken:n.accessToken,refreshToken:n.refreshToken,expiresAt:n.expiresAt*1e3,baseUrl:t};Pe(r);let i=Er();return i&&Gt(i).catch(()=>{}),{email:e.email,message:"Logged in successfully."}});import{z as _e}from"zod";var an=s({name:"logout",description:"Log out and clear stored credentials.",input:_e.object({}),output:_e.object({success:_e.literal(!0),message:_e.string()})});var sn=c(an,async()=>(Ye(),{success:!0,message:"Logged out."}));import{createRequire as qr}from"module";import{z as we}from"zod";var cn=s({name:"qr_generate",description:"Display a QR code in the terminal. Pass any text \u2014 wallet address, URL, token address, etc.",input:we.object({value:we.string().describe("Text to encode as a QR code")}),output:we.object({value:we.string()})});var Ur=qr(import.meta.url),Dr=Ur("qrcode-terminal"),pn=c(cn,async e=>(Dr.generate(e.value,{small:!0},t=>{process.stderr.write(`
|
|
32
|
-
${t}
|
|
33
|
-
`)}),{value:e.value}));import{z as R}from"zod";var ln=s({name:"upgrade",description:"Purchase a rate limit upgrade via x402. Increases your API rate limit. Requires login and a funded wallet.",input:R.object({duration:R.enum(["day","month"]).describe("Upgrade duration: day ($1 USDC, 24h) or month ($20 USDC, 30 days)"),wallet:R.string().describe("Wallet name or address to pay with"),chain:R.enum(["solana","base"]).describe("Chain to pay from. x402 payments accepted on Solana and Base.")}),output:R.object({duration:R.string(),expiresAt:R.string().describe("When the upgrade expires"),message:R.string()})});var dn=c(ln,async e=>{if(!await L())throw new Error("Login required to upgrade. Run `mp login` first.");let n=k(),r=await w(n,"user_retrieve",{}),i=await ye.handler({method:"POST",url:`${n}/x402/upgrade`,body:{userId:r.id,duration:e.duration},params:null,wallet:e.wallet,chain:e.chain});if(i.status>=400){let o=i.data?.error??"Upgrade failed";throw new Error(o)}return i.data});var np=[rt,st,lt,j,ht,yt,bt,q,he,Tt,At,$t,Et,Dt,fe,Nt,ye,Ht,Xt,tt,Qt,on,sn,pn,dn];export{k as a,Ce as b,Yr as c,de as d,tt as e,np as f};
|
package/dist/mcp-C2P2VCTT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
import{a as u,b as f,c as d,f as l}from"./chunk-K4KO6VY7.js";import"./chunk-WLQU5BOQ.js";import{Server as R}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as x}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as T,ListToolsRequestSchema as v}from"@modelcontextprotocol/sdk/types.js";import{zodToJsonSchema as N}from"zod-to-json-schema";var y=new Map(l.map(s=>[s.schema.name,s]));function q(s){let n=s.inputSchema;if(n.$ref&&n.definitions){let p=n.$ref.replace("#/definitions/","");return n.definitions[p]??n}return n}async function C(){let s=new R({name:"moonpay",version:"1.0.0"},{capabilities:{tools:{listChanged:!0}}}),n=l.map(e=>({name:e.schema.name,description:e.schema.description,inputSchema:N(e.schema.input)})),p=new Map;for(let e of d){if(y.has(e.name))continue;let t=q(e);p.set(e.name,t.properties??{}),n.push({name:e.name,description:e.description,inputSchema:{type:"object",properties:t.properties??{},...t.required?{required:t.required}:{},...t.additionalProperties!==void 0?{additionalProperties:t.additionalProperties}:{}}})}let h=new Map(n.map(e=>[e.name,e]));s.setRequestHandler(v,async()=>({tools:n.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema}))})),s.setRequestHandler(T,async e=>{let{name:t,arguments:o={}}=e.params;if(!h.has(t))return{content:[{type:"text",text:`Unknown tool: ${t}`}],isError:!0};try{let i=y.get(t);if(i){let c=i.schema.input.shape??{};for(let[m,a]of Object.entries(c))o[m]===void 0&&a._def.typeName==="ZodNullable"&&(o[m]=null);let r=await i.handler(o);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}let S=p.get(t)??{};for(let[c,r]of Object.entries(S))o[c]===void 0&&(Array.isArray(r.type)?r.type.includes("null"):r.anyOf?.some(O=>O.type==="null"))&&(o[c]=null),(r.type==="number"||r.type==="integer"||Array.isArray(r.type)&&r.type.some(a=>a==="number"||a==="integer")||r.anyOf?.some(a=>a.type==="number"||a.type==="integer"))&&typeof o[c]=="string"&&(o[c]=Number(o[c]));let b=u(),w=await f(b,t,o);return{content:[{type:"text",text:JSON.stringify(w,null,2)}]}}catch(i){return{content:[{type:"text",text:i instanceof Error?i.message:String(i)}],isError:!0}}});let g=new x;await s.connect(g)}export{C as startMcpServer};
|