@velora-dex/widget 0.4.9-dev.3 → 0.4.9

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.
Files changed (138) hide show
  1. package/dist/components/ui/accordion.js +1 -1
  2. package/dist/components/ui/accordion.js.map +1 -1
  3. package/dist/components/widget/AppHeader/AppHeader.d.ts.map +1 -1
  4. package/dist/components/widget/AppHeader/AppHeader.js +66 -93
  5. package/dist/components/widget/AppHeader/AppHeader.js.map +1 -1
  6. package/dist/components/widget/Details/DetailWithValueList.js +1 -1
  7. package/dist/components/widget/Details/DetailWithValueList.js.map +1 -1
  8. package/dist/components/widget/Drawer/state/useDrawerControls.d.ts +0 -1
  9. package/dist/components/widget/Drawer/state/useDrawerControls.d.ts.map +1 -1
  10. package/dist/components/widget/Drawer/state/useDrawerControls.js +2 -5
  11. package/dist/components/widget/Drawer/state/useDrawerControls.js.map +1 -1
  12. package/dist/components/widget/LimitOrderItem/LimitOrderListItem.d.ts.map +1 -1
  13. package/dist/components/widget/LimitOrderItem/LimitOrderListItem.js +3 -3
  14. package/dist/components/widget/LimitOrderItem/LimitOrderListItem.js.map +1 -1
  15. package/dist/components/widget/TradeParameters/TradeParameters.d.ts +1 -3
  16. package/dist/components/widget/TradeParameters/TradeParameters.d.ts.map +1 -1
  17. package/dist/components/widget/TradeParameters/TradeParameters.js +77 -131
  18. package/dist/components/widget/TradeParameters/TradeParameters.js.map +1 -1
  19. package/dist/components/widget/TradeParameters/hooks/useIsNotDefaultAnyParameter.d.ts.map +1 -1
  20. package/dist/components/widget/TradeParameters/hooks/useIsNotDefaultAnyParameter.js +7 -15
  21. package/dist/components/widget/TradeParameters/hooks/useIsNotDefaultAnyParameter.js.map +1 -1
  22. package/dist/components/widget/TradeParameters/state/resetParamsAtom.d.ts.map +1 -1
  23. package/dist/components/widget/TradeParameters/useTempTradeParameters.d.ts +0 -2
  24. package/dist/components/widget/TradeParameters/useTempTradeParameters.d.ts.map +1 -1
  25. package/dist/components/widget/TradeParameters/useTempTradeParameters.js +82 -108
  26. package/dist/components/widget/TradeParameters/useTempTradeParameters.js.map +1 -1
  27. package/dist/components/widget/Warning/Warning.d.ts +2 -4
  28. package/dist/components/widget/Warning/Warning.d.ts.map +1 -1
  29. package/dist/components/widget/Warning/Warning.js +31 -41
  30. package/dist/components/widget/Warning/Warning.js.map +1 -1
  31. package/dist/components/widget/YouGet/YouGet.d.ts.map +1 -1
  32. package/dist/components/widget/YouGet/YouGet.js +46 -56
  33. package/dist/components/widget/YouGet/YouGet.js.map +1 -1
  34. package/dist/configurator/components/AllowNoUsdPricesSwitcher.d.ts +3 -3
  35. package/dist/configurator/components/AllowNoUsdPricesSwitcher.d.ts.map +1 -1
  36. package/dist/core/Warnings.d.ts.map +1 -1
  37. package/dist/core/Warnings.js +12 -38
  38. package/dist/core/Warnings.js.map +1 -1
  39. package/dist/core/index.js +5 -5
  40. package/dist/core/index.js.map +1 -1
  41. package/dist/core/state/configActionsAtom.js +2 -2
  42. package/dist/core/state/configActionsAtom.js.map +1 -1
  43. package/dist/core/state/configAtom.d.ts +5 -5
  44. package/dist/core/state/configAtom.d.ts.map +1 -1
  45. package/dist/core/state/configAtom.js +1 -1
  46. package/dist/core/state/configAtom.js.map +1 -1
  47. package/dist/core/swapDetails/priceImpact.d.ts +0 -1
  48. package/dist/core/swapDetails/priceImpact.d.ts.map +1 -1
  49. package/dist/core/swapDetails/priceImpact.js +3 -4
  50. package/dist/core/swapDetails/priceImpact.js.map +1 -1
  51. package/dist/core/swapDetails/useIsPriceImpactUnavailable.d.ts +2 -0
  52. package/dist/core/swapDetails/useIsPriceImpactUnavailable.d.ts.map +1 -0
  53. package/dist/core/swapDetails/useIsPriceImpactUnavailable.js +40 -0
  54. package/dist/core/swapDetails/useIsPriceImpactUnavailable.js.map +1 -0
  55. package/dist/core/swapDetails/useSwapDetailsListProps.d.ts.map +1 -1
  56. package/dist/core/swapDetails/useSwapDetailsListProps.js +5 -7
  57. package/dist/core/swapDetails/useSwapDetailsListProps.js.map +1 -1
  58. package/dist/core/types.d.ts +2 -2
  59. package/dist/core/types.d.ts.map +1 -1
  60. package/dist/events/getters/settings.d.ts.map +1 -1
  61. package/dist/events/getters/settings.js +0 -3
  62. package/dist/events/getters/settings.js.map +1 -1
  63. package/dist/events/types/common.d.ts +0 -1
  64. package/dist/events/types/common.d.ts.map +1 -1
  65. package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.d.ts +0 -1
  66. package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.d.ts.map +1 -1
  67. package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.js +2 -4
  68. package/dist/hooks/swap/prices/delta/mutations/useCreateDeltaOrder.js.map +1 -1
  69. package/dist/hooks/swap/prices/delta/mutations/useCreatePreSignableDeltaOrder.d.ts.map +1 -1
  70. package/dist/hooks/swap/prices/delta/mutations/useCreatePreSignableDeltaOrder.js +2 -4
  71. package/dist/hooks/swap/prices/delta/mutations/useCreatePreSignableDeltaOrder.js.map +1 -1
  72. package/dist/hooks/swap/prices/delta/mutations/useDeltaOrderToPost.d.ts.map +1 -1
  73. package/dist/hooks/swap/prices/delta/mutations/useDeltaOrderToPost.js +2 -4
  74. package/dist/hooks/swap/prices/delta/mutations/useDeltaOrderToPost.js.map +1 -1
  75. package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.d.ts.map +1 -1
  76. package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.js +2 -4
  77. package/dist/hooks/swap/prices/delta/mutations/usePostDeltaOrder.js.map +1 -1
  78. package/dist/hooks/swap/prices/delta/mutations/utils.d.ts +1 -2
  79. package/dist/hooks/swap/prices/delta/mutations/utils.d.ts.map +1 -1
  80. package/dist/hooks/swap/prices/delta/mutations/utils.js +2 -4
  81. package/dist/hooks/swap/prices/delta/mutations/utils.js.map +1 -1
  82. package/dist/hooks/swap/prices/delta/orders/types.d.ts +1 -1
  83. package/dist/hooks/swap/prices/delta/orders/types.d.ts.map +1 -1
  84. package/dist/hooks/swap/prices/delta/orders/utils.d.ts +7 -0
  85. package/dist/hooks/swap/prices/delta/orders/utils.d.ts.map +1 -1
  86. package/dist/hooks/swap/prices/delta/orders/utils.js +10 -4
  87. package/dist/hooks/swap/prices/delta/orders/utils.js.map +1 -1
  88. package/dist/hooks/swap/prices/delta/queries/errors.d.ts +0 -2
  89. package/dist/hooks/swap/prices/delta/queries/errors.d.ts.map +1 -1
  90. package/dist/hooks/swap/prices/delta/queries/errors.js +1 -9
  91. package/dist/hooks/swap/prices/delta/queries/errors.js.map +1 -1
  92. package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.d.ts +0 -2
  93. package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.d.ts.map +1 -1
  94. package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.js +2 -4
  95. package/dist/hooks/swap/prices/delta/queries/useDeltaPriceQuery.js.map +1 -1
  96. package/dist/hooks/swap/prices/market/queries/useMarketPriceQuery.d.ts +0 -1
  97. package/dist/hooks/swap/prices/market/queries/useMarketPriceQuery.d.ts.map +1 -1
  98. package/dist/hooks/swap/prices/market/queries/useMarketPriceQuery.js +2 -3
  99. package/dist/hooks/swap/prices/market/queries/useMarketPriceQuery.js.map +1 -1
  100. package/dist/hooks/swap/prices/usePricesParams.d.ts +1 -1
  101. package/dist/hooks/swap/prices/usePricesParams.d.ts.map +1 -1
  102. package/dist/hooks/swap/prices/usePricesParams.js +28 -31
  103. package/dist/hooks/swap/prices/usePricesParams.js.map +1 -1
  104. package/dist/hooks/swap/prices/useSwapPrices.d.ts +0 -3
  105. package/dist/hooks/swap/prices/useSwapPrices.d.ts.map +1 -1
  106. package/dist/hooks/swap/prices/useSwapPrices.js +58 -67
  107. package/dist/hooks/swap/prices/useSwapPrices.js.map +1 -1
  108. package/dist/hooks/swap/tradeFlow/useDeltaFlow.d.ts.map +1 -1
  109. package/dist/hooks/swap/tradeFlow/useDeltaFlow.js +0 -1
  110. package/dist/hooks/swap/tradeFlow/useDeltaFlow.js.map +1 -1
  111. package/dist/hooks/swap/tradeFlow/useMarketFlow.d.ts.map +1 -1
  112. package/dist/hooks/swap/tradeFlow/useMarketFlow.js +0 -1
  113. package/dist/hooks/swap/tradeFlow/useMarketFlow.js.map +1 -1
  114. package/dist/hooks/tokens/balances/useMultichainTokenBalances.d.ts.map +1 -1
  115. package/dist/hooks/tokens/balances/useMultichainTokenBalances.js +1 -1
  116. package/dist/hooks/tokens/balances/useMultichainTokenBalances.js.map +1 -1
  117. package/dist/styles.css +3 -21
  118. package/package.json +2 -2
  119. package/dist/components/widget/TradeParameters/DegenModeConfirmation.d.ts +0 -6
  120. package/dist/components/widget/TradeParameters/DegenModeConfirmation.d.ts.map +0 -1
  121. package/dist/components/widget/TradeParameters/DegenModeConfirmation.js +0 -139
  122. package/dist/components/widget/TradeParameters/DegenModeConfirmation.js.map +0 -1
  123. package/dist/components/widget/TradeParameters/DegenModeParameter.d.ts +0 -8
  124. package/dist/components/widget/TradeParameters/DegenModeParameter.d.ts.map +0 -1
  125. package/dist/components/widget/TradeParameters/DegenModeParameter.js +0 -84
  126. package/dist/components/widget/TradeParameters/DegenModeParameter.js.map +0 -1
  127. package/dist/components/widget/TradeParameters/state/degenModeParamAtom.d.ts +0 -7
  128. package/dist/components/widget/TradeParameters/state/degenModeParamAtom.d.ts.map +0 -1
  129. package/dist/components/widget/TradeParameters/state/degenModeParamAtom.js +0 -16
  130. package/dist/components/widget/TradeParameters/state/degenModeParamAtom.js.map +0 -1
  131. package/dist/core/swapDetails/usePriceImpactWarning.d.ts +0 -8
  132. package/dist/core/swapDetails/usePriceImpactWarning.d.ts.map +0 -1
  133. package/dist/core/swapDetails/usePriceImpactWarning.js +0 -89
  134. package/dist/core/swapDetails/usePriceImpactWarning.js.map +0 -1
  135. package/dist/hooks/swap/prices/market/queries/errors.d.ts +0 -3
  136. package/dist/hooks/swap/prices/market/queries/errors.d.ts.map +0 -1
  137. package/dist/hooks/swap/prices/market/queries/errors.js +0 -11
  138. package/dist/hooks/swap/prices/market/queries/errors.js.map +0 -1
