@imtbl/checkout-sdk 2.4.14-alpha.0 → 2.4.14-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,22 +138,22 @@ var fn = /* @__PURE__ */ ((d) => {
138
138
  d["TRANSFER_FAILED"] = "TRANSFER_FAILED";
139
139
  return d;
140
140
  })(fn || {});
141
- var En = /* @__PURE__ */ ((n) => {
141
+ var gn = /* @__PURE__ */ ((n) => {
142
142
  n["PAYMENT_METHOD_SELECTED"] = "PAYMENT_METHOD_SELECTED";
143
143
  n["PAYMENT_TOKEN_SELECTED"] = "PAYMENT_TOKEN_SELECTED";
144
144
  n["NETWORK_SWITCH"] = "NETWORK_SWITCH";
145
145
  return n;
146
- })(En || {});
146
+ })(gn || {});
147
147
 
148
148
  // src/widgets/definitions/events/addTokens.ts
149
- var gn = /* @__PURE__ */ ((a) => {
149
+ var En = /* @__PURE__ */ ((a) => {
150
150
  a["CLOSE_WIDGET"] = "close-widget";
151
151
  a["LANGUAGE_CHANGED"] = "language-changed";
152
152
  a["CONNECT_SUCCESS"] = "connect-success";
153
153
  a["SUCCESS"] = "success";
154
154
  a["FAILURE"] = "failure";
155
155
  return a;
156
- })(gn || {});
156
+ })(En || {});
157
157
 
158
158
  // src/widgets/definitions/events/purchase.ts
