@skip-go/widget 3.10.1 → 3.10.3

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,13 +1,13 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import o, { useState, useMemo, useEffect, useContext, useRef, useDebugValue, createElement, useCallback, Fragment as Fragment$1 } from "react";
2
+ import o, { useContext, useState, useMemo, useEffect, useRef, useDebugValue, createElement, useCallback, Fragment as Fragment$1, forwardRef } from "react";
3
3
  import { Scope } from "react-shadow-scope";
4
4
  import { atom as atom$1, useAtomValue, useAtom, useSetAtom, createStore, Provider } from "jotai";
5
5
  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-DI-xtNqN.js");
43212
+ const { EthereumProvider } = await import("./index.es-CPA_Zoq7.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;
@@ -44497,12 +44517,14 @@ const VirtualList = ({
44497
44517
  renderItem,
44498
44518
  itemKey,
44499
44519
  className,
44500
- empty
44520
+ empty,
44521
+ expandedItemKey
44501
44522
  }) => {
44502
44523
  const theme = nt();
44503
44524
  const [currentlyFocusedElement, setCurrentlyFocusedElement] = useState();
44504
44525
  const listHeight = useListHeight(itemHeight);
44505
44526
  const listRef = useRef(null);
44527
+ const itemRefs = useRef({});
44506
44528
  useEffect(() => {
44507
44529
  var _a, _b, _c;
44508
44530
  const listElement = (_c = (_b = (_a = listRef.current) == null ? void 0 : _a.nativeElement) == null ? void 0 : _b.getElementsByClassName(
@@ -44541,6 +44563,13 @@ const VirtualList = ({
44541
44563
  (_a = listRef.current) == null ? void 0 : _a.scrollTo(0);
44542
44564
  }, 0);
44543
44565
  }, [listItems.length]);
44566
+ useEffect(() => {
44567
+ if (!listRef.current || expandedItemKey == null) return;
44568
+ const index = listItems.findIndex((item) => itemKey(item) === expandedItemKey);
44569
+ if (index !== -1) {
44570
+ listRef.current.scrollTo({ index, align: "top" });
44571
+ }
44572
+ }, [expandedItemKey, listItems, itemKey]);
44544
44573
  if (listItems.length === 0) {
44545
44574
  return /* @__PURE__ */ jsxs(StyledNoResultsContainer, { gap: 10, height: height ?? listHeight, children: [
44546
44575
  empty == null ? void 0 : empty.icon,
@@ -44567,7 +44596,9 @@ const VirtualList = ({
44567
44596
  backgroundColor: getHexColor(theme.primary.text.normal) + opacityToHex(50)
44568
44597
  }
44569
44598
  },
44570
- children: (item, index) => renderItem(item, index)
44599
+ children: (item, index) => renderItem(item, index, (el) => {
44600
+ itemRefs.current[itemKey(item)] = el;
44601
+ })
44571
44602
  }
44572
44603
  );
44573
44604
  };
@@ -48566,11 +48597,8 @@ const useSettingsDrawer = () => {
48566
48597
  };
48567
48598
  return { SettingsFooter, drawerOpen };
48568
48599
  };
48569
- const ErrorPageGoFastWarning = ({
48570
- onClickBack,
48571
- onClickContinue
48572
- }) => {
48573
- const setErrorAtom = useSetAtom(errorAtom);
48600
+ const WarningPageGoFast = ({ onClickBack, onClickContinue }) => {
48601
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
48574
48602
  const setShowGoFastErrorAtom = useSetAtom(goFastWarningAtom);
48575
48603
  const { SettingsFooter, drawerOpen } = useSettingsDrawer();
48576
48604
  const theme = nt();
@@ -48579,7 +48607,7 @@ const ErrorPageGoFastWarning = ({
48579
48607
  setTag("goFastWarning", true);
48580
48608
  }, [setShowGoFastErrorAtom]);
48581
48609
  const handleOnClickBack = () => {
48582
- setErrorAtom(void 0);
48610
+ setErrorWarningAtom(void 0);
48583
48611
  onClickBack == null ? void 0 : onClickBack();
48584
48612
  };
48585
48613
  return /* @__PURE__ */ jsxs(
@@ -48597,14 +48625,14 @@ const ErrorPageGoFastWarning = ({
48597
48625
  label: "Back",
48598
48626
  icon: ICONS.thinArrow,
48599
48627
  onClick: () => {
48600
- track("error page: go fast warning - header back button clicked");
48628
+ track("warning page: go fast - header back button clicked");
48601
48629
  handleOnClickBack();
48602
48630
  }
48603
48631
  }
48604
48632
  }
48605
48633
  ),
48606
48634
  /* @__PURE__ */ jsx(
48607
- ErrorPageContent,
48635
+ ErrorWarningPageContent,
48608
48636
  {
48609
48637
  title: "You're on the fastest route",
48610
48638
  description: /* @__PURE__ */ jsxs(SmallText, { textAlign: "center", textWrap: "balance", lineHeight: "17px", children: [
@@ -48627,7 +48655,7 @@ const ErrorPageGoFastWarning = ({
48627
48655
  label: "Continue",
48628
48656
  icon: ICONS.rightArrow,
48629
48657
  onClick: () => {
48630
- track("error page: go fast warning - main continue button clicked");
48658
+ track("warning page: go fast - main continue button clicked");
48631
48659
  onClickContinue();
48632
48660
  }
48633
48661
  }
@@ -48640,7 +48668,7 @@ const ErrorPageGoFastWarning = ({
48640
48668
  const StyledSettingsContainer = dt(Row)`
48641
48669
  display: inline-flex;
48642
48670
  `;
48643
- const ErrorPageLowInfoWarning = ({
48671
+ const WarningPageLowInfo = ({
48644
48672
  onClickContinue,
48645
48673
  onClickBack,
48646
48674
  route: route2
@@ -48672,14 +48700,14 @@ const ErrorPageLowInfoWarning = ({
48672
48700
  label: "Back",
48673
48701
  icon: ICONS.thinArrow,
48674
48702
  onClick: () => {
48675
- track("error page: low info warning - header back button clicked");
48703
+ track("warning page: low info - header back button clicked");
48676
48704
  onClickBack();
48677
48705
  }
48678
48706
  }
48679
48707
  }
48680
48708
  ),
48681
48709
  /* @__PURE__ */ jsx(
48682
- ErrorPageContent,
48710
+ ErrorWarningPageContent,
48683
48711
  {
48684
48712
  title: "Warning: Incomplete Price Data",
48685
48713
  description: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -48698,7 +48726,7 @@ const ErrorPageLowInfoWarning = ({
48698
48726
  SmallTextButton,
48699
48727
  {
48700
48728
  onClick: () => {
48701
- track("error page: low info warning - continue anyway clicked");
48729
+ track("warning page: low info - continue anyway clicked");
48702
48730
  onClickContinue();
48703
48731
  },
48704
48732
  color: theme.primary.text.lowContrast,
@@ -48717,7 +48745,7 @@ const ErrorPageLowInfoWarning = ({
48717
48745
  label: "Back",
48718
48746
  icon: ICONS.leftArrow,
48719
48747
  onClick: () => {
48720
- track("error page: low info warning - main back button clicked");
48748
+ track("warning page: low info - main back button clicked");
48721
48749
  onClickBack();
48722
48750
  },
48723
48751
  backgroundColor: theme.warning.text
@@ -48725,15 +48753,18 @@ const ErrorPageLowInfoWarning = ({
48725
48753
  )
48726
48754
  ] });
48727
48755
  };
48728
- const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48756
+ const ExpectedErrorPageInsufficientGasBalance = ({
48757
+ error,
48758
+ onClickBack
48759
+ }) => {
48729
48760
  const theme = nt();
48730
- const setErrorAtom = useSetAtom(errorAtom);
48761
+ const setErrorWarningAtom = useSetAtom(errorWarningAtom);
48731
48762
  const setCurrentPage = useSetAtom(currentPageAtom);
48732
48763
  useEffect(() => {
48733
48764
  setTag("errorMessage", error == null ? void 0 : error.message);
48734
48765
  }, [error == null ? void 0 : error.message]);
48735
48766
  const onClickRetry = () => {
48736
- setErrorAtom(void 0);
48767
+ setErrorWarningAtom(void 0);
48737
48768
  setCurrentPage(Routes.SwapPage);
48738
48769
  };
48739
48770
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -48744,8 +48775,8 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48744
48775
  label: "Back",
48745
48776
  icon: ICONS.thinArrow,
48746
48777
  onClick: () => {
48747
- track("error page: insufficient gas balance - header back button clicked");
48748
- setErrorAtom(void 0);
48778
+ track("expected error page: insufficient gas balance - header back button clicked");
48779
+ setErrorWarningAtom(void 0);
48749
48780
  onClickBack == null ? void 0 : onClickBack();
48750
48781
  setCurrentPage(Routes.SwapPage);
48751
48782
  }
@@ -48753,7 +48784,7 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48753
48784
  }
48754
48785
  ),
48755
48786
  /* @__PURE__ */ jsx(
48756
- ErrorPageContent,
48787
+ ErrorWarningPageContent,
48757
48788
  {
48758
48789
  title: "Insufficient gas balance",
48759
48790
  description: error == null ? void 0 : error.message,
@@ -48768,7 +48799,7 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48768
48799
  label: "Retry",
48769
48800
  icon: ICONS.rightArrow,
48770
48801
  onClick: () => {
48771
- track("error page: insufficient gas balance - retry button clicked");
48802
+ track("expected error page: insufficient gas balance - retry button clicked");
48772
48803
  onClickRetry();
48773
48804
  },
48774
48805
  backgroundColor: theme.error.text
@@ -48776,37 +48807,90 @@ const ErrorPageInsufficientGasBalance = ({ error, onClickBack }) => {
48776
48807
  )
48777
48808
  ] });
48778
48809
  };
48779
- const ErrorPage = () => {
48780
- 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);
48781
48863
  const renderErrorVariant = useMemo(() => {
48782
- switch (error == null ? void 0 : error.errorType) {
48783
- case ErrorType.AuthFailed:
48784
- return /* @__PURE__ */ jsx(ErrorPageAuthFailed, { ...error });
48785
- case ErrorType.GoFastWarning:
48786
- return /* @__PURE__ */ jsx(ErrorPageGoFastWarning, { ...error });
48787
- case ErrorType.Timeout:
48788
- return /* @__PURE__ */ jsx(ErrorPageTimeout, { ...error });
48789
- case ErrorType.AdditionalSigningRequired:
48790
- return /* @__PURE__ */ jsx(ErrorPageTradeAdditionalSigningRequired, { ...error });
48791
- case ErrorType.BadPriceWarning:
48792
- return /* @__PURE__ */ jsx(ErrorPageBadPriceWarning, { ...error });
48793
- case ErrorType.TransactionFailed:
48794
- return /* @__PURE__ */ jsx(ErrorPageTransactionFailed, { ...error });
48795
- case ErrorType.TransactionReverted:
48796
- return /* @__PURE__ */ jsx(ErrorPageTransactionReverted, { ...error });
48797
- case ErrorType.Unexpected:
48798
- return /* @__PURE__ */ jsx(ErrorPageUnexpected, { error: error.error });
48799
- case ErrorType.InsufficientBalanceForGas:
48800
- return /* @__PURE__ */ jsx(ErrorPageInsufficientGasBalance, { error: error.error });
48801
- case ErrorType.CosmosLedgerWarning:
48802
- return /* @__PURE__ */ jsx(ErrorPageCosmosLedgerWarning, { ...error });
48803
- case ErrorType.LowInfoWarning:
48804
- 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 });
48805
48889
  default:
48806
48890
  return;
48807
48891
  }
48808
- }, [error]);
48809
- 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;
48810
48894
  return /* @__PURE__ */ jsx(Column, { gap: 5, children: renderErrorVariant });
48811
48895
  };
48812
48896
  const SwapExecutionPageRouteSimpleRow = ({
@@ -48852,9 +48936,6 @@ const SwapExecutionPageRouteSimpleRow = ({
48852
48936
  }
48853
48937
  }
48854
48938
  }, [chainAddresses, context]);
48855
- const displayAmount = useMemo(() => {
48856
- return formatDisplayAmount(assetDetails.amount);
48857
- }, [assetDetails.amount]);
48858
48939
  const renderExplorerLink = useMemo(() => {
48859
48940
  if (!explorerLink) return;
48860
48941
  if (isMobileScreenSize) {
@@ -48883,7 +48964,7 @@ const SwapExecutionPageRouteSimpleRow = ({
48883
48964
  ),
48884
48965
  /* @__PURE__ */ jsxs(Column, { gap: 5, children: [
48885
48966
  /* @__PURE__ */ jsxs(StyledSymbolAndAmount, { children: [
48886
- displayAmount,
48967
+ formatDisplayAmount(assetDetails.amount),
48887
48968
  " ",
48888
48969
  assetDetails == null ? void 0 : assetDetails.symbol
48889
48970
  ] }),
@@ -49470,7 +49551,7 @@ const useAutoSetAddress = () => {
49470
49551
  };
49471
49552
  const useHandleTransactionTimeout = (swapExecutionState) => {
49472
49553
  const { route: route2, transactionDetailsArray } = useAtomValue(swapExecutionStateAtom);
49473
- const setError = useSetAtom(errorAtom);
49554
+ const setError = useSetAtom(errorWarningAtom);
49474
49555
  const setOverallStatus = useSetAtom(setOverallStatusAtom);
49475
49556
  const [transactionTimeoutTimer, setTransactionTimeoutTimer] = useState();
49476
49557
  useEffect(() => {
@@ -49479,9 +49560,9 @@ const useHandleTransactionTimeout = (swapExecutionState) => {
49479
49560
  const lastTransaction = transactionDetailsArray[transactionDetailsArray.length - 1];
49480
49561
  const timeoutTimer = setTimeout(
49481
49562
  () => {
49482
- track("error page: transaction overtime", { route: route2 });
49563
+ track("unexpected error page: transaction timeover", { route: route2 });
49483
49564
  setError({
49484
- errorType: ErrorType.Timeout,
49565
+ errorWarningType: ErrorWarningType.Timeout,
49485
49566
  onClickBack: () => {
49486
49567
  setOverallStatus("unconfirmed");
49487
49568
  },
@@ -49731,7 +49812,7 @@ const SwapExecutionButton = ({
49731
49812
  swapExecutionState
49732
49813
  });
49733
49814
  const theme = nt();
49734
- const setError = useSetAtom(errorAtom);
49815
+ const setErrorWarning = useSetAtom(errorWarningAtom);
49735
49816
  const setCurrentPage = useSetAtom(currentPageAtom);
49736
49817
  const clearAssetInputAmounts = useSetAtom(clearAssetInputAmountsAtom);
49737
49818
  const isGoFast = useIsGoFast(route2);
@@ -49782,9 +49863,9 @@ const SwapExecutionButton = ({
49782
49863
  track("swap execution page: confirm button - clicked", { route: route2 });
49783
49864
  const onClickConfirmSwap = () => {
49784
49865
  if ((route2 == null ? void 0 : route2.txsRequired) && route2.txsRequired > 1) {
49785
- track("error page: additional signing required", { route: route2 });
49786
- setError({
49787
- errorType: ErrorType.AdditionalSigningRequired,
49866
+ track("warning page: additional signing required", { route: route2 });
49867
+ setErrorWarning({
49868
+ errorWarningType: ErrorWarningType.AdditionalSigningRequired,
49788
49869
  onClickContinue: () => submitExecuteRouteMutation(),
49789
49870
  signaturesRequired: route2.txsRequired
49790
49871
  });
@@ -49845,7 +49926,7 @@ const SwapExecutionButton = ({
49845
49926
  };
49846
49927
  const useHandleTransactionFailed = (statusData) => {
49847
49928
  var _a, _b;
49848
- const setError = useSetAtom(errorAtom);
49929
+ const setErrorWarning = useSetAtom(errorWarningAtom);
49849
49930
  const setCurrentPage = useSetAtom(currentPageAtom);
49850
49931
  const setSourceAssetAtom = useSetAtom(sourceAssetAtom);
49851
49932
  const setDebouncedSourceAssetAmountAtom = useSetAtom(debouncedSourceAssetAmountAtom);
@@ -49869,12 +49950,12 @@ const useHandleTransactionFailed = (statusData) => {
49869
49950
  useEffect(() => {
49870
49951
  if ((statusData == null ? void 0 : statusData.isSettled) && !(statusData == null ? void 0 : statusData.isSuccess)) {
49871
49952
  if (sourceClientAsset) {
49872
- track("error page: transaction reverted", {
49953
+ track("unexpected error page: transaction reverted", {
49873
49954
  transferAssetRelease: statusData.transferAssetRelease,
49874
49955
  lastTransaction
49875
49956
  });
49876
- setError({
49877
- errorType: ErrorType.TransactionReverted,
49957
+ setErrorWarning({
49958
+ errorWarningType: ErrorWarningType.TransactionReverted,
49878
49959
  onClickContinueTransaction: () => {
49879
49960
  var _a2;
49880
49961
  setSourceAssetAtom(sourceClientAsset);
@@ -49884,16 +49965,16 @@ const useHandleTransactionFailed = (statusData) => {
49884
49965
  true
49885
49966
  );
49886
49967
  setCurrentPage(Routes.SwapPage);
49887
- setError(void 0);
49968
+ setErrorWarning(void 0);
49888
49969
  },
49889
49970
  explorerUrl: (lastTransaction == null ? void 0 : lastTransaction.explorerLink) ?? "",
49890
49971
  transferAssetRelease: statusData.transferAssetRelease
49891
49972
  });
49892
49973
  return;
49893
49974
  }
49894
- track("error page: transaction failed", { lastTransaction });
49895
- setError({
49896
- errorType: ErrorType.TransactionFailed,
49975
+ track("unexpected error page: transaction failed", { lastTransaction });
49976
+ setErrorWarning({
49977
+ errorWarningType: ErrorWarningType.TransactionFailed,
49897
49978
  onClickContactSupport: () => window.open("https://skip.build/discord", "_blank"),
49898
49979
  explorerLink: (lastTransaction == null ? void 0 : lastTransaction.explorerLink) ?? "",
49899
49980
  txHash: lastTransaction == null ? void 0 : lastTransaction.txHash
@@ -49905,7 +49986,7 @@ const useHandleTransactionFailed = (statusData) => {
49905
49986
  lastTransaction == null ? void 0 : lastTransaction.txHash,
49906
49987
  setCurrentPage,
49907
49988
  setDebouncedSourceAssetAmountAtom,
49908
- setError,
49989
+ setErrorWarning,
49909
49990
  setSourceAssetAtom,
49910
49991
  sourceClientAsset,
49911
49992
  statusData == null ? void 0 : statusData.isSettled,
@@ -50602,7 +50683,8 @@ const useUpdateAmountWhenRouteChanges = () => {
50602
50683
  ...old,
50603
50684
  amount: formatDisplayAmount(swapInAmount, {
50604
50685
  decimals: destinationAsset.decimals,
50605
- showLessThanSign: false
50686
+ showLessThanSign: false,
50687
+ abbreviate: false
50606
50688
  })
50607
50689
  }));
50608
50690
  } else if (direction === "swap-out" && swapOutAmountChanged) {
@@ -50610,7 +50692,8 @@ const useUpdateAmountWhenRouteChanges = () => {
50610
50692
  ...old,
50611
50693
  amount: formatDisplayAmount(swapOutAmount, {
50612
50694
  decimals: sourceAsset.decimals,
50613
- showLessThanSign: false
50695
+ showLessThanSign: false,
50696
+ abbreviate: false
50614
50697
  })
50615
50698
  }));
50616
50699
  }
@@ -50631,6 +50714,177 @@ const useShowCosmosLedgerWarning = () => {
50631
50714
  return !!(account == null ? void 0 : account.wallet.isLedger);
50632
50715
  }, [sourceAsset == null ? void 0 : sourceAsset.chainId, chainType, getAccount]);
50633
50716
  };
50717
+ const name = "@skip-go/widget";
50718
+ const description = "Swap widget";
50719
+ const version = "3.10.3";
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
+ };
50634
50888
  const SwapPage = () => {
50635
50889
  var _a;
50636
50890
  const { SettingsFooter, drawerOpen } = useSettingsDrawer();
@@ -50647,7 +50901,7 @@ const SwapPage = () => {
50647
50901
  const isInvertingSwap = useAtomValue(isInvertingSwapAtom);
50648
50902
  const insufficientBalance = useInsufficientSourceBalance();
50649
50903
  const setSwapExecutionState = useSetAtom(setSwapExecutionStateAtom);
50650
- const setError = useSetAtom(errorAtom);
50904
+ const setError = useSetAtom(errorWarningAtom);
50651
50905
  const { isFetching, isPending } = useAtomValue(skipAllBalancesAtom);
50652
50906
  const isLoadingBalances = isFetching && isPending;
50653
50907
  const { data: route2, isError: isRouteError, error: routeError } = useAtomValue(skipRouteAtom);
@@ -50693,7 +50947,7 @@ const SwapPage = () => {
50693
50947
  switchEvmchainId(asset == null ? void 0 : asset.chainId);
50694
50948
  setSourceAssetAmount("");
50695
50949
  setDestinationAssetAmount("");
50696
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50950
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50697
50951
  }
50698
50952
  });
50699
50953
  }, [setDestinationAssetAmount, setSourceAsset, setSourceAssetAmount, switchEvmchainId]);
@@ -50708,7 +50962,7 @@ const SwapPage = () => {
50708
50962
  ...asset
50709
50963
  }));
50710
50964
  switchEvmchainId(asset == null ? void 0 : asset.chainId);
50711
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50965
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50712
50966
  },
50713
50967
  selectedAsset: getClientAsset(sourceAsset == null ? void 0 : sourceAsset.denom, sourceAsset == null ? void 0 : sourceAsset.chainId),
50714
50968
  selectChain: true
@@ -50724,7 +50978,7 @@ const SwapPage = () => {
50724
50978
  ...old,
50725
50979
  ...asset
50726
50980
  }));
50727
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50981
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50728
50982
  }
50729
50983
  });
50730
50984
  }, [setDestinationAsset]);
@@ -50738,7 +50992,7 @@ const SwapPage = () => {
50738
50992
  ...old,
50739
50993
  ...asset
50740
50994
  }));
50741
- NiceModal.remove(Modals.AssetAndChainSelectorModal);
50995
+ NiceModal.hide(Modals.AssetAndChainSelectorModal);
50742
50996
  },
50743
50997
  selectedAsset: getClientAsset(destinationAsset == null ? void 0 : destinationAsset.denom, destinationAsset == null ? void 0 : destinationAsset.chainId),
50744
50998
  selectChain: true
@@ -50815,9 +51069,9 @@ const SwapPage = () => {
50815
51069
  });
50816
51070
  setUserId(sourceAccount == null ? void 0 : sourceAccount.address);
50817
51071
  if (showCosmosLedgerWarning) {
50818
- track("error page: cosmos ledger warning", { route: route2 });
51072
+ track("warning page: cosmos ledger", { route: route2 });
50819
51073
  setError({
50820
- errorType: ErrorType.CosmosLedgerWarning,
51074
+ errorWarningType: ErrorWarningType.CosmosLedgerWarning,
50821
51075
  onClickBack: () => {
50822
51076
  setError(void 0);
50823
51077
  }
@@ -50825,9 +51079,9 @@ const SwapPage = () => {
50825
51079
  return;
50826
51080
  }
50827
51081
  if (((_a3 = route2 == null ? void 0 : route2.warning) == null ? void 0 : _a3.type) === "BAD_PRICE_WARNING") {
50828
- track("error page: bad price warning", { route: route2 });
51082
+ track("warning page: bad price", { route: route2 });
50829
51083
  setError({
50830
- errorType: ErrorType.BadPriceWarning,
51084
+ errorWarningType: ErrorWarningType.BadPriceWarning,
50831
51085
  onClickContinue: () => {
50832
51086
  setError(void 0);
50833
51087
  setChainAddresses({});
@@ -50842,9 +51096,9 @@ const SwapPage = () => {
50842
51096
  return;
50843
51097
  }
50844
51098
  if (((_b = route2 == null ? void 0 : route2.warning) == null ? void 0 : _b.type) === "LOW_INFO_WARNING") {
50845
- track("error page: low info warning", { route: route2 });
51099
+ track("warning page: low info", { route: route2 });
50846
51100
  setError({
50847
- errorType: ErrorType.LowInfoWarning,
51101
+ errorWarningType: ErrorWarningType.LowInfoWarning,
50848
51102
  onClickContinue: () => {
50849
51103
  setError(void 0);
50850
51104
  setChainAddresses({});
@@ -50859,9 +51113,9 @@ const SwapPage = () => {
50859
51113
  return;
50860
51114
  }
50861
51115
  if (showGoFastWarning && isGoFast) {
50862
- track("error page: go fast warning", { route: route2 });
51116
+ track("warning page: go fast", { route: route2 });
50863
51117
  setError({
50864
- errorType: ErrorType.GoFastWarning,
51118
+ errorWarningType: ErrorWarningType.GoFastWarning,
50865
51119
  onClickContinue: () => {
50866
51120
  setError(void 0);
50867
51121
  setChainAddresses({});
@@ -50879,6 +51133,7 @@ const SwapPage = () => {
50879
51133
  setCurrentPage(Routes.SwapExecutionPage);
50880
51134
  setUser({ username: sourceAccount == null ? void 0 : sourceAccount.address });
50881
51135
  if (sourceAccount == null ? void 0 : sourceAccount.address) {
51136
+ startAmplitudeSessionReplay();
50882
51137
  const replay = getReplay();
50883
51138
  replay == null ? void 0 : replay.start();
50884
51139
  }
@@ -51820,144 +52075,142 @@ const FilledWarningIcon = ({
51820
52075
  }
51821
52076
  )
51822
52077
  ] });
51823
- const TransactionHistoryPageHistoryItem = ({
51824
- index,
51825
- txHistoryItem,
51826
- showDetails,
51827
- onClickRow
51828
- }) => {
51829
- var _a, _b, _c;
51830
- const theme = nt();
51831
- const isMobileScreenSize = useIsMobileScreenSize();
51832
- const { data: chains2 } = useAtomValue(skipChainsAtom);
51833
- const {
51834
- status: historyStatus,
51835
- explorerLinks: txHistoryExplorerLinks,
51836
- transferAssetRelease
51837
- } = useTxHistory({
51838
- txHistoryItem,
51839
- index
51840
- });
51841
- const removeTransactionHistoryItem = useSetAtom(removeTransactionHistoryItemAtom);
51842
- const {
51843
- route: {
51844
- amountIn,
51845
- amountOut,
51846
- sourceAssetDenom,
51847
- sourceAssetChainId,
51848
- destAssetDenom,
51849
- destAssetChainId
51850
- },
51851
- timestamp,
51852
- transactionDetails
51853
- } = txHistoryItem;
51854
- const initialTxHash = (_a = transactionDetails == null ? void 0 : transactionDetails[0]) == null ? void 0 : _a.txHash;
51855
- const chainId = (_b = transactionDetails == null ? void 0 : transactionDetails[0]) == null ? void 0 : _b.chainId;
51856
- const chainType = (_c = chains2 == null ? void 0 : chains2.find((chain) => chain.chainId === chainId)) == null ? void 0 : _c.chainType;
51857
- const derivedExplorerLink = createExplorerLink({
51858
- txHash: initialTxHash,
51859
- chainId,
51860
- chainType
51861
- });
51862
- const explorerLinks = useMemo(() => {
51863
- if (txHistoryExplorerLinks.length === 0 && derivedExplorerLink) {
51864
- return [derivedExplorerLink];
51865
- }
51866
- return txHistoryExplorerLinks;
51867
- }, [derivedExplorerLink, txHistoryExplorerLinks]);
51868
- const sourceAssetDetails = useGetAssetDetails({
51869
- assetDenom: sourceAssetDenom,
51870
- chainId: sourceAssetChainId,
51871
- tokenAmount: amountIn
51872
- });
51873
- const destinationAssetDetails = useGetAssetDetails({
51874
- assetDenom: destAssetDenom,
51875
- chainId: destAssetChainId,
51876
- tokenAmount: amountOut
51877
- });
51878
- const source = {
51879
- amount: sourceAssetDetails.amount,
51880
- asset: sourceAssetDetails.asset,
51881
- assetImage: sourceAssetDetails.assetImage ?? "",
51882
- chainName: sourceAssetDetails.chainName
51883
- };
51884
- const destination = {
51885
- amount: destinationAssetDetails.amount,
51886
- asset: destinationAssetDetails.asset,
51887
- assetImage: destinationAssetDetails.assetImage ?? "",
51888
- chainName: destinationAssetDetails.chainName
51889
- };
51890
- const renderStatus = useMemo(() => {
51891
- switch (historyStatus) {
51892
- case "unconfirmed":
51893
- case "pending":
51894
- return /* @__PURE__ */ jsx(
51895
- StyledAnimatedBorder,
51896
- {
51897
- width: 10,
51898
- height: 10,
51899
- backgroundColor: theme.primary.text.normal,
51900
- status: "pending"
51901
- }
51902
- );
51903
- case "completed":
51904
- return /* @__PURE__ */ jsx(StyledGreenDot, {});
51905
- case "incomplete":
51906
- case "failed": {
51907
- if (transferAssetRelease) {
51908
- return /* @__PURE__ */ jsx(FilledWarningIcon, { backgroundColor: theme.warning.text });
51909
- } else return /* @__PURE__ */ jsx(XIcon, { color: theme.error.text });
51910
- }
51911
- }
51912
- }, [
51913
- historyStatus,
51914
- theme.primary.text.normal,
51915
- theme.error.text,
51916
- theme.warning.text,
51917
- transferAssetRelease
51918
- ]);
51919
- const absoluteTimeString = useMemo(() => {
51920
- if (isMobileScreenSize) {
51921
- return getMobileDateFormat(new Date(timestamp));
51922
- }
51923
- return new Date(timestamp).toLocaleString();
51924
- }, [isMobileScreenSize, timestamp]);
51925
- const relativeTime = useMemo(() => {
51926
- if (historyStatus === "pending") {
51927
- return "In Progress";
51928
- }
51929
- if (!timestamp) return "";
51930
- return formatDistanceStrict(new Date(timestamp), /* @__PURE__ */ new Date(), {
51931
- addSuffix: true
51932
- }).replace("minutes", "mins").replace("minute", "min").replace("hours", "hrs").replace("hour", "hr").replace("seconds", "secs").replace("second", "sec").replace("months", "mos").replace("month", "mo").replace("years", "yrs").replace("year", "yr");
51933
- }, [timestamp, historyStatus]);
51934
- if (!txHistoryItem.route) return null;
51935
- return /* @__PURE__ */ jsxs(StyledHistoryContainer, { showDetails, children: [
51936
- /* @__PURE__ */ jsxs(StyledHistoryItemRow, { align: "center", justify: "space-between", onClick: onClickRow, children: [
51937
- /* @__PURE__ */ jsxs(Row, { gap: 8, align: "center", children: [
51938
- /* @__PURE__ */ jsx(RenderAssetAmount, { ...source, sourceAsset: true }),
51939
- /* @__PURE__ */ jsx(ThinArrowIcon, { color: theme.primary.text.lowContrast, direction: "right" }),
51940
- /* @__PURE__ */ jsx(RenderAssetAmount, { ...destination })
52078
+ const TransactionHistoryPageHistoryItem = forwardRef(
52079
+ ({ index, txHistoryItem, showDetails, onClickRow }, ref) => {
52080
+ var _a, _b, _c;
52081
+ const theme = nt();
52082
+ const isMobileScreenSize = useIsMobileScreenSize();
52083
+ const { data: chains2 } = useAtomValue(skipChainsAtom);
52084
+ const {
52085
+ status: historyStatus,
52086
+ explorerLinks: txHistoryExplorerLinks,
52087
+ transferAssetRelease
52088
+ } = useTxHistory({
52089
+ txHistoryItem,
52090
+ index
52091
+ });
52092
+ const removeTransactionHistoryItem = useSetAtom(removeTransactionHistoryItemAtom);
52093
+ const {
52094
+ route: {
52095
+ amountIn,
52096
+ amountOut,
52097
+ sourceAssetDenom,
52098
+ sourceAssetChainId,
52099
+ destAssetDenom,
52100
+ destAssetChainId
52101
+ },
52102
+ timestamp,
52103
+ transactionDetails
52104
+ } = txHistoryItem;
52105
+ const initialTxHash = (_a = transactionDetails == null ? void 0 : transactionDetails[0]) == null ? void 0 : _a.txHash;
52106
+ const chainId = (_b = transactionDetails == null ? void 0 : transactionDetails[0]) == null ? void 0 : _b.chainId;
52107
+ const chainType = (_c = chains2 == null ? void 0 : chains2.find((chain) => chain.chainId === chainId)) == null ? void 0 : _c.chainType;
52108
+ const derivedExplorerLink = createExplorerLink({
52109
+ txHash: initialTxHash,
52110
+ chainId,
52111
+ chainType
52112
+ });
52113
+ const explorerLinks = useMemo(() => {
52114
+ if (txHistoryExplorerLinks.length === 0 && derivedExplorerLink) {
52115
+ return [derivedExplorerLink];
52116
+ }
52117
+ return txHistoryExplorerLinks;
52118
+ }, [derivedExplorerLink, txHistoryExplorerLinks]);
52119
+ const sourceAssetDetails = useGetAssetDetails({
52120
+ assetDenom: sourceAssetDenom,
52121
+ chainId: sourceAssetChainId,
52122
+ tokenAmount: amountIn
52123
+ });
52124
+ const destinationAssetDetails = useGetAssetDetails({
52125
+ assetDenom: destAssetDenom,
52126
+ chainId: destAssetChainId,
52127
+ tokenAmount: amountOut
52128
+ });
52129
+ const source = {
52130
+ amount: sourceAssetDetails.amount,
52131
+ asset: sourceAssetDetails.asset,
52132
+ assetImage: sourceAssetDetails.assetImage ?? "",
52133
+ chainName: sourceAssetDetails.chainName
52134
+ };
52135
+ const destination = {
52136
+ amount: destinationAssetDetails.amount,
52137
+ asset: destinationAssetDetails.asset,
52138
+ assetImage: destinationAssetDetails.assetImage ?? "",
52139
+ chainName: destinationAssetDetails.chainName
52140
+ };
52141
+ const renderStatus = useMemo(() => {
52142
+ switch (historyStatus) {
52143
+ case "unconfirmed":
52144
+ case "pending":
52145
+ return /* @__PURE__ */ jsx(
52146
+ StyledAnimatedBorder,
52147
+ {
52148
+ width: 10,
52149
+ height: 10,
52150
+ backgroundColor: theme.primary.text.normal,
52151
+ status: "pending"
52152
+ }
52153
+ );
52154
+ case "completed":
52155
+ return /* @__PURE__ */ jsx(StyledGreenDot, {});
52156
+ case "incomplete":
52157
+ case "failed": {
52158
+ if (transferAssetRelease) {
52159
+ return /* @__PURE__ */ jsx(FilledWarningIcon, { backgroundColor: theme.warning.text });
52160
+ } else return /* @__PURE__ */ jsx(XIcon, { color: theme.error.text });
52161
+ }
52162
+ }
52163
+ }, [
52164
+ historyStatus,
52165
+ theme.primary.text.normal,
52166
+ theme.error.text,
52167
+ theme.warning.text,
52168
+ transferAssetRelease
52169
+ ]);
52170
+ const absoluteTimeString = useMemo(() => {
52171
+ if (isMobileScreenSize) {
52172
+ return getMobileDateFormat(new Date(timestamp));
52173
+ }
52174
+ return new Date(timestamp).toLocaleString();
52175
+ }, [isMobileScreenSize, timestamp]);
52176
+ const relativeTime = useMemo(() => {
52177
+ if (historyStatus === "pending") {
52178
+ return "In Progress";
52179
+ }
52180
+ if (!timestamp) return "";
52181
+ return formatDistanceStrict(new Date(timestamp), /* @__PURE__ */ new Date(), {
52182
+ addSuffix: true
52183
+ }).replace("minutes", "mins").replace("minute", "min").replace("hours", "hrs").replace("hour", "hr").replace("seconds", "secs").replace("second", "sec").replace("months", "mos").replace("month", "mo").replace("years", "yrs").replace("year", "yr");
52184
+ }, [timestamp, historyStatus]);
52185
+ if (!txHistoryItem.route) return null;
52186
+ return /* @__PURE__ */ jsxs(StyledHistoryContainer, { ref, showDetails, children: [
52187
+ /* @__PURE__ */ jsxs(StyledHistoryItemRow, { align: "center", justify: "space-between", onClick: onClickRow, children: [
52188
+ /* @__PURE__ */ jsxs(Row, { gap: 8, align: "center", children: [
52189
+ /* @__PURE__ */ jsx(RenderAssetAmount, { ...source, sourceAsset: true }),
52190
+ /* @__PURE__ */ jsx(ThinArrowIcon, { color: theme.primary.text.lowContrast, direction: "right" }),
52191
+ /* @__PURE__ */ jsx(RenderAssetAmount, { ...destination })
52192
+ ] }),
52193
+ /* @__PURE__ */ jsxs(Row, { align: "center", gap: 6, children: [
52194
+ /* @__PURE__ */ jsx(SmallText, { children: relativeTime }),
52195
+ /* @__PURE__ */ jsx(Row, { width: 20, align: "center", justify: "center", children: renderStatus })
52196
+ ] })
51941
52197
  ] }),
51942
- /* @__PURE__ */ jsxs(Row, { align: "center", gap: 6, children: [
51943
- /* @__PURE__ */ jsx(SmallText, { children: relativeTime }),
51944
- /* @__PURE__ */ jsx(Row, { width: 20, align: "center", justify: "center", children: renderStatus })
51945
- ] })
51946
- ] }),
51947
- showDetails && /* @__PURE__ */ jsx(
51948
- TransactionHistoryPageHistoryItemDetails,
51949
- {
51950
- status: historyStatus,
51951
- sourceChainName: sourceAssetDetails.chainName ?? "--",
51952
- destinationChainName: destinationAssetDetails.chainName ?? "--",
51953
- absoluteTimeString,
51954
- onClickDelete: () => removeTransactionHistoryItem(index),
51955
- explorerLinks,
51956
- transferAssetRelease
51957
- }
51958
- )
51959
- ] });
51960
- };
52198
+ showDetails && /* @__PURE__ */ jsx(
52199
+ TransactionHistoryPageHistoryItemDetails,
52200
+ {
52201
+ status: historyStatus,
52202
+ sourceChainName: sourceAssetDetails.chainName ?? "--",
52203
+ destinationChainName: destinationAssetDetails.chainName ?? "--",
52204
+ absoluteTimeString,
52205
+ onClickDelete: () => removeTransactionHistoryItem(index),
52206
+ explorerLinks,
52207
+ transferAssetRelease
52208
+ }
52209
+ )
52210
+ ] });
52211
+ }
52212
+ );
52213
+ TransactionHistoryPageHistoryItem.displayName = "TransactionHistoryPageHistoryItem";
51961
52214
  const RenderAssetAmount = ({
51962
52215
  amount,
51963
52216
  asset,
@@ -51966,13 +52219,6 @@ const RenderAssetAmount = ({
51966
52219
  sourceAsset = false
51967
52220
  }) => {
51968
52221
  const isMobileScreenSize = useIsMobileScreenSize();
51969
- const formattedAmount = useMemo(() => {
51970
- const numberAfterLimitTwoDecimalPlaces = limitDecimalsDisplayed(amount, 2);
51971
- if (numberAfterLimitTwoDecimalPlaces === "0.00") {
51972
- return "< 0.01";
51973
- }
51974
- return numberAfterLimitTwoDecimalPlaces;
51975
- }, [amount]);
51976
52222
  const subtitle = useMemo(() => {
51977
52223
  if (!asset) return;
51978
52224
  const verboseString = `${asset == null ? void 0 : asset.recommendedSymbol} on ${chainName ?? (asset == null ? void 0 : asset.chainName)}`;
@@ -51981,10 +52227,12 @@ const RenderAssetAmount = ({
51981
52227
  }
51982
52228
  return verboseString;
51983
52229
  }, [asset, chainName, isMobileScreenSize, sourceAsset]);
51984
- return /* @__PURE__ */ jsxs(Row, { gap: 8, children: [
51985
- /* @__PURE__ */ jsx("img", { height: 35, width: 35, src: assetImage, alt: subtitle }),
52230
+ return /* @__PURE__ */ jsxs(Row, { gap: 8, align: "center", children: [
52231
+ /* @__PURE__ */ jsx("img", { height: 30, width: 30, src: assetImage, alt: subtitle }),
51986
52232
  /* @__PURE__ */ jsxs(Column, { style: sourceAsset ? { width: 50 } : void 0, children: [
51987
- /* @__PURE__ */ jsx(Tooltip, { content: amount, style: { width: "min-content" }, children: /* @__PURE__ */ jsx(Text, { normalTextColor: true, style: { width: "max-content" }, children: formattedAmount }) }),
52233
+ /* @__PURE__ */ jsx(Tooltip, { content: amount, style: { width: "min-content" }, children: /* @__PURE__ */ jsx(Text, { normalTextColor: true, style: { width: "max-content" }, children: formatDisplayAmount(amount, {
52234
+ decimals: 2
52235
+ }) }) }),
51988
52236
  /* @__PURE__ */ jsx(SmallText, { title: asset == null ? void 0 : asset.chainName, textWrap: "nowrap", overflowEllipsis: true, children: subtitle })
51989
52237
  ] })
51990
52238
  ] });
@@ -52013,7 +52261,7 @@ const StyledGreenDot = dt.div`
52013
52261
  border-radius: 50%;
52014
52262
  `;
52015
52263
  const TransactionHistoryPage = () => {
52016
- var _a;
52264
+ var _a, _b, _c, _d;
52017
52265
  const theme = nt();
52018
52266
  const setCurrentPage = useSetAtom(currentPageAtom);
52019
52267
  const [itemIndexToShowDetail, setItemIndexToShowDetail] = useState(void 0);
@@ -52045,10 +52293,11 @@ const TransactionHistoryPage = () => {
52045
52293
  details: "No transactions yet",
52046
52294
  icon: /* @__PURE__ */ jsx(HistoryIcon, { width: 30, height: 30, color: (_a = theme == null ? void 0 : theme.primary) == null ? void 0 : _a.text.lowContrast })
52047
52295
  },
52048
- itemHeight: 1,
52049
- renderItem: (item, index) => /* @__PURE__ */ jsx(
52296
+ itemHeight: 55,
52297
+ renderItem: (item, index, refSetter) => /* @__PURE__ */ jsx(
52050
52298
  TransactionHistoryPageHistoryItem,
52051
52299
  {
52300
+ ref: refSetter,
52052
52301
  index,
52053
52302
  txHistoryItem: item,
52054
52303
  showDetails: index === itemIndexToShowDetail,
@@ -52061,9 +52310,10 @@ const TransactionHistoryPage = () => {
52061
52310
  }
52062
52311
  ),
52063
52312
  itemKey: (item) => {
52064
- var _a2;
52065
- return (_a2 = item.transactionDetails) == null ? void 0 : _a2[0].txHash;
52066
- }
52313
+ var _a2, _b2;
52314
+ return (_b2 = (_a2 = item == null ? void 0 : item.transactionDetails) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.txHash;
52315
+ },
52316
+ expandedItemKey: itemIndexToShowDetail ? (_d = (_c = (_b = historyList[itemIndexToShowDetail]) == null ? void 0 : _b.transactionDetails) == null ? void 0 : _c[0]) == null ? void 0 : _d.txHash : void 0
52067
52317
  },
52068
52318
  txHistory.length
52069
52319
  ) }),
@@ -52157,9 +52407,9 @@ const useKeepWalletStateSynced = () => {
52157
52407
  const Router = () => {
52158
52408
  useKeepWalletStateSynced();
52159
52409
  const [currentPage] = useAtom(currentPageAtom);
52160
- const [error, setError] = useAtom(errorAtom);
52161
- if (error) {
52162
- return /* @__PURE__ */ jsx(ErrorPage, {});
52410
+ const [errorWarning, setErrorWarning] = useAtom(errorWarningAtom);
52411
+ if (errorWarning) {
52412
+ return /* @__PURE__ */ jsx(ErrorWarningPage, {});
52163
52413
  }
52164
52414
  switch (currentPage) {
52165
52415
  case Routes.SwapPage:
@@ -52167,9 +52417,9 @@ const Router = () => {
52167
52417
  ErrorBoundary,
52168
52418
  {
52169
52419
  fallback: null,
52170
- onError: (error2) => {
52171
- track("error page: unexpected error from swap page", { error: error2 });
52172
- setError({ errorType: ErrorType.Unexpected, error: error2 });
52420
+ onError: (error) => {
52421
+ track("unexpected error page: unexpected error from swap page", { error });
52422
+ setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error });
52173
52423
  },
52174
52424
  children: /* @__PURE__ */ jsx(SwapPage, {})
52175
52425
  }
@@ -52179,9 +52429,9 @@ const Router = () => {
52179
52429
  ErrorBoundary,
52180
52430
  {
52181
52431
  fallback: null,
52182
- onError: (error2) => {
52183
- track("error page: unexpected error from execution page", { error: error2 });
52184
- setError({ errorType: ErrorType.Unexpected, error: error2 });
52432
+ onError: (error) => {
52433
+ track("unexpected error page: unexpected error from execution page", { error });
52434
+ setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error });
52185
52435
  },
52186
52436
  children: /* @__PURE__ */ jsx(SwapExecutionPage, {})
52187
52437
  }
@@ -52191,9 +52441,11 @@ const Router = () => {
52191
52441
  ErrorBoundary,
52192
52442
  {
52193
52443
  fallback: null,
52194
- onError: (error2) => {
52195
- track("error page: unexpected error from transaction history page", { error: error2 });
52196
- setError({ errorType: ErrorType.Unexpected, error: error2 });
52444
+ onError: (error) => {
52445
+ track("unexpected error page: unexpected error from transaction history page", {
52446
+ error
52447
+ });
52448
+ setErrorWarning({ errorWarningType: ErrorWarningType.Unexpected, error });
52197
52449
  },
52198
52450
  children: /* @__PURE__ */ jsx(TransactionHistoryPage, {})
52199
52451
  }
@@ -52213,7 +52465,7 @@ const useInitDefaultRoute = (defaultRoute) => {
52213
52465
  let isSentryInitialized = false;
52214
52466
  const initSentry = () => {
52215
52467
  if (isSentryInitialized) return;
52216
- init({
52468
+ init$1({
52217
52469
  dsn: "https://10ce608bdd1c68a13d3849d6b242333c@o4504768725909504.ingest.us.sentry.io/4508485201231872",
52218
52470
  tunnel: "https://go.skip.build/api/sentry",
52219
52471
  defaultIntegrations: false,
@@ -52238,164 +52490,6 @@ const initSentry = () => {
52238
52490
  });
52239
52491
  isSentryInitialized = true;
52240
52492
  };
52241
- const name = "@skip-go/widget";
52242
- const description = "Swap widget";
52243
- const version = "3.10.1";
52244
- const repository = {
52245
- url: "https://github.com/skip-mev/skip-go",
52246
- directory: "packages/widget"
52247
- };
52248
- const type = "module";
52249
- const scripts = {
52250
- dev: "vite --force --host",
52251
- "dev:storybook": "storybook dev -p 6006",
52252
- build: "npm run generate-chains && NODE_OPTIONS=--max-old-space-size=16384 vite build",
52253
- "watch:build": "vite build --watch",
52254
- lint: "NODE_OPTIONS=--max-old-space-size=32384 eslint . --fix",
52255
- preview: "vite preview",
52256
- "build:web-component": "NODE_OPTIONS=--max-old-space-size=32384 webpack --config webpack.config.js",
52257
- "publish:web-component": "npm run build:web-component && cd web-component && npm publish && cd ..",
52258
- prepack: "yarn run pre",
52259
- postpack: "yarn run post",
52260
- pre: "npm run build && node scripts/prepublish.cjs",
52261
- post: "git checkout -- package.json",
52262
- "generate-chains": "node scripts/generate-chains.cjs",
52263
- "update-registries": "yarn up @initia/initia-registry chain-registry",
52264
- test: "yarn playwright test"
52265
- };
52266
- const exports = {
52267
- ".": {
52268
- types: "./build/index.d.ts",
52269
- "import": "./build/index.js"
52270
- }
52271
- };
52272
- const types = "./build/index.d.ts";
52273
- const files = [
52274
- "build",
52275
- "README.md"
52276
- ];
52277
- const devDependencies = {
52278
- "@chromatic-com/storybook": "^1.6.1",
52279
- "@eslint/js": "^9.9.0",
52280
- "@initia/initia-registry": "^1.0.5",
52281
- "@keplr-wallet/types": "^0.12.125",
52282
- "@playwright/test": "^1.51.1",
52283
- "@storybook/addon-essentials": "^8.2.6",
52284
- "@storybook/addon-interactions": "^8.2.6",
52285
- "@storybook/addon-links": "^8.2.6",
52286
- "@storybook/addon-onboarding": "^8.2.6",
52287
- "@storybook/blocks": "^8.2.6",
52288
- "@storybook/react": "^8.2.6",
52289
- "@storybook/react-vite": "^8.2.6",
52290
- "@storybook/test": "^8.2.6",
52291
- "@testing-library/dom": "^10.4.0",
52292
- "@testing-library/react": "^16.2.0",
52293
- "@types/eslint__js": "^8.42.3",
52294
- "@types/pluralize": "^0.0.33",
52295
- "@types/react": "^19.0.10",
52296
- "@types/react-dom": "^19.0.4",
52297
- "@typescript-eslint/eslint-plugin": "^7.15.0",
52298
- "@typescript-eslint/parser": "^7.15.0",
52299
- "@vitejs/plugin-react": "^4.3.1",
52300
- buffer: "^6.0.3",
52301
- "chain-registry": "^1.69.212",
52302
- download: "^8.0.0",
52303
- eslint: "^9.9.0",
52304
- "eslint-config-prettier": "^9.1.0",
52305
- "eslint-plugin-prettier": "^5.2.1",
52306
- "eslint-plugin-react-hooks": "^4.6.2",
52307
- "fs-extra": "^11.3.0",
52308
- "node-polyfill-webpack-plugin": "^4.0.0",
52309
- "pino-pretty": "^13.0.0",
52310
- "postcss-loader": "^8.1.1",
52311
- prettier: "^3.4.2",
52312
- process: "^0.11.10",
52313
- "raw-loader": "^4.0.2",
52314
- react: ">=17.0.0",
52315
- "react-dom": ">=17.0.0",
52316
- starknet: "6.11.0",
52317
- storybook: "^8.2.6",
52318
- "ts-loader": "^9.5.1",
52319
- typescript: "^5.5.4",
52320
- "typescript-eslint": "^8.2.0",
52321
- "url-loader": "^4.1.1",
52322
- vite: "^5.3.4",
52323
- "vite-plugin-dts": "^4.0.0-beta.1",
52324
- "vite-plugin-node-polyfills": "^0.22.0",
52325
- webpack: "^5.94.0",
52326
- "webpack-cli": "^5.1.4"
52327
- };
52328
- const peerDependencies = {
52329
- "@tanstack/react-query": "^5.51.21",
52330
- react: ">=17.0.0",
52331
- "react-dom": ">=17.0.0",
52332
- viem: "^2.21.55",
52333
- wagmi: "^2.14.1"
52334
- };
52335
- const dependencies = {
52336
- "@amplitude/analytics-browser": "^2.11.12",
52337
- "@amplitude/plugin-session-replay-browser": "^1.16.5",
52338
- "@cosmjs/amino": "0.33.1",
52339
- "@cosmjs/cosmwasm-stargate": "0.33.1",
52340
- "@cosmjs/encoding": "0.33.1",
52341
- "@cosmjs/math": "0.33.1",
52342
- "@cosmjs/proto-signing": "0.33.1",
52343
- "@cosmjs/stargate": "0.33.1",
52344
- "@ebay/nice-modal-react": "^1.2.13",
52345
- "@eslint/compat": "^1.1.1",
52346
- "@leapwallet/cosmos-social-login-capsule-provider": "^0.0.44",
52347
- "@penumbra-zone/bech32m": "^13.0.0",
52348
- "@penumbra-zone/client": "^24.0.0",
52349
- "@penumbra-zone/protobuf": "^7.2.0",
52350
- "@penumbra-zone/transport-dom": "^7.5.0",
52351
- "@r2wc/react-to-web-component": "^2.0.3",
52352
- "@sentry/react": "^8.46.0",
52353
- "@skip-go/client": "workspace:^",
52354
- "@solana/spl-token": "^0.4.8",
52355
- "@solana/wallet-adapter-backpack": "^0.1.14",
52356
- "@solana/wallet-adapter-coinbase": "^0.1.19",
52357
- "@solana/wallet-adapter-ledger": "^0.9.25",
52358
- "@solana/wallet-adapter-phantom": "^0.9.24",
52359
- "@solana/wallet-adapter-solflare": "^0.6.28",
52360
- "@solana/wallet-adapter-trust": "^0.1.13",
52361
- "@solana/web3.js": "^1.95.8",
52362
- "@tanstack/query-core": "^5.51.21",
52363
- "@walletconnect/modal": "2.7.0",
52364
- "@walletconnect/sign-client": "2.17.2",
52365
- "@walletconnect/solana-adapter": "^0.0.6",
52366
- add: "^2.0.6",
52367
- bech32: "^2.0.0",
52368
- graz: "0.3.2",
52369
- jotai: "^2.10.1",
52370
- "jotai-effect": "^1.0.2",
52371
- "jotai-tanstack-query": "^0.8.6",
52372
- "lodash.debounce": "^4.0.8",
52373
- pluralize: "^8.0.0",
52374
- "rc-virtual-list": "^3.14.5",
52375
- "react-error-boundary": "^4.0.13",
52376
- "react-shadow-scope": "^1.0.5",
52377
- "styled-components": "^6.1.13",
52378
- yarn: "^1.22.22",
52379
- zod: "^3.23.8"
52380
- };
52381
- const publishConfig = {
52382
- access: "public"
52383
- };
52384
- const packageJson = {
52385
- name,
52386
- description,
52387
- version,
52388
- repository,
52389
- type,
52390
- scripts,
52391
- exports,
52392
- types,
52393
- files,
52394
- devDependencies,
52395
- peerDependencies,
52396
- dependencies,
52397
- publishConfig
52398
- };
52399
52493
  const useMobileRouteConfig = () => {
52400
52494
  const isMobile2 = useIsMobileScreenSize();
52401
52495
  const setRouteConfig = useSetAtom(routeConfigAtom);
@@ -52406,17 +52500,6 @@ const useMobileRouteConfig = () => {
52406
52500
  }));
52407
52501
  }, [isMobile2, setRouteConfig]);
52408
52502
  };
52409
- let isAmplitudeInitialized = false;
52410
- const initAmplitude = () => {
52411
- if (isAmplitudeInitialized) return;
52412
- const plugin = sessionReplayPlugin();
52413
- add(plugin);
52414
- init$1("14616a575f32087cf0403ab8f3ea3ce0", {
52415
- autocapture: true,
52416
- appVersion: version
52417
- });
52418
- isAmplitudeInitialized = true;
52419
- };
52420
52503
  const useInitWidget = (props) => {
52421
52504
  var _a, _b;
52422
52505
  if (props.enableSentrySessionReplays) {