cards402 0.2.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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -0
  3. package/dist/__tests__/client.test.d.ts +2 -0
  4. package/dist/__tests__/client.test.d.ts.map +1 -0
  5. package/dist/__tests__/client.test.js +251 -0
  6. package/dist/__tests__/client.test.js.map +1 -0
  7. package/dist/__tests__/errors.test.d.ts +2 -0
  8. package/dist/__tests__/errors.test.d.ts.map +1 -0
  9. package/dist/__tests__/errors.test.js +177 -0
  10. package/dist/__tests__/errors.test.js.map +1 -0
  11. package/dist/__tests__/integration.test.d.ts +13 -0
  12. package/dist/__tests__/integration.test.d.ts.map +1 -0
  13. package/dist/__tests__/integration.test.js +223 -0
  14. package/dist/__tests__/integration.test.js.map +1 -0
  15. package/dist/client.d.ts +116 -0
  16. package/dist/client.d.ts.map +1 -0
  17. package/dist/client.js +261 -0
  18. package/dist/client.js.map +1 -0
  19. package/dist/errors.d.ts +66 -0
  20. package/dist/errors.d.ts.map +1 -0
  21. package/dist/errors.js +148 -0
  22. package/dist/errors.js.map +1 -0
  23. package/dist/index.d.ts +8 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +35 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/mcp.d.ts +3 -0
  28. package/dist/mcp.d.ts.map +1 -0
  29. package/dist/mcp.js +521 -0
  30. package/dist/mcp.js.map +1 -0
  31. package/dist/ows.d.ts +121 -0
  32. package/dist/ows.d.ts.map +1 -0
  33. package/dist/ows.js +300 -0
  34. package/dist/ows.js.map +1 -0
  35. package/dist/soroban.d.ts +48 -0
  36. package/dist/soroban.d.ts.map +1 -0
  37. package/dist/soroban.js +132 -0
  38. package/dist/soroban.js.map +1 -0
  39. package/dist/stellar.d.ts +53 -0
  40. package/dist/stellar.d.ts.map +1 -0
  41. package/dist/stellar.js +156 -0
  42. package/dist/stellar.js.map +1 -0
  43. package/package.json +73 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Structured error types for the cards402 SDK.
