@cedros/pay-react 1.1.5 → 1.1.9

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 (57) hide show
  1. package/dist/CedrosContext-C2v_s8cc.js +6 -0
  2. package/dist/CedrosContext-D7nh5-Zh.mjs +2100 -0
  3. package/dist/WalletManager-B5KLZK2D.js +1 -0
  4. package/dist/WalletManager-oEjZhaFk.mjs +219 -0
  5. package/dist/components/CedrosPay.d.ts.map +1 -1
  6. package/dist/components/admin/AISettingsSection.d.ts.map +1 -1
  7. package/dist/components/admin/CouponsSection.d.ts.map +1 -1
  8. package/dist/components/admin/ErrorBanner.d.ts +11 -0
  9. package/dist/components/admin/ErrorBanner.d.ts.map +1 -0
  10. package/dist/components/admin/FAQSection.d.ts.map +1 -1
  11. package/dist/components/admin/MessagingSection.d.ts.map +1 -1
  12. package/dist/components/admin/OverviewSection.d.ts.map +1 -1
  13. package/dist/components/admin/ProductsSection.d.ts.map +1 -1
  14. package/dist/components/admin/RefundsSection.d.ts.map +1 -1
  15. package/dist/components/admin/SingleCategorySettings.d.ts.map +1 -1
  16. package/dist/components/admin/StorefrontSection.d.ts.map +1 -1
  17. package/dist/components/admin/SubscriptionsSection.d.ts.map +1 -1
  18. package/dist/components/admin/TransactionsSection.d.ts.map +1 -1
  19. package/dist/context/CedrosContext.d.ts +9 -3
  20. package/dist/context/CedrosContext.d.ts.map +1 -1
  21. package/dist/crypto-only.d.ts +9 -19
  22. package/dist/crypto-only.d.ts.map +1 -1
  23. package/dist/crypto-only.js +1 -1
  24. package/dist/crypto-only.mjs +766 -32
  25. package/dist/index-BFt38o8Q.mjs +88 -0
  26. package/dist/index-S3b2N8tp.js +136 -0
  27. package/dist/index-WcOlBYZJ.js +1 -0
  28. package/dist/{index-Bzp2srIS.mjs → index-iIxY1o71.mjs} +10413 -9402
  29. package/dist/index.d.ts +1 -7
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +1 -1
  32. package/dist/index.mjs +68 -75
  33. package/dist/managers/ManagerCache.d.ts +2 -2
  34. package/dist/managers/ManagerCache.d.ts.map +1 -1
  35. package/dist/pay-react.css +1 -1
  36. package/dist/{sections-D6R2jRAp.js → sections-bhZyRM7o.js} +1 -1
  37. package/dist/{sections-cz9ughWO.mjs → sections-otLBNrzu.mjs} +2 -2
  38. package/dist/solanaCheck-BS3QTE63.js +6 -0
  39. package/dist/solanaCheck-IlYsbXDd.mjs +27 -0
  40. package/dist/stripe-only.d.ts +4 -21
  41. package/dist/stripe-only.d.ts.map +1 -1
  42. package/dist/stripe-only.js +1 -1
  43. package/dist/stripe-only.mjs +71 -29
  44. package/dist/testing/index.js +1 -1
  45. package/dist/testing/index.mjs +1 -1
  46. package/dist/types/componentOptions.d.ts +15 -2
  47. package/dist/types/componentOptions.d.ts.map +1 -1
  48. package/dist/utils/index.d.ts +0 -1
  49. package/dist/utils/index.d.ts.map +1 -1
  50. package/dist/walletPool-BR6etEiq.mjs +67 -0
  51. package/dist/walletPool-BZyAG4YS.js +1 -0
  52. package/package.json +6 -1
  53. package/dist/CedrosContext-DUT3cLZg.mjs +0 -2474
  54. package/dist/CedrosContext-efFL4kQz.js +0 -11
  55. package/dist/index-CFzfjC82.js +0 -136
  56. package/dist/styles-C4-_hbgr.js +0 -1
  57. package/dist/styles-QcAsIVWl.mjs +0 -1909
