@moonpay/cli 1.95.3 → 1.96.0

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.
@@ -1,2 +0,0 @@
1
- process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
2
- import{f as qt,g as Ft,j as Bt,m as Ht,n as Ut,o as Et,p as zt}from"./chunk-YECUFLA2.js";var n=class extends Error{constructor(r,u,i){super(r);this.status=u;this.toolName=i;this.name="MoonPayError"}},o=class extends n{constructor(t="Authentication required"){super(t,401),this.name="AuthError"}},c=class extends n{constructor(t="Rate limit exceeded"){super(t,429),this.name="RateLimitError"}},a=class extends n{constructor(t,r){super(t,400,r),this.name="ValidationError"}},l=class extends n{constructor(t){super(`Tool not found: ${t}`,404,t),this.name="ToolNotFoundError"}},s=class extends n{constructor(t,r){super(`Tool "${t}" has been renamed to "${r}"`,410,t),this.name="ToolRenamedError",this.newName=r}};var $t="https://agents.moonpay.com",Gt=36e4;function Wt(e){return!!e&&typeof e=="object"}function d(e){if(typeof e=="string")return e.length>0&&e!=="[object Object]"?e:void 0;if(typeof e=="number"||typeof e=="boolean")return String(e);if(!Wt(e))return;let t=d(e.error)??d(e.message)??d(e.errorMessage);if(t)return t;try{return JSON.stringify(e)}catch{return}}function Kt(e,t){if(!Wt(e))return;let r=e[t];return typeof r=="string"?r:void 0}var h=class{constructor(t={}){this.baseUrl=(t.baseUrl??$t).replace(/\/$/,""),this.auth=t.auth??{type:"none"},this.timeout=t.timeout??Gt,this.headers=t.headers??{}}async _call(t,r){let u=`${this.baseUrl}/api/tools/${encodeURIComponent(t)}`,i=await this.buildHeaders(),_=await fetch(u,{method:"POST",headers:i,body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout)});if(_.status===401&&this.auth.type==="bearer"&&this.auth.refreshToken)try{let Dt=await this.auth.refreshToken();i.Authorization=`Bearer ${Dt}`,_=await fetch(u,{method:"POST",headers:i,body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout)})}catch{throw new o("Token refresh failed")}return this.handleResponse(_,t)}async buildHeaders(){let t={"Content-Type":"application/json",...this.headers};if(this.auth.type==="bearer"){let r=await this.auth.getToken();r&&(t.Authorization=`Bearer ${r}`)}return t}async handleResponse(t,r){if(t.ok)return t.json();let u;try{u=await t.json()}catch{u={error:t.statusText}}let i=d(u)??`Request failed with status ${t.status}`;switch(t.status){case 400:throw new a(i,r);case 401:throw new o(i);case 404:throw new l(r);case 410:throw new s(r,Kt(u,"newName")??"unknown");case 429:throw new c(i);default:throw new n(i,t.status,r)}}};var O=class{constructor(t){this.client=t}create(t){return this.client._call("app_activation_create",t)}},v=class{constructor(t){this.client=t}get activation(){return new O(this.client)}},P=class{constructor(t){this.client=t}build(t){return this.client._call("card_delegation_approve_transaction_build",t)}},C=class{constructor(t){this.client=t}get transaction(){return new P(this.client)}},y=class{constructor(t){this.client=t}build(t){return this.client._call("card_delegation_revoke_transaction_build",t)}},I=class{constructor(t){this.client=t}get transaction(){return new y(this.client)}},g=class{constructor(t){this.client=t}retrieve(t){return this.client._call("card_delegation_token_retrieve",t)}},k=class{constructor(t){this.client=t}get approve(){return new C(this.client)}get revoke(){return new I(this.client)}get token(){return new g(this.client)}},A=class{constructor(t){this.client=t}check(t){return this.client._call("card_onboarding_check",t)}finish(t){return this.client._call("card_onboarding_finish",t)}start(t){return this.client._call("card_onboarding_start",t)}},f=class{constructor(t){this.client=t}list(t){return this.client._call("card_transaction_list",t)}},R=class{constructor(t){this.client=t}retrieve(t){return this.client._call("card_user_retrieve",t)}},w=class{constructor(t){this.client=t}check(t){return this.client._call("card_wallet_check",t)}link(t){return this.client._call("card_wallet_link",t)}list(t){return this.client._call("card_wallet_list",t)}unlink(t){return this.client._call("card_wallet_unlink",t)}},L=class{constructor(t){this.client=t}get delegation(){return new k(this.client)}get onboarding(){return new A(this.client)}get transaction(){return new f(this.client)}get user(){return new R(this.client)}get wallet(){return new w(this.client)}create(t){return this.client._call("card_create",t)}freeze(t){return this.client._call("card_freeze",t)}retrieve(t){return this.client._call("card_retrieve",t)}reveal(t){return this.client._call("card_reveal",t)}unfreeze(t){return this.client._call("card_unfreeze",t)}},M=class{constructor(t){this.client=t}list(t){return this.client._call("chain_list",t)}retrieve(t){return this.client._call("chain_retrieve",t)}},T=class{constructor(t){this.client=t}create(t){return this.client._call("cli_activation_create",t)}update(t){return this.client._call("cli_activation_update",t)}},x=class{constructor(t){this.client=t}get activation(){return new T(this.client)}},V=class{constructor(t){this.client=t}add(t){return this.client._call("commerce_cart_add",t)}remove(t){return this.client._call("commerce_cart_remove",t)}retrieve(t){return this.client._call("commerce_cart_retrieve",t)}update(t){return this.client._call("commerce_cart_update",t)}},b=class{constructor(t){this.client=t}pay(t){return this.client._call("commerce_checkout_pay",t)}start(t){return this.client._call("commerce_checkout_start",t)}},S=class{constructor(t){this.client=t}retrieve(t){return this.client._call("commerce_product_retrieve",t)}search(t){return this.client._call("commerce_product_search",t)}},q=class{constructor(t){this.client=t}list(t){return this.client._call("commerce_store_list",t)}retrieve(t){return this.client._call("commerce_store_retrieve",t)}},B=class{constructor(t){this.client=t}get cart(){return new V(this.client)}get checkout(){return new b(this.client)}get product(){return new S(this.client)}get store(){return new q(this.client)}search(t){return this.client._call("commerce_search",t)}},H=class{constructor(t){this.client=t}list(t){return this.client._call("deposit_transaction_list",t)}},U=class{constructor(t){this.client=t}get transaction(){return new H(this.client)}create(t){return this.client._call("deposit_create",t)}retrieve(t){return this.client._call("deposit_retrieve",t)}},E=class{constructor(t){this.client=t}create(t){return this.client._call("feedback_create",t)}},W=class{constructor(t){this.client=t}buy(t){return this.client._call("gateway_buy",t)}search(t){return this.client._call("gateway_search",t)}},D=class{constructor(t){this.client=t}retrieve(t){return this.client._call("hyperliquid_balance_retrieve",t)}},F=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_candle_list",t)}},z=class{constructor(t){this.client=t}create(t){return this.client._call("hyperliquid_deposit_create",t)}},$=class{constructor(t){this.client=t}submit(t){return this.client._call("hyperliquid_exchange_submit",t)}},G=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_funding_payment_list",t)}},K=class{constructor(t){this.client=t}get payment(){return new G(this.client)}},j=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_market_list",t)}},J=class{constructor(t){this.client=t}create(t){return this.client._call("hyperliquid_order_create",t)}list(t){return this.client._call("hyperliquid_order_list",t)}},Q=class{constructor(t){this.client=t}retrieve(t){return this.client._call("hyperliquid_orderbook_retrieve",t)}},X=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_position_list",t)}},Y=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_predicted_funding_list",t)}},Z=class{constructor(t){this.client=t}get funding(){return new Y(this.client)}},N=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_price_list",t)}},tt=class{constructor(t){this.client=t}list(t){return this.client._call("hyperliquid_trade_list",t)}},et=class{constructor(t){this.client=t}get balance(){return new D(this.client)}get candle(){return new F(this.client)}get deposit(){return new z(this.client)}get exchange(){return new $(this.client)}get funding(){return new K(this.client)}get market(){return new j(this.client)}get order(){return new J(this.client)}get orderbook(){return new Q(this.client)}get position(){return new X(this.client)}get predicted(){return new Z(this.client)}get price(){return new N(this.client)}get trade(){return new tt(this.client)}},rt=class{constructor(t){this.client=t}redeem(t){return this.client._call("polymarket_position_redeem",t)}sell(t){return this.client._call("polymarket_position_sell",t)}},nt=class{constructor(t){this.client=t}get position(){return new rt(this.client)}},it=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_event_list",t)}retrieve(t){return this.client._call("prediction-market_event_retrieve",t)}search(t){return this.client._call("prediction-market_event_search",t)}},ut=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_ohlcv_list",t)}},ot=class{constructor(t){this.client=t}get ohlcv(){return new ut(this.client)}},ct=class{constructor(t){this.client=t}retrieve(t){return this.client._call("prediction-market_order_retrieve",t)}},at=class{constructor(t){this.client=t}buy(t){return this.client._call("prediction-market_position_buy",t)}list(t){return this.client._call("prediction-market_position_list",t)}redeem(t){return this.client._call("prediction-market_position_redeem",t)}sell(t){return this.client._call("prediction-market_position_sell",t)}},lt=class{constructor(t){this.client=t}get event(){return new it(this.client)}get market(){return new ot(this.client)}get order(){return new ct(this.client)}get position(){return new at(this.client)}},st=class{constructor(t){this.client=t}check(t){return this.client._call("solana_balance_check",t)}},pt=class{constructor(t){this.client=t}get balance(){return new st(this.client)}},dt=class{constructor(t){this.client=t}retrieve(t){return this.client._call("swaps_quote_retrieve",t)}},ht=class{constructor(t){this.client=t}build(t){return this.client._call("swaps_transaction_build",t)}},mt=class{constructor(t){this.client=t}get quote(){return new dt(this.client)}get transaction(){return new ht(this.client)}},_t=class{constructor(t){this.client=t}list(t){return this.client._call("token_activity_list",t)}},Ot=class{constructor(t){this.client=t}list(t){return this.client._call("token_balance_list",t)}},vt=class{constructor(t){this.client=t}list(t){return this.client._call("token_holder_list",t)}},Pt=class{constructor(t){this.client=t}list(t){return this.client._call("token_ohlcv_list",t)}},Ct=class{constructor(t){this.client=t}list(t){return this.client._call("token_trending_list",t)}},yt=class{constructor(t){this.client=t}get activity(){return new _t(this.client)}get balance(){return new Ot(this.client)}get holder(){return new vt(this.client)}get ohlcv(){return new Pt(this.client)}get trending(){return new Ct(this.client)}check(t){return this.client._call("token_check",t)}list(t){return this.client._call("token_list",t)}retrieve(t){return this.client._call("token_retrieve",t)}search(t){return this.client._call("token_search",t)}},It=class{constructor(t){this.client=t}list(t){return this.client._call("transaction_list",t)}prepare(t){return this.client._call("transaction_prepare",t)}register(t){return this.client._call("transaction_register",t)}retrieve(t){return this.client._call("transaction_retrieve",t)}send(t){return this.client._call("transaction_send",t)}},gt=class{constructor(t){this.client=t}retrieve(t){return this.client._call("user_retrieve",t)}},kt=class{constructor(t){this.client=t}accept(t){return this.client._call("virtual-account_agreement_accept",t)}list(t){return this.client._call("virtual-account_agreement_list",t)}},At=class{constructor(t){this.client=t}delete(t){return this.client._call("virtual-account_bank-account_delete",t)}list(t){return this.client._call("virtual-account_bank-account_list",t)}register(t){return this.client._call("virtual-account_bank-account_register",t)}retrieve(t){return this.client._call("virtual-account_bank-account_retrieve",t)}},ft=class{constructor(t){this.client=t}continue(t){return this.client._call("virtual-account_kyc_continue",t)}restart(t){return this.client._call("virtual-account_kyc_restart",t)}},Rt=class{constructor(t){this.client=t}cancel(t){return this.client._call("virtual-account_offramp_cancel",t)}create(t){return this.client._call("virtual-account_offramp_create",t)}initiate(t){return this.client._call("virtual-account_offramp_initiate",t)}list(t){return this.client._call("virtual-account_offramp_list",t)}retrieve(t){return this.client._call("virtual-account_offramp_retrieve",t)}update(t){return this.client._call("virtual-account_offramp_update",t)}},wt=class{constructor(t){this.client=t}create(t){return this.client._call("virtual-account_onramp_payment_create",t)}retrieve(t){return this.client._call("virtual-account_onramp_payment_retrieve",t)}},Lt=class{constructor(t){this.client=t}get payment(){return new wt(this.client)}cancel(t){return this.client._call("virtual-account_onramp_cancel",t)}create(t){return this.client._call("virtual-account_onramp_create",t)}list(t){return this.client._call("virtual-account_onramp_list",t)}retrieve(t){return this.client._call("virtual-account_onramp_retrieve",t)}update(t){return this.client._call("virtual-account_onramp_update",t)}},Mt=class{constructor(t){this.client=t}list(t){return this.client._call("virtual-account_transaction_list",t)}},Tt=class{constructor(t){this.client=t}list(t){return this.client._call("virtual-account_wallet_list",t)}register(t){return this.client._call("virtual-account_wallet_register",t)}},xt=class{constructor(t){this.client=t}get agreement(){return new kt(this.client)}get bankAccount(){return new At(this.client)}get kyc(){return new ft(this.client)}get offramp(){return new Rt(this.client)}get onramp(){return new Lt(this.client)}get transaction(){return new Mt(this.client)}get wallet(){return new Tt(this.client)}create(t){return this.client._call("virtual-account_create",t)}retrieve(t){return this.client._call("virtual-account_retrieve",t)}},Vt=class{constructor(t){this.client=t}list(t){return this.client._call("wallet_activity_list",t)}},bt=class{constructor(t){this.client=t}retrieve(t){return this.client._call("wallet_pnl_retrieve",t)}},St=class{constructor(t){this.client=t}get activity(){return new Vt(this.client)}get pnl(){return new bt(this.client)}discover(t){return this.client._call("wallet_discover",t)}},p=class extends h{constructor(t={}){super(t)}get app(){return new v(this)}get card(){return new L(this)}get chain(){return new M(this)}get cli(){return new x(this)}get commerce(){return new B(this)}get deposit(){return new U(this)}get feedback(){return new E(this)}get gateway(){return new W(this)}get hyperliquid(){return new et(this)}get polymarket(){return new nt(this)}get predictionMarket(){return new lt(this)}get solana(){return new pt(this)}get swaps(){return new mt(this)}get token(){return new yt(this)}get transaction(){return new It(this)}get user(){return new gt(this)}get virtualAccount(){return new xt(this)}get wallet(){return new St(this)}buy(t){return this._call("buy",t)}login(t){return this._call("login",t)}refresh(t){return this._call("refresh",t)}verify(t){return this._call("verify",t)}};zt();Ft();var m=null;function jt(){return m||(m=new p({baseUrl:Ht(),auth:{type:"bearer",getToken:Et,refreshToken:async()=>{let e=Bt();if(!e?.refreshToken)throw new Error("No refresh token available");return(await Ut(e)).accessToken}},headers:qt()})),m}var oe=new Proxy({},{get(e,t){return Reflect.get(jt(),t)}});function ce(){m=null}export{p as a,oe as b,ce as c};