159
159
  var Rn = /* @__PURE__ */ ((o) => {
@@ -229,7 +229,7 @@ var _config = require('@imtbl/config');
229
229
  // src/api/http/httpClient.ts
230
230
  var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
231
231
  var Sn = "pk_imapik-";
232
- var Pn = [
232
+ var kn = [
233
233
  "https://checkout-api.dev.immutable.com",
234
234
  "https://checkout-api.sandbox.immutable.com",
235
235
  "https://checkout-api.immutable.com"
@@ -244,7 +244,7 @@ var le = class {
244
244
  }
245
245
  // eslint-disable-next-line class-methods-use-this
246
246
  shouldAddPublishableKey(e) {
247
- return Pn.some((t) => e.startsWith(t));
247
+ return kn.some((t) => e.startsWith(t));
248
248
  }
249
249
  setupInterceptors() {
250
250
  this.axiosInstance.interceptors.request.use(
@@ -418,18 +418,18 @@ var Se = {
418
418
  decimals: G,
419
419
  address: _
420
420
  };
421
- var kn = {
421
+ var Pn = {
422
422
  name: "tIMX",
423
423
  symbol: "tIMX",
424
424
  decimals: G,
425
425
  address: _
426
426
  };
427
- var U = {
427
+ var L = {
428
428
  [Z]: "https://api.dev.immutable.com",
429
429
  [_config.Environment.SANDBOX]: "https://api.sandbox.immutable.com",
430
430
  [_config.Environment.PRODUCTION]: "https://api.immutable.com"
431
431
  };
432
- var Pe = {
432
+ var ke = {
433
433
  [Z]: "https://checkout-api.dev.immutable.com",
434
434
  [_config.Environment.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
435
435
  [_config.Environment.PRODUCTION]: "https://checkout-api.immutable.com"
@@ -489,7 +489,7 @@ var we = /* @__PURE__ */ new Map([
489
489
  chainIdHex: `0x${13473 .toString(16)}`,
490
490
  chainName: "Immutable zkEVM Testnet",
491
491
  rpcUrls: ["https://rpc.testnet.immutable.com"],
492
- nativeCurrency: kn
492
+ nativeCurrency: Pn
493
493
  }
494
494
  ]
495
495
  ]);
@@ -536,7 +536,7 @@ var te = {
536
536
  nativeToken: ye.get(1).nativeCurrency
537
537
  }
538
538
  };
539
- var L = [
539
+ var D = [
540
540
  {
541
541
  constant: true,
542
542
  inputs: [],
@@ -803,15 +803,15 @@ var ot = {
803
803
  };
804
804
 
805
805
  // src/env/env.ts
806
- var vn = "2.4.14-alpha.0";
806
+ var vn = "2.4.14-alpha.2";
807
807
  var pe = () => vn;
808
808
 
809
809
  // src/availability/availability.ts
810
- var ke = (r, e) => {
810
+ var Pe = (r, e) => {
811
811
  const t = () => {
812
- if (r) return U[Z];
813
- if (e) return U[_config.Environment.PRODUCTION];
814
- return U[_config.Environment.SANDBOX];
812
+ if (r) return L[Z];
813
+ if (e) return L[_config.Environment.PRODUCTION];
814
+ return L[_config.Environment.SANDBOX];
815
815
  };
816
816
  const n = async () => {
817
817
  let o;
@@ -915,16 +915,16 @@ var B = /* @__PURE__ */ ((o) => {
915
915
  o["ERC1155"] = "ERC1155";
916
916
  return o;
917
917
  })(B || {});
918
- var Ee = /* @__PURE__ */ ((t) => {
918
+ var ge = /* @__PURE__ */ ((t) => {
919
919
  t["TRANSACTION"] = "TRANSACTION";
920
920
  t["GAS"] = "GAS";
921
921
  return t;
922
- })(Ee || {});
923
- var ge = /* @__PURE__ */ ((t) => {
922
+ })(ge || {});
923
+ var Ee = /* @__PURE__ */ ((t) => {
924
924
  t["NATIVE"] = "NATIVE";
925
925
  t["ERC20"] = "ERC20";
926
926
  return t;
927
- })(ge || {});
927
+ })(Ee || {});
928
928
  var st = /* @__PURE__ */ ((n) => {
929
929
  n["ROUTES_FOUND"] = "ROUTES_FOUND";
930
930
  n["NO_ROUTES_FOUND"] = "NO_ROUTES_FOUND";
@@ -1305,9 +1305,9 @@ var bn = (r, e) => {
1305
1305
  return we;
1306
1306
  };
1307
1307
  var Ln = (r, e) => {
1308
- if (e) return U[Z];
1309
- if (r) return U[_config.Environment.PRODUCTION];
1310
- return U[_config.Environment.SANDBOX];
1308
+ if (e) return L[Z];
1309
+ if (r) return L[_config.Environment.PRODUCTION];
1310
+ return L[_config.Environment.SANDBOX];
1311
1311
  };
1312
1312
  var Dn = (r, e) => {
1313
1313
  if (e) return "imtbl-zkevm-devnet";
@@ -1324,9 +1324,9 @@ var A = (r) => {
1324
1324
  return 13473;
1325
1325
  };
1326
1326
  var Fn = (r, e) => {
1327
- if (e) return Pe[Z];
1328
- if (r) return Pe[_config.Environment.PRODUCTION];
1329
- return Pe[_config.Environment.SANDBOX];
1327
+ if (e) return ke[Z];
1328
+ if (r) return ke[_config.Environment.PRODUCTION];
1329
+ return ke[_config.Environment.SANDBOX];
1330
1330
  };
1331
1331
  var Ie = (_class2 = class {
1332
1332
  // This is a hidden feature that is only available
@@ -1436,7 +1436,7 @@ var O = (r) => !r || T(r, _);
1436
1436
  async function Oe(r, e) {
1437
1437
  return await x(
1438
1438
  async () => {
1439
- const t = new (0, _ethers.Contract)(e, JSON.stringify(L), r);
1439
+ const t = new (0, _ethers.Contract)(e, JSON.stringify(D), r);
1440
1440
  const [n, o, a] = await Promise.all([
1441
1441
  t.name(),
1442
1442
  t.symbol(),
@@ -1619,7 +1619,7 @@ async function ft(r, e, t) {
1619
1619
  async () => {
1620
1620
  const n = new (0, _ethers.Contract)(
1621
1621
  t,
1622
- JSON.stringify(L),
1622
+ JSON.stringify(D),
1623
1623
  r
1624
1624
  );
1625
1625
  return Promise.all([
@@ -1643,7 +1643,7 @@ async function ft(r, e, t) {
1643
1643
  );
1644
1644
  }
1645
1645
  var pt = /* @__PURE__ */ new Map();
1646
- var Et = () => pt.clear();
1646
+ var gt = () => pt.clear();
1647
1647
  var zn = async (r, e, t, n) => {
1648
1648
  const o = n !== void 0;
1649
1649
  const a = Object.assign(
@@ -1659,37 +1659,37 @@ var zn = async (r, e, t, n) => {
1659
1659
  const i = [];
1660
1660
  const c = "ERC-20";
1661
1661
  const d = async (m) => {
1662
- let E;
1662
+ let g;
1663
1663
  try {
1664
1664
  do {
1665
- E = await m.getTokensByWalletAddress({
1665
+ g = await m.getTokensByWalletAddress({
1666
1666
  walletAddress: e,
1667
1667
  tokenType: c,
1668
- nextPage: _optionalChain([E, 'optionalAccess', _74 => _74.next_page_params])
1668
+ nextPage: _optionalChain([g, 'optionalAccess', _74 => _74.next_page_params])
1669
1669
  });
1670
- i.push(...E.items);
1671
- } while (E.next_page_params);
1672
- } catch (g) {
1673
- if (_optionalChain([g, 'optionalAccess', _75 => _75.code]) !== _axios.HttpStatusCode.NotFound) {
1670
+ i.push(...g.items);
1671
+ } while (g.next_page_params);
1672
+ } catch (E) {
1673
+ if (_optionalChain([E, 'optionalAccess', _75 => _75.code]) !== _axios.HttpStatusCode.NotFound) {
1674
1674
  throw new p(
1675
- g.message || "InternalServerError | getTokensByWalletAddress",
1675
+ E.message || "InternalServerError | getTokensByWalletAddress",
1676
1676
  "GET_INDEXER_BALANCE_ERROR",
1677
- { error: g }
1677
+ { error: E }
1678
1678
  );
1679
1679
  }
1680
1680
  }
1681
1681
  };
1682
1682
  const l = async (m) => {
1683
1683
  try {
1684
- const E = await m.getNativeTokenByWalletAddress({ walletAddress: e });
1685
- E.token.address ||= _;
1686
- i.push(E);
1687
- } catch (E) {
1688
- if (_optionalChain([E, 'optionalAccess', _76 => _76.code]) !== _axios.HttpStatusCode.NotFound) {
1684
+ const g = await m.getNativeTokenByWalletAddress({ walletAddress: e });
1685
+ g.token.address ||= _;
1686
+ i.push(g);
1687
+ } catch (g) {
1688
+ if (_optionalChain([g, 'optionalAccess', _76 => _76.code]) !== _axios.HttpStatusCode.NotFound) {
1689
1689
  throw new p(
1690
- E.message || "InternalServerError | getNativeTokenByWalletAddress",
1690
+ g.message || "InternalServerError | getNativeTokenByWalletAddress",
1691
1691
  "GET_INDEXER_BALANCE_ERROR",
1692
- { error: E }
1692
+ { error: g }
1693
1693
  );
1694
1694
  }
1695
1695
  }
@@ -1700,16 +1700,16 @@ var zn = async (r, e, t, n) => {
1700
1700
  ]);
1701
1701
  const u = [];
1702
1702
  i.forEach((m) => {
1703
- const E = a[m.token.address.toLowerCase()];
1704
- if (o && !E) return;
1705
- const g = m.token || {};
1703
+ const g = a[m.token.address.toLowerCase()];
1704
+ if (o && !g) return;
1705
+ const E = m.token || {};
1706
1706
  if (m.value == null) return;
1707
1707
  const f = BigInt(m.value);
1708
- let R = parseInt(g.decimals, 10);
1708
+ let R = parseInt(E.decimals, 10);
1709
1709
  if (Number.isNaN(R)) R = G;
1710
- const I = _nullishCoalesce(g.icon_url, () => ( E.icon));
1710
+ const I = _nullishCoalesce(E.icon_url, () => ( g.icon));
1711
1711
  const C = {
1712
- ...g,
1712
+ ...E,
1713
1713
  decimals: R,
1714
1714
  icon: I
1715
1715
  };
@@ -1778,7 +1778,7 @@ var q = async (r, e, t, n, o = false) => {
1778
1778
  }
1779
1779
  );
1780
1780
  if (o) {
1781
- Et();
1781
+ gt();
1782
1782
  }
1783
1783
  if (he.isChainSupported(n)) {
1784
1784
  const s = await _asyncNullishCoalesce(t, async () => ( await await _asyncOptionalChain([(await _optionalChain([e, 'optionalAccess', _77 => _77.getSigner, 'call', _78 => _78()])), 'optionalAccess', async _79 => _79.getAddress, 'call', async _80 => _80()])));
@@ -2124,7 +2124,7 @@ async function ar(r, e, t) {
2124
2124
 
2125
2125
  // src/gasEstimate/gasPriceInWei.ts
2126
2126
  var lo = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2127
- var gt = (r) => {
2127
+ var Et = (r) => {
2128
2128
  if (lo(r)) {
2129
2129
  const { maxFeePerGas: e, maxPriorityFeePerGas: t } = r;
2130
2130
  if (e === null || t === null) return null;
@@ -2195,7 +2195,7 @@ function Ct() {
2195
2195
  }
2196
2196
 
2197
2197
  // src/provider/injectedProvidersManager.ts
2198
- var D = (_class4 = class r {
2198
+ var F = (_class4 = class r {
2199
2199
 
2200
2200
 
2201
2201
 
@@ -2268,7 +2268,7 @@ var mo = (r) => ({
2268
2268
  });
2269
2269
 
2270
2270
  // src/provider/provider.ts
2271
- async function Eo() {
2271
+ async function go() {
2272
2272
  const r = await x(
2273
2273
  async () => await _detectprovider2.default.call(void 0, ),
2274
2274
  { type: "METAMASK_PROVIDER_ERROR" }
@@ -2286,7 +2286,7 @@ async function sr(r, e) {
2286
2286
  let n;
2287
2287
  switch (r) {
2288
2288
  case "passport": {
2289
- n = D.getInstance().findProvider({ rdns: Le.rdns });
2289
+ n = F.getInstance().findProvider({ rdns: Le.rdns });
2290
2290
  if (!n) {
2291
2291
  if (e) {
2292
2292
  t = new b(
@@ -2305,14 +2305,14 @@ async function sr(r, e) {
2305
2305
  break;
2306
2306
  }
2307
2307
  case "metamask": {
2308
- n = D.getInstance().findProvider({ rdns: be.rdns });
2308
+ n = F.getInstance().findProvider({ rdns: be.rdns });
2309
2309
  if (!n) {
2310
- t = await Eo();
2310
+ t = await go();
2311
2311
  }
2312
2312
  break;
2313
2313
  }
2314
2314
  default:
2315
- n = D.getInstance().findProvider({ rdns: r });
2315
+ n = F.getInstance().findProvider({ rdns: r });
2316
2316
  if (!n) {
2317
2317
  console.error(
2318
2318
  "The WalletProviderName that was provided is not supported"
@@ -2529,7 +2529,7 @@ var Ao = async (r, e, t, n) => {
2529
2529
  try {
2530
2530
  const o = new (0, _ethers.Contract)(
2531
2531
  t,
2532
- JSON.stringify(L),
2532
+ JSON.stringify(D),
2533
2533
  r
2534
2534
  );
2535
2535
  return await o.allowance(e, n);
@@ -2545,7 +2545,7 @@ var yo = async (r, e, t, n, o) => {
2545
2545
  try {
2546
2546
  const a = new (0, _ethers.Contract)(
2547
2547
  t,
2548
- JSON.stringify(L),
2548
+ JSON.stringify(D),
2549
2549
  r
2550
2550
  );
2551
2551
  const s = await a.approve.populateTransaction(n, o);
@@ -2566,39 +2566,39 @@ var lr = async (r, e, t) => {
2566
2566
  const s = /* @__PURE__ */ new Map();
2567
2567
  const i = /* @__PURE__ */ new Map();
2568
2568
  const c = /* @__PURE__ */ new Map();
2569
- for (const E of t) {
2570
- if (E.type !== "ERC20") continue;
2571
- const { tokenAddress: g, spenderAddress: f } = E;
2572
- const R = `${g}${f}`;
2573
- a.set(R, E);
2569
+ for (const g of t) {
2570
+ if (g.type !== "ERC20") continue;
2571
+ const { tokenAddress: E, spenderAddress: f } = g;
2572
+ const R = `${E}${f}`;
2573
+ a.set(R, g);
2574
2574
  s.set(
2575
2575
  R,
2576
- Ao(r, e, g, f)
2576
+ Ao(r, e, E, f)
2577
2577
  );
2578
2578
  }
2579
2579
  const d = await Promise.all(s.values());
2580
2580
  const l = Array.from(s.keys());
2581
- for (let E = 0; E < d.length; E++) {
2582
- const g = a.get(l[E]);
2583
- if (!g || g.type !== "ERC20") continue;
2584
- if (d[E] >= g.amount) {
2581
+ for (let g = 0; g < d.length; g++) {
2582
+ const E = a.get(l[g]);
2583
+ if (!E || E.type !== "ERC20") continue;
2584
+ if (d[g] >= E.amount) {
2585
2585
  o.push({
2586
2586
  sufficient: true,
2587
- itemRequirement: g
2587
+ itemRequirement: E
2588
2588
  });
2589
2589
  continue;
2590
2590
  }
2591
2591
  n = false;
2592
- const { tokenAddress: f, spenderAddress: R } = g;
2592
+ const { tokenAddress: f, spenderAddress: R } = E;
2593
2593
  const I = `${f}${R}`;
2594
- const C = g.amount - d[E];
2594
+ const C = E.amount - d[g];
2595
2595
  i.set(
2596
2596
  I,
2597
2597
  {
2598
2598
  type: "ERC20",
2599
2599
  sufficient: false,
2600
2600
  delta: C,
2601
- itemRequirement: g,
2601
+ itemRequirement: E,
2602
2602
  approvalTransaction: void 0
2603
2603
  }
2604
2604
  );
@@ -2615,11 +2615,11 @@ var lr = async (r, e, t) => {
2615
2615
  }
2616
2616
  const u = await Promise.all(c.values());
2617
2617
  const m = Array.from(c.keys());
2618
- u.forEach((E, g) => {
2619
- const f = i.get(m[g]);
2618
+ u.forEach((g, E) => {
2619
+ const f = i.get(m[E]);
2620
2620
  if (!f) return;
2621
2621
  if (f.sufficient) return;
2622
- f.approvalTransaction = E;
2622
+ f.approvalTransaction = g;
2623
2623
  });
2624
2624
  return { sufficient: n, allowances: o.concat(Array.from(i.values())) };
2625
2625
  };
@@ -2671,7 +2671,7 @@ var So = async (r, e, t, n, o) => {
2671
2671
  );
2672
2672
  }
2673
2673
  };
2674
- var Po = async (r, e, t) => {
2674
+ var ko = async (r, e, t) => {
2675
2675
  try {
2676
2676
  const n = new (0, _ethers.Contract)(
2677
2677
  e,
@@ -2709,7 +2709,7 @@ var pr = (r, e) => {
2709
2709
  );
2710
2710
  }
2711
2711
  };
2712
- var ko = async (r, e, t) => {
2712
+ var Po = async (r, e, t) => {
2713
2713
  const n = /* @__PURE__ */ new Map();
2714
2714
  const o = /* @__PURE__ */ new Map();
2715
2715
  for (const i of e) {
@@ -2739,37 +2739,37 @@ var ur = async (r, e, t) => {
2739
2739
  const s = /* @__PURE__ */ new Map();
2740
2740
  const i = /* @__PURE__ */ new Map();
2741
2741
  const c = /* @__PURE__ */ new Map();
2742
- const d = await ko(
2742
+ const d = await Po(
2743
2743
  r,
2744
2744
  t,
2745
2745
  e
2746
2746
  );
2747
- for (const g of t) {
2748
- if (g.type !== "ERC721") continue;
2749
- const { contractAddress: f, id: R, spenderAddress: I } = g;
2747
+ for (const E of t) {
2748
+ if (E.type !== "ERC721") continue;
2749
+ const { contractAddress: f, id: R, spenderAddress: I } = E;
2750
2750
  const C = `${f}-${I}`;
2751
2751
  const y = d.get(C);
2752
2752
  if (y) {
2753
2753
  o.push({
2754
2754
  sufficient: true,
2755
- itemRequirement: g
2755
+ itemRequirement: E
2756
2756
  });
2757
2757
  continue;
2758
2758
  }
2759
- const P = `${f}-${R}`;
2759
+ const k = `${f}-${R}`;
2760
2760
  const N = pr(R, f);
2761
- a.set(P, g);
2761
+ a.set(k, E);
2762
2762
  s.set(
2763
- P,
2764
- Po(r, f, N)
2763
+ k,
2764
+ ko(r, f, N)
2765
2765
  );
2766
2766
  }
2767
2767
  const l = await Promise.all(s.values());
2768
2768
  const u = Array.from(s.keys());
2769
- for (let g = 0; g < l.length; g++) {
2770
- const f = a.get(u[g]);
2769
+ for (let E = 0; E < l.length; E++) {
2770
+ const f = a.get(u[E]);
2771
2771
  if (!f || f.type !== "ERC721") continue;
2772
- if (l[g] === f.spenderAddress) {
2772
+ if (l[E] === f.spenderAddress) {
2773
2773
  o.push({
2774
2774
  sufficient: true,
2775
2775
  itemRequirement: f
@@ -2779,7 +2779,7 @@ var ur = async (r, e, t) => {
2779
2779
  n = false;
2780
2780
  const { contractAddress: R, id: I, spenderAddress: C } = f;
2781
2781
  const y = `${R}-${I}`;
2782
- const P = pr(I, R);
2782
+ const k = pr(I, R);
2783
2783
  i.set(
2784
2784
  y,
2785
2785
  {
@@ -2796,17 +2796,17 @@ var ur = async (r, e, t) => {
2796
2796
  e,
2797
2797
  R,
2798
2798
  C,
2799
- P
2799
+ k
2800
2800
  )
2801
2801
  );
2802
2802
  }
2803
2803
  const m = await Promise.all(c.values());
2804
- const E = Array.from(c.keys());
2805
- m.forEach((g, f) => {
2806
- const R = i.get(E[f]);
2804
+ const g = Array.from(c.keys());
2805
+ m.forEach((E, f) => {
2806
+ const R = i.get(g[f]);
2807
2807
  if (!R) return;
2808
2808
  if (R.sufficient) return;
2809
- R.approvalTransaction = g;
2809
+ R.approvalTransaction = E;
2810
2810
  });
2811
2811
  return { sufficient: n, allowances: o.concat(Array.from(i.values())) };
2812
2812
  };
@@ -2954,11 +2954,11 @@ var Bo = (r) => {
2954
2954
  });
2955
2955
  return t.concat(Array.from(e.values()));
2956
2956
  };
2957
- var Er = (r) => Bo(Oo(_o(r)));
2957
+ var gr = (r) => Bo(Oo(_o(r)));
2958
2958
 
2959
2959
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2960
2960
 
2961
- var gr = (r) => r.map((e) => {
2961
+ var Er = (r) => r.map((e) => {
2962
2962
  switch (e.type) {
2963
2963
  case "ERC20":
2964
2964
  return {
@@ -3045,16 +3045,16 @@ var Tr = async (r, e, t) => {
3045
3045
  try {
3046
3046
  const l = new (0, _ethers.Contract)(
3047
3047
  o.tokenAddress,
3048
- JSON.stringify(L),
3048
+ JSON.stringify(D),
3049
3049
  t
3050
3050
  );
3051
- const [u, m, E] = await Promise.all([
3051
+ const [u, m, g] = await Promise.all([
3052
3052
  l.name(),
3053
3053
  l.symbol(),
3054
3054
  l.decimals()
3055
3055
  ]);
3056
3056
  s = o.tokenAddress;
3057
- d = E;
3057
+ d = g;
3058
3058
  i = u;
3059
3059
  c = m;
3060
3060
  } catch (l) {
@@ -3142,7 +3142,7 @@ var Ir = (r, e, t) => {
3142
3142
  var Lo = async (r, e, t, n, o = false) => {
3143
3143
  try {
3144
3144
  const a = /* @__PURE__ */ new Map();
3145
- gr(n).forEach(
3145
+ Er(n).forEach(
3146
3146
  (i) => {
3147
3147
  if (!i.address) return;
3148
3148
  a.set(i.address.toLocaleLowerCase(), i);
@@ -3201,7 +3201,7 @@ var Do = async (r, e, t) => {
3201
3201
  return n;
3202
3202
  };
3203
3203
  var hr = async (r, e, t, n, o = false) => {
3204
- const a = Er(n);
3204
+ const a = gr(n);
3205
3205
  const s = [];
3206
3206
  const i = [];
3207
3207
  a.forEach((m) => {
@@ -3234,32 +3234,32 @@ var hr = async (r, e, t, n, o = false) => {
3234
3234
  const l = [];
3235
3235
  if (s.length > 0) {
3236
3236
  const m = _nullishCoalesce(d.shift(), () => ( []));
3237
- const E = new Map(m.map((f) => {
3237
+ const g = new Map(m.map((f) => {
3238
3238
  const R = f.type === "NATIVE" ? _ : _optionalChain([f, 'access', _130 => _130.token, 'access', _131 => _131.address, 'optionalAccess', _132 => _132.toLowerCase, 'call', _133 => _133()]);
3239
3239
  return [R, f];
3240
3240
  }));
3241
- const g = await Tr(s, m, e);
3241
+ const E = await Tr(s, m, e);
3242
3242
  s.forEach((f) => {
3243
3243
  const R = (_nullishCoalesce(f.tokenAddress, () => ( _))).toLowerCase();
3244
- const I = g[R];
3245
- const C = E.get(R);
3246
- const y = Ir(f, [...E.values()], I);
3244
+ const I = E[R];
3245
+ const C = g.get(R);
3246
+ const y = Ir(f, [...g.values()], I);
3247
3247
  l.push(y);
3248
3248
  if (!C) {
3249
3249
  return;
3250
3250
  }
3251
- const P = C.balance - y.required.balance;
3252
- E.set(R, {
3251
+ const k = C.balance - y.required.balance;
3252
+ g.set(R, {
3253
3253
  ...C,
3254
- balance: P,
3255
- formattedBalance: _ethers.formatUnits.call(void 0, P, y.required.token.decimals)
3254
+ balance: k,
3255
+ formattedBalance: _ethers.formatUnits.call(void 0, k, y.required.token.decimals)
3256
3256
  });
3257
3257
  });
3258
3258
  }
3259
3259
  if (i.length > 0) {
3260
3260
  const m = _nullishCoalesce(d.shift(), () => ( []));
3261
- i.forEach((E) => {
3262
- l.push(Rr(E, m));
3261
+ i.forEach((g) => {
3262
+ l.push(Rr(g, m));
3263
3263
  });
3264
3264
  }
3265
3265
  const u = l.find((m) => !m.sufficient) === void 0;
@@ -3308,7 +3308,7 @@ var yr = async (r, e, t) => {
3308
3308
  n.push(Ar(r, t.transaction));
3309
3309
  } else {
3310
3310
  const s = await r.getFeeData();
3311
- const i = gt(s);
3311
+ const i = Et(s);
3312
3312
  if (i !== null) {
3313
3313
  const c = i * t.gasToken.limit;
3314
3314
  if (c) o += c;
@@ -3325,7 +3325,7 @@ var yr = async (r, e, t) => {
3325
3325
  // src/smartCheckout/routing/geoBlocking.ts
3326
3326
  var wr = async () => true;
3327
3327
  var Sr = async (r) => {
3328
- const e = ke(r.isDevelopment, r.isProduction);
3328
+ const e = Pe(r.isDevelopment, r.isProduction);
3329
3329
  try {
3330
3330
  return await e.checkDexAvailability();
3331
3331
  } catch (e4) {
@@ -3337,7 +3337,7 @@ var Sr = async (r) => {
3337
3337
  function ht(r) {
3338
3338
  return _optionalChain([r, 'optionalAccess', _134 => _134.ethereumProvider, 'optionalAccess', _135 => _135.isPassport]) === true;
3339
3339
  }
3340
- var Pr = async (r, e) => {
3340
+ var kr = async (r, e) => {
3341
3341
  const t = {
3342
3342
  onRamp: r.isOnRampEnabled,
3343
3343
  swap: r.isSwapEnabled,
@@ -3363,7 +3363,7 @@ var Pr = async (r, e) => {
3363
3363
  };
3364
3364
 
3365
3365
  // src/smartCheckout/routing/tokenBalances.ts
3366
- var kr = async (r, e, t, n) => {
3366
+ var Pr = async (r, e, t, n) => {
3367
3367
  const o = /* @__PURE__ */ new Map();
3368
3368
  const a = /* @__PURE__ */ new Map();
3369
3369
  if (e.size === 0) {
@@ -3459,8 +3459,8 @@ var We = async (r, e, t, n, o) => {
3459
3459
  );
3460
3460
  l.forEach((u, m) => {
3461
3461
  if (u.status === "rejected") return;
3462
- const E = d[m];
3463
- a.set(E, {
3462
+ const g = d[m];
3463
+ a.set(g, {
3464
3464
  quote: u.value.quote,
3465
3465
  approval: _nullishCoalesce(_optionalChain([u, 'access', _136 => _136.value, 'access', _137 => _137.approval, 'optionalAccess', _138 => _138.gasFeeEstimate]), () => ( null)),
3466
3466
  swap: u.value.swap.gasFeeEstimate
@@ -3692,12 +3692,12 @@ var Ge = async (r, e, t, n, o, a, s) => {
3692
3692
  c,
3693
3693
  a
3694
3694
  );
3695
- const E = Array.from(m.keys());
3696
- for (const g of E) {
3697
- const f = m.get(g);
3695
+ const g = Array.from(m.keys());
3696
+ for (const E of g) {
3697
+ const f = m.get(E);
3698
3698
  if (!f) continue;
3699
3699
  const R = u.find(
3700
- (P) => T(P.token.address, g)
3700
+ (k) => T(k.token.address, E)
3701
3701
  );
3702
3702
  if (!R) continue;
3703
3703
  const I = f.quote.amountWithMaxSlippage;
@@ -3711,13 +3711,13 @@ var Ge = async (r, e, t, n, o, a, s) => {
3711
3711
  f.quote.fees,
3712
3712
  {
3713
3713
  amount: I.value,
3714
- address: g
3714
+ address: E
3715
3715
  }
3716
3716
  )) continue;
3717
3717
  if (!Ho(
3718
3718
  R.balance,
3719
3719
  s,
3720
- g,
3720
+ E,
3721
3721
  I.value,
3722
3722
  C,
3723
3723
  f.quote.fees
@@ -3952,50 +3952,50 @@ var Ve = async (r, e, t, n, o) => {
3952
3952
  if (!u) return void 0;
3953
3953
  const { l1address: m } = u;
3954
3954
  if (O(m)) {
3955
- if (!l.find((P) => O(P.address))) return void 0;
3956
- } else if (!l.find((P) => T(P.address, m))) {
3955
+ if (!l.find((k) => O(k.address))) return void 0;
3956
+ } else if (!l.find((k) => T(k.address, m))) {
3957
3957
  return void 0;
3958
3958
  }
3959
- const E = await Or(
3959
+ const g = await Or(
3960
3960
  r,
3961
3961
  e,
3962
3962
  a,
3963
3963
  s
3964
3964
  );
3965
3965
  const {
3966
- sourceChainGas: g,
3966
+ sourceChainGas: E,
3967
3967
  approvalGas: f,
3968
3968
  bridgeFee: R,
3969
3969
  imtblFee: I,
3970
3970
  totalFees: C
3971
- } = E;
3971
+ } = g;
3972
3972
  if (!Yo(c, C)) return void 0;
3973
3973
  if (O(m)) {
3974
- const P = c.balances.find((N) => O(N.token.address));
3975
- if (P && P.balance >= n.amount + C) {
3974
+ const k = c.balances.find((N) => O(N.token.address));
3975
+ if (k && k.balance >= n.amount + C) {
3976
3976
  const N = Br(
3977
- g,
3977
+ E,
3978
3978
  R,
3979
3979
  I,
3980
3980
  f,
3981
3981
  i
3982
3982
  );
3983
- return Mr(a, P, n, "NATIVE", N);
3983
+ return Mr(a, k, n, "NATIVE", N);
3984
3984
  }
3985
3985
  return void 0;
3986
3986
  }
3987
3987
  const y = c.balances.find(
3988
- (P) => T(P.token.address, m)
3988
+ (k) => T(k.token.address, m)
3989
3989
  );
3990
3990
  if (y && y.balance >= n.amount) {
3991
- const P = Br(
3992
- g,
3991
+ const k = Br(
3992
+ E,
3993
3993
  R,
3994
3994
  I,
3995
3995
  f,
3996
3996
  i
3997
3997
  );
3998
- return Mr(a, y, n, "ERC20", P);
3998
+ return Mr(a, y, n, "ERC20", k);
3999
3999
  }
4000
4000
  return void 0;
4001
4001
  };
@@ -4073,9 +4073,9 @@ var br = (r, e, t, n, o) => {
4073
4073
  return T(C.token.address, l);
4074
4074
  });
4075
4075
  if (!m) continue;
4076
- const E = i.quote.amountWithMaxSlippage.value;
4077
- const g = $o(i, s);
4078
- const f = E + g;
4076
+ const g = i.quote.amountWithMaxSlippage.value;
4077
+ const E = $o(i, s);
4078
+ const f = g + E;
4079
4079
  const R = Xo(
4080
4080
  o,
4081
4081
  s
@@ -4168,15 +4168,15 @@ var oa = (r, e, t, n, o) => {
4168
4168
  let u = BigInt(0);
4169
4169
  const m = s.get(l);
4170
4170
  if (m) u = m.balance;
4171
- const E = u + d;
4172
- const g = o.find((f) => T(f.address, l));
4171
+ const g = u + d;
4172
+ const E = o.find((f) => T(f.address, l));
4173
4173
  s.set(l, {
4174
- balance: E,
4174
+ balance: g,
4175
4175
  formattedBalance: _ethers.formatUnits.call(void 0,
4176
- E,
4177
- g.decimals
4176
+ g,
4177
+ E.decimals
4178
4178
  ),
4179
- token: g
4179
+ token: E
4180
4180
  });
4181
4181
  }
4182
4182
  const i = Array.from(s.values());
@@ -4250,22 +4250,22 @@ var Fr = async (r, e, t, n, o, a, s, i, c) => {
4250
4250
  u
4251
4251
  )) return [];
4252
4252
  const m = await Lr(r, i);
4253
- const E = na(
4253
+ const g = na(
4254
4254
  u,
4255
4255
  s,
4256
4256
  i,
4257
4257
  m
4258
4258
  );
4259
- if (E.length === 0) return [];
4260
- const g = await Dr(
4259
+ if (g.length === 0) return [];
4260
+ const E = await Dr(
4261
4261
  r,
4262
4262
  o,
4263
4263
  u,
4264
4264
  n,
4265
- E
4265
+ g
4266
4266
  );
4267
4267
  const f = br(
4268
- g,
4268
+ E,
4269
4269
  d,
4270
4270
  l,
4271
4271
  m,
@@ -4275,37 +4275,37 @@ var Fr = async (r, e, t, n, o, a, s, i, c) => {
4275
4275
  const R = /* @__PURE__ */ new Map();
4276
4276
  const I = /* @__PURE__ */ new Map();
4277
4277
  const C = [];
4278
- for (const W of f) {
4279
- if (!W.l2address) continue;
4278
+ for (const U of f) {
4279
+ if (!U.l2address) continue;
4280
4280
  R.set(
4281
- W.l2address,
4281
+ U.l2address,
4282
4282
  Ve(
4283
4283
  r,
4284
4284
  e,
4285
4285
  t,
4286
- W,
4286
+ U,
4287
4287
  a
4288
4288
  )
4289
4289
  );
4290
- I.set(W.l2address, {
4291
- amount: W.amount,
4292
- formattedAmount: W.formattedAmount,
4293
- l2address: W.l2address
4290
+ I.set(U.l2address, {
4291
+ amount: U.amount,
4292
+ formattedAmount: U.formattedAmount,
4293
+ l2address: U.l2address
4294
4294
  });
4295
4295
  }
4296
4296
  const y = await Promise.all(R.values());
4297
- const P = Array.from(R.keys());
4297
+ const k = Array.from(R.keys());
4298
4298
  const N = [];
4299
- y.forEach((W, et) => {
4300
- const j = P[et];
4301
- if (W === void 0) return;
4299
+ y.forEach((U, et) => {
4300
+ const j = k[et];
4301
+ if (U === void 0) return;
4302
4302
  N.push(j);
4303
- const k = I.get(j);
4304
- if (!k) return;
4303
+ const P = I.get(j);
4304
+ if (!P) return;
4305
4305
  C.push({
4306
- amount: k.amount,
4307
- formattedAmount: k.formattedAmount,
4308
- l2address: k.l2address
4306
+ amount: P.amount,
4307
+ formattedAmount: P.formattedAmount,
4308
+ l2address: P.l2address
4309
4309
  });
4310
4310
  });
4311
4311
  if (N.length === 0) return [];
@@ -4436,15 +4436,15 @@ var pa = async (r, e, t, n, o, a, s, i) => {
4436
4436
  if (!d) return [];
4437
4437
  if (d.error !== void 0 || !d.success) return [];
4438
4438
  const l = _nullishCoalesce(_optionalChain([s, 'optionalAccess', _145 => _145.bridge]), () => ( []));
4439
- const u = l.map((g) => {
4440
- if (g.address === void 0) return J;
4441
- return g.address;
4439
+ const u = l.map((E) => {
4440
+ if (E.address === void 0) return J;
4441
+ return E.address;
4442
4442
  });
4443
4443
  const m = _nullishCoalesce(_optionalChain([s, 'optionalAccess', _146 => _146.swap]), () => ( []));
4444
4444
  if (n.type !== "NATIVE" && n.type !== "ERC20") {
4445
4445
  return [];
4446
4446
  }
4447
- const E = await Fr(
4447
+ const g = await Fr(
4448
4448
  r,
4449
4449
  e,
4450
4450
  t,
@@ -4455,7 +4455,7 @@ var pa = async (r, e, t, n, o, a, s, i) => {
4455
4455
  m,
4456
4456
  i
4457
4457
  );
4458
- return E;
4458
+ return g;
4459
4459
  };
4460
4460
  var ua = async (r, e, t) => {
4461
4461
  if (!e.onRamp) return void 0;
@@ -4505,7 +4505,7 @@ var Ur = async (r, e, t, n, o) => {
4505
4505
  const s = await S(
4506
4506
  r,
4507
4507
  "Time to get token balances inside router",
4508
- kr(
4508
+ Pr(
4509
4509
  r,
4510
4510
  a,
4511
4511
  e,
@@ -4679,22 +4679,22 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
4679
4679
  c,
4680
4680
  d
4681
4681
  );
4682
- const E = await S(
4682
+ const g = await S(
4683
4683
  r,
4684
4684
  "Time to calculate token allowances",
4685
4685
  Promise.all([l, u, m])
4686
4686
  );
4687
- const g = cr(
4688
- E[0],
4689
- E[1],
4690
- E[2]
4687
+ const E = cr(
4688
+ g[0],
4689
+ g[1],
4690
+ g[2]
4691
4691
  );
4692
4692
  let f = null;
4693
4693
  if (n) {
4694
4694
  f = await S(
4695
4695
  r,
4696
4696
  "Time to run gas calculator",
4697
- yr(e, g, n)
4697
+ yr(e, E, n)
4698
4698
  );
4699
4699
  if (f !== null) {
4700
4700
  d.push(f);
@@ -4711,7 +4711,7 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
4711
4711
  const y = await S(
4712
4712
  r,
4713
4713
  "Time to fetch available routing options",
4714
- Pr(r, e)
4714
+ kr(r, e)
4715
4715
  );
4716
4716
  if (_optionalChain([o, 'optionalAccess', _149 => _149.onRamp]) === false) y.onRamp = false;
4717
4717
  if (_optionalChain([o, 'optionalAccess', _150 => _150.swap]) === false) y.swap = false;
@@ -4739,7 +4739,7 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
4739
4739
  transactionRequirements: C
4740
4740
  };
4741
4741
  }
4742
- const P = await Gr(
4742
+ const k = await Gr(
4743
4743
  r,
4744
4744
  c,
4745
4745
  I,
@@ -4755,7 +4755,7 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
4755
4755
  transactionRequirements: C,
4756
4756
  router: {
4757
4757
  availableRoutingOptions: y,
4758
- routingOutcome: P
4758
+ routingOutcome: k
4759
4759
  }
4760
4760
  };
4761
4761
  };
@@ -4771,15 +4771,15 @@ var _metrics = require('@imtbl/metrics');
4771
4771
  function wt(r) {
4772
4772
  return _optionalChain([r, 'optionalAccess', _152 => _152.ethereumProvider, 'optionalAccess', _153 => _153.isPassport]) === true;
4773
4773
  }
4774
- function Ea(r) {
4774
+ function ga(r) {
4775
4775
  return wt(r);
4776
4776
  }
4777
- var ga = async (r, e) => {
4777
+ var Ea = async (r, e) => {
4778
4778
  const t = e;
4779
4779
  const { chainId: n } = await r.getNetwork();
4780
4780
  if (!Kt(Number(n))) return t;
4781
4781
  if (typeof t.gasPrice !== "undefined") return t;
4782
- if (Ea(r)) {
4782
+ if (ga(r)) {
4783
4783
  t.gasPrice = BigInt(0);
4784
4784
  } else {
4785
4785
  t.maxFeePerGas = ot.maxFeePerGas;
@@ -4808,10 +4808,10 @@ var St = (r) => {
4808
4808
  { error: r }
4809
4809
  );
4810
4810
  };
4811
- var F = async (r, e) => {
4811
+ var W = async (r, e) => {
4812
4812
  try {
4813
4813
  const t = await r.getSigner();
4814
- const n = await ga(r, e);
4814
+ const n = await Ea(r, e);
4815
4815
  const o = await t.sendTransaction(n);
4816
4816
  return {
4817
4817
  transactionResponse: o
@@ -4826,7 +4826,7 @@ var Ke = async (r, e) => {
4826
4826
  let t = [];
4827
4827
  try {
4828
4828
  const n = await Promise.all(
4829
- e.map((o) => F(r, o))
4829
+ e.map((o) => W(r, o))
4830
4830
  );
4831
4831
  t = await Promise.all(n.map((o) => o.transactionResponse.wait()));
4832
4832
  } catch (n) {
@@ -4853,7 +4853,7 @@ var Qe = async (r, e) => {
4853
4853
  let t = [];
4854
4854
  try {
4855
4855
  const n = await Promise.all(e.map(
4856
- (o) => F(r, o)
4856
+ (o) => W(r, o)
4857
4857
  ));
4858
4858
  t = await Promise.all(n.map((o) => o.transactionResponse.wait()));
4859
4859
  } catch (n) {
@@ -4936,7 +4936,7 @@ var Vr = async (r) => {
4936
4936
  e = await Promise.all(t);
4937
4937
  return e;
4938
4938
  };
4939
- var kt = async (r) => {
4939
+ var Pt = async (r) => {
4940
4940
  let e = [];
4941
4941
  const t = [];
4942
4942
  for (const n of r) {
@@ -5038,7 +5038,7 @@ var Sa = (r, e, t, n, o = false) => {
5038
5038
  };
5039
5039
  }
5040
5040
  };
5041
- var Pa = (r, e) => {
5041
+ var ka = (r, e) => {
5042
5042
  if (e.length > 0) {
5043
5043
  return {
5044
5044
  type: "TRANSACTION",
@@ -5074,26 +5074,26 @@ var Kr = async (r, e, t, n = {
5074
5074
  "Time to get the address from the provider",
5075
5075
  (await e.getSigner()).getAddress()
5076
5076
  );
5077
- Et();
5077
+ gt();
5078
5078
  q(r, e, l, v(r));
5079
5079
  q(r, e, l, A(r));
5080
- const { id: u, takerFees: m, fillAmount: E } = t[0];
5081
- let g;
5080
+ const { id: u, takerFees: m, fillAmount: g } = t[0];
5081
+ let E;
5082
5082
  try {
5083
5083
  o = await S(
5084
5084
  r,
5085
5085
  "Time to fetch the listing from the orderbook",
5086
5086
  c.getListing(u)
5087
5087
  );
5088
- const { seaportContractAddress: k, chainName: X } = c.config();
5089
- g = X;
5090
- a = k;
5091
- } catch (k) {
5088
+ const { seaportContractAddress: P, chainName: X } = c.config();
5089
+ E = X;
5090
+ a = P;
5091
+ } catch (P) {
5092
5092
  throw new p(
5093
5093
  "An error occurred while getting the order listing",
5094
5094
  "GET_ORDER_LISTING_ERROR",
5095
5095
  {
5096
- error: k,
5096
+ error: P,
5097
5097
  orderId: u
5098
5098
  }
5099
5099
  );
@@ -5110,47 +5110,47 @@ var Kr = async (r, e, t, n = {
5110
5110
  }
5111
5111
  const f = o.result.buy[0];
5112
5112
  if (f.type === "ERC20") {
5113
- const k = await S(
5113
+ const P = await S(
5114
5114
  r,
5115
5115
  "Time to get decimals of token contract for the buy token",
5116
- d.getToken({ contractAddress: f.contractAddress, chainName: g })
5116
+ d.getToken({ contractAddress: f.contractAddress, chainName: E })
5117
5117
  );
5118
- if (k.result.decimals) s = k.result.decimals;
5118
+ if (P.result.decimals) s = P.result.decimals;
5119
5119
  }
5120
5120
  let R = [];
5121
5121
  if (m && m.length > 0) {
5122
- const k = o.result.sell[0].type === "ERC721" ? BigInt(1) : BigInt(o.result.sell[0].amount);
5123
- R = $e(m, f.amount, s, k);
5122
+ const P = o.result.sell[0].type === "ERC721" ? BigInt(1) : BigInt(o.result.sell[0].amount);
5123
+ R = $e(m, f.amount, s, P);
5124
5124
  }
5125
5125
  let I = [];
5126
5126
  let C = [];
5127
5127
  let y = [];
5128
- const P = performance.now();
5128
+ const k = performance.now();
5129
5129
  try {
5130
- const { actions: k } = await S(
5130
+ const { actions: P } = await S(
5131
5131
  r,
5132
5132
  "Time to call fulfillOrder from the orderbook",
5133
- c.fulfillOrder(u, l, R, E)
5133
+ c.fulfillOrder(u, l, R, g)
5134
5134
  );
5135
- y = k;
5135
+ y = P;
5136
5136
  I = await S(
5137
5137
  r,
5138
5138
  "Time to construct the unsigned approval transactions",
5139
- Vr(k)
5139
+ Vr(P)
5140
5140
  );
5141
- } catch (k) {
5142
- const X = (performance.now() - P) / 1e3;
5141
+ } catch (P) {
5142
+ const X = (performance.now() - k) / 1e3;
5143
5143
  dt(r, "Time to call fulfillOrder from the orderbook", X);
5144
- if (k.message.includes(_orderbook.OrderStatusName.EXPIRED)) {
5144
+ if (P.message.includes(_orderbook.OrderStatusName.EXPIRED)) {
5145
5145
  throw new p("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: u });
5146
5146
  }
5147
- if (!k.message.includes("The fulfiller does not have the balances needed to fulfill")) {
5147
+ if (!P.message.includes("The fulfiller does not have the balances needed to fulfill")) {
5148
5148
  throw new p(
5149
5149
  "Error occurred while trying to fulfill the order",
5150
5150
  "FULFILL_ORDER_LISTING_ERROR",
5151
5151
  {
5152
5152
  orderId: u,
5153
- error: k
5153
+ error: P
5154
5154
  }
5155
5155
  );
5156
5156
  }
@@ -5159,7 +5159,7 @@ var Kr = async (r, e, t, n = {
5159
5159
  C = await S(
5160
5160
  r,
5161
5161
  "Time to construct the unsigned fulfillment transactions",
5162
- kt(y)
5162
+ Pt(y)
5163
5163
  );
5164
5164
  } catch (e6) {
5165
5165
  }
@@ -5186,17 +5186,17 @@ var Kr = async (r, e, t, n = {
5186
5186
  );
5187
5187
  }
5188
5188
  }
5189
- $.forEach((k) => {
5190
- if (k.type !== "ERC721") {
5191
- N += BigInt(k.amount);
5189
+ $.forEach((P) => {
5190
+ if (P.type !== "ERC721") {
5191
+ N += BigInt(P.amount);
5192
5192
  }
5193
5193
  });
5194
- const W = o.result.fees;
5195
- W.forEach((k) => {
5196
- N += BigInt(k.amount);
5194
+ const U = o.result.fees;
5195
+ U.forEach((P) => {
5196
+ N += BigInt(P.amount);
5197
5197
  });
5198
- if (o.result.sell[0].type === "ERC1155" && E) {
5199
- N = N * BigInt(E) / BigInt(o.result.sell[0].amount);
5198
+ if (o.result.sell[0].type === "ERC1155" && g) {
5199
+ N = N * BigInt(g) / BigInt(o.result.sell[0].amount);
5200
5200
  }
5201
5201
  const et = [
5202
5202
  Sa(z, de, N, a)
@@ -5208,25 +5208,25 @@ var Kr = async (r, e, t, n = {
5208
5208
  r,
5209
5209
  e,
5210
5210
  et,
5211
- Pa(
5211
+ ka(
5212
5212
  i,
5213
5213
  C
5214
5214
  )
5215
5215
  )
5216
5216
  );
5217
5217
  if (j.sufficient) {
5218
- const k = await Ke(e, I);
5219
- if (k.type === "FAILED") {
5218
+ const P = await Ke(e, I);
5219
+ if (P.type === "FAILED") {
5220
5220
  return {
5221
5221
  status: "FAILED",
5222
- transactionHash: k.transactionHash,
5223
- reason: k.reason,
5222
+ transactionHash: P.transactionHash,
5223
+ reason: P.reason,
5224
5224
  smartCheckoutResult: j
5225
5225
  };
5226
5226
  }
5227
5227
  try {
5228
5228
  if (C.length === 0) {
5229
- C = await kt(y);
5229
+ C = await Pt(y);
5230
5230
  }
5231
5231
  } catch (V) {
5232
5232
  throw new p(
@@ -5253,7 +5253,7 @@ var Kr = async (r, e, t, n = {
5253
5253
  let X;
5254
5254
  try {
5255
5255
  const V = await Promise.all(C.map(
5256
- (tt) => F(e, tt)
5256
+ (tt) => W(e, tt)
5257
5257
  ));
5258
5258
  X = V.map((tt) => tt.transactionResponse);
5259
5259
  } catch (V) {
@@ -5328,7 +5328,7 @@ var va = async (r, e, t, n, o) => {
5328
5328
  let i;
5329
5329
  try {
5330
5330
  const c = await Promise.all([a].map(
5331
- (d) => F(t, d)
5331
+ (d) => W(t, d)
5332
5332
  ));
5333
5333
  i = c.map((d) => d.transactionResponse);
5334
5334
  } catch (c) {
@@ -5415,7 +5415,7 @@ async function Yr(r, e) {
5415
5415
  e.forEach((a) => {
5416
5416
  if (a.type === "ERC20") {
5417
5417
  const { tokenAddress: s } = a;
5418
- t.push(nr(s, L, r).decimals());
5418
+ t.push(nr(s, D, r).decimals());
5419
5419
  }
5420
5420
  });
5421
5421
  const n = await Promise.all(t);
@@ -5491,7 +5491,7 @@ var Jr = async (r, e, t) => {
5491
5491
  if (s.type === "ERC20") {
5492
5492
  const f = new (0, _ethers.Contract)(
5493
5493
  s.tokenAddress,
5494
- JSON.stringify(L),
5494
+ JSON.stringify(D),
5495
5495
  e
5496
5496
  );
5497
5497
  l = await S(
@@ -5542,7 +5542,7 @@ var Jr = async (r, e, t) => {
5542
5542
  }
5543
5543
  );
5544
5544
  }
5545
- const E = [];
5545
+ const g = [];
5546
5546
  if (m && i.type === "ERC1155") {
5547
5547
  const f = La(
5548
5548
  i.id,
@@ -5550,20 +5550,20 @@ var Jr = async (r, e, t) => {
5550
5550
  a,
5551
5551
  i.amount
5552
5552
  );
5553
- E.push(f);
5553
+ g.push(f);
5554
5554
  } else {
5555
5555
  const f = ba(i.id, i.collectionAddress, a);
5556
- E.push(f);
5556
+ g.push(f);
5557
5557
  }
5558
- let g;
5558
+ let E;
5559
5559
  if (!ht(e)) {
5560
- g = await S(
5560
+ E = await S(
5561
5561
  r,
5562
5562
  "Total time running smart checkout",
5563
5563
  ce(
5564
5564
  r,
5565
5565
  e,
5566
- E,
5566
+ g,
5567
5567
  {
5568
5568
  type: "GAS",
5569
5569
  gasToken: {
@@ -5574,9 +5574,9 @@ var Jr = async (r, e, t) => {
5574
5574
  )
5575
5575
  );
5576
5576
  } else {
5577
- g = { sufficient: true, transactionRequirements: [] };
5577
+ E = { sufficient: true, transactionRequirements: [] };
5578
5578
  }
5579
- if (g.sufficient) {
5579
+ if (E.sufficient) {
5580
5580
  const f = await jr(o.actions);
5581
5581
  const R = await Ke(e, f.approvalTransactions);
5582
5582
  if (R.type === "FAILED") {
@@ -5584,7 +5584,7 @@ var Jr = async (r, e, t) => {
5584
5584
  status: "FAILED",
5585
5585
  transactionHash: R.transactionHash,
5586
5586
  reason: R.reason,
5587
- smartCheckoutResult: g
5587
+ smartCheckoutResult: E
5588
5588
  };
5589
5589
  }
5590
5590
  const I = Hr(
@@ -5607,7 +5607,7 @@ var Jr = async (r, e, t) => {
5607
5607
  I
5608
5608
  );
5609
5609
  let y = "";
5610
- const P = {
5610
+ const k = {
5611
5611
  orderComponents: C.orderComponents,
5612
5612
  orderHash: C.orderHash,
5613
5613
  orderSignature: C.signedMessage,
@@ -5623,10 +5623,10 @@ var Jr = async (r, e, t) => {
5623
5623
  "CREATE_ORDER_LISTING_ERROR"
5624
5624
  );
5625
5625
  }
5626
- P.makerFees = z;
5626
+ k.makerFees = z;
5627
5627
  }
5628
5628
  try {
5629
- const N = await n.createListing(P);
5629
+ const N = await n.createListing(k);
5630
5630
  y = N.result.id;
5631
5631
  } catch (N) {
5632
5632
  throw new p(
@@ -5642,12 +5642,12 @@ var Jr = async (r, e, t) => {
5642
5642
  return {
5643
5643
  status: "SUCCESS",
5644
5644
  orderIds: [y],
5645
- smartCheckoutResult: g
5645
+ smartCheckoutResult: E
5646
5646
  };
5647
5647
  }
5648
5648
  return {
5649
5649
  status: "INSUFFICIENT_FUNDS",
5650
- smartCheckoutResult: g
5650
+ smartCheckoutResult: E
5651
5651
  };
5652
5652
  };
5653
5653
 
@@ -5715,16 +5715,16 @@ var Xr = async (r, e, t, n, o, a, s, i, c) => {
5715
5715
  c
5716
5716
  );
5717
5717
  if (d.approval) {
5718
- const m = await F(e, d.approval.transaction);
5719
- const E = await m.transactionResponse.wait();
5720
- if (_optionalChain([E, 'optionalAccess', _156 => _156.status]) === 0) {
5718
+ const m = await W(e, d.approval.transaction);
5719
+ const g = await m.transactionResponse.wait();
5720
+ if (_optionalChain([g, 'optionalAccess', _156 => _156.status]) === 0) {
5721
5721
  throw new p(
5722
5722
  "Approval transaction failed and was reverted",
5723
5723
  "APPROVAL_TRANSACTION_FAILED"
5724
5724
  );
5725
5725
  }
5726
5726
  }
5727
- const l = await F(e, d.swap.transaction);
5727
+ const l = await W(e, d.swap.transaction);
5728
5728
  const u = await l.transactionResponse.wait();
5729
5729
  if (_optionalChain([u, 'optionalAccess', _157 => _157.status]) === 0) {
5730
5730
  throw new p(
@@ -5770,7 +5770,7 @@ var Nt = async (r, e) => {
5770
5770
  try {
5771
5771
  const o = _nullishCoalesce(_optionalChain([n, 'optionalAccess', _162 => _162.levels, 'access', _163 => _163.map, 'call', _164 => _164((s) => s.toLowerCase())]), () => ( []));
5772
5772
  const a = await _axios2.default.post(
5773
- `${U[e.environment]}/v1/sanctions/check`,
5773
+ `${L[e.environment]}/v1/sanctions/check`,
5774
5774
  {
5775
5775
  addresses: r
5776
5776
  }
@@ -5786,15 +5786,52 @@ var Nt = async (r, e) => {
5786
5786
  return t;
5787
5787
  }
5788
5788
  };
5789
+
5790
+ // src/riskAssessment/riskAssessmentV2.ts
5791
+
5792
+ var ja = async (r, e) => {
5793
+ const t = Object.fromEntries(
5794
+ r.map((o) => [o.address.toLowerCase(), { sanctioned: false }])
5795
+ );
5796
+ const n = await e.remote.getConfig("riskAssessment");
5797
+ if (!_optionalChain([n, 'optionalAccess', _165 => _165.enabled])) {
5798
+ return t;
5799
+ }
5800
+ try {
5801
+ const o = _nullishCoalesce(_optionalChain([n, 'optionalAccess', _166 => _166.levels, 'access', _167 => _167.map, 'call', _168 => _168((i) => i.toLowerCase())]), () => ( []));
5802
+ const a = r.map((i) => ({
5803
+ address: i.address,
5804
+ token_addr: i.tokenAddr,
5805
+ amount: i.amount.toString()
5806
+ }));
5807
+ const s = await _axios2.default.post(
5808
+ `${L[e.environment]}/v2/sanctions/check`,
5809
+ a
5810
+ );
5811
+ for (const i of s.data) {
5812
+ t[i.address.toLowerCase()].sanctioned = o.includes(
5813
+ i.risk.toLowerCase()
5814
+ );
5815
+ }
5816
+ return t;
5817
+ } catch (o) {
5818
+ console.error("Error fetching risk assessment", o);
5819
+ return t;
5820
+ }
5821
+ };
5822
+
5823
+ // src/riskAssessment/common.ts
5789
5824
  var _t = (r, e) => {
5790
5825
  if (e) {
5791
5826
  return r[e.toLowerCase()].sanctioned;
5792
5827
  }
5793
5828
  return Object.values(r).some((t) => t.sanctioned);
5794
5829
  };
5830
+ var Va = (r, e) => r[e.toLowerCase()].sanctioned;
5831
+ var Ha = (r) => Object.values(r).some((e) => e.sanctioned);
5795
5832
 
5796
5833
  // src/sdk.ts
5797
- var ja = {
5834
+ var Ka = {
5798
5835
  baseConfig: {
5799
5836
  environment: _config.Environment.SANDBOX
5800
5837
  },
@@ -5811,17 +5848,17 @@ var Ot = class {
5811
5848
  * Constructs a new instance of the CheckoutModule class.
5812
5849
  * @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
5813
5850
  */
5814
- constructor(e = ja) {
5851
+ constructor(e = Ka) {
5815
5852
  this.httpClient = new le(e);
5816
5853
  this.config = new Ie(e, this.httpClient);
5817
5854
  this.fiatRampService = new Be(this.config);
5818
5855
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5819
- this.availability = ke(
5856
+ this.availability = Pe(
5820
5857
  this.config.isDevelopment,
5821
5858
  this.config.isProduction
5822
5859
  );
5823
5860
  this.passport = e.passport;
5824
- D.getInstance().initialise();
5861
+ F.getInstance().initialise();
5825
5862
  }
5826
5863
  /**
5827
5864
  * Loads the widgets bundle and initiates the widgets factory.
@@ -5867,7 +5904,7 @@ var Ot = class {
5867
5904
  * @returns {readonly EIP6963ProviderDetail[]} A readonly array of injected providers and their metadata.
5868
5905
  */
5869
5906
  getInjectedProviders() {
5870
- return D.getInstance().getProviders();
5907
+ return F.getInstance().getProviders();
5871
5908
  }
5872
5909
  /**
5873
5910
  * Finds an injected provider by its RDNS.
@@ -5875,7 +5912,7 @@ var Ot = class {
5875
5912
  * @returns {EIP6963ProviderDetail | undefined} - The found provider and metadata or undefined.
5876
5913
  */
5877
5914
  findInjectedProvider(e) {
5878
- return D.getInstance().findProvider(e);
5915
+ return F.getInstance().findProvider(e);
5879
5916
  }
5880
5917
  /**
5881
5918
  * Subscribes to changes in the injected providers.
@@ -5883,14 +5920,14 @@ var Ot = class {
5883
5920
  * @returns {() => void} - A function to unsubscribe the listener.
5884
5921
  */
5885
5922
  onInjectedProvidersChange(e) {
5886
- return D.getInstance().subscribe(e);
5923
+ return F.getInstance().subscribe(e);
5887
5924
  }
5888
5925
  /**
5889
5926
  * Clears all registered injected providers and their subscriptions.
5890
5927
  * @returns {void} This method doesn't return a value
5891
5928
  */
5892
5929
  clearInjectedProviders() {
5893
- return D.getInstance().clear();
5930
+ return F.getInstance().clear();
5894
5931
  }
5895
5932
  /**
5896
5933
  * Checks if a wallet is connected to the specified provider.
@@ -6074,7 +6111,7 @@ var Ot = class {
6074
6111
  allowMistmatchedChainId: true
6075
6112
  }
6076
6113
  );
6077
- return await F(t, e.transaction);
6114
+ return await W(t, e.transaction);
6078
6115
  }
6079
6116
  /**
6080
6117
  * Wraps a WrappedBrowserProvider call to validate the provider and handle errors.
@@ -6255,20 +6292,20 @@ var Ot = class {
6255
6292
  let o;
6256
6293
  const a = "request" in e.browserProvider ? new b(e.browserProvider) : e.browserProvider;
6257
6294
  const s = await (await a.getSigner()).getAddress();
6258
- const i = _optionalChain([a, 'access', _165 => _165.ethereumProvider, 'optionalAccess', _166 => _166.isPassport]) || false;
6295
+ const i = _optionalChain([a, 'access', _169 => _169.ethereumProvider, 'optionalAccess', _170 => _170.isPassport]) || false;
6259
6296
  if (i && e.passport) {
6260
6297
  const u = await e.passport.getUserInfo();
6261
- o = _optionalChain([u, 'optionalAccess', _167 => _167.email]);
6298
+ o = _optionalChain([u, 'optionalAccess', _171 => _171.email]);
6262
6299
  }
6263
6300
  const c = await H(this.config, {
6264
6301
  type: "onramp"
6265
6302
  });
6266
- const d = _optionalChain([c, 'access', _168 => _168.tokens, 'optionalAccess', _169 => _169.find, 'call', _170 => _170((u) => T(u.address, e.tokenAddress))]);
6303
+ const d = _optionalChain([c, 'access', _172 => _172.tokens, 'optionalAccess', _173 => _173.find, 'call', _174 => _174((u) => T(u.address, e.tokenAddress))]);
6267
6304
  if (d) {
6268
6305
  t = e.tokenAmount;
6269
6306
  n = d.symbol;
6270
6307
  }
6271
- const l = _optionalChain([c, 'optionalAccess', _171 => _171.tokens, 'optionalAccess', _172 => _172.filter, 'call', _173 => _173((u) => u.symbol), 'access', _174 => _174.map, 'call', _175 => _175((u) => u.symbol)]);
6308
+ const l = _optionalChain([c, 'optionalAccess', _175 => _175.tokens, 'optionalAccess', _176 => _176.filter, 'call', _177 => _177((u) => u.symbol), 'access', _178 => _178.map, 'call', _179 => _179((u) => u.symbol)]);
6272
6309
  return await this.fiatRampService.createWidgetUrl({
6273
6310
  exchangeType: e.exchangeType,
6274
6311
  isPassport: i,
@@ -6348,7 +6385,7 @@ var Xe = class {
6348
6385
  * @returns {string | undefined} The URL to view the transaction on Blockscout, or undefined if the chain ID or hash is invalid
6349
6386
  */
6350
6387
  static getTransactionLink(e, t) {
6351
- const n = _optionalChain([te, 'optionalAccess', _176 => _176[e], 'optionalAccess', _177 => _177.url]);
6388
+ const n = _optionalChain([te, 'optionalAccess', _180 => _180[e], 'optionalAccess', _181 => _181.url]);
6352
6389
  if (!n || !t) return void 0;
6353
6390
  return `${n}/tx/${t}`;
6354
6391
  }
@@ -6409,4 +6446,7 @@ var Xe = class {
6409
6446
 
6410
6447
 
6411
6448
 
6412
- exports.AddTokensEventType = gn; exports.BlockExplorerService = Xe; exports.BridgeEventType = dn; exports.ChainId = Q; exports.ChainName = rt; exports.ChainSlug = Ae; exports.Checkout = Ot; exports.CheckoutConfiguration = Ie; exports.CheckoutError = p; exports.CheckoutErrorType = w; exports.CheckoutStatus = fe; exports.CommerceEventType = un; exports.CommerceFailureEventType = fn; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = mn; exports.CommerceUserActionEventType = En; exports.ConnectEventType = nn; exports.ConnectTargetLayer = In; exports.ExchangeType = qt; exports.FeeType = ve; exports.FundingStepType = Re; exports.GasEstimateType = at; exports.GasTokenType = ge; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = tn; exports.ItemType = B; exports.NetworkFilterTypes = ue; exports.OnRampEventType = pn; exports.OrchestrationEventType = ln; exports.ProviderEventType = rn; exports.PurchaseEventType = Rn; exports.RoutingOutcomeType = st; exports.SaleEventType = sn; exports.SalePaymentTypes = cn; exports.SwapDirection = hn; exports.SwapEventType = an; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = Ee; exports.TransferEventType = Cn; exports.WalletEventType = on; exports.WalletFilterTypes = Wt; exports.WalletProviderName = me; exports.WalletProviderRdns = Ut; exports.WidgetTheme = yn; exports.WidgetType = Tn; exports.WrappedBrowserProvider = b; exports.fetchRiskAssessment = Nt; exports.getGasPriceInWei = gt; exports.getMetaMaskProviderDetail = mo; exports.getPassportProviderDetail = uo; exports.getUnderlyingChainId = Ce; exports.isAddressSanctioned = _t; exports.metaMaskProviderInfo = be; exports.passportProviderInfo = Le; exports.validateProvider = M;
6449
+
6450
+
6451
+
6452
+ exports.AddTokensEventType = En; exports.BlockExplorerService = Xe; exports.BridgeEventType = dn; exports.ChainId = Q; exports.ChainName = rt; exports.ChainSlug = Ae; exports.Checkout = Ot; exports.CheckoutConfiguration = Ie; exports.CheckoutError = p; exports.CheckoutErrorType = w; exports.CheckoutStatus = fe; exports.CommerceEventType = un; exports.CommerceFailureEventType = fn; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = mn; exports.CommerceUserActionEventType = gn; exports.ConnectEventType = nn; exports.ConnectTargetLayer = In; exports.ExchangeType = qt; exports.FeeType = ve; exports.FundingStepType = Re; exports.GasEstimateType = at; exports.GasTokenType = Ee; exports.IMMUTABLE_API_BASE_URL = L; exports.IMTBLWidgetEvents = tn; exports.ItemType = B; exports.NetworkFilterTypes = ue; exports.OnRampEventType = pn; exports.OrchestrationEventType = ln; exports.ProviderEventType = rn; exports.PurchaseEventType = Rn; exports.RoutingOutcomeType = st; exports.SaleEventType = sn; exports.SalePaymentTypes = cn; exports.SwapDirection = hn; exports.SwapEventType = an; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = ge; exports.TransferEventType = Cn; exports.WalletEventType = on; exports.WalletFilterTypes = Wt; exports.WalletProviderName = me; exports.WalletProviderRdns = Ut; exports.WidgetTheme = yn; exports.WidgetType = Tn; exports.WrappedBrowserProvider = b; exports.fetchRiskAssessment = Nt; exports.fetchRiskAssessmentV2 = ja; exports.getGasPriceInWei = Et; exports.getMetaMaskProviderDetail = mo; exports.getPassportProviderDetail = uo; exports.getUnderlyingChainId = Ce; exports.isAddressSanctioned = _t; exports.isSingleAddressSanctioned = Va; exports.metaMaskProviderInfo = be; exports.passportProviderInfo = Le; exports.resultHasSanctionedWallets = Ha; exports.validateProvider = M;