@@ -0,0 +1 @@
1
+ "use strict";var k=Object.create;var h=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var S=(i,r,e,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of b(r))!T.call(i,n)&&n!==e&&h(i,n,{get:()=>r[n],enumerable:!(a=R(r,n))||a.enumerable});return i};var x=(i,r,e)=>(e=i!=null?k(C(i)):{},S(r||!i||!i.__esModule?h(e,"default",{value:i,enumerable:!0}):e,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@solana/web3.js"),w=require("@solana/spl-token"),t=require("./CedrosContext-C2v_s8cc.js"),p=require("./index-WcOlBYZJ.js");class B{connection;cluster;endpoint;allowUnknownMint;rpcRateLimiter=t.createRateLimiter({maxRequests:50,windowMs:6e4});rpcCircuitBreaker=t.createCircuitBreaker({failureThreshold:5,timeout:1e4,name:"solana-rpc"});constructor(r="mainnet-beta",e,a=!1){this.cluster=r,this.endpoint=e,this.allowUnknownMint=a,this.connection=this.createConnection()}createConnection(){const r=this.endpoint??s.clusterApiUrl(this.cluster);return new s.Connection(r,"confirmed")}transformRpcError(r){const e=r instanceof Error?r.message:typeof r=="string"?r:String(r);return e.includes("403")||e.includes("Access forbidden")?new Error("Public Solana RPC access denied. Please configure a custom RPC endpoint (e.g., from Helius, QuickNode, or Alchemy) in your CedrosProvider config using the solanaEndpoint option."):e.includes("429")||e.includes("Too Many Requests")?new Error("Solana RPC rate limit exceeded. Please configure a custom RPC endpoint with higher limits in your CedrosProvider config using the solanaEndpoint option."):r instanceof Error?r:new Error(e)}async buildTransaction(r){const{requirement:e,payerPublicKey:a,blockhash:n}=r;if(!e||!e.payTo)throw new Error("Invalid requirement: missing payTo");t.getLogger().debug("[WalletManager] Building transaction for resource:",e.resource);const o=new s.Transaction,l=this.resolveAmountInMinorUnits(e),u=e.asset;if(!u)throw new Error("asset is required in x402 requirement");const g=t.validateX402Asset(u,e.resource,this.allowUnknownMint);if(!g.isValid&&g.error)throw new Error(g.error);g.warning&&t.getLogger().warn(g.warning);const P=new s.PublicKey(u),f=await w.getAssociatedTokenAddress(P,a);if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");let y;try{y=await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getAccountInfo(f),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-account-info"}))}catch(c){throw c instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(c)}if(!y)throw new Error("Payer is missing an associated token account for this mint");let d;try{d=e.extra?.recipientTokenAccount?new s.PublicKey(e.extra.recipientTokenAccount):new s.PublicKey(e.payTo)}catch{throw new Error("We are currently unable to process payment, please try again later")}if(o.add(w.createTransferInstruction(f,d,a,l)),e.extra?.memo){const{TransactionInstruction:c}=await import("@solana/web3.js"),E=new c({keys:[],programId:new s.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),data:Buffer.from(e.extra.memo,"utf8")});o.add(E)}let m;if(n)m=n;else{if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{m=(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getLatestBlockhash(),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-blockhash"}))).blockhash}catch(c){throw c instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(c)}}return o.recentBlockhash=m,e.extra?.feePayer?o.feePayer=new s.PublicKey(e.extra.feePayer):o.feePayer=a,o}resolveAmountInMinorUnits(r){const e=parseInt(r.maxAmountRequired,10);if(Number.isNaN(e)||e<=0)throw new Error("Invalid maxAmountRequired in requirement");return e}buildPaymentPayload(r){const{requirement:e,signedTx:a,payerPublicKey:n}=r;return{x402Version:0,scheme:e.scheme,network:e.network,payload:{signature:a.signature,transaction:a.serialized,payer:n.toString(),memo:e.extra?.memo,recipientTokenAccount:e.extra?.recipientTokenAccount}}}async signTransaction(r){const{transaction:e,signTransaction:a}=r;t.getLogger().debug("[WalletManager] Requesting wallet to sign transaction");const n=await a(e),o=n.serialize(),l=n.signatures[0]?.signature;if(!l)throw new Error("Signed transaction missing signature");const u=p.bs58.encode(l);return t.getLogger().debug("[WalletManager] Transaction signed with signature:",u.substring(0,20)+"..."),{serialized:t.gBase64.fromUint8Array(o),signature:u}}deserializeTransaction(r){try{const e=t.gBase64.toUint8Array(r);return s.Transaction.from(e)}catch(e){throw new Error(`Failed to deserialize transaction: ${t.formatError(e,"Unknown error")}`)}}async partiallySignTransaction(r){const{transaction:e,signTransaction:a,blockhash:n}=r;n&&e.recentBlockhash!==n&&(e.recentBlockhash=n);const o=await a(e),l=o.signatures[0]?.signature;if(l){const g=p.bs58.encode(l);t.getLogger().debug("[WalletManager] Partially signed with signature:",g.substring(0,20)+"...")}const u=o.serialize({requireAllSignatures:!1,verifySignatures:!1});return t.gBase64.fromUint8Array(u)}async getBalance(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{return await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getBalance(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-balance"}))/s.LAMPORTS_PER_SOL}catch(e){throw e instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(e)}}async verifyTransaction(r){if(!this.rpcRateLimiter.tryConsume())return t.getLogger().warn("[WalletManager] RPC rate limit exceeded for transaction verification"),!1;try{return!!(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getSignatureStatus(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-verify-tx"}))).value?.confirmationStatus}catch(e){return e instanceof t.CircuitBreakerOpenError&&t.getLogger().warn("[WalletManager] Circuit breaker OPEN - cannot verify transaction"),!1}}}exports.WalletManager=B;
@@ -0,0 +1,219 @@
1
+ import { clusterApiUrl as E, Connection as R, Transaction as P, PublicKey as l, LAMPORTS_PER_SOL as T } from "@solana/web3.js";
2
+ import { getAssociatedTokenAddress as x, createTransferInstruction as A } from "@solana/spl-token";
3
+ import { c as S, b as B, i as u, k as v, r as m, g, e as f, l as h, m as M } from "./CedrosContext-D7nh5-Zh.mjs";
4
+ import { b as k } from "./index-BFt38o8Q.mjs";
5
+ class z {
6
+ connection;
7
+ cluster;
8
+ endpoint;
9
+ allowUnknownMint;
10
+ rpcRateLimiter = S({
11
+ maxRequests: 50,
12
+ windowMs: 6e4
13
+ // 50 requests per minute for RPC calls
14
+ });
15
+ rpcCircuitBreaker = B({
16
+ failureThreshold: 5,
17
+ timeout: 1e4,
18
+ // 10 seconds for faster recovery in payment flows
19
+ name: "solana-rpc"
20
+ });
21
+ constructor(r = "mainnet-beta", e, t = !1) {
22
+ this.cluster = r, this.endpoint = e, this.allowUnknownMint = t, this.connection = this.createConnection();
23
+ }
24
+ /**
25
+ * Create Solana RPC connection
26
+ */
27
+ createConnection() {
28
+ const r = this.endpoint ?? E(this.cluster);
29
+ return new R(r, "confirmed");
30
+ }
31
+ /**
32
+ * Transform RPC errors into user-friendly messages
33
+ */
34
+ transformRpcError(r) {
35
+ const e = r instanceof Error ? r.message : typeof r == "string" ? r : String(r);
36
+ return e.includes("403") || e.includes("Access forbidden") ? new Error(
37
+ "Public Solana RPC access denied. Please configure a custom RPC endpoint (e.g., from Helius, QuickNode, or Alchemy) in your CedrosProvider config using the solanaEndpoint option."
38
+ ) : e.includes("429") || e.includes("Too Many Requests") ? new Error(
39
+ "Solana RPC rate limit exceeded. Please configure a custom RPC endpoint with higher limits in your CedrosProvider config using the solanaEndpoint option."
40
+ ) : r instanceof Error ? r : new Error(e);
41
+ }
42
+ /**
43
+ * Build transaction from x402 requirement
44
+ */
45
+ async buildTransaction(r) {
46
+ const { requirement: e, payerPublicKey: t, blockhash: n } = r;
47
+ if (!e || !e.payTo)
48
+ throw new Error("Invalid requirement: missing payTo");
49
+ u().debug("[WalletManager] Building transaction for resource:", e.resource);
50
+ const a = new P(), s = this.resolveAmountInMinorUnits(e), o = e.asset;
51
+ if (!o)
52
+ throw new Error("asset is required in x402 requirement");
53
+ const c = v(o, e.resource, this.allowUnknownMint);
54
+ if (!c.isValid && c.error)
55
+ throw new Error(c.error);
56
+ c.warning && u().warn(c.warning);
57
+ const C = new l(o), d = await x(
58
+ C,
59
+ t
60
+ );
61
+ if (!this.rpcRateLimiter.tryConsume())
62
+ throw new Error("RPC rate limit exceeded. Please try again in a moment.");
63
+ let y;
64
+ try {
65
+ y = await this.rpcCircuitBreaker.execute(async () => await m(
66
+ async () => await this.connection.getAccountInfo(d),
67
+ { ...g.QUICK, name: "rpc-get-account-info" }
68
+ ));
69
+ } catch (i) {
70
+ throw i instanceof f ? new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments.") : this.transformRpcError(i);
71
+ }
72
+ if (!y)
73
+ throw new Error("Payer is missing an associated token account for this mint");
74
+ let p;
75
+ try {
76
+ p = e.extra?.recipientTokenAccount ? new l(e.extra.recipientTokenAccount) : new l(e.payTo);
77
+ } catch {
78
+ throw new Error("We are currently unable to process payment, please try again later");
79
+ }
80
+ if (a.add(
81
+ A(
82
+ d,
83
+ p,
84
+ t,
85
+ s
86
+ )
87
+ ), e.extra?.memo) {
88
+ const { TransactionInstruction: i } = await import("@solana/web3.js"), b = new i({
89
+ keys: [],
90
+ programId: new l("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),
91
+ data: Buffer.from(e.extra.memo, "utf8")
92
+ });
93
+ a.add(b);
94
+ }
95
+ let w;
96
+ if (n)
97
+ w = n;
98
+ else {
99
+ if (!this.rpcRateLimiter.tryConsume())
100
+ throw new Error("RPC rate limit exceeded. Please try again in a moment.");
101
+ try {
102
+ w = (await this.rpcCircuitBreaker.execute(async () => await m(
103
+ async () => await this.connection.getLatestBlockhash(),
104
+ { ...g.QUICK, name: "rpc-get-blockhash" }
105
+ ))).blockhash;
106
+ } catch (i) {
107
+ throw i instanceof f ? new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments.") : this.transformRpcError(i);
108
+ }
109
+ }
110
+ return a.recentBlockhash = w, e.extra?.feePayer ? a.feePayer = new l(e.extra.feePayer) : a.feePayer = t, a;
111
+ }
112
+ /**
113
+ * Parse amount from x402 requirement (already in atomic units as string)
114
+ */
115
+ resolveAmountInMinorUnits(r) {
116
+ const e = parseInt(r.maxAmountRequired, 10);
117
+ if (Number.isNaN(e) || e <= 0)
118
+ throw new Error("Invalid maxAmountRequired in requirement");
119
+ return e;
120
+ }
121
+ /**
122
+ * Build payment payload from signed transaction (x402 spec)
123
+ */
124
+ buildPaymentPayload(r) {
125
+ const { requirement: e, signedTx: t, payerPublicKey: n } = r;
126
+ return {
127
+ x402Version: 0,
128
+ scheme: e.scheme,
129
+ network: e.network,
130
+ payload: {
131
+ signature: t.signature,
132
+ transaction: t.serialized,
133
+ payer: n.toString(),
134
+ memo: e.extra?.memo,
135
+ recipientTokenAccount: e.extra?.recipientTokenAccount
136
+ }
137
+ };
138
+ }
139
+ /**
140
+ * Sign transaction using wallet adapter (fully signed for regular mode)
141
+ */
142
+ async signTransaction(r) {
143
+ const { transaction: e, signTransaction: t } = r;
144
+ u().debug("[WalletManager] Requesting wallet to sign transaction");
145
+ const n = await t(e), a = n.serialize(), s = n.signatures[0]?.signature;
146
+ if (!s)
147
+ throw new Error("Signed transaction missing signature");
148
+ const o = k.encode(s);
149
+ return u().debug("[WalletManager] Transaction signed with signature:", o.substring(0, 20) + "..."), {
150
+ serialized: h.fromUint8Array(a),
151
+ signature: o
152
+ };
153
+ }
154
+ /**
155
+ * Deserialize a base64-encoded transaction from the backend
156
+ * Used for gasless flow where backend builds the complete transaction
157
+ */
158
+ deserializeTransaction(r) {
159
+ try {
160
+ const e = h.toUint8Array(r);
161
+ return P.from(e);
162
+ } catch (e) {
163
+ throw new Error(
164
+ `Failed to deserialize transaction: ${M(e, "Unknown error")}`
165
+ );
166
+ }
167
+ }
168
+ /**
169
+ * Partially sign transaction for gasless mode
170
+ * User signs their authority, server will co-sign as fee payer
171
+ */
172
+ async partiallySignTransaction(r) {
173
+ const { transaction: e, signTransaction: t, blockhash: n } = r;
174
+ n && e.recentBlockhash !== n && (e.recentBlockhash = n);
175
+ const a = await t(e), s = a.signatures[0]?.signature;
176
+ if (s) {
177
+ const c = k.encode(s);
178
+ u().debug("[WalletManager] Partially signed with signature:", c.substring(0, 20) + "...");
179
+ }
180
+ const o = a.serialize({
181
+ requireAllSignatures: !1,
182
+ verifySignatures: !1
183
+ });
184
+ return h.fromUint8Array(o);
185
+ }
186
+ /**
187
+ * Get wallet balance
188
+ */
189
+ async getBalance(r) {
190
+ if (!this.rpcRateLimiter.tryConsume())
191
+ throw new Error("RPC rate limit exceeded. Please try again in a moment.");
192
+ try {
193
+ return await this.rpcCircuitBreaker.execute(async () => await m(
194
+ async () => await this.connection.getBalance(r),
195
+ { ...g.QUICK, name: "rpc-get-balance" }
196
+ )) / T;
197
+ } catch (e) {
198
+ throw e instanceof f ? new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments.") : this.transformRpcError(e);
199
+ }
200
+ }
201
+ /**
202
+ * Verify transaction on-chain
203
+ */
204
+ async verifyTransaction(r) {
205
+ if (!this.rpcRateLimiter.tryConsume())
206
+ return u().warn("[WalletManager] RPC rate limit exceeded for transaction verification"), !1;
207
+ try {
208
+ return !!(await this.rpcCircuitBreaker.execute(async () => await m(
209
+ async () => await this.connection.getSignatureStatus(r),
210
+ { ...g.QUICK, name: "rpc-verify-tx" }
211
+ ))).value?.confirmationStatus;
212
+ } catch (e) {
213
+ return e instanceof f && u().warn("[WalletManager] Circuit breaker OPEN - cannot verify transaction"), !1;
214
+ }
215
+ }
216
+ }
217
+ export {
218
+ z as WalletManager
219
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"CedrosPay.d.ts","sourceRoot":"","sources":["../../src/components/CedrosPay.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,QAAQ,EACT,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEnB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAgL9C"}
1
+ {"version":3,"file":"CedrosPay.d.ts","sourceRoot":"","sources":["../../src/components/CedrosPay.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,QAAQ,EAET,MAAM,UAAU,CAAC;AAiElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEnB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CA8L9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"AISettingsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/AISettingsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EACV,YAAY,EAMb,MAAM,SAAS,CAAC;AAgHjB,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,2CAogBjF"}
1
+ {"version":3,"file":"AISettingsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/AISettingsSection.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EACV,YAAY,EAMb,MAAM,SAAS,CAAC;AAgHjB,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,2CAugBjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"CouponsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/CouponsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAA6D,MAAM,SAAS,CAAC;AAGvG,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CA+f7F"}
1
+ {"version":3,"file":"CouponsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/CouponsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,YAAY,EAA6D,MAAM,SAAS,CAAC;AAGvG,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CAyd7F"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared error banner with optional retry button.
3
+ *
4
+ * Renders nothing when `message` is null.
5
+ */
6
+ export interface ErrorBannerProps {
7
+ message: string | null;
8
+ onRetry?: () => void;
9
+ }
10
+ export declare function ErrorBanner({ message, onRetry }: ErrorBannerProps): import("react/jsx-runtime").JSX.Element | null;
11
+ //# sourceMappingURL=ErrorBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBanner.d.ts","sourceRoot":"","sources":["../../../src/components/admin/ErrorBanner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,gBAAgB,kDAgBjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"FAQSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/FAQSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,SAAS,CAAC;AAGjD,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CA+ezF"}
1
+ {"version":3,"file":"FAQSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/FAQSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,SAAS,CAAC;AAEjD,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CAgbzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessagingSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/MessagingSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAmCD,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,qBAAqB,2CAgXzF"}
1
+ {"version":3,"file":"MessagingSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/MessagingSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAmCD,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,qBAAqB,2CAqXzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"OverviewSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/OverviewSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,SAAS,CAAC;AAG1D,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,eAAuB,EAAE,WAAW,EAAE,EAAE,YAAY,2CAyJxG"}
1
+ {"version":3,"file":"OverviewSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/OverviewSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,SAAS,CAAC;AAG1D,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,eAAuB,EAAE,WAAW,EAAE,EAAE,YAAY,2CAqJxG"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/ProductsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,SAAS,CAAC;AAIrD,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CAgvB9F"}
1
+ {"version":3,"file":"ProductsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/ProductsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,SAAS,CAAC;AAIrD,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CA6rB9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefundsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/RefundsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,YAAY,EAA8C,MAAM,SAAS,CAAC;AAIxF,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CA+xB7F"}
1
+ {"version":3,"file":"RefundsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/RefundsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAA8C,MAAM,SAAS,CAAC;AAIxF,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CAuvB7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"SingleCategorySettings.d.ts","sourceRoot":"","sources":["../../../src/components/admin/SingleCategorySettings.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,MAAM,EAAE,OAAO,EACf,WAAW,EACX,QAAQ,EACR,KAAK,EACL,WAAW,EACX,YAAwB,EACxB,iBAAyB,GAC1B,EAAE,2BAA2B,2CA8Y7B"}
1
+ {"version":3,"file":"SingleCategorySettings.d.ts","sourceRoot":"","sources":["../../../src/components/admin/SingleCategorySettings.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,MAAM,EAAE,OAAO,EACf,WAAW,EACX,QAAQ,EACR,KAAK,EACL,WAAW,EACX,YAAwB,EACxB,iBAAyB,GAC1B,EAAE,2BAA2B,2CA4T7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"StorefrontSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/StorefrontSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAwO,MAAM,SAAS,CAAC;AAgIlR,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,2CAguBjF"}
1
+ {"version":3,"file":"StorefrontSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/StorefrontSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAwO,MAAM,SAAS,CAAC;AAgIlR,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,2CAquBjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/SubscriptionsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,YAAY,EAA0C,MAAM,SAAS,CAAC;AA6BpF,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,2CA4pBpF"}
1
+ {"version":3,"file":"SubscriptionsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/SubscriptionsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAA0C,MAAM,SAAS,CAAC;AA6BpF,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,2CAwpBpF"}
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/TransactionsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,YAAY,EAA6B,MAAM,SAAS,CAAC;AAIvE,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CAoOlG"}
1
+ {"version":3,"file":"TransactionsSection.d.ts","sourceRoot":"","sources":["../../../src/components/admin/TransactionsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAA6B,MAAM,SAAS,CAAC;AAIvE,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAa,EAAE,WAAW,EAAE,EAAE,YAAY,2CAgOlG"}
@@ -6,7 +6,13 @@ import { IWalletManager } from '../managers/WalletManager';
6
6
  import { ISubscriptionManager } from '../managers/SubscriptionManager';
7
7
  import { ISubscriptionChangeManager } from '../managers/SubscriptionChangeManager';
8
8
  import { ICreditsManager } from '../managers/CreditsManager';
9
- import { WalletPool } from '../utils/walletPool';
9
+ /** Minimal interface matching WalletPool to avoid importing the module at parse time */
10
+ export interface LazyWalletPool {
11
+ getAdapters(): unknown[];
12
+ cleanup(): Promise<void>;
13
+ isInitialized(): boolean;
14
+ getId(): string;
15
+ }
10
16
  /**
11
17
  * Context value containing configuration and manager instances.
12
18
  *
@@ -22,7 +28,7 @@ export interface CedrosContextValue {
22
28
  subscriptionChangeManager: ISubscriptionChangeManager;
23
29
  creditsManager: ICreditsManager;
24
30
  /** Context-scoped wallet pool (for internal use by CedrosPay component) */
25
- walletPool: WalletPool;
31
+ walletPool: LazyWalletPool;
26
32
  /** Cached Solana availability check result (null = not checked yet, string = error message, undefined = available) */
27
33
  solanaError: string | null | undefined;
28
34
  }
@@ -41,7 +47,7 @@ interface CedrosProviderProps {
41
47
  * <App />
42
48
  * </CedrosProvider>
43
49
  */
44
- export declare function CedrosProvider({ config, children }: CedrosProviderProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare function CedrosProvider({ config, children }: CedrosProviderProps): import("react/jsx-runtime").JSX.Element | null;
45
51
  /**
46
52
  * Hook to access Cedros context
47
53
  *
@@ -1 +1 @@
1
- {"version":3,"file":"CedrosContext.d.ts","sourceRoot":"","sources":["../../src/context/CedrosContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAoD,MAAM,OAAO,CAAC;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAKlE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAaxE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,cAAc,CAAC;IAC9B,WAAW,EAAE,YAAY,CAAC;IAC1B,aAAa,EAAE,cAAc,CAAC;IAC9B,mBAAmB,EAAE,oBAAoB,CAAC;IAC1C,yBAAyB,EAAE,0BAA0B,CAAC;IACtD,cAAc,EAAE,eAAe,CAAC;IAChC,2EAA2E;IAC3E,UAAU,EAAE,UAAU,CAAC;IACvB,sHAAsH;IACtH,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACxC;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAwHvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAQrD"}
1
+ {"version":3,"file":"CedrosContext.d.ts","sourceRoot":"","sources":["../../src/context/CedrosContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAoD,MAAM,OAAO,CAAC;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAQlE,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,WAAW,IAAI,OAAO,EAAE,CAAC;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,aAAa,IAAI,OAAO,CAAC;IACzB,KAAK,IAAI,MAAM,CAAC;CACjB;AAoBD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,cAAc,CAAC;IAC9B,WAAW,EAAE,YAAY,CAAC;IAC1B,aAAa,EAAE,cAAc,CAAC;IAC9B,mBAAmB,EAAE,oBAAoB,CAAC;IAC1C,yBAAyB,EAAE,0BAA0B,CAAC;IACtD,cAAc,EAAE,eAAe,CAAC;IAChC,2EAA2E;IAC3E,UAAU,EAAE,cAAc,CAAC;IAC3B,sHAAsH;IACtH,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACxC;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,kDAyIvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAQrD"}
@@ -1,33 +1,23 @@
1
1
  /**
2
2
  * @cedros/pay-react/crypto-only
3
3
  *
4
- * Crypto-only build (no Stripe dependencies)
5
- * Bundle size: ~900KB (Solana web3.js + wallet adapters)
4
+ * Full entry point including Solana crypto payment components and hooks.
5
+ * Use this when you need CryptoButton, useX402Payment, or other Solana features.
6
6
  *
7
- * Use this entry point if you only need Solana crypto payments.
7
+ * Requires @solana/* peer dependencies to be installed.
8
8
  *
9
9
  * @example
10
10
  * ```typescript
11
- * // In your package.json or import statement
12
- * import { CedrosProvider, CryptoButton } from '@cedros/pay-react/crypto-only';
11
+ * import { CedrosProvider, CryptoButton, useX402Payment } from '@cedros/pay-react/crypto-only';
13
12
  * ```
14
13
  */
15
- export { CedrosProvider, useCedrosContext, useCedrosTheme, type CedrosContextValue } from './context';
14
+ export * from './index';
16
15
  export { CryptoButton } from './components/CryptoButton';
17
- export { PaymentModal } from './components/PaymentModal';
18
- export type { PaymentModalProps } from './components/PaymentModal';
19
- export { ProductPrice, PaymentMethodBadge } from './components/ProductPrice';
20
- export type { PaymentMethod } from './components/ProductPrice';
16
+ export { CryptoSubscribeButton } from './components/CryptoSubscribeButton';
21
17
  export { useX402Payment } from './hooks/useX402Payment';
22
- export { usePaymentMode } from './hooks/usePaymentMode';
23
- export type { CedrosConfig, PaymentStatus, Currency, X402Requirement, X402Response, PaymentPayload, SettlementResponse, PaymentResult, PaymentMetadata, PaymentState, CedrosThemeMode, CedrosThemeTokens, Product, CartItem, PaymentErrorCode, PaymentError, ErrorResponse, } from './types';
24
- export { ERROR_CATEGORIES } from './types/errors';
25
- export type { IX402Manager } from './managers/X402Manager';
18
+ export { useCryptoSubscription } from './hooks/useCryptoSubscription';
19
+ export { useRefundVerification } from './hooks/useRefundVerification';
26
20
  export type { IWalletManager } from './managers/WalletManager';
27
- export type { IRouteDiscoveryManager } from './managers/RouteDiscoveryManager';
28
- export { validateConfig, parseCouponCodes, formatCouponCodes, calculateDiscountPercentage, createRateLimiter, RATE_LIMITER_PRESETS, type RateLimiter, type RateLimiterConfig, } from './utils';
29
- export { LogLevel, Logger, getLogger, createLogger, type LoggerConfig, } from './utils/logger';
30
- export { CEDROS_EVENTS, emitPaymentStart, emitPaymentProcessing, emitPaymentSuccess, emitPaymentError, type PaymentStartDetail, type PaymentProcessingDetail, type PaymentSuccessDetail, type PaymentErrorDetail, } from './utils';
31
- export { isRetryableError, getUserErrorMessage, } from './utils';
21
+ export { createWalletPool, WalletPool } from './utils/walletPool';
32
22
  export { validateTokenMint, KNOWN_STABLECOINS } from './utils/tokenMintValidator';
33
23
  //# sourceMappingURL=crypto-only.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-only.d.ts","sourceRoot":"","sources":["../src/crypto-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGtG,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,YAAY,EACV,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG/E,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,YAAY,EACZ,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,OAAO,cAAc,CAAC"}
1
+ {"version":3,"file":"crypto-only.d.ts","sourceRoot":"","sources":["../src/crypto-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./CedrosContext-efFL4kQz.js"),e=require("./styles-C4-_hbgr.js");require("@solana/wallet-adapter-wallets");exports.CedrosProvider=t.CedrosProvider;exports.KNOWN_STABLECOINS=t.KNOWN_STABLECOINS;exports.LogLevel=t.LogLevel;exports.Logger=t.Logger;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.createLogger=t.createLogger;exports.createRateLimiter=t.createRateLimiter;exports.getLogger=t.getLogger;exports.useCedrosContext=t.useCedrosContext;exports.useCedrosTheme=t.useCedrosTheme;exports.validateConfig=t.validateConfig;exports.validateTokenMint=t.validateTokenMint;exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CryptoButton=e.CryptoButton;exports.ERROR_CATEGORIES=e.ERROR_CATEGORIES;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.formatCouponCodes=e.formatCouponCodes;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.parseCouponCodes=e.parseCouponCodes;exports.usePaymentMode=e.usePaymentMode;exports.useX402Payment=e.useX402Payment;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-S3b2N8tp.js"),C=require("react/jsx-runtime"),i=require("react"),t=require("./CedrosContext-C2v_s8cc.js");require("@solana/web3.js");require("./index-WcOlBYZJ.js");const Q=require("@solana/wallet-adapter-react"),ne=require("@solana/wallet-adapter-base"),be=require("@solana/wallet-adapter-react-ui"),ae=require("./walletPool-BZyAG4YS.js");function se(){const{subscriptionManager:n,x402Manager:d,walletManager:f}=t.useCedrosContext(),{publicKey:c,signTransaction:T}=Q.useWallet(),[h,m]=i.useState({status:"idle",error:null,sessionId:null,subscriptionStatus:null,expiresAt:null}),[x,E]=i.useState(null),R=i.useCallback(()=>{if(!c){const l="Wallet not connected";return m(o=>({...o,status:"error",error:l})),{valid:!1,error:l}}if(!T){const l="Wallet does not support signing";return m(o=>({...o,status:"error",error:l})),{valid:!1,error:l}}return{valid:!0}},[c,T]),W=i.useCallback(async l=>{if(!c)return m(o=>({...o,status:"error",error:"Wallet not connected"})),null;m(o=>({...o,status:"checking",error:null}));try{const o=await n.checkSubscriptionStatus({resource:l,userId:c.toString()});return m(a=>({...a,status:o.active?"success":"idle",subscriptionStatus:o.status,expiresAt:o.expiresAt||o.currentPeriodEnd||null})),o}catch(o){const a=t.formatError(o,"Failed to check subscription status");return m(u=>({...u,status:"error",error:a})),null}},[c,n]),k=i.useCallback(async(l,o,a)=>{m(u=>({...u,status:"loading",error:null}));try{const u=await n.requestSubscriptionQuote(l,o,a);return E(u),m(b=>({...b,status:"idle"})),u}catch(u){const b=t.formatError(u,"Failed to get subscription quote");return m(s=>({...s,status:"error",error:b})),null}},[n]),I=i.useCallback(async(l,o,a)=>{const u=R();if(!u.valid)return{success:!1,error:u.error};m(b=>({...b,status:"loading",error:null}));try{const b=await n.requestSubscriptionQuote(l,o,a);E(b);const s=b.requirement;if(!d.validateRequirement(s))throw new Error("Invalid subscription quote received from server");const w=!!s.extra?.feePayer;let P;if(w){const{transaction:y,blockhash:v}=await d.buildGaslessTransaction({resourceId:l,userWallet:c.toString(),feePayer:s.extra.feePayer,couponCode:a?.couponCode}),_=f.deserializeTransaction(y),j=await f.partiallySignTransaction({transaction:_,signTransaction:T,blockhash:v});P=await d.submitGaslessTransaction({resource:l,partialTx:j,couponCode:a?.couponCode,resourceType:"regular",requirement:s})}else{const y=await f.buildTransaction({requirement:s,payerPublicKey:c}),v=await f.signTransaction({transaction:y,signTransaction:T}),_=f.buildPaymentPayload({requirement:s,signedTx:v,payerPublicKey:c});P=await d.submitPayment({resource:l,payload:_,couponCode:a?.couponCode,resourceType:"regular"})}if(P.success){const y=await n.checkSubscriptionStatus({resource:l,userId:c.toString()});m({status:"success",error:null,sessionId:P.transactionId||null,subscriptionStatus:y.status,expiresAt:y.expiresAt||y.currentPeriodEnd||null})}else m(y=>({...y,status:"error",error:P.error||"Subscription payment failed"}));return P}catch(b){const s=t.formatError(b,"Subscription payment failed");return m(w=>({...w,status:"error",error:s})),{success:!1,error:s}}},[R,n,d,f,c,T]),S=i.useCallback(()=>{m({status:"idle",error:null,sessionId:null,subscriptionStatus:null,expiresAt:null}),E(null)},[]);return{...h,quote:x,checkStatus:W,requestQuote:k,processPayment:I,reset:S}}function Ce({resource:n,interval:d,intervalDays:f,couponCode:c,label:T,disabled:h=!1,onAttempt:m,onSuccess:x,onError:E,className:R="",testPageUrl:W,hideMessages:k=!1,autoCheckStatus:I=!0}){const{connected:S,connecting:l,connect:o,disconnect:a,select:u,wallets:b,wallet:s,publicKey:w}=Q.useWallet(),{status:P,error:y,subscriptionStatus:v,expiresAt:_,checkStatus:j,processPayment:O}=se(),g=t.useCedrosTheme(),{solanaError:L}=t.useCedrosContext(),{t:B,translations:F}=e.useTranslation(),ie=T||B("ui.subscribe_with_crypto"),U=i.useRef(O),G=i.useRef(j);i.useEffect(()=>{U.current=O,G.current=j},[O,j]);const le=y&&typeof y!="string"?y?.code??null:null,ce=L&&typeof L!="string"?L?.code??null:null,V=r=>{if(!r||!F)return"";const p=F.errors[r];return p?p.action?`${p.message} ${p.action}`:p.message:""},Y=y?typeof y=="string"?y:V(le):null,X=L?typeof L=="string"?L:V(ce):null,ue=i.useMemo(()=>b.map(r=>`${r.adapter.name}-${r.readyState}`).join(","),[b]),z=i.useMemo(()=>b.filter(({readyState:r})=>r===ne.WalletReadyState.Installed||r===ne.WalletReadyState.Loadable),[ue]);i.useEffect(()=>{I&&S&&w&&(t.getLogger().debug("[CryptoSubscribeButton] Auto-checking subscription status"),G.current(n))},[I,S,w,n]),i.useEffect(()=>{P==="success"&&v==="active"&&(e.emitPaymentSuccess("crypto","subscription-active",n),x&&x("subscription-active"))},[P,v,n,x]),i.useEffect(()=>{P==="error"&&y&&(e.emitPaymentError("crypto",y,n),E&&E(y))},[P,y,n,E]);const H=typeof window<"u"&&window.top!==window.self,[J,M]=i.useState(!1),[Z,K]=i.useState(!1),[ee,q]=i.useState(!1),A=L;i.useEffect(()=>{let r=!1;return r||(async()=>{if(Z&&s&&!S&&!l){t.getLogger().debug("[CryptoSubscribeButton] Wallet detected, attempting auto-connect:",s.adapter.name),K(!1),e.emitWalletConnect(s.adapter.name);try{await o(),r||t.getLogger().debug("[CryptoSubscribeButton] Auto-connect successful")}catch($){if(!r){t.getLogger().error("[CryptoSubscribeButton] Auto-connect failed:",$);const fe=$ instanceof Error?$.message:"Failed to connect wallet";e.emitWalletError(fe,s.adapter.name),q(!1)}}}})(),()=>{r=!0}},[s,Z,S,l,o]),i.useEffect(()=>{S&&ee&&w&&s&&(e.emitWalletConnected(s.adapter.name,w.toString()),t.getLogger().debug("[CryptoSubscribeButton] Processing pending subscription payment"),q(!1),M(!1),e.emitPaymentProcessing("crypto",n),U.current(n,d,{couponCode:c,intervalDays:f}))},[S,ee,w,s,n,d,c,f]);const te=i.useCallback(async()=>{if(t.getLogger().debug("[CryptoSubscribeButton] executeSubscriptionFlow called",{connected:S,wallet:s?.adapter.name,resource:n,interval:d}),e.emitPaymentStart("crypto",n),m&&m("crypto"),A){t.getLogger().error("[CryptoSubscribeButton] Solana dependencies missing:",A),e.emitPaymentError("crypto",A,n),E&&E(A);return}if(H){const r=W||window.location.href;try{if(new URL(r,window.location.origin).origin!==window.location.origin)throw t.getLogger().error("[CryptoSubscribeButton] Blocked attempt to open external URL:",r),new Error("Cannot open external URLs from embedded context");window.open(r,"_blank","noopener,noreferrer")}catch(p){throw t.getLogger().error("[CryptoSubscribeButton] URL validation failed:",p),p}return}if(S)e.emitPaymentProcessing("crypto",n),await O(n,d,{couponCode:c,intervalDays:f});else{q(!0);try{if(s)t.getLogger().debug("[CryptoSubscribeButton] Wallet already selected, connecting:",s.adapter.name),e.emitWalletConnect(s.adapter.name),await o();else{if(t.getLogger().debug("[CryptoSubscribeButton] No wallet selected, showing selector"),z.length===0){q(!1);const r="No wallets available";throw e.emitWalletError(r),new Error(r)}M(!0)}}catch(r){q(!1);const p=r instanceof Error?r.message:"Failed to connect wallet";t.getLogger().error("[CryptoSubscribeButton] Connection error:",p),e.emitWalletError(p,s?.adapter.name)}}},[S,s,n,d,c,f,H,W,z,o,O,A,m,E]),re=i.useMemo(()=>`crypto-subscribe-${n}-${d}`,[n,d]),de=i.useMemo(()=>e.createDedupedClickHandler(re,te,{cooldownMs:200,deduplicationWindowMs:0}),[re,te]),oe=P==="loading"||P==="checking",N=v==="active"||v==="trialing",ge=h||oe||l||!!A||N;let D=ie;if(oe)D=B("ui.processing");else if(N&&_){const r=new Date(_).toLocaleDateString();D=`${B("ui.subscribed_until")} ${r}`}else N&&(D=B("ui.subscribed"));const pe=i.useCallback(async()=>{try{K(!1),S&&await a(),u(null),M(!0)}catch(r){t.getLogger().error("Failed to change wallet:",r)}},[S,a,u]),me=i.useCallback(r=>{t.getLogger().debug("[CryptoSubscribeButton] Wallet clicked:",r),M(!1),u(r),K(!0)},[u]),ye=i.useCallback(async()=>{try{if(await a(),q(!1),typeof window<"u"&&window.localStorage)try{window.localStorage.removeItem("walletName")}catch(r){r instanceof Error&&r.name==="QuotaExceededError"?t.getLogger().warn("localStorage quota exceeded when removing wallet preference"):t.getLogger().error("Failed to clear wallet preference from localStorage:",r)}}catch(r){t.getLogger().error("Failed to disconnect wallet:",r)}},[a]);return C.jsxs("div",{className:g.unstyled?R:`${g.className} cedros-theme__crypto-button ${R||""}`,style:g.unstyled?{}:g.style,children:[C.jsx("button",{onClick:de,disabled:ge,className:g.unstyled?R:"cedros-theme__button cedros-theme__crypto",type:"button",children:D}),J&&!k&&C.jsx("div",{className:"cedros-modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:g.tokens.modalOverlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem"},onClick:()=>M(!1),children:C.jsxs("div",{className:"cedros-modal-content",style:{backgroundColor:g.tokens.modalBackground,borderRadius:"12px",padding:"2rem",maxWidth:"400px",width:"100%",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",border:`1px solid ${g.tokens.modalBorder}`},onClick:r=>r.stopPropagation(),children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[C.jsx("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:600,color:g.tokens.surfaceText},children:B("wallet.select_wallet")}),C.jsx("button",{onClick:()=>M(!1),style:e.getModalCloseButtonStyles(g.tokens.surfaceText),"aria-label":"Close modal",type:"button",children:"×"})]}),C.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:z.map(r=>C.jsxs("button",{onClick:()=>me(r.adapter.name),style:{width:"100%",padding:"1rem",backgroundColor:g.tokens.surfaceBackground,border:`1px solid ${g.tokens.surfaceBorder}`,borderRadius:"0.5rem",cursor:"pointer",fontSize:"1rem",textAlign:"left",color:g.tokens.surfaceText,display:"flex",alignItems:"center",gap:"1rem",transition:"all 0.2s ease"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=g.tokens.modalBackground,p.currentTarget.style.borderColor=g.tokens.surfaceText,p.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor=g.tokens.surfaceBackground,p.currentTarget.style.borderColor=g.tokens.surfaceBorder,p.currentTarget.style.transform="translateY(0)"},type:"button",children:[C.jsx(be.WalletIcon,{wallet:r,style:{width:"24px",height:"24px"}}),C.jsx("span",{style:{fontWeight:500},children:r.adapter.name})]},r.adapter.name))})]})}),S&&!k&&!J&&C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"0.5rem",fontSize:"0.75rem",color:g.tokens.surfaceText,opacity:.7},children:[C.jsx("button",{onClick:pe,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:B("wallet.change")}),C.jsx("button",{onClick:ye,style:{background:"none",border:"none",padding:0,color:"inherit",textDecoration:"none",cursor:"pointer",fontSize:"inherit"},type:"button",children:B("ui.disconnect")})]}),!k&&X&&C.jsx("div",{className:g.unstyled?"":"cedros-theme__error",children:X}),!k&&Y&&C.jsx("div",{className:g.unstyled?"":"cedros-theme__error",children:Y}),!k&&N&&C.jsx("div",{className:g.unstyled?"":"cedros-theme__success",children:B("ui.subscription_active")})]})}function Se(){const{x402Manager:n,walletManager:d}=t.useCedrosContext(),{publicKey:f,signTransaction:c}=Q.useWallet(),[T,h]=i.useState({status:"idle",error:null,transactionId:null}),[m,x]=i.useState(null),[E,R]=i.useState(null),W=i.useCallback(async l=>{try{h(a=>({...a,status:"loading"}));const o=await n.requestQuote({resource:l});if(!n.validateRequirement(o))throw new Error("Invalid refund requirement received from server");return x(o),h(a=>({...a,status:"idle"})),o}catch(o){const a=t.formatError(o,"Failed to fetch refund requirement");throw h({status:"error",error:a,transactionId:null}),o}},[n]),k=i.useCallback(async(l,o)=>{if(!f||!c)throw new Error("Wallet not connected");try{h({status:"loading",error:null,transactionId:null});const a=await n.requestQuote({resource:l,couponCode:o});if(!n.validateRequirement(a))throw new Error("Invalid refund requirement received");x(a);const u=await d.buildTransaction({requirement:a,payerPublicKey:f}),b=await d.signTransaction({transaction:u,signTransaction:c}),s=d.buildPaymentPayload({requirement:a,signedTx:b,payerPublicKey:f}),w=await n.submitPayment({resource:l,payload:s,couponCode:o,metadata:void 0,resourceType:"refund"});return w.settlement&&R(w.settlement),h({status:"success",error:null,transactionId:w.transactionId||b.signature}),w}catch(a){const u=t.formatError(a,"Refund payment failed");throw h({status:"error",error:u,transactionId:null}),a}},[f,c,n,d]),I=i.useCallback(async l=>{if(!f||!c)throw new Error("Wallet not connected");try{h({status:"loading",error:null,transactionId:null});const o=await n.requestQuote({resource:l});if(!n.validateRequirement(o))throw new Error("Invalid refund requirement received");x(o);const{transaction:a}=await n.buildGaslessTransaction({resourceId:l,userWallet:f.toString(),feePayer:o.extra.feePayer}),u=d.deserializeTransaction(a),b=await d.partiallySignTransaction({transaction:u,signTransaction:c}),s=await n.submitGaslessTransaction({resource:l,partialTx:b,couponCode:void 0,metadata:void 0,resourceType:"refund",requirement:o});return s.settlement&&R(s.settlement),h({status:"success",error:null,transactionId:s.transactionId||"gasless-refund-tx"}),s}catch(o){const a=t.formatError(o,"Gasless refund payment failed");throw h({status:"error",error:a,transactionId:null}),o}},[f,c,n,d]),S=i.useCallback(()=>{h({status:"idle",error:null,transactionId:null}),x(null),R(null)},[]);return{state:T,requirement:m,settlement:E,fetchRefundQuote:W,processRefund:k,processGaslessRefund:I,reset:S}}exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CSP_PRESETS=e.CSP_PRESETS;exports.CedrosPay=e.CedrosPay;exports.CedrosPayAdminDashboard=e.CedrosPayAdminDashboard;exports.CreditsButton=e.CreditsButton;exports.CreditsSubscribeButton=e.CreditsSubscribeButton;exports.CryptoButton=e.CryptoButton;exports.ERROR_CATEGORIES=e.ERROR_CATEGORIES;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.PurchaseButton=e.PurchaseButton;exports.RPC_PROVIDERS=e.RPC_PROVIDERS;exports.SECURITY_RECOMMENDATIONS=e.SECURITY_RECOMMENDATIONS;exports.StripeButton=e.StripeButton;exports.SubscribeButton=e.SubscribeButton;exports.SubscriptionManagementPanel=e.SubscriptionManagementPanel;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.cedrosPayPlugin=e.cedrosPayPlugin;exports.createTranslator=e.createTranslator;exports.detectLocale=e.detectLocale;exports.ecommerce=e.index;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.emitWalletConnect=e.emitWalletConnect;exports.emitWalletConnected=e.emitWalletConnected;exports.emitWalletError=e.emitWalletError;exports.formatCSP=e.formatCSP;exports.formatCouponCodes=e.formatCouponCodes;exports.generateCSP=e.generateCSP;exports.generateCSPDirectives=e.generateCSPDirectives;exports.getAvailableLocales=e.getAvailableLocales;exports.getLocalizedError=e.getLocalizedError;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.loadLocale=e.loadLocale;exports.logSecurityReport=e.logSecurityReport;exports.parseCouponCodes=e.parseCouponCodes;exports.stackCheckoutCoupons=e.stackCheckoutCoupons;exports.useCreditsPayment=e.useCreditsPayment;exports.useCreditsSubscription=e.useCreditsSubscription;exports.useLocalizedError=e.useLocalizedError;exports.usePaymentMode=e.usePaymentMode;exports.useStripeCheckout=e.useStripeCheckout;exports.useSubscription=e.useSubscription;exports.useSubscriptionManagement=e.useSubscriptionManagement;exports.useTranslation=e.useTranslation;exports.useX402Payment=e.useX402Payment;exports.validateSecurity=e.validateSecurity;exports.CIRCUIT_BREAKER_PRESETS=t.CIRCUIT_BREAKER_PRESETS;exports.CedrosProvider=t.CedrosProvider;exports.CircuitBreakerOpenError=t.CircuitBreakerOpenError;exports.CircuitState=t.CircuitState;exports.KNOWN_STABLECOINS=t.KNOWN_STABLECOINS;exports.LogLevel=t.LogLevel;exports.Logger=t.Logger;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.RETRY_PRESETS=t.RETRY_PRESETS;exports.createCircuitBreaker=t.createCircuitBreaker;exports.createLogger=t.createLogger;exports.createRateLimiter=t.createRateLimiter;exports.getLogger=t.getLogger;exports.retryWithBackoff=t.retryWithBackoff;exports.useCedrosContext=t.useCedrosContext;exports.useCedrosTheme=t.useCedrosTheme;exports.validateConfig=t.validateConfig;exports.validateTokenMint=t.validateTokenMint;exports.WalletPool=ae.WalletPool;exports.createWalletPool=ae.createWalletPool;exports.CryptoSubscribeButton=Ce;exports.useCryptoSubscription=se;exports.useRefundVerification=Se;