@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.
@@ -189,18 +189,18 @@ var ho = /* @__PURE__ */ ((u) => {
189
189
  })(ho || {});
190
190
 
191
191
  // src/widgets/definitions/parameters/connect.ts
192
- var yo = /* @__PURE__ */ ((t) => {
192
+ var Ao = /* @__PURE__ */ ((t) => {
193
193
  t["LAYER1"] = "LAYER1";
194
194
  t["LAYER2"] = "LAYER2";
195
195
  return t;
196
- })(yo || {});
196
+ })(Ao || {});
197
197
 
198
198
  // src/widgets/definitions/parameters/swap.ts
199
- var Ao = /* @__PURE__ */ ((t) => {
199
+ var yo = /* @__PURE__ */ ((t) => {
200
200
  t["FROM"] = "FROM";
201
201
  t["TO"] = "TO";
202
202
  return t;
203
- })(Ao || {});
203
+ })(yo || {});
204
204
 
205
205
  // src/widgets/definitions/parameters/commerce.ts
206
206
  var wo = /* @__PURE__ */ ((p) => {
@@ -224,7 +224,7 @@ var Po = /* @__PURE__ */ ((t) => {
224
224
  })(Po || {});
225
225
 
226
226
  // src/sdk.ts
227
- import { Environment as Va } from "@imtbl/config";
227
+ import { Environment as Qa } from "@imtbl/config";
228
228
 
229
229
  // src/api/http/httpClient.ts
230
230
  import So from "axios";
@@ -304,49 +304,49 @@ import { Environment as Ut } from "@imtbl/config";
304
304
  import xo from "axios";
305
305
 
306
306
  // src/errors/checkoutError.ts
307
- var S = /* @__PURE__ */ ((A) => {
308
- A["MISSING_PARAMS"] = "MISSING_PARAMS";
309
- A["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
310
- A["PROVIDER_ERROR"] = "PROVIDER_ERROR";
311
- A["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
312
- A["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
313
- A["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
314
- A["GET_INDEXER_BALANCE_ERROR"] = "GET_INDEXER_BALANCE_ERROR";
315
- A["GET_ERC20_INFO_ERROR"] = "GET_ERC20_INFO_ERROR";
316
- A["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
317
- A["GET_ERC721_BALANCE_ERROR"] = "GET_ERC721_BALANCE_ERROR";
318
- A["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
319
- A["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
320
- A["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
321
- A["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
322
- A["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
323
- A["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
324
- A["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
325
- A["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
326
- A["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
327
- A["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
328
- A["UNSUPPORTED_TOKEN_TYPE_ERROR"] = "UNSUPPORTED_TOKEN_TYPE_ERROR";
329
- A["UNSUPPORTED_BALANCE_REQUIREMENT_ERROR"] = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR";
330
- A["GET_ORDER_LISTING_ERROR"] = "GET_ORDER_LISTING_ERROR";
331
- A["CANCEL_ORDER_LISTING_ERROR"] = "CANCEL_ORDER_LISTING_ERROR";
332
- A["PREPARE_ORDER_LISTING_ERROR"] = "PREPARE_ORDER_LISTING_ERROR";
333
- A["CREATE_ORDER_LISTING_ERROR"] = "CREATE_ORDER_LISTING_ERROR";
334
- A["FULFILL_ORDER_LISTING_ERROR"] = "FULFILL_ORDER_LISTING_ERROR";
335
- A["SWITCH_NETWORK_UNSUPPORTED"] = "SWITCH_NETWORK_UNSUPPORTED";
336
- A["GET_ERC20_ALLOWANCE_ERROR"] = "GET_ERC20_ALLOWANCE_ERROR";
337
- A["GET_ERC721_ALLOWANCE_ERROR"] = "GET_ERC721_ALLOWANCE_ERROR";
338
- A["GET_ERC1155_ALLOWANCE_ERROR"] = "GET_ERC1155_ALLOWANCE_ERROR";
339
- A["EXECUTE_APPROVAL_TRANSACTION_ERROR"] = "EXECUTE_APPROVAL_TRANSACTION_ERROR";
340
- A["EXECUTE_FULFILLMENT_TRANSACTION_ERROR"] = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR";
341
- A["SIGN_MESSAGE_ERROR"] = "SIGN_MESSAGE_ERROR";
342
- A["BRIDGE_GAS_ESTIMATE_ERROR"] = "BRIDGE_GAS_ESTIMATE_ERROR";
343
- A["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
344
- A["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
345
- A["API_ERROR"] = "API_ERROR";
346
- A["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
347
- A["WIDGETS_SCRIPT_LOAD_ERROR"] = "WIDGETS_SCRIPT_LOAD_ERROR";
348
- A["APPROVAL_TRANSACTION_FAILED"] = "APPROVAL_TRANSACTION_FAILED";
349
- return A;
307
+ var S = /* @__PURE__ */ ((y) => {
308
+ y["MISSING_PARAMS"] = "MISSING_PARAMS";
309
+ y["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
310
+ y["PROVIDER_ERROR"] = "PROVIDER_ERROR";
311
+ y["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
312
+ y["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
313
+ y["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
314
+ y["GET_INDEXER_BALANCE_ERROR"] = "GET_INDEXER_BALANCE_ERROR";
315
+ y["GET_ERC20_INFO_ERROR"] = "GET_ERC20_INFO_ERROR";
316
+ y["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
317
+ y["GET_ERC721_BALANCE_ERROR"] = "GET_ERC721_BALANCE_ERROR";
318
+ y["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
319
+ y["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
320
+ y["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
321
+ y["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
322
+ y["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
323
+ y["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
324
+ y["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
325
+ y["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
326
+ y["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
327
+ y["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
328
+ y["UNSUPPORTED_TOKEN_TYPE_ERROR"] = "UNSUPPORTED_TOKEN_TYPE_ERROR";
329
+ y["UNSUPPORTED_BALANCE_REQUIREMENT_ERROR"] = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR";
330
+ y["GET_ORDER_LISTING_ERROR"] = "GET_ORDER_LISTING_ERROR";
331
+ y["CANCEL_ORDER_LISTING_ERROR"] = "CANCEL_ORDER_LISTING_ERROR";
332
+ y["PREPARE_ORDER_LISTING_ERROR"] = "PREPARE_ORDER_LISTING_ERROR";
333
+ y["CREATE_ORDER_LISTING_ERROR"] = "CREATE_ORDER_LISTING_ERROR";
334
+ y["FULFILL_ORDER_LISTING_ERROR"] = "FULFILL_ORDER_LISTING_ERROR";
335
+ y["SWITCH_NETWORK_UNSUPPORTED"] = "SWITCH_NETWORK_UNSUPPORTED";
336
+ y["GET_ERC20_ALLOWANCE_ERROR"] = "GET_ERC20_ALLOWANCE_ERROR";
337
+ y["GET_ERC721_ALLOWANCE_ERROR"] = "GET_ERC721_ALLOWANCE_ERROR";
338
+ y["GET_ERC1155_ALLOWANCE_ERROR"] = "GET_ERC1155_ALLOWANCE_ERROR";
339
+ y["EXECUTE_APPROVAL_TRANSACTION_ERROR"] = "EXECUTE_APPROVAL_TRANSACTION_ERROR";
340
+ y["EXECUTE_FULFILLMENT_TRANSACTION_ERROR"] = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR";
341
+ y["SIGN_MESSAGE_ERROR"] = "SIGN_MESSAGE_ERROR";
342
+ y["BRIDGE_GAS_ESTIMATE_ERROR"] = "BRIDGE_GAS_ESTIMATE_ERROR";
343
+ y["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
344
+ y["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
345
+ y["API_ERROR"] = "API_ERROR";
346
+ y["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
347
+ y["WIDGETS_SCRIPT_LOAD_ERROR"] = "WIDGETS_SCRIPT_LOAD_ERROR";
348
+ y["APPROVAL_TRANSACTION_FAILED"] = "APPROVAL_TRANSACTION_FAILED";
349
+ return y;
350
350
  })(S || {});
351
351
  var m = class extends Error {
352
352
  message;
@@ -424,7 +424,7 @@ var No = {
424
424
  decimals: j,
425
425
  address: O
426
426
  };
427
- var q = {
427
+ var W = {
428
428
  [J]: "https://api.dev.immutable.com",
429
429
  [re.SANDBOX]: "https://api.sandbox.immutable.com",
430
430
  [re.PRODUCTION]: "https://api.immutable.com"
@@ -536,7 +536,7 @@ var oe = {
536
536
  nativeToken: Pe.get(1).nativeCurrency
537
537
  }
538
538
  };
539
- var W = [
539
+ var F = [
540
540
  {
541
541
  constant: true,
542
542
  inputs: [],
@@ -803,15 +803,15 @@ var it = {
803
803
  };
804
804
 
805
805
  // src/env/env.ts
806
- var _o = "2.4.14-alpha.0";
806
+ var _o = "2.4.14-alpha.2";
807
807
  var me = () => _o;
808
808
 
809
809
  // src/availability/availability.ts
810
810
  var Ne = (r, e) => {
811
811
  const t = () => {
812
- if (r) return q[J];
813
- if (e) return q[Ut.PRODUCTION];
814
- return q[Ut.SANDBOX];
812
+ if (r) return W[J];
813
+ if (e) return W[Ut.PRODUCTION];
814
+ return W[Ut.SANDBOX];
815
815
  };
816
816
  const o = async () => {
817
817
  let n;
@@ -1305,9 +1305,9 @@ var Do = (r, e) => {
1305
1305
  return Se;
1306
1306
  };
1307
1307
  var Wo = (r, e) => {
1308
- if (e) return q[J];
1309
- if (r) return q[ie.PRODUCTION];
1310
- return q[ie.SANDBOX];
1308
+ if (e) return W[J];
1309
+ if (r) return W[ie.PRODUCTION];
1310
+ return W[ie.SANDBOX];
1311
1311
  };
1312
1312
  var Fo = (r, e) => {
1313
1313
  if (e) return "imtbl-zkevm-devnet";
@@ -1328,7 +1328,7 @@ var Uo = (r, e) => {
1328
1328
  if (r) return ve[ie.PRODUCTION];
1329
1329
  return ve[ie.SANDBOX];
1330
1330
  };
1331
- var ye = class {
1331
+ var Ae = class {
1332
1332
  // This is a hidden feature that is only available
1333
1333
  // when building the project from source code.
1334
1334
  // This will be used to get around the lack of
@@ -1436,7 +1436,7 @@ var B = (r) => !r || h(r, O);
1436
1436
  async function Be(r, e) {
1437
1437
  return await L(
1438
1438
  async () => {
1439
- const t = new jo(e, JSON.stringify(W), r);
1439
+ const t = new jo(e, JSON.stringify(F), r);
1440
1440
  const [o, n, a] = await Promise.all([
1441
1441
  t.name(),
1442
1442
  t.symbol(),
@@ -1458,7 +1458,7 @@ import Yt, {
1458
1458
  HttpStatusCode as Jt
1459
1459
  } from "axios";
1460
1460
  var Ho = 5;
1461
- var Ae = class {
1461
+ var ye = class {
1462
1462
  url;
1463
1463
  nativeToken;
1464
1464
  ttl;
@@ -1619,7 +1619,7 @@ async function Et(r, e, t) {
1619
1619
  async () => {
1620
1620
  const o = new zo(
1621
1621
  t,
1622
- JSON.stringify(W),
1622
+ JSON.stringify(F),
1623
1623
  r
1624
1624
  );
1625
1625
  return Promise.all([
@@ -1653,7 +1653,7 @@ var Qo = async (r, e, t, o) => {
1653
1653
  let i = mt.get(t);
1654
1654
  if (!i) {
1655
1655
  const f = r.remote.getHttpClient();
1656
- i = new Ae(f, t);
1656
+ i = new ye(f, t);
1657
1657
  mt.set(t, i);
1658
1658
  }
1659
1659
  const s = [];
@@ -1707,11 +1707,11 @@ var Qo = async (r, e, t, o) => {
1707
1707
  const E = BigInt(f.value);
1708
1708
  let T = parseInt(C.decimals, 10);
1709
1709
  if (Number.isNaN(T)) T = j;
1710
- const y = C.icon_url ?? R.icon;
1710
+ const A = C.icon_url ?? R.icon;
1711
1711
  const I = {
1712
1712
  ...C,
1713
1713
  decimals: T,
1714
- icon: y
1714
+ icon: A
1715
1715
  };
1716
1716
  const P = gt(f.value, I.decimals);
1717
1717
  g.push({ balance: E, formattedBalance: P, token: I });
@@ -1780,7 +1780,7 @@ var V = async (r, e, t, o, n = false) => {
1780
1780
  if (n) {
1781
1781
  Rt();
1782
1782
  }
1783
- if (Ae.isChainSupported(o)) {
1783
+ if (ye.isChainSupported(o)) {
1784
1784
  const i = t ?? await (await e?.getSigner())?.getAddress();
1785
1785
  try {
1786
1786
  return await k(
@@ -2195,7 +2195,7 @@ function It() {
2195
2195
  }
2196
2196
 
2197
2197
  // src/provider/injectedProvidersManager.ts
2198
- var F = class r {
2198
+ var U = class r {
2199
2199
  static instance;
2200
2200
  store;
2201
2201
  resetTimeout;
@@ -2286,7 +2286,7 @@ async function cr(r, e) {
2286
2286
  let o;
2287
2287
  switch (r) {
2288
2288
  case "passport": {
2289
- o = F.getInstance().findProvider({ rdns: We.rdns });
2289
+ o = U.getInstance().findProvider({ rdns: We.rdns });
2290
2290
  if (!o) {
2291
2291
  if (e) {
2292
2292
  t = new D(
@@ -2305,14 +2305,14 @@ async function cr(r, e) {
2305
2305
  break;
2306
2306
  }
2307
2307
  case "metamask": {
2308
- o = F.getInstance().findProvider({ rdns: De.rdns });
2308
+ o = U.getInstance().findProvider({ rdns: De.rdns });
2309
2309
  if (!o) {
2310
2310
  t = await Rn();
2311
2311
  }
2312
2312
  break;
2313
2313
  }
2314
2314
  default:
2315
- o = F.getInstance().findProvider({ rdns: r });
2315
+ o = U.getInstance().findProvider({ rdns: r });
2316
2316
  if (!o) {
2317
2317
  console.error(
2318
2318
  "The WalletProviderName that was provided is not supported"
@@ -2480,7 +2480,7 @@ var hn = (r) => {
2480
2480
  });
2481
2481
  return t.concat(Array.from(e.values()));
2482
2482
  };
2483
- var yn = (r) => {
2483
+ var An = (r) => {
2484
2484
  const e = /* @__PURE__ */ new Map();
2485
2485
  const t = [];
2486
2486
  r.forEach((o) => {
@@ -2496,7 +2496,7 @@ var yn = (r) => {
2496
2496
  });
2497
2497
  return t.concat(Array.from(e.values()));
2498
2498
  };
2499
- var An = (r) => {
2499
+ var yn = (r) => {
2500
2500
  const e = /* @__PURE__ */ new Map();
2501
2501
  const t = [];
2502
2502
  r.forEach((o) => {
@@ -2521,7 +2521,7 @@ var An = (r) => {
2521
2521
  });
2522
2522
  return t.concat(Array.from(e.values()));
2523
2523
  };
2524
- var ht = (r) => An(yn(hn(In(r))));
2524
+ var ht = (r) => yn(An(hn(In(r))));
2525
2525
 
2526
2526
  // src/smartCheckout/allowance/erc20.ts
2527
2527
  import { Contract as pr } from "ethers";
@@ -2529,7 +2529,7 @@ var wn = async (r, e, t, o) => {
2529
2529
  try {
2530
2530
  const n = new pr(
2531
2531
  t,
2532
- JSON.stringify(W),
2532
+ JSON.stringify(F),
2533
2533
  r
2534
2534
  );
2535
2535
  return await n.allowance(e, o);
@@ -2545,7 +2545,7 @@ var Pn = async (r, e, t, o, n) => {
2545
2545
  try {
2546
2546
  const a = new pr(
2547
2547
  t,
2548
- JSON.stringify(W),
2548
+ JSON.stringify(F),
2549
2549
  r
2550
2550
  );
2551
2551
  const i = await a.approve.populateTransaction(o, n);
@@ -2590,10 +2590,10 @@ var ur = async (r, e, t) => {
2590
2590
  }
2591
2591
  o = false;
2592
2592
  const { tokenAddress: E, spenderAddress: T } = C;
2593
- const y = `${E}${T}`;
2593
+ const A = `${E}${T}`;
2594
2594
  const I = C.amount - p[R];
2595
2595
  s.set(
2596
- y,
2596
+ A,
2597
2597
  {
2598
2598
  type: "ERC20",
2599
2599
  sufficient: false,
@@ -2603,7 +2603,7 @@ var ur = async (r, e, t) => {
2603
2603
  }
2604
2604
  );
2605
2605
  c.set(
2606
- y,
2606
+ A,
2607
2607
  Pn(
2608
2608
  r,
2609
2609
  e,
@@ -2625,10 +2625,10 @@ var ur = async (r, e, t) => {
2625
2625
  };
2626
2626
 
2627
2627
  // src/smartCheckout/allowance/erc721.ts
2628
- import { Contract as yt } from "ethers";
2628
+ import { Contract as At } from "ethers";
2629
2629
  var Sn = async (r, e, t, o) => {
2630
2630
  try {
2631
- const n = new yt(
2631
+ const n = new At(
2632
2632
  t,
2633
2633
  JSON.stringify(ne),
2634
2634
  r
@@ -2649,7 +2649,7 @@ var Sn = async (r, e, t, o) => {
2649
2649
  };
2650
2650
  var kn = async (r, e, t, o, n) => {
2651
2651
  try {
2652
- const a = new yt(
2652
+ const a = new At(
2653
2653
  t,
2654
2654
  JSON.stringify(ne),
2655
2655
  r
@@ -2673,7 +2673,7 @@ var kn = async (r, e, t, o, n) => {
2673
2673
  };
2674
2674
  var vn = async (r, e, t) => {
2675
2675
  try {
2676
- const o = new yt(
2676
+ const o = new At(
2677
2677
  e,
2678
2678
  JSON.stringify(ne),
2679
2679
  r
@@ -2746,8 +2746,8 @@ var gr = async (r, e, t) => {
2746
2746
  );
2747
2747
  for (const C of t) {
2748
2748
  if (C.type !== "ERC721") continue;
2749
- const { contractAddress: E, id: T, spenderAddress: y } = C;
2750
- const I = `${E}-${y}`;
2749
+ const { contractAddress: E, id: T, spenderAddress: A } = C;
2750
+ const I = `${E}-${A}`;
2751
2751
  const P = p.get(I);
2752
2752
  if (P) {
2753
2753
  n.push({
@@ -2777,9 +2777,9 @@ var gr = async (r, e, t) => {
2777
2777
  continue;
2778
2778
  }
2779
2779
  o = false;
2780
- const { contractAddress: T, id: y, spenderAddress: I } = E;
2781
- const P = `${T}-${y}`;
2782
- const v = mr(y, T);
2780
+ const { contractAddress: T, id: A, spenderAddress: I } = E;
2781
+ const P = `${T}-${A}`;
2782
+ const v = mr(A, T);
2783
2783
  s.set(
2784
2784
  P,
2785
2785
  {
@@ -3045,7 +3045,7 @@ var hr = async (r, e, t) => {
3045
3045
  try {
3046
3046
  const u = new bn(
3047
3047
  n.tokenAddress,
3048
- JSON.stringify(W),
3048
+ JSON.stringify(F),
3049
3049
  t
3050
3050
  );
3051
3051
  const [g, f, R] = await Promise.all([
@@ -3073,7 +3073,7 @@ var hr = async (r, e, t) => {
3073
3073
  }
3074
3074
  return o;
3075
3075
  };
3076
- var yr = (r, e, t) => {
3076
+ var Ar = (r, e, t) => {
3077
3077
  let o = Ir(r, e);
3078
3078
  const n = r.amount;
3079
3079
  const a = n < 0 || n === 0n || o && o?.balance >= n;
@@ -3200,7 +3200,7 @@ var Fn = async (r, e, t) => {
3200
3200
  }
3201
3201
  return o;
3202
3202
  };
3203
- var Ar = async (r, e, t, o, n = false) => {
3203
+ var yr = async (r, e, t, o, n = false) => {
3204
3204
  const a = Rr(o);
3205
3205
  const i = [];
3206
3206
  const s = [];
@@ -3241,9 +3241,9 @@ var Ar = async (r, e, t, o, n = false) => {
3241
3241
  const C = await hr(i, f, e);
3242
3242
  i.forEach((E) => {
3243
3243
  const T = (E.tokenAddress ?? O).toLowerCase();
3244
- const y = C[T];
3244
+ const A = C[T];
3245
3245
  const I = R.get(T);
3246
- const P = yr(E, [...R.values()], y);
3246
+ const P = Ar(E, [...R.values()], A);
3247
3247
  u.push(P);
3248
3248
  if (!I) {
3249
3249
  return;
@@ -3334,7 +3334,7 @@ var kr = async (r) => {
3334
3334
  };
3335
3335
 
3336
3336
  // src/smartCheckout/routing/routingOptions.ts
3337
- function At(r) {
3337
+ function yt(r) {
3338
3338
  return r?.ethereumProvider?.isPassport === true;
3339
3339
  }
3340
3340
  var vr = async (r, e) => {
@@ -3358,7 +3358,7 @@ var vr = async (r, e) => {
3358
3358
  t[c] = t[c] && i.status === "fulfilled" && i.value;
3359
3359
  });
3360
3360
  }
3361
- t.bridge = t.bridge && !At(e);
3361
+ t.bridge = t.bridge && !yt(e);
3362
3362
  return t;
3363
3363
  };
3364
3364
 
@@ -3700,8 +3700,8 @@ var je = async (r, e, t, o, n, a, i) => {
3700
3700
  (v) => h(v.token.address, C)
3701
3701
  );
3702
3702
  if (!T) continue;
3703
- const y = E.quote.amountWithMaxSlippage;
3704
- if (T.balance < y.value) continue;
3703
+ const A = E.quote.amountWithMaxSlippage;
3704
+ if (T.balance < A.value) continue;
3705
3705
  const I = Kn(g, E.approval);
3706
3706
  if (!I.sufficient) continue;
3707
3707
  if (!Hn(
@@ -3710,7 +3710,7 @@ var je = async (r, e, t, o, n, a, i) => {
3710
3710
  E.swap,
3711
3711
  E.quote.fees,
3712
3712
  {
3713
- amount: y.value,
3713
+ amount: A.value,
3714
3714
  address: C
3715
3715
  }
3716
3716
  )) continue;
@@ -3718,7 +3718,7 @@ var je = async (r, e, t, o, n, a, i) => {
3718
3718
  T.balance,
3719
3719
  i,
3720
3720
  C,
3721
- y.value,
3721
+ A.value,
3722
3722
  I,
3723
3723
  E.quote.fees
3724
3724
  )) continue;
@@ -3726,7 +3726,7 @@ var je = async (r, e, t, o, n, a, i) => {
3726
3726
  s.push(
3727
3727
  qn(
3728
3728
  p,
3729
- y.value,
3729
+ A.value,
3730
3730
  T,
3731
3731
  P
3732
3732
  )
@@ -3966,7 +3966,7 @@ var He = async (r, e, t, o, n) => {
3966
3966
  sourceChainGas: C,
3967
3967
  approvalGas: E,
3968
3968
  bridgeFee: T,
3969
- imtblFee: y,
3969
+ imtblFee: A,
3970
3970
  totalFees: I
3971
3971
  } = R;
3972
3972
  if (!$n(c, I)) return void 0;
@@ -3976,7 +3976,7 @@ var He = async (r, e, t, o, n) => {
3976
3976
  const x = Mr(
3977
3977
  C,
3978
3978
  T,
3979
- y,
3979
+ A,
3980
3980
  E,
3981
3981
  s
3982
3982
  );
@@ -3991,7 +3991,7 @@ var He = async (r, e, t, o, n) => {
3991
3991
  const v = Mr(
3992
3992
  C,
3993
3993
  T,
3994
- y,
3994
+ A,
3995
3995
  E,
3996
3996
  s
3997
3997
  );
@@ -4080,16 +4080,16 @@ var Dr = (r, e, t, o, n) => {
4080
4080
  n,
4081
4081
  i
4082
4082
  );
4083
- const y = ra(E, T, c);
4084
- if (y <= 0) {
4083
+ const A = ra(E, T, c);
4084
+ if (A <= 0) {
4085
4085
  continue;
4086
4086
  }
4087
- if (y >= f.balance) {
4087
+ if (A >= f.balance) {
4088
4088
  continue;
4089
4089
  }
4090
4090
  a.push({
4091
- amount: y,
4092
- formattedAmount: Z(Xn(y, f.token.decimals)),
4091
+ amount: A,
4092
+ formattedAmount: Z(Xn(A, f.token.decimals)),
4093
4093
  // L2 address is used for the bridge requirement as the bridge route uses the indexer to find L1 address
4094
4094
  l2address: g
4095
4095
  });
@@ -4273,34 +4273,34 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4273
4273
  );
4274
4274
  if (E.length === 0) return [];
4275
4275
  const T = /* @__PURE__ */ new Map();
4276
- const y = /* @__PURE__ */ new Map();
4276
+ const A = /* @__PURE__ */ new Map();
4277
4277
  const I = [];
4278
- for (const G of E) {
4279
- if (!G.l2address) continue;
4278
+ for (const q of E) {
4279
+ if (!q.l2address) continue;
4280
4280
  T.set(
4281
- G.l2address,
4281
+ q.l2address,
4282
4282
  He(
4283
4283
  r,
4284
4284
  e,
4285
4285
  t,
4286
- G,
4286
+ q,
4287
4287
  a
4288
4288
  )
4289
4289
  );
4290
- y.set(G.l2address, {
4291
- amount: G.amount,
4292
- formattedAmount: G.formattedAmount,
4293
- l2address: G.l2address
4290
+ A.set(q.l2address, {
4291
+ amount: q.amount,
4292
+ formattedAmount: q.formattedAmount,
4293
+ l2address: q.l2address
4294
4294
  });
4295
4295
  }
4296
4296
  const P = await Promise.all(T.values());
4297
4297
  const v = Array.from(T.keys());
4298
4298
  const x = [];
4299
- P.forEach((G, rt) => {
4299
+ P.forEach((q, rt) => {
4300
4300
  const K = v[rt];
4301
- if (G === void 0) return;
4301
+ if (q === void 0) return;
4302
4302
  x.push(K);
4303
- const N = y.get(K);
4303
+ const N = A.get(K);
4304
4304
  if (!N) return;
4305
4305
  I.push({
4306
4306
  amount: N.amount,
@@ -4704,9 +4704,9 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4704
4704
  const T = await k(
4705
4705
  r,
4706
4706
  "Time to run balance checks",
4707
- Ar(r, e, c, p, true)
4707
+ yr(r, e, c, p, true)
4708
4708
  );
4709
- const { sufficient: y } = T;
4709
+ const { sufficient: A } = T;
4710
4710
  const I = T.balanceRequirements;
4711
4711
  const P = await k(
4712
4712
  r,
@@ -4720,7 +4720,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4720
4720
  jr(
4721
4721
  r,
4722
4722
  c,
4723
- y,
4723
+ A,
4724
4724
  P,
4725
4725
  I,
4726
4726
  T,
@@ -4729,20 +4729,20 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4729
4729
  i
4730
4730
  );
4731
4731
  return {
4732
- sufficient: y,
4732
+ sufficient: A,
4733
4733
  transactionRequirements: I
4734
4734
  };
4735
4735
  }
4736
- if (y) {
4736
+ if (A) {
4737
4737
  return {
4738
- sufficient: y,
4738
+ sufficient: A,
4739
4739
  transactionRequirements: I
4740
4740
  };
4741
4741
  }
4742
4742
  const v = await jr(
4743
4743
  r,
4744
4744
  c,
4745
- y,
4745
+ A,
4746
4746
  P,
4747
4747
  I,
4748
4748
  T,
@@ -4751,7 +4751,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4751
4751
  i
4752
4752
  );
4753
4753
  return {
4754
- sufficient: y,
4754
+ sufficient: A,
4755
4755
  transactionRequirements: I,
4756
4756
  router: {
4757
4757
  availableRoutingOptions: P,
@@ -4808,7 +4808,7 @@ var kt = (r) => {
4808
4808
  { error: r }
4809
4809
  );
4810
4810
  };
4811
- var U = async (r, e) => {
4811
+ var G = async (r, e) => {
4812
4812
  try {
4813
4813
  const t = await r.getSigner();
4814
4814
  const o = await Ca(r, e);
@@ -4826,7 +4826,7 @@ var Ze = async (r, e) => {
4826
4826
  let t = [];
4827
4827
  try {
4828
4828
  const o = await Promise.all(
4829
- e.map((n) => U(r, n))
4829
+ e.map((n) => G(r, n))
4830
4830
  );
4831
4831
  t = await Promise.all(o.map((n) => n.transactionResponse.wait()));
4832
4832
  } catch (o) {
@@ -4853,7 +4853,7 @@ var Ye = async (r, e) => {
4853
4853
  let t = [];
4854
4854
  try {
4855
4855
  const o = await Promise.all(e.map(
4856
- (n) => U(r, n)
4856
+ (n) => G(r, n)
4857
4857
  ));
4858
4858
  t = await Promise.all(o.map((n) => n.transactionResponse.wait()));
4859
4859
  } catch (o) {
@@ -4972,13 +4972,13 @@ var zr = (r, e, t) => {
4972
4972
  import { parseUnits as ha } from "ethers";
4973
4973
  var Qr = 1;
4974
4974
  var Xe = 6;
4975
- var ya = (r, e, t = BigInt(1)) => {
4975
+ var Aa = (r, e, t = BigInt(1)) => {
4976
4976
  const o = r.amount;
4977
4977
  const n = Math.round(o.percentageDecimal * 10 ** Xe);
4978
4978
  const a = e * BigInt(n) / BigInt(10 ** Xe);
4979
4979
  return a - a % t;
4980
4980
  };
4981
- var Aa = (r, e) => {
4981
+ var ya = (r, e) => {
4982
4982
  const t = r.amount;
4983
4983
  const o = ha(t.token, e);
4984
4984
  return o;
@@ -4991,10 +4991,10 @@ var et = (r, e, t = 18, o = BigInt(1)) => {
4991
4991
  for (const c of r) {
4992
4992
  let p = BigInt(0);
4993
4993
  if (Object.hasOwn(c.amount, "percentageDecimal")) {
4994
- p = ya(c, a, o);
4994
+ p = Aa(c, a, o);
4995
4995
  n += p;
4996
4996
  } else if (Object.hasOwn(c.amount, "token")) {
4997
- p = Aa(c, t);
4997
+ p = ya(c, t);
4998
4998
  n += p;
4999
4999
  } else {
5000
5000
  throw new m(
@@ -5122,7 +5122,7 @@ var Zr = async (r, e, t, o = {
5122
5122
  const N = n.result.sell[0].type === "ERC721" ? BigInt(1) : BigInt(n.result.sell[0].amount);
5123
5123
  T = et(f, E.amount, i, N);
5124
5124
  }
5125
- let y = [];
5125
+ let A = [];
5126
5126
  let I = [];
5127
5127
  let P = [];
5128
5128
  const v = performance.now();
@@ -5133,7 +5133,7 @@ var Zr = async (r, e, t, o = {
5133
5133
  c.fulfillOrder(g, u, T, R)
5134
5134
  );
5135
5135
  P = N;
5136
- y = await k(
5136
+ A = await k(
5137
5137
  r,
5138
5138
  "Time to construct the unsigned approval transactions",
5139
5139
  Hr(N)
@@ -5191,8 +5191,8 @@ var Zr = async (r, e, t, o = {
5191
5191
  x += BigInt(N.amount);
5192
5192
  }
5193
5193
  });
5194
- const G = n.result.fees;
5195
- G.forEach((N) => {
5194
+ const q = n.result.fees;
5195
+ q.forEach((N) => {
5196
5196
  x += BigInt(N.amount);
5197
5197
  });
5198
5198
  if (n.result.sell[0].type === "ERC1155" && R) {
@@ -5215,7 +5215,7 @@ var Zr = async (r, e, t, o = {
5215
5215
  )
5216
5216
  );
5217
5217
  if (K.sufficient) {
5218
- const N = await Ze(e, y);
5218
+ const N = await Ze(e, A);
5219
5219
  if (N.type === "FAILED") {
5220
5220
  return {
5221
5221
  status: "FAILED",
@@ -5253,7 +5253,7 @@ var Zr = async (r, e, t, o = {
5253
5253
  let te;
5254
5254
  try {
5255
5255
  const H = await Promise.all(I.map(
5256
- (ot) => U(e, ot)
5256
+ (ot) => G(e, ot)
5257
5257
  ));
5258
5258
  te = H.map((ot) => ot.transactionResponse);
5259
5259
  } catch (H) {
@@ -5328,7 +5328,7 @@ var _a = async (r, e, t, o, n) => {
5328
5328
  let s;
5329
5329
  try {
5330
5330
  const c = await Promise.all([a].map(
5331
- (p) => U(t, p)
5331
+ (p) => G(t, p)
5332
5332
  ));
5333
5333
  s = c.map((p) => p.transactionResponse);
5334
5334
  } catch (c) {
@@ -5415,7 +5415,7 @@ async function $r(r, e) {
5415
5415
  e.forEach((a) => {
5416
5416
  if (a.type === "ERC20") {
5417
5417
  const { tokenAddress: i } = a;
5418
- t.push(ar(i, W, r).decimals());
5418
+ t.push(ar(i, F, r).decimals());
5419
5419
  }
5420
5420
  });
5421
5421
  const o = await Promise.all(t);
@@ -5491,7 +5491,7 @@ var Xr = async (r, e, t) => {
5491
5491
  if (i.type === "ERC20") {
5492
5492
  const E = new Ba(
5493
5493
  i.tokenAddress,
5494
- JSON.stringify(W),
5494
+ JSON.stringify(F),
5495
5495
  e
5496
5496
  );
5497
5497
  u = await k(
@@ -5511,7 +5511,7 @@ var Xr = async (r, e, t) => {
5511
5511
  o = ce(r);
5512
5512
  const { seaportContractAddress: T } = o.config();
5513
5513
  a = T;
5514
- const y = f && s.type === "ERC1155" ? {
5514
+ const A = f && s.type === "ERC1155" ? {
5515
5515
  type: "ERC1155",
5516
5516
  contractAddress: s.collectionAddress,
5517
5517
  tokenId: s.id,
@@ -5527,7 +5527,7 @@ var Xr = async (r, e, t) => {
5527
5527
  o.prepareListing({
5528
5528
  makerAddress: E,
5529
5529
  buy: g,
5530
- sell: y,
5530
+ sell: A,
5531
5531
  orderExpiry: p
5532
5532
  })
5533
5533
  );
@@ -5556,7 +5556,7 @@ var Xr = async (r, e, t) => {
5556
5556
  R.push(E);
5557
5557
  }
5558
5558
  let C;
5559
- if (!At(e)) {
5559
+ if (!yt(e)) {
5560
5560
  C = await k(
5561
5561
  r,
5562
5562
  "Total time running smart checkout",
@@ -5587,12 +5587,12 @@ var Xr = async (r, e, t) => {
5587
5587
  smartCheckoutResult: C
5588
5588
  };
5589
5589
  }
5590
- const y = zr(
5590
+ const A = zr(
5591
5591
  n.orderHash,
5592
5592
  n.orderComponents,
5593
5593
  n.actions
5594
5594
  );
5595
- if (!y) {
5595
+ if (!A) {
5596
5596
  throw new m(
5597
5597
  "The unsigned message is missing after preparing the listing",
5598
5598
  "SIGN_MESSAGE_ERROR",
@@ -5604,7 +5604,7 @@ var Xr = async (r, e, t) => {
5604
5604
  }
5605
5605
  const I = await Vr(
5606
5606
  e,
5607
- y
5607
+ A
5608
5608
  );
5609
5609
  let P = "";
5610
5610
  const v = {
@@ -5715,7 +5715,7 @@ var to = async (r, e, t, o, n, a, i, s, c) => {
5715
5715
  c
5716
5716
  );
5717
5717
  if (p.approval) {
5718
- const f = await U(e, p.approval.transaction);
5718
+ const f = await G(e, p.approval.transaction);
5719
5719
  const R = await f.transactionResponse.wait();
5720
5720
  if (R?.status === 0) {
5721
5721
  throw new m(
@@ -5724,7 +5724,7 @@ var to = async (r, e, t, o, n, a, i, s, c) => {
5724
5724
  );
5725
5725
  }
5726
5726
  }
5727
- const u = await U(e, p.swap.transaction);
5727
+ const u = await G(e, p.swap.transaction);
5728
5728
  const g = await u.transactionResponse.wait();
5729
5729
  if (g?.status === 0) {
5730
5730
  throw new m(
@@ -5770,7 +5770,7 @@ var xt = async (r, e) => {
5770
5770
  try {
5771
5771
  const n = o?.levels.map((i) => i.toLowerCase()) ?? [];
5772
5772
  const a = await ja.post(
5773
- `${q[e.environment]}/v1/sanctions/check`,
5773
+ `${W[e.environment]}/v1/sanctions/check`,
5774
5774
  {
5775
5775
  addresses: r
5776
5776
  }
@@ -5786,17 +5786,54 @@ var xt = async (r, e) => {
5786
5786
  return t;
5787
5787
  }
5788
5788
  };
5789
+
5790
+ // src/riskAssessment/riskAssessmentV2.ts
5791
+ import Va from "axios";
5792
+ var Ka = async (r, e) => {
5793
+ const t = Object.fromEntries(
5794
+ r.map((n) => [n.address.toLowerCase(), { sanctioned: false }])
5795
+ );
5796
+ const o = await e.remote.getConfig("riskAssessment");
5797
+ if (!o?.enabled) {
5798
+ return t;
5799
+ }
5800
+ try {
5801
+ const n = o?.levels.map((s) => s.toLowerCase()) ?? [];
5802
+ const a = r.map((s) => ({
5803
+ address: s.address,
5804
+ token_addr: s.tokenAddr,
5805
+ amount: s.amount.toString()
5806
+ }));
5807
+ const i = await Va.post(
5808
+ `${W[e.environment]}/v2/sanctions/check`,
5809
+ a
5810
+ );
5811
+ for (const s of i.data) {
5812
+ t[s.address.toLowerCase()].sanctioned = n.includes(
5813
+ s.risk.toLowerCase()
5814
+ );
5815
+ }
5816
+ return t;
5817
+ } catch (n) {
5818
+ console.error("Error fetching risk assessment", n);
5819
+ return t;
5820
+ }
5821
+ };
5822
+
5823
+ // src/riskAssessment/common.ts
5789
5824
  var Ot = (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 Ha = (r, e) => r[e.toLowerCase()].sanctioned;
5831
+ var za = (r) => Object.values(r).some((e) => e.sanctioned);
5795
5832
 
5796
5833
  // src/sdk.ts
5797
- var Ka = {
5834
+ var Za = {
5798
5835
  baseConfig: {
5799
- environment: Va.SANDBOX
5836
+ environment: Qa.SANDBOX
5800
5837
  },
5801
5838
  passport: void 0
5802
5839
  };
@@ -5811,9 +5848,9 @@ var Bt = 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 = Ka) {
5851
+ constructor(e = Za) {
5815
5852
  this.httpClient = new ue(e);
5816
- this.config = new ye(e, this.httpClient);
5853
+ this.config = new Ae(e, this.httpClient);
5817
5854
  this.fiatRampService = new Me(this.config);
5818
5855
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5819
5856
  this.availability = Ne(
@@ -5821,7 +5858,7 @@ var Bt = class {
5821
5858
  this.config.isProduction
5822
5859
  );
5823
5860
  this.passport = e.passport;
5824
- F.getInstance().initialise();
5861
+ U.getInstance().initialise();
5825
5862
  }
5826
5863
  /**
5827
5864
  * Loads the widgets bundle and initiates the widgets factory.
@@ -5867,7 +5904,7 @@ var Bt = class {
5867
5904
  * @returns {readonly EIP6963ProviderDetail[]} A readonly array of injected providers and their metadata.
5868
5905
  */
5869
5906
  getInjectedProviders() {
5870
- return F.getInstance().getProviders();
5907
+ return U.getInstance().getProviders();
5871
5908
  }
5872
5909
  /**
5873
5910
  * Finds an injected provider by its RDNS.
@@ -5875,7 +5912,7 @@ var Bt = class {
5875
5912
  * @returns {EIP6963ProviderDetail | undefined} - The found provider and metadata or undefined.
5876
5913
  */
5877
5914
  findInjectedProvider(e) {
5878
- return F.getInstance().findProvider(e);
5915
+ return U.getInstance().findProvider(e);
5879
5916
  }
5880
5917
  /**
5881
5918
  * Subscribes to changes in the injected providers.
@@ -5883,14 +5920,14 @@ var Bt = class {
5883
5920
  * @returns {() => void} - A function to unsubscribe the listener.
5884
5921
  */
5885
5922
  onInjectedProvidersChange(e) {
5886
- return F.getInstance().subscribe(e);
5923
+ return U.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 F.getInstance().clear();
5930
+ return U.getInstance().clear();
5894
5931
  }
5895
5932
  /**
5896
5933
  * Checks if a wallet is connected to the specified provider.
@@ -6074,7 +6111,7 @@ var Bt = class {
6074
6111
  allowMistmatchedChainId: true
6075
6112
  }
6076
6113
  );
6077
- return await U(t, e.transaction);
6114
+ return await G(t, e.transaction);
6078
6115
  }
6079
6116
  /**
6080
6117
  * Wraps a WrappedBrowserProvider call to validate the provider and handle errors.
@@ -6361,7 +6398,7 @@ export {
6361
6398
  nt as ChainName,
6362
6399
  we as ChainSlug,
6363
6400
  Bt as Checkout,
6364
- ye as CheckoutConfiguration,
6401
+ Ae as CheckoutConfiguration,
6365
6402
  m as CheckoutError,
6366
6403
  S as CheckoutErrorType,
6367
6404
  Ee as CheckoutStatus,
@@ -6371,13 +6408,13 @@ export {
6371
6408
  fo as CommerceSuccessEventType,
6372
6409
  Ro as CommerceUserActionEventType,
6373
6410
  ao as ConnectEventType,
6374
- yo as ConnectTargetLayer,
6411
+ Ao as ConnectTargetLayer,
6375
6412
  Vt as ExchangeType,
6376
6413
  _e as FeeType,
6377
6414
  Te as FundingStepType,
6378
6415
  st as GasEstimateType,
6379
6416
  Ce as GasTokenType,
6380
- q as IMMUTABLE_API_BASE_URL,
6417
+ W as IMMUTABLE_API_BASE_URL,
6381
6418
  oo as IMTBLWidgetEvents,
6382
6419
  M as ItemType,
6383
6420
  ge as NetworkFilterTypes,
@@ -6388,7 +6425,7 @@ export {
6388
6425
  ct as RoutingOutcomeType,
6389
6426
  co as SaleEventType,
6390
6427
  lo as SalePaymentTypes,
6391
- Ao as SwapDirection,
6428
+ yo as SwapDirection,
6392
6429
  so as SwapEventType,
6393
6430
  ae as TokenFilterTypes,
6394
6431
  Re as TransactionOrGasType,
@@ -6401,12 +6438,15 @@ export {
6401
6438
  ho as WidgetType,
6402
6439
  D as WrappedBrowserProvider,
6403
6440
  xt as fetchRiskAssessment,
6441
+ Ka as fetchRiskAssessmentV2,
6404
6442
  Ct as getGasPriceInWei,
6405
6443
  fn as getMetaMaskProviderDetail,
6406
6444
  gn as getPassportProviderDetail,
6407
6445
  Ie as getUnderlyingChainId,
6408
6446
  Ot as isAddressSanctioned,
6447
+ Ha as isSingleAddressSanctioned,
6409
6448
  De as metaMaskProviderInfo,
6410
6449
  We as passportProviderInfo,
6450
+ za as resultHasSanctionedWallets,
6411
6451
  b as validateProvider
6412
6452
  };