@moonpay/cli 0.9.2 → 0.9.3

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.
@@ -0,0 +1,30 @@
1
+ process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
2
+ import{a as Se,b as E,c as we,d as ie,e as Pe,f as je,g as Ce,h as f,i as Te,j as Ie,k as O,l as re,m as g,n as u,o as De,p as B,q as ne,r as oe,t as Ae,v as k,w as K,x as Ue,y as N}from"./chunk-2KI3H3A7.js";async function Zt(e,t,i){let r=await O(),n=E();r&&(n.Authorization=`Bearer ${r}`);let o=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:n,body:JSON.stringify(i)});if(o.status===401&&r){let l=Pe();if(l?.refreshToken)try{let h=await Ie(l);o=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:{...E(),Authorization:`Bearer ${h.accessToken}`},body:JSON.stringify(i)})}catch{}}if(o.status===401)throw new Error("This command requires a MoonPay CLI account. Run `moonpay login` first.");let s=await o.text();if(!s){if(o.status===429){let l=r?" Run `mp upgrade` to increase your rate limit.":" Log in with `mp login` for higher limits.";throw new Error(`Rate limit exceeded.${l}`)}throw new Error(`Empty response from server (${o.status})`)}let a;try{a=JSON.parse(s)}catch{throw new Error(`Unexpected response from server (${o.status})`)}if(o.status<200||o.status>=300){let l=a;throw new Error(l?.error??`Tool call failed (${o.status})`)}return a}async function d(e,t,i){return await Zt(e,t,i)}var _r=[{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:2e3,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:"prediction-market_activity_list",description:"List all activity for a wallet on prediction markets. Includes trades, splits, merges, redemptions, and rewards.",inputSchema:{$ref:"#/definitions/prediction-market_activity_list_input",definitions:{"prediction-market_activity_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address"},limit:{type:["number","null"],description:"Max results (default 100)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"}},required:["provider","wallet","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_activity_list_output",definitions:{"prediction-market_activity_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{type:{type:"string",description:"Activity type (TRADE, SPLIT, MERGE, REDEEM, etc.)"},asset:{type:["string","null"],description:"Token ID (CLOB token or mint address)"},conditionId:{type:["string","null"],description:"Condition ID"},size:{type:["number","null"],description:"Amount"},price:{type:["number","null"],description:"Price"},fee:{type:["number","null"],default:null,description:"Fee amount"},timestamp:{type:"number",description:"Activity timestamp (unix)"},title:{type:["string","null"],description:"Event title"},slug:{type:["string","null"],description:"Event slug"},outcome:{type:["string","null"],description:"Outcome name"},transactionHash:{type:["string","null"],description:"Transaction hash"}},required:["type","asset","conditionId","size","price","timestamp","title","slug","outcome","transactionHash"],additionalProperties:!1},description:"Activity history"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_event_retrieve",description:"Get detailed information about a prediction market event including all associated markets, outcomes, and prices.",inputSchema:{$ref:"#/definitions/prediction-market_market_event_retrieve_input",definitions:{"prediction-market_market_event_retrieve_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},slug:{type:"string",description:"Event slug identifier"}},required:["provider","slug"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_event_retrieve_output",definitions:{"prediction-market_market_event_retrieve_output":{type:"object",properties:{id:{type:"string",description:"Event ID"},ticker:{type:"string",description:"Event ticker"},slug:{type:"string",description:"URL slug"},title:{type:"string",description:"Event title"},description:{type:["string","null"],description:"Event description"},subtitle:{type:["string","null"],default:null,description:"Event subtitle"},image:{type:["string","null"],default:null,description:"Event image URL"},icon:{type:["string","null"],default:null,description:"Event icon URL"},category:{type:["string","null"],default:null,description:"Primary category"},subcategory:{type:["string","null"],default:null,description:"Subcategory"},volume:{type:"number",default:0,description:"Total volume in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},openInterest:{type:["number","null"],description:"Open interest in USDC"},liquidity:{type:["number","null"],description:"Available liquidity"},startDate:{type:["string","null"],default:null,description:"Event start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Event end date (ISO)"},closedTime:{type:["string","null"],default:null,description:"Time event was closed (ISO)"},active:{type:"boolean",description:"Whether event is active"},closed:{type:"boolean",description:"Whether event has closed"},featured:{type:["boolean","null"],default:null,description:"Whether event is featured"},commentCount:{type:["number","null"],default:null,description:"Number of comments"},negRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},markets:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Market ID"},question:{type:"string",description:"Market question"},description:{type:["string","null"],default:null,description:"Market description"},conditionId:{type:["string","null"],default:null,description:"Condition ID for on-chain settlement"},slug:{type:"string",description:"URL slug"},image:{type:["string","null"],default:null,description:"Market image URL"},outcomes:{type:"array",items:{type:"string"},description:"Possible outcomes (e.g. ['Yes', 'No'])"},outcomePrices:{type:"array",items:{type:"number"},description:"Current price per outcome (0-1)"},outcomeTokens:{type:"array",items:{type:"object",properties:{outcome:{type:"string",description:"Outcome name (e.g. 'Yes', 'No')"},tokenId:{type:"string",description:"Token identifier \u2014 CLOB token ID (Polymarket/EVM) or mint address (Kalshi/Solana)"},price:{type:["number","null"],default:null,description:"Current price for this outcome (0-1)"}},required:["outcome","tokenId"],additionalProperties:!1},default:[],description:"Token IDs for each outcome \u2014 use these to trade"},volume:{type:"number",default:0,description:"Total volume traded in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},lastTradePrice:{type:["number","null"],default:null,description:"Last trade price"},bestBid:{type:["number","null"],default:null,description:"Best bid price"},bestAsk:{type:["number","null"],default:null,description:"Best ask price"},spread:{type:["number","null"],default:null,description:"Bid-ask spread"},oneDayPriceChange:{type:["number","null"],default:null,description:"24-hour price change"},oneHourPriceChange:{type:["number","null"],default:null,description:"1-hour price change"},oneWeekPriceChange:{type:["number","null"],default:null,description:"1-week price change"},startDate:{type:["string","null"],default:null,description:"Market start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Market end date (ISO)"},negRisk:{type:["boolean","null"],default:null,description:"Whether this uses negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},acceptingOrders:{type:"boolean",description:"Whether market is accepting orders"},enableOrderBook:{type:["boolean","null"],default:null,description:"Whether order book is enabled"},orderMinSize:{type:["number","null"],default:null,description:"Minimum order size"},liquidity:{type:["number","null"],default:null,description:"Available liquidity in USDC"},tickSize:{type:["string","null"],default:null,description:"Minimum price increment"}},required:["id","question","slug","outcomes","outcomePrices","acceptingOrders"],additionalProperties:!1},description:"Markets within this event"},tags:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"Category tags"}},required:["id","ticker","slug","title","description","openInterest","liquidity","active","closed","markets","tags"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_price_history_list",description:"Get historical price data for a prediction market outcome. Use to analyze price trends over time.",inputSchema:{$ref:"#/definitions/prediction-market_market_price_history_list_input",definitions:{"prediction-market_market_price_history_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},tokenId:{type:"string",description:"Outcome token ID (from outcomeTokens[].tokenId)"},interval:{type:"string",enum:["1hr","1d","1w","1m","max"],description:"Time interval: 1hr, 1d (day), 1w (week), 1m (month), or max (all time)"}},required:["provider","tokenId","interval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_price_history_list_output",definitions:{"prediction-market_market_price_history_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{timestamp:{type:"number",description:"Unix timestamp"},price:{type:"number",description:"Price at this time (0-1)"}},required:["timestamp","price"],additionalProperties:!1},description:"Price history data points"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_price_retrieve",description:"Get the current price for a prediction market outcome token.",inputSchema:{$ref:"#/definitions/prediction-market_market_price_retrieve_input",definitions:{"prediction-market_market_price_retrieve_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},tokenId:{type:"string",description:"Outcome token ID (from outcomeTokens[].tokenId)"}},required:["provider","tokenId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_price_retrieve_output",definitions:{"prediction-market_market_price_retrieve_output":{type:"object",properties:{price:{type:["number","null"],description:"Current price (0-1), null if no orders"}},required:["price"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_search",description:"Search prediction markets by query string or tags. Returns events with their markets, prices, and volumes.",inputSchema:{$ref:"#/definitions/prediction-market_market_search_input",definitions:{"prediction-market_market_search_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},query:{type:"string",description:"Search query (use '*' for all markets)"},tagIds:{type:["string","null"],description:"Comma-separated tag IDs to filter by"},limit:{type:["number","null"],description:"Max results (default 10)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"},activeOnly:{type:["boolean","null"],description:"Only show active markets (default true)"}},required:["provider","query","tagIds","limit","page","activeOnly"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_search_output",definitions:{"prediction-market_market_search_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Event ID"},ticker:{type:"string",description:"Event ticker"},slug:{type:"string",description:"URL slug"},title:{type:"string",description:"Event title"},description:{type:["string","null"],description:"Event description"},subtitle:{type:["string","null"],default:null,description:"Event subtitle"},image:{type:["string","null"],default:null,description:"Event image URL"},icon:{type:["string","null"],default:null,description:"Event icon URL"},category:{type:["string","null"],default:null,description:"Primary category"},subcategory:{type:["string","null"],default:null,description:"Subcategory"},volume:{type:"number",default:0,description:"Total volume in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},openInterest:{type:["number","null"],description:"Open interest in USDC"},liquidity:{type:["number","null"],description:"Available liquidity"},startDate:{type:["string","null"],default:null,description:"Event start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Event end date (ISO)"},closedTime:{type:["string","null"],default:null,description:"Time event was closed (ISO)"},active:{type:"boolean",description:"Whether event is active"},closed:{type:"boolean",description:"Whether event has closed"},featured:{type:["boolean","null"],default:null,description:"Whether event is featured"},commentCount:{type:["number","null"],default:null,description:"Number of comments"},negRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},markets:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Market ID"},question:{type:"string",description:"Market question"},description:{type:["string","null"],default:null,description:"Market description"},conditionId:{type:["string","null"],default:null,description:"Condition ID for on-chain settlement"},slug:{type:"string",description:"URL slug"},image:{type:["string","null"],default:null,description:"Market image URL"},outcomes:{type:"array",items:{type:"string"},description:"Possible outcomes (e.g. ['Yes', 'No'])"},outcomePrices:{type:"array",items:{type:"number"},description:"Current price per outcome (0-1)"},outcomeTokens:{type:"array",items:{type:"object",properties:{outcome:{type:"string",description:"Outcome name (e.g. 'Yes', 'No')"},tokenId:{type:"string",description:"Token identifier \u2014 CLOB token ID (Polymarket/EVM) or mint address (Kalshi/Solana)"},price:{type:["number","null"],default:null,description:"Current price for this outcome (0-1)"}},required:["outcome","tokenId"],additionalProperties:!1},default:[],description:"Token IDs for each outcome \u2014 use these to trade"},volume:{type:"number",default:0,description:"Total volume traded in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},lastTradePrice:{type:["number","null"],default:null,description:"Last trade price"},bestBid:{type:["number","null"],default:null,description:"Best bid price"},bestAsk:{type:["number","null"],default:null,description:"Best ask price"},spread:{type:["number","null"],default:null,description:"Bid-ask spread"},oneDayPriceChange:{type:["number","null"],default:null,description:"24-hour price change"},oneHourPriceChange:{type:["number","null"],default:null,description:"1-hour price change"},oneWeekPriceChange:{type:["number","null"],default:null,description:"1-week price change"},startDate:{type:["string","null"],default:null,description:"Market start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Market end date (ISO)"},negRisk:{type:["boolean","null"],default:null,description:"Whether this uses negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},acceptingOrders:{type:"boolean",description:"Whether market is accepting orders"},enableOrderBook:{type:["boolean","null"],default:null,description:"Whether order book is enabled"},orderMinSize:{type:["number","null"],default:null,description:"Minimum order size"},liquidity:{type:["number","null"],default:null,description:"Available liquidity in USDC"},tickSize:{type:["string","null"],default:null,description:"Minimum price increment"}},required:["id","question","slug","outcomes","outcomePrices","acceptingOrders"],additionalProperties:!1},description:"Markets within this event"},tags:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"Category tags"}},required:["id","ticker","slug","title","description","openInterest","liquidity","active","closed","markets","tags"],additionalProperties:!1},description:"Matching events with markets"},hasMore:{type:"boolean",description:"Whether more results exist"}},required:["items","hasMore"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_tag_list",description:"List available prediction market categories and tags for filtering markets.",inputSchema:{$ref:"#/definitions/prediction-market_market_tag_list_input",definitions:{"prediction-market_market_tag_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},limit:{type:["number","null"],description:"Max results (default 50)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"},slug:{type:["string","null"],description:"Filter by tag slug (e.g. 'nfl')"}},required:["provider","limit","page","slug"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_tag_list_output",definitions:{"prediction-market_market_tag_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"List of tags"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_trending_list",description:"Get trending prediction markets sorted by 24-hour volume. Minimum $150K 24h volume.",inputSchema:{$ref:"#/definitions/prediction-market_market_trending_list_input",definitions:{"prediction-market_market_trending_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},limit:{type:["number","null"],description:"Max results (default 20)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"}},required:["provider","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_trending_list_output",definitions:{"prediction-market_market_trending_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Event ID"},ticker:{type:"string",description:"Event ticker"},slug:{type:"string",description:"URL slug"},title:{type:"string",description:"Event title"},description:{type:["string","null"],description:"Event description"},subtitle:{type:["string","null"],default:null,description:"Event subtitle"},image:{type:["string","null"],default:null,description:"Event image URL"},icon:{type:["string","null"],default:null,description:"Event icon URL"},category:{type:["string","null"],default:null,description:"Primary category"},subcategory:{type:["string","null"],default:null,description:"Subcategory"},volume:{type:"number",default:0,description:"Total volume in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},openInterest:{type:["number","null"],description:"Open interest in USDC"},liquidity:{type:["number","null"],description:"Available liquidity"},startDate:{type:["string","null"],default:null,description:"Event start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Event end date (ISO)"},closedTime:{type:["string","null"],default:null,description:"Time event was closed (ISO)"},active:{type:"boolean",description:"Whether event is active"},closed:{type:"boolean",description:"Whether event has closed"},featured:{type:["boolean","null"],default:null,description:"Whether event is featured"},commentCount:{type:["number","null"],default:null,description:"Number of comments"},negRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},markets:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Market ID"},question:{type:"string",description:"Market question"},description:{type:["string","null"],default:null,description:"Market description"},conditionId:{type:["string","null"],default:null,description:"Condition ID for on-chain settlement"},slug:{type:"string",description:"URL slug"},image:{type:["string","null"],default:null,description:"Market image URL"},outcomes:{type:"array",items:{type:"string"},description:"Possible outcomes (e.g. ['Yes', 'No'])"},outcomePrices:{type:"array",items:{type:"number"},description:"Current price per outcome (0-1)"},outcomeTokens:{type:"array",items:{type:"object",properties:{outcome:{type:"string",description:"Outcome name (e.g. 'Yes', 'No')"},tokenId:{type:"string",description:"Token identifier \u2014 CLOB token ID (Polymarket/EVM) or mint address (Kalshi/Solana)"},price:{type:["number","null"],default:null,description:"Current price for this outcome (0-1)"}},required:["outcome","tokenId"],additionalProperties:!1},default:[],description:"Token IDs for each outcome \u2014 use these to trade"},volume:{type:"number",default:0,description:"Total volume traded in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},lastTradePrice:{type:["number","null"],default:null,description:"Last trade price"},bestBid:{type:["number","null"],default:null,description:"Best bid price"},bestAsk:{type:["number","null"],default:null,description:"Best ask price"},spread:{type:["number","null"],default:null,description:"Bid-ask spread"},oneDayPriceChange:{type:["number","null"],default:null,description:"24-hour price change"},oneHourPriceChange:{type:["number","null"],default:null,description:"1-hour price change"},oneWeekPriceChange:{type:["number","null"],default:null,description:"1-week price change"},startDate:{type:["string","null"],default:null,description:"Market start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Market end date (ISO)"},negRisk:{type:["boolean","null"],default:null,description:"Whether this uses negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},acceptingOrders:{type:"boolean",description:"Whether market is accepting orders"},enableOrderBook:{type:["boolean","null"],default:null,description:"Whether order book is enabled"},orderMinSize:{type:["number","null"],default:null,description:"Minimum order size"},liquidity:{type:["number","null"],default:null,description:"Available liquidity in USDC"},tickSize:{type:["string","null"],default:null,description:"Minimum price increment"}},required:["id","question","slug","outcomes","outcomePrices","acceptingOrders"],additionalProperties:!1},description:"Markets within this event"},tags:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"Category tags"}},required:["id","ticker","slug","title","description","openInterest","liquidity","active","closed","markets","tags"],additionalProperties:!1},description:"Trending events"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_pnl_retrieve",description:"Get profit and loss summary for a wallet on prediction markets.",inputSchema:{$ref:"#/definitions/prediction-market_pnl_retrieve_input",definitions:{"prediction-market_pnl_retrieve_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address"}},required:["provider","wallet"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_pnl_retrieve_output",definitions:{"prediction-market_pnl_retrieve_output":{type:"object",properties:{totalPnl:{type:"number",description:"Total profit/loss in USDC"},realizedPnl:{type:"number",description:"Realized PnL from closed positions"},unrealizedPnl:{type:"number",description:"Unrealized PnL from open positions"},totalInvested:{type:"number",description:"Total amount invested in USDC"},totalValue:{type:"number",description:"Current total value of all positions"}},required:["totalPnl","realizedPnl","unrealizedPnl","totalInvested","totalValue"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_position_buy",description:"Buy shares of a prediction market outcome. Places a limit order at the specified price.",inputSchema:{$ref:"#/definitions/prediction-market_position_buy_input",definitions:{"prediction-market_position_buy_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address placing the order"},tokenId:{type:"string",description:"Outcome token ID to buy (from outcomeTokens[].tokenId)"},price:{type:"number",description:"Price per share (0-1)"},size:{type:"number",description:"Number of shares to buy"},negRisk:{type:["boolean","null"],description:"Whether market uses negative risk framework (from market data)"},tickSize:{type:["string","null"],description:"Market tick size (from market data, e.g. '0.01', '0.001')"}},required:["provider","wallet","tokenId","price","size","negRisk","tickSize"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_position_buy_output",definitions:{"prediction-market_position_buy_output":{type:"object",properties:{orderId:{type:["string","null"],description:"Order/transaction ID"},status:{type:"string",description:"Order status (pending_signature, executed, etc.)"},transactionHashes:{type:"array",items:{type:"string"},description:"On-chain transaction hashes"},transaction:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded Solana transaction"},lastValidBlockHeight:{type:"number"}},required:["type","base64","lastValidBlockHeight"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string"},data:{type:"string"},value:{type:"string"},chainId:{type:"number"}},required:["type","to","data","value","chainId"],additionalProperties:!1}]},{type:"null"}],description:"Transaction to sign (Kalshi=Solana, Polymarket=EVM)"}},required:["orderId","status","transactionHashes","transaction"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_position_list",description:"List prediction market positions for a wallet address. Shows current value, PnL, and outcome details.",inputSchema:{$ref:"#/definitions/prediction-market_position_list_input",definitions:{"prediction-market_position_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address"},status:{anyOf:[{type:"string",enum:["open","closed"]},{type:"null"}],description:"Position status (default open)"},limit:{type:["number","null"],description:"Max results (default 100)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"}},required:["provider","wallet","status","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_position_list_output",definitions:{"prediction-market_position_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{asset:{type:"string",description:"Token ID (CLOB token or mint address)"},conditionId:{type:["string","null"],default:null,description:"Condition ID (Polymarket)"},size:{type:"number",description:"Position size in shares"},avgPrice:{type:"number",description:"Average entry price"},initialValue:{type:"number",description:"Initial position value in USDC"},currentValue:{type:"number",description:"Current position value in USDC"},cashPnl:{type:"number",description:"Cash profit/loss in USDC"},percentPnl:{type:"number",description:"Percentage profit/loss"},curPrice:{type:"number",description:"Current outcome price"},redeemable:{type:"boolean",description:"Whether position can be redeemed"},mergeable:{type:"boolean",description:"Whether position can be merged"},title:{type:"string",description:"Event title"},slug:{type:"string",description:"Event slug"},outcome:{type:"string",description:"Outcome name (e.g. 'Yes')"},outcomeIndex:{type:"number",description:"Outcome index (0 or 1)"},oppositeOutcome:{type:["string","null"],default:null,description:"Opposite outcome name"},oppositeAsset:{type:["string","null"],default:null,description:"Opposite outcome token ID"},endDate:{type:["string","null"],description:"Market end date"},negativeRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"}},required:["asset","size","avgPrice","initialValue","currentValue","cashPnl","percentPnl","curPrice","redeemable","mergeable","title","slug","outcome","outcomeIndex","endDate"],additionalProperties:!1},description:"Positions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_position_sell",description:"Sell shares of a prediction market outcome. Places a limit order at the specified price.",inputSchema:{$ref:"#/definitions/prediction-market_position_sell_input",definitions:{"prediction-market_position_sell_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address placing the order"},tokenId:{type:"string",description:"Outcome token ID to sell (from outcomeTokens[].tokenId)"},price:{type:"number",description:"Price per share (0-1)"},size:{type:"number",description:"Number of shares to sell"},negRisk:{type:["boolean","null"],description:"Whether market uses negative risk framework (from market data)"},tickSize:{type:["string","null"],description:"Market tick size (from market data, e.g. '0.01', '0.001')"}},required:["provider","wallet","tokenId","price","size","negRisk","tickSize"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_position_sell_output",definitions:{"prediction-market_position_sell_output":{type:"object",properties:{orderId:{type:["string","null"],description:"Order ID (set for Polymarket, null for Kalshi until signed)"},status:{type:"string",description:"Order status (live, matched, delayed, unmatched, pending_signature)"},transactionHashes:{type:"array",items:{type:"string"},description:"On-chain transaction hashes"},transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded Solana transaction"},lastValidBlockHeight:{type:"number"}},required:["type","base64","lastValidBlockHeight"],additionalProperties:!1},{type:"null"}],description:"Solana transaction to sign (Kalshi only, null for Polymarket)"}},required:["orderId","status","transactionHashes","transaction"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_trade_list",description:"List trade history for a wallet address on prediction markets. Shows buys, sells, prices, and timestamps.",inputSchema:{$ref:"#/definitions/prediction-market_trade_list_input",definitions:{"prediction-market_trade_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address"},limit:{type:["number","null"],description:"Max results (default 100)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"}},required:["provider","wallet","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_trade_list_output",definitions:{"prediction-market_trade_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{side:{type:"string",description:"Trade side (BUY or SELL)"},asset:{type:"string",description:"Token ID (CLOB token or mint address)"},conditionId:{type:["string","null"],default:null,description:"Condition ID"},size:{type:"number",description:"Number of shares"},price:{type:"number",description:"Price per share"},fee:{type:["number","null"],default:null,description:"Trading fee"},timestamp:{type:"number",description:"Trade timestamp (unix)"},title:{type:["string","null"],default:null,description:"Event title"},slug:{type:["string","null"],default:null,description:"Event slug"},outcome:{type:"string",description:"Outcome name"},outcomeIndex:{type:"number",description:"Outcome index"},transactionHash:{type:["string","null"],description:"On-chain transaction hash"},orderId:{type:["string","null"],default:null,description:"Order ID"}},required:["side","asset","size","price","timestamp","outcome","outcomeIndex","transactionHash"],additionalProperties:!1},description:"Trade history"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_user_create",description:"Register a wallet with a prediction market provider. Required before placing orders.",inputSchema:{$ref:"#/definitions/prediction-market_user_create_input",definitions:{"prediction-market_user_create_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},wallet:{type:"string",description:"Wallet address to register"}},required:["provider","wallet"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_user_create_output",definitions:{"prediction-market_user_create_output":{type:"object",properties:{userId:{type:"string",description:"User ID (EVM address or Solana pubkey)"},proxyWallet:{type:["string","null"],description:"Provider proxy wallet address"}},required:["userId","proxyWallet"],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},{type:"object",properties:{type:{type:"string",const:"tron"},rawDataHex:{type:"string",description:"Hex-encoded raw transaction data for signing"}},required:["type","rawDataHex"],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},{type:"object",properties:{type:{type:"string",const:"tron"},rawDataHex:{type:"string",description:"Hex-encoded raw transaction data for signing"}},required:["type","rawDataHex"],additionalProperties:!1}]},message:{type:"string",description:"Human-readable description of the transfer"},requiresApproval:{type:"boolean",description:"Whether a token approval transaction is needed first"}},required:["transaction","message","requiresApproval"],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 the swap build step"},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 swap 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, Bitcoin, and Tron.",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, JSON {raw_data_hex, signature} for Tron"},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_bank-account_delete",description:"Delete a bank account",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_delete_input",definitions:{"virtual-account_bank-account_delete_input":{type:"object",properties:{bankAccountId:{type:"string",format:"uuid",description:"The ID of the bank account to delete"}},required:["bankAccountId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_delete_output",definitions:{"virtual-account_bank-account_delete_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_bank-account_list",description:"List registered bank accounts",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_list_input",definitions:{"virtual-account_bank-account_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_list_output",definitions:{"virtual-account_bank-account_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},bank_account_identifier:{anyOf:[{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"}},required:["type","iban"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"ACH"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Wire"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1}]},bank_name:{type:"string"},country:{type:"string"},created_at:{type:"string",format:"date-time"},currency:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"},customer_id:{type:"string"},is_third_party:{type:"boolean"},label:{type:["string","null"]},ownership_verified:{type:"boolean"},status:{type:"string",enum:["AuthorizationRequired","AuthorizationFailed","RegistrationPending","RegistrationFailed","Registered"]},updated_at:{type:"string",format:"date-time"}},required:["id","bank_account_identifier","bank_name","country","created_at","currency","customer_id","is_third_party","label","ownership_verified","status","updated_at"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_bank-account_register",description:"Register a bank account for offramp payouts. USD accounts use ACH/Wire with account+routing numbers. EUR accounts use SEPA with IBAN.",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_register_input",definitions:{"virtual-account_bank-account_register_input":{type:"object",properties:{currency:{type:"string",enum:["USD","EUR"],description:"Currency of the bank account (USD or EUR)"},type:{type:"string",enum:["ACH","Wire","SEPA"],description:"Account type: ACH or Wire for USD, SEPA for EUR"},accountNumber:{type:["string","null"],description:"Account number (required for USD ACH/Wire)"},routingNumber:{type:["string","null"],description:"Routing number (required for USD ACH/Wire)"},iban:{type:["string","null"],description:"IBAN (required for EUR SEPA)"},address:{type:"object",properties:{street:{type:"string",description:"Street address"},city:{type:"string",description:"City"},state:{type:"string",description:"State or province"},country:{type:"string",enum:["US","GB","CA","AU","DE","FR","IT","ES","NL","BE","AT","CH","SE","NO","DK","FI","IE","PT","PL","CZ","GR","JP","KR","CN","IN","BR","MX","AR","ZA","NZ","SG","HK","AE"],description:"ISO 3166-1 Alpha-2 country code"},postalCode:{type:"string",description:"Postal or ZIP code"}},required:["street","city","state","country","postalCode"],additionalProperties:!1,description:"Address of the account holder"},email:{type:"string",description:"Email address of the account holder"},phoneNumber:{type:"string",description:"Phone number of the account holder"},providerCountry:{type:"string",enum:["US","GB","CA","AU","DE","FR","IT","ES","NL","BE","AT","CH","SE","NO","DK","FI","IE","PT","PL","CZ","GR","JP","KR","CN","IN","BR","MX","AR","ZA","NZ","SG","HK","AE"],description:"ISO 3166-1 Alpha-2 country code where the bank is located"},providerName:{type:"string",description:"Name of the bank"},givenName:{type:"string",description:"First/given name of the account holder"},familyName:{type:"string",description:"Last/family name of the account holder"}},required:["currency","type","accountNumber","routingNumber","iban","address","email","phoneNumber","providerCountry","providerName","givenName","familyName"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_register_output",definitions:{"virtual-account_bank-account_register_output":{type:"object",properties:{id:{type:"string"},bank_account_identifier:{anyOf:[{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"}},required:["type","iban"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"ACH"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Wire"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1}]},bank_name:{type:"string"},country:{type:"string"},created_at:{type:"string",format:"date-time"},currency:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"},customer_id:{type:"string"},is_third_party:{type:"boolean"},label:{type:["string","null"]},ownership_verified:{type:"boolean"},status:{type:"string",enum:["AuthorizationRequired","AuthorizationFailed","RegistrationPending","RegistrationFailed","Registered"]},updated_at:{type:"string",format:"date-time"}},required:["id","bank_account_identifier","bank_name","country","created_at","currency","customer_id","is_third_party","label","ownership_verified","status","updated_at"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_bank-account_retrieve",description:"Get a bank account by ID",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_retrieve_input",definitions:{"virtual-account_bank-account_retrieve_input":{type:"object",properties:{bankAccountId:{type:"string",description:"Bank account ID"}},required:["bankAccountId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_retrieve_output",definitions:{"virtual-account_bank-account_retrieve_output":{type:"object",properties:{id:{type:"string"},bank_account_identifier:{anyOf:[{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"}},required:["type","iban"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"ACH"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Wire"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1}]},bank_name:{type:"string"},country:{type:"string"},created_at:{type:"string",format:"date-time"},currency:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"},customer_id:{type:"string"},is_third_party:{type:"boolean"},label:{type:["string","null"]},ownership_verified:{type:"boolean"},status:{type:"string",enum:["AuthorizationRequired","AuthorizationFailed","RegistrationPending","RegistrationFailed","Registered"]},updated_at:{type:"string",format:"date-time"}},required:["id","bank_account_identifier","bank_name","country","created_at","currency","customer_id","is_third_party","label","ownership_verified","status","updated_at"],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_offramp_cancel",description:"Cancel an offramp",inputSchema:{$ref:"#/definitions/virtual-account_offramp_cancel_input",definitions:{"virtual-account_offramp_cancel_input":{type:"object",properties:{offrampId:{type:"string",format:"uuid",description:"The ID of the offramp to cancel"}},required:["offrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_cancel_output",definitions:{"virtual-account_offramp_cancel_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_offramp_create",description:"Create an offramp to convert stablecoin to fiat",inputSchema:{$ref:"#/definitions/virtual-account_offramp_create_input",definitions:{"virtual-account_offramp_create_input":{type:"object",properties:{name:{type:"string",description:"The name of the offramp"},bankAccountId:{type:"string",description:"Bank account ID to receive fiat. Get from `bank-account list`."},stablecoin:{type:"string",enum:["USDC","USDT","EURC"],description:"The stablecoin token to convert from"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain the stablecoin is on (solana, ethereum, polygon, arbitrum, base)"}},required:["name","bankAccountId","stablecoin","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_create_output",definitions:{"virtual-account_offramp_create_output":{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_initiate",description:"Build an unsigned transaction to send stablecoin to an offramp deposit address",inputSchema:{$ref:"#/definitions/virtual-account_offramp_initiate_input",definitions:{"virtual-account_offramp_initiate_input":{type:"object",properties:{wallet:{type:"string",description:"The wallet address to send from"},offrampId:{type:"string",description:"The ID of the offramp to initiate"},amount:{type:"number",minimum:0,description:"The amount of stablecoin to send (in human-readable units, e.g., 100.5)"}},required:["wallet","offrampId","amount"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_initiate_output",definitions:{"virtual-account_offramp_initiate_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},{type:"object",properties:{type:{type:"string",const:"tron"},rawDataHex:{type:"string",description:"Hex-encoded raw transaction data for signing"}},required:["type","rawDataHex"],additionalProperties:!1}]},message:{type:"string",description:"Human-readable description of the transfer"},requiresApproval:{type:"boolean",description:"Whether a token approval transaction is needed first"}},required:["transaction","message","requiresApproval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_list",description:"List all offramps",inputSchema:{$ref:"#/definitions/virtual-account_offramp_list_input",definitions:{"virtual-account_offramp_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_list_output",definitions:{"virtual-account_offramp_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_retrieve",description:"Get offramp details",inputSchema:{$ref:"#/definitions/virtual-account_offramp_retrieve_input",definitions:{"virtual-account_offramp_retrieve_input":{type:"object",properties:{offrampId:{type:"string",format:"uuid",description:"The ID of the offramp to retrieve"}},required:["offrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_retrieve_output",definitions:{"virtual-account_offramp_retrieve_output":{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_update",description:"Update an existing offramp's destination bank account or fiat currency.",inputSchema:{$ref:"#/definitions/virtual-account_offramp_update_input",definitions:{"virtual-account_offramp_update_input":{type:"object",properties:{offrampId:{type:"string",description:"The ID of the offramp to update"},bankAccountId:{type:"string",description:"New bank account ID. Get from `bank-account list`."}},required:["offrampId","bankAccountId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_update_output",definitions:{"virtual-account_offramp_update_output":{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_cancel",description:"Cancel an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_cancel_input",definitions:{"virtual-account_onramp_cancel_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_cancel_output",definitions:{"virtual-account_onramp_cancel_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_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)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to receive stablecoin on (solana, ethereum, polygon, arbitrum, base)"}},required:["name","fiat","stablecoin","wallet","chain"],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","EditPending","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_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","EditPending","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","EditPending","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_update",description:"Update an existing onramp's destination wallet, chain, or stablecoin.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_update_input",definitions:{"virtual-account_onramp_update_input":{type:"object",properties:{onrampId:{type:"string",description:"The ID of the onramp to update"},wallet:{type:["string","null"],description:"New destination wallet address (must be registered)"},chain:{anyOf:[{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"]},{type:"null"}],description:"New destination chain (solana, ethereum, polygon, arbitrum, base)"},stablecoin:{anyOf:[{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"},{type:"null"}],description:"New destination stablecoin (USDC, USDT, EURC)"}},required:["onrampId","wallet","chain","stablecoin"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_update_output",definitions:{"virtual-account_onramp_update_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","EditPending","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:"Proof-of-ownership verification message"},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#"}}];var Qt="https://www.moonpay.com/legal/terms_of_use_europe_hypermint",ei="https://www.moonpay.com/legal/privacy_policy",ti="https://swaps.xyz/terms",$e=` Terms of Use: ${Qt}
3
+ Privacy Policy: ${ei}
4
+ Swaps by: ${ti}`;import*as Me from"fs";import*as We from"os";import*as ze from"path";var p=e=>e,c=(e,t)=>({schema:e,handler:async i=>{let r=e.input.parse(i),n=await t(r);return e.output.parse(n)}});import{z as G}from"zod";var qe=p({name:"consent_check",description:"Check whether the MoonPay Terms of Use have been accepted. Throws if not accepted.",input:G.object({}),output:G.object({accepted:G.literal(!0),tosVersion:G.string(),acceptedAt:G.string()})});import*as L from"fs";import*as Be from"os";import*as Ne from"path";import*as Le from"crypto";import{z as ae}from"zod";var xe=p({name:"consent_accept",description:"Accept the MoonPay Terms of Use. Required before using any CLI command.",input:ae.object({}),output:ae.object({tosVersion:ae.string(),acceptedAt:ae.string()})});import*as se from"os";var Re=3e3;function Ee(e){let t=f(),i=JSON.stringify({agentId:e.agentId,tosVersion:e.tosVersion,cliVersion:e.cliVersion,nodeVersion:process.version,os:se.platform(),arch:se.arch()});fetch(`${t}/api/tools/cli_activation_create`,{method:"POST",headers:E(),body:i,signal:AbortSignal.timeout(Re)}).catch(()=>{})}async function Oe(e){let t=f(),i=await O();i&&fetch(`${t}/api/tools/cli_activation_update`,{method:"POST",headers:{...E(),Authorization:`Bearer ${i}`},body:JSON.stringify({agentId:e}),signal:AbortSignal.timeout(Re)}).catch(()=>{})}var he=Ne.join(Be.homedir(),".config","moonpay","consent.json");function ii(){try{return JSON.parse(L.readFileSync(he,"utf-8"))}catch{return null}}var ce=c(xe,async()=>{we();let t=ii()?.agentId??Le.randomUUID(),i=new Date().toISOString(),r={tosVersion:"1.2",acceptedAt:i,agentId:t},n=he+`.tmp.${process.pid}`;return L.writeFileSync(n,JSON.stringify(r,null,2),{encoding:"utf-8",mode:384}),L.renameSync(n,he),process.stderr.write(`
5
+ By using this CLI, you agree to:
6
+ ${$e}
7
+
8
+ `),Ee({agentId:t,tosVersion:"1.2",cliVersion:Se}),{tosVersion:r.tosVersion,acceptedAt:r.acceptedAt}});var ri=ze.join(We.homedir(),".config","moonpay","consent.json"),He=c(qe,async()=>{let e=null;try{e=JSON.parse(Me.readFileSync(ri,"utf-8"))}catch{}if(!e||e.tosVersion!=="1.2"){let t=await ce.handler({});return{accepted:!0,tosVersion:t.tosVersion,acceptedAt:t.acceptedAt}}return{accepted:!0,tosVersion:e.tosVersion,acceptedAt:e.acceptedAt}});import{generateMnemonic as ni}from"@scure/bip39";import{wordlist as oi}from"@scure/bip39/wordlists/english";import{z as M}from"zod";var Fe=p({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:M.object({name:M.string().describe("Wallet name")}),output:M.object({name:M.string(),addresses:M.record(g,M.string())})});var Ve=c(Fe,async e=>{let t=ni(oi,256),i=re(t);return K({name:e.name,type:"hd",mnemonic:t,addresses:i,createdAt:new Date().toISOString()}),{name:e.name,addresses:B(i)}});import{createInterface as ai}from"readline";import{validateMnemonic as Ge}from"@scure/bip39";import{wordlist as Ye}from"@scure/bip39/wordlists/english";import{Keypair as si}from"@solana/web3.js";import pi from"bs58";import{privateKeyToAccount as ci}from"viem/accounts";import{z as q}from"zod";var Ke=p({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:q.object({name:q.string().describe("Wallet name"),mnemonic:q.string().nullable().describe("BIP39 mnemonic seed phrase (for HD wallet import)"),key:q.string().nullable().describe("Private key: base58 for Solana, hex for EVM/Bitcoin"),chain:g.nullable().describe("Chain for single-key import (default solana)")}),output:q.object({name:q.string(),type:q.enum(["hd","imported"]),addresses:De})});function li(e){return new Promise((t,i)=>{if(!process.stdin.isTTY){i(new Error("Interactive import requires a terminal. Pass --mnemonic or --key instead."));return}let r=ai({input:process.stdin,output:process.stderr});process.stderr.write(e),process.stdin.setRawMode(!0);let n="",o=s=>{let a=s.toString();a===`
9
+ `||a==="\r"?(process.stdin.setRawMode(!1),process.stdin.removeListener("data",o),process.stderr.write(`
10
+ `),r.close(),t(n.trim())):a===""?(process.stdin.setRawMode(!1),r.close(),process.exit(0)):a==="\x7F"||a==="\b"?n=n.slice(0,-1):n+=a};process.stdin.on("data",o)})}function di(e){let t=e.split(/\s+/);return t.length>=12&&t.length<=24&&Ge(e,Ye)?"mnemonic":"key"}var Je=c(Ke,async e=>{if(e.mnemonic&&e.key)throw new Error("Provide either --mnemonic or --key, not both.");let t=e.mnemonic,i=e.key;if(!t&&!i){let a=await li("Paste your mnemonic or private key (hidden): ");if(!a)throw new Error("No input provided.");di(a)==="mnemonic"?t=a:i=a}if(t){let a=t.trim().toLowerCase();if(!Ge(a,Ye))throw new Error("Invalid BIP39 mnemonic.");let l=re(a);return K({name:e.name,type:"hd",mnemonic:a,addresses:l,createdAt:new Date().toISOString()}),{name:e.name,type:"hd",addresses:l}}let r=e.chain?u[e.chain]:"solana",n=i??"",o,s;if(r==="solana")try{let a=pi.decode(n);o=si.fromSecretKey(a).publicKey.toBase58(),s=n}catch{throw new Error("Invalid Solana private key. Expected base58-encoded secret key.")}else if(r==="ethereum"){if(s=n.startsWith("0x")?n.slice(2):n,!/^[0-9a-fA-F]{64}$/.test(s))throw new Error("Invalid EVM private key. Expected 64-character hex string.");o=ci(`0x${s}`).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:s,addresses:{[r]:o},createdAt:new Date().toISOString()}),{name:e.name,type:"imported",addresses:{[r]:o}}});import{z as Ze}from"zod";var Xe=p({name:"wallet_list",description:"List all local wallets",input:Ze.object({}),output:Ze.array(ne)});var Qe=c(Xe,async()=>oe().map(t=>({name:t.name,type:t.type,addresses:B(t.addresses),createdAt:t.createdAt})));import{z as et}from"zod";var tt=p({name:"wallet_retrieve",description:"Get details of a specific wallet",input:et.object({wallet:et.string().describe("Wallet name or address")}),output:ne});var b=c(tt,async e=>{let t=k(e.wallet);return{name:t.name,type:t.type,addresses:B(t.addresses),createdAt:t.createdAt}});import{z as W}from"zod";var it=p({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 rt=c(it,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=k(e.wallet);return Ue(t.name),{name:t.name,deleted:!0}});import{z}from"zod";var nt=p({name:"wallet_rename",description:"Rename a local wallet.",input:z.object({wallet:z.string().describe("Current name or address of the wallet"),name:z.string().describe("New name for the wallet")}),output:z.object({oldName:z.string(),newName:z.string()})});var ot=c(nt,async e=>{let i=k(e.wallet).name;if(i===e.name)return{oldName:i,newName:e.name};if(oe().some(n=>n.name===e.name))throw new Error(`Wallet "${e.name}" already exists`);return Ae(n=>{let o=n.find(s=>s.name===i);if(!o)throw new Error(`Wallet "${i}" not found`);o.name=e.name}),{oldName:i,newName:e.name}});import{z as le}from"zod";var at=p({name:"wallet_export",description:"Export wallet secret (mnemonic or private key). Interactive only \u2014 cannot be run by agents or piped.",input:le.object({wallet:le.string().describe("Wallet name")}),output:le.object({exported:le.literal(!0)})});var st=c(at,async e=>{if(!process.stdout.isTTY)throw new Error(`Wallet export requires an interactive terminal.
11
+ Run this command directly in your terminal: mp wallet export `+e.wallet);let t=k(e.wallet);return t.type==="hd"?(process.stderr.write(`
12
+ Mnemonic for "${t.name}":
13
+
14
+ `),process.stderr.write(` ${t.mnemonic}
15
+
16
+ `),process.stderr.write(`Write this down and store it securely.
17
+
18
+ `)):(process.stderr.write(`
19
+ Private key for "${t.name}" (${t.chain}):
20
+
21
+ `),process.stderr.write(` ${t.privateKey}
22
+
23
+ `)),{exported:!0}});import{createHash as ui}from"crypto";import{Keypair as mi,VersionedTransaction as yi}from"@solana/web3.js";import{privateKeyToAccount as hi}from"viem/accounts";import{parseTransaction as fi}from"viem";import{createPublicClient as gi,http as bi}from"viem";import*as _ from"viem/chains";import*as ct from"tiny-secp256k1";import{z as Y}from"zod";var pt=p({name:"transaction_sign",description:"Sign a transaction with a local wallet. Supports Solana (VersionedTransaction), EVM (RLP-encoded), and Bitcoin (PSBT) transactions.",input:Y.object({wallet:Y.string().describe("Wallet name or address"),chain:g.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),transaction:Y.string().describe("Base64-encoded unsigned transaction")}),output:Y.object({transaction:Y.string().describe("Base64-encoded signed transaction")})});var _i={1:_.mainnet,137:_.polygon,42161:_.arbitrum,8453:_.base,10:_.optimism,56:_.bsc,43114:_.avalanche},ki={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"},v=c(pt,async e=>{let t=k(e.wallet),i=e.chain,r=u[i],{privateKey:n}=N(t,i);switch(r){case"solana":return vi(n,e.transaction.trim());case"ethereum":return Si(n,e.transaction.trim());case"tron":return wi(n,e.transaction.trim());case"bitcoin":return Pi(n,e.transaction.trim())}});function vi(e,t){let i=Buffer.from(t,"base64"),r=yi.deserialize(i),n=mi.fromSecretKey(e);return r.sign([n]),{transaction:Buffer.from(r.serialize()).toString("base64")}}async function Si(e,t){let i=hi(`0x${Buffer.from(e).toString("hex")}`);if(t.startsWith("{")){let{to:s,data:a,value:l,chainId:h}=JSON.parse(t),m=_i[h]??_.mainnet,y=ki[h],T=gi({chain:m,transport:bi(y)}),$=await T.getTransactionCount({address:i.address}),ee=await T.estimateFeesPerGas(),te=await T.estimateGas({account:i.address,to:s,data:a,value:BigInt(l??"0")});return{transaction:await i.signTransaction({to:s,data:a,value:BigInt(l??"0"),chainId:h,nonce:$,gas:te,maxFeePerGas:ee.maxFeePerGas,maxPriorityFeePerGas:ee.maxPriorityFeePerGas,type:"eip1559"})}}let r=t.startsWith("0x")?t:`0x${Buffer.from(t,"base64").toString("hex")}`,n=fi(r);return{transaction:await i.signTransaction(n)}}function wi(e,t){let i=t.startsWith("0x")?t.slice(2):t,r=Buffer.from(i,"hex"),n=ui("sha256").update(r).digest(),o=ct.sign(n,e);if(!o)throw new Error("Tron transaction signing failed");return{transaction:JSON.stringify({raw_data_hex:i,signature:Buffer.from(o).toString("hex")})}}async function Pi(e,t){let i=await import("bitcoinjs-lib"),r=(await import("ecpair")).default,n=await import("tiny-secp256k1"),s=r(n).fromPrivateKey(Buffer.from(e)),a=i.Psbt.fromBase64(t);return a.signAllInputs(s),a.finalizeAllInputs(),{transaction:a.toBase64()}}import{createHash as dt}from"crypto";import{Keypair as ji}from"@solana/web3.js";import Ci from"bs58";import Ti from"tweetnacl";import*as fe from"tiny-secp256k1";import{keccak_256 as Ii}from"@noble/hashes/sha3";import{privateKeyToAccount as Di}from"viem/accounts";import{z as J}from"zod";var lt=p({name:"message_sign",description:"Sign a message with a local wallet. Supports Solana (ed25519), EVM (EIP-191 personal sign), and Bitcoin (secp256k1 ECDSA).",input:J.object({wallet:J.string().describe("Wallet address or name to sign with"),chain:g.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),message:J.string().describe("Message text to sign")}),output:J.object({signature:J.string().describe("Signature: base58 for Solana, hex (0x-prefixed) for EVM/Bitcoin")})});var de=c(lt,async e=>{let t=k(e.wallet),i=e.chain,r=u[i],{privateKey:n}=N(t,i),o=Buffer.from(e.message,"utf8");switch(r){case"solana":return Ai(n,o);case"ethereum":return Ui(n,e.message);case"tron":return $i(n,e.message);case"bitcoin":return qi(n,o)}});function Ai(e,t){let i=ji.fromSecretKey(e),r=Ti.sign.detached(t,i.secretKey);return{signature:Ci.encode(r)}}async function Ui(e,t){return{signature:await Di(`0x${Buffer.from(e).toString("hex")}`).signMessage({message:t})}}function $i(e,t){let i=Buffer.from(t,"utf8"),r=Buffer.from(`TRON Signed Message:
24
+ ${i.length}`,"utf8"),n=Ii(Buffer.concat([r,i])),o=fe.sign(n,e);if(!o)throw new Error("Tron message signing failed");return{signature:"0x"+Buffer.from(o).toString("hex")}}function qi(e,t){let i=dt("sha256").update(t).digest(),r=dt("sha256").update(i).digest(),n=fe.sign(r,e);if(!n)throw new Error("Bitcoin message signing failed");return{signature:"0x"+Buffer.from(n).toString("hex")}}import xi from"https";import{z as w}from"zod";var ut=p({name:"bitcoin_balance_retrieve",description:"Get the BTC balance of a Bitcoin address. Returns confirmed and unconfirmed balances in BTC and satoshis.",input:w.object({wallet:w.string().describe("Bitcoin address (bc1...) or wallet name")}),output:w.object({address:w.string().describe("Bitcoin address"),confirmed:w.object({btc:w.string().describe("Confirmed balance in BTC"),sats:w.number().describe("Confirmed balance in satoshis")}),unconfirmed:w.object({btc:w.string().describe("Unconfirmed (pending) balance in BTC"),sats:w.number().describe("Unconfirmed (pending) balance in satoshis")}),total:w.object({btc:w.string().describe("Total balance in BTC"),sats:w.number().describe("Total balance in satoshis")})})});var Ri=1e8;function ge(e){return(e/Ri).toFixed(8)}function Ei(e){return new Promise((t,i)=>{xi.get(e,{headers:{"User-Agent":"moonpay-cli"}},r=>{if(r.statusCode!==200){i(new Error(`HTTP ${r.statusCode} from ${e}`)),r.resume();return}let n="";r.on("data",o=>n+=o),r.on("end",()=>{try{t(JSON.parse(n))}catch{i(new Error("Invalid JSON response"))}})}).on("error",i)})}var mt=c(ut,async e=>{let t=e.wallet;if(!t.startsWith("bc1")&&!t.startsWith("1")&&!t.startsWith("3")){let{findWalletOrThrow:s}=await import("./store-TCMIGPOP.js"),l=s(t).addresses.bitcoin;if(!l)throw new Error(`Wallet "${t}" has no Bitcoin address. It may be an imported single-chain wallet.`);t=l}let i=await Ei(`https://mempool.space/api/address/${encodeURIComponent(t)}`),r=i.chain_stats.funded_txo_sum-i.chain_stats.spent_txo_sum,n=i.mempool_stats.funded_txo_sum-i.mempool_stats.spent_txo_sum,o=r+n;return{address:t,confirmed:{btc:ge(r),sats:r},unconfirmed:{btc:ge(n),sats:n},total:{btc:ge(o),sats:o}}});import{readdirSync as Oi,readFileSync as yt,existsSync as be,mkdirSync as Bi,cpSync as Ni}from"fs";import{join as H,dirname as Li}from"path";import{homedir as Mi}from"os";import{fileURLToPath as Wi}from"url";function _e(){let e=Wi(import.meta.url),t=Li(e);return H(t,"..","skills")}function zi(){return H(Mi(),".claude","skills")}function ke(){let e=_e();return be(e)?Oi(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&t.name.startsWith("moonpay-")).map(t=>{let r=yt(H(e,t.name,"SKILL.md"),"utf-8").match(/^description:\s*(.+)$/m);return{name:t.name,description:r?.[1]?.replace(/^["']|["']$/g,"")??""}}).sort((t,i)=>t.name.localeCompare(i.name)):[]}function ht(e){if(/[/\\]|\.\./.test(e))throw new Error(`Invalid skill name: "${e}"`);let t=H(_e(),e,"SKILL.md");if(!be(t))throw new Error(`Skill "${e}" not found. Run \`mp skill list\` to see available skills.`);return yt(t,"utf-8")}function ft(e,t){let i=_e(),r=t??zi(),n=ke();return Bi(r,{recursive:!0}),n.map(o=>{let s=H(r,o.name);return be(s)&&!e?{name:o.name,installed:!1}:(Ni(H(i,o.name),s,{recursive:!0,force:!0}),{name:o.name,installed:!0})})}import{z as Z}from"zod";var gt=p({name:"skill_list",description:"List available AI skills for Claude Code and other agents",input:Z.object({}),output:Z.array(Z.object({name:Z.string(),description:Z.string()}))});var bt=c(gt,async()=>ke());import{z as X}from"zod";var _t=p({name:"skill_retrieve",description:"Get the full instructions for a specific skill",input:X.object({name:X.string().describe("Skill name (e.g. moonpay-swap-tokens)")}),output:X.object({name:X.string(),content:X.string()})});var kt=c(_t,async e=>({name:e.name,content:ht(e.name)}));import{z as x}from"zod";var vt=p({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:x.object({force:x.boolean().describe("Overwrite existing skills"),dir:x.string().nullable().describe("Target directory to install skills into (default: ~/.claude/skills/)")}),output:x.array(x.object({name:x.string(),installed:x.boolean()}))});var St=c(vt,async e=>ft(e.force,e.dir??void 0));import{encodeFunctionData as Hi}from"viem";import{z as C}from"zod";var wt=p({name:"token_bridge",description:"Bridge tokens across chains. Builds, signs locally, broadcasts, and registers.",input:C.object({from:C.object({wallet:C.string().describe("Local wallet name to sign with"),chain:g.describe("Source chain"),token:C.string().describe("Source token address"),amount:C.coerce.number().nullable().describe("Amount to send (exact-in). Null for exact-out.")}),to:C.object({wallet:C.string().nullable().describe("Destination wallet name or address (defaults to from wallet)"),chain:g.describe("Destination chain"),token:C.string().describe("Destination token address"),amount:C.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:C.object({signature:C.string().describe("Transaction hash/signature"),message:C.string().describe("Human-readable bridge description")})});var Fi=[{name:"approve",type:"function",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],ue=c(wt,async e=>{if(!e.from.amount&&!e.to.amount)throw new Error("Provide either from.amount or to.amount.");let t=f(),i=await b.handler({wallet:e.from.wallet}),r=i.addresses[u[e.from.chain]];if(!r)throw new Error(`Wallet "${i.name}" has no address on ${e.from.chain}.`);let n=r;if(e.to.wallet)try{n=(await b.handler({wallet:e.to.wallet})).addresses[u[e.to.chain]]??e.to.wallet}catch{n=e.to.wallet}else e.from.chain!==e.to.chain&&(n=i.addresses[u[e.to.chain]]??r);let o={from:{wallet:r,chain:e.from.chain,token:e.from.token,amount:e.from.amount},to:{wallet:n,chain:e.to.chain,token:e.to.token,amount:e.to.amount}},s=await d(t,"swaps_transaction_build",o),a=s.transaction;if(s.requiresApproval&&"to"in a){let{to:y,chainId:T}=a,$={type:"evm",to:e.from.token,data:Hi({abi:Fi,functionName:"approve",args:[y,BigInt(s.amountIn.raw)]}),value:"0",chainId:T},{transaction:ee}=await v.handler({wallet:i.name,chain:e.from.chain,transaction:JSON.stringify($)}),te=await d(t,"transaction_send",{transaction:ee,message:`Approve ${s.amountIn.symbol}`,chain:e.from.chain});if(!te.signature)throw new Error(`Approval failed: ${te.message}`);process.stderr.write(`Approval sent. Waiting for confirmation...
25
+ `),await new Promise(ve=>setTimeout(ve,5e3)),s=await d(t,"swaps_transaction_build",o)}let l="base64"in s.transaction?s.transaction.base64:JSON.stringify(s.transaction),{transaction:h}=await v.handler({wallet:i.name,chain:e.from.chain,transaction:l}),m=await d(t,"transaction_send",{transaction:h,message:s.message,chain:e.from.chain});if(!m.signature)throw new Error(`Transaction send failed: ${m.message}`);try{await d(t,"transaction_register",{transactionId:s.transactionId,transactionHash:m.signature,chain:e.from.chain})}catch{}return{signature:m.signature,message:s.message}});import{z as I}from"zod";var Pt=p({name:"token_swap",description:"Swap tokens on the same chain. Builds, signs locally, broadcasts, and registers.",input:I.object({wallet:I.string().describe("Local wallet name to sign with"),chain:g.describe("Chain to swap on"),from:I.object({token:I.string().describe("Input token address (selling)"),amount:I.coerce.number().nullable().describe("Amount to sell (exact-in). Null for exact-out.")}),to:I.object({token:I.string().describe("Output token address (buying)"),amount:I.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:I.object({signature:I.string().describe("Transaction hash/signature"),message:I.string().describe("Human-readable swap description")})});var jt=c(Pt,async e=>ue.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 A}from"zod";var Ct=p({name:"token_transfer",description:"Transfer tokens to another wallet on the same chain. Builds, signs locally, and broadcasts.",input:A.object({wallet:A.string().describe("Local wallet name to sign with"),chain:g.describe("Chain to transfer on"),token:A.string().describe("Token address to transfer"),amount:A.coerce.number().describe("Amount to transfer"),to:A.string().describe("Recipient wallet name or address")}),output:A.object({signature:A.string().describe("Transaction hash/signature"),message:A.string().describe("Human-readable transfer description")})});var Tt=c(Ct,async e=>{let t=f(),i=await b.handler({wallet:e.wallet}),r=i.addresses[u[e.chain]];if(!r)throw new Error(`Wallet "${i.name}" has no address on ${e.chain}.`);let n=e.to;try{n=(await b.handler({wallet:e.to})).addresses[u[e.chain]]??e.to}catch{}let o=await d(t,"token_transfer",{wallet:r,token:e.token,to:n,amount:e.amount,chain:e.chain}),s="base64"in o.transaction?o.transaction.base64:JSON.stringify(o.transaction),{transaction:a}=await v.handler({wallet:i.name,chain:e.chain,transaction:s}),l=await d(t,"transaction_send",{transaction:a,message:o.message,chain:e.chain});if(!l.signature)throw new Error(`Transaction send failed: ${l.message}`);return{signature:l.signature,message:o.message}});import{Keypair as Vi,VersionedTransaction as Ki,VersionedMessage as Gi}from"@solana/web3.js";import Dt from"axios";import{wrapAxiosWithPayment as At}from"@x402/axios";import{x402Client as Ut}from"@x402/core/client";import{ExactSvmScheme as Yi}from"@x402/svm";import{registerExactEvmScheme as Ji}from"@x402/evm/exact/client";import{toClientEvmSigner as Zi}from"@x402/evm";import{privateKeyToAccount as Xi}from"viem/accounts";import{createPublicClient as Qi,http as er}from"viem";import*as D from"viem/chains";import{z as S}from"zod";var It=p({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:S.object({method:S.enum(["GET","POST","PUT","PATCH","DELETE"]).describe("HTTP method"),url:S.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:S.record(S.any()).nullable().describe("Request body (for POST, PUT, PATCH)"),params:S.record(S.any()).nullable().describe("Query parameters"),wallet:S.string().describe("Wallet name or address to pay with"),chain:S.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:S.object({status:S.number().describe("HTTP status code"),data:S.any().describe("Response data"),headers:S.record(S.any()).describe("Response headers")})});var tr="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",ir={ethereum:D.mainnet,base:D.base,polygon:D.polygon,arbitrum:D.arbitrum,optimism:D.optimism};function rr(e,t){let i=Vi.fromSecretKey(t),r={address:e,signTransactions:async s=>s.map(a=>{let l=new Uint8Array(a.messageBytes),h=Gi.deserialize(l),m=Object.keys(a.signatures).length,y=new Ki(h,new Array(m).fill(new Uint8Array(64)));y.sign([i]);let T=h.staticAccountKeys.findIndex($=>$.toBase58()===e);if(T===-1)throw new Error(`Wallet ${e} is not a signer for this transaction`);return{[e]:y.signatures[T]}})},n=new Ut,o=new Yi(r);return n.register(tr,o),n.registerV1("solana",o),At(Dt.create(),n)}function nr(e,t){let i=Xi(`0x${Buffer.from(e).toString("hex")}`),r=ir[t]??D.base,n=Qi({chain:r,transport:er()}),o=Zi(i,n),s=new Ut;return Ji(s,{signer:o}),At(Dt.create(),s)}var me=c(It,async({method:e,url:t,body:i,params:r,wallet:n,chain:o})=>{let s=k(n),a=o??"solana",{privateKey:l,address:h}=N(s,a),m=a==="solana"?rr(h,l):nr(l,a),y;switch(e){case"GET":y=await m.get(t,{params:r});break;case"POST":y=await m.post(t,i||{},{params:r});break;case"PUT":y=await m.put(t,i||{},{params:r});break;case"PATCH":y=await m.patch(t,i||{},{params:r});break;case"DELETE":y=await m.delete(t,{params:r});break;default:throw new Error(`Unsupported HTTP method: ${e}`)}return{status:y.status,data:y.data,headers:y.headers}});import{z as F}from"zod";var $t=p({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:g.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")})});function or(e,t){let i=new Date,r=`${String(i.getUTCDate()).padStart(2,"0")}/${String(i.getUTCMonth()+1).padStart(2,"0")}/${i.getUTCFullYear()}`;return`I am verifying ownership of the wallet address ${e} as customer ${t}. This message was signed on ${r} to confirm my control over this wallet.`}var qt=c($t,async e=>{let t=f(),i=e.chain,[r,n]=await Promise.all([b.handler({wallet:e.wallet}),d(t,"virtual-account_retrieve",{})]),o=u[i],s=r.addresses[o];if(!s)throw new Error(`Wallet "${r.name}" has no ${o} address.`);let a=or(s,n.id),{signature:l}=await de.handler({wallet:r.name,chain:i,message:a});return await d(t,"virtual-account_wallet_register",{wallet:s,message:a,signature:l,chain:i}),{success:!0,address:s,chain:i}});import{z as R}from"zod";var xt=p({name:"virtual-account_offramp_initiate",description:"Send stablecoin to an approved offramp. Builds the transfer, signs locally, and broadcasts.",input:R.object({wallet:R.string().describe("Local wallet name to sign with"),offrampId:R.string().describe("The ID of the approved offramp"),amount:R.coerce.number().describe("Amount of stablecoin to send")}),output:R.object({signature:R.string().describe("Transaction hash/signature"),message:R.string().describe("Human-readable transfer description")})});var ar={Solana:"solana",Ethereum:"ethereum",Polygon:"polygon",Base:"base",Arbitrum:"arbitrum"},Rt=c(xt,async e=>{let t=f(),i=await b.handler({wallet:e.wallet}),n=(await d(t,"virtual-account_offramp_retrieve",{offrampId:e.offrampId})).source_currencies[0];if(!n||n.type!=="Crypto")throw new Error("Offramp does not have a valid crypto source currency.");let o=ar[n.blockchain];if(!o)throw new Error(`Unsupported blockchain "${n.blockchain}".`);let s=i.addresses[u[o]];if(!s)throw new Error(`Wallet "${i.name}" has no address on ${o}.`);let a=await d(t,"virtual-account_offramp_initiate",{wallet:s,offrampId:e.offrampId,amount:e.amount}),l="base64"in a.transaction?a.transaction.base64:JSON.stringify(a.transaction),{transaction:h}=await v.handler({wallet:i.name,chain:o,transaction:l}),m=await d(t,"transaction_send",{transaction:h,message:a.message,chain:o});if(!m.signature)throw new Error(`Transaction send failed: ${m.message}`);return{signature:m.signature,message:a.message}});import{z as Q}from"zod";var Et=p({name:"login",description:"Generate a sign-in link. Open it in a browser to get a verification code, then use `mp verify` to complete login.",input:Q.object({email:Q.string().describe("Email address")}),output:Q.object({email:Q.string(),message:Q.string()})});var Ot=c(Et,async e=>{let{baseUrl:t}=ie(),i=`${t}/login?email=${encodeURIComponent(e.email)}`;return{email:e.email,message:`Open this link to verify:
26
+
27
+ ${i}
28
+
29
+ Then run: mp verify --email ${e.email} --code <code>`}});import*as Nt from"fs";import*as Lt from"os";import*as Mt from"path";import{z as V}from"zod";var Bt=p({name:"verify",description:"Verify login code and store encrypted credentials.",input:V.object({email:V.string().describe("Email address"),code:V.string().describe("Verification code")}),output:V.object({email:V.string(),message:V.string()})});var sr=Mt.join(Lt.homedir(),".config","moonpay","consent.json");function pr(){try{return JSON.parse(Nt.readFileSync(sr,"utf-8")).agentId??null}catch{return null}}var Wt=c(Bt,async e=>{let{baseUrl:t}=ie(),i=await Te(t,"verify",{email:e.email,code:e.code}),r={accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:i.expiresAt*1e3,baseUrl:t};je(r);let n=pr();return n&&Oe(n).catch(()=>{}),{email:e.email,message:"Logged in successfully."}});import{z as ye}from"zod";var zt=p({name:"logout",description:"Log out and clear stored credentials.",input:ye.object({}),output:ye.object({success:ye.literal(!0),message:ye.string()})});var Ht=c(zt,async()=>(Ce(),{success:!0,message:"Logged out."}));import{z as U}from"zod";var Ft=p({name:"upgrade",description:"Purchase a rate limit upgrade via x402. Increases your API rate limit. Requires login and a funded wallet.",input:U.object({duration:U.enum(["day","month"]).describe("Upgrade duration: day ($1 USDC, 24h) or month ($20 USDC, 30 days)"),wallet:U.string().describe("Wallet name or address to pay with"),chain:U.enum(["solana","base"]).describe("Chain to pay from. x402 payments accepted on Solana and Base.")}),output:U.object({duration:U.string(),expiresAt:U.string().describe("When the upgrade expires"),message:U.string()})});var Vt=c(Ft,async e=>{if(!await O())throw new Error("Login required to upgrade. Run `mp login` first.");let i=f(),r=await d(i,"user_retrieve",{}),n=await me.handler({method:"POST",url:`${i}/x402/upgrade`,body:{userId:r.id,duration:e.duration},params:null,wallet:e.wallet,chain:e.chain});if(n.status>=400){let o=n.data?.error??"Upgrade failed";throw new Error(o)}return n.data});import{encodeFunctionData as cr,maxUint256 as lr}from"viem";import{z as P}from"zod";var Kt=p({name:"prediction-market_position_buy",description:"Buy shares of a prediction market outcome. Builds, signs locally, and broadcasts.",input:P.object({wallet:P.string().describe("Local wallet name to sign with"),provider:P.enum(["polymarket","kalshi"]).describe("Prediction market provider"),tokenId:P.string().describe("Outcome token ID to buy (from outcomeTokens[].tokenId)"),price:P.number().describe("Price per share (0-1)"),size:P.number().describe("Number of shares to buy"),negRisk:P.boolean().nullable().describe("Whether market uses negative risk framework"),tickSize:P.string().nullable().describe("Market tick size (e.g. '0.01')")}),output:P.object({signature:P.string().nullable().describe("Transaction hash/signature"),orderId:P.string().nullable().describe("Order/transaction ID"),status:P.string().describe("Order status"),message:P.string().describe("Human-readable description")})});var dr={polymarket:"polygon",kalshi:"solana"},ur="0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",mr=[{name:"approve",type:"function",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Gt=c(Kt,async e=>{let t=f(),i=dr[e.provider],r=await b.handler({wallet:e.wallet}),n=r.addresses[u[i]];if(!n)throw new Error(`Wallet "${r.name}" has no address on ${i}.`);let o=await d(t,"prediction-market_position_buy",{provider:e.provider,wallet:n,tokenId:e.tokenId,price:e.price,size:e.size,negRisk:e.negRisk,tickSize:e.tickSize});if(!o.transaction)return{signature:null,orderId:o.orderId,status:o.status,message:`Buy order ${o.status}`};if("to"in o.transaction){let h=o.transaction.to,m={type:"evm",to:ur,data:cr({abi:mr,functionName:"approve",args:[h,lr]}),value:"0",chainId:o.transaction.chainId},{transaction:y}=await v.handler({wallet:r.name,chain:i,transaction:JSON.stringify(m)}),T=await d(t,"transaction_send",{transaction:y,message:"Approve USDC",chain:i});if(!T.signature)throw new Error(`Approval failed: ${T.message}`);process.stderr.write(`USDC approval sent. Waiting for confirmation...
30
+ `),await new Promise($=>setTimeout($,5e3))}let s="base64"in o.transaction?o.transaction.base64:JSON.stringify(o.transaction),{transaction:a}=await v.handler({wallet:r.name,chain:i,transaction:s}),l=await d(t,"transaction_send",{transaction:a,message:`Buy ${e.size} shares at ${e.price}`,chain:i});if(!l.signature)throw new Error(`Transaction send failed: ${l.message}`);return{signature:l.signature,orderId:o.orderId,status:"executed",message:`Bought ${e.size} shares at ${e.price} on ${e.provider}`}});import{z as j}from"zod";var Yt=p({name:"prediction-market_position_sell",description:"Sell shares of a prediction market outcome. Signs locally if needed and broadcasts.",input:j.object({wallet:j.string().describe("Local wallet name to sign with"),provider:j.enum(["polymarket","kalshi"]).describe("Prediction market provider"),tokenId:j.string().describe("Outcome token ID to sell (from outcomeTokens[].tokenId)"),price:j.number().describe("Price per share (0-1)"),size:j.number().describe("Number of shares to sell"),negRisk:j.boolean().nullable().describe("Whether market uses negative risk framework"),tickSize:j.string().nullable().describe("Market tick size (e.g. '0.01')")}),output:j.object({signature:j.string().nullable().describe("Transaction hash/signature"),orderId:j.string().nullable().describe("Order ID"),status:j.string().describe("Order status"),message:j.string().describe("Human-readable description")})});var yr={polymarket:"polygon",kalshi:"solana"},Jt=c(Yt,async e=>{let t=f(),i=yr[e.provider],r=await b.handler({wallet:e.wallet}),n=r.addresses[u[i]];if(!n)throw new Error(`Wallet "${r.name}" has no address on ${i}.`);let o=await d(t,"prediction-market_position_sell",{provider:e.provider,wallet:n,tokenId:e.tokenId,price:e.price,size:e.size,negRisk:e.negRisk,tickSize:e.tickSize});if(!o.transaction)return{signature:o.transactionHashes?.[0]??null,orderId:o.orderId,status:o.status,message:`Sold ${e.size} shares at ${e.price} on ${e.provider}`};let{transaction:s}=await v.handler({wallet:r.name,chain:i,transaction:o.transaction.base64}),a=await d(t,"transaction_send",{transaction:s,message:`Sell ${e.size} shares at ${e.price}`,chain:i});if(!a.signature)throw new Error(`Transaction send failed: ${a.message}`);return{signature:a.signature,orderId:o.orderId,status:"executed",message:`Sold ${e.size} shares at ${e.price} on ${e.provider}`}});var rc=[Ve,Je,Qe,b,rt,ot,st,v,de,mt,bt,kt,St,jt,ue,Tt,me,qt,Rt,ce,He,Ot,Wt,Ht,Vt,Gt,Jt];export{Zt as a,_r as b,$e as c,He as d,rc as e};