@imtbl/checkout-sdk 2.1.0 → 2.1.1-alpha.1

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,75 +1,75 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5;// src/widgets/definitions/events/widgets.ts
2
- var ln = /* @__PURE__ */ ((u) => {
3
- u["IMTBL_WIDGETS_PROVIDER"] = "imtbl-widgets-provider";
4
- u["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
5
- u["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
6
- u["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
7
- u["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
8
- u["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
9
- u["IMTBL_SALE_WIDGET_EVENT"] = "imtbl-sale-widget";
10
- u["IMTBL_COMMERCE_WIDGET_EVENT"] = "imtbl-commerce-widget";
11
- u["IMTBL_ADD_TOKENS_WIDGET_EVENT"] = "imtbl-add-tokens-widget";
12
- u["IMTBL_PURCHASE_WIDGET_EVENT"] = "imtbl-purchase-widget";
13
- return u;
14
- })(ln || {});
15
- var un = /* @__PURE__ */ ((e) => {
2
+ var rn = /* @__PURE__ */ ((p) => {
3
+ p["IMTBL_WIDGETS_PROVIDER"] = "imtbl-widgets-provider";
4
+ p["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
5
+ p["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
6
+ p["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
7
+ p["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
8
+ p["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
9
+ p["IMTBL_SALE_WIDGET_EVENT"] = "imtbl-sale-widget";
10
+ p["IMTBL_COMMERCE_WIDGET_EVENT"] = "imtbl-commerce-widget";
11
+ p["IMTBL_ADD_TOKENS_WIDGET_EVENT"] = "imtbl-add-tokens-widget";
12
+ p["IMTBL_PURCHASE_WIDGET_EVENT"] = "imtbl-purchase-widget";
13
+ return p;
14
+ })(rn || {});
15
+ var nn = /* @__PURE__ */ ((e) => {
16
16
  e["PROVIDER_UPDATED"] = "PROVIDER_UPDATED";
17
17
  return e;
18
- })(un || {});
18
+ })(nn || {});
19
19
 
20
20
  // src/widgets/definitions/events/connect.ts
21
- var pn = /* @__PURE__ */ ((a) => {
21
+ var on = /* @__PURE__ */ ((a) => {
22
22
  a["CLOSE_WIDGET"] = "close-widget";
23
23
  a["SUCCESS"] = "success";
24
24
  a["FAILURE"] = "failure";
25
25
  a["LANGUAGE_CHANGED"] = "language-changed";
26
26
  a["WALLETCONNECT_PROVIDER_UPDATED"] = "walletconnect-provider-updated";
27
27
  return a;
28
- })(pn || {});
28
+ })(on || {});
29
29
 
30
30
  // src/widgets/definitions/events/wallet.ts
31
- var mn = /* @__PURE__ */ ((o) => {
31
+ var an = /* @__PURE__ */ ((o) => {
32
32
  o["CLOSE_WIDGET"] = "close-widget";
33
33
  o["NETWORK_SWITCH"] = "network-switch";
34
34
  o["DISCONNECT_WALLET"] = "disconnect-wallet";
35
35
  o["LANGUAGE_CHANGED"] = "language-changed";
36
36
  return o;
37
- })(mn || {});
37
+ })(an || {});
38
38
 
39
39
  // src/widgets/definitions/events/swap.ts
40
- var fn = /* @__PURE__ */ ((a) => {
40
+ var sn = /* @__PURE__ */ ((a) => {
41
41
  a["CLOSE_WIDGET"] = "close-widget";
42
42
  a["SUCCESS"] = "success";
43
43
  a["FAILURE"] = "failure";
44
44
  a["REJECTED"] = "rejected";
45
45
  a["LANGUAGE_CHANGED"] = "language-changed";
46
46
  return a;
47
- })(fn || {});
47
+ })(sn || {});
48
48
 
49
49
  // src/widgets/definitions/events/sale.ts
50
- var gn = /* @__PURE__ */ ((p) => {
51
- p["CLOSE_WIDGET"] = "close-widget";
52
- p["SUCCESS"] = "success";
53
- p["FAILURE"] = "failure";
54
- p["REJECTED"] = "rejected";
55
- p["TRANSACTION_SUCCESS"] = "transaction-success";
56
- p["LANGUAGE_CHANGED"] = "language-changed";
57
- p["PAYMENT_METHOD"] = "payment-method";
58
- p["REQUEST_BRIDGE"] = "request-bridge";
59
- p["REQUEST_ONRAMP"] = "request-onramp";
60
- p["REQUEST_SWAP"] = "request-swap";
61
- p["PAYMENT_TOKEN"] = "payment-token";
62
- return p;
63
- })(gn || {});
64
- var En = /* @__PURE__ */ ((n) => {
50
+ var cn = /* @__PURE__ */ ((u) => {
51
+ u["CLOSE_WIDGET"] = "close-widget";
52
+ u["SUCCESS"] = "success";
53
+ u["FAILURE"] = "failure";
54
+ u["REJECTED"] = "rejected";
55
+ u["TRANSACTION_SUCCESS"] = "transaction-success";
56
+ u["LANGUAGE_CHANGED"] = "language-changed";
57
+ u["PAYMENT_METHOD"] = "payment-method";
58
+ u["REQUEST_BRIDGE"] = "request-bridge";
59
+ u["REQUEST_ONRAMP"] = "request-onramp";
60
+ u["REQUEST_SWAP"] = "request-swap";
61
+ u["PAYMENT_TOKEN"] = "payment-token";
62
+ return u;
63
+ })(cn || {});
64
+ var dn = /* @__PURE__ */ ((n) => {
65
65
  n["CRYPTO"] = "crypto";
66
66
  n["DEBIT"] = "debit";
67
67
  n["CREDIT"] = "credit";
68
68
  return n;
69
- })(En || {});
69
+ })(dn || {});
70
70
 
71
71
  // src/widgets/definitions/events/bridge.ts
72
- var Rn = /* @__PURE__ */ ((i) => {
72
+ var ln = /* @__PURE__ */ ((i) => {
73
73
  i["CLOSE_WIDGET"] = "close-widget";
74
74
  i["FAILURE"] = "failure";
75
75
  i["TRANSACTION_SENT"] = "transaction-sent";
@@ -77,10 +77,10 @@ var Rn = /* @__PURE__ */ ((i) => {
77
77
  i["CLAIM_WITHDRAWAL_SUCCESS"] = "claim-withdrawal-success";
78
78
  i["CLAIM_WITHDRAWAL_FAILURE"] = "claim-withdrawal-failure";
79
79
  return i;
80
- })(Rn || {});
80
+ })(ln || {});
81
81
 
82
82
  // src/widgets/definitions/events/orchestration.ts
83
- var Cn = /* @__PURE__ */ ((c) => {
83
+ var pn = /* @__PURE__ */ ((c) => {
84
84
  c["REQUEST_CONNECT"] = "request-connect";
85
85
  c["REQUEST_WALLET"] = "request-wallet";
86
86
  c["REQUEST_SWAP"] = "request-swap";
@@ -90,19 +90,19 @@ var Cn = /* @__PURE__ */ ((c) => {
90
90
  c["REQUEST_PURCHASE"] = "request-purchase";
91
91
  c["REQUEST_GO_BACK"] = "request-go-back";
92
92
  return c;
93
- })(Cn || {});
93
+ })(pn || {});
94
94
 
95
95
  // src/widgets/definitions/events/onramp.ts
96
- var In = /* @__PURE__ */ ((o) => {
96
+ var un = /* @__PURE__ */ ((o) => {
97
97
  o["CLOSE_WIDGET"] = "close-widget";
98
98
  o["SUCCESS"] = "success";
99
99
  o["FAILURE"] = "failure";
100
100
  o["LANGUAGE_CHANGED"] = "language-changed";
101
101
  return o;
102
- })(In || {});
102
+ })(un || {});
103
103
 
104
104
  // src/widgets/definitions/events/commerce.ts
105
- var Tn = /* @__PURE__ */ ((s) => {
105
+ var mn = /* @__PURE__ */ ((s) => {
106
106
  s["INITIALISED"] = "INITIALISED";
107
107
  s["PROVIDER_UPDATED"] = "PROVIDER_UPDATED";
108
108
  s["CLOSE"] = "CLOSE";
@@ -111,8 +111,8 @@ var Tn = /* @__PURE__ */ ((s) => {
111
111
  s["DISCONNECTED"] = "DISCONNECTED";
112
112
  s["USER_ACTION"] = "USER_ACTION";
113
113
  return s;
114
- })(Tn || {});
115
- var hn = /* @__PURE__ */ ((d) => {
114
+ })(mn || {});
115
+ var fn = /* @__PURE__ */ ((d) => {
116
116
  d["SWAP_SUCCESS"] = "SWAP_SUCCESS";
117
117
  d["ONRAMP_SUCCESS"] = "ONRAMP_SUCCESS";
118
118
  d["CONNECT_SUCCESS"] = "CONNECT_SUCCESS";
@@ -123,8 +123,8 @@ var hn = /* @__PURE__ */ ((d) => {
123
123
  d["ADD_TOKENS_SUCCESS"] = "ADD_TOKENS_SUCCESS";
124
124
  d["ADD_TOKENS_CONNECT_SUCCESS"] = "ADD_TOKENS_CONNECT_SUCCESS";
125
125
  return d;
126
- })(hn || {});
127
- var An = /* @__PURE__ */ ((c) => {
126
+ })(fn || {});
127
+ var En = /* @__PURE__ */ ((c) => {
128
128
  c["BRIDGE_FAILED"] = "BRIDGE_FAILED";
129
129
  c["BRIDGE_CLAIM_WITHDRAWAL_FAILED"] = "BRIDGE_CLAIM_WITHDRAWAL_FAILED";
130
130
  c["SWAP_FAILED"] = "SWAP_FAILED";
@@ -134,35 +134,35 @@ var An = /* @__PURE__ */ ((c) => {
134
134
  c["ONRAMP_FAILED"] = "ONRAMP_FAILED";
135
135
  c["ADD_TOKENS_FAILED"] = "ADD_TOKENS_FAILED";
136
136
  return c;
137
- })(An || {});
138
- var wn = /* @__PURE__ */ ((n) => {
137
+ })(En || {});
138
+ var gn = /* @__PURE__ */ ((n) => {
139
139
  n["PAYMENT_METHOD_SELECTED"] = "PAYMENT_METHOD_SELECTED";
140
140
  n["PAYMENT_TOKEN_SELECTED"] = "PAYMENT_TOKEN_SELECTED";
141
141
  n["NETWORK_SWITCH"] = "NETWORK_SWITCH";
142
142
  return n;
143
- })(wn || {});
143
+ })(gn || {});
144
144
 
145
145
  // src/widgets/definitions/events/addTokens.ts
146
- var yn = /* @__PURE__ */ ((a) => {
146
+ var Rn = /* @__PURE__ */ ((a) => {
147
147
  a["CLOSE_WIDGET"] = "close-widget";
148
148
  a["LANGUAGE_CHANGED"] = "language-changed";
149
149
  a["CONNECT_SUCCESS"] = "connect-success";
150
150
  a["SUCCESS"] = "success";
151
151
  a["FAILURE"] = "failure";
152
152
  return a;
153
- })(yn || {});
153
+ })(Rn || {});
154
154
 
155
155
  // src/widgets/definitions/events/purchase.ts
156
- var Sn = /* @__PURE__ */ ((o) => {
156
+ var Cn = /* @__PURE__ */ ((o) => {
157
157
  o["CLOSE_WIDGET"] = "close-widget";
158
158
  o["CONNECT_SUCCESS"] = "connect-success";
159
159
  o["SUCCESS"] = "success";
160
160
  o["FAILURE"] = "failure";
161
161
  return o;
162
- })(Sn || {});
162
+ })(Cn || {});
163
163
 
164
164
  // src/widgets/definitions/types.ts
165
- var Pn = /* @__PURE__ */ ((d) => {
165
+ var In = /* @__PURE__ */ ((d) => {
166
166
  d["CONNECT"] = "connect";
167
167
  d["WALLET"] = "wallet";
168
168
  d["SWAP"] = "swap";
@@ -173,24 +173,24 @@ var Pn = /* @__PURE__ */ ((d) => {
173
173
  d["ADD_TOKENS"] = "addTokens";
174
174
  d["PURCHASE"] = "purchase";
175
175
  return d;
176
- })(Pn || {});
176
+ })(In || {});
177
177
 
178
178
  // src/widgets/definitions/parameters/connect.ts
179
- var kn = /* @__PURE__ */ ((t) => {
179
+ var Tn = /* @__PURE__ */ ((t) => {
180
180
  t["LAYER1"] = "LAYER1";
181
181
  t["LAYER2"] = "LAYER2";
182
182
  return t;
183
- })(kn || {});
183
+ })(Tn || {});
184
184
 
185
185
  // src/widgets/definitions/parameters/swap.ts
186
- var vn = /* @__PURE__ */ ((t) => {
186
+ var hn = /* @__PURE__ */ ((t) => {
187
187
  t["FROM"] = "FROM";
188
188
  t["TO"] = "TO";
189
189
  return t;
190
- })(vn || {});
190
+ })(hn || {});
191
191
 
192
192
  // src/widgets/definitions/parameters/commerce.ts
193
- var Nn = /* @__PURE__ */ ((c) => {
193
+ var An = /* @__PURE__ */ ((c) => {
194
194
  c["CONNECT"] = "CONNECT";
195
195
  c["WALLET"] = "WALLET";
196
196
  c["SALE"] = "SALE";
@@ -200,22 +200,22 @@ var Nn = /* @__PURE__ */ ((c) => {
200
200
  c["ADD_TOKENS"] = "ADD_TOKENS";
201
201
  c["PURCHASE"] = "PURCHASE";
202
202
  return c;
203
- })(Nn || {});
203
+ })(An || {});
204
204
 
205
205
  // src/widgets/definitions/configurations/theme.ts
206
- var _n = /* @__PURE__ */ ((t) => {
206
+ var yn = /* @__PURE__ */ ((t) => {
207
207
  t["LIGHT"] = "light";
208
208
  t["DARK"] = "dark";
209
209
  return t;
210
- })(_n || {});
210
+ })(yn || {});
211
211
 
212
212
  // src/sdk.ts
213
213
  var _config = require('@imtbl/config');
214
214
 
215
215
  // src/api/http/httpClient.ts
216
216
  var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
217
- var Mn = "pk_imapik-";
218
- var Bn = [
217
+ var Sn = "pk_imapik-";
218
+ var Pn = [
219
219
  "https://checkout-api.dev.immutable.com",
220
220
  "https://checkout-api.sandbox.immutable.com",
221
221
  "https://checkout-api.immutable.com"
@@ -230,14 +230,14 @@ var de = class {
230
230
  }
231
231
  // eslint-disable-next-line class-methods-use-this
232
232
  shouldAddPublishableKey(e) {
233
- return Bn.some((t) => e.startsWith(t));
233
+ return Pn.some((t) => e.startsWith(t));
234
234
  }
235
235
  setupInterceptors() {
236
236
  this.axiosInstance.interceptors.request.use(
237
237
  (e) => {
238
238
  const t = _optionalChain([this, 'access', _2 => _2.config, 'optionalAccess', _3 => _3.baseConfig, 'optionalAccess', _4 => _4.publishableKey]);
239
239
  if (t && this.shouldAddPublishableKey(e.url || "")) {
240
- if (!t.startsWith(Mn)) {
240
+ if (!t.startsWith(Sn)) {
241
241
  throw new Error(
242
242
  "Invalid Publishable key. Create your Publishable key in Immutable developer hub. https://hub.immutable.com"
243
243
  );
@@ -290,7 +290,7 @@ var de = class {
290
290
 
291
291
 
292
292
  // src/errors/checkoutError.ts
293
- var y = /* @__PURE__ */ ((h) => {
293
+ var w = /* @__PURE__ */ ((h) => {
294
294
  h["MISSING_PARAMS"] = "MISSING_PARAMS";
295
295
  h["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
296
296
  h["PROVIDER_ERROR"] = "PROVIDER_ERROR";
@@ -333,7 +333,7 @@ var y = /* @__PURE__ */ ((h) => {
333
333
  h["WIDGETS_SCRIPT_LOAD_ERROR"] = "WIDGETS_SCRIPT_LOAD_ERROR";
334
334
  h["APPROVAL_TRANSACTION_FAILED"] = "APPROVAL_TRANSACTION_FAILED";
335
335
  return h;
336
- })(y || {});
336
+ })(w || {});
337
337
  var l = class extends Error {
338
338
 
339
339
 
@@ -345,7 +345,7 @@ var l = class extends Error {
345
345
  this.data = n;
346
346
  }
347
347
  };
348
- var b = async (r, e) => {
348
+ var x = async (r, e) => {
349
349
  try {
350
350
  return await r();
351
351
  } catch (t) {
@@ -384,19 +384,19 @@ var tt = /* @__PURE__ */ ((a) => {
384
384
  a["IMTBL_ZKEVM_MAINNET"] = "Immutable zkEVM";
385
385
  return a;
386
386
  })(tt || {});
387
- var Te = /* @__PURE__ */ ((a) => {
387
+ var he = /* @__PURE__ */ ((a) => {
388
388
  a["ETHEREUM"] = "ethereum";
389
389
  a["SEPOLIA"] = "sepolia";
390
390
  a["IMTBL_ZKEVM_MAINNET"] = "imtbl-zkevm-mainnet";
391
391
  a["IMTBL_ZKEVM_TESTNET"] = "imtbl-zkevm-testnet";
392
392
  a["IMTBL_ZKEVM_DEVNET"] = "imtbl-zkevm-devnet";
393
393
  return a;
394
- })(Te || {});
394
+ })(he || {});
395
395
 
396
396
  // src/env/constants.ts
397
397
  var K = "development";
398
398
  var q = 18;
399
- var Bt = 6;
399
+ var Ot = 6;
400
400
  var _ = "native";
401
401
  var we = {
402
402
  name: "IMX",
@@ -404,7 +404,7 @@ var we = {
404
404
  decimals: q,
405
405
  address: _
406
406
  };
407
- var bn = {
407
+ var kn = {
408
408
  name: "tIMX",
409
409
  symbol: "tIMX",
410
410
  decimals: q,
@@ -415,19 +415,19 @@ var U = {
415
415
  [_config.Environment.SANDBOX]: "https://api.sandbox.immutable.com",
416
416
  [_config.Environment.PRODUCTION]: "https://api.immutable.com"
417
417
  };
418
- var ye = {
418
+ var Se = {
419
419
  [K]: "https://checkout-api.dev.immutable.com",
420
420
  [_config.Environment.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
421
421
  [_config.Environment.PRODUCTION]: "https://checkout-api.immutable.com"
422
422
  };
423
- var bt = true;
423
+ var Bt = true;
424
+ var Mt = true;
424
425
  var xt = true;
425
- var Lt = true;
426
- var Dt = {
426
+ var bt = {
427
427
  [_config.Environment.SANDBOX]: "https://global-stg.transak.com",
428
428
  [_config.Environment.PRODUCTION]: "https://global.transak.com/"
429
429
  };
430
- var he = /* @__PURE__ */ new Map([
430
+ var Ae = /* @__PURE__ */ new Map([
431
431
  [
432
432
  1,
433
433
  {
@@ -452,7 +452,7 @@ var he = /* @__PURE__ */ new Map([
452
452
  }
453
453
  ]
454
454
  ]);
455
- var Ae = /* @__PURE__ */ new Map([
455
+ var ye = /* @__PURE__ */ new Map([
456
456
  [
457
457
  11155111,
458
458
  {
@@ -475,11 +475,11 @@ var Ae = /* @__PURE__ */ new Map([
475
475
  chainIdHex: `0x${13473 .toString(16)}`,
476
476
  chainName: "Immutable zkEVM Testnet",
477
477
  rpcUrls: ["https://rpc.testnet.immutable.com"],
478
- nativeCurrency: bn
478
+ nativeCurrency: kn
479
479
  }
480
480
  ]
481
481
  ]);
482
- var Ft = /* @__PURE__ */ new Map([
482
+ var Lt = /* @__PURE__ */ new Map([
483
483
  [
484
484
  11155111,
485
485
  {
@@ -507,22 +507,22 @@ var Ft = /* @__PURE__ */ new Map([
507
507
  var te = {
508
508
  [13473]: {
509
509
  url: "https://explorer.testnet.immutable.com",
510
- nativeToken: Ae.get(13473).nativeCurrency
510
+ nativeToken: ye.get(13473).nativeCurrency
511
511
  },
512
512
  [13371]: {
513
513
  url: "https://explorer.immutable.com",
514
- nativeToken: he.get(13371).nativeCurrency
514
+ nativeToken: Ae.get(13371).nativeCurrency
515
515
  },
516
516
  [11155111]: {
517
517
  url: "https://eth-sepolia.blockscout.com",
518
- nativeToken: Ae.get(11155111).nativeCurrency
518
+ nativeToken: ye.get(11155111).nativeCurrency
519
519
  },
520
520
  [1]: {
521
521
  url: "https://eth.blockscout.com/",
522
- nativeToken: he.get(1).nativeCurrency
522
+ nativeToken: Ae.get(1).nativeCurrency
523
523
  }
524
524
  };
525
- var x = [
525
+ var b = [
526
526
  {
527
527
  constant: true,
528
528
  inputs: [],
@@ -789,9 +789,8 @@ var nt = {
789
789
  };
790
790
 
791
791
  // src/env/env.ts
792
- var xn = "2.1.0";
793
- var ot = () => false;
794
- var Se = () => xn;
792
+ var vn = "2.1.1-alpha.1";
793
+ var le = () => vn;
795
794
 
796
795
  // src/availability/availability.ts
797
796
  var Pe = (r, e) => {
@@ -825,17 +824,17 @@ var Pe = (r, e) => {
825
824
  var _ethers = require('ethers');
826
825
 
827
826
  // src/types/gasEstimate.ts
828
- var at = /* @__PURE__ */ ((t) => {
827
+ var ot = /* @__PURE__ */ ((t) => {
829
828
  t["BRIDGE_TO_L2"] = "BRIDGE_TO_L2";
830
829
  t["SWAP"] = "SWAP";
831
830
  return t;
832
- })(at || {});
831
+ })(ot || {});
833
832
 
834
833
  // src/types/network.ts
835
- var le = /* @__PURE__ */ ((e) => {
834
+ var pe = /* @__PURE__ */ ((e) => {
836
835
  e["ALL"] = "all";
837
836
  return e;
838
- })(le || {});
837
+ })(pe || {});
839
838
 
840
839
  // src/types/token.ts
841
840
  var ne = /* @__PURE__ */ ((o) => {
@@ -847,10 +846,10 @@ var ne = /* @__PURE__ */ ((o) => {
847
846
  })(ne || {});
848
847
 
849
848
  // src/types/wallet.ts
850
- var Ut = /* @__PURE__ */ ((e) => {
849
+ var Ft = /* @__PURE__ */ ((e) => {
851
850
  e["ALL"] = "all";
852
851
  return e;
853
- })(Ut || {});
852
+ })(Ft || {});
854
853
 
855
854
  // src/types/provider.ts
856
855
 
@@ -862,13 +861,13 @@ var ue = /* @__PURE__ */ ((n) => {
862
861
  n["WALLETCONNECT"] = "walletconnect";
863
862
  return n;
864
863
  })(ue || {});
865
- var Gt = /* @__PURE__ */ ((n) => {
864
+ var Wt = /* @__PURE__ */ ((n) => {
866
865
  n["PASSPORT"] = "com.immutable.passport";
867
866
  n["METAMASK"] = "io.metamask";
868
867
  n["WALLETCONNECT"] = "walletconnect";
869
868
  return n;
870
- })(Gt || {});
871
- var qt = {
869
+ })(Wt || {});
870
+ var Ut = {
872
871
  allowMistmatchedChainId: false,
873
872
  allowUnsupportedProvider: false
874
873
  };
@@ -888,36 +887,36 @@ var L = class extends _ethers.BrowserProvider {
888
887
  };
889
888
 
890
889
  // src/types/smartCheckout.ts
891
- var pe = /* @__PURE__ */ ((o) => {
890
+ var me = /* @__PURE__ */ ((o) => {
892
891
  o["SUCCESS"] = "SUCCESS";
893
892
  o["FAILED"] = "FAILED";
894
893
  o["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
895
894
  o["FULFILLMENTS_UNSETTLED"] = "FULFILLMENTS_UNSETTLED";
896
895
  return o;
897
- })(pe || {});
898
- var M = /* @__PURE__ */ ((o) => {
896
+ })(me || {});
897
+ var B = /* @__PURE__ */ ((o) => {
899
898
  o["NATIVE"] = "NATIVE";
900
899
  o["ERC20"] = "ERC20";
901
900
  o["ERC721"] = "ERC721";
902
901
  o["ERC1155"] = "ERC1155";
903
902
  return o;
904
- })(M || {});
905
- var me = /* @__PURE__ */ ((t) => {
903
+ })(B || {});
904
+ var fe = /* @__PURE__ */ ((t) => {
906
905
  t["TRANSACTION"] = "TRANSACTION";
907
906
  t["GAS"] = "GAS";
908
907
  return t;
909
- })(me || {});
910
- var fe = /* @__PURE__ */ ((t) => {
908
+ })(fe || {});
909
+ var Ee = /* @__PURE__ */ ((t) => {
911
910
  t["NATIVE"] = "NATIVE";
912
911
  t["ERC20"] = "ERC20";
913
912
  return t;
914
- })(fe || {});
915
- var it = /* @__PURE__ */ ((n) => {
913
+ })(Ee || {});
914
+ var at = /* @__PURE__ */ ((n) => {
916
915
  n["ROUTES_FOUND"] = "ROUTES_FOUND";
917
916
  n["NO_ROUTES_FOUND"] = "NO_ROUTES_FOUND";
918
917
  n["NO_ROUTE_OPTIONS"] = "NO_ROUTE_OPTIONS";
919
918
  return n;
920
- })(it || {});
919
+ })(at || {});
921
920
  var ke = /* @__PURE__ */ ((o) => {
922
921
  o["GAS"] = "GAS";
923
922
  o["BRIDGE_FEE"] = "BRIDGE_FEE";
@@ -933,13 +932,13 @@ var ge = /* @__PURE__ */ ((n) => {
933
932
  })(ge || {});
934
933
 
935
934
  // src/types/fiatRamp.ts
936
- var jt = /* @__PURE__ */ ((e) => {
935
+ var Gt = /* @__PURE__ */ ((e) => {
937
936
  e["ONRAMP"] = "onramp";
938
937
  return e;
939
- })(jt || {});
938
+ })(Gt || {});
940
939
 
941
940
  // src/provider/getUnderlyingProvider.ts
942
- async function Fn(r) {
941
+ async function On(r) {
943
942
  if (!r.send) {
944
943
  throw new l(
945
944
  "Parsed provider is not a valid WrappedBrowserProvider",
@@ -952,22 +951,22 @@ async function Fn(r) {
952
951
  }
953
952
  return e;
954
953
  }
955
- async function Ee(r) {
954
+ async function Re(r) {
956
955
  const e = await r.getNetwork();
957
956
  if (e.chainId && typeof e.chainId === "bigint") {
958
957
  return e.chainId;
959
958
  }
960
- return Fn(r);
959
+ return On(r);
961
960
  }
962
961
 
963
962
  // src/network/network.ts
964
- var Wn = 4902;
965
- async function Un(r, e, t) {
963
+ var Bn = 4902;
964
+ async function Mn(r, e, t) {
966
965
  return await e.send("wallet_switchEthereumChain", [
967
966
  { chainId: _optionalChain([r, 'access', _7 => _7.get, 'call', _8 => _8(t), 'optionalAccess', _9 => _9.chainIdHex]) }
968
967
  ]);
969
968
  }
970
- async function st(r, e, t) {
969
+ async function it(r, e, t) {
971
970
  if (e.send) {
972
971
  const n = r.get(t);
973
972
  const o = {
@@ -991,7 +990,7 @@ async function Y(r, { type: e = "all", exclude: t }) {
991
990
  }
992
991
  const a = (o || []).filter((s) => {
993
992
  const c = e === "all";
994
- const d = !(t || []).map((u) => u.chainId).includes(s.chainId);
993
+ const d = !(t || []).map((p) => p.chainId).includes(s.chainId);
995
994
  return c && d;
996
995
  });
997
996
  const i = [];
@@ -1010,9 +1009,9 @@ async function Y(r, { type: e = "all", exclude: t }) {
1010
1009
  networks: i
1011
1010
  };
1012
1011
  }
1013
- async function Re(r, e) {
1012
+ async function Ce(r, e) {
1014
1013
  const { networkMap: t } = r;
1015
- return b(
1014
+ return x(
1016
1015
  async () => {
1017
1016
  try {
1018
1017
  const n = await e.getNetwork();
@@ -1031,7 +1030,7 @@ async function Re(r, e) {
1031
1030
  isSupported: false
1032
1031
  };
1033
1032
  } catch (n) {
1034
- const o = await Ee(e);
1033
+ const o = await Re(e);
1035
1034
  const a = Array.from(t.keys()).includes(Number(o));
1036
1035
  return {
1037
1036
  chainId: Number(o),
@@ -1044,7 +1043,7 @@ async function Re(r, e) {
1044
1043
  }
1045
1044
  );
1046
1045
  }
1047
- async function Ht(r, e, t) {
1046
+ async function jt(r, e, t) {
1048
1047
  const { networkMap: n } = r;
1049
1048
  const o = await Y(r, {
1050
1049
  type: "all"
@@ -1063,7 +1062,7 @@ async function Ht(r, e, t) {
1063
1062
  }
1064
1063
  try {
1065
1064
  if (e && "ethereumProvider" in e) {
1066
- await Un(n, e, t);
1065
+ await Mn(n, e, t);
1067
1066
  } else {
1068
1067
  throw new l(
1069
1068
  "Incorrect provider type",
@@ -1072,10 +1071,10 @@ async function Ht(r, e, t) {
1072
1071
  }
1073
1072
  } catch (c) {
1074
1073
  console.error(c);
1075
- if (c.code === Wn) {
1074
+ if (c.code === Bn) {
1076
1075
  try {
1077
1076
  if ("ethereumProvider" in e) {
1078
- await st(n, e, t);
1077
+ await it(n, e, t);
1079
1078
  } else {
1080
1079
  throw new l(
1081
1080
  "Incorrect provider type",
@@ -1104,7 +1103,7 @@ async function Ht(r, e, t) {
1104
1103
  "USER_REJECTED_REQUEST_ERROR"
1105
1104
  );
1106
1105
  }
1107
- const s = await Re(r, a);
1106
+ const s = await Ce(r, a);
1108
1107
  return {
1109
1108
  network: s,
1110
1109
  provider: a
@@ -1131,9 +1130,9 @@ var ve = (_class = class {
1131
1130
  this.httpClient = e;
1132
1131
  }
1133
1132
  __init2() {this.getEndpoint = () => {
1134
- if (this.isDevelopment) return ye[K];
1135
- if (this.isProduction) return ye[_config.Environment.PRODUCTION];
1136
- return ye[_config.Environment.SANDBOX];
1133
+ if (this.isDevelopment) return Se[K];
1134
+ if (this.isProduction) return Se[_config.Environment.PRODUCTION];
1135
+ return Se[_config.Environment.SANDBOX];
1137
1136
  }}
1138
1137
  // eslint-disable-next-line class-methods-use-this
1139
1138
  parseResponse(e) {
@@ -1179,7 +1178,7 @@ var ve = (_class = class {
1179
1178
 
1180
1179
  // src/config/tokensFetcher.ts
1181
1180
 
1182
- var Gn = "0x0000000000000000000000000000000000000eee";
1181
+ var xn = "0x0000000000000000000000000000000000000eee";
1183
1182
  var Ne = (_class2 = class {
1184
1183
 
1185
1184
 
@@ -1276,7 +1275,7 @@ var Ne = (_class2 = class {
1276
1275
  if (!t[s]) {
1277
1276
  t[s] = [];
1278
1277
  }
1279
- if (c === Gn) {
1278
+ if (c === xn) {
1280
1279
  c = "native";
1281
1280
  }
1282
1281
  _optionalChain([t, 'access', _32 => _32[s], 'optionalAccess', _33 => _33.push, 'call', _34 => _34({
@@ -1311,17 +1310,17 @@ var Ne = (_class2 = class {
1311
1310
  }, _class2);
1312
1311
 
1313
1312
  // src/config/config.ts
1314
- var ct = class extends Error {
1313
+ var st = class extends Error {
1315
1314
 
1316
1315
  constructor(e) {
1317
1316
  super(e);
1318
1317
  this.message = e;
1319
1318
  }
1320
1319
  };
1321
- var qn = (r, e) => {
1322
- if (e) return Ft;
1323
- if (r) return he;
1324
- return Ae;
1320
+ var bn = (r, e) => {
1321
+ if (e) return Lt;
1322
+ if (r) return Ae;
1323
+ return ye;
1325
1324
  };
1326
1325
  var N = (r) => {
1327
1326
  if (!r.isProduction) return 11155111;
@@ -1332,7 +1331,7 @@ var A = (r) => {
1332
1331
  if (r.isProduction) return 13371;
1333
1332
  return 13473;
1334
1333
  };
1335
- var Ce = (_class3 = class {
1334
+ var Ie = (_class3 = class {
1336
1335
  // This is a hidden feature that is only available
1337
1336
  // when building the project from source code.
1338
1337
  // This will be used to get around the lack of
@@ -1350,17 +1349,17 @@ var Ce = (_class3 = class {
1350
1349
 
1351
1350
  constructor(e, t) {;_class3.prototype.__init6.call(this);
1352
1351
  if (!Object.values(_config.Environment).includes(e.baseConfig.environment)) {
1353
- throw new ct(
1352
+ throw new st(
1354
1353
  "Invalid checkout configuration of environment"
1355
1354
  );
1356
1355
  }
1357
1356
  this.environment = e.baseConfig.environment;
1358
1357
  this.isProduction = !this.isDevelopment && this.environment === _config.Environment.PRODUCTION;
1359
- this.isOnRampEnabled = _nullishCoalesce(_optionalChain([e, 'access', _35 => _35.onRamp, 'optionalAccess', _36 => _36.enable]), () => ( bt));
1360
- this.isSwapEnabled = _nullishCoalesce(_optionalChain([e, 'access', _37 => _37.swap, 'optionalAccess', _38 => _38.enable]), () => ( xt));
1361
- this.isBridgeEnabled = _nullishCoalesce(_optionalChain([e, 'access', _39 => _39.bridge, 'optionalAccess', _40 => _40.enable]), () => ( Lt));
1358
+ this.isOnRampEnabled = _nullishCoalesce(_optionalChain([e, 'access', _35 => _35.onRamp, 'optionalAccess', _36 => _36.enable]), () => ( Bt));
1359
+ this.isSwapEnabled = _nullishCoalesce(_optionalChain([e, 'access', _37 => _37.swap, 'optionalAccess', _38 => _38.enable]), () => ( Mt));
1360
+ this.isBridgeEnabled = _nullishCoalesce(_optionalChain([e, 'access', _39 => _39.bridge, 'optionalAccess', _40 => _40.enable]), () => ( xt));
1362
1361
  this.publishableKey = _nullishCoalesce(e.publishableKey, () => ( "<no-publishable-key>"));
1363
- this.networkMap = qn(this.isProduction, this.isDevelopment);
1362
+ this.networkMap = bn(this.isProduction, this.isDevelopment);
1364
1363
  this.remote = new ve(t, {
1365
1364
  isDevelopment: this.isDevelopment,
1366
1365
  isProduction: this.isProduction
@@ -1373,14 +1372,14 @@ var Ce = (_class3 = class {
1373
1372
  }
1374
1373
  // eslint-disable-next-line class-methods-use-this
1375
1374
  get sdkVersion() {
1376
- return Se();
1375
+ return le();
1377
1376
  }
1378
1377
  }, _class3);
1379
1378
 
1380
1379
  // src/utils/utils.ts
1381
1380
  var I = (r = "", e = "") => r.toLowerCase() === e.toLowerCase();
1382
- var Yt = (r) => r === 15003 || r === 13473 || r === 13371;
1383
- var jn = (r, e) => {
1381
+ var Qt = (r) => r === 15003 || r === 13473 || r === 13371;
1382
+ var Ln = (r, e) => {
1384
1383
  const t = r.indexOf(".");
1385
1384
  const n = r.substring(t + e + 1);
1386
1385
  if (n && parseFloat(n) >= 1) {
@@ -1390,15 +1389,15 @@ var jn = (r, e) => {
1390
1389
  }
1391
1390
  return parseFloat(r.substring(0, t + e + 1)).toString();
1392
1391
  };
1393
- var Q = (r, e = Bt) => {
1392
+ var Q = (r, e = Ot) => {
1394
1393
  const t = r.indexOf(".");
1395
1394
  if (t === -1) return r;
1396
- const n = jn(r, e);
1395
+ const n = Ln(r, e);
1397
1396
  return n;
1398
1397
  };
1399
1398
 
1400
1399
  // src/tokens/tokens.ts
1401
- var zn = "native";
1400
+ var Wn = "native";
1402
1401
  var H = async (r, {
1403
1402
  type: e = "all",
1404
1403
  chainId: t,
@@ -1421,7 +1420,7 @@ var H = async (r, {
1421
1420
  o = _optionalChain([a, 'access', _42 => _42["201811419111"], 'optionalAccess', _43 => _43.tokens]) || [];
1422
1421
  break;
1423
1422
  case "bridge":
1424
- o = (await r.tokens.getTokensConfig(s)).filter((d) => d.bridge === zn);
1423
+ o = (await r.tokens.getTokensConfig(s)).filter((d) => d.bridge === Wn);
1425
1424
  break;
1426
1425
  case "all":
1427
1426
  default:
@@ -1429,14 +1428,14 @@ var H = async (r, {
1429
1428
  }
1430
1429
  if (!n || _optionalChain([n, 'optionalAccess', _44 => _44.length]) === 0) return { tokens: o };
1431
1430
  return {
1432
- tokens: o.filter((d) => !n.map((u) => u.address).includes(d.address || ""))
1431
+ tokens: o.filter((d) => !n.map((p) => p.address).includes(d.address || ""))
1433
1432
  };
1434
1433
  };
1435
1434
  var O = (r) => !r || I(r, _);
1436
1435
  async function _e(r, e) {
1437
- return await b(
1436
+ return await x(
1438
1437
  async () => {
1439
- const t = new (0, _ethers.Contract)(e, JSON.stringify(x), r);
1438
+ const t = new (0, _ethers.Contract)(e, JSON.stringify(b), r);
1440
1439
  const [n, o, a] = await Promise.all([
1441
1440
  t.name(),
1442
1441
  t.symbol(),
@@ -1457,8 +1456,8 @@ async function _e(r, e) {
1457
1456
 
1458
1457
 
1459
1458
 
1460
- var Qn = 5;
1461
- var Ie = (_class4 = class {
1459
+ var Gn = 5;
1460
+ var Te = (_class4 = class {
1462
1461
 
1463
1462
 
1464
1463
 
@@ -1491,7 +1490,7 @@ var Ie = (_class4 = class {
1491
1490
  symbol: o.symbol
1492
1491
  };
1493
1492
  this.cacheMap = {};
1494
- this.ttl = n !== void 0 ? n : Qn;
1493
+ this.ttl = n !== void 0 ? n : Gn;
1495
1494
  }
1496
1495
  /**
1497
1496
  * isChainSupported verifies if the chain is supported by Blockscout
@@ -1566,7 +1565,7 @@ var Ie = (_class4 = class {
1566
1565
  }, _class4.__initStatic(), _class4.__initStatic2(), _class4);
1567
1566
 
1568
1567
  // src/logger/debugLogger.ts
1569
- var dt = (r, e, t) => {
1568
+ var ct = (r, e, t) => {
1570
1569
  if (!r.isProduction) console.info(e, t);
1571
1570
  };
1572
1571
  var S = async (r, e, t) => {
@@ -1574,14 +1573,14 @@ var S = async (r, e, t) => {
1574
1573
  const o = await t;
1575
1574
  const a = performance.now();
1576
1575
  const i = (a - n) / 1e3;
1577
- dt(r, e, i);
1576
+ ct(r, e, i);
1578
1577
  return o;
1579
1578
  };
1580
1579
 
1581
1580
  // src/balances/balances.ts
1582
- var mt = async (r, e, t) => await b(
1581
+ var ut = async (r, e, t) => await x(
1583
1582
  async () => {
1584
- const n = await Re(r, e);
1583
+ const n = await Ce(r, e);
1585
1584
  if (!n.isSupported) {
1586
1585
  throw new l(
1587
1586
  `Chain:${n.chainId} is not a supported chain`,
@@ -1601,12 +1600,12 @@ var mt = async (r, e, t) => await b(
1601
1600
  },
1602
1601
  { type: "GET_BALANCE_ERROR" }
1603
1602
  );
1604
- async function ft(r, e, t) {
1605
- return await b(
1603
+ async function mt(r, e, t) {
1604
+ return await x(
1606
1605
  async () => {
1607
1606
  const n = new (0, _ethers.Contract)(
1608
1607
  t,
1609
- JSON.stringify(x),
1608
+ JSON.stringify(b),
1610
1609
  r
1611
1610
  );
1612
1611
  return Promise.all([
@@ -1629,92 +1628,92 @@ async function ft(r, e, t) {
1629
1628
  { type: "GET_ERC20_BALANCE_ERROR" }
1630
1629
  );
1631
1630
  }
1632
- var ut = /* @__PURE__ */ new Map();
1633
- var gt = () => ut.clear();
1634
- var Yn = async (r, e, t, n) => {
1631
+ var lt = /* @__PURE__ */ new Map();
1632
+ var ft = () => lt.clear();
1633
+ var jn = async (r, e, t, n) => {
1635
1634
  const o = n !== void 0;
1636
1635
  const a = Object.assign(
1637
1636
  {},
1638
1637
  ...(_nullishCoalesce(n, () => ( []))).map((m) => ({ [_optionalChain([m, 'access', _55 => _55.address, 'optionalAccess', _56 => _56.toLowerCase, 'call', _57 => _57()]) || _]: m }))
1639
1638
  );
1640
- let i = ut.get(t);
1639
+ let i = lt.get(t);
1641
1640
  if (!i) {
1642
1641
  const m = r.remote.getHttpClient();
1643
- i = new Ie(m, t);
1644
- ut.set(t, i);
1642
+ i = new Te(m, t);
1643
+ lt.set(t, i);
1645
1644
  }
1646
1645
  const s = [];
1647
1646
  const c = "ERC-20";
1648
1647
  const d = async (m) => {
1649
- let g;
1648
+ let E;
1650
1649
  try {
1651
1650
  do {
1652
- g = await m.getTokensByWalletAddress({
1651
+ E = await m.getTokensByWalletAddress({
1653
1652
  walletAddress: e,
1654
1653
  tokenType: c,
1655
- nextPage: _optionalChain([g, 'optionalAccess', _58 => _58.next_page_params])
1654
+ nextPage: _optionalChain([E, 'optionalAccess', _58 => _58.next_page_params])
1656
1655
  });
1657
- s.push(...g.items);
1658
- } while (g.next_page_params);
1659
- } catch (E) {
1660
- if (_optionalChain([E, 'optionalAccess', _59 => _59.code]) !== _axios.HttpStatusCode.NotFound) {
1656
+ s.push(...E.items);
1657
+ } while (E.next_page_params);
1658
+ } catch (g) {
1659
+ if (_optionalChain([g, 'optionalAccess', _59 => _59.code]) !== _axios.HttpStatusCode.NotFound) {
1661
1660
  throw new l(
1662
- E.message || "InternalServerError | getTokensByWalletAddress",
1661
+ g.message || "InternalServerError | getTokensByWalletAddress",
1663
1662
  "GET_INDEXER_BALANCE_ERROR",
1664
- { error: E }
1663
+ { error: g }
1665
1664
  );
1666
1665
  }
1667
1666
  }
1668
1667
  };
1669
- const u = async (m) => {
1668
+ const p = async (m) => {
1670
1669
  try {
1671
- const g = await m.getNativeTokenByWalletAddress({ walletAddress: e });
1672
- g.token.address ||= _;
1673
- s.push(g);
1674
- } catch (g) {
1675
- if (_optionalChain([g, 'optionalAccess', _60 => _60.code]) !== _axios.HttpStatusCode.NotFound) {
1670
+ const E = await m.getNativeTokenByWalletAddress({ walletAddress: e });
1671
+ E.token.address ||= _;
1672
+ s.push(E);
1673
+ } catch (E) {
1674
+ if (_optionalChain([E, 'optionalAccess', _60 => _60.code]) !== _axios.HttpStatusCode.NotFound) {
1676
1675
  throw new l(
1677
- g.message || "InternalServerError | getNativeTokenByWalletAddress",
1676
+ E.message || "InternalServerError | getNativeTokenByWalletAddress",
1678
1677
  "GET_INDEXER_BALANCE_ERROR",
1679
- { error: g }
1678
+ { error: E }
1680
1679
  );
1681
1680
  }
1682
1681
  }
1683
1682
  };
1684
1683
  await Promise.all([
1685
1684
  d(i),
1686
- u(i)
1685
+ p(i)
1687
1686
  ]);
1688
- const p = [];
1687
+ const u = [];
1689
1688
  s.forEach((m) => {
1690
- const g = a[m.token.address.toLowerCase()];
1691
- if (o && !g) return;
1692
- const E = m.token || {};
1689
+ const E = a[m.token.address.toLowerCase()];
1690
+ if (o && !E) return;
1691
+ const g = m.token || {};
1693
1692
  if (m.value == null) return;
1694
1693
  const f = BigInt(m.value);
1695
- let R = parseInt(E.decimals, 10);
1694
+ let R = parseInt(g.decimals, 10);
1696
1695
  if (Number.isNaN(R)) R = q;
1697
- const T = _nullishCoalesce(E.icon_url, () => ( g.icon));
1696
+ const T = _nullishCoalesce(g.icon_url, () => ( E.icon));
1698
1697
  const C = {
1699
- ...E,
1698
+ ...g,
1700
1699
  decimals: R,
1701
1700
  icon: T
1702
1701
  };
1703
- const w = _ethers.formatUnits.call(void 0, m.value, C.decimals);
1704
- p.push({ balance: f, formattedBalance: w, token: C });
1702
+ const y = _ethers.formatUnits.call(void 0, m.value, C.decimals);
1703
+ u.push({ balance: f, formattedBalance: y, token: C });
1705
1704
  });
1706
- return { balances: p };
1705
+ return { balances: u };
1707
1706
  };
1708
- var Jn = async (r, e, t, n) => {
1707
+ var Vn = async (r, e, t, n) => {
1709
1708
  const o = [];
1710
1709
  n.forEach((s) => {
1711
1710
  if (!s.address || I(s.address, _)) {
1712
1711
  o.push(
1713
- mt(r, e, t)
1712
+ ut(r, e, t)
1714
1713
  );
1715
1714
  } else {
1716
1715
  o.push(
1717
- ft(e, t, s.address)
1716
+ mt(e, t, s.address)
1718
1717
  );
1719
1718
  }
1720
1719
  });
@@ -1729,7 +1728,7 @@ var Jn = async (r, e, t, n) => {
1729
1728
  });
1730
1729
  return { balances: i };
1731
1730
  };
1732
- var Xt = async (r, e, t, n, o) => {
1731
+ var Jt = async (r, e, t, n, o) => {
1733
1732
  if (!e) {
1734
1733
  throw new l(
1735
1734
  "indexer is disabled for this chain, you must provide a provider.",
@@ -1741,7 +1740,7 @@ var Xt = async (r, e, t, n, o) => {
1741
1740
  return await S(
1742
1741
  r,
1743
1742
  `Time to fetch balances using RPC for ${n}`,
1744
- Jn(r, e, a, o)
1743
+ Vn(r, e, a, o)
1745
1744
  );
1746
1745
  };
1747
1746
  var G = async (r, e, t, n, o = false) => {
@@ -1765,28 +1764,28 @@ var G = async (r, e, t, n, o = false) => {
1765
1764
  }
1766
1765
  );
1767
1766
  if (o) {
1768
- gt();
1767
+ ft();
1769
1768
  }
1770
- if (Ie.isChainSupported(n)) {
1769
+ if (Te.isChainSupported(n)) {
1771
1770
  const i = await _asyncNullishCoalesce(t, async () => ( await await _asyncOptionalChain([(await _optionalChain([e, 'optionalAccess', _61 => _61.getSigner, 'call', _62 => _62()])), 'optionalAccess', async _63 => _63.getAddress, 'call', async _64 => _64()])));
1772
1771
  try {
1773
1772
  return await S(
1774
1773
  r,
1775
1774
  `Time to fetch balances using blockscout for ${n}`,
1776
- Yn(r, i, n, a)
1775
+ jn(r, i, n, a)
1777
1776
  );
1778
1777
  } catch (s) {
1779
1778
  if (s.type === "GET_INDEXER_BALANCE_ERROR" && _optionalChain([s, 'access', _65 => _65.data, 'optionalAccess', _66 => _66.error, 'optionalAccess', _67 => _67.code]) === _axios.HttpStatusCode.TooManyRequests) {
1780
- return Xt(r, e, t, n, a);
1779
+ return Jt(r, e, t, n, a);
1781
1780
  }
1782
1781
  throw s;
1783
1782
  }
1784
1783
  }
1785
- return Xt(r, e, t, n, a);
1784
+ return Jt(r, e, t, n, a);
1786
1785
  };
1787
1786
 
1788
1787
  // src/connect/connect.ts
1789
- async function er(r) {
1788
+ async function $t(r) {
1790
1789
  if (!_optionalChain([r, 'optionalAccess', _68 => _68.send])) {
1791
1790
  throw new l(
1792
1791
  "Check wallet connection request failed",
@@ -1814,7 +1813,7 @@ async function er(r) {
1814
1813
  walletAddress: _nullishCoalesce(e[0], () => ( ""))
1815
1814
  };
1816
1815
  }
1817
- async function tr(r) {
1816
+ async function Xt(r) {
1818
1817
  if (!r || !r.send) {
1819
1818
  throw new l(
1820
1819
  "Incompatible provider",
@@ -1822,7 +1821,7 @@ async function tr(r) {
1822
1821
  { details: "Attempting to connect with an incompatible provider" }
1823
1822
  );
1824
1823
  }
1825
- await b(
1824
+ await x(
1826
1825
  async () => {
1827
1826
  if (!r.send) return;
1828
1827
  await r.send("eth_requestAccounts", []);
@@ -1831,7 +1830,7 @@ async function tr(r) {
1831
1830
  );
1832
1831
  return r;
1833
1832
  }
1834
- async function rr(r) {
1833
+ async function er(r) {
1835
1834
  if (!r || !r.send) {
1836
1835
  throw new l(
1837
1836
  "Incompatible provider",
@@ -1839,7 +1838,7 @@ async function rr(r) {
1839
1838
  { details: "Attempting to connect with an incompatible provider" }
1840
1839
  );
1841
1840
  }
1842
- await b(
1841
+ await x(
1843
1842
  async () => {
1844
1843
  if (!r.send) return;
1845
1844
  await r.send("wallet_requestPermissions", [{ eth_accounts: {} }]);
@@ -1872,7 +1871,7 @@ var Oe = class {
1872
1871
  const t = await this.config.remote.getConfig(
1873
1872
  "onramp"
1874
1873
  );
1875
- const n = Dt[this.config.environment];
1874
+ const n = bt[this.config.environment];
1876
1875
  let o = {
1877
1876
  apiKey: t["201811419111"].publishableApiKey,
1878
1877
  network: "immutablezkevm",
@@ -1927,7 +1926,7 @@ var Oe = class {
1927
1926
 
1928
1927
 
1929
1928
  var _bridgesdk = require('@imtbl/bridge-sdk');
1930
- async function or(r, e, t, n) {
1929
+ async function rr(r, e, t, n) {
1931
1930
  const o = e === N(n) ? _bridgesdk.BridgeFeeActions.DEPOSIT : _bridgesdk.BridgeFeeActions.WITHDRAW;
1932
1931
  return await r.getFee({
1933
1932
  action: o,
@@ -1951,7 +1950,7 @@ async function or(r, e, t, n) {
1951
1950
  var _dexsdk = require('@imtbl/dex-sdk');
1952
1951
  var _orderbook = require('@imtbl/orderbook');
1953
1952
  var _blockchaindata = require('@imtbl/blockchain-data');
1954
- function Me(r, e, t, n) {
1953
+ function Be(r, e, t, n) {
1955
1954
  const o = t.get(r);
1956
1955
  const a = t.get(e);
1957
1956
  if (!o) {
@@ -1997,7 +1996,7 @@ function ae(r) {
1997
1996
  }
1998
1997
  });
1999
1998
  }
2000
- function Be(r) {
1999
+ function Me(r) {
2001
2000
  return new (0, _blockchaindata.BlockchainData)({
2002
2001
  baseConfig: {
2003
2002
  environment: r.environment
@@ -2009,26 +2008,26 @@ function Be(r) {
2009
2008
 
2010
2009
 
2011
2010
 
2012
- function ir(r, e, t) {
2011
+ function or(r, e, t) {
2013
2012
  return new (0, _ethers.Contract)(r, e, t);
2014
2013
  }
2015
2014
 
2016
2015
  // src/gasEstimate/gasEstimator.ts
2017
- var uo = "0x0000000000000000000000000000000000000001";
2018
- var sr = 18;
2019
- async function po(r, e) {
2016
+ var no = "0x0000000000000000000000000000000000000001";
2017
+ var ar = 18;
2018
+ async function oo(r, e) {
2020
2019
  const t = N(e);
2021
2020
  const n = A(e);
2022
2021
  const o = r.get(t);
2023
2022
  if (!o) throw new Error(`Missing JsonRpcProvider for chain id: ${t}`);
2024
2023
  try {
2025
- const a = Me(
2024
+ const a = Be(
2026
2025
  t,
2027
2026
  n,
2028
2027
  r,
2029
2028
  e
2030
2029
  );
2031
- const i = await or(
2030
+ const i = await rr(
2032
2031
  a,
2033
2032
  t,
2034
2033
  n,
@@ -2053,7 +2052,7 @@ async function po(r, e) {
2053
2052
  };
2054
2053
  }
2055
2054
  }
2056
- async function mo(r) {
2055
+ async function ao(r) {
2057
2056
  const e = A(r);
2058
2057
  const t = await r.remote.getConfig(
2059
2058
  "gasEstimateTokens"
@@ -2062,10 +2061,10 @@ async function mo(r) {
2062
2061
  try {
2063
2062
  const a = await oe(e, r);
2064
2063
  const { swap: i } = await a.getUnsignedSwapTxFromAmountIn(
2065
- uo,
2064
+ no,
2066
2065
  n,
2067
2066
  o,
2068
- BigInt(_ethers.parseUnits.call(void 0, "1", sr))
2067
+ BigInt(_ethers.parseUnits.call(void 0, "1", ar))
2069
2068
  );
2070
2069
  if (!i.gasFeeEstimate) {
2071
2070
  return {
@@ -2081,7 +2080,7 @@ async function mo(r) {
2081
2080
  address: i.gasFeeEstimate.token.address,
2082
2081
  symbol: _nullishCoalesce(i.gasFeeEstimate.token.symbol, () => ( "")),
2083
2082
  name: _nullishCoalesce(i.gasFeeEstimate.token.name, () => ( "")),
2084
- decimals: _nullishCoalesce(i.gasFeeEstimate.token.decimals, () => ( sr))
2083
+ decimals: _nullishCoalesce(i.gasFeeEstimate.token.decimals, () => ( ar))
2085
2084
  }
2086
2085
  }
2087
2086
  };
@@ -2092,15 +2091,15 @@ async function mo(r) {
2092
2091
  };
2093
2092
  }
2094
2093
  }
2095
- async function cr(r, e, t) {
2094
+ async function ir(r, e, t) {
2096
2095
  switch (r.gasEstimateType) {
2097
2096
  case "BRIDGE_TO_L2":
2098
- return await po(
2097
+ return await oo(
2099
2098
  e,
2100
2099
  t
2101
2100
  );
2102
2101
  case "SWAP":
2103
- return await mo(t);
2102
+ return await ao(t);
2104
2103
  default:
2105
2104
  throw new l(
2106
2105
  "Invalid type provided for gasEstimateType",
@@ -2110,9 +2109,9 @@ async function cr(r, e, t) {
2110
2109
  }
2111
2110
 
2112
2111
  // src/gasEstimate/gasPriceInWei.ts
2113
- var fo = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2112
+ var io = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2114
2113
  var Et = (r) => {
2115
- if (fo(r)) {
2114
+ if (io(r)) {
2116
2115
  const { maxFeePerGas: e, maxPriorityFeePerGas: t } = r;
2117
2116
  if (e === null || t === null) return null;
2118
2117
  const n = (e - t) / BigInt(2);
@@ -2126,7 +2125,7 @@ var Et = (r) => {
2126
2125
  var _detectprovider = require('@metamask/detect-provider'); var _detectprovider2 = _interopRequireDefault(_detectprovider);
2127
2126
 
2128
2127
  // src/provider/injected/utils.ts
2129
- function Rt(r) {
2128
+ function gt(r) {
2130
2129
  if (typeof window === "undefined") return;
2131
2130
  const e = (t) => r(t.detail);
2132
2131
  window.addEventListener("eip6963:announceProvider", e);
@@ -2135,10 +2134,10 @@ function Rt(r) {
2135
2134
  }
2136
2135
 
2137
2136
  // src/provider/injected/store.ts
2138
- function Ct() {
2137
+ function Rt() {
2139
2138
  const r = /* @__PURE__ */ new Set();
2140
2139
  let e = [];
2141
- const t = () => Rt((o) => {
2140
+ const t = () => gt((o) => {
2142
2141
  if (e.some(
2143
2142
  ({ info: a }) => a.uuid === o.info.uuid
2144
2143
  )) return;
@@ -2188,7 +2187,7 @@ var D = (_class5 = class r {
2188
2187
 
2189
2188
  __init7() {this.isInit = false}
2190
2189
  constructor() {;_class5.prototype.__init7.call(this);
2191
- this.store = Ct();
2190
+ this.store = Rt();
2192
2191
  this.store.reset();
2193
2192
  }
2194
2193
  static getInstance() {
@@ -2231,32 +2230,32 @@ var D = (_class5 = class r {
2231
2230
  }, _class5);
2232
2231
 
2233
2232
  // src/provider/providerDetail.ts
2234
- var be = {
2233
+ var xe = {
2235
2234
  name: "MetaMask",
2236
2235
  rdns: "io.metamask",
2237
2236
  // eslint-disable-next-line max-len
2238
2237
  icon: "data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMzIiB2aWV3Qm94PSIwIDAgMzUgMzMiIHdpZHRoPSIzNSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iLjI1Ij48cGF0aCBkPSJtMzIuOTU4MiAxLTEzLjEzNDEgOS43MTgzIDIuNDQyNC01LjcyNzMxeiIgZmlsbD0iI2UxNzcyNiIgc3Ryb2tlPSIjZTE3NzI2Ii8+PGcgZmlsbD0iI2UyNzYyNSIgc3Ryb2tlPSIjZTI3NjI1Ij48cGF0aCBkPSJtMi42NjI5NiAxIDEzLjAxNzE0IDkuODA5LTIuMzI1NC01LjgxODAyeiIvPjxwYXRoIGQ9Im0yOC4yMjk1IDIzLjUzMzUtMy40OTQ3IDUuMzM4NiA3LjQ4MjkgMi4wNjAzIDIuMTQzNi03LjI4MjN6Ii8+PHBhdGggZD0ibTEuMjcyODEgMjMuNjUwMSAyLjEzMDU1IDcuMjgyMyA3LjQ2OTk0LTIuMDYwMy0zLjQ4MTY2LTUuMzM4NnoiLz48cGF0aCBkPSJtMTAuNDcwNiAxNC41MTQ5LTIuMDc4NiAzLjEzNTggNy40MDUuMzM2OS0uMjQ2OS03Ljk2OXoiLz48cGF0aCBkPSJtMjUuMTUwNSAxNC41MTQ5LTUuMTU3NS00LjU4NzA0LS4xNjg4IDguMDU5NzQgNy40MDQ5LS4zMzY5eiIvPjxwYXRoIGQ9Im0xMC44NzMzIDI4Ljg3MjEgNC40ODE5LTIuMTYzOS0zLjg1ODMtMy4wMDYyeiIvPjxwYXRoIGQ9Im0yMC4yNjU5IDI2LjcwODIgNC40Njg5IDIuMTYzOS0uNjEwNS01LjE3MDF6Ii8+PC9nPjxwYXRoIGQ9Im0yNC43MzQ4IDI4Ljg3MjEtNC40NjktMi4xNjM5LjM2MzggMi45MDI1LS4wMzkgMS4yMzF6IiBmaWxsPSIjZDViZmIyIiBzdHJva2U9IiNkNWJmYjIiLz48cGF0aCBkPSJtMTAuODczMiAyOC44NzIxIDQuMTU3MiAxLjk2OTYtLjAyNi0xLjIzMS4zNTA4LTIuOTAyNXoiIGZpbGw9IiNkNWJmYjIiIHN0cm9rZT0iI2Q1YmZiMiIvPjxwYXRoIGQ9Im0xNS4xMDg0IDIxLjc4NDItMy43MTU1LTEuMDg4NCAyLjYyNDMtMS4yMDUxeiIgZmlsbD0iIzIzMzQ0NyIgc3Ryb2tlPSIjMjMzNDQ3Ii8+PHBhdGggZD0ibTIwLjUxMjYgMjEuNzg0MiAxLjA5MTMtMi4yOTM1IDIuNjM3MiAxLjIwNTF6IiBmaWxsPSIjMjMzNDQ3IiBzdHJva2U9IiMyMzM0NDciLz48cGF0aCBkPSJtMTAuODczMyAyOC44NzIxLjY0OTUtNS4zMzg2LTQuMTMxMTcuMTE2N3oiIGZpbGw9IiNjYzYyMjgiIHN0cm9rZT0iI2NjNjIyOCIvPjxwYXRoIGQ9Im0yNC4wOTgyIDIzLjUzMzUuNjM2NiA1LjMzODYgMy40OTQ2LTUuMjIxOXoiIGZpbGw9IiNjYzYyMjgiIHN0cm9rZT0iI2NjNjIyOCIvPjxwYXRoIGQ9Im0yNy4yMjkxIDE3LjY1MDctNy40MDUuMzM2OS42ODg1IDMuNzk2NiAxLjA5MTMtMi4yOTM1IDIuNjM3MiAxLjIwNTF6IiBmaWxsPSIjY2M2MjI4IiBzdHJva2U9IiNjYzYyMjgiLz48cGF0aCBkPSJtMTEuMzkyOSAyMC42OTU4IDIuNjI0Mi0xLjIwNTEgMS4wOTEzIDIuMjkzNS42ODg1LTMuNzk2Ni03LjQwNDk1LS4zMzY5eiIgZmlsbD0iI2NjNjIyOCIgc3Ryb2tlPSIjY2M2MjI4Ii8+PHBhdGggZD0ibTguMzkyIDE3LjY1MDcgMy4xMDQ5IDYuMDUxMy0uMTAzOS0zLjAwNjJ6IiBmaWxsPSIjZTI3NTI1IiBzdHJva2U9IiNlMjc1MjUiLz48cGF0aCBkPSJtMjQuMjQxMiAyMC42OTU4LS4xMTY5IDMuMDA2MiAzLjEwNDktNi4wNTEzeiIgZmlsbD0iI2UyNzUyNSIgc3Ryb2tlPSIjZTI3NTI1Ii8+PHBhdGggZD0ibTE1Ljc5NyAxNy45ODc2LS42ODg2IDMuNzk2Ny44NzA0IDQuNDgzMy4xOTQ5LTUuOTA4N3oiIGZpbGw9IiNlMjc1MjUiIHN0cm9rZT0iI2UyNzUyNSIvPjxwYXRoIGQ9Im0xOS44MjQyIDE3Ljk4NzYtLjM2MzggMi4zNTg0LjE4MTkgNS45MjE2Ljg3MDQtNC40ODMzeiIgZmlsbD0iI2UyNzUyNSIgc3Ryb2tlPSIjZTI3NTI1Ii8+PHBhdGggZD0ibTIwLjUxMjcgMjEuNzg0Mi0uODcwNCA0LjQ4MzQuNjIzNi40NDA2IDMuODU4NC0zLjAwNjIuMTE2OS0zLjAwNjJ6IiBmaWxsPSIjZjU4NDFmIiBzdHJva2U9IiNmNTg0MWYiLz48cGF0aCBkPSJtMTEuMzkyOSAyMC42OTU4LjEwNCAzLjAwNjIgMy44NTgzIDMuMDA2Mi42MjM2LS40NDA2LS44NzA0LTQuNDgzNHoiIGZpbGw9IiNmNTg0MWYiIHN0cm9rZT0iI2Y1ODQxZiIvPjxwYXRoIGQ9Im0yMC41OTA2IDMwLjg0MTcuMDM5LTEuMjMxLS4zMzc4LS4yODUxaC00Ljk2MjZsLS4zMjQ4LjI4NTEuMDI2IDEuMjMxLTQuMTU3Mi0xLjk2OTYgMS40NTUxIDEuMTkyMSAyLjk0ODkgMi4wMzQ0aDUuMDUzNmwyLjk2Mi0yLjAzNDQgMS40NDItMS4xOTIxeiIgZmlsbD0iI2MwYWM5ZCIgc3Ryb2tlPSIjYzBhYzlkIi8+PHBhdGggZD0ibTIwLjI2NTkgMjYuNzA4Mi0uNjIzNi0uNDQwNmgtMy42NjM1bC0uNjIzNi40NDA2LS4zNTA4IDIuOTAyNS4zMjQ4LS4yODUxaDQuOTYyNmwuMzM3OC4yODUxeiIgZmlsbD0iIzE2MTYxNiIgc3Ryb2tlPSIjMTYxNjE2Ii8+PHBhdGggZD0ibTMzLjUxNjggMTEuMzUzMiAxLjEwNDMtNS4zNjQ0Ny0xLjY2MjktNC45ODg3My0xMi42OTIzIDkuMzk0NCA0Ljg4NDYgNC4xMjA1IDYuODk4MyAyLjAwODUgMS41Mi0xLjc3NTItLjY2MjYtLjQ3OTUgMS4wNTIzLS45NTg4LS44MDU0LS42MjIgMS4wNTIzLS44MDM0eiIgZmlsbD0iIzc2M2UxYSIgc3Ryb2tlPSIjNzYzZTFhIi8+PHBhdGggZD0ibTEgNS45ODg3MyAxLjExNzI0IDUuMzY0NDctLjcxNDUxLjUzMTMgMS4wNjUyNy44MDM0LS44MDU0NS42MjIgMS4wNTIyOC45NTg4LS42NjI1NS40Nzk1IDEuNTE5OTcgMS43NzUyIDYuODk4MzUtMi4wMDg1IDQuODg0Ni00LjEyMDUtMTIuNjkyMzMtOS4zOTQ0eiIgZmlsbD0iIzc2M2UxYSIgc3Ryb2tlPSIjNzYzZTFhIi8+PHBhdGggZD0ibTMyLjA0ODkgMTYuNTIzNC02Ljg5ODMtMi4wMDg1IDIuMDc4NiAzLjEzNTgtMy4xMDQ5IDYuMDUxMyA0LjEwNTItLjA1MTloNi4xMzE4eiIgZmlsbD0iI2Y1ODQxZiIgc3Ryb2tlPSIjZjU4NDFmIi8+PHBhdGggZD0ibTEwLjQ3MDUgMTQuNTE0OS02Ljg5ODI4IDIuMDA4NS0yLjI5OTQ0IDcuMTI2N2g2LjExODgzbDQuMTA1MTkuMDUxOS0zLjEwNDg3LTYuMDUxM3oiIGZpbGw9IiNmNTg0MWYiIHN0cm9rZT0iI2Y1ODQxZiIvPjxwYXRoIGQ9Im0xOS44MjQxIDE3Ljk4NzYuNDQxNy03LjU5MzIgMi4wMDA3LTUuNDAzNGgtOC45MTE5bDIuMDAwNiA1LjQwMzQuNDQxNyA3LjU5MzIuMTY4OSAyLjM4NDIuMDEzIDUuODk1OGgzLjY2MzVsLjAxMy01Ljg5NTh6IiBmaWxsPSIjZjU4NDFmIiBzdHJva2U9IiNmNTg0MWYiLz48L2c+PC9zdmc+",
2239
2238
  uuid: "fb8e904e-1a71-454a-af65-dc1ee86311c3"
2240
2239
  };
2241
- var xe = {
2240
+ var be = {
2242
2241
  // eslint-disable-next-line max-len
2243
2242
  icon: 'data:image/svg+xml,<svg viewBox="0 0 48 48" class="SvgIcon undefined Logo Logo--PassportSymbolOutlined css-1dn9atd" xmlns="http://www.w3.org/2000/svg"><g data-testid="undefined__g"><circle cx="24" cy="24" r="22.5" fill="url(%23paint0_radial_6324_83922)"></circle><circle cx="24" cy="24" r="22.5" fill="url(%23paint1_radial_6324_83922)"></circle><path d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM23.0718 9.16608C23.7383 8.83951 24.4406 8.86188 25.087 9.2287C27.3282 10.5059 29.5627 11.7942 31.786 13.096C32.5018 13.5165 32.8686 14.1897 32.8708 15.0173C32.8843 17.9184 32.8798 20.8171 32.8708 23.7182C32.8708 23.8255 32.8015 23.9821 32.7143 24.0335C31.8531 24.548 30.9808 25.0423 30.0347 25.5881V25.1318C30.0347 22.148 30.0257 19.1664 30.0414 16.1827C30.0436 15.6101 29.8468 15.241 29.339 14.9525C26.7377 13.474 24.1499 11.9687 21.5575 10.4723C21.4457 10.4075 21.3361 10.3381 21.1661 10.2352C21.8326 9.85722 22.4321 9.47698 23.0673 9.16608H23.0718ZM22.5953 38.8451C22.45 38.7713 22.3426 38.7198 22.2375 38.6595C18.8041 36.68 15.3752 34.687 11.9307 32.7232C10.9644 32.173 10.5238 31.3879 10.5349 30.2852C10.5551 27.9411 10.5484 25.597 10.5372 23.2507C10.5327 22.1927 10.9622 21.4255 11.8926 20.8977C14.3105 19.5221 16.715 18.1264 19.1195 16.7284C19.3275 16.6076 19.4796 16.5875 19.6965 16.7172C20.5264 17.216 21.3719 17.6924 22.2554 18.2024C22.0876 18.3031 21.9601 18.3791 21.8304 18.4552C19.2268 19.9582 16.6278 21.4658 14.0175 22.9599C13.5903 23.2037 13.3912 23.5213 13.3957 24.0179C13.4091 25.8654 13.4114 27.713 13.3957 29.5605C13.3912 30.0705 13.5948 30.3948 14.0332 30.6453C16.7866 32.2199 19.5288 33.8125 22.28 35.3916C22.5126 35.5258 22.611 35.6645 22.6065 35.9418C22.5864 36.888 22.5998 37.8363 22.5998 38.8473L22.5953 38.8451ZM22.5953 33.553C22.356 33.4166 22.1838 33.3204 22.0116 33.2198C19.8285 31.9605 17.6477 30.6967 15.4602 29.4464C15.2231 29.3122 15.1359 29.1668 15.1381 28.8917C15.1538 27.4714 15.1471 26.0511 15.1426 24.6308C15.1426 24.4384 15.1717 24.3064 15.3618 24.1991C16.167 23.7495 16.9633 23.2798 17.7618 22.8212C17.8199 22.7877 17.8826 22.7631 17.9877 22.7116V24.3064C17.9877 25.1698 18.0011 26.0354 17.9832 26.8988C17.972 27.3909 18.1622 27.7241 18.5916 27.9657C19.8285 28.6636 21.0498 29.3883 22.2867 30.0839C22.5305 30.2203 22.6043 30.3724 22.5998 30.6408C22.5842 31.5847 22.5931 32.5308 22.5931 33.5508L22.5953 33.553ZM20.0746 14.91C19.6116 14.6371 19.2157 14.6393 18.7527 14.91C16.1581 16.4265 13.5523 17.9228 10.9487 19.4259C10.8391 19.4908 10.7251 19.5489 10.5305 19.6541C10.5998 18.6654 10.3873 17.7327 10.7251 16.8291C10.9085 16.3348 11.2529 15.9635 11.7092 15.6995C13.8811 14.4447 16.0507 13.1877 18.227 11.9396C19.0211 11.4833 19.8308 11.4945 20.6248 11.953C23.0964 13.3756 25.5657 14.8026 28.0306 16.2341C28.1357 16.2945 28.2677 16.4309 28.2677 16.5338C28.2856 17.5493 28.2788 18.567 28.2788 19.6563C27.3819 19.1396 26.5543 18.6609 25.7267 18.1823C23.8412 17.093 21.9512 16.0149 20.0746 14.91ZM37.4427 30.8779C37.3778 31.6764 36.9103 32.2423 36.2192 32.6404C33.5732 34.1614 30.9294 35.6913 28.2856 37.2168C27.4557 37.6954 26.6259 38.1741 25.7938 38.6527C25.6932 38.7109 25.5903 38.7601 25.4539 38.8317C25.4449 38.693 25.4337 38.5924 25.4337 38.4917C25.4337 37.6149 25.4382 36.7404 25.4293 35.8636C25.4293 35.6645 25.4762 35.5437 25.6596 35.4386C29.5157 33.2198 33.3696 30.9942 37.2212 28.7709C37.2794 28.7374 37.3443 28.7105 37.4539 28.6591C37.4539 29.4375 37.4986 30.1622 37.4427 30.8779ZM37.4628 25.3577C37.4561 26.2658 36.9663 26.9033 36.1901 27.3506C33.175 29.0841 30.1622 30.8265 27.1493 32.5666C26.5991 32.8842 26.0466 33.1996 25.4561 33.5396C25.4472 33.3897 25.436 33.2913 25.436 33.1907C25.436 32.3273 25.4449 31.4617 25.4293 30.5983C25.4248 30.3523 25.5075 30.2226 25.72 30.0995C28.46 28.5271 31.1911 26.9368 33.9355 25.3733C34.4231 25.096 34.6378 24.7538 34.6334 24.1812C34.6132 21.1974 34.6244 18.2136 34.6244 15.2298V14.7087C35.3402 15.1404 36.0112 15.496 36.624 15.9299C37.1832 16.3258 37.465 16.9253 37.4673 17.6164C37.4762 20.1976 37.4829 22.7788 37.465 25.3599L37.4628 25.3577Z" fill="%230D0D0D"></path><path fill-rule="evenodd" d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2Z" fill="url(%23paint2_radial_6324_83922)"></path><path fill-rule="evenodd" d="M24 0C10.7452 0 0 10.7452 0 24C0 37.2548 10.7452 48 24 48C37.2548 48 48 37.2548 48 24C48 10.7452 37.2548 0 24 0ZM24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2Z" fill="url(%23paint3_radial_6324_83922)"></path><defs><radialGradient id="paint0_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(13.4442 13.3899) rotate(44.9817) scale(46.7487 99.1435)"><stop stop-color="%23A3EEF8"></stop><stop offset="0.177083" stop-color="%23A4DCF5"></stop><stop offset="0.380208" stop-color="%23A6AEEC"></stop><stop offset="1" stop-color="%23ECBEE1"></stop></radialGradient><radialGradient id="paint1_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(25.9515 43.7068) rotate(84.265) scale(24.2138 46.3215)"><stop stop-color="%23FCF5EE"></stop><stop offset="0.715135" stop-color="%23ECBEE1" stop-opacity="0"></stop></radialGradient><radialGradient id="paint2_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(12.7405 12.6825) rotate(44.9817) scale(49.8653 105.753)"><stop stop-color="%23A3EEF8"></stop><stop offset="0.177083" stop-color="%23A4DCF5"></stop><stop offset="0.380208" stop-color="%23A6AEEC"></stop><stop offset="1" stop-color="%23ECBEE1"></stop></radialGradient><radialGradient id="paint3_radial_6324_83922" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26.0816 45.0206) rotate(84.265) scale(25.828 49.4096)"><stop stop-color="%23FCF5EE"></stop><stop offset="0.715135" stop-color="%23ECBEE1" stop-opacity="0"></stop></radialGradient></defs></g></svg>',
2244
2243
  name: "Immutable Passport",
2245
2244
  rdns: "com.immutable.passport",
2246
2245
  uuid: "b90118be-7234-4c89-b89b-d5d267663eb5"
2247
2246
  };
2248
- var Eo = (r) => ({
2249
- info: xe,
2247
+ var co = (r) => ({
2248
+ info: be,
2250
2249
  provider: r
2251
2250
  });
2252
- var Ro = (r) => ({
2253
- info: be,
2251
+ var lo = (r) => ({
2252
+ info: xe,
2254
2253
  provider: r
2255
2254
  });
2256
2255
 
2257
2256
  // src/provider/provider.ts
2258
- async function Io() {
2259
- const r = await b(
2257
+ async function uo() {
2258
+ const r = await x(
2260
2259
  async () => await _detectprovider2.default.call(void 0, ),
2261
2260
  { type: "METAMASK_PROVIDER_ERROR" }
2262
2261
  );
@@ -2268,12 +2267,12 @@ async function Io() {
2268
2267
  }
2269
2268
  return new L(r);
2270
2269
  }
2271
- async function dr(r, e) {
2270
+ async function sr(r, e) {
2272
2271
  let t = null;
2273
2272
  let n;
2274
2273
  switch (r) {
2275
2274
  case "passport": {
2276
- n = D.getInstance().findProvider({ rdns: xe.rdns });
2275
+ n = D.getInstance().findProvider({ rdns: be.rdns });
2277
2276
  if (!n) {
2278
2277
  if (e) {
2279
2278
  t = new L(
@@ -2292,9 +2291,9 @@ async function dr(r, e) {
2292
2291
  break;
2293
2292
  }
2294
2293
  case "metamask": {
2295
- n = D.getInstance().findProvider({ rdns: be.rdns });
2294
+ n = D.getInstance().findProvider({ rdns: xe.rdns });
2296
2295
  if (!n) {
2297
- t = await Io();
2296
+ t = await uo();
2298
2297
  }
2299
2298
  break;
2300
2299
  }
@@ -2327,11 +2326,11 @@ async function dr(r, e) {
2327
2326
  }
2328
2327
 
2329
2328
  // src/provider/validateProvider.ts
2330
- function lr(r) {
2329
+ function cr(r) {
2331
2330
  return r && "send" in r && typeof r.send === "function";
2332
2331
  }
2333
- async function B(r, e, t) {
2334
- return b(
2332
+ async function M(r, e, t) {
2333
+ return x(
2335
2334
  async () => {
2336
2335
  if ("request" in e) {
2337
2336
  return new L(e);
@@ -2340,10 +2339,10 @@ async function B(r, e, t) {
2340
2339
  return e;
2341
2340
  }
2342
2341
  const n = {
2343
- ...qt,
2342
+ ...Ut,
2344
2343
  ...t
2345
2344
  };
2346
- const o = await Ee(e);
2345
+ const o = await Re(e);
2347
2346
  let a = (await e.getNetwork()).chainId;
2348
2347
  try {
2349
2348
  if (!a) {
@@ -2399,7 +2398,7 @@ async function Le(r, e) {
2399
2398
  }
2400
2399
 
2401
2400
  // src/smartCheckout/aggregators/allowanceAggregator.ts
2402
- var ur = (r, e, t) => {
2401
+ var dr = (r, e, t) => {
2403
2402
  const n = [];
2404
2403
  if (!r.sufficient) {
2405
2404
  for (const o of r.allowances) {
@@ -2420,7 +2419,7 @@ var ur = (r, e, t) => {
2420
2419
  };
2421
2420
 
2422
2421
  // src/smartCheckout/aggregators/itemAggregator.ts
2423
- var Ao = (r) => {
2422
+ var Eo = (r) => {
2424
2423
  const e = /* @__PURE__ */ new Map();
2425
2424
  const t = [];
2426
2425
  r.forEach((n) => {
@@ -2443,7 +2442,7 @@ var Ao = (r) => {
2443
2442
  });
2444
2443
  return t.concat(Array.from(e.values()));
2445
2444
  };
2446
- var wo = (r) => {
2445
+ var go = (r) => {
2447
2446
  const e = /* @__PURE__ */ new Map();
2448
2447
  const t = [];
2449
2448
  r.forEach((n) => {
@@ -2458,16 +2457,16 @@ var wo = (r) => {
2458
2457
  };
2459
2458
  const { tokenAddress: i, spenderAddress: s, amount: c } = a;
2460
2459
  const d = `${i}${s}`;
2461
- const u = e.get(d);
2462
- if (u && u.type === "ERC20") {
2463
- u.amount += c;
2460
+ const p = e.get(d);
2461
+ if (p && p.type === "ERC20") {
2462
+ p.amount += c;
2464
2463
  } else {
2465
2464
  e.set(d, { ...a });
2466
2465
  }
2467
2466
  });
2468
2467
  return t.concat(Array.from(e.values()));
2469
2468
  };
2470
- var yo = (r) => {
2469
+ var Ro = (r) => {
2471
2470
  const e = /* @__PURE__ */ new Map();
2472
2471
  const t = [];
2473
2472
  r.forEach((n) => {
@@ -2483,7 +2482,7 @@ var yo = (r) => {
2483
2482
  });
2484
2483
  return t.concat(Array.from(e.values()));
2485
2484
  };
2486
- var So = (r) => {
2485
+ var Co = (r) => {
2487
2486
  const e = /* @__PURE__ */ new Map();
2488
2487
  const t = [];
2489
2488
  r.forEach((n) => {
@@ -2499,24 +2498,24 @@ var So = (r) => {
2499
2498
  amount: c
2500
2499
  } = n;
2501
2500
  const d = `${a}${i}${s}`;
2502
- const u = e.get(d);
2503
- if (u && u.type === "ERC1155") {
2504
- u.amount += c;
2501
+ const p = e.get(d);
2502
+ if (p && p.type === "ERC1155") {
2503
+ p.amount += c;
2505
2504
  } else {
2506
2505
  e.set(d, { ...n });
2507
2506
  }
2508
2507
  });
2509
2508
  return t.concat(Array.from(e.values()));
2510
2509
  };
2511
- var It = (r) => So(yo(wo(Ao(r))));
2510
+ var Ct = (r) => Co(Ro(go(Eo(r))));
2512
2511
 
2513
2512
  // src/smartCheckout/allowance/erc20.ts
2514
2513
 
2515
- var Po = async (r, e, t, n) => {
2514
+ var Io = async (r, e, t, n) => {
2516
2515
  try {
2517
2516
  const o = new (0, _ethers.Contract)(
2518
2517
  t,
2519
- JSON.stringify(x),
2518
+ JSON.stringify(b),
2520
2519
  r
2521
2520
  );
2522
2521
  return await o.allowance(e, n);
@@ -2528,11 +2527,11 @@ var Po = async (r, e, t, n) => {
2528
2527
  );
2529
2528
  }
2530
2529
  };
2531
- var ko = async (r, e, t, n, o) => {
2530
+ var To = async (r, e, t, n, o) => {
2532
2531
  try {
2533
2532
  const a = new (0, _ethers.Contract)(
2534
2533
  t,
2535
- JSON.stringify(x),
2534
+ JSON.stringify(b),
2536
2535
  r
2537
2536
  );
2538
2537
  const i = await a.approve.populateTransaction(n, o);
@@ -2546,52 +2545,52 @@ var ko = async (r, e, t, n, o) => {
2546
2545
  );
2547
2546
  }
2548
2547
  };
2549
- var mr = async (r, e, t) => {
2548
+ var pr = async (r, e, t) => {
2550
2549
  let n = true;
2551
2550
  const o = [];
2552
2551
  const a = /* @__PURE__ */ new Map();
2553
2552
  const i = /* @__PURE__ */ new Map();
2554
2553
  const s = /* @__PURE__ */ new Map();
2555
2554
  const c = /* @__PURE__ */ new Map();
2556
- for (const g of t) {
2557
- if (g.type !== "ERC20") continue;
2558
- const { tokenAddress: E, spenderAddress: f } = g;
2559
- const R = `${E}${f}`;
2560
- a.set(R, g);
2555
+ for (const E of t) {
2556
+ if (E.type !== "ERC20") continue;
2557
+ const { tokenAddress: g, spenderAddress: f } = E;
2558
+ const R = `${g}${f}`;
2559
+ a.set(R, E);
2561
2560
  i.set(
2562
2561
  R,
2563
- Po(r, e, E, f)
2562
+ Io(r, e, g, f)
2564
2563
  );
2565
2564
  }
2566
2565
  const d = await Promise.all(i.values());
2567
- const u = Array.from(i.keys());
2568
- for (let g = 0; g < d.length; g++) {
2569
- const E = a.get(u[g]);
2570
- if (!E || E.type !== "ERC20") continue;
2571
- if (d[g] >= E.amount) {
2566
+ const p = Array.from(i.keys());
2567
+ for (let E = 0; E < d.length; E++) {
2568
+ const g = a.get(p[E]);
2569
+ if (!g || g.type !== "ERC20") continue;
2570
+ if (d[E] >= g.amount) {
2572
2571
  o.push({
2573
2572
  sufficient: true,
2574
- itemRequirement: E
2573
+ itemRequirement: g
2575
2574
  });
2576
2575
  continue;
2577
2576
  }
2578
2577
  n = false;
2579
- const { tokenAddress: f, spenderAddress: R } = E;
2578
+ const { tokenAddress: f, spenderAddress: R } = g;
2580
2579
  const T = `${f}${R}`;
2581
- const C = E.amount - d[g];
2580
+ const C = g.amount - d[E];
2582
2581
  s.set(
2583
2582
  T,
2584
2583
  {
2585
2584
  type: "ERC20",
2586
2585
  sufficient: false,
2587
2586
  delta: C,
2588
- itemRequirement: E,
2587
+ itemRequirement: g,
2589
2588
  approvalTransaction: void 0
2590
2589
  }
2591
2590
  );
2592
2591
  c.set(
2593
2592
  T,
2594
- ko(
2593
+ To(
2595
2594
  r,
2596
2595
  e,
2597
2596
  f,
@@ -2600,20 +2599,20 @@ var mr = async (r, e, t) => {
2600
2599
  )
2601
2600
  );
2602
2601
  }
2603
- const p = await Promise.all(c.values());
2602
+ const u = await Promise.all(c.values());
2604
2603
  const m = Array.from(c.keys());
2605
- p.forEach((g, E) => {
2606
- const f = s.get(m[E]);
2604
+ u.forEach((E, g) => {
2605
+ const f = s.get(m[g]);
2607
2606
  if (!f) return;
2608
2607
  if (f.sufficient) return;
2609
- f.approvalTransaction = g;
2608
+ f.approvalTransaction = E;
2610
2609
  });
2611
2610
  return { sufficient: n, allowances: o.concat(Array.from(s.values())) };
2612
2611
  };
2613
2612
 
2614
2613
  // src/smartCheckout/allowance/erc721.ts
2615
2614
 
2616
- var vo = async (r, e, t, n) => {
2615
+ var ho = async (r, e, t, n) => {
2617
2616
  try {
2618
2617
  const o = new (0, _ethers.Contract)(
2619
2618
  t,
@@ -2634,7 +2633,7 @@ var vo = async (r, e, t, n) => {
2634
2633
  );
2635
2634
  }
2636
2635
  };
2637
- var No = async (r, e, t, n, o) => {
2636
+ var Ao = async (r, e, t, n, o) => {
2638
2637
  try {
2639
2638
  const a = new (0, _ethers.Contract)(
2640
2639
  t,
@@ -2658,7 +2657,7 @@ var No = async (r, e, t, n, o) => {
2658
2657
  );
2659
2658
  }
2660
2659
  };
2661
- var _o = async (r, e, t) => {
2660
+ var yo = async (r, e, t) => {
2662
2661
  try {
2663
2662
  const n = new (0, _ethers.Contract)(
2664
2663
  e,
@@ -2678,7 +2677,7 @@ var _o = async (r, e, t) => {
2678
2677
  );
2679
2678
  }
2680
2679
  };
2681
- var fr = (r, e) => {
2680
+ var ur = (r, e) => {
2682
2681
  try {
2683
2682
  if (!r.trim()) {
2684
2683
  throw new l(
@@ -2696,16 +2695,16 @@ var fr = (r, e) => {
2696
2695
  );
2697
2696
  }
2698
2697
  };
2699
- var Oo = async (r, e, t) => {
2698
+ var wo = async (r, e, t) => {
2700
2699
  const n = /* @__PURE__ */ new Map();
2701
2700
  const o = /* @__PURE__ */ new Map();
2702
2701
  for (const s of e) {
2703
2702
  if (s.type !== "ERC721") continue;
2704
2703
  const { contractAddress: c, spenderAddress: d } = s;
2705
- const u = `${c}-${d}`;
2706
- n.set(u, false);
2707
- if (o.has(u)) continue;
2708
- o.set(u, vo(
2704
+ const p = `${c}-${d}`;
2705
+ n.set(p, false);
2706
+ if (o.has(p)) continue;
2707
+ o.set(p, ho(
2709
2708
  r,
2710
2709
  t,
2711
2710
  c,
@@ -2719,44 +2718,44 @@ var Oo = async (r, e, t) => {
2719
2718
  });
2720
2719
  return n;
2721
2720
  };
2722
- var gr = async (r, e, t) => {
2721
+ var mr = async (r, e, t) => {
2723
2722
  let n = true;
2724
2723
  const o = [];
2725
2724
  const a = /* @__PURE__ */ new Map();
2726
2725
  const i = /* @__PURE__ */ new Map();
2727
2726
  const s = /* @__PURE__ */ new Map();
2728
2727
  const c = /* @__PURE__ */ new Map();
2729
- const d = await Oo(
2728
+ const d = await wo(
2730
2729
  r,
2731
2730
  t,
2732
2731
  e
2733
2732
  );
2734
- for (const E of t) {
2735
- if (E.type !== "ERC721") continue;
2736
- const { contractAddress: f, id: R, spenderAddress: T } = E;
2733
+ for (const g of t) {
2734
+ if (g.type !== "ERC721") continue;
2735
+ const { contractAddress: f, id: R, spenderAddress: T } = g;
2737
2736
  const C = `${f}-${T}`;
2738
- const w = d.get(C);
2739
- if (w) {
2737
+ const y = d.get(C);
2738
+ if (y) {
2740
2739
  o.push({
2741
2740
  sufficient: true,
2742
- itemRequirement: E
2741
+ itemRequirement: g
2743
2742
  });
2744
2743
  continue;
2745
2744
  }
2746
2745
  const P = `${f}-${R}`;
2747
- const v = fr(R, f);
2748
- a.set(P, E);
2746
+ const v = ur(R, f);
2747
+ a.set(P, g);
2749
2748
  i.set(
2750
2749
  P,
2751
- _o(r, f, v)
2750
+ yo(r, f, v)
2752
2751
  );
2753
2752
  }
2754
- const u = await Promise.all(i.values());
2755
- const p = Array.from(i.keys());
2756
- for (let E = 0; E < u.length; E++) {
2757
- const f = a.get(p[E]);
2753
+ const p = await Promise.all(i.values());
2754
+ const u = Array.from(i.keys());
2755
+ for (let g = 0; g < p.length; g++) {
2756
+ const f = a.get(u[g]);
2758
2757
  if (!f || f.type !== "ERC721") continue;
2759
- if (u[E] === f.spenderAddress) {
2758
+ if (p[g] === f.spenderAddress) {
2760
2759
  o.push({
2761
2760
  sufficient: true,
2762
2761
  itemRequirement: f
@@ -2765,10 +2764,10 @@ var gr = async (r, e, t) => {
2765
2764
  }
2766
2765
  n = false;
2767
2766
  const { contractAddress: R, id: T, spenderAddress: C } = f;
2768
- const w = `${R}-${T}`;
2769
- const P = fr(T, R);
2767
+ const y = `${R}-${T}`;
2768
+ const P = ur(T, R);
2770
2769
  s.set(
2771
- w,
2770
+ y,
2772
2771
  {
2773
2772
  type: "ERC721",
2774
2773
  sufficient: false,
@@ -2777,8 +2776,8 @@ var gr = async (r, e, t) => {
2777
2776
  }
2778
2777
  );
2779
2778
  c.set(
2780
- w,
2781
- No(
2779
+ y,
2780
+ Ao(
2782
2781
  r,
2783
2782
  e,
2784
2783
  R,
@@ -2788,19 +2787,19 @@ var gr = async (r, e, t) => {
2788
2787
  );
2789
2788
  }
2790
2789
  const m = await Promise.all(c.values());
2791
- const g = Array.from(c.keys());
2792
- m.forEach((E, f) => {
2793
- const R = s.get(g[f]);
2790
+ const E = Array.from(c.keys());
2791
+ m.forEach((g, f) => {
2792
+ const R = s.get(E[f]);
2794
2793
  if (!R) return;
2795
2794
  if (R.sufficient) return;
2796
- R.approvalTransaction = E;
2795
+ R.approvalTransaction = g;
2797
2796
  });
2798
2797
  return { sufficient: n, allowances: o.concat(Array.from(s.values())) };
2799
2798
  };
2800
2799
 
2801
2800
  // src/smartCheckout/allowance/erc1155.ts
2802
2801
 
2803
- var Mo = async (r, e, t, n) => {
2802
+ var So = async (r, e, t, n) => {
2804
2803
  try {
2805
2804
  const o = new (0, _ethers.Contract)(
2806
2805
  t,
@@ -2821,7 +2820,7 @@ var Mo = async (r, e, t, n) => {
2821
2820
  );
2822
2821
  }
2823
2822
  };
2824
- var Bo = async (r, e, t, n) => {
2823
+ var Po = async (r, e, t, n) => {
2825
2824
  try {
2826
2825
  const o = new (0, _ethers.Contract)(
2827
2826
  t,
@@ -2844,13 +2843,13 @@ var Bo = async (r, e, t, n) => {
2844
2843
  );
2845
2844
  }
2846
2845
  };
2847
- var Rr = async (r, e, t) => {
2846
+ var Er = async (r, e, t) => {
2848
2847
  const n = t.filter(
2849
2848
  (a) => a.type === "ERC1155"
2850
2849
  );
2851
2850
  const o = await Promise.all(
2852
2851
  n.map(async (a) => {
2853
- const i = await Mo(
2852
+ const i = await So(
2854
2853
  r,
2855
2854
  e,
2856
2855
  a.contractAddress,
@@ -2862,7 +2861,7 @@ var Rr = async (r, e, t) => {
2862
2861
  itemRequirement: a
2863
2862
  };
2864
2863
  }
2865
- const s = await Bo(
2864
+ const s = await Po(
2866
2865
  r,
2867
2866
  e,
2868
2867
  a.contractAddress,
@@ -2886,7 +2885,7 @@ var Rr = async (r, e, t) => {
2886
2885
 
2887
2886
 
2888
2887
  // src/smartCheckout/aggregators/balanceAggregator.ts
2889
- var bo = (r) => {
2888
+ var ko = (r) => {
2890
2889
  const e = /* @__PURE__ */ new Map();
2891
2890
  const t = [];
2892
2891
  r.forEach((n) => {
@@ -2905,7 +2904,7 @@ var bo = (r) => {
2905
2904
  });
2906
2905
  return t.concat(Array.from(e.values()));
2907
2906
  };
2908
- var xo = (r) => {
2907
+ var vo = (r) => {
2909
2908
  const e = /* @__PURE__ */ new Map();
2910
2909
  const t = [];
2911
2910
  r.forEach((n) => {
@@ -2925,7 +2924,7 @@ var xo = (r) => {
2925
2924
  });
2926
2925
  return t.concat(Array.from(e.values()));
2927
2926
  };
2928
- var Lo = (r) => {
2927
+ var No = (r) => {
2929
2928
  const e = /* @__PURE__ */ new Map();
2930
2929
  const t = [];
2931
2930
  r.forEach((n) => {
@@ -2941,11 +2940,11 @@ var Lo = (r) => {
2941
2940
  });
2942
2941
  return t.concat(Array.from(e.values()));
2943
2942
  };
2944
- var Cr = (r) => Lo(xo(bo(r)));
2943
+ var gr = (r) => No(vo(ko(r)));
2945
2944
 
2946
2945
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2947
2946
 
2948
- var Ir = (r) => r.map((e) => {
2947
+ var Rr = (r) => r.map((e) => {
2949
2948
  switch (e.type) {
2950
2949
  case "ERC20":
2951
2950
  return {
@@ -2962,7 +2961,7 @@ var Ir = (r) => r.map((e) => {
2962
2961
  };
2963
2962
  }
2964
2963
  });
2965
- var Tr = (r, e) => {
2964
+ var Cr = (r, e) => {
2966
2965
  const t = BigInt(1);
2967
2966
  const n = e.find((s) => {
2968
2967
  const c = s;
@@ -2999,7 +2998,7 @@ var Tr = (r, e) => {
2999
2998
  isFee: false
3000
2999
  };
3001
3000
  };
3002
- var hr = (r, e) => {
3001
+ var Ir = (r, e) => {
3003
3002
  if (r.type === "ERC20") {
3004
3003
  return e.find((t) => {
3005
3004
  return I(
@@ -3012,14 +3011,14 @@ var hr = (r, e) => {
3012
3011
  return O(_optionalChain([t, 'access', _102 => _102.token, 'optionalAccess', _103 => _103.address]));
3013
3012
  });
3014
3013
  };
3015
- var Ar = async (r, e, t) => {
3014
+ var Tr = async (r, e, t) => {
3016
3015
  const n = {};
3017
3016
  for (const o of r) {
3018
3017
  if (o.type === "NATIVE") {
3019
3018
  n[_] = we;
3020
3019
  continue;
3021
3020
  }
3022
- const a = hr(o, e);
3021
+ const a = Ir(o, e);
3023
3022
  let i = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _104 => _104.token, 'access', _105 => _105.address]), () => ( ""));
3024
3023
  let s = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _106 => _106.token, 'access', _107 => _107.name]), () => ( ""));
3025
3024
  let c = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _108 => _108.token, 'access', _109 => _109.symbol]), () => ( ""));
@@ -3030,21 +3029,21 @@ var Ar = async (r, e, t) => {
3030
3029
  continue;
3031
3030
  }
3032
3031
  try {
3033
- const u = new (0, _ethers.Contract)(
3032
+ const p = new (0, _ethers.Contract)(
3034
3033
  o.tokenAddress,
3035
- JSON.stringify(x),
3034
+ JSON.stringify(b),
3036
3035
  t
3037
3036
  );
3038
- const [p, m, g] = await Promise.all([
3039
- u.name(),
3040
- u.symbol(),
3041
- u.decimals()
3037
+ const [u, m, E] = await Promise.all([
3038
+ p.name(),
3039
+ p.symbol(),
3040
+ p.decimals()
3042
3041
  ]);
3043
3042
  i = o.tokenAddress;
3044
- d = g;
3045
- s = p;
3043
+ d = E;
3044
+ s = u;
3046
3045
  c = m;
3047
- } catch (u) {
3046
+ } catch (p) {
3048
3047
  console.error(
3049
3048
  "Failed to query contract information",
3050
3049
  o.tokenAddress
@@ -3060,8 +3059,8 @@ var Ar = async (r, e, t) => {
3060
3059
  }
3061
3060
  return n;
3062
3061
  };
3063
- var wr = (r, e, t) => {
3064
- let n = hr(r, e);
3062
+ var hr = (r, e, t) => {
3063
+ let n = Ir(r, e);
3065
3064
  const o = r.amount;
3066
3065
  const a = o < 0 || o === 0n || n && _optionalChain([n, 'optionalAccess', _112 => _112.balance]) >= o;
3067
3066
  const i = o - (_nullishCoalesce(_optionalChain([n, 'optionalAccess', _113 => _113.balance]), () => ( BigInt(0))));
@@ -3126,10 +3125,10 @@ var wr = (r, e, t) => {
3126
3125
  };
3127
3126
 
3128
3127
  // src/smartCheckout/balanceCheck/balanceCheck.ts
3129
- var Uo = async (r, e, t, n, o = false) => {
3128
+ var Mo = async (r, e, t, n, o = false) => {
3130
3129
  try {
3131
3130
  const a = /* @__PURE__ */ new Map();
3132
- Ir(n).forEach(
3131
+ Rr(n).forEach(
3133
3132
  (s) => {
3134
3133
  if (!s.address) return;
3135
3134
  a.set(s.address.toLocaleLowerCase(), s);
@@ -3147,7 +3146,7 @@ var Uo = async (r, e, t, n, o = false) => {
3147
3146
  );
3148
3147
  }
3149
3148
  };
3150
- var Go = async (r, e, t) => {
3149
+ var xo = async (r, e, t) => {
3151
3150
  const n = [];
3152
3151
  const o = /* @__PURE__ */ new Map();
3153
3152
  const a = /* @__PURE__ */ new Map();
@@ -3165,17 +3164,17 @@ var Go = async (r, e, t) => {
3165
3164
  const i = await Promise.all(a.values());
3166
3165
  const s = Array.from(a.keys());
3167
3166
  i.forEach((c, d) => {
3168
- const u = o.get(s[d]);
3169
- let p = 0;
3170
- if (u && I(e, c)) {
3171
- p = 1;
3167
+ const p = o.get(s[d]);
3168
+ let u = 0;
3169
+ if (p && I(e, c)) {
3170
+ u = 1;
3172
3171
  }
3173
3172
  n.push({
3174
3173
  type: "ERC721",
3175
- balance: BigInt(p),
3176
- formattedBalance: p.toString(),
3177
- contractAddress: u.contractAddress,
3178
- id: u.id
3174
+ balance: BigInt(u),
3175
+ formattedBalance: u.toString(),
3176
+ contractAddress: p.contractAddress,
3177
+ id: p.id
3179
3178
  });
3180
3179
  });
3181
3180
  } catch (i) {
@@ -3187,8 +3186,8 @@ var Go = async (r, e, t) => {
3187
3186
  }
3188
3187
  return n;
3189
3188
  };
3190
- var yr = async (r, e, t, n, o = false) => {
3191
- const a = Cr(n);
3189
+ var Ar = async (r, e, t, n, o = false) => {
3190
+ const a = gr(n);
3192
3191
  const i = [];
3193
3192
  const s = [];
3194
3193
  a.forEach((m) => {
@@ -3212,52 +3211,52 @@ var yr = async (r, e, t, n, o = false) => {
3212
3211
  }
3213
3212
  const c = [];
3214
3213
  if (i.length > 0) {
3215
- c.push(Uo(r, e, t, a, o));
3214
+ c.push(Mo(r, e, t, a, o));
3216
3215
  }
3217
3216
  if (s.length > 0) {
3218
- c.push(Go(e, t, a));
3217
+ c.push(xo(e, t, a));
3219
3218
  }
3220
3219
  const d = await Promise.all(c);
3221
- const u = [];
3220
+ const p = [];
3222
3221
  if (i.length > 0) {
3223
3222
  const m = _nullishCoalesce(d.shift(), () => ( []));
3224
- const g = new Map(m.map((f) => {
3223
+ const E = new Map(m.map((f) => {
3225
3224
  const R = f.type === "NATIVE" ? _ : _optionalChain([f, 'access', _114 => _114.token, 'access', _115 => _115.address, 'optionalAccess', _116 => _116.toLowerCase, 'call', _117 => _117()]);
3226
3225
  return [R, f];
3227
3226
  }));
3228
- const E = await Ar(i, m, e);
3227
+ const g = await Tr(i, m, e);
3229
3228
  i.forEach((f) => {
3230
3229
  const R = (_nullishCoalesce(f.tokenAddress, () => ( _))).toLowerCase();
3231
- const T = E[R];
3232
- const C = g.get(R);
3233
- const w = wr(f, [...g.values()], T);
3234
- u.push(w);
3230
+ const T = g[R];
3231
+ const C = E.get(R);
3232
+ const y = hr(f, [...E.values()], T);
3233
+ p.push(y);
3235
3234
  if (!C) {
3236
3235
  return;
3237
3236
  }
3238
- const P = C.balance - w.required.balance;
3239
- g.set(R, {
3237
+ const P = C.balance - y.required.balance;
3238
+ E.set(R, {
3240
3239
  ...C,
3241
3240
  balance: P,
3242
- formattedBalance: _ethers.formatUnits.call(void 0, P, w.required.token.decimals)
3241
+ formattedBalance: _ethers.formatUnits.call(void 0, P, y.required.token.decimals)
3243
3242
  });
3244
3243
  });
3245
3244
  }
3246
3245
  if (s.length > 0) {
3247
3246
  const m = _nullishCoalesce(d.shift(), () => ( []));
3248
- s.forEach((g) => {
3249
- u.push(Tr(g, m));
3247
+ s.forEach((E) => {
3248
+ p.push(Cr(E, m));
3250
3249
  });
3251
3250
  }
3252
- const p = u.find((m) => !m.sufficient) === void 0;
3251
+ const u = p.find((m) => !m.sufficient) === void 0;
3253
3252
  return {
3254
- sufficient: p,
3255
- balanceRequirements: u
3253
+ sufficient: u,
3254
+ balanceRequirements: p
3256
3255
  };
3257
3256
  };
3258
3257
 
3259
3258
  // src/smartCheckout/gas/gasCalculator.ts
3260
- var Sr = async (r, e) => {
3259
+ var yr = async (r, e) => {
3261
3260
  try {
3262
3261
  return await r.estimateGas(e);
3263
3262
  } catch (t) {
@@ -3268,7 +3267,7 @@ var Sr = async (r, e) => {
3268
3267
  );
3269
3268
  }
3270
3269
  };
3271
- var qo = (r, e) => {
3270
+ var bo = (r, e) => {
3272
3271
  if (e.type === "TRANSACTION" || e.gasToken.type === "NATIVE") {
3273
3272
  return {
3274
3273
  type: "NATIVE",
@@ -3284,15 +3283,15 @@ var qo = (r, e) => {
3284
3283
  isFee: true
3285
3284
  };
3286
3285
  };
3287
- var Pr = async (r, e, t) => {
3286
+ var wr = async (r, e, t) => {
3288
3287
  const n = [];
3289
3288
  let o = BigInt(0);
3290
3289
  for (const i of e) {
3291
3290
  if (i.approvalTransaction === void 0) continue;
3292
- n.push(Sr(r, i.approvalTransaction));
3291
+ n.push(yr(r, i.approvalTransaction));
3293
3292
  }
3294
3293
  if (t.type === "TRANSACTION") {
3295
- n.push(Sr(r, t.transaction));
3294
+ n.push(yr(r, t.transaction));
3296
3295
  } else {
3297
3296
  const i = await r.getFeeData();
3298
3297
  const s = Et(i);
@@ -3306,12 +3305,12 @@ var Pr = async (r, e, t) => {
3306
3305
  o += i;
3307
3306
  });
3308
3307
  if (o === 0n) return null;
3309
- return qo(o, t);
3308
+ return bo(o, t);
3310
3309
  };
3311
3310
 
3312
3311
  // src/smartCheckout/routing/geoBlocking.ts
3313
- var kr = async () => true;
3314
- var vr = async (r) => {
3312
+ var Sr = async () => true;
3313
+ var Pr = async (r) => {
3315
3314
  const e = Pe(r.isDevelopment, r.isProduction);
3316
3315
  try {
3317
3316
  return await e.checkDexAvailability();
@@ -3321,10 +3320,10 @@ var vr = async (r) => {
3321
3320
  };
3322
3321
 
3323
3322
  // src/smartCheckout/routing/routingOptions.ts
3324
- function ht(r) {
3323
+ function Tt(r) {
3325
3324
  return _optionalChain([r, 'optionalAccess', _118 => _118.ethereumProvider, 'optionalAccess', _119 => _119.isPassport]) === true;
3326
3325
  }
3327
- var Nr = async (r, e) => {
3326
+ var kr = async (r, e) => {
3328
3327
  const t = {
3329
3328
  onRamp: r.isOnRampEnabled,
3330
3329
  swap: r.isSwapEnabled,
@@ -3332,10 +3331,10 @@ var Nr = async (r, e) => {
3332
3331
  };
3333
3332
  const n = [];
3334
3333
  if (t.onRamp) {
3335
- n.push({ id: "onRamp", promise: kr() });
3334
+ n.push({ id: "onRamp", promise: Sr() });
3336
3335
  }
3337
3336
  if (t.swap) {
3338
- n.push({ id: "swap", promise: vr(r) });
3337
+ n.push({ id: "swap", promise: Pr(r) });
3339
3338
  }
3340
3339
  if (n.length > 0) {
3341
3340
  const o = n.map((i) => i.promise);
@@ -3345,12 +3344,12 @@ var Nr = async (r, e) => {
3345
3344
  t[c] = t[c] && i.status === "fulfilled" && i.value;
3346
3345
  });
3347
3346
  }
3348
- t.bridge = t.bridge && !ht(e);
3347
+ t.bridge = t.bridge && !Tt(e);
3349
3348
  return t;
3350
3349
  };
3351
3350
 
3352
3351
  // src/smartCheckout/routing/tokenBalances.ts
3353
- var _r = async (r, e, t, n) => {
3352
+ var vr = async (r, e, t, n) => {
3354
3353
  const o = /* @__PURE__ */ new Map();
3355
3354
  const a = /* @__PURE__ */ new Map();
3356
3355
  if (e.size === 0) {
@@ -3398,15 +3397,15 @@ var _r = async (r, e, t, n) => {
3398
3397
  if (a.size > 0) {
3399
3398
  const s = Array.from(a.keys());
3400
3399
  const c = await Promise.allSettled(a.values());
3401
- c.forEach((d, u) => {
3402
- const p = s[u];
3400
+ c.forEach((d, p) => {
3401
+ const u = s[p];
3403
3402
  if (d.status === "fulfilled") {
3404
- o.set(p, {
3403
+ o.set(u, {
3405
3404
  success: true,
3406
3405
  balances: d.value.balances
3407
3406
  });
3408
3407
  } else {
3409
- o.set(p, {
3408
+ o.set(u, {
3410
3409
  success: false,
3411
3410
  error: new l(`Error getting ${i} balances`, "GET_BALANCE_ERROR"),
3412
3411
  balances: []
@@ -3428,29 +3427,29 @@ var Fe = async (r, e, t, n, o) => {
3428
3427
  const s = await oe(e, r);
3429
3428
  const c = [];
3430
3429
  const d = [];
3431
- for (const p of o) {
3432
- if (p === n.address) continue;
3430
+ for (const u of o) {
3431
+ if (u === n.address) continue;
3433
3432
  c.push(s.getUnsignedSwapTxFromAmountOut(
3434
3433
  t,
3435
- p,
3434
+ u,
3436
3435
  n.address,
3437
3436
  n.amount,
3438
3437
  i
3439
3438
  ));
3440
- d.push(p);
3439
+ d.push(u);
3441
3440
  }
3442
- const u = await S(
3441
+ const p = await S(
3443
3442
  r,
3444
3443
  "Time to resolve swap quotes from the dex",
3445
3444
  Promise.allSettled(c)
3446
3445
  );
3447
- u.forEach((p, m) => {
3448
- if (p.status === "rejected") return;
3449
- const g = d[m];
3450
- a.set(g, {
3451
- quote: p.value.quote,
3452
- approval: _nullishCoalesce(_optionalChain([p, 'access', _120 => _120.value, 'access', _121 => _121.approval, 'optionalAccess', _122 => _122.gasFeeEstimate]), () => ( null)),
3453
- swap: p.value.swap.gasFeeEstimate
3446
+ p.forEach((u, m) => {
3447
+ if (u.status === "rejected") return;
3448
+ const E = d[m];
3449
+ a.set(E, {
3450
+ quote: u.value.quote,
3451
+ approval: _nullishCoalesce(_optionalChain([u, 'access', _120 => _120.value, 'access', _121 => _121.approval, 'optionalAccess', _122 => _122.gasFeeEstimate]), () => ( null)),
3452
+ swap: u.value.swap.gasFeeEstimate
3454
3453
  });
3455
3454
  });
3456
3455
  return a;
@@ -3460,7 +3459,7 @@ var Fe = async (r, e, t, n, o) => {
3460
3459
  };
3461
3460
 
3462
3461
  // src/smartCheckout/routing/swap/swapRoute.ts
3463
- var jo = (r, e, t) => {
3462
+ var Lo = (r, e, t) => {
3464
3463
  let n = BigInt(0);
3465
3464
  let o = "0";
3466
3465
  let a;
@@ -3488,17 +3487,17 @@ var jo = (r, e, t) => {
3488
3487
  };
3489
3488
  }
3490
3489
  const d = [];
3491
- for (const u of t) {
3490
+ for (const p of t) {
3492
3491
  d.push({
3493
3492
  type: "SWAP_FEE",
3494
- amount: u.amount.value,
3495
- formattedAmount: _ethers.formatUnits.call(void 0, u.amount.value, u.amount.token.decimals),
3496
- basisPoints: u.basisPoints,
3493
+ amount: p.amount.value,
3494
+ formattedAmount: _ethers.formatUnits.call(void 0, p.amount.value, p.amount.token.decimals),
3495
+ basisPoints: p.basisPoints,
3497
3496
  token: {
3498
- name: _nullishCoalesce(u.amount.token.name, () => ( "")),
3499
- symbol: _nullishCoalesce(u.amount.token.symbol, () => ( "")),
3500
- address: u.amount.token.address,
3501
- decimals: u.amount.token.decimals
3497
+ name: _nullishCoalesce(p.amount.token.name, () => ( "")),
3498
+ symbol: _nullishCoalesce(p.amount.token.symbol, () => ( "")),
3499
+ address: p.amount.token.address,
3500
+ decimals: p.amount.token.decimals
3502
3501
  }
3503
3502
  });
3504
3503
  }
@@ -3518,7 +3517,7 @@ var jo = (r, e, t) => {
3518
3517
  swapFees: d
3519
3518
  };
3520
3519
  };
3521
- var Vo = (r, e, t, n) => {
3520
+ var Do = (r, e, t, n) => {
3522
3521
  const o = t.token.address;
3523
3522
  let a = "ERC20";
3524
3523
  if (O(o)) {
@@ -3545,7 +3544,7 @@ var Vo = (r, e, t, n) => {
3545
3544
  fees: n
3546
3545
  };
3547
3546
  };
3548
- var Ho = (r) => {
3547
+ var Fo = (r) => {
3549
3548
  if (r.type === "ERC20") {
3550
3549
  return !!r.required.token.address;
3551
3550
  }
@@ -3554,7 +3553,7 @@ var Ho = (r) => {
3554
3553
  }
3555
3554
  return false;
3556
3555
  };
3557
- var zo = (r) => {
3556
+ var Wo = (r) => {
3558
3557
  let e = "";
3559
3558
  let t = BigInt(0);
3560
3559
  switch (r.type) {
@@ -3570,7 +3569,7 @@ var zo = (r) => {
3570
3569
  }
3571
3570
  return { address: e, amount: t };
3572
3571
  };
3573
- var Ko = (r, e) => {
3572
+ var Uo = (r, e) => {
3574
3573
  if (!e) return { sufficient: true, approvalGasFee: BigInt(0), approvalGasTokenAddress: "" };
3575
3574
  const t = e.value;
3576
3575
  const n = e.token.address;
@@ -3594,7 +3593,7 @@ var Ko = (r, e) => {
3594
3593
  }
3595
3594
  return { sufficient: true, approvalGasFee: t, approvalGasTokenAddress: n };
3596
3595
  };
3597
- var Qo = (r, e, t, n, o) => {
3596
+ var Go = (r, e, t, n, o) => {
3598
3597
  const a = /* @__PURE__ */ new Map();
3599
3598
  if (e.approvalGasFee > BigInt(0)) {
3600
3599
  a.set(e.approvalGasTokenAddress, e.approvalGasFee);
@@ -3637,7 +3636,7 @@ var Qo = (r, e, t, n, o) => {
3637
3636
  }
3638
3637
  return true;
3639
3638
  };
3640
- var Zo = (r, e, t, n, o, a) => {
3639
+ var qo = (r, e, t, n, o, a) => {
3641
3640
  let i = BigInt(0);
3642
3641
  let s = "";
3643
3642
  let c = false;
@@ -3665,13 +3664,13 @@ var Ue = async (r, e, t, n, o, a, i) => {
3665
3664
  const s = [];
3666
3665
  if (!e.swap) return s;
3667
3666
  if (a.length === 0) return s;
3668
- if (!Ho(n)) return s;
3669
- const c = zo(n);
3667
+ if (!Fo(n)) return s;
3668
+ const c = Wo(n);
3670
3669
  const d = A(r);
3671
- const u = o.get(d);
3672
- if (!u) return s;
3673
- const p = u.balances;
3674
- if (p.length === 0) return s;
3670
+ const p = o.get(d);
3671
+ if (!p) return s;
3672
+ const u = p.balances;
3673
+ if (u.length === 0) return s;
3675
3674
  const m = await Fe(
3676
3675
  r,
3677
3676
  A(r),
@@ -3679,43 +3678,43 @@ var Ue = async (r, e, t, n, o, a, i) => {
3679
3678
  c,
3680
3679
  a
3681
3680
  );
3682
- const g = Array.from(m.keys());
3683
- for (const E of g) {
3684
- const f = m.get(E);
3681
+ const E = Array.from(m.keys());
3682
+ for (const g of E) {
3683
+ const f = m.get(g);
3685
3684
  if (!f) continue;
3686
- const R = p.find(
3687
- (P) => I(P.token.address, E)
3685
+ const R = u.find(
3686
+ (P) => I(P.token.address, g)
3688
3687
  );
3689
3688
  if (!R) continue;
3690
3689
  const T = f.quote.amountWithMaxSlippage;
3691
3690
  if (R.balance < T.value) continue;
3692
- const C = Ko(p, f.approval);
3691
+ const C = Uo(u, f.approval);
3693
3692
  if (!C.sufficient) continue;
3694
- if (!Qo(
3695
- p,
3693
+ if (!Go(
3694
+ u,
3696
3695
  C,
3697
3696
  f.swap,
3698
3697
  f.quote.fees,
3699
3698
  {
3700
3699
  amount: T.value,
3701
- address: E
3700
+ address: g
3702
3701
  }
3703
3702
  )) continue;
3704
- if (!Zo(
3703
+ if (!qo(
3705
3704
  R.balance,
3706
3705
  i,
3707
- E,
3706
+ g,
3708
3707
  T.value,
3709
3708
  C,
3710
3709
  f.quote.fees
3711
3710
  )) continue;
3712
- const w = jo(f.approval, f.swap, f.quote.fees);
3711
+ const y = Lo(f.approval, f.swap, f.quote.fees);
3713
3712
  s.push(
3714
- Vo(
3713
+ Do(
3715
3714
  d,
3716
3715
  T.value,
3717
3716
  R,
3718
- w
3717
+ y
3719
3718
  )
3720
3719
  );
3721
3720
  }
@@ -3723,7 +3722,7 @@ var Ue = async (r, e, t, n, o, a, i) => {
3723
3722
  };
3724
3723
 
3725
3724
  // src/smartCheckout/allowList/allowListCheck.ts
3726
- var Or = (r, e) => {
3725
+ var Nr = (r, e) => {
3727
3726
  if (e && e.success) {
3728
3727
  return r.filter((t) => {
3729
3728
  if ("address" in t) {
@@ -3736,35 +3735,35 @@ var Or = (r, e) => {
3736
3735
  }
3737
3736
  return [];
3738
3737
  };
3739
- var At = async (r, e) => {
3738
+ var ht = async (r, e) => {
3740
3739
  if (e.onRamp) {
3741
3740
  const t = await H(r, { type: "onramp" });
3742
3741
  return t.tokens;
3743
3742
  }
3744
3743
  return [];
3745
3744
  };
3746
- var wt = async (r, e, t) => {
3745
+ var At = async (r, e, t) => {
3747
3746
  if (t.bridge) {
3748
3747
  const n = N(r);
3749
3748
  const o = (await H(r, { type: "bridge", chainId: n })).tokens;
3750
3749
  const a = e.get(n);
3751
- return Or(o, a);
3750
+ return Nr(o, a);
3752
3751
  }
3753
3752
  return [];
3754
3753
  };
3755
- var Yo = async (r, e, t) => {
3754
+ var jo = async (r, e, t) => {
3756
3755
  if (t.swap) {
3757
3756
  const n = (await H(r, { type: "swap" })).tokens;
3758
3757
  const o = e.get(A(r));
3759
- return Or(n, o);
3758
+ return Nr(n, o);
3760
3759
  }
3761
3760
  return [];
3762
3761
  };
3763
- var Mr = async (r, e, t) => {
3762
+ var _r = async (r, e, t) => {
3764
3763
  const n = {};
3765
- n.swap = await Yo(r, e, t);
3766
- n.bridge = await wt(r, e, t);
3767
- n.onRamp = await At(r, t);
3764
+ n.swap = await jo(r, e, t);
3765
+ n.bridge = await At(r, e, t);
3766
+ n.onRamp = await ht(r, t);
3768
3767
  return n;
3769
3768
  };
3770
3769
 
@@ -3775,7 +3774,7 @@ var Mr = async (r, e, t) => {
3775
3774
 
3776
3775
 
3777
3776
  // src/smartCheckout/routing/bridge/getEthBalance.ts
3778
- var Br = (r) => {
3777
+ var Or = (r) => {
3779
3778
  for (const e of r.balances) {
3780
3779
  if (O(e.token.address)) {
3781
3780
  return e.balance;
@@ -3786,8 +3785,8 @@ var Br = (r) => {
3786
3785
 
3787
3786
  // src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
3788
3787
 
3789
- var br = async (r, e, t, n) => {
3790
- const o = Me(
3788
+ var Br = async (r, e, t, n) => {
3789
+ const o = Be(
3791
3790
  t,
3792
3791
  n,
3793
3792
  e,
@@ -3817,13 +3816,13 @@ var br = async (r, e, t, n) => {
3817
3816
 
3818
3817
  // src/smartCheckout/routing/indexer/fetchL1Representation.ts
3819
3818
  var J = "0x0000000000000000000000000000000000000eee";
3820
- var $o = (r) => {
3819
+ var Ho = (r) => {
3821
3820
  if (r === 13371) return "imtbl-zkevm-mainnet";
3822
3821
  if (r === 13473) return "imtbl-zkevm-testnet";
3823
3822
  if (r === 15003) return "imtbl-zkevm-devnet";
3824
3823
  return "";
3825
3824
  };
3826
- var Xo = async (r, e) => {
3825
+ var zo = async (r, e) => {
3827
3826
  const t = await e.remote.getConfig(
3828
3827
  "imxAddressMapping"
3829
3828
  );
@@ -3832,12 +3831,12 @@ var Xo = async (r, e) => {
3832
3831
  var Ge = async (r, e) => {
3833
3832
  if (O(e)) {
3834
3833
  return {
3835
- l1address: await Xo(N(r), r),
3834
+ l1address: await zo(N(r), r),
3836
3835
  l2address: _
3837
3836
  };
3838
3837
  }
3839
- const t = $o(A(r));
3840
- const n = Be(r);
3838
+ const t = Ho(A(r));
3839
+ const n = Me(r);
3841
3840
  const o = await n.getToken({
3842
3841
  chainName: t,
3843
3842
  contractAddress: e
@@ -3857,11 +3856,11 @@ var Ge = async (r, e) => {
3857
3856
  };
3858
3857
 
3859
3858
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3860
- var ea = (r, e) => {
3861
- const t = Br(r);
3859
+ var Ko = (r, e) => {
3860
+ const t = Or(r);
3862
3861
  return t >= e;
3863
3862
  };
3864
- var xr = (r, e, t, n, o) => {
3863
+ var Mr = (r, e, t, n, o) => {
3865
3864
  const a = _nullishCoalesce(_optionalChain([o, 'optionalAccess', _123 => _123.decimals]), () => ( q));
3866
3865
  const i = [];
3867
3866
  if (e > 0) {
@@ -3896,7 +3895,7 @@ var xr = (r, e, t, n, o) => {
3896
3895
  bridgeFees: i
3897
3896
  };
3898
3897
  };
3899
- var Lr = (r, e, t, n, o) => ({
3898
+ var xr = (r, e, t, n, o) => ({
3900
3899
  type: "BRIDGE",
3901
3900
  chainId: r,
3902
3901
  fundingItem: {
@@ -3933,62 +3932,62 @@ var je = async (r, e, t, n, o) => {
3933
3932
  );
3934
3933
  }
3935
3934
  if (c === void 0 || c.success === false) return void 0;
3936
- const u = await wt(r, o, t);
3937
- if (u.length === 0) return void 0;
3938
- const p = await Ge(r, n.l2address);
3939
- if (!p) return void 0;
3940
- const { l1address: m } = p;
3935
+ const p = await At(r, o, t);
3936
+ if (p.length === 0) return void 0;
3937
+ const u = await Ge(r, n.l2address);
3938
+ if (!u) return void 0;
3939
+ const { l1address: m } = u;
3941
3940
  if (O(m)) {
3942
- if (!u.find((P) => O(P.address))) return void 0;
3943
- } else if (!u.find((P) => I(P.address, m))) {
3941
+ if (!p.find((P) => O(P.address))) return void 0;
3942
+ } else if (!p.find((P) => I(P.address, m))) {
3944
3943
  return void 0;
3945
3944
  }
3946
- const g = await br(
3945
+ const E = await Br(
3947
3946
  r,
3948
3947
  e,
3949
3948
  a,
3950
3949
  i
3951
3950
  );
3952
3951
  const {
3953
- sourceChainGas: E,
3952
+ sourceChainGas: g,
3954
3953
  approvalGas: f,
3955
3954
  bridgeFee: R,
3956
3955
  imtblFee: T,
3957
3956
  totalFees: C
3958
- } = g;
3959
- if (!ea(c, C)) return void 0;
3957
+ } = E;
3958
+ if (!Ko(c, C)) return void 0;
3960
3959
  if (O(m)) {
3961
3960
  const P = c.balances.find((v) => O(v.token.address));
3962
3961
  if (P && P.balance >= n.amount + C) {
3963
- const v = xr(
3964
- E,
3962
+ const v = Mr(
3963
+ g,
3965
3964
  R,
3966
3965
  T,
3967
3966
  f,
3968
3967
  s
3969
3968
  );
3970
- return Lr(a, P, n, "NATIVE", v);
3969
+ return xr(a, P, n, "NATIVE", v);
3971
3970
  }
3972
3971
  return void 0;
3973
3972
  }
3974
- const w = c.balances.find(
3973
+ const y = c.balances.find(
3975
3974
  (P) => I(P.token.address, m)
3976
3975
  );
3977
- if (w && w.balance >= n.amount) {
3978
- const P = xr(
3979
- E,
3976
+ if (y && y.balance >= n.amount) {
3977
+ const P = Mr(
3978
+ g,
3980
3979
  R,
3981
3980
  T,
3982
3981
  f,
3983
3982
  s
3984
3983
  );
3985
- return Lr(a, w, n, "ERC20", P);
3984
+ return xr(a, y, n, "ERC20", P);
3986
3985
  }
3987
3986
  return void 0;
3988
3987
  };
3989
3988
 
3990
3989
  // src/smartCheckout/routing/bridgeAndSwap/getBalancesByChain.ts
3991
- var Dr = (r, e) => {
3990
+ var br = (r, e) => {
3992
3991
  const t = { l1balances: [], l2balances: [] };
3993
3992
  const n = e.get(N(r));
3994
3993
  const o = e.get(A(r));
@@ -4005,7 +4004,7 @@ var Dr = (r, e) => {
4005
4004
 
4006
4005
  // src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.ts
4007
4006
 
4008
- var ra = (r, e) => {
4007
+ var Zo = (r, e) => {
4009
4008
  let t = BigInt(0);
4010
4009
  r.quote.fees.forEach((n) => {
4011
4010
  if (I(n.amount.token.address, e)) {
@@ -4019,7 +4018,7 @@ var ra = (r, e) => {
4019
4018
  }
4020
4019
  return t;
4021
4020
  };
4022
- var na = (r, e) => {
4021
+ var Yo = (r, e) => {
4023
4022
  for (const t of r.balanceRequirements) {
4024
4023
  if (t.type === "NATIVE" || t.type === "ERC20") {
4025
4024
  if (I(t.required.token.address, e)) {
@@ -4029,7 +4028,7 @@ var na = (r, e) => {
4029
4028
  }
4030
4029
  return BigInt(0);
4031
4030
  };
4032
- var oa = (r, e, t) => {
4031
+ var Jo = (r, e, t) => {
4033
4032
  const n = _nullishCoalesce(_optionalChain([t, 'optionalAccess', _128 => _128.balance]), () => ( BigInt(0)));
4034
4033
  if (n >= r + e) {
4035
4034
  return BigInt(0);
@@ -4043,7 +4042,7 @@ var oa = (r, e, t) => {
4043
4042
  }
4044
4043
  return r + e - n;
4045
4044
  };
4046
- var Fr = (r, e, t, n, o) => {
4045
+ var Lr = (r, e, t, n, o) => {
4047
4046
  const a = [];
4048
4047
  for (const [i, s] of r) {
4049
4048
  const c = t.find((C) => I(C.token.address, i));
@@ -4051,23 +4050,23 @@ var Fr = (r, e, t, n, o) => {
4051
4050
  (C) => I(C.l2address, i)
4052
4051
  );
4053
4052
  if (!d) continue;
4054
- const { l1address: u, l2address: p } = d;
4055
- if (!u) continue;
4053
+ const { l1address: p, l2address: u } = d;
4054
+ if (!p) continue;
4056
4055
  const m = e.find((C) => {
4057
- if (C.token.address === void 0 && I(u, J)) {
4056
+ if (C.token.address === void 0 && I(p, J)) {
4058
4057
  return true;
4059
4058
  }
4060
- return I(C.token.address, u);
4059
+ return I(C.token.address, p);
4061
4060
  });
4062
4061
  if (!m) continue;
4063
- const g = s.quote.amountWithMaxSlippage.value;
4064
- const E = ra(s, i);
4065
- const f = g + E;
4066
- const R = na(
4062
+ const E = s.quote.amountWithMaxSlippage.value;
4063
+ const g = Zo(s, i);
4064
+ const f = E + g;
4065
+ const R = Yo(
4067
4066
  o,
4068
4067
  i
4069
4068
  );
4070
- const T = oa(f, R, c);
4069
+ const T = Jo(f, R, c);
4071
4070
  if (T <= 0) {
4072
4071
  continue;
4073
4072
  }
@@ -4078,21 +4077,21 @@ var Fr = (r, e, t, n, o) => {
4078
4077
  amount: T,
4079
4078
  formattedAmount: Q(_ethers.formatUnits.call(void 0, T, m.token.decimals)),
4080
4079
  // L2 address is used for the bridge requirement as the bridge route uses the indexer to find L1 address
4081
- l2address: p
4080
+ l2address: u
4082
4081
  });
4083
4082
  }
4084
4083
  return a;
4085
4084
  };
4086
4085
 
4087
4086
  // src/smartCheckout/routing/bridgeAndSwap/fetchL1ToL2Mappings.ts
4088
- var Wr = async (r, e) => {
4087
+ var Dr = async (r, e) => {
4089
4088
  const t = e.map((o) => Ge(r, _nullishCoalesce(o.address, () => ( ""))));
4090
4089
  const n = await Promise.all(t);
4091
4090
  return n.filter((o) => o !== void 0);
4092
4091
  };
4093
4092
 
4094
4093
  // src/smartCheckout/routing/bridgeAndSwap/getDexQuotes.ts
4095
- var Ur = async (r, e, t, n, o) => {
4094
+ var Fr = async (r, e, t, n, o) => {
4096
4095
  const a = [];
4097
4096
  for (const s of o) {
4098
4097
  if (!s.address) continue;
@@ -4112,7 +4111,7 @@ var Ur = async (r, e, t, n, o) => {
4112
4111
  };
4113
4112
 
4114
4113
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
4115
- var ia = (r, e, t, n, o, a) => {
4114
+ var Xo = (r, e, t, n, o, a) => {
4116
4115
  if (r.length === 0) return true;
4117
4116
  if (e.length === 0) return true;
4118
4117
  if (t.length === 0) return true;
@@ -4123,7 +4122,7 @@ var ia = (r, e, t, n, o, a) => {
4123
4122
  if (a === "") return true;
4124
4123
  return false;
4125
4124
  };
4126
- var sa = (r, e, t, n) => {
4125
+ var ea = (r, e, t, n) => {
4127
4126
  const o = [];
4128
4127
  for (const a of n) {
4129
4128
  if (!e.includes(a.l1address)) continue;
@@ -4136,7 +4135,7 @@ var sa = (r, e, t, n) => {
4136
4135
  }
4137
4136
  return o;
4138
4137
  };
4139
- var ca = (r, e, t, n, o) => {
4138
+ var ta = (r, e, t, n, o) => {
4140
4139
  const a = /* @__PURE__ */ new Map();
4141
4140
  for (const [c, d] of e) {
4142
4141
  a.set(c, {
@@ -4150,20 +4149,20 @@ var ca = (r, e, t, n, o) => {
4150
4149
  i.set(c.token.address, c);
4151
4150
  }
4152
4151
  for (const c of n) {
4153
- const { amount: d, l2address: u } = c;
4154
- if (u === "") continue;
4155
- let p = BigInt(0);
4156
- const m = i.get(u);
4157
- if (m) p = m.balance;
4158
- const g = p + d;
4159
- const E = o.find((f) => I(f.address, u));
4160
- i.set(u, {
4161
- balance: g,
4152
+ const { amount: d, l2address: p } = c;
4153
+ if (p === "") continue;
4154
+ let u = BigInt(0);
4155
+ const m = i.get(p);
4156
+ if (m) u = m.balance;
4157
+ const E = u + d;
4158
+ const g = o.find((f) => I(f.address, p));
4159
+ i.set(p, {
4160
+ balance: E,
4162
4161
  formattedBalance: _ethers.formatUnits.call(void 0,
4163
- g,
4164
- E.decimals
4162
+ E,
4163
+ g.decimals
4165
4164
  ),
4166
- token: E
4165
+ token: g
4167
4166
  });
4168
4167
  }
4169
4168
  const s = Array.from(i.values());
@@ -4176,7 +4175,7 @@ var ca = (r, e, t, n, o) => {
4176
4175
  );
4177
4176
  return a;
4178
4177
  };
4179
- var da = (r, e) => {
4178
+ var ra = (r, e) => {
4180
4179
  const t = [];
4181
4180
  for (const n of e) {
4182
4181
  const { chainId: o, fundingItem: a } = n;
@@ -4185,12 +4184,12 @@ var da = (r, e) => {
4185
4184
  if (!s) continue;
4186
4185
  let c = BigInt(0);
4187
4186
  let d = "0";
4188
- const u = s.balances.find(
4189
- (p) => I(p.token.address, a.token.address)
4187
+ const p = s.balances.find(
4188
+ (u) => I(u.token.address, a.token.address)
4190
4189
  );
4191
- if (u) {
4192
- c = u.balance;
4193
- d = u.formattedBalance;
4190
+ if (p) {
4191
+ c = p.balance;
4192
+ d = p.formattedBalance;
4194
4193
  }
4195
4194
  i.balance = c;
4196
4195
  i.formattedBalance = d;
@@ -4198,7 +4197,7 @@ var da = (r, e) => {
4198
4197
  }
4199
4198
  return t;
4200
4199
  };
4201
- var la = (r, e, t) => {
4200
+ var na = (r, e, t) => {
4202
4201
  const n = [];
4203
4202
  for (const o of r) {
4204
4203
  if (!o) continue;
@@ -4225,36 +4224,36 @@ var la = (r, e, t) => {
4225
4224
  }
4226
4225
  return n;
4227
4226
  };
4228
- var Gr = async (r, e, t, n, o, a, i, s, c) => {
4229
- const { l1balances: d, l2balances: u } = Dr(r, a);
4230
- const p = n.required.token.address;
4231
- if (ia(
4227
+ var Wr = async (r, e, t, n, o, a, i, s, c) => {
4228
+ const { l1balances: d, l2balances: p } = br(r, a);
4229
+ const u = n.required.token.address;
4230
+ if (Xo(
4232
4231
  i,
4233
4232
  s,
4234
4233
  d,
4235
- u,
4234
+ p,
4236
4235
  t,
4237
- p
4236
+ u
4238
4237
  )) return [];
4239
- const m = await Wr(r, s);
4240
- const g = sa(
4241
- p,
4238
+ const m = await Dr(r, s);
4239
+ const E = ea(
4240
+ u,
4242
4241
  i,
4243
4242
  s,
4244
4243
  m
4245
4244
  );
4246
- if (g.length === 0) return [];
4247
- const E = await Ur(
4245
+ if (E.length === 0) return [];
4246
+ const g = await Fr(
4248
4247
  r,
4249
4248
  o,
4250
- p,
4249
+ u,
4251
4250
  n,
4252
- g
4251
+ E
4253
4252
  );
4254
- const f = Fr(
4255
- E,
4253
+ const f = Lr(
4254
+ g,
4256
4255
  d,
4257
- u,
4256
+ p,
4258
4257
  m,
4259
4258
  c
4260
4259
  );
@@ -4280,10 +4279,10 @@ var Gr = async (r, e, t, n, o, a, i, s, c) => {
4280
4279
  l2address: W.l2address
4281
4280
  });
4282
4281
  }
4283
- const w = await Promise.all(R.values());
4282
+ const y = await Promise.all(R.values());
4284
4283
  const P = Array.from(R.keys());
4285
4284
  const v = [];
4286
- w.forEach((W, Xe) => {
4285
+ y.forEach((W, Xe) => {
4287
4286
  const j = P[Xe];
4288
4287
  if (W === void 0) return;
4289
4288
  v.push(j);
@@ -4297,10 +4296,10 @@ var Gr = async (r, e, t, n, o, a, i, s, c) => {
4297
4296
  });
4298
4297
  if (v.length === 0) return [];
4299
4298
  if (C.length === 0) return [];
4300
- const z = ca(
4299
+ const z = ta(
4301
4300
  r,
4302
4301
  a,
4303
- u,
4302
+ p,
4304
4303
  C,
4305
4304
  s
4306
4305
  );
@@ -4314,23 +4313,23 @@ var Gr = async (r, e, t, n, o, a, i, s, c) => {
4314
4313
  c
4315
4314
  );
4316
4315
  if (!ce) return [];
4317
- const $ = da(
4316
+ const $ = ra(
4318
4317
  a,
4319
4318
  ce
4320
4319
  );
4321
- return la(
4322
- w,
4320
+ return na(
4321
+ y,
4323
4322
  $,
4324
4323
  m
4325
4324
  );
4326
4325
  };
4327
4326
 
4328
4327
  // src/smartCheckout/routing/onRamp/onRampRoute.ts
4329
- var qr = async (r, e, t) => {
4328
+ var Ur = async (r, e, t) => {
4330
4329
  if (!["ERC20", "NATIVE"].includes(t.type)) return void 0;
4331
4330
  const { required: n, current: o, delta: a } = t;
4332
4331
  let i = false;
4333
- const s = await At(r, e);
4332
+ const s = await ht(r, e);
4334
4333
  s.forEach((c) => {
4335
4334
  if (!c.address) return;
4336
4335
  if (!n.token) return;
@@ -4358,8 +4357,8 @@ var qr = async (r, e, t) => {
4358
4357
  };
4359
4358
 
4360
4359
  // src/smartCheckout/routing/routingCalculator.ts
4361
- var ua = (r) => r.bridge || r.swap || r.onRamp;
4362
- var pa = (r) => {
4360
+ var oa = (r) => r.bridge || r.swap || r.onRamp;
4361
+ var aa = (r) => {
4363
4362
  let e = 0;
4364
4363
  let t;
4365
4364
  for (const n of r.balanceRequirements) {
@@ -4371,7 +4370,7 @@ var pa = (r) => {
4371
4370
  if (e === 1) return t;
4372
4371
  return void 0;
4373
4372
  };
4374
- var ma = async (r, e, t, n, o) => {
4373
+ var ia = async (r, e, t, n, o) => {
4375
4374
  let a;
4376
4375
  if (n === void 0) return void 0;
4377
4376
  if (n.type !== "NATIVE" && n.type !== "ERC20") {
@@ -4393,7 +4392,7 @@ var ma = async (r, e, t, n, o) => {
4393
4392
  }
4394
4393
  return a;
4395
4394
  };
4396
- var fa = async (r, e, t, n, o, a, i) => {
4395
+ var sa = async (r, e, t, n, o, a, i) => {
4397
4396
  const s = [];
4398
4397
  if (!e.swap) return s;
4399
4398
  if (t === void 0) return s;
@@ -4402,7 +4401,7 @@ var fa = async (r, e, t, n, o, a, i) => {
4402
4401
  if (!c) return s;
4403
4402
  if (c.error !== void 0 || !c.success) return s;
4404
4403
  if (a.length === 0) return s;
4405
- const d = a.filter((u) => u.address).map((u) => u.address);
4404
+ const d = a.filter((p) => p.address).map((p) => p.address);
4406
4405
  if (d.length === 0) return s;
4407
4406
  return await Ue(
4408
4407
  r,
@@ -4414,7 +4413,7 @@ var fa = async (r, e, t, n, o, a, i) => {
4414
4413
  i
4415
4414
  );
4416
4415
  };
4417
- var ga = async (r, e, t, n, o, a, i, s) => {
4416
+ var ca = async (r, e, t, n, o, a, i, s) => {
4418
4417
  if (!n) return [];
4419
4418
  const c = a.get(N(r));
4420
4419
  const d = a.get(A(r));
@@ -4422,32 +4421,32 @@ var ga = async (r, e, t, n, o, a, i, s) => {
4422
4421
  if (c.error !== void 0 || !c.success) return [];
4423
4422
  if (!d) return [];
4424
4423
  if (d.error !== void 0 || !d.success) return [];
4425
- const u = _nullishCoalesce(_optionalChain([i, 'optionalAccess', _129 => _129.bridge]), () => ( []));
4426
- const p = u.map((E) => {
4427
- if (E.address === void 0) return J;
4428
- return E.address;
4424
+ const p = _nullishCoalesce(_optionalChain([i, 'optionalAccess', _129 => _129.bridge]), () => ( []));
4425
+ const u = p.map((g) => {
4426
+ if (g.address === void 0) return J;
4427
+ return g.address;
4429
4428
  });
4430
4429
  const m = _nullishCoalesce(_optionalChain([i, 'optionalAccess', _130 => _130.swap]), () => ( []));
4431
4430
  if (n.type !== "NATIVE" && n.type !== "ERC20") {
4432
4431
  return [];
4433
4432
  }
4434
- const g = await Gr(
4433
+ const E = await Wr(
4435
4434
  r,
4436
4435
  e,
4437
4436
  t,
4438
4437
  n,
4439
4438
  o,
4440
4439
  a,
4441
- p,
4440
+ u,
4442
4441
  m,
4443
4442
  s
4444
4443
  );
4445
- return g;
4444
+ return E;
4446
4445
  };
4447
- var Ea = async (r, e, t) => {
4446
+ var da = async (r, e, t) => {
4448
4447
  if (!e.onRamp) return void 0;
4449
4448
  if (t === void 0) return void 0;
4450
- const n = await qr(
4449
+ const n = await Ur(
4451
4450
  r,
4452
4451
  e,
4453
4452
  t
@@ -4472,8 +4471,8 @@ var He = (r, e, t, n) => {
4472
4471
  t.push(a);
4473
4472
  _optionalChain([n, 'optionalCall', _131 => _131(a)]);
4474
4473
  };
4475
- var jr = async (r, e, t, n, o) => {
4476
- if (!ua(n)) {
4474
+ var Gr = async (r, e, t, n, o) => {
4475
+ if (!oa(n)) {
4477
4476
  return {
4478
4477
  type: "NO_ROUTE_OPTIONS",
4479
4478
  message: "No routing options are available"
@@ -4482,17 +4481,17 @@ var jr = async (r, e, t, n, o) => {
4482
4481
  let a;
4483
4482
  try {
4484
4483
  a = await Le(r);
4485
- } catch (p) {
4484
+ } catch (u) {
4486
4485
  throw new l(
4487
4486
  "Error occurred while creating read only providers",
4488
4487
  "PROVIDER_ERROR",
4489
- { error: p }
4488
+ { error: u }
4490
4489
  );
4491
4490
  }
4492
4491
  const i = await S(
4493
4492
  r,
4494
4493
  "Time to get token balances inside router",
4495
- _r(
4494
+ vr(
4496
4495
  r,
4497
4496
  a,
4498
4497
  e,
@@ -4502,14 +4501,14 @@ var jr = async (r, e, t, n, o) => {
4502
4501
  const s = await S(
4503
4502
  r,
4504
4503
  "Time to get routing allowlist",
4505
- Mr(r, i, n)
4504
+ _r(r, i, n)
4506
4505
  );
4507
- const c = pa(t);
4506
+ const c = aa(t);
4508
4507
  const d = [];
4509
- const u = [];
4508
+ const p = [];
4510
4509
  if (n.swap) {
4511
4510
  d.push(
4512
- fa(
4511
+ sa(
4513
4512
  r,
4514
4513
  n,
4515
4514
  c,
@@ -4517,12 +4516,12 @@ var jr = async (r, e, t, n, o) => {
4517
4516
  i,
4518
4517
  s.swap,
4519
4518
  t
4520
- ).then((p) => {
4521
- p.forEach((m) => {
4519
+ ).then((u) => {
4520
+ u.forEach((m) => {
4522
4521
  He(
4523
4522
  m,
4524
4523
  Ve.swap,
4525
- u,
4524
+ p,
4526
4525
  o
4527
4526
  );
4528
4527
  });
@@ -4531,17 +4530,17 @@ var jr = async (r, e, t, n, o) => {
4531
4530
  }
4532
4531
  if (n.bridge) {
4533
4532
  d.push(
4534
- ma(
4533
+ ia(
4535
4534
  r,
4536
4535
  a,
4537
4536
  n,
4538
4537
  c,
4539
4538
  i
4540
- ).then((p) => {
4539
+ ).then((u) => {
4541
4540
  He(
4542
- p,
4543
- Ve.bridge,
4544
4541
  u,
4542
+ Ve.bridge,
4543
+ p,
4545
4544
  o
4546
4545
  );
4547
4546
  })
@@ -4549,15 +4548,15 @@ var jr = async (r, e, t, n, o) => {
4549
4548
  }
4550
4549
  if (n.onRamp) {
4551
4550
  d.push(
4552
- Ea(
4551
+ da(
4553
4552
  r,
4554
4553
  n,
4555
4554
  c
4556
- ).then((p) => {
4555
+ ).then((u) => {
4557
4556
  He(
4558
- p,
4559
- Ve.onRamp,
4560
4557
  u,
4558
+ Ve.onRamp,
4559
+ p,
4561
4560
  o
4562
4561
  );
4563
4562
  })
@@ -4565,7 +4564,7 @@ var jr = async (r, e, t, n, o) => {
4565
4564
  }
4566
4565
  if (n.swap && n.bridge) {
4567
4566
  d.push(
4568
- ga(
4567
+ ca(
4569
4568
  r,
4570
4569
  a,
4571
4570
  n,
@@ -4574,12 +4573,12 @@ var jr = async (r, e, t, n, o) => {
4574
4573
  i,
4575
4574
  s,
4576
4575
  t
4577
- ).then((p) => {
4578
- p.forEach((m) => {
4576
+ ).then((u) => {
4577
+ u.forEach((m) => {
4579
4578
  He(
4580
4579
  m,
4581
4580
  Ve.bridgeAndSwap,
4582
- u,
4581
+ p,
4583
4582
  o
4584
4583
  );
4585
4584
  });
@@ -4591,7 +4590,7 @@ var jr = async (r, e, t, n, o) => {
4591
4590
  "Time to resolve all routes",
4592
4591
  Promise.all(d)
4593
4592
  );
4594
- if (u.length === 0) {
4593
+ if (p.length === 0) {
4595
4594
  return {
4596
4595
  type: "NO_ROUTES_FOUND",
4597
4596
  message: "Smart Checkout did not find any funding routes to fulfill the transaction"
@@ -4599,12 +4598,12 @@ var jr = async (r, e, t, n, o) => {
4599
4598
  }
4600
4599
  return {
4601
4600
  type: "ROUTES_FOUND",
4602
- fundingRoutes: u
4601
+ fundingRoutes: p
4603
4602
  };
4604
4603
  };
4605
4604
 
4606
4605
  // src/smartCheckout/smartCheckout.ts
4607
- var Ra = (r) => {
4606
+ var la = (r) => {
4608
4607
  const e = r.balanceRequirements.map(
4609
4608
  (t) => {
4610
4609
  if (t.type === "ERC20" && t.sufficient) {
@@ -4625,12 +4624,12 @@ var Ra = (r) => {
4625
4624
  balanceRequirements: e
4626
4625
  };
4627
4626
  };
4628
- var Vr = async (r, e, t, n, o, a, i, s, c) => {
4629
- const d = !i || t && s ? Ra(a) : a;
4630
- const u = await S(
4627
+ var qr = async (r, e, t, n, o, a, i, s, c) => {
4628
+ const d = !i || t && s ? la(a) : a;
4629
+ const p = await S(
4631
4630
  r,
4632
4631
  "Total time to run the routing calculator",
4633
- jr(
4632
+ Gr(
4634
4633
  r,
4635
4634
  e,
4636
4635
  d,
@@ -4643,72 +4642,72 @@ var Vr = async (r, e, t, n, o, a, i, s, c) => {
4643
4642
  transactionRequirements: o,
4644
4643
  router: {
4645
4644
  availableRoutingOptions: n,
4646
- routingOutcome: u
4645
+ routingOutcome: p
4647
4646
  }
4648
4647
  })]);
4649
- return u;
4648
+ return p;
4650
4649
  };
4651
4650
  var se = async (r, e, t, n, o, a, i, s = false) => {
4652
4651
  const c = await (await e.getSigner()).getAddress();
4653
- let d = It(t);
4654
- const u = mr(
4652
+ let d = Ct(t);
4653
+ const p = pr(
4655
4654
  e,
4656
4655
  c,
4657
4656
  d
4658
4657
  );
4659
- const p = gr(
4658
+ const u = mr(
4660
4659
  e,
4661
4660
  c,
4662
4661
  d
4663
4662
  );
4664
- const m = Rr(
4663
+ const m = Er(
4665
4664
  e,
4666
4665
  c,
4667
4666
  d
4668
4667
  );
4669
- const g = await S(
4668
+ const E = await S(
4670
4669
  r,
4671
4670
  "Time to calculate token allowances",
4672
- Promise.all([u, p, m])
4671
+ Promise.all([p, u, m])
4673
4672
  );
4674
- const E = ur(
4675
- g[0],
4676
- g[1],
4677
- g[2]
4673
+ const g = dr(
4674
+ E[0],
4675
+ E[1],
4676
+ E[2]
4678
4677
  );
4679
4678
  let f = null;
4680
4679
  if (n) {
4681
4680
  f = await S(
4682
4681
  r,
4683
4682
  "Time to run gas calculator",
4684
- Pr(e, E, n)
4683
+ wr(e, g, n)
4685
4684
  );
4686
4685
  if (f !== null) {
4687
4686
  d.push(f);
4688
- d = It(d);
4687
+ d = Ct(d);
4689
4688
  }
4690
4689
  }
4691
4690
  const R = await S(
4692
4691
  r,
4693
4692
  "Time to run balance checks",
4694
- yr(r, e, c, d, true)
4693
+ Ar(r, e, c, d, true)
4695
4694
  );
4696
4695
  const { sufficient: T } = R;
4697
4696
  const C = R.balanceRequirements;
4698
- const w = await S(
4697
+ const y = await S(
4699
4698
  r,
4700
4699
  "Time to fetch available routing options",
4701
- Nr(r, e)
4700
+ kr(r, e)
4702
4701
  );
4703
- if (_optionalChain([o, 'optionalAccess', _133 => _133.onRamp]) === false) w.onRamp = false;
4704
- if (_optionalChain([o, 'optionalAccess', _134 => _134.swap]) === false) w.swap = false;
4705
- if (_optionalChain([o, 'optionalAccess', _135 => _135.bridge]) === false) w.bridge = false;
4702
+ if (_optionalChain([o, 'optionalAccess', _133 => _133.onRamp]) === false) y.onRamp = false;
4703
+ if (_optionalChain([o, 'optionalAccess', _134 => _134.swap]) === false) y.swap = false;
4704
+ if (_optionalChain([o, 'optionalAccess', _135 => _135.bridge]) === false) y.bridge = false;
4706
4705
  if (a) {
4707
- Vr(
4706
+ qr(
4708
4707
  r,
4709
4708
  c,
4710
4709
  T,
4711
- w,
4710
+ y,
4712
4711
  C,
4713
4712
  R,
4714
4713
  s,
@@ -4726,11 +4725,11 @@ var se = async (r, e, t, n, o, a, i, s = false) => {
4726
4725
  transactionRequirements: C
4727
4726
  };
4728
4727
  }
4729
- const P = await Vr(
4728
+ const P = await qr(
4730
4729
  r,
4731
4730
  c,
4732
4731
  T,
4733
- w,
4732
+ y,
4734
4733
  C,
4735
4734
  R,
4736
4735
  s,
@@ -4741,7 +4740,7 @@ var se = async (r, e, t, n, o, a, i, s = false) => {
4741
4740
  sufficient: T,
4742
4741
  transactionRequirements: C,
4743
4742
  router: {
4744
- availableRoutingOptions: w,
4743
+ availableRoutingOptions: y,
4745
4744
  routingOutcome: P
4746
4745
  }
4747
4746
  };
@@ -4758,15 +4757,15 @@ var _metrics = require('@imtbl/metrics');
4758
4757
  function yt(r) {
4759
4758
  return _optionalChain([r, 'optionalAccess', _136 => _136.ethereumProvider, 'optionalAccess', _137 => _137.isPassport]) === true;
4760
4759
  }
4761
- function Ia(r) {
4760
+ function ua(r) {
4762
4761
  return yt(r);
4763
4762
  }
4764
- var Ta = async (r, e) => {
4763
+ var ma = async (r, e) => {
4765
4764
  const t = e;
4766
4765
  const { chainId: n } = await r.getNetwork();
4767
- if (!Yt(Number(n))) return t;
4766
+ if (!Qt(Number(n))) return t;
4768
4767
  if (typeof t.gasPrice !== "undefined") return t;
4769
- if (Ia(r)) {
4768
+ if (ua(r)) {
4770
4769
  t.gasPrice = BigInt(0);
4771
4770
  } else {
4772
4771
  t.maxFeePerGas = nt.maxFeePerGas;
@@ -4774,7 +4773,7 @@ var Ta = async (r, e) => {
4774
4773
  }
4775
4774
  return t;
4776
4775
  };
4777
- var St = (r) => {
4776
+ var wt = (r) => {
4778
4777
  if (r.code === "INSUFFICIENT_FUNDS") {
4779
4778
  return new l(
4780
4779
  r.message,
@@ -4798,13 +4797,13 @@ var St = (r) => {
4798
4797
  var F = async (r, e) => {
4799
4798
  try {
4800
4799
  const t = await r.getSigner();
4801
- const n = await Ta(r, e);
4800
+ const n = await ma(r, e);
4802
4801
  const o = await t.sendTransaction(n);
4803
4802
  return {
4804
4803
  transactionResponse: o
4805
4804
  };
4806
4805
  } catch (t) {
4807
- throw St(t);
4806
+ throw wt(t);
4808
4807
  }
4809
4808
  };
4810
4809
 
@@ -4863,7 +4862,7 @@ var Ke = async (r, e) => {
4863
4862
  type: "SUCCESS"
4864
4863
  };
4865
4864
  };
4866
- var Hr = async (r, e) => {
4865
+ var jr = async (r, e) => {
4867
4866
  try {
4868
4867
  const t = await (await r.getSigner()).signTypedData(
4869
4868
  e.unsignedMessage.domain,
@@ -4890,7 +4889,7 @@ var Hr = async (r, e) => {
4890
4889
 
4891
4890
 
4892
4891
 
4893
- var zr = async (r) => {
4892
+ var Vr = async (r) => {
4894
4893
  let e = [];
4895
4894
  let t = [];
4896
4895
  const n = [];
@@ -4911,7 +4910,7 @@ var zr = async (r) => {
4911
4910
  fulfillmentTransactions: t
4912
4911
  };
4913
4912
  };
4914
- var Kr = async (r) => {
4913
+ var Hr = async (r) => {
4915
4914
  let e = [];
4916
4915
  const t = [];
4917
4916
  for (const n of r) {
@@ -4923,7 +4922,7 @@ var Kr = async (r) => {
4923
4922
  e = await Promise.all(t);
4924
4923
  return e;
4925
4924
  };
4926
- var kt = async (r) => {
4925
+ var Pt = async (r) => {
4927
4926
  let e = [];
4928
4927
  const t = [];
4929
4928
  for (const n of r) {
@@ -4935,7 +4934,7 @@ var kt = async (r) => {
4935
4934
  e = await Promise.all(t);
4936
4935
  return e;
4937
4936
  };
4938
- var Qr = (r, e, t) => {
4937
+ var zr = (r, e, t) => {
4939
4938
  let n;
4940
4939
  for (const o of t) {
4941
4940
  if (o.type !== _orderbook.ActionType.SIGNABLE) continue;
@@ -4957,15 +4956,15 @@ var Qr = (r, e, t) => {
4957
4956
 
4958
4957
  // src/smartCheckout/fees/fees.ts
4959
4958
 
4960
- var Zr = 1;
4959
+ var Kr = 1;
4961
4960
  var Ye = 6;
4962
- var ya = (r, e, t = BigInt(1)) => {
4961
+ var Ra = (r, e, t = BigInt(1)) => {
4963
4962
  const n = r.amount;
4964
4963
  const o = Math.round(n.percentageDecimal * 10 ** Ye);
4965
4964
  const a = e * BigInt(o) / BigInt(10 ** Ye);
4966
4965
  return a - a % t;
4967
4966
  };
4968
- var Sa = (r, e) => {
4967
+ var Ca = (r, e) => {
4969
4968
  const t = r.amount;
4970
4969
  const n = _ethers.parseUnits.call(void 0, t.token, e);
4971
4970
  return n;
@@ -4973,15 +4972,15 @@ var Sa = (r, e) => {
4973
4972
  var Je = (r, e, t = 18, n = BigInt(1)) => {
4974
4973
  let o = BigInt(0);
4975
4974
  const a = BigInt(e);
4976
- const i = a * BigInt(Zr * 10 ** Ye) / BigInt(10 ** Ye);
4975
+ const i = a * BigInt(Kr * 10 ** Ye) / BigInt(10 ** Ye);
4977
4976
  const s = [];
4978
4977
  for (const c of r) {
4979
4978
  let d = BigInt(0);
4980
4979
  if (Object.hasOwn(c.amount, "percentageDecimal")) {
4981
- d = ya(c, a, n);
4980
+ d = Ra(c, a, n);
4982
4981
  o += d;
4983
4982
  } else if (Object.hasOwn(c.amount, "token")) {
4984
- d = Sa(c, t);
4983
+ d = Ca(c, t);
4985
4984
  o += d;
4986
4985
  } else {
4987
4986
  throw new l(
@@ -4991,7 +4990,7 @@ var Je = (r, e, t = 18, n = BigInt(1)) => {
4991
4990
  }
4992
4991
  if (o > i) {
4993
4992
  throw new l(
4994
- `The combined fees are above the allowed maximum of ${Zr * 100}%`,
4993
+ `The combined fees are above the allowed maximum of ${Kr * 100}%`,
4995
4994
  "ORDER_FEE_ERROR"
4996
4995
  );
4997
4996
  }
@@ -5006,7 +5005,7 @@ var Je = (r, e, t = 18, n = BigInt(1)) => {
5006
5005
  };
5007
5006
 
5008
5007
  // src/smartCheckout/buy/buy.ts
5009
- var Na = (r, e, t, n, o = false) => {
5008
+ var Aa = (r, e, t, n, o = false) => {
5010
5009
  switch (r) {
5011
5010
  case "ERC20":
5012
5011
  return {
@@ -5025,7 +5024,7 @@ var Na = (r, e, t, n, o = false) => {
5025
5024
  };
5026
5025
  }
5027
5026
  };
5028
- var _a = (r, e) => {
5027
+ var ya = (r, e) => {
5029
5028
  if (e.length > 0) {
5030
5029
  return {
5031
5030
  type: "TRANSACTION",
@@ -5040,7 +5039,7 @@ var _a = (r, e) => {
5040
5039
  }
5041
5040
  };
5042
5041
  };
5043
- var Yr = async (r, e, t, n = {
5042
+ var Qr = async (r, e, t, n = {
5044
5043
  waitFulfillmentSettlements: true
5045
5044
  }) => {
5046
5045
  _metrics.track.call(void 0, "checkout_sdk", "buy_initiated");
@@ -5055,25 +5054,25 @@ var Yr = async (r, e, t, n = {
5055
5054
  let i = 18;
5056
5055
  const s = _orderbook.constants.estimatedFulfillmentGasGwei;
5057
5056
  const c = ae(r);
5058
- const d = Be(r);
5059
- const u = await S(
5057
+ const d = Me(r);
5058
+ const p = await S(
5060
5059
  r,
5061
5060
  "Time to get the address from the provider",
5062
5061
  (await e.getSigner()).getAddress()
5063
5062
  );
5064
- gt();
5065
- G(r, e, u, N(r));
5066
- G(r, e, u, A(r));
5067
- const { id: p, takerFees: m, fillAmount: g } = t[0];
5068
- let E;
5063
+ ft();
5064
+ G(r, e, p, N(r));
5065
+ G(r, e, p, A(r));
5066
+ const { id: u, takerFees: m, fillAmount: E } = t[0];
5067
+ let g;
5069
5068
  try {
5070
5069
  o = await S(
5071
5070
  r,
5072
5071
  "Time to fetch the listing from the orderbook",
5073
- c.getListing(p)
5072
+ c.getListing(u)
5074
5073
  );
5075
5074
  const { seaportContractAddress: k, chainName: X } = c.config();
5076
- E = X;
5075
+ g = X;
5077
5076
  a = k;
5078
5077
  } catch (k) {
5079
5078
  throw new l(
@@ -5081,7 +5080,7 @@ var Yr = async (r, e, t, n = {
5081
5080
  "GET_ORDER_LISTING_ERROR",
5082
5081
  {
5083
5082
  error: k,
5084
- orderId: p
5083
+ orderId: u
5085
5084
  }
5086
5085
  );
5087
5086
  }
@@ -5090,7 +5089,7 @@ var Yr = async (r, e, t, n = {
5090
5089
  "An error occurred with the get order listing",
5091
5090
  "GET_ORDER_LISTING_ERROR",
5092
5091
  {
5093
- orderId: p,
5092
+ orderId: u,
5094
5093
  message: "No buy side tokens found on order"
5095
5094
  }
5096
5095
  );
@@ -5100,7 +5099,7 @@ var Yr = async (r, e, t, n = {
5100
5099
  const k = await S(
5101
5100
  r,
5102
5101
  "Time to get decimals of token contract for the buy token",
5103
- d.getToken({ contractAddress: f.contractAddress, chainName: E })
5102
+ d.getToken({ contractAddress: f.contractAddress, chainName: g })
5104
5103
  );
5105
5104
  if (k.result.decimals) i = k.result.decimals;
5106
5105
  }
@@ -5111,32 +5110,32 @@ var Yr = async (r, e, t, n = {
5111
5110
  }
5112
5111
  let T = [];
5113
5112
  let C = [];
5114
- let w = [];
5113
+ let y = [];
5115
5114
  const P = performance.now();
5116
5115
  try {
5117
5116
  const { actions: k } = await S(
5118
5117
  r,
5119
5118
  "Time to call fulfillOrder from the orderbook",
5120
- c.fulfillOrder(p, u, R, g)
5119
+ c.fulfillOrder(u, p, R, E)
5121
5120
  );
5122
- w = k;
5121
+ y = k;
5123
5122
  T = await S(
5124
5123
  r,
5125
5124
  "Time to construct the unsigned approval transactions",
5126
- Kr(k)
5125
+ Hr(k)
5127
5126
  );
5128
5127
  } catch (k) {
5129
5128
  const X = (performance.now() - P) / 1e3;
5130
- dt(r, "Time to call fulfillOrder from the orderbook", X);
5129
+ ct(r, "Time to call fulfillOrder from the orderbook", X);
5131
5130
  if (k.message.includes(_orderbook.OrderStatusName.EXPIRED)) {
5132
- throw new l("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: p });
5131
+ throw new l("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: u });
5133
5132
  }
5134
5133
  if (!k.message.includes("The fulfiller does not have the balances needed to fulfill")) {
5135
5134
  throw new l(
5136
5135
  "Error occurred while trying to fulfill the order",
5137
5136
  "FULFILL_ORDER_LISTING_ERROR",
5138
5137
  {
5139
- orderId: p,
5138
+ orderId: u,
5140
5139
  error: k
5141
5140
  }
5142
5141
  );
@@ -5146,7 +5145,7 @@ var Yr = async (r, e, t, n = {
5146
5145
  C = await S(
5147
5146
  r,
5148
5147
  "Time to construct the unsigned fulfillment transactions",
5149
- kt(w)
5148
+ Pt(y)
5150
5149
  );
5151
5150
  } catch (e6) {
5152
5151
  }
@@ -5168,7 +5167,7 @@ var Yr = async (r, e, t, n = {
5168
5167
  "Purchasing token type is unsupported",
5169
5168
  "UNSUPPORTED_TOKEN_TYPE_ERROR",
5170
5169
  {
5171
- orderId: p
5170
+ orderId: u
5172
5171
  }
5173
5172
  );
5174
5173
  }
@@ -5182,11 +5181,11 @@ var Yr = async (r, e, t, n = {
5182
5181
  W.forEach((k) => {
5183
5182
  v += BigInt(k.amount);
5184
5183
  });
5185
- if (o.result.sell[0].type === "ERC1155" && g) {
5186
- v = v * BigInt(g) / BigInt(o.result.sell[0].amount);
5184
+ if (o.result.sell[0].type === "ERC1155" && E) {
5185
+ v = v * BigInt(E) / BigInt(o.result.sell[0].amount);
5187
5186
  }
5188
5187
  const Xe = [
5189
- Na(z, ce, v, a)
5188
+ Aa(z, ce, v, a)
5190
5189
  ];
5191
5190
  const j = await S(
5192
5191
  r,
@@ -5195,7 +5194,7 @@ var Yr = async (r, e, t, n = {
5195
5194
  r,
5196
5195
  e,
5197
5196
  Xe,
5198
- _a(
5197
+ ya(
5199
5198
  s,
5200
5199
  C
5201
5200
  )
@@ -5213,7 +5212,7 @@ var Yr = async (r, e, t, n = {
5213
5212
  }
5214
5213
  try {
5215
5214
  if (C.length === 0) {
5216
- C = await kt(w);
5215
+ C = await Pt(y);
5217
5216
  }
5218
5217
  } catch (V) {
5219
5218
  throw new l(
@@ -5265,7 +5264,7 @@ var Yr = async (r, e, t, n = {
5265
5264
  };
5266
5265
 
5267
5266
  // src/smartCheckout/cancel/cancel.ts
5268
- var Ma = async (r, e, t, n, o) => {
5267
+ var Sa = async (r, e, t, n, o) => {
5269
5268
  let a;
5270
5269
  if (n.length === 0) {
5271
5270
  throw new l(
@@ -5332,7 +5331,7 @@ var Ma = async (r, e, t, n, o) => {
5332
5331
  transactions: s
5333
5332
  };
5334
5333
  };
5335
- var Ba = async (r, e, t) => {
5334
+ var Pa = async (r, e, t) => {
5336
5335
  try {
5337
5336
  const n = await e.getSigner();
5338
5337
  const o = await n.getAddress();
@@ -5345,27 +5344,27 @@ var Ba = async (r, e, t) => {
5345
5344
  const { result: s } = await r.cancelOrders(t, o, i);
5346
5345
  const c = [];
5347
5346
  const d = [];
5348
- const u = [];
5349
- for (const p of s.successful_cancellations) {
5347
+ const p = [];
5348
+ for (const u of s.successful_cancellations) {
5350
5349
  c.push({
5351
- orderId: p
5350
+ orderId: u
5352
5351
  });
5353
5352
  }
5354
- for (const p of s.failed_cancellations) {
5353
+ for (const u of s.failed_cancellations) {
5355
5354
  d.push({
5356
- orderId: p.order,
5357
- reason: p.reason_code
5355
+ orderId: u.order,
5356
+ reason: u.reason_code
5358
5357
  });
5359
5358
  }
5360
- for (const p of s.pending_cancellations) {
5361
- u.push({
5362
- orderId: p
5359
+ for (const u of s.pending_cancellations) {
5360
+ p.push({
5361
+ orderId: u
5363
5362
  });
5364
5363
  }
5365
5364
  return {
5366
5365
  successfulCancellations: c,
5367
5366
  failedCancellations: d,
5368
- pendingCancellations: u
5367
+ pendingCancellations: p
5369
5368
  };
5370
5369
  } catch (n) {
5371
5370
  throw new l(
@@ -5378,15 +5377,15 @@ var Ba = async (r, e, t) => {
5378
5377
  );
5379
5378
  }
5380
5379
  };
5381
- var Jr = async (r, e, t, n = {
5380
+ var Zr = async (r, e, t, n = {
5382
5381
  waitFulfillmentSettlements: true,
5383
5382
  useGaslessCancel: false
5384
5383
  }) => {
5385
5384
  const o = ae(r);
5386
5385
  if (n.useGaslessCancel) {
5387
- return await Ba(o, e, t);
5386
+ return await Pa(o, e, t);
5388
5387
  }
5389
- return await Ma(
5388
+ return await Sa(
5390
5389
  r,
5391
5390
  o,
5392
5391
  e,
@@ -5397,12 +5396,12 @@ var Jr = async (r, e, t, n = {
5397
5396
 
5398
5397
  // src/smartCheckout/itemRequirements/itemRequirements.ts
5399
5398
 
5400
- async function Xr(r, e) {
5399
+ async function Jr(r, e) {
5401
5400
  const t = [];
5402
5401
  e.forEach((a) => {
5403
5402
  if (a.type === "ERC20") {
5404
5403
  const { tokenAddress: i } = a;
5405
- t.push(ir(i, x, r).decimals());
5404
+ t.push(or(i, b, r).decimals());
5406
5405
  }
5407
5406
  });
5408
5407
  const n = await Promise.all(t);
@@ -5430,20 +5429,20 @@ async function Xr(r, e) {
5430
5429
 
5431
5430
 
5432
5431
 
5433
- var Wa = (r, e, t) => ({
5432
+ var Ba = (r, e, t) => ({
5434
5433
  type: "ERC721",
5435
5434
  id: r,
5436
5435
  contractAddress: e,
5437
5436
  spenderAddress: t
5438
5437
  });
5439
- var Ua = (r, e, t, n) => ({
5438
+ var Ma = (r, e, t, n) => ({
5440
5439
  type: "ERC1155",
5441
5440
  id: r,
5442
5441
  contractAddress: e,
5443
5442
  spenderAddress: t,
5444
5443
  amount: BigInt(n)
5445
5444
  });
5446
- var Ga = (r, e = 18) => {
5445
+ var xa = (r, e = 18) => {
5447
5446
  const t = _ethers.parseUnits.call(void 0, r.amount, e);
5448
5447
  if (r.type === "NATIVE") {
5449
5448
  return {
@@ -5457,7 +5456,7 @@ var Ga = (r, e = 18) => {
5457
5456
  contractAddress: r.tokenAddress
5458
5457
  };
5459
5458
  };
5460
- var en = async (r, e, t) => {
5459
+ var $r = async (r, e, t) => {
5461
5460
  let n;
5462
5461
  let o;
5463
5462
  let a = "";
@@ -5474,20 +5473,20 @@ var en = async (r, e, t) => {
5474
5473
  makerFees: c,
5475
5474
  orderExpiry: d
5476
5475
  } = t[0];
5477
- let u = 18;
5476
+ let p = 18;
5478
5477
  if (i.type === "ERC20") {
5479
5478
  const f = new (0, _ethers.Contract)(
5480
5479
  i.tokenAddress,
5481
- JSON.stringify(x),
5480
+ JSON.stringify(b),
5482
5481
  e
5483
5482
  );
5484
- u = await S(
5483
+ p = await S(
5485
5484
  r,
5486
5485
  "Time to get decimals of token contract for the buy token",
5487
5486
  f.decimals()
5488
5487
  );
5489
5488
  }
5490
- const p = Ga(i, u);
5489
+ const u = xa(i, p);
5491
5490
  const m = "type" in s;
5492
5491
  try {
5493
5492
  const f = await S(
@@ -5513,7 +5512,7 @@ var en = async (r, e, t) => {
5513
5512
  "Time to prepare the listing from the orderbook",
5514
5513
  n.prepareListing({
5515
5514
  makerAddress: f,
5516
- buy: p,
5515
+ buy: u,
5517
5516
  sell: T,
5518
5517
  orderExpiry: d
5519
5518
  })
@@ -5529,28 +5528,28 @@ var en = async (r, e, t) => {
5529
5528
  }
5530
5529
  );
5531
5530
  }
5532
- const g = [];
5531
+ const E = [];
5533
5532
  if (m && s.type === "ERC1155") {
5534
- const f = Ua(
5533
+ const f = Ma(
5535
5534
  s.id,
5536
5535
  s.collectionAddress,
5537
5536
  a,
5538
5537
  s.amount
5539
5538
  );
5540
- g.push(f);
5539
+ E.push(f);
5541
5540
  } else {
5542
- const f = Wa(s.id, s.collectionAddress, a);
5543
- g.push(f);
5541
+ const f = Ba(s.id, s.collectionAddress, a);
5542
+ E.push(f);
5544
5543
  }
5545
- let E;
5546
- if (!ht(e)) {
5547
- E = await S(
5544
+ let g;
5545
+ if (!Tt(e)) {
5546
+ g = await S(
5548
5547
  r,
5549
5548
  "Total time running smart checkout",
5550
5549
  se(
5551
5550
  r,
5552
5551
  e,
5553
- g,
5552
+ E,
5554
5553
  {
5555
5554
  type: "GAS",
5556
5555
  gasToken: {
@@ -5561,20 +5560,20 @@ var en = async (r, e, t) => {
5561
5560
  )
5562
5561
  );
5563
5562
  } else {
5564
- E = { sufficient: true, transactionRequirements: [] };
5563
+ g = { sufficient: true, transactionRequirements: [] };
5565
5564
  }
5566
- if (E.sufficient) {
5567
- const f = await zr(o.actions);
5565
+ if (g.sufficient) {
5566
+ const f = await Vr(o.actions);
5568
5567
  const R = await ze(e, f.approvalTransactions);
5569
5568
  if (R.type === "FAILED") {
5570
5569
  return {
5571
5570
  status: "FAILED",
5572
5571
  transactionHash: R.transactionHash,
5573
5572
  reason: R.reason,
5574
- smartCheckoutResult: E
5573
+ smartCheckoutResult: g
5575
5574
  };
5576
5575
  }
5577
- const T = Qr(
5576
+ const T = zr(
5578
5577
  o.orderHash,
5579
5578
  o.orderComponents,
5580
5579
  o.actions
@@ -5589,11 +5588,11 @@ var en = async (r, e, t) => {
5589
5588
  }
5590
5589
  );
5591
5590
  }
5592
- const C = await Hr(
5591
+ const C = await jr(
5593
5592
  e,
5594
5593
  T
5595
5594
  );
5596
- let w = "";
5595
+ let y = "";
5597
5596
  const P = {
5598
5597
  orderComponents: C.orderComponents,
5599
5598
  orderHash: C.orderHash,
@@ -5603,7 +5602,7 @@ var en = async (r, e, t) => {
5603
5602
  if (c !== void 0) {
5604
5603
  let v = BigInt(1);
5605
5604
  if (m && s.type === "ERC1155") v = BigInt(s.amount);
5606
- const z = Je(c, p.amount, u, v);
5605
+ const z = Je(c, u.amount, p, v);
5607
5606
  if (z.length !== c.length) {
5608
5607
  throw new l(
5609
5608
  "One of the fees is too small, must be greater than 0.000001",
@@ -5614,7 +5613,7 @@ var en = async (r, e, t) => {
5614
5613
  }
5615
5614
  try {
5616
5615
  const v = await n.createListing(P);
5617
- w = v.result.id;
5616
+ y = v.result.id;
5618
5617
  } catch (v) {
5619
5618
  throw new l(
5620
5619
  "An error occurred while creating the listing",
@@ -5628,19 +5627,19 @@ var en = async (r, e, t) => {
5628
5627
  }
5629
5628
  return {
5630
5629
  status: "SUCCESS",
5631
- orderIds: [w],
5632
- smartCheckoutResult: E
5630
+ orderIds: [y],
5631
+ smartCheckoutResult: g
5633
5632
  };
5634
5633
  }
5635
5634
  return {
5636
5635
  status: "INSUFFICIENT_FUNDS",
5637
- smartCheckoutResult: E
5636
+ smartCheckoutResult: g
5638
5637
  };
5639
5638
  };
5640
5639
 
5641
5640
  // src/swap/swap.ts
5642
5641
 
5643
- var vt = async (r, e, t, n, o, a, i, s, c) => {
5642
+ var kt = async (r, e, t, n, o, a, i, s, c) => {
5644
5643
  if (!t.address || t.decimals === 0) {
5645
5644
  throw new l(
5646
5645
  "fromToken address or decimals is missing.",
@@ -5666,11 +5665,11 @@ var vt = async (r, e, t, n, o, a, i, s, c) => {
5666
5665
  );
5667
5666
  }
5668
5667
  const d = A(r);
5669
- const u = await oe(d, r);
5670
- const p = await (await e.getSigner()).getAddress();
5668
+ const p = await oe(d, r);
5669
+ const u = await (await e.getSigner()).getAddress();
5671
5670
  if (o) {
5672
- return u.getUnsignedSwapTxFromAmountIn(
5673
- p,
5671
+ return p.getUnsignedSwapTxFromAmountIn(
5672
+ u,
5674
5673
  t.address,
5675
5674
  n.address,
5676
5675
  BigInt(_ethers.parseUnits.call(void 0, o, t.decimals)),
@@ -5679,8 +5678,8 @@ var vt = async (r, e, t, n, o, a, i, s, c) => {
5679
5678
  c
5680
5679
  );
5681
5680
  }
5682
- return u.getUnsignedSwapTxFromAmountOut(
5683
- p,
5681
+ return p.getUnsignedSwapTxFromAmountOut(
5682
+ u,
5684
5683
  t.address,
5685
5684
  n.address,
5686
5685
  BigInt(_ethers.parseUnits.call(void 0, a, n.decimals)),
@@ -5689,8 +5688,8 @@ var vt = async (r, e, t, n, o, a, i, s, c) => {
5689
5688
  c
5690
5689
  );
5691
5690
  };
5692
- var rn = async (r, e, t, n, o, a, i, s, c) => {
5693
- const d = await vt(
5691
+ var en = async (r, e, t, n, o, a, i, s, c) => {
5692
+ const d = await kt(
5694
5693
  r,
5695
5694
  e,
5696
5695
  t,
@@ -5703,31 +5702,31 @@ var rn = async (r, e, t, n, o, a, i, s, c) => {
5703
5702
  );
5704
5703
  if (d.approval) {
5705
5704
  const m = await F(e, d.approval.transaction);
5706
- const g = await m.transactionResponse.wait();
5707
- if (_optionalChain([g, 'optionalAccess', _140 => _140.status]) === 0) {
5705
+ const E = await m.transactionResponse.wait();
5706
+ if (_optionalChain([E, 'optionalAccess', _140 => _140.status]) === 0) {
5708
5707
  throw new l(
5709
5708
  "Approval transaction failed and was reverted",
5710
5709
  "APPROVAL_TRANSACTION_FAILED"
5711
5710
  );
5712
5711
  }
5713
5712
  }
5714
- const u = await F(e, d.swap.transaction);
5715
- const p = await u.transactionResponse.wait();
5716
- if (_optionalChain([p, 'optionalAccess', _141 => _141.status]) === 0) {
5713
+ const p = await F(e, d.swap.transaction);
5714
+ const u = await p.transactionResponse.wait();
5715
+ if (_optionalChain([u, 'optionalAccess', _141 => _141.status]) === 0) {
5717
5716
  throw new l(
5718
5717
  "Swap transaction failed and was reverted",
5719
5718
  "TRANSACTION_FAILED"
5720
5719
  );
5721
5720
  }
5722
5721
  return {
5723
- swapReceipt: p,
5722
+ swapReceipt: u,
5724
5723
  quote: d.quote,
5725
5724
  swap: d.swap
5726
5725
  };
5727
5726
  };
5728
5727
 
5729
5728
  // src/wallet/wallet.ts
5730
- async function nn(r) {
5729
+ async function tn(r) {
5731
5730
  const e = [];
5732
5731
  const t = _nullishCoalesce(_optionalChain([r, 'access', _142 => _142.exclude, 'optionalAccess', _143 => _143.map, 'call', _144 => _144((o) => o.walletProviderName)]), () => ( []));
5733
5732
  let n = Object.values(ue);
@@ -5744,116 +5743,18 @@ async function nn(r) {
5744
5743
  };
5745
5744
  }
5746
5745
 
5747
- // src/widgets/load.ts
5748
- function on(r, e, t) {
5749
- if (window === void 0) {
5750
- throw new Error("missing window object: please run Checkout client side");
5751
- }
5752
- if (document === void 0) {
5753
- throw new Error("missing document object: please run Checkout client side");
5754
- }
5755
- let n = `https://cdn.jsdelivr.net/npm/@imtbl/checkout-widgets@${t}/dist/browser/index.cdn.js`;
5756
- if (ot()) n = `http://${window.location.host}/lib/js/widgets.js`;
5757
- r.setAttribute("id", e);
5758
- r.setAttribute("data-version", t);
5759
- r.setAttribute("src", n);
5760
- document.head.appendChild(r);
5761
- }
5762
- function an(r) {
5763
- let e = `https://cdn.jsdelivr.net/npm/@imtbl/checkout-widgets@${r}/dist/browser/index.js`;
5764
- if (ot()) e = `http://${window.location.host}/lib/js/index.js`;
5765
- return e;
5766
- }
5767
-
5768
- // src/widgets/version.ts
5769
- var _semver = require('semver'); var _semver2 = _interopRequireDefault(_semver);
5770
- function cn(r) {
5771
- const e = Se();
5772
- if (r === void 0 || r.major === void 0) return e;
5773
- if (!Number.isInteger(r.major) || r.major < 0) return e;
5774
- if (r.minor !== void 0 && r.minor < 0) return e;
5775
- if (r.patch !== void 0 && r.patch < 0) return e;
5776
- if (r.major === 0 && r.minor === void 0) return e;
5777
- if (r.major === 0 && r.minor === 0 && r.patch === void 0) return e;
5778
- if (r.major === 0 && r.minor === void 0 && r.patch === void 0) return e;
5779
- if (r.major === 0 && r.minor === 0 && r.patch === 0) return e;
5780
- let t = r.major.toString();
5781
- if (r.minor === void 0) return t;
5782
- if (Number.isInteger(r.minor)) {
5783
- t += `.${r.minor.toString()}`;
5784
- }
5785
- if (r.patch === void 0) return t;
5786
- if (Number.isInteger(r.patch)) {
5787
- t += `.${r.patch.toString()}`;
5788
- }
5789
- if (r.prerelease === void 0 || r.prerelease !== "alpha") return t;
5790
- if (r.prerelease === "alpha") {
5791
- t += `-${r.prerelease}`;
5792
- }
5793
- if (r.build === void 0) return t;
5794
- if (Number.isInteger(r.build) && r.build >= 0) {
5795
- t += `.${r.build.toString()}`;
5796
- }
5797
- return t;
5798
- }
5799
- async function Nt() {
5800
- const r = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@latest/dist/version.json?t=${Date.now()}`;
5801
- const e = "latest";
5802
- try {
5803
- const t = await fetch(r);
5804
- if (!t.ok) {
5805
- return e;
5806
- }
5807
- const n = await t.json();
5808
- const o = _optionalChain([n, 'access', _145 => _145.version, 'optionalAccess', _146 => _146.trim, 'call', _147 => _147()]);
5809
- if (o) {
5810
- return o;
5811
- }
5812
- return e;
5813
- } catch (t) {
5814
- return e;
5815
- }
5816
- }
5817
- function Ha(r, e) {
5818
- for (const t of e) {
5819
- if (_semver2.default.valid(t) && _semver2.default.lte(r, t)) {
5820
- return t;
5821
- }
5822
- }
5823
- return "latest";
5824
- }
5825
- async function dn(r, e, t) {
5826
- if (e) {
5827
- return r;
5828
- }
5829
- if (r.includes("alpha")) {
5830
- return r;
5831
- }
5832
- if (!t || !Array.isArray(t.compatibleVersionMarkers)) {
5833
- return r;
5834
- }
5835
- const n = Ha(
5836
- r,
5837
- t.compatibleVersionMarkers
5838
- );
5839
- if (n === "latest") {
5840
- return await Nt();
5841
- }
5842
- return n;
5843
- }
5844
-
5845
5746
  // src/riskAssessment/riskAssessment.ts
5846
5747
 
5847
- var _t = async (r, e) => {
5748
+ var vt = async (r, e) => {
5848
5749
  const t = Object.fromEntries(
5849
5750
  r.map((o) => [o.toLowerCase(), { sanctioned: false }])
5850
5751
  );
5851
5752
  const n = await e.remote.getConfig("riskAssessment");
5852
- if (!_optionalChain([n, 'optionalAccess', _148 => _148.enabled])) {
5753
+ if (!_optionalChain([n, 'optionalAccess', _145 => _145.enabled])) {
5853
5754
  return t;
5854
5755
  }
5855
5756
  try {
5856
- const o = _nullishCoalesce(_optionalChain([n, 'optionalAccess', _149 => _149.levels, 'access', _150 => _150.map, 'call', _151 => _151((i) => i.toLowerCase())]), () => ( []));
5757
+ const o = _nullishCoalesce(_optionalChain([n, 'optionalAccess', _146 => _146.levels, 'access', _147 => _147.map, 'call', _148 => _148((i) => i.toLowerCase())]), () => ( []));
5857
5758
  const a = await _axios2.default.post(
5858
5759
  `${U[e.environment]}/v1/sanctions/check`,
5859
5760
  {
@@ -5871,7 +5772,7 @@ var _t = async (r, e) => {
5871
5772
  return t;
5872
5773
  }
5873
5774
  };
5874
- var Ot = (r, e) => {
5775
+ var Nt = (r, e) => {
5875
5776
  if (e) {
5876
5777
  return r[e.toLowerCase()].sanctioned;
5877
5778
  }
@@ -5879,13 +5780,13 @@ var Ot = (r, e) => {
5879
5780
  };
5880
5781
 
5881
5782
  // src/sdk.ts
5882
- var Qa = {
5783
+ var Ua = {
5883
5784
  baseConfig: {
5884
5785
  environment: _config.Environment.SANDBOX
5885
5786
  },
5886
5787
  passport: void 0
5887
5788
  };
5888
- var Mt = class {
5789
+ var _t = class {
5889
5790
 
5890
5791
 
5891
5792
 
@@ -5896,9 +5797,9 @@ var Mt = class {
5896
5797
  * Constructs a new instance of the CheckoutModule class.
5897
5798
  * @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
5898
5799
  */
5899
- constructor(e = Qa) {
5800
+ constructor(e = Ua) {
5900
5801
  this.httpClient = new de(e);
5901
- this.config = new Ce(e, this.httpClient);
5802
+ this.config = new Ie(e, this.httpClient);
5902
5803
  this.fiatRampService = new Oe(this.config);
5903
5804
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5904
5805
  this.availability = Pe(
@@ -5909,6 +5810,8 @@ var Mt = class {
5909
5810
  D.getInstance().initialise();
5910
5811
  }
5911
5812
  /**
5813
+ * @deprecated Use `import { WidgetsFactory } from '@imtbl/checkout-widgets'` instead.
5814
+ * This method will be removed in the next major release (v3)
5912
5815
  * Loads the widgets bundle and initiates the widgets factory.
5913
5816
  * @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
5914
5817
  * @returns {Promise<ImmutableCheckoutWidgets.WidgetsFactory>} A promise that resolves to the widgets factory instance
@@ -5917,134 +5820,32 @@ var Mt = class {
5917
5820
  */
5918
5821
  async widgets(e) {
5919
5822
  const t = this;
5920
- const n = await t.config.remote.getConfig("checkoutWidgetsVersion");
5921
- const o = cn(e.version);
5922
- const a = e.version !== void 0;
5923
- const i = await dn(
5924
- o,
5925
- a,
5926
- n
5927
- );
5823
+ const n = le();
5928
5824
  try {
5929
- const s = await this.loadEsModules(e.config, i);
5930
- return s;
5931
- } catch (s) {
5825
+ const o = `https://cdn.jsdelivr.net/npm/@imtbl/checkout-widgets@${le()}/dist/browser/index.js`;
5826
+ const a = await Promise.resolve().then(() => _interopRequireWildcard(require(
5827
+ /* webpackIgnore: true */
5828
+ o
5829
+ )));
5830
+ if (a && a.WidgetsFactory) {
5831
+ return new a.WidgetsFactory(t, e.config);
5832
+ }
5833
+ throw new Error(`WidgetsFactory not found in loaded module for version: ${n}`);
5834
+ } catch (o) {
5932
5835
  throw new l(
5933
5836
  "Failed to load widgets script",
5934
5837
  "WIDGETS_SCRIPT_LOAD_ERROR",
5935
- { error: s }
5838
+ { error: o }
5936
5839
  );
5937
5840
  }
5938
5841
  }
5939
- async loadUmdBundle(e, t) {
5940
- const n = this;
5941
- const o = new Promise(
5942
- (a, i) => {
5943
- try {
5944
- const s = "immutable-checkout-widgets-bundle";
5945
- const c = document.getElementById(
5946
- s
5947
- );
5948
- if (c) {
5949
- if (typeof ImmutableCheckoutWidgets !== "undefined") {
5950
- a(
5951
- new ImmutableCheckoutWidgets.WidgetsFactory(n, e)
5952
- );
5953
- } else {
5954
- i(
5955
- new l(
5956
- "Failed to find ImmutableCheckoutWidgets script",
5957
- "WIDGETS_SCRIPT_LOAD_ERROR"
5958
- )
5959
- );
5960
- }
5961
- }
5962
- const d = document.createElement("script");
5963
- d.addEventListener("load", () => {
5964
- if (typeof ImmutableCheckoutWidgets !== "undefined") {
5965
- a(
5966
- new ImmutableCheckoutWidgets.WidgetsFactory(n, e)
5967
- );
5968
- } else {
5969
- i(
5970
- new l(
5971
- "Failed to find ImmutableCheckoutWidgets script",
5972
- "WIDGETS_SCRIPT_LOAD_ERROR"
5973
- )
5974
- );
5975
- }
5976
- });
5977
- d.addEventListener("error", (u) => {
5978
- i(
5979
- new l(
5980
- "Failed to load widgets script",
5981
- "WIDGETS_SCRIPT_LOAD_ERROR",
5982
- { error: u }
5983
- )
5984
- );
5985
- });
5986
- on(d, s, t);
5987
- } catch (s) {
5988
- i(
5989
- new l(
5990
- "Failed to load widgets script",
5991
- "WIDGETS_SCRIPT_LOAD_ERROR",
5992
- { error: s }
5993
- )
5994
- );
5995
- }
5996
- }
5997
- );
5998
- return o;
5999
- }
6000
- async loadEsModules(e, t) {
6001
- const n = this;
6002
- async function o(a) {
6003
- const i = an(a);
6004
- try {
6005
- const s = await Promise.resolve().then(() => _interopRequireWildcard(require(
6006
- /* webpackIgnore: true */
6007
- i
6008
- )));
6009
- if (s && s.WidgetsFactory) {
6010
- return new s.WidgetsFactory(n, e);
6011
- }
6012
- throw new Error(`WidgetsFactory not found in loaded module for version: ${a}`);
6013
- } catch (s) {
6014
- console.warn(
6015
- `Failed to load ESM bundle for version ${a}. Error: ${s.message}`
6016
- );
6017
- throw s;
6018
- }
6019
- }
6020
- try {
6021
- return await o(t);
6022
- } catch (a) {
6023
- const i = await Nt();
6024
- if (t === i && t !== "latest") {
6025
- try {
6026
- return await o("latest");
6027
- } catch (s) {
6028
- console.warn(
6029
- `Failed to resolve Commerce Widgets module, falling back to UMD bundle. Error: ${s.message}`
6030
- );
6031
- }
6032
- } else {
6033
- console.warn(
6034
- `Failed to resolve Commerce Widgets module for version ${t}, falling back to UMD bundle.
6035
- Error: ${a.message}`
6036
- );
6037
- }
6038
- }
6039
- return await n.loadUmdBundle(e, t);
6040
- }
6041
5842
  /**
6042
5843
  * Creates a provider using the given parameters.
6043
5844
  * @param {CreateProviderParams} params - The parameters for creating the provider.
6044
5845
  * @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
6045
5846
  */
6046
5847
  async createProvider(e) {
6047
- return await dr(
5848
+ return await sr(
6048
5849
  e.walletProviderName,
6049
5850
  this.passport
6050
5851
  );
@@ -6085,7 +5886,7 @@ var Mt = class {
6085
5886
  * @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
6086
5887
  */
6087
5888
  async checkIsWalletConnected(e) {
6088
- const t = await B(
5889
+ const t = await M(
6089
5890
  this.config,
6090
5891
  e.provider,
6091
5892
  {
@@ -6093,7 +5894,7 @@ var Mt = class {
6093
5894
  allowUnsupportedProvider: true
6094
5895
  }
6095
5896
  );
6096
- return er(t);
5897
+ return $t(t);
6097
5898
  }
6098
5899
  /**
6099
5900
  * Fetches the risk assessment for the given addresses.
@@ -6101,7 +5902,7 @@ var Mt = class {
6101
5902
  * @returns {Promise<AssessmentResult>} - A promise that resolves to the risk assessment result.
6102
5903
  */
6103
5904
  async getRiskAssessment(e) {
6104
- return await _t(e, this.config);
5905
+ return await vt(e, this.config);
6105
5906
  }
6106
5907
  /**
6107
5908
  * Helper method that checks if given risk assessment results contain sanctioned addresses.
@@ -6110,7 +5911,7 @@ var Mt = class {
6110
5911
  * @returns {boolean} - Result of the check.
6111
5912
  */
6112
5913
  checkIsAddressSanctioned(e, t) {
6113
- return Ot(e, t);
5914
+ return Nt(e, t);
6114
5915
  }
6115
5916
  /**
6116
5917
  * Connects to a blockchain network using the specified provider.
@@ -6119,7 +5920,7 @@ var Mt = class {
6119
5920
  * @throws {Error} If the provider is not valid or if there is an error connecting to the network.
6120
5921
  */
6121
5922
  async connect(e) {
6122
- const t = await B(
5923
+ const t = await M(
6123
5924
  this.config,
6124
5925
  e.provider,
6125
5926
  {
@@ -6128,9 +5929,9 @@ var Mt = class {
6128
5929
  }
6129
5930
  );
6130
5931
  if (e.requestWalletPermissions && !yt(t)) {
6131
- await rr(t);
5932
+ await er(t);
6132
5933
  } else {
6133
- await tr(t);
5934
+ await Xt(t);
6134
5935
  }
6135
5936
  return t;
6136
5937
  }
@@ -6141,7 +5942,7 @@ var Mt = class {
6141
5942
  * @throws {CheckoutError} When the network cannot be added to the wallet
6142
5943
  */
6143
5944
  async addNetwork(e) {
6144
- const t = await B(
5945
+ const t = await M(
6145
5946
  this.config,
6146
5947
  e.provider,
6147
5948
  {
@@ -6149,7 +5950,7 @@ var Mt = class {
6149
5950
  allowMistmatchedChainId: true
6150
5951
  }
6151
5952
  );
6152
- const n = await st(
5953
+ const n = await it(
6153
5954
  this.config.networkMap,
6154
5955
  t,
6155
5956
  e.chainId
@@ -6162,7 +5963,7 @@ var Mt = class {
6162
5963
  * @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
6163
5964
  */
6164
5965
  async switchNetwork(e) {
6165
- const t = await B(
5966
+ const t = await M(
6166
5967
  this.config,
6167
5968
  e.provider,
6168
5969
  {
@@ -6170,7 +5971,7 @@ var Mt = class {
6170
5971
  allowMistmatchedChainId: true
6171
5972
  }
6172
5973
  );
6173
- const n = await Ht(
5974
+ const n = await jt(
6174
5975
  this.config,
6175
5976
  t,
6176
5977
  e.chainId
@@ -6192,18 +5993,18 @@ var Mt = class {
6192
5993
  * @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
6193
5994
  */
6194
5995
  async getBalance(e) {
6195
- const t = await B(
5996
+ const t = await M(
6196
5997
  this.config,
6197
5998
  e.provider
6198
5999
  );
6199
6000
  if (!e.tokenAddress || e.tokenAddress === "") {
6200
- return await mt(
6001
+ return await ut(
6201
6002
  this.config,
6202
6003
  t,
6203
6004
  e.walletAddress
6204
6005
  );
6205
6006
  }
6206
- return await ft(
6007
+ return await mt(
6207
6008
  t,
6208
6009
  e.walletAddress,
6209
6010
  e.tokenAddress
@@ -6223,7 +6024,7 @@ var Mt = class {
6223
6024
  e.chainId
6224
6025
  );
6225
6026
  }
6226
- const t = await B(
6027
+ const t = await M(
6227
6028
  this.config,
6228
6029
  e.provider
6229
6030
  );
@@ -6256,7 +6057,7 @@ var Mt = class {
6256
6057
  * @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
6257
6058
  */
6258
6059
  async getWalletAllowList(e) {
6259
- return await nn(e);
6060
+ return await tn(e);
6260
6061
  }
6261
6062
  /**
6262
6063
  * Sends a transaction using the specified provider and transaction parameters.
@@ -6264,7 +6065,7 @@ var Mt = class {
6264
6065
  * @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
6265
6066
  */
6266
6067
  async sendTransaction(e) {
6267
- const t = await B(
6068
+ const t = await M(
6268
6069
  this.config,
6269
6070
  e.provider,
6270
6071
  {
@@ -6281,7 +6082,7 @@ var Mt = class {
6281
6082
  * @returns {Promise<T>} Returns the result of the provided block param.
6282
6083
  */
6283
6084
  async providerCall(e, t) {
6284
- const n = await B(
6085
+ const n = await M(
6285
6086
  this.config,
6286
6087
  e,
6287
6088
  {
@@ -6292,7 +6093,7 @@ var Mt = class {
6292
6093
  try {
6293
6094
  return await t(n);
6294
6095
  } catch (o) {
6295
- throw St(o);
6096
+ throw wt(o);
6296
6097
  }
6297
6098
  }
6298
6099
  /**
@@ -6301,7 +6102,7 @@ var Mt = class {
6301
6102
  * @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
6302
6103
  */
6303
6104
  async getNetworkInfo(e) {
6304
- const t = await B(
6105
+ const t = await M(
6305
6106
  this.config,
6306
6107
  e.provider,
6307
6108
  {
@@ -6309,7 +6110,7 @@ var Mt = class {
6309
6110
  allowMistmatchedChainId: true
6310
6111
  }
6311
6112
  );
6312
- return await Re(this.config, t);
6113
+ return await Ce(this.config, t);
6313
6114
  }
6314
6115
  /**
6315
6116
  * Determines the requirements for performing a buy.
@@ -6324,11 +6125,11 @@ var Mt = class {
6324
6125
  "This endpoint currently only processes the first order in the array."
6325
6126
  );
6326
6127
  }
6327
- const t = await B(
6128
+ const t = await M(
6328
6129
  this.config,
6329
6130
  e.provider
6330
6131
  );
6331
- return await Yr(
6132
+ return await Qr(
6332
6133
  this.config,
6333
6134
  t,
6334
6135
  e.orders,
@@ -6350,11 +6151,11 @@ var Mt = class {
6350
6151
  "This endpoint currently only processes the first order in the array."
6351
6152
  );
6352
6153
  }
6353
- const t = await B(
6154
+ const t = await M(
6354
6155
  this.config,
6355
6156
  e.provider
6356
6157
  );
6357
- return await en(this.config, t, e.orders);
6158
+ return await $r(this.config, t, e.orders);
6358
6159
  }
6359
6160
  /**
6360
6161
  * Cancels a sell.
@@ -6366,11 +6167,11 @@ var Mt = class {
6366
6167
  console.warn(
6367
6168
  "This endpoint currently only processes the first order in the array."
6368
6169
  );
6369
- const t = await B(
6170
+ const t = await M(
6370
6171
  this.config,
6371
6172
  e.provider
6372
6173
  );
6373
- return await Jr(
6174
+ return await Zr(
6374
6175
  this.config,
6375
6176
  t,
6376
6177
  e.orderIds,
@@ -6390,13 +6191,13 @@ var Mt = class {
6390
6191
  * @throws {CheckoutError} When item requirements cannot be mapped or checkout validation fails
6391
6192
  */
6392
6193
  async smartCheckout(e) {
6393
- const t = await B(
6194
+ const t = await M(
6394
6195
  this.config,
6395
6196
  e.provider
6396
6197
  );
6397
6198
  let n = [];
6398
6199
  try {
6399
- n = await Xr(
6200
+ n = await Jr(
6400
6201
  t,
6401
6202
  e.itemRequirements
6402
6203
  );
@@ -6424,7 +6225,7 @@ var Mt = class {
6424
6225
  * @returns {boolean} - True if the object is a WrappedBrowserProvider, false otherwise.
6425
6226
  */
6426
6227
  static isWrappedBrowserProvider(e) {
6427
- return lr(e);
6228
+ return cr(e);
6428
6229
  }
6429
6230
  /**
6430
6231
  * Estimates the gas required for a swap or bridge transaction.
@@ -6436,7 +6237,7 @@ var Mt = class {
6436
6237
  this.config,
6437
6238
  this.readOnlyProviders
6438
6239
  );
6439
- return await cr(
6240
+ return await ir(
6440
6241
  e,
6441
6242
  this.readOnlyProviders,
6442
6243
  this.config
@@ -6453,20 +6254,20 @@ var Mt = class {
6453
6254
  let o;
6454
6255
  const a = "request" in e.browserProvider ? new L(e.browserProvider) : e.browserProvider;
6455
6256
  const i = await (await a.getSigner()).getAddress();
6456
- const s = _optionalChain([a, 'access', _152 => _152.ethereumProvider, 'optionalAccess', _153 => _153.isPassport]) || false;
6257
+ const s = _optionalChain([a, 'access', _149 => _149.ethereumProvider, 'optionalAccess', _150 => _150.isPassport]) || false;
6457
6258
  if (s && e.passport) {
6458
- const p = await e.passport.getUserInfo();
6459
- o = _optionalChain([p, 'optionalAccess', _154 => _154.email]);
6259
+ const u = await e.passport.getUserInfo();
6260
+ o = _optionalChain([u, 'optionalAccess', _151 => _151.email]);
6460
6261
  }
6461
6262
  const c = await H(this.config, {
6462
6263
  type: "onramp"
6463
6264
  });
6464
- const d = _optionalChain([c, 'access', _155 => _155.tokens, 'optionalAccess', _156 => _156.find, 'call', _157 => _157((p) => I(p.address, e.tokenAddress))]);
6265
+ const d = _optionalChain([c, 'access', _152 => _152.tokens, 'optionalAccess', _153 => _153.find, 'call', _154 => _154((u) => I(u.address, e.tokenAddress))]);
6465
6266
  if (d) {
6466
6267
  t = e.tokenAmount;
6467
6268
  n = d.symbol;
6468
6269
  }
6469
- const u = _optionalChain([c, 'optionalAccess', _158 => _158.tokens, 'optionalAccess', _159 => _159.filter, 'call', _160 => _160((p) => p.symbol), 'access', _161 => _161.map, 'call', _162 => _162((p) => p.symbol)]);
6270
+ const p = _optionalChain([c, 'optionalAccess', _155 => _155.tokens, 'optionalAccess', _156 => _156.filter, 'call', _157 => _157((u) => u.symbol), 'access', _158 => _158.map, 'call', _159 => _159((u) => u.symbol)]);
6470
6271
  return await this.fiatRampService.createWidgetUrl({
6471
6272
  exchangeType: e.exchangeType,
6472
6273
  isPassport: s,
@@ -6474,7 +6275,7 @@ var Mt = class {
6474
6275
  tokenAmount: t,
6475
6276
  tokenSymbol: n,
6476
6277
  email: o,
6477
- allowedTokens: u
6278
+ allowedTokens: p
6478
6279
  });
6479
6280
  }
6480
6281
  /**
@@ -6497,11 +6298,11 @@ var Mt = class {
6497
6298
  * @returns {Promise<SwapResult>} - A promise that resolves to the swap result (swap tx, swap tx receipt, quote used in the swap).
6498
6299
  */
6499
6300
  async swap(e) {
6500
- const t = await B(
6301
+ const t = await M(
6501
6302
  this.config,
6502
6303
  e.provider
6503
6304
  );
6504
- return rn(
6305
+ return en(
6505
6306
  this.config,
6506
6307
  t,
6507
6308
  e.fromToken,
@@ -6519,11 +6320,11 @@ var Mt = class {
6519
6320
  * @returns {Promise<SwapQuoteResult>} - A promise that resolves to the swap quote result.
6520
6321
  */
6521
6322
  async swapQuote(e) {
6522
- const t = await B(
6323
+ const t = await M(
6523
6324
  this.config,
6524
6325
  e.provider
6525
6326
  );
6526
- return vt(
6327
+ return kt(
6527
6328
  this.config,
6528
6329
  t,
6529
6330
  e.fromToken,
@@ -6546,7 +6347,7 @@ var $e = class {
6546
6347
  * @returns {string | undefined} The URL to view the transaction on Blockscout, or undefined if the chain ID or hash is invalid
6547
6348
  */
6548
6349
  static getTransactionLink(e, t) {
6549
- const n = _optionalChain([te, 'optionalAccess', _163 => _163[e], 'optionalAccess', _164 => _164.url]);
6350
+ const n = _optionalChain([te, 'optionalAccess', _160 => _160[e], 'optionalAccess', _161 => _161.url]);
6550
6351
  if (!n || !t) return void 0;
6551
6352
  return `${n}/tx/${t}`;
6552
6353
  }
@@ -6606,4 +6407,4 @@ var $e = class {
6606
6407
 
6607
6408
 
6608
6409
 
6609
- exports.AddTokensEventType = yn; exports.BlockExplorerService = $e; exports.BridgeEventType = Rn; exports.ChainId = Z; exports.ChainName = tt; exports.ChainSlug = Te; exports.Checkout = Mt; exports.CheckoutConfiguration = Ce; exports.CheckoutError = l; exports.CheckoutErrorType = y; exports.CheckoutStatus = pe; exports.CommerceEventType = Tn; exports.CommerceFailureEventType = An; exports.CommerceFlowType = Nn; exports.CommerceSuccessEventType = hn; exports.CommerceUserActionEventType = wn; exports.ConnectEventType = pn; exports.ConnectTargetLayer = kn; exports.ExchangeType = jt; exports.FeeType = ke; exports.FundingStepType = ge; exports.GasEstimateType = at; exports.GasTokenType = fe; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = ln; exports.ItemType = M; exports.NetworkFilterTypes = le; exports.OnRampEventType = In; exports.OrchestrationEventType = Cn; exports.ProviderEventType = un; exports.PurchaseEventType = Sn; exports.RoutingOutcomeType = it; exports.SaleEventType = gn; exports.SalePaymentTypes = En; exports.SwapDirection = vn; exports.SwapEventType = fn; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = me; exports.WalletEventType = mn; exports.WalletFilterTypes = Ut; exports.WalletProviderName = ue; exports.WalletProviderRdns = Gt; exports.WidgetTheme = _n; exports.WidgetType = Pn; exports.WrappedBrowserProvider = L; exports.fetchRiskAssessment = _t; exports.getGasPriceInWei = Et; exports.getMetaMaskProviderDetail = Ro; exports.getPassportProviderDetail = Eo; exports.getUnderlyingChainId = Ee; exports.isAddressSanctioned = Ot; exports.metaMaskProviderInfo = be; exports.passportProviderInfo = xe; exports.validateProvider = B;
6410
+ exports.AddTokensEventType = Rn; exports.BlockExplorerService = $e; exports.BridgeEventType = ln; exports.ChainId = Z; exports.ChainName = tt; exports.ChainSlug = he; exports.Checkout = _t; exports.CheckoutConfiguration = Ie; exports.CheckoutError = l; exports.CheckoutErrorType = w; exports.CheckoutStatus = me; exports.CommerceEventType = mn; exports.CommerceFailureEventType = En; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = fn; exports.CommerceUserActionEventType = gn; exports.ConnectEventType = on; exports.ConnectTargetLayer = Tn; exports.ExchangeType = Gt; exports.FeeType = ke; exports.FundingStepType = ge; exports.GasEstimateType = ot; exports.GasTokenType = Ee; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = rn; exports.ItemType = B; exports.NetworkFilterTypes = pe; exports.OnRampEventType = un; exports.OrchestrationEventType = pn; exports.ProviderEventType = nn; exports.PurchaseEventType = Cn; exports.RoutingOutcomeType = at; exports.SaleEventType = cn; exports.SalePaymentTypes = dn; exports.SwapDirection = hn; exports.SwapEventType = sn; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = fe; exports.WalletEventType = an; exports.WalletFilterTypes = Ft; exports.WalletProviderName = ue; exports.WalletProviderRdns = Wt; exports.WidgetTheme = yn; exports.WidgetType = In; exports.WrappedBrowserProvider = L; exports.fetchRiskAssessment = vt; exports.getGasPriceInWei = Et; exports.getMetaMaskProviderDetail = lo; exports.getPassportProviderDetail = co; exports.getUnderlyingChainId = Re; exports.isAddressSanctioned = Nt; exports.metaMaskProviderInfo = xe; exports.passportProviderInfo = be; exports.validateProvider = M;