@skip-go/widget 3.10.2 → 3.10.4

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.
@@ -6,8 +6,8 @@ import NiceModal, { useModal } from "@ebay/nice-modal-react";
6
6
  import { assets, chains, bridges, venues, transactionStatus, ChainType, getSigningStargateClient, route, executeRoute, balances, FeeType, GAS_STATION_CHAIN_IDS, setClientOptions } from "@skip-go/client";
7
7
  import { atomWithQuery, atomWithMutation } from "jotai-tanstack-query";
8
8
  import pluralize from "pluralize";
9
- import { track, setUserId, add, init as init$1 } from "@amplitude/analytics-browser";
10
- import { setTag, setUser, getReplay, init, breadcrumbsIntegration, dedupeIntegration, functionToStringIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration, browserSessionIntegration, replayIntegration } from "@sentry/react";
9
+ import { track, init, add, setUserId } from "@amplitude/analytics-browser";
10
+ import { setTag, setUser, getReplay, init as init$1, breadcrumbsIntegration, dedupeIntegration, functionToStringIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration, browserSessionIntegration, replayIntegration } from "@sentry/react";
11
11
  import { useQuery, useMutation, QueryClient, QueryClientProvider } from "@tanstack/react-query";
12
12
  import { atomEffect } from "jotai-effect";
13
13
  import { getWallet, WalletType, useActiveWalletType, useDisconnect, isWalletConnect, checkWallet, connect, useAccount as useAccount$1, getChainInfo as getChainInfo$1, GrazProvider } from "graz";
@@ -1734,21 +1734,22 @@ function atomWithStorage(key, initialValue, storage = defaultStorage, options) {
1734
1734
  );
1735
1735
  return anAtom;
1736
1736
  }
1737
- const errorAtom = atomWithReset(void 0);
1738
- var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
1739
- ErrorType2[ErrorType2["AuthFailed"] = 0] = "AuthFailed";
1740
- ErrorType2[ErrorType2["Timeout"] = 1] = "Timeout";
1741
- ErrorType2[ErrorType2["AdditionalSigningRequired"] = 2] = "AdditionalSigningRequired";
1742
- ErrorType2[ErrorType2["BadPriceWarning"] = 3] = "BadPriceWarning";
1743
- ErrorType2[ErrorType2["TransactionFailed"] = 4] = "TransactionFailed";
1744
- ErrorType2[ErrorType2["TransactionReverted"] = 5] = "TransactionReverted";
1745
- ErrorType2[ErrorType2["Unexpected"] = 6] = "Unexpected";
1746
- ErrorType2[ErrorType2["CosmosLedgerWarning"] = 7] = "CosmosLedgerWarning";
1747
- ErrorType2[ErrorType2["GoFastWarning"] = 8] = "GoFastWarning";
1748
- ErrorType2[ErrorType2["LowInfoWarning"] = 9] = "LowInfoWarning";
1749
- ErrorType2[ErrorType2["InsufficientBalanceForGas"] = 10] = "InsufficientBalanceForGas";
1750
- return ErrorType2;
1751
- })(ErrorType || {});
1737
+ const errorWarningAtom = atomWithReset(void 0);
1738
+ var ErrorWarningType = /* @__PURE__ */ ((ErrorWarningType2) => {
1739
+ ErrorWarningType2[ErrorWarningType2["AuthFailed"] = 0] = "AuthFailed";
1740
+ ErrorWarningType2[ErrorWarningType2["Timeout"] = 1] = "Timeout";
1741
+ ErrorWarningType2[ErrorWarningType2["AdditionalSigningRequired"] = 2] = "AdditionalSigningRequired";
1742
+ ErrorWarningType2[ErrorWarningType2["BadPriceWarning"] = 3] = "BadPriceWarning";
1743
+ ErrorWarningType2[ErrorWarningType2["TransactionFailed"] = 4] = "TransactionFailed";
1744
+ ErrorWarningType2[ErrorWarningType2["TransactionReverted"] = 5] = "TransactionReverted";
1745
+ ErrorWarningType2[ErrorWarningType2["Unexpected"] = 6] = "Unexpected";
1746
+ ErrorWarningType2[ErrorWarningType2["CosmosLedgerWarning"] = 7] = "CosmosLedgerWarning";
1747
+ ErrorWarningType2[ErrorWarningType2["GoFastWarning"] = 8] = "GoFastWarning";
1748
+ ErrorWarningType2[ErrorWarningType2["LowInfoWarning"] = 9] = "LowInfoWarning";
1749
+ ErrorWarningType2[ErrorWarningType2["InsufficientBalanceForGas"] = 10] = "InsufficientBalanceForGas";
1750
+ ErrorWarningType2[ErrorWarningType2["ExpiredRelayFeeQuote"] = 11] = "ExpiredRelayFeeQuote";
1751
+ return ErrorWarningType2;
1752
+ })(ErrorWarningType || {});
1752
1753
  const flexProps = lt`
1753
1754
  display: flex;
1754
1755
  ${({ align }) => align && `align-items: ${align}`};
@@ -1805,7 +1806,7 @@ function atomWithStorageNoCrossTabSync(storageKey, initialValue) {
1805
1806
  },
1806
1807
  removeItem: (key) => {
1807
1808
  if (typeof window === "undefined") return;
1808
- localStorage.delete(key);
1809
+ localStorage.removeItem(key);
1809
1810
  }
1810
1811
  };
1811
1812
  return atomWithStorage(storageKey, initialValue, defaultStorage2, { getOnInit: true });
@@ -2199,7 +2200,7 @@ const TextButton = dt(Text).attrs({ as: "button" })`
2199
2200
  ${removeButtonStyles}
2200
2201
  cursor: pointer;
2201
2202
  `;
2202
- const ErrorPageContent = ({
2203
+ const ErrorWarningPageContent = ({
2203
2204
  title,
2204
2205
  description: description2,
2205
2206
  textColor,
@@ -2211,7 +2212,7 @@ const ErrorPageContent = ({
2211
2212
  backgroundColor ?? (backgroundColor = theme.primary.background.normal);
2212
2213
  const Icon = iconMap[icon];
2213
2214
  return /* @__PURE__ */ jsxs(
2214
- StyledErrorStateContainer,
2215
+ StyledErrorWarningStateContainer,
2215
2216
  {
2216
2217
  align: "center",
2217
2218
  justify: "center",
@@ -2221,7 +2222,7 @@ const ErrorPageContent = ({
2221
2222
  children: [
2222
2223
  /* @__PURE__ */ jsx(Icon, { backgroundColor: textColor, color: backgroundColor, height: 40, width: 40 }),
2223
2224
  typeof title === "string" ? /* @__PURE__ */ jsx(Text, { fontSize: 20, color: textColor, textAlign: "center", children: title }) : title,
2224
- typeof description2 === "string" ? /* @__PURE__ */ jsx(StyledErrorTextInnerContainer, { children: /* @__PURE__ */ jsx(
2225
+ typeof description2 === "string" ? /* @__PURE__ */ jsx(StyledErrorWarningTextInnerContainer, { children: /* @__PURE__ */ jsx(
2225
2226
  SmallText,
2226
2227
  {
2227
2228
  color: textColor,
@@ -2236,13 +2237,13 @@ const ErrorPageContent = ({
2236
2237
  }
2237
2238
  );
2238
2239
  };
2239
- const StyledErrorStateContainer = dt(Column)`
2240
+ const StyledErrorWarningStateContainer = dt(Column)`
2240
2241
  width: 100%;
2241
2242
  height: 225px;
2242
2243
  border-radius: 25px;
2243
2244
  ${({ backgroundColor }) => backgroundColor && `background: ${backgroundColor}`};
2244
2245
  `;
2245
- const StyledErrorTextInnerContainer = dt(Column)`
2246
+ const StyledErrorWarningTextInnerContainer = dt(Column)`
2246
2247
  padding: 8px;
2247
2248
  max-height: 100px;
2248
2249
  overflow-y: auto;
@@ -2587,7 +2588,7 @@ const ROUTE_PREFERENCE_OPTIONS = [
2587
2588
  RoutePreference.FASTEST,
2588
2589
  RoutePreference.CHEAPEST
2589
2590
  ];
2590
- const DEFAULT_DECIMAL_PLACES = 8;
2591
+ const DEFAULT_DECIMAL_PLACES = 6;
2591
2592
  var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
