@moonpay/cli 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-UHPYTDLQ.js → chunk-GJQ5VDB5.js} +1 -1
- package/dist/chunk-RBDBNHEB.js +29 -0
- package/dist/index.js +2 -2
- package/dist/{mcp-A7HG6W4H.js → mcp-2EWJYSQN.js} +1 -1
- package/dist/{store-ZFZAUEFD.js → store-FXTIXNAV.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-QUR7QAZV.js +0 -29
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
import{existsSync as qe,readFileSync as Qe,writeFileSync as Ze,renameSync as et}from"fs";import{join as W}from"path";import{homedir as tt}from"os";import{randomBytes as rt}from"crypto";import{z as c}from"zod";import{randomBytes as P,scryptSync as L,createCipheriv as oe,createDecipheriv as ie}from"crypto";import{z as a}from"zod";var B=2**18,D=8,U=1,j=32,$=512*1024*1024,m=a.object({encryption:a.object({cipher:a.literal("aes-256-gcm"),kdf:a.literal("scrypt"),kdfparams:a.object({n:a.number(),r:a.number(),p:a.number()}),salt:a.string(),iv:a.string(),tag:a.string()}),data:a.string()});function v(e,t){let r=P(32),n=L(t,r,j,{N:B,r:D,p:U,maxmem:$}),o=P(12),s=oe("aes-256-gcm",n,o),f=Buffer.concat([s.update(e,"utf8"),s.final()]);return{encryption:{cipher:"aes-256-gcm",kdf:"scrypt",kdfparams:{n:B,r:D,p:U},salt:r.toString("base64"),iv:o.toString("base64"),tag:s.getAuthTag().toString("base64")},data:f.toString("base64")}}function E(e,t){let{salt:r,iv:n,tag:o,kdfparams:s}=e.encryption,f=L(t,Buffer.from(r,"base64"),j,{N:s.n,r:s.r,p:s.p,maxmem:$}),p=ie("aes-256-gcm",f,Buffer.from(n,"base64"),{authTagLength:16});return p.setAuthTag(Buffer.from(o,"base64")),Buffer.concat([p.update(Buffer.from(e.data,"base64")),p.final()]).toString("utf8")}var ut=c.enum(["solana","ethereum","base","arbitrum","polygon","optimism","bnb","avalanche","bitcoin","tron"]),se=c.enum(["solana","ethereum","bitcoin","tron"]),Y={solana:"solana",ethereum:"ethereum",base:"ethereum",arbitrum:"ethereum",polygon:"ethereum",optimism:"ethereum",bnb:"ethereum",avalanche:"ethereum",bitcoin:"bitcoin",tron:"tron"},H=c.object({solana:c.string().optional(),ethereum:c.string().optional(),bitcoin:c.string().optional(),tron:c.string().optional()}),ce=["base","arbitrum","polygon","optimism","bnb","avalanche"];function dt(e){let t={};if(e.solana&&(t.solana=e.solana),e.ethereum){t.ethereum=e.ethereum;for(let r of ce)t[r]=e.ethereum}return e.bitcoin&&(t.bitcoin=e.bitcoin),e.tron&&(t.tron=e.tron),t}var ae=c.object({name:c.string(),type:c.literal("hd"),mnemonic:c.string(),addresses:H,createdAt:c.string()}),fe=c.object({name:c.string(),type:c.literal("imported"),chain:se,privateKey:c.string(),addresses:H,createdAt:c.string()}),J=c.discriminatedUnion("type",[ae,fe]),mt=c.object({name:c.string(),type:c.enum(["hd","imported"]),addresses:c.record(c.string(),c.string()),createdAt:c.string()});import{execFileSync as k,execSync as we}from"child_process";import{randomBytes as Ke}from"crypto";import{existsSync as ke,readFileSync as _e,writeFileSync as Ae}from"fs";import{homedir as Te,platform as G}from"os";import{join as Oe}from"path";import*as i from"fs";import*as V from"os";import*as C from"path";import{readFileSync as pe}from"fs";import{join as le}from"path";import{homedir as ue}from"os";var de="0.9.
|
|
2
|
+
import{existsSync as qe,readFileSync as Qe,writeFileSync as Ze,renameSync as et}from"fs";import{join as W}from"path";import{homedir as tt}from"os";import{randomBytes as rt}from"crypto";import{z as c}from"zod";import{randomBytes as P,scryptSync as L,createCipheriv as oe,createDecipheriv as ie}from"crypto";import{z as a}from"zod";var B=2**18,D=8,U=1,j=32,$=512*1024*1024,m=a.object({encryption:a.object({cipher:a.literal("aes-256-gcm"),kdf:a.literal("scrypt"),kdfparams:a.object({n:a.number(),r:a.number(),p:a.number()}),salt:a.string(),iv:a.string(),tag:a.string()}),data:a.string()});function v(e,t){let r=P(32),n=L(t,r,j,{N:B,r:D,p:U,maxmem:$}),o=P(12),s=oe("aes-256-gcm",n,o),f=Buffer.concat([s.update(e,"utf8"),s.final()]);return{encryption:{cipher:"aes-256-gcm",kdf:"scrypt",kdfparams:{n:B,r:D,p:U},salt:r.toString("base64"),iv:o.toString("base64"),tag:s.getAuthTag().toString("base64")},data:f.toString("base64")}}function E(e,t){let{salt:r,iv:n,tag:o,kdfparams:s}=e.encryption,f=L(t,Buffer.from(r,"base64"),j,{N:s.n,r:s.r,p:s.p,maxmem:$}),p=ie("aes-256-gcm",f,Buffer.from(n,"base64"),{authTagLength:16});return p.setAuthTag(Buffer.from(o,"base64")),Buffer.concat([p.update(Buffer.from(e.data,"base64")),p.final()]).toString("utf8")}var ut=c.enum(["solana","ethereum","base","arbitrum","polygon","optimism","bnb","avalanche","bitcoin","tron"]),se=c.enum(["solana","ethereum","bitcoin","tron"]),Y={solana:"solana",ethereum:"ethereum",base:"ethereum",arbitrum:"ethereum",polygon:"ethereum",optimism:"ethereum",bnb:"ethereum",avalanche:"ethereum",bitcoin:"bitcoin",tron:"tron"},H=c.object({solana:c.string().optional(),ethereum:c.string().optional(),bitcoin:c.string().optional(),tron:c.string().optional()}),ce=["base","arbitrum","polygon","optimism","bnb","avalanche"];function dt(e){let t={};if(e.solana&&(t.solana=e.solana),e.ethereum){t.ethereum=e.ethereum;for(let r of ce)t[r]=e.ethereum}return e.bitcoin&&(t.bitcoin=e.bitcoin),e.tron&&(t.tron=e.tron),t}var ae=c.object({name:c.string(),type:c.literal("hd"),mnemonic:c.string(),addresses:H,createdAt:c.string()}),fe=c.object({name:c.string(),type:c.literal("imported"),chain:se,privateKey:c.string(),addresses:H,createdAt:c.string()}),J=c.discriminatedUnion("type",[ae,fe]),mt=c.object({name:c.string(),type:c.enum(["hd","imported"]),addresses:c.record(c.string(),c.string()),createdAt:c.string()});import{execFileSync as k,execSync as we}from"child_process";import{randomBytes as Ke}from"crypto";import{existsSync as ke,readFileSync as _e,writeFileSync as Ae}from"fs";import{homedir as Te,platform as G}from"os";import{join as Oe}from"path";import*as i from"fs";import*as V from"os";import*as C from"path";import{readFileSync as pe}from"fs";import{join as le}from"path";import{homedir as ue}from"os";var de="0.9.1",me="X-CLI-Version",ye="X-Agent-Id",y;function he(){if(y!==void 0)return y;try{y=JSON.parse(pe(le(ue(),".config","moonpay","consent.json"),"utf-8")).agentId??null}catch{y=null}return y??null}function M(){let e={"Content-Type":"application/json",[me]:de},t=he();return t&&(e[ye]=t),e}var g=C.join(V.homedir(),".config","moonpay"),N=C.join(g,"config.json"),S=C.join(g,"credentials.json"),h=C.join(g,".credentials.lock"),I={baseUrl:"https://agents.moonpay.com"};function l(){i.existsSync(g)||i.mkdirSync(g,{recursive:!0,mode:448})}function z(e,t,r){let n=e+`.tmp.${process.pid}`;i.writeFileSync(n,t,{encoding:"utf-8",mode:r}),i.renameSync(n,e)}var ge=3e4;function Se(){l();try{let e=i.openSync(h,i.constants.O_CREAT|i.constants.O_EXCL|i.constants.O_WRONLY,384);i.writeSync(e,JSON.stringify({pid:process.pid,ts:Date.now()})),i.closeSync(e)}catch(e){if(e.code!=="EEXIST")throw e;try{let t=JSON.parse(i.readFileSync(h,"utf-8"));if(Date.now()-t.ts<ge)return null}catch{}try{i.unlinkSync(h)}catch{}try{let t=i.openSync(h,i.constants.O_CREAT|i.constants.O_EXCL|i.constants.O_WRONLY,384);i.writeSync(t,JSON.stringify({pid:process.pid,ts:Date.now()})),i.closeSync(t)}catch{return null}}return()=>{try{i.unlinkSync(h)}catch{}}}function X(){if(!i.existsSync(N))return null;try{let e=JSON.parse(i.readFileSync(N,"utf-8"));return e.baseUrl?e:null}catch{return null}}function Et(){let e=X();return e||(Ce(I),I)}function w(){if(!i.existsSync(S))return null;let e=x();if(!e)return null;try{let t=JSON.parse(i.readFileSync(S,"utf-8")),r=m.parse(t),n=E(r,e),o=JSON.parse(n);return!o.accessToken||!o.baseUrl?null:o}catch{return null}}function xe(e){let t=K(),r=v(JSON.stringify(e),t);l(),z(S,JSON.stringify(r,null,2),384)}function Ce(e){l(),z(N,JSON.stringify(e,null,2),384)}function wt(){i.existsSync(S)&&i.unlinkSync(S)}function Kt(){let e=X(),t=w();return e?.baseUrl??t?.baseUrl??I.baseUrl}async function be(e,t,r){let n=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(15e3),headers:M(),body:JSON.stringify(r)}),o=await n.json();if(!n.ok){let s=o;throw new Error(s?.error??`${t} failed (${n.status})`)}return o}async function ve(e){if(!e.refreshToken)throw new Error("No refresh token available");let t=Se();if(!t){await new Promise(n=>setTimeout(n,2e3));let r=w();if(r&&r.expiresAt>Date.now())return r;throw new Error("Token refresh failed (concurrent refresh in progress)")}try{let r=w();if(r&&r.expiresAt>Date.now()+6e4)return r;let n=await be(e.baseUrl,"refresh",{refreshToken:e.refreshToken}),o={accessToken:n.accessToken,refreshToken:n.refreshToken,expiresAt:n.expiresAt*1e3,baseUrl:e.baseUrl};return xe(o),o}finally{t()}}var Ee=300*1e3;async function kt(){let e=w();if(!e)return null;if(Date.now()>=e.expiresAt-Ee){if(e.refreshToken)try{return(await ve(e)).accessToken}catch{return null}return null}return e.accessToken}var u="moonpay-cli",b="encryption-key",_=Oe(Te(),".config","moonpay",".encryption-key");function Ne(e){try{k("security",["delete-generic-password","-s",u,"-a",b],{stdio:"ignore"})}catch{}k("security",["add-generic-password","-s",u,"-a",b,"-w",e],{stdio:"ignore"})}function Ie(){try{return k("security",["find-generic-password","-s",u,"-a",b,"-w"],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function Fe(e){we(`printf '%s' | secret-tool store --label="${u}" service "${u}" account "${b}"`,{input:e,stdio:["pipe","ignore","ignore"]})}function Re(){try{return k("secret-tool",["lookup","service",u,"account",b],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function We(e){l(),Ae(_,e,{encoding:"utf-8",mode:384})}function Pe(){try{return ke(_)&&_e(_,"utf-8").trim()||null}catch{return null}}function Be(e){try{let t=G();return t==="darwin"?(Ne(e),!0):t==="linux"?(Fe(e),!0):!1}catch{return!1}}function De(){let e=G();return e==="darwin"?Ie():e==="linux"?Re():null}function x(){let e=process.env.MOONPAY_ENCRYPTION_KEY;return e||(De()??Pe())}function K(){let e=x();if(e)return e;let t=Ke(32).toString("hex");return Be(t)||(We(t),process.stderr.write("Note: Keychain unavailable. Encryption key stored in "+_+`
|
|
3
3
|
`)),t}import{createHash as q}from"crypto";import{HDKey as F}from"@scure/bip32";import{mnemonicToSeedSync as A}from"@scure/bip39";import{keccak_256 as Q}from"@noble/hashes/sha3";import{derivePath as Ue}from"ed25519-hd-key";import*as Z from"bitcoinjs-lib";import Le from"ecpair";import*as T from"tiny-secp256k1";import{Keypair as je}from"@solana/web3.js";import $e from"bs58";var Ye=Le(T);function O(e,t=0){switch(e){case"solana":return`m/44'/501'/${t}'/0'`;case"ethereum":return`m/44'/60'/${t}'/0/0`;case"bitcoin":return`m/84'/0'/${t}'/0/0`;case"tron":return`m/44'/195'/${t}'/0/0`}}function d(e,t,r=0){switch(t){case"solana":return He(e,r);case"ethereum":return Je(e,r);case"bitcoin":return ze(e,r);case"tron":return Xe(e,r)}}function Yt(e,t=0){return{solana:d(e,"solana",t).address,ethereum:d(e,"ethereum",t).address,bitcoin:d(e,"bitcoin",t).address,tron:d(e,"tron",t).address}}function He(e,t){let r=A(e),n=O("solana",t),{key:o}=Ue(n,Buffer.from(r).toString("hex")),s=je.fromSeed(Uint8Array.from(o));return{privateKey:s.secretKey,address:s.publicKey.toBase58()}}function Je(e,t){let r=A(e),n=F.fromMasterSeed(r),o=O("ethereum",t),s=n.derive(o);if(!s.privateKey)throw new Error("Failed to derive EVM private key");let f=Me(s.publicKey);return{privateKey:s.privateKey,address:f}}function Me(e){let t=T.pointCompress(e,!1),n=ee(t.slice(1)).slice(-20),o="0x"+Buffer.from(n).toString("hex");return Ve(o)}function ee(e){return Q(e)}function Ve(e){let t=e.toLowerCase().replace("0x",""),r=Buffer.from(Q(Buffer.from(t,"utf8"))).toString("hex"),n="0x";for(let o=0;o<t.length;o++)n+=parseInt(r[o],16)>=8?t[o].toUpperCase():t[o];return n}function ze(e,t){let r=A(e),n=F.fromMasterSeed(r),o=O("bitcoin",t),s=n.derive(o);if(!s.privateKey)throw new Error("Failed to derive Bitcoin private key");let f=Ye.fromPrivateKey(Buffer.from(s.privateKey)),{address:p}=Z.payments.p2wpkh({pubkey:Buffer.from(f.publicKey)});if(!p)throw new Error("Failed to derive Bitcoin address");return{privateKey:s.privateKey,address:p}}function Xe(e,t){let r=A(e),n=F.fromMasterSeed(r),o=O("tron",t),s=n.derive(o);if(!s.privateKey)throw new Error("Failed to derive Tron private key");let f=Ge(s.publicKey);return{privateKey:s.privateKey,address:f}}function Ge(e){let t=T.pointCompress(e,!1),n=ee(t.slice(1)).slice(-20),o=Buffer.concat([Buffer.from([65]),Buffer.from(n)]),s=q("sha256").update(o).digest(),f=q("sha256").update(s).digest(),p=Buffer.concat([o,f.slice(0,4)]);return $e.encode(p)}import nt from"bs58";var te=W(tt(),".config","moonpay"),R=W(te,"wallets.json");function re(){if(!qe(R))return[];let e=x();if(!e)throw new Error("Encryption key not found. Set MOONPAY_ENCRYPTION_KEY or ensure OS keychain is accessible.");let t=JSON.parse(Qe(R,"utf-8")),r=m.parse(t),n=E(r,e);return(JSON.parse(n).wallets??[]).map(s=>J.parse(s))}function ot(e){let t=K(),r=JSON.stringify({wallets:e}),n=v(r,t);l();let o=W(te,`.wallets.${rt(4).toString("hex")}.tmp`);Ze(o,JSON.stringify(n,null,2),{mode:384}),et(o,R)}function ne(e){let t=re();e(t),ot(t)}function it(e){let t=re();for(let r of t){if(r.name===e)return r;for(let n of Object.values(r.addresses))if(n===e)return r}return null}function tr(e){let t=it(e);if(!t)throw new Error(`Wallet "${e}" not found`);return t}function rr(e){ne(t=>{if(t.some(r=>r.name===e.name))throw new Error(`Wallet "${e.name}" already exists`);t.push(e)})}function nr(e){ne(t=>{let r=t.findIndex(n=>n.name===e);if(r===-1)throw new Error(`Wallet "${e}" not found`);t.splice(r,1)})}function or(e,t){let r=Y[t];if(e.type==="imported"){if(e.chain!==r)throw new Error(`Wallet "${e.name}" was imported for ${e.chain}, cannot sign for ${t}.`);return{privateKey:st(e.privateKey,r),address:e.addresses[r]}}let n=d(e.mnemonic,r);return{privateKey:n.privateKey,address:n.address}}function st(e,t){if(t==="solana")return nt.decode(e);let r=e.startsWith("0x")?e.slice(2):e;return Uint8Array.from(Buffer.from(r,"hex"))}export{de as a,M as b,l as c,Et as d,w as e,xe as f,wt as g,Kt as h,be as i,ve as j,kt as k,Yt as l,ut as m,Y as n,H as o,dt as p,mt as q,re as r,ot as s,ne as t,it as u,tr as v,rr as w,nr as x,or as y};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{a as ke,b as x,c as ve,d as ee,e as Se,f as we,g as Pe,h as k,i as je,j as Ce,k as R,l as te,m,n as y,o as Te,p as E,q as ie,r as ne,t as Ae,v as b,w as F,x as De,y as $}from"./chunk-GJQ5VDB5.js";async function Ft(e,t,i){let n=await R(),r=x();n&&(r.Authorization=`Bearer ${n}`);let o=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:r,body:JSON.stringify(i)});if(o.status===401&&n){let l=Se();if(l?.refreshToken)try{let f=await Ce(l);o=await fetch(`${e}/api/tools/${encodeURIComponent(t)}`,{method:"POST",signal:AbortSignal.timeout(6e4),headers:{...x(),Authorization:`Bearer ${f.accessToken}`},body:JSON.stringify(i)})}catch{}}if(o.status===401)throw new Error("This command requires a MoonPay CLI account. Run `moonpay login` first.");let a=await o.text();if(!a){if(o.status===429){let l=n?" Run `mp upgrade` to increase your rate limit.":" Log in with `mp login` for higher limits.";throw new Error(`Rate limit exceeded.${l}`)}throw new Error(`Empty response from server (${o.status})`)}let s;try{s=JSON.parse(a)}catch{throw new Error(`Unexpected response from server (${o.status})`)}if(o.status<200||o.status>=300){let l=s;throw new Error(l?.error??`Tool call failed (${o.status})`)}return s}async function d(e,t,i){return await Ft(e,t,i)}var pn=[{name:"buy",description:"Buy crypto with fiat via MoonPay. Returns a checkout URL to complete the purchase.",inputSchema:{$ref:"#/definitions/buy_input",definitions:{buy_input:{type:"object",properties:{token:{type:"string",enum:["btc","pol_polygon","sol","trx","usdc","usdc_arbitrum","usdc_base","usdc_optimism","usdc_sol","usdc_polygon","usdt_trx","eth","eth_polygon","eth_optimism","eth_base","eth_arbitrum"],description:"MoonPay currency code: sol (Solana), usdc_sol (USDC on Solana), eth (Ethereum), usdc (USDC on Ethereum), usdc_base (USDC on Base), trx (TRX on Tron), usdt_trx (USDT on Tron), etc."},amount:{type:"number",description:"Amount in USD to spend. For example, 50 means $50 worth of the selected token."},wallet:{type:"string",description:"Destination wallet address to receive tokens (must match the chain for the selected token)"},email:{type:["string","null"],description:"Buyer email to pre-fill on the checkout page"}},required:["token","amount","wallet","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/buy_output",definitions:{buy_output:{type:"object",properties:{url:{type:"string",description:"MoonPay checkout URL \u2014 open in browser to complete purchase"}},required:["url"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_create",description:"Create a new deposit link that generates multi-chain deposit addresses. Anyone can send crypto to these addresses from Solana, Ethereum, Bitcoin, or Tron \u2014 it automatically converts to the specified stablecoin and settles to the destination wallet and chain.",inputSchema:{$ref:"#/definitions/deposit_create_input",definitions:{deposit_create_input:{type:"object",properties:{name:{type:"string",description:"Human-readable label for this deposit link (e.g. 'Treasury Base USDC')"},wallet:{type:"string",description:"Destination wallet address where USDC will be delivered"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","bnb"],description:"Blockchain of the destination wallet"},token:{type:"string",enum:["USDC","USDC.e","USDT"],description:"Token to receive. USDC.e (bridged USDC) is only available on Polygon."}},required:["name","wallet","chain","token"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_create_output",definitions:{deposit_create_output:{type:"object",properties:{id:{type:"string",description:"Unique deposit ID \u2014 use with deposit_transaction_list to check incoming payments"},destinationWallet:{type:"string",description:"Wallet address that will receive the stablecoin"},destinationChain:{type:"string",description:"Chain where the stablecoin will be delivered"},customerToken:{type:"string",description:"Token to check deposit transactions \u2014 pass to deposit_transaction_list"},depositUrl:{type:"string",description:"Shareable URL \u2014 open in browser or share with senders to deposit funds"},wallets:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address to send funds to"},chain:{type:"string",description:"Chain this address is on (solana, ethereum, bitcoin, tron)"},qrCode:{type:"string",description:"URL to a QR code image for the deposit address"}},required:["address","chain","qrCode"],additionalProperties:!1},description:"Deposit addresses across all supported chains \u2014 send any token to any of these"},instructions:{type:"string",description:"Human-readable instructions explaining how to use the deposit"}},required:["id","destinationWallet","destinationChain","customerToken","depositUrl","wallets","instructions"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_retrieve",description:"Retrieve details of a deposit by ID. Returns the deposit name, status, destination wallet, and deposit addresses.",inputSchema:{$ref:"#/definitions/deposit_retrieve_input",definitions:{deposit_retrieve_input:{type:"object",properties:{id:{type:"string",description:"Deposit ID returned from deposit_create"}},required:["id"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_retrieve_output",definitions:{deposit_retrieve_output:{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string"},destinationWallet:{type:["string","null"]},depositUrl:{type:"string"}},required:["id","name","status","destinationWallet","depositUrl"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"deposit_transaction_list",description:"List transactions for a deposit. Pass the deposit id from deposit_create to check incoming payment status.",inputSchema:{$ref:"#/definitions/deposit_transaction_list_input",definitions:{deposit_transaction_list_input:{type:"object",properties:{id:{type:"string",description:"Deposit ID returned from deposit_create"}},required:["id"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/deposit_transaction_list_output",definitions:{deposit_transaction_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},amount:{type:"number"},token:{type:"string"},from:{type:"string"},status:{type:"string"},settledAmount:{type:["number","null"]},settledCurrency:{type:["string","null"]},timestamp:{type:"string"}},required:["id","amount","token","from","status","settledAmount","settledCurrency","timestamp"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"feedback_create",description:"Submit feedback, a bug report, or a feature request. Requires authentication.",inputSchema:{$ref:"#/definitions/feedback_create_input",definitions:{feedback_create_input:{type:"object",properties:{type:{type:"string",enum:["bug","feature","general"],description:"Type of feedback: bug, feature, or general"},message:{type:"string",minLength:1,maxLength:2e3,description:"Your feedback message"}},required:["type","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/feedback_create_output",definitions:{feedback_create_output:{type:"object",properties:{id:{type:"string",description:"Feedback ID"},message:{type:"string",description:"Confirmation message"}},required:["id","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"login",description:"Send a verification code to the provided email to sign in or create an account. Requires an hCaptcha token.",inputSchema:{$ref:"#/definitions/login_input",definitions:{login_input:{type:"object",properties:{email:{type:"string",format:"email",description:"The email of the user to login"},captchaToken:{type:"string",description:"hCaptcha response token"}},required:["email","captchaToken"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/login_output",definitions:{login_output:{type:"object",properties:{email:{type:"string",description:"The email the OTP was sent to"}},required:["email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_event_retrieve",description:"Get detailed information about a prediction market event including all associated markets, outcomes, and prices.",inputSchema:{$ref:"#/definitions/prediction-market_market_event_retrieve_input",definitions:{"prediction-market_market_event_retrieve_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},slug:{type:"string",description:"Event slug identifier"}},required:["provider","slug"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_event_retrieve_output",definitions:{"prediction-market_market_event_retrieve_output":{type:"object",properties:{id:{type:"string",description:"Event ID"},ticker:{type:"string",description:"Event ticker"},slug:{type:"string",description:"URL slug"},title:{type:"string",description:"Event title"},description:{type:["string","null"],description:"Event description"},subtitle:{type:["string","null"],default:null,description:"Event subtitle"},image:{type:["string","null"],default:null,description:"Event image URL"},icon:{type:["string","null"],default:null,description:"Event icon URL"},category:{type:["string","null"],default:null,description:"Primary category"},subcategory:{type:["string","null"],default:null,description:"Subcategory"},volume:{type:"number",default:0,description:"Total volume in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},openInterest:{type:["number","null"],description:"Open interest in USDC"},liquidity:{type:["number","null"],description:"Available liquidity"},startDate:{type:["string","null"],default:null,description:"Event start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Event end date (ISO)"},closedTime:{type:["string","null"],default:null,description:"Time event was closed (ISO)"},active:{type:"boolean",description:"Whether event is active"},closed:{type:"boolean",description:"Whether event has closed"},featured:{type:["boolean","null"],default:null,description:"Whether event is featured"},commentCount:{type:["number","null"],default:null,description:"Number of comments"},negRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},markets:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Market ID"},question:{type:"string",description:"Market question"},description:{type:["string","null"],default:null,description:"Market description"},conditionId:{type:["string","null"],default:null,description:"Condition ID for on-chain settlement"},slug:{type:"string",description:"URL slug"},image:{type:["string","null"],default:null,description:"Market image URL"},outcomes:{type:"array",items:{type:"string"},description:"Possible outcomes (e.g. ['Yes', 'No'])"},outcomePrices:{type:"array",items:{type:"number"},description:"Current price per outcome (0-1)"},outcomeTokens:{type:"array",items:{type:"object",properties:{outcome:{type:"string",description:"Outcome name (e.g. 'Yes', 'No')"},tokenId:{type:"string",description:"Token identifier \u2014 CLOB token ID (Polymarket/EVM) or mint address (Kalshi/Solana)"},price:{type:["number","null"],default:null,description:"Current price for this outcome (0-1)"}},required:["outcome","tokenId"],additionalProperties:!1},default:[],description:"Token IDs for each outcome \u2014 use these to trade"},volume:{type:"number",default:0,description:"Total volume traded in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},lastTradePrice:{type:["number","null"],default:null,description:"Last trade price"},bestBid:{type:["number","null"],default:null,description:"Best bid price"},bestAsk:{type:["number","null"],default:null,description:"Best ask price"},spread:{type:["number","null"],default:null,description:"Bid-ask spread"},oneDayPriceChange:{type:["number","null"],default:null,description:"24-hour price change"},oneHourPriceChange:{type:["number","null"],default:null,description:"1-hour price change"},oneWeekPriceChange:{type:["number","null"],default:null,description:"1-week price change"},startDate:{type:["string","null"],default:null,description:"Market start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Market end date (ISO)"},negRisk:{type:["boolean","null"],default:null,description:"Whether this uses negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},acceptingOrders:{type:"boolean",description:"Whether market is accepting orders"},enableOrderBook:{type:["boolean","null"],default:null,description:"Whether order book is enabled"},orderMinSize:{type:["number","null"],default:null,description:"Minimum order size"},liquidity:{type:["number","null"],default:null,description:"Available liquidity in USDC"},tickSize:{type:["string","null"],default:null,description:"Minimum price increment"}},required:["id","question","slug","outcomes","outcomePrices","acceptingOrders"],additionalProperties:!1},description:"Markets within this event"},tags:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"Category tags"}},required:["id","ticker","slug","title","description","openInterest","liquidity","active","closed","markets","tags"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_price_history_list",description:"Get historical price data for a prediction market outcome. Use to analyze price trends over time.",inputSchema:{$ref:"#/definitions/prediction-market_market_price_history_list_input",definitions:{"prediction-market_market_price_history_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},tokenId:{type:"string",description:"Outcome token ID (from outcomeTokens[].tokenId)"},interval:{type:"string",enum:["1hr","1d","1w","1m","max"],description:"Time interval: 1hr, 1d (day), 1w (week), 1m (month), or max (all time)"}},required:["provider","tokenId","interval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_price_history_list_output",definitions:{"prediction-market_market_price_history_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{timestamp:{type:"number",description:"Unix timestamp"},price:{type:"number",description:"Price at this time (0-1)"}},required:["timestamp","price"],additionalProperties:!1},description:"Price history data points"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_price_retrieve",description:"Get the current price for a prediction market outcome token.",inputSchema:{$ref:"#/definitions/prediction-market_market_price_retrieve_input",definitions:{"prediction-market_market_price_retrieve_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},tokenId:{type:"string",description:"Outcome token ID (from outcomeTokens[].tokenId)"}},required:["provider","tokenId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_price_retrieve_output",definitions:{"prediction-market_market_price_retrieve_output":{type:"object",properties:{price:{type:["number","null"],description:"Current price (0-1), null if no orders"}},required:["price"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_search",description:"Search prediction markets by query string or tags. Returns events with their markets, prices, and volumes.",inputSchema:{$ref:"#/definitions/prediction-market_market_search_input",definitions:{"prediction-market_market_search_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},query:{type:"string",description:"Search query (use '*' for all markets)"},tagIds:{type:["string","null"],description:"Comma-separated tag IDs to filter by"},limit:{type:["number","null"],description:"Max results (default 10)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"},activeOnly:{type:["boolean","null"],description:"Only show active markets (default true)"}},required:["provider","query","tagIds","limit","page","activeOnly"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_search_output",definitions:{"prediction-market_market_search_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Event ID"},ticker:{type:"string",description:"Event ticker"},slug:{type:"string",description:"URL slug"},title:{type:"string",description:"Event title"},description:{type:["string","null"],description:"Event description"},subtitle:{type:["string","null"],default:null,description:"Event subtitle"},image:{type:["string","null"],default:null,description:"Event image URL"},icon:{type:["string","null"],default:null,description:"Event icon URL"},category:{type:["string","null"],default:null,description:"Primary category"},subcategory:{type:["string","null"],default:null,description:"Subcategory"},volume:{type:"number",default:0,description:"Total volume in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},openInterest:{type:["number","null"],description:"Open interest in USDC"},liquidity:{type:["number","null"],description:"Available liquidity"},startDate:{type:["string","null"],default:null,description:"Event start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Event end date (ISO)"},closedTime:{type:["string","null"],default:null,description:"Time event was closed (ISO)"},active:{type:"boolean",description:"Whether event is active"},closed:{type:"boolean",description:"Whether event has closed"},featured:{type:["boolean","null"],default:null,description:"Whether event is featured"},commentCount:{type:["number","null"],default:null,description:"Number of comments"},negRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},markets:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Market ID"},question:{type:"string",description:"Market question"},description:{type:["string","null"],default:null,description:"Market description"},conditionId:{type:["string","null"],default:null,description:"Condition ID for on-chain settlement"},slug:{type:"string",description:"URL slug"},image:{type:["string","null"],default:null,description:"Market image URL"},outcomes:{type:"array",items:{type:"string"},description:"Possible outcomes (e.g. ['Yes', 'No'])"},outcomePrices:{type:"array",items:{type:"number"},description:"Current price per outcome (0-1)"},outcomeTokens:{type:"array",items:{type:"object",properties:{outcome:{type:"string",description:"Outcome name (e.g. 'Yes', 'No')"},tokenId:{type:"string",description:"Token identifier \u2014 CLOB token ID (Polymarket/EVM) or mint address (Kalshi/Solana)"},price:{type:["number","null"],default:null,description:"Current price for this outcome (0-1)"}},required:["outcome","tokenId"],additionalProperties:!1},default:[],description:"Token IDs for each outcome \u2014 use these to trade"},volume:{type:"number",default:0,description:"Total volume traded in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},lastTradePrice:{type:["number","null"],default:null,description:"Last trade price"},bestBid:{type:["number","null"],default:null,description:"Best bid price"},bestAsk:{type:["number","null"],default:null,description:"Best ask price"},spread:{type:["number","null"],default:null,description:"Bid-ask spread"},oneDayPriceChange:{type:["number","null"],default:null,description:"24-hour price change"},oneHourPriceChange:{type:["number","null"],default:null,description:"1-hour price change"},oneWeekPriceChange:{type:["number","null"],default:null,description:"1-week price change"},startDate:{type:["string","null"],default:null,description:"Market start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Market end date (ISO)"},negRisk:{type:["boolean","null"],default:null,description:"Whether this uses negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},acceptingOrders:{type:"boolean",description:"Whether market is accepting orders"},enableOrderBook:{type:["boolean","null"],default:null,description:"Whether order book is enabled"},orderMinSize:{type:["number","null"],default:null,description:"Minimum order size"},liquidity:{type:["number","null"],default:null,description:"Available liquidity in USDC"},tickSize:{type:["string","null"],default:null,description:"Minimum price increment"}},required:["id","question","slug","outcomes","outcomePrices","acceptingOrders"],additionalProperties:!1},description:"Markets within this event"},tags:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"Category tags"}},required:["id","ticker","slug","title","description","openInterest","liquidity","active","closed","markets","tags"],additionalProperties:!1},description:"Matching events with markets"},hasMore:{type:"boolean",description:"Whether more results exist"}},required:["items","hasMore"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_tag_list",description:"List available prediction market categories and tags for filtering markets.",inputSchema:{$ref:"#/definitions/prediction-market_market_tag_list_input",definitions:{"prediction-market_market_tag_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},limit:{type:["number","null"],description:"Max results (default 50)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"},slug:{type:["string","null"],description:"Filter by tag slug (e.g. 'nfl')"}},required:["provider","limit","page","slug"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_tag_list_output",definitions:{"prediction-market_market_tag_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"List of tags"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"prediction-market_market_trending_list",description:"Get trending prediction markets sorted by 24-hour volume. Minimum $150K 24h volume.",inputSchema:{$ref:"#/definitions/prediction-market_market_trending_list_input",definitions:{"prediction-market_market_trending_list_input":{type:"object",properties:{provider:{type:"string",enum:["polymarket","kalshi"],description:"Prediction market provider"},limit:{type:["number","null"],description:"Max results (default 20)"},page:{type:["number","null"],description:"Page number, starts at 1 (default 1)"}},required:["provider","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/prediction-market_market_trending_list_output",definitions:{"prediction-market_market_trending_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Event ID"},ticker:{type:"string",description:"Event ticker"},slug:{type:"string",description:"URL slug"},title:{type:"string",description:"Event title"},description:{type:["string","null"],description:"Event description"},subtitle:{type:["string","null"],default:null,description:"Event subtitle"},image:{type:["string","null"],default:null,description:"Event image URL"},icon:{type:["string","null"],default:null,description:"Event icon URL"},category:{type:["string","null"],default:null,description:"Primary category"},subcategory:{type:["string","null"],default:null,description:"Subcategory"},volume:{type:"number",default:0,description:"Total volume in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},openInterest:{type:["number","null"],description:"Open interest in USDC"},liquidity:{type:["number","null"],description:"Available liquidity"},startDate:{type:["string","null"],default:null,description:"Event start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Event end date (ISO)"},closedTime:{type:["string","null"],default:null,description:"Time event was closed (ISO)"},active:{type:"boolean",description:"Whether event is active"},closed:{type:"boolean",description:"Whether event has closed"},featured:{type:["boolean","null"],default:null,description:"Whether event is featured"},commentCount:{type:["number","null"],default:null,description:"Number of comments"},negRisk:{type:["boolean","null"],default:null,description:"Negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},markets:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Market ID"},question:{type:"string",description:"Market question"},description:{type:["string","null"],default:null,description:"Market description"},conditionId:{type:["string","null"],default:null,description:"Condition ID for on-chain settlement"},slug:{type:"string",description:"URL slug"},image:{type:["string","null"],default:null,description:"Market image URL"},outcomes:{type:"array",items:{type:"string"},description:"Possible outcomes (e.g. ['Yes', 'No'])"},outcomePrices:{type:"array",items:{type:"number"},description:"Current price per outcome (0-1)"},outcomeTokens:{type:"array",items:{type:"object",properties:{outcome:{type:"string",description:"Outcome name (e.g. 'Yes', 'No')"},tokenId:{type:"string",description:"Token identifier \u2014 CLOB token ID (Polymarket/EVM) or mint address (Kalshi/Solana)"},price:{type:["number","null"],default:null,description:"Current price for this outcome (0-1)"}},required:["outcome","tokenId"],additionalProperties:!1},default:[],description:"Token IDs for each outcome \u2014 use these to trade"},volume:{type:"number",default:0,description:"Total volume traded in USDC"},volume24hr:{type:["number","null"],default:null,description:"24-hour volume in USDC"},volume1wk:{type:["number","null"],default:null,description:"1-week volume in USDC"},volume1mo:{type:["number","null"],default:null,description:"1-month volume in USDC"},volume1yr:{type:["number","null"],default:null,description:"1-year volume in USDC"},lastTradePrice:{type:["number","null"],default:null,description:"Last trade price"},bestBid:{type:["number","null"],default:null,description:"Best bid price"},bestAsk:{type:["number","null"],default:null,description:"Best ask price"},spread:{type:["number","null"],default:null,description:"Bid-ask spread"},oneDayPriceChange:{type:["number","null"],default:null,description:"24-hour price change"},oneHourPriceChange:{type:["number","null"],default:null,description:"1-hour price change"},oneWeekPriceChange:{type:["number","null"],default:null,description:"1-week price change"},startDate:{type:["string","null"],default:null,description:"Market start date (ISO)"},endDate:{type:["string","null"],default:null,description:"Market end date (ISO)"},negRisk:{type:["boolean","null"],default:null,description:"Whether this uses negative risk framework"},negRiskMarketID:{type:["string","null"],default:null,description:"Negative risk market ID"},acceptingOrders:{type:"boolean",description:"Whether market is accepting orders"},enableOrderBook:{type:["boolean","null"],default:null,description:"Whether order book is enabled"},orderMinSize:{type:["number","null"],default:null,description:"Minimum order size"},liquidity:{type:["number","null"],default:null,description:"Available liquidity in USDC"},tickSize:{type:["string","null"],default:null,description:"Minimum price increment"}},required:["id","question","slug","outcomes","outcomePrices","acceptingOrders"],additionalProperties:!1},description:"Markets within this event"},tags:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Tag ID"},label:{type:"string",description:"Human-readable tag label"},slug:{type:"string",description:"URL-safe tag slug"},category:{type:["string","null"],default:null,description:"Parent category"}},required:["id","label","slug"],additionalProperties:!1},description:"Category tags"}},required:["id","ticker","slug","title","description","openInterest","liquidity","active","closed","markets","tags"],additionalProperties:!1},description:"Trending events"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"refresh",description:"Refresh an expired access token using a refresh token.",inputSchema:{$ref:"#/definitions/refresh_input",definitions:{refresh_input:{type:"object",properties:{refreshToken:{type:"string",description:"The refresh token from a previous login"}},required:["refreshToken"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/refresh_output",definitions:{refresh_output:{type:"object",properties:{accessToken:{type:"string"},refreshToken:{type:"string"},expiresAt:{type:"number"}},required:["accessToken","refreshToken","expiresAt"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"swaps_transaction_build",description:"Build a swap or bridge transaction. Returns an unsigned transaction with a human-readable message, amounts, exchange rate, and estimated time. Supports same-chain swaps and cross-chain bridges. Accepts UI amounts (e.g. 0.1 SOL) \u2014 decimal conversion is handled automatically.",inputSchema:{$ref:"#/definitions/swaps_transaction_build_input",definitions:{swaps_transaction_build_input:{type:"object",properties:{from:{type:"object",properties:{wallet:{type:"string",description:"Source wallet address (Solana pubkey or EVM 0x address)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Source blockchain"},token:{type:"string",description:"Source token address (mint on Solana, contract on EVM). Use native token address for SOL/ETH."},amount:{type:["number","null"],description:"Amount to swap (exact-in). Null for exact-out."}},required:["wallet","chain","token","amount"],additionalProperties:!1,description:"Source: wallet, chain, token, amount"},to:{type:"object",properties:{wallet:{type:"string",description:"Destination wallet address. Same as source wallet for same-chain swaps."},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Destination blockchain"},token:{type:"string",description:"Destination token address (mint on Solana, contract on EVM)"},amount:{type:["number","null"],description:"Amount to receive (exact-out). Null for exact-in."}},required:["wallet","chain","token","amount"],additionalProperties:!1,description:"Destination: wallet, chain, token, amount"}},required:["from","to"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/swaps_transaction_build_output",definitions:{swaps_transaction_build_output:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID for tracking"},transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Contract address"},data:{type:"string",description:"Calldata"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"tron"},rawDataHex:{type:"string",description:"Hex-encoded raw transaction data for signing"}},required:["type","rawDataHex"],additionalProperties:!1}],description:"Unsigned transaction"},message:{type:"string",description:"Human-readable description (e.g. Swap 0.1 SOL \u2192 42.5 USDC on Solana)"},amountIn:{type:"object",properties:{amount:{type:"number",description:"Human-readable amount (e.g. 1.5)"},raw:{type:"string",description:"Raw amount in smallest unit (e.g. wei, lamports)"},symbol:{type:"string"},usd:{type:["number","null"]}},required:["amount","raw","symbol","usd"],additionalProperties:!1},amountOut:{type:"object",properties:{amount:{type:"number",description:"Human-readable amount (e.g. 1.5)"},raw:{type:"string",description:"Raw amount in smallest unit (e.g. wei, lamports)"},symbol:{type:"string"},usd:{type:["number","null"]}},required:["amount","raw","symbol","usd"],additionalProperties:!1},exchangeRate:{type:"number",description:"Exchange rate (amountOut / amountIn)"},estimatedTime:{type:["number","null"],description:"Estimated completion time in seconds"},requiresApproval:{type:"boolean",description:"Whether an ERC20 approval transaction is needed first"}},required:["transactionId","transaction","message","amountIn","amountOut","exchangeRate","estimatedTime","requiresApproval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_balance_list",description:"List all token balances held in a wallet, including amount owned, current value in USD, and token details. Shows the complete token portfolio.",inputSchema:{$ref:"#/definitions/token_balance_list_input",definitions:{token_balance_list_input:{type:"object",properties:{wallet:{type:"string",description:"Wallet address to check token balances for"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to check balances on (e.g. 'solana', 'ethereum', 'base')"}},required:["wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_balance_list_output",definitions:{token_balance_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},balance:{type:"object",properties:{amount:{type:"number",description:"Number of tokens owned"},value:{type:"number",description:"Total value of the token in USD"},price:{type:"number",description:"Current price of the token"}},required:["amount","value","price"],additionalProperties:!1}},required:["address","name","symbol","chain","decimals","balance"],additionalProperties:!1},description:"Array of all tokens in the wallet with their balances and current values"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_retrieve",description:"Get detailed token information including market data, price changes, volume, trades, and holder statistics by token address",inputSchema:{$ref:"#/definitions/token_retrieve_input",definitions:{token_retrieve_input:{type:"object",properties:{token:{type:"string",description:"Address of the token to retrieve"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain network where the token exists"}},required:["token","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_retrieve_output",definitions:{token_retrieve_output:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_search",description:"Search for tokens by name, symbol, or address. Returns matching tokens with their market data including price, volume, and liquidity.",inputSchema:{$ref:"#/definitions/token_search_input",definitions:{token_search_input:{type:"object",properties:{query:{type:"string",description:"Search term - can be token name (e.g. 'Bitcoin'), symbol (e.g. 'BTC'), or partial match"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to search on (e.g. 'solana', 'ethereum', 'base')"},limit:{type:["number","null"],description:"Maximum number of results to return (optional, defaults to 5)"}},required:["query","chain","limit"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_search_output",definitions:{token_search_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1},description:"Array of tokens matching the search query with their market data"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_transfer",description:"Build an unsigned transfer transaction. Returns a transaction ready for signing. Handles both native and token transfers.",inputSchema:{$ref:"#/definitions/token_transfer_input",definitions:{token_transfer_input:{type:"object",properties:{wallet:{type:"string",description:"Sender wallet address (Solana pubkey or EVM 0x address)"},token:{type:"string",description:"Token address (mint on Solana, contract on EVM). Use native token address for SOL/ETH."},to:{type:"string",description:"Recipient wallet address or name"},amount:{type:"number",description:"Amount to transfer in human-readable units (e.g. 1.5)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to execute the transfer on"}},required:["wallet","token","to","amount","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_transfer_output",definitions:{token_transfer_output:{type:"object",properties:{transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Recipient or contract address"},data:{type:"string",description:"Calldata (0x for native transfers)"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"tron"},rawDataHex:{type:"string",description:"Hex-encoded raw transaction data for signing"}},required:["type","rawDataHex"],additionalProperties:!1}]},message:{type:"string",description:"Human-readable description of the transfer"},requiresApproval:{type:"boolean",description:"Whether a token approval transaction is needed first"}},required:["transaction","message","requiresApproval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"token_trending_list",description:"Get currently trending tokens on a blockchain. Perfect for discovering what's hot right now.",inputSchema:{$ref:"#/definitions/token_trending_list_input",definitions:{token_trending_list_input:{type:"object",properties:{chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to get trending tokens from (e.g. 'solana', 'ethereum', 'base')"},limit:{type:"integer",minimum:1,description:"Number of results per page"},page:{type:"integer",minimum:1,description:"Page number (starts at 1)"}},required:["chain","limit","page"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/token_trending_list_output",definitions:{token_trending_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{address:{type:"string",description:"Address of the token"},name:{type:"string",description:"Name of the token"},symbol:{type:"string",description:"Symbol of the token"},image:{type:["string","null"],description:"Image of the token"},description:{type:["string","null"],description:"Description of the token"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain of the token"},decimals:{type:"number",description:"Number of decimals of the token"},externalLinks:{anyOf:[{type:"object",properties:{website:{type:["string","null"],description:"Official website URL"},twitter:{type:["string","null"],description:"Twitter/X profile URL"},telegram:{type:["string","null"],description:"Telegram group URL"},discord:{type:["string","null"],description:"Discord server URL"},github:{type:["string","null"],description:"GitHub repository URL"},coingeckoId:{type:["string","null"],description:"CoinGecko token ID"}},additionalProperties:!1},{type:"null"}],description:"External links and social media"},marketData:{type:"object",properties:{liquidity:{type:["number","null"],description:"Total liquidity"},marketCap:{type:["number","null"],description:"Market capitalization"},fdv:{type:["number","null"],description:"Fully diluted valuation"},price:{type:["number","null"],description:"Current price"},priceChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in price across time intervals"},volume:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Trading volume in USD across time intervals"},volumeChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in trading volume across time intervals"},trades:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of trades across time intervals"},tradesChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of trades across time intervals"},buys:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of buys across time intervals"},buysChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of buys across time intervals"},sells:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of sells across time intervals"},sellsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of sells across time intervals"},uniqueWallets:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Number of unique wallets trading across time intervals"},uniqueWalletsChangePercent:{type:"object",properties:{"1m":{type:["number","null"],description:"1-minute data"},"5m":{type:["number","null"],description:"5-minute data"},"30m":{type:["number","null"],description:"30-minute data"},"1h":{type:["number","null"],description:"1-hour data"},"2h":{type:["number","null"],description:"2-hour data"},"4h":{type:["number","null"],description:"4-hour data"},"6h":{type:["number","null"],description:"6-hour data"},"8h":{type:["number","null"],description:"8-hour data"},"12h":{type:["number","null"],description:"12-hour data"},"24h":{type:["number","null"],description:"24-hour data"}},additionalProperties:!1,description:"Percentage change in number of unique wallets trading across time intervals"}},additionalProperties:!1}},required:["address","name","symbol","chain","decimals"],additionalProperties:!1},description:"Array of trending tokens with their market data"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_list",description:"List swap and bridge transaction history for a wallet.",inputSchema:{$ref:"#/definitions/transaction_list_input",definitions:{transaction_list_input:{type:"object",properties:{wallet:{type:"string",description:"Wallet address that signed and sent the transactions"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Chain the wallet is on"}},required:["wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_list_output",definitions:{transaction_list_output:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{transactionId:{type:"string",description:"Transaction tracking ID"},status:{type:"string",description:"Current status: pending, success, or failed"},type:{type:"string",enum:["swap","bridge"],description:"Transaction type"},from:{type:"object",properties:{chain:{type:"string",description:"Source blockchain"},token:{type:"string",description:"Source token symbol"},amount:{type:["number","null"],description:"Amount sent"},txHash:{type:"string",description:"Source chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},to:{type:"object",properties:{chain:{type:"string",description:"Destination blockchain"},token:{type:"string",description:"Destination token symbol"},amount:{type:["number","null"],description:"Amount received"},txHash:{type:["string","null"],description:"Destination chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},usd:{type:["number","null"],description:"USD value of the transaction"},bridgeTime:{type:["number","null"],description:"Bridge completion time in seconds"}},required:["transactionId","status","type","from","to","usd","bridgeTime"],additionalProperties:!1},description:"List of swap/bridge transactions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_register",description:"Register a broadcast transaction for tracking. Call after transaction_send to enable status tracking via transaction_retrieve.",inputSchema:{$ref:"#/definitions/transaction_register_input",definitions:{transaction_register_input:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID from the swap build step"},transactionHash:{type:"string",description:"Transaction hash/signature after broadcasting"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain where the transaction was broadcast"}},required:["transactionId","transactionHash","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_register_output",definitions:{transaction_register_output:{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_retrieve",description:"Get the status and details of a transaction by its ID.",inputSchema:{$ref:"#/definitions/transaction_retrieve_input",definitions:{transaction_retrieve_input:{type:"object",properties:{transactionId:{type:"string",description:"Transaction ID from swap build or transaction register"}},required:["transactionId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_retrieve_output",definitions:{transaction_retrieve_output:{type:"object",properties:{transactionId:{type:"string",description:"Transaction tracking ID"},status:{type:"string",description:"Current status: pending, success, or failed"},type:{type:"string",enum:["swap","bridge"],description:"Transaction type"},from:{type:"object",properties:{chain:{type:"string",description:"Source blockchain"},token:{type:"string",description:"Source token symbol"},amount:{type:["number","null"],description:"Amount sent"},txHash:{type:"string",description:"Source chain transaction hash"}},required:["chain","token","amount","txHash"],additionalProperties:!1},to:{type:"object",properties:{chain:{type:"string",description:"Destination blockchain"},token:{type:"string",description:"Destination token symbol"},amount:{type:["number","null"],description:"Amount received"},txHash:{type:["string","null"],description:"Destination chain transaction hash. Null while bridge is in progress."}},required:["chain","token","amount","txHash"],additionalProperties:!1},usd:{type:["number","null"],description:"USD value of the transaction"},bridgeTime:{type:["number","null"],description:"Bridge completion time in seconds. Null for same-chain swaps."}},required:["transactionId","status","type","from","to","usd","bridgeTime"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"transaction_send",description:"Broadcast a signed transaction to the network. Supports Solana, EVM chains, Bitcoin, and Tron.",inputSchema:{$ref:"#/definitions/transaction_send_input",definitions:{transaction_send_input:{type:"object",properties:{transaction:{type:"string",description:"Signed transaction: base64-encoded for Solana, hex-encoded (0x...) for EVM, raw hex for Bitcoin, JSON {raw_data_hex, signature} for Tron"},message:{type:"string",description:"Human-readable message describing the transaction"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to broadcast on"}},required:["transaction","message","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/transaction_send_output",definitions:{transaction_send_output:{type:"object",properties:{signature:{type:"string",description:"Transaction signature/hash. Absent if broadcast failed."},message:{type:"string",description:"Result message or error description"}},required:["message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"user_retrieve",description:"Get the currently authenticated user",inputSchema:{$ref:"#/definitions/user_retrieve_input",definitions:{user_retrieve_input:{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/user_retrieve_output",definitions:{user_retrieve_output:{type:"object",properties:{id:{type:"string",description:"User ID"},email:{type:["string","null"],description:"User email address"}},required:["id","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"verify",description:"Verify a login code for the user.",inputSchema:{$ref:"#/definitions/verify_input",definitions:{verify_input:{type:"object",properties:{code:{type:"string",pattern:"^\\d{6}$",description:"The code to verify"},email:{type:"string",format:"email",description:"The email the OTP was sent to"}},required:["code","email"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/verify_output",definitions:{verify_output:{type:"object",properties:{accessToken:{type:"string"},refreshToken:{type:"string"},expiresAt:{type:"number"}},required:["accessToken","refreshToken","expiresAt"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_agreement_accept",description:"Accept a required legal agreement. Pass the content ID from virtual-account_agreement_list to mark the agreement as accepted.",inputSchema:{$ref:"#/definitions/virtual-account_agreement_accept_input",definitions:{"virtual-account_agreement_accept_input":{type:"object",properties:{contentId:{type:"string",description:"Content ID from virtual-account_agreement_list"}},required:["contentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_agreement_accept_output",definitions:{"virtual-account_agreement_accept_output":{type:"object",properties:{id:{type:"string",description:"Signing record ID"},contentId:{type:["string","null"],description:"Content ID of the accepted agreement"},documentId:{type:["string","null"],description:"Document ID"}},required:["id","contentId","documentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_agreement_list",description:"List legal agreements. By default shows pending agreements that must be accepted to activate the account. Use status=accepted to see previously accepted agreements.",inputSchema:{$ref:"#/definitions/virtual-account_agreement_list_input",definitions:{"virtual-account_agreement_list_input":{type:"object",properties:{status:{anyOf:[{type:"string",enum:["pending","accepted"]},{type:"null"}],description:"Filter: pending (need to accept, default) or accepted (already signed)"},country:{type:["string","null"],description:"Country code for terms (e.g. USA, GBR). Defaults to USA."}},required:["status","country"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_agreement_list_output",definitions:{"virtual-account_agreement_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Content ID \u2014 pass to virtual-account_agreement_accept to accept"},name:{type:"string",description:"Document name (e.g. 'USA Terms and Conditions')"},url:{type:"string",description:"URL to view the document"}},required:["id","name","url"],additionalProperties:!1},description:"List of agreements"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_bank-account_delete",description:"Delete a bank account",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_delete_input",definitions:{"virtual-account_bank-account_delete_input":{type:"object",properties:{bankAccountId:{type:"string",format:"uuid",description:"The ID of the bank account to delete"}},required:["bankAccountId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_delete_output",definitions:{"virtual-account_bank-account_delete_output":{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_bank-account_list",description:"List registered bank accounts",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_list_input",definitions:{"virtual-account_bank-account_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_list_output",definitions:{"virtual-account_bank-account_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},bank_account_identifier:{anyOf:[{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"}},required:["type","iban"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"ACH"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Wire"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1}]},bank_name:{type:"string"},country:{type:"string"},created_at:{type:"string",format:"date-time"},currency:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"},customer_id:{type:"string"},is_third_party:{type:"boolean"},label:{type:["string","null"]},ownership_verified:{type:"boolean"},status:{type:"string",enum:["AuthorizationRequired","AuthorizationFailed","RegistrationPending","RegistrationFailed","Registered"]},updated_at:{type:"string",format:"date-time"}},required:["id","bank_account_identifier","bank_name","country","created_at","currency","customer_id","is_third_party","label","ownership_verified","status","updated_at"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_bank-account_register",description:"Register a bank account for offramp payouts. USD accounts use ACH/Wire with account+routing numbers. EUR accounts use SEPA with IBAN.",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_register_input",definitions:{"virtual-account_bank-account_register_input":{type:"object",properties:{currency:{type:"string",enum:["USD","EUR"],description:"Currency of the bank account (USD or EUR)"},type:{type:"string",enum:["ACH","Wire","SEPA"],description:"Account type: ACH or Wire for USD, SEPA for EUR"},accountNumber:{type:["string","null"],description:"Account number (required for USD ACH/Wire)"},routingNumber:{type:["string","null"],description:"Routing number (required for USD ACH/Wire)"},iban:{type:["string","null"],description:"IBAN (required for EUR SEPA)"},address:{type:"object",properties:{street:{type:"string",description:"Street address"},city:{type:"string",description:"City"},state:{type:"string",description:"State or province"},country:{type:"string",enum:["US","GB","CA","AU","DE","FR","IT","ES","NL","BE","AT","CH","SE","NO","DK","FI","IE","PT","PL","CZ","GR","JP","KR","CN","IN","BR","MX","AR","ZA","NZ","SG","HK","AE"],description:"ISO 3166-1 Alpha-2 country code"},postalCode:{type:"string",description:"Postal or ZIP code"}},required:["street","city","state","country","postalCode"],additionalProperties:!1,description:"Address of the account holder"},email:{type:"string",description:"Email address of the account holder"},phoneNumber:{type:"string",description:"Phone number of the account holder"},providerCountry:{type:"string",enum:["US","GB","CA","AU","DE","FR","IT","ES","NL","BE","AT","CH","SE","NO","DK","FI","IE","PT","PL","CZ","GR","JP","KR","CN","IN","BR","MX","AR","ZA","NZ","SG","HK","AE"],description:"ISO 3166-1 Alpha-2 country code where the bank is located"},providerName:{type:"string",description:"Name of the bank"},givenName:{type:"string",description:"First/given name of the account holder"},familyName:{type:"string",description:"Last/family name of the account holder"}},required:["currency","type","accountNumber","routingNumber","iban","address","email","phoneNumber","providerCountry","providerName","givenName","familyName"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_register_output",definitions:{"virtual-account_bank-account_register_output":{type:"object",properties:{id:{type:"string"},bank_account_identifier:{anyOf:[{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"}},required:["type","iban"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"ACH"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Wire"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1}]},bank_name:{type:"string"},country:{type:"string"},created_at:{type:"string",format:"date-time"},currency:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"},customer_id:{type:"string"},is_third_party:{type:"boolean"},label:{type:["string","null"]},ownership_verified:{type:"boolean"},status:{type:"string",enum:["AuthorizationRequired","AuthorizationFailed","RegistrationPending","RegistrationFailed","Registered"]},updated_at:{type:"string",format:"date-time"}},required:["id","bank_account_identifier","bank_name","country","created_at","currency","customer_id","is_third_party","label","ownership_verified","status","updated_at"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_bank-account_retrieve",description:"Get a bank account by ID",inputSchema:{$ref:"#/definitions/virtual-account_bank-account_retrieve_input",definitions:{"virtual-account_bank-account_retrieve_input":{type:"object",properties:{bankAccountId:{type:"string",description:"Bank account ID"}},required:["bankAccountId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_bank-account_retrieve_output",definitions:{"virtual-account_bank-account_retrieve_output":{type:"object",properties:{id:{type:"string"},bank_account_identifier:{anyOf:[{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"}},required:["type","iban"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"ACH"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Wire"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","routing_number"],additionalProperties:!1}]},bank_name:{type:"string"},country:{type:"string"},created_at:{type:"string",format:"date-time"},currency:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"},customer_id:{type:"string"},is_third_party:{type:"boolean"},label:{type:["string","null"]},ownership_verified:{type:"boolean"},status:{type:"string",enum:["AuthorizationRequired","AuthorizationFailed","RegistrationPending","RegistrationFailed","Registered"]},updated_at:{type:"string",format:"date-time"}},required:["id","bank_account_identifier","bank_name","country","created_at","currency","customer_id","is_third_party","label","ownership_verified","status","updated_at"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_create",description:"Create a virtual account and start KYC verification",inputSchema:{$ref:"#/definitions/virtual-account_create_input",definitions:{"virtual-account_create_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_create_output",definitions:{"virtual-account_create_output":{type:"object",properties:{id:{type:"string"},email:{type:"string"},customerType:{type:"string",enum:["Person","Business"]},status:{type:"string",enum:["UserRequired","SigningsRequired","IdentificationRequired","Active","Suspended"]},nextStep:{type:["string","null"]}},required:["id","email","customerType","status","nextStep"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_kyc_continue",description:"Get the current KYC verification status and URL. Use this to check progress or get the verification link again.",inputSchema:{$ref:"#/definitions/virtual-account_kyc_continue_input",definitions:{"virtual-account_kyc_continue_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_kyc_continue_output",definitions:{"virtual-account_kyc_continue_output":{type:"object",properties:{id:{type:"string",description:"Identification record ID"},status:{type:"string",enum:["Pending","Processed","PendingReview","Approved","Declined","Expired"],description:"KYC status: Pending, Processed, PendingReview, Approved, Declined, or Expired"},url:{type:["string","null"],description:"URL to complete KYC verification. Null if already submitted."}},required:["id","status","url"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_kyc_restart",description:"Restart KYC verification. Creates a fresh verification link. Only available when account status is IdentificationRequired.",inputSchema:{$ref:"#/definitions/virtual-account_kyc_restart_input",definitions:{"virtual-account_kyc_restart_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_kyc_restart_output",definitions:{"virtual-account_kyc_restart_output":{type:"object",properties:{id:{type:"string",description:"Identification record ID"},status:{type:"string",enum:["Pending","Processed","PendingReview","Approved","Declined","Expired"],description:"KYC status: Pending, Processed, PendingReview, Approved, Declined, or Expired"},url:{type:["string","null"],description:"URL to complete KYC verification. Null if already submitted."},message:{type:["string","null"],description:"Instructions for the user"}},required:["id","status","url","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_cancel",description:"Cancel an offramp",inputSchema:{$ref:"#/definitions/virtual-account_offramp_cancel_input",definitions:{"virtual-account_offramp_cancel_input":{type:"object",properties:{offrampId:{type:"string",format:"uuid",description:"The ID of the offramp to cancel"}},required:["offrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_cancel_output",definitions:{"virtual-account_offramp_cancel_output":{type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_create",description:"Create an offramp to convert stablecoin to fiat",inputSchema:{$ref:"#/definitions/virtual-account_offramp_create_input",definitions:{"virtual-account_offramp_create_input":{type:"object",properties:{name:{type:"string",description:"The name of the offramp"},bankAccountId:{type:"string",description:"Bank account ID to receive fiat. Get from `bank-account list`."},stablecoin:{type:"string",enum:["USDC","USDT","EURC"],description:"The stablecoin token to convert from"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain the stablecoin is on (solana, ethereum, polygon, arbitrum, base)"}},required:["name","bankAccountId","stablecoin","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_create_output",definitions:{"virtual-account_offramp_create_output":{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_initiate",description:"Build an unsigned transaction to send stablecoin to an offramp deposit address",inputSchema:{$ref:"#/definitions/virtual-account_offramp_initiate_input",definitions:{"virtual-account_offramp_initiate_input":{type:"object",properties:{wallet:{type:"string",description:"The wallet address to send from"},offrampId:{type:"string",description:"The ID of the offramp to initiate"},amount:{type:"number",minimum:0,description:"The amount of stablecoin to send (in human-readable units, e.g., 100.5)"}},required:["wallet","offrampId","amount"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_initiate_output",definitions:{"virtual-account_offramp_initiate_output":{type:"object",properties:{transaction:{anyOf:[{type:"object",properties:{type:{type:"string",const:"solana"},base64:{type:"string",description:"Base64-encoded transaction"}},required:["type","base64"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"evm"},to:{type:"string",description:"Recipient or contract address"},data:{type:"string",description:"Calldata (0x for native transfers)"},value:{type:"string",description:"Native token value in wei"},chainId:{type:"number",description:"EVM chain ID"}},required:["type","to","data","value","chainId"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"tron"},rawDataHex:{type:"string",description:"Hex-encoded raw transaction data for signing"}},required:["type","rawDataHex"],additionalProperties:!1}]},message:{type:"string",description:"Human-readable description of the transfer"},requiresApproval:{type:"boolean",description:"Whether a token approval transaction is needed first"}},required:["transaction","message","requiresApproval"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_list",description:"List all offramps",inputSchema:{$ref:"#/definitions/virtual-account_offramp_list_input",definitions:{"virtual-account_offramp_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_list_output",definitions:{"virtual-account_offramp_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_retrieve",description:"Get offramp details",inputSchema:{$ref:"#/definitions/virtual-account_offramp_retrieve_input",definitions:{"virtual-account_offramp_retrieve_input":{type:"object",properties:{offrampId:{type:"string",format:"uuid",description:"The ID of the offramp to retrieve"}},required:["offrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_retrieve_output",definitions:{"virtual-account_offramp_retrieve_output":{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_offramp_update",description:"Update an existing offramp's destination bank account or fiat currency.",inputSchema:{$ref:"#/definitions/virtual-account_offramp_update_input",definitions:{"virtual-account_offramp_update_input":{type:"object",properties:{offrampId:{type:"string",description:"The ID of the offramp to update"},bankAccountId:{type:"string",description:"New bank account ID. Get from `bank-account list`."}},required:["offrampId","bankAccountId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_offramp_update_output",definitions:{"virtual-account_offramp_update_output":{type:"object",properties:{created_at:{type:"string",format:"date-time"},deposit_account:{anyOf:[{anyOf:[{type:"object",properties:{type:{type:"string",const:"ACHWire"},account_number:{type:"string"},bank_address:{type:"string"},bank_name:{type:"string"},recipient_address:{type:"string"},recipient_name:{type:"string"},routing_number:{type:"string"}},required:["type","account_number","bank_address","bank_name","recipient_address","recipient_name","routing_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"AfricanBankTransfer"},account_name:{type:"string"},account_number:{type:"string"},amount:{type:"string"},bank_name:{type:"string"},currency:{type:"string"},financial_institution:{type:"string"}},required:["type","account_name","account_number","amount","bank_name","currency","financial_institution"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Crypto"},address:{type:"string"},chain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]}},required:["type","address","chain"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"MobileMoney"},instruction:{type:"string"},mobile_number:{type:"string"}},required:["type","mobile_number"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Pix"},instruction:{type:"string"},pix_key:{type:"string"}},required:["type","instruction","pix_key"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"SEPA"},iban:{type:"string"},address:{type:"string"},beneficiary_name:{type:["string","null"]},bic:{type:"string"},name:{type:"string"},phone:{type:"string"}},required:["type","iban","beneficiary_name"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Spei"},clabe:{type:"string"},instruction:{type:"string"}},required:["type","clabe","instruction"],additionalProperties:!1}]},{type:"null"}]},destination_currency:{anyOf:[{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",const:"Fiat"},code:{type:"string",enum:["USD","EUR"],description:"Fiat currency code. USD: US Dollar, EUR: Euro"}},required:["type","code"],additionalProperties:!1}]},id:{type:"string",description:"The ID of the autoramp"},name:{type:"string"},recipient:{type:"object",properties:{type:{type:"string",const:"BankAccount"},provider_name:{type:"string"},provider_country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},is_third_party:{type:"boolean"},account_identifier:{type:"object",properties:{type:{type:"string",enum:["SEPA","ACH","Wire"]},iban:{type:"string"},account_number:{type:"string"},routing_number:{type:"string"}},required:["type"],additionalProperties:!1},address:{type:"object",properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"object",properties:{code:{type:"string",minLength:2,maxLength:2}},required:["code"],additionalProperties:!1},postal_code:{type:"string"}},required:["street","city","state","country","postal_code"],additionalProperties:!1},recipient:{type:"object",properties:{type:{type:"string",enum:["Individual","Business"]},family_name:{type:"string"},given_name:{type:"string"},name:{type:"string"}},required:["type"],additionalProperties:!1}},required:["type","provider_name","provider_country","is_third_party","account_identifier","address","recipient"],additionalProperties:!1},source:{type:"string",enum:["Standalone","Quote"]},source_currencies:{type:"array",items:{type:"object",properties:{type:{type:"string",const:"Crypto"},blockchain:{type:"string",enum:["Solana","Ethereum","Polygon","Arbitrum","Base","Stellar","Citrea"]},token:{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"}},required:["type","blockchain","token"],additionalProperties:!1}},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]}},required:["created_at","deposit_account","destination_currency","id","name","recipient","source","source_currencies","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_cancel",description:"Cancel an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_cancel_input",definitions:{"virtual-account_onramp_cancel_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp to cancel"}},required:["onrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_cancel_output",definitions:{"virtual-account_onramp_cancel_output":{type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_create",description:"Create a fiat-to-stablecoin onramp. Returns a deposit account (bank IBAN or account number) where the user sends fiat. Incoming fiat is automatically converted to stablecoin and sent to the registered wallet.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_create_input",definitions:{"virtual-account_onramp_create_input":{type:"object",properties:{name:{type:"string",description:"A label for this onramp (e.g. 'My USD onramp')"},fiat:{type:"string",enum:["USD","EUR"],description:"Fiat currency: usd or eur"},stablecoin:{type:"string",enum:["USDC","USDT","EURC"],description:"Target stablecoin: usdc, usdt, or eurc"},wallet:{type:"string",description:"Registered wallet address (must be registered via virtual-account_wallet_register first)"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain to receive stablecoin on (solana, ethereum, polygon, arbitrum, base)"}},required:["name","fiat","stablecoin","wallet","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_create_output",definitions:{"virtual-account_onramp_create_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_list",description:"List all fiat-to-stablecoin onramps. Shows each onramp's deposit account details, status, and destination wallet.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_list_input",definitions:{"virtual-account_onramp_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_list_output",definitions:{"virtual-account_onramp_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1},description:"List of configured onramps"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_payment_create",description:"Create an open banking payment link for an onramp",inputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_create_input",definitions:{"virtual-account_onramp_payment_create_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp"},amount:{type:"string",description:"The amount to pay"},fiat:{type:"string",enum:["USD","EUR"],description:"The fiat currency (USD or EUR)"}},required:["onrampId","amount","fiat"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_create_output",definitions:{"virtual-account_onramp_payment_create_output":{type:"object",properties:{id:{type:"string"},paymentLink:{type:["string","null"]},status:{type:"string",enum:["Pending","Ready","Processing","Completed","Failed"]}},required:["id","paymentLink","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_payment_retrieve",description:"Get the status of an open banking payment",inputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_retrieve_input",definitions:{"virtual-account_onramp_payment_retrieve_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp this payment belongs to"},paymentId:{type:"string",format:"uuid",description:"The ID of the payment to retrieve"}},required:["onrampId","paymentId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_payment_retrieve_output",definitions:{"virtual-account_onramp_payment_retrieve_output":{type:"object",properties:{id:{type:"string"},paymentLink:{type:["string","null"]},status:{type:"string",enum:["Pending","Ready","Processing","Completed","Failed"]}},required:["id","paymentLink","status"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_retrieve",description:"Get onramp details and banking info",inputSchema:{$ref:"#/definitions/virtual-account_onramp_retrieve_input",definitions:{"virtual-account_onramp_retrieve_input":{type:"object",properties:{onrampId:{type:"string",format:"uuid",description:"The ID of the onramp to retrieve"}},required:["onrampId"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_retrieve_output",definitions:{"virtual-account_onramp_retrieve_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_onramp_update",description:"Update an existing onramp's destination wallet, chain, or stablecoin.",inputSchema:{$ref:"#/definitions/virtual-account_onramp_update_input",definitions:{"virtual-account_onramp_update_input":{type:"object",properties:{onrampId:{type:"string",description:"The ID of the onramp to update"},wallet:{type:["string","null"],description:"New destination wallet address (must be registered)"},chain:{anyOf:[{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"]},{type:"null"}],description:"New destination chain (solana, ethereum, polygon, arbitrum, base)"},stablecoin:{anyOf:[{type:"string",enum:["USDC","USDT","EURC"],description:"Stablecoin token code. USDC: USD Coin, USDT: Tether, EURC: Euro Coin"},{type:"null"}],description:"New destination stablecoin (USDC, USDT, EURC)"}},required:["onrampId","wallet","chain","stablecoin"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_onramp_update_output",definitions:{"virtual-account_onramp_update_output":{type:"object",properties:{id:{type:"string"},name:{type:"string"},status:{type:"string",enum:["Created","EditPending","Authorized","DepositAccountAdded","Approved","Rejected","Cancelled"]},fiat:{type:"string"},stablecoin:{type:"string"},depositAccount:{anyOf:[{type:"object",properties:{type:{type:"string"},iban:{type:["string","null"]},bic:{type:["string","null"]},accountNumber:{type:["string","null"]},routingNumber:{type:["string","null"]},bankName:{type:["string","null"]},bankAddress:{type:["string","null"]},recipientName:{type:["string","null"]}},required:["type","iban","bic","accountNumber","routingNumber","bankName","bankAddress","recipientName"],additionalProperties:!1},{type:"null"}]},walletAddress:{type:"string"},fees:{anyOf:[{type:"object",properties:{transactionFee:{type:"string",description:"e.g. '0.50%'"},bankingFee:{type:["string","null"],description:"e.g. '0.50 EUR (SEPA)'"},networkFee:{type:"string",description:"'subsidized' or 'charged'"}},required:["transactionFee","bankingFee","networkFee"],additionalProperties:!1},{type:"null"}]},legalDisclaimer:{type:"string"}},required:["id","name","status","fiat","stablecoin","depositAccount","walletAddress","fees","legalDisclaimer"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_retrieve",description:"Get your virtual account status",inputSchema:{$ref:"#/definitions/virtual-account_retrieve_input",definitions:{"virtual-account_retrieve_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_retrieve_output",definitions:{"virtual-account_retrieve_output":{type:"object",properties:{id:{type:"string"},email:{type:"string"},customerType:{type:"string",enum:["Person","Business"]},status:{type:"string",enum:["UserRequired","SigningsRequired","IdentificationRequired","Active","Suspended"]},nextStep:{type:["string","null"]}},required:["id","email","customerType","status","nextStep"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_transaction_list",description:"List fiat-to-stablecoin conversion transactions. Shows status, fiat amount sent, and stablecoin amount received for each conversion.",inputSchema:{$ref:"#/definitions/virtual-account_transaction_list_input",definitions:{"virtual-account_transaction_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_transaction_list_output",definitions:{"virtual-account_transaction_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Transaction ID"},state:{type:"string",enum:["Pending","PayoutPending","Payout","PayoutCompleted","Completed","Failed","InAmlReview","AmlRejected","AmountRejected"],description:"Transaction state (e.g. pending, completed, failed)"},sourceAmount:{type:"string",description:"Fiat amount sent (e.g. '100.00 USD')"},destinationAmount:{type:"string",description:"Stablecoin amount received (e.g. '99.50 USDC')"},createdAt:{type:"string",format:"date-time",description:"Transaction creation timestamp"}},required:["id","state","sourceAmount","destinationAmount","createdAt"],additionalProperties:!1},description:"List of onramp conversion transactions"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_list",description:"List wallets registered for the virtual account. Only registered wallets can receive onramp payouts.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_list_input",definitions:{"virtual-account_wallet_list_input":{type:"object",properties:{},additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_list_output",definitions:{"virtual-account_wallet_list_output":{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{id:{type:"string"},address:{type:"string"},blockchain:{type:"string"}},required:["id","address","blockchain"],additionalProperties:!1},description:"List of registered wallets"}},required:["items"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}},{name:"virtual-account_wallet_register",description:"Register a wallet by submitting a signed proof-of-ownership message. The wallet can then be used as a destination for onramp payouts.",inputSchema:{$ref:"#/definitions/virtual-account_wallet_register_input",definitions:{"virtual-account_wallet_register_input":{type:"object",properties:{wallet:{type:"string",description:"Wallet address to register"},message:{type:"string",description:"Proof-of-ownership verification message"},signature:{type:"string",description:"Signature of the message, signed by the wallet's private key"},chain:{type:"string",enum:["solana","ethereum","base","polygon","arbitrum","optimism","bnb","avalanche","tron","bitcoin"],description:"Blockchain for wallet registration (solana, ethereum, polygon, base, arbitrum)"}},required:["wallet","message","signature","chain"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"},outputSchema:{$ref:"#/definitions/virtual-account_wallet_register_output",definitions:{"virtual-account_wallet_register_output":{type:"object",properties:{success:{type:"boolean",description:"Whether the operation was successful"}},required:["success"],additionalProperties:!1}},$schema:"http://json-schema.org/draft-07/schema#"}}];var Kt="https://www.moonpay.com/legal/terms_of_use_europe_hypermint",Gt="https://www.moonpay.com/legal/privacy_policy",Yt="https://swaps.xyz/terms",Ue=` Terms of Use: ${Kt}
|
|
3
|
+
Privacy Policy: ${Gt}
|
|
4
|
+
Swaps by: ${Yt}`;import*as Ne from"fs";import*as Le from"os";import*as Me from"path";var p=e=>e,c=(e,t)=>({schema:e,handler:async i=>{let n=e.input.parse(i),r=await t(n);return e.output.parse(r)}});import{z as V}from"zod";var Ie=p({name:"consent_check",description:"Check whether the MoonPay Terms of Use have been accepted. Throws if not accepted.",input:V.object({}),output:V.object({accepted:V.literal(!0),tosVersion:V.string(),acceptedAt:V.string()})});import*as O from"fs";import*as $e from"os";import*as Oe from"path";import*as Be from"crypto";import{z as re}from"zod";var qe=p({name:"consent_accept",description:"Accept the MoonPay Terms of Use. Required before using any CLI command.",input:re.object({}),output:re.object({tosVersion:re.string(),acceptedAt:re.string()})});import*as oe from"os";var xe=3e3;function Re(e){let t=k(),i=JSON.stringify({agentId:e.agentId,tosVersion:e.tosVersion,cliVersion:e.cliVersion,nodeVersion:process.version,os:oe.platform(),arch:oe.arch()});fetch(`${t}/api/tools/cli_activation_create`,{method:"POST",headers:x(),body:i,signal:AbortSignal.timeout(xe)}).catch(()=>{})}async function Ee(e){let t=k(),i=await R();i&&fetch(`${t}/api/tools/cli_activation_update`,{method:"POST",headers:{...x(),Authorization:`Bearer ${i}`},body:JSON.stringify({agentId:e}),signal:AbortSignal.timeout(xe)}).catch(()=>{})}var me=Oe.join($e.homedir(),".config","moonpay","consent.json");function Jt(){try{return JSON.parse(O.readFileSync(me,"utf-8"))}catch{return null}}var se=c(qe,async()=>{ve();let t=Jt()?.agentId??Be.randomUUID(),i=new Date().toISOString(),n={tosVersion:"1.2",acceptedAt:i,agentId:t},r=me+`.tmp.${process.pid}`;return O.writeFileSync(r,JSON.stringify(n,null,2),{encoding:"utf-8",mode:384}),O.renameSync(r,me),process.stderr.write(`
|
|
5
|
+
By using this CLI, you agree to:
|
|
6
|
+
${Ue}
|
|
7
|
+
|
|
8
|
+
`),Re({agentId:t,tosVersion:"1.2",cliVersion:ke}),{tosVersion:n.tosVersion,acceptedAt:n.acceptedAt}});var Zt=Me.join(Le.homedir(),".config","moonpay","consent.json"),We=c(Ie,async()=>{let e=null;try{e=JSON.parse(Ne.readFileSync(Zt,"utf-8"))}catch{}if(!e||e.tosVersion!=="1.2"){let t=await se.handler({});return{accepted:!0,tosVersion:t.tosVersion,acceptedAt:t.acceptedAt}}return{accepted:!0,tosVersion:e.tosVersion,acceptedAt:e.acceptedAt}});import{generateMnemonic as Xt}from"@scure/bip39";import{wordlist as Qt}from"@scure/bip39/wordlists/english";import{z as B}from"zod";var He=p({name:"wallet_create",description:"Create a new multi-chain HD wallet. Generates a BIP39 mnemonic and derives addresses for Solana, Ethereum, Bitcoin, and Tron. The mnemonic is copied to clipboard (interactive) or omitted (headless). Keys are encrypted with a random key stored in the OS keychain.",input:B.object({name:B.string().describe("Wallet name")}),output:B.object({name:B.string(),addresses:B.record(m,B.string())})});var ze=c(He,async e=>{let t=Xt(Qt,256),i=te(t);return F({name:e.name,type:"hd",mnemonic:t,addresses:i,createdAt:new Date().toISOString()}),{name:e.name,addresses:E(i)}});import{createInterface as ei}from"readline";import{validateMnemonic as Ve}from"@scure/bip39";import{wordlist as Ke}from"@scure/bip39/wordlists/english";import{Keypair as ti}from"@solana/web3.js";import ii from"bs58";import{privateKeyToAccount as ni}from"viem/accounts";import{z as U}from"zod";var Fe=p({name:"wallet_import",description:"Import a wallet from a BIP39 mnemonic (HD, all chains) or a single private key (one chain). Provide either --mnemonic or --key, not both.",input:U.object({name:U.string().describe("Wallet name"),mnemonic:U.string().nullable().describe("BIP39 mnemonic seed phrase (for HD wallet import)"),key:U.string().nullable().describe("Private key: base58 for Solana, hex for EVM/Bitcoin"),chain:m.nullable().describe("Chain for single-key import (default solana)")}),output:U.object({name:U.string(),type:U.enum(["hd","imported"]),addresses:Te})});function ri(e){return new Promise((t,i)=>{if(!process.stdin.isTTY){i(new Error("Interactive import requires a terminal. Pass --mnemonic or --key instead."));return}let n=ei({input:process.stdin,output:process.stderr});process.stderr.write(e),process.stdin.setRawMode(!0);let r="",o=a=>{let s=a.toString();s===`
|
|
9
|
+
`||s==="\r"?(process.stdin.setRawMode(!1),process.stdin.removeListener("data",o),process.stderr.write(`
|
|
10
|
+
`),n.close(),t(r.trim())):s===""?(process.stdin.setRawMode(!1),n.close(),process.exit(0)):s==="\x7F"||s==="\b"?r=r.slice(0,-1):r+=s};process.stdin.on("data",o)})}function oi(e){let t=e.split(/\s+/);return t.length>=12&&t.length<=24&&Ve(e,Ke)?"mnemonic":"key"}var Ge=c(Fe,async e=>{if(e.mnemonic&&e.key)throw new Error("Provide either --mnemonic or --key, not both.");let t=e.mnemonic,i=e.key;if(!t&&!i){let s=await ri("Paste your mnemonic or private key (hidden): ");if(!s)throw new Error("No input provided.");oi(s)==="mnemonic"?t=s:i=s}if(t){let s=t.trim().toLowerCase();if(!Ve(s,Ke))throw new Error("Invalid BIP39 mnemonic.");let l=te(s);return F({name:e.name,type:"hd",mnemonic:s,addresses:l,createdAt:new Date().toISOString()}),{name:e.name,type:"hd",addresses:l}}let n=e.chain?y[e.chain]:"solana",r=i??"",o,a;if(n==="solana")try{let s=ii.decode(r);o=ti.fromSecretKey(s).publicKey.toBase58(),a=r}catch{throw new Error("Invalid Solana private key. Expected base58-encoded secret key.")}else if(n==="ethereum"){if(a=r.startsWith("0x")?r.slice(2):r,!/^[0-9a-fA-F]{64}$/.test(a))throw new Error("Invalid EVM private key. Expected 64-character hex string.");o=ni(`0x${a}`).address}else throw new Error(`Single-key import for ${n} is not yet supported. Use a mnemonic instead.`);return F({name:e.name,type:"imported",chain:n,privateKey:a,addresses:{[n]:o},createdAt:new Date().toISOString()}),{name:e.name,type:"imported",addresses:{[n]:o}}});import{z as Ye}from"zod";var Je=p({name:"wallet_list",description:"List all local wallets",input:Ye.object({}),output:Ye.array(ie)});var Ze=c(Je,async()=>ne().map(t=>({name:t.name,type:t.type,addresses:E(t.addresses),createdAt:t.createdAt})));import{z as Xe}from"zod";var Qe=p({name:"wallet_retrieve",description:"Get details of a specific wallet",input:Xe.object({wallet:Xe.string().describe("Wallet name or address")}),output:ie});var S=c(Qe,async e=>{let t=b(e.wallet);return{name:t.name,type:t.type,addresses:E(t.addresses),createdAt:t.createdAt}});import{z as N}from"zod";var et=p({name:"wallet_delete",description:"Permanently delete a local wallet. This removes the private key file and cannot be undone.",input:N.object({wallet:N.string().describe("Name or address of the wallet to delete"),confirm:N.boolean().describe("Must be true to confirm deletion")}),output:N.object({name:N.string().describe("Name of the deleted wallet"),deleted:N.literal(!0)})});var tt=c(et,async e=>{if(!e.confirm)throw new Error("Back up your wallet before deleting! Run `mp wallet export "+e.wallet+"` to save your recovery phrase, then re-run with --confirm to permanently delete.");let t=b(e.wallet);return De(t.name),{name:t.name,deleted:!0}});import{z as L}from"zod";var it=p({name:"wallet_rename",description:"Rename a local wallet.",input:L.object({wallet:L.string().describe("Current name or address of the wallet"),name:L.string().describe("New name for the wallet")}),output:L.object({oldName:L.string(),newName:L.string()})});var nt=c(it,async e=>{let i=b(e.wallet).name;if(i===e.name)return{oldName:i,newName:e.name};if(ne().some(r=>r.name===e.name))throw new Error(`Wallet "${e.name}" already exists`);return Ae(r=>{let o=r.find(a=>a.name===i);if(!o)throw new Error(`Wallet "${i}" not found`);o.name=e.name}),{oldName:i,newName:e.name}});import{z as pe}from"zod";var rt=p({name:"wallet_export",description:"Export wallet secret (mnemonic or private key). Interactive only \u2014 cannot be run by agents or piped.",input:pe.object({wallet:pe.string().describe("Wallet name")}),output:pe.object({exported:pe.literal(!0)})});var ot=c(rt,async e=>{if(!process.stdout.isTTY)throw new Error(`Wallet export requires an interactive terminal.
|
|
11
|
+
Run this command directly in your terminal: mp wallet export `+e.wallet);let t=b(e.wallet);return t.type==="hd"?(process.stderr.write(`
|
|
12
|
+
Mnemonic for "${t.name}":
|
|
13
|
+
|
|
14
|
+
`),process.stderr.write(` ${t.mnemonic}
|
|
15
|
+
|
|
16
|
+
`),process.stderr.write(`Write this down and store it securely.
|
|
17
|
+
|
|
18
|
+
`)):(process.stderr.write(`
|
|
19
|
+
Private key for "${t.name}" (${t.chain}):
|
|
20
|
+
|
|
21
|
+
`),process.stderr.write(` ${t.privateKey}
|
|
22
|
+
|
|
23
|
+
`)),{exported:!0}});import{createHash as ai}from"crypto";import{Keypair as si,VersionedTransaction as pi}from"@solana/web3.js";import{privateKeyToAccount as ci}from"viem/accounts";import{parseTransaction as li}from"viem";import{createPublicClient as ui,http as di}from"viem";import*as g from"viem/chains";import*as st from"tiny-secp256k1";import{z as K}from"zod";var at=p({name:"transaction_sign",description:"Sign a transaction with a local wallet. Supports Solana (VersionedTransaction), EVM (RLP-encoded), and Bitcoin (PSBT) transactions.",input:K.object({wallet:K.string().describe("Wallet name or address"),chain:m.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),transaction:K.string().describe("Base64-encoded unsigned transaction")}),output:K.object({transaction:K.string().describe("Base64-encoded signed transaction")})});var mi={1:g.mainnet,137:g.polygon,42161:g.arbitrum,8453:g.base,10:g.optimism,56:g.bsc,43114:g.avalanche},yi={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"},C=c(at,async e=>{let t=b(e.wallet),i=e.chain,n=y[i],{privateKey:r}=$(t,i);switch(n){case"solana":return hi(r,e.transaction.trim());case"ethereum":return fi(r,e.transaction.trim());case"tron":return gi(r,e.transaction.trim());case"bitcoin":return bi(r,e.transaction.trim())}});function hi(e,t){let i=Buffer.from(t,"base64"),n=pi.deserialize(i),r=si.fromSecretKey(e);return n.sign([r]),{transaction:Buffer.from(n.serialize()).toString("base64")}}async function fi(e,t){let i=ci(`0x${Buffer.from(e).toString("hex")}`);if(t.startsWith("{")){let{to:a,data:s,value:l,chainId:f}=JSON.parse(t),u=mi[f]??g.mainnet,h=yi[f],T=ui({chain:u,transport:di(h)}),z=await T.getTransactionCount({address:i.address}),X=await T.estimateFeesPerGas(),Q=await T.estimateGas({account:i.address,to:a,data:s,value:BigInt(l??"0")});return{transaction:await i.signTransaction({to:a,data:s,value:BigInt(l??"0"),chainId:f,nonce:z,gas:Q,maxFeePerGas:X.maxFeePerGas,maxPriorityFeePerGas:X.maxPriorityFeePerGas,type:"eip1559"})}}let n=t.startsWith("0x")?t:`0x${Buffer.from(t,"base64").toString("hex")}`,r=li(n);return{transaction:await i.signTransaction(r)}}function gi(e,t){let i=t.startsWith("0x")?t.slice(2):t,n=Buffer.from(i,"hex"),r=ai("sha256").update(n).digest(),o=st.sign(r,e);if(!o)throw new Error("Tron transaction signing failed");return{transaction:JSON.stringify({raw_data_hex:i,signature:Buffer.from(o).toString("hex")})}}async function bi(e,t){let i=await import("bitcoinjs-lib"),n=(await import("ecpair")).default,r=await import("tiny-secp256k1"),a=n(r).fromPrivateKey(Buffer.from(e)),s=i.Psbt.fromBase64(t);return s.signAllInputs(a),s.finalizeAllInputs(),{transaction:s.toBase64()}}import{createHash as ct}from"crypto";import{Keypair as _i}from"@solana/web3.js";import ki from"bs58";import vi from"tweetnacl";import*as ye from"tiny-secp256k1";import{keccak_256 as Si}from"@noble/hashes/sha3";import{privateKeyToAccount as wi}from"viem/accounts";import{z as G}from"zod";var pt=p({name:"message_sign",description:"Sign a message with a local wallet. Supports Solana (ed25519), EVM (EIP-191 personal sign), and Bitcoin (secp256k1 ECDSA).",input:G.object({wallet:G.string().describe("Wallet address or name to sign with"),chain:m.describe("Chain: solana, ethereum, base, arbitrum, or bitcoin"),message:G.string().describe("Message text to sign")}),output:G.object({signature:G.string().describe("Signature: base58 for Solana, hex (0x-prefixed) for EVM/Bitcoin")})});var ce=c(pt,async e=>{let t=b(e.wallet),i=e.chain,n=y[i],{privateKey:r}=$(t,i),o=Buffer.from(e.message,"utf8");switch(n){case"solana":return Pi(r,o);case"ethereum":return ji(r,e.message);case"tron":return Ci(r,e.message);case"bitcoin":return Ti(r,o)}});function Pi(e,t){let i=_i.fromSecretKey(e),n=vi.sign.detached(t,i.secretKey);return{signature:ki.encode(n)}}async function ji(e,t){return{signature:await wi(`0x${Buffer.from(e).toString("hex")}`).signMessage({message:t})}}function Ci(e,t){let i=Buffer.from(t,"utf8"),n=Buffer.from(`TRON Signed Message:
|
|
24
|
+
${i.length}`,"utf8"),r=Si(Buffer.concat([n,i])),o=ye.sign(r,e);if(!o)throw new Error("Tron message signing failed");return{signature:"0x"+Buffer.from(o).toString("hex")}}function Ti(e,t){let i=ct("sha256").update(t).digest(),n=ct("sha256").update(i).digest(),r=ye.sign(n,e);if(!r)throw new Error("Bitcoin message signing failed");return{signature:"0x"+Buffer.from(r).toString("hex")}}import Ai from"https";import{z as v}from"zod";var lt=p({name:"bitcoin_balance_retrieve",description:"Get the BTC balance of a Bitcoin address. Returns confirmed and unconfirmed balances in BTC and satoshis.",input:v.object({wallet:v.string().describe("Bitcoin address (bc1...) or wallet name")}),output:v.object({address:v.string().describe("Bitcoin address"),confirmed:v.object({btc:v.string().describe("Confirmed balance in BTC"),sats:v.number().describe("Confirmed balance in satoshis")}),unconfirmed:v.object({btc:v.string().describe("Unconfirmed (pending) balance in BTC"),sats:v.number().describe("Unconfirmed (pending) balance in satoshis")}),total:v.object({btc:v.string().describe("Total balance in BTC"),sats:v.number().describe("Total balance in satoshis")})})});var Di=1e8;function he(e){return(e/Di).toFixed(8)}function Ui(e){return new Promise((t,i)=>{Ai.get(e,{headers:{"User-Agent":"moonpay-cli"}},n=>{if(n.statusCode!==200){i(new Error(`HTTP ${n.statusCode} from ${e}`)),n.resume();return}let r="";n.on("data",o=>r+=o),n.on("end",()=>{try{t(JSON.parse(r))}catch{i(new Error("Invalid JSON response"))}})}).on("error",i)})}var ut=c(lt,async e=>{let t=e.wallet;if(!t.startsWith("bc1")&&!t.startsWith("1")&&!t.startsWith("3")){let{findWalletOrThrow:a}=await import("./store-FXTIXNAV.js"),l=a(t).addresses.bitcoin;if(!l)throw new Error(`Wallet "${t}" has no Bitcoin address. It may be an imported single-chain wallet.`);t=l}let i=await Ui(`https://mempool.space/api/address/${encodeURIComponent(t)}`),n=i.chain_stats.funded_txo_sum-i.chain_stats.spent_txo_sum,r=i.mempool_stats.funded_txo_sum-i.mempool_stats.spent_txo_sum,o=n+r;return{address:t,confirmed:{btc:he(n),sats:n},unconfirmed:{btc:he(r),sats:r},total:{btc:he(o),sats:o}}});import{readdirSync as Ii,readFileSync as dt,existsSync as fe,mkdirSync as qi,cpSync as xi}from"fs";import{join as M,dirname as Ri}from"path";import{homedir as Ei}from"os";import{fileURLToPath as $i}from"url";function ge(){let e=$i(import.meta.url),t=Ri(e);return M(t,"..","skills")}function Oi(){return M(Ei(),".claude","skills")}function be(){let e=ge();return fe(e)?Ii(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&t.name.startsWith("moonpay-")).map(t=>{let n=dt(M(e,t.name,"SKILL.md"),"utf-8").match(/^description:\s*(.+)$/m);return{name:t.name,description:n?.[1]?.replace(/^["']|["']$/g,"")??""}}).sort((t,i)=>t.name.localeCompare(i.name)):[]}function mt(e){if(/[/\\]|\.\./.test(e))throw new Error(`Invalid skill name: "${e}"`);let t=M(ge(),e,"SKILL.md");if(!fe(t))throw new Error(`Skill "${e}" not found. Run \`mp skill list\` to see available skills.`);return dt(t,"utf-8")}function yt(e,t){let i=ge(),n=t??Oi(),r=be();return qi(n,{recursive:!0}),r.map(o=>{let a=M(n,o.name);return fe(a)&&!e?{name:o.name,installed:!1}:(xi(M(i,o.name),a,{recursive:!0,force:!0}),{name:o.name,installed:!0})})}import{z as Y}from"zod";var ht=p({name:"skill_list",description:"List available AI skills for Claude Code and other agents",input:Y.object({}),output:Y.array(Y.object({name:Y.string(),description:Y.string()}))});var ft=c(ht,async()=>be());import{z as J}from"zod";var gt=p({name:"skill_retrieve",description:"Get the full instructions for a specific skill",input:J.object({name:J.string().describe("Skill name (e.g. moonpay-swap-tokens)")}),output:J.object({name:J.string(),content:J.string()})});var bt=c(gt,async e=>({name:e.name,content:mt(e.name)}));import{z as I}from"zod";var _t=p({name:"skill_install",description:"Install AI skills for Claude Code. Defaults to ~/.claude/skills/, or specify --dir for a custom location (e.g. project-local, ~/.agents/skills).",input:I.object({force:I.boolean().describe("Overwrite existing skills"),dir:I.string().nullable().describe("Target directory to install skills into (default: ~/.claude/skills/)")}),output:I.array(I.object({name:I.string(),installed:I.boolean()}))});var kt=c(_t,async e=>yt(e.force,e.dir??void 0));import{encodeFunctionData as Bi}from"viem";import{z as w}from"zod";var vt=p({name:"token_bridge",description:"Bridge tokens across chains. Builds, signs locally, broadcasts, and registers.",input:w.object({from:w.object({wallet:w.string().describe("Local wallet name to sign with"),chain:m.describe("Source chain"),token:w.string().describe("Source token address"),amount:w.coerce.number().nullable().describe("Amount to send (exact-in). Null for exact-out.")}),to:w.object({wallet:w.string().nullable().describe("Destination wallet name or address (defaults to from wallet)"),chain:m.describe("Destination chain"),token:w.string().describe("Destination token address"),amount:w.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:w.object({signature:w.string().describe("Transaction hash/signature"),message:w.string().describe("Human-readable bridge description")})});var Ni=[{name:"approve",type:"function",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],le=c(vt,async e=>{if(!e.from.amount&&!e.to.amount)throw new Error("Provide either from.amount or to.amount.");let t=k(),i=await S.handler({wallet:e.from.wallet}),n=i.addresses[y[e.from.chain]];if(!n)throw new Error(`Wallet "${i.name}" has no address on ${e.from.chain}.`);let r=n;if(e.to.wallet)try{r=(await S.handler({wallet:e.to.wallet})).addresses[y[e.to.chain]]??e.to.wallet}catch{r=e.to.wallet}else e.from.chain!==e.to.chain&&(r=i.addresses[y[e.to.chain]]??n);let o={from:{wallet:n,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}},a=await d(t,"swaps_transaction_build",o),s=a.transaction;if(a.requiresApproval&&"to"in s){let{to:h,chainId:T}=s,z={type:"evm",to:e.from.token,data:Bi({abi:Ni,functionName:"approve",args:[h,BigInt(a.amountIn.raw)]}),value:"0",chainId:T},{transaction:X}=await C.handler({wallet:i.name,chain:e.from.chain,transaction:JSON.stringify(z)}),Q=await d(t,"transaction_send",{transaction:X,message:`Approve ${a.amountIn.symbol}`,chain:e.from.chain});if(!Q.signature)throw new Error(`Approval failed: ${Q.message}`);process.stderr.write(`Approval sent. Waiting for confirmation...
|
|
25
|
+
`),await new Promise(_e=>setTimeout(_e,5e3)),a=await d(t,"swaps_transaction_build",o)}let l="base64"in a.transaction?a.transaction.base64:JSON.stringify(a.transaction),{transaction:f}=await C.handler({wallet:i.name,chain:e.from.chain,transaction:l}),u=await d(t,"transaction_send",{transaction:f,message:a.message,chain:e.from.chain});if(!u.signature)throw new Error(`Transaction send failed: ${u.message}`);try{await d(t,"transaction_register",{transactionId:a.transactionId,transactionHash:u.signature,chain:e.from.chain})}catch{}return{signature:u.signature,message:a.message}});import{z as P}from"zod";var St=p({name:"token_swap",description:"Swap tokens on the same chain. Builds, signs locally, broadcasts, and registers.",input:P.object({wallet:P.string().describe("Local wallet name to sign with"),chain:m.describe("Chain to swap on"),from:P.object({token:P.string().describe("Input token address (selling)"),amount:P.coerce.number().nullable().describe("Amount to sell (exact-in). Null for exact-out.")}),to:P.object({token:P.string().describe("Output token address (buying)"),amount:P.coerce.number().nullable().describe("Amount to receive (exact-out). Null for exact-in.")})}),output:P.object({signature:P.string().describe("Transaction hash/signature"),message:P.string().describe("Human-readable swap description")})});var wt=c(St,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 A}from"zod";var Pt=p({name:"token_transfer",description:"Transfer tokens to another wallet on the same chain. Builds, signs locally, and broadcasts.",input:A.object({wallet:A.string().describe("Local wallet name to sign with"),chain:m.describe("Chain to transfer on"),token:A.string().describe("Token address to transfer"),amount:A.coerce.number().describe("Amount to transfer"),to:A.string().describe("Recipient wallet name or address")}),output:A.object({signature:A.string().describe("Transaction hash/signature"),message:A.string().describe("Human-readable transfer description")})});var jt=c(Pt,async e=>{let t=k(),i=await S.handler({wallet:e.wallet}),n=i.addresses[y[e.chain]];if(!n)throw new Error(`Wallet "${i.name}" has no address on ${e.chain}.`);let r=e.to;try{r=(await S.handler({wallet:e.to})).addresses[y[e.chain]]??e.to}catch{}let o=await d(t,"token_transfer",{wallet:n,token:e.token,to:r,amount:e.amount,chain:e.chain}),a="base64"in o.transaction?o.transaction.base64:JSON.stringify(o.transaction),{transaction:s}=await C.handler({wallet:i.name,chain:e.chain,transaction:a}),l=await d(t,"transaction_send",{transaction:s,message:o.message,chain:e.chain});if(!l.signature)throw new Error(`Transaction send failed: ${l.message}`);return{signature:l.signature,message:o.message}});import{Keypair as Li,VersionedTransaction as Mi,VersionedMessage as Wi}from"@solana/web3.js";import Tt from"axios";import{wrapAxiosWithPayment as At}from"@x402/axios";import{x402Client as Dt}from"@x402/core/client";import{ExactSvmScheme as Hi}from"@x402/svm";import{registerExactEvmScheme as zi}from"@x402/evm/exact/client";import{toClientEvmSigner as Fi}from"@x402/evm";import{privateKeyToAccount as Vi}from"viem/accounts";import{createPublicClient as Ki,http as Gi}from"viem";import*as j from"viem/chains";import{z as _}from"zod";var Ct=p({name:"x402_request",description:"Make an HTTP request to an x402-protected endpoint. Automatically handles payment when a 402 Payment Required response is received, signing the payment transaction with the local wallet.",input:_.object({method:_.enum(["GET","POST","PUT","PATCH","DELETE"]).describe("HTTP method"),url:_.string().url().refine(e=>e.startsWith("https://"),{message:"URL must use HTTPS"}).refine(e=>{try{return!new URL(e).hostname.match(/^(localhost|127\.|10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|169\.254\.|0\.0\.0\.0|\[::1\])/)}catch{return!1}},{message:"URL must not target private/internal addresses"}).describe("Full HTTPS URL of the x402-protected endpoint (e.g., 'https://agents.moonpay.com/x402/upgrade')"),body:_.record(_.any()).nullable().describe("Request body (for POST, PUT, PATCH)"),params:_.record(_.any()).nullable().describe("Query parameters"),wallet:_.string().describe("Wallet name or address to pay with"),chain:_.enum(["solana","base","ethereum","arbitrum","polygon","optimism"]).nullable().describe("Chain to pay from (default: solana). Use an EVM chain like 'base' to pay with an EVM wallet.")}),output:_.object({status:_.number().describe("HTTP status code"),data:_.any().describe("Response data"),headers:_.record(_.any()).describe("Response headers")})});var Yi="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",Ji={ethereum:j.mainnet,base:j.base,polygon:j.polygon,arbitrum:j.arbitrum,optimism:j.optimism};function Zi(e,t){let i=Li.fromSecretKey(t),n={address:e,signTransactions:async a=>a.map(s=>{let l=new Uint8Array(s.messageBytes),f=Wi.deserialize(l),u=Object.keys(s.signatures).length,h=new Mi(f,new Array(u).fill(new Uint8Array(64)));h.sign([i]);let T=f.staticAccountKeys.findIndex(z=>z.toBase58()===e);if(T===-1)throw new Error(`Wallet ${e} is not a signer for this transaction`);return{[e]:h.signatures[T]}})},r=new Dt,o=new Hi(n);return r.register(Yi,o),r.registerV1("solana",o),At(Tt.create(),r)}function Xi(e,t){let i=Vi(`0x${Buffer.from(e).toString("hex")}`),n=Ji[t]??j.base,r=Ki({chain:n,transport:Gi()}),o=Fi(i,r),a=new Dt;return zi(a,{signer:o}),At(Tt.create(),a)}var ue=c(Ct,async({method:e,url:t,body:i,params:n,wallet:r,chain:o})=>{let a=b(r),s=o??"solana",{privateKey:l,address:f}=$(a,s),u=s==="solana"?Zi(f,l):Xi(l,s),h;switch(e){case"GET":h=await u.get(t,{params:n});break;case"POST":h=await u.post(t,i||{},{params:n});break;case"PUT":h=await u.put(t,i||{},{params:n});break;case"PATCH":h=await u.patch(t,i||{},{params:n});break;case"DELETE":h=await u.delete(t,{params:n});break;default:throw new Error(`Unsupported HTTP method: ${e}`)}return{status:h.status,data:h.data,headers:h.headers}});import{z as W}from"zod";var Ut=p({name:"virtual-account_wallet_register",description:"Register a local wallet with your virtual account. Creates the verification message, signs it locally, and registers in one step.",input:W.object({wallet:W.string().describe("Local wallet name"),chain:m.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")})});function Qi(e,t){let i=new Date,n=`${String(i.getUTCDate()).padStart(2,"0")}/${String(i.getUTCMonth()+1).padStart(2,"0")}/${i.getUTCFullYear()}`;return`I am verifying ownership of the wallet address ${e} as customer ${t}. This message was signed on ${n} to confirm my control over this wallet.`}var It=c(Ut,async e=>{let t=k(),i=e.chain,[n,r]=await Promise.all([S.handler({wallet:e.wallet}),d(t,"virtual-account_retrieve",{})]),o=y[i],a=n.addresses[o];if(!a)throw new Error(`Wallet "${n.name}" has no ${o} address.`);let s=Qi(a,r.id),{signature:l}=await ce.handler({wallet:n.name,chain:i,message:s});return await d(t,"virtual-account_wallet_register",{wallet:a,message:s,signature:l,chain:i}),{success:!0,address:a,chain:i}});import{z as q}from"zod";var qt=p({name:"virtual-account_offramp_initiate",description:"Send stablecoin to an approved offramp. Builds the transfer, signs locally, and broadcasts.",input:q.object({wallet:q.string().describe("Local wallet name to sign with"),offrampId:q.string().describe("The ID of the approved offramp"),amount:q.coerce.number().describe("Amount of stablecoin to send")}),output:q.object({signature:q.string().describe("Transaction hash/signature"),message:q.string().describe("Human-readable transfer description")})});var en={Solana:"solana",Ethereum:"ethereum",Polygon:"polygon",Base:"base",Arbitrum:"arbitrum"},xt=c(qt,async e=>{let t=k(),i=await S.handler({wallet:e.wallet}),r=(await d(t,"virtual-account_offramp_retrieve",{offrampId:e.offrampId})).source_currencies[0];if(!r||r.type!=="Crypto")throw new Error("Offramp does not have a valid crypto source currency.");let o=en[r.blockchain];if(!o)throw new Error(`Unsupported blockchain "${r.blockchain}".`);let a=i.addresses[y[o]];if(!a)throw new Error(`Wallet "${i.name}" has no address on ${o}.`);let s=await d(t,"virtual-account_offramp_initiate",{wallet:a,offrampId:e.offrampId,amount:e.amount}),l="base64"in s.transaction?s.transaction.base64:JSON.stringify(s.transaction),{transaction:f}=await C.handler({wallet:i.name,chain:o,transaction:l}),u=await d(t,"transaction_send",{transaction:f,message:s.message,chain:o});if(!u.signature)throw new Error(`Transaction send failed: ${u.message}`);return{signature:u.signature,message:s.message}});import{z as Z}from"zod";var Rt=p({name:"login",description:"Generate a sign-in link. Open it in a browser to get a verification code, then use `mp verify` to complete login.",input:Z.object({email:Z.string().describe("Email address")}),output:Z.object({email:Z.string(),message:Z.string()})});var Et=c(Rt,async e=>{let{baseUrl:t}=ee(),i=`${t}/login?email=${encodeURIComponent(e.email)}`;return{email:e.email,message:`Open this link to verify:
|
|
26
|
+
|
|
27
|
+
${i}
|
|
28
|
+
|
|
29
|
+
Then run: mp verify --email ${e.email} --code <code>`}});import*as Ot from"fs";import*as Bt from"os";import*as Nt from"path";import{z as H}from"zod";var $t=p({name:"verify",description:"Verify login code and store encrypted credentials.",input:H.object({email:H.string().describe("Email address"),code:H.string().describe("Verification code")}),output:H.object({email:H.string(),message:H.string()})});var tn=Nt.join(Bt.homedir(),".config","moonpay","consent.json");function nn(){try{return JSON.parse(Ot.readFileSync(tn,"utf-8")).agentId??null}catch{return null}}var Lt=c($t,async e=>{let{baseUrl:t}=ee(),i=await je(t,"verify",{email:e.email,code:e.code}),n={accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:i.expiresAt*1e3,baseUrl:t};we(n);let r=nn();return r&&Ee(r).catch(()=>{}),{email:e.email,message:"Logged in successfully."}});import{z as de}from"zod";var Mt=p({name:"logout",description:"Log out and clear stored credentials.",input:de.object({}),output:de.object({success:de.literal(!0),message:de.string()})});var Wt=c(Mt,async()=>(Pe(),{success:!0,message:"Logged out."}));import{z as D}from"zod";var Ht=p({name:"upgrade",description:"Purchase a rate limit upgrade via x402. Increases your API rate limit. Requires login and a funded wallet.",input:D.object({duration:D.enum(["day","month"]).describe("Upgrade duration: day ($1 USDC, 24h) or month ($20 USDC, 30 days)"),wallet:D.string().describe("Wallet name or address to pay with"),chain:D.enum(["solana","base"]).describe("Chain to pay from. x402 payments accepted on Solana and Base.")}),output:D.object({duration:D.string(),expiresAt:D.string().describe("When the upgrade expires"),message:D.string()})});var zt=c(Ht,async e=>{if(!await R())throw new Error("Login required to upgrade. Run `mp login` first.");let i=k(),n=await d(i,"user_retrieve",{}),r=await ue.handler({method:"POST",url:`${i}/x402/upgrade`,body:{userId:n.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 kp=[ze,Ge,Ze,S,tt,nt,ot,C,ce,ut,ft,bt,kt,wt,le,jt,ue,It,xt,se,We,Et,Lt,Wt,zt];export{Ft as a,pn as b,Ue as c,We as d,kp as e};
|