package/dist/styles.css CHANGED
@@ -1308,9 +1308,6 @@
1308
1308
  .velora-widget.velora-widget .border-secondary-radical-red-1 {
1309
1309
  border-color: var(--secondary-radical_red-1);
1310
1310
  }
1311
- .velora-widget.velora-widget .border-secondary-shamrock-green-2 {
1312
- border-color: var(--secondary-shamrock_green-2);
1313
- }
1314
1311
  .velora-widget.velora-widget .border-transparent {
1315
1312
  border-color: #0000;
1316
1313
  }
@@ -1475,9 +1472,6 @@
1475
1472
  .velora-widget.velora-widget .stroke-secondary-orange-peel-1 {
1476
1473
  stroke: var(--secondary-orange_peel-1);
1477
1474
  }
1478
- .velora-widget.velora-widget .stroke-secondary-shamrock-green-2 {
1479
- stroke: var(--secondary-shamrock_green-2);
1480
- }
1481
1475
  .velora-widget.velora-widget .p-0 {
1482
1476
  padding: calc(var(--spacing) * 0);
1483
1477
  }
@@ -1601,9 +1595,6 @@
1601
1595
  .velora-widget.velora-widget .pt-8 {
1602
1596
  padding-top: calc(var(--spacing) * 8);
1603
1597
  }
