@imtbl/checkout-sdk 2.10.3 → 2.10.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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.0";
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,72 @@ 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: "0D0D0D",
1897
+ default_crypto_currency: e.tokenSymbol || "IMX",
1898
+ hide_menu: !(e.showMenu ?? true)
1899
1899
  };
1900
1900
  if (e.isPassport && e.email) {
1901
- n = {
1902
- ...n,
1903
- email: encodeURIComponent(e.email),
1904
- isAutoFillUserData: true,
1905
- disableWalletAddressForm: true
1901
+ a = {
1902
+ ...a,
1903
+ email: e.email,
1904
+ is_auto_fill_user_data: true,
1905
+ disable_wallet_address_form: true
1906
1906
  };
1907
1907
  }
1908
1908
  if (e.tokenAmount && e.tokenSymbol) {
1909
- n = {
1910
- ...n,
1911
- defaultCryptoAmount: e.tokenAmount,
1912
- cryptoCurrencyCode: e.tokenSymbol
1909
+ a = {
1910
+ ...a,
1911
+ default_crypto_amount: e.tokenAmount,
1912
+ crypto_currency_code: e.tokenSymbol
1913
1913
  };
1914
1914
  } else {
1915
- n = {
1916
- ...n,
1917
- defaultFiatAmount: 50,
1918
- defaultFiatCurrency: "usd"
1915
+ a = {
1916
+ ...a,
1917
+ default_fiat_amount: 50,
1918
+ default_fiat_currency: "usd"
1919
1919
  };
1920
1920
  }
1921
1921
  if (e.walletAddress) {
1922
- n = {
1923
- ...n,
1924
- walletAddress: e.walletAddress
1922
+ a = {
1923
+ ...a,
1924
+ wallet_address: e.walletAddress
1925
1925
  };
1926
1926
  }
1927
1927
  if (e.allowedTokens) {
1928
- n = {
1929
- ...n,
1930
- cryptoCurrencyList: e.allowedTokens?.join(",").toLowerCase()
1928
+ a = {
1929
+ ...a,
1930
+ crypto_currency_list: e.allowedTokens?.join(",").toLowerCase()
1931
1931
  };
1932
1932
  }
1933
- return `${o}?${new URLSearchParams(n).toString()}`;
1933
+ const i = await t.post(n, a, { method: "POST" });
1934
+ return i.data.url;
1934
1935
  }
1935
1936
  };
1936
1937
 
1937
1938
  // src/gasEstimate/gasEstimator.ts
1938
- import { parseUnits as cn } from "ethers";
1939
+ import { parseUnits as sn } from "ethers";
1939
1940
 
1940
1941
  // src/gasEstimate/bridgeGasEstimate.ts
1941
1942
  import {
1942
- BridgeFeeActions as rr
1943
+ BridgeFeeActions as tr
1943
1944
  } from "@imtbl/bridge-sdk";
1944
- async function or(r, e, t, o) {
1945
- const n = e === _(o) ? rr.DEPOSIT : rr.WITHDRAW;
1945
+ async function rr(r, e, t, o) {
1946
+ const n = e === _(o) ? tr.DEPOSIT : tr.WITHDRAW;
1946
1947
  return await r.getFee({
1947
1948
  action: n,
1948
1949
  gasMultiplier: "auto",
@@ -1955,16 +1956,16 @@ async function or(r, e, t, o) {
1955
1956
 
1956
1957
  // src/instance/instance.ts
1957
1958
  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
1959
+ BridgeConfiguration as Jo,
1960
+ ETH_MAINNET_TO_ZKEVM_MAINNET as $o,
1961
+ ETH_SEPOLIA_TO_ZKEVM_DEVNET as Xo,
1962
+ ETH_SEPOLIA_TO_ZKEVM_TESTNET as en,
1963
+ TokenBridge as tn
1963
1964
  } 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";
1965
+ import { ImmutableConfiguration as or } from "@imtbl/config";
1966
+ import { Exchange as rn } from "@imtbl/dex-sdk";
1967
+ import { Orderbook as on } from "@imtbl/orderbook";
1968
+ import { BlockchainData as nn } from "@imtbl/blockchain-data";
1968
1969
  function be(r, e, t, o) {
1969
1970
  const n = t.get(r);
1970
1971
  const a = t.get(e);
@@ -1980,39 +1981,39 @@ function be(r, e, t, o) {
1980
1981
  "CHAIN_NOT_SUPPORTED_ERROR"
1981
1982
  );
1982
1983
  }
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 }),
1984
+ let i = en;
1985
+ if (o.isDevelopment) i = Xo;
1986
+ if (o.isProduction) i = $o;
1987
+ const s = new Jo({
1988
+ baseConfig: new or({ environment: o.environment }),
1988
1989
  bridgeInstance: i,
1989
1990
  rootProvider: n,
1990
1991
  childProvider: a
1991
1992
  });
1992
- return new rn(s);
1993
+ return new tn(s);
1993
1994
  }
1994
- async function se(r, e) {
1995
+ async function ce(r, e) {
1995
1996
  const t = await e.remote.getConfig(
1996
1997
  "dex"
1997
1998
  );
1998
- return new on({
1999
+ return new rn({
1999
2000
  chainId: r,
2000
- baseConfig: new nr({
2001
+ baseConfig: new or({
2001
2002
  environment: e.environment
2002
2003
  }),
2003
2004
  overrides: t?.overrides,
2004
2005
  secondaryFees: t?.secondaryFees
2005
2006
  });
2006
2007
  }
2007
- function ce(r) {
2008
- return new nn({
2008
+ function de(r) {
2009
+ return new on({
2009
2010
  baseConfig: {
2010
2011
  environment: r.environment
2011
2012
  }
2012
2013
  });
2013
2014
  }
2014
2015
  function Le(r) {
2015
- return new an({
2016
+ return new nn({
2016
2017
  baseConfig: {
2017
2018
  environment: r.environment
2018
2019
  }
@@ -2021,16 +2022,16 @@ function Le(r) {
2021
2022
 
2022
2023
  // src/instance/contract.ts
2023
2024
  import {
2024
- Contract as sn
2025
+ Contract as an
2025
2026
  } from "ethers";
2026
- function ar(r, e, t) {
2027
- return new sn(r, e, t);
2027
+ function nr(r, e, t) {
2028
+ return new an(r, e, t);
2028
2029
  }
2029
2030
 
2030
2031
  // src/gasEstimate/gasEstimator.ts
2031
- var dn = "0x0000000000000000000000000000000000000001";
2032
- var ir = 18;
2033
- async function ln(r, e) {
2032
+ var cn = "0x0000000000000000000000000000000000000001";
2033
+ var ar = 18;
2034
+ async function dn(r, e) {
2034
2035
  const t = _(e);
2035
2036
  const o = w(e);
2036
2037
  const n = r.get(t);
@@ -2042,7 +2043,7 @@ async function ln(r, e) {
2042
2043
  r,
2043
2044
  e
2044
2045
  );
2045
- const i = await or(
2046
+ const i = await rr(
2046
2047
  a,
2047
2048
  t,
2048
2049
  o,
@@ -2067,19 +2068,19 @@ async function ln(r, e) {
2067
2068
  };
2068
2069
  }
2069
2070
  }
2070
- async function pn(r) {
2071
+ async function ln(r) {
2071
2072
  const e = w(r);
2072
2073
  const t = await r.remote.getConfig(
2073
2074
  "gasEstimateTokens"
2074
2075
  );
2075
2076
  const { inAddress: o, outAddress: n } = t[e].swapAddresses;
2076
2077
  try {
2077
- const a = await se(e, r);
2078
+ const a = await ce(e, r);
2078
2079
  const { swap: i } = await a.getUnsignedSwapTxFromAmountIn(
2079
- dn,
2080
+ cn,
2080
2081
  o,
2081
2082
  n,
2082
- BigInt(cn("1", ir))
2083
+ BigInt(sn("1", ar))
2083
2084
  );
2084
2085
  if (!i.gasFeeEstimate) {
2085
2086
  return {
@@ -2095,7 +2096,7 @@ async function pn(r) {
2095
2096
  address: i.gasFeeEstimate.token.address,
2096
2097
  symbol: i.gasFeeEstimate.token.symbol ?? "",
2097
2098
  name: i.gasFeeEstimate.token.name ?? "",
2098
- decimals: i.gasFeeEstimate.token.decimals ?? ir
2099
+ decimals: i.gasFeeEstimate.token.decimals ?? ar
2099
2100
  }
2100
2101
  }
2101
2102
  };
@@ -2106,15 +2107,15 @@ async function pn(r) {
2106
2107
  };
2107
2108
  }
2108
2109
  }
2109
- async function sr(r, e, t) {
2110
+ async function ir(r, e, t) {
2110
2111
  switch (r.gasEstimateType) {
2111
2112
  case "BRIDGE_TO_L2":
2112
- return await ln(
2113
+ return await dn(
2113
2114
  e,
2114
2115
  t
2115
2116
  );
2116
2117
  case "SWAP":
2117
- return await pn(t);
2118
+ return await ln(t);
2118
2119
  default:
2119
2120
  throw new m(
2120
2121
  "Invalid type provided for gasEstimateType",
@@ -2124,9 +2125,9 @@ async function sr(r, e, t) {
2124
2125
  }
2125
2126
 
2126
2127
  // src/gasEstimate/gasPriceInWei.ts
2127
- var un = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2128
+ var pn = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
2128
2129
  var Ct = (r) => {
2129
- if (un(r)) {
2130
+ if (pn(r)) {
2130
2131
  const { maxFeePerGas: e, maxPriorityFeePerGas: t } = r;
2131
2132
  if (e === null || t === null) return null;
2132
2133
  const o = (e - t) / BigInt(2);
@@ -2137,7 +2138,7 @@ var Ct = (r) => {
2137
2138
  };
2138
2139
 
2139
2140
  // src/provider/provider.ts
2140
- import En from "@metamask/detect-provider";
2141
+ import fn from "@metamask/detect-provider";
2141
2142
 
2142
2143
  // src/provider/injected/utils.ts
2143
2144
  function Tt(r) {
@@ -2259,19 +2260,19 @@ var We = {
2259
2260
  rdns: "com.immutable.passport",
2260
2261
  uuid: "b90118be-7234-4c89-b89b-d5d267663eb5"
2261
2262
  };
2262
- var gn = (r) => ({
2263
+ var mn = (r) => ({
2263
2264
  info: We,
2264
2265
  provider: r
2265
2266
  });
2266
- var fn = (r) => ({
2267
+ var gn = (r) => ({
2267
2268
  info: De,
2268
2269
  provider: r
2269
2270
  });
2270
2271
 
2271
2272
  // src/provider/provider.ts
2272
- async function Rn() {
2273
+ async function En() {
2273
2274
  const r = await L(
2274
- async () => await En(),
2275
+ async () => await fn(),
2275
2276
  { type: "METAMASK_PROVIDER_ERROR" }
2276
2277
  );
2277
2278
  if (!r || !r.request) {
@@ -2282,7 +2283,7 @@ async function Rn() {
2282
2283
  }
2283
2284
  return new D(r);
2284
2285
  }
2285
- async function cr(r, e) {
2286
+ async function sr(r, e) {
2286
2287
  let t = null;
2287
2288
  let o;
2288
2289
  switch (r) {
@@ -2308,7 +2309,7 @@ async function cr(r, e) {
2308
2309
  case "metamask": {
2309
2310
  o = F.getInstance().findProvider({ rdns: De.rdns });
2310
2311
  if (!o) {
2311
- t = await Rn();
2312
+ t = await En();
2312
2313
  }
2313
2314
  break;
2314
2315
  }
@@ -2341,7 +2342,7 @@ async function cr(r, e) {
2341
2342
  }
2342
2343
 
2343
2344
  // src/provider/validateProvider.ts
2344
- function dr(r) {
2345
+ function cr(r) {
2345
2346
  return r && "send" in r && typeof r.send === "function";
2346
2347
  }
2347
2348
  async function b(r, e, t) {
@@ -2354,7 +2355,7 @@ async function b(r, e, t) {
2354
2355
  return e;
2355
2356
  }
2356
2357
  const o = {
2357
- ...jt,
2358
+ ...qt,
2358
2359
  ...t
2359
2360
  };
2360
2361
  const n = await Ie(e);
@@ -2377,7 +2378,7 @@ async function b(r, e, t) {
2377
2378
  "WEB3_PROVIDER_ERROR"
2378
2379
  );
2379
2380
  }
2380
- const i = await $(r, {
2381
+ const i = await X(r, {
2381
2382
  type: "all"
2382
2383
  });
2383
2384
  const s = i.networks.some((c) => c.chainId === Number(n));
@@ -2396,24 +2397,24 @@ async function b(r, e, t) {
2396
2397
  }
2397
2398
 
2398
2399
  // src/readOnlyProviders/readOnlyProvider.ts
2399
- import { JsonRpcProvider as Tn } from "ethers";
2400
+ import { JsonRpcProvider as Cn } from "ethers";
2400
2401
  async function Fe(r, e) {
2401
2402
  if (r.isProduction && e?.has(1)) return e;
2402
2403
  if (e?.has(11155111)) return e;
2403
2404
  const t = /* @__PURE__ */ new Map();
2404
- const o = await $(r, {
2405
+ const o = await X(r, {
2405
2406
  type: "all"
2406
2407
  });
2407
2408
  o.networks.forEach((n) => {
2408
2409
  const a = r.networkMap.get(Number(n.chainId))?.rpcUrls[0];
2409
- const i = new Tn(a);
2410
+ const i = new Cn(a);
2410
2411
  t.set(Number(n.chainId), i);
2411
2412
  });
2412
2413
  return t;
2413
2414
  }
2414
2415
 
2415
2416
  // src/smartCheckout/aggregators/allowanceAggregator.ts
2416
- var lr = (r, e, t) => {
2417
+ var dr = (r, e, t) => {
2417
2418
  const o = [];
2418
2419
  if (!r.sufficient) {
2419
2420
  for (const n of r.allowances) {
@@ -2434,7 +2435,7 @@ var lr = (r, e, t) => {
2434
2435
  };
2435
2436
 
2436
2437
  // src/smartCheckout/aggregators/itemAggregator.ts
2437
- var In = (r) => {
2438
+ var Tn = (r) => {
2438
2439
  const e = /* @__PURE__ */ new Map();
2439
2440
  const t = [];
2440
2441
  r.forEach((o) => {
@@ -2457,7 +2458,7 @@ var In = (r) => {
2457
2458
  });
2458
2459
  return t.concat(Array.from(e.values()));
2459
2460
  };
2460
- var hn = (r) => {
2461
+ var In = (r) => {
2461
2462
  const e = /* @__PURE__ */ new Map();
2462
2463
  const t = [];
2463
2464
  r.forEach((o) => {
@@ -2481,7 +2482,7 @@ var hn = (r) => {
2481
2482
  });
2482
2483
  return t.concat(Array.from(e.values()));
2483
2484
  };
2484
- var An = (r) => {
2485
+ var hn = (r) => {
2485
2486
  const e = /* @__PURE__ */ new Map();
2486
2487
  const t = [];
2487
2488
  r.forEach((o) => {
@@ -2522,13 +2523,13 @@ var yn = (r) => {
2522
2523
  });
2523
2524
  return t.concat(Array.from(e.values()));
2524
2525
  };
2525
- var ht = (r) => yn(An(hn(In(r))));
2526
+ var ht = (r) => yn(hn(In(Tn(r))));
2526
2527
 
2527
2528
  // src/smartCheckout/allowance/erc20.ts
2528
- import { Contract as pr } from "ethers";
2529
- var wn = async (r, e, t, o) => {
2529
+ import { Contract as lr } from "ethers";
2530
+ var An = async (r, e, t, o) => {
2530
2531
  try {
2531
- const n = new pr(
2532
+ const n = new lr(
2532
2533
  t,
2533
2534
  JSON.stringify(W),
2534
2535
  r
@@ -2542,9 +2543,9 @@ var wn = async (r, e, t, o) => {
2542
2543
  );
2543
2544
  }
2544
2545
  };
2545
- var Pn = async (r, e, t, o, n) => {
2546
+ var wn = async (r, e, t, o, n) => {
2546
2547
  try {
2547
- const a = new pr(
2548
+ const a = new lr(
2548
2549
  t,
2549
2550
  JSON.stringify(W),
2550
2551
  r
@@ -2560,7 +2561,7 @@ var Pn = async (r, e, t, o, n) => {
2560
2561
  );
2561
2562
  }
2562
2563
  };
2563
- var ur = async (r, e, t) => {
2564
+ var pr = async (r, e, t) => {
2564
2565
  let o = true;
2565
2566
  const n = [];
2566
2567
  const a = /* @__PURE__ */ new Map();
@@ -2574,7 +2575,7 @@ var ur = async (r, e, t) => {
2574
2575
  a.set(T, R);
2575
2576
  i.set(
2576
2577
  T,
2577
- wn(r, e, C, E)
2578
+ An(r, e, C, E)
2578
2579
  );
2579
2580
  }
2580
2581
  const p = await Promise.all(i.values());
@@ -2591,10 +2592,10 @@ var ur = async (r, e, t) => {
2591
2592
  }
2592
2593
  o = false;
2593
2594
  const { tokenAddress: E, spenderAddress: T } = C;
2594
- const A = `${E}${T}`;
2595
+ const y = `${E}${T}`;
2595
2596
  const I = C.amount - p[R];
2596
2597
  s.set(
2597
- A,
2598
+ y,
2598
2599
  {
2599
2600
  type: "ERC20",
2600
2601
  sufficient: false,
@@ -2604,8 +2605,8 @@ var ur = async (r, e, t) => {
2604
2605
  }
2605
2606
  );
2606
2607
  c.set(
2607
- A,
2608
- Pn(
2608
+ y,
2609
+ wn(
2609
2610
  r,
2610
2611
  e,
2611
2612
  E,
@@ -2626,12 +2627,12 @@ var ur = async (r, e, t) => {
2626
2627
  };
2627
2628
 
2628
2629
  // src/smartCheckout/allowance/erc721.ts
2629
- import { Contract as At } from "ethers";
2630
- var Sn = async (r, e, t, o) => {
2630
+ import { Contract as yt } from "ethers";
2631
+ var Pn = async (r, e, t, o) => {
2631
2632
  try {
2632
- const n = new At(
2633
+ const n = new yt(
2633
2634
  t,
2634
- JSON.stringify(ne),
2635
+ JSON.stringify(ae),
2635
2636
  r
2636
2637
  );
2637
2638
  return await n.isApprovedForAll(e, o);
@@ -2648,11 +2649,11 @@ var Sn = async (r, e, t, o) => {
2648
2649
  );
2649
2650
  }
2650
2651
  };
2651
- var kn = async (r, e, t, o, n) => {
2652
+ var Sn = async (r, e, t, o, n) => {
2652
2653
  try {
2653
- const a = new At(
2654
+ const a = new yt(
2654
2655
  t,
2655
- JSON.stringify(ne),
2656
+ JSON.stringify(ae),
2656
2657
  r
2657
2658
  );
2658
2659
  const i = await a.approve.populateTransaction(o, n);
@@ -2672,11 +2673,11 @@ var kn = async (r, e, t, o, n) => {
2672
2673
  );
2673
2674
  }
2674
2675
  };
2675
- var vn = async (r, e, t) => {
2676
+ var kn = async (r, e, t) => {
2676
2677
  try {
2677
- const o = new At(
2678
+ const o = new yt(
2678
2679
  e,
2679
- JSON.stringify(ne),
2680
+ JSON.stringify(ae),
2680
2681
  r
2681
2682
  );
2682
2683
  return await o.getApproved(t);
@@ -2692,7 +2693,7 @@ var vn = async (r, e, t) => {
2692
2693
  );
2693
2694
  }
2694
2695
  };
2695
- var mr = (r, e) => {
2696
+ var ur = (r, e) => {
2696
2697
  try {
2697
2698
  if (!r.trim()) {
2698
2699
  throw new m(
@@ -2710,7 +2711,7 @@ var mr = (r, e) => {
2710
2711
  );
2711
2712
  }
2712
2713
  };
2713
- var Nn = async (r, e, t) => {
2714
+ var vn = async (r, e, t) => {
2714
2715
  const o = /* @__PURE__ */ new Map();
2715
2716
  const n = /* @__PURE__ */ new Map();
2716
2717
  for (const s of e) {
@@ -2719,7 +2720,7 @@ var Nn = async (r, e, t) => {
2719
2720
  const u = `${c}-${p}`;
2720
2721
  o.set(u, false);
2721
2722
  if (n.has(u)) continue;
2722
- n.set(u, Sn(
2723
+ n.set(u, Pn(
2723
2724
  r,
2724
2725
  t,
2725
2726
  c,
@@ -2733,22 +2734,22 @@ var Nn = async (r, e, t) => {
2733
2734
  });
2734
2735
  return o;
2735
2736
  };
2736
- var gr = async (r, e, t) => {
2737
+ var mr = async (r, e, t) => {
2737
2738
  let o = true;
2738
2739
  const n = [];
2739
2740
  const a = /* @__PURE__ */ new Map();
2740
2741
  const i = /* @__PURE__ */ new Map();
2741
2742
  const s = /* @__PURE__ */ new Map();
2742
2743
  const c = /* @__PURE__ */ new Map();
2743
- const p = await Nn(
2744
+ const p = await vn(
2744
2745
  r,
2745
2746
  t,
2746
2747
  e
2747
2748
  );
2748
2749
  for (const C of t) {
2749
2750
  if (C.type !== "ERC721") continue;
2750
- const { contractAddress: E, id: T, spenderAddress: A } = C;
2751
- const I = `${E}-${A}`;
2751
+ const { contractAddress: E, id: T, spenderAddress: y } = C;
2752
+ const I = `${E}-${y}`;
2752
2753
  const P = p.get(I);
2753
2754
  if (P) {
2754
2755
  n.push({
@@ -2758,11 +2759,11 @@ var gr = async (r, e, t) => {
2758
2759
  continue;
2759
2760
  }
2760
2761
  const v = `${E}-${T}`;
2761
- const O = mr(T, E);
2762
+ const O = ur(T, E);
2762
2763
  a.set(v, C);
2763
2764
  i.set(
2764
2765
  v,
2765
- vn(r, E, O)
2766
+ kn(r, E, O)
2766
2767
  );
2767
2768
  }
2768
2769
  const u = await Promise.all(i.values());
@@ -2778,9 +2779,9 @@ var gr = async (r, e, t) => {
2778
2779
  continue;
2779
2780
  }
2780
2781
  o = false;
2781
- const { contractAddress: T, id: A, spenderAddress: I } = E;
2782
- const P = `${T}-${A}`;
2783
- const v = mr(A, T);
2782
+ const { contractAddress: T, id: y, spenderAddress: I } = E;
2783
+ const P = `${T}-${y}`;
2784
+ const v = ur(y, T);
2784
2785
  s.set(
2785
2786
  P,
2786
2787
  {
@@ -2792,7 +2793,7 @@ var gr = async (r, e, t) => {
2792
2793
  );
2793
2794
  c.set(
2794
2795
  P,
2795
- kn(
2796
+ Sn(
2796
2797
  r,
2797
2798
  e,
2798
2799
  T,
@@ -2813,10 +2814,10 @@ var gr = async (r, e, t) => {
2813
2814
  };
2814
2815
 
2815
2816
  // src/smartCheckout/allowance/erc1155.ts
2816
- import { Contract as fr } from "ethers";
2817
- var _n = async (r, e, t, o) => {
2817
+ import { Contract as gr } from "ethers";
2818
+ var Nn = async (r, e, t, o) => {
2818
2819
  try {
2819
- const n = new fr(
2820
+ const n = new gr(
2820
2821
  t,
2821
2822
  JSON.stringify(at),
2822
2823
  r
@@ -2835,9 +2836,9 @@ var _n = async (r, e, t, o) => {
2835
2836
  );
2836
2837
  }
2837
2838
  };
2838
- var On = async (r, e, t, o) => {
2839
+ var _n = async (r, e, t, o) => {
2839
2840
  try {
2840
- const n = new fr(
2841
+ const n = new gr(
2841
2842
  t,
2842
2843
  JSON.stringify(at),
2843
2844
  r
@@ -2858,13 +2859,13 @@ var On = async (r, e, t, o) => {
2858
2859
  );
2859
2860
  }
2860
2861
  };
2861
- var Er = async (r, e, t) => {
2862
+ var fr = async (r, e, t) => {
2862
2863
  const o = t.filter(
2863
2864
  (a) => a.type === "ERC1155"
2864
2865
  );
2865
2866
  const n = await Promise.all(
2866
2867
  o.map(async (a) => {
2867
- const i = await _n(
2868
+ const i = await Nn(
2868
2869
  r,
2869
2870
  e,
2870
2871
  a.contractAddress,
@@ -2876,7 +2877,7 @@ var Er = async (r, e, t) => {
2876
2877
  itemRequirement: a
2877
2878
  };
2878
2879
  }
2879
- const s = await On(
2880
+ const s = await _n(
2880
2881
  r,
2881
2882
  e,
2882
2883
  a.contractAddress,
@@ -2897,10 +2898,10 @@ var Er = async (r, e, t) => {
2897
2898
  };
2898
2899
 
2899
2900
  // src/smartCheckout/balanceCheck/balanceCheck.ts
2900
- import { Contract as Ln, formatUnits as Dn } from "ethers";
2901
+ import { Contract as bn, formatUnits as Ln } from "ethers";
2901
2902
 
2902
2903
  // src/smartCheckout/aggregators/balanceAggregator.ts
2903
- var xn = (r) => {
2904
+ var On = (r) => {
2904
2905
  const e = /* @__PURE__ */ new Map();
2905
2906
  const t = [];
2906
2907
  r.forEach((o) => {
@@ -2919,7 +2920,7 @@ var xn = (r) => {
2919
2920
  });
2920
2921
  return t.concat(Array.from(e.values()));
2921
2922
  };
2922
- var Bn = (r) => {
2923
+ var xn = (r) => {
2923
2924
  const e = /* @__PURE__ */ new Map();
2924
2925
  const t = [];
2925
2926
  r.forEach((o) => {
@@ -2939,7 +2940,7 @@ var Bn = (r) => {
2939
2940
  });
2940
2941
  return t.concat(Array.from(e.values()));
2941
2942
  };
2942
- var Mn = (r) => {
2943
+ var Bn = (r) => {
2943
2944
  const e = /* @__PURE__ */ new Map();
2944
2945
  const t = [];
2945
2946
  r.forEach((o) => {
@@ -2955,11 +2956,11 @@ var Mn = (r) => {
2955
2956
  });
2956
2957
  return t.concat(Array.from(e.values()));
2957
2958
  };
2958
- var Rr = (r) => Mn(Bn(xn(r)));
2959
+ var Er = (r) => Bn(xn(On(r)));
2959
2960
 
2960
2961
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2961
- import { Contract as bn, formatUnits as Ue } from "ethers";
2962
- var Cr = (r) => r.map((e) => {
2962
+ import { Contract as Mn, formatUnits as Ue } from "ethers";
2963
+ var Rr = (r) => r.map((e) => {
2963
2964
  switch (e.type) {
2964
2965
  case "ERC20":
2965
2966
  return {
@@ -2976,7 +2977,7 @@ var Cr = (r) => r.map((e) => {
2976
2977
  };
2977
2978
  }
2978
2979
  });
2979
- var Tr = (r, e) => {
2980
+ var Cr = (r, e) => {
2980
2981
  const t = BigInt(1);
2981
2982
  const o = e.find((s) => {
2982
2983
  const c = s;
@@ -3013,7 +3014,7 @@ var Tr = (r, e) => {
3013
3014
  isFee: false
3014
3015
  };
3015
3016
  };
3016
- var Ir = (r, e) => {
3017
+ var Tr = (r, e) => {
3017
3018
  if (r.type === "ERC20") {
3018
3019
  return e.find((t) => {
3019
3020
  return h(
@@ -3026,25 +3027,25 @@ var Ir = (r, e) => {
3026
3027
  return B(t.token?.address);
3027
3028
  });
3028
3029
  };
3029
- var hr = async (r, e, t) => {
3030
+ var Ir = async (r, e, t) => {
3030
3031
  const o = {};
3031
3032
  for (const n of r) {
3032
3033
  if (n.type === "NATIVE") {
3033
3034
  o[x] = ke;
3034
3035
  continue;
3035
3036
  }
3036
- const a = Ir(n, e);
3037
+ const a = Tr(n, e);
3037
3038
  let i = a?.token.address ?? "";
3038
3039
  let s = a?.token.name ?? "";
3039
3040
  let c = a?.token.symbol ?? "";
3040
- let p = a?.token.decimals ?? q;
3041
+ let p = a?.token.decimals ?? j;
3041
3042
  if (!a && n.type === "ERC20") {
3042
3043
  i = n.tokenAddress;
3043
3044
  if (i.toLowerCase() in o) {
3044
3045
  continue;
3045
3046
  }
3046
3047
  try {
3047
- const u = new bn(
3048
+ const u = new Mn(
3048
3049
  n.tokenAddress,
3049
3050
  JSON.stringify(W),
3050
3051
  t
@@ -3074,8 +3075,8 @@ var hr = async (r, e, t) => {
3074
3075
  }
3075
3076
  return o;
3076
3077
  };
3077
- var Ar = (r, e, t) => {
3078
- let o = Ir(r, e);
3078
+ var hr = (r, e, t) => {
3079
+ let o = Tr(r, e);
3079
3080
  const n = r.amount;
3080
3081
  const a = n < 0 || n === 0n || o && o?.balance >= n;
3081
3082
  const i = n - (o?.balance ?? BigInt(0));
@@ -3140,16 +3141,16 @@ var Ar = (r, e, t) => {
3140
3141
  };
3141
3142
 
3142
3143
  // src/smartCheckout/balanceCheck/balanceCheck.ts
3143
- var Wn = async (r, e, t, o, n = false) => {
3144
+ var Dn = async (r, e, t, o, n = false) => {
3144
3145
  try {
3145
3146
  const a = /* @__PURE__ */ new Map();
3146
- Cr(o).forEach(
3147
+ Rr(o).forEach(
3147
3148
  (s) => {
3148
3149
  if (!s.address) return;
3149
3150
  a.set(s.address.toLocaleLowerCase(), s);
3150
3151
  }
3151
3152
  );
3152
- const { balances: i } = await j(r, e, t, w(r), n);
3153
+ const { balances: i } = await V(r, e, t, w(r), n);
3153
3154
  return i.filter(
3154
3155
  (s) => a.get((s.token.address || x).toLocaleLowerCase())
3155
3156
  );
@@ -3161,15 +3162,15 @@ var Wn = async (r, e, t, o, n = false) => {
3161
3162
  );
3162
3163
  }
3163
3164
  };
3164
- var Fn = async (r, e, t) => {
3165
+ var Wn = async (r, e, t) => {
3165
3166
  const o = [];
3166
3167
  const n = /* @__PURE__ */ new Map();
3167
3168
  const a = /* @__PURE__ */ new Map();
3168
3169
  t.forEach((i) => {
3169
3170
  if (i.type !== "ERC721") return;
3170
- const s = new Ln(
3171
+ const s = new bn(
3171
3172
  i.contractAddress,
3172
- JSON.stringify(ne),
3173
+ JSON.stringify(ae),
3173
3174
  r
3174
3175
  );
3175
3176
  n.set(i.contractAddress, i);
@@ -3202,7 +3203,7 @@ var Fn = async (r, e, t) => {
3202
3203
  return o;
3203
3204
  };
3204
3205
  var yr = async (r, e, t, o, n = false) => {
3205
- const a = Rr(o);
3206
+ const a = Er(o);
3206
3207
  const i = [];
3207
3208
  const s = [];
3208
3209
  a.forEach((f) => {
@@ -3226,10 +3227,10 @@ var yr = async (r, e, t, o, n = false) => {
3226
3227
  }
3227
3228
  const c = [];
3228
3229
  if (i.length > 0) {
3229
- c.push(Wn(r, e, t, a, n));
3230
+ c.push(Dn(r, e, t, a, n));
3230
3231
  }
3231
3232
  if (s.length > 0) {
3232
- c.push(Fn(e, t, a));
3233
+ c.push(Wn(e, t, a));
3233
3234
  }
3234
3235
  const p = await Promise.all(c);
3235
3236
  const u = [];
@@ -3239,12 +3240,12 @@ var yr = async (r, e, t, o, n = false) => {
3239
3240
  const T = E.type === "NATIVE" ? x : E.token.address?.toLowerCase();
3240
3241
  return [T, E];
3241
3242
  }));
3242
- const C = await hr(i, f, e);
3243
+ const C = await Ir(i, f, e);
3243
3244
  i.forEach((E) => {
3244
3245
  const T = (E.tokenAddress ?? x).toLowerCase();
3245
- const A = C[T];
3246
+ const y = C[T];
3246
3247
  const I = R.get(T);
3247
- const P = Ar(E, [...R.values()], A);
3248
+ const P = hr(E, [...R.values()], y);
3248
3249
  u.push(P);
3249
3250
  if (!I) {
3250
3251
  return;
@@ -3253,14 +3254,14 @@ var yr = async (r, e, t, o, n = false) => {
3253
3254
  R.set(T, {
3254
3255
  ...I,
3255
3256
  balance: v,
3256
- formattedBalance: Dn(v, P.required.token.decimals)
3257
+ formattedBalance: Ln(v, P.required.token.decimals)
3257
3258
  });
3258
3259
  });
3259
3260
  }
3260
3261
  if (s.length > 0) {
3261
3262
  const f = p.shift() ?? [];
3262
3263
  s.forEach((R) => {
3263
- u.push(Tr(R, f));
3264
+ u.push(Cr(R, f));
3264
3265
  });
3265
3266
  }
3266
3267
  const g = u.find((f) => !f.sufficient) === void 0;
@@ -3271,7 +3272,7 @@ var yr = async (r, e, t, o, n = false) => {
3271
3272
  };
3272
3273
 
3273
3274
  // src/smartCheckout/gas/gasCalculator.ts
3274
- var wr = async (r, e) => {
3275
+ var Ar = async (r, e) => {
3275
3276
  try {
3276
3277
  return await r.estimateGas(e);
3277
3278
  } catch (t) {
@@ -3282,7 +3283,7 @@ var wr = async (r, e) => {
3282
3283
  );
3283
3284
  }
3284
3285
  };
3285
- var Un = (r, e) => {
3286
+ var Fn = (r, e) => {
3286
3287
  if (e.type === "TRANSACTION" || e.gasToken.type === "NATIVE") {
3287
3288
  return {
3288
3289
  type: "NATIVE",
@@ -3298,15 +3299,15 @@ var Un = (r, e) => {
3298
3299
  isFee: true
3299
3300
  };
3300
3301
  };
3301
- var Pr = async (r, e, t) => {
3302
+ var wr = async (r, e, t) => {
3302
3303
  const o = [];
3303
3304
  let n = BigInt(0);
3304
3305
  for (const i of e) {
3305
3306
  if (i.approvalTransaction === void 0) continue;
3306
- o.push(wr(r, i.approvalTransaction));
3307
+ o.push(Ar(r, i.approvalTransaction));
3307
3308
  }
3308
3309
  if (t.type === "TRANSACTION") {
3309
- o.push(wr(r, t.transaction));
3310
+ o.push(Ar(r, t.transaction));
3310
3311
  } else {
3311
3312
  const i = await r.getFeeData();
3312
3313
  const s = Ct(i);
@@ -3320,12 +3321,12 @@ var Pr = async (r, e, t) => {
3320
3321
  n += i;
3321
3322
  });
3322
3323
  if (n === 0n) return null;
3323
- return Un(n, t);
3324
+ return Fn(n, t);
3324
3325
  };
3325
3326
 
3326
3327
  // src/smartCheckout/routing/geoBlocking.ts
3327
- var Sr = async () => true;
3328
- var kr = async (r) => {
3328
+ var Pr = async () => true;
3329
+ var Sr = async (r) => {
3329
3330
  const e = Ne(r.isDevelopment, r.isProduction);
3330
3331
  try {
3331
3332
  return await e.checkDexAvailability();
@@ -3335,10 +3336,10 @@ var kr = async (r) => {
3335
3336
  };
3336
3337
 
3337
3338
  // src/smartCheckout/routing/routingOptions.ts
3338
- function yt(r) {
3339
+ function At(r) {
3339
3340
  return r?.ethereumProvider?.isPassport === true;
3340
3341
  }
3341
- var vr = async (r, e) => {
3342
+ var kr = async (r, e) => {
3342
3343
  const t = {
3343
3344
  onRamp: r.isOnRampEnabled,
3344
3345
  swap: r.isSwapEnabled,
@@ -3346,10 +3347,10 @@ var vr = async (r, e) => {
3346
3347
  };
3347
3348
  const o = [];
3348
3349
  if (t.onRamp) {
3349
- o.push({ id: "onRamp", promise: Sr() });
3350
+ o.push({ id: "onRamp", promise: Pr() });
3350
3351
  }
3351
3352
  if (t.swap) {
3352
- o.push({ id: "swap", promise: kr(r) });
3353
+ o.push({ id: "swap", promise: Sr(r) });
3353
3354
  }
3354
3355
  if (o.length > 0) {
3355
3356
  const n = o.map((i) => i.promise);
@@ -3359,12 +3360,12 @@ var vr = async (r, e) => {
3359
3360
  t[c] = t[c] && i.status === "fulfilled" && i.value;
3360
3361
  });
3361
3362
  }
3362
- t.bridge = t.bridge && !yt(e);
3363
+ t.bridge = t.bridge && !At(e);
3363
3364
  return t;
3364
3365
  };
3365
3366
 
3366
3367
  // src/smartCheckout/routing/tokenBalances.ts
3367
- var Nr = async (r, e, t, o) => {
3368
+ var vr = async (r, e, t, o) => {
3368
3369
  const n = /* @__PURE__ */ new Map();
3369
3370
  const a = /* @__PURE__ */ new Map();
3370
3371
  if (e.size === 0) {
@@ -3380,7 +3381,7 @@ var Nr = async (r, e, t, o) => {
3380
3381
  if (o.bridge) {
3381
3382
  const s = _(r);
3382
3383
  if (e.has(s)) {
3383
- a.set(s, j(
3384
+ a.set(s, V(
3384
3385
  r,
3385
3386
  e.get(s),
3386
3387
  t,
@@ -3396,7 +3397,7 @@ var Nr = async (r, e, t, o) => {
3396
3397
  }
3397
3398
  const i = w(r);
3398
3399
  if (e.has(i)) {
3399
- a.set(i, j(
3400
+ a.set(i, V(
3400
3401
  r,
3401
3402
  e.get(i),
3402
3403
  t,
@@ -3439,7 +3440,7 @@ var Ge = async (r, e, t, o, n) => {
3439
3440
  const a = /* @__PURE__ */ new Map();
3440
3441
  const i = 1;
3441
3442
  try {
3442
- const s = await se(e, r);
3443
+ const s = await ce(e, r);
3443
3444
  const c = [];
3444
3445
  const p = [];
3445
3446
  for (const g of n) {
@@ -3474,7 +3475,7 @@ var Ge = async (r, e, t, o, n) => {
3474
3475
  };
3475
3476
 
3476
3477
  // src/smartCheckout/routing/swap/swapRoute.ts
3477
- var Gn = (r, e, t) => {
3478
+ var Un = (r, e, t) => {
3478
3479
  let o = BigInt(0);
3479
3480
  let n = "0";
3480
3481
  let a;
@@ -3532,7 +3533,7 @@ var Gn = (r, e, t) => {
3532
3533
  swapFees: p
3533
3534
  };
3534
3535
  };
3535
- var qn = (r, e, t, o) => {
3536
+ var Gn = (r, e, t, o) => {
3536
3537
  const n = t.token.address;
3537
3538
  let a = "ERC20";
3538
3539
  if (B(n)) {
@@ -3559,7 +3560,7 @@ var qn = (r, e, t, o) => {
3559
3560
  fees: o
3560
3561
  };
3561
3562
  };
3562
- var jn = (r) => {
3563
+ var qn = (r) => {
3563
3564
  if (r.type === "ERC20") {
3564
3565
  return !!r.required.token.address;
3565
3566
  }
@@ -3568,7 +3569,7 @@ var jn = (r) => {
3568
3569
  }
3569
3570
  return false;
3570
3571
  };
3571
- var Vn = (r) => {
3572
+ var jn = (r) => {
3572
3573
  let e = "";
3573
3574
  let t = BigInt(0);
3574
3575
  switch (r.type) {
@@ -3584,7 +3585,7 @@ var Vn = (r) => {
3584
3585
  }
3585
3586
  return { address: e, amount: t };
3586
3587
  };
3587
- var Kn = (r, e) => {
3588
+ var Vn = (r, e) => {
3588
3589
  if (!e) return { sufficient: true, approvalGasFee: BigInt(0), approvalGasTokenAddress: "" };
3589
3590
  const t = e.value;
3590
3591
  const o = e.token.address;
@@ -3608,7 +3609,7 @@ var Kn = (r, e) => {
3608
3609
  }
3609
3610
  return { sufficient: true, approvalGasFee: t, approvalGasTokenAddress: o };
3610
3611
  };
3611
- var Hn = (r, e, t, o, n) => {
3612
+ var Kn = (r, e, t, o, n) => {
3612
3613
  const a = /* @__PURE__ */ new Map();
3613
3614
  if (e.approvalGasFee > BigInt(0)) {
3614
3615
  a.set(e.approvalGasTokenAddress, e.approvalGasFee);
@@ -3651,7 +3652,7 @@ var Hn = (r, e, t, o, n) => {
3651
3652
  }
3652
3653
  return true;
3653
3654
  };
3654
- var zn = (r, e, t, o, n, a) => {
3655
+ var Hn = (r, e, t, o, n, a) => {
3655
3656
  let i = BigInt(0);
3656
3657
  let s = "";
3657
3658
  let c = false;
@@ -3679,8 +3680,8 @@ var je = async (r, e, t, o, n, a, i) => {
3679
3680
  const s = [];
3680
3681
  if (!e.swap) return s;
3681
3682
  if (a.length === 0) return s;
3682
- if (!jn(o)) return s;
3683
- const c = Vn(o);
3683
+ if (!qn(o)) return s;
3684
+ const c = jn(o);
3684
3685
  const p = w(r);
3685
3686
  const u = n.get(p);
3686
3687
  if (!u) return s;
@@ -3701,33 +3702,33 @@ var je = async (r, e, t, o, n, a, i) => {
3701
3702
  (v) => h(v.token.address, C)
3702
3703
  );
3703
3704
  if (!T) continue;
3704
- const A = E.quote.amountWithMaxSlippage;
3705
- if (T.balance < A.value) continue;
3706
- const I = Kn(g, E.approval);
3705
+ const y = E.quote.amountWithMaxSlippage;
3706
+ if (T.balance < y.value) continue;
3707
+ const I = Vn(g, E.approval);
3707
3708
  if (!I.sufficient) continue;
3708
- if (!Hn(
3709
+ if (!Kn(
3709
3710
  g,
3710
3711
  I,
3711
3712
  E.swap,
3712
3713
  E.quote.fees,
3713
3714
  {
3714
- amount: A.value,
3715
+ amount: y.value,
3715
3716
  address: C
3716
3717
  }
3717
3718
  )) continue;
3718
- if (!zn(
3719
+ if (!Hn(
3719
3720
  T.balance,
3720
3721
  i,
3721
3722
  C,
3722
- A.value,
3723
+ y.value,
3723
3724
  I,
3724
3725
  E.quote.fees
3725
3726
  )) continue;
3726
- const P = Gn(E.approval, E.swap, E.quote.fees);
3727
+ const P = Un(E.approval, E.swap, E.quote.fees);
3727
3728
  s.push(
3728
- qn(
3729
+ Gn(
3729
3730
  p,
3730
- A.value,
3731
+ y.value,
3731
3732
  T,
3732
3733
  P
3733
3734
  )
@@ -3737,7 +3738,7 @@ var je = async (r, e, t, o, n, a, i) => {
3737
3738
  };
3738
3739
 
3739
3740
  // src/smartCheckout/allowList/allowListCheck.ts
3740
- var _r = (r, e) => {
3741
+ var Nr = (r, e) => {
3741
3742
  if (e && e.success) {
3742
3743
  return r.filter((t) => {
3743
3744
  if ("address" in t) {
@@ -3762,34 +3763,34 @@ var Pt = async (r, e, t) => {
3762
3763
  const o = _(r);
3763
3764
  const n = (await z(r, { type: "bridge", chainId: o })).tokens;
3764
3765
  const a = e.get(o);
3765
- return _r(n, a);
3766
+ return Nr(n, a);
3766
3767
  }
3767
3768
  return [];
3768
3769
  };
3769
- var Qn = async (r, e, t) => {
3770
+ var zn = async (r, e, t) => {
3770
3771
  if (t.swap) {
3771
3772
  const o = (await z(r, { type: "swap" })).tokens;
3772
3773
  const n = e.get(w(r));
3773
- return _r(o, n);
3774
+ return Nr(o, n);
3774
3775
  }
3775
3776
  return [];
3776
3777
  };
3777
- var Or = async (r, e, t) => {
3778
+ var _r = async (r, e, t) => {
3778
3779
  const o = {};
3779
- o.swap = await Qn(r, e, t);
3780
+ o.swap = await zn(r, e, t);
3780
3781
  o.bridge = await Pt(r, e, t);
3781
3782
  o.onRamp = await wt(r, t);
3782
3783
  return o;
3783
3784
  };
3784
3785
 
3785
3786
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
3786
- import { formatUnits as oa } from "ethers";
3787
+ import { formatUnits as ra } from "ethers";
3787
3788
 
3788
3789
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3789
3790
  import { formatUnits as Ke } from "ethers";
3790
3791
 
3791
3792
  // src/smartCheckout/routing/bridge/getEthBalance.ts
3792
- var xr = (r) => {
3793
+ var Or = (r) => {
3793
3794
  for (const e of r.balances) {
3794
3795
  if (B(e.token.address)) {
3795
3796
  return e.balance;
@@ -3799,8 +3800,8 @@ var xr = (r) => {
3799
3800
  };
3800
3801
 
3801
3802
  // src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
3802
- import { BridgeFeeActions as Zn } from "@imtbl/bridge-sdk";
3803
- var Br = async (r, e, t, o) => {
3803
+ import { BridgeFeeActions as Qn } from "@imtbl/bridge-sdk";
3804
+ var xr = async (r, e, t, o) => {
3804
3805
  const n = be(
3805
3806
  t,
3806
3807
  o,
@@ -3810,7 +3811,7 @@ var Br = async (r, e, t, o) => {
3810
3811
  try {
3811
3812
  const a = await n.getFee(
3812
3813
  {
3813
- action: Zn.DEPOSIT,
3814
+ action: Qn.DEPOSIT,
3814
3815
  gasMultiplier: "auto",
3815
3816
  sourceChainId: t.toString(),
3816
3817
  destinationChainId: o.toString()
@@ -3830,14 +3831,14 @@ var Br = async (r, e, t, o) => {
3830
3831
  };
3831
3832
 
3832
3833
  // src/smartCheckout/routing/indexer/fetchL1Representation.ts
3833
- var X = "0x0000000000000000000000000000000000000eee";
3834
- var Yn = (r) => {
3834
+ var ee = "0x0000000000000000000000000000000000000eee";
3835
+ var Zn = (r) => {
3835
3836
  if (r === 13371) return "imtbl-zkevm-mainnet";
3836
3837
  if (r === 13473) return "imtbl-zkevm-testnet";
3837
3838
  if (r === 15003) return "imtbl-zkevm-devnet";
3838
3839
  return "";
3839
3840
  };
3840
- var Jn = async (r, e) => {
3841
+ var Yn = async (r, e) => {
3841
3842
  const t = await e.remote.getConfig(
3842
3843
  "imxAddressMapping"
3843
3844
  );
@@ -3846,18 +3847,18 @@ var Jn = async (r, e) => {
3846
3847
  var Ve = async (r, e) => {
3847
3848
  if (B(e)) {
3848
3849
  return {
3849
- l1address: await Jn(_(r), r),
3850
+ l1address: await Yn(_(r), r),
3850
3851
  l2address: x
3851
3852
  };
3852
3853
  }
3853
- const t = Yn(w(r));
3854
+ const t = Zn(w(r));
3854
3855
  const o = Le(r);
3855
3856
  const n = await o.getToken({
3856
3857
  chainName: t,
3857
3858
  contractAddress: e
3858
3859
  });
3859
3860
  const a = n.result.root_contract_address;
3860
- if (h(a ?? "", X)) {
3861
+ if (h(a ?? "", ee)) {
3861
3862
  return {
3862
3863
  l1address: "native",
3863
3864
  l2address: e
@@ -3871,12 +3872,12 @@ var Ve = async (r, e) => {
3871
3872
  };
3872
3873
 
3873
3874
  // src/smartCheckout/routing/bridge/bridgeRoute.ts
3874
- var $n = (r, e) => {
3875
- const t = xr(r);
3875
+ var Jn = (r, e) => {
3876
+ const t = Or(r);
3876
3877
  return t >= e;
3877
3878
  };
3878
- var Mr = (r, e, t, o, n) => {
3879
- const a = n?.decimals ?? q;
3879
+ var Br = (r, e, t, o, n) => {
3880
+ const a = n?.decimals ?? j;
3880
3881
  const i = [];
3881
3882
  if (e > 0) {
3882
3883
  i.push({
@@ -3898,19 +3899,19 @@ var Mr = (r, e, t, o, n) => {
3898
3899
  approvalGasFee: {
3899
3900
  type: "GAS",
3900
3901
  amount: o,
3901
- formattedAmount: Ke(o, q),
3902
+ formattedAmount: Ke(o, j),
3902
3903
  token: n
3903
3904
  },
3904
3905
  bridgeGasFee: {
3905
3906
  type: "GAS",
3906
3907
  amount: r,
3907
- formattedAmount: Ke(r, q),
3908
+ formattedAmount: Ke(r, j),
3908
3909
  token: n
3909
3910
  },
3910
3911
  bridgeFees: i
3911
3912
  };
3912
3913
  };
3913
- var br = (r, e, t, o, n) => ({
3914
+ var Mr = (r, e, t, o, n) => ({
3914
3915
  type: "BRIDGE",
3915
3916
  chainId: r,
3916
3917
  fundingItem: {
@@ -3957,7 +3958,7 @@ var He = async (r, e, t, o, n) => {
3957
3958
  } else if (!u.find((v) => h(v.address, f))) {
3958
3959
  return void 0;
3959
3960
  }
3960
- const R = await Br(
3961
+ const R = await xr(
3961
3962
  r,
3962
3963
  e,
3963
3964
  a,
@@ -3967,21 +3968,21 @@ var He = async (r, e, t, o, n) => {
3967
3968
  sourceChainGas: C,
3968
3969
  approvalGas: E,
3969
3970
  bridgeFee: T,
3970
- imtblFee: A,
3971
+ imtblFee: y,
3971
3972
  totalFees: I
3972
3973
  } = R;
3973
- if (!$n(c, I)) return void 0;
3974
+ if (!Jn(c, I)) return void 0;
3974
3975
  if (B(f)) {
3975
3976
  const v = c.balances.find((O) => B(O.token.address));
3976
3977
  if (v && v.balance >= o.amount + I) {
3977
- const O = Mr(
3978
+ const O = Br(
3978
3979
  C,
3979
3980
  T,
3980
- A,
3981
+ y,
3981
3982
  E,
3982
3983
  s
3983
3984
  );
3984
- return br(a, v, o, "NATIVE", O);
3985
+ return Mr(a, v, o, "NATIVE", O);
3985
3986
  }
3986
3987
  return void 0;
3987
3988
  }
@@ -3989,20 +3990,20 @@ var He = async (r, e, t, o, n) => {
3989
3990
  (v) => h(v.token.address, f)
3990
3991
  );
3991
3992
  if (P && P.balance >= o.amount) {
3992
- const v = Mr(
3993
+ const v = Br(
3993
3994
  C,
3994
3995
  T,
3995
- A,
3996
+ y,
3996
3997
  E,
3997
3998
  s
3998
3999
  );
3999
- return br(a, P, o, "ERC20", v);
4000
+ return Mr(a, P, o, "ERC20", v);
4000
4001
  }
4001
4002
  return void 0;
4002
4003
  };
4003
4004
 
4004
4005
  // src/smartCheckout/routing/bridgeAndSwap/getBalancesByChain.ts
4005
- var Lr = (r, e) => {
4006
+ var br = (r, e) => {
4006
4007
  const t = { l1balances: [], l2balances: [] };
4007
4008
  const o = e.get(_(r));
4008
4009
  const n = e.get(w(r));
@@ -4018,8 +4019,8 @@ var Lr = (r, e) => {
4018
4019
  };
4019
4020
 
4020
4021
  // src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.ts
4021
- import { formatUnits as Xn } from "ethers";
4022
- var ea = (r, e) => {
4022
+ import { formatUnits as $n } from "ethers";
4023
+ var Xn = (r, e) => {
4023
4024
  let t = BigInt(0);
4024
4025
  r.quote.fees.forEach((o) => {
4025
4026
  if (h(o.amount.token.address, e)) {
@@ -4033,7 +4034,7 @@ var ea = (r, e) => {
4033
4034
  }
4034
4035
  return t;
4035
4036
  };
4036
- var ta = (r, e) => {
4037
+ var ea = (r, e) => {
4037
4038
  for (const t of r.balanceRequirements) {
4038
4039
  if (t.type === "NATIVE" || t.type === "ERC20") {
4039
4040
  if (h(t.required.token.address, e)) {
@@ -4043,7 +4044,7 @@ var ta = (r, e) => {
4043
4044
  }
4044
4045
  return BigInt(0);
4045
4046
  };
4046
- var ra = (r, e, t) => {
4047
+ var ta = (r, e, t) => {
4047
4048
  const o = t?.balance ?? BigInt(0);
4048
4049
  if (o >= r + e) {
4049
4050
  return BigInt(0);
@@ -4057,7 +4058,7 @@ var ra = (r, e, t) => {
4057
4058
  }
4058
4059
  return r + e - o;
4059
4060
  };
4060
- var Dr = (r, e, t, o, n) => {
4061
+ var Lr = (r, e, t, o, n) => {
4061
4062
  const a = [];
4062
4063
  for (const [i, s] of r) {
4063
4064
  const c = t.find((I) => h(I.token.address, i));
@@ -4068,29 +4069,29 @@ var Dr = (r, e, t, o, n) => {
4068
4069
  const { l1address: u, l2address: g } = p;
4069
4070
  if (!u) continue;
4070
4071
  const f = e.find((I) => {
4071
- if (I.token.address === void 0 && h(u, X)) {
4072
+ if (I.token.address === void 0 && h(u, ee)) {
4072
4073
  return true;
4073
4074
  }
4074
4075
  return h(I.token.address, u);
4075
4076
  });
4076
4077
  if (!f) continue;
4077
4078
  const R = s.quote.amountWithMaxSlippage.value;
4078
- const C = ea(s, i);
4079
+ const C = Xn(s, i);
4079
4080
  const E = R + C;
4080
- const T = ta(
4081
+ const T = ea(
4081
4082
  n,
4082
4083
  i
4083
4084
  );
4084
- const A = ra(E, T, c);
4085
- if (A <= 0) {
4085
+ const y = ta(E, T, c);
4086
+ if (y <= 0) {
4086
4087
  continue;
4087
4088
  }
4088
- if (A >= f.balance) {
4089
+ if (y >= f.balance) {
4089
4090
  continue;
4090
4091
  }
4091
4092
  a.push({
4092
- amount: A,
4093
- formattedAmount: Z(Xn(A, f.token.decimals)),
4093
+ amount: y,
4094
+ formattedAmount: Z($n(y, f.token.decimals)),
4094
4095
  // L2 address is used for the bridge requirement as the bridge route uses the indexer to find L1 address
4095
4096
  l2address: g
4096
4097
  });
@@ -4099,14 +4100,14 @@ var Dr = (r, e, t, o, n) => {
4099
4100
  };
4100
4101
 
4101
4102
  // src/smartCheckout/routing/bridgeAndSwap/fetchL1ToL2Mappings.ts
4102
- var Wr = async (r, e) => {
4103
+ var Dr = async (r, e) => {
4103
4104
  const t = e.map((n) => Ve(r, n.address ?? ""));
4104
4105
  const o = await Promise.all(t);
4105
4106
  return o.filter((n) => n !== void 0);
4106
4107
  };
4107
4108
 
4108
4109
  // src/smartCheckout/routing/bridgeAndSwap/getDexQuotes.ts
4109
- var Fr = async (r, e, t, o, n) => {
4110
+ var Wr = async (r, e, t, o, n) => {
4110
4111
  const a = [];
4111
4112
  for (const s of n) {
4112
4113
  if (!s.address) continue;
@@ -4126,7 +4127,7 @@ var Fr = async (r, e, t, o, n) => {
4126
4127
  };
4127
4128
 
4128
4129
  // src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.ts
4129
- var na = (r, e, t, o, n, a) => {
4130
+ var oa = (r, e, t, o, n, a) => {
4130
4131
  if (r.length === 0) return true;
4131
4132
  if (e.length === 0) return true;
4132
4133
  if (t.length === 0) return true;
@@ -4137,7 +4138,7 @@ var na = (r, e, t, o, n, a) => {
4137
4138
  if (a === "") return true;
4138
4139
  return false;
4139
4140
  };
4140
- var aa = (r, e, t, o) => {
4141
+ var na = (r, e, t, o) => {
4141
4142
  const n = [];
4142
4143
  for (const a of o) {
4143
4144
  if (!e.includes(a.l1address)) continue;
@@ -4150,7 +4151,7 @@ var aa = (r, e, t, o) => {
4150
4151
  }
4151
4152
  return n;
4152
4153
  };
4153
- var ia = (r, e, t, o, n) => {
4154
+ var aa = (r, e, t, o, n) => {
4154
4155
  const a = /* @__PURE__ */ new Map();
4155
4156
  for (const [c, p] of e) {
4156
4157
  a.set(c, {
@@ -4173,7 +4174,7 @@ var ia = (r, e, t, o, n) => {
4173
4174
  const C = n.find((E) => h(E.address, u));
4174
4175
  i.set(u, {
4175
4176
  balance: R,
4176
- formattedBalance: oa(
4177
+ formattedBalance: ra(
4177
4178
  R,
4178
4179
  C.decimals
4179
4180
  ),
@@ -4190,7 +4191,7 @@ var ia = (r, e, t, o, n) => {
4190
4191
  );
4191
4192
  return a;
4192
4193
  };
4193
- var sa = (r, e) => {
4194
+ var ia = (r, e) => {
4194
4195
  const t = [];
4195
4196
  for (const o of e) {
4196
4197
  const { chainId: n, fundingItem: a } = o;
@@ -4212,14 +4213,14 @@ var sa = (r, e) => {
4212
4213
  }
4213
4214
  return t;
4214
4215
  };
4215
- var ca = (r, e, t) => {
4216
+ var sa = (r, e, t) => {
4216
4217
  const o = [];
4217
4218
  for (const n of r) {
4218
4219
  if (!n) continue;
4219
4220
  const a = t.find(
4220
4221
  (s) => {
4221
4222
  if (n.fundingItem.token.address === void 0) {
4222
- return h(s.l1address, X) && s.l2address;
4223
+ return h(s.l1address, ee) && s.l2address;
4223
4224
  }
4224
4225
  return h(
4225
4226
  s.l1address,
@@ -4239,10 +4240,10 @@ var ca = (r, e, t) => {
4239
4240
  }
4240
4241
  return o;
4241
4242
  };
4242
- var Ur = async (r, e, t, o, n, a, i, s, c) => {
4243
- const { l1balances: p, l2balances: u } = Lr(r, a);
4243
+ var Fr = async (r, e, t, o, n, a, i, s, c) => {
4244
+ const { l1balances: p, l2balances: u } = br(r, a);
4244
4245
  const g = o.required.token.address;
4245
- if (na(
4246
+ if (oa(
4246
4247
  i,
4247
4248
  s,
4248
4249
  p,
@@ -4250,22 +4251,22 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4250
4251
  t,
4251
4252
  g
4252
4253
  )) return [];
4253
- const f = await Wr(r, s);
4254
- const R = aa(
4254
+ const f = await Dr(r, s);
4255
+ const R = na(
4255
4256
  g,
4256
4257
  i,
4257
4258
  s,
4258
4259
  f
4259
4260
  );
4260
4261
  if (R.length === 0) return [];
4261
- const C = await Fr(
4262
+ const C = await Wr(
4262
4263
  r,
4263
4264
  n,
4264
4265
  g,
4265
4266
  o,
4266
4267
  R
4267
4268
  );
4268
- const E = Dr(
4269
+ const E = Lr(
4269
4270
  C,
4270
4271
  p,
4271
4272
  u,
@@ -4274,7 +4275,7 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4274
4275
  );
4275
4276
  if (E.length === 0) return [];
4276
4277
  const T = /* @__PURE__ */ new Map();
4277
- const A = /* @__PURE__ */ new Map();
4278
+ const y = /* @__PURE__ */ new Map();
4278
4279
  const I = [];
4279
4280
  for (const G of E) {
4280
4281
  if (!G.l2address) continue;
@@ -4288,7 +4289,7 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4288
4289
  a
4289
4290
  )
4290
4291
  );
4291
- A.set(G.l2address, {
4292
+ y.set(G.l2address, {
4292
4293
  amount: G.amount,
4293
4294
  formattedAmount: G.formattedAmount,
4294
4295
  l2address: G.l2address
@@ -4298,10 +4299,10 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4298
4299
  const v = Array.from(T.keys());
4299
4300
  const O = [];
4300
4301
  P.forEach((G, rt) => {
4301
- const V = v[rt];
4302
+ const K = v[rt];
4302
4303
  if (G === void 0) return;
4303
- O.push(V);
4304
- const N = A.get(V);
4304
+ O.push(K);
4305
+ const N = y.get(K);
4305
4306
  if (!N) return;
4306
4307
  I.push({
4307
4308
  amount: N.amount,
@@ -4311,14 +4312,14 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4311
4312
  });
4312
4313
  if (O.length === 0) return [];
4313
4314
  if (I.length === 0) return [];
4314
- const Q = ia(
4315
+ const Q = aa(
4315
4316
  r,
4316
4317
  a,
4317
4318
  u,
4318
4319
  I,
4319
4320
  s
4320
4321
  );
4321
- const pe = await je(
4322
+ const ue = await je(
4322
4323
  r,
4323
4324
  t,
4324
4325
  n,
@@ -4327,20 +4328,20 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
4327
4328
  O,
4328
4329
  c
4329
4330
  );
4330
- if (!pe) return [];
4331
- const ee = sa(
4331
+ if (!ue) return [];
4332
+ const te = ia(
4332
4333
  a,
4333
- pe
4334
+ ue
4334
4335
  );
4335
- return ca(
4336
+ return sa(
4336
4337
  P,
4337
- ee,
4338
+ te,
4338
4339
  f
4339
4340
  );
4340
4341
  };
4341
4342
 
4342
4343
  // src/smartCheckout/routing/onRamp/onRampRoute.ts
4343
- var Gr = async (r, e, t) => {
4344
+ var Ur = async (r, e, t) => {
4344
4345
  if (!["ERC20", "NATIVE"].includes(t.type)) return void 0;
4345
4346
  const { required: o, current: n, delta: a } = t;
4346
4347
  let i = false;
@@ -4372,8 +4373,8 @@ var Gr = async (r, e, t) => {
4372
4373
  };
4373
4374
 
4374
4375
  // src/smartCheckout/routing/routingCalculator.ts
4375
- var da = (r) => r.bridge || r.swap || r.onRamp;
4376
- var la = (r) => {
4376
+ var ca = (r) => r.bridge || r.swap || r.onRamp;
4377
+ var da = (r) => {
4377
4378
  let e = 0;
4378
4379
  let t;
4379
4380
  for (const o of r.balanceRequirements) {
@@ -4385,7 +4386,7 @@ var la = (r) => {
4385
4386
  if (e === 1) return t;
4386
4387
  return void 0;
4387
4388
  };
4388
- var pa = async (r, e, t, o, n) => {
4389
+ var la = async (r, e, t, o, n) => {
4389
4390
  let a;
4390
4391
  if (o === void 0) return void 0;
4391
4392
  if (o.type !== "NATIVE" && o.type !== "ERC20") {
@@ -4407,7 +4408,7 @@ var pa = async (r, e, t, o, n) => {
4407
4408
  }
4408
4409
  return a;
4409
4410
  };
4410
- var ua = async (r, e, t, o, n, a, i) => {
4411
+ var pa = async (r, e, t, o, n, a, i) => {
4411
4412
  const s = [];
4412
4413
  if (!e.swap) return s;
4413
4414
  if (t === void 0) return s;
@@ -4428,7 +4429,7 @@ var ua = async (r, e, t, o, n, a, i) => {
4428
4429
  i
4429
4430
  );
4430
4431
  };
4431
- var ma = async (r, e, t, o, n, a, i, s) => {
4432
+ var ua = async (r, e, t, o, n, a, i, s) => {
4432
4433
  if (!o) return [];
4433
4434
  const c = a.get(_(r));
4434
4435
  const p = a.get(w(r));
@@ -4438,14 +4439,14 @@ var ma = async (r, e, t, o, n, a, i, s) => {
4438
4439
  if (p.error !== void 0 || !p.success) return [];
4439
4440
  const u = i?.bridge ?? [];
4440
4441
  const g = u.map((C) => {
4441
- if (C.address === void 0) return X;
4442
+ if (C.address === void 0) return ee;
4442
4443
  return C.address;
4443
4444
  });
4444
4445
  const f = i?.swap ?? [];
4445
4446
  if (o.type !== "NATIVE" && o.type !== "ERC20") {
4446
4447
  return [];
4447
4448
  }
4448
- const R = await Ur(
4449
+ const R = await Fr(
4449
4450
  r,
4450
4451
  e,
4451
4452
  t,
@@ -4458,10 +4459,10 @@ var ma = async (r, e, t, o, n, a, i, s) => {
4458
4459
  );
4459
4460
  return R;
4460
4461
  };
4461
- var ga = async (r, e, t) => {
4462
+ var ma = async (r, e, t) => {
4462
4463
  if (!e.onRamp) return void 0;
4463
4464
  if (t === void 0) return void 0;
4464
- const o = await Gr(
4465
+ const o = await Ur(
4465
4466
  r,
4466
4467
  e,
4467
4468
  t
@@ -4486,8 +4487,8 @@ var Qe = (r, e, t, o) => {
4486
4487
  t.push(a);
4487
4488
  o?.(a);
4488
4489
  };
4489
- var qr = async (r, e, t, o, n) => {
4490
- if (!da(o)) {
4490
+ var Gr = async (r, e, t, o, n) => {
4491
+ if (!ca(o)) {
4491
4492
  return {
4492
4493
  type: "NO_ROUTE_OPTIONS",
4493
4494
  message: "No routing options are available"
@@ -4506,7 +4507,7 @@ var qr = async (r, e, t, o, n) => {
4506
4507
  const i = await k(
4507
4508
  r,
4508
4509
  "Time to get token balances inside router",
4509
- Nr(
4510
+ vr(
4510
4511
  r,
4511
4512
  a,
4512
4513
  e,
@@ -4516,14 +4517,14 @@ var qr = async (r, e, t, o, n) => {
4516
4517
  const s = await k(
4517
4518
  r,
4518
4519
  "Time to get routing allowlist",
4519
- Or(r, i, o)
4520
+ _r(r, i, o)
4520
4521
  );
4521
- const c = la(t);
4522
+ const c = da(t);
4522
4523
  const p = [];
4523
4524
  const u = [];
4524
4525
  if (o.swap) {
4525
4526
  p.push(
4526
- ua(
4527
+ pa(
4527
4528
  r,
4528
4529
  o,
4529
4530
  c,
@@ -4545,7 +4546,7 @@ var qr = async (r, e, t, o, n) => {
4545
4546
  }
4546
4547
  if (o.bridge) {
4547
4548
  p.push(
4548
- pa(
4549
+ la(
4549
4550
  r,
4550
4551
  a,
4551
4552
  o,
@@ -4563,7 +4564,7 @@ var qr = async (r, e, t, o, n) => {
4563
4564
  }
4564
4565
  if (o.onRamp) {
4565
4566
  p.push(
4566
- ga(
4567
+ ma(
4567
4568
  r,
4568
4569
  o,
4569
4570
  c
@@ -4579,7 +4580,7 @@ var qr = async (r, e, t, o, n) => {
4579
4580
  }
4580
4581
  if (o.swap && o.bridge) {
4581
4582
  p.push(
4582
- ma(
4583
+ ua(
4583
4584
  r,
4584
4585
  a,
4585
4586
  o,
@@ -4618,7 +4619,7 @@ var qr = async (r, e, t, o, n) => {
4618
4619
  };
4619
4620
 
4620
4621
  // src/smartCheckout/smartCheckout.ts
4621
- var fa = (r) => {
4622
+ var ga = (r) => {
4622
4623
  const e = r.balanceRequirements.map(
4623
4624
  (t) => {
4624
4625
  if (t.type === "ERC20" && t.sufficient) {
@@ -4639,12 +4640,12 @@ var fa = (r) => {
4639
4640
  balanceRequirements: e
4640
4641
  };
4641
4642
  };
4642
- var jr = async (r, e, t, o, n, a, i, s, c) => {
4643
- const p = !i || t && s ? fa(a) : a;
4643
+ var qr = async (r, e, t, o, n, a, i, s, c) => {
4644
+ const p = !i || t && s ? ga(a) : a;
4644
4645
  const u = await k(
4645
4646
  r,
4646
4647
  "Total time to run the routing calculator",
4647
- qr(
4648
+ Gr(
4648
4649
  r,
4649
4650
  e,
4650
4651
  p,
@@ -4662,20 +4663,20 @@ var jr = async (r, e, t, o, n, a, i, s, c) => {
4662
4663
  });
4663
4664
  return u;
4664
4665
  };
4665
- var le = async (r, e, t, o, n, a, i, s = false) => {
4666
+ var pe = async (r, e, t, o, n, a, i, s = false) => {
4666
4667
  const c = await (await e.getSigner()).getAddress();
4667
4668
  let p = ht(t);
4668
- const u = ur(
4669
+ const u = pr(
4669
4670
  e,
4670
4671
  c,
4671
4672
  p
4672
4673
  );
4673
- const g = gr(
4674
+ const g = mr(
4674
4675
  e,
4675
4676
  c,
4676
4677
  p
4677
4678
  );
4678
- const f = Er(
4679
+ const f = fr(
4679
4680
  e,
4680
4681
  c,
4681
4682
  p
@@ -4685,7 +4686,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4685
4686
  "Time to calculate token allowances",
4686
4687
  Promise.all([u, g, f])
4687
4688
  );
4688
- const C = lr(
4689
+ const C = dr(
4689
4690
  R[0],
4690
4691
  R[1],
4691
4692
  R[2]
@@ -4695,7 +4696,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4695
4696
  E = await k(
4696
4697
  r,
4697
4698
  "Time to run gas calculator",
4698
- Pr(e, C, o)
4699
+ wr(e, C, o)
4699
4700
  );
4700
4701
  if (E !== null) {
4701
4702
  p.push(E);
@@ -4707,21 +4708,21 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4707
4708
  "Time to run balance checks",
4708
4709
  yr(r, e, c, p, true)
4709
4710
  );
4710
- const { sufficient: A } = T;
4711
+ const { sufficient: y } = T;
4711
4712
  const I = T.balanceRequirements;
4712
4713
  const P = await k(
4713
4714
  r,
4714
4715
  "Time to fetch available routing options",
4715
- vr(r, e)
4716
+ kr(r, e)
4716
4717
  );
4717
4718
  if (n?.onRamp === false) P.onRamp = false;
4718
4719
  if (n?.swap === false) P.swap = false;
4719
4720
  if (n?.bridge === false) P.bridge = false;
4720
4721
  if (a) {
4721
- jr(
4722
+ qr(
4722
4723
  r,
4723
4724
  c,
4724
- A,
4725
+ y,
4725
4726
  P,
4726
4727
  I,
4727
4728
  T,
@@ -4730,20 +4731,20 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4730
4731
  i
4731
4732
  );
4732
4733
  return {
4733
- sufficient: A,
4734
+ sufficient: y,
4734
4735
  transactionRequirements: I
4735
4736
  };
4736
4737
  }
4737
- if (A) {
4738
+ if (y) {
4738
4739
  return {
4739
- sufficient: A,
4740
+ sufficient: y,
4740
4741
  transactionRequirements: I
4741
4742
  };
4742
4743
  }
4743
- const v = await jr(
4744
+ const v = await qr(
4744
4745
  r,
4745
4746
  c,
4746
- A,
4747
+ y,
4747
4748
  P,
4748
4749
  I,
4749
4750
  T,
@@ -4752,7 +4753,7 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4752
4753
  i
4753
4754
  );
4754
4755
  return {
4755
- sufficient: A,
4756
+ sufficient: y,
4756
4757
  transactionRequirements: I,
4757
4758
  router: {
4758
4759
  availableRoutingOptions: P,
@@ -4763,24 +4764,24 @@ var le = async (r, e, t, o, n, a, i, s = false) => {
4763
4764
 
4764
4765
  // src/smartCheckout/buy/buy.ts
4765
4766
  import {
4766
- constants as wa,
4767
- OrderStatusName as Pa
4767
+ constants as Aa,
4768
+ OrderStatusName as wa
4768
4769
  } from "@imtbl/orderbook";
4769
- import { track as Sa } from "@imtbl/metrics";
4770
+ import { track as Pa } from "@imtbl/metrics";
4770
4771
 
4771
4772
  // src/transaction/transaction.ts
4772
4773
  function St(r) {
4773
4774
  return r?.ethereumProvider?.isPassport === true;
4774
4775
  }
4775
- function Ra(r) {
4776
+ function Ea(r) {
4776
4777
  return St(r);
4777
4778
  }
4778
- var Ca = async (r, e) => {
4779
+ var Ra = async (r, e) => {
4779
4780
  const t = e;
4780
4781
  const { chainId: o } = await r.getNetwork();
4781
- if (!Zt(Number(o))) return t;
4782
+ if (!Qt(Number(o))) return t;
4782
4783
  if (typeof t.gasPrice !== "undefined") return t;
4783
- if (Ra(r)) {
4784
+ if (Ea(r)) {
4784
4785
  t.gasPrice = BigInt(0);
4785
4786
  } else {
4786
4787
  t.maxFeePerGas = it.maxFeePerGas;
@@ -4812,7 +4813,7 @@ var kt = (r) => {
4812
4813
  var U = async (r, e) => {
4813
4814
  try {
4814
4815
  const t = await r.getSigner();
4815
- const o = await Ca(r, e);
4816
+ const o = await Ra(r, e);
4816
4817
  const n = await t.sendTransaction(o);
4817
4818
  return {
4818
4819
  transactionResponse: n
@@ -4877,7 +4878,7 @@ var Ye = async (r, e) => {
4877
4878
  type: "SUCCESS"
4878
4879
  };
4879
4880
  };
4880
- var Vr = async (r, e) => {
4881
+ var jr = async (r, e) => {
4881
4882
  try {
4882
4883
  const t = await (await r.getSigner()).signTypedData(
4883
4884
  e.unsignedMessage.domain,
@@ -4902,9 +4903,9 @@ var Vr = async (r, e) => {
4902
4903
  import {
4903
4904
  TransactionPurpose as Je,
4904
4905
  ActionType as $e,
4905
- SignablePurpose as Ia
4906
+ SignablePurpose as Ta
4906
4907
  } from "@imtbl/orderbook";
4907
- var Kr = async (r) => {
4908
+ var Vr = async (r) => {
4908
4909
  let e = [];
4909
4910
  let t = [];
4910
4911
  const o = [];
@@ -4925,7 +4926,7 @@ var Kr = async (r) => {
4925
4926
  fulfillmentTransactions: t
4926
4927
  };
4927
4928
  };
4928
- var Hr = async (r) => {
4929
+ var Kr = async (r) => {
4929
4930
  let e = [];
4930
4931
  const t = [];
4931
4932
  for (const o of r) {
@@ -4949,11 +4950,11 @@ var Nt = async (r) => {
4949
4950
  e = await Promise.all(t);
4950
4951
  return e;
4951
4952
  };
4952
- var zr = (r, e, t) => {
4953
+ var Hr = (r, e, t) => {
4953
4954
  let o;
4954
4955
  for (const n of t) {
4955
4956
  if (n.type !== $e.SIGNABLE) continue;
4956
- if (n.purpose === Ia.CREATE_LISTING) {
4957
+ if (n.purpose === Ta.CREATE_LISTING) {
4957
4958
  o = {
4958
4959
  domain: n.message.domain,
4959
4960
  types: n.message.types,
@@ -4970,10 +4971,10 @@ var zr = (r, e, t) => {
4970
4971
  };
4971
4972
 
4972
4973
  // src/smartCheckout/fees/fees.ts
4973
- import { parseUnits as ha } from "ethers";
4974
- var Qr = 1;
4974
+ import { parseUnits as Ia } from "ethers";
4975
+ var zr = 1;
4975
4976
  var Xe = 6;
4976
- var Aa = (r, e, t = BigInt(1)) => {
4977
+ var ha = (r, e, t = BigInt(1)) => {
4977
4978
  const o = r.amount;
4978
4979
  const n = Math.round(o.percentageDecimal * 10 ** Xe);
4979
4980
  const a = e * BigInt(n) / BigInt(10 ** Xe);
@@ -4981,18 +4982,18 @@ var Aa = (r, e, t = BigInt(1)) => {
4981
4982
  };
4982
4983
  var ya = (r, e) => {
4983
4984
  const t = r.amount;
4984
- const o = ha(t.token, e);
4985
+ const o = Ia(t.token, e);
4985
4986
  return o;
4986
4987
  };
4987
4988
  var et = (r, e, t = 18, o = BigInt(1)) => {
4988
4989
  let n = BigInt(0);
4989
4990
  const a = BigInt(e);
4990
- const i = a * BigInt(Qr * 10 ** Xe) / BigInt(10 ** Xe);
4991
+ const i = a * BigInt(zr * 10 ** Xe) / BigInt(10 ** Xe);
4991
4992
  const s = [];
4992
4993
  for (const c of r) {
4993
4994
  let p = BigInt(0);
4994
4995
  if (Object.hasOwn(c.amount, "percentageDecimal")) {
4995
- p = Aa(c, a, o);
4996
+ p = ha(c, a, o);
4996
4997
  n += p;
4997
4998
  } else if (Object.hasOwn(c.amount, "token")) {
4998
4999
  p = ya(c, t);
@@ -5005,7 +5006,7 @@ var et = (r, e, t = 18, o = BigInt(1)) => {
5005
5006
  }
5006
5007
  if (n > i) {
5007
5008
  throw new m(
5008
- `The combined fees are above the allowed maximum of ${Qr * 100}%`,
5009
+ `The combined fees are above the allowed maximum of ${zr * 100}%`,
5009
5010
  "ORDER_FEE_ERROR"
5010
5011
  );
5011
5012
  }
@@ -5020,7 +5021,7 @@ var et = (r, e, t = 18, o = BigInt(1)) => {
5020
5021
  };
5021
5022
 
5022
5023
  // src/smartCheckout/buy/buy.ts
5023
- var ka = (r, e, t, o, n = false) => {
5024
+ var Sa = (r, e, t, o, n = false) => {
5024
5025
  switch (r) {
5025
5026
  case "ERC20":
5026
5027
  return {
@@ -5039,7 +5040,7 @@ var ka = (r, e, t, o, n = false) => {
5039
5040
  };
5040
5041
  }
5041
5042
  };
5042
- var va = (r, e) => {
5043
+ var ka = (r, e) => {
5043
5044
  if (e.length > 0) {
5044
5045
  return {
5045
5046
  type: "TRANSACTION",
@@ -5054,10 +5055,10 @@ var va = (r, e) => {
5054
5055
  }
5055
5056
  };
5056
5057
  };
5057
- var Zr = async (r, e, t, o = {
5058
+ var Qr = async (r, e, t, o = {
5058
5059
  waitFulfillmentSettlements: true
5059
5060
  }) => {
5060
- Sa("checkout_sdk", "buy_initiated");
5061
+ Pa("checkout_sdk", "buy_initiated");
5061
5062
  if (t.length === 0) {
5062
5063
  throw new m(
5063
5064
  "No orders were provided to the orders array. Please provide at least one order.",
@@ -5067,8 +5068,8 @@ var Zr = async (r, e, t, o = {
5067
5068
  let n;
5068
5069
  let a = "";
5069
5070
  let i = 18;
5070
- const s = wa.estimatedFulfillmentGasGwei;
5071
- const c = ce(r);
5071
+ const s = Aa.estimatedFulfillmentGasGwei;
5072
+ const c = de(r);
5072
5073
  const p = Le(r);
5073
5074
  const u = await k(
5074
5075
  r,
@@ -5076,8 +5077,8 @@ var Zr = async (r, e, t, o = {
5076
5077
  (await e.getSigner()).getAddress()
5077
5078
  );
5078
5079
  Rt();
5079
- j(r, e, u, _(r));
5080
- j(r, e, u, w(r));
5080
+ V(r, e, u, _(r));
5081
+ V(r, e, u, w(r));
5081
5082
  const { id: g, takerFees: f, fillAmount: R } = t[0];
5082
5083
  let C;
5083
5084
  try {
@@ -5086,8 +5087,8 @@ var Zr = async (r, e, t, o = {
5086
5087
  "Time to fetch the listing from the orderbook",
5087
5088
  c.getListing(g)
5088
5089
  );
5089
- const { seaportContractAddress: N, chainName: te } = c.config();
5090
- C = te;
5090
+ const { seaportContractAddress: N, chainName: re } = c.config();
5091
+ C = re;
5091
5092
  a = N;
5092
5093
  } catch (N) {
5093
5094
  throw new m(
@@ -5123,7 +5124,7 @@ var Zr = async (r, e, t, o = {
5123
5124
  const N = n.result.sell[0].type === "ERC721" ? BigInt(1) : BigInt(n.result.sell[0].amount);
5124
5125
  T = et(f, E.amount, i, N);
5125
5126
  }
5126
- let A = [];
5127
+ let y = [];
5127
5128
  let I = [];
5128
5129
  let P = [];
5129
5130
  const v = performance.now();
@@ -5134,15 +5135,15 @@ var Zr = async (r, e, t, o = {
5134
5135
  c.fulfillOrder(g, u, T, R)
5135
5136
  );
5136
5137
  P = N;
5137
- A = await k(
5138
+ y = await k(
5138
5139
  r,
5139
5140
  "Time to construct the unsigned approval transactions",
5140
- Hr(N)
5141
+ Kr(N)
5141
5142
  );
5142
5143
  } 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)) {
5144
+ const re = (performance.now() - v) / 1e3;
5145
+ pt(r, "Time to call fulfillOrder from the orderbook", re);
5146
+ if (N.message.includes(wa.EXPIRED)) {
5146
5147
  throw new m("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: g });
5147
5148
  }
5148
5149
  if (!N.message.includes("The fulfiller does not have the balances needed to fulfill")) {
@@ -5166,16 +5167,16 @@ var Zr = async (r, e, t, o = {
5166
5167
  }
5167
5168
  let O = BigInt("0");
5168
5169
  let Q = "NATIVE";
5169
- let pe = "";
5170
- const ee = n.result.buy;
5171
- if (ee.length > 0) {
5172
- switch (ee[0].type) {
5170
+ let ue = "";
5171
+ const te = n.result.buy;
5172
+ if (te.length > 0) {
5173
+ switch (te[0].type) {
5173
5174
  case "NATIVE":
5174
5175
  Q = "NATIVE";
5175
5176
  break;
5176
5177
  case "ERC20":
5177
5178
  Q = "ERC20";
5178
- pe = ee[0].contractAddress;
5179
+ ue = te[0].contractAddress;
5179
5180
  break;
5180
5181
  default:
5181
5182
  throw new m(
@@ -5187,7 +5188,7 @@ var Zr = async (r, e, t, o = {
5187
5188
  );
5188
5189
  }
5189
5190
  }
5190
- ee.forEach((N) => {
5191
+ te.forEach((N) => {
5191
5192
  if (N.type !== "ERC721") {
5192
5193
  O += BigInt(N.amount);
5193
5194
  }
@@ -5200,86 +5201,86 @@ var Zr = async (r, e, t, o = {
5200
5201
  O = O * BigInt(R) / BigInt(n.result.sell[0].amount);
5201
5202
  }
5202
5203
  const rt = [
5203
- ka(Q, pe, O, a)
5204
+ Sa(Q, ue, O, a)
5204
5205
  ];
5205
- const V = await k(
5206
+ const K = await k(
5206
5207
  r,
5207
5208
  "Total time running smart checkout",
5208
- le(
5209
+ pe(
5209
5210
  r,
5210
5211
  e,
5211
5212
  rt,
5212
- va(
5213
+ ka(
5213
5214
  s,
5214
5215
  I
5215
5216
  )
5216
5217
  )
5217
5218
  );
5218
- if (V.sufficient) {
5219
- const N = await Ze(e, A);
5219
+ if (K.sufficient) {
5220
+ const N = await Ze(e, y);
5220
5221
  if (N.type === "FAILED") {
5221
5222
  return {
5222
5223
  status: "FAILED",
5223
5224
  transactionHash: N.transactionHash,
5224
5225
  reason: N.reason,
5225
- smartCheckoutResult: V
5226
+ smartCheckoutResult: K
5226
5227
  };
5227
5228
  }
5228
5229
  try {
5229
5230
  if (I.length === 0) {
5230
5231
  I = await Nt(P);
5231
5232
  }
5232
- } catch (K) {
5233
+ } catch (H) {
5233
5234
  throw new m(
5234
5235
  "Error fetching fulfillment transaction",
5235
5236
  "FULFILL_ORDER_LISTING_ERROR",
5236
- { error: K }
5237
+ { error: H }
5237
5238
  );
5238
5239
  }
5239
5240
  if (o.waitFulfillmentSettlements) {
5240
- const K = await Ye(e, I);
5241
- if (K.type === "FAILED") {
5241
+ const H = await Ye(e, I);
5242
+ if (H.type === "FAILED") {
5242
5243
  return {
5243
5244
  status: "FAILED",
5244
- transactionHash: K.transactionHash,
5245
- reason: K.reason,
5246
- smartCheckoutResult: V
5245
+ transactionHash: H.transactionHash,
5246
+ reason: H.reason,
5247
+ smartCheckoutResult: K
5247
5248
  };
5248
5249
  }
5249
5250
  return {
5250
5251
  status: "SUCCESS",
5251
- smartCheckoutResult: V
5252
+ smartCheckoutResult: K
5252
5253
  };
5253
5254
  }
5254
- let te;
5255
+ let re;
5255
5256
  try {
5256
- const K = await Promise.all(I.map(
5257
+ const H = await Promise.all(I.map(
5257
5258
  (ot) => U(e, ot)
5258
5259
  ));
5259
- te = K.map((ot) => ot.transactionResponse);
5260
- } catch (K) {
5260
+ re = H.map((ot) => ot.transactionResponse);
5261
+ } catch (H) {
5261
5262
  throw new m(
5262
5263
  "An error occurred while executing the fulfillment transaction",
5263
5264
  "EXECUTE_FULFILLMENT_TRANSACTION_ERROR",
5264
5265
  {
5265
- message: K.message
5266
+ message: H.message
5266
5267
  }
5267
5268
  );
5268
5269
  }
5269
5270
  return {
5270
5271
  status: "FULFILLMENTS_UNSETTLED",
5271
- smartCheckoutResult: V,
5272
- transactions: te
5272
+ smartCheckoutResult: K,
5273
+ transactions: re
5273
5274
  };
5274
5275
  }
5275
5276
  return {
5276
5277
  status: "INSUFFICIENT_FUNDS",
5277
- smartCheckoutResult: V
5278
+ smartCheckoutResult: K
5278
5279
  };
5279
5280
  };
5280
5281
 
5281
5282
  // src/smartCheckout/cancel/cancel.ts
5282
- var _a = async (r, e, t, o, n) => {
5283
+ var Na = async (r, e, t, o, n) => {
5283
5284
  let a;
5284
5285
  if (o.length === 0) {
5285
5286
  throw new m(
@@ -5346,7 +5347,7 @@ var _a = async (r, e, t, o, n) => {
5346
5347
  transactions: s
5347
5348
  };
5348
5349
  };
5349
- var Oa = async (r, e, t) => {
5350
+ var _a = async (r, e, t) => {
5350
5351
  try {
5351
5352
  const o = await e.getSigner();
5352
5353
  const n = await o.getAddress();
@@ -5392,15 +5393,15 @@ var Oa = async (r, e, t) => {
5392
5393
  );
5393
5394
  }
5394
5395
  };
5395
- var Yr = async (r, e, t, o = {
5396
+ var Zr = async (r, e, t, o = {
5396
5397
  waitFulfillmentSettlements: true,
5397
5398
  useGaslessCancel: false
5398
5399
  }) => {
5399
- const n = ce(r);
5400
+ const n = de(r);
5400
5401
  if (o.useGaslessCancel) {
5401
- return await Oa(n, e, t);
5402
+ return await _a(n, e, t);
5402
5403
  }
5403
- return await _a(
5404
+ return await Na(
5404
5405
  r,
5405
5406
  n,
5406
5407
  e,
@@ -5410,13 +5411,13 @@ var Yr = async (r, e, t, o = {
5410
5411
  };
5411
5412
 
5412
5413
  // src/smartCheckout/itemRequirements/itemRequirements.ts
5413
- import { parseUnits as Jr } from "ethers";
5414
- async function $r(r, e) {
5414
+ import { parseUnits as Yr } from "ethers";
5415
+ async function Jr(r, e) {
5415
5416
  const t = [];
5416
5417
  e.forEach((a) => {
5417
5418
  if (a.type === "ERC20") {
5418
5419
  const { tokenAddress: i } = a;
5419
- t.push(ar(i, W, r).decimals());
5420
+ t.push(nr(i, W, r).decimals());
5420
5421
  }
5421
5422
  });
5422
5423
  const o = await Promise.all(t);
@@ -5424,13 +5425,13 @@ async function $r(r, e) {
5424
5425
  if (a.type === "NATIVE") {
5425
5426
  return {
5426
5427
  ...a,
5427
- amount: Jr(a.amount, 18)
5428
+ amount: Yr(a.amount, 18)
5428
5429
  };
5429
5430
  }
5430
5431
  if (a.type === "ERC20") {
5431
5432
  return {
5432
5433
  ...a,
5433
- amount: Jr(a.amount, o[i])
5434
+ amount: Yr(a.amount, o[i])
5434
5435
  };
5435
5436
  }
5436
5437
  return a;
@@ -5439,26 +5440,26 @@ async function $r(r, e) {
5439
5440
  }
5440
5441
 
5441
5442
  // src/smartCheckout/sell/sell.ts
5442
- import { Contract as Ba, parseUnits as Ma } from "ethers";
5443
+ import { Contract as xa, parseUnits as Ba } from "ethers";
5443
5444
  import {
5444
- constants as ba
5445
+ constants as Ma
5445
5446
  } from "@imtbl/orderbook";
5446
- import { track as La } from "@imtbl/metrics";
5447
- var Da = (r, e, t) => ({
5447
+ import { track as ba } from "@imtbl/metrics";
5448
+ var La = (r, e, t) => ({
5448
5449
  type: "ERC721",
5449
5450
  id: r,
5450
5451
  contractAddress: e,
5451
5452
  spenderAddress: t
5452
5453
  });
5453
- var Wa = (r, e, t, o) => ({
5454
+ var Da = (r, e, t, o) => ({
5454
5455
  type: "ERC1155",
5455
5456
  id: r,
5456
5457
  contractAddress: e,
5457
5458
  spenderAddress: t,
5458
5459
  amount: BigInt(o)
5459
5460
  });
5460
- var Fa = (r, e = 18) => {
5461
- const t = Ma(r.amount, e);
5461
+ var Wa = (r, e = 18) => {
5462
+ const t = Ba(r.amount, e);
5462
5463
  if (r.type === "NATIVE") {
5463
5464
  return {
5464
5465
  type: "NATIVE",
@@ -5471,11 +5472,11 @@ var Fa = (r, e = 18) => {
5471
5472
  contractAddress: r.tokenAddress
5472
5473
  };
5473
5474
  };
5474
- var Xr = async (r, e, t) => {
5475
+ var $r = async (r, e, t) => {
5475
5476
  let o;
5476
5477
  let n;
5477
5478
  let a = "";
5478
- La("checkout_sdk", "sell_initiated");
5479
+ ba("checkout_sdk", "sell_initiated");
5479
5480
  if (t.length === 0) {
5480
5481
  throw new m(
5481
5482
  "No orders were provided to the orders array. Please provide at least one order.",
@@ -5490,7 +5491,7 @@ var Xr = async (r, e, t) => {
5490
5491
  } = t[0];
5491
5492
  let u = 18;
5492
5493
  if (i.type === "ERC20") {
5493
- const E = new Ba(
5494
+ const E = new xa(
5494
5495
  i.tokenAddress,
5495
5496
  JSON.stringify(W),
5496
5497
  e
@@ -5501,7 +5502,7 @@ var Xr = async (r, e, t) => {
5501
5502
  E.decimals()
5502
5503
  );
5503
5504
  }
5504
- const g = Fa(i, u);
5505
+ const g = Wa(i, u);
5505
5506
  const f = "type" in s;
5506
5507
  try {
5507
5508
  const E = await k(
@@ -5509,10 +5510,10 @@ var Xr = async (r, e, t) => {
5509
5510
  "Time to get the address from the provider",
5510
5511
  (await e.getSigner()).getAddress()
5511
5512
  );
5512
- o = ce(r);
5513
+ o = de(r);
5513
5514
  const { seaportContractAddress: T } = o.config();
5514
5515
  a = T;
5515
- const A = f && s.type === "ERC1155" ? {
5516
+ const y = f && s.type === "ERC1155" ? {
5516
5517
  type: "ERC1155",
5517
5518
  contractAddress: s.collectionAddress,
5518
5519
  tokenId: s.id,
@@ -5528,7 +5529,7 @@ var Xr = async (r, e, t) => {
5528
5529
  o.prepareListing({
5529
5530
  makerAddress: E,
5530
5531
  buy: g,
5531
- sell: A,
5532
+ sell: y,
5532
5533
  orderExpiry: p
5533
5534
  })
5534
5535
  );
@@ -5545,7 +5546,7 @@ var Xr = async (r, e, t) => {
5545
5546
  }
5546
5547
  const R = [];
5547
5548
  if (f && s.type === "ERC1155") {
5548
- const E = Wa(
5549
+ const E = Da(
5549
5550
  s.id,
5550
5551
  s.collectionAddress,
5551
5552
  a,
@@ -5553,15 +5554,15 @@ var Xr = async (r, e, t) => {
5553
5554
  );
5554
5555
  R.push(E);
5555
5556
  } else {
5556
- const E = Da(s.id, s.collectionAddress, a);
5557
+ const E = La(s.id, s.collectionAddress, a);
5557
5558
  R.push(E);
5558
5559
  }
5559
5560
  let C;
5560
- if (!yt(e)) {
5561
+ if (!At(e)) {
5561
5562
  C = await k(
5562
5563
  r,
5563
5564
  "Total time running smart checkout",
5564
- le(
5565
+ pe(
5565
5566
  r,
5566
5567
  e,
5567
5568
  R,
@@ -5569,7 +5570,7 @@ var Xr = async (r, e, t) => {
5569
5570
  type: "GAS",
5570
5571
  gasToken: {
5571
5572
  type: "NATIVE",
5572
- limit: BigInt(ba.estimatedFulfillmentGasGwei)
5573
+ limit: BigInt(Ma.estimatedFulfillmentGasGwei)
5573
5574
  }
5574
5575
  }
5575
5576
  )
@@ -5578,7 +5579,7 @@ var Xr = async (r, e, t) => {
5578
5579
  C = { sufficient: true, transactionRequirements: [] };
5579
5580
  }
5580
5581
  if (C.sufficient) {
5581
- const E = await Kr(n.actions);
5582
+ const E = await Vr(n.actions);
5582
5583
  const T = await Ze(e, E.approvalTransactions);
5583
5584
  if (T.type === "FAILED") {
5584
5585
  return {
@@ -5588,12 +5589,12 @@ var Xr = async (r, e, t) => {
5588
5589
  smartCheckoutResult: C
5589
5590
  };
5590
5591
  }
5591
- const A = zr(
5592
+ const y = Hr(
5592
5593
  n.orderHash,
5593
5594
  n.orderComponents,
5594
5595
  n.actions
5595
5596
  );
5596
- if (!A) {
5597
+ if (!y) {
5597
5598
  throw new m(
5598
5599
  "The unsigned message is missing after preparing the listing",
5599
5600
  "SIGN_MESSAGE_ERROR",
@@ -5603,9 +5604,9 @@ var Xr = async (r, e, t) => {
5603
5604
  }
5604
5605
  );
5605
5606
  }
5606
- const I = await Vr(
5607
+ const I = await jr(
5607
5608
  e,
5608
- A
5609
+ y
5609
5610
  );
5610
5611
  let P = "";
5611
5612
  const v = {
@@ -5653,7 +5654,7 @@ var Xr = async (r, e, t) => {
5653
5654
  };
5654
5655
 
5655
5656
  // src/swap/swap.ts
5656
- import { parseUnits as eo } from "ethers";
5657
+ import { parseUnits as Xr } from "ethers";
5657
5658
  var _t = async (r, e, t, o, n, a, i, s, c) => {
5658
5659
  if (!t.address || t.decimals === 0) {
5659
5660
  throw new m(
@@ -5680,14 +5681,14 @@ var _t = async (r, e, t, o, n, a, i, s, c) => {
5680
5681
  );
5681
5682
  }
5682
5683
  const p = w(r);
5683
- const u = await se(p, r);
5684
+ const u = await ce(p, r);
5684
5685
  const g = await (await e.getSigner()).getAddress();
5685
5686
  if (n) {
5686
5687
  return u.getUnsignedSwapTxFromAmountIn(
5687
5688
  g,
5688
5689
  t.address,
5689
5690
  o.address,
5690
- BigInt(eo(n, t.decimals)),
5691
+ BigInt(Xr(n, t.decimals)),
5691
5692
  i,
5692
5693
  s,
5693
5694
  c
@@ -5697,13 +5698,13 @@ var _t = async (r, e, t, o, n, a, i, s, c) => {
5697
5698
  g,
5698
5699
  t.address,
5699
5700
  o.address,
5700
- BigInt(eo(a, o.decimals)),
5701
+ BigInt(Xr(a, o.decimals)),
5701
5702
  i,
5702
5703
  s,
5703
5704
  c
5704
5705
  );
5705
5706
  };
5706
- var to = async (r, e, t, o, n, a, i, s, c) => {
5707
+ var eo = async (r, e, t, o, n, a, i, s, c) => {
5707
5708
  const p = await _t(
5708
5709
  r,
5709
5710
  e,
@@ -5741,7 +5742,7 @@ var to = async (r, e, t, o, n, a, i, s, c) => {
5741
5742
  };
5742
5743
 
5743
5744
  // src/wallet/wallet.ts
5744
- async function ro(r) {
5745
+ async function to(r) {
5745
5746
  const e = [];
5746
5747
  const t = r.exclude?.map((n) => n.walletProviderName) ?? [];
5747
5748
  let o = Object.values(fe);
@@ -5765,13 +5766,13 @@ var Ot = async (r, e) => Object.fromEntries(
5765
5766
 
5766
5767
  // src/riskAssessment/common.ts
5767
5768
  var xt = (r, e) => false;
5768
- var ja = (r, e) => false;
5769
- var Va = (r) => false;
5769
+ var qa = (r, e) => false;
5770
+ var ja = (r) => false;
5770
5771
 
5771
5772
  // src/sdk.ts
5772
- var Ha = {
5773
+ var Ka = {
5773
5774
  baseConfig: {
5774
- environment: Ka.SANDBOX
5775
+ environment: Va.SANDBOX
5775
5776
  },
5776
5777
  passport: void 0
5777
5778
  };
@@ -5786,9 +5787,9 @@ var Bt = class {
5786
5787
  * Constructs a new instance of the CheckoutModule class.
5787
5788
  * @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
5788
5789
  */
5789
- constructor(e = Ha) {
5790
- this.httpClient = new ue(e);
5791
- this.config = new Ae(e, this.httpClient);
5790
+ constructor(e = Ka) {
5791
+ this.httpClient = new Y(e);
5792
+ this.config = new ye(e, this.httpClient);
5792
5793
  this.fiatRampService = new Me(this.config);
5793
5794
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5794
5795
  this.availability = Ne(
@@ -5832,7 +5833,7 @@ var Bt = class {
5832
5833
  * @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
5833
5834
  */
5834
5835
  async createProvider(e) {
5835
- return await cr(
5836
+ return await sr(
5836
5837
  e.walletProviderName,
5837
5838
  this.passport
5838
5839
  );
@@ -5881,7 +5882,7 @@ var Bt = class {
5881
5882
  allowUnsupportedProvider: true
5882
5883
  }
5883
5884
  );
5884
- return Xt(t);
5885
+ return $t(t);
5885
5886
  }
5886
5887
  /**
5887
5888
  * Fetches the risk assessment for the given addresses.
@@ -5918,9 +5919,9 @@ var Bt = class {
5918
5919
  }
5919
5920
  );
5920
5921
  if (e.requestWalletPermissions && !St(t)) {
5921
- await tr(t);
5922
- } else {
5923
5922
  await er(t);
5923
+ } else {
5924
+ await Xt(t);
5924
5925
  }
5925
5926
  return t;
5926
5927
  }
@@ -5960,7 +5961,7 @@ var Bt = class {
5960
5961
  allowMistmatchedChainId: true
5961
5962
  }
5962
5963
  );
5963
- const o = await zt(
5964
+ const o = await Ht(
5964
5965
  this.config,
5965
5966
  t,
5966
5967
  e.chainId
@@ -6006,7 +6007,7 @@ var Bt = class {
6006
6007
  */
6007
6008
  async getAllBalances(e) {
6008
6009
  const t = !e.provider || "ethereumProvider" in e.provider ? e.provider : new D(e.provider);
6009
- return j(
6010
+ return V(
6010
6011
  this.config,
6011
6012
  t,
6012
6013
  e.walletAddress,
@@ -6019,7 +6020,7 @@ var Bt = class {
6019
6020
  * @returns {Promise<GetNetworkAllowListResult>} - A promise that resolves to the network allow list result.
6020
6021
  */
6021
6022
  async getNetworkAllowList(e) {
6022
- return await $(this.config, e);
6023
+ return await X(this.config, e);
6023
6024
  }
6024
6025
  /**
6025
6026
  * Retrieves the supported tokens based on the provided parameters.
@@ -6035,7 +6036,7 @@ var Bt = class {
6035
6036
  * @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
6036
6037
  */
6037
6038
  async getWalletAllowList(e) {
6038
- return await ro(e);
6039
+ return await to(e);
6039
6040
  }
6040
6041
  /**
6041
6042
  * Sends a transaction using the specified provider and transaction parameters.
@@ -6107,7 +6108,7 @@ var Bt = class {
6107
6108
  this.config,
6108
6109
  e.provider
6109
6110
  );
6110
- return await Zr(
6111
+ return await Qr(
6111
6112
  this.config,
6112
6113
  t,
6113
6114
  e.orders,
@@ -6133,7 +6134,7 @@ var Bt = class {
6133
6134
  this.config,
6134
6135
  e.provider
6135
6136
  );
6136
- return await Xr(this.config, t, e.orders);
6137
+ return await $r(this.config, t, e.orders);
6137
6138
  }
6138
6139
  /**
6139
6140
  * Cancels a sell.
@@ -6149,7 +6150,7 @@ var Bt = class {
6149
6150
  this.config,
6150
6151
  e.provider
6151
6152
  );
6152
- return await Yr(
6153
+ return await Zr(
6153
6154
  this.config,
6154
6155
  t,
6155
6156
  e.orderIds,
@@ -6175,7 +6176,7 @@ var Bt = class {
6175
6176
  );
6176
6177
  let o = [];
6177
6178
  try {
6178
- o = await $r(
6179
+ o = await Jr(
6179
6180
  t,
6180
6181
  e.itemRequirements
6181
6182
  );
@@ -6186,7 +6187,7 @@ var Bt = class {
6186
6187
  { error: n }
6187
6188
  );
6188
6189
  }
6189
- return await le(
6190
+ return await pe(
6190
6191
  this.config,
6191
6192
  t,
6192
6193
  o,
@@ -6203,7 +6204,7 @@ var Bt = class {
6203
6204
  * @returns {boolean} - True if the object is a WrappedBrowserProvider, false otherwise.
6204
6205
  */
6205
6206
  static isWrappedBrowserProvider(e) {
6206
- return dr(e);
6207
+ return cr(e);
6207
6208
  }
6208
6209
  /**
6209
6210
  * Estimates the gas required for a swap or bridge transaction.
@@ -6215,7 +6216,7 @@ var Bt = class {
6215
6216
  this.config,
6216
6217
  this.readOnlyProviders
6217
6218
  );
6218
- return await sr(
6219
+ return await ir(
6219
6220
  e,
6220
6221
  this.readOnlyProviders,
6221
6222
  this.config
@@ -6282,7 +6283,7 @@ var Bt = class {
6282
6283
  this.config,
6283
6284
  e.provider
6284
6285
  );
6285
- return to(
6286
+ return eo(
6286
6287
  this.config,
6287
6288
  t,
6288
6289
  e.fromToken,
@@ -6327,67 +6328,67 @@ var tt = class {
6327
6328
  * @returns {string | undefined} The URL to view the transaction on Blockscout, or undefined if the chain ID or hash is invalid
6328
6329
  */
6329
6330
  static getTransactionLink(e, t) {
6330
- const o = oe?.[e]?.url;
6331
+ const o = ne?.[e]?.url;
6331
6332
  if (!o || !t) return void 0;
6332
6333
  return `${o}/tx/${t}`;
6333
6334
  }
6334
6335
  };
6335
6336
  export {
6336
- Co as AddTokensEventType,
6337
+ Ro as AddTokensEventType,
6337
6338
  tt as BlockExplorerService,
6338
- po as BridgeEventType,
6339
- Y as ChainId,
6339
+ lo as BridgeEventType,
6340
+ J as ChainId,
6340
6341
  nt as ChainName,
6341
6342
  we as ChainSlug,
6342
6343
  Bt as Checkout,
6343
- Ae as CheckoutConfiguration,
6344
+ ye as CheckoutConfiguration,
6344
6345
  m as CheckoutError,
6345
6346
  S as CheckoutErrorType,
6346
6347
  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,
6348
+ mo as CommerceEventType,
6349
+ fo as CommerceFailureEventType,
6350
+ Ao as CommerceFlowType,
6351
+ go as CommerceSuccessEventType,
6352
+ Eo as CommerceUserActionEventType,
6353
+ no as ConnectEventType,
6354
+ ho as ConnectTargetLayer,
6355
+ jt as ExchangeType,
6355
6356
  _e as FeeType,
6356
6357
  Te as FundingStepType,
6357
6358
  st as GasEstimateType,
6358
6359
  Ce as GasTokenType,
6359
- H as IMMUTABLE_API_BASE_URL,
6360
- oo as IMTBLWidgetEvents,
6360
+ q as IMMUTABLE_API_BASE_URL,
6361
+ ro as IMTBLWidgetEvents,
6361
6362
  M as ItemType,
6362
6363
  ge as NetworkFilterTypes,
6363
- mo as OnRampEventType,
6364
- uo as OrchestrationEventType,
6365
- no as ProviderEventType,
6366
- To as PurchaseEventType,
6364
+ uo as OnRampEventType,
6365
+ po as OrchestrationEventType,
6366
+ oo as ProviderEventType,
6367
+ Co as PurchaseEventType,
6367
6368
  ct as RoutingOutcomeType,
6368
- co as SaleEventType,
6369
- lo as SalePaymentTypes,
6369
+ so as SaleEventType,
6370
+ co as SalePaymentTypes,
6370
6371
  yo as SwapDirection,
6371
- so as SwapEventType,
6372
- ae as TokenFilterTypes,
6372
+ io as SwapEventType,
6373
+ ie as TokenFilterTypes,
6373
6374
  Re as TransactionOrGasType,
6374
- Io as TransferEventType,
6375
- io as WalletEventType,
6376
- Gt as WalletFilterTypes,
6375
+ To as TransferEventType,
6376
+ ao as WalletEventType,
6377
+ Ut as WalletFilterTypes,
6377
6378
  fe as WalletProviderName,
6378
- qt as WalletProviderRdns,
6379
- Po as WidgetTheme,
6380
- ho as WidgetType,
6379
+ Gt as WalletProviderRdns,
6380
+ wo as WidgetTheme,
6381
+ Io as WidgetType,
6381
6382
  D as WrappedBrowserProvider,
6382
6383
  Ot as fetchRiskAssessment,
6383
6384
  Ct as getGasPriceInWei,
6384
- fn as getMetaMaskProviderDetail,
6385
- gn as getPassportProviderDetail,
6385
+ gn as getMetaMaskProviderDetail,
6386
+ mn as getPassportProviderDetail,
6386
6387
  Ie as getUnderlyingChainId,
6387
6388
  xt as isAddressSanctioned,
6388
- ja as isSingleAddressSanctioned,
6389
+ qa as isSingleAddressSanctioned,
6389
6390
  De as metaMaskProviderInfo,
6390
6391
  We as passportProviderInfo,
6391
- Va as resultHasSanctionedWallets,
6392
+ ja as resultHasSanctionedWallets,
6392
6393
  b as validateProvider
6393
6394
  };