@moonpay/cli 1.33.1 → 1.33.2
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-RRJ343JG.js → chunk-22HVBWTR.js} +1 -1
- package/dist/{chunk-BQLXCAZK.js → chunk-26E6PGV7.js} +3 -3
- package/dist/{chunk-CDSUIZGH.js → chunk-KJSPAQFX.js} +1 -1
- package/dist/{chunk-M5QR3774.js → chunk-P6ZQQFH4.js} +2 -2
- package/dist/{client-6AXSU6DZ.js → client-ZMMWSH6J.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{ledger-PZSSY7JC.js → ledger-T6T6DATW.js} +2 -2
- package/dist/{mcp-CAYALHCH.js → mcp-GUB64TXZ.js} +1 -1
- package/dist/{store-XVTFEQKB.js → store-Z7OV22CM.js} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
process.noDeprecation = true; import { createRequire as __createRequire } from "module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
import{f as it,g as lt,j as ut,m as ct,n as ot,o as at,p as pt}from"./chunk-CDSUIZGH.js";var n=class extends Error{constructor(r,i,u){super(r);this.status=i;this.toolName=u;this.name="MoonPayError"}},o=class extends n{constructor(t="Authentication required"){super(t,401),this.name="AuthError"}},a=class extends n{constructor(t="Rate limit exceeded"){super(t,429),this.name="RateLimitError"}},s=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"}},p=class extends n{constructor(t,r){super(`Tool "${t}" has been renamed to "${r}"`,410,t),this.name="ToolRenamedError",this.newName=r}};var mt="https://agents.moonpay.com",ht=6e4,h=class{constructor(t={}){this.baseUrl=(t.baseUrl??mt).replace(/\/$/,""),this.auth=t.auth??{type:"none"},this.timeout=t.timeout??ht,this.headers=t.headers??{}}async _call(t,r){let i=`${this.baseUrl}/api/tools/${encodeURIComponent(t)}`,u=await this.buildHeaders(),c=await fetch(i,{method:"POST",headers:u,body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout)});if(c.status===401&&this.auth.type==="bearer"&&this.auth.refreshToken)try{let st=await this.auth.refreshToken();u.Authorization=`Bearer ${st}`,c=await fetch(i,{method:"POST",headers:u,body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout)})}catch{throw new o("Token refresh failed")}return this.handleResponse(c,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 i;try{i=await t.json()}catch{i={error:t.statusText}}let u=i?.error??i?.message,c=typeof u=="string"?u:u?JSON.stringify(u):`Request failed with status ${t.status}`;switch(t.status){case 400:throw new s(c,r);case 401:throw new o(c);case 404:throw new l(r);case 410:throw new p(r,i?.newName??"unknown");case 429:throw new a(c);default:throw new n(c,t.status,r)}}};var _=class{constructor(t){this.client=t}list(t){return this.client._call("chain_list",t)}retrieve(t){return this.client._call("chain_retrieve",t)}},v=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)}},O=class{constructor(t){this.client=t}get activation(){return new v(this.client)}},d=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)}},k=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)}},C=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)}},I=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)}},A=class{constructor(t){this.client=t}get cart(){return new d(this.client)}get checkout(){return new k(this.client)}get product(){return new C(this.client)}get store(){return new I(this.client)}},y=class{constructor(t){this.client=t}list(t){return this.client._call("deposit_transaction_list",t)}},g=class{constructor(t){this.client=t}get transaction(){return new y(this.client)}create(t){return this.client._call("deposit_create",t)}retrieve(t){return this.client._call("deposit_retrieve",t)}},f=class{constructor(t){this.client=t}create(t){return this.client._call("feedback_create",t)}},M=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_activity_list",t)}},R=class{constructor(t){this.client=t}retrieve(t){return this.client._call("prediction-market_market_event_retrieve",t)}},T=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_price_history_list",t)}},V=class{constructor(t){this.client=t}get history(){return new T(this.client)}retrieve(t){return this.client._call("prediction-market_market_price_retrieve",t)}},w=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_tag_list",t)}},L=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_trending_list",t)}},x=class{constructor(t){this.client=t}get event(){return new R(this.client)}get price(){return new V(this.client)}get tag(){return new w(this.client)}get trending(){return new L(this.client)}search(t){return this.client._call("prediction-market_market_search",t)}},S=class{constructor(t){this.client=t}retrieve(t){return this.client._call("prediction-market_pnl_retrieve",t)}},b=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)}},B=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_trade_list",t)}},U=class{constructor(t){this.client=t}create(t){return this.client._call("prediction-market_user_create",t)}},E=class{constructor(t){this.client=t}get activity(){return new M(this.client)}get market(){return new x(this.client)}get pnl(){return new S(this.client)}get position(){return new b(this.client)}get trade(){return new B(this.client)}get user(){return new U(this.client)}},D=class{constructor(t){this.client=t}build(t){return this.client._call("swaps_transaction_build",t)}},W=class{constructor(t){this.client=t}get transaction(){return new D(this.client)}},H=class{constructor(t){this.client=t}list(t){return this.client._call("token_balance_list",t)}},$=class{constructor(t){this.client=t}list(t){return this.client._call("token_holder_list",t)}},F=class{constructor(t){this.client=t}list(t){return this.client._call("token_trending_list",t)}},K=class{constructor(t){this.client=t}get balance(){return new H(this.client)}get holder(){return new $(this.client)}get trending(){return new F(this.client)}check(t){return this.client._call("token_check",t)}retrieve(t){return this.client._call("token_retrieve",t)}search(t){return this.client._call("token_search",t)}transfer(t){return this.client._call("token_transfer",t)}},j=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)}},J=class{constructor(t){this.client=t}retrieve(t){return this.client._call("user_retrieve",t)}},q=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)}},z=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)}},G=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)}},Q=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)}},X=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)}},Y=class{constructor(t){this.client=t}get payment(){return new X(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)}},Z=class{constructor(t){this.client=t}list(t){return this.client._call("virtual-account_transaction_list",t)}},N=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)}},tt=class{constructor(t){this.client=t}get agreement(){return new q(this.client)}get bankAccount(){return new z(this.client)}get kyc(){return new G(this.client)}get offramp(){return new Q(this.client)}get onramp(){return new Y(this.client)}get transaction(){return new Z(this.client)}get wallet(){return new N(this.client)}create(t){return this.client._call("virtual-account_create",t)}retrieve(t){return this.client._call("virtual-account_retrieve",t)}},et=class{constructor(t){this.client=t}list(t){return this.client._call("wallet_activity_list",t)}},rt=class{constructor(t){this.client=t}retrieve(t){return this.client._call("wallet_pnl_retrieve",t)}},nt=class{constructor(t){this.client=t}get activity(){return new et(this.client)}get pnl(){return new rt(this.client)}discover(t){return this.client._call("wallet_discover",t)}},m=class extends h{constructor(t={}){super(t)}get chain(){return new _(this)}get cli(){return new O(this)}get commerce(){return new A(this)}get deposit(){return new g(this)}get feedback(){return new f(this)}get predictionMarket(){return new E(this)}get swaps(){return new W(this)}get token(){return new K(this)}get transaction(){return new j(this)}get user(){return new J(this)}get virtualAccount(){return new tt(this)}get wallet(){return new nt(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)}};pt();lt();var P=null;function Pt(){return P||(P=new m({baseUrl:ct(),auth:{type:"bearer",getToken:at,refreshToken:async()=>{let e=ut();if(!e?.refreshToken)throw new Error("No refresh token available");return(await ot(e)).accessToken}},headers:it()})),P}var Rt=new Proxy({},{get(e,t){return Reflect.get(Pt(),t)}});function Tt(){P=null}export{m as a,Rt as b,Tt as c};
|
|
2
|
+
import{f as it,g as lt,j as ut,m as ct,n as ot,o as at,p as pt}from"./chunk-KJSPAQFX.js";var n=class extends Error{constructor(r,i,u){super(r);this.status=i;this.toolName=u;this.name="MoonPayError"}},o=class extends n{constructor(t="Authentication required"){super(t,401),this.name="AuthError"}},a=class extends n{constructor(t="Rate limit exceeded"){super(t,429),this.name="RateLimitError"}},s=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"}},p=class extends n{constructor(t,r){super(`Tool "${t}" has been renamed to "${r}"`,410,t),this.name="ToolRenamedError",this.newName=r}};var mt="https://agents.moonpay.com",ht=6e4,h=class{constructor(t={}){this.baseUrl=(t.baseUrl??mt).replace(/\/$/,""),this.auth=t.auth??{type:"none"},this.timeout=t.timeout??ht,this.headers=t.headers??{}}async _call(t,r){let i=`${this.baseUrl}/api/tools/${encodeURIComponent(t)}`,u=await this.buildHeaders(),c=await fetch(i,{method:"POST",headers:u,body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout)});if(c.status===401&&this.auth.type==="bearer"&&this.auth.refreshToken)try{let st=await this.auth.refreshToken();u.Authorization=`Bearer ${st}`,c=await fetch(i,{method:"POST",headers:u,body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout)})}catch{throw new o("Token refresh failed")}return this.handleResponse(c,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 i;try{i=await t.json()}catch{i={error:t.statusText}}let u=i?.error??i?.message,c=typeof u=="string"?u:u?JSON.stringify(u):`Request failed with status ${t.status}`;switch(t.status){case 400:throw new s(c,r);case 401:throw new o(c);case 404:throw new l(r);case 410:throw new p(r,i?.newName??"unknown");case 429:throw new a(c);default:throw new n(c,t.status,r)}}};var _=class{constructor(t){this.client=t}list(t){return this.client._call("chain_list",t)}retrieve(t){return this.client._call("chain_retrieve",t)}},v=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)}},O=class{constructor(t){this.client=t}get activation(){return new v(this.client)}},d=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)}},k=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)}},C=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)}},I=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)}},A=class{constructor(t){this.client=t}get cart(){return new d(this.client)}get checkout(){return new k(this.client)}get product(){return new C(this.client)}get store(){return new I(this.client)}},y=class{constructor(t){this.client=t}list(t){return this.client._call("deposit_transaction_list",t)}},g=class{constructor(t){this.client=t}get transaction(){return new y(this.client)}create(t){return this.client._call("deposit_create",t)}retrieve(t){return this.client._call("deposit_retrieve",t)}},f=class{constructor(t){this.client=t}create(t){return this.client._call("feedback_create",t)}},M=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_activity_list",t)}},R=class{constructor(t){this.client=t}retrieve(t){return this.client._call("prediction-market_market_event_retrieve",t)}},T=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_price_history_list",t)}},V=class{constructor(t){this.client=t}get history(){return new T(this.client)}retrieve(t){return this.client._call("prediction-market_market_price_retrieve",t)}},w=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_tag_list",t)}},L=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_market_trending_list",t)}},x=class{constructor(t){this.client=t}get event(){return new R(this.client)}get price(){return new V(this.client)}get tag(){return new w(this.client)}get trending(){return new L(this.client)}search(t){return this.client._call("prediction-market_market_search",t)}},S=class{constructor(t){this.client=t}retrieve(t){return this.client._call("prediction-market_pnl_retrieve",t)}},b=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)}},B=class{constructor(t){this.client=t}list(t){return this.client._call("prediction-market_trade_list",t)}},U=class{constructor(t){this.client=t}create(t){return this.client._call("prediction-market_user_create",t)}},E=class{constructor(t){this.client=t}get activity(){return new M(this.client)}get market(){return new x(this.client)}get pnl(){return new S(this.client)}get position(){return new b(this.client)}get trade(){return new B(this.client)}get user(){return new U(this.client)}},D=class{constructor(t){this.client=t}build(t){return this.client._call("swaps_transaction_build",t)}},W=class{constructor(t){this.client=t}get transaction(){return new D(this.client)}},H=class{constructor(t){this.client=t}list(t){return this.client._call("token_balance_list",t)}},$=class{constructor(t){this.client=t}list(t){return this.client._call("token_holder_list",t)}},F=class{constructor(t){this.client=t}list(t){return this.client._call("token_trending_list",t)}},K=class{constructor(t){this.client=t}get balance(){return new H(this.client)}get holder(){return new $(this.client)}get trending(){return new F(this.client)}check(t){return this.client._call("token_check",t)}retrieve(t){return this.client._call("token_retrieve",t)}search(t){return this.client._call("token_search",t)}transfer(t){return this.client._call("token_transfer",t)}},j=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)}},J=class{constructor(t){this.client=t}retrieve(t){return this.client._call("user_retrieve",t)}},q=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)}},z=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)}},G=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)}},Q=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)}},X=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)}},Y=class{constructor(t){this.client=t}get payment(){return new X(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)}},Z=class{constructor(t){this.client=t}list(t){return this.client._call("virtual-account_transaction_list",t)}},N=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)}},tt=class{constructor(t){this.client=t}get agreement(){return new q(this.client)}get bankAccount(){return new z(this.client)}get kyc(){return new G(this.client)}get offramp(){return new Q(this.client)}get onramp(){return new Y(this.client)}get transaction(){return new Z(this.client)}get wallet(){return new N(this.client)}create(t){return this.client._call("virtual-account_create",t)}retrieve(t){return this.client._call("virtual-account_retrieve",t)}},et=class{constructor(t){this.client=t}list(t){return this.client._call("wallet_activity_list",t)}},rt=class{constructor(t){this.client=t}retrieve(t){return this.client._call("wallet_pnl_retrieve",t)}},nt=class{constructor(t){this.client=t}get activity(){return new et(this.client)}get pnl(){return new rt(this.client)}discover(t){return this.client._call("wallet_discover",t)}},m=class extends h{constructor(t={}){super(t)}get chain(){return new _(this)}get cli(){return new O(this)}get commerce(){return new A(this)}get deposit(){return new g(this)}get feedback(){return new f(this)}get predictionMarket(){return new E(this)}get swaps(){return new W(this)}get token(){return new K(this)}get transaction(){return new j(this)}get user(){return new J(this)}get virtualAccount(){return new tt(this)}get wallet(){return new nt(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)}};pt();lt();var P=null;function Pt(){return P||(P=new m({baseUrl:ct(),auth:{type:"bearer",getToken:at,refreshToken:async()=>{let e=ut();if(!e?.refreshToken)throw new Error("No refresh token available");return(await ot(e)).accessToken}},headers:it()})),P}var Rt=new Proxy({},{get(e,t){return Reflect.get(Pt(),t)}});function Tt(){P=null}export{m as a,Rt as b,Tt as c};
|