1604
- .velora-widget.velora-widget .pt-20 {
1605
- padding-top: calc(var(--spacing) * 20);
1606
- }
1607
1598
  .velora-widget.velora-widget .pt-\[2px\] {
1608
1599
  padding-top: 2px;
1609
1600
  }
@@ -2326,9 +2317,6 @@
2326
2317
  .velora-widget.velora-widget .focus-visible\:border-ring:focus-visible {
2327
2318
  border-color: var(--ring);
2328
2319
  }
2329
- .velora-widget.velora-widget .focus-visible\:border-secondary-shamrock-green-2:focus-visible {
2330
- border-color: var(--secondary-shamrock_green-2);
2331
- }
2332
2320
  .velora-widget.velora-widget .focus-visible\:ring-\[3px\]:focus-visible {
2333
2321
  --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
2334
2322
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -2658,9 +2646,6 @@
2658
2646
  .velora-widget.velora-widget .dark\:border-input:is(.velora-widget.dark *) {
2659
2647
  border-color: var(--input);
2660
2648
  }
2661
- .velora-widget.velora-widget .dark\:border-secondary-shamrock-green-2:is(.velora-widget.dark *) {
2662
- border-color: var(--secondary-shamrock_green-2);
2663
- }
2664
2649
  .velora-widget.velora-widget .dark\:border-transparent:is(.velora-widget.dark *) {
2665
2650
  border-color: #0000;
2666
2651
  }
@@ -2752,12 +2737,12 @@
2752
2737
  .velora-widget.velora-widget .dark\:text-contrast-9:is(.velora-widget.dark *) {
2753
2738
  color: var(--contrast-9);
2754
2739
  }
2740
+ .velora-widget.velora-widget .dark\:text-secondary-orange-peel-1:is(.velora-widget.dark *) {
2741
+ color: var(--secondary-orange_peel-1);
2742
+ }
2755
2743
  .velora-widget.velora-widget .dark\:text-secondary-radical-red-1:is(.velora-widget.dark *) {
2756
2744
  color: var(--secondary-radical_red-1);
2757
2745
  }
2758
- .velora-widget.velora-widget .dark\:text-secondary-radical-red-2:is(.velora-widget.dark *) {
2759
- color: var(--secondary-radical_red-2);
2760
- }
2761
2746
  .velora-widget.velora-widget .dark\:text-white:is(.velora-widget.dark *) {
2762
2747
  color: var(--color-white);
2763
2748
  }
@@ -2844,9 +2829,6 @@
2844
2829
  .velora-widget.velora-widget .dark\:focus-visible\:border-primary-azul-1:is(.velora-widget.dark *):focus-visible {
2845
2830
  border-color: var(--primary-azul-1);
2846
2831
  }
2847
- .velora-widget.velora-widget .dark\:focus-visible\:border-secondary-shamrock-green-2:is(.velora-widget.dark *):focus-visible {
2848
- border-color: var(--secondary-shamrock_green-2);
2849
- }
2850
2832
  .velora-widget.velora-widget .dark\:focus-visible\:ring-destructive\/40:is(.velora-widget.dark *):focus-visible {
2851
2833
  --tw-ring-color: var(--destructive);
2852
2834
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velora-dex/widget",
3
- "version": "0.4.9-dev.3",
3
+ "version": "0.4.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -76,7 +76,7 @@
76
76
  "@tanstack/react-pacer": "^0.14.0",
77
77
  "@tanstack/react-virtual": "^3.13.12",
78
78
  "@uniswap/token-lists": "1.0.0-beta.34",
79
- "@velora-dex/sdk": "9.3.5-dev.1",
79
+ "@velora-dex/sdk": "9.3.5",
80
80
  "@wagmi/core": "^2.18.1",
81
81
  "axios": "^1.11.0",
82
82
  "big.js": "^7.0.1",
@@ -1,6 +0,0 @@
1
- type DegenModeConfirmationProps = {
2
- onConfirm: () => void;
3
- };
4
- export declare const DegenModeConfirmation: ({ onConfirm, }: DegenModeConfirmationProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
6
- //# sourceMappingURL=DegenModeConfirmation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DegenModeConfirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/TradeParameters/DegenModeConfirmation.tsx"],"names":[],"mappings":"AASA,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAOF,eAAO,MAAM,qBAAqB,GAAI,gBAEnC,0BAA0B,4CAuE5B,CAAC"}
@@ -1,139 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { d as distExports } from '../../../_virtual/index.js';
3
- import { useState } from 'react';
4
- import { Input } from '../../ui/input.js';
5
- import { Button } from '../../ui/button.js';
6
- import { WarningWithTitle } from '../Warning/Warning.js';
7
- import { cn } from '../../../lib/utils/index.js';
8
- import { ReactComponent as ForwardRef } from '../../../assets/check.svg.js';
9
-
10
- const CONFIRMATION_WORD = "CONFIRM";
11
- const warningClassses = {
12
- root: "border-1 border-secondary-radical-red-1 rounded-xs bg-[rgba(255,43,82,0.05)] text-secondary-radical-red-1",
13
- title: "font-medium"
14
- };
15
- const DegenModeConfirmation = (t0) => {
16
- const $ = distExports.c(24);
17
- const {
18
- onConfirm
19
- } = t0;
20
- const [inputValue, setInputValue] = useState("");
21
- let t1;
22
- if ($[0] !== inputValue) {
23
- t1 = inputValue.toLowerCase();
24
- $[0] = inputValue;
25
- $[1] = t1;
26
- } else {
27
- t1 = $[1];
28
- }
29
- let t2;
30
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
31
- t2 = CONFIRMATION_WORD.toLowerCase();
32
- $[2] = t2;
33
- } else {
34
- t2 = $[2];
35
- }
36
- const isValid = t1 === t2;
37
- let t3;
38
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
39
- t3 = /* @__PURE__ */ jsx(WarningWithTitle, { title: "You are about to enable “Degen Mode”", message: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
40
- /* @__PURE__ */ jsx("div", { children: "Enabling Degen Mode allows future trades with high price impact or no USD price oracle." }),
41
- /* @__PURE__ */ jsx("div", { children: "Prices may be unreliable and execution can be unfavorable. This disables price safety checks until turned off. Proceed only if you accept the risks." })
42
- ] }), classes: warningClassses });
43
- $[3] = t3;
44
- } else {
45
- t3 = $[3];
46
- }
47
- let t4;
48
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
49
- t4 = /* @__PURE__ */ jsxs("p", { className: "text-sm text-contrast-4 dark:text-contrast-6 pb-2", children: [
50
- "Please write below “",
51
- /* @__PURE__ */ jsx("span", { className: "font-semibold text-secondary-radical-red-1", children: CONFIRMATION_WORD }),
52
- "” to proceed"
53
- ] });
54
- $[4] = t4;
55
- } else {
56
- t4 = $[4];
57
- }
58
- let t5;
59
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
60
- t5 = (e) => setInputValue(e.target.value);
61
- $[5] = t5;
62
- } else {
63
- t5 = $[5];
64
- }
65
- let t6;
66
- if ($[6] !== isValid) {
67
- t6 = cn("rounded-sm h-10 placeholder:text-contrast-6 dark:placeholder:text-contrast-5 placeholder:text-xs uppercase", {
68
- "border-secondary-shamrock-green-2 dark:border-secondary-shamrock-green-2 focus-visible:border-secondary-shamrock-green-2 dark:focus-visible:border-secondary-shamrock-green-2": isValid
69
- });
70
- $[6] = isValid;
71
- $[7] = t6;
72
- } else {
73
- t6 = $[7];
74
- }
75
- let t7;
76
- if ($[8] !== isValid) {
77
- t7 = isValid ? /* @__PURE__ */ jsx(ForwardRef, { className: "stroke-secondary-shamrock-green-2" }) : void 0;
78
- $[8] = isValid;
79
- $[9] = t7;
80
- } else {
81
- t7 = $[9];
82
- }
83
- let t8;
84
- if ($[10] !== isValid || $[11] !== onConfirm) {
85
- t8 = (e_0) => {
86
- if (e_0.key === "Enter" && isValid) {
87
- onConfirm();
88
- }
89
- };
90
- $[10] = isValid;
91
- $[11] = onConfirm;
92
- $[12] = t8;
93
- } else {
94
- t8 = $[12];
95
- }
96
- let t9;
97
- if ($[13] !== inputValue || $[14] !== t6 || $[15] !== t7 || $[16] !== t8) {
98
- t9 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 pb-8", children: [
99
- t3,
100
- /* @__PURE__ */ jsxs("div", { children: [
101
- t4,
102
- /* @__PURE__ */ jsx(Input, { value: inputValue, onChange: t5, placeholder: `Write “${CONFIRMATION_WORD}” here`, autoFocus: true, className: t6, endAdornment: t7, onKeyDown: t8 })
103
- ] })
104
- ] });
105
- $[13] = inputValue;
106
- $[14] = t6;
107
- $[15] = t7;
108
- $[16] = t8;
109
- $[17] = t9;
110
- } else {
111
- t9 = $[17];
112
- }
113
- const t10 = !isValid;
114
- let t11;
115
- if ($[18] !== onConfirm || $[19] !== t10) {
116
- t11 = /* @__PURE__ */ jsx(Button, { variant: "default", radius: "sm", className: "h-[40px] w-full mt-auto", onClick: onConfirm, disabled: t10, children: "Confirm" });
117
- $[18] = onConfirm;
118
- $[19] = t10;
119
- $[20] = t11;
120
- } else {
121
- t11 = $[20];
122
- }
123
- let t12;
124
- if ($[21] !== t11 || $[22] !== t9) {
125
- t12 = /* @__PURE__ */ jsxs("div", { className: "p-6 pt-0 text-contrast-4 dark:text-contrast-7 flex flex-col", children: [
126
- t9,
127
- t11
128
- ] });
129
- $[21] = t11;
130
- $[22] = t9;
131
- $[23] = t12;
132
- } else {
133
- t12 = $[23];
134
- }
135
- return t12;
136
- };
137
-
138
- export { DegenModeConfirmation };
139
- //# sourceMappingURL=DegenModeConfirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DegenModeConfirmation.js","sources":["../../../../src/components/widget/TradeParameters/DegenModeConfirmation.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { Button } from \"@/components/ui/button\";\nimport { WarningWithTitle } from \"../Warning/Warning\";\nimport { cn } from \"@/lib/utils\";\nimport { ReactComponent as CheckSVG } from \"@/assets/check.svg\";\n\nconst CONFIRMATION_WORD = \"CONFIRM\";\n\ntype DegenModeConfirmationProps = {\n onConfirm: () => void;\n};\n\nconst warningClassses = {\n root: \"border-1 border-secondary-radical-red-1 rounded-xs bg-[rgba(255,43,82,0.05)] text-secondary-radical-red-1\",\n title: \"font-medium\",\n} as const;\n\nexport const DegenModeConfirmation = ({\n onConfirm,\n}: DegenModeConfirmationProps) => {\n const [inputValue, setInputValue] = useState(\"\");\n\n const isValid = inputValue.toLowerCase() === CONFIRMATION_WORD.toLowerCase();\n\n return (\n <div className=\"p-6 pt-0 text-contrast-4 dark:text-contrast-7 flex flex-col\">\n <div className=\"flex flex-col gap-6 pb-8\">\n <WarningWithTitle\n title=\"You are about to enable “Degen Mode”\"\n message={\n <div className=\"flex flex-col gap-2\">\n <div>\n Enabling Degen Mode allows future trades with high price impact\n or no USD price oracle.\n </div>\n <div>\n Prices may be unreliable and execution can be unfavorable. This\n disables price safety checks until turned off. Proceed only if\n you accept the risks.\n </div>\n </div>\n }\n classes={warningClassses}\n />\n <div>\n <p className=\"text-sm text-contrast-4 dark:text-contrast-6 pb-2\">\n Please write below “\n <span className=\"font-semibold text-secondary-radical-red-1\">\n {CONFIRMATION_WORD}\n </span>\n ” to proceed\n </p>\n <Input\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n placeholder={`Write “${CONFIRMATION_WORD}” here`}\n autoFocus\n className={cn(\n \"rounded-sm h-10 placeholder:text-contrast-6 dark:placeholder:text-contrast-5 placeholder:text-xs uppercase\",\n {\n \"border-secondary-shamrock-green-2 dark:border-secondary-shamrock-green-2 focus-visible:border-secondary-shamrock-green-2 dark:focus-visible:border-secondary-shamrock-green-2\":\n isValid,\n }\n )}\n endAdornment={\n isValid ? (\n <CheckSVG className=\"stroke-secondary-shamrock-green-2\" />\n ) : undefined\n }\n onKeyDown={(e) => {\n // allow confirming by pressing Enter\n if (e.key === \"Enter\" && isValid) {\n onConfirm();\n }\n }}\n />\n </div>\n </div>\n\n <Button\n variant=\"default\"\n radius=\"sm\"\n className=\"h-[40px] w-full mt-auto\"\n onClick={onConfirm}\n disabled={!isValid}\n >\n Confirm\n </Button>\n </div>\n );\n};\n"],"names":["CONFIRMATION_WORD","warningClassses","root","title","DegenModeConfirmation","t0","$","_c","onConfirm","inputValue","setInputValue","useState","t1","toLowerCase","t2","Symbol","for","isValid","t3","t4","t5","e","target","value","t6","cn","t7","CheckSVG","undefined","t8","e_0","key","t9","t10","t11","t12"],"mappings":";;;;;;;;;AAOA,MAAMA,iBAAAA,GAAoB,SAAA;AAM1B,MAAMC,eAAAA,GAAkB;AAAA,EACtBC,IAAAA,EAAM,2GAAA;AAAA,EACNC,KAAAA,EAAO;AACT,CAAA;AAEO,MAAMC,wBAAwBC,CAAAA,EAAAA,KAAA;AAAA,EAAA,MAAAC,CAAAA,GAAAC,cAAA,EAAA,CAAA;AAAC,EAAA,MAAA;AAAA,IAAAC;AAAAA,GAAA,GAAAH,EAAAA;AAGpC,EAAA,MAAA,CAAAI,UAAAA,EAAAC,aAAA,CAAA,GAAoCC,SAAS,EAAE,CAAA;AAAE,EAAA,IAAAC,EAAAA;AAAA,EAAA,IAAAN,CAAAA,QAAAG,UAAAA,EAAA;AAEjCG,IAAAA,EAAAA,GAA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,GAAA7B,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OA/DN6B,GAAAA;AA+DM;;;;"}
@@ -1,8 +0,0 @@
1
- export type DegenModeParameterProps = {
2
- isNotDefault: boolean;
3
- setValue: (value: boolean) => void;
4
- value: boolean;
5
- onRequestEnable?: () => void;
6
- };
7
- export declare const DegenModeParameter: ({ isNotDefault, setValue, value, onRequestEnable, }: DegenModeParameterProps) => import("react/jsx-runtime").JSX.Element;
8
- //# sourceMappingURL=DegenModeParameter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DegenModeParameter.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/TradeParameters/DegenModeParameter.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,qDAKhC,uBAAuB,4CAgCzB,CAAC"}
@@ -1,84 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { d as distExports } from '../../../_virtual/index.js';
3
- import { Switch } from '../../ui/switch.js';
4
- import { EllipseIcon } from '../Icon/EllipseIcon.js';
5
- import { DetailWithTooltip } from '../Details/DetailWithTooltip.js';
6
-
7
- const DegenModeParameter = (t0) => {
8
- const $ = distExports.c(14);
9
- const {
10
- isNotDefault,
11
- setValue,
12
- value,
13
- onRequestEnable
14
- } = t0;
15
- let t1;
16
- if ($[0] !== onRequestEnable || $[1] !== setValue) {
17
- t1 = (checked) => {
18
- if (checked && onRequestEnable) {
19
- onRequestEnable();
20
- return;
21
- }
22
- setValue(checked);
23
- };
24
- $[0] = onRequestEnable;
25
- $[1] = setValue;
26
- $[2] = t1;
27
- } else {
28
- t1 = $[2];
29
- }
30
- const handleChange = t1;
31
- let t2;
32
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
33
- t2 = /* @__PURE__ */ jsx(DetailWithTooltip, { detail: "Degen Mode", tooltip: "Allows trading when price impact is high or no USD oracle price is available. Rates may be unreliable. Use at your own risk.", classes: {
34
- root: "text-sm"
35
- } });
36
- $[3] = t2;
37
- } else {
38
- t2 = $[3];
39
- }
40
- let t3;
41
- if ($[4] !== isNotDefault) {
42
- t3 = isNotDefault && /* @__PURE__ */ jsx(EllipseIcon, { className: "stroke-contrast-8 dark:stroke-contrast-2" });
43
- $[4] = isNotDefault;
44
- $[5] = t3;
45
- } else {
46
- t3 = $[5];
47
- }
48
- let t4;
49
- if ($[6] !== t3) {
50
- t4 = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
51
- t2,
52
- t3
53
- ] });
54
- $[6] = t3;
55
- $[7] = t4;
56
- } else {
57
- t4 = $[7];
58
- }
59
- let t5;
60
- if ($[8] !== handleChange || $[9] !== value) {
61
- t5 = /* @__PURE__ */ jsx(Switch, { checked: value, onCheckedChange: handleChange, className: "cursor-pointer" });
62
- $[8] = handleChange;
63
- $[9] = value;
64
- $[10] = t5;
65
- } else {
66
- t5 = $[10];
67
- }
68
- let t6;
69
- if ($[11] !== t4 || $[12] !== t5) {
70
- t6 = /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 py-4", children: [
71
- t4,
72
- t5
73
- ] });
74
- $[11] = t4;
75
- $[12] = t5;
76
- $[13] = t6;
77
- } else {
78
- t6 = $[13];
79
- }
80
- return t6;
81
- };
82
-
83
- export { DegenModeParameter };
84
- //# sourceMappingURL=DegenModeParameter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DegenModeParameter.js","sources":["../../../../src/components/widget/TradeParameters/DegenModeParameter.tsx"],"sourcesContent":["import { Switch } from \"@/components/ui/switch\";\nimport { EllipseIcon } from \"../Icon/EllipseIcon\";\nimport { DetailWithTooltip } from \"../Details/DetailWithTooltip\";\n\nexport type DegenModeParameterProps = {\n isNotDefault: boolean;\n setValue: (value: boolean) => void;\n value: boolean;\n onRequestEnable?: () => void;\n};\n\nexport const DegenModeParameter = ({\n isNotDefault,\n setValue,\n value,\n onRequestEnable,\n}: DegenModeParameterProps) => {\n const handleChange = (checked: boolean) => {\n if (checked && onRequestEnable) {\n // Intercept enable — show confirmation instead of toggling directly\n onRequestEnable();\n return;\n }\n // Disable works immediately without confirmation\n setValue(checked);\n };\n\n return (\n <div className=\"flex items-center justify-between gap-2 py-4\">\n <div className=\"flex items-center gap-2 text-sm\">\n <DetailWithTooltip\n detail=\"Degen Mode\"\n tooltip={\n \"Allows trading when price impact is high or no USD oracle price is available. Rates may be unreliable. Use at your own risk.\"\n }\n classes={{ root: \"text-sm\" }}\n />\n {isNotDefault && (\n <EllipseIcon className=\"stroke-contrast-8 dark:stroke-contrast-2\" />\n )}\n </div>\n <Switch\n checked={value}\n onCheckedChange={handleChange}\n className=\"cursor-pointer\"\n />\n </div>\n );\n};\n"],"names":["DegenModeParameter","t0","$","_c","isNotDefault","setValue","value","onRequestEnable","t1","checked","handleChange","t2","Symbol","for","root","t3","t4","t5","t6"],"mappings":";;;;;;AAWO,MAAMA,qBAAqBC,CAAAA,EAAAA,KAAA;AAAA,EAAA,MAAAC,CAAAA,GAAAC,cAAA,EAAA,CAAA;AAAC,EAAA,MAAA;AAAA,IAAAC,YAAAA;AAAAA,IAAAC,QAAAA;AAAAA,IAAAC,KAAAA;AAAAA,IAAAC;AAAAA,GAAA,GAAAN,EAAAA;AAKT,EAAA,IAAAO,EAAAA;AAAA,EAAA,IAAAN,EAAA,CAAA,CAAA,KAAAK,mBAAAL,CAAAA,QAAAG,QAAAA,EAAA;AACHG,IAAAA,EAAAA,GAAAC,CAAAA,OAAAA,KAAA;AACnB,MAAA,IAAIA,WAAAF,eAAAA,EAA0B;AAE5BA,QAAAA,eAAAA,EAAgB;AAAC,QAAA;AAAA,MAAA;AAInBF,MAAAA,QAAAA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CAAA;AAAMb,IAAAA,CAAAA,MAAAa,EAAAA;AAAAb,IAAAA,CAAAA,MAAAc,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAd,EAAA,CAAA,CAAA;AAAA,EAAA;AAAA,EAAA,IAAAe,EAAAA;AAAA,EAAA,IAAAf,EAAA,CAAA,CAAA,KAAAQ,gBAAAR,CAAAA,QAAAI,KAAAA,EAAA;AACNW,IAAAA,EAAAA,uBAAC,MAAA,EAAA,EACUX,OAAAA,SACQI,eAAAA,gBACP,WAAA,gBAAA,EAAgB,CAAA;AAC1BR,IAAAA,CAAAA,MAAAQ,YAAAA;AAAAR,IAAAA,CAAAA,MAAAI,KAAAA;AAAAJ,IAAAA,CAAAA,OAAAe,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAf,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,IAAAgB,EAAAA;AAAA,EAAA,IAAAhB,EAAA,EAAA,CAAA,KAAAc,MAAAd,CAAAA,SAAAe,EAAAA,EAAA;AAjBJC,IAAAA,EAAAA,mBAAA,IAAA,CAAA,KAAA,EAAA,EAAe,SAAA,EAAA,8CAAA,EACbF,QAAAA,EAAAA;AAAAA,MAAAA,EAAAA;AAAAA,MAYAC;AAAAA,KAAAA,EAKF,CAAA;AAAMf,IAAAA,CAAAA,OAAAc,EAAAA;AAAAd,IAAAA,CAAAA,OAAAe,EAAAA;AAAAf,IAAAA,CAAAA,OAAAgB,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAhB,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OAlBNgB,EAAAA;AAkBM;;;;"}
@@ -1,7 +0,0 @@
1
- export declare const defaultDegenMode = false;
2
- export declare const userDegenModeParamAtom: import('jotai').PrimitiveAtom<boolean> & {
3
- init: boolean;
4
- };
5
- export declare const degenModeParamAtom: import('jotai').Atom<boolean>;
6
- export declare const isNotDefaultDegenModeParamAtom: import('jotai').Atom<boolean>;
7
- //# sourceMappingURL=degenModeParamAtom.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"degenModeParamAtom.d.ts","sourceRoot":"","sources":["../../../../../src/components/widget/TradeParameters/state/degenModeParamAtom.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAGtC,eAAO,MAAM,sBAAsB;;CAAyB,CAAC;AAG7D,eAAO,MAAM,kBAAkB,+BAS7B,CAAC;AAEH,eAAO,MAAM,8BAA8B,+BAE1C,CAAC"}
@@ -1,16 +0,0 @@
1
- import { widgetConfigAtom } from '../../../../core/state/configAtom.js';
2
- import { atom } from 'jotai';
3
-
4
- const defaultDegenMode = false;
5
- const userDegenModeParamAtom = atom(defaultDegenMode);
6
- const degenModeParamAtom = atom((get) => {
7
- const enabledInConfig = get(widgetConfigAtom).enableDegenMode;
8
- if (!enabledInConfig) {
9
- return false;
10
- }
11
- return get(userDegenModeParamAtom);
12
- });
13
- const isNotDefaultDegenModeParamAtom = atom((get) => get(degenModeParamAtom) !== defaultDegenMode);
14
-
15
- export { defaultDegenMode, degenModeParamAtom, isNotDefaultDegenModeParamAtom, userDegenModeParamAtom };
16
- //# sourceMappingURL=degenModeParamAtom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"degenModeParamAtom.js","sources":["../../../../../src/components/widget/TradeParameters/state/degenModeParamAtom.ts"],"sourcesContent":["import { widgetConfigAtom } from \"@/core/state/configAtom\";\nimport { atom } from \"jotai\";\n\nexport const defaultDegenMode = false;\n\n// store the user's preference\nexport const userDegenModeParamAtom = atom(defaultDegenMode);\n\n// derive the effective degen mode\nexport const degenModeParamAtom = atom((get) => {\n const enabledInConfig = get(widgetConfigAtom).enableDegenMode;\n\n // If the widget config has degen mode disabled, always return false\n if (!enabledInConfig) {\n return false;\n }\n\n return get(userDegenModeParamAtom);\n});\n\nexport const isNotDefaultDegenModeParamAtom = atom(\n (get) => get(degenModeParamAtom) !== defaultDegenMode\n);\n"],"names":["defaultDegenMode","userDegenModeParamAtom","atom","degenModeParamAtom","get","enabledInConfig","widgetConfigAtom","enableDegenMode","isNotDefaultDegenModeParamAtom"],"mappings":";;;AAGO,MAAMA,gBAAAA,GAAmB;AAGzB,MAAMC,sBAAAA,GAAyBC,KAAKF,gBAAgB;AAGpD,MAAMG,kBAAAA,GAAqBD,KAAME,CAAAA,GAAAA,KAAQ;AAC9C,EAAA,MAAMC,eAAAA,GAAkBD,GAAAA,CAAIE,gBAAgB,CAAA,CAAEC,eAAAA;AAG9C,EAAA,IAAI,CAACF,eAAAA,EAAiB;AACpB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAOD,IAAIH,sBAAsB,CAAA;AACnC,CAAC;AAEM,MAAMO,iCAAiCN,IAAAA,CAC3CE,CAAAA,GAAAA,KAAQA,GAAAA,CAAID,kBAAkB,MAAMH,gBACvC;;;;"}
@@ -1,8 +0,0 @@
1
- export declare function usePriceImpactWarning(): {
2
- shouldShowWarning: boolean;
3
- isMaxImpactReachedError?: undefined;
4
- } | {
5
- shouldShowWarning: boolean;
6
- isMaxImpactReachedError: boolean;
7
- };
8
- //# sourceMappingURL=usePriceImpactWarning.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePriceImpactWarning.d.ts","sourceRoot":"","sources":["../../../src/core/swapDetails/usePriceImpactWarning.ts"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB;;;;;;EAuCpC"}
@@ -1,89 +0,0 @@
1
- import { d as distExports } from '../../_virtual/index.js';
2
- import { useCurrentSwapPrice } from '../../hooks/swap/prices/useSwapPrices.js';
3
- import { getPriceImpact } from '../../lib/utils/priceImpact.js';
4
- import { useSwapTokenTo } from '../inputs/state/selectedTokenAtom.js';
5
- import { isDeltaPrice } from '../../hooks/swap/prices/delta/queries/useDeltaPriceQuery.js';
6
- import { isMarketPriceImpactError, isMarketBadUsdPriceError } from '../../hooks/swap/prices/market/queries/errors.js';
7
- import { isDeltaMaxImpactReachedError, isDeltaNoUsdPriceError } from '../../hooks/swap/prices/delta/queries/errors.js';
8
- import { degenModeParamAtom } from '../../components/widget/TradeParameters/state/degenModeParamAtom.js';
9
- import { useAtomValue } from '../store.js';
10
-
11
- function usePriceImpactWarning() {
12
- const $ = distExports.c(12);
13
- const tokenTo = useSwapTokenTo();
14
- const degenMode = useAtomValue(degenModeParamAtom);
15
- let t0;
16
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
17
- t0 = {
18
- enabled: false
19
- };
20
- $[0] = t0;
21
- } else {
22
- t0 = $[0];
23
- }
24
- const {
25
- price,
26
- cachedError
27
- } = useCurrentSwapPrice(t0);
28
- if (degenMode) {
29
- let t12;
30
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
31
- t12 = {
32
- shouldShowWarning: false
33
- };
34
- $[1] = t12;
35
- } else {
36
- t12 = $[1];
37
- }
38
- return t12;
39
- }
40
- let t1;
41
- if ($[2] !== cachedError) {
42
- t1 = isMarketPriceImpactError(cachedError) || isDeltaMaxImpactReachedError(cachedError);
43
- $[2] = cachedError;
44
- $[3] = t1;
45
- } else {
46
- t1 = $[3];
47
- }
48
- const isMaxImpactReachedError = t1;
49
- let t2;
50
- if ($[4] !== cachedError) {
51
- t2 = isMarketBadUsdPriceError(cachedError) || isDeltaNoUsdPriceError(cachedError);
52
- $[4] = cachedError;
53
- $[5] = t2;
54
- } else {
55
- t2 = $[5];
56
- }
57
- const isNoUsdPriceError = t2;
58
- let t3;
59
- if ($[6] !== isNoUsdPriceError || $[7] !== price) {
60
- t3 = isNoUsdPriceError || !!price && getPriceImpact({
61
- srcUSD: price.srcUSD,
62
- destUSD: isDeltaPrice(price) ? price.receivedDestUSD : price.destUSD
63
- }).isUnavailable;
64
- $[6] = isNoUsdPriceError;
65
- $[7] = price;
66
- $[8] = t3;
67
- } else {
68
- t3 = $[8];
69
- }
70
- const isPriceImpactUnavailable = t3;
71
- const isError = isPriceImpactUnavailable || isMaxImpactReachedError;
72
- const shouldShowWarning = isError && !!tokenTo;
73
- let t4;
74
- if ($[9] !== isMaxImpactReachedError || $[10] !== shouldShowWarning) {
75
- t4 = {
76
- shouldShowWarning,
77
- isMaxImpactReachedError
78
- };
79
- $[9] = isMaxImpactReachedError;
80
- $[10] = shouldShowWarning;
81
- $[11] = t4;
82
- } else {
83
- t4 = $[11];
84
- }
85
- return t4;
86
- }
87
-
88
- export { usePriceImpactWarning };
89
- //# sourceMappingURL=usePriceImpactWarning.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePriceImpactWarning.js","sources":["../../../src/core/swapDetails/usePriceImpactWarning.ts"],"sourcesContent":["import { useCurrentSwapPrice } from \"@/hooks/swap/prices/useSwapPrices\";\nimport { getPriceImpact } from \"@/lib/utils/priceImpact\";\nimport { useSwapTokenTo } from \"../inputs/state/selectedTokenAtom\";\nimport { isDeltaPrice } from \"@/hooks/swap/prices/delta/queries/useDeltaPriceQuery\";\nimport {\n isMarketPriceImpactError,\n isMarketBadUsdPriceError,\n} from \"@/hooks/swap/prices/market/queries/errors\";\nimport {\n isDeltaMaxImpactReachedError,\n isDeltaNoUsdPriceError,\n} from \"@/hooks/swap/prices/delta/queries/errors\";\nimport { degenModeParamAtom } from \"@/components/widget/TradeParameters/state/degenModeParamAtom\";\nimport { useAtomValue } from \"../store\";\n\nexport function usePriceImpactWarning() {\n const tokenTo = useSwapTokenTo();\n const degenMode = useAtomValue(degenModeParamAtom);\n\n const { price, cachedError } = useCurrentSwapPrice({\n enabled: false,\n });\n\n if (degenMode) return { shouldShowWarning: false }; // user explicitly enabled degen mode\n\n // cachedError keeps the error until the query succeeds,\n // so if the prices errored for the current token pair,\n // the error is unlikely to disappear unless the user changes tokenFrom/tokenTo (main screen unmount -> ref resets to null -> error disappears)\n const isMaxImpactReachedError =\n isMarketPriceImpactError(cachedError) ||\n isDeltaMaxImpactReachedError(cachedError);\n const isNoUsdPriceError =\n isMarketBadUsdPriceError(cachedError) ||\n isDeltaNoUsdPriceError(cachedError);\n\n const isPriceImpactUnavailable =\n isNoUsdPriceError ||\n (!!price &&\n getPriceImpact({\n srcUSD: price.srcUSD,\n destUSD: isDeltaPrice(price) ? price.receivedDestUSD : price.destUSD,\n }).isUnavailable);\n\n const isError =\n isPriceImpactUnavailable || // unable to calculate price impact\n isMaxImpactReachedError; // price impact is above threshold\n\n // Default to false, only show when explicitly unavailable and not loading\n const shouldShowWarning = isError && !!tokenTo;\n\n return {\n shouldShowWarning,\n isMaxImpactReachedError,\n };\n}\n"],"names":["usePriceImpactWarning","$","_c","tokenTo","useSwapTokenTo","degenMode","useAtomValue","degenModeParamAtom","t0","Symbol","for","enabled","price","cachedError","useCurrentSwapPrice","t1","shouldShowWarning","isMarketPriceImpactError","isDeltaMaxImpactReachedError","isMaxImpactReachedError","t2","isMarketBadUsdPriceError","isDeltaNoUsdPriceError","isNoUsdPriceError","t3","getPriceImpact","srcUSD","destUSD","isDeltaPrice","receivedDestUSD","isUnavailable","isPriceImpactUnavailable","isError","t4"],"mappings":";;;;;;;;;;AAeO,SAAAA,qBAAAA,GAAA;AAAA,EAAA,MAAAC,CAAAA,GAAAC,cAAA,EAAA,CAAA;AACL,EAAA,MAAAC,UAAgBC,cAAAA,EAAe;AAC/B,EAAA,MAAAC,SAAAA,GAAkBC,aAAaC,kBAAkB,CAAA;AAAE,EAAA,IAAAC,EAAAA;AAAA,EAAA,IAAAP,EAAA,CAAA,CAAA,KAAAQ,MAAAA,CAAAC,GAAAA,CAAA,2BAAA,CAAA,EAAA;AAEAF,IAAAA,EAAAA,GAAA;AAAA,MAAAG,OAAAA,EACxC;AAAA,KACX;AAACV,IAAAA,CAAAA,MAAAO,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAP,EAAA,CAAA,CAAA;AAAA,EAAA;AAFD,EAAA,MAAA;AAAA,IAAAW,KAAAA;AAAAA,IAAAC;AAAAA,GAAA,GAA+BC,oBAAoBN,EAElD,CA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A,EAAA;AAGpCY,IAAAA,EAAAA,GAAAD,iBAAAA,IACC,CAAC,CAACX,KAAAA,IACDa,cAAAA,CAAe;AAAA,MAAAC,QACLd,KAAAA,CAAKc,MAAAA;AAAAA,MAAOC,SACXC,YAAAA,CAAahB,KAA6C,CAAA,GAApCA,KAAAA,CAAKiB,kBAAmBjB,KAAAA,CAAKe;AAAAA,KAC7D,CAAA,CAACG,aAAAA;AAAe7B,IAAAA,CAAAA,MAAAsB,iBAAAA;AAAAtB,IAAAA,CAAAA,MAAAW,KAAAA;AAAAX,IAAAA,CAAAA,MAAAuB,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAvB,EAAA,CAAA,CAAA;AAAA,EAAA;AANrB,EAAA,MAAA8B,wBAAAA,GACEP,EAAAA;AAOF,EAAA,MAAAQ,UACED,wBAAAA,IAAAZ,uBAAAA;AAIF,EAAA,MAAAH,iBAAAA,GAA0BgB,OAAAA,IAAA,CAAY,CAAC7B,OAAAA;AAAQ,EAAA,IAAA8B,EAAAA;AAAA,EAAA,IAAAhC,EAAA,CAAA,CAAA,KAAAkB,2BAAAlB,CAAAA,SAAAe,iBAAAA,EAAA;AAExCiB,IAAAA,EAAAA,GAAA;AAAA,MAAAjB,iBAAAA;AAAAA,MAAAG;AAAAA,KAGP;AAAClB,IAAAA,CAAAA,MAAAkB,uBAAAA;AAAAlB,IAAAA,CAAAA,OAAAe,iBAAAA;AAAAf,IAAAA,CAAAA,OAAAgC,EAAAA;AAAAA,EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAhC,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OAHMgC,EAAAA;AAGN;;;;"}
@@ -1,3 +0,0 @@
1
- export declare function isMarketPriceImpactError(error: unknown): boolean;
2
- export declare function isMarketBadUsdPriceError(error: unknown): boolean;
3
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../src/hooks/swap/prices/market/queries/errors.ts"],"names":[],"mappings":"AAKA,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGhE;AAKD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGhE"}
@@ -1,11 +0,0 @@
1
- function isMarketPriceImpactError(error) {
2
- if (!(error instanceof Error)) return false;
3
- return error.message === "ESTIMATED_LOSS_GREATER_THAN_MAX_IMPACT";
4
- }
5
- function isMarketBadUsdPriceError(error) {
6
- if (!(error instanceof Error)) return false;
7
- return error.message === "Bad USD price";
8
- }
9
-
10
- export { isMarketBadUsdPriceError, isMarketPriceImpactError };
11
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sources":["../../../../../../src/hooks/swap/prices/market/queries/errors.ts"],"sourcesContent":["// {\n// \"error\": \"ESTIMATED_LOSS_GREATER_THAN_MAX_IMPACT\",\n// \"value\": \"97.81%\",\n// \"priceRoute\": { ... }\n// }\nexport function isMarketPriceImpactError(error: unknown): boolean {\n if (!(error instanceof Error)) return false;\n return error.message === \"ESTIMATED_LOSS_GREATER_THAN_MAX_IMPACT\"; // e.error returned as e.message in SDK\n}\n\n// {\n// \"error\": \"Bad USD price\",\n// }\nexport function isMarketBadUsdPriceError(error: unknown): boolean {\n if (!(error instanceof Error)) return false;\n return error.message === \"Bad USD price\"; // e.error returned as e.message in SDK\n}\n"],"names":["isMarketPriceImpactError","error","Error","message","isMarketBadUsdPriceError"],"mappings":"AAKO,SAASA,yBAAyBC,KAAAA,EAAyB;AAChE,EAAA,IAAI,EAAEA,KAAAA,YAAiBC,KAAAA,CAAAA,EAAQ,OAAO,KAAA;AACtC,EAAA,OAAOD,MAAME,OAAAA,KAAY,wCAAA;AAC3B;AAKO,SAASC,yBAAyBH,KAAAA,EAAyB;AAChE,EAAA,IAAI,EAAEA,KAAAA,YAAiBC,KAAAA,CAAAA,EAAQ,OAAO,KAAA;AACtC,EAAA,OAAOD,MAAME,OAAAA,KAAY,eAAA;AAC3B;;;;"}