@imtbl/checkout-sdk 2.1.7 → 2.1.8-alpha.0

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.
@@ -1,16 +1,17 @@
1
1
  // src/widgets/definitions/events/widgets.ts
2
- var no = /* @__PURE__ */ ((m) => {
3
- m["IMTBL_WIDGETS_PROVIDER"] = "imtbl-widgets-provider";
4
- m["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
5
- m["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
6
- m["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
7
- m["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
8
- m["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
9
- m["IMTBL_SALE_WIDGET_EVENT"] = "imtbl-sale-widget";
10
- m["IMTBL_COMMERCE_WIDGET_EVENT"] = "imtbl-commerce-widget";
11
- m["IMTBL_ADD_TOKENS_WIDGET_EVENT"] = "imtbl-add-tokens-widget";
12
- m["IMTBL_PURCHASE_WIDGET_EVENT"] = "imtbl-purchase-widget";
13
- return m;
2
+ var no = /* @__PURE__ */ ((g) => {
3
+ g["IMTBL_WIDGETS_PROVIDER"] = "imtbl-widgets-provider";
4
+ g["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
5
+ g["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
6
+ g["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
7
+ g["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
8
+ g["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
9
+ g["IMTBL_SALE_WIDGET_EVENT"] = "imtbl-sale-widget";
10
+ g["IMTBL_COMMERCE_WIDGET_EVENT"] = "imtbl-commerce-widget";
11
+ g["IMTBL_ADD_TOKENS_WIDGET_EVENT"] = "imtbl-add-tokens-widget";
12
+ g["IMTBL_PURCHASE_WIDGET_EVENT"] = "imtbl-purchase-widget";
13
+ g["IMTBL_TRANSFER_WIDGET_EVENT"] = "imtbl-transfer-widget";
14
+ return g;
14
15
  })(no || {});
15
16
  var ao = /* @__PURE__ */ ((e) => {
16
17
  e["PROVIDER_UPDATED"] = "PROVIDER_UPDATED";
@@ -161,61 +162,72 @@ var Io = /* @__PURE__ */ ((n) => {
161
162
  return n;
162
163
  })(Io || {});
163
164
 
164
- // src/widgets/definitions/types.ts
165
- var ho = /* @__PURE__ */ ((p) => {
166
- p["CONNECT"] = "connect";
167
- p["WALLET"] = "wallet";
168
- p["SWAP"] = "swap";
169
- p["BRIDGE"] = "bridge";
170
- p["ONRAMP"] = "onramp";
171
- p["SALE"] = "sale";
172
- p["IMMUTABLE_COMMERCE"] = "immutableCommerce";
173
- p["ADD_TOKENS"] = "addTokens";
174
- p["PURCHASE"] = "purchase";
175
- return p;
165
+ // src/widgets/definitions/events/transfer.ts
166
+ var ho = /* @__PURE__ */ ((n) => {
167
+ n["CLOSE_WIDGET"] = "close-widget";
168
+ n["REJECTED"] = "rejected";
169
+ n["SUCCESS"] = "success";
170
+ n["FAILURE"] = "failure";
171
+ return n;
176
172
  })(ho || {});
177
173
 
174
+ // src/widgets/definitions/types.ts
175
+ var yo = /* @__PURE__ */ ((m) => {
176
+ m["CONNECT"] = "connect";
177
+ m["WALLET"] = "wallet";
178
+ m["SWAP"] = "swap";
179
+ m["BRIDGE"] = "bridge";
180
+ m["ONRAMP"] = "onramp";
181
+ m["SALE"] = "sale";
182
+ m["IMMUTABLE_COMMERCE"] = "immutableCommerce";
183
+ m["ADD_TOKENS"] = "addTokens";
184
+ m["PURCHASE"] = "purchase";
185
+ m["TRANSFER"] = "transfer";
186
+ return m;
187
+ })(yo || {});
188
+
178
189
  // src/widgets/definitions/parameters/connect.ts
179
- var yo = /* @__PURE__ */ ((t) => {
190
+ var Ao = /* @__PURE__ */ ((t) => {
180
191
  t["LAYER1"] = "LAYER1";
181
192
  t["LAYER2"] = "LAYER2";
182
193
  return t;
183
- })(yo || {});
194
+ })(Ao || {});
184
195
 
185
196
  // src/widgets/definitions/parameters/swap.ts
186
- var Ao = /* @__PURE__ */ ((t) => {
197
+ var Po = /* @__PURE__ */ ((t) => {
187
198
  t["FROM"] = "FROM";
188
199
  t["TO"] = "TO";
189
200
  return t;
190
- })(Ao || {});
201
+ })(Po || {});
191
202
 
192
203
  // src/widgets/definitions/parameters/commerce.ts
193
- var Po = /* @__PURE__ */ ((c) => {
194
- c["CONNECT"] = "CONNECT";
195
- c["WALLET"] = "WALLET";
196
- c["SALE"] = "SALE";
197
- c["SWAP"] = "SWAP";
198
- c["BRIDGE"] = "BRIDGE";
199
- c["ONRAMP"] = "ONRAMP";
200
- c["ADD_TOKENS"] = "ADD_TOKENS";
201
- c["PURCHASE"] = "PURCHASE";
202
- return c;
203
- })(Po || {});
204
+ var wo = /* @__PURE__ */ ((p) => {
205
+ p["CONNECT"] = "CONNECT";
206
+ p["WALLET"] = "WALLET";
207
+ p["SALE"] = "SALE";
208
+ p["SWAP"] = "SWAP";
209
+ p["BRIDGE"] = "BRIDGE";
210
+ p["ONRAMP"] = "ONRAMP";
211
+ p["ADD_TOKENS"] = "ADD_TOKENS";
212
+ p["PURCHASE"] = "PURCHASE";
213
+ p["TRANSFER"] = "TRANSFER";
214
+ return p;
215
+ })(wo || {});
204
216
 
205
217
  // src/widgets/definitions/configurations/theme.ts
206
- var wo = /* @__PURE__ */ ((t) => {
218
+ var So = /* @__PURE__ */ ((t) => {
207
219
  t["LIGHT"] = "light";
208
220
  t["DARK"] = "dark";
209
221
  return t;
210
- })(wo || {});
222
+ })(So || {});
211
223
 
212
224
  // src/sdk.ts
213
- import { Environment as Ga } from "@imtbl/config";
225
+ import { Environment as qa } from "@imtbl/config";
214
226
 
215
227
  // src/api/http/httpClient.ts
216
- import So from "axios";
217
- var ko = "pk_imapik-";
218
- var vo = [
228
+ import ko from "axios";
229
+ var vo = "pk_imapik-";
230
+ var No = [
219
231
  "https://checkout-api.dev.immutable.com",
220
232
  "https://checkout-api.sandbox.immutable.com",
221
233
  "https://checkout-api.immutable.com"
@@ -225,19 +237,19 @@ var pe = class {
225
237
  axiosInstance;
226
238
  constructor(e) {
227
239
  this.config = e;
228
- this.axiosInstance = So.create();
240
+ this.axiosInstance = ko.create();
229
241
  this.setupInterceptors();
230
242
  }
231
243
  // eslint-disable-next-line class-methods-use-this
232
244
  shouldAddPublishableKey(e) {
233
- return vo.some((t) => e.startsWith(t));
245
+ return No.some((t) => e.startsWith(t));
234
246
  }
235
247
  setupInterceptors() {
236
248
  this.axiosInstance.interceptors.request.use(
237
249
  (e) => {
238
250
  const t = this.config?.baseConfig?.publishableKey;
239
251
  if (t && this.shouldAddPublishableKey(e.url || "")) {
240
- if (!t.startsWith(ko)) {
252
+ if (!t.startsWith(vo)) {
241
253
  throw new Error(
242
254
  "Invalid Publishable key. Create your Publishable key in Immutable developer hub. https://hub.immutable.com"
243
255
  );
@@ -287,7 +299,7 @@ var pe = class {
287
299
 
288
300
  // src/availability/availability.ts
289
301
  import { Environment as Ft } from "@imtbl/config";
290
- import Oo from "axios";
302
+ import xo from "axios";
291
303
 
292
304
  // src/errors/checkoutError.ts
293
305
  var S = /* @__PURE__ */ ((A) => {
@@ -368,14 +380,14 @@ var L = async (r, e) => {
368
380
  import { Environment as re } from "@imtbl/config";
369
381
 
370
382
  // src/types/chains.ts
371
- var J = /* @__PURE__ */ ((a) => {
383
+ var Y = /* @__PURE__ */ ((a) => {
372
384
  a[a["IMTBL_ZKEVM_MAINNET"] = 13371] = "IMTBL_ZKEVM_MAINNET";
373
385
  a[a["IMTBL_ZKEVM_TESTNET"] = 13473] = "IMTBL_ZKEVM_TESTNET";
374
386
  a[a["IMTBL_ZKEVM_DEVNET"] = 15003] = "IMTBL_ZKEVM_DEVNET";
375
387
  a[a["ETHEREUM"] = 1] = "ETHEREUM";
376
388
  a[a["SEPOLIA"] = 11155111] = "SEPOLIA";
377
389
  return a;
378
- })(J || {});
390
+ })(Y || {});
379
391
  var ot = /* @__PURE__ */ ((a) => {
380
392
  a["ETHEREUM"] = "Ethereum";
381
393
  a["SEPOLIA"] = "Sepolia";
@@ -404,7 +416,7 @@ var Se = {
404
416
  decimals: j,
405
417
  address: x
406
418
  };
407
- var No = {
419
+ var _o = {
408
420
  name: "tIMX",
409
421
  symbol: "tIMX",
410
422
  decimals: j,
@@ -475,7 +487,7 @@ var we = /* @__PURE__ */ new Map([
475
487
  chainIdHex: `0x${13473 .toString(16)}`,
476
488
  chainName: "Immutable zkEVM Testnet",
477
489
  rpcUrls: ["https://rpc.testnet.immutable.com"],
478
- nativeCurrency: No
490
+ nativeCurrency: _o
479
491
  }
480
492
  ]
481
493
  ]);
@@ -789,8 +801,8 @@ var at = {
789
801
  };
790
802
 
791
803
  // src/env/env.ts
792
- var _o = "2.1.7";
793
- var ue = () => _o;
804
+ var Oo = "2.1.8-alpha.0";
805
+ var ue = () => Oo;
794
806
 
795
807
  // src/availability/availability.ts
796
808
  var ve = (r, e) => {
@@ -802,7 +814,7 @@ var ve = (r, e) => {
802
814
  const o = async () => {
803
815
  let n;
804
816
  try {
805
- n = await Oo.post(`${t()}/v1/availability/checkout/swap`);
817
+ n = await xo.post(`${t()}/v1/availability/checkout/swap`);
806
818
  } catch (a) {
807
819
  n = a.response;
808
820
  if (n.status === 403) return false;
@@ -821,7 +833,7 @@ var ve = (r, e) => {
821
833
 
822
834
  // src/balances/balances.ts
823
835
  import { HttpStatusCode as pt } from "axios";
824
- import { Contract as Vo, formatUnits as mt } from "ethers";
836
+ import { Contract as Ko, formatUnits as mt } from "ethers";
825
837
 
826
838
  // src/types/gasEstimate.ts
827
839
  var it = /* @__PURE__ */ ((t) => {
@@ -853,7 +865,7 @@ var Ut = /* @__PURE__ */ ((e) => {
853
865
 
854
866
  // src/types/provider.ts
855
867
  import {
856
- BrowserProvider as xo
868
+ BrowserProvider as Bo
857
869
  } from "ethers";
858
870
  var ge = /* @__PURE__ */ ((o) => {
859
871
  o["PASSPORT"] = "passport";
@@ -871,7 +883,7 @@ var qt = {
871
883
  allowMistmatchedChainId: false,
872
884
  allowUnsupportedProvider: false
873
885
  };
874
- var D = class extends xo {
886
+ var D = class extends Bo {
875
887
  ethereumProvider;
876
888
  // eslint-disable-next-line max-len
877
889
  constructor(e, t, o) {
@@ -938,7 +950,7 @@ var jt = /* @__PURE__ */ ((e) => {
938
950
  })(jt || {});
939
951
 
940
952
  // src/provider/getUnderlyingProvider.ts
941
- async function Bo(r) {
953
+ async function Mo(r) {
942
954
  if (!r.send) {
943
955
  throw new u(
944
956
  "Parsed provider is not a valid WrappedBrowserProvider",
@@ -956,12 +968,12 @@ async function Te(r) {
956
968
  if (e.chainId && typeof e.chainId === "bigint") {
957
969
  return e.chainId;
958
970
  }
959
- return Bo(r);
971
+ return Mo(r);
960
972
  }
961
973
 
962
974
  // src/network/network.ts
963
- var Mo = 4902;
964
- async function bo(r, e, t) {
975
+ var bo = 4902;
976
+ async function Lo(r, e, t) {
965
977
  return await e.send("wallet_switchEthereumChain", [
966
978
  { chainId: r.get(t)?.chainIdHex }
967
979
  ]);
@@ -1062,7 +1074,7 @@ async function Kt(r, e, t) {
1062
1074
  }
1063
1075
  try {
1064
1076
  if (e && "ethereumProvider" in e) {
1065
- await bo(o, e, t);
1077
+ await Lo(o, e, t);
1066
1078
  } else {
1067
1079
  throw new u(
1068
1080
  "Incorrect provider type",
@@ -1071,7 +1083,7 @@ async function Kt(r, e, t) {
1071
1083
  }
1072
1084
  } catch (c) {
1073
1085
  console.error(c);
1074
- if (c.code === Mo) {
1086
+ if (c.code === bo) {
1075
1087
  try {
1076
1088
  if ("ethereumProvider" in e) {
1077
1089
  await ct(o, e, t);
@@ -1111,7 +1123,7 @@ async function Kt(r, e, t) {
1111
1123
  }
1112
1124
 
1113
1125
  // src/tokens/tokens.ts
1114
- import { Contract as Uo } from "ethers";
1126
+ import { Contract as Go } from "ethers";
1115
1127
 
1116
1128
  // src/config/config.ts
1117
1129
  import { Environment as Zt } from "@imtbl/config";
@@ -1178,7 +1190,7 @@ var _e = class {
1178
1190
 
1179
1191
  // src/config/tokensFetcher.ts
1180
1192
  import { Environment as Qt } from "@imtbl/config";
1181
- var Lo = "0x0000000000000000000000000000000000000eee";
1193
+ var Do = "0x0000000000000000000000000000000000000eee";
1182
1194
  var Oe = class {
1183
1195
  httpClient;
1184
1196
  remoteConfig;
@@ -1275,7 +1287,7 @@ var Oe = class {
1275
1287
  if (!t[s]) {
1276
1288
  t[s] = [];
1277
1289
  }
1278
- if (c === Lo) {
1290
+ if (c === Do) {
1279
1291
  c = "native";
1280
1292
  }
1281
1293
  t[s]?.push({
@@ -1317,7 +1329,7 @@ var dt = class extends Error {
1317
1329
  this.message = e;
1318
1330
  }
1319
1331
  };
1320
- var Do = (r, e) => {
1332
+ var Wo = (r, e) => {
1321
1333
  if (e) return Wt;
1322
1334
  if (r) return Pe;
1323
1335
  return we;
@@ -1359,7 +1371,7 @@ var he = class {
1359
1371
  this.isSwapEnabled = e.swap?.enable ?? bt;
1360
1372
  this.isBridgeEnabled = e.bridge?.enable ?? Lt;
1361
1373
  this.publishableKey = e.publishableKey ?? "<no-publishable-key>";
1362
- this.networkMap = Do(this.isProduction, this.isDevelopment);
1374
+ this.networkMap = Wo(this.isProduction, this.isDevelopment);
1363
1375
  this.remote = new _e(t, {
1364
1376
  isDevelopment: this.isDevelopment,
1365
1377
  isProduction: this.isProduction
@@ -1378,8 +1390,8 @@ var he = class {
1378
1390
 
1379
1391
  // src/utils/utils.ts
1380
1392
  var h = (r = "", e = "") => r.toLowerCase() === e.toLowerCase();
1381
- var Yt = (r) => r === 15003 || r === 13473 || r === 13371;
1382
- var Wo = (r, e) => {
1393
+ var Jt = (r) => r === 15003 || r === 13473 || r === 13371;
1394
+ var Fo = (r, e) => {
1383
1395
  const t = r.indexOf(".");
1384
1396
  const o = r.substring(t + e + 1);
1385
1397
  if (o && parseFloat(o) >= 1) {
@@ -1389,15 +1401,15 @@ var Wo = (r, e) => {
1389
1401
  }
1390
1402
  return parseFloat(r.substring(0, t + e + 1)).toString();
1391
1403
  };
1392
- var Y = (r, e = Bt) => {
1404
+ var J = (r, e = Bt) => {
1393
1405
  const t = r.indexOf(".");
1394
1406
  if (t === -1) return r;
1395
- const o = Wo(r, e);
1407
+ const o = Fo(r, e);
1396
1408
  return o;
1397
1409
  };
1398
1410
 
1399
1411
  // src/tokens/tokens.ts
1400
- var Go = "native";
1412
+ var qo = "native";
1401
1413
  var z = async (r, {
1402
1414
  type: e = "all",
1403
1415
  chainId: t,
@@ -1420,7 +1432,7 @@ var z = async (r, {
1420
1432
  n = a["201811419111"]?.tokens || [];
1421
1433
  break;
1422
1434
  case "bridge":
1423
- n = (await r.tokens.getTokensConfig(s)).filter((p) => p.bridge === Go);
1435
+ n = (await r.tokens.getTokensConfig(s)).filter((p) => p.bridge === qo);
1424
1436
  break;
1425
1437
  case "all":
1426
1438
  default:
@@ -1435,7 +1447,7 @@ var B = (r) => !r || h(r, x);
1435
1447
  async function xe(r, e) {
1436
1448
  return await L(
1437
1449
  async () => {
1438
- const t = new Uo(e, JSON.stringify(W), r);
1450
+ const t = new Go(e, JSON.stringify(W), r);
1439
1451
  const [o, n, a] = await Promise.all([
1440
1452
  t.name(),
1441
1453
  t.symbol(),
@@ -1453,10 +1465,10 @@ async function xe(r, e) {
1453
1465
  }
1454
1466
 
1455
1467
  // src/api/blockscout/blockscout.ts
1456
- import Jt, {
1468
+ import Yt, {
1457
1469
  HttpStatusCode as $t
1458
1470
  } from "axios";
1459
- var jo = 5;
1471
+ var Vo = 5;
1460
1472
  var ye = class {
1461
1473
  url;
1462
1474
  nativeToken;
@@ -1490,7 +1502,7 @@ var ye = class {
1490
1502
  symbol: n.symbol
1491
1503
  };
1492
1504
  this.cacheMap = {};
1493
- this.ttl = o !== void 0 ? o : jo;
1505
+ this.ttl = o !== void 0 ? o : Vo;
1494
1506
  }
1495
1507
  /**
1496
1508
  * isChainSupported verifies if the chain is supported by Blockscout
@@ -1528,7 +1540,7 @@ var ye = class {
1528
1540
  } catch (t) {
1529
1541
  let o = $t.InternalServerError;
1530
1542
  let n = "InternalServerError";
1531
- if (Jt.isAxiosError(t)) {
1543
+ if (Yt.isAxiosError(t)) {
1532
1544
  o = t.response?.status || o;
1533
1545
  n = t.message;
1534
1546
  }
@@ -1555,7 +1567,7 @@ var ye = class {
1555
1567
  } catch (t) {
1556
1568
  let o = $t.InternalServerError;
1557
1569
  let n = "InternalServerError";
1558
- if (Jt.isAxiosError(t)) {
1570
+ if (Yt.isAxiosError(t)) {
1559
1571
  o = t.response?.status || o;
1560
1572
  n = t.message;
1561
1573
  }
@@ -1603,7 +1615,7 @@ var gt = async (r, e, t) => await L(
1603
1615
  async function ft(r, e, t) {
1604
1616
  return await L(
1605
1617
  async () => {
1606
- const o = new Vo(
1618
+ const o = new Ko(
1607
1619
  t,
1608
1620
  JSON.stringify(W),
1609
1621
  r
@@ -1630,7 +1642,7 @@ async function ft(r, e, t) {
1630
1642
  }
1631
1643
  var ut = /* @__PURE__ */ new Map();
1632
1644
  var Et = () => ut.clear();
1633
- var Ko = async (r, e, t, o) => {
1645
+ var Ho = async (r, e, t, o) => {
1634
1646
  const n = o !== void 0;
1635
1647
  const a = Object.assign(
1636
1648
  {},
@@ -1704,7 +1716,7 @@ var Ko = async (r, e, t, o) => {
1704
1716
  });
1705
1717
  return { balances: g };
1706
1718
  };
1707
- var Ho = async (r, e, t, o) => {
1719
+ var zo = async (r, e, t, o) => {
1708
1720
  const n = [];
1709
1721
  o.forEach((s) => {
1710
1722
  if (!s.address || h(s.address, x)) {
@@ -1740,7 +1752,7 @@ var Xt = async (r, e, t, o, n) => {
1740
1752
  return await k(
1741
1753
  r,
1742
1754
  `Time to fetch balances using RPC for ${o}`,
1743
- Ho(r, e, a, n)
1755
+ zo(r, e, a, n)
1744
1756
  );
1745
1757
  };
1746
1758
  var V = async (r, e, t, o, n = false) => {
@@ -1772,7 +1784,7 @@ var V = async (r, e, t, o, n = false) => {
1772
1784
  return await k(
1773
1785
  r,
1774
1786
  `Time to fetch balances using blockscout for ${o}`,
1775
- Ko(r, i, o, a)
1787
+ Ho(r, i, o, a)
1776
1788
  );
1777
1789
  } catch (s) {
1778
1790
  if (s.type === "GET_INDEXER_BALANCE_ERROR" && s.data?.error?.code === pt.TooManyRequests) {
@@ -1920,7 +1932,7 @@ var Be = class {
1920
1932
  };
1921
1933
 
1922
1934
  // src/gasEstimate/gasEstimator.ts
1923
- import { parseUnits as nn } from "ethers";
1935
+ import { parseUnits as an } from "ethers";
1924
1936
 
1925
1937
  // src/gasEstimate/bridgeGasEstimate.ts
1926
1938
  import {
@@ -1940,16 +1952,16 @@ async function nr(r, e, t, o) {
1940
1952
 
1941
1953
  // src/instance/instance.ts
1942
1954
  import {
1943
- BridgeConfiguration as Zo,
1955
+ BridgeConfiguration as Jo,
1944
1956
  ETH_MAINNET_TO_ZKEVM_MAINNET as Yo,
1945
- ETH_SEPOLIA_TO_ZKEVM_DEVNET as Jo,
1946
- ETH_SEPOLIA_TO_ZKEVM_TESTNET as $o,
1947
- TokenBridge as Xo
1957
+ ETH_SEPOLIA_TO_ZKEVM_DEVNET as $o,
1958
+ ETH_SEPOLIA_TO_ZKEVM_TESTNET as Xo,
1959
+ TokenBridge as en
1948
1960
  } from "@imtbl/bridge-sdk";
1949
1961
  import { ImmutableConfiguration as ar } from "@imtbl/config";
1950
- import { Exchange as en } from "@imtbl/dex-sdk";
1951
- import { Orderbook as tn } from "@imtbl/orderbook";
1952
- import { BlockchainData as rn } from "@imtbl/blockchain-data";
1962
+ import { Exchange as tn } from "@imtbl/dex-sdk";
1963
+ import { Orderbook as rn } from "@imtbl/orderbook";
1964
+ import { BlockchainData as on } from "@imtbl/blockchain-data";
1953
1965
  function Me(r, e, t, o) {
1954
1966
  const n = t.get(r);
1955
1967
  const a = t.get(e);
@@ -1965,22 +1977,22 @@ function Me(r, e, t, o) {
1965
1977
  "CHAIN_NOT_SUPPORTED_ERROR"
1966
1978
  );
1967
1979
  }
1968
- let i = $o;
1969
- if (o.isDevelopment) i = Jo;
1980
+ let i = Xo;
1981
+ if (o.isDevelopment) i = $o;
1970
1982
  if (o.isProduction) i = Yo;
1971
- const s = new Zo({
1983
+ const s = new Jo({
1972
1984
  baseConfig: new ar({ environment: o.environment }),
1973
1985
  bridgeInstance: i,
1974
1986
  rootProvider: n,
1975
1987
  childProvider: a
1976
1988
  });
1977
- return new Xo(s);
1989
+ return new en(s);
1978
1990
  }
1979
1991
  async function ie(r, e) {
1980
1992
  const t = await e.remote.getConfig(
1981
1993
  "dex"
1982
1994
  );
1983
- return new en({
1995
+ return new tn({
1984
1996
  chainId: r,
1985
1997
  baseConfig: new ar({
1986
1998
  environment: e.environment
@@ -1990,14 +2002,14 @@ async function ie(r, e) {
1990
2002
  });
1991
2003
  }
1992
2004
  function se(r) {
1993
- return new tn({
2005
+ return new rn({
1994
2006
  baseConfig: {
1995
2007
  environment: r.environment
1996
2008
  }
1997
2009
  });
1998
2010
  }
1999
2011
  function be(r) {
2000
- return new rn({
2012
+ return new on({
2001
2013
  baseConfig: {
2002
2014
  environment: r.environment
2003
2015
  }
@@ -2006,16 +2018,16 @@ function be(r) {
2006
2018
 
2007
2019
  // src/instance/contract.ts
2008
2020
  import {
2009
- Contract as on
2021
+ Contract as nn
2010
2022
  } from "ethers";
2011
2023
  function ir(r, e, t) {
2012
- return new on(r, e, t);
2024
+ return new nn(r, e, t);
2013
2025
  }
2014
2026
 
2015
2027
  // src/gasEstimate/gasEstimator.ts
2016
- var an = "0x0000000000000000000000000000000000000001";
2028
+ var sn = "0x0000000000000000000000000000000000000001";
2017
2029
  var sr = 18;
2018
- async function sn(r, e) {
2030
+ async function cn(r, e) {
2019
2031
  const t = O(e);
2020
2032
  const o = P(e);
2021
2033
  const n = r.get(t);
@@ -2052,7 +2064,7 @@ async function sn(r, e) {
2052
2064
  };
2053
2065
  }
2054
2066
  }
2055
- async function cn(r) {
2067
+ async function dn(r) {
2056
2068
  const e = P(r);
2057
2069
  const t = await r.remote.getConfig(
2058
2070
  "gasEstimateTokens"
@@ -2061,10 +2073,10 @@ async function cn(r) {
2061
2073
  try {
2062
2074
  const a = await ie(e, r);
2063
2075
  const { swap: i } = await a.getUnsignedSwapTxFromAmountIn(
2064
- an,
2076
+ sn,
2065
2077
  o,
2066
2078
  n,
2067
- BigInt(nn("1", sr))
2079
+ BigInt(an("1", sr))
2068
2080
  );
2069
2081
  if (!i.gasFeeEstimate) {
2070
2082
  return {
@@ -2094,12 +2106,12 @@ async function cn(r) {
2094
2106
  async function cr(r, e, t) {
2095
2107
  switch (r.gasEstimateType) {
2096
2108
  case "BRIDGE_TO_L2":
2097
- return await sn(
2109
+ return await cn(
2098
2110
  e,
2099
2111
  t
2100
2112
  );
2101
2113
  case "SWAP":
2102
- return await cn(t);
2114
+ return await dn(t);
2103
2115
  default:
2104
2116
  throw new u(
2105
2117
  "Invalid type provided for gasEstimateType",
@@ -2109,9 +2121,9 @@ async function cr(r, e, t) {
2109
2121
  }
2110
2122
 
2111
2123
  // src/gasEstimate/gasPriceInWei.ts
2112
- var dn = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2124
+ var ln = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2113
2125
  var Rt = (r) => {
2114
- if (dn(r)) {
2126
+ if (ln(r)) {
2115
2127
  const { maxFeePerGas: e, maxPriorityFeePerGas: t } = r;
2116
2128
  if (e === null || t === null) return null;
2117
2129
  const o = (e - t) / BigInt(2);
@@ -2122,7 +2134,7 @@ var Rt = (r) => {
2122
2134
  };
2123
2135
 
2124
2136
  // src/provider/provider.ts
2125
- import mn from "@metamask/detect-provider";
2137
+ import gn from "@metamask/detect-provider";
2126
2138
 
2127
2139
  // src/provider/injected/utils.ts
2128
2140
  function Ct(r) {
@@ -2244,19 +2256,19 @@ var De = {
2244
2256
  rdns: "com.immutable.passport",
2245
2257
  uuid: "b90118be-7234-4c89-b89b-d5d267663eb5"
2246
2258
  };
2247
- var pn = (r) => ({
2259
+ var un = (r) => ({
2248
2260
  info: De,
2249
2261
  provider: r
2250
2262
  });
2251
- var un = (r) => ({
2263
+ var mn = (r) => ({
2252
2264
  info: Le,
2253
2265
  provider: r
2254
2266
  });
2255
2267
 
2256
2268
  // src/provider/provider.ts
2257
- async function gn() {
2269
+ async function fn() {
2258
2270
  const r = await L(
2259
- async () => await mn(),
2271
+ async () => await gn(),
2260
2272
  { type: "METAMASK_PROVIDER_ERROR" }
2261
2273
  );
2262
2274
  if (!r || !r.request) {
@@ -2293,7 +2305,7 @@ async function dr(r, e) {
2293
2305
  case "metamask": {
2294
2306
  o = F.getInstance().findProvider({ rdns: Le.rdns });
2295
2307
  if (!o) {
2296
- t = await gn();
2308
+ t = await fn();
2297
2309
  }
2298
2310
  break;
2299
2311
  }
@@ -2381,7 +2393,7 @@ async function b(r, e, t) {
2381
2393
  }
2382
2394
 
2383
2395
  // src/readOnlyProviders/readOnlyProvider.ts
2384
- import { JsonRpcProvider as En } from "ethers";
2396
+ import { JsonRpcProvider as Rn } from "ethers";
2385
2397
  async function We(r, e) {
2386
2398
  if (r.isProduction && e?.has(1)) return e;
2387
2399
  if (e?.has(11155111)) return e;
@@ -2391,7 +2403,7 @@ async function We(r, e) {
2391
2403
  });
2392
2404
  o.networks.forEach((n) => {
2393
2405
  const a = r.networkMap.get(Number(n.chainId))?.rpcUrls[0];
2394
- const i = new En(a);
2406
+ const i = new Rn(a);
2395
2407
  t.set(Number(n.chainId), i);
2396
2408
  });
2397
2409
  return t;
@@ -2419,7 +2431,7 @@ var pr = (r, e, t) => {
2419
2431
  };
2420
2432
 
2421
2433
  // src/smartCheckout/aggregators/itemAggregator.ts
2422
- var Rn = (r) => {
2434
+ var Cn = (r) => {
2423
2435
  const e = /* @__PURE__ */ new Map();
2424
2436
  const t = [];
2425
2437
  r.forEach((o) => {
@@ -2442,7 +2454,7 @@ var Rn = (r) => {
2442
2454
  });
2443
2455
  return t.concat(Array.from(e.values()));
2444
2456
  };
2445
- var Cn = (r) => {
2457
+ var Tn = (r) => {
2446
2458
  const e = /* @__PURE__ */ new Map();
2447
2459
  const t = [];
2448
2460
  r.forEach((o) => {
@@ -2466,7 +2478,7 @@ var Cn = (r) => {
2466
2478
  });
2467
2479
  return t.concat(Array.from(e.values()));
2468
2480
  };
2469
- var Tn = (r) => {
2481
+ var In = (r) => {
2470
2482
  const e = /* @__PURE__ */ new Map();
2471
2483
  const t = [];
2472
2484
  r.forEach((o) => {
@@ -2482,7 +2494,7 @@ var Tn = (r) => {
2482
2494
  });
2483
2495
  return t.concat(Array.from(e.values()));
2484
2496
  };
2485
- var In = (r) => {
2497
+ var hn = (r) => {
2486
2498
  const e = /* @__PURE__ */ new Map();
2487
2499
  const t = [];
2488
2500
  r.forEach((o) => {
@@ -2507,11 +2519,11 @@ var In = (r) => {
2507
2519
  });
2508
2520
  return t.concat(Array.from(e.values()));
2509
2521
  };
2510
- var It = (r) => In(Tn(Cn(Rn(r))));
2522
+ var It = (r) => hn(In(Tn(Cn(r))));
2511
2523
 
2512
2524
  // src/smartCheckout/allowance/erc20.ts
2513
2525
  import { Contract as ur } from "ethers";
2514
- var hn = async (r, e, t, o) => {
2526
+ var yn = async (r, e, t, o) => {
2515
2527
  try {
2516
2528
  const n = new ur(
2517
2529
  t,
@@ -2527,7 +2539,7 @@ var hn = async (r, e, t, o) => {
2527
2539
  );
2528
2540
  }
2529
2541
  };
2530
- var yn = async (r, e, t, o, n) => {
2542
+ var An = async (r, e, t, o, n) => {
2531
2543
  try {
2532
2544
  const a = new ur(
2533
2545
  t,
@@ -2559,7 +2571,7 @@ var mr = async (r, e, t) => {
2559
2571
  a.set(T, R);
2560
2572
  i.set(
2561
2573
  T,
2562
- hn(r, e, C, E)
2574
+ yn(r, e, C, E)
2563
2575
  );
2564
2576
  }
2565
2577
  const p = await Promise.all(i.values());
@@ -2590,7 +2602,7 @@ var mr = async (r, e, t) => {
2590
2602
  );
2591
2603
  c.set(
2592
2604
  y,
2593
- yn(
2605
+ An(
2594
2606
  r,
2595
2607
  e,
2596
2608
  E,
@@ -2612,7 +2624,7 @@ var mr = async (r, e, t) => {
2612
2624
 
2613
2625
  // src/smartCheckout/allowance/erc721.ts
2614
2626
  import { Contract as ht } from "ethers";
2615
- var An = async (r, e, t, o) => {
2627
+ var Pn = async (r, e, t, o) => {
2616
2628
  try {
2617
2629
  const n = new ht(
2618
2630
  t,
@@ -2633,7 +2645,7 @@ var An = async (r, e, t, o) => {
2633
2645
  );
2634
2646
  }
2635
2647
  };
2636
- var Pn = async (r, e, t, o, n) => {
2648
+ var wn = async (r, e, t, o, n) => {
2637
2649
  try {
2638
2650
  const a = new ht(
2639
2651
  t,
@@ -2657,7 +2669,7 @@ var Pn = async (r, e, t, o, n) => {
2657
2669
  );
2658
2670
  }
2659
2671
  };
2660
- var wn = async (r, e, t) => {
2672
+ var Sn = async (r, e, t) => {
2661
2673
  try {
2662
2674
  const o = new ht(
2663
2675
  e,
@@ -2695,7 +2707,7 @@ var gr = (r, e) => {
2695
2707
  );
2696
2708
  }
2697
2709
  };
2698
- var Sn = async (r, e, t) => {
2710
+ var kn = async (r, e, t) => {
2699
2711
  const o = /* @__PURE__ */ new Map();
2700
2712
  const n = /* @__PURE__ */ new Map();
2701
2713
  for (const s of e) {
@@ -2704,7 +2716,7 @@ var Sn = async (r, e, t) => {
2704
2716
  const m = `${c}-${p}`;
2705
2717
  o.set(m, false);
2706
2718
  if (n.has(m)) continue;
2707
- n.set(m, An(
2719
+ n.set(m, Pn(
2708
2720
  r,
2709
2721
  t,
2710
2722
  c,
@@ -2725,7 +2737,7 @@ var fr = async (r, e, t) => {
2725
2737
  const i = /* @__PURE__ */ new Map();
2726
2738
  const s = /* @__PURE__ */ new Map();
2727
2739
  const c = /* @__PURE__ */ new Map();
2728
- const p = await Sn(
2740
+ const p = await kn(
2729
2741
  r,
2730
2742
  t,
2731
2743
  e
@@ -2747,7 +2759,7 @@ var fr = async (r, e, t) => {
2747
2759
  a.set(v, C);
2748
2760
  i.set(
2749
2761
  v,
2750
- wn(r, E, _)
2762
+ Sn(r, E, _)
2751
2763
  );
2752
2764
  }
2753
2765
  const m = await Promise.all(i.values());
@@ -2777,7 +2789,7 @@ var fr = async (r, e, t) => {
2777
2789
  );
2778
2790
  c.set(
2779
2791
  w,
2780
- Pn(
2792
+ wn(
2781
2793
  r,
2782
2794
  e,
2783
2795
  T,
@@ -2799,7 +2811,7 @@ var fr = async (r, e, t) => {
2799
2811
 
2800
2812
  // src/smartCheckout/allowance/erc1155.ts
2801
2813
  import { Contract as Er } from "ethers";
2802
- var kn = async (r, e, t, o) => {
2814
+ var vn = async (r, e, t, o) => {
2803
2815
  try {
2804
2816
  const n = new Er(
2805
2817
  t,
@@ -2820,7 +2832,7 @@ var kn = async (r, e, t, o) => {
2820
2832
  );
2821
2833
  }
2822
2834
  };
2823
- var vn = async (r, e, t, o) => {
2835
+ var Nn = async (r, e, t, o) => {
2824
2836
  try {
2825
2837
  const n = new Er(
2826
2838
  t,
@@ -2849,7 +2861,7 @@ var Rr = async (r, e, t) => {
2849
2861
  );
2850
2862
  const n = await Promise.all(
2851
2863
  o.map(async (a) => {
2852
- const i = await kn(
2864
+ const i = await vn(
2853
2865
  r,
2854
2866
  e,
2855
2867
  a.contractAddress,
@@ -2861,7 +2873,7 @@ var Rr = async (r, e, t) => {
2861
2873
  itemRequirement: a
2862
2874
  };
2863
2875
  }
2864
- const s = await vn(
2876
+ const s = await Nn(
2865
2877
  r,
2866
2878
  e,
2867
2879
  a.contractAddress,
@@ -2882,10 +2894,10 @@ var Rr = async (r, e, t) => {
2882
2894
  };
2883
2895
 
2884
2896
  // src/smartCheckout/balanceCheck/balanceCheck.ts
2885
- import { Contract as Bn, formatUnits as Mn } from "ethers";
2897
+ import { Contract as Mn, formatUnits as bn } from "ethers";
2886
2898
 
2887
2899
  // src/smartCheckout/aggregators/balanceAggregator.ts
2888
- var Nn = (r) => {
2900
+ var _n = (r) => {
2889
2901
  const e = /* @__PURE__ */ new Map();
2890
2902
  const t = [];
2891
2903
  r.forEach((o) => {
@@ -2904,7 +2916,7 @@ var Nn = (r) => {
2904
2916
  });
2905
2917
  return t.concat(Array.from(e.values()));
2906
2918
  };
2907
- var _n = (r) => {
2919
+ var On = (r) => {
2908
2920
  const e = /* @__PURE__ */ new Map();
2909
2921
  const t = [];
2910
2922
  r.forEach((o) => {
@@ -2924,7 +2936,7 @@ var _n = (r) => {
2924
2936
  });
2925
2937
  return t.concat(Array.from(e.values()));
2926
2938
  };
2927
- var On = (r) => {
2939
+ var xn = (r) => {
2928
2940
  const e = /* @__PURE__ */ new Map();
2929
2941
  const t = [];
2930
2942
  r.forEach((o) => {
@@ -2940,10 +2952,10 @@ var On = (r) => {
2940
2952
  });
2941
2953
  return t.concat(Array.from(e.values()));
2942
2954
  };
2943
- var Cr = (r) => On(_n(Nn(r)));
2955
+ var Cr = (r) => xn(On(_n(r)));
2944
2956
 
2945
2957
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2946
- import { Contract as xn, formatUnits as Fe } from "ethers";
2958
+ import { Contract as Bn, formatUnits as Fe } from "ethers";
2947
2959
  var Tr = (r) => r.map((e) => {
2948
2960
  switch (e.type) {
2949
2961
  case "ERC20":
@@ -3029,7 +3041,7 @@ var yr = async (r, e, t) => {
3029
3041
  continue;
3030
3042
  }
3031
3043
  try {
3032
- const m = new xn(
3044
+ const m = new Bn(
3033
3045
  n.tokenAddress,
3034
3046
  JSON.stringify(W),
3035
3047
  t
@@ -3125,7 +3137,7 @@ var Ar = (r, e, t) => {
3125
3137
  };
3126
3138
 
3127
3139
  // src/smartCheckout/balanceCheck/balanceCheck.ts
3128
- var bn = async (r, e, t, o, n = false) => {
3140
+ var Ln = async (r, e, t, o, n = false) => {
3129
3141
  try {
3130
3142
  const a = /* @__PURE__ */ new Map();
3131
3143
  Tr(o).forEach(
@@ -3146,13 +3158,13 @@ var bn = async (r, e, t, o, n = false) => {
3146
3158
  );
3147
3159
  }
3148
3160
  };
3149
- var Ln = async (r, e, t) => {
3161
+ var Dn = async (r, e, t) => {
3150
3162
  const o = [];
3151
3163
  const n = /* @__PURE__ */ new Map();
3152
3164
  const a = /* @__PURE__ */ new Map();
3153
3165
  t.forEach((i) => {
3154
3166
  if (i.type !== "ERC721") return;
3155
- const s = new Bn(
3167
+ const s = new Mn(
3156
3168
  i.contractAddress,
3157
3169
  JSON.stringify(ne),
3158
3170
  r
@@ -3211,10 +3223,10 @@ var Pr = async (r, e, t, o, n = false) => {
3211
3223
  }
3212
3224
  const c = [];
3213
3225
  if (i.length > 0) {
3214
- c.push(bn(r, e, t, a, n));
3226
+ c.push(Ln(r, e, t, a, n));
3215
3227
  }
3216
3228
  if (s.length > 0) {
3217
- c.push(Ln(e, t, a));
3229
+ c.push(Dn(e, t, a));
3218
3230
  }
3219
3231
  const p = await Promise.all(c);
3220
3232
  const m = [];
@@ -3238,7 +3250,7 @@ var Pr = async (r, e, t, o, n = false) => {
3238
3250
  R.set(T, {
3239
3251
  ...I,
3240
3252
  balance: v,
3241
- formattedBalance: Mn(v, w.required.token.decimals)
3253
+ formattedBalance: bn(v, w.required.token.decimals)
3242
3254
  });
3243
3255
  });
3244
3256
  }
@@ -3267,7 +3279,7 @@ var wr = async (r, e) => {
3267
3279
  );
3268
3280
  }
3269
3281
  };
3270
- var Dn = (r, e) => {
3282
+ var Wn = (r, e) => {
3271
3283
  if (e.type === "TRANSACTION" || e.gasToken.type === "NATIVE") {
3272
3284
  return {
3273
3285
  type: "NATIVE",
@@ -3305,7 +3317,7 @@ var Sr = async (r, e, t) => {
3305
3317
  n += i;
3306
3318
  });
3307
3319
  if (n === 0n) return null;
3308
- return Dn(n, t);
3320
+ return Wn(n, t);
3309
3321
  };
3310
3322
 
3311
3323
  // src/smartCheckout/routing/geoBlocking.ts
@@ -3459,7 +3471,7 @@ var Ue = async (r, e, t, o, n) => {
3459
3471
  };
3460
3472
 
3461
3473
  // src/smartCheckout/routing/swap/swapRoute.ts
3462
- var Wn = (r, e, t) => {
3474
+ var Fn = (r, e, t) => {
3463
3475
  let o = BigInt(0);
3464
3476
  let n = "0";
3465
3477
  let a;
@@ -3517,7 +3529,7 @@ var Wn = (r, e, t) => {
3517
3529
  swapFees: p
3518
3530
  };
3519
3531
  };
3520
- var Fn = (r, e, t, o) => {
3532
+ var Un = (r, e, t, o) => {
3521
3533
  const n = t.token.address;
3522
3534
  let a = "ERC20";
3523
3535
  if (B(n)) {
@@ -3530,7 +3542,7 @@ var Fn = (r, e, t, o) => {
3530
3542
  type: a,
3531
3543
  fundsRequired: {
3532
3544
  amount: e,
3533
- formattedAmount: Y(Ge(
3545
+ formattedAmount: J(Ge(
3534
3546
  e,
3535
3547
  t.token.decimals
3536
3548
  ))
@@ -3544,7 +3556,7 @@ var Fn = (r, e, t, o) => {
3544
3556
  fees: o
3545
3557
  };
3546
3558
  };
3547
- var Un = (r) => {
3559
+ var Gn = (r) => {
3548
3560
  if (r.type === "ERC20") {
3549
3561
  return !!r.required.token.address;
3550
3562
  }
@@ -3553,7 +3565,7 @@ var Un = (r) => {
3553
3565
  }
3554
3566
  return false;
3555
3567
  };
3556
- var Gn = (r) => {
3568
+ var qn = (r) => {
3557
3569
  let e = "";
3558
3570
  let t = BigInt(0);
3559
3571
  switch (r.type) {
@@ -3569,7 +3581,7 @@ var Gn = (r) => {
3569
3581
  }
3570
3582
  return { address: e, amount: t };
3571
3583
  };
3572
- var qn = (r, e) => {
3584
+ var jn = (r, e) => {
3573
3585
  if (!e) return { sufficient: true, approvalGasFee: BigInt(0), approvalGasTokenAddress: "" };
3574
3586
  const t = e.value;
3575
3587
  const o = e.token.address;
@@ -3593,7 +3605,7 @@ var qn = (r, e) => {
3593
3605
  }
3594
3606
  return { sufficient: true, approvalGasFee: t, approvalGasTokenAddress: o };
3595
3607
  };
3596
- var jn = (r, e, t, o, n) => {
3608
+ var Vn = (r, e, t, o, n) => {
3597
3609
  const a = /* @__PURE__ */ new Map();
3598
3610
  if (e.approvalGasFee > BigInt(0)) {
3599
3611
  a.set(e.approvalGasTokenAddress, e.approvalGasFee);
@@ -3636,7 +3648,7 @@ var jn = (r, e, t, o, n) => {
3636
3648
  }
3637
3649
  return true;
3638
3650
  };
3639
- var Vn = (r, e, t, o, n, a) => {
3651
+ var Kn = (r, e, t, o, n, a) => {
3640
3652
  let i = BigInt(0);
3641
3653
  let s = "";
3642
3654
  let c = false;
@@ -3664,8 +3676,8 @@ var qe = async (r, e, t, o, n, a, i) => {
3664
3676
  const s = [];
3665
3677
  if (!e.swap) return s;
3666
3678
  if (a.length === 0) return s;
3667
- if (!Un(o)) return s;
3668
- const c = Gn(o);
3679
+ if (!Gn(o)) return s;
3680
+ const c = qn(o);
3669
3681
  const p = P(r);
3670
3682
  const m = n.get(p);
3671
3683
  if (!m) return s;
@@ -3688,9 +3700,9 @@ var qe = async (r, e, t, o, n, a, i) => {
3688
3700
  if (!T) continue;
3689
3701
  const y = E.quote.amountWithMaxSlippage;
3690
3702
  if (T.balance < y.value) continue;
3691
- const I = qn(g, E.approval);
3703
+ const I = jn(g, E.approval);
3692
3704
  if (!I.sufficient) continue;
3693
- if (!jn(
3705
+ if (!Vn(
3694
3706
  g,
3695
3707
  I,
3696
3708
  E.swap,
@@ -3700,7 +3712,7 @@ var qe = async (r, e, t, o, n, a, i) => {
3700
3712
  address: C
3701
3713
  }
3702
3714
  )) continue;
3703
- if (!Vn(
3715
+ if (!Kn(
3704
3716
  T.balance,
3705
3717
  i,
3706
3718
  C,
@@ -3708,9 +3720,9 @@ var qe = async (r, e, t, o, n, a, i) => {
3708
3720
  I,
3709
3721
  E.quote.fees
3710
3722
  )) continue;
3711
- const w = Wn(E.approval, E.swap, E.quote.fees);
3723
+ const w = Fn(E.approval, E.swap, E.quote.fees);
3712
3724
  s.push(
3713
- Fn(
3725
+ Un(
3714
3726
  p,
3715
3727
  y.value,
3716
3728
  T,
@@ -3751,7 +3763,7 @@ var Pt = async (r, e, t) => {
3751
3763
  }
3752
3764
  return [];
3753
3765
  };
3754
- var Kn = async (r, e, t) => {
3766
+ var Hn = async (r, e, t) => {
3755
3767
  if (t.swap) {
3756
3768
  const o = (await z(r, { type: "swap" })).tokens;
3757
3769
  const n = e.get(P(r));
@@ -3761,14 +3773,14 @@ var Kn = async (r, e, t) => {
3761
3773
  };
3762
3774
  var xr = async (r, e, t) => {
3763
3775
  const o = {};
3764
- o.swap = await Kn(r, e, t);
3776
+ o.swap = await Hn(r, e, t);
3765
3777
  o.bridge = await Pt(r, e, t);
3766
3778
  o.onRamp = await At(r, t);
3767
3779
  return o;
3768
3780
  };
3769
3781
 
3770
3782
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
3771
- import { formatUnits as ea } from "ethers";
3783
+ import { formatUnits as ta } from "ethers";
3772
3784
 
3773
3785
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3774
3786
  import { formatUnits as Ve } from "ethers";
@@ -3784,7 +3796,7 @@ var Br = (r) => {
3784
3796
  };
3785
3797
 
3786
3798
  // src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
3787
- import { BridgeFeeActions as Hn } from "@imtbl/bridge-sdk";
3799
+ import { BridgeFeeActions as zn } from "@imtbl/bridge-sdk";
3788
3800
  var Mr = async (r, e, t, o) => {
3789
3801
  const n = Me(
3790
3802
  t,
@@ -3795,7 +3807,7 @@ var Mr = async (r, e, t, o) => {
3795
3807
  try {
3796
3808
  const a = await n.getFee(
3797
3809
  {
3798
- action: Hn.DEPOSIT,
3810
+ action: zn.DEPOSIT,
3799
3811
  gasMultiplier: "auto",
3800
3812
  sourceChainId: t.toString(),
3801
3813
  destinationChainId: o.toString()
@@ -3816,13 +3828,13 @@ var Mr = async (r, e, t, o) => {
3816
3828
 
3817
3829
  // src/smartCheckout/routing/indexer/fetchL1Representation.ts
3818
3830
  var X = "0x0000000000000000000000000000000000000eee";
3819
- var zn = (r) => {
3831
+ var Qn = (r) => {
3820
3832
  if (r === 13371) return "imtbl-zkevm-mainnet";
3821
3833
  if (r === 13473) return "imtbl-zkevm-testnet";
3822
3834
  if (r === 15003) return "imtbl-zkevm-devnet";
3823
3835
  return "";
3824
3836
  };
3825
- var Qn = async (r, e) => {
3837
+ var Zn = async (r, e) => {
3826
3838
  const t = await e.remote.getConfig(
3827
3839
  "imxAddressMapping"
3828
3840
  );
@@ -3831,11 +3843,11 @@ var Qn = async (r, e) => {
3831
3843
  var je = async (r, e) => {
3832
3844
  if (B(e)) {
3833
3845
  return {
3834
- l1address: await Qn(O(r), r),
3846
+ l1address: await Zn(O(r), r),
3835
3847
  l2address: x
3836
3848
  };
3837
3849
  }
3838
- const t = zn(P(r));
3850
+ const t = Qn(P(r));
3839
3851
  const o = be(r);
3840
3852
  const n = await o.getToken({
3841
3853
  chainName: t,
@@ -3856,7 +3868,7 @@ var je = async (r, e) => {
3856
3868
  };
3857
3869
 
3858
3870
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3859
- var Zn = (r, e) => {
3871
+ var Jn = (r, e) => {
3860
3872
  const t = Br(r);
3861
3873
  return t >= e;
3862
3874
  };
@@ -3902,7 +3914,7 @@ var Lr = (r, e, t, o, n) => ({
3902
3914
  type: o,
3903
3915
  fundsRequired: {
3904
3916
  amount: t.amount,
3905
- formattedAmount: Y(t.formattedAmount)
3917
+ formattedAmount: J(t.formattedAmount)
3906
3918
  },
3907
3919
  userBalance: {
3908
3920
  balance: e.balance,
@@ -3955,7 +3967,7 @@ var Ke = async (r, e, t, o, n) => {
3955
3967
  imtblFee: y,
3956
3968
  totalFees: I
3957
3969
  } = R;
3958
- if (!Zn(c, I)) return void 0;
3970
+ if (!Jn(c, I)) return void 0;
3959
3971
  if (B(f)) {
3960
3972
  const v = c.balances.find((_) => B(_.token.address));
3961
3973
  if (v && v.balance >= o.amount + I) {
@@ -4004,7 +4016,7 @@ var Dr = (r, e) => {
4004
4016
 
4005
4017
  // src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.ts
4006
4018
  import { formatUnits as Yn } from "ethers";
4007
- var Jn = (r, e) => {
4019
+ var $n = (r, e) => {
4008
4020
  let t = BigInt(0);
4009
4021
  r.quote.fees.forEach((o) => {
4010
4022
  if (h(o.amount.token.address, e)) {
@@ -4018,7 +4030,7 @@ var Jn = (r, e) => {
4018
4030
  }
4019
4031
  return t;
4020
4032
  };
4021
- var $n = (r, e) => {
4033
+ var Xn = (r, e) => {
4022
4034
  for (const t of r.balanceRequirements) {
4023
4035
  if (t.type === "NATIVE" || t.type === "ERC20") {
4024
4036
  if (h(t.required.token.address, e)) {
@@ -4028,7 +4040,7 @@ var $n = (r, e) => {
4028
4040
  }
4029
4041
  return BigInt(0);
4030
4042
  };
4031
- var Xn = (r, e, t) => {
4043
+ var ea = (r, e, t) => {
4032
4044
  const o = t?.balance ?? BigInt(0);
4033
4045
  if (o >= r + e) {
4034
4046
  return BigInt(0);
@@ -4060,13 +4072,13 @@ var Wr = (r, e, t, o, n) => {
4060
4072
  });
4061
4073
  if (!f) continue;
4062
4074
  const R = s.quote.amountWithMaxSlippage.value;
4063
- const C = Jn(s, i);
4075
+ const C = $n(s, i);
4064
4076
  const E = R + C;
4065
- const T = $n(
4077
+ const T = Xn(
4066
4078
  n,
4067
4079
  i
4068
4080
  );
4069
- const y = Xn(E, T, c);
4081
+ const y = ea(E, T, c);
4070
4082
  if (y <= 0) {
4071
4083
  continue;
4072
4084
  }
@@ -4075,7 +4087,7 @@ var Wr = (r, e, t, o, n) => {
4075
4087
  }
4076
4088
  a.push({
4077
4089
  amount: y,
4078
- formattedAmount: Y(Yn(y, f.token.decimals)),
4090
+ formattedAmount: J(Yn(y, f.token.decimals)),
4079
4091
  // L2 address is used for the bridge requirement as the bridge route uses the indexer to find L1 address
4080
4092
  l2address: g
4081
4093
  });
@@ -4111,7 +4123,7 @@ var Ur = async (r, e, t, o, n) => {
4111
4123
  };
4112
4124
 
4113
4125
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
4114
- var ta = (r, e, t, o, n, a) => {
4126
+ var ra = (r, e, t, o, n, a) => {
4115
4127
  if (r.length === 0) return true;
4116
4128
  if (e.length === 0) return true;
4117
4129
  if (t.length === 0) return true;
@@ -4122,7 +4134,7 @@ var ta = (r, e, t, o, n, a) => {
4122
4134
  if (a === "") return true;
4123
4135
  return false;
4124
4136
  };
4125
- var ra = (r, e, t, o) => {
4137
+ var oa = (r, e, t, o) => {
4126
4138
  const n = [];
4127
4139
  for (const a of o) {
4128
4140
  if (!e.includes(a.l1address)) continue;
@@ -4135,7 +4147,7 @@ var ra = (r, e, t, o) => {
4135
4147
  }
4136
4148
  return n;
4137
4149
  };
4138
- var oa = (r, e, t, o, n) => {
4150
+ var na = (r, e, t, o, n) => {
4139
4151
  const a = /* @__PURE__ */ new Map();
4140
4152
  for (const [c, p] of e) {
4141
4153
  a.set(c, {
@@ -4158,7 +4170,7 @@ var oa = (r, e, t, o, n) => {
4158
4170
  const C = n.find((E) => h(E.address, m));
4159
4171
  i.set(m, {
4160
4172
  balance: R,
4161
- formattedBalance: ea(
4173
+ formattedBalance: ta(
4162
4174
  R,
4163
4175
  C.decimals
4164
4176
  ),
@@ -4175,7 +4187,7 @@ var oa = (r, e, t, o, n) => {
4175
4187
  );
4176
4188
  return a;
4177
4189
  };
4178
- var na = (r, e) => {
4190
+ var aa = (r, e) => {
4179
4191
  const t = [];
4180
4192
  for (const o of e) {
4181
4193
  const { chainId: n, fundingItem: a } = o;
@@ -4197,7 +4209,7 @@ var na = (r, e) => {
4197
4209
  }
4198
4210
  return t;
4199
4211
  };
4200
- var aa = (r, e, t) => {
4212
+ var ia = (r, e, t) => {
4201
4213
  const o = [];
4202
4214
  for (const n of r) {
4203
4215
  if (!n) continue;
@@ -4227,7 +4239,7 @@ var aa = (r, e, t) => {
4227
4239
  var Gr = async (r, e, t, o, n, a, i, s, c) => {
4228
4240
  const { l1balances: p, l2balances: m } = Dr(r, a);
4229
4241
  const g = o.required.token.address;
4230
- if (ta(
4242
+ if (ra(
4231
4243
  i,
4232
4244
  s,
4233
4245
  p,
@@ -4236,7 +4248,7 @@ var Gr = async (r, e, t, o, n, a, i, s, c) => {
4236
4248
  g
4237
4249
  )) return [];
4238
4250
  const f = await Fr(r, s);
4239
- const R = ra(
4251
+ const R = oa(
4240
4252
  g,
4241
4253
  i,
4242
4254
  s,
@@ -4296,7 +4308,7 @@ var Gr = async (r, e, t, o, n, a, i, s, c) => {
4296
4308
  });
4297
4309
  if (_.length === 0) return [];
4298
4310
  if (I.length === 0) return [];
4299
- const Q = oa(
4311
+ const Q = na(
4300
4312
  r,
4301
4313
  a,
4302
4314
  m,
@@ -4313,11 +4325,11 @@ var Gr = async (r, e, t, o, n, a, i, s, c) => {
4313
4325
  c
4314
4326
  );
4315
4327
  if (!le) return [];
4316
- const ee = na(
4328
+ const ee = aa(
4317
4329
  a,
4318
4330
  le
4319
4331
  );
4320
- return aa(
4332
+ return ia(
4321
4333
  w,
4322
4334
  ee,
4323
4335
  f
@@ -4345,7 +4357,7 @@ var qr = async (r, e, t) => {
4345
4357
  type: B(o.token.address) ? "NATIVE" : "ERC20",
4346
4358
  fundsRequired: {
4347
4359
  amount: a.balance,
4348
- formattedAmount: Y(a.formattedBalance)
4360
+ formattedAmount: J(a.formattedBalance)
4349
4361
  },
4350
4362
  userBalance: {
4351
4363
  balance: n.balance,
@@ -4357,8 +4369,8 @@ var qr = async (r, e, t) => {
4357
4369
  };
4358
4370
 
4359
4371
  // src/smartCheckout/routing/routingCalculator.ts
4360
- var ia = (r) => r.bridge || r.swap || r.onRamp;
4361
- var sa = (r) => {
4372
+ var sa = (r) => r.bridge || r.swap || r.onRamp;
4373
+ var ca = (r) => {
4362
4374
  let e = 0;
4363
4375
  let t;
4364
4376
  for (const o of r.balanceRequirements) {
@@ -4370,7 +4382,7 @@ var sa = (r) => {
4370
4382
  if (e === 1) return t;
4371
4383
  return void 0;
4372
4384
  };
4373
- var ca = async (r, e, t, o, n) => {
4385
+ var da = async (r, e, t, o, n) => {
4374
4386
  let a;
4375
4387
  if (o === void 0) return void 0;
4376
4388
  if (o.type !== "NATIVE" && o.type !== "ERC20") {
@@ -4392,7 +4404,7 @@ var ca = async (r, e, t, o, n) => {
4392
4404
  }
4393
4405
  return a;
4394
4406
  };
4395
- var da = async (r, e, t, o, n, a, i) => {
4407
+ var la = async (r, e, t, o, n, a, i) => {
4396
4408
  const s = [];
4397
4409
  if (!e.swap) return s;
4398
4410
  if (t === void 0) return s;
@@ -4413,7 +4425,7 @@ var da = async (r, e, t, o, n, a, i) => {
4413
4425
  i
4414
4426
  );
4415
4427
  };
4416
- var la = async (r, e, t, o, n, a, i, s) => {
4428
+ var pa = async (r, e, t, o, n, a, i, s) => {
4417
4429
  if (!o) return [];
4418
4430
  const c = a.get(O(r));
4419
4431
  const p = a.get(P(r));
@@ -4443,7 +4455,7 @@ var la = async (r, e, t, o, n, a, i, s) => {
4443
4455
  );
4444
4456
  return R;
4445
4457
  };
4446
- var pa = async (r, e, t) => {
4458
+ var ua = async (r, e, t) => {
4447
4459
  if (!e.onRamp) return void 0;
4448
4460
  if (t === void 0) return void 0;
4449
4461
  const o = await qr(
@@ -4472,7 +4484,7 @@ var ze = (r, e, t, o) => {
4472
4484
  o?.(a);
4473
4485
  };
4474
4486
  var jr = async (r, e, t, o, n) => {
4475
- if (!ia(o)) {
4487
+ if (!sa(o)) {
4476
4488
  return {
4477
4489
  type: "NO_ROUTE_OPTIONS",
4478
4490
  message: "No routing options are available"
@@ -4503,12 +4515,12 @@ var jr = async (r, e, t, o, n) => {
4503
4515
  "Time to get routing allowlist",
4504
4516
  xr(r, i, o)
4505
4517
  );
4506
- const c = sa(t);
4518
+ const c = ca(t);
4507
4519
  const p = [];
4508
4520
  const m = [];
4509
4521
  if (o.swap) {
4510
4522
  p.push(
4511
- da(
4523
+ la(
4512
4524
  r,
4513
4525
  o,
4514
4526
  c,
@@ -4530,7 +4542,7 @@ var jr = async (r, e, t, o, n) => {
4530
4542
  }
4531
4543
  if (o.bridge) {
4532
4544
  p.push(
4533
- ca(
4545
+ da(
4534
4546
  r,
4535
4547
  a,
4536
4548
  o,
@@ -4548,7 +4560,7 @@ var jr = async (r, e, t, o, n) => {
4548
4560
  }
4549
4561
  if (o.onRamp) {
4550
4562
  p.push(
4551
- pa(
4563
+ ua(
4552
4564
  r,
4553
4565
  o,
4554
4566
  c
@@ -4564,7 +4576,7 @@ var jr = async (r, e, t, o, n) => {
4564
4576
  }
4565
4577
  if (o.swap && o.bridge) {
4566
4578
  p.push(
4567
- la(
4579
+ pa(
4568
4580
  r,
4569
4581
  a,
4570
4582
  o,
@@ -4603,7 +4615,7 @@ var jr = async (r, e, t, o, n) => {
4603
4615
  };
4604
4616
 
4605
4617
  // src/smartCheckout/smartCheckout.ts
4606
- var ua = (r) => {
4618
+ var ma = (r) => {
4607
4619
  const e = r.balanceRequirements.map(
4608
4620
  (t) => {
4609
4621
  if (t.type === "ERC20" && t.sufficient) {
@@ -4625,7 +4637,7 @@ var ua = (r) => {
4625
4637
  };
4626
4638
  };
4627
4639
  var Vr = async (r, e, t, o, n, a, i, s, c) => {
4628
- const p = !i || t && s ? ua(a) : a;
4640
+ const p = !i || t && s ? ma(a) : a;
4629
4641
  const m = await k(
4630
4642
  r,
4631
4643
  "Total time to run the routing calculator",
@@ -4748,24 +4760,24 @@ var de = async (r, e, t, o, n, a, i, s = false) => {
4748
4760
 
4749
4761
  // src/smartCheckout/buy/buy.ts
4750
4762
  import {
4751
- constants as ha,
4752
- OrderStatusName as ya
4763
+ constants as ya,
4764
+ OrderStatusName as Aa
4753
4765
  } from "@imtbl/orderbook";
4754
- import { track as Aa } from "@imtbl/metrics";
4766
+ import { track as Pa } from "@imtbl/metrics";
4755
4767
 
4756
4768
  // src/transaction/transaction.ts
4757
4769
  function wt(r) {
4758
4770
  return r?.ethereumProvider?.isPassport === true;
4759
4771
  }
4760
- function ga(r) {
4772
+ function fa(r) {
4761
4773
  return wt(r);
4762
4774
  }
4763
- var fa = async (r, e) => {
4775
+ var Ea = async (r, e) => {
4764
4776
  const t = e;
4765
4777
  const { chainId: o } = await r.getNetwork();
4766
- if (!Yt(Number(o))) return t;
4778
+ if (!Jt(Number(o))) return t;
4767
4779
  if (typeof t.gasPrice !== "undefined") return t;
4768
- if (ga(r)) {
4780
+ if (fa(r)) {
4769
4781
  t.gasPrice = BigInt(0);
4770
4782
  } else {
4771
4783
  t.maxFeePerGas = at.maxFeePerGas;
@@ -4797,7 +4809,7 @@ var St = (r) => {
4797
4809
  var U = async (r, e) => {
4798
4810
  try {
4799
4811
  const t = await r.getSigner();
4800
- const o = await fa(r, e);
4812
+ const o = await Ea(r, e);
4801
4813
  const n = await t.sendTransaction(o);
4802
4814
  return {
4803
4815
  transactionResponse: n
@@ -4885,9 +4897,9 @@ var Kr = async (r, e) => {
4885
4897
 
4886
4898
  // src/smartCheckout/actions/getUnsignedActions.ts
4887
4899
  import {
4888
- TransactionPurpose as Ye,
4889
- ActionType as Je,
4890
- SignablePurpose as Ra
4900
+ TransactionPurpose as Je,
4901
+ ActionType as Ye,
4902
+ SignablePurpose as Ca
4891
4903
  } from "@imtbl/orderbook";
4892
4904
  var Hr = async (r) => {
4893
4905
  let e = [];
@@ -4895,11 +4907,11 @@ var Hr = async (r) => {
4895
4907
  const o = [];
4896
4908
  const n = [];
4897
4909
  for (const a of r) {
4898
- if (a.type !== Je.TRANSACTION) continue;
4899
- if (a.purpose === Ye.APPROVAL) {
4910
+ if (a.type !== Ye.TRANSACTION) continue;
4911
+ if (a.purpose === Je.APPROVAL) {
4900
4912
  o.push(a.buildTransaction());
4901
4913
  }
4902
- if (a.purpose === Ye.FULFILL_ORDER) {
4914
+ if (a.purpose === Je.FULFILL_ORDER) {
4903
4915
  n.push(a.buildTransaction());
4904
4916
  }
4905
4917
  }
@@ -4914,8 +4926,8 @@ var zr = async (r) => {
4914
4926
  let e = [];
4915
4927
  const t = [];
4916
4928
  for (const o of r) {
4917
- if (o.type !== Je.TRANSACTION) continue;
4918
- if (o.purpose === Ye.APPROVAL) {
4929
+ if (o.type !== Ye.TRANSACTION) continue;
4930
+ if (o.purpose === Je.APPROVAL) {
4919
4931
  t.push(o.buildTransaction());
4920
4932
  }
4921
4933
  }
@@ -4926,8 +4938,8 @@ var vt = async (r) => {
4926
4938
  let e = [];
4927
4939
  const t = [];
4928
4940
  for (const o of r) {
4929
- if (o.type !== Je.TRANSACTION) continue;
4930
- if (o.purpose === Ye.FULFILL_ORDER) {
4941
+ if (o.type !== Ye.TRANSACTION) continue;
4942
+ if (o.purpose === Je.FULFILL_ORDER) {
4931
4943
  t.push(o.buildTransaction());
4932
4944
  }
4933
4945
  }
@@ -4937,8 +4949,8 @@ var vt = async (r) => {
4937
4949
  var Qr = (r, e, t) => {
4938
4950
  let o;
4939
4951
  for (const n of t) {
4940
- if (n.type !== Je.SIGNABLE) continue;
4941
- if (n.purpose === Ra.CREATE_LISTING) {
4952
+ if (n.type !== Ye.SIGNABLE) continue;
4953
+ if (n.purpose === Ca.CREATE_LISTING) {
4942
4954
  o = {
4943
4955
  domain: n.message.domain,
4944
4956
  types: n.message.types,
@@ -4955,18 +4967,18 @@ var Qr = (r, e, t) => {
4955
4967
  };
4956
4968
 
4957
4969
  // src/smartCheckout/fees/fees.ts
4958
- import { parseUnits as Ca } from "ethers";
4970
+ import { parseUnits as Ta } from "ethers";
4959
4971
  var Zr = 1;
4960
4972
  var $e = 6;
4961
- var Ta = (r, e, t = BigInt(1)) => {
4973
+ var Ia = (r, e, t = BigInt(1)) => {
4962
4974
  const o = r.amount;
4963
4975
  const n = Math.round(o.percentageDecimal * 10 ** $e);
4964
4976
  const a = e * BigInt(n) / BigInt(10 ** $e);
4965
4977
  return a - a % t;
4966
4978
  };
4967
- var Ia = (r, e) => {
4979
+ var ha = (r, e) => {
4968
4980
  const t = r.amount;
4969
- const o = Ca(t.token, e);
4981
+ const o = Ta(t.token, e);
4970
4982
  return o;
4971
4983
  };
4972
4984
  var Xe = (r, e, t = 18, o = BigInt(1)) => {
@@ -4977,10 +4989,10 @@ var Xe = (r, e, t = 18, o = BigInt(1)) => {
4977
4989
  for (const c of r) {
4978
4990
  let p = BigInt(0);
4979
4991
  if (Object.hasOwn(c.amount, "percentageDecimal")) {
4980
- p = Ta(c, a, o);
4992
+ p = Ia(c, a, o);
4981
4993
  n += p;
4982
4994
  } else if (Object.hasOwn(c.amount, "token")) {
4983
- p = Ia(c, t);
4995
+ p = ha(c, t);
4984
4996
  n += p;
4985
4997
  } else {
4986
4998
  throw new u(
@@ -5005,7 +5017,7 @@ var Xe = (r, e, t = 18, o = BigInt(1)) => {
5005
5017
  };
5006
5018
 
5007
5019
  // src/smartCheckout/buy/buy.ts
5008
- var Pa = (r, e, t, o, n = false) => {
5020
+ var wa = (r, e, t, o, n = false) => {
5009
5021
  switch (r) {
5010
5022
  case "ERC20":
5011
5023
  return {
@@ -5024,7 +5036,7 @@ var Pa = (r, e, t, o, n = false) => {
5024
5036
  };
5025
5037
  }
5026
5038
  };
5027
- var wa = (r, e) => {
5039
+ var Sa = (r, e) => {
5028
5040
  if (e.length > 0) {
5029
5041
  return {
5030
5042
  type: "TRANSACTION",
@@ -5039,10 +5051,10 @@ var wa = (r, e) => {
5039
5051
  }
5040
5052
  };
5041
5053
  };
5042
- var Yr = async (r, e, t, o = {
5054
+ var Jr = async (r, e, t, o = {
5043
5055
  waitFulfillmentSettlements: true
5044
5056
  }) => {
5045
- Aa("checkout_sdk", "buy_initiated");
5057
+ Pa("checkout_sdk", "buy_initiated");
5046
5058
  if (t.length === 0) {
5047
5059
  throw new u(
5048
5060
  "No orders were provided to the orders array. Please provide at least one order.",
@@ -5052,7 +5064,7 @@ var Yr = async (r, e, t, o = {
5052
5064
  let n;
5053
5065
  let a = "";
5054
5066
  let i = 18;
5055
- const s = ha.estimatedFulfillmentGasGwei;
5067
+ const s = ya.estimatedFulfillmentGasGwei;
5056
5068
  const c = se(r);
5057
5069
  const p = be(r);
5058
5070
  const m = await k(
@@ -5127,7 +5139,7 @@ var Yr = async (r, e, t, o = {
5127
5139
  } catch (N) {
5128
5140
  const te = (performance.now() - v) / 1e3;
5129
5141
  lt(r, "Time to call fulfillOrder from the orderbook", te);
5130
- if (N.message.includes(ya.EXPIRED)) {
5142
+ if (N.message.includes(Aa.EXPIRED)) {
5131
5143
  throw new u("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: g });
5132
5144
  }
5133
5145
  if (!N.message.includes("The fulfiller does not have the balances needed to fulfill")) {
@@ -5185,7 +5197,7 @@ var Yr = async (r, e, t, o = {
5185
5197
  _ = _ * BigInt(R) / BigInt(n.result.sell[0].amount);
5186
5198
  }
5187
5199
  const tt = [
5188
- Pa(Q, le, _, a)
5200
+ wa(Q, le, _, a)
5189
5201
  ];
5190
5202
  const K = await k(
5191
5203
  r,
@@ -5194,7 +5206,7 @@ var Yr = async (r, e, t, o = {
5194
5206
  r,
5195
5207
  e,
5196
5208
  tt,
5197
- wa(
5209
+ Sa(
5198
5210
  s,
5199
5211
  I
5200
5212
  )
@@ -5264,7 +5276,7 @@ var Yr = async (r, e, t, o = {
5264
5276
  };
5265
5277
 
5266
5278
  // src/smartCheckout/cancel/cancel.ts
5267
- var ka = async (r, e, t, o, n) => {
5279
+ var va = async (r, e, t, o, n) => {
5268
5280
  let a;
5269
5281
  if (o.length === 0) {
5270
5282
  throw new u(
@@ -5331,7 +5343,7 @@ var ka = async (r, e, t, o, n) => {
5331
5343
  transactions: s
5332
5344
  };
5333
5345
  };
5334
- var va = async (r, e, t) => {
5346
+ var Na = async (r, e, t) => {
5335
5347
  try {
5336
5348
  const o = await e.getSigner();
5337
5349
  const n = await o.getAddress();
@@ -5377,15 +5389,15 @@ var va = async (r, e, t) => {
5377
5389
  );
5378
5390
  }
5379
5391
  };
5380
- var Jr = async (r, e, t, o = {
5392
+ var Yr = async (r, e, t, o = {
5381
5393
  waitFulfillmentSettlements: true,
5382
5394
  useGaslessCancel: false
5383
5395
  }) => {
5384
5396
  const n = se(r);
5385
5397
  if (o.useGaslessCancel) {
5386
- return await va(n, e, t);
5398
+ return await Na(n, e, t);
5387
5399
  }
5388
- return await ka(
5400
+ return await va(
5389
5401
  r,
5390
5402
  n,
5391
5403
  e,
@@ -5424,26 +5436,26 @@ async function Xr(r, e) {
5424
5436
  }
5425
5437
 
5426
5438
  // src/smartCheckout/sell/sell.ts
5427
- import { Contract as _a, parseUnits as Oa } from "ethers";
5439
+ import { Contract as Oa, parseUnits as xa } from "ethers";
5428
5440
  import {
5429
- constants as xa
5441
+ constants as Ba
5430
5442
  } from "@imtbl/orderbook";
5431
- import { track as Ba } from "@imtbl/metrics";
5432
- var Ma = (r, e, t) => ({
5443
+ import { track as Ma } from "@imtbl/metrics";
5444
+ var ba = (r, e, t) => ({
5433
5445
  type: "ERC721",
5434
5446
  id: r,
5435
5447
  contractAddress: e,
5436
5448
  spenderAddress: t
5437
5449
  });
5438
- var ba = (r, e, t, o) => ({
5450
+ var La = (r, e, t, o) => ({
5439
5451
  type: "ERC1155",
5440
5452
  id: r,
5441
5453
  contractAddress: e,
5442
5454
  spenderAddress: t,
5443
5455
  amount: BigInt(o)
5444
5456
  });
5445
- var La = (r, e = 18) => {
5446
- const t = Oa(r.amount, e);
5457
+ var Da = (r, e = 18) => {
5458
+ const t = xa(r.amount, e);
5447
5459
  if (r.type === "NATIVE") {
5448
5460
  return {
5449
5461
  type: "NATIVE",
@@ -5460,7 +5472,7 @@ var eo = async (r, e, t) => {
5460
5472
  let o;
5461
5473
  let n;
5462
5474
  let a = "";
5463
- Ba("checkout_sdk", "sell_initiated");
5475
+ Ma("checkout_sdk", "sell_initiated");
5464
5476
  if (t.length === 0) {
5465
5477
  throw new u(
5466
5478
  "No orders were provided to the orders array. Please provide at least one order.",
@@ -5475,7 +5487,7 @@ var eo = async (r, e, t) => {
5475
5487
  } = t[0];
5476
5488
  let m = 18;
5477
5489
  if (i.type === "ERC20") {
5478
- const E = new _a(
5490
+ const E = new Oa(
5479
5491
  i.tokenAddress,
5480
5492
  JSON.stringify(W),
5481
5493
  e
@@ -5486,7 +5498,7 @@ var eo = async (r, e, t) => {
5486
5498
  E.decimals()
5487
5499
  );
5488
5500
  }
5489
- const g = La(i, m);
5501
+ const g = Da(i, m);
5490
5502
  const f = "type" in s;
5491
5503
  try {
5492
5504
  const E = await k(
@@ -5530,7 +5542,7 @@ var eo = async (r, e, t) => {
5530
5542
  }
5531
5543
  const R = [];
5532
5544
  if (f && s.type === "ERC1155") {
5533
- const E = ba(
5545
+ const E = La(
5534
5546
  s.id,
5535
5547
  s.collectionAddress,
5536
5548
  a,
@@ -5538,7 +5550,7 @@ var eo = async (r, e, t) => {
5538
5550
  );
5539
5551
  R.push(E);
5540
5552
  } else {
5541
- const E = Ma(s.id, s.collectionAddress, a);
5553
+ const E = ba(s.id, s.collectionAddress, a);
5542
5554
  R.push(E);
5543
5555
  }
5544
5556
  let C;
@@ -5554,7 +5566,7 @@ var eo = async (r, e, t) => {
5554
5566
  type: "GAS",
5555
5567
  gasToken: {
5556
5568
  type: "NATIVE",
5557
- limit: BigInt(xa.estimatedFulfillmentGasGwei)
5569
+ limit: BigInt(Ba.estimatedFulfillmentGasGwei)
5558
5570
  }
5559
5571
  }
5560
5572
  )
@@ -5744,7 +5756,7 @@ async function oo(r) {
5744
5756
  }
5745
5757
 
5746
5758
  // src/riskAssessment/riskAssessment.ts
5747
- import Ua from "axios";
5759
+ import Ga from "axios";
5748
5760
  var _t = async (r, e) => {
5749
5761
  const t = Object.fromEntries(
5750
5762
  r.map((n) => [n.toLowerCase(), { sanctioned: false }])
@@ -5755,7 +5767,7 @@ var _t = async (r, e) => {
5755
5767
  }
5756
5768
  try {
5757
5769
  const n = o?.levels.map((i) => i.toLowerCase()) ?? [];
5758
- const a = await Ua.post(
5770
+ const a = await Ga.post(
5759
5771
  `${q[e.environment]}/v1/sanctions/check`,
5760
5772
  {
5761
5773
  addresses: r
@@ -5780,9 +5792,9 @@ var Ot = (r, e) => {
5780
5792
  };
5781
5793
 
5782
5794
  // src/sdk.ts
5783
- var qa = {
5795
+ var ja = {
5784
5796
  baseConfig: {
5785
- environment: Ga.SANDBOX
5797
+ environment: qa.SANDBOX
5786
5798
  },
5787
5799
  passport: void 0
5788
5800
  };
@@ -5797,7 +5809,7 @@ var xt = class {
5797
5809
  * Constructs a new instance of the CheckoutModule class.
5798
5810
  * @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
5799
5811
  */
5800
- constructor(e = qa) {
5812
+ constructor(e = ja) {
5801
5813
  this.httpClient = new pe(e);
5802
5814
  this.config = new he(e, this.httpClient);
5803
5815
  this.fiatRampService = new Be(this.config);
@@ -6116,7 +6128,7 @@ var xt = class {
6116
6128
  this.config,
6117
6129
  e.provider
6118
6130
  );
6119
- return await Yr(
6131
+ return await Jr(
6120
6132
  this.config,
6121
6133
  t,
6122
6134
  e.orders,
@@ -6158,7 +6170,7 @@ var xt = class {
6158
6170
  this.config,
6159
6171
  e.provider
6160
6172
  );
6161
- return await Jr(
6173
+ return await Yr(
6162
6174
  this.config,
6163
6175
  t,
6164
6176
  e.orderIds,
@@ -6343,7 +6355,7 @@ export {
6343
6355
  To as AddTokensEventType,
6344
6356
  et as BlockExplorerService,
6345
6357
  uo as BridgeEventType,
6346
- J as ChainId,
6358
+ Y as ChainId,
6347
6359
  ot as ChainName,
6348
6360
  Ae as ChainSlug,
6349
6361
  xt as Checkout,
@@ -6353,11 +6365,11 @@ export {
6353
6365
  fe as CheckoutStatus,
6354
6366
  fo as CommerceEventType,
6355
6367
  Ro as CommerceFailureEventType,
6356
- Po as CommerceFlowType,
6368
+ wo as CommerceFlowType,
6357
6369
  Eo as CommerceSuccessEventType,
6358
6370
  Co as CommerceUserActionEventType,
6359
6371
  io as ConnectEventType,
6360
- yo as ConnectTargetLayer,
6372
+ Ao as ConnectTargetLayer,
6361
6373
  jt as ExchangeType,
6362
6374
  Ne as FeeType,
6363
6375
  Ce as FundingStepType,
@@ -6374,21 +6386,22 @@ export {
6374
6386
  st as RoutingOutcomeType,
6375
6387
  lo as SaleEventType,
6376
6388
  po as SalePaymentTypes,
6377
- Ao as SwapDirection,
6389
+ Po as SwapDirection,
6378
6390
  co as SwapEventType,
6379
6391
  ae as TokenFilterTypes,
6380
6392
  Ee as TransactionOrGasType,
6393
+ ho as TransferEventType,
6381
6394
  so as WalletEventType,
6382
6395
  Ut as WalletFilterTypes,
6383
6396
  ge as WalletProviderName,
6384
6397
  Gt as WalletProviderRdns,
6385
- wo as WidgetTheme,
6386
- ho as WidgetType,
6398
+ So as WidgetTheme,
6399
+ yo as WidgetType,
6387
6400
  D as WrappedBrowserProvider,
6388
6401
  _t as fetchRiskAssessment,
6389
6402
  Rt as getGasPriceInWei,
6390
- un as getMetaMaskProviderDetail,
6391
- pn as getPassportProviderDetail,
6403
+ mn as getMetaMaskProviderDetail,
6404
+ un as getPassportProviderDetail,
6392
6405
  Te as getUnderlyingChainId,
6393
6406
  Ot as isAddressSanctioned,
6394
6407
  Le as metaMaskProviderInfo,