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