@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.
- package/dist/CedrosContext-C2v_s8cc.js +6 -0
- package/dist/CedrosContext-D7nh5-Zh.mjs +2100 -0
- package/dist/WalletManager-B5KLZK2D.js +1 -0
- package/dist/WalletManager-oEjZhaFk.mjs +219 -0
- package/dist/components/CedrosPay.d.ts.map +1 -1
- package/dist/components/admin/AISettingsSection.d.ts.map +1 -1
- package/dist/components/admin/CouponsSection.d.ts.map +1 -1
- package/dist/components/admin/ErrorBanner.d.ts +11 -0
- package/dist/components/admin/ErrorBanner.d.ts.map +1 -0
- package/dist/components/admin/FAQSection.d.ts.map +1 -1
- package/dist/components/admin/MessagingSection.d.ts.map +1 -1
- package/dist/components/admin/OverviewSection.d.ts.map +1 -1
- package/dist/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/components/admin/RefundsSection.d.ts.map +1 -1
- package/dist/components/admin/SingleCategorySettings.d.ts.map +1 -1
- package/dist/components/admin/StorefrontSection.d.ts.map +1 -1
- package/dist/components/admin/SubscriptionsSection.d.ts.map +1 -1
- package/dist/components/admin/TransactionsSection.d.ts.map +1 -1
- package/dist/context/CedrosContext.d.ts +9 -3
- package/dist/context/CedrosContext.d.ts.map +1 -1
- package/dist/crypto-only.d.ts +9 -19
- package/dist/crypto-only.d.ts.map +1 -1
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +766 -32
- package/dist/index-BFt38o8Q.mjs +88 -0
- package/dist/index-S3b2N8tp.js +136 -0
- package/dist/index-WcOlBYZJ.js +1 -0
- package/dist/{index-Bzp2srIS.mjs → index-iIxY1o71.mjs} +10413 -9402
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +68 -75
- package/dist/managers/ManagerCache.d.ts +2 -2
- package/dist/managers/ManagerCache.d.ts.map +1 -1
- package/dist/pay-react.css +1 -1
- package/dist/{sections-D6R2jRAp.js → sections-bhZyRM7o.js} +1 -1
- package/dist/{sections-cz9ughWO.mjs → sections-otLBNrzu.mjs} +2 -2
- package/dist/solanaCheck-BS3QTE63.js +6 -0
- package/dist/solanaCheck-IlYsbXDd.mjs +27 -0
- package/dist/stripe-only.d.ts +4 -21
- package/dist/stripe-only.d.ts.map +1 -1
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +71 -29
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/types/componentOptions.d.ts +15 -2
- package/dist/types/componentOptions.d.ts.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/walletPool-BR6etEiq.mjs +67 -0
- package/dist/walletPool-BZyAG4YS.js +1 -0
- package/package.json +6 -1
- package/dist/CedrosContext-DUT3cLZg.mjs +0 -2474
- package/dist/CedrosContext-efFL4kQz.js +0 -11
- package/dist/index-CFzfjC82.js +0 -136
- package/dist/styles-C4-_hbgr.js +0 -1
- package/dist/styles-QcAsIVWl.mjs +0 -1909
package/dist/stripe-only.mjs
CHANGED
|
@@ -1,32 +1,74 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
1
|
+
import { x as c, w as n, C as u, a as C, b as m, h as S, E, f as P, d, e as l, P as R, R as g, L as p, S as y, g as T, i as L, q as b, c as B, Q as M, M as _, W as f, G as h, D as I, y as v, F as O, z as k, A, B as D, v as W, o as x, r as N, t as U, O as z, T as V, I as j, H as G, N as K, K as Y, p as q, s as w, j as F, m as H, V as J, k as Q, u as X, l as Z, n as $, U as ee, J as ae } from "./index-iIxY1o71.mjs";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { f as te, C as re, e as oe, d as ie, L as ce, h as ne, R as ue, g as Ce, b as me, j as Se, c as Ee, i as Pe, r as de, u as le, a as Re, v as ge } from "./CedrosContext-D7nh5-Zh.mjs";
|
|
5
|
+
import "@solana/web3.js";
|
|
6
|
+
import "./index-BFt38o8Q.mjs";
|
|
7
|
+
import "@solana/wallet-adapter-react";
|
|
4
8
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
c as CEDROS_EVENTS,
|
|
10
|
+
te as CIRCUIT_BREAKER_PRESETS,
|
|
11
|
+
n as CSP_PRESETS,
|
|
12
|
+
u as CedrosPay,
|
|
13
|
+
C as CedrosPayAdminDashboard,
|
|
14
|
+
re as CedrosProvider,
|
|
15
|
+
oe as CircuitBreakerOpenError,
|
|
16
|
+
ie as CircuitState,
|
|
17
|
+
m as CreditsButton,
|
|
18
|
+
S as CreditsSubscribeButton,
|
|
19
|
+
E as ERROR_CATEGORIES,
|
|
20
|
+
ce as LogLevel,
|
|
21
|
+
ne as Logger,
|
|
22
|
+
P as PaymentMethodBadge,
|
|
23
|
+
d as PaymentModal,
|
|
24
|
+
l as ProductPrice,
|
|
25
|
+
R as PurchaseButton,
|
|
26
|
+
ue as RATE_LIMITER_PRESETS,
|
|
27
|
+
Ce as RETRY_PRESETS,
|
|
28
|
+
g as RPC_PROVIDERS,
|
|
29
|
+
p as SECURITY_RECOMMENDATIONS,
|
|
14
30
|
y as StripeButton,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
T as SubscribeButton,
|
|
32
|
+
L as SubscriptionManagementPanel,
|
|
33
|
+
b as calculateDiscountPercentage,
|
|
34
|
+
B as cedrosPayPlugin,
|
|
35
|
+
me as createCircuitBreaker,
|
|
36
|
+
Se as createLogger,
|
|
37
|
+
Ee as createRateLimiter,
|
|
38
|
+
M as createTranslator,
|
|
39
|
+
_ as detectLocale,
|
|
40
|
+
f as ecommerce,
|
|
41
|
+
h as emitPaymentError,
|
|
42
|
+
I as emitPaymentProcessing,
|
|
43
|
+
v as emitPaymentStart,
|
|
44
|
+
O as emitPaymentSuccess,
|
|
45
|
+
k as emitWalletConnect,
|
|
46
|
+
A as emitWalletConnected,
|
|
47
|
+
D as emitWalletError,
|
|
48
|
+
W as formatCSP,
|
|
49
|
+
x as formatCouponCodes,
|
|
50
|
+
N as generateCSP,
|
|
51
|
+
U as generateCSPDirectives,
|
|
52
|
+
z as getAvailableLocales,
|
|
53
|
+
V as getLocalizedError,
|
|
54
|
+
Pe as getLogger,
|
|
55
|
+
j as getUserErrorMessage,
|
|
56
|
+
G as isRetryableError,
|
|
57
|
+
K as loadLocale,
|
|
58
|
+
Y as logSecurityReport,
|
|
59
|
+
q as parseCouponCodes,
|
|
60
|
+
de as retryWithBackoff,
|
|
61
|
+
w as stackCheckoutCoupons,
|
|
62
|
+
le as useCedrosContext,
|
|
63
|
+
Re as useCedrosTheme,
|
|
64
|
+
F as useCreditsPayment,
|
|
65
|
+
H as useCreditsSubscription,
|
|
66
|
+
J as useLocalizedError,
|
|
67
|
+
Q as usePaymentMode,
|
|
68
|
+
X as useStripeCheckout,
|
|
69
|
+
Z as useSubscription,
|
|
70
|
+
$ as useSubscriptionManagement,
|
|
71
|
+
ee as useTranslation,
|
|
72
|
+
ge as validateConfig,
|
|
73
|
+
ae as validateSecurity
|
|
32
74
|
};
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wr=require("react/jsx-runtime"),Wu=require("../CedrosContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wr=require("react/jsx-runtime"),Wu=require("../CedrosContext-C2v_s8cc.js");var xs={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function yo(e){return String(e)}yo.open="";yo.close="";function Vu(){let e=typeof process<"u"?process:void 0,t=e?.env||{},n=t.FORCE_TTY!=="false",r=e?.argv||[];return!("NO_COLOR"in t||r.includes("--no-color"))&&("FORCE_COLOR"in t||r.includes("--color")||e?.platform==="win32"||n&&t.TERM!=="dumb"||"CI"in t)||typeof window<"u"&&!!window.chrome}function Uu(){let e=Vu(),t=(s,i,a,u)=>{let c="",l=0;do c+=s.substring(l,u)+a,l=u+i.length,u=s.indexOf(i,l);while(~u);return c+s.substring(l)},n=(s,i,a=s)=>{let u=c=>{let l=String(c),f=l.indexOf(i,s.length);return~f?s+t(l,i,a,f)+i:s+l+i};return u.open=s,u.close=i,u},r={isColorSupported:e},o=s=>`\x1B[${s}m`;for(let s in xs){let i=xs[s];r[s]=e?n(o(i[0]),o(i[1]),i[2]):yo}return r}var ce=Uu();function Pc(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function Ku(e,t){const n=Object.keys(e),r=t===null?n:n.sort(t);if(Object.getOwnPropertySymbols)for(const o of Object.getOwnPropertySymbols(e))Object.getOwnPropertyDescriptor(e,o).enumerable&&r.push(o);return r}function rn(e,t,n,r,o,s,i=": "){let a="",u=0,c=e.next();if(!c.done){a+=t.spacingOuter;const l=n+t.indent;for(;!c.done;){if(a+=l,u++===t.maxWidth){a+="…";break}const f=s(c.value[0],t,l,r,o),h=s(c.value[1],t,l,r,o);a+=f+i+h,c=e.next(),c.done?t.min||(a+=","):a+=`,${t.spacingInner}`}a+=t.spacingOuter+n}return a}function bo(e,t,n,r,o,s){let i="",a=0,u=e.next();if(!u.done){i+=t.spacingOuter;const c=n+t.indent;for(;!u.done;){if(i+=c,a++===t.maxWidth){i+="…";break}i+=s(u.value,t,c,r,o),u=e.next(),u.done?t.min||(i+=","):i+=`,${t.spacingInner}`}i+=t.spacingOuter+n}return i}function $n(e,t,n,r,o,s){let i="";e=e instanceof ArrayBuffer?new DataView(e):e;const a=c=>c instanceof DataView,u=a(e)?e.byteLength:e.length;if(u>0){i+=t.spacingOuter;const c=n+t.indent;for(let l=0;l<u;l++){if(i+=c,l===t.maxWidth){i+="…";break}(a(e)||l in e)&&(i+=s(a(e)?e.getInt8(l):e[l],t,c,r,o)),l<u-1?i+=`,${t.spacingInner}`:t.min||(i+=",")}i+=t.spacingOuter+n}return i}function wo(e,t,n,r,o,s){let i="";const a=Ku(e,t.compareKeys);if(a.length>0){i+=t.spacingOuter;const u=n+t.indent;for(let c=0;c<a.length;c++){const l=a[c],f=s(l,t,u,r,o),h=s(e[l],t,u,r,o);i+=`${u+f}: ${h}`,c<a.length-1?i+=`,${t.spacingInner}`:t.min||(i+=",")}i+=t.spacingOuter+n}return i}const Gu=typeof Symbol=="function"&&Symbol.for?Symbol.for("jest.asymmetricMatcher"):1267621,fn=" ",Yu=(e,t,n,r,o,s)=>{const i=e.toString();if(i==="ArrayContaining"||i==="ArrayNotContaining")return++r>t.maxDepth?`[${i}]`:`${i+fn}[${$n(e.sample,t,n,r,o,s)}]`;if(i==="ObjectContaining"||i==="ObjectNotContaining")return++r>t.maxDepth?`[${i}]`:`${i+fn}{${wo(e.sample,t,n,r,o,s)}}`;if(i==="StringMatching"||i==="StringNotMatching"||i==="StringContaining"||i==="StringNotContaining")return i+fn+s(e.sample,t,n,r,o);if(typeof e.toAsymmetricMatcher!="function")throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);return e.toAsymmetricMatcher()},Ju=e=>e&&e.$$typeof===Gu,Xu={serialize:Yu,test:Ju},Hu=" ",Ic=new Set(["DOMStringMap","NamedNodeMap"]),Zu=/^(?:HTML\w*Collection|NodeList)$/;function Qu(e){return Ic.has(e)||Zu.test(e)}const el=e=>e&&e.constructor&&!!e.constructor.name&&Qu(e.constructor.name);function tl(e){return e.constructor.name==="NamedNodeMap"}const nl=(e,t,n,r,o,s)=>{const i=e.constructor.name;return++r>t.maxDepth?`[${i}]`:(t.min?"":i+Hu)+(Ic.has(i)?`{${wo(tl(e)?[...e].reduce((a,u)=>(a[u.name]=u.value,a),{}):{...e},t,n,r,o,s)}}`:`[${$n([...e],t,n,r,o,s)}]`)},rl={serialize:nl,test:el};function Nc(e){return e.replaceAll("<","<").replaceAll(">",">")}function To(e,t,n,r,o,s,i){const a=r+n.indent,u=n.colors;return e.map(c=>{const l=t[c];let f=i(l,n,a,o,s);return typeof l!="string"&&(f.includes(`
|
|
2
2
|
`)&&(f=n.spacingOuter+a+f+n.spacingOuter+r),f=`{${f}}`),`${n.spacingInner+r+u.prop.open+c+u.prop.close}=${u.value.open}${f}${u.value.close}`}).join("")}function Rn(e,t,n,r,o,s){return e.map(i=>t.spacingOuter+n+(typeof i=="string"?jc(i,t):s(i,t,n,r,o))).join("")}function ol(e,t,n,r,o,s){return t.printShadowRoot===!1?"":[`${t.spacingOuter+n}#shadow-root`,Rn(e,t,n+t.indent,r,o,s)].join("")}function jc(e,t){const n=t.colors.content;return n.open+Nc(e)+n.close}function sl(e,t){const n=t.colors.comment;return`${n.open}<!--${Nc(e)}-->${n.close}`}function So(e,t,n,r,o){const s=r.colors.tag;return`${s.open}<${e}${t&&s.close+t+r.spacingOuter+o+s.open}${n?`>${s.close}${n}${r.spacingOuter}${o}${s.open}</${e}`:`${t&&!r.min?"":" "}/`}>${s.close}`}function Eo(e,t){const n=t.colors.tag;return`${n.open}<${e}${n.close} …${n.open} />${n.close}`}const il=1,Rc=3,Fc=8,Dc=11,cl=/^(?:(?:HTML|SVG)\w*)?Element$/;function al(e){try{return typeof e.hasAttribute=="function"&&e.hasAttribute("is")}catch{return!1}}function ul(e){const t=e.constructor.name,{nodeType:n,tagName:r}=e,o=typeof r=="string"&&r.includes("-")||al(e);return n===il&&(cl.test(t)||o)||n===Rc&&t==="Text"||n===Fc&&t==="Comment"||n===Dc&&t==="DocumentFragment"}const ll=e=>e?.constructor?.name&&ul(e);function fl(e){return e.nodeType===Rc}function hl(e){return e.nodeType===Fc}function hn(e){return e.nodeType===Dc}const pl=(e,t,n,r,o,s)=>{if(fl(e))return jc(e.data,t);if(hl(e))return sl(e.data,t);const i=hn(e)?"DocumentFragment":e.tagName.toLowerCase();return++r>t.maxDepth?Eo(i,t):So(i,To(hn(e)?[]:Array.from(e.attributes,a=>a.name).sort(),hn(e)?{}:[...e.attributes].reduce((a,u)=>(a[u.name]=u.value,a),{}),t,n+t.indent,r,o,s),(hn(e)||!e.shadowRoot?"":ol(Array.prototype.slice.call(e.shadowRoot.children),t,n+t.indent,r,o,s))+Rn(Array.prototype.slice.call(e.childNodes||e.children),t,n+t.indent,r,o,s),t,n)},dl={serialize:pl,test:ll},ml="@@__IMMUTABLE_ITERABLE__@@",gl="@@__IMMUTABLE_LIST__@@",yl="@@__IMMUTABLE_KEYED__@@",bl="@@__IMMUTABLE_MAP__@@",Ms="@@__IMMUTABLE_ORDERED__@@",wl="@@__IMMUTABLE_RECORD__@@",Tl="@@__IMMUTABLE_SEQ__@@",Sl="@@__IMMUTABLE_SET__@@",El="@@__IMMUTABLE_STACK__@@",At=e=>`Immutable.${e}`,Fn=e=>`[${e}]`,Qt=" ",_s="…";function vl(e,t,n,r,o,s,i){return++r>t.maxDepth?Fn(At(i)):`${At(i)+Qt}{${rn(e.entries(),t,n,r,o,s)}}`}function $l(e){let t=0;return{next(){if(t<e._keys.length){const n=e._keys[t++];return{done:!1,value:[n,e.get(n)]}}return{done:!0,value:void 0}}}}function xl(e,t,n,r,o,s){const i=At(e._name||"Record");return++r>t.maxDepth?Fn(i):`${i+Qt}{${rn($l(e),t,n,r,o,s)}}`}function Ml(e,t,n,r,o,s){const i=At("Seq");return++r>t.maxDepth?Fn(i):e[yl]?`${i+Qt}{${e._iter||e._object?rn(e.entries(),t,n,r,o,s):_s}}`:`${i+Qt}[${e._iter||e._array||e._collection||e._iterable?bo(e.values(),t,n,r,o,s):_s}]`}function sr(e,t,n,r,o,s,i){return++r>t.maxDepth?Fn(At(i)):`${At(i)+Qt}[${bo(e.values(),t,n,r,o,s)}]`}const _l=(e,t,n,r,o,s)=>e[bl]?vl(e,t,n,r,o,s,e[Ms]?"OrderedMap":"Map"):e[gl]?sr(e,t,n,r,o,s,"List"):e[Sl]?sr(e,t,n,r,o,s,e[Ms]?"OrderedSet":"Set"):e[El]?sr(e,t,n,r,o,s,"Stack"):e[Tl]?Ml(e,t,n,r,o,s):xl(e,t,n,r,o,s),Ol=e=>e&&(e[ml]===!0||e[wl]===!0),kl={serialize:_l,test:Ol};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ir={exports:{}},Z={};var Os;function Al(){if(Os)return Z;Os=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function d(g){if(typeof g=="object"&&g!==null){var w=g.$$typeof;switch(w){case e:switch(g=g.type,g){case n:case o:case r:case u:case c:case h:return g;default:switch(g=g&&g.$$typeof,g){case i:case a:case f:case l:return g;case s:return g;default:return w}}case t:return w}}}return Z.ContextConsumer=s,Z.ContextProvider=i,Z.Element=e,Z.ForwardRef=a,Z.Fragment=n,Z.Lazy=f,Z.Memo=l,Z.Portal=t,Z.Profiler=o,Z.StrictMode=r,Z.Suspense=u,Z.SuspenseList=c,Z.isContextConsumer=function(g){return d(g)===s},Z.isContextProvider=function(g){return d(g)===i},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},Z.isForwardRef=function(g){return d(g)===a},Z.isFragment=function(g){return d(g)===n},Z.isLazy=function(g){return d(g)===f},Z.isMemo=function(g){return d(g)===l},Z.isPortal=function(g){return d(g)===t},Z.isProfiler=function(g){return d(g)===o},Z.isStrictMode=function(g){return d(g)===r},Z.isSuspense=function(g){return d(g)===u},Z.isSuspenseList=function(g){return d(g)===c},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===o||g===r||g===u||g===c||typeof g=="object"&&g!==null&&(g.$$typeof===f||g.$$typeof===l||g.$$typeof===i||g.$$typeof===s||g.$$typeof===a||g.$$typeof===p||g.getModuleId!==void 0)},Z.typeOf=d,Z}var ks;function Cl(){return ks||(ks=1,ir.exports=Al()),ir.exports}var qc=Cl(),Pl=Lc(qc),Il=Pc({__proto__:null,default:Pl},[qc]),cr={exports:{}},J={};var As;function Nl(){if(As)return J;As=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),a=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),d;d=Symbol.for("react.module.reference");function g(w){if(typeof w=="object"&&w!==null){var T=w.$$typeof;switch(T){case e:switch(w=w.type,w){case n:case o:case r:case c:case l:return w;default:switch(w=w&&w.$$typeof,w){case a:case i:case u:case h:case f:case s:return w;default:return T}}case t:return T}}}return J.ContextConsumer=i,J.ContextProvider=s,J.Element=e,J.ForwardRef=u,J.Fragment=n,J.Lazy=h,J.Memo=f,J.Portal=t,J.Profiler=o,J.StrictMode=r,J.Suspense=c,J.SuspenseList=l,J.isAsyncMode=function(){return!1},J.isConcurrentMode=function(){return!1},J.isContextConsumer=function(w){return g(w)===i},J.isContextProvider=function(w){return g(w)===s},J.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},J.isForwardRef=function(w){return g(w)===u},J.isFragment=function(w){return g(w)===n},J.isLazy=function(w){return g(w)===h},J.isMemo=function(w){return g(w)===f},J.isPortal=function(w){return g(w)===t},J.isProfiler=function(w){return g(w)===o},J.isStrictMode=function(w){return g(w)===r},J.isSuspense=function(w){return g(w)===c},J.isSuspenseList=function(w){return g(w)===l},J.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===o||w===r||w===c||w===l||w===p||typeof w=="object"&&w!==null&&(w.$$typeof===h||w.$$typeof===f||w.$$typeof===s||w.$$typeof===i||w.$$typeof===u||w.$$typeof===d||w.getModuleId!==void 0)},J.typeOf=g,J}var Cs;function jl(){return Cs||(Cs=1,cr.exports=Nl()),cr.exports}var Bc=jl(),Rl=Lc(Bc),Fl=Pc({__proto__:null,default:Rl},[Bc]);const Dl=["isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isSuspenseList","isValidElementType"],ut=Object.fromEntries(Dl.map(e=>[e,t=>Fl[e](t)||Il[e](t)]));function zc(e,t=[]){if(Array.isArray(e))for(const n of e)zc(n,t);else e!=null&&e!==!1&&e!==""&&t.push(e);return t}function Ps(e){const t=e.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Unknown";if(ut.isFragment(e))return"React.Fragment";if(ut.isSuspense(e))return"React.Suspense";if(typeof t=="object"&&t!==null){if(ut.isContextProvider(e))return"Context.Provider";if(ut.isContextConsumer(e))return"Context.Consumer";if(ut.isForwardRef(e)){if(t.displayName)return t.displayName;const n=t.render.displayName||t.render.name||"";return n===""?"ForwardRef":`ForwardRef(${n})`}if(ut.isMemo(e)){const n=t.displayName||t.type.displayName||t.type.name||"";return n===""?"Memo":`Memo(${n})`}}return"UNDEFINED"}function Ll(e){const{props:t}=e;return Object.keys(t).filter(n=>n!=="children"&&t[n]!==void 0).sort()}const ql=(e,t,n,r,o,s)=>++r>t.maxDepth?Eo(Ps(e),t):So(Ps(e),To(Ll(e),e.props,t,n+t.indent,r,o,s),Rn(zc(e.props.children),t,n+t.indent,r,o,s),t,n),Bl=e=>e!=null&&ut.isElement(e),zl={serialize:ql,test:Bl},Wl=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function Vl(e){const{props:t}=e;return t?Object.keys(t).filter(n=>t[n]!==void 0).sort():[]}const Ul=(e,t,n,r,o,s)=>++r>t.maxDepth?Eo(e.type,t):So(e.type,e.props?To(Vl(e),e.props,t,n+t.indent,r,o,s):"",e.children?Rn(e.children,t,n+t.indent,r,o,s):"",t,n),Kl=e=>e&&e.$$typeof===Wl,Gl={serialize:Ul,test:Kl},Wc=Object.prototype.toString,Yl=Date.prototype.toISOString,Jl=Error.prototype.toString,Is=RegExp.prototype.toString;function bn(e){return typeof e.constructor=="function"&&e.constructor.name||"Object"}function Xl(e){return typeof window<"u"&&e===window}const Hl=/^Symbol\((.*)\)(.*)$/,Zl=/\n/g;class Vc extends Error{constructor(t,n){super(t),this.stack=n,this.name=this.constructor.name}}function Ql(e){return e==="[object Array]"||e==="[object ArrayBuffer]"||e==="[object DataView]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object Int8Array]"||e==="[object Int16Array]"||e==="[object Int32Array]"||e==="[object Uint8Array]"||e==="[object Uint8ClampedArray]"||e==="[object Uint16Array]"||e==="[object Uint32Array]"}function ef(e){return Object.is(e,-0)?"-0":String(e)}function tf(e){return`${e}n`}function Ns(e,t){return t?`[Function ${e.name||"anonymous"}]`:"[Function]"}function js(e){return String(e).replace(Hl,"Symbol($1)")}function Rs(e){return`[${Jl.call(e)}]`}function Uc(e,t,n,r){if(e===!0||e===!1)return`${e}`;if(e===void 0)return"undefined";if(e===null)return"null";const o=typeof e;if(o==="number")return ef(e);if(o==="bigint")return tf(e);if(o==="string")return r?`"${e.replaceAll(/"|\\/g,"\\$&")}"`:`"${e}"`;if(o==="function")return Ns(e,t);if(o==="symbol")return js(e);const s=Wc.call(e);return s==="[object WeakMap]"?"WeakMap {}":s==="[object WeakSet]"?"WeakSet {}":s==="[object Function]"||s==="[object GeneratorFunction]"?Ns(e,t):s==="[object Symbol]"?js(e):s==="[object Date]"?Number.isNaN(+e)?"Date { NaN }":Yl.call(e):s==="[object Error]"?Rs(e):s==="[object RegExp]"?n?Is.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"):Is.call(e):e instanceof Error?Rs(e):null}function Kc(e,t,n,r,o,s){if(o.includes(e))return"[Circular]";o=[...o],o.push(e);const i=++r>t.maxDepth,a=t.min;if(t.callToJSON&&!i&&e.toJSON&&typeof e.toJSON=="function"&&!s)return tt(e.toJSON(),t,n,r,o,!0);const u=Wc.call(e);return u==="[object Arguments]"?i?"[Arguments]":`${a?"":"Arguments "}[${$n(e,t,n,r,o,tt)}]`:Ql(u)?i?`[${e.constructor.name}]`:`${a||!t.printBasicPrototype&&e.constructor.name==="Array"?"":`${e.constructor.name} `}[${$n(e,t,n,r,o,tt)}]`:u==="[object Map]"?i?"[Map]":`Map {${rn(e.entries(),t,n,r,o,tt," => ")}}`:u==="[object Set]"?i?"[Set]":`Set {${bo(e.values(),t,n,r,o,tt)}}`:i||Xl(e)?`[${bn(e)}]`:`${a||!t.printBasicPrototype&&bn(e)==="Object"?"":`${bn(e)} `}{${wo(e,t,n,r,o,tt)}}`}const nf={test:e=>e&&e instanceof Error,serialize(e,t,n,r,o,s){if(o.includes(e))return"[Circular]";o=[...o,e];const i=++r>t.maxDepth,{message:a,cause:u,...c}=e,l={message:a,...typeof u<"u"?{cause:u}:{},...e instanceof AggregateError?{errors:e.errors}:{},...c},f=e.name!=="Error"?e.name:bn(e);return i?`[${f}]`:`${f} {${rn(Object.entries(l).values(),t,n,r,o,s)}}`}};function rf(e){return e.serialize!=null}function Gc(e,t,n,r,o,s){let i;try{i=rf(e)?e.serialize(t,n,r,o,s,tt):e.print(t,a=>tt(a,n,r,o,s),a=>{const u=r+n.indent;return u+a.replaceAll(Zl,`
|
|
3
3
|
${u}`)},{edgeSpacing:n.spacingOuter,min:n.min,spacing:n.spacingInner},n.colors)}catch(a){throw new Vc(a.message,a.stack)}if(typeof i!="string")throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof i}".`);return i}function Yc(e,t){for(const n of e)try{if(n.test(t))return n}catch(r){throw new Vc(r.message,r.stack)}return null}function tt(e,t,n,r,o,s){const i=Yc(t.plugins,e);if(i!==null)return Gc(i,e,t,n,r,o);const a=Uc(e,t.printFunctionName,t.escapeRegex,t.escapeString);return a!==null?a:Kc(e,t,n,r,o,s)}const vo={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},Jc=Object.keys(vo),Fe={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:Number.POSITIVE_INFINITY,maxWidth:Number.POSITIVE_INFINITY,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,printShadowRoot:!0,theme:vo};function of(e){for(const t of Object.keys(e))if(!Object.hasOwn(Fe,t))throw new Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.')}function sf(){return Jc.reduce((e,t)=>{const n=vo[t],r=n&&ce[n];if(r&&typeof r.close=="string"&&typeof r.open=="string")e[t]=r;else throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${n}" is undefined in ansi-styles.`);return e},Object.create(null))}function cf(){return Jc.reduce((e,t)=>(e[t]={close:"",open:""},e),Object.create(null))}function Xc(e){return e?.printFunctionName??Fe.printFunctionName}function Hc(e){return e?.escapeRegex??Fe.escapeRegex}function Zc(e){return e?.escapeString??Fe.escapeString}function Fs(e){return{callToJSON:e?.callToJSON??Fe.callToJSON,colors:e?.highlight?sf():cf(),compareKeys:typeof e?.compareKeys=="function"||e?.compareKeys===null?e.compareKeys:Fe.compareKeys,escapeRegex:Hc(e),escapeString:Zc(e),indent:e?.min?"":af(e?.indent??Fe.indent),maxDepth:e?.maxDepth??Fe.maxDepth,maxWidth:e?.maxWidth??Fe.maxWidth,min:e?.min??Fe.min,plugins:e?.plugins??Fe.plugins,printBasicPrototype:e?.printBasicPrototype??!0,printFunctionName:Xc(e),printShadowRoot:e?.printShadowRoot??!0,spacingInner:e?.min?" ":`
|
|
4
4
|
`,spacingOuter:e?.min?"":`
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
import { WalletAdapter } from '@solana/wallet-adapter-base';
|
|
2
1
|
import { CartItem } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Structural type matching @solana/wallet-adapter-base WalletAdapter.
|
|
4
|
+
* Using a local interface avoids a runtime import of @solana/wallet-adapter-base
|
|
5
|
+
* which Metro may resolve even for type-only imports.
|
|
6
|
+
*/
|
|
7
|
+
export interface WalletAdapterLike {
|
|
8
|
+
name: string;
|
|
9
|
+
connected: boolean;
|
|
10
|
+
publicKey: {
|
|
11
|
+
toBase58(): string;
|
|
12
|
+
} | null;
|
|
13
|
+
connect(): Promise<void>;
|
|
14
|
+
disconnect(): Promise<void>;
|
|
15
|
+
}
|
|
3
16
|
/**
|
|
4
17
|
* Payment method types (extensible)
|
|
5
18
|
*/
|
|
@@ -139,7 +152,7 @@ export interface CallbackOptions {
|
|
|
139
152
|
*/
|
|
140
153
|
export interface AdvancedOptions {
|
|
141
154
|
/** Custom wallet adapters (overrides default pool) */
|
|
142
|
-
wallets?:
|
|
155
|
+
wallets?: WalletAdapterLike[];
|
|
143
156
|
/** Auto-detect wallets and skip modal if none found */
|
|
144
157
|
autoDetectWallets?: boolean;
|
|
145
158
|
/** URL to open for crypto testing (e.g., Storybook test page) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentOptions.d.ts","sourceRoot":"","sources":["../../src/types/componentOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"componentOptions.d.ts","sourceRoot":"","sources":["../../src/types/componentOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE;QAAE,QAAQ,IAAI,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IAC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|
|
|
5
5
|
export { ERROR_MESSAGES, getUserFriendlyError, formatUserError, type ErrorMessage, } from './errorMessages';
|
|
6
6
|
export { deduplicateRequest, createDedupedClickHandler, isButtonInCooldown, setButtonCooldown, isDuplicateRequest, markRequestProcessed, getInFlightRequest, trackInFlightRequest, clearDeduplicationCache, getDeduplicationStats, DEFAULT_COOLDOWN_MS, DEFAULT_DEDUP_WINDOW_MS, } from './requestDeduplication';
|
|
7
7
|
export { getModalCloseButtonStyles } from './modalStyles';
|
|
8
|
-
export { createWalletPool, WalletPool } from './walletPool';
|
|
9
8
|
export { CEDROS_EVENTS, emitPaymentStart, emitWalletConnect, emitWalletConnected, emitWalletError, emitPaymentProcessing, emitPaymentSuccess, emitPaymentError, type PaymentMethod, type WalletProvider, type PaymentStartDetail, type WalletConnectDetail, type WalletErrorDetail, type PaymentProcessingDetail, type PaymentSuccessDetail, type PaymentErrorDetail, } from './eventEmitter';
|
|
10
9
|
export { isRetryableError, getUserErrorMessage, } from './errorParser';
|
|
11
10
|
export { createRateLimiter, RATE_LIMITER_PRESETS, type RateLimiter, type RateLimiterConfig, } from './rateLimiter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtI,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtI,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,WAAW,EACX,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PhantomWalletAdapter as n, SolflareWalletAdapter as i } from "@solana/wallet-adapter-wallets";
|
|
2
|
+
import { i as e } from "./CedrosContext-D7nh5-Zh.mjs";
|
|
3
|
+
class r {
|
|
4
|
+
adapters = null;
|
|
5
|
+
poolId;
|
|
6
|
+
isCleanedUp = !1;
|
|
7
|
+
constructor(l) {
|
|
8
|
+
this.poolId = l ?? `pool_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`, e().debug(`[WalletPool] Created pool: ${this.poolId}`);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get wallet adapters for this pool
|
|
12
|
+
*
|
|
13
|
+
* Lazy initialization: adapters are created on first access.
|
|
14
|
+
* Returns empty array in SSR environments.
|
|
15
|
+
*/
|
|
16
|
+
getAdapters() {
|
|
17
|
+
return typeof window > "u" ? [] : this.isCleanedUp ? (e().warn(`[WalletPool] Attempted to use pool after cleanup: ${this.poolId}`), []) : this.adapters !== null ? this.adapters : (e().debug(`[WalletPool] Initializing adapters for pool: ${this.poolId}`), this.adapters = [
|
|
18
|
+
new n(),
|
|
19
|
+
new i()
|
|
20
|
+
], this.adapters);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Cleanup wallet adapters
|
|
24
|
+
*
|
|
25
|
+
* Disconnects all wallets and clears the adapter cache.
|
|
26
|
+
* Called automatically when CedrosProvider unmounts.
|
|
27
|
+
*
|
|
28
|
+
* IMPORTANT: After cleanup, getAdapters() will return empty array.
|
|
29
|
+
*/
|
|
30
|
+
async cleanup() {
|
|
31
|
+
if (this.isCleanedUp) {
|
|
32
|
+
e().debug(`[WalletPool] Pool already cleaned up: ${this.poolId}`);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (e().debug(`[WalletPool] Cleaning up pool: ${this.poolId}`), this.isCleanedUp = !0, this.adapters === null)
|
|
36
|
+
return;
|
|
37
|
+
const l = this.adapters.map(async (t) => {
|
|
38
|
+
try {
|
|
39
|
+
t.connected && (e().debug(`[WalletPool] Disconnecting wallet: ${t.name}`), await t.disconnect());
|
|
40
|
+
} catch (a) {
|
|
41
|
+
e().warn(`[WalletPool] Failed to disconnect wallet ${t.name}:`, a);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
await Promise.allSettled(l), this.adapters = null, e().debug(`[WalletPool] Pool cleanup complete: ${this.poolId}`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check if this pool has been initialized
|
|
48
|
+
*
|
|
49
|
+
* Useful for testing or debugging.
|
|
50
|
+
*/
|
|
51
|
+
isInitialized() {
|
|
52
|
+
return this.adapters !== null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get pool ID (for debugging/logging)
|
|
56
|
+
*/
|
|
57
|
+
getId() {
|
|
58
|
+
return this.poolId;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function p(o) {
|
|
62
|
+
return new r(o);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
r as WalletPool,
|
|
66
|
+
p as createWalletPool
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@solana/wallet-adapter-wallets"),e=require("./CedrosContext-C2v_s8cc.js");class r{adapters=null;poolId;isCleanedUp=!1;constructor(l){this.poolId=l??`pool_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,e.getLogger().debug(`[WalletPool] Created pool: ${this.poolId}`)}getAdapters(){return typeof window>"u"?[]:this.isCleanedUp?(e.getLogger().warn(`[WalletPool] Attempted to use pool after cleanup: ${this.poolId}`),[]):this.adapters!==null?this.adapters:(e.getLogger().debug(`[WalletPool] Initializing adapters for pool: ${this.poolId}`),this.adapters=[new a.PhantomWalletAdapter,new a.SolflareWalletAdapter],this.adapters)}async cleanup(){if(this.isCleanedUp){e.getLogger().debug(`[WalletPool] Pool already cleaned up: ${this.poolId}`);return}if(e.getLogger().debug(`[WalletPool] Cleaning up pool: ${this.poolId}`),this.isCleanedUp=!0,this.adapters===null)return;const l=this.adapters.map(async t=>{try{t.connected&&(e.getLogger().debug(`[WalletPool] Disconnecting wallet: ${t.name}`),await t.disconnect())}catch(n){e.getLogger().warn(`[WalletPool] Failed to disconnect wallet ${t.name}:`,n)}});await Promise.allSettled(l),this.adapters=null,e.getLogger().debug(`[WalletPool] Pool cleanup complete: ${this.poolId}`)}isInitialized(){return this.adapters!==null}getId(){return this.poolId}}function i(o){return new r(o)}exports.WalletPool=r;exports.createWalletPool=i;
|
package/package.json
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedros/pay-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "React frontend library for Cedros Pay - unified Stripe and Solana x402 payments",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"react-native": "./src/index.ts",
|
|
10
11
|
"types": "./dist/index.d.ts",
|
|
11
12
|
"import": "./dist/index.mjs",
|
|
12
13
|
"require": "./dist/index.js"
|
|
13
14
|
},
|
|
14
15
|
"./stripe-only": {
|
|
16
|
+
"react-native": "./src/stripe-only.ts",
|
|
15
17
|
"types": "./dist/stripe-only.d.ts",
|
|
16
18
|
"import": "./dist/stripe-only.mjs",
|
|
17
19
|
"require": "./dist/stripe-only.js"
|
|
18
20
|
},
|
|
19
21
|
"./crypto-only": {
|
|
22
|
+
"react-native": "./src/crypto-only.ts",
|
|
20
23
|
"types": "./dist/crypto-only.d.ts",
|
|
21
24
|
"import": "./dist/crypto-only.mjs",
|
|
22
25
|
"require": "./dist/crypto-only.js"
|
|
23
26
|
},
|
|
24
27
|
"./telemetry": {
|
|
28
|
+
"react-native": "./src/telemetry.ts",
|
|
25
29
|
"types": "./dist/telemetry.d.ts",
|
|
26
30
|
"import": "./dist/telemetry.mjs",
|
|
27
31
|
"require": "./dist/telemetry.js"
|
|
28
32
|
},
|
|
29
33
|
"./testing": {
|
|
34
|
+
"react-native": "./src/testing/index.ts",
|
|
30
35
|
"types": "./dist/testing/index.d.ts",
|
|
31
36
|
"import": "./dist/testing/index.mjs",
|
|
32
37
|
"require": "./dist/testing/index.js"
|