@w3payments/react 1.1.2 → 1.1.3

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/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  import './assets/main.css';var Re = Object.defineProperty, Oe = Object.defineProperties;
2
2
  var Le = Object.getOwnPropertyDescriptors;
3
- var ye = Object.getOwnPropertySymbols;
3
+ var Te = Object.getOwnPropertySymbols;
4
4
  var Be = Object.prototype.hasOwnProperty, je = Object.prototype.propertyIsEnumerable;
5
- var re = (n, e, o) => e in n ? Re(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, y = (n, e) => {
5
+ var re = (n, e, o) => e in n ? Re(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, f = (n, e) => {
6
6
  for (var o in e || (e = {}))
7
7
  Be.call(e, o) && re(n, o, e[o]);
8
- if (ye)
9
- for (var o of ye(e))
8
+ if (Te)
9
+ for (var o of Te(e))
10
10
  je.call(e, o) && re(n, o, e[o]);
11
11
  return n;
12
- }, P = (n, e) => Oe(n, Le(e));
12
+ }, N = (n, e) => Oe(n, Le(e));
13
13
  var g = (n, e, o) => re(n, typeof e != "symbol" ? e + "" : e, o);
14
14
  var S = (n, e, o) => new Promise((t, r) => {
15
15
  var i = (d) => {
@@ -29,10 +29,10 @@ var S = (n, e, o) => new Promise((t, r) => {
29
29
  });
30
30
  import He, { createContext as Xe, useMemo as me, useEffect as Ve, useContext as Ge, useState as ee, Children as We, isValidElement as ae } from "react";
31
31
  var q = { exports: {} }, _ = {};
32
- var Te;
32
+ var De;
33
33
  function Ze() {
34
- if (Te) return _;
35
- Te = 1;
34
+ if (De) return _;
35
+ De = 1;
36
36
  var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
37
37
  function o(t, r, i) {
38
38
  var a = null;
@@ -52,13 +52,13 @@ function Ze() {
52
52
  return _.Fragment = e, _.jsx = o, _.jsxs = o, _;
53
53
  }
54
54
  var $ = {};
55
- var De;
55
+ var ke;
56
56
  function ze() {
57
- return De || (De = 1, process.env.NODE_ENV !== "production" && (function() {
57
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && (function() {
58
58
  function n(s) {
59
59
  if (s == null) return null;
60
60
  if (typeof s == "function")
61
- return s.$$typeof === N ? null : s.displayName || s.name || null;
61
+ return s.$$typeof === P ? null : s.displayName || s.name || null;
62
62
  if (typeof s == "string") return s;
63
63
  switch (s) {
64
64
  case T:
@@ -110,11 +110,11 @@ function ze() {
110
110
  }
111
111
  if (p) {
112
112
  p = console;
113
- var h = p.error, f = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
113
+ var h = p.error, v = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
114
114
  return h.call(
115
115
  p,
116
116
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
117
- f
117
+ v
118
118
  ), e(s);
119
119
  }
120
120
  }
@@ -161,15 +161,15 @@ function ze() {
161
161
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
162
162
  )), s = this.props.ref, s !== void 0 ? s : null;
163
163
  }
164
- function u(s, p, h, f, J, ce) {
165
- var v = h.ref;
164
+ function u(s, p, h, v, J, ce) {
165
+ var y = h.ref;
166
166
  return s = {
167
167
  $$typeof: x,
168
168
  type: s,
169
169
  key: p,
170
170
  props: h,
171
- _owner: f
172
- }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(s, "ref", {
171
+ _owner: v
172
+ }, (y !== void 0 ? y : null) !== null ? Object.defineProperty(s, "ref", {
173
173
  enumerable: !1,
174
174
  get: d
175
175
  }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
@@ -194,48 +194,48 @@ function ze() {
194
194
  value: ce
195
195
  }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
196
196
  }
197
- function U(s, p, h, f, J, ce) {
198
- var v = p.children;
199
- if (v !== void 0)
200
- if (f)
201
- if (se(v)) {
202
- for (f = 0; f < v.length; f++)
203
- w(v[f]);
204
- Object.freeze && Object.freeze(v);
197
+ function U(s, p, h, v, J, ce) {
198
+ var y = p.children;
199
+ if (y !== void 0)
200
+ if (v)
201
+ if (se(y)) {
202
+ for (v = 0; v < y.length; v++)
203
+ w(y[v]);
204
+ Object.freeze && Object.freeze(y);
205
205
  } else
206
206
  console.error(
207
207
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
208
208
  );
209
- else w(v);
209
+ else w(y);
210
210
  if (z.call(p, "key")) {
211
- v = n(s);
211
+ y = n(s);
212
212
  var W = Object.keys(p).filter(function(Pe) {
213
213
  return Pe !== "key";
214
214
  });
215
- f = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", ve[v + f] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
215
+ v = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", ye[y + v] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
216
216
  `A props object containing a "key" prop is being spread into JSX:
217
217
  let props = %s;
218
218
  <%s {...props} />
219
219
  React keys must be passed directly to JSX without using spread:
220
220
  let props = %s;
221
221
  <%s key={someKey} {...props} />`,
222
- f,
223
222
  v,
223
+ y,
224
224
  W,
225
- v
226
- ), ve[v + f] = !0);
225
+ y
226
+ ), ye[y + v] = !0);
227
227
  }
228
- if (v = null, h !== void 0 && (o(h), v = "" + h), a(p) && (o(p.key), v = "" + p.key), "key" in p) {
228
+ if (y = null, h !== void 0 && (o(h), y = "" + h), a(p) && (o(p.key), y = "" + p.key), "key" in p) {
229
229
  h = {};
230
230
  for (var ie in p)
231
231
  ie !== "key" && (h[ie] = p[ie]);
232
232
  } else h = p;
233
- return v && l(
233
+ return y && l(
234
234
  h,
235
235
  typeof s == "function" ? s.displayName || s.name || "Unknown" : s
236
236
  ), u(
237
237
  s,
238
- v,
238
+ y,
239
239
  h,
240
240
  r(),
241
241
  J,
@@ -248,7 +248,7 @@ React keys must be passed directly to JSX without using spread:
248
248
  function C(s) {
249
249
  return typeof s == "object" && s !== null && s.$$typeof === x;
250
250
  }
251
- var E = He, x = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), ne = Symbol.for("react.profiler"), G = Symbol.for("react.consumer"), M = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), N = Symbol.for("react.client.reference"), Z = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, se = Array.isArray, F = console.createTask ? console.createTask : function() {
251
+ var E = He, x = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), ne = Symbol.for("react.profiler"), G = Symbol.for("react.consumer"), M = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), Z = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, se = Array.isArray, F = console.createTask ? console.createTask : function() {
252
252
  return null;
253
253
  };
254
254
  E = {
@@ -259,33 +259,33 @@ React keys must be passed directly to JSX without using spread:
259
259
  var Y, m = {}, b = E.react_stack_bottom_frame.bind(
260
260
  E,
261
261
  i
262
- )(), k = F(t(i)), ve = {};
262
+ )(), k = F(t(i)), ye = {};
263
263
  $.Fragment = T, $.jsx = function(s, p, h) {
264
- var f = 1e4 > Z.recentlyCreatedOwnerStacks++;
264
+ var v = 1e4 > Z.recentlyCreatedOwnerStacks++;
265
265
  return U(
266
266
  s,
267
267
  p,
268
268
  h,
269
269
  !1,
270
- f ? Error("react-stack-top-frame") : b,
271
- f ? F(t(s)) : k
270
+ v ? Error("react-stack-top-frame") : b,
271
+ v ? F(t(s)) : k
272
272
  );
273
273
  }, $.jsxs = function(s, p, h) {
274
- var f = 1e4 > Z.recentlyCreatedOwnerStacks++;
274
+ var v = 1e4 > Z.recentlyCreatedOwnerStacks++;
275
275
  return U(
276
276
  s,
277
277
  p,
278
278
  h,
279
279
  !0,
280
- f ? Error("react-stack-top-frame") : b,
281
- f ? F(t(s)) : k
280
+ v ? Error("react-stack-top-frame") : b,
281
+ v ? F(t(s)) : k
282
282
  );
283
283
  };
284
284
  })()), $;
285
285
  }
286
- var ke;
286
+ var Se;
287
287
  function Fe() {
288
- return ke || (ke = 1, process.env.NODE_ENV === "production" ? q.exports = Ze() : q.exports = ze()), q.exports;
288
+ return Se || (Se = 1, process.env.NODE_ENV === "production" ? q.exports = Ze() : q.exports = ze()), q.exports;
289
289
  }
290
290
  var c = Fe();
291
291
  const H = class H {
@@ -510,7 +510,7 @@ const H = class H {
510
510
  };
511
511
  g(H, "instance");
512
512
  let be = H;
513
- const Se = be.getInstance(), X = class X {
513
+ const Ue = be.getInstance(), X = class X {
514
514
  constructor() {
515
515
  g(this, "currencies", /* @__PURE__ */ new Map());
516
516
  g(this, "supportedCurrencies", {
@@ -624,7 +624,7 @@ const Se = be.getInstance(), X = class X {
624
624
  };
625
625
  g(X, "instance");
626
626
  let ge = X;
627
- const Ue = ge.getInstance(), V = class V {
627
+ const ue = ge.getInstance(), V = class V {
628
628
  constructor() {
629
629
  g(this, "networks", /* @__PURE__ */ new Map());
630
630
  }
@@ -681,8 +681,8 @@ const Ue = ge.getInstance(), V = class V {
681
681
  }
682
682
  };
683
683
  g(V, "instance");
684
- let ue = V;
685
- const we = ue.getInstance(), le = /* @__PURE__ */ new Map();
684
+ let he = V;
685
+ const we = he.getInstance(), le = /* @__PURE__ */ new Map();
686
686
  function Ye(n, e = !1) {
687
687
  const o = `${n}-${e}`;
688
688
  return le.has(o) || le.set(
@@ -733,7 +733,7 @@ function Je(n) {
733
733
  const e = Ke();
734
734
  switch (n) {
735
735
  case "dark":
736
- return P(y({}, e), {
736
+ return N(f({}, e), {
737
737
  colorPrimary: "#6366f1",
738
738
  colorPrimaryHover: "#7c3aed",
739
739
  colorPrimaryLight: "#1e1b4b",
@@ -750,7 +750,7 @@ function Je(n) {
750
750
  }
751
751
  function qe(n, e) {
752
752
  var i;
753
- const o = typeof n == "string" ? { theme: n } : n, t = Je((i = o.theme) != null ? i : "light"), r = y(y({}, t), o.variables);
753
+ const o = typeof n == "string" ? { theme: n } : n, t = Je((i = o.theme) != null ? i : "light"), r = f(f({}, t), o.variables);
754
754
  Object.entries(r).forEach(([a, l]) => {
755
755
  if (l !== void 0) {
756
756
  const d = `--${Ee(a)}`;
@@ -855,7 +855,7 @@ const so = {
855
855
  "coinbase-pro": "https://assets.coincap.io/assets/icons/256/coinbase.png",
856
856
  "binance-us": "https://assets.coincap.io/assets/icons/256/binance.png"
857
857
  };
858
- function xe(n) {
858
+ function Ne(n) {
859
859
  return so[n.toLowerCase()];
860
860
  }
861
861
  const co = {
@@ -874,7 +874,7 @@ const co = {
874
874
  bank: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMgN1YxN0gyMVY3SDNaTTQgOEgyMFYxNkg0VjhaTTYgMTBWMTRIOVYxMEg2Wk0xMCAxMFYxMUgxOFYxMEgxMFpNMTAgMTJWMTNIMTVWMTJIMTBaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz4KPC9zdmc+",
875
875
  other: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDhDMTMuMSA4IDE0IDcuMSAxNCA2UzEzLjEgNCAxMiA0IDEwIDQuOSAxMCA2UzEwLjkgOCAxMiA4Wk0xMiAxMEMxMC45IDEwIDEwIDEwLjkgMTAgMTJTMTAuOSAxNCAxMiAxNFMxNCAxMy4xIDE0IDEyUzEzLjEgMTAgMTIgMTBaTTEyIDE2QzEwLjkgMTYgMTAgMTYuOSAxMCAxOFMxMC45IDIwIDEyIDIwUzE0IDE5LjEgMTQgMThTMTMuMSAxNiAxMiAxNloiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K"
876
876
  };
877
- function Ne(n) {
877
+ function xe(n) {
878
878
  return co[n.toLowerCase()];
879
879
  }
880
880
  var io = {
@@ -4488,22 +4488,38 @@ var bo = class {
4488
4488
  return S(this, null, function* () {
4489
4489
  if (!this.config)
4490
4490
  throw new Error("Adapter not initialized");
4491
- const e = {
4491
+ const e = ue.getCurrency(n.currency), o = (e == null ? void 0 : e.type) === "fiat";
4492
+ if (console.log("MeshPay createCheckoutSession:", {
4493
+ currency: n.currency,
4494
+ amount: n.amount,
4495
+ currencyType: e == null ? void 0 : e.type,
4496
+ isFiatCurrency: o,
4497
+ destinations: n.destinations
4498
+ }), o && n.currency !== "USD")
4499
+ throw new Error(
4500
+ `MeshPay adapter only supports USD as fiat currency, received: ${n.currency}`
4501
+ );
4502
+ const t = {
4492
4503
  userId: n.customerId,
4493
4504
  configurationId: this.config.configurationId,
4494
4505
  restrictMultipleAccounts: !0,
4495
- transferOptions: {
4496
- toAddresses: n.destinations.map((r) => ({
4497
- networkId: this.getNetworkIdFromName(r.networkId),
4498
- symbol: r.symbol,
4499
- address: r.address
4500
- })),
4501
- amountInFiat: n.amount,
4506
+ transferOptions: N(f({
4507
+ toAddresses: n.destinations.map((a) => {
4508
+ const l = this.getNetworkIdFromName(a.networkId);
4509
+ return f({
4510
+ networkId: l,
4511
+ symbol: a.symbol,
4512
+ address: a.address
4513
+ }, !o && { amount: n.amount });
4514
+ })
4515
+ }, o && { amountInFiat: n.amount }), {
4502
4516
  isInclusiveFeeEnabled: !1,
4503
4517
  generatePayLink: !1
4504
- },
4518
+ }),
4505
4519
  disableApiKeyGeneration: !1
4506
- }, o = yield globalThis.fetch(
4520
+ };
4521
+ console.log("MeshPay linkTokenRequest:", JSON.stringify(t, null, 2));
4522
+ const r = yield globalThis.fetch(
4507
4523
  `${this.config.baseUrl}/api/v1/linktoken`,
4508
4524
  {
4509
4525
  method: "POST",
@@ -4512,21 +4528,21 @@ var bo = class {
4512
4528
  "X-Client-Id": this.config.clientId,
4513
4529
  "X-Client-Secret": this.config.clientSecret
4514
4530
  },
4515
- body: JSON.stringify(e)
4531
+ body: JSON.stringify(t)
4516
4532
  }
4517
4533
  );
4518
- if (!o.ok) {
4519
- const r = yield o.text();
4534
+ if (!r.ok) {
4535
+ const a = yield r.text();
4520
4536
  throw new Error(
4521
- `LinkToken generation failed: ${o.status} ${r}`
4537
+ `LinkToken generation failed: ${r.status} ${a}`
4522
4538
  );
4523
4539
  }
4524
- const t = yield o.json();
4525
- if (t.status !== "ok")
4540
+ const i = yield r.json();
4541
+ if (i.status !== "ok")
4526
4542
  throw new Error(
4527
- `MeshPay API error: ${t.message || "Unknown error"}`
4543
+ `MeshPay API error: ${i.message || "Unknown error"}`
4528
4544
  );
4529
- return t.content;
4545
+ return i.content;
4530
4546
  });
4531
4547
  }
4532
4548
  /**
@@ -4542,11 +4558,9 @@ var bo = class {
4542
4558
  return new Promise((o, t) => {
4543
4559
  e({
4544
4560
  clientId: n.metadata.clientId,
4545
- onIntegrationConnected: (i) => {
4546
- console.log("MeshPay integration connected:", i);
4561
+ onIntegrationConnected: () => {
4547
4562
  },
4548
4563
  onTransferFinished: (i) => {
4549
- console.log("MeshPay transfer finished:", i);
4550
4564
  const a = i.status === "success";
4551
4565
  o({
4552
4566
  id: n.id,
@@ -4567,7 +4581,7 @@ var bo = class {
4567
4581
  });
4568
4582
  },
4569
4583
  onExit: (i) => {
4570
- console.log("MeshPay link exited:", i), i ? t(new Error(`MeshPay error: ${i.message || i}`)) : o({
4584
+ i ? t(new Error(`MeshPay error: ${i.message || i}`)) : o({
4571
4585
  id: n.id,
4572
4586
  status: "cancelled",
4573
4587
  data: {
@@ -4750,12 +4764,12 @@ class Ce {
4750
4764
  return o && this.adapters.size === 0 && (this.initialized = !1), o;
4751
4765
  }
4752
4766
  }
4753
- class he {
4767
+ class fe {
4754
4768
  constructor(e) {
4755
4769
  g(this, "registry");
4756
- g(this, "currencyService", Ue);
4770
+ g(this, "currencyService", ue);
4757
4771
  g(this, "networkService", we);
4758
- g(this, "paymentMethodService", Se);
4772
+ g(this, "paymentMethodService", Ue);
4759
4773
  g(this, "options");
4760
4774
  g(this, "clientMode", !1);
4761
4775
  /**
@@ -4788,7 +4802,7 @@ class he {
4788
4802
  currency: e.currency,
4789
4803
  customerId: e.customerId,
4790
4804
  destinations: e.destinations,
4791
- metadata: P(y({}, e.metadata), {
4805
+ metadata: N(f({}, e.metadata), {
4792
4806
  selectedBy: "w3payments-core",
4793
4807
  selectionReason: "auto-selected",
4794
4808
  selectedVendor: o
@@ -4796,7 +4810,7 @@ class he {
4796
4810
  };
4797
4811
  try {
4798
4812
  const a = yield this.registry.get(o).createCheckoutSession(t);
4799
- return P(y({}, a), {
4813
+ return N(f({}, a), {
4800
4814
  selectedVendor: ((r = a.metadata) == null ? void 0 : r.selectedVendor) || o
4801
4815
  });
4802
4816
  } catch (i) {
@@ -4833,8 +4847,8 @@ class he {
4833
4847
  * Only initializes currencies, networks, and registers adapters without API initialization
4834
4848
  */
4835
4849
  static createClient(e = "sandbox") {
4836
- const o = Object.create(he.prototype);
4837
- return o.currencyService = Ue, o.networkService = we, o.paymentMethodService = Se, o.registry = new Ce(), o.clientMode = !0, o.options = {
4850
+ const o = Object.create(fe.prototype);
4851
+ return o.currencyService = ue, o.networkService = we, o.paymentMethodService = Ue, o.registry = new Ce(), o.clientMode = !0, o.options = {
4838
4852
  config: {
4839
4853
  environment: e
4840
4854
  }
@@ -4865,7 +4879,7 @@ class he {
4865
4879
  */
4866
4880
  initialize() {
4867
4881
  return S(this, null, function* () {
4868
- const e = P(y({}, this.options.config), {
4882
+ const e = N(f({}, this.options.config), {
4869
4883
  environment: this.options.environment || this.options.config.environment
4870
4884
  });
4871
4885
  yield this.registry.initialize(e), this.registerPaymentMethods();
@@ -4960,8 +4974,8 @@ class fo {
4960
4974
  }
4961
4975
  makeRequest(t) {
4962
4976
  return S(this, arguments, function* (e, o = {}) {
4963
- const r = yield globalThis.fetch(`${this.config.endpoint}${e}`, y({
4964
- headers: y(y({
4977
+ const r = yield globalThis.fetch(`${this.config.endpoint}${e}`, f({
4978
+ headers: f(f({
4965
4979
  "Content-Type": "application/json"
4966
4980
  }, this.config.headers), o.headers)
4967
4981
  }, o));
@@ -4989,10 +5003,10 @@ class fo {
4989
5003
  return !!this.config.endpoint;
4990
5004
  }
4991
5005
  }
4992
- const fe = Xe(
5006
+ const ve = Xe(
4993
5007
  null
4994
5008
  );
4995
- fe.displayName = "W3PaymentsContext";
5009
+ ve.displayName = "W3PaymentsContext";
4996
5010
  const Co = ({
4997
5011
  endpoint: n,
4998
5012
  environment: e = "sandbox",
@@ -5002,7 +5016,7 @@ const Co = ({
5002
5016
  const { w3payments: r, httpClient: i, isInitialized: a, initError: l } = me(() => {
5003
5017
  try {
5004
5018
  console.debug("W3PaymentsProvider: Initializing clients...");
5005
- const u = he.createClient(e), U = new fo({ endpoint: n });
5019
+ const u = fe.createClient(e), U = new fo({ endpoint: n });
5006
5020
  return console.debug(
5007
5021
  "W3PaymentsProvider: Both clients initialized successfully"
5008
5022
  ), {
@@ -5050,7 +5064,7 @@ const Co = ({
5050
5064
  /* @__PURE__ */ c.jsx("p", { style: { margin: "8px 0 0 0" }, children: l })
5051
5065
  ]
5052
5066
  }
5053
- ) : a ? /* @__PURE__ */ c.jsx(fe.Provider, { value: d, children: t }) : /* @__PURE__ */ c.jsx(
5067
+ ) : a ? /* @__PURE__ */ c.jsx(ve.Provider, { value: d, children: t }) : /* @__PURE__ */ c.jsx(
5054
5068
  "div",
5055
5069
  {
5056
5070
  className: "w3-loading-container",
@@ -5064,7 +5078,7 @@ const Co = ({
5064
5078
  }
5065
5079
  );
5066
5080
  }, vo = () => {
5067
- const n = Ge(fe);
5081
+ const n = Ge(ve);
5068
5082
  if (!n)
5069
5083
  throw new Error(
5070
5084
  "useW3Payments must be used within W3PaymentsProvider. Make sure your component is wrapped with <W3PaymentsProvider>."
@@ -5296,7 +5310,7 @@ const Co = ({
5296
5310
  const t = n.enabled === !1, i = ((a) => {
5297
5311
  const l = a.toLowerCase();
5298
5312
  let d = Me(a);
5299
- if (d || (d = xe(l), d) || (d = Ne(l), d)) return d;
5313
+ if (d || (d = Ne(l), d) || (d = xe(l), d)) return d;
5300
5314
  })(n.displayName);
5301
5315
  return /* @__PURE__ */ c.jsxs("div", { className: "relative", children: [
5302
5316
  /* @__PURE__ */ c.jsxs(
@@ -5342,7 +5356,7 @@ const Co = ({
5342
5356
  const r = ((i) => {
5343
5357
  const a = i.toLowerCase();
5344
5358
  let l = Me(i);
5345
- if (l || (l = xe(a), l) || (l = Ne(a), l)) return l;
5359
+ if (l || (l = Ne(a), l) || (l = xe(a), l)) return l;
5346
5360
  })(n.displayName);
5347
5361
  return /* @__PURE__ */ c.jsx(
5348
5362
  "div",
@@ -5607,7 +5621,7 @@ const Co = ({
5607
5621
  onError: T
5608
5622
  }) => {
5609
5623
  var Y;
5610
- const { w3payments: I, httpClient: ne, isInitialized: G } = vo(), [M, K] = ee(r), [D, L] = ee(), [te, B] = ee(!1), A = me(() => I ? I.getCurrency(l) : null, [I, l]), N = me(() => !G || !I ? [] : I.paymentMethodService.getDisplayOptions({
5624
+ const { w3payments: I, httpClient: ne, isInitialized: G } = vo(), [M, K] = ee(r), [D, L] = ee(), [te, B] = ee(!1), A = me(() => I ? I.getCurrency(l) : null, [I, l]), P = me(() => !G || !I ? [] : I.paymentMethodService.getDisplayOptions({
5611
5625
  walletFilter: w,
5612
5626
  exchangeFilter: C,
5613
5627
  fiatFilter: E,
@@ -5621,14 +5635,14 @@ const Co = ({
5621
5635
  E,
5622
5636
  d,
5623
5637
  u
5624
- ]), Z = (m) => N.find((b) => b.id === m), z = () => !!(M && D && A && I && G), se = () => {
5638
+ ]), Z = (m) => P.find((b) => b.id === m), z = () => !!(M && D && A && I && G), se = () => {
5625
5639
  K(""), L(void 0), B(!1);
5626
5640
  }, F = () => S(null, null, function* () {
5627
5641
  var m;
5628
5642
  if (!(!z() || !I || !A)) {
5629
5643
  B(!0);
5630
5644
  try {
5631
- yield x == null ? void 0 : x(y({
5645
+ yield x == null ? void 0 : x(f({
5632
5646
  amount: M,
5633
5647
  currency: A.code,
5634
5648
  paymentMethodId: D
@@ -5653,7 +5667,7 @@ const Co = ({
5653
5667
  id: b.id,
5654
5668
  url: b.url,
5655
5669
  expiresAt: b.expiresAt,
5656
- metadata: P(y({}, b.metadata), {
5670
+ metadata: N(f({}, b.metadata), {
5657
5671
  selectedVendor: b.selectedVendor,
5658
5672
  vendorId: b.selectedVendor
5659
5673
  })
@@ -5675,7 +5689,7 @@ const Co = ({
5675
5689
  });
5676
5690
  return;
5677
5691
  } else
5678
- R == null || R(P(y({
5692
+ R == null || R(N(f({
5679
5693
  amount: M,
5680
5694
  currency: A.code,
5681
5695
  paymentMethodId: D,
@@ -5694,7 +5708,7 @@ const Co = ({
5694
5708
  });
5695
5709
  }
5696
5710
  else
5697
- R == null || R(y({
5711
+ R == null || R(f({
5698
5712
  amount: M,
5699
5713
  currency: A.code,
5700
5714
  paymentMethodId: D,
@@ -5703,7 +5717,7 @@ const Co = ({
5703
5717
  status: "pending"
5704
5718
  }, o && { userId: o }));
5705
5719
  } catch (b) {
5706
- console.error("Payment failed:", b), T == null || T(P(y(y({
5720
+ console.error("Payment failed:", b), T == null || T(N(f(f({
5707
5721
  message: b instanceof Error ? b.message : "Payment failed"
5708
5722
  }, t && { transactionId: t }), o && { userId: o }), {
5709
5723
  details: b
@@ -5729,7 +5743,7 @@ const Co = ({
5729
5743
  `,
5730
5744
  children: [
5731
5745
  /* @__PURE__ */ c.jsxs("div", { className: "flex flex-col gap-0.5 flex-1 overflow-y-auto pb-1", children: [
5732
- /* @__PURE__ */ c.jsx(yo, y({ title: n }, e && { logo: e })),
5746
+ /* @__PURE__ */ c.jsx(yo, f({ title: n }, e && { logo: e })),
5733
5747
  A && /* @__PURE__ */ c.jsx("div", { className: "px-[var(--spacing)]", children: /* @__PURE__ */ c.jsx(
5734
5748
  To,
5735
5749
  {
@@ -5742,10 +5756,10 @@ const Co = ({
5742
5756
  ) }),
5743
5757
  /* @__PURE__ */ c.jsxs(
5744
5758
  Do,
5745
- P(y({}, D && { selectedMethodId: D }), {
5759
+ N(f({}, D && { selectedMethodId: D }), {
5746
5760
  onMethodSelect: L,
5747
5761
  children: [
5748
- N.filter((m) => m.method === "wallet").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Crypto Wallets", children: N.filter((m) => m.method === "wallet").map((m, b) => /* @__PURE__ */ c.jsx(
5762
+ P.filter((m) => m.method === "wallet").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Crypto Wallets", children: P.filter((m) => m.method === "wallet").map((m, b) => /* @__PURE__ */ c.jsx(
5749
5763
  pe,
5750
5764
  {
5751
5765
  data: {
@@ -5757,7 +5771,7 @@ const Co = ({
5757
5771
  },
5758
5772
  b
5759
5773
  )) }),
5760
- N.filter((m) => m.method === "exchange").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Exchanges", children: N.filter((m) => m.method === "exchange").map((m, b) => /* @__PURE__ */ c.jsx(
5774
+ P.filter((m) => m.method === "exchange").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Exchanges", children: P.filter((m) => m.method === "exchange").map((m, b) => /* @__PURE__ */ c.jsx(
5761
5775
  pe,
5762
5776
  {
5763
5777
  data: {
@@ -5769,7 +5783,7 @@ const Co = ({
5769
5783
  },
5770
5784
  b
5771
5785
  )) }),
5772
- N.filter((m) => m.method === "fiat").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Traditional Payment", children: N.filter((m) => m.method === "fiat").map((m, b) => /* @__PURE__ */ c.jsx(
5786
+ P.filter((m) => m.method === "fiat").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Traditional Payment", children: P.filter((m) => m.method === "fiat").map((m, b) => /* @__PURE__ */ c.jsx(
5773
5787
  pe,
5774
5788
  {
5775
5789
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w3payments/react",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "React component library for universal Web3 payment processing with multi-vendor support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -56,9 +56,9 @@
56
56
  "@storybook/react-vite": "^10.1.10",
57
57
  "@tailwindcss/vite": "^4.1.18",
58
58
  "tailwindcss": "^4.1.18",
59
- "@w3payments/adapters": "1.1.1",
60
- "@w3payments/core": "1.1.1",
61
- "@w3payments/common": "1.1.1"
59
+ "@w3payments/common": "1.1.2",
60
+ "@w3payments/adapters": "1.1.2",
61
+ "@w3payments/core": "1.1.2"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "react": ">=18.0.0",