@imtbl/checkout-sdk 2.10.3 → 2.10.4-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,5 +1,5 @@
1
1
  // src/widgets/definitions/events/widgets.ts
2
- var oo = /* @__PURE__ */ ((g) => {
2
+ var ro = /* @__PURE__ */ ((g) => {
3
3
  g["IMTBL_WIDGETS_PROVIDER"] = "imtbl-widgets-provider";
4
4
  g["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
5
5
  g["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
@@ -12,43 +12,43 @@ var oo = /* @__PURE__ */ ((g) => {
12
12
  g["IMTBL_PURCHASE_WIDGET_EVENT"] = "imtbl-purchase-widget";
13
13
  g["IMTBL_TRANSFER_WIDGET_EVENT"] = "imtbl-transfer-widget";
14
14
  return g;
15
- })(oo || {});
16
- var no = /* @__PURE__ */ ((e) => {
15
+ })(ro || {});
16
+ var oo = /* @__PURE__ */ ((e) => {
17
17
  e["PROVIDER_UPDATED"] = "PROVIDER_UPDATED";
18
18
  return e;
19
- })(no || {});
19
+ })(oo || {});
20
20
 
21
21
  // src/widgets/definitions/events/connect.ts
22
- var ao = /* @__PURE__ */ ((a) => {
22
+ var no = /* @__PURE__ */ ((a) => {
23
23
  a["CLOSE_WIDGET"] = "close-widget";
24
24
  a["SUCCESS"] = "success";
25
25
  a["FAILURE"] = "failure";
26
26
  a["LANGUAGE_CHANGED"] = "language-changed";
27
27
  a["WALLETCONNECT_PROVIDER_UPDATED"] = "walletconnect-provider-updated";
28
28
  return a;
29
- })(ao || {});
29
+ })(no || {});
30
30
 
31
31
  // src/widgets/definitions/events/wallet.ts
32
- var io = /* @__PURE__ */ ((n) => {
32
+ var ao = /* @__PURE__ */ ((n) => {
33
33
  n["CLOSE_WIDGET"] = "close-widget";
34
34
  n["NETWORK_SWITCH"] = "network-switch";
35
35
  n["DISCONNECT_WALLET"] = "disconnect-wallet";
36
36
  n["LANGUAGE_CHANGED"] = "language-changed";
37
37
  return n;
38
- })(io || {});
38
+ })(ao || {});
39
39
 
40
40
  // src/widgets/definitions/events/swap.ts
41
- var so = /* @__PURE__ */ ((a) => {
41
+ var io = /* @__PURE__ */ ((a) => {
42
42
  a["CLOSE_WIDGET"] = "close-widget";
43
43
  a["SUCCESS"] = "success";
44
44
  a["FAILURE"] = "failure";
45
45
  a["REJECTED"] = "rejected";
46
46
  a["LANGUAGE_CHANGED"] = "language-changed";
47
47
  return a;
48
- })(so || {});
48
+ })(io || {});
49
49
 
50
50
  // src/widgets/definitions/events/sale.ts
51
- var co = /* @__PURE__ */ ((g) => {
51
+ var so = /* @__PURE__ */ ((g) => {
52
52
  g["CLOSE_WIDGET"] = "close-widget";
53
53
  g["SUCCESS"] = "success";
54
54
  g["FAILURE"] = "failure";
@@ -61,16 +61,16 @@ var co = /* @__PURE__ */ ((g) => {
61
61
  g["REQUEST_SWAP"] = "request-swap";
62
62
  g["PAYMENT_TOKEN"] = "payment-token";
63
63
  return g;
64
- })(co || {});
65
- var lo = /* @__PURE__ */ ((o) => {
64
+ })(so || {});
65
+ var co = /* @__PURE__ */ ((o) => {
66
66
  o["CRYPTO"] = "crypto";
67
67
  o["DEBIT"] = "debit";
68
68
  o["CREDIT"] = "credit";
69
69
  return o;
70
- })(lo || {});
70
+ })(co || {});
71
71
 
72
72
  // src/widgets/definitions/events/bridge.ts
73
- var po = /* @__PURE__ */ ((i) => {
73
+ var lo = /* @__PURE__ */ ((i) => {
74
74
  i["CLOSE_WIDGET"] = "close-widget";
75
75
  i["FAILURE"] = "failure";
76
76
  i["TRANSACTION_SENT"] = "transaction-sent";
@@ -78,10 +78,10 @@ var po = /* @__PURE__ */ ((i) => {
78
78
  i["CLAIM_WITHDRAWAL_SUCCESS"] = "claim-withdrawal-success";
79
79
  i["CLAIM_WITHDRAWAL_FAILURE"] = "claim-withdrawal-failure";
80
80
  return i;
81
- })(po || {});
81
+ })(lo || {});
82
82
 
83
83
  // src/widgets/definitions/events/orchestration.ts
84
- var uo = /* @__PURE__ */ ((c) => {
84
+ var po = /* @__PURE__ */ ((c) => {
85
85
  c["REQUEST_CONNECT"] = "request-connect";
86
86
  c["REQUEST_WALLET"] = "request-wallet";
87
87
  c["REQUEST_SWAP"] = "request-swap";
@@ -91,19 +91,19 @@ var uo = /* @__PURE__ */ ((c) => {
91
91
  c["REQUEST_PURCHASE"] = "request-purchase";
92
92
  c["REQUEST_GO_BACK"] = "request-go-back";
93
93
  return c;
94
- })(uo || {});
94
+ })(po || {});
95
95
 
96
96
  // src/widgets/definitions/events/onramp.ts
97
- var mo = /* @__PURE__ */ ((n) => {
97
+ var uo = /* @__PURE__ */ ((n) => {
98
98
  n["CLOSE_WIDGET"] = "close-widget";
99
99
  n["SUCCESS"] = "success";
100
100
  n["FAILURE"] = "failure";
101
101
  n["LANGUAGE_CHANGED"] = "language-changed";
102
102
  return n;
103
- })(mo || {});
103
+ })(uo || {});
104
104
 
105
105
  // src/widgets/definitions/events/commerce.ts
106
- var go = /* @__PURE__ */ ((s) => {
106
+ var mo = /* @__PURE__ */ ((s) => {
107
107
  s["INITIALISED"] = "INITIALISED";
108
108
  s["PROVIDER_UPDATED"] = "PROVIDER_UPDATED";
109
109
  s["CLOSE"] = "CLOSE";
@@ -112,8 +112,8 @@ var go = /* @__PURE__ */ ((s) => {
112
112
  s["DISCONNECTED"] = "DISCONNECTED";
113
113
  s["USER_ACTION"] = "USER_ACTION";
114
114
  return s;
115
- })(go || {});
116
- var fo = /* @__PURE__ */ ((u) => {
115
+ })(mo || {});
116
+ var go = /* @__PURE__ */ ((u) => {
117
117
  u["SWAP_SUCCESS"] = "SWAP_SUCCESS";
118
118
  u["ONRAMP_SUCCESS"] = "ONRAMP_SUCCESS";
119
119
  u["CONNECT_SUCCESS"] = "CONNECT_SUCCESS";
@@ -125,8 +125,8 @@ var fo = /* @__PURE__ */ ((u) => {
125
125
  u["ADD_TOKENS_CONNECT_SUCCESS"] = "ADD_TOKENS_CONNECT_SUCCESS";
126
126
  u["TRANSFER_SUCCESS"] = "TRANSFER_SUCCESS";
127
127
  return u;
128
- })(fo || {});
129
- var Eo = /* @__PURE__ */ ((p) => {
128
+ })(go || {});
129
+ var fo = /* @__PURE__ */ ((p) => {
130
130
  p["BRIDGE_FAILED"] = "BRIDGE_FAILED";
131
131
  p["BRIDGE_CLAIM_WITHDRAWAL_FAILED"] = "BRIDGE_CLAIM_WITHDRAWAL_FAILED";
132
132
  p["SWAP_FAILED"] = "SWAP_FAILED";
@@ -137,44 +137,44 @@ var Eo = /* @__PURE__ */ ((p) => {
137
137
  p["ADD_TOKENS_FAILED"] = "ADD_TOKENS_FAILED";
138
138
  p["TRANSFER_FAILED"] = "TRANSFER_FAILED";
139
139
  return p;
140
- })(Eo || {});
141
- var Ro = /* @__PURE__ */ ((o) => {
140
+ })(fo || {});
141
+ var Eo = /* @__PURE__ */ ((o) => {
142
142
  o["PAYMENT_METHOD_SELECTED"] = "PAYMENT_METHOD_SELECTED";
143
143
  o["PAYMENT_TOKEN_SELECTED"] = "PAYMENT_TOKEN_SELECTED";
144
144
  o["NETWORK_SWITCH"] = "NETWORK_SWITCH";
145
145
  return o;
146
- })(Ro || {});
146
+ })(Eo || {});
147
147
 
148
148
  // src/widgets/definitions/events/addTokens.ts
149
- var Co = /* @__PURE__ */ ((a) => {
149
+ var Ro = /* @__PURE__ */ ((a) => {
150
150
  a["CLOSE_WIDGET"] = "close-widget";
151
151
  a["LANGUAGE_CHANGED"] = "language-changed";
152
152
  a["CONNECT_SUCCESS"] = "connect-success";
153
153
  a["SUCCESS"] = "success";
154
154
  a["FAILURE"] = "failure";
155
155
  return a;
156
- })(Co || {});
156
+ })(Ro || {});
157
157
 
158
158
  // src/widgets/definitions/events/purchase.ts
159
- var To = /* @__PURE__ */ ((n) => {
159
+ var Co = /* @__PURE__ */ ((n) => {
160
160
  n["CLOSE_WIDGET"] = "close-widget";
161
161
  n["CONNECT_SUCCESS"] = "connect-success";
162
162
  n["SUCCESS"] = "success";
163
163
  n["FAILURE"] = "failure";
164
164
  return n;
165
- })(To || {});
165
+ })(Co || {});
166
166
 
167
167
  // src/widgets/definitions/events/transfer.ts
168
- var Io = /* @__PURE__ */ ((n) => {
168
+ var To = /* @__PURE__ */ ((n) => {
169
169
  n["CLOSE_WIDGET"] = "close-widget";
170
170
  n["REJECTED"] = "rejected";
171
171
  n["SUCCESS"] = "success";
172
172
  n["FAILURE"] = "failure";
173
173
  return n;
174
- })(Io || {});
174
+ })(To || {});
175
175
 
176
176
  // src/widgets/definitions/types.ts
177
- var ho = /* @__PURE__ */ ((u) => {
177
+ var Io = /* @__PURE__ */ ((u) => {
178
178
  u["CONNECT"] = "connect";
179
179
  u["WALLET"] = "wallet";
180
180
  u["SWAP"] = "swap";
@@ -186,14 +186,14 @@ var ho = /* @__PURE__ */ ((u) => {
186
186
  u["PURCHASE"] = "purchase";
187
187
  u["TRANSFER"] = "transfer";
188
188
  return u;
189
- })(ho || {});
189
+ })(Io || {});
190
190
 
191
191
  // src/widgets/definitions/parameters/connect.ts
192
- var Ao = /* @__PURE__ */ ((t) => {
192
+ var ho = /* @__PURE__ */ ((t) => {
193
193
  t["LAYER1"] = "LAYER1";
194
194
  t["LAYER2"] = "LAYER2";
195
195
  return t;
196
- })(Ao || {});
196
+ })(ho || {});
197
197
 
198
198
  // src/widgets/definitions/parameters/swap.ts
199
199
  var yo = /* @__PURE__ */ ((t) => {
@@ -203,7 +203,7 @@ var yo = /* @__PURE__ */ ((t) => {
203
203
  })(yo || {});
204
204
 
205
205
  // src/widgets/definitions/parameters/commerce.ts
206
- var wo = /* @__PURE__ */ ((p) => {
206
+ var Ao = /* @__PURE__ */ ((p) => {
207
207
  p["CONNECT"] = "CONNECT";
208
208
  p["WALLET"] = "WALLET";
209
209
  p["SALE"] = "SALE";
@@ -214,44 +214,44 @@ var wo = /* @__PURE__ */ ((p) => {
214
214
  p["PURCHASE"] = "PURCHASE";
215
215
  p["TRANSFER"] = "TRANSFER";
216
216
  return p;
217
- })(wo || {});
217
+ })(Ao || {});
218
218
 
219
219
  // src/widgets/definitions/configurations/theme.ts
220
- var Po = /* @__PURE__ */ ((t) => {
220
+ var wo = /* @__PURE__ */ ((t) => {
221
221
  t["LIGHT"] = "light";
222
222
  t["DARK"] = "dark";
223
223
  return t;
224
- })(Po || {});
224
+ })(wo || {});
225
225
 
226
226
  // src/sdk.ts
227
- import { Environment as Ka } from "@imtbl/config";
227
+ import { Environment as Va } from "@imtbl/config";
228
228
 
229
229
  // src/api/http/httpClient.ts
230
- import So from "axios";
231
- var ko = "pk_imapik-";
232
- var vo = [
230
+ import Po from "axios";
231
+ var So = "pk_imapik-";
232
+ var ko = [
233
233
  "https://checkout-api.dev.immutable.com",
234
234
  "https://checkout-api.sandbox.immutable.com",
235
235
  "https://checkout-api.immutable.com"
236
236
  ];
237
- var ue = class {
237
+ var Y = class {
238
238
  config;
239
239
  axiosInstance;
240
240
  constructor(e) {
241
241
  this.config = e;
242
- this.axiosInstance = So.create();
242
+ this.axiosInstance = Po.create();
243
243
  this.setupInterceptors();
244
244
  }
245
245
  // eslint-disable-next-line class-methods-use-this
246
246
  shouldAddPublishableKey(e) {
247
- return vo.some((t) => e.startsWith(t));
247
+ return ko.some((t) => e.startsWith(t));
248
248
  }
249
249
  setupInterceptors() {
250
250
  this.axiosInstance.interceptors.request.use(
251
251
  (e) => {
252
252
  const t = this.config?.baseConfig?.publishableKey;
253
253
  if (t && this.shouldAddPublishableKey(e.url || "")) {
254
- if (!t.startsWith(ko)) {
254
+ if (!t.startsWith(So)) {
255
255
  throw new Error(
256
256
  "Invalid Publishable key. Create your Publishable key in Immutable developer hub. https://hub.immutable.com"
257
257
  );
@@ -300,53 +300,53 @@ var ue = class {
300
300
  };
301
301
 
302
302
  // src/availability/availability.ts
303
- import { Environment as Ut } from "@imtbl/config";
304
- import Oo from "axios";
303
+ import { Environment as Ft } from "@imtbl/config";
304
+ import _o from "axios";
305
305
 
306
306
  // src/errors/checkoutError.ts
307
- var S = /* @__PURE__ */ ((y) => {
308
- y["MISSING_PARAMS"] = "MISSING_PARAMS";
309
- y["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
310
- y["PROVIDER_ERROR"] = "PROVIDER_ERROR";
311
- y["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
312
- y["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
313
- y["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
314
- y["GET_INDEXER_BALANCE_ERROR"] = "GET_INDEXER_BALANCE_ERROR";
315
- y["GET_ERC20_INFO_ERROR"] = "GET_ERC20_INFO_ERROR";
316
- y["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
317
- y["GET_ERC721_BALANCE_ERROR"] = "GET_ERC721_BALANCE_ERROR";
318
- y["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
319
- y["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
320
- y["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
321
- y["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
322
- y["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
323
- y["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
324
- y["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
325
- y["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
326
- y["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
327
- y["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
328
- y["UNSUPPORTED_TOKEN_TYPE_ERROR"] = "UNSUPPORTED_TOKEN_TYPE_ERROR";
329
- y["UNSUPPORTED_BALANCE_REQUIREMENT_ERROR"] = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR";
330
- y["GET_ORDER_LISTING_ERROR"] = "GET_ORDER_LISTING_ERROR";
331
- y["CANCEL_ORDER_LISTING_ERROR"] = "CANCEL_ORDER_LISTING_ERROR";
332
- y["PREPARE_ORDER_LISTING_ERROR"] = "PREPARE_ORDER_LISTING_ERROR";
333
- y["CREATE_ORDER_LISTING_ERROR"] = "CREATE_ORDER_LISTING_ERROR";
334
- y["FULFILL_ORDER_LISTING_ERROR"] = "FULFILL_ORDER_LISTING_ERROR";
335
- y["SWITCH_NETWORK_UNSUPPORTED"] = "SWITCH_NETWORK_UNSUPPORTED";
336
- y["GET_ERC20_ALLOWANCE_ERROR"] = "GET_ERC20_ALLOWANCE_ERROR";
337
- y["GET_ERC721_ALLOWANCE_ERROR"] = "GET_ERC721_ALLOWANCE_ERROR";
338
- y["GET_ERC1155_ALLOWANCE_ERROR"] = "GET_ERC1155_ALLOWANCE_ERROR";
339
- y["EXECUTE_APPROVAL_TRANSACTION_ERROR"] = "EXECUTE_APPROVAL_TRANSACTION_ERROR";
340
- y["EXECUTE_FULFILLMENT_TRANSACTION_ERROR"] = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR";
341
- y["SIGN_MESSAGE_ERROR"] = "SIGN_MESSAGE_ERROR";
342
- y["BRIDGE_GAS_ESTIMATE_ERROR"] = "BRIDGE_GAS_ESTIMATE_ERROR";
343
- y["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
344
- y["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
345
- y["API_ERROR"] = "API_ERROR";
346
- y["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
347
- y["WIDGETS_SCRIPT_LOAD_ERROR"] = "WIDGETS_SCRIPT_LOAD_ERROR";
348
- y["APPROVAL_TRANSACTION_FAILED"] = "APPROVAL_TRANSACTION_FAILED";
349
- return y;
307
+ var S = /* @__PURE__ */ ((A) => {
308
+ A["MISSING_PARAMS"] = "MISSING_PARAMS";
309
+ A["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
310
+ A["PROVIDER_ERROR"] = "PROVIDER_ERROR";
311
+ A["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
312
+ A["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
313
+ A["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
314
+ A["GET_INDEXER_BALANCE_ERROR"] = "GET_INDEXER_BALANCE_ERROR";
315
+ A["GET_ERC20_INFO_ERROR"] = "GET_ERC20_INFO_ERROR";
316
+ A["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
317
+ A["GET_ERC721_BALANCE_ERROR"] = "GET_ERC721_BALANCE_ERROR";
318
+ A["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
319
+ A["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
320
+ A["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
321
+ A["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
322
+ A["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
323
+ A["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
324
+ A["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
325
+ A["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
326
+ A["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
327
+ A["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
328
+ A["UNSUPPORTED_TOKEN_TYPE_ERROR"] = "UNSUPPORTED_TOKEN_TYPE_ERROR";
329
+ A["UNSUPPORTED_BALANCE_REQUIREMENT_ERROR"] = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR";
330
+ A["GET_ORDER_LISTING_ERROR"] = "GET_ORDER_LISTING_ERROR";
331
+ A["CANCEL_ORDER_LISTING_ERROR"] = "CANCEL_ORDER_LISTING_ERROR";
332
+ A["PREPARE_ORDER_LISTING_ERROR"] = "PREPARE_ORDER_LISTING_ERROR";
333
+ A["CREATE_ORDER_LISTING_ERROR"] = "CREATE_ORDER_LISTING_ERROR";
334
+ A["FULFILL_ORDER_LISTING_ERROR"] = "FULFILL_ORDER_LISTING_ERROR";
335
+ A["SWITCH_NETWORK_UNSUPPORTED"] = "SWITCH_NETWORK_UNSUPPORTED";
336
+ A["GET_ERC20_ALLOWANCE_ERROR"] = "GET_ERC20_ALLOWANCE_ERROR";
337
+ A["GET_ERC721_ALLOWANCE_ERROR"] = "GET_ERC721_ALLOWANCE_ERROR";
338
+ A["GET_ERC1155_ALLOWANCE_ERROR"] = "GET_ERC1155_ALLOWANCE_ERROR";
339
+ A["EXECUTE_APPROVAL_TRANSACTION_ERROR"] = "EXECUTE_APPROVAL_TRANSACTION_ERROR";
340
+ A["EXECUTE_FULFILLMENT_TRANSACTION_ERROR"] = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR";
341
+ A["SIGN_MESSAGE_ERROR"] = "SIGN_MESSAGE_ERROR";
342
+ A["BRIDGE_GAS_ESTIMATE_ERROR"] = "BRIDGE_GAS_ESTIMATE_ERROR";
343
+ A["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
344
+ A["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
345
+ A["API_ERROR"] = "API_ERROR";
346
+ A["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
347
+ A["WIDGETS_SCRIPT_LOAD_ERROR"] = "WIDGETS_SCRIPT_LOAD_ERROR";
348
+ A["APPROVAL_TRANSACTION_FAILED"] = "APPROVAL_TRANSACTION_FAILED";
349
+ return A;
350
350
  })(S || {});
351
351
  var m = class extends Error {
352
352
  message;
@@ -379,17 +379,17 @@ var L = async (r, e) => {
379
379
  };
380
380
 
381
381
  // src/env/constants.ts
382
- import { Environment as re } from "@imtbl/config";
382
+ import { Environment as oe } from "@imtbl/config";
383
383
 
384
384
  // src/types/chains.ts
385
- var Y = /* @__PURE__ */ ((a) => {
385
+ var J = /* @__PURE__ */ ((a) => {
386
386
  a[a["IMTBL_ZKEVM_MAINNET"] = 13371] = "IMTBL_ZKEVM_MAINNET";
387
387
  a[a["IMTBL_ZKEVM_TESTNET"] = 13473] = "IMTBL_ZKEVM_TESTNET";
388
388
  a[a["IMTBL_ZKEVM_DEVNET"] = 15003] = "IMTBL_ZKEVM_DEVNET";
389
389
  a[a["ETHEREUM"] = 1] = "ETHEREUM";
390
390
  a[a["SEPOLIA"] = 11155111] = "SEPOLIA";
391
391
  return a;
392
- })(Y || {});
392
+ })(J || {});
393
393
  var nt = /* @__PURE__ */ ((a) => {
394
394
  a["ETHEREUM"] = "Ethereum";
395
395
  a["SEPOLIA"] = "Sepolia";
@@ -408,38 +408,38 @@ var we = /* @__PURE__ */ ((a) => {
408
408
  })(we || {});
409
409
 
410
410
  // src/env/constants.ts
411
- var J = "development";
412
- var q = 18;
411
+ var $ = "development";
412
+ var j = 18;
413
413
  var Mt = 6;
414
414
  var x = "native";
415
415
  var ke = {
416
416
  name: "IMX",
417
417
  symbol: "IMX",
418
- decimals: q,
418
+ decimals: j,
419
419
  address: x
420
420
  };
421
- var No = {
421
+ var vo = {
422
422
  name: "tIMX",
423
423
  symbol: "tIMX",
424
- decimals: q,
424
+ decimals: j,
425
425
  address: x
426
426
  };
427
- var H = {
428
- [J]: "https://api.dev.immutable.com",
429
- [re.SANDBOX]: "https://api.sandbox.immutable.com",
430
- [re.PRODUCTION]: "https://api.immutable.com"
427
+ var q = {
428
+ [$]: "https://api.dev.immutable.com",
429
+ [oe.SANDBOX]: "https://api.sandbox.immutable.com",
430
+ [oe.PRODUCTION]: "https://api.immutable.com"
431
431
  };
432
432
  var ve = {
433
- [J]: "https://checkout-api.dev.immutable.com",
434
- [re.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
435
- [re.PRODUCTION]: "https://checkout-api.immutable.com"
433
+ [$]: "https://checkout-api.dev.immutable.com",
434
+ [oe.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
435
+ [oe.PRODUCTION]: "https://checkout-api.immutable.com"
436
436
  };
437
437
  var bt = true;
438
438
  var Lt = true;
439
439
  var Dt = true;
440
- var Wt = {
441
- [re.SANDBOX]: "https://global-stg.transak.com",
442
- [re.PRODUCTION]: "https://global.transak.com/"
440
+ var xc = {
441
+ [oe.SANDBOX]: "https://global-stg.transak.com",
442
+ [oe.PRODUCTION]: "https://global.transak.com/"
443
443
  };
444
444
  var Pe = /* @__PURE__ */ new Map([
445
445
  [
@@ -489,11 +489,11 @@ var Se = /* @__PURE__ */ new Map([
489
489
  chainIdHex: `0x${13473 .toString(16)}`,
490
490
  chainName: "Immutable zkEVM Testnet",
491
491
  rpcUrls: ["https://rpc.testnet.immutable.com"],
492
- nativeCurrency: No
492
+ nativeCurrency: vo
493
493
  }
494
494
  ]
495
495
  ]);
496
- var Ft = /* @__PURE__ */ new Map([
496
+ var Wt = /* @__PURE__ */ new Map([
497
497
  [
498
498
  11155111,
499
499
  {
@@ -518,7 +518,7 @@ var Ft = /* @__PURE__ */ new Map([
518
518
  }
519
519
  ]
520
520
  ]);
521
- var oe = {
521
+ var ne = {
522
522
  [13473]: {
523
523
  url: "https://explorer.testnet.immutable.com",
524
524
  nativeToken: Se.get(13473).nativeCurrency
@@ -641,7 +641,7 @@ var W = [
641
641
  type: "function"
642
642
  }
643
643
  ];
644
- var ne = [
644
+ var ae = [
645
645
  {
646
646
  constant: false,
647
647
  inputs: [
@@ -803,20 +803,20 @@ var it = {
803
803
  };
804
804
 
805
805
  // src/env/env.ts
806
- var _o = "2.10.3";
807
- var me = () => _o;
806
+ var No = "2.10.4-alpha.1";
807
+ var me = () => No;
808
808
 
809
809
  // src/availability/availability.ts
810
810
  var Ne = (r, e) => {
811
811
  const t = () => {
812
- if (r) return H[J];
813
- if (e) return H[Ut.PRODUCTION];
814
- return H[Ut.SANDBOX];
812
+ if (r) return q[$];
813
+ if (e) return q[Ft.PRODUCTION];
814
+ return q[Ft.SANDBOX];
815
815
  };
816
816
  const o = async () => {
817
817
  let n;
818
818
  try {
819
- n = await Oo.post(`${t()}/v1/availability/checkout/swap`);
819
+ n = await _o.post(`${t()}/v1/availability/checkout/swap`);
820
820
  } catch (a) {
821
821
  n = a.response;
822
822
  if (n.status === 403) return false;
@@ -835,7 +835,7 @@ var Ne = (r, e) => {
835
835
 
836
836
  // src/balances/balances.ts
837
837
  import { HttpStatusCode as ut } from "axios";
838
- import { Contract as zo, formatUnits as gt } from "ethers";
838
+ import { Contract as Ho, formatUnits as gt } from "ethers";
839
839
 
840
840
  // src/types/gasEstimate.ts
841
841
  var st = /* @__PURE__ */ ((t) => {
@@ -851,23 +851,23 @@ var ge = /* @__PURE__ */ ((e) => {
851
851
  })(ge || {});
852
852
 
853
853
  // src/types/token.ts
854
- var ae = /* @__PURE__ */ ((n) => {
854
+ var ie = /* @__PURE__ */ ((n) => {
855
855
  n["ALL"] = "all";
856
856
  n["SWAP"] = "swap";
857
857
  n["BRIDGE"] = "bridge";
858
858
  n["ONRAMP"] = "onramp";
859
859
  return n;
860
- })(ae || {});
860
+ })(ie || {});
861
861
 
862
862
  // src/types/wallet.ts
863
- var Gt = /* @__PURE__ */ ((e) => {
863
+ var Ut = /* @__PURE__ */ ((e) => {
864
864
  e["ALL"] = "all";
865
865
  return e;
866
- })(Gt || {});
866
+ })(Ut || {});
867
867
 
868
868
  // src/types/provider.ts
869
869
  import {
870
- BrowserProvider as xo
870
+ BrowserProvider as Oo
871
871
  } from "ethers";
872
872
  var fe = /* @__PURE__ */ ((o) => {
873
873
  o["PASSPORT"] = "passport";
@@ -875,17 +875,17 @@ var fe = /* @__PURE__ */ ((o) => {
875
875
  o["WALLETCONNECT"] = "walletconnect";
876
876
  return o;
877
877
  })(fe || {});
878
- var qt = /* @__PURE__ */ ((o) => {
878
+ var Gt = /* @__PURE__ */ ((o) => {
879
879
  o["PASSPORT"] = "com.immutable.passport";
880
880
  o["METAMASK"] = "io.metamask";
881
881
  o["WALLETCONNECT"] = "walletconnect";
882
882
  return o;
883
- })(qt || {});
884
- var jt = {
883
+ })(Gt || {});
884
+ var qt = {
885
885
  allowMistmatchedChainId: false,
886
886
  allowUnsupportedProvider: false
887
887
  };
888
- var D = class extends xo {
888
+ var D = class extends Oo {
889
889
  ethereumProvider;
890
890
  // eslint-disable-next-line max-len
891
891
  constructor(e, t, o) {
@@ -946,13 +946,13 @@ var Te = /* @__PURE__ */ ((o) => {
946
946
  })(Te || {});
947
947
 
948
948
  // src/types/fiatRamp.ts
949
- var Vt = /* @__PURE__ */ ((e) => {
949
+ var jt = /* @__PURE__ */ ((e) => {
950
950
  e["ONRAMP"] = "onramp";
951
951
  return e;
952
- })(Vt || {});
952
+ })(jt || {});
953
953
 
954
954
  // src/provider/getUnderlyingProvider.ts
955
- async function Bo(r) {
955
+ async function xo(r) {
956
956
  if (!r.send) {
957
957
  throw new m(
958
958
  "Parsed provider is not a valid WrappedBrowserProvider",
@@ -970,12 +970,12 @@ async function Ie(r) {
970
970
  if (e.chainId && typeof e.chainId === "bigint") {
971
971
  return e.chainId;
972
972
  }
973
- return Bo(r);
973
+ return xo(r);
974
974
  }
975
975
 
976
976
  // src/network/network.ts
977
- var Ht = 4902;
978
- async function Mo(r, e, t) {
977
+ var Kt = 4902;
978
+ async function Bo(r, e, t) {
979
979
  return await e.send("wallet_switchEthereumChain", [
980
980
  { chainId: r.get(t)?.chainIdHex }
981
981
  ]);
@@ -994,7 +994,7 @@ async function dt(r, e, t) {
994
994
  }
995
995
  return Promise.reject("Provider does not support request method");
996
996
  }
997
- async function $(r, { type: e = "all", exclude: t }) {
997
+ async function X(r, { type: e = "all", exclude: t }) {
998
998
  const { networkMap: o } = r;
999
999
  const n = await r.remote.getConfig(
1000
1000
  "allowedNetworks"
@@ -1057,10 +1057,10 @@ async function he(r, e) {
1057
1057
  }
1058
1058
  );
1059
1059
  }
1060
- var bo = (r) => r.error?.data?.originalError?.code === Ht || r.error?.code === Ht;
1061
- async function zt(r, e, t) {
1060
+ var Mo = (r) => r.error?.data?.originalError?.code === Kt || r.error?.code === Kt;
1061
+ async function Ht(r, e, t) {
1062
1062
  const { networkMap: o } = r;
1063
- const n = await $(r, {
1063
+ const n = await X(r, {
1064
1064
  type: "all"
1065
1065
  });
1066
1066
  if (!n.networks.some((c) => c.chainId === t)) {
@@ -1076,10 +1076,10 @@ async function zt(r, e, t) {
1076
1076
  );
1077
1077
  }
1078
1078
  try {
1079
- await Mo(o, e, t);
1079
+ await Bo(o, e, t);
1080
1080
  } catch (c) {
1081
1081
  console.error(c);
1082
- if (bo(c)) {
1082
+ if (Mo(c)) {
1083
1083
  try {
1084
1084
  await dt(o, e, t);
1085
1085
  } catch (p) {
@@ -1112,10 +1112,10 @@ async function zt(r, e, t) {
1112
1112
  }
1113
1113
 
1114
1114
  // src/tokens/tokens.ts
1115
- import { Contract as jo } from "ethers";
1115
+ import { Contract as qo } from "ethers";
1116
1116
 
1117
1117
  // src/config/config.ts
1118
- import { Environment as ie } from "@imtbl/config";
1118
+ import { Environment as se } from "@imtbl/config";
1119
1119
 
1120
1120
  // src/config/remoteConfigFetcher.ts
1121
1121
  var Oe = class {
@@ -1170,7 +1170,7 @@ var Oe = class {
1170
1170
  };
1171
1171
 
1172
1172
  // src/config/tokensFetcher.ts
1173
- var Lo = "0x0000000000000000000000000000000000000eee";
1173
+ var bo = "0x0000000000000000000000000000000000000eee";
1174
1174
  var xe = class {
1175
1175
  httpClient;
1176
1176
  remoteConfig;
@@ -1257,7 +1257,7 @@ var xe = class {
1257
1257
  if (!t[s]) {
1258
1258
  t[s] = [];
1259
1259
  }
1260
- if (c === Lo) {
1260
+ if (c === bo) {
1261
1261
  c = "native";
1262
1262
  }
1263
1263
  t[s]?.push({
@@ -1299,17 +1299,17 @@ var lt = class extends Error {
1299
1299
  this.message = e;
1300
1300
  }
1301
1301
  };
1302
- var Do = (r, e) => {
1303
- if (e) return Ft;
1302
+ var Lo = (r, e) => {
1303
+ if (e) return Wt;
1304
1304
  if (r) return Pe;
1305
1305
  return Se;
1306
1306
  };
1307
- var Wo = (r, e) => {
1308
- if (e) return H[J];
1309
- if (r) return H[ie.PRODUCTION];
1310
- return H[ie.SANDBOX];
1307
+ var Do = (r, e) => {
1308
+ if (e) return q[$];
1309
+ if (r) return q[se.PRODUCTION];
1310
+ return q[se.SANDBOX];
1311
1311
  };
1312
- var Fo = (r, e) => {
1312
+ var Wo = (r, e) => {
1313
1313
  if (e) return "imtbl-zkevm-devnet";
1314
1314
  if (r) return "imtbl-zkevm-mainnet";
1315
1315
  return "imtbl-zkevm-testnet";
@@ -1323,12 +1323,12 @@ var w = (r) => {
1323
1323
  if (r.isProduction) return 13371;
1324
1324
  return 13473;
1325
1325
  };
1326
- var Uo = (r, e) => {
1327
- if (e) return ve[J];
1328
- if (r) return ve[ie.PRODUCTION];
1329
- return ve[ie.SANDBOX];
1326
+ var Fo = (r, e) => {
1327
+ if (e) return ve[$];
1328
+ if (r) return ve[se.PRODUCTION];
1329
+ return ve[se.SANDBOX];
1330
1330
  };
1331
- var Ae = class {
1331
+ var ye = class {
1332
1332
  // This is a hidden feature that is only available
1333
1333
  // when building the project from source code.
1334
1334
  // This will be used to get around the lack of
@@ -1347,25 +1347,25 @@ var Ae = class {
1347
1347
  l2ChainId;
1348
1348
  overrides;
1349
1349
  constructor(e, t) {
1350
- if (!Object.values(ie).includes(e.baseConfig.environment)) {
1350
+ if (!Object.values(se).includes(e.baseConfig.environment)) {
1351
1351
  throw new lt(
1352
1352
  "Invalid checkout configuration of environment"
1353
1353
  );
1354
1354
  }
1355
1355
  this.environment = e.baseConfig.environment;
1356
- this.isProduction = !this.isDevelopment && this.environment === ie.PRODUCTION;
1356
+ this.isProduction = !this.isDevelopment && this.environment === se.PRODUCTION;
1357
1357
  this.isOnRampEnabled = e.onRamp?.enable ?? bt;
1358
1358
  this.isSwapEnabled = e.swap?.enable ?? Lt;
1359
1359
  this.isBridgeEnabled = e.bridge?.enable ?? Dt;
1360
1360
  this.publishableKey = e.publishableKey ?? "<no-publishable-key>";
1361
- this.networkMap = e.overrides?.networkMap ?? Do(this.isProduction, this.isDevelopment);
1362
- const o = e.overrides?.remoteConfigEndpoint ?? Uo(this.isProduction, this.isDevelopment);
1361
+ this.networkMap = e.overrides?.networkMap ?? Lo(this.isProduction, this.isDevelopment);
1362
+ const o = e.overrides?.remoteConfigEndpoint ?? Fo(this.isProduction, this.isDevelopment);
1363
1363
  this.remote = new Oe(t, {
1364
1364
  remoteConfigEndpoint: o
1365
1365
  });
1366
1366
  this.tokens = new xe(t, this.remote, {
1367
- baseUrl: e.overrides?.baseUrl ?? Wo(this.isProduction, this.isDevelopment),
1368
- chainSlug: e.overrides?.chainSlug ?? Fo(this.isProduction, this.isDevelopment)
1367
+ baseUrl: e.overrides?.baseUrl ?? Do(this.isProduction, this.isDevelopment),
1368
+ chainSlug: e.overrides?.chainSlug ?? Wo(this.isProduction, this.isDevelopment)
1369
1369
  });
1370
1370
  this.l1ChainId = _(this);
1371
1371
  this.l2ChainId = e.overrides?.l2ChainId ?? w(this);
@@ -1379,8 +1379,8 @@ var Ae = class {
1379
1379
 
1380
1380
  // src/utils/utils.ts
1381
1381
  var h = (r = "", e = "") => r.toLowerCase() === e.toLowerCase();
1382
- var Zt = (r) => r === 15003 || r === 13473 || r === 13371;
1383
- var Go = (r, e) => {
1382
+ var Qt = (r) => r === 15003 || r === 13473 || r === 13371;
1383
+ var Uo = (r, e) => {
1384
1384
  const t = r.indexOf(".");
1385
1385
  const o = r.substring(t + e + 1);
1386
1386
  if (o && parseFloat(o) >= 1) {
@@ -1393,12 +1393,12 @@ var Go = (r, e) => {
1393
1393
  var Z = (r, e = Mt) => {
1394
1394
  const t = r.indexOf(".");
1395
1395
  if (t === -1) return r;
1396
- const o = Go(r, e);
1396
+ const o = Uo(r, e);
1397
1397
  return o;
1398
1398
  };
1399
1399
 
1400
1400
  // src/tokens/tokens.ts
1401
- var Vo = "native";
1401
+ var jo = "native";
1402
1402
  var z = async (r, {
1403
1403
  type: e = "all",
1404
1404
  chainId: t,
@@ -1421,7 +1421,7 @@ var z = async (r, {
1421
1421
  n = a["201811419111"]?.tokens || [];
1422
1422
  break;
1423
1423
  case "bridge":
1424
- n = (await r.tokens.getTokensConfig(s)).filter((p) => p.bridge === Vo);
1424
+ n = (await r.tokens.getTokensConfig(s)).filter((p) => p.bridge === jo);
1425
1425
  break;
1426
1426
  case "all":
1427
1427
  default:
@@ -1436,7 +1436,7 @@ var B = (r) => !r || h(r, x);
1436
1436
  async function Be(r, e) {
1437
1437
  return await L(
1438
1438
  async () => {
1439
- const t = new jo(e, JSON.stringify(W), r);
1439
+ const t = new qo(e, JSON.stringify(W), r);
1440
1440
  const [o, n, a] = await Promise.all([
1441
1441
  t.name(),
1442
1442
  t.symbol(),
@@ -1454,11 +1454,11 @@ async function Be(r, e) {
1454
1454
  }
1455
1455
 
1456
1456
  // src/api/blockscout/blockscout.ts
1457
- import Yt, {
1458
- HttpStatusCode as Jt
1457
+ import Zt, {
1458
+ HttpStatusCode as Yt
1459
1459
  } from "axios";
1460
- var Ho = 5;
1461
- var ye = class {
1460
+ var Ko = 5;
1461
+ var Ae = class {
1462
1462
  url;
1463
1463
  nativeToken;
1464
1464
  ttl;
@@ -1482,8 +1482,8 @@ var ye = class {
1482
1482
  constructor(e, t, o) {
1483
1483
  this.httpClient = e;
1484
1484
  this.chainId = t;
1485
- this.url = oe[this.chainId].url;
1486
- const n = oe[this.chainId].nativeToken;
1485
+ this.url = ne[this.chainId].url;
1486
+ const n = ne[this.chainId].nativeToken;
1487
1487
  this.nativeToken = {
1488
1488
  address: n.address ?? "",
1489
1489
  decimals: n.decimals.toString(),
@@ -1491,13 +1491,13 @@ var ye = class {
1491
1491
  symbol: n.symbol
1492
1492
  };
1493
1493
  this.cacheMap = {};
1494
- this.ttl = o !== void 0 ? o : Ho;
1494
+ this.ttl = o !== void 0 ? o : Ko;
1495
1495
  }
1496
1496
  /**
1497
1497
  * isChainSupported verifies if the chain is supported by Blockscout
1498
1498
  * @param chainId
1499
1499
  */
1500
- static isChainSupported = (e) => Boolean(oe[e]);
1500
+ static isChainSupported = (e) => Boolean(ne[e]);
1501
1501
  /**
1502
1502
  * isBlockscoutError verifies if the error is a Blockscout client error
1503
1503
  * @param err error to evaluate
@@ -1540,9 +1540,9 @@ var ye = class {
1540
1540
  this.setCache(t, i);
1541
1541
  return Promise.resolve(i);
1542
1542
  } catch (t) {
1543
- let o = Jt.InternalServerError;
1543
+ let o = Yt.InternalServerError;
1544
1544
  let n = "InternalServerError";
1545
- if (Yt.isAxiosError(t)) {
1545
+ if (Zt.isAxiosError(t)) {
1546
1546
  o = t.response?.status || o;
1547
1547
  n = t.message;
1548
1548
  }
@@ -1567,9 +1567,9 @@ var ye = class {
1567
1567
  this.setCache(t, a);
1568
1568
  return Promise.resolve(a);
1569
1569
  } catch (t) {
1570
- let o = Jt.InternalServerError;
1570
+ let o = Yt.InternalServerError;
1571
1571
  let n = "InternalServerError";
1572
- if (Yt.isAxiosError(t)) {
1572
+ if (Zt.isAxiosError(t)) {
1573
1573
  o = t.response?.status || o;
1574
1574
  n = t.message;
1575
1575
  }
@@ -1617,7 +1617,7 @@ var ft = async (r, e, t) => await L(
1617
1617
  async function Et(r, e, t) {
1618
1618
  return await L(
1619
1619
  async () => {
1620
- const o = new zo(
1620
+ const o = new Ho(
1621
1621
  t,
1622
1622
  JSON.stringify(W),
1623
1623
  r
@@ -1644,7 +1644,7 @@ async function Et(r, e, t) {
1644
1644
  }
1645
1645
  var mt = /* @__PURE__ */ new Map();
1646
1646
  var Rt = () => mt.clear();
1647
- var Qo = async (r, e, t, o) => {
1647
+ var zo = async (r, e, t, o) => {
1648
1648
  const n = o !== void 0;
1649
1649
  const a = Object.assign(
1650
1650
  {},
@@ -1653,7 +1653,7 @@ var Qo = async (r, e, t, o) => {
1653
1653
  let i = mt.get(t);
1654
1654
  if (!i) {
1655
1655
  const f = r.remote.getHttpClient();
1656
- i = new ye(f, t);
1656
+ i = new Ae(f, t);
1657
1657
  mt.set(t, i);
1658
1658
  }
1659
1659
  const s = [];
@@ -1706,19 +1706,19 @@ var Qo = async (r, e, t, o) => {
1706
1706
  if (f.value == null) return;
1707
1707
  const E = BigInt(f.value);
1708
1708
  let T = parseInt(C.decimals, 10);
1709
- if (Number.isNaN(T)) T = q;
1710
- const A = C.icon_url ?? R.icon;
1709
+ if (Number.isNaN(T)) T = j;
1710
+ const y = C.icon_url ?? R.icon;
1711
1711
  const I = {
1712
1712
  ...C,
1713
1713
  decimals: T,
1714
- icon: A
1714
+ icon: y
1715
1715
  };
1716
1716
  const P = gt(f.value, I.decimals);
1717
1717
  g.push({ balance: E, formattedBalance: P, token: I });
1718
1718
  });
1719
1719
  return { balances: g };
1720
1720
  };
1721
- var Zo = async (r, e, t, o) => {
1721
+ var Qo = async (r, e, t, o) => {
1722
1722
  const n = [];
1723
1723
  o.forEach((i) => {
1724
1724
  if (!i.address || h(i.address, x)) {
@@ -1742,7 +1742,7 @@ var Zo = async (r, e, t, o) => {
1742
1742
  return i;
1743
1743
  }, { balances: new Array() });
1744
1744
  };
1745
- var $t = async (r, e, t, o, n) => {
1745
+ var Jt = async (r, e, t, o, n) => {
1746
1746
  if (!e) {
1747
1747
  throw new m(
1748
1748
  "indexer is disabled for this chain, you must provide a provider.",
@@ -1754,10 +1754,10 @@ var $t = async (r, e, t, o, n) => {
1754
1754
  return await k(
1755
1755
  r,
1756
1756
  `Time to fetch balances using RPC for ${o}`,
1757
- Zo(r, e, a, n)
1757
+ Qo(r, e, a, n)
1758
1758
  );
1759
1759
  };
1760
- var j = async (r, e, t, o, n = false) => {
1760
+ var V = async (r, e, t, o, n = false) => {
1761
1761
  if (!t && !e) {
1762
1762
  throw new m(
1763
1763
  "both walletAddress and provider are missing. At least one must be provided.",
@@ -1780,26 +1780,26 @@ var j = async (r, e, t, o, n = false) => {
1780
1780
  if (n) {
1781
1781
  Rt();
1782
1782
  }
1783
- if (ye.isChainSupported(o)) {
1783
+ if (Ae.isChainSupported(o)) {
1784
1784
  const i = t ?? await (await e?.getSigner())?.getAddress();
1785
1785
  try {
1786
1786
  return await k(
1787
1787
  r,
1788
1788
  `Time to fetch balances using blockscout for ${o}`,
1789
- Qo(r, i, o, a)
1789
+ zo(r, i, o, a)
1790
1790
  );
1791
1791
  } catch (s) {
1792
1792
  if (s.type === "GET_INDEXER_BALANCE_ERROR" && s.data?.error?.code === ut.TooManyRequests) {
1793
- return $t(r, e, t, o, a);
1793
+ return Jt(r, e, t, o, a);
1794
1794
  }
1795
1795
  throw s;
1796
1796
  }
1797
1797
  }
1798
- return $t(r, e, t, o, a);
1798
+ return Jt(r, e, t, o, a);
1799
1799
  };
1800
1800
 
1801
1801
  // src/connect/connect.ts
1802
- async function Xt(r) {
1802
+ async function $t(r) {
1803
1803
  if (!r?.send) {
1804
1804
  throw new m(
1805
1805
  "Check wallet connection request failed",
@@ -1827,7 +1827,7 @@ async function Xt(r) {
1827
1827
  walletAddress: e[0] ?? ""
1828
1828
  };
1829
1829
  }
1830
- async function er(r) {
1830
+ async function Xt(r) {
1831
1831
  if (!r || !r.send) {
1832
1832
  throw new m(
1833
1833
  "Incompatible provider",
@@ -1844,7 +1844,7 @@ async function er(r) {
1844
1844
  );
1845
1845
  return r;
1846
1846
  }
1847
- async function tr(r) {
1847
+ async function er(r) {
1848
1848
  if (!r || !r.send) {
1849
1849
  throw new m(
1850
1850
  "Incompatible provider",
@@ -1878,71 +1878,73 @@ var Me = class {
1878
1878
  );
1879
1879
  return e["201811419111"]?.fees;
1880
1880
  }
1881
- async createWidgetUrl(e) {
1882
- return await this.getTransakWidgetUrl(e);
1881
+ async createWidgetUrl(e, t = new Y()) {
1882
+ return await this.getTransakWidgetUrl(e, t);
1883
1883
  }
1884
- async getTransakWidgetUrl(e) {
1885
- const t = await this.config.remote.getConfig(
1884
+ async getTransakWidgetUrl(e, t) {
1885
+ const o = await this.config.remote.getConfig(
1886
1886
  "onramp"
1887
1887
  );
1888
- const o = Wt[this.config.environment];
1889
- let n = {
1890
- apiKey: t["201811419111"].publishableApiKey,
1888
+ const n = `${q[this.config.environment]}/checkout/v1/widget-url`;
1889
+ let a = {
1890
+ api_key: o["201811419111"].publishableApiKey,
1891
1891
  network: "immutablezkevm",
1892
- defaultPaymentMethod: "credit_debit_card",
1893
- disablePaymentMethods: "",
1894
- productsAvailed: "buy",
1895
- exchangeScreenTitle: e.customSubTitle === "" ? " " : e.customSubTitle ?? "Buy",
1896
- themeColor: "0D0D0D",
1897
- defaultCryptoCurrency: e.tokenSymbol || "IMX",
1898
- hideMenu: !(e.showMenu ?? true)
1892
+ default_payment_method: "credit_debit_card",
1893
+ disable_payment_methods: "",
1894
+ products_availed: "buy",
1895
+ exchange_screen_title: e.customSubTitle === "" ? " " : e.customSubTitle ?? "Buy",
1896
+ theme_color: "FFFFFF",
1897
+ // this only controls the background colour of the Buy button
1898
+ default_crypto_currency: e.tokenSymbol || "IMX",
1899
+ hide_menu: !(e.showMenu ?? true)
1899
1900
  };
1900
1901
  if (e.isPassport && e.email) {
1901
- n = {
1902
- ...n,
1903
- email: encodeURIComponent(e.email),
1904
- isAutoFillUserData: true,
1905
- disableWalletAddressForm: true
1902
+ a = {
1903
+ ...a,
1904
+ email: e.email,
1905
+ is_auto_fill_user_data: true,
1906
+ disable_wallet_address_form: true
1906
1907
  };
1907
1908
  }
1908
1909
  if (e.tokenAmount && e.tokenSymbol) {
1909
- n = {
1910
- ...n,
1911
- defaultCryptoAmount: e.tokenAmount,
1912
- cryptoCurrencyCode: e.tokenSymbol
1910
+ a = {
1911
+ ...a,
1912
+ default_crypto_amount: e.tokenAmount,
1913
+ crypto_currency_code: e.tokenSymbol
1913
1914
  };
1914
1915
  } else {
1915
- n = {
1916
- ...n,
1917
- defaultFiatAmount: 50,
1918
- defaultFiatCurrency: "usd"
1916
+ a = {
1917
+ ...a,
1918
+ default_fiat_amount: 50,
1919
+ default_fiat_currency: "usd"
1919
1920
  };
1920
1921
  }
1921
1922
  if (e.walletAddress) {
1922
- n = {
1923
- ...n,
1924
- walletAddress: e.walletAddress
1923
+ a = {
1924
+ ...a,
1925
+ wallet_address: e.walletAddress
1925
1926
  };
1926
1927
  }
1927
1928
  if (e.allowedTokens) {
1928
- n = {
1929
- ...n,
1930
- cryptoCurrencyList: e.allowedTokens?.join(",").toLowerCase()
1929
+ a = {
1930
+ ...a,
1931
+ crypto_currency_list: e.allowedTokens?.join(",").toLowerCase()
1931
1932
  };
1932
1933
  }
1933
- return `${o}?${new URLSearchParams(n).toString()}`;
1934
+ const i = await t.post(n, a, { method: "POST" });
1935
+ return i.data.url;
1934
1936
  }
1935
1937
  };
1936
1938
 
1937
1939
  // src/gasEstimate/gasEstimator.ts
1938
- import { parseUnits as cn } from "ethers";
1940
+ import { parseUnits as sn } from "ethers";
1939
1941
 
1940
1942
  // src/gasEstimate/bridgeGasEstimate.ts
1941
1943
  import {
1942
- BridgeFeeActions as rr
1944
+ BridgeFeeActions as tr
1943
1945
  } from "@imtbl/bridge-sdk";
1944
- async function or(r, e, t, o) {
1945
- const n = e === _(o) ? rr.DEPOSIT : rr.WITHDRAW;
1946
+ async function rr(r, e, t, o) {
1947
+ const n = e === _(o) ? tr.DEPOSIT : tr.WITHDRAW;
1946
1948
  return await r.getFee({
1947
1949
  action: n,
1948
1950
  gasMultiplier: "auto",
@@ -1955,16 +1957,16 @@ async function or(r, e, t, o) {
1955
1957
 
1956
1958
  // src/instance/instance.ts
1957
1959
  import {
1958
- BridgeConfiguration as $o,
1959
- ETH_MAINNET_TO_ZKEVM_MAINNET as Xo,
1960
- ETH_SEPOLIA_TO_ZKEVM_DEVNET as en,
1961
- ETH_SEPOLIA_TO_ZKEVM_TESTNET as tn,
1962
- TokenBridge as rn
1960
+ BridgeConfiguration as Jo,
1961
+ ETH_MAINNET_TO_ZKEVM_MAINNET as $o,
1962
+ ETH_SEPOLIA_TO_ZKEVM_DEVNET as Xo,
1963
+ ETH_SEPOLIA_TO_ZKEVM_TESTNET as en,
1964
+ TokenBridge as tn
1963
1965
  } from "@imtbl/bridge-sdk";
1964
- import { ImmutableConfiguration as nr } from "@imtbl/config";
1965
- import { Exchange as on } from "@imtbl/dex-sdk";
1966
- import { Orderbook as nn } from "@imtbl/orderbook";
1967
- import { BlockchainData as an } from "@imtbl/blockchain-data";
1966
+ import { ImmutableConfiguration as or } from "@imtbl/config";
1967
+ import { Exchange as rn } from "@imtbl/dex-sdk";
1968
+ import { Orderbook as on } from "@imtbl/orderbook";
1969
+ import { BlockchainData as nn } from "@imtbl/blockchain-data";
1968
1970
  function be(r, e, t, o) {
1969
1971
  const n = t.get(r);
1970
1972
  const a = t.get(e);
@@ -1980,39 +1982,39 @@ function be(r, e, t, o) {
1980
1982
  "CHAIN_NOT_SUPPORTED_ERROR"
1981
1983
  );
1982
1984
  }
1983
- let i = tn;
1984
- if (o.isDevelopment) i = en;
1985
- if (o.isProduction) i = Xo;
1986
- const s = new $o({
1987
- baseConfig: new nr({ environment: o.environment }),
1985
+ let i = en;
1986
+ if (o.isDevelopment) i = Xo;
1987
+ if (o.isProduction) i = $o;
1988
+ const s = new Jo({
1989
+ baseConfig: new or({ environment: o.environment }),
1988
1990
  bridgeInstance: i,
1989
1991
  rootProvider: n,
1990
1992
  childProvider: a
1991
1993
  });
1992
- return new rn(s);
1994
+ return new tn(s);
1993
1995
  }
1994
- async function se(r, e) {
1996
+ async function ce(r, e) {
1995
1997
  const t = await e.remote.getConfig(
1996
1998
  "dex"
1997
1999
  );
1998
- return new on({
2000
+ return new rn({
1999
2001
  chainId: r,
2000
- baseConfig: new nr({
2002
+ baseConfig: new or({
2001
2003
  environment: e.environment
2002
2004
  }),
2003
2005
  overrides: t?.overrides,
2004
2006
  secondaryFees: t?.secondaryFees
2005
2007
  });
2006
2008
  }
2007
- function ce(r) {
2008
- return new nn({
2009
+ function de(r) {
2010
+ return new on({
2009
2011
  baseConfig: {
2010
2012
  environment: r.environment
2011
2013
  }
2012
2014
  });
2013
2015
  }
2014
2016
  function Le(r) {
2015
- return new an({
2017
+ return new nn({
2016
2018
  baseConfig: {
2017
2019
  environment: r.environment
2018
2020
  }
@@ -2021,16 +2023,16 @@ function Le(r) {
2021
2023
 
2022
2024
  // src/instance/contract.ts
2023
2025
  import {
2024
- Contract as sn
2026
+ Contract as an
2025
2027
  } from "ethers";
2026
- function ar(r, e, t) {
2027
- return new sn(r, e, t);
2028
+ function nr(r, e, t) {
2029
+ return new an(r, e, t);
2028
2030
  }
2029
2031
 
2030
2032
  // src/gasEstimate/gasEstimator.ts
2031
- var dn = "0x0000000000000000000000000000000000000001";
2032
- var ir = 18;
2033
- async function ln(r, e) {
2033
+ var cn = "0x0000000000000000000000000000000000000001";
2034
+ var ar = 18;
2035
+ async function dn(r, e) {
2034
2036
  const t = _(e);
2035
2037
  const o = w(e);
2036
2038
  const n = r.get(t);
@@ -2042,7 +2044,7 @@ async function ln(r, e) {
2042
2044
  r,
2043
2045
  e
2044
2046
  );
2045
- const i = await or(
2047
+ const i = await rr(
2046
2048
  a,
2047
2049
  t,
2048
2050
  o,
@@ -2067,19 +2069,19 @@ async function ln(r, e) {
2067
2069
  };
2068
2070
  }
2069
2071
  }
2070
- async function pn(r) {
2072
+ async function ln(r) {
2071
2073
  const e = w(r);
2072
2074
  const t = await r.remote.getConfig(
2073
2075
  "gasEstimateTokens"
2074
2076
  );
2075
2077
  const { inAddress: o, outAddress: n } = t[e].swapAddresses;
2076
2078
  try {
2077
- const a = await se(e, r);
2079
+ const a = await ce(e, r);
2078
2080
  const { swap: i } = await a.getUnsignedSwapTxFromAmountIn(
2079
- dn,
2081
+ cn,
2080
2082
  o,
2081
2083
  n,
2082
- BigInt(cn("1", ir))
2084
+ BigInt(sn("1", ar))
2083
2085
  );
2084
2086
  if (!i.gasFeeEstimate) {
2085
2087
  return {
@@ -2095,7 +2097,7 @@ async function pn(r) {
2095
2097
  address: i.gasFeeEstimate.token.address,
2096
2098
  symbol: i.gasFeeEstimate.token.symbol ?? "",
2097
2099
  name: i.gasFeeEstimate.token.name ?? "",
2098
- decimals: i.gasFeeEstimate.token.decimals ?? ir
2100
+ decimals: i.gasFeeEstimate.token.decimals ?? ar
2099
2101
  }
2100
2102
  }
2101
2103
  };
@@ -2106,15 +2108,15 @@ async function pn(r) {
2106
2108
  };
2107
2109
  }
2108
2110
  }
2109
- async function sr(r, e, t) {
2111
+ async function ir(r, e, t) {
2110
2112
  switch (r.gasEstimateType) {
2111
2113
  case "BRIDGE_TO_L2":
2112
- return await ln(
2114
+ return await dn(
2113
2115
  e,
2114
2116
  t
2115
2117
  );
2116
2118
  case "SWAP":
2117
- return await pn(t);
2119
+ return await ln(t);
2118
2120
  default:
2119
2121
  throw new m(
2120
2122
  "Invalid type provided for gasEstimateType",
@@ -2124,9 +2126,9 @@ async function sr(r, e, t) {
2124
2126
  }
2125
2127
 
2126
2128
  // src/gasEstimate/gasPriceInWei.ts
2127
- var un = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2129
+ var pn = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2128
2130
  var Ct = (r) => {
2129
- if (un(r)) {
2131
+ if (pn(r)) {
2130
2132
  const { maxFeePerGas: e, maxPriorityFeePerGas: t } = r;
2131
2133
  if (e === null || t === null) return null;
2132
2134
  const o = (e - t) / BigInt(2);
@@ -2137,7 +2139,7 @@ var Ct = (r) => {
2137
2139
  };
2138
2140
 
2139
2141
  // src/provider/provider.ts
2140
- import En from "@metamask/detect-provider";
2142
+ import fn from "@metamask/detect-provider";
2141
2143
 
2142
2144
  // src/provider/injected/utils.ts
2143
2145
  function Tt(r) {
@@ -2259,19 +2261,19 @@ var We = {
2259
2261
  rdns: "com.immutable.passport",
2260
2262
  uuid: "b90118be-7234-4c89-b89b-d5d267663eb5"
2261
2263
  };
2262
- var gn = (r) => ({
2264
+ var mn = (r) => ({
2263
2265
  info: We,
2264
2266
  provider: r
2265
2267
  });
2266
- var fn = (r) => ({
2268
+ var gn = (r) => ({
2267
2269
  info: De,
2268
2270
  provider: r
2269
2271
  });
2270
2272
 
2271
2273
  // src/provider/provider.ts
2272
- async function Rn() {
2274
+ async function En() {
2273
2275
  const r = await L(
2274
- async () => await En(),
2276
+ async () => await fn(),
2275
2277
  { type: "METAMASK_PROVIDER_ERROR" }
2276
2278
  );
2277
2279
  if (!r || !r.request) {
@@ -2282,7 +2284,7 @@ async function Rn() {
2282
2284
  }
2283
2285
  return new D(r);
2284
2286
  }
2285
- async function cr(r, e) {
2287
+ async function sr(r, e) {
2286
2288
  let t = null;
2287
2289
  let o;
2288
2290
  switch (r) {
@@ -2308,7 +2310,7 @@ async function cr(r, e) {
2308
2310
  case "metamask": {
2309
2311
  o = F.getInstance().findProvider({ rdns: De.rdns });
2310
2312
  if (!o) {
2311
- t = await Rn();
2313
+ t = await En();
2312
2314
  }
2313
2315
  break;
2314
2316
  }
@@ -2341,7 +2343,7 @@ async function cr(r, e) {
2341
2343
  }
2342
2344
 
2343
2345
  // src/provider/validateProvider.ts
2344
- function dr(r) {
2346
+ function cr(r) {
2345
2347
  return r && "send" in r && typeof r.send === "function";
2346
2348
  }
2347
2349
  async function b(r, e, t) {
@@ -2354,7 +2356,7 @@ async function b(r, e, t) {
2354
2356
  return e;
2355
2357
  }
2356
2358
  const o = {
2357
- ...jt,
2359
+ ...qt,
2358
2360
  ...t
2359
2361
  };
2360
2362
  const n = await Ie(e);
@@ -2377,7 +2379,7 @@ async function b(r, e, t) {
2377
2379
  "WEB3_PROVIDER_ERROR"
2378
2380
  );
2379
2381
  }
2380
- const i = await $(r, {
2382
+ const i = await X(r, {
2381
2383
  type: "all"
2382
2384
  });
2383
2385
  const s = i.networks.some((c) => c.chainId === Number(n));
@@ -2396,24 +2398,24 @@ async function b(r, e, t) {
2396
2398
  }
2397
2399
 
2398
2400
  // src/readOnlyProviders/readOnlyProvider.ts
2399
- import { JsonRpcProvider as Tn } from "ethers";
2401
+ import { JsonRpcProvider as Cn } from "ethers";
2400
2402
  async function Fe(r, e) {
2401
2403
  if (r.isProduction && e?.has(1)) return e;
2402
2404
  if (e?.has(11155111)) return e;
2403
2405
  const t = /* @__PURE__ */ new Map();
2404
- const o = await $(r, {
2406
+ const o = await X(r, {
2405
2407
  type: "all"
2406
2408
  });
2407
2409
  o.networks.forEach((n) => {
2408
2410
  const a = r.networkMap.get(Number(n.chainId))?.rpcUrls[0];
2409
- const i = new Tn(a);
2411
+ const i = new Cn(a);
2410
2412
  t.set(Number(n.chainId), i);
2411
2413
  });
2412
2414
  return t;
2413
2415
  }
2414
2416
 
2415
2417
  // src/smartCheckout/aggregators/allowanceAggregator.ts
2416
- var lr = (r, e, t) => {
2418
+ var dr = (r, e, t) => {
2417
2419
  const o = [];
2418
2420
  if (!r.sufficient) {
2419
2421
  for (const n of r.allowances) {
@@ -2434,7 +2436,7 @@ var lr = (r, e, t) => {
2434
2436
  };
2435
2437
 
2436
2438
  // src/smartCheckout/aggregators/itemAggregator.ts
2437
- var In = (r) => {
2439
+ var Tn = (r) => {
2438
2440
  const e = /* @__PURE__ */ new Map();
2439
2441
  const t = [];
2440
2442
  r.forEach((o) => {
@@ -2457,7 +2459,7 @@ var In = (r) => {
2457
2459
  });
2458
2460
  return t.concat(Array.from(e.values()));
2459
2461
  };
2460
- var hn = (r) => {
2462
+ var In = (r) => {
2461
2463
  const e = /* @__PURE__ */ new Map();
2462
2464
  const t = [];
2463
2465
  r.forEach((o) => {
@@ -2481,7 +2483,7 @@ var hn = (r) => {
2481
2483
  });
2482
2484
  return t.concat(Array.from(e.values()));
2483
2485
  };
2484
- var An = (r) => {
2486
+ var hn = (r) => {
2485
2487
  const e = /* @__PURE__ */ new Map();
2486
2488
  const t = [];
2487
2489
  r.forEach((o) => {
@@ -2522,13 +2524,13 @@ var yn = (r) => {
2522
2524
  });
2523
2525
  return t.concat(Array.from(e.values()));
2524
2526
  };
2525
- var ht = (r) => yn(An(hn(In(r))));
2527
+ var ht = (r) => yn(hn(In(Tn(r))));
2526
2528
 
2527
2529
  // src/smartCheckout/allowance/erc20.ts
2528
- import { Contract as pr } from "ethers";
2529
- var wn = async (r, e, t, o) => {
2530
+ import { Contract as lr } from "ethers";
2531
+ var An = async (r, e, t, o) => {
2530
2532
  try {
2531
- const n = new pr(
2533
+ const n = new lr(
2532
2534
  t,
2533
2535
  JSON.stringify(W),
2534
2536
  r
@@ -2542,9 +2544,9 @@ var wn = async (r, e, t, o) => {
2542
2544
  );
2543
2545
  }
2544
2546
  };
2545
- var Pn = async (r, e, t, o, n) => {
2547
+ var wn = async (r, e, t, o, n) => {
2546
2548
  try {
2547
- const a = new pr(
2549
+ const a = new lr(
2548
2550
  t,
2549
2551
  JSON.stringify(W),
2550
2552
  r
@@ -2560,7 +2562,7 @@ var Pn = async (r, e, t, o, n) => {
2560
2562
  );
2561
2563
  }
2562
2564
  };
2563
- var ur = async (r, e, t) => {
2565
+ var pr = async (r, e, t) => {
2564
2566
  let o = true;
2565
2567
  const n = [];
2566
2568
  const a = /* @__PURE__ */ new Map();
@@ -2574,7 +2576,7 @@ var ur = async (r, e, t) => {
2574
2576
  a.set(T, R);
2575
2577
  i.set(
2576
2578
  T,
2577
- wn(r, e, C, E)
2579
+ An(r, e, C, E)
2578
2580
  );
2579
2581
  }
2580
2582
  const p = await Promise.all(i.values());
@@ -2591,10 +2593,10 @@ var ur = async (r, e, t) => {
2591
2593
  }
2592
2594
  o = false;
2593
2595
  const { tokenAddress: E, spenderAddress: T } = C;
2594
- const A = `${E}${T}`;
2596
+ const y = `${E}${T}`;
2595
2597
  const I = C.amount - p[R];
2596
2598
  s.set(
2597
- A,
2599
+ y,
2598
2600
  {
2599
2601
  type: "ERC20",
2600
2602
  sufficient: false,
@@ -2604,8 +2606,8 @@ var ur = async (r, e, t) => {
2604
2606
  }
2605
2607
  );
2606
2608
  c.set(
2607
- A,
2608
- Pn(
2609
+ y,
2610
+ wn(
2609
2611
  r,
2610
2612
  e,
2611
2613
  E,
@@ -2626,12 +2628,12 @@ var ur = async (r, e, t) => {
2626
2628
  };
2627
2629
 
2628
2630
  // src/smartCheckout/allowance/erc721.ts
2629
- import { Contract as At } from "ethers";
2630
- var Sn = async (r, e, t, o) => {
2631
+ import { Contract as yt } from "ethers";
2632
+ var Pn = async (r, e, t, o) => {
2631
2633
  try {
2632
- const n = new At(
2634
+ const n = new yt(
2633
2635
  t,
2634
- JSON.stringify(ne),
2636
+ JSON.stringify(ae),
2635
2637
  r
2636
2638
  );
2637
2639
  return await n.isApprovedForAll(e, o);
@@ -2648,11 +2650,11 @@ var Sn = async (r, e, t, o) => {
2648
2650
  );
2649
2651
  }
2650
2652
  };
2651
- var kn = async (r, e, t, o, n) => {
2653
+ var Sn = async (r, e, t, o, n) => {
2652
2654
  try {
2653
- const a = new At(
2655
+ const a = new yt(
2654
2656
  t,
2655
- JSON.stringify(ne),
2657
+ JSON.stringify(ae),
2656
2658
  r
2657
2659
  );
2658
2660
  const i = await a.approve.populateTransaction(o, n);
@@ -2672,11 +2674,11 @@ var kn = async (r, e, t, o, n) => {
2672
2674
  );
2673
2675
  }
2674
2676
  };
2675
- var vn = async (r, e, t) => {
2677
+ var kn = async (r, e, t) => {
2676
2678
  try {
2677
- const o = new At(
2679
+ const o = new yt(
2678
2680
  e,
2679
- JSON.stringify(ne),
2681
+ JSON.stringify(ae),
2680
2682
  r
2681
2683
  );
2682
2684
  return await o.getApproved(t);
@@ -2692,7 +2694,7 @@ var vn = async (r, e, t) => {
2692
2694
  );
2693
2695
  }
2694
2696
  };
2695
- var mr = (r, e) => {
2697
+ var ur = (r, e) => {
2696
2698
  try {
2697
2699
  if (!r.trim()) {
2698
2700
  throw new m(
@@ -2710,7 +2712,7 @@ var mr = (r, e) => {
2710
2712
  );
2711
2713
  }
2712
2714
  };
2713
- var Nn = async (r, e, t) => {
2715
+ var vn = async (r, e, t) => {
2714
2716
  const o = /* @__PURE__ */ new Map();
2715
2717
  const n = /* @__PURE__ */ new Map();
2716
2718
  for (const s of e) {
@@ -2719,7 +2721,7 @@ var Nn = async (r, e, t) => {
2719
2721
  const u = `${c}-${p}`;
2720
2722
  o.set(u, false);
2721
2723
  if (n.has(u)) continue;
2722
- n.set(u, Sn(
2724
+ n.set(u, Pn(
2723
2725
  r,
2724
2726
  t,
2725
2727
  c,
@@ -2733,22 +2735,22 @@ var Nn = async (r, e, t) => {
2733
2735
  });
2734
2736
  return o;
2735
2737
  };
2736
- var gr = async (r, e, t) => {
2738
+ var mr = async (r, e, t) => {
2737
2739
  let o = true;
2738
2740
  const n = [];
2739
2741
  const a = /* @__PURE__ */ new Map();
2740
2742
  const i = /* @__PURE__ */ new Map();
2741
2743
  const s = /* @__PURE__ */ new Map();
2742
2744
  const c = /* @__PURE__ */ new Map();
2743
- const p = await Nn(
2745
+ const p = await vn(
2744
2746
  r,
2745
2747
  t,
2746
2748
  e
2747
2749
  );
2748
2750
  for (const C of t) {
2749
2751
  if (C.type !== "ERC721") continue;
2750
- const { contractAddress: E, id: T, spenderAddress: A } = C;
2751
- const I = `${E}-${A}`;
2752
+ const { contractAddress: E, id: T, spenderAddress: y } = C;
2753
+ const I = `${E}-${y}`;
2752
2754
  const P = p.get(I);
2753
2755
  if (P) {
2754
2756
  n.push({
@@ -2758,11 +2760,11 @@ var gr = async (r, e, t) => {
2758
2760
  continue;
2759
2761
  }
2760
2762
  const v = `${E}-${T}`;
2761
- const O = mr(T, E);
2763
+ const O = ur(T, E);
2762
2764
  a.set(v, C);
2763
2765
  i.set(
2764
2766
  v,
2765
- vn(r, E, O)
2767
+ kn(r, E, O)
2766
2768
  );
2767
2769
  }
2768
2770
  const u = await Promise.all(i.values());
@@ -2778,9 +2780,9 @@ var gr = async (r, e, t) => {
2778
2780
  continue;
2779
2781
  }
2780
2782
  o = false;
2781
- const { contractAddress: T, id: A, spenderAddress: I } = E;
2782
- const P = `${T}-${A}`;
2783
- const v = mr(A, T);
2783
+ const { contractAddress: T, id: y, spenderAddress: I } = E;
2784
+ const P = `${T}-${y}`;
2785
+ const v = ur(y, T);
2784
2786
  s.set(
2785
2787
  P,
2786
2788
  {
@@ -2792,7 +2794,7 @@ var gr = async (r, e, t) => {
2792
2794
  );
2793
2795
  c.set(
2794
2796
  P,
2795
- kn(
2797
+ Sn(
2796
2798
  r,
2797
2799
  e,
2798
2800
  T,
@@ -2813,10 +2815,10 @@ var gr = async (r, e, t) => {
2813
2815
  };
2814
2816
 
2815
2817
  // src/smartCheckout/allowance/erc1155.ts
2816
- import { Contract as fr } from "ethers";
2817
- var _n = async (r, e, t, o) => {
2818
+ import { Contract as gr } from "ethers";
2819
+ var Nn = async (r, e, t, o) => {
2818
2820
  try {
2819
- const n = new fr(
2821
+ const n = new gr(
2820
2822
  t,
2821
2823
  JSON.stringify(at),
2822
2824
  r
@@ -2835,9 +2837,9 @@ var _n = async (r, e, t, o) => {
2835
2837
  );
2836
2838
  }
2837
2839
  };
2838
- var On = async (r, e, t, o) => {
2840
+ var _n = async (r, e, t, o) => {
2839
2841
  try {
2840
- const n = new fr(
2842
+ const n = new gr(
2841
2843
  t,
2842
2844
  JSON.stringify(at),
2843
2845
  r
@@ -2858,13 +2860,13 @@ var On = async (r, e, t, o) => {
2858
2860
  );
2859
2861
  }
2860
2862
  };
2861
- var Er = async (r, e, t) => {
2863
+ var fr = async (r, e, t) => {
2862
2864
  const o = t.filter(
2863
2865
  (a) => a.type === "ERC1155"
2864
2866
  );
2865
2867
  const n = await Promise.all(
2866
2868
  o.map(async (a) => {
2867
- const i = await _n(
2869
+ const i = await Nn(
2868
2870
  r,
2869
2871
  e,
2870
2872
  a.contractAddress,
@@ -2876,7 +2878,7 @@ var Er = async (r, e, t) => {
2876
2878
  itemRequirement: a
2877
2879
  };
2878
2880
  }
2879
- const s = await On(
2881
+ const s = await _n(
2880
2882
  r,
2881
2883
  e,
2882
2884
  a.contractAddress,
@@ -2897,10 +2899,10 @@ var Er = async (r, e, t) => {
2897
2899
  };
2898
2900
 
2899
2901
  // src/smartCheckout/balanceCheck/balanceCheck.ts
2900
- import { Contract as Ln, formatUnits as Dn } from "ethers";
2902
+ import { Contract as bn, formatUnits as Ln } from "ethers";
2901
2903
 
2902
2904
  // src/smartCheckout/aggregators/balanceAggregator.ts
2903
- var xn = (r) => {
2905
+ var On = (r) => {
2904
2906
  const e = /* @__PURE__ */ new Map();
2905
2907
  const t = [];
2906
2908
  r.forEach((o) => {
@@ -2919,7 +2921,7 @@ var xn = (r) => {
2919
2921
  });
2920
2922
  return t.concat(Array.from(e.values()));
2921
2923
  };
2922
- var Bn = (r) => {
2924
+ var xn = (r) => {
2923
2925
  const e = /* @__PURE__ */ new Map();
2924
2926
  const t = [];
2925
2927
  r.forEach((o) => {
@@ -2939,7 +2941,7 @@ var Bn = (r) => {
2939
2941
  });
2940
2942
  return t.concat(Array.from(e.values()));
2941
2943
  };
2942
- var Mn = (r) => {
2944
+ var Bn = (r) => {
2943
2945
  const e = /* @__PURE__ */ new Map();
2944
2946
  const t = [];
2945
2947
  r.forEach((o) => {
@@ -2955,11 +2957,11 @@ var Mn = (r) => {
2955
2957
  });
2956
2958
  return t.concat(Array.from(e.values()));
2957
2959
  };
2958
- var Rr = (r) => Mn(Bn(xn(r)));
2960
+ var Er = (r) => Bn(xn(On(r)));
2959
2961
 
2960
2962
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2961
- import { Contract as bn, formatUnits as Ue } from "ethers";
2962
- var Cr = (r) => r.map((e) => {
2963
+ import { Contract as Mn, formatUnits as Ue } from "ethers";
2964
+ var Rr = (r) => r.map((e) => {
2963
2965
  switch (e.type) {
2964
2966
  case "ERC20":
2965
2967
  return {
@@ -2976,7 +2978,7 @@ var Cr = (r) => r.map((e) => {
2976
2978
  };
2977
2979
  }
2978
2980
  });
2979
- var Tr = (r, e) => {
2981
+ var Cr = (r, e) => {
2980
2982
  const t = BigInt(1);
2981
2983
  const o = e.find((s) => {
2982
2984
  const c = s;
@@ -3013,7 +3015,7 @@ var Tr = (r, e) => {
3013
3015
  isFee: false
3014
3016
  };
3015
3017
  };
3016
- var Ir = (r, e) => {
3018
+ var Tr = (r, e) => {
3017
3019
  if (r.type === "ERC20") {
3018
3020
  return e.find((t) => {
3019
3021
  return h(
@@ -3026,25 +3028,25 @@ var Ir = (r, e) => {
3026
3028
  return B(t.token?.address);
3027
3029
  });
3028
3030
  };
3029
- var hr = async (r, e, t) => {
3031
+ var Ir = async (r, e, t) => {
3030
3032
  const o = {};
3031
3033
  for (const n of r) {
3032
3034
  if (n.type === "NATIVE") {
3033
3035
  o[x] = ke;
3034
3036
  continue;
3035
3037
  }
3036
- const a = Ir(n, e);
3038
+ const a = Tr(n, e);
3037
3039
  let i = a?.token.address ?? "";
3038
3040
  let s = a?.token.name ?? "";
3039
3041
  let c = a?.token.symbol ?? "";
3040
- let p = a?.token.decimals ?? q;
3042
+ let p = a?.token.decimals ?? j;
3041
3043
  if (!a && n.type === "ERC20") {
3042
3044
  i = n.tokenAddress;
3043
3045
  if (i.toLowerCase() in o) {
3044
3046
  continue;
3045
3047
  }
3046
3048
  try {
3047
- const u = new bn(
3049
+ const u = new Mn(
3048
3050
  n.tokenAddress,
3049
3051
  JSON.stringify(W),
3050
3052
  t
@@ -3074,8 +3076,8 @@ var hr = async (r, e, t) => {
3074
3076
  }
3075
3077
  return o;
3076
3078
  };
3077
- var Ar = (r, e, t) => {
3078
- let o = Ir(r, e);
3079
+ var hr = (r, e, t) => {
3080
+ let o = Tr(r, e);
3079
3081
  const n = r.amount;
3080
3082
  const a = n < 0 || n === 0n || o && o?.balance >= n;
3081
3083
  const i = n - (o?.balance ?? BigInt(0));
@@ -3140,16 +3142,16 @@ var Ar = (r, e, t) => {
3140
3142
  };
3141
3143
 
3142
3144
  // src/smartCheckout/balanceCheck/balanceCheck.ts
3143
- var Wn = async (r, e, t, o, n = false) => {
3145
+ var Dn = async (r, e, t, o, n = false) => {
3144
3146
  try {
3145
3147
  const a = /* @__PURE__ */ new Map();
3146
- Cr(o).forEach(
3148
+ Rr(o).forEach(
3147
3149
  (s) => {
3148
3150
  if (!s.address) return;
3149
3151
  a.set(s.address.toLocaleLowerCase(), s);
3150
3152
  }
3151
3153
  );
3152
- const { balances: i } = await j(r, e, t, w(r), n);
3154
+ const { balances: i } = await V(r, e, t, w(r), n);
3153
3155
  return i.filter(
3154
3156
  (s) => a.get((s.token.address || x).toLocaleLowerCase())
3155
3157
  );
@@ -3161,15 +3163,15 @@ var Wn = async (r, e, t, o, n = false) => {
3161
3163
  );
3162
3164
  }
3163
3165
  };
3164
- var Fn = async (r, e, t) => {
3166
+ var Wn = async (r, e, t) => {
3165
3167
  const o = [];
3166
3168
  const n = /* @__PURE__ */ new Map();
3167
3169
  const a = /* @__PURE__ */ new Map();
3168
3170
  t.forEach((i) => {
3169
3171
  if (i.type !== "ERC721") return;
3170
- const s = new Ln(
3172
+ const s = new bn(
3171
3173
  i.contractAddress,
3172
- JSON.stringify(ne),
3174
+ JSON.stringify(ae),
3173
3175
  r
3174
3176
  );
3175
3177
  n.set(i.contractAddress, i);
@@ -3202,7 +3204,7 @@ var Fn = async (r, e, t) => {
3202
3204
  return o;
3203
3205
  };
3204
3206
  var yr = async (r, e, t, o, n = false) => {
3205
- const a = Rr(o);
3207
+ const a = Er(o);
3206
3208
  const i = [];
3207
3209
  const s = [];
3208
3210
  a.forEach((f) => {
@@ -3226,10 +3228,10 @@ var yr = async (r, e, t, o, n = false) => {
3226
3228
  }
3227
3229
  const c = [];
3228
3230
  if (i.length > 0) {
3229
- c.push(Wn(r, e, t, a, n));
3231
+ c.push(Dn(r, e, t, a, n));
3230
3232
  }
3231
3233
  if (s.length > 0) {
3232
- c.push(Fn(e, t, a));
3234
+ c.push(Wn(e, t, a));
3233
3235
  }
3234
3236
  const p = await Promise.all(c);
3235
3237
  const u = [];
@@ -3239,12 +3241,12 @@ var yr = async (r, e, t, o, n = false) => {
3239
3241
  const T = E.type === "NATIVE" ? x : E.token.address?.toLowerCase();
3240
3242
  return [T, E];
3241
3243
  }));
3242
- const C = await hr(i, f, e);
3244
+ const C = await Ir(i, f, e);
3243
3245
  i.forEach((E) => {
3244
3246
  const T = (E.tokenAddress ?? x).toLowerCase();
3245
- const A = C[T];
3247
+ const y = C[T];
3246
3248
  const I = R.get(T);
3247
- const P = Ar(E, [...R.values()], A);
3249
+ const P = hr(E, [...R.values()], y);
3248
3250
  u.push(P);
3249
3251
  if (!I) {
3250
3252
  return;
@@ -3253,14 +3255,14 @@ var yr = async (r, e, t, o, n = false) => {
3253
3255
  R.set(T, {
3254
3256
  ...I,
3255
3257
  balance: v,
3256
- formattedBalance: Dn(v, P.required.token.decimals)
3258
+ formattedBalance: Ln(v, P.required.token.decimals)
3257
3259
  });
3258
3260
  });
3259
3261
  }
3260
3262
  if (s.length > 0) {
3261
3263
  const f = p.shift() ?? [];
3262
3264
  s.forEach((R) => {
3263
- u.push(Tr(R, f));
3265
+ u.push(Cr(R, f));
3264
3266
  });
3265
3267
  }
3266
3268
  const g = u.find((f) => !f.sufficient) === void 0;
@@ -3271,7 +3273,7 @@ var yr = async (r, e, t, o, n = false) => {
3271
3273
  };
3272
3274
 
3273
3275
  // src/smartCheckout/gas/gasCalculator.ts
3274
- var wr = async (r, e) => {
3276
+ var Ar = async (r, e) => {
3275
3277
  try {
3276
3278
  return await r.estimateGas(e);
3277
3279
  } catch (t) {
@@ -3282,7 +3284,7 @@ var wr = async (r, e) => {
3282
3284
  );
3283
3285
  }
3284
3286
  };
3285
- var Un = (r, e) => {
3287
+ var Fn = (r, e) => {
3286
3288
  if (e.type === "TRANSACTION" || e.gasToken.type === "NATIVE") {
3287
3289
  return {
3288
3290
  type: "NATIVE",
@@ -3298,15 +3300,15 @@ var Un = (r, e) => {
3298
3300
  isFee: true
3299
3301
  };
3300
3302
  };
3301
- var Pr = async (r, e, t) => {
3303
+ var wr = async (r, e, t) => {
3302
3304
  const o = [];
3303
3305
  let n = BigInt(0);
3304
3306
  for (const i of e) {
3305
3307
  if (i.approvalTransaction === void 0) continue;
3306
- o.push(wr(r, i.approvalTransaction));
3308
+ o.push(Ar(r, i.approvalTransaction));
3307
3309
  }
3308
3310
  if (t.type === "TRANSACTION") {
3309
- o.push(wr(r, t.transaction));
3311
+ o.push(Ar(r, t.transaction));
3310
3312
  } else {
3311
3313
  const i = await r.getFeeData();
3312
3314
  const s = Ct(i);
@@ -3320,12 +3322,12 @@ var Pr = async (r, e, t) => {
3320
3322
  n += i;
3321
3323
  });
3322
3324
  if (n === 0n) return null;
3323
- return Un(n, t);
3325
+ return Fn(n, t);
3324
3326
  };
3325
3327
 
3326
3328
  // src/smartCheckout/routing/geoBlocking.ts
3327
- var Sr = async () => true;
3328
- var kr = async (r) => {
3329
+ var Pr = async () => true;
3330
+ var Sr = async (r) => {
3329
3331
  const e = Ne(r.isDevelopment, r.isProduction);
3330
3332
  try {
3331
3333
  return await e.checkDexAvailability();
@@ -3335,10 +3337,10 @@ var kr = async (r) => {
3335
3337
  };
3336
3338
 
3337
3339
  // src/smartCheckout/routing/routingOptions.ts
3338
- function yt(r) {
3340
+ function At(r) {
3339
3341
  return r?.ethereumProvider?.isPassport === true;
3340
3342
  }
3341
- var vr = async (r, e) => {
3343
+ var kr = async (r, e) => {
3342
3344
  const t = {
3343
3345
  onRamp: r.isOnRampEnabled,
3344
3346
  swap: r.isSwapEnabled,
@@ -3346,10 +3348,10 @@ var vr = async (r, e) => {
3346
3348
  };
3347
3349
  const o = [];
3348
3350
  if (t.onRamp) {
3349
- o.push({ id: "onRamp", promise: Sr() });
3351
+ o.push({ id: "onRamp", promise: Pr() });
3350
3352
  }
3351
3353
  if (t.swap) {
3352
- o.push({ id: "swap", promise: kr(r) });
3354
+ o.push({ id: "swap", promise: Sr(r) });
3353
3355
  }
3354
3356
  if (o.length > 0) {
3355
3357
  const n = o.map((i) => i.promise);
@@ -3359,12 +3361,12 @@ var vr = async (r, e) => {
3359
3361
  t[c] = t[c] && i.status === "fulfilled" && i.value;
3360
3362
  });
3361
3363
  }
3362
- t.bridge = t.bridge && !yt(e);
3364
+ t.bridge = t.bridge && !At(e);
3363
3365
  return t;
3364
3366
  };
3365
3367
 
3366
3368
  // src/smartCheckout/routing/tokenBalances.ts
3367
- var Nr = async (r, e, t, o) => {
3369
+ var vr = async (r, e, t, o) => {
3368
3370
  const n = /* @__PURE__ */ new Map();
3369
3371
  const a = /* @__PURE__ */ new Map();
3370
3372
  if (e.size === 0) {
@@ -3380,7 +3382,7 @@ var Nr = async (r, e, t, o) => {
3380
3382
  if (o.bridge) {
3381
3383
  const s = _(r);
3382
3384
  if (e.has(s)) {
3383
- a.set(s, j(
3385
+ a.set(s, V(
3384
3386
  r,
3385
3387
  e.get(s),
3386
3388
  t,
@@ -3396,7 +3398,7 @@ var Nr = async (r, e, t, o) => {
3396
3398
  }
3397
3399
  const i = w(r);
3398
3400
  if (e.has(i)) {
3399
- a.set(i, j(
3401
+ a.set(i, V(
3400
3402
  r,
3401
3403
  e.get(i),
3402
3404
  t,
@@ -3439,7 +3441,7 @@ var Ge = async (r, e, t, o, n) => {
3439
3441
  const a = /* @__PURE__ */ new Map();
3440
3442
  const i = 1;
3441
3443
  try {
3442
- const s = await se(e, r);
3444
+ const s = await ce(e, r);
3443
3445
  const c = [];
3444
3446
  const p = [];
3445
3447
  for (const g of n) {
@@ -3474,7 +3476,7 @@ var Ge = async (r, e, t, o, n) => {
3474
3476
  };
3475
3477
 
3476
3478
  // src/smartCheckout/routing/swap/swapRoute.ts
3477
- var Gn = (r, e, t) => {
3479
+ var Un = (r, e, t) => {
3478
3480
  let o = BigInt(0);
3479
3481
  let n = "0";
3480
3482
  let a;
@@ -3532,7 +3534,7 @@ var Gn = (r, e, t) => {
3532
3534
  swapFees: p
3533
3535
  };
3534
3536
  };
3535
- var qn = (r, e, t, o) => {
3537
+ var Gn = (r, e, t, o) => {
3536
3538
  const n = t.token.address;
3537
3539
  let a = "ERC20";
3538
3540
  if (B(n)) {
@@ -3559,7 +3561,7 @@ var qn = (r, e, t, o) => {
3559
3561
  fees: o
3560
3562
  };
3561
3563
  };
3562
- var jn = (r) => {
3564
+ var qn = (r) => {
3563
3565
  if (r.type === "ERC20") {
3564
3566
  return !!r.required.token.address;
3565
3567
  }
@@ -3568,7 +3570,7 @@ var jn = (r) => {
3568
3570
  }
3569
3571
  return false;
3570
3572
  };
3571
- var Vn = (r) => {
3573
+ var jn = (r) => {
3572
3574
  let e = "";
3573
3575
  let t = BigInt(0);
3574
3576
  switch (r.type) {
@@ -3584,7 +3586,7 @@ var Vn = (r) => {
3584
3586
  }
3585
3587
  return { address: e, amount: t };
3586
3588
  };
3587
- var Kn = (r, e) => {
3589
+ var Vn = (r, e) => {
3588
3590
  if (!e) return { sufficient: true, approvalGasFee: BigInt(0), approvalGasTokenAddress: "" };
3589
3591
  const t = e.value;
3590
3592
  const o = e.token.address;
@@ -3608,7 +3610,7 @@ var Kn = (r, e) => {
3608
3610
  }
3609
3611
  return { sufficient: true, approvalGasFee: t, approvalGasTokenAddress: o };
3610
3612
  };
3611
- var Hn = (r, e, t, o, n) => {
3613
+ var Kn = (r, e, t, o, n) => {
3612
3614
  const a = /* @__PURE__ */ new Map();
3613
3615
  if (e.approvalGasFee > BigInt(0)) {
3614
3616
  a.set(e.approvalGasTokenAddress, e.approvalGasFee);
@@ -3651,7 +3653,7 @@ var Hn = (r, e, t, o, n) => {
3651
3653
  }
3652
3654
  return true;
3653
3655
  };
3654
- var zn = (r, e, t, o, n, a) => {
3656
+ var Hn = (r, e, t, o, n, a) => {
3655
3657
  let i = BigInt(0);
3656
3658
  let s = "";
3657
3659
  let c = false;
@@ -3679,8 +3681,8 @@ var je = async (r, e, t, o, n, a, i) => {
3679
3681
  const s = [];
3680
3682
  if (!e.swap) return s;
3681
3683
  if (a.length === 0) return s;
3682
- if (!jn(o)) return s;
3683
- const c = Vn(o);
3684
+ if (!qn(o)) return s;
3685
+ const c = jn(o);
3684
3686
  const p = w(r);
3685
3687
  const u = n.get(p);
3686
3688
  if (!u) return s;
@@ -3701,33 +3703,33 @@ var je = async (r, e, t, o, n, a, i) => {
3701
3703
  (v) => h(v.token.address, C)
3702
3704
  );
3703
3705
  if (!T) continue;
3704
- const A = E.quote.amountWithMaxSlippage;
3705
- if (T.balance < A.value) continue;
3706
- const I = Kn(g, E.approval);
3706
+ const y = E.quote.amountWithMaxSlippage;
3707
+ if (T.balance < y.value) continue;
3708
+ const I = Vn(g, E.approval);
3707
3709
  if (!I.sufficient) continue;
3708
- if (!Hn(
3710
+ if (!Kn(
3709
3711
  g,
3710
3712
  I,
3711
3713
  E.swap,
3712
3714
  E.quote.fees,
3713
3715
  {
3714
- amount: A.value,
3716
+ amount: y.value,
3715
3717
  address: C
3716
3718
  }
3717
3719
  )) continue;
3718
- if (!zn(
3720
+ if (!Hn(
3719
3721
  T.balance,
3720
3722
  i,
3721
3723
  C,
3722
- A.value,
3724
+ y.value,
3723
3725
  I,
3724
3726
  E.quote.fees
3725
3727
  )) continue;
3726
- const P = Gn(E.approval, E.swap, E.quote.fees);
3728
+ const P = Un(E.approval, E.swap, E.quote.fees);
3727
3729
  s.push(
3728
- qn(
3730
+ Gn(
3729
3731
  p,
3730
- A.value,
3732
+ y.value,
3731
3733
  T,
3732
3734
  P
3733
3735
  )
@@ -3737,7 +3739,7 @@ var je = async (r, e, t, o, n, a, i) => {
3737
3739
  };
3738
3740
 
3739
3741
  // src/smartCheckout/allowList/allowListCheck.ts
3740
- var _r = (r, e) => {
3742
+ var Nr = (r, e) => {
3741
3743
  if (e && e.success) {
3742
3744
  return r.filter((t) => {
3743
3745
  if ("address" in t) {
@@ -3762,34 +3764,34 @@ var Pt = async (r, e, t) => {
3762
3764
  const o = _(r);
3763
3765
  const n = (await z(r, { type: "bridge", chainId: o })).tokens;
3764
3766
  const a = e.get(o);
3765
- return _r(n, a);
3767
+ return Nr(n, a);
3766
3768
  }
3767
3769
  return [];
3768
3770
  };
3769
- var Qn = async (r, e, t) => {
3771
+ var zn = async (r, e, t) => {
3770
3772
  if (t.swap) {
3771
3773
  const o = (await z(r, { type: "swap" })).tokens;
3772
3774
  const n = e.get(w(r));
3773
- return _r(o, n);
3775
+ return Nr(o, n);
3774
3776
  }
3775
3777
  return [];
3776
3778
  };
3777
- var Or = async (r, e, t) => {
3779
+ var _r = async (r, e, t) => {
3778
3780
  const o = {};
3779
- o.swap = await Qn(r, e, t);
3781
+ o.swap = await zn(r, e, t);
3780
3782
  o.bridge = await Pt(r, e, t);
3781
3783
  o.onRamp = await wt(r, t);
3782
3784
  return o;
3783
3785
  };
3784
3786
 
3785
3787
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
3786
- import { formatUnits as oa } from "ethers";
3788
+ import { formatUnits as ra } from "ethers";
3787
3789
 
3788
3790
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3789
3791
  import { formatUnits as Ke } from "ethers";
3790
3792
 
3791
3793
  // src/smartCheckout/routing/bridge/getEthBalance.ts
3792
- var xr = (r) => {
3794
+ var Or = (r) => {
3793
3795
  for (const e of r.balances) {
3794
3796
  if (B(e.token.address)) {
3795
3797
  return e.balance;
@@ -3799,8 +3801,8 @@ var xr = (r) => {
3799
3801
  };
3800
3802
 
3801
3803
  // src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
3802
- import { BridgeFeeActions as Zn } from "@imtbl/bridge-sdk";
3803
- var Br = async (r, e, t, o) => {
3804
+ import { BridgeFeeActions as Qn } from "@imtbl/bridge-sdk";
3805
+ var xr = async (r, e, t, o) => {
3804
3806
  const n = be(
3805
3807
  t,
3806
3808
  o,
@@ -3810,7 +3812,7 @@ var Br = async (r, e, t, o) => {
3810
3812
  try {
3811
3813
  const a = await n.getFee(
3812
3814
  {
3813
- action: Zn.DEPOSIT,
3815
+ action: Qn.DEPOSIT,
3814
3816
  gasMultiplier: "auto",
3815
3817
  sourceChainId: t.toString(),
3816
3818
  destinationChainId: o.toString()
@@ -3830,14 +3832,14 @@ var Br = async (r, e, t, o) => {
3830
3832
  };
3831
3833
 
3832
3834
  // src/smartCheckout/routing/indexer/fetchL1Representation.ts
3833
- var X = "0x0000000000000000000000000000000000000eee";
3834
- var Yn = (r) => {
3835
+ var ee = "0x0000000000000000000000000000000000000eee";
3836
+ var Zn = (r) => {
3835
3837
  if (r === 13371) return "imtbl-zkevm-mainnet";
3836
3838
  if (r === 13473) return "imtbl-zkevm-testnet";
3837
3839
  if (r === 15003) return "imtbl-zkevm-devnet";
3838
3840
  return "";
3839
3841
  };
3840
- var Jn = async (r, e) => {
3842
+ var Yn = async (r, e) => {
3841
3843
  const t = await e.remote.getConfig(
3842
3844
  "imxAddressMapping"
3843
3845
  );
@@ -3846,18 +3848,18 @@ var Jn = async (r, e) => {
3846
3848
  var Ve = async (r, e) => {
3847
3849
  if (B(e)) {
3848
3850
  return {
3849
- l1address: await Jn(_(r), r),
3851
+ l1address: await Yn(_(r), r),
3850
3852
  l2address: x
3851
3853
  };
3852
3854
  }
3853
- const t = Yn(w(r));
3855
+ const t = Zn(w(r));
3854
3856
  const o = Le(r);
3855
3857
  const n = await o.getToken({
3856
3858
  chainName: t,
3857
3859
  contractAddress: e
3858
3860
  });
3859
3861
  const a = n.result.root_contract_address;
3860
- if (h(a ?? "", X)) {
3862
+ if (h(a ?? "", ee)) {
3861
3863
  return {
3862
3864
  l1address: "native",
3863
3865
  l2address: e
@@ -3871,12 +3873,12 @@ var Ve = async (r, e) => {
3871
3873
  };
3872
3874
 
3873
3875
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3874
- var $n = (r, e) => {
3875
- const t = xr(r);
3876
+ var Jn = (r, e) => {
3877
+ const t = Or(r);
3876
3878
  return t >= e;
3877
3879
  };
3878
- var Mr = (r, e, t, o, n) => {
3879
- const a = n?.decimals ?? q;
3880
+ var Br = (r, e, t, o, n) => {
3881
+ const a = n?.decimals ?? j;
3880
3882
  const i = [];
3881
3883
  if (e > 0) {
3882
3884
  i.push({
@@ -3898,19 +3900,19 @@ var Mr = (r, e, t, o, n) => {
3898
3900
  approvalGasFee: {
3899
3901
  type: "GAS",
3900
3902
  amount: o,
3901
- formattedAmount: Ke(o, q),
3903
+ formattedAmount: Ke(o, j),
3902
3904
  token: n
3903
3905
  },
3904
3906
  bridgeGasFee: {
3905
3907
  type: "GAS",
3906
3908
  amount: r,
3907
- formattedAmount: Ke(r, q),
3909
+ formattedAmount: Ke(r, j),
3908
3910
  token: n
3909
3911
  },
3910
3912
  bridgeFees: i
3911
3913
  };
3912
3914
  };
3913
- var br = (r, e, t, o, n) => ({
3915
+ var Mr = (r, e, t, o, n) => ({
3914
3916
  type: "BRIDGE",
3915
3917
  chainId: r,
3916
3918
  fundingItem: {
@@ -3957,7 +3959,7 @@ var He = async (r, e, t, o, n) => {
3957
3959
  } else if (!u.find((v) => h(v.address, f))) {
3958
3960
  return void 0;
3959
3961
  }
3960
- const R = await Br(
3962
+ const R = await xr(
3961
3963
  r,
3962
3964
  e,
3963
3965
  a,
@@ -3967,21 +3969,21 @@ var He = async (r, e, t, o, n) => {
3967
3969
  sourceChainGas: C,
3968
3970
  approvalGas: E,
3969
3971
  bridgeFee: T,
3970
- imtblFee: A,
3972
+ imtblFee: y,
3971
3973
  totalFees: I
3972
3974
  } = R;
3973
- if (!$n(c, I)) return void 0;
3975
+ if (!Jn(c, I)) return void 0;
3974
3976
  if (B(f)) {
3975
3977
  const v = c.balances.find((O) => B(O.token.address));
3976
3978
  if (v && v.balance >= o.amount + I) {
3977
- const O = Mr(
3979
+ const O = Br(
3978
3980
  C,
3979
3981
  T,
3980
- A,
3982
+ y,
3981
3983
  E,
3982
3984
  s
3983
3985
  );
3984
- return br(a, v, o, "NATIVE", O);
3986
+ return Mr(a, v, o, "NATIVE", O);
3985
3987
  }
3986
3988
  return void 0;
3987
3989
  }
@@ -3989,20 +3991,20 @@ var He = async (r, e, t, o, n) => {
3989
3991
  (v) => h(v.token.address, f)
3990
3992
  );
3991
3993
  if (P && P.balance >= o.amount) {
3992
- const v = Mr(
3994
+ const v = Br(
3993
3995
  C,
3994
3996
  T,
3995
- A,
3997
+ y,
3996
3998
  E,
3997
3999
  s
3998
4000
  );
3999
- return br(a, P, o, "ERC20", v);
4001
+ return Mr(a, P, o, "ERC20", v);
4000
4002
  }
4001
4003
  return void 0;
4002
4004
  };
4003
4005
 
4004
4006
  // src/smartCheckout/routing/bridgeAndSwap/getBalancesByChain.ts
4005
- var Lr = (r, e) => {
4007
+ var br = (r, e) => {
4006
4008
  const t = { l1balances: [], l2balances: [] };
4007
4009
  const o = e.get(_(r));
4008
4010
  const n = e.get(w(r));
@@ -4018,8 +4020,8 @@ var Lr = (r, e) => {
4018
4020
  };
4019
4021
 
4020
4022
  // src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.ts
4021
- import { formatUnits as Xn } from "ethers";
4022
- var ea = (r, e) => {
4023
+ import { formatUnits as $n } from "ethers";
4024
+ var Xn = (r, e) => {
4023
4025
  let t = BigInt(0);
4024
4026
  r.quote.fees.forEach((o) => {
4025
4027
  if (h(o.amount.token.address, e)) {
@@ -4033,7 +4035,7 @@ var ea = (r, e) => {
4033
4035
  }
4034
4036
  return t;
4035
4037
  };
4036
- var ta = (r, e) => {
4038
+ var ea = (r, e) => {
4037
4039
  for (const t of r.balanceRequirements) {
4038
4040
  if (t.type === "NATIVE" || t.type === "ERC20") {
4039
4041
  if (h(t.required.token.address, e)) {
@@ -4043,7 +4045,7 @@ var ta = (r, e) => {
4043
4045
  }
4044
4046
  return BigInt(0);
4045
4047
  };
4046
- var ra = (r, e, t) => {
4048
+ var ta = (r, e, t) => {
4047
4049
  const o = t?.balance ?? BigInt(0);
4048
4050
  if (o >= r + e) {
4049
4051
  return BigInt(0);
@@ -4057,7 +4059,7 @@ var ra = (r, e, t) => {
4057
4059
  }
4058
4060
  return r + e - o;
4059
4061
  };
4060
- var Dr = (r, e, t, o, n) => {
4062
+ var Lr = (r, e, t, o, n) => {
4061
4063
  const a = [];
4062
4064
  for (const [i, s] of r) {
4063
4065
  const c = t.find((I) => h(I.token.address, i));
@@ -4068,29 +4070,29 @@ var Dr = (r, e, t, o, n) => {
4068
4070
  const { l1address: u, l2address: g } = p;
4069
4071
  if (!u) continue;
4070
4072
  const f = e.find((I) => {
4071
- if (I.token.address === void 0 && h(u, X)) {
4073
+ if (I.token.address === void 0 && h(u, ee)) {
4072
4074
  return true;
4073
4075
  }
4074
4076
  return h(I.token.address, u);
4075
4077
  });
4076
4078
  if (!f) continue;
4077
4079
  const R = s.quote.amountWithMaxSlippage.value;
4078
- const C = ea(s, i);
4080
+ const C = Xn(s, i);
4079
4081
  const E = R + C;
4080
- const T = ta(
4082
+ const T = ea(
4081
4083
  n,
4082
4084
  i
4083
4085
  );
4084
- const A = ra(E, T, c);
4085
- if (A <= 0) {
4086
+ const y = ta(E, T, c);
4087
+ if (y <= 0) {
4086
4088
  continue;
4087
4089
  }
4088
- if (A >= f.balance) {
4090
+ if (y >= f.balance) {
4089
4091
  continue;
4090
4092
  }
4091
4093
  a.push({
4092
- amount: A,
4093
- formattedAmount: Z(Xn(A, f.token.decimals)),
4094
+ amount: y,
4095
+ formattedAmount: Z($n(y, f.token.decimals)),
4094
4096
  // L2 address is used for the bridge requirement as the bridge route uses the indexer to find L1 address
4095
4097
  l2address: g
4096
4098
  });
@@ -4099,14 +4101,14 @@ var Dr = (r, e, t, o, n) => {
4099
4101
  };
4100
4102
 
4101
4103
  // src/smartCheckout/routing/bridgeAndSwap/fetchL1ToL2Mappings.ts
4102
- var Wr = async (r, e) => {
4104
+ var Dr = async (r, e) => {
4103
4105
  const t = e.map((n) => Ve(r, n.address ?? ""));
4104
4106
  const o = await Promise.all(t);
4105
4107
  return o.filter((n) => n !== void 0);
4106
4108
  };
4107
4109
 
4108
4110
  // src/smartCheckout/routing/bridgeAndSwap/getDexQuotes.ts
4109
- var Fr = async (r, e, t, o, n) => {
4111
+ var Wr = async (r, e, t, o, n) => {
4110
4112
  const a = [];
4111
4113
  for (const s of n) {
4112
4114
  if (!s.address) continue;
@@ -4126,7 +4128,7 @@ var Fr = async (r, e, t, o, n) => {
4126
4128
  };
4127
4129
 
4128
4130
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
4129
- var na = (r, e, t, o, n, a) => {
4131
+ var oa = (r, e, t, o, n, a) => {
4130
4132
  if (r.length === 0) return true;
4131
4133
  if (e.length === 0) return true;
4132
4134
  if (t.length === 0) return true;
@@ -4137,7 +4139,7 @@ var na = (r, e, t, o, n, a) => {
4137
4139
  if (a === "") return true;
4138
4140
  return false;
4139
4141
  };
4140
- var aa = (r, e, t, o) => {
4142
+ var na = (r, e, t, o) => {
4141
4143
  const n = [];
4142
4144
  for (const a of o) {
4143
4145
  if (!e.includes(a.l1address)) continue;
@@ -4150,7 +4152,7 @@ var aa = (r, e, t, o) => {
4150
4152
  }
4151
4153
  return n;
4152
4154
  };
4153
- var ia = (r, e, t, o, n) => {
4155
+ var aa = (r, e, t, o, n) => {
4154
4156
  const a = /* @__PURE__ */ new Map();
4155
4157
  for (const [c, p] of e) {
4156
4158
  a.set(c, {
@@ -4173,7 +4175,7 @@ var ia = (r, e, t, o, n) => {
4173
4175
  const C = n.find((E) => h(E.address, u));
4174
4176
  i.set(u, {
4175
4177
  balance: R,
4176
- formattedBalance: oa(
4178
+ formattedBalance: ra(
4177
4179
  R,
4178
4180
  C.decimals
4179
4181
  ),
@@ -4190,7 +4192,7 @@ var ia = (r, e, t, o, n) => {
4190
4192
  );
4191
4193
  return a;
4192
4194
  };
4193
- var sa = (r, e) => {
4195
+ var ia = (r, e) => {
4194
4196
  const t = [];
4195
4197
  for (const o of e) {
4196
4198
  const { chainId: n, fundingItem: a } = o;
@@ -4212,14 +4214,14 @@ var sa = (r, e) => {
4212
4214
  }
4213
4215
  return t;
4214
4216
  };
4215
- var ca = (r, e, t) => {
4217
+ var sa = (r, e, t) => {
4216
4218
  const o = [];
4217
4219
  for (const n of r) {
4218
4220
  if (!n) continue;
4219
4221
  const a = t.find(
4220
4222
  (s) => {
4221
4223
  if (n.fundingItem.token.address === void 0) {
4222
- return h(s.l1address, X) && s.l2address;
4224
+ return h(s.l1address, ee) && s.l2address;
4223
4225
  }
4224
4226
  return h(
4225
4227
  s.l1address,
@@ -4239,10 +4241,10 @@ var ca = (r, e, t) => {
4239
4241
  }
4240
4242
  return o;
4241
4243
  };
4242
- var Ur = async (r, e, t, o, n, a, i, s, c) => {
4243
- const { l1balances: p, l2balances: u } = Lr(r, a);
4244
+ var Fr = async (r, e, t, o, n, a, i, s, c) => {
4245
+ const { l1balances: p, l2balances: u } = br(r, a);
4244
4246
  const g = o.required.token.address;
4245
- if (na(
4247
+ if (oa(
4246
4248
  i,
4247
4249
  s,
4248
4250
  p,
@@ -4250,22 +4252,22 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4250
4252
  t,
4251
4253
  g
4252
4254
  )) return [];
4253
- const f = await Wr(r, s);
4254
- const R = aa(
4255
+ const f = await Dr(r, s);
4256
+ const R = na(
4255
4257
  g,
4256
4258
  i,
4257
4259
  s,
4258
4260
  f
4259
4261
  );
4260
4262
  if (R.length === 0) return [];
4261
- const C = await Fr(
4263
+ const C = await Wr(
4262
4264
  r,
4263
4265
  n,
4264
4266
  g,
4265
4267
  o,
4266
4268
  R
4267
4269
  );
4268
- const E = Dr(
4270
+ const E = Lr(
4269
4271
  C,
4270
4272
  p,
4271
4273
  u,
@@ -4274,7 +4276,7 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4274
4276
  );
4275
4277
  if (E.length === 0) return [];
4276
4278
  const T = /* @__PURE__ */ new Map();
4277
- const A = /* @__PURE__ */ new Map();
4279
+ const y = /* @__PURE__ */ new Map();
4278
4280
  const I = [];
4279
4281
  for (const G of E) {
4280
4282
  if (!G.l2address) continue;
@@ -4288,7 +4290,7 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4288
4290
  a
4289
4291
  )
4290
4292
  );
4291
- A.set(G.l2address, {
4293
+ y.set(G.l2address, {
4292
4294
  amount: G.amount,
4293
4295
  formattedAmount: G.formattedAmount,
4294
4296
  l2address: G.l2address
@@ -4298,10 +4300,10 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4298
4300
  const v = Array.from(T.keys());
4299
4301
  const O = [];
4300
4302
  P.forEach((G, rt) => {
4301
- const V = v[rt];
4303
+ const K = v[rt];
4302
4304
  if (G === void 0) return;
4303
- O.push(V);
4304
- const N = A.get(V);
4305
+ O.push(K);
4306
+ const N = y.get(K);
4305
4307
  if (!N) return;
4306
4308
  I.push({
4307
4309
  amount: N.amount,
@@ -4311,14 +4313,14 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4311
4313
  });
4312
4314
  if (O.length === 0) return [];
4313
4315
  if (I.length === 0) return [];
4314
- const Q = ia(
4316
+ const Q = aa(
4315
4317
  r,
4316
4318
  a,
4317
4319
  u,
4318
4320
  I,
4319
4321
  s
4320
4322
  );
4321
- const pe = await je(
4323
+ const ue = await je(
4322
4324
  r,
4323
4325
  t,
4324
4326
  n,
@@ -4327,20 +4329,20 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4327
4329
  O,
4328
4330
  c
4329
4331
  );
4330
- if (!pe) return [];
4331
- const ee = sa(
4332
+ if (!ue) return [];
4333
+ const te = ia(
4332
4334
  a,
4333
- pe
4335
+ ue
4334
4336
  );
4335
- return ca(
4337
+ return sa(
4336
4338
  P,
4337
- ee,
4339
+ te,
4338
4340
  f
4339
4341
  );
4340
4342
  };
4341
4343
 
4342
4344
  // src/smartCheckout/routing/onRamp/onRampRoute.ts
4343
- var Gr = async (r, e, t) => {
4345
+ var Ur = async (r, e, t) => {
4344
4346
  if (!["ERC20", "NATIVE"].includes(t.type)) return void 0;
4345
4347
  const { required: o, current: n, delta: a } = t;
4346
4348
  let i = false;
@@ -4372,8 +4374,8 @@ var Gr = async (r, e, t) => {
4372
4374
  };
4373
4375
 
4374
4376
  // src/smartCheckout/routing/routingCalculator.ts
4375
- var da = (r) => r.bridge || r.swap || r.onRamp;
4376
- var la = (r) => {
4377
+ var ca = (r) => r.bridge || r.swap || r.onRamp;
4378
+ var da = (r) => {
4377
4379
  let e = 0;
4378
4380
  let t;
4379
4381
  for (const o of r.balanceRequirements) {
@@ -4385,7 +4387,7 @@ var la = (r) => {
4385
4387
  if (e === 1) return t;
4386
4388
  return void 0;
4387
4389
  };
4388
- var pa = async (r, e, t, o, n) => {
4390
+ var la = async (r, e, t, o, n) => {
4389
4391
  let a;
4390
4392
  if (o === void 0) return void 0;
4391
4393
  if (o.type !== "NATIVE" && o.type !== "ERC20") {
@@ -4407,7 +4409,7 @@ var pa = async (r, e, t, o, n) => {
4407
4409
  }
4408
4410
  return a;
4409
4411
  };
4410
- var ua = async (r, e, t, o, n, a, i) => {
4412
+ var pa = async (r, e, t, o, n, a, i) => {
4411
4413
  const s = [];
4412
4414
  if (!e.swap) return s;
4413
4415
  if (t === void 0) return s;
@@ -4428,7 +4430,7 @@ var ua = async (r, e, t, o, n, a, i) => {
4428
4430
  i
4429
4431
  );
4430
4432
  };
4431
- var ma = async (r, e, t, o, n, a, i, s) => {
4433
+ var ua = async (r, e, t, o, n, a, i, s) => {
4432
4434
  if (!o) return [];
4433
4435
  const c = a.get(_(r));
4434
4436
  const p = a.get(w(r));
@@ -4438,14 +4440,14 @@ var ma = async (r, e, t, o, n, a, i, s) => {
4438
4440
  if (p.error !== void 0 || !p.success) return [];
4439
4441
  const u = i?.bridge ?? [];
4440
4442
  const g = u.map((C) => {
4441
- if (C.address === void 0) return X;
4443
+ if (C.address === void 0) return ee;
4442
4444
  return C.address;
4443
4445
  });
4444
4446
  const f = i?.swap ?? [];
4445
4447
  if (o.type !== "NATIVE" && o.type !== "ERC20") {
4446
4448
  return [];
4447
4449
  }
4448
- const R = await Ur(
4450
+ const R = await Fr(
4449
4451
  r,
4450
4452
  e,
4451
4453
  t,
@@ -4458,10 +4460,10 @@ var ma = async (r, e, t, o, n, a, i, s) => {
4458
4460
  );
4459
4461
  return R;
4460
4462
  };
4461
- var ga = async (r, e, t) => {
4463
+ var ma = async (r, e, t) => {
4462
4464
  if (!e.onRamp) return void 0;
4463
4465
  if (t === void 0) return void 0;
4464
- const o = await Gr(
4466
+ const o = await Ur(
4465
4467
  r,
4466
4468
  e,
4467
4469
  t
@@ -4486,8 +4488,8 @@ var Qe = (r, e, t, o) => {
4486
4488
  t.push(a);
4487
4489
  o?.(a);
4488
4490
  };
4489
- var qr = async (r, e, t, o, n) => {
4490
- if (!da(o)) {
4491
+ var Gr = async (r, e, t, o, n) => {
4492
+ if (!ca(o)) {
4491
4493
  return {
4492
4494
  type: "NO_ROUTE_OPTIONS",
4493
4495
  message: "No routing options are available"
@@ -4506,7 +4508,7 @@ var qr = async (r, e, t, o, n) => {
4506
4508
  const i = await k(
4507
4509
  r,
4508
4510
  "Time to get token balances inside router",
4509
- Nr(
4511
+ vr(
4510
4512
  r,
4511
4513
  a,
4512
4514
  e,
@@ -4516,14 +4518,14 @@ var qr = async (r, e, t, o, n) => {
4516
4518
  const s = await k(
4517
4519
  r,
4518
4520
  "Time to get routing allowlist",
4519
- Or(r, i, o)
4521
+ _r(r, i, o)
4520
4522
  );
4521
- const c = la(t);
4523
+ const c = da(t);
4522
4524
  const p = [];
4523
4525
  const u = [];
4524
4526
  if (o.swap) {
4525
4527
  p.push(
4526
- ua(
4528
+ pa(
4527
4529
  r,
4528
4530
  o,
4529
4531
  c,
@@ -4545,7 +4547,7 @@ var qr = async (r, e, t, o, n) => {
4545
4547
  }
4546
4548
  if (o.bridge) {
4547
4549
  p.push(
4548
- pa(
4550
+ la(
4549
4551
  r,
4550
4552
  a,
4551
4553
  o,
@@ -4563,7 +4565,7 @@ var qr = async (r, e, t, o, n) => {
4563
4565
  }
4564
4566
  if (o.onRamp) {
4565
4567
  p.push(
4566
- ga(
4568
+ ma(
4567
4569
  r,
4568
4570
  o,
4569
4571
  c
@@ -4579,7 +4581,7 @@ var qr = async (r, e, t, o, n) => {
4579
4581
  }
4580
4582
  if (o.swap && o.bridge) {
4581
4583
  p.push(
4582
- ma(
4584
+ ua(
4583
4585
  r,
4584
4586
  a,
4585
4587
  o,
@@ -4618,7 +4620,7 @@ var qr = async (r, e, t, o, n) => {
4618
4620
  };
4619
4621
 
4620
4622
  // src/smartCheckout/smartCheckout.ts
4621
- var fa = (r) => {
4623
+ var ga = (r) => {
4622
4624
  const e = r.balanceRequirements.map(
4623
4625
  (t) => {
4624
4626
  if (t.type === "ERC20" && t.sufficient) {
@@ -4639,12 +4641,12 @@ var fa = (r) => {
4639
4641
  balanceRequirements: e
4640
4642
  };
4641
4643
  };
4642
- var jr = async (r, e, t, o, n, a, i, s, c) => {
4643
- const p = !i || t && s ? fa(a) : a;
4644
+ var qr = async (r, e, t, o, n, a, i, s, c) => {
4645
+ const p = !i || t && s ? ga(a) : a;
4644
4646
  const u = await k(
4645
4647
  r,
4646
4648
  "Total time to run the routing calculator",
4647
- qr(
4649
+ Gr(
4648
4650
  r,
4649
4651
  e,
4650
4652
  p,
@@ -4662,20 +4664,20 @@ var jr = async (r, e, t, o, n, a, i, s, c) => {
4662
4664
  });
4663
4665
  return u;
4664
4666
  };
4665
- var le = async (r, e, t, o, n, a, i, s = false) => {
4667
+ var pe = async (r, e, t, o, n, a, i, s = false) => {
4666
4668
  const c = await (await e.getSigner()).getAddress();
4667
4669
  let p = ht(t);
4668
- const u = ur(
4670
+ const u = pr(
4669
4671
  e,
4670
4672
  c,
4671
4673
  p
4672
4674
  );
4673
- const g = gr(
4675
+ const g = mr(
4674
4676
  e,
4675
4677
  c,
4676
4678
  p
4677
4679
  );
4678
- const f = Er(
4680
+ const f = fr(
4679
4681
  e,
4680
4682
  c,
4681
4683
  p
@@ -4685,7 +4687,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4685
4687
  "Time to calculate token allowances",
4686
4688
  Promise.all([u, g, f])
4687
4689
  );
4688
- const C = lr(
4690
+ const C = dr(
4689
4691
  R[0],
4690
4692
  R[1],
4691
4693
  R[2]
@@ -4695,7 +4697,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4695
4697
  E = await k(
4696
4698
  r,
4697
4699
  "Time to run gas calculator",
4698
- Pr(e, C, o)
4700
+ wr(e, C, o)
4699
4701
  );
4700
4702
  if (E !== null) {
4701
4703
  p.push(E);
@@ -4707,21 +4709,21 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4707
4709
  "Time to run balance checks",
4708
4710
  yr(r, e, c, p, true)
4709
4711
  );
4710
- const { sufficient: A } = T;
4712
+ const { sufficient: y } = T;
4711
4713
  const I = T.balanceRequirements;
4712
4714
  const P = await k(
4713
4715
  r,
4714
4716
  "Time to fetch available routing options",
4715
- vr(r, e)
4717
+ kr(r, e)
4716
4718
  );
4717
4719
  if (n?.onRamp === false) P.onRamp = false;
4718
4720
  if (n?.swap === false) P.swap = false;
4719
4721
  if (n?.bridge === false) P.bridge = false;
4720
4722
  if (a) {
4721
- jr(
4723
+ qr(
4722
4724
  r,
4723
4725
  c,
4724
- A,
4726
+ y,
4725
4727
  P,
4726
4728
  I,
4727
4729
  T,
@@ -4730,20 +4732,20 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4730
4732
  i
4731
4733
  );
4732
4734
  return {
4733
- sufficient: A,
4735
+ sufficient: y,
4734
4736
  transactionRequirements: I
4735
4737
  };
4736
4738
  }
4737
- if (A) {
4739
+ if (y) {
4738
4740
  return {
4739
- sufficient: A,
4741
+ sufficient: y,
4740
4742
  transactionRequirements: I
4741
4743
  };
4742
4744
  }
4743
- const v = await jr(
4745
+ const v = await qr(
4744
4746
  r,
4745
4747
  c,
4746
- A,
4748
+ y,
4747
4749
  P,
4748
4750
  I,
4749
4751
  T,
@@ -4752,7 +4754,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4752
4754
  i
4753
4755
  );
4754
4756
  return {
4755
- sufficient: A,
4757
+ sufficient: y,
4756
4758
  transactionRequirements: I,
4757
4759
  router: {
4758
4760
  availableRoutingOptions: P,
@@ -4763,24 +4765,24 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4763
4765
 
4764
4766
  // src/smartCheckout/buy/buy.ts
4765
4767
  import {
4766
- constants as wa,
4767
- OrderStatusName as Pa
4768
+ constants as Aa,
4769
+ OrderStatusName as wa
4768
4770
  } from "@imtbl/orderbook";
4769
- import { track as Sa } from "@imtbl/metrics";
4771
+ import { track as Pa } from "@imtbl/metrics";
4770
4772
 
4771
4773
  // src/transaction/transaction.ts
4772
4774
  function St(r) {
4773
4775
  return r?.ethereumProvider?.isPassport === true;
4774
4776
  }
4775
- function Ra(r) {
4777
+ function Ea(r) {
4776
4778
  return St(r);
4777
4779
  }
4778
- var Ca = async (r, e) => {
4780
+ var Ra = async (r, e) => {
4779
4781
  const t = e;
4780
4782
  const { chainId: o } = await r.getNetwork();
4781
- if (!Zt(Number(o))) return t;
4783
+ if (!Qt(Number(o))) return t;
4782
4784
  if (typeof t.gasPrice !== "undefined") return t;
4783
- if (Ra(r)) {
4785
+ if (Ea(r)) {
4784
4786
  t.gasPrice = BigInt(0);
4785
4787
  } else {
4786
4788
  t.maxFeePerGas = it.maxFeePerGas;
@@ -4812,7 +4814,7 @@ var kt = (r) => {
4812
4814
  var U = async (r, e) => {
4813
4815
  try {
4814
4816
  const t = await r.getSigner();
4815
- const o = await Ca(r, e);
4817
+ const o = await Ra(r, e);
4816
4818
  const n = await t.sendTransaction(o);
4817
4819
  return {
4818
4820
  transactionResponse: n
@@ -4877,7 +4879,7 @@ var Ye = async (r, e) => {
4877
4879
  type: "SUCCESS"
4878
4880
  };
4879
4881
  };
4880
- var Vr = async (r, e) => {
4882
+ var jr = async (r, e) => {
4881
4883
  try {
4882
4884
  const t = await (await r.getSigner()).signTypedData(
4883
4885
  e.unsignedMessage.domain,
@@ -4902,9 +4904,9 @@ var Vr = async (r, e) => {
4902
4904
  import {
4903
4905
  TransactionPurpose as Je,
4904
4906
  ActionType as $e,
4905
- SignablePurpose as Ia
4907
+ SignablePurpose as Ta
4906
4908
  } from "@imtbl/orderbook";
4907
- var Kr = async (r) => {
4909
+ var Vr = async (r) => {
4908
4910
  let e = [];
4909
4911
  let t = [];
4910
4912
  const o = [];
@@ -4925,7 +4927,7 @@ var Kr = async (r) => {
4925
4927
  fulfillmentTransactions: t
4926
4928
  };
4927
4929
  };
4928
- var Hr = async (r) => {
4930
+ var Kr = async (r) => {
4929
4931
  let e = [];
4930
4932
  const t = [];
4931
4933
  for (const o of r) {
@@ -4949,11 +4951,11 @@ var Nt = async (r) => {
4949
4951
  e = await Promise.all(t);
4950
4952
  return e;
4951
4953
  };
4952
- var zr = (r, e, t) => {
4954
+ var Hr = (r, e, t) => {
4953
4955
  let o;
4954
4956
  for (const n of t) {
4955
4957
  if (n.type !== $e.SIGNABLE) continue;
4956
- if (n.purpose === Ia.CREATE_LISTING) {
4958
+ if (n.purpose === Ta.CREATE_LISTING) {
4957
4959
  o = {
4958
4960
  domain: n.message.domain,
4959
4961
  types: n.message.types,
@@ -4970,10 +4972,10 @@ var zr = (r, e, t) => {
4970
4972
  };
4971
4973
 
4972
4974
  // src/smartCheckout/fees/fees.ts
4973
- import { parseUnits as ha } from "ethers";
4974
- var Qr = 1;
4975
+ import { parseUnits as Ia } from "ethers";
4976
+ var zr = 1;
4975
4977
  var Xe = 6;
4976
- var Aa = (r, e, t = BigInt(1)) => {
4978
+ var ha = (r, e, t = BigInt(1)) => {
4977
4979
  const o = r.amount;
4978
4980
  const n = Math.round(o.percentageDecimal * 10 ** Xe);
4979
4981
  const a = e * BigInt(n) / BigInt(10 ** Xe);
@@ -4981,18 +4983,18 @@ var Aa = (r, e, t = BigInt(1)) => {
4981
4983
  };
4982
4984
  var ya = (r, e) => {
4983
4985
  const t = r.amount;
4984
- const o = ha(t.token, e);
4986
+ const o = Ia(t.token, e);
4985
4987
  return o;
4986
4988
  };
4987
4989
  var et = (r, e, t = 18, o = BigInt(1)) => {
4988
4990
  let n = BigInt(0);
4989
4991
  const a = BigInt(e);
4990
- const i = a * BigInt(Qr * 10 ** Xe) / BigInt(10 ** Xe);
4992
+ const i = a * BigInt(zr * 10 ** Xe) / BigInt(10 ** Xe);
4991
4993
  const s = [];
4992
4994
  for (const c of r) {
4993
4995
  let p = BigInt(0);
4994
4996
  if (Object.hasOwn(c.amount, "percentageDecimal")) {
4995
- p = Aa(c, a, o);
4997
+ p = ha(c, a, o);
4996
4998
  n += p;
4997
4999
  } else if (Object.hasOwn(c.amount, "token")) {
4998
5000
  p = ya(c, t);
@@ -5005,7 +5007,7 @@ var et = (r, e, t = 18, o = BigInt(1)) => {
5005
5007
  }
5006
5008
  if (n > i) {
5007
5009
  throw new m(
5008
- `The combined fees are above the allowed maximum of ${Qr * 100}%`,
5010
+ `The combined fees are above the allowed maximum of ${zr * 100}%`,
5009
5011
  "ORDER_FEE_ERROR"
5010
5012
  );
5011
5013
  }
@@ -5020,7 +5022,7 @@ var et = (r, e, t = 18, o = BigInt(1)) => {
5020
5022
  };
5021
5023
 
5022
5024
  // src/smartCheckout/buy/buy.ts
5023
- var ka = (r, e, t, o, n = false) => {
5025
+ var Sa = (r, e, t, o, n = false) => {
5024
5026
  switch (r) {
5025
5027
  case "ERC20":
5026
5028
  return {
@@ -5039,7 +5041,7 @@ var ka = (r, e, t, o, n = false) => {
5039
5041
  };
5040
5042
  }
5041
5043
  };
5042
- var va = (r, e) => {
5044
+ var ka = (r, e) => {
5043
5045
  if (e.length > 0) {
5044
5046
  return {
5045
5047
  type: "TRANSACTION",
@@ -5054,10 +5056,10 @@ var va = (r, e) => {
5054
5056
  }
5055
5057
  };
5056
5058
  };
5057
- var Zr = async (r, e, t, o = {
5059
+ var Qr = async (r, e, t, o = {
5058
5060
  waitFulfillmentSettlements: true
5059
5061
  }) => {
5060
- Sa("checkout_sdk", "buy_initiated");
5062
+ Pa("checkout_sdk", "buy_initiated");
5061
5063
  if (t.length === 0) {
5062
5064
  throw new m(
5063
5065
  "No orders were provided to the orders array. Please provide at least one order.",
@@ -5067,8 +5069,8 @@ var Zr = async (r, e, t, o = {
5067
5069
  let n;
5068
5070
  let a = "";
5069
5071
  let i = 18;
5070
- const s = wa.estimatedFulfillmentGasGwei;
5071
- const c = ce(r);
5072
+ const s = Aa.estimatedFulfillmentGasGwei;
5073
+ const c = de(r);
5072
5074
  const p = Le(r);
5073
5075
  const u = await k(
5074
5076
  r,
@@ -5076,8 +5078,8 @@ var Zr = async (r, e, t, o = {
5076
5078
  (await e.getSigner()).getAddress()
5077
5079
  );
5078
5080
  Rt();
5079
- j(r, e, u, _(r));
5080
- j(r, e, u, w(r));
5081
+ V(r, e, u, _(r));
5082
+ V(r, e, u, w(r));
5081
5083
  const { id: g, takerFees: f, fillAmount: R } = t[0];
5082
5084
  let C;
5083
5085
  try {
@@ -5086,8 +5088,8 @@ var Zr = async (r, e, t, o = {
5086
5088
  "Time to fetch the listing from the orderbook",
5087
5089
  c.getListing(g)
5088
5090
  );
5089
- const { seaportContractAddress: N, chainName: te } = c.config();
5090
- C = te;
5091
+ const { seaportContractAddress: N, chainName: re } = c.config();
5092
+ C = re;
5091
5093
  a = N;
5092
5094
  } catch (N) {
5093
5095
  throw new m(
@@ -5123,7 +5125,7 @@ var Zr = async (r, e, t, o = {
5123
5125
  const N = n.result.sell[0].type === "ERC721" ? BigInt(1) : BigInt(n.result.sell[0].amount);
5124
5126
  T = et(f, E.amount, i, N);
5125
5127
  }
5126
- let A = [];
5128
+ let y = [];
5127
5129
  let I = [];
5128
5130
  let P = [];
5129
5131
  const v = performance.now();
@@ -5134,15 +5136,15 @@ var Zr = async (r, e, t, o = {
5134
5136
  c.fulfillOrder(g, u, T, R)
5135
5137
  );
5136
5138
  P = N;
5137
- A = await k(
5139
+ y = await k(
5138
5140
  r,
5139
5141
  "Time to construct the unsigned approval transactions",
5140
- Hr(N)
5142
+ Kr(N)
5141
5143
  );
5142
5144
  } catch (N) {
5143
- const te = (performance.now() - v) / 1e3;
5144
- pt(r, "Time to call fulfillOrder from the orderbook", te);
5145
- if (N.message.includes(Pa.EXPIRED)) {
5145
+ const re = (performance.now() - v) / 1e3;
5146
+ pt(r, "Time to call fulfillOrder from the orderbook", re);
5147
+ if (N.message.includes(wa.EXPIRED)) {
5146
5148
  throw new m("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: g });
5147
5149
  }
5148
5150
  if (!N.message.includes("The fulfiller does not have the balances needed to fulfill")) {
@@ -5166,16 +5168,16 @@ var Zr = async (r, e, t, o = {
5166
5168
  }
5167
5169
  let O = BigInt("0");
5168
5170
  let Q = "NATIVE";
5169
- let pe = "";
5170
- const ee = n.result.buy;
5171
- if (ee.length > 0) {
5172
- switch (ee[0].type) {
5171
+ let ue = "";
5172
+ const te = n.result.buy;
5173
+ if (te.length > 0) {
5174
+ switch (te[0].type) {
5173
5175
  case "NATIVE":
5174
5176
  Q = "NATIVE";
5175
5177
  break;
5176
5178
  case "ERC20":
5177
5179
  Q = "ERC20";
5178
- pe = ee[0].contractAddress;
5180
+ ue = te[0].contractAddress;
5179
5181
  break;
5180
5182
  default:
5181
5183
  throw new m(
@@ -5187,7 +5189,7 @@ var Zr = async (r, e, t, o = {
5187
5189
  );
5188
5190
  }
5189
5191
  }
5190
- ee.forEach((N) => {
5192
+ te.forEach((N) => {
5191
5193
  if (N.type !== "ERC721") {
5192
5194
  O += BigInt(N.amount);
5193
5195
  }
@@ -5200,86 +5202,86 @@ var Zr = async (r, e, t, o = {
5200
5202
  O = O * BigInt(R) / BigInt(n.result.sell[0].amount);
5201
5203
  }
5202
5204
  const rt = [
5203
- ka(Q, pe, O, a)
5205
+ Sa(Q, ue, O, a)
5204
5206
  ];
5205
- const V = await k(
5207
+ const K = await k(
5206
5208
  r,
5207
5209
  "Total time running smart checkout",
5208
- le(
5210
+ pe(
5209
5211
  r,
5210
5212
  e,
5211
5213
  rt,
5212
- va(
5214
+ ka(
5213
5215
  s,
5214
5216
  I
5215
5217
  )
5216
5218
  )
5217
5219
  );
5218
- if (V.sufficient) {
5219
- const N = await Ze(e, A);
5220
+ if (K.sufficient) {
5221
+ const N = await Ze(e, y);
5220
5222
  if (N.type === "FAILED") {
5221
5223
  return {
5222
5224
  status: "FAILED",
5223
5225
  transactionHash: N.transactionHash,
5224
5226
  reason: N.reason,
5225
- smartCheckoutResult: V
5227
+ smartCheckoutResult: K
5226
5228
  };
5227
5229
  }
5228
5230
  try {
5229
5231
  if (I.length === 0) {
5230
5232
  I = await Nt(P);
5231
5233
  }
5232
- } catch (K) {
5234
+ } catch (H) {
5233
5235
  throw new m(
5234
5236
  "Error fetching fulfillment transaction",
5235
5237
  "FULFILL_ORDER_LISTING_ERROR",
5236
- { error: K }
5238
+ { error: H }
5237
5239
  );
5238
5240
  }
5239
5241
  if (o.waitFulfillmentSettlements) {
5240
- const K = await Ye(e, I);
5241
- if (K.type === "FAILED") {
5242
+ const H = await Ye(e, I);
5243
+ if (H.type === "FAILED") {
5242
5244
  return {
5243
5245
  status: "FAILED",
5244
- transactionHash: K.transactionHash,
5245
- reason: K.reason,
5246
- smartCheckoutResult: V
5246
+ transactionHash: H.transactionHash,
5247
+ reason: H.reason,
5248
+ smartCheckoutResult: K
5247
5249
  };
5248
5250
  }
5249
5251
  return {
5250
5252
  status: "SUCCESS",
5251
- smartCheckoutResult: V
5253
+ smartCheckoutResult: K
5252
5254
  };
5253
5255
  }
5254
- let te;
5256
+ let re;
5255
5257
  try {
5256
- const K = await Promise.all(I.map(
5258
+ const H = await Promise.all(I.map(
5257
5259
  (ot) => U(e, ot)
5258
5260
  ));
5259
- te = K.map((ot) => ot.transactionResponse);
5260
- } catch (K) {
5261
+ re = H.map((ot) => ot.transactionResponse);
5262
+ } catch (H) {
5261
5263
  throw new m(
5262
5264
  "An error occurred while executing the fulfillment transaction",
5263
5265
  "EXECUTE_FULFILLMENT_TRANSACTION_ERROR",
5264
5266
  {
5265
- message: K.message
5267
+ message: H.message
5266
5268
  }
5267
5269
  );
5268
5270
  }
5269
5271
  return {
5270
5272
  status: "FULFILLMENTS_UNSETTLED",
5271
- smartCheckoutResult: V,
5272
- transactions: te
5273
+ smartCheckoutResult: K,
5274
+ transactions: re
5273
5275
  };
5274
5276
  }
5275
5277
  return {
5276
5278
  status: "INSUFFICIENT_FUNDS",
5277
- smartCheckoutResult: V
5279
+ smartCheckoutResult: K
5278
5280
  };
5279
5281
  };
5280
5282
 
5281
5283
  // src/smartCheckout/cancel/cancel.ts
5282
- var _a = async (r, e, t, o, n) => {
5284
+ var Na = async (r, e, t, o, n) => {
5283
5285
  let a;
5284
5286
  if (o.length === 0) {
5285
5287
  throw new m(
@@ -5346,7 +5348,7 @@ var _a = async (r, e, t, o, n) => {
5346
5348
  transactions: s
5347
5349
  };
5348
5350
  };
5349
- var Oa = async (r, e, t) => {
5351
+ var _a = async (r, e, t) => {
5350
5352
  try {
5351
5353
  const o = await e.getSigner();
5352
5354
  const n = await o.getAddress();
@@ -5392,15 +5394,15 @@ var Oa = async (r, e, t) => {
5392
5394
  );
5393
5395
  }
5394
5396
  };
5395
- var Yr = async (r, e, t, o = {
5397
+ var Zr = async (r, e, t, o = {
5396
5398
  waitFulfillmentSettlements: true,
5397
5399
  useGaslessCancel: false
5398
5400
  }) => {
5399
- const n = ce(r);
5401
+ const n = de(r);
5400
5402
  if (o.useGaslessCancel) {
5401
- return await Oa(n, e, t);
5403
+ return await _a(n, e, t);
5402
5404
  }
5403
- return await _a(
5405
+ return await Na(
5404
5406
  r,
5405
5407
  n,
5406
5408
  e,
@@ -5410,13 +5412,13 @@ var Yr = async (r, e, t, o = {
5410
5412
  };
5411
5413
 
5412
5414
  // src/smartCheckout/itemRequirements/itemRequirements.ts
5413
- import { parseUnits as Jr } from "ethers";
5414
- async function $r(r, e) {
5415
+ import { parseUnits as Yr } from "ethers";
5416
+ async function Jr(r, e) {
5415
5417
  const t = [];
5416
5418
  e.forEach((a) => {
5417
5419
  if (a.type === "ERC20") {
5418
5420
  const { tokenAddress: i } = a;
5419
- t.push(ar(i, W, r).decimals());
5421
+ t.push(nr(i, W, r).decimals());
5420
5422
  }
5421
5423
  });
5422
5424
  const o = await Promise.all(t);
@@ -5424,13 +5426,13 @@ async function $r(r, e) {
5424
5426
  if (a.type === "NATIVE") {
5425
5427
  return {
5426
5428
  ...a,
5427
- amount: Jr(a.amount, 18)
5429
+ amount: Yr(a.amount, 18)
5428
5430
  };
5429
5431
  }
5430
5432
  if (a.type === "ERC20") {
5431
5433
  return {
5432
5434
  ...a,
5433
- amount: Jr(a.amount, o[i])
5435
+ amount: Yr(a.amount, o[i])
5434
5436
  };
5435
5437
  }
5436
5438
  return a;
@@ -5439,26 +5441,26 @@ async function $r(r, e) {
5439
5441
  }
5440
5442
 
5441
5443
  // src/smartCheckout/sell/sell.ts
5442
- import { Contract as Ba, parseUnits as Ma } from "ethers";
5444
+ import { Contract as xa, parseUnits as Ba } from "ethers";
5443
5445
  import {
5444
- constants as ba
5446
+ constants as Ma
5445
5447
  } from "@imtbl/orderbook";
5446
- import { track as La } from "@imtbl/metrics";
5447
- var Da = (r, e, t) => ({
5448
+ import { track as ba } from "@imtbl/metrics";
5449
+ var La = (r, e, t) => ({
5448
5450
  type: "ERC721",
5449
5451
  id: r,
5450
5452
  contractAddress: e,
5451
5453
  spenderAddress: t
5452
5454
  });
5453
- var Wa = (r, e, t, o) => ({
5455
+ var Da = (r, e, t, o) => ({
5454
5456
  type: "ERC1155",
5455
5457
  id: r,
5456
5458
  contractAddress: e,
5457
5459
  spenderAddress: t,
5458
5460
  amount: BigInt(o)
5459
5461
  });
5460
- var Fa = (r, e = 18) => {
5461
- const t = Ma(r.amount, e);
5462
+ var Wa = (r, e = 18) => {
5463
+ const t = Ba(r.amount, e);
5462
5464
  if (r.type === "NATIVE") {
5463
5465
  return {
5464
5466
  type: "NATIVE",
@@ -5471,11 +5473,11 @@ var Fa = (r, e = 18) => {
5471
5473
  contractAddress: r.tokenAddress
5472
5474
  };
5473
5475
  };
5474
- var Xr = async (r, e, t) => {
5476
+ var $r = async (r, e, t) => {
5475
5477
  let o;
5476
5478
  let n;
5477
5479
  let a = "";
5478
- La("checkout_sdk", "sell_initiated");
5480
+ ba("checkout_sdk", "sell_initiated");
5479
5481
  if (t.length === 0) {
5480
5482
  throw new m(
5481
5483
  "No orders were provided to the orders array. Please provide at least one order.",
@@ -5490,7 +5492,7 @@ var Xr = async (r, e, t) => {
5490
5492
  } = t[0];
5491
5493
  let u = 18;
5492
5494
  if (i.type === "ERC20") {
5493
- const E = new Ba(
5495
+ const E = new xa(
5494
5496
  i.tokenAddress,
5495
5497
  JSON.stringify(W),
5496
5498
  e
@@ -5501,7 +5503,7 @@ var Xr = async (r, e, t) => {
5501
5503
  E.decimals()
5502
5504
  );
5503
5505
  }
5504
- const g = Fa(i, u);
5506
+ const g = Wa(i, u);
5505
5507
  const f = "type" in s;
5506
5508
  try {
5507
5509
  const E = await k(
@@ -5509,10 +5511,10 @@ var Xr = async (r, e, t) => {
5509
5511
  "Time to get the address from the provider",
5510
5512
  (await e.getSigner()).getAddress()
5511
5513
  );
5512
- o = ce(r);
5514
+ o = de(r);
5513
5515
  const { seaportContractAddress: T } = o.config();
5514
5516
  a = T;
5515
- const A = f && s.type === "ERC1155" ? {
5517
+ const y = f && s.type === "ERC1155" ? {
5516
5518
  type: "ERC1155",
5517
5519
  contractAddress: s.collectionAddress,
5518
5520
  tokenId: s.id,
@@ -5528,7 +5530,7 @@ var Xr = async (r, e, t) => {
5528
5530
  o.prepareListing({
5529
5531
  makerAddress: E,
5530
5532
  buy: g,
5531
- sell: A,
5533
+ sell: y,
5532
5534
  orderExpiry: p
5533
5535
  })
5534
5536
  );
@@ -5545,7 +5547,7 @@ var Xr = async (r, e, t) => {
5545
5547
  }
5546
5548
  const R = [];
5547
5549
  if (f && s.type === "ERC1155") {
5548
- const E = Wa(
5550
+ const E = Da(
5549
5551
  s.id,
5550
5552
  s.collectionAddress,
5551
5553
  a,
@@ -5553,15 +5555,15 @@ var Xr = async (r, e, t) => {
5553
5555
  );
5554
5556
  R.push(E);
5555
5557
  } else {
5556
- const E = Da(s.id, s.collectionAddress, a);
5558
+ const E = La(s.id, s.collectionAddress, a);
5557
5559
  R.push(E);
5558
5560
  }
5559
5561
  let C;
5560
- if (!yt(e)) {
5562
+ if (!At(e)) {
5561
5563
  C = await k(
5562
5564
  r,
5563
5565
  "Total time running smart checkout",
5564
- le(
5566
+ pe(
5565
5567
  r,
5566
5568
  e,
5567
5569
  R,
@@ -5569,7 +5571,7 @@ var Xr = async (r, e, t) => {
5569
5571
  type: "GAS",
5570
5572
  gasToken: {
5571
5573
  type: "NATIVE",
5572
- limit: BigInt(ba.estimatedFulfillmentGasGwei)
5574
+ limit: BigInt(Ma.estimatedFulfillmentGasGwei)
5573
5575
  }
5574
5576
  }
5575
5577
  )
@@ -5578,7 +5580,7 @@ var Xr = async (r, e, t) => {
5578
5580
  C = { sufficient: true, transactionRequirements: [] };
5579
5581
  }
5580
5582
  if (C.sufficient) {
5581
- const E = await Kr(n.actions);
5583
+ const E = await Vr(n.actions);
5582
5584
  const T = await Ze(e, E.approvalTransactions);
5583
5585
  if (T.type === "FAILED") {
5584
5586
  return {
@@ -5588,12 +5590,12 @@ var Xr = async (r, e, t) => {
5588
5590
  smartCheckoutResult: C
5589
5591
  };
5590
5592
  }
5591
- const A = zr(
5593
+ const y = Hr(
5592
5594
  n.orderHash,
5593
5595
  n.orderComponents,
5594
5596
  n.actions
5595
5597
  );
5596
- if (!A) {
5598
+ if (!y) {
5597
5599
  throw new m(
5598
5600
  "The unsigned message is missing after preparing the listing",
5599
5601
  "SIGN_MESSAGE_ERROR",
@@ -5603,9 +5605,9 @@ var Xr = async (r, e, t) => {
5603
5605
  }
5604
5606
  );
5605
5607
  }
5606
- const I = await Vr(
5608
+ const I = await jr(
5607
5609
  e,
5608
- A
5610
+ y
5609
5611
  );
5610
5612
  let P = "";
5611
5613
  const v = {
@@ -5653,7 +5655,7 @@ var Xr = async (r, e, t) => {
5653
5655
  };
5654
5656
 
5655
5657
  // src/swap/swap.ts
5656
- import { parseUnits as eo } from "ethers";
5658
+ import { parseUnits as Xr } from "ethers";
5657
5659
  var _t = async (r, e, t, o, n, a, i, s, c) => {
5658
5660
  if (!t.address || t.decimals === 0) {
5659
5661
  throw new m(
@@ -5680,14 +5682,14 @@ var _t = async (r, e, t, o, n, a, i, s, c) => {
5680
5682
  );
5681
5683
  }
5682
5684
  const p = w(r);
5683
- const u = await se(p, r);
5685
+ const u = await ce(p, r);
5684
5686
  const g = await (await e.getSigner()).getAddress();
5685
5687
  if (n) {
5686
5688
  return u.getUnsignedSwapTxFromAmountIn(
5687
5689
  g,
5688
5690
  t.address,
5689
5691
  o.address,
5690
- BigInt(eo(n, t.decimals)),
5692
+ BigInt(Xr(n, t.decimals)),
5691
5693
  i,
5692
5694
  s,
5693
5695
  c
@@ -5697,13 +5699,13 @@ var _t = async (r, e, t, o, n, a, i, s, c) => {
5697
5699
  g,
5698
5700
  t.address,
5699
5701
  o.address,
5700
- BigInt(eo(a, o.decimals)),
5702
+ BigInt(Xr(a, o.decimals)),
5701
5703
  i,
5702
5704
  s,
5703
5705
  c
5704
5706
  );
5705
5707
  };
5706
- var to = async (r, e, t, o, n, a, i, s, c) => {
5708
+ var eo = async (r, e, t, o, n, a, i, s, c) => {
5707
5709
  const p = await _t(
5708
5710
  r,
5709
5711
  e,
@@ -5741,7 +5743,7 @@ var to = async (r, e, t, o, n, a, i, s, c) => {
5741
5743
  };
5742
5744
 
5743
5745
  // src/wallet/wallet.ts
5744
- async function ro(r) {
5746
+ async function to(r) {
5745
5747
  const e = [];
5746
5748
  const t = r.exclude?.map((n) => n.walletProviderName) ?? [];
5747
5749
  let o = Object.values(fe);
@@ -5765,13 +5767,13 @@ var Ot = async (r, e) => Object.fromEntries(
5765
5767
 
5766
5768
  // src/riskAssessment/common.ts
5767
5769
  var xt = (r, e) => false;
5768
- var ja = (r, e) => false;
5769
- var Va = (r) => false;
5770
+ var qa = (r, e) => false;
5771
+ var ja = (r) => false;
5770
5772
 
5771
5773
  // src/sdk.ts
5772
- var Ha = {
5774
+ var Ka = {
5773
5775
  baseConfig: {
5774
- environment: Ka.SANDBOX
5776
+ environment: Va.SANDBOX
5775
5777
  },
5776
5778
  passport: void 0
5777
5779
  };
@@ -5786,9 +5788,9 @@ var Bt = class {
5786
5788
  * Constructs a new instance of the CheckoutModule class.
5787
5789
  * @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
5788
5790
  */
5789
- constructor(e = Ha) {
5790
- this.httpClient = new ue(e);
5791
- this.config = new Ae(e, this.httpClient);
5791
+ constructor(e = Ka) {
5792
+ this.httpClient = new Y(e);
5793
+ this.config = new ye(e, this.httpClient);
5792
5794
  this.fiatRampService = new Me(this.config);
5793
5795
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5794
5796
  this.availability = Ne(
@@ -5832,7 +5834,7 @@ var Bt = class {
5832
5834
  * @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
5833
5835
  */
5834
5836
  async createProvider(e) {
5835
- return await cr(
5837
+ return await sr(
5836
5838
  e.walletProviderName,
5837
5839
  this.passport
5838
5840
  );
@@ -5881,7 +5883,7 @@ var Bt = class {
5881
5883
  allowUnsupportedProvider: true
5882
5884
  }
5883
5885
  );
5884
- return Xt(t);
5886
+ return $t(t);
5885
5887
  }
5886
5888
  /**
5887
5889
  * Fetches the risk assessment for the given addresses.
@@ -5918,9 +5920,9 @@ var Bt = class {
5918
5920
  }
5919
5921
  );
5920
5922
  if (e.requestWalletPermissions && !St(t)) {
5921
- await tr(t);
5922
- } else {
5923
5923
  await er(t);
5924
+ } else {
5925
+ await Xt(t);
5924
5926
  }
5925
5927
  return t;
5926
5928
  }
@@ -5960,7 +5962,7 @@ var Bt = class {
5960
5962
  allowMistmatchedChainId: true
5961
5963
  }
5962
5964
  );
5963
- const o = await zt(
5965
+ const o = await Ht(
5964
5966
  this.config,
5965
5967
  t,
5966
5968
  e.chainId
@@ -6006,7 +6008,7 @@ var Bt = class {
6006
6008
  */
6007
6009
  async getAllBalances(e) {
6008
6010
  const t = !e.provider || "ethereumProvider" in e.provider ? e.provider : new D(e.provider);
6009
- return j(
6011
+ return V(
6010
6012
  this.config,
6011
6013
  t,
6012
6014
  e.walletAddress,
@@ -6019,7 +6021,7 @@ var Bt = class {
6019
6021
  * @returns {Promise<GetNetworkAllowListResult>} - A promise that resolves to the network allow list result.
6020
6022
  */
6021
6023
  async getNetworkAllowList(e) {
6022
- return await $(this.config, e);
6024
+ return await X(this.config, e);
6023
6025
  }
6024
6026
  /**
6025
6027
  * Retrieves the supported tokens based on the provided parameters.
@@ -6035,7 +6037,7 @@ var Bt = class {
6035
6037
  * @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
6036
6038
  */
6037
6039
  async getWalletAllowList(e) {
6038
- return await ro(e);
6040
+ return await to(e);
6039
6041
  }
6040
6042
  /**
6041
6043
  * Sends a transaction using the specified provider and transaction parameters.
@@ -6107,7 +6109,7 @@ var Bt = class {
6107
6109
  this.config,
6108
6110
  e.provider
6109
6111
  );
6110
- return await Zr(
6112
+ return await Qr(
6111
6113
  this.config,
6112
6114
  t,
6113
6115
  e.orders,
@@ -6133,7 +6135,7 @@ var Bt = class {
6133
6135
  this.config,
6134
6136
  e.provider
6135
6137
  );
6136
- return await Xr(this.config, t, e.orders);
6138
+ return await $r(this.config, t, e.orders);
6137
6139
  }
6138
6140
  /**
6139
6141
  * Cancels a sell.
@@ -6149,7 +6151,7 @@ var Bt = class {
6149
6151
  this.config,
6150
6152
  e.provider
6151
6153
  );
6152
- return await Yr(
6154
+ return await Zr(
6153
6155
  this.config,
6154
6156
  t,
6155
6157
  e.orderIds,
@@ -6175,7 +6177,7 @@ var Bt = class {
6175
6177
  );
6176
6178
  let o = [];
6177
6179
  try {
6178
- o = await $r(
6180
+ o = await Jr(
6179
6181
  t,
6180
6182
  e.itemRequirements
6181
6183
  );
@@ -6186,7 +6188,7 @@ var Bt = class {
6186
6188
  { error: n }
6187
6189
  );
6188
6190
  }
6189
- return await le(
6191
+ return await pe(
6190
6192
  this.config,
6191
6193
  t,
6192
6194
  o,
@@ -6203,7 +6205,7 @@ var Bt = class {
6203
6205
  * @returns {boolean} - True if the object is a WrappedBrowserProvider, false otherwise.
6204
6206
  */
6205
6207
  static isWrappedBrowserProvider(e) {
6206
- return dr(e);
6208
+ return cr(e);
6207
6209
  }
6208
6210
  /**
6209
6211
  * Estimates the gas required for a swap or bridge transaction.
@@ -6215,7 +6217,7 @@ var Bt = class {
6215
6217
  this.config,
6216
6218
  this.readOnlyProviders
6217
6219
  );
6218
- return await sr(
6220
+ return await ir(
6219
6221
  e,
6220
6222
  this.readOnlyProviders,
6221
6223
  this.config
@@ -6282,7 +6284,7 @@ var Bt = class {
6282
6284
  this.config,
6283
6285
  e.provider
6284
6286
  );
6285
- return to(
6287
+ return eo(
6286
6288
  this.config,
6287
6289
  t,
6288
6290
  e.fromToken,
@@ -6327,67 +6329,67 @@ var tt = class {
6327
6329
  * @returns {string | undefined} The URL to view the transaction on Blockscout, or undefined if the chain ID or hash is invalid
6328
6330
  */
6329
6331
  static getTransactionLink(e, t) {
6330
- const o = oe?.[e]?.url;
6332
+ const o = ne?.[e]?.url;
6331
6333
  if (!o || !t) return void 0;
6332
6334
  return `${o}/tx/${t}`;
6333
6335
  }
6334
6336
  };
6335
6337
  export {
6336
- Co as AddTokensEventType,
6338
+ Ro as AddTokensEventType,
6337
6339
  tt as BlockExplorerService,
6338
- po as BridgeEventType,
6339
- Y as ChainId,
6340
+ lo as BridgeEventType,
6341
+ J as ChainId,
6340
6342
  nt as ChainName,
6341
6343
  we as ChainSlug,
6342
6344
  Bt as Checkout,
6343
- Ae as CheckoutConfiguration,
6345
+ ye as CheckoutConfiguration,
6344
6346
  m as CheckoutError,
6345
6347
  S as CheckoutErrorType,
6346
6348
  Ee as CheckoutStatus,
6347
- go as CommerceEventType,
6348
- Eo as CommerceFailureEventType,
6349
- wo as CommerceFlowType,
6350
- fo as CommerceSuccessEventType,
6351
- Ro as CommerceUserActionEventType,
6352
- ao as ConnectEventType,
6353
- Ao as ConnectTargetLayer,
6354
- Vt as ExchangeType,
6349
+ mo as CommerceEventType,
6350
+ fo as CommerceFailureEventType,
6351
+ Ao as CommerceFlowType,
6352
+ go as CommerceSuccessEventType,
6353
+ Eo as CommerceUserActionEventType,
6354
+ no as ConnectEventType,
6355
+ ho as ConnectTargetLayer,
6356
+ jt as ExchangeType,
6355
6357
  _e as FeeType,
6356
6358
  Te as FundingStepType,
6357
6359
  st as GasEstimateType,
6358
6360
  Ce as GasTokenType,
6359
- H as IMMUTABLE_API_BASE_URL,
6360
- oo as IMTBLWidgetEvents,
6361
+ q as IMMUTABLE_API_BASE_URL,
6362
+ ro as IMTBLWidgetEvents,
6361
6363
  M as ItemType,
6362
6364
  ge as NetworkFilterTypes,
6363
- mo as OnRampEventType,
6364
- uo as OrchestrationEventType,
6365
- no as ProviderEventType,
6366
- To as PurchaseEventType,
6365
+ uo as OnRampEventType,
6366
+ po as OrchestrationEventType,
6367
+ oo as ProviderEventType,
6368
+ Co as PurchaseEventType,
6367
6369
  ct as RoutingOutcomeType,
6368
- co as SaleEventType,
6369
- lo as SalePaymentTypes,
6370
+ so as SaleEventType,
6371
+ co as SalePaymentTypes,
6370
6372
  yo as SwapDirection,
6371
- so as SwapEventType,
6372
- ae as TokenFilterTypes,
6373
+ io as SwapEventType,
6374
+ ie as TokenFilterTypes,
6373
6375
  Re as TransactionOrGasType,
6374
- Io as TransferEventType,
6375
- io as WalletEventType,
6376
- Gt as WalletFilterTypes,
6376
+ To as TransferEventType,
6377
+ ao as WalletEventType,
6378
+ Ut as WalletFilterTypes,
6377
6379
  fe as WalletProviderName,
6378
- qt as WalletProviderRdns,
6379
- Po as WidgetTheme,
6380
- ho as WidgetType,
6380
+ Gt as WalletProviderRdns,
6381
+ wo as WidgetTheme,
6382
+ Io as WidgetType,
6381
6383
  D as WrappedBrowserProvider,
6382
6384
  Ot as fetchRiskAssessment,
6383
6385
  Ct as getGasPriceInWei,
6384
- fn as getMetaMaskProviderDetail,
6385
- gn as getPassportProviderDetail,
6386
+ gn as getMetaMaskProviderDetail,
6387
+ mn as getPassportProviderDetail,
6386
6388
  Ie as getUnderlyingChainId,
6387
6389
  xt as isAddressSanctioned,
6388
- ja as isSingleAddressSanctioned,
6390
+ qa as isSingleAddressSanctioned,
6389
6391
  De as metaMaskProviderInfo,
6390
6392
  We as passportProviderInfo,
6391
- Va as resultHasSanctionedWallets,
6393
+ ja as resultHasSanctionedWallets,
6392
6394
  b as validateProvider
6393
6395
  };