3
+ *
4
+ * Catch by type so your agent can handle each case without string-parsing:
5
+ *
6
+ * try {
7
+ * const card = await client.createOrder({ amount_usdc: '10.00' });
8
+ * } catch (err) {
9
+ * if (err instanceof SpendLimitError) { ... }
10
+ * if (err instanceof ServiceUnavailableError) { ... }
11
+ * }
12
+ */
13
+ /** Base class — all cards402 errors extend this. */
14
+ export declare class Cards402Error extends Error {
15
+ readonly code: string;
16
+ readonly status: number;
17
+ readonly raw?: unknown | undefined;
18
+ constructor(message: string, code: string, status: number, raw?: unknown | undefined);
19
+ }
20
+ /** The API key's spend limit has been reached. */
21
+ export declare class SpendLimitError extends Cards402Error {
22
+ readonly limit: string;
23
+ readonly spent: string;
24
+ constructor(limit: string, spent: string);
25
+ }
26
+ /** Too many orders created in the current window (60/hour). */
27
+ export declare class RateLimitError extends Cards402Error {
28
+ constructor();
29
+ }
30
+ /** Service is temporarily suspended (fulfillment circuit breaker tripped). */
31
+ export declare class ServiceUnavailableError extends Cards402Error {
32
+ constructor(message?: string);
33
+ }
34
+ /** XLM price feed is unavailable — retry or use USDC. */
35
+ export declare class PriceUnavailableError extends Cards402Error {
36
+ constructor(message?: string);
37
+ }
38
+ /** amount_usdc was missing, zero, or non-numeric. */
39
+ export declare class InvalidAmountError extends Cards402Error {
40
+ constructor(message?: string);
41
+ }
42
+ /** The API key is missing or invalid. */
43
+ export declare class AuthError extends Cards402Error {
44
+ constructor();
45
+ }
46
+ /** Order failed during fulfillment. A refund may be in progress. */
47
+ export declare class OrderFailedError extends Cards402Error {
48
+ readonly orderId: string;
49
+ readonly refund?: {
50
+ stellar_txid: string;
51
+ } | undefined;
52
+ constructor(orderId: string, reason: string, refund?: {
53
+ stellar_txid: string;
54
+ } | undefined);
55
+ }
56
+ /** Waiting for a card timed out — order may still be processing. */
57
+ export declare class WaitTimeoutError extends Cards402Error {
58
+ readonly orderId: string;
59
+ constructor(orderId: string, timeoutMs: number);
60
+ }
61
+ /**
62
+ * Parse a raw API error response into the appropriate typed error.
63
+ * Falls back to generic Cards402Error for unknown codes.
64
+ */
65
+ export declare function parseApiError(status: number, body: Record<string, unknown>): Cards402Error;
66
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oDAAoD;AACpD,qBAAa,aAAc,SAAQ,KAAK;aAGpB,IAAI,EAAE,MAAM;aACZ,MAAM,EAAE,MAAM;aACd,GAAG,CAAC,EAAE,OAAO;gBAH7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,OAAO,YAAA;CAMhC;AAED,kDAAkD;AAClD,qBAAa,eAAgB,SAAQ,aAAa;aAE9B,KAAK,EAAE,MAAM;aACb,KAAK,EAAE,MAAM;gBADb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM;CAUhC;AAED,+DAA+D;AAC/D,qBAAa,cAAe,SAAQ,aAAa;;CAUhD;AAED,8EAA8E;AAC9E,qBAAa,uBAAwB,SAAQ,aAAa;gBAC5C,OAAO,SAAuE;CAK3F;AAED,yDAAyD;AACzD,qBAAa,qBAAsB,SAAQ,aAAa;gBAEpD,OAAO,SAAuF;CAMjG;AAED,qDAAqD;AACrD,qBAAa,kBAAmB,SAAQ,aAAa;gBACvC,OAAO,SAA0E;CAK9F;AAED,yCAAyC;AACzC,qBAAa,SAAU,SAAQ,aAAa;;CAU3C;AAED,oEAAoE;AACpE,qBAAa,gBAAiB,SAAQ,aAAa;aAE/B,OAAO,EAAE,MAAM;aAEf,MAAM,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE;gBAFjC,OAAO,EAAE,MAAM,EAC/B,MAAM,EAAE,MAAM,EACE,MAAM,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,YAAA;CAapD;AAED,oEAAoE;AACpE,qBAAa,gBAAiB,SAAQ,aAAa;aAE/B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM,EAC/B,SAAS,EAAE,MAAM;CAWpB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CAsB1F"}
package/dist/errors.js ADDED
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ /**
3
+ * Structured error types for the cards402 SDK.
4
+ *
5
+ * Catch by type so your agent can handle each case without string-parsing:
6
+ *
7
+ * try {
8
+ * const card = await client.createOrder({ amount_usdc: '10.00' });
9
+ * } catch (err) {
10
+ * if (err instanceof SpendLimitError) { ... }
11
+ * if (err instanceof ServiceUnavailableError) { ... }
12
+ * }
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.WaitTimeoutError = exports.OrderFailedError = exports.AuthError = exports.InvalidAmountError = exports.PriceUnavailableError = exports.ServiceUnavailableError = exports.RateLimitError = exports.SpendLimitError = exports.Cards402Error = void 0;
16
+ exports.parseApiError = parseApiError;
17
+ /** Base class — all cards402 errors extend this. */
18
+ class Cards402Error extends Error {
19
+ code;
20
+ status;
21
+ raw;
22
+ constructor(message, code, status, raw) {
23
+ super(message);
24
+ this.code = code;
25
+ this.status = status;
26
+ this.raw = raw;
27
+ this.name = 'Cards402Error';
28
+ Object.setPrototypeOf(this, new.target.prototype);
29
+ }
30
+ }
31
+ exports.Cards402Error = Cards402Error;
32
+ /** The API key's spend limit has been reached. */
33
+ class SpendLimitError extends Cards402Error {
34
+ limit;
35
+ spent;
36
+ constructor(limit, spent) {
37
+ super(`Spend limit exceeded: $${spent} spent of $${limit} limit. Ask your operator to raise the limit or wait for the next reset period.`, 'spend_limit_exceeded', 403);
38
+ this.limit = limit;
39
+ this.spent = spent;
40
+ this.name = 'SpendLimitError';
41
+ Object.setPrototypeOf(this, new.target.prototype);
42
+ }
43
+ }
44
+ exports.SpendLimitError = SpendLimitError;
45
+ /** Too many orders created in the current window (60/hour). */
46
+ class RateLimitError extends Cards402Error {
47
+ constructor() {
48
+ super('Rate limit exceeded — maximum 60 orders per hour per API key. Wait before retrying.', 'rate_limit_exceeded', 429);
49
+ this.name = 'RateLimitError';
50
+ Object.setPrototypeOf(this, new.target.prototype);
51
+ }
52
+ }
53
+ exports.RateLimitError = RateLimitError;
54
+ /** Service is temporarily suspended (fulfillment circuit breaker tripped). */
55
+ class ServiceUnavailableError extends Cards402Error {
56
+ constructor(message = 'Card fulfillment is temporarily suspended. Retry in a few minutes.') {
57
+ super(message, 'service_temporarily_unavailable', 503);
58
+ this.name = 'ServiceUnavailableError';
59
+ Object.setPrototypeOf(this, new.target.prototype);
60
+ }
61
+ }
62
+ exports.ServiceUnavailableError = ServiceUnavailableError;
63
+ /** XLM price feed is unavailable — retry or use USDC. */
64
+ class PriceUnavailableError extends Cards402Error {
65
+ constructor(message = 'XLM price is temporarily unavailable. Retry shortly, or use payment_asset: "usdc".') {
66
+ super(message, 'price_unavailable', 503);
67
+ this.name = 'PriceUnavailableError';
68
+ Object.setPrototypeOf(this, new.target.prototype);
69
+ }
70
+ }
71
+ exports.PriceUnavailableError = PriceUnavailableError;
72
+ /** amount_usdc was missing, zero, or non-numeric. */
73
+ class InvalidAmountError extends Cards402Error {
74
+ constructor(message = 'Invalid amount_usdc — must be a positive number string, e.g. "10.00".') {
75
+ super(message, 'invalid_amount', 400);
76
+ this.name = 'InvalidAmountError';
77
+ Object.setPrototypeOf(this, new.target.prototype);
78
+ }
79
+ }
80
+ exports.InvalidAmountError = InvalidAmountError;
81
+ /** The API key is missing or invalid. */
82
+ class AuthError extends Cards402Error {
83
+ constructor() {
84
+ super('Invalid or missing API key. Pass it as the X-Api-Key header, or set CARDS402_API_KEY.', 'invalid_api_key', 401);
85
+ this.name = 'AuthError';
86
+ Object.setPrototypeOf(this, new.target.prototype);
87
+ }
88
+ }
89
+ exports.AuthError = AuthError;
90
+ /** Order failed during fulfillment. A refund may be in progress. */
91
+ class OrderFailedError extends Cards402Error {
92
+ orderId;
93
+ refund;
94
+ constructor(orderId, reason, refund) {
95
+ const refundNote = refund
96
+ ? ` Your payment is being refunded (txid: ${refund.stellar_txid}).`
97
+ : ' A refund will be processed if payment was received.';
98
+ super(`Order ${orderId} failed: ${reason}.${refundNote}`, 'order_failed', 200, {
99
+ orderId,
100
+ reason,
101
+ refund,
102
+ });
103
+ this.orderId = orderId;
104
+ this.refund = refund;
105
+ this.name = 'OrderFailedError';
106
+ Object.setPrototypeOf(this, new.target.prototype);
107
+ }
108
+ }
109
+ exports.OrderFailedError = OrderFailedError;
110
+ /** Waiting for a card timed out — order may still be processing. */
111
+ class WaitTimeoutError extends Cards402Error {
112
+ orderId;
113
+ constructor(orderId, timeoutMs) {
114
+ super(`Timed out waiting for card after ${timeoutMs / 1000}s (order: ${orderId}). ` +
115
+ 'Poll GET /v1/orders/:id to check status — it may still complete.', 'wait_timeout', 408);
116
+ this.orderId = orderId;
117
+ this.name = 'WaitTimeoutError';
118
+ Object.setPrototypeOf(this, new.target.prototype);
119
+ }
120
+ }
121
+ exports.WaitTimeoutError = WaitTimeoutError;
122
+ /**
123
+ * Parse a raw API error response into the appropriate typed error.
124
+ * Falls back to generic Cards402Error for unknown codes.
125
+ */
126
+ function parseApiError(status, body) {
127
+ const code = String(body.error ?? 'unknown');
128
+ const message = String(body.message ?? body.error ?? 'Unknown error');
129
+ switch (code) {
130
+ case 'spend_limit_exceeded':
131
+ return new SpendLimitError(String(body.limit ?? '?'), String(body.spent ?? '?'));
132
+ case 'rate_limit_exceeded':
133
+ return new RateLimitError();
134
+ case 'service_temporarily_unavailable':
135
+ return new ServiceUnavailableError(message);
136
+ case 'price_unavailable':
137
+ case 'xlm_price_unavailable':
138
+ return new PriceUnavailableError(message);
139
+ case 'invalid_amount':
140
+ return new InvalidAmountError(message);
141
+ case 'missing_api_key':
142
+ case 'invalid_api_key':
143
+ return new AuthError();
144
+ default:
145
+ return new Cards402Error(message, code, status, body);
146
+ }
147
+ }
148
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAgIH,sCAsBC;AApJD,oDAAoD;AACpD,MAAa,aAAc,SAAQ,KAAK;IAGpB;IACA;IACA;IAJlB,YACE,OAAe,EACC,IAAY,EACZ,MAAc,EACd,GAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,QAAG,GAAH,GAAG,CAAU;QAG7B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAXD,sCAWC;AAED,kDAAkD;AAClD,MAAa,eAAgB,SAAQ,aAAa;IAE9B;IACA;IAFlB,YACkB,KAAa,EACb,KAAa;QAE7B,KAAK,CACH,0BAA0B,KAAK,cAAc,KAAK,iFAAiF,EACnI,sBAAsB,EACtB,GAAG,CACJ,CAAC;QAPc,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAQ;QAO7B,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAbD,0CAaC;AAED,+DAA+D;AAC/D,MAAa,cAAe,SAAQ,aAAa;IAC/C;QACE,KAAK,CACH,qFAAqF,EACrF,qBAAqB,EACrB,GAAG,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,MAAM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AK,IAAI,eAAe,CAAC,CAAC;IAEtE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,sBAAsB;YACzB,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC;QACnF,KAAK,qBAAqB;YACxB,OAAO,IAAI,cAAc,EAAE,CAAC;QAC9B,KAAK,iCAAiC;YACpC,OAAO,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAC9C,KAAK,mBAAmB,CAAC;QACzB,KAAK,uBAAuB;YAC1B,OAAO,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAC5C,KAAK,gBAAgB;YACnB,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACzC,KAAK,iBAAiB,CAAC;QACvB,KAAK,iBAAiB;YACpB,OAAO,IAAI,SAAS,EAAE,CAAC;QACzB;YACE,OAAO,IAAI,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { Cards402Client } from './client';
2
+ export type { OrderOptions, OrderResponse, OrderStatus, OrderListItem, OrderPhase, CardDetails, PaymentInstructions, Budget, UsageSummary, } from './client';
3
+ export { createWallet, getBalance, addUsdcTrustline, payViaContract, purchaseCard, payVCC, } from './stellar';
4
+ export type { WalletInfo, PayOpts } from './stellar';
5
+ export { createOWSWallet, importStellarKey, getOWSPublicKey, getOWSBalance, addUsdcTrustlineOWS, payViaContractOWS, purchaseCardOWS, onboardAgent, payVCCOWS, } from './ows';
6
+ export type { TrustlineOpts, PayViaContractOwsOpts, PayVCCOwsOpts, PurchaseCardOwsOpts, OnboardAgentOpts, OnboardAgentResult, } from './ows';
7
+ export { Cards402Error, SpendLimitError, RateLimitError, ServiceUnavailableError, PriceUnavailableError, InvalidAmountError, AuthError, OrderFailedError, WaitTimeoutError, } from './errors';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,YAAY,GACb,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EAEZ,MAAM,GACP,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,YAAY,EAEZ,SAAS,GACV,MAAM,OAAO,CAAC;AACf,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WaitTimeoutError = exports.OrderFailedError = exports.AuthError = exports.InvalidAmountError = exports.PriceUnavailableError = exports.ServiceUnavailableError = exports.RateLimitError = exports.SpendLimitError = exports.Cards402Error = exports.payVCCOWS = exports.onboardAgent = exports.purchaseCardOWS = exports.payViaContractOWS = exports.addUsdcTrustlineOWS = exports.getOWSBalance = exports.getOWSPublicKey = exports.importStellarKey = exports.createOWSWallet = exports.payVCC = exports.purchaseCard = exports.payViaContract = exports.addUsdcTrustline = exports.getBalance = exports.createWallet = exports.Cards402Client = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "Cards402Client", { enumerable: true, get: function () { return client_1.Cards402Client; } });
6
+ var stellar_1 = require("./stellar");
7
+ Object.defineProperty(exports, "createWallet", { enumerable: true, get: function () { return stellar_1.createWallet; } });
8
+ Object.defineProperty(exports, "getBalance", { enumerable: true, get: function () { return stellar_1.getBalance; } });
9
+ Object.defineProperty(exports, "addUsdcTrustline", { enumerable: true, get: function () { return stellar_1.addUsdcTrustline; } });
10
+ Object.defineProperty(exports, "payViaContract", { enumerable: true, get: function () { return stellar_1.payViaContract; } });
11
+ Object.defineProperty(exports, "purchaseCard", { enumerable: true, get: function () { return stellar_1.purchaseCard; } });
12
+ // Back-compat alias for payViaContract.
13
+ Object.defineProperty(exports, "payVCC", { enumerable: true, get: function () { return stellar_1.payVCC; } });
14
+ var ows_1 = require("./ows");
15
+ Object.defineProperty(exports, "createOWSWallet", { enumerable: true, get: function () { return ows_1.createOWSWallet; } });
16
+ Object.defineProperty(exports, "importStellarKey", { enumerable: true, get: function () { return ows_1.importStellarKey; } });
17
+ Object.defineProperty(exports, "getOWSPublicKey", { enumerable: true, get: function () { return ows_1.getOWSPublicKey; } });
18
+ Object.defineProperty(exports, "getOWSBalance", { enumerable: true, get: function () { return ows_1.getOWSBalance; } });
19
+ Object.defineProperty(exports, "addUsdcTrustlineOWS", { enumerable: true, get: function () { return ows_1.addUsdcTrustlineOWS; } });
20
+ Object.defineProperty(exports, "payViaContractOWS", { enumerable: true, get: function () { return ows_1.payViaContractOWS; } });
21
+ Object.defineProperty(exports, "purchaseCardOWS", { enumerable: true, get: function () { return ows_1.purchaseCardOWS; } });
22
+ Object.defineProperty(exports, "onboardAgent", { enumerable: true, get: function () { return ows_1.onboardAgent; } });
23
+ // Back-compat alias.
24
+ Object.defineProperty(exports, "payVCCOWS", { enumerable: true, get: function () { return ows_1.payVCCOWS; } });
25
+ var errors_1 = require("./errors");
26
+ Object.defineProperty(exports, "Cards402Error", { enumerable: true, get: function () { return errors_1.Cards402Error; } });
27
+ Object.defineProperty(exports, "SpendLimitError", { enumerable: true, get: function () { return errors_1.SpendLimitError; } });
28
+ Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return errors_1.RateLimitError; } });
29
+ Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return errors_1.ServiceUnavailableError; } });
30
+ Object.defineProperty(exports, "PriceUnavailableError", { enumerable: true, get: function () { return errors_1.PriceUnavailableError; } });
31
+ Object.defineProperty(exports, "InvalidAmountError", { enumerable: true, get: function () { return errors_1.InvalidAmountError; } });
32
+ Object.defineProperty(exports, "AuthError", { enumerable: true, get: function () { return errors_1.AuthError; } });
33
+ Object.defineProperty(exports, "OrderFailedError", { enumerable: true, get: function () { return errors_1.OrderFailedError; } });
34
+ Object.defineProperty(exports, "WaitTimeoutError", { enumerable: true, get: function () { return errors_1.WaitTimeoutError; } });
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AAavB,qCAQmB;AAPjB,uGAAA,YAAY,OAAA;AACZ,qGAAA,UAAU,OAAA;AACV,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,uGAAA,YAAY,OAAA;AACZ,wCAAwC;AACxC,iGAAA,MAAM,OAAA;AAIR,6BAWe;AAVb,sGAAA,eAAe,OAAA;AACf,uGAAA,gBAAgB,OAAA;AAChB,sGAAA,eAAe,OAAA;AACf,oGAAA,aAAa,OAAA;AACb,0GAAA,mBAAmB,OAAA;AACnB,wGAAA,iBAAiB,OAAA;AACjB,sGAAA,eAAe,OAAA;AACf,mGAAA,YAAY,OAAA;AACZ,qBAAqB;AACrB,gGAAA,SAAS,OAAA;AAWX,mCAUkB;AAThB,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,iHAAA,uBAAuB,OAAA;AACvB,+GAAA,qBAAqB,OAAA;AACrB,4GAAA,kBAAkB,OAAA;AAClB,mGAAA,SAAS,OAAA;AACT,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA"}
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":""}