2592
2593
  function clone(configObject) {
2593
2594
  var div, convertBase, parseNumeric, P2 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
@@ -4031,7 +4032,11 @@ function shouldReduceFontSize(value) {
4031
4032
  return valueWithoutCommas.length >= 14;
4032
4033
  }
4033
4034
  const formatDisplayAmount = (input, options = {}) => {
4034
- const { showLessThanSign = true, decimals = 6 } = options;
4035
+ const {
4036
+ showLessThanSign = true,
4037
+ decimals = DEFAULT_DECIMAL_PLACES,
4038
+ abbreviate = true
4039
+ } = options;
4035
4040
  if (input === void 0) {
4036
4041
  return "";
4037
4042
  }
@@ -4050,6 +4055,18 @@ const formatDisplayAmount = (input, options = {}) => {
4050
4055
  const thresholdStr = THRESHOLD.toFixed(decimals);
4051
4056
  return showLessThanSign ? `< ${thresholdStr}` : thresholdStr;
4052
4057
  }
4058
+ if (abbreviate) {
4059
+ const scales = [
4060
+ { value: 1e6, symbol: "M" },
4061
+ { value: 1e3, symbol: "K" }
4062
+ ];
4063
+ for (const { value, symbol } of scales) {
4064
+ if (abs2 >= value) {
4065
+ const formatted = (num / value).toFixed(2).replace(/\.?0+$/, "");
4066
+ return `${formatted}${symbol}`;
4067
+ }
4068
+ }
4069
+ }
4053
4070
  return num.toFixed(decimals).replace(/\.?0+$/, "");
4054
4071
  };
4055
4072
  function limitDecimalsDisplayed(input, decimalPlaces = DEFAULT_DECIMAL_PLACES) {
@@ -4158,7 +4175,7 @@ const SwapPageHeader = ({ leftButton, rightButton, rightContent }) => {
4158
4175
  const StyledSwapPageHeaderContainer = dt(Row)`
4159
4176
  height: 30px;
4160
4177
  `;
4161
- const ErrorPageBadPriceWarning = ({
4178
+ const WarningPageBadPrice = ({
4162
4179
  onClickContinue,
4163
4180
  onClickBack,
4164
4181
  route: route2
@@ -4256,14 +4273,14 @@ const ErrorPageBadPriceWarning = ({
4256
4273
  label: "Back",
4257
4274
  icon: ICONS.thinArrow,
4258
4275
  onClick: () => {
4259
- track("error page: bad price warning - header back button clicked");
4276
+ track("warning page: bad price - header back button clicked");
4260
4277
  onClickBack();
4261
4278
  }
4262
4279
  }
4263
4280
  }
4264
4281
  ),
4265
4282
  /* @__PURE__ */ jsx(
4266
- ErrorPageContent,
4283
+ ErrorWarningPageContent,
4267
4284
  {
4268
4285
  title,
4269
4286
  description: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -4272,7 +4289,7 @@ const ErrorPageBadPriceWarning = ({
4272
4289
  SmallTextButton,
4273
4290
  {
4274
4291
  onClick: () => {
4275
- track("error page: bad price warning - continue anyway button clicked");
4292
+ track("warning page: bad price - continue anyway button clicked");
4276
4293
  onClickContinue();
4277
4294
  },
4278
4295
  color: theme.primary.text.lowContrast,
@@ -4291,7 +4308,7 @@ const ErrorPageBadPriceWarning = ({
4291
4308
  label: "Back",
4292
4309
  icon: ICONS.leftArrow,
4293
4310
  onClick: () => {
4294
- track("error page: bad price warning - main back button clicked");
4311
+ track("warning page: bad price - main back button clicked");
4295
4312
  onClickBack();
4296
4313
  },
4297
4314
  backgroundColor: theme.error.text
@@ -4299,12 +4316,12 @@ const ErrorPageBadPriceWarning = ({
4299
4316
  )
4300
4317
  ] });
4301
4318
  };
4302
- const ErrorPageAuthFailed = ({ onClickBack }) => {
4303
- const setErrorAtom = useSetAtom(errorAtom);
4319
+ const ExpectedErrorPageAuthFailed = ({ onClickBack }) => {
4320
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
4304
4321
  const theme = nt();
4305
4322
  const handleOnClickBack = () => {
4306
- track("error page: user rejected request - back button clicked");
4307
- setErrorAtom(void 0);
4323
+ track("expected error page: user rejected request - back button clicked");
4324
+ setErrorWarningAtom(void 0);
4308
4325
  onClickBack == null ? void 0 : onClickBack();
4309
4326
  };
4310
4327
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -4319,7 +4336,7 @@ const ErrorPageAuthFailed = ({ onClickBack }) => {
4319
4336
  }
4320
4337
  ),
4321
4338
  /* @__PURE__ */ jsx(
4322
- ErrorPageContent,
4339
+ ErrorWarningPageContent,
4323
4340
  {
4324
4341
  title: "Transaction failed",
4325
4342
  description: "User rejected authentication request",
@@ -4370,14 +4387,14 @@ const currentPageAtom = atom$1(
4370
4387
  0
4371
4388
  /* SwapPage */
4372
4389
  );
4373
- const ErrorPageTransactionFailed = ({
4390
+ const UnexpectedErrorPageTransactionFailed = ({
4374
4391
  txHash,
4375
4392
  explorerLink,
4376
4393
  onClickContactSupport,
4377
4394
  onClickBack
4378
4395
  }) => {
4379
4396
  const theme = nt();
4380
- const setErrorAtom = useSetAtom(errorAtom);
4397
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
4381
4398
  const setCurrentPage = useSetAtom(currentPageAtom);
4382
4399
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4383
4400
  /* @__PURE__ */ jsx(
@@ -4387,8 +4404,8 @@ const ErrorPageTransactionFailed = ({
4387
4404
  label: "Back",
4388
4405
  icon: ICONS.thinArrow,
4389
4406
  onClick: () => {
4390
- track("error page: transaction failed - header back button clicked");
4391
- setErrorAtom(void 0);
4407
+ track("unexpected error page: transaction failed - header back button clicked");
4408
+ setErrorWarningAtom(void 0);
4392
4409
  if (onClickBack) {
4393
4410
  onClickBack();
4394
4411
  }
@@ -4398,7 +4415,7 @@ const ErrorPageTransactionFailed = ({
4398
4415
  }
4399
4416
  ),
4400
4417
  /* @__PURE__ */ jsx(
4401
- ErrorPageContent,
4418
+ ErrorWarningPageContent,
4402
4419
  {
4403
4420
  title: "Transaction failed",
4404
4421
  description: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -4409,7 +4426,7 @@ const ErrorPageTransactionFailed = ({
4409
4426
  as: SmallTextButton,
4410
4427
  gap: 5,
4411
4428
  onClick: () => {
4412
- track("error page: transaction failed - explorer link clicked");
4429
+ track("unexpected error page: transaction failed - explorer link clicked");
4413
4430
  window.open(explorerLink, "_blank");
4414
4431
  },
4415
4432
  color: theme.primary.text.lowContrast,
@@ -4432,7 +4449,7 @@ const ErrorPageTransactionFailed = ({
4432
4449
  label: "Contact support",
4433
4450
  icon: ICONS.rightArrow,
4434
4451
  onClick: () => {
4435
- track("error page: transaction failed - contact support button clicked");
4452
+ track("unexpected error page: transaction failed - contact support button clicked");
4436
4453
  onClickContactSupport();
4437
4454
  },
4438
4455
  backgroundColor: theme.error.text
@@ -4440,15 +4457,18 @@ const ErrorPageTransactionFailed = ({
4440
4457
  )
4441
4458
  ] });
4442
4459
  };
4443
- const ErrorPageUnexpected = ({ error, onClickBack }) => {
4460
+ const UnexpectedErrorPageUnexpected = ({
4461
+ error,
4462
+ onClickBack
4463
+ }) => {
4444
4464
  const theme = nt();
4445
- const setErrorAtom = useSetAtom(errorAtom);
4465
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
4446
4466
  const setCurrentPage = useSetAtom(currentPageAtom);
4447
4467
  useEffect(() => {
4448
4468
  setTag("errorMessage", error == null ? void 0 : error.message);
4449
4469
  }, [error == null ? void 0 : error.message]);
4450
4470
  const onClickRetry = () => {
4451
- setErrorAtom(void 0);
4471
+ setErrorWarningAtom(void 0);
4452
4472
  setCurrentPage(Routes.SwapPage);
4453
4473
  };
4454
4474
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -4459,8 +4479,8 @@ const ErrorPageUnexpected = ({ error, onClickBack }) => {
4459
4479
  label: "Back",
4460
4480
  icon: ICONS.thinArrow,
4461
4481
  onClick: () => {
4462
- track("error page: unexpected error - header back button clicked");
4463
- setErrorAtom(void 0);
4482
+ track("unexpected error page: unexpected error - header back button clicked");
4483
+ setErrorWarningAtom(void 0);
4464
4484
  onClickBack == null ? void 0 : onClickBack();
4465
4485
  setCurrentPage(Routes.SwapPage);
4466
4486
  }
@@ -4468,7 +4488,7 @@ const ErrorPageUnexpected = ({ error, onClickBack }) => {
4468
4488
  }
4469
4489
  ),
4470
4490
  /* @__PURE__ */ jsx(
4471
- ErrorPageContent,
4491
+ ErrorWarningPageContent,
4472
4492
  {
4473
4493
  title: "An unexpected error has occurred",
4474
4494
  description: error == null ? void 0 : error.message,
@@ -4483,7 +4503,7 @@ const ErrorPageUnexpected = ({ error, onClickBack }) => {
4483
4503
  label: "Retry",
4484
4504
  icon: ICONS.rightArrow,
4485
4505
  onClick: () => {
4486
- track("error page: unexpected error - retry button clicked");
4506
+ track("unexpected error page: unexpected error - retry button clicked");
4487
4507
  onClickRetry();
4488
4508
  },
4489
4509
  backgroundColor: theme.error.text
@@ -4965,7 +4985,7 @@ const resetWidget = ({ onlyClearInputValues } = {}) => {
4965
4985
  }
4966
4986
  set(setRouteToDefaultRouteAtom);
4967
4987
  set(currentPageAtom, Routes.SwapPage);
4968
- set(errorAtom, void 0);
4988
+ set(errorWarningAtom, void 0);
4969
4989
  };
4970
4990
  const sourceAssetAmountAtom = atom$1(
4971
4991
  (get) => {
@@ -5149,10 +5169,10 @@ const _skipRouteAtom = atomWithQuery((get) => {
5149
5169
  const params = get(skipRouteRequestAtom);
5150
5170
  const currentPage = get(currentPageAtom);
5151
5171
  const isInvertingSwap = get(isInvertingSwapAtom);
5152
- const error = get(errorAtom);
5172
+ const errorWarning = get(errorWarningAtom);
5153
5173
  const routeConfig = get(routeConfigAtom);
5154
5174
  const swapSettings = get(swapSettingsAtom);
5155
- const queryEnabled = params !== void 0 && (Number(params.amountIn) > 0 || Number(params.amountOut) > 0) && !isInvertingSwap && currentPage === Routes.SwapPage && error === void 0;
5175
+ const queryEnabled = params !== void 0 && (Number(params.amountIn) > 0 || Number(params.amountOut) > 0) && !isInvertingSwap && currentPage === Routes.SwapPage && errorWarning === void 0;
5156
5176
  return {
5157
5177
  queryKey: ["skipRoute", params, routeConfig, swapSettings],
5158
5178
  queryFn: async () => {
@@ -5168,10 +5188,10 @@ const _skipRouteAtom = atomWithQuery((get) => {
5168
5188
  abortDuplicateRequests: true
5169
5189
  });
5170
5190
  return response;
5171
- } catch (error2) {
5191
+ } catch (error) {
5172
5192
  return {
5173
5193
  isError: true,
5174
- error: error2
5194
+ error
5175
5195
  };
5176
5196
  }
5177
5197
  },
@@ -43189,7 +43209,7 @@ function walletConnect(parameters) {
43189
43209
  const optionalChains = config2.chains.map((x2) => x2.id);
43190
43210
  if (!optionalChains.length)
43191
43211
  return;
43192
- const { EthereumProvider } = await import("./index.es-COUg1FzR.js");
43212
+ const { EthereumProvider } = await import("./index.es-DFLgSQWV.js");
43193
43213
  return await EthereumProvider.init({
43194
43214
  ...parameters,
43195
43215
  disableProviderPing: true,
@@ -43683,7 +43703,7 @@ const setSwapExecutionStateAtom = atom$1(null, (get, set) => {
43683
43703
  set(setOverallStatusAtom, "pending");
43684
43704
  },
43685
43705
  onError: (error, transactionDetailsArray) => {
43686
- var _a2, _b;
43706
+ var _a2, _b, _c;
43687
43707
  const currentPage = get(currentPageAtom);
43688
43708
  track("execute route: error", { error, route: route2 });
43689
43709
  (_a2 = callbacks == null ? void 0 : callbacks.onTransactionFailed) == null ? void 0 : _a2.call(callbacks, {
@@ -43691,29 +43711,38 @@ const setSwapExecutionStateAtom = atom$1(null, (get, set) => {
43691
43711
  });
43692
43712
  const lastTransaction = transactionDetailsArray == null ? void 0 : transactionDetailsArray[(transactionDetailsArray == null ? void 0 : transactionDetailsArray.length) - 1];
43693
43713
  if (isUserRejectedRequestError(error)) {
43694
- track("error page: user rejected request");
43714
+ track("expected error page: user rejected request");
43695
43715
  if (currentPage === Routes.SwapExecutionPage) {
43696
- set(errorAtom, {
43697
- errorType: ErrorType.AuthFailed,
43716
+ set(errorWarningAtom, {
43717
+ errorWarningType: ErrorWarningType.AuthFailed,
43698
43718
  onClickBack: () => {
43699
43719
  set(setOverallStatusAtom, "unconfirmed");
43700
43720
  set(clearIsValidatingGasBalanceAtom);
43701
43721
  }
43702
43722
  });
43703
43723
  }
43704
- } else if ((_b = error == null ? void 0 : error.message) == null ? void 0 : _b.toLowerCase().includes("insufficient balance for gas")) {
43705
- track("error page: insufficient balance for gas");
43706
- set(errorAtom, {
43707
- errorType: ErrorType.InsufficientBalanceForGas,
43724
+ } else if ((_b = error == null ? void 0 : error.message) == null ? void 0 : _b.toLowerCase().includes("relay fee quote has expired")) {
43725
+ track("error page: relay fee quote has expired");
43726
+ set(errorWarningAtom, {
43727
+ errorType: ErrorWarningType.ExpiredRelayFeeQuote,
43728
+ error,
43729
+ onClickBack: () => {
43730
+ set(setOverallStatusAtom, "unconfirmed");
43731
+ }
43732
+ });
43733
+ } else if ((_c = error == null ? void 0 : error.message) == null ? void 0 : _c.toLowerCase().includes("insufficient balance for gas")) {
43734
+ track("expected error page: insufficient gas balance");
43735
+ set(errorWarningAtom, {
43736
+ errorWarningType: ErrorWarningType.InsufficientBalanceForGas,
43708
43737
  error,
43709
43738
  onClickBack: () => {
43710
43739
  set(setOverallStatusAtom, "unconfirmed");
43711
43740
  }
43712
43741
  });
43713
43742
  } else if (lastTransaction == null ? void 0 : lastTransaction.explorerLink) {
43714
- track("error page: transaction failed", { lastTransaction });
43715
- set(errorAtom, {
43716
- errorType: ErrorType.TransactionFailed,
43743
+ track("unexpected error page: transaction failed", { lastTransaction });
43744
+ set(errorWarningAtom, {
43745
+ errorWarningType: ErrorWarningType.TransactionFailed,
43717
43746
  onClickBack: () => {
43718
43747
  set(setOverallStatusAtom, "unconfirmed");
43719
43748
  },
@@ -43724,9 +43753,9 @@ const setSwapExecutionStateAtom = atom$1(null, (get, set) => {
43724
43753
  }
43725
43754
  });
43726
43755
  } else {
43727
- track("error page: unexpected error", { error, route: route2 });
43728
- set(errorAtom, {
43729
- errorType: ErrorType.Unexpected,
43756
+ track("unexpected error page: unexpected error", { error, route: route2 });
43757
+ set(errorWarningAtom, {
43758
+ errorWarningType: ErrorWarningType.Unexpected,
43730
43759
  error,
43731
43760
  onClickBack: () => {
43732
43761
  set(setOverallStatusAtom, "unconfirmed");
@@ -43793,30 +43822,11 @@ const chainAddressEffectAtom = atomEffect((get, set) => {
43793
43822
  }));
43794
43823
  });
43795
43824
  const submitSwapExecutionCallbacksAtom = atom$1();
43796
- const fallbackGasAmountFnAtom = atom$1((get) => {
43797
- var _a;
43798
- const swapVenues = (_a = get(skipSwapVenuesAtom)) == null ? void 0 : _a.data;
43799
- return async (chainId, chainType) => {
43800
- if (chainType === ChainType.Evm) {
43801
- return EVM_GAS_AMOUNT;
43802
- }
43803
- if (chainType !== ChainType.Cosmos) return void 0;
43804
- const isSwapChain = (swapVenues == null ? void 0 : swapVenues.some((venue) => venue.chainId === chainId)) ?? false;
43805
- const defaultGasAmount = Math.ceil(
43806
- isSwapChain ? COSMOS_GAS_AMOUNT.SWAP : COSMOS_GAS_AMOUNT.DEFAULT
43807
- );
43808
- if (chainId === "carbon-1") {
43809
- return COSMOS_GAS_AMOUNT.CARBON;
43810
- }
43811
- return defaultGasAmount;
43812
- };
43813
- });
43814
43825
  const simulateTxAtom = atom$1();
43815
43826
  const skipSubmitSwapExecutionAtom = atomWithMutation((get) => {
43816
43827
  var _a;
43817
43828
  const { route: route2, userAddresses, transactionDetailsArray } = get(swapExecutionStateAtom);
43818
43829
  const submitSwapExecutionCallbacks = get(submitSwapExecutionCallbacksAtom);
43819
- const getFallbackGasAmount = get(fallbackGasAmountFnAtom);
43820
43830
  const simulateTx = get(simulateTxAtom);
43821
43831
  const swapSettings = get(swapSettingsAtom);
43822
43832
  const getSigners = get(getConnectedSignersAtom);
@@ -43850,7 +43860,6 @@ const skipSubmitSwapExecutionAtom = atomWithMutation((get) => {
43850
43860
  slippageTolerancePercent: swapSettings.slippage.toString(),
43851
43861
  useUnlimitedApproval: swapSettings.useUnlimitedApproval,
43852
43862
  simulate: simulateTx !== void 0 ? simulateTx : route2.sourceAssetChainId !== "984122",
43853
- getFallbackGasAmount,
43854
43863
  ...submitSwapExecutionCallbacks,
43855
43864
  getCosmosSigner: async (chainId) => {
43856
43865
  if (getSigners == null ? void 0 : getSigners.getCosmosSigner) {
@@ -43913,9 +43922,13 @@ const useIsSwapOperation = (route2) => {
43913
43922
  return (clientOperations == null ? void 0 : clientOperations.some((item) => swapOperations.includes(item.type))) ?? false;
43914
43923
  }, [route2 == null ? void 0 : route2.operations]);
43915
43924
  };
43916
- const ErrorPageTimeout = ({ txHash, explorerLink, onClickBack }) => {
43925
+ const UnexpectedErrorPageTimeout = ({
43926
+ txHash,
43927
+ explorerLink,
43928
+ onClickBack
43929
+ }) => {
43917
43930
  const theme = nt();
43918
- const [error, setError] = useAtom(errorAtom);
43931
+ const [errorWarning, setErrorWarning] = useAtom(errorWarningAtom);
43919
43932
  const setCurrentPage = useSetAtom(currentPageAtom);
43920
43933
  const { route: route2, transactionDetailsArray } = useAtomValue(swapExecutionStateAtom);
43921
43934
  const isGoFast = useIsGoFast(route2);
@@ -43924,11 +43937,11 @@ const ErrorPageTimeout = ({ txHash, explorerLink, onClickBack }) => {
43924
43937
  txs: transactionDetailsArray
43925
43938
  });
43926
43939
  useEffect(() => {
43927
- if (error && (data == null ? void 0 : data.isSettled)) {
43928
- track("error page: transaction timeover - transaction settled");
43929
- setError(void 0);
43940
+ if (errorWarning && (data == null ? void 0 : data.isSettled)) {
43941
+ track("unexpected error page: transaction timeover - transaction settled");
43942
+ setErrorWarning(void 0);
43930
43943
  }
43931
- }, [data == null ? void 0 : data.isSettled, error, setError]);
43944
+ }, [data == null ? void 0 : data.isSettled, errorWarning, setErrorWarning]);
43932
43945
  return /* @__PURE__ */ jsxs(Fragment, { children: [
43933
43946
  /* @__PURE__ */ jsx(
43934
43947
  SwapPageHeader,
@@ -43937,8 +43950,8 @@ const ErrorPageTimeout = ({ txHash, explorerLink, onClickBack }) => {
43937
43950
  label: "Back",
43938
43951
  icon: ICONS.thinArrow,
43939
43952
  onClick: () => {
43940
- track("error page: transaction timeover - header back button clicked");
43941
- setError(void 0);
43953
+ track("unexpected error page: transaction timeover - header back button clicked");
43954
+ setErrorWarning(void 0);
43942
43955
  onClickBack == null ? void 0 : onClickBack();
43943
43956
  setCurrentPage(Routes.SwapPage);
43944
43957
  }
@@ -43946,7 +43959,7 @@ const ErrorPageTimeout = ({ txHash, explorerLink, onClickBack }) => {
43946
43959
  }
43947
43960
  ),
43948
43961
  /* @__PURE__ */ jsx(
43949
- ErrorPageContent,
43962
+ ErrorWarningPageContent,
43950
43963
  {
43951
43964
  title: "Sorry, your transaction is taking longer than usual.",
43952
43965
  description: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -43964,7 +43977,7 @@ const ErrorPageTimeout = ({ txHash, explorerLink, onClickBack }) => {
43964
43977
  align: "center",
43965
43978
  as: SmallTextButton,
43966
43979
  onClick: () => {
43967
- track("error page: transaction timeover - view on explorer clicked");
43980
+ track("unexpected error page: transaction timeover - view on explorer clicked");
43968
43981
  window.open(explorerLink, "_blank");
43969
43982
  },
43970
43983
  color: theme.primary.text.lowContrast,
@@ -43983,19 +43996,20 @@ const ErrorPageTimeout = ({ txHash, explorerLink, onClickBack }) => {
43983
43996
  /* @__PURE__ */ jsx(MainButton, { isGoFast, label: "Processing", loading: true })
43984
43997
  ] });
43985
43998
  };
43986
- const ErrorPageTradeAdditionalSigningRequired = ({
43999
+ const WarningPageTradeAdditionalSigningRequired = ({
43987
44000
  onClickContinue,
43988
44001
  signaturesRequired,
43989
44002
  onClickBack
43990
44003
  }) => {
43991
44004
  const theme = nt();
43992
- const setErrorAtom = useSetAtom(errorAtom);
44005
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
44006
+ track("warning page: two signatures required");
43993
44007
  const handleOnClickBack = () => {
43994
- setErrorAtom(void 0);
44008
+ setErrorWarningAtom(void 0);
43995
44009
  onClickBack == null ? void 0 : onClickBack();
43996
44010
  };
43997
44011
  const handleOnClickContinue = () => {
43998
- setErrorAtom(void 0);
44012
+ setErrorWarningAtom(void 0);
43999
44013
  onClickContinue();
44000
44014
  };
44001
44015
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -44006,14 +44020,14 @@ const ErrorPageTradeAdditionalSigningRequired = ({
44006
44020
  label: "Back",
44007
44021
  icon: ICONS.thinArrow,
44008
44022
  onClick: () => {
44009
- track("error page: additional signing required - header back button clicked");
44023
+ track("warning page: additional signing required - header back button clicked");
44010
44024
  handleOnClickBack();
44011
44025
  }
44012
44026
  }
44013
44027
  }
44014
44028
  ),
44015
44029
  /* @__PURE__ */ jsx(
44016
- ErrorPageContent,
44030
+ ErrorWarningPageContent,
44017
44031
  {
44018
44032
  title: "This transaction requires additional signing steps",
44019
44033
  description: /* @__PURE__ */ jsxs(SmallText, { textWrap: "balance", textAlign: "center", color: theme.warning.text, children: [
@@ -44035,7 +44049,7 @@ const ErrorPageTradeAdditionalSigningRequired = ({
44035
44049
  label: "Continue",
44036
44050
  icon: ICONS.rightArrow,
44037
44051
  onClick: () => {
44038
- track("error page: additional signing required - main continue button clicked");
44052
+ track("warning page: additional signing required - main continue button clicked");
44039
44053
  handleOnClickContinue();
44040
44054
  },
44041
44055
  backgroundColor: theme.warning.text
@@ -44043,13 +44057,13 @@ const ErrorPageTradeAdditionalSigningRequired = ({
44043
44057
  )
44044
44058
  ] });
44045
44059
  };
44046
- const ErrorPageTransactionReverted = ({
44060
+ const UnexpectedErrorPageTransactionReverted = ({
44047
44061
  explorerUrl,
44048
44062
  transferAssetRelease,
44049
44063
  onClickContinueTransaction,
44050
44064
  onClickBack
44051
44065
  }) => {
44052
- const setErrorAtom = useSetAtom(errorAtom);
44066
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
44053
44067
  const setCurrentPage = useSetAtom(currentPageAtom);
44054
44068
  const theme = nt();
44055
44069
  const assetDetails = useGetAssetDetails({
@@ -44065,8 +44079,8 @@ const ErrorPageTransactionReverted = ({
44065
44079
  label: "Back",
44066
44080
  icon: ICONS.thinArrow,
44067
44081
  onClick: () => {
44068
- track("error page: transaction reverted - header back button clicked");
44069
- setErrorAtom(void 0);
44082
+ track("unexpected error page: transaction reverted - header back button clicked");
44083
+ setErrorWarningAtom(void 0);
44070
44084
  onClickBack == null ? void 0 : onClickBack();
44071
44085
  setCurrentPage(Routes.SwapPage);
44072
44086
  }
@@ -44074,7 +44088,7 @@ const ErrorPageTransactionReverted = ({
44074
44088
  }
44075
44089
  ),
44076
44090
  /* @__PURE__ */ jsx(
44077
- ErrorPageContent,
44091
+ ErrorWarningPageContent,
44078
44092
  {
44079
44093
  title: "Action Required",
44080
44094
  description: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -44099,7 +44113,7 @@ const ErrorPageTransactionReverted = ({
44099
44113
  align: "center",
44100
44114
  as: SmallTextButton,
44101
44115
  onClick: () => {
44102
- track("error page: transaction reverted - view on explorer clicked");
44116
+ track("unexpected error page: transaction reverted - view on explorer clicked");
44103
44117
  window.open(explorerUrl, "_blank");
44104
44118
  },
44105
44119
  color: theme.primary.text.lowContrast,
@@ -44122,14 +44136,14 @@ const ErrorPageTransactionReverted = ({
44122
44136
  backgroundColor: theme.warning.text,
44123
44137
  icon: ICONS.rightArrow,
44124
44138
  onClick: () => {
44125
- track("error page: transaction reverted - main continue button clicked");
44139
+ track("unexpected error page: transaction reverted - main continue button clicked");
44126
44140
  onClickContinueTransaction();
44127
44141
  }
44128
44142
  }
44129
44143
  )
44130
44144
  ] });
44131
44145
  };
44132
- const ErrorPageCosmosLedgerWarning = ({ onClickBack }) => {
44146
+ const WarningPageCosmosLedger = ({ onClickBack }) => {
44133
44147
  const theme = nt();
44134
44148
  return /* @__PURE__ */ jsxs(Fragment, { children: [
44135
44149
  /* @__PURE__ */ jsx(
@@ -44139,14 +44153,14 @@ const ErrorPageCosmosLedgerWarning = ({ onClickBack }) => {
44139
44153
  label: "Back",
44140
44154
  icon: ICONS.thinArrow,
44141
44155
  onClick: () => {
44142
- track("error page: cosmos ledger warning - header back button clicked");
44156
+ track("warning page: cosmos ledger - header back button clicked");
44143
44157
  onClickBack();
44144
44158
  }
44145
44159
  }
44146
44160
  }
44147
44161
  ),
44148
44162
  /* @__PURE__ */ jsx(
44149
- ErrorPageContent,
44163
+ ErrorWarningPageContent,
44150
44164
  {
44151
44165
  title: "Warning: Ledger not supported",
44152
44166
  description: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(SmallText, { color: theme.error.text, textAlign: "center", textWrap: "balance", children: "Ledger isn't currently supported on Ethermint chains (such as Injective, Dymension, EVMOS, and similar networks)." }) }),
@@ -44161,7 +44175,7 @@ const ErrorPageCosmosLedgerWarning = ({ onClickBack }) => {
44161
44175
  label: "Back",
44162
44176
  icon: ICONS.leftArrow,
44163
44177
  onClick: () => {
44164
- track("error page: cosmos ledger warning - main back button clicked");
44178
+ track("warning page: cosmos ledger - main back button clicked");
44165
44179
  onClickBack();
44166
44180
  },
44167
44181
  backgroundColor: theme.error.text
@@ -44240,6 +44254,9 @@ const Modal = ({ children, drawer, container, onOpenChange, theme }) => {
44240
44254
  "data-root-id": rootId,
44241
44255
  onAnimationEnd: () => {
44242
44256
  if (!modal.visible) {
44257
+ if (modalRef.current) {
44258
+ modalRef.current.style.display = "none";
44259
+ }
44243
44260
  modal.remove();
44244
44261
  }
44245
44262
  },
@@ -44261,13 +44278,13 @@ const Modal = ({ children, drawer, container, onOpenChange, theme }) => {
44261
44278
  const createModal = (component) => {
44262
44279
  const Component = component;
44263
44280
  const WrappedComponent = (props) => {
44264
- const setError = useSetAtom(errorAtom);
44281
+ const setErrorWarning = useSetAtom(errorWarningAtom);
44265
44282
  const theme = useAtomValue(themeAtom);
44266
44283
  return /* @__PURE__ */ jsx(Modal, { ...props, theme, children: /* @__PURE__ */ jsx(
44267
44284
  ErrorBoundary,
44268
44285
  {
44269
44286
  fallback: null,
44270
- onError: (error) => setError({ errorType: ErrorType.Unexpected, error }),
44287
+ onError: (error) => setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error }),
44271
44288
  children: /* @__PURE__ */ jsx(Component, { ...props })
44272
44289
  }
44273
44290
  ) });
@@ -44341,6 +44358,7 @@ const StyledOverlay = dt.div`
44341
44358
  place-items: center;
44342
44359
  z-index: 10;
44343
44360
  animation: ${({ open }) => open ? fadeIn$1 : fadeOut} 150ms ease-in-out forwards;
44361
+
44344
44362
  /* For Chrome */
44345
44363
  &::-webkit-scrollbar {
44346
44364
  display: none;
@@ -44364,6 +44382,8 @@ const StyledOverlay = dt.div`
44364
44382
  /* For Internet Explorer and Edge */
44365
44383
  -ms-overflow-style: none;
44366
44384
  `};
44385
+
44386
+ pointer-events: ${({ open }) => open ? "auto" : "none"};
44367
44387
  `;
44368
44388
  const StyledContent = dt.div`
44369
44389
  max-width: 600px;
@@ -44461,7 +44481,7 @@ const useIsMobileScreenSize = () => {
44461
44481
  typeof window !== "undefined" && window.innerWidth <= MAX_MOBILE_SCREEN_WIDTH
44462
44482
  );
44463
44483
  useEffect(() => {
44464
- if (window === void 0) return;
44484
+ if (typeof window === "undefined") return;
44465
44485
  const handleResize = () => {
44466
44486
  const isMobileScreenSize2 = (window == null ? void 0 : window.innerWidth) <= MAX_MOBILE_SCREEN_WIDTH;
44467
44487
  setIsMobileScreenSize(isMobileScreenSize2);
@@ -48577,11 +48597,8 @@ const useSettingsDrawer = () => {
48577
48597
  };
48578
48598
  return { SettingsFooter, drawerOpen };
48579
48599
  };
48580
- const ErrorPageGoFastWarning = ({
48581
- onClickBack,
48582
- onClickContinue
48583
- }) => {
48584
- const setErrorAtom = useSetAtom(errorAtom);
48600
+ const WarningPageGoFast = ({ onClickBack, onClickContinue }) => {
48601
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
48585
48602
  const setShowGoFastErrorAtom = useSetAtom(goFastWarningAtom);
48586
48603
  const { SettingsFooter, drawerOpen } = useSettingsDrawer();
48587
48604
  const theme = nt();
@@ -48590,7 +48607,7 @@ const ErrorPageGoFastWarning = ({
48590
48607
  setTag("goFastWarning", true);
48591
48608
  }, [setShowGoFastErrorAtom]);
48592
48609
  const handleOnClickBack = () => {
48593
- setErrorAtom(void 0);
48610
+ setErrorWarningAtom(void 0);
48594
48611
  onClickBack == null ? void 0 : onClickBack();
48595
48612
  };
48596
48613
  return /* @__PURE__ */ jsxs(
@@ -48608,14 +48625,14 @@ const ErrorPageGoFastWarning = ({
48608
48625
  label: "Back",
48609
48626
  icon: ICONS.thinArrow,
48610
48627
  onClick: () => {
48611
- track("error page: go fast warning - header back button clicked");
48628
+ track("warning page: go fast - header back button clicked");
48612
48629
  handleOnClickBack();
48613
48630
  }
48614
48631
  }
48615
48632
  }
48616
48633
  ),
48617
48634
  /* @__PURE__ */ jsx(
48618
- ErrorPageContent,
48635
+ ErrorWarningPageContent,
48619
48636
  {
48620
48637
  title: "You're on the fastest route",
48621
48638
  description: /* @__PURE__ */ jsxs(SmallText, { textAlign: "center", textWrap: "balance", lineHeight: "17px", children: [
@@ -48638,7 +48655,7 @@ const ErrorPageGoFastWarning = ({
48638
48655
  label: "Continue",
48639
48656
  icon: ICONS.rightArrow,
48640
48657
  onClick: () => {
48641
- track("error page: go fast warning - main continue button clicked");
48658
+ track("warning page: go fast - main continue button clicked");
48642
48659
  onClickContinue();
48643
48660
  }
48644
48661
  }
@@ -48651,7 +48668,7 @@ const ErrorPageGoFastWarning = ({
48651
48668
  const StyledSettingsContainer = dt(Row)`
48652
48669
  display: inline-flex;
48653
48670
  `;
48654
- const ErrorPageLowInfoWarning = ({
48671
+ const WarningPageLowInfo = ({
48655
48672
  onClickContinue,
48656
48673
  onClickBack,
48657
48674
  route: route2
@@ -48683,14 +48700,14 @@ const ErrorPageLowInfoWarning = ({
48683
48700
  label: "Back",
48684
48701
  icon: ICONS.thinArrow,
48685
48702
  onClick: () => {
48686
- track("error page: low info warning - header back button clicked");
48703
+ track("warning page: low info - header back button clicked");
48687
48704
  onClickBack();
48688
48705
  }
48689
48706
  }
48690
48707
  }
48691
48708
  ),
48692
48709
  /* @__PURE__ */ jsx(
48693
- ErrorPageContent,
48710
+ ErrorWarningPageContent,
48694
48711
  {
48695
48712
  title: "Warning: Incomplete Price Data",
48696
48713
  description: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -48709,7 +48726,7 @@ const ErrorPageLowInfoWarning = ({
48709
48726
  SmallTextButton,
48710
48727
  {
48711
48728
  onClick: () => {
48712
- track("error page: low info warning - continue anyway clicked");
48729
+ track("warning page: low info - continue anyway clicked");
48713
48730
  onClickContinue();
48714
48731
  },
48715
48732
  color: theme.primary.text.lowContrast,
@@ -48728,7 +48745,7 @@ const ErrorPageLowInfoWarning = ({
48728
48745
  label: "Back",
48729
48746
  icon: ICONS.leftArrow,
48730
48747
  onClick: () => {
48731
- track("error page: low info warning - main back button clicked");
48748
+ track("warning page: low info - main back button clicked");
48732
48749
  onClickBack();
48733
48750
  },
48734
48751
  backgroundColor: theme.warning.text
@@ -48736,15 +48753,18 @@ const ErrorPageLowInfoWarning = ({
48736
48753
  )
48737
48754
  ] });
48738
48755
  };
48739
- const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48756
+ const ExpectedErrorPageInsufficientGasBalance = ({
48757
+ error,
48758
+ onClickBack
48759
+ }) => {
48740
48760
  const theme = nt();
48741
- const setErrorAtom = useSetAtom(errorAtom);
48761
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
48742
48762
  const setCurrentPage = useSetAtom(currentPageAtom);
48743
48763
  useEffect(() => {
48744
48764
  setTag("errorMessage", error == null ? void 0 : error.message);
48745
48765
  }, [error == null ? void 0 : error.message]);
48746
48766
  const onClickRetry = () => {
48747
- setErrorAtom(void 0);
48767
+ setErrorWarningAtom(void 0);
48748
48768
  setCurrentPage(Routes.SwapPage);
48749
48769
  };
48750
48770
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -48755,8 +48775,8 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48755
48775
  label: "Back",
48756
48776
  icon: ICONS.thinArrow,
48757
48777
  onClick: () => {
48758
- track("error page: insufficient gas balance - header back button clicked");
48759
- setErrorAtom(void 0);
48778
+ track("expected error page: insufficient gas balance - header back button clicked");
48779
+ setErrorWarningAtom(void 0);
48760
48780
  onClickBack == null ? void 0 : onClickBack();
48761
48781
  setCurrentPage(Routes.SwapPage);
48762
48782
  }
@@ -48764,7 +48784,7 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48764
48784
  }
48765
48785
  ),
48766
48786
  /* @__PURE__ */ jsx(
48767
- ErrorPageContent,
48787
+ ErrorWarningPageContent,
48768
48788
  {
48769
48789
  title: "Insufficient gas balance",
48770
48790
  description: error == null ? void 0 : error.message,
@@ -48779,7 +48799,7 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48779
48799
  label: "Retry",
48780
48800
  icon: ICONS.rightArrow,
48781
48801
  onClick: () => {
48782
- track("error page: insufficient gas balance - retry button clicked");
48802
+ track("expected error page: insufficient gas balance - retry button clicked");
48783
48803
  onClickRetry();
48784
48804
  },
48785
48805
  backgroundColor: theme.error.text
@@ -48787,37 +48807,90 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48787
48807
  )
48788
48808
  ] });
48789
48809
  };
48790
- const ErrorPage = () => {
48791
- const [error] = useAtom(errorAtom);
48810
+ const ExpectedErrorPageRelayFeeQuoteExpired = ({ error, onClickBack }) => {
48811
+ const theme = nt();
48812
+ const setErrorAtom = useSetAtom(errorWarningAtom);
48813
+ const setCurrentPage = useSetAtom(currentPageAtom);
48814
+ useEffect(() => {
48815
+ setTag("errorMessage", error == null ? void 0 : error.message);
48816
+ }, [error == null ? void 0 : error.message]);
48817
+ const onClickRetry = () => {
48818
+ setErrorAtom(void 0);
48819
+ setCurrentPage(Routes.SwapPage);
48820
+ };
48821
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
48822
+ /* @__PURE__ */ jsx(
48823
+ SwapPageHeader,
48824
+ {
48825
+ leftButton: {
48826
+ label: "Back",
48827
+ icon: ICONS.thinArrow,
48828
+ onClick: () => {
48829
+ track("error page: relay fee quote expired - header back button clicked");
48830
+ setErrorAtom(void 0);
48831
+ onClickBack == null ? void 0 : onClickBack();
48832
+ setCurrentPage(Routes.SwapPage);
48833
+ }
48834
+ }
48835
+ }
48836
+ ),
48837
+ /* @__PURE__ */ jsx(
48838
+ ErrorWarningPageContent,
48839
+ {
48840
+ title: "Relay fee quote expired",
48841
+ description: "Please retry your route.",
48842
+ icon: ICONS.triangleWarning,
48843
+ backgroundColor: theme.error.background,
48844
+ textColor: theme.error.text
48845
+ }
48846
+ ),
48847
+ /* @__PURE__ */ jsx(
48848
+ MainButton,
48849
+ {
48850
+ label: "Retry",
48851
+ icon: ICONS.rightArrow,
48852
+ onClick: () => {
48853
+ track("error page: relay fee quote expired - retry button clicked");
48854
+ onClickRetry();
48855
+ },
48856
+ backgroundColor: theme.error.text
48857
+ }
48858
+ )
48859
+ ] });
48860
+ };
48861
+ const ErrorWarningPage = () => {
48862
+ const [errorWarningPage] = useAtom(errorWarningAtom);
48792
48863
  const renderErrorVariant = useMemo(() => {
48793
- switch (error == null ? void 0 : error.errorType) {
48794
- case ErrorType.AuthFailed:
48795
- return /* @__PURE__ */ jsx(ErrorPageAuthFailed, { ...error });
48796
- case ErrorType.GoFastWarning:
48797
- return /* @__PURE__ */ jsx(ErrorPageGoFastWarning, { ...error });
48798
- case ErrorType.Timeout:
48799
- return /* @__PURE__ */ jsx(ErrorPageTimeout, { ...error });
48800
- case ErrorType.AdditionalSigningRequired:
48801
- return /* @__PURE__ */ jsx(ErrorPageTradeAdditionalSigningRequired, { ...error });
48802
- case ErrorType.BadPriceWarning:
48803
- return /* @__PURE__ */ jsx(ErrorPageBadPriceWarning, { ...error });
48804
- case ErrorType.TransactionFailed:
48805
- return /* @__PURE__ */ jsx(ErrorPageTransactionFailed, { ...error });
48806
- case ErrorType.TransactionReverted:
48807
- return /* @__PURE__ */ jsx(ErrorPageTransactionReverted, { ...error });
48808
- case ErrorType.Unexpected:
48809
- return /* @__PURE__ */ jsx(ErrorPageUnexpected, { error: error.error });
48810
- case ErrorType.InsufficientBalanceForGas:
48811
- return /* @__PURE__ */ jsx(ErrorPageInsufficientGasBalance, { error: error.error });
48812
- case ErrorType.CosmosLedgerWarning:
48813
- return /* @__PURE__ */ jsx(ErrorPageCosmosLedgerWarning, { ...error });
48814
- case ErrorType.LowInfoWarning:
48815
- return /* @__PURE__ */ jsx(ErrorPageLowInfoWarning, { ...error });
48864
+ switch (errorWarningPage == null ? void 0 : errorWarningPage.errorWarningType) {
48865
+ case ErrorWarningType.AuthFailed:
48866
+ return /* @__PURE__ */ jsx(ExpectedErrorPageAuthFailed, { ...errorWarningPage });
48867
+ case ErrorWarningType.GoFastWarning:
48868
+ return /* @__PURE__ */ jsx(WarningPageGoFast, { ...errorWarningPage });
48869
+ case ErrorWarningType.Timeout:
48870
+ return /* @__PURE__ */ jsx(UnexpectedErrorPageTimeout, { ...errorWarningPage });
48871
+ case ErrorWarningType.AdditionalSigningRequired:
48872
+ return /* @__PURE__ */ jsx(WarningPageTradeAdditionalSigningRequired, { ...errorWarningPage });
48873
+ case ErrorWarningType.BadPriceWarning:
48874
+ return /* @__PURE__ */ jsx(WarningPageBadPrice, { ...errorWarningPage });
48875
+ case ErrorWarningType.TransactionFailed:
48876
+ return /* @__PURE__ */ jsx(UnexpectedErrorPageTransactionFailed, { ...errorWarningPage });
48877
+ case ErrorWarningType.TransactionReverted:
48878
+ return /* @__PURE__ */ jsx(UnexpectedErrorPageTransactionReverted, { ...errorWarningPage });
48879
+ case ErrorWarningType.Unexpected:
48880
+ return /* @__PURE__ */ jsx(UnexpectedErrorPageUnexpected, { error: errorWarningPage.error });
48881
+ case ErrorWarningType.InsufficientBalanceForGas:
48882
+ return /* @__PURE__ */ jsx(ExpectedErrorPageInsufficientGasBalance, { error: errorWarningPage.error });
48883
+ case ErrorWarningType.CosmosLedgerWarning:
48884
+ return /* @__PURE__ */ jsx(WarningPageCosmosLedger, { ...errorWarningPage });
48885
+ case ErrorWarningType.ExpiredRelayFeeQuote:
48886
+ return /* @__PURE__ */ jsx(ExpectedErrorPageRelayFeeQuoteExpired, { ...errorWarningPage });
48887
+ case ErrorWarningType.LowInfoWarning:
48888
+ return /* @__PURE__ */ jsx(WarningPageLowInfo, { ...errorWarningPage });
48816
48889
  default:
48817
48890
  return;
48818
48891
  }
48819
- }, [error]);
48820
- if ((error == null ? void 0 : error.errorType) === void 0) return null;
48892
+ }, [errorWarningPage]);
48893
+ if ((errorWarningPage == null ? void 0 : errorWarningPage.errorWarningType) === void 0) return null;
48821
48894
  return /* @__PURE__ */ jsx(Column, { gap: 5, children: renderErrorVariant });
48822
48895
  };
48823
48896
  const SwapExecutionPageRouteSimpleRow = ({
@@ -48863,9 +48936,6 @@ const SwapExecutionPageRouteSimpleRow = ({
48863
48936
  }
48864
48937
  }
48865
48938
  }, [chainAddresses, context]);
48866
- const displayAmount = useMemo(() => {
48867
- return formatDisplayAmount(assetDetails.amount);
48868
- }, [assetDetails.amount]);
48869
48939
  const renderExplorerLink = useMemo(() => {
48870
48940
  if (!explorerLink) return;
48871
48941
  if (isMobileScreenSize) {
@@ -48894,7 +48964,7 @@ const SwapExecutionPageRouteSimpleRow = ({
48894
48964
  ),
48895
48965
  /* @__PURE__ */ jsxs(Column, { gap: 5, children: [
48896
48966
  /* @__PURE__ */ jsxs(StyledSymbolAndAmount, { children: [
48897
- displayAmount,
48967
+ formatDisplayAmount(assetDetails.amount),
48898
48968
  " ",
48899
48969
  assetDetails == null ? void 0 : assetDetails.symbol
48900
48970
  ] }),
@@ -49481,7 +49551,7 @@ const useAutoSetAddress = () => {
49481
49551
  };
49482
49552
  const useHandleTransactionTimeout = (swapExecutionState) => {
49483
49553
  const { route: route2, transactionDetailsArray } = useAtomValue(swapExecutionStateAtom);
49484
- const setError = useSetAtom(errorAtom);
49554
+ const setError = useSetAtom(errorWarningAtom);
49485
49555
  const setOverallStatus = useSetAtom(setOverallStatusAtom);
49486
49556
  const [transactionTimeoutTimer, setTransactionTimeoutTimer] = useState();
49487
49557
  useEffect(() => {
@@ -49490,9 +49560,9 @@ const useHandleTransactionTimeout = (swapExecutionState) => {
49490
49560
  const lastTransaction = transactionDetailsArray[transactionDetailsArray.length - 1];
49491
49561
  const timeoutTimer = setTimeout(
49492
49562
  () => {
49493
- track("error page: transaction overtime", { route: route2 });
49563
+ track("unexpected error page: transaction timeover", { route: route2 });
49494
49564
  setError({
49495
- errorType: ErrorType.Timeout,
49565
+ errorWarningType: ErrorWarningType.Timeout,
49496
49566
  onClickBack: () => {
49497
49567
  setOverallStatus("unconfirmed");
49498
49568
  },
@@ -49742,7 +49812,7 @@ const SwapExecutionButton = ({
49742
49812
  swapExecutionState
49743
49813
  });
49744
49814
  const theme = nt();
49745
- const setError = useSetAtom(errorAtom);
49815
+ const setErrorWarning = useSetAtom(errorWarningAtom);
49746
49816
  const setCurrentPage = useSetAtom(currentPageAtom);
49747
49817
  const clearAssetInputAmounts = useSetAtom(clearAssetInputAmountsAtom);
49748
49818
  const isGoFast = useIsGoFast(route2);
@@ -49793,9 +49863,9 @@ const SwapExecutionButton = ({
49793
49863
  track("swap execution page: confirm button - clicked", { route: route2 });
49794
49864
  const onClickConfirmSwap = () => {
49795
49865
  if ((route2 == null ? void 0 : route2.txsRequired) && route2.txsRequired > 1) {
49796
- track("error page: additional signing required", { route: route2 });
49797
- setError({
49798
- errorType: ErrorType.AdditionalSigningRequired,
49866
+ track("warning page: additional signing required", { route: route2 });
49867
+ setErrorWarning({
49868
+ errorWarningType: ErrorWarningType.AdditionalSigningRequired,
49799
49869
  onClickContinue: () => submitExecuteRouteMutation(),
49800
49870
  signaturesRequired: route2.txsRequired
49801
49871
  });
@@ -49856,7 +49926,7 @@ const SwapExecutionButton = ({
49856
49926
  };
49857
49927
  const useHandleTransactionFailed = (statusData) => {
49858
49928
  var _a, _b;
49859
- const setError = useSetAtom(errorAtom);
49929
+ const setErrorWarning = useSetAtom(errorWarningAtom);
49860
49930
  const setCurrentPage = useSetAtom(currentPageAtom);
49861
49931
  const setSourceAssetAtom = useSetAtom(sourceAssetAtom);
49862
49932
  const setDebouncedSourceAssetAmountAtom = useSetAtom(debouncedSourceAssetAmountAtom);
@@ -49880,12 +49950,12 @@ const useHandleTransactionFailed = (statusData) => {
49880
49950
  useEffect(() => {
49881
49951
  if ((statusData == null ? void 0 : statusData.isSettled) && !(statusData == null ? void 0 : statusData.isSuccess)) {
49882
49952
  if (sourceClientAsset) {
49883
- track("error page: transaction reverted", {
49953
+ track("unexpected error page: transaction reverted", {
49884
49954
  transferAssetRelease: statusData.transferAssetRelease,
49885
49955
  lastTransaction
49886
49956
  });
49887
- setError({
49888
- errorType: ErrorType.TransactionReverted,
49957
+ setErrorWarning({
49958
+ errorWarningType: ErrorWarningType.TransactionReverted,
49889
49959
  onClickContinueTransaction: () => {
49890
49960
  var _a2;
49891
49961
  setSourceAssetAtom(sourceClientAsset);
@@ -49895,16 +49965,16 @@ const useHandleTransactionFailed = (statusData) => {
49895
49965
  true
49896
49966
  );
49897
49967
  setCurrentPage(Routes.SwapPage);
49898
- setError(void 0);
49968
+ setErrorWarning(void 0);
49899
49969
  },
49900
49970
  explorerUrl: (lastTransaction == null ? void 0 : lastTransaction.explorerLink) ?? "",
49901
49971
  transferAssetRelease: statusData.transferAssetRelease
49902
49972
  });
49903
49973
  return;
49904
49974
  }
49905
- track("error page: transaction failed", { lastTransaction });
49906
- setError({
49907
- errorType: ErrorType.TransactionFailed,
49975
+ track("unexpected error page: transaction failed", { lastTransaction });
49976
+ setErrorWarning({
49977
+ errorWarningType: ErrorWarningType.TransactionFailed,
49908
49978
  onClickContactSupport: () => window.open("https://skip.build/discord", "_blank"),
49909
49979
  explorerLink: (lastTransaction == null ? void 0 : lastTransaction.explorerLink) ?? "",
49910
49980
  txHash: lastTransaction == null ? void 0 : lastTransaction.txHash
@@ -49916,7 +49986,7 @@ const useHandleTransactionFailed = (statusData) => {
49916
49986
  lastTransaction == null ? void 0 : lastTransaction.txHash,
49917
49987
  setCurrentPage,
49918
49988
  setDebouncedSourceAssetAmountAtom,
49919
- setError,
49989
+ setErrorWarning,
49920
49990
  setSourceAssetAtom,
49921
49991
  sourceClientAsset,
49922
49992
  statusData == null ? void 0 : statusData.isSettled,
@@ -50613,7 +50683,8 @@ const useUpdateAmountWhenRouteChanges = () => {
50613
50683
  ...old,
50614
50684
  amount: formatDisplayAmount(swapInAmount, {
50615
50685
  decimals: destinationAsset.decimals,
50616
- showLessThanSign: false
50686
+ showLessThanSign: false,
50687
+ abbreviate: false
50617
50688
  })
50618
50689
  }));
50619
50690
  } else if (direction === "swap-out" && swapOutAmountChanged) {
@@ -50621,7 +50692,8 @@ const useUpdateAmountWhenRouteChanges = () => {
50621
50692
  ...old,
50622
50693
  amount: formatDisplayAmount(swapOutAmount, {
50623
50694
  decimals: sourceAsset.decimals,
50624
- showLessThanSign: false
50695
+ showLessThanSign: false,
50696
+ abbreviate: false
50625
50697
  })
50626
50698
  }));
50627
50699
  }
@@ -50642,6 +50714,177 @@ const useShowCosmosLedgerWarning = () => {
50642
50714
  return !!(account == null ? void 0 : account.wallet.isLedger);
50643
50715
  }, [sourceAsset == null ? void 0 : sourceAsset.chainId, chainType, getAccount]);
50644
50716
  };
50717
+ const name = "@skip-go/widget";
50718
+ const description = "Swap widget";
50719
+ const version = "3.10.4";
50720
+ const repository = {
50721
+ url: "https://github.com/skip-mev/skip-go",
50722
+ directory: "packages/widget"
50723
+ };
50724
+ const type = "module";
50725
+ const scripts = {
50726
+ dev: "vite --force --host",
50727
+ "dev:storybook": "storybook dev -p 6006",
50728
+ build: "npm run generate-chains && NODE_OPTIONS=--max-old-space-size=16384 vite build",
50729
+ "watch:build": "vite build --watch",
50730
+ lint: "NODE_OPTIONS=--max-old-space-size=32384 eslint . --fix",
50731
+ preview: "vite preview",
50732
+ "build:web-component": "NODE_OPTIONS=--max-old-space-size=32384 webpack --config webpack.config.js",
50733
+ "publish:web-component": "npm run build:web-component && cd web-component && npm publish && cd ..",
50734
+ prepack: "yarn run pre",
50735
+ postpack: "yarn run post",
50736
+ pre: "npm run build && node scripts/prepublish.cjs",
50737
+ post: "git checkout -- package.json",
50738
+ "generate-chains": "node scripts/generate-chains.cjs",
50739
+ "update-registries": "yarn up @initia/initia-registry chain-registry",
50740
+ test: "yarn playwright test"
50741
+ };
50742
+ const exports = {
50743
+ ".": {
50744
+ types: "./build/index.d.ts",
50745
+ "import": "./build/index.js"
50746
+ }
50747
+ };
50748
+ const types = "./build/index.d.ts";
50749
+ const files = [
50750
+ "build",
50751
+ "README.md"
50752
+ ];
50753
+ const devDependencies = {
50754
+ "@chromatic-com/storybook": "^1.6.1",
50755
+ "@eslint/js": "^9.9.0",
50756
+ "@initia/initia-registry": "^1.0.5",
50757
+ "@keplr-wallet/types": "^0.12.125",
50758
+ "@playwright/test": "^1.51.1",
50759
+ "@storybook/addon-essentials": "^8.2.6",
50760
+ "@storybook/addon-interactions": "^8.2.6",
50761
+ "@storybook/addon-links": "^8.2.6",
50762
+ "@storybook/addon-onboarding": "^8.2.6",
50763
+ "@storybook/blocks": "^8.2.6",
50764
+ "@storybook/react": "^8.2.6",
50765
+ "@storybook/react-vite": "^8.2.6",
50766
+ "@storybook/test": "^8.2.6",
50767
+ "@testing-library/dom": "^10.4.0",
50768
+ "@testing-library/react": "^16.2.0",
50769
+ "@types/eslint__js": "^8.42.3",
50770
+ "@types/pluralize": "^0.0.33",
50771
+ "@types/react": "^19.0.10",
50772
+ "@types/react-dom": "^19.0.4",
50773
+ "@typescript-eslint/eslint-plugin": "^7.15.0",
50774
+ "@typescript-eslint/parser": "^7.15.0",
50775
+ "@vitejs/plugin-react": "^4.3.1",
50776
+ buffer: "^6.0.3",
50777
+ "chain-registry": "^1.69.218",
50778
+ download: "^8.0.0",
50779
+ eslint: "^9.9.0",
50780
+ "eslint-config-prettier": "^9.1.0",
50781
+ "eslint-plugin-prettier": "^5.2.1",
50782
+ "eslint-plugin-react-hooks": "^4.6.2",
50783
+ "fs-extra": "^11.3.0",
50784
+ "node-polyfill-webpack-plugin": "^4.0.0",
50785
+ "pino-pretty": "^13.0.0",
50786
+ "postcss-loader": "^8.1.1",
50787
+ prettier: "^3.4.2",
50788
+ process: "^0.11.10",
50789
+ "raw-loader": "^4.0.2",
50790
+ react: ">=17.0.0",
50791
+ "react-dom": ">=17.0.0",
50792
+ starknet: "6.11.0",
50793
+ storybook: "^8.2.6",
50794
+ "ts-loader": "^9.5.1",
50795
+ typescript: "^5.5.4",
50796
+ "typescript-eslint": "^8.2.0",
50797
+ "url-loader": "^4.1.1",
50798
+ vite: "^5.3.4",
50799
+ "vite-plugin-dts": "^4.0.0-beta.1",
50800
+ "vite-plugin-node-polyfills": "^0.22.0",
50801
+ webpack: "^5.94.0",
50802
+ "webpack-cli": "^5.1.4"
50803
+ };
50804
+ const peerDependencies = {
50805
+ "@tanstack/react-query": "^5.51.21",
50806
+ react: ">=17.0.0",
50807
+ "react-dom": ">=17.0.0",
50808
+ viem: "^2.21.55",
50809
+ wagmi: "^2.14.1"
50810
+ };
50811
+ const dependencies = {
50812
+ "@amplitude/analytics-browser": "^2.11.12",
50813
+ "@amplitude/plugin-session-replay-browser": "^1.16.5",
50814
+ "@cosmjs/amino": "0.33.1",
50815
+ "@cosmjs/cosmwasm-stargate": "0.33.1",
50816
+ "@cosmjs/encoding": "0.33.1",
50817
+ "@cosmjs/math": "0.33.1",
50818
+ "@cosmjs/proto-signing": "0.33.1",
50819
+ "@cosmjs/stargate": "0.33.1",
50820
+ "@ebay/nice-modal-react": "^1.2.13",
50821
+ "@eslint/compat": "^1.1.1",
50822
+ "@penumbra-zone/bech32m": "^13.0.0",
50823
+ "@penumbra-zone/client": "^24.0.0",
50824
+ "@penumbra-zone/protobuf": "^7.2.0",
50825
+ "@penumbra-zone/transport-dom": "^7.5.0",
50826
+ "@r2wc/react-to-web-component": "^2.0.3",
50827
+ "@sentry/react": "^8.46.0",
50828
+ "@skip-go/client": "workspace:^",
50829
+ "@solana/spl-token": "^0.4.8",
50830
+ "@solana/wallet-adapter-backpack": "^0.1.14",
50831
+ "@solana/wallet-adapter-coinbase": "^0.1.19",
50832
+ "@solana/wallet-adapter-ledger": "^0.9.25",
50833
+ "@solana/wallet-adapter-phantom": "^0.9.24",
50834
+ "@solana/wallet-adapter-solflare": "^0.6.28",
50835
+ "@solana/wallet-adapter-trust": "^0.1.13",
50836
+ "@solana/web3.js": "^1.95.8",
50837
+ "@tanstack/query-core": "^5.51.21",
50838
+ "@walletconnect/modal": "^2.7.0",
50839
+ "@walletconnect/sign-client": "^2.20.3",
50840
+ "@walletconnect/solana-adapter": "^0.0.8",
50841
+ add: "^2.0.6",
50842
+ bech32: "^2.0.0",
50843
+ graz: "0.3.2",
50844
+ jotai: "^2.10.1",
50845
+ "jotai-effect": "^1.0.2",
50846
+ "jotai-tanstack-query": "^0.8.6",
50847
+ "lodash.debounce": "^4.0.8",
50848
+ pluralize: "^8.0.0",
50849
+ "rc-virtual-list": "^3.14.5",
50850
+ "react-error-boundary": "^4.0.13",
50851
+ "react-shadow-scope": "^1.0.5",
50852
+ "styled-components": "^6.1.13",
50853
+ yarn: "^1.22.22",
50854
+ zod: "^3.23.8"
50855
+ };
50856
+ const publishConfig = {
50857
+ access: "public"
50858
+ };
50859
+ const packageJson = {
50860
+ name,
50861
+ description,
50862
+ version,
50863
+ repository,
50864
+ type,
50865
+ scripts,
50866
+ exports,
50867
+ types,
50868
+ files,
50869
+ devDependencies,
50870
+ peerDependencies,
50871
+ dependencies,
50872
+ publishConfig
50873
+ };
50874
+ let isAmplitudeInitialized = false;
50875
+ const initAmplitude = () => {
50876
+ if (isAmplitudeInitialized) return;
50877
+ init("14616a575f32087cf0403ab8f3ea3ce0", {
50878
+ appVersion: version
50879
+ });
50880
+ isAmplitudeInitialized = true;
50881
+ };
50882
+ const startAmplitudeSessionReplay = () => {
50883
+ if (isAmplitudeInitialized) {
50884
+ const plugin = sessionReplayPlugin({});
50885
+ add(plugin);
50886
+ }
50887
+ };
50645
50888
  const SwapPage = () => {
50646
50889
  var _a;
50647
50890
  const { SettingsFooter, drawerOpen } = useSettingsDrawer();
@@ -50658,7 +50901,7 @@ const SwapPage = () => {
50658
50901
  const isInvertingSwap = useAtomValue(isInvertingSwapAtom);
50659
50902
  const insufficientBalance = useInsufficientSourceBalance();
50660
50903
  const setSwapExecutionState = useSetAtom(setSwapExecutionStateAtom);
50661
- const setError = useSetAtom(errorAtom);
50904
+ const setError = useSetAtom(errorWarningAtom);
50662
50905
  const { isFetching, isPending } = useAtomValue(skipAllBalancesAtom);
50663
50906
  const isLoadingBalances = isFetching && isPending;
50664
50907
  const { data: route2, isError: isRouteError, error: routeError } = useAtomValue(skipRouteAtom);
@@ -50704,7 +50947,7 @@ const SwapPage = () => {
50704
50947
  switchEvmchainId(asset == null ? void 0 : asset.chainId);
50705
50948
  setSourceAssetAmount("");
50706
50949
  setDestinationAssetAmount("");
50707
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50950
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50708
50951
  }
50709
50952
  });
50710
50953
  }, [setDestinationAssetAmount, setSourceAsset, setSourceAssetAmount, switchEvmchainId]);
@@ -50719,7 +50962,7 @@ const SwapPage = () => {
50719
50962
  ...asset
50720
50963
  }));
50721
50964
  switchEvmchainId(asset == null ? void 0 : asset.chainId);
50722
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50965
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50723
50966
  },
50724
50967
  selectedAsset: getClientAsset(sourceAsset == null ? void 0 : sourceAsset.denom, sourceAsset == null ? void 0 : sourceAsset.chainId),
50725
50968
  selectChain: true
@@ -50735,7 +50978,7 @@ const SwapPage = () => {
50735
50978
  ...old,
50736
50979
  ...asset
50737
50980
  }));
50738
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50981
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50739
50982
  }
50740
50983
  });
50741
50984
  }, [setDestinationAsset]);
@@ -50749,7 +50992,7 @@ const SwapPage = () => {
50749
50992
  ...old,
50750
50993
  ...asset
50751
50994
  }));
50752
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50995
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50753
50996
  },
50754
50997
  selectedAsset: getClientAsset(destinationAsset == null ? void 0 : destinationAsset.denom, destinationAsset == null ? void 0 : destinationAsset.chainId),
50755
50998
  selectChain: true
@@ -50826,9 +51069,9 @@ const SwapPage = () => {
50826
51069
  });
50827
51070
  setUserId(sourceAccount == null ? void 0 : sourceAccount.address);
50828
51071
  if (showCosmosLedgerWarning) {
50829
- track("error page: cosmos ledger warning", { route: route2 });
51072
+ track("warning page: cosmos ledger", { route: route2 });
50830
51073
  setError({
50831
- errorType: ErrorType.CosmosLedgerWarning,
51074
+ errorWarningType: ErrorWarningType.CosmosLedgerWarning,
50832
51075
  onClickBack: () => {
50833
51076
  setError(void 0);
50834
51077
  }
@@ -50836,9 +51079,9 @@ const SwapPage = () => {
50836
51079
  return;
50837
51080
  }
50838
51081
  if (((_a3 = route2 == null ? void 0 : route2.warning) == null ? void 0 : _a3.type) === "BAD_PRICE_WARNING") {
50839
- track("error page: bad price warning", { route: route2 });
51082
+ track("warning page: bad price", { route: route2 });
50840
51083
  setError({
50841
- errorType: ErrorType.BadPriceWarning,
51084
+ errorWarningType: ErrorWarningType.BadPriceWarning,
50842
51085
  onClickContinue: () => {
50843
51086
  setError(void 0);
50844
51087
  setChainAddresses({});
@@ -50853,9 +51096,9 @@ const SwapPage = () => {
50853
51096
  return;
50854
51097
  }
50855
51098
  if (((_b = route2 == null ? void 0 : route2.warning) == null ? void 0 : _b.type) === "LOW_INFO_WARNING") {
50856
- track("error page: low info warning", { route: route2 });
51099
+ track("warning page: low info", { route: route2 });
50857
51100
  setError({
50858
- errorType: ErrorType.LowInfoWarning,
51101
+ errorWarningType: ErrorWarningType.LowInfoWarning,
50859
51102
  onClickContinue: () => {
50860
51103
  setError(void 0);
50861
51104
  setChainAddresses({});
@@ -50870,9 +51113,9 @@ const SwapPage = () => {
50870
51113
  return;
50871
51114
  }
50872
51115
  if (showGoFastWarning && isGoFast) {
50873
- track("error page: go fast warning", { route: route2 });
51116
+ track("warning page: go fast", { route: route2 });
50874
51117
  setError({
50875
- errorType: ErrorType.GoFastWarning,
51118
+ errorWarningType: ErrorWarningType.GoFastWarning,
50876
51119
  onClickContinue: () => {
50877
51120
  setError(void 0);
50878
51121
  setChainAddresses({});
@@ -50890,6 +51133,7 @@ const SwapPage = () => {
50890
51133
  setCurrentPage(Routes.SwapExecutionPage);
50891
51134
  setUser({ username: sourceAccount == null ? void 0 : sourceAccount.address });
50892
51135
  if (sourceAccount == null ? void 0 : sourceAccount.address) {
51136
+ startAmplitudeSessionReplay();
50893
51137
  const replay = getReplay();
50894
51138
  replay == null ? void 0 : replay.start();
50895
51139
  }
@@ -51756,14 +52000,31 @@ function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
51756
52000
  }
51757
52001
  throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'");
51758
52002
  }
51759
- const getMobileDateFormat = (date) => {
51760
- const hours = String(date.getHours());
51761
- const minutes = String(date.getMinutes());
51762
- const timeZone = date.toLocaleTimeString("en-US", { timeZoneName: "short" }).split(" ").pop();
51763
- const month = date.getMonth() + 1;
51764
- const day = date.getDate();
51765
- const year = String(date.getFullYear()).slice(-2);
51766
- return `${hours}:${minutes} ${timeZone} ${month}/${day}/${year}`;
52003
+ const getMobileDateFormat = (date, timeZone) => {
52004
+ const options = {
52005
+ timeZone: void 0,
52006
+ // undefined means local time
52007
+ hour: "2-digit",
52008
+ minute: "2-digit",
52009
+ timeZoneName: "short",
52010
+ day: "2-digit",
52011
+ month: "2-digit",
52012
+ year: "2-digit",
52013
+ hour12: false
52014
+ };
52015
+ const formatter = new Intl.DateTimeFormat("en-US", options);
52016
+ const parts = formatter.formatToParts(date);
52017
+ const lookup = (type2) => {
52018
+ var _a;
52019
+ return ((_a = parts.find((p2) => p2.type === type2)) == null ? void 0 : _a.value) ?? "";
52020
+ };
52021
+ const hours = lookup("hour");
52022
+ const minutes = lookup("minute");
52023
+ const tz = lookup("timeZoneName");
52024
+ const day = lookup("day");
52025
+ const month = lookup("month");
52026
+ const year = lookup("year");
52027
+ return `${hours}:${minutes} ${tz} ${month}/${day}/${year}`;
51767
52028
  };
51768
52029
  const useTxHistory = ({
51769
52030
  txHistoryItem,
@@ -51975,13 +52236,6 @@ const RenderAssetAmount = ({
51975
52236
  sourceAsset = false
51976
52237
  }) => {
51977
52238
  const isMobileScreenSize = useIsMobileScreenSize();
51978
- const formattedAmount = useMemo(() => {
51979
- const numberAfterLimitTwoDecimalPlaces = limitDecimalsDisplayed(amount, 2);
51980
- if (numberAfterLimitTwoDecimalPlaces === "0.00") {
51981
- return "< 0.01";
51982
- }
51983
- return numberAfterLimitTwoDecimalPlaces;
51984
- }, [amount]);
51985
52239
  const subtitle = useMemo(() => {
51986
52240
  if (!asset) return;
51987
52241
  const verboseString = `${asset == null ? void 0 : asset.recommendedSymbol} on ${chainName ?? (asset == null ? void 0 : asset.chainName)}`;
@@ -51990,10 +52244,12 @@ const RenderAssetAmount = ({
51990
52244
  }
51991
52245
  return verboseString;
51992
52246
  }, [asset, chainName, isMobileScreenSize, sourceAsset]);
51993
- return /* @__PURE__ */ jsxs(Row, { gap: 8, children: [
51994
- /* @__PURE__ */ jsx("img", { height: 35, width: 35, src: assetImage, alt: subtitle }),
52247
+ return /* @__PURE__ */ jsxs(Row, { gap: 8, align: "center", children: [
52248
+ /* @__PURE__ */ jsx("img", { height: 30, width: 30, src: assetImage, alt: subtitle }),
51995
52249
  /* @__PURE__ */ jsxs(Column, { style: sourceAsset ? { width: 50 } : void 0, children: [
51996
- /* @__PURE__ */ jsx(Tooltip, { content: amount, style: { width: "min-content" }, children: /* @__PURE__ */ jsx(Text, { normalTextColor: true, style: { width: "max-content" }, children: formattedAmount }) }),
52250
+ /* @__PURE__ */ jsx(Tooltip, { content: amount, style: { width: "min-content" }, children: /* @__PURE__ */ jsx(Text, { normalTextColor: true, style: { width: "max-content" }, children: formatDisplayAmount(amount, {
52251
+ decimals: 2
52252
+ }) }) }),
51997
52253
  /* @__PURE__ */ jsx(SmallText, { title: asset == null ? void 0 : asset.chainName, textWrap: "nowrap", overflowEllipsis: true, children: subtitle })
51998
52254
  ] })
51999
52255
  ] });
@@ -52168,9 +52424,9 @@ const useKeepWalletStateSynced = () => {
52168
52424
  const Router = () => {
52169
52425
  useKeepWalletStateSynced();
52170
52426
  const [currentPage] = useAtom(currentPageAtom);
52171
- const [error, setError] = useAtom(errorAtom);
52172
- if (error) {
52173
- return /* @__PURE__ */ jsx(ErrorPage, {});
52427
+ const [errorWarning, setErrorWarning] = useAtom(errorWarningAtom);
52428
+ if (errorWarning) {
52429
+ return /* @__PURE__ */ jsx(ErrorWarningPage, {});
52174
52430
  }
52175
52431
  switch (currentPage) {
52176
52432
  case Routes.SwapPage:
@@ -52178,9 +52434,9 @@ const Router = () => {
52178
52434
  ErrorBoundary,
52179
52435
  {
52180
52436
  fallback: null,
52181
- onError: (error2) => {
52182
- track("error page: unexpected error from swap page", { error: error2 });
52183
- setError({ errorType: ErrorType.Unexpected, error: error2 });
52437
+ onError: (error) => {
52438
+ track("unexpected error page: unexpected error from swap page", { error });
52439
+ setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error });
52184
52440
  },
52185
52441
  children: /* @__PURE__ */ jsx(SwapPage, {})
52186
52442
  }
@@ -52190,9 +52446,9 @@ const Router = () => {
52190
52446
  ErrorBoundary,
52191
52447
  {
52192
52448
  fallback: null,
52193
- onError: (error2) => {
52194
- track("error page: unexpected error from execution page", { error: error2 });
52195
- setError({ errorType: ErrorType.Unexpected, error: error2 });
52449
+ onError: (error) => {
52450
+ track("unexpected error page: unexpected error from execution page", { error });
52451
+ setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error });
52196
52452
  },
52197
52453
  children: /* @__PURE__ */ jsx(SwapExecutionPage, {})
52198
52454
  }
@@ -52202,9 +52458,11 @@ const Router = () => {
52202
52458
  ErrorBoundary,
52203
52459
  {
52204
52460
  fallback: null,
52205
- onError: (error2) => {
52206
- track("error page: unexpected error from transaction history page", { error: error2 });
52207
- setError({ errorType: ErrorType.Unexpected, error: error2 });
52461
+ onError: (error) => {
52462
+ track("unexpected error page: unexpected error from transaction history page", {
52463
+ error
52464
+ });
52465
+ setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error });
52208
52466
  },
52209
52467
  children: /* @__PURE__ */ jsx(TransactionHistoryPage, {})
52210
52468
  }
@@ -52224,7 +52482,7 @@ const useInitDefaultRoute = (defaultRoute) => {
52224
52482
  let isSentryInitialized = false;
52225
52483
  const initSentry = () => {
52226
52484
  if (isSentryInitialized) return;
52227
- init({
52485
+ init$1({
52228
52486
  dsn: "https://10ce608bdd1c68a13d3849d6b242333c@o4504768725909504.ingest.us.sentry.io/4508485201231872",
52229
52487
  tunnel: "https://go.skip.build/api/sentry",
52230
52488
  defaultIntegrations: false,
@@ -52249,163 +52507,6 @@ const initSentry = () => {
52249
52507
  });
52250
52508
  isSentryInitialized = true;
52251
52509
  };
52252
- const name = "@skip-go/widget";
52253
- const description = "Swap widget";
52254
- const version = "3.10.2";
52255
- const repository = {
52256
- url: "https://github.com/skip-mev/skip-go",
52257
- directory: "packages/widget"
52258
- };
52259
- const type = "module";
52260
- const scripts = {
52261
- dev: "vite --force --host",
52262
- "dev:storybook": "storybook dev -p 6006",
52263
- build: "npm run generate-chains && NODE_OPTIONS=--max-old-space-size=16384 vite build",
52264
- "watch:build": "vite build --watch",
52265
- lint: "NODE_OPTIONS=--max-old-space-size=32384 eslint . --fix",
52266
- preview: "vite preview",
52267
- "build:web-component": "NODE_OPTIONS=--max-old-space-size=32384 webpack --config webpack.config.js",
52268
- "publish:web-component": "npm run build:web-component && cd web-component && npm publish && cd ..",
52269
- prepack: "yarn run pre",
52270
- postpack: "yarn run post",
52271
- pre: "npm run build && node scripts/prepublish.cjs",
52272
- post: "git checkout -- package.json",
52273
- "generate-chains": "node scripts/generate-chains.cjs",
52274
- "update-registries": "yarn up @initia/initia-registry chain-registry",
52275
- test: "yarn playwright test"
52276
- };
52277
- const exports = {
52278
- ".": {
52279
- types: "./build/index.d.ts",
52280
- "import": "./build/index.js"
52281
- }
52282
- };
52283
- const types = "./build/index.d.ts";
52284
- const files = [
52285
- "build",
52286
- "README.md"
52287
- ];
52288
- const devDependencies = {
52289
- "@chromatic-com/storybook": "^1.6.1",
52290
- "@eslint/js": "^9.9.0",
52291
- "@initia/initia-registry": "^1.0.5",
52292
- "@keplr-wallet/types": "^0.12.125",
52293
- "@playwright/test": "^1.51.1",
52294
- "@storybook/addon-essentials": "^8.2.6",
52295
- "@storybook/addon-interactions": "^8.2.6",
52296
- "@storybook/addon-links": "^8.2.6",
52297
- "@storybook/addon-onboarding": "^8.2.6",
52298
- "@storybook/blocks": "^8.2.6",
52299
- "@storybook/react": "^8.2.6",
52300
- "@storybook/react-vite": "^8.2.6",
52301
- "@storybook/test": "^8.2.6",
52302
- "@testing-library/dom": "^10.4.0",
52303
- "@testing-library/react": "^16.2.0",
52304
- "@types/eslint__js": "^8.42.3",
52305
- "@types/pluralize": "^0.0.33",
52306
- "@types/react": "^19.0.10",
52307
- "@types/react-dom": "^19.0.4",
52308
- "@typescript-eslint/eslint-plugin": "^7.15.0",
52309
- "@typescript-eslint/parser": "^7.15.0",
52310
- "@vitejs/plugin-react": "^4.3.1",
52311
- buffer: "^6.0.3",
52312
- "chain-registry": "^1.69.218",
52313
- download: "^8.0.0",
52314
- eslint: "^9.9.0",
52315
- "eslint-config-prettier": "^9.1.0",
52316
- "eslint-plugin-prettier": "^5.2.1",
52317
- "eslint-plugin-react-hooks": "^4.6.2",
52318
- "fs-extra": "^11.3.0",
52319
- "node-polyfill-webpack-plugin": "^4.0.0",
52320
- "pino-pretty": "^13.0.0",
52321
- "postcss-loader": "^8.1.1",
52322
- prettier: "^3.4.2",
52323
- process: "^0.11.10",
52324
- "raw-loader": "^4.0.2",
52325
- react: ">=17.0.0",
52326
- "react-dom": ">=17.0.0",
52327
- starknet: "6.11.0",
52328
- storybook: "^8.2.6",
52329
- "ts-loader": "^9.5.1",
52330
- typescript: "^5.5.4",
52331
- "typescript-eslint": "^8.2.0",
52332
- "url-loader": "^4.1.1",
52333
- vite: "^5.3.4",
52334
- "vite-plugin-dts": "^4.0.0-beta.1",
52335
- "vite-plugin-node-polyfills": "^0.22.0",
52336
- webpack: "^5.94.0",
52337
- "webpack-cli": "^5.1.4"
52338
- };
52339
- const peerDependencies = {
52340
- "@tanstack/react-query": "^5.51.21",
52341
- react: ">=17.0.0",
52342
- "react-dom": ">=17.0.0",
52343
- viem: "^2.21.55",
52344
- wagmi: "^2.14.1"
52345
- };
52346
- const dependencies = {
52347
- "@amplitude/analytics-browser": "^2.11.12",
52348
- "@amplitude/plugin-session-replay-browser": "^1.16.5",
52349
- "@cosmjs/amino": "0.33.1",
52350
- "@cosmjs/cosmwasm-stargate": "0.33.1",
52351
- "@cosmjs/encoding": "0.33.1",
52352
- "@cosmjs/math": "0.33.1",
52353
- "@cosmjs/proto-signing": "0.33.1",
52354
- "@cosmjs/stargate": "0.33.1",
52355
- "@ebay/nice-modal-react": "^1.2.13",
52356
- "@eslint/compat": "^1.1.1",
52357
- "@penumbra-zone/bech32m": "^13.0.0",
52358
- "@penumbra-zone/client": "^24.0.0",
52359
- "@penumbra-zone/protobuf": "^7.2.0",
52360
- "@penumbra-zone/transport-dom": "^7.5.0",
52361
- "@r2wc/react-to-web-component": "^2.0.3",
52362
- "@sentry/react": "^8.46.0",
52363
- "@skip-go/client": "workspace:^",
52364
- "@solana/spl-token": "^0.4.8",
52365
- "@solana/wallet-adapter-backpack": "^0.1.14",
52366
- "@solana/wallet-adapter-coinbase": "^0.1.19",
52367
- "@solana/wallet-adapter-ledger": "^0.9.25",
52368
- "@solana/wallet-adapter-phantom": "^0.9.24",
52369
- "@solana/wallet-adapter-solflare": "^0.6.28",
52370
- "@solana/wallet-adapter-trust": "^0.1.13",
52371
- "@solana/web3.js": "^1.95.8",
52372
- "@tanstack/query-core": "^5.51.21",
52373
- "@walletconnect/modal": "2.7.0",
52374
- "@walletconnect/sign-client": "2.17.2",
52375
- "@walletconnect/solana-adapter": "^0.0.6",
52376
- add: "^2.0.6",
52377
- bech32: "^2.0.0",
52378
- graz: "0.3.2",
52379
- jotai: "^2.10.1",
52380
- "jotai-effect": "^1.0.2",
52381
- "jotai-tanstack-query": "^0.8.6",
52382
- "lodash.debounce": "^4.0.8",
52383
- pluralize: "^8.0.0",
52384
- "rc-virtual-list": "^3.14.5",
52385
- "react-error-boundary": "^4.0.13",
52386
- "react-shadow-scope": "^1.0.5",
52387
- "styled-components": "^6.1.13",
52388
- yarn: "^1.22.22",
52389
- zod: "^3.23.8"
52390
- };
52391
- const publishConfig = {
52392
- access: "public"
52393
- };
52394
- const packageJson = {
52395
- name,
52396
- description,
52397
- version,
52398
- repository,
52399
- type,
52400
- scripts,
52401
- exports,
52402
- types,
52403
- files,
52404
- devDependencies,
52405
- peerDependencies,
52406
- dependencies,
52407
- publishConfig
52408
- };
52409
52510
  const useMobileRouteConfig = () => {
52410
52511
  const isMobile2 = useIsMobileScreenSize();
52411
52512
  const setRouteConfig = useSetAtom(routeConfigAtom);
@@ -52416,17 +52517,6 @@ const useMobileRouteConfig = () => {
52416
52517
  }));
52417
52518
  }, [isMobile2, setRouteConfig]);
52418
52519
  };
52419
- let isAmplitudeInitialized = false;
52420
- const initAmplitude = () => {
52421
- if (isAmplitudeInitialized) return;
52422
- const plugin = sessionReplayPlugin();
52423
- add(plugin);
52424
- init$1("14616a575f32087cf0403ab8f3ea3ce0", {
52425
- autocapture: true,
52426
- appVersion: version
52427
- });
52428
- isAmplitudeInitialized = true;
52429
- };
52430
52520
  const useInitWidget = (props) => {
52431
52521
  var _a, _b;
52432
52522
  if (props.enableSentrySessionReplays) {