@stakekit/widget 0.0.273 → 0.0.275

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 (55) hide show
  1. package/dist/bundle/index.bundle.css +1 -1
  2. package/dist/bundle/index.bundle.js +54 -54
  3. package/dist/package/index.package.css +0 -7
  4. package/dist/package/index.package.js +1311 -1209
  5. package/dist/types/components/molecules/select-opportunity-list-item/index.d.ts +7 -5
  6. package/dist/types/domain/types/stake.d.ts +3 -3
  7. package/dist/types/domain/types/yields.d.ts +14 -17
  8. package/dist/types/hooks/api/use-dashboard-yield-catalog.d.ts +23 -0
  9. package/dist/types/hooks/api/use-multi-yields.d.ts +2 -1
  10. package/dist/types/hooks/api/use-token-list-yields.d.ts +10 -5
  11. package/dist/types/hooks/api/use-yield-opportunity/get-yield-opportunity.d.ts +5 -1
  12. package/dist/types/hooks/api/use-yield-providers.d.ts +13 -0
  13. package/dist/types/hooks/api/use-yield-summaries.d.ts +58 -0
  14. package/dist/types/pages/details/earn-page/components/select-token-section/select-token-list-item.d.ts +1 -3
  15. package/dist/types/pages/details/earn-page/components/select-token-section/styles.css.d.ts +0 -2
  16. package/dist/types/pages/details/earn-page/state/types.d.ts +7 -1
  17. package/dist/types/pages/details/earn-page/types.d.ts +3 -3
  18. package/dist/types/pages/position-details/hooks/use-unstake-machine.d.ts +7 -118
  19. package/dist/types/pages/review/hooks/use-stake-review.hook.d.ts +37 -1
  20. package/dist/types/providers/api/api-client-provider.d.ts +6 -22
  21. package/dist/types/providers/api/api-client.d.ts +6 -22
  22. package/dist/types/providers/ethereum/config.d.ts +4 -3
  23. package/dist/types/providers/settings/types.d.ts +1 -0
  24. package/dist/types/providers/wagmi/index.d.ts +1 -0
  25. package/dist/website/assets/{basic-ThspdnuL.js → basic-AvmmQyRT.js} +1 -1
  26. package/dist/website/assets/{basic-Bo7SBwII.js → basic-B4L21H7R.js} +1 -1
  27. package/dist/website/assets/{browser-DskDvf4V.js → browser-CD2gtnKg.js} +1 -1
  28. package/dist/website/assets/{build-BmJ27Vry.js → build-CEL1SZmV.js} +1 -1
  29. package/dist/website/assets/{build-DN0pJtdR.js → build-DWB27dsZ.js} +1 -1
  30. package/dist/website/assets/{cardano-connector-B2Ea9uXJ.js → cardano-connector-BNJvqm1_.js} +1 -1
  31. package/dist/website/assets/{core-BFFu4TZK.js → core-NRhVeH3P.js} +2 -2
  32. package/dist/website/assets/{dist-BC-yZnz1.js → dist-CH4nKZqs.js} +1 -1
  33. package/dist/website/assets/{dist-DwMZ-Epn.js → dist-DRLRXyTA.js} +1 -1
  34. package/dist/website/assets/en_US-IFPOGBSL-DcKUUZBp.js +1 -0
  35. package/dist/website/assets/{esm-Bvq2M2B2.js → esm-CX7v7VH6.js} +1 -1
  36. package/dist/website/assets/{exports-BEqJeoxC.js → exports-CZja-uIB.js} +1 -1
  37. package/dist/website/assets/{index-DTVV95ia.js → index-BEIkkHR9.js} +43 -43
  38. package/dist/website/assets/{index-E_6jknHw.css → index-BmH6Rgkr.css} +1 -1
  39. package/dist/website/assets/{index.es-qQnPYJtJ.js → index.es-C4PtkNtC.js} +2 -2
  40. package/dist/website/assets/{ledger-connector-C520fQQY.js → ledger-connector-CQI9gS0Q.js} +1 -1
  41. package/dist/website/assets/{receive-Dcx0aHWA.js → receive-D87X5CO9.js} +1 -1
  42. package/dist/website/assets/{registry-CvkKYDcW.js → registry-DFrHgvrU.js} +1 -1
  43. package/dist/website/assets/{safe-connector-CDGYW3b8.js → safe-connector-D5A7hhAW.js} +1 -1
  44. package/dist/website/assets/{socials-BDwTFvCa.js → socials-DlOk7Wls.js} +1 -1
  45. package/dist/website/assets/{solana-connector-BcHaSaSq.js → solana-connector-C1qGbaG8.js} +1 -1
  46. package/dist/website/assets/{substrate-connector-DxYe9s4o.js → substrate-connector-DfJfljNz.js} +1 -1
  47. package/dist/website/assets/{ton-connector-sD5IEuy2.js → ton-connector-DA1-w57X.js} +1 -1
  48. package/dist/website/assets/{tron-connector-DgBR_biA.js → tron-connector-BTe1GdWY.js} +3 -3
  49. package/dist/website/assets/tx-zX2fdmDi.js +1 -0
  50. package/dist/website/assets/{wallet-manager-4JkYZ_Wn.js → wallet-manager-pYzGZQVw.js} +3 -3
  51. package/dist/website/assets/{wui-qr-code-CadVdoQK.js → wui-qr-code-BgRoILGj.js} +1 -1
  52. package/dist/website/index.html +2 -2
  53. package/package.json +1 -1
  54. package/dist/website/assets/en_US-IFPOGBSL-DY8aJwVh.js +0 -1
  55. package/dist/website/assets/tx-Cjn1Xzt5.js +0 -1
@@ -18348,7 +18348,7 @@ var handleGeoBlockResponse = ({ data, status }) => {
18348
18348
  notify$2();
18349
18349
  };
18350
18350
  var useGeoBlock = () => {
18351
- return useSyncExternalStore(_temp$111, _temp2$69, _temp3$42);
18351
+ return useSyncExternalStore(_temp$111, _temp2$68, _temp3$41);
18352
18352
  };
18353
18353
  function _temp$111(onChange) {
18354
18354
  const unsub = subscribe$1(onChange);
@@ -18356,10 +18356,10 @@ function _temp$111(onChange) {
18356
18356
  unsub();
18357
18357
  };
18358
18358
  }
18359
- function _temp2$69() {
18359
+ function _temp2$68() {
18360
18360
  return _isGeoBlocked;
18361
18361
  }
18362
- function _temp3$42() {
18362
+ function _temp3$41() {
18363
18363
  return _isGeoBlocked;
18364
18364
  }
18365
18365
  //#endregion
@@ -18444,12 +18444,12 @@ var useLocalStorageValue = (key) => {
18444
18444
  t2 = () => value.current;
18445
18445
  $[4] = t2;
18446
18446
  } else t2 = $[4];
18447
- return useSyncExternalStore(t1, t2, _temp2$68);
18447
+ return useSyncExternalStore(t1, t2, _temp2$67);
18448
18448
  };
18449
18449
  function _temp$110() {
18450
18450
  return null;
18451
18451
  }
18452
- function _temp2$68() {
18452
+ function _temp2$67() {
18453
18453
  return null;
18454
18454
  }
18455
18455
  //#endregion
@@ -21994,7 +21994,7 @@ var HelpModal = (t0) => {
21994
21994
  title: t("help_modals.get_in_touch.title"),
21995
21995
  button: {
21996
21996
  title: t("help_modals.get_in_touch.button"),
21997
- onClick: _temp2$67
21997
+ onClick: _temp2$66
21998
21998
  },
21999
21999
  description: "",
22000
22000
  image: images.whatIsLiquidStaking
@@ -22175,7 +22175,7 @@ var HelpModal = (t0) => {
22175
22175
  function _temp$108(w) {
22176
22176
  return w.open("https://twitter.com/yield_xyz", "_blank");
22177
22177
  }
22178
- function _temp2$67() {
22178
+ function _temp2$66() {
22179
22179
  return MaybeWindow.ifJust(_temp$108);
22180
22180
  }
22181
22181
  //#endregion
@@ -22343,6 +22343,14 @@ function isScheduler(value) {
22343
22343
  return value && isFunction$3(value.schedule);
22344
22344
  }
22345
22345
  //#endregion
22346
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/args.js
22347
+ function last(arr) {
22348
+ return arr[arr.length - 1];
22349
+ }
22350
+ function popScheduler(args) {
22351
+ return isScheduler(last(args)) ? args.pop() : void 0;
22352
+ }
22353
+ //#endregion
22346
22354
  //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js
22347
22355
  var isArrayLike = (function(x) {
22348
22356
  return x && typeof x.length === "number" && typeof x !== "function";
@@ -22678,6 +22686,13 @@ function from$1(input, scheduler) {
22678
22686
  return scheduler ? scheduled(input, scheduler) : innerFrom(input);
22679
22687
  }
22680
22688
  //#endregion
22689
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/of.js
22690
+ function of$1() {
22691
+ var args = [];
22692
+ for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
22693
+ return from$1(args, popScheduler(args));
22694
+ }
22695
+ //#endregion
22681
22696
  //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js
22682
22697
  var EmptyError = createErrorClass(function(_super) {
22683
22698
  return function EmptyErrorImpl() {
@@ -22947,7 +22962,7 @@ var handleRichErrorResponse = ({ data, url }) => {
22947
22962
  };
22948
22963
  var useRichErrors = () => {
22949
22964
  const $ = c(2);
22950
- const error = useSyncExternalStore(_temp$107, _temp2$66, _temp3$41);
22965
+ const error = useSyncExternalStore(_temp$107, _temp2$65, _temp3$40);
22951
22966
  let t0;
22952
22967
  if ($[0] !== error) {
22953
22968
  t0 = {
@@ -22965,10 +22980,10 @@ function _temp$107(onChange) {
22965
22980
  sub.unsubscribe();
22966
22981
  };
22967
22982
  }
22968
- function _temp2$66() {
22983
+ function _temp2$65() {
22969
22984
  return $richError.value;
22970
22985
  }
22971
- function _temp3$41() {
22986
+ function _temp3$40() {
22972
22987
  return $richError.value;
22973
22988
  }
22974
22989
  //#endregion
@@ -60767,7 +60782,7 @@ var import_lodash_uniqwith = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJS
60767
60782
  var getEnabledNetworks = ({ apiClient, queryClient }) => EitherAsync(() => queryClient.fetchQuery({
60768
60783
  staleTime: Number.POSITIVE_INFINITY,
60769
60784
  queryKey: [config.appPrefix, "enabled-networks"],
60770
- queryFn: async () => new Set((await apiClient.yield.NetworksControllerGetNetworks(void 0)).map((network) => network.id))
60785
+ queryFn: async () => new Set((await apiClient.legacy.YieldControllerGetMyNetworks(void 0)).map((network) => network))
60771
60786
  })).mapLeft(() => /* @__PURE__ */ new Error("Could not get enabled networks"));
60772
60787
  //#endregion
60773
60788
  //#region src/components/atoms/token-icon/token-icon-container/hooks/use-variant-network-urls.ts
@@ -60801,6 +60816,25 @@ var dashboardYieldCategories = [
60801
60816
  "defi",
60802
60817
  "rwa"
60803
60818
  ];
60819
+ /**
60820
+ * Maps every API `YieldType` to exactly one dashboard category. The
60821
+ * `satisfies Record<ApiYieldType, ...>` guarantees exhaustiveness: a new server
60822
+ * yield type fails the build here until it is assigned a category. This mirrors
60823
+ * `getDashboardYieldCategory` (which classifies hydrated yields) but is keyed by
60824
+ * the API `type` so it can drive `types[]` query filters.
60825
+ */
60826
+ var apiYieldTypeToDashboardCategory = {
60827
+ staking: "stake",
60828
+ restaking: "stake",
60829
+ lending: "defi",
60830
+ vault: "defi",
60831
+ fixed_yield: "defi",
60832
+ concentrated_liquidity_pool: "defi",
60833
+ liquidity_pool: "defi",
60834
+ real_world_asset: "rwa"
60835
+ };
60836
+ var getApiYieldTypesForDashboardCategory = (category) => Object.entries(apiYieldTypeToDashboardCategory).filter(([, mapped]) => mapped === category).map(([yieldType]) => yieldType);
60837
+ var getDashboardYieldCategoryForApiYieldType = (yieldType) => apiYieldTypeToDashboardCategory[yieldType];
60804
60838
  var getDashboardYieldCategory = (yieldDto) => {
60805
60839
  const yieldType = getExtendedYieldType(yieldDto);
60806
60840
  if (yieldType === "real_world_asset") return "rwa";
@@ -60808,15 +60842,6 @@ var getDashboardYieldCategory = (yieldDto) => {
60808
60842
  if (isDepositYieldType(yieldType)) return "defi";
60809
60843
  return null;
60810
60844
  };
60811
- var getAvailableDashboardYieldCategories = (yields) => {
60812
- const categories = /* @__PURE__ */ new Set();
60813
- for (const yieldDto of yields) {
60814
- if (!isNonZeroRewardRateYield(yieldDto)) continue;
60815
- const category = getDashboardYieldCategory(yieldDto);
60816
- if (category) categories.add(category);
60817
- }
60818
- return dashboardYieldCategories.filter((category) => categories.has(category));
60819
- };
60820
60845
  var filterValidators = ({ validatorsConfig, validators, network, yieldId }) => {
60821
60846
  const valConfig = Maybe.fromNullable(validatorsConfig.get(network)).altLazy(() => Maybe.fromNullable(validatorsConfig.get("*"))).extractNullable();
60822
60847
  const filtered = !valConfig ? validators : (() => {
@@ -60891,7 +60916,6 @@ var getYieldRiskSourceLabel = (source, t) => {
60891
60916
  var hasYieldFeeConfigurationEnabled = (yieldDto) => Object.values(yieldDto.mechanics.fee ?? {}).some(Boolean);
60892
60917
  var getYieldCooldownPeriod = (yieldDto) => secondsToDays(yieldDto.mechanics.cooldownPeriod?.seconds);
60893
60918
  var getYieldWarmupPeriod = (yieldDto) => secondsToDays(yieldDto.mechanics.warmupPeriod?.seconds);
60894
- var getYieldCommission = (yieldDto) => yieldDto.__fallback__.metadata.commission;
60895
60919
  var getYieldTvlUsd = (yieldDto) => {
60896
60920
  const tvlUsd = yieldDto.statistics?.tvlUsd;
60897
60921
  if (tvlUsd == null || tvlUsd === "") return null;
@@ -60908,7 +60932,6 @@ var getYieldFeePercent = (yieldDto) => {
60908
60932
  return total / 100;
60909
60933
  };
60910
60934
  var getYieldLockupPeriod = (yieldDto) => secondsToDays(yieldDto.mechanics.lockupPeriod?.seconds);
60911
- var hasYieldExitSignatureVerification = (yieldDto) => !!yieldDto.__fallback__.args.exit?.args?.signatureVerification?.required;
60912
60935
  var getExtendedYieldType = (yieldDto) => {
60913
60936
  if (isNativeStaking(yieldDto)) return "native_staking";
60914
60937
  if (isPooledStaking(yieldDto)) return "pooled_staking";
@@ -61000,44 +61023,21 @@ var isNativeStaking = (yieldDto) => Maybe.fromFalsy(isEthereumStaking(yieldDto))
61000
61023
  var isPooledStaking = (yieldDto) => isEthereumStaking(yieldDto) && !isNativeStaking(yieldDto);
61001
61024
  var isYieldWithProviderOptions = (yieldDto) => !!getYieldActionArg(yieldDto, "enter", "providerId")?.required;
61002
61025
  var getYieldProviderYieldIds = (yieldDto) => getYieldActionArg(yieldDto, "enter", "providerId")?.options ?? [];
61003
- var isYieldIntegrationAggregator = (yieldDto) => !!yieldDto.__fallback__.metadata.isIntegrationAggregator;
61004
- var isYieldValidatorSelectionRequired = (yieldDto) => !!(yieldDto.mechanics.requiresValidatorSelection || isYieldIntegrationAggregator(yieldDto) || isYieldActionArgRequired(yieldDto, "enter", "validatorAddress") || isYieldActionArgRequired(yieldDto, "enter", "validatorAddresses"));
61026
+ var isYieldValidatorSelectionRequired = (yieldDto) => !!(yieldDto.mechanics.requiresValidatorSelection || isYieldActionArgRequired(yieldDto, "enter", "validatorAddress") || isYieldActionArgRequired(yieldDto, "enter", "validatorAddresses"));
61005
61027
  var isEthenaUsdeStaking = (yieldId) => yieldId === "ethena-usde-staking";
61006
61028
  var isBittensorStaking = (yieldId) => yieldId === "bittensor-native-staking";
61007
61029
  var zeroRewardRateYieldIdWhitelist = new Set(["optimism-usdc-gtusdcb-0x4ffc4e5f1f1f5c43dc9bc27b53728da13b02be35-4626-vault"]);
61008
61030
  var isNonZeroRewardRateYield = (yieldDto) => (yieldDto.rewardRate?.total ?? 0) > 0 || zeroRewardRateYieldIdWhitelist.has(yieldDto.id);
61009
61031
  var isERC4626 = (yieldDto) => yieldDto.metadata.supportedStandards?.includes("ERC4626") ?? false;
61010
61032
  //#endregion
61011
- //#region src/hooks/api/use-yield-opportunity/get-yield-opportunity.ts
61012
- var staleTime$9 = 1e3 * 60 * 2;
61013
- var getKey$1 = (params) => [
61014
- "yield-opportunity",
61015
- params.yieldId,
61016
- params.isLedgerLive
61017
- ];
61018
- var getMultiKey = (params) => [
61019
- "yield-opportunities",
61020
- params.yieldIds,
61021
- params.isLedgerLive
61022
- ];
61033
+ //#region src/hooks/api/use-yield-providers.ts
61034
+ var staleTime$10 = 1e3 * 60 * 2;
61023
61035
  var getProviderKey = (providerId) => ["yield-provider", providerId];
61024
- var applyYieldOverrides = (yieldDto) => isEthenaUsdeStaking(yieldDto.id) ? {
61025
- ...yieldDto,
61026
- metadata: {
61027
- ...yieldDto.metadata,
61028
- name: yieldDto.metadata.name.replace(/staking/i, "")
61029
- }
61030
- } : yieldDto;
61031
- var createYield = ({ legacyYield, provider, yieldDto }) => ({
61032
- ...yieldDto,
61033
- ...provider ? { provider } : {},
61034
- __fallback__: legacyYield
61035
- });
61036
61036
  var fetchYieldProvider = async ({ client, providerId, queryClient }) => {
61037
61037
  try {
61038
61038
  return await queryClient.fetchQuery({
61039
61039
  queryKey: getProviderKey(providerId),
61040
- staleTime: staleTime$9,
61040
+ staleTime: staleTime$10,
61041
61041
  queryFn: () => client.yield.ProvidersControllerGetProvider(providerId, void 0)
61042
61042
  });
61043
61043
  } catch (e) {
@@ -61056,6 +61056,108 @@ var fetchYieldProviders = async ({ client, providerIds, queryClient }) => {
61056
61056
  })));
61057
61057
  return new Map(providers.flatMap(({ provider, providerId }) => provider ? [[providerId, provider]] : []));
61058
61058
  };
61059
+ //#endregion
61060
+ //#region src/hooks/api/use-yield-summaries.ts
61061
+ var DEFAULT_YIELD_IDS_CHUNK_SIZE = 100;
61062
+ /**
61063
+ * A summary is "visible" when it is enterable, on a supported chain, and has a
61064
+ * non-zero reward rate (matching the dashboard catalog's display semantics).
61065
+ */
61066
+ var isVisibleYieldSummary = (summary) => summary.status.enter && isSupportedChain(summary.token.network) && isNonZeroRewardRateYield(summary);
61067
+ var getYieldSummariesQueryKey = (params) => ["yield-summaries", params];
61068
+ var unique = (items) => [...new Set(items)];
61069
+ var chunks = (items, chunkSize) => {
61070
+ const result = [];
61071
+ for (let index = 0; index < items.length; index += chunkSize) result.push(items.slice(index, index + chunkSize));
61072
+ return result;
61073
+ };
61074
+ /**
61075
+ * Fetch a single page of yield summaries.
61076
+ */
61077
+ var fetchYieldSummariesPage = async ({ apiClient, params, signal }) => {
61078
+ return [...(await apiClient.withOptions({ signal }).yield.YieldsControllerGetYields({ params })).items ?? []];
61079
+ };
61080
+ /**
61081
+ * Fetch yield summaries by ID without ever sending an unbounded `yieldIds`
61082
+ * query array. Results are ordered according to the first occurrence of each
61083
+ * requested ID.
61084
+ */
61085
+ var fetchYieldSummariesByIds = async ({ apiClient, chunkSize = DEFAULT_YIELD_IDS_CHUNK_SIZE, signal, suppressRichErrors, yieldIds }) => {
61086
+ const ids = unique(yieldIds);
61087
+ if (ids.length === 0) return [];
61088
+ const client = apiClient.withOptions({
61089
+ signal,
61090
+ suppressRichErrors
61091
+ });
61092
+ const normalizedChunkSize = Math.max(1, chunkSize);
61093
+ const summariesById = /* @__PURE__ */ new Map();
61094
+ for (const chunk of chunks(ids, normalizedChunkSize)) {
61095
+ const result = await client.yield.YieldsControllerGetYields({ params: {
61096
+ yieldIds: chunk,
61097
+ limit: chunk.length
61098
+ } });
61099
+ for (const summary of result.items ?? []) summariesById.set(summary.id, summary);
61100
+ }
61101
+ return ids.flatMap((id) => {
61102
+ const summary = summariesById.get(id);
61103
+ return summary ? [summary] : [];
61104
+ });
61105
+ };
61106
+ var applyYieldSummaryOverrides = (yieldDto) => isEthenaUsdeStaking(yieldDto.id) ? {
61107
+ ...yieldDto,
61108
+ metadata: {
61109
+ ...yieldDto.metadata,
61110
+ name: yieldDto.metadata.name.replace(/staking/i, "")
61111
+ }
61112
+ } : yieldDto;
61113
+ var fetchYieldSummariesWithProvidersByIds = async ({ apiClient, queryClient, signal, suppressRichErrors, yieldIds }) => {
61114
+ const client = apiClient.withOptions({
61115
+ signal,
61116
+ suppressRichErrors
61117
+ });
61118
+ const summaries = await fetchYieldSummariesByIds({
61119
+ apiClient,
61120
+ signal,
61121
+ suppressRichErrors,
61122
+ yieldIds
61123
+ });
61124
+ const providersById = await fetchYieldProviders({
61125
+ client,
61126
+ providerIds: summaries.map((yieldDto) => yieldDto.providerId),
61127
+ queryClient
61128
+ });
61129
+ return summaries.map((summary) => {
61130
+ const provider = providersById.get(summary.providerId);
61131
+ return applyYieldSummaryOverrides({
61132
+ ...summary,
61133
+ ...provider ? { provider } : {}
61134
+ });
61135
+ });
61136
+ };
61137
+ //#endregion
61138
+ //#region src/hooks/api/use-yield-opportunity/get-yield-opportunity.ts
61139
+ var staleTime$9 = 1e3 * 60 * 2;
61140
+ var getKey$1 = (params) => [
61141
+ "yield-opportunity",
61142
+ params.yieldId,
61143
+ params.isLedgerLive
61144
+ ];
61145
+ var getMultiKey = (params) => [
61146
+ "yield-opportunities",
61147
+ params.yieldIds,
61148
+ params.isLedgerLive
61149
+ ];
61150
+ var applyYieldOverrides = (yieldDto) => isEthenaUsdeStaking(yieldDto.id) ? {
61151
+ ...yieldDto,
61152
+ metadata: {
61153
+ ...yieldDto.metadata,
61154
+ name: yieldDto.metadata.name.replace(/staking/i, "")
61155
+ }
61156
+ } : yieldDto;
61157
+ var createYield = ({ provider, yieldDto }) => ({
61158
+ ...yieldDto,
61159
+ ...provider ? { provider } : {}
61160
+ });
61059
61161
  var getYieldOpportunity = (params) => EitherAsync(() => params.queryClient.fetchQuery({
61060
61162
  queryKey: getKey$1(params),
61061
61163
  staleTime: staleTime$9,
@@ -61064,6 +61166,17 @@ var getYieldOpportunity = (params) => EitherAsync(() => params.queryClient.fetch
61064
61166
  console.log(e);
61065
61167
  return /* @__PURE__ */ new Error("Could not get yield opportunity");
61066
61168
  });
61169
+ var getYieldOpportunityFromSummary = (params) => EitherAsync(() => params.queryClient.fetchQuery({
61170
+ queryKey: getKey$1({
61171
+ ...params,
61172
+ yieldId: params.yieldDto.id
61173
+ }),
61174
+ staleTime: staleTime$9,
61175
+ queryFn: () => hydrateYieldSummaryQueryFn(params)
61176
+ })).mapLeft((e) => {
61177
+ console.log(e);
61178
+ return /* @__PURE__ */ new Error("Could not get yield opportunity");
61179
+ });
61067
61180
  var getYieldOpportunities = (params) => EitherAsync(() => params.queryClient.fetchQuery({
61068
61181
  queryKey: getMultiKey(params),
61069
61182
  staleTime: staleTime$9,
@@ -61085,15 +61198,14 @@ var getYieldOpportunities = (params) => EitherAsync(() => params.queryClient.fet
61085
61198
  });
61086
61199
  var queryFn$8 = async (params) => (await fn$1(params)).unsafeCoerce();
61087
61200
  var multiQueryFn = async (params) => (await multiFn(params)).unsafeCoerce();
61088
- var fn$1 = ({ isLedgerLive, yieldId, queryClient, signal, suppressRichErrors, apiClient }) => {
61201
+ var fn$1 = ({ yieldId, queryClient, signal, suppressRichErrors, apiClient }) => {
61089
61202
  return EitherAsync(async () => {
61090
61203
  const client = apiClient.withOptions({
61091
61204
  signal,
61092
61205
  suppressRichErrors
61093
61206
  });
61094
- const [newYieldResult, legacyYieldResult] = await Promise.all([client.yield.YieldsControllerGetYield(yieldId, void 0), client.legacy.YieldControllerYieldOpportunity(yieldId, { params: { ledgerWalletAPICompatible: isLedgerLive } })]);
61207
+ const newYieldResult = await client.yield.YieldsControllerGetYield(yieldId, void 0);
61095
61208
  return createYield({
61096
- legacyYield: legacyYieldResult,
61097
61209
  provider: await fetchYieldProvider({
61098
61210
  client,
61099
61211
  providerId: newYieldResult.providerId,
@@ -61106,36 +61218,32 @@ var fn$1 = ({ isLedgerLive, yieldId, queryClient, signal, suppressRichErrors, ap
61106
61218
  return /* @__PURE__ */ new Error("Could not get yield opportunity");
61107
61219
  });
61108
61220
  };
61109
- var multiFn = ({ isLedgerLive, queryClient, yieldIds, signal, suppressRichErrors, apiClient }) => {
61110
- return EitherAsync(async () => {
61111
- const client = apiClient.withOptions({
61112
- signal,
61113
- suppressRichErrors
61114
- });
61115
- const newYieldsResult = await client.yield.YieldsControllerGetYields({ params: {
61116
- yieldIds,
61117
- limit: yieldIds.length
61118
- } });
61119
- const newYieldsById = new Map((newYieldsResult.items ?? []).map((yieldDto) => [yieldDto.id, yieldDto]));
61120
- const providersById = await fetchYieldProviders({
61221
+ var hydrateYieldSummaryQueryFn = async ({ yieldDto, queryClient, signal, suppressRichErrors, apiClient }) => {
61222
+ const client = apiClient.withOptions({
61223
+ signal,
61224
+ suppressRichErrors
61225
+ });
61226
+ return applyYieldOverrides(createYield({
61227
+ provider: yieldDto.provider ?? await fetchYieldProvider({
61121
61228
  client,
61122
- providerIds: [...newYieldsById.values()].map((yieldDto) => yieldDto.providerId),
61229
+ providerId: yieldDto.providerId,
61123
61230
  queryClient
61124
- });
61125
- return (await Promise.all(yieldIds.map(async (yieldId) => {
61126
- const newYieldResult = newYieldsById.get(yieldId);
61127
- if (!newYieldResult) return null;
61128
- try {
61129
- return applyYieldOverrides(createYield({
61130
- legacyYield: await client.legacy.YieldControllerYieldOpportunity(yieldId, { params: { ledgerWalletAPICompatible: isLedgerLive } }),
61131
- provider: providersById.get(newYieldResult.providerId),
61132
- yieldDto: newYieldResult
61133
- }));
61134
- } catch (e) {
61135
- console.log(e);
61136
- return null;
61137
- }
61138
- }))).filter((yieldDto) => yieldDto !== null);
61231
+ }),
61232
+ yieldDto
61233
+ }));
61234
+ };
61235
+ var multiFn = ({ queryClient, yieldIds, signal, suppressRichErrors, apiClient }) => {
61236
+ return EitherAsync(async () => {
61237
+ return (await fetchYieldSummariesWithProvidersByIds({
61238
+ apiClient,
61239
+ queryClient,
61240
+ signal,
61241
+ suppressRichErrors,
61242
+ yieldIds
61243
+ })).map((yieldDto) => applyYieldOverrides(createYield({
61244
+ provider: yieldDto.provider,
61245
+ yieldDto
61246
+ })));
61139
61247
  }).mapLeft((e) => {
61140
61248
  console.log(e);
61141
61249
  return /* @__PURE__ */ new Error("Could not get yield opportunities");
@@ -64411,9 +64519,8 @@ var bindLegacyApi = ({ api, options }) => ({
64411
64519
  TokenControllerGetTokenPrices: bindOperation(api.TokenControllerGetTokenPrices, options),
64412
64520
  TokenControllerGetTokens: bindOperation(api.TokenControllerGetTokens, options),
64413
64521
  TokenControllerTokenBalancesScan: bindOperation(api.TokenControllerTokenBalancesScan, options),
64414
- TransactionControllerGetTransactionVerificationMessageForNetwork: bindOperation(api.TransactionControllerGetTransactionVerificationMessageForNetwork, options),
64415
- YieldControllerGetSingleYieldRewardsSummary: bindOperation(api.YieldControllerGetSingleYieldRewardsSummary, options),
64416
- YieldControllerYieldOpportunity: bindOperation(api.YieldControllerYieldOpportunity, options)
64522
+ YieldControllerGetMyNetworks: bindOperation(api.YieldControllerGetMyNetworks, options),
64523
+ YieldControllerGetSingleYieldRewardsSummary: bindOperation(api.YieldControllerGetSingleYieldRewardsSummary, options)
64417
64524
  });
64418
64525
  var bindYieldApi = ({ api, options }) => ({
64419
64526
  ActionsControllerEnterYield: bindOperation(api.ActionsControllerEnterYield, options),
@@ -64422,7 +64529,6 @@ var bindYieldApi = ({ api, options }) => ({
64422
64529
  ActionsControllerManageYield: bindOperation(api.ActionsControllerManageYield, options),
64423
64530
  HealthControllerHealth: bindOperation(api.HealthControllerHealth, options),
64424
64531
  KycControllerGetStatus: bindOperation(api.KycControllerGetStatus, options),
64425
- NetworksControllerGetNetworks: bindOperation(api.NetworksControllerGetNetworks, options),
64426
64532
  ProvidersControllerGetProvider: bindOperation(api.ProvidersControllerGetProvider, options),
64427
64533
  TransactionsControllerGetTransaction: bindOperation(api.TransactionsControllerGetTransaction, options),
64428
64534
  TransactionsControllerSubmitTransaction: bindOperation(api.TransactionsControllerSubmitTransaction, options),
@@ -64526,7 +64632,7 @@ var getWagmiChain = (chain) => ({
64526
64632
  });
64527
64633
  //#endregion
64528
64634
  //#region src/providers/cosmos/config.ts
64529
- var queryKey$5 = [config.appPrefix, "cosmos-config"];
64635
+ var queryKey$4 = [config.appPrefix, "cosmos-config"];
64530
64636
  var staleTime$8 = Number.POSITIVE_INFINITY;
64531
64637
  var queryFn$7 = async ({ apiClient, queryClient, forceWalletConnectOnly }) => getEnabledNetworks({
64532
64638
  apiClient,
@@ -64580,7 +64686,7 @@ var queryFn$7 = async ({ apiClient, queryClient, forceWalletConnectOnly }) => ge
64580
64686
  });
64581
64687
  var getConfig$5 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
64582
64688
  staleTime: staleTime$8,
64583
- queryKey: queryKey$5,
64689
+ queryKey: queryKey$4,
64584
64690
  queryFn: () => queryFn$7(opts)
64585
64691
  })).mapLeft((e) => {
64586
64692
  console.log(e);
@@ -65269,7 +65375,7 @@ var createFineryWallets = (evmChains) => {
65269
65375
  };
65270
65376
  //#endregion
65271
65377
  //#region src/providers/ethereum/config.ts
65272
- var queryFn$6 = async ({ apiClient, queryClient, forceWalletConnectOnly, variant }) => getEnabledNetworks({
65378
+ var queryFn$6 = async ({ apiClient, queryClient, forceWalletConnectOnly, institutionalWallets, variant }) => getEnabledNetworks({
65273
65379
  apiClient,
65274
65380
  queryClient
65275
65381
  }).caseOf({
@@ -65299,14 +65405,20 @@ var queryFn$6 = async ({ apiClient, queryClient, forceWalletConnectOnly, variant
65299
65405
  evmChainsMap: filteredEvmChainsMap,
65300
65406
  evmChains,
65301
65407
  connector: Maybe.fromPredicate(() => !!evmChains.length, connector),
65302
- fineryWallets: variant === "finery" ? createFineryWallets(evmChains) : null
65408
+ institutionalWallets: variant === "finery" || institutionalWallets ? createFineryWallets(evmChains) : null
65303
65409
  });
65304
65410
  },
65305
65411
  Left: (l) => Promise.reject(l)
65306
65412
  });
65307
65413
  var getConfig$4 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65308
65414
  staleTime: Number.POSITIVE_INFINITY,
65309
- queryKey: [config.appPrefix, "evm-config"],
65415
+ queryKey: [
65416
+ config.appPrefix,
65417
+ "evm-config",
65418
+ opts.variant,
65419
+ opts.institutionalWallets,
65420
+ opts.forceWalletConnectOnly
65421
+ ],
65310
65422
  queryFn: () => queryFn$6(opts)
65311
65423
  })).mapLeft((e) => {
65312
65424
  console.log(e);
@@ -65314,7 +65426,7 @@ var getConfig$4 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65314
65426
  });
65315
65427
  //#endregion
65316
65428
  //#region src/providers/ledger/config.ts
65317
- var queryKey$4 = [config.appPrefix, "ledger-live-config"];
65429
+ var queryKey$3 = [config.appPrefix, "ledger-live-config"];
65318
65430
  var staleTime$7 = Number.POSITIVE_INFINITY;
65319
65431
  var queryFn$5 = async ({ enabledChainsMap, queryParams }) => {
65320
65432
  return EitherAsync.liftEither(Maybe.fromFalsy(isLedgerDappBrowserProvider()).toEither(null)).chain(() => EitherAsync(() => import("./ledger-connector-Cf6yV8eL.js")).mapLeft(() => /* @__PURE__ */ new Error("Could not import ledger-connector")).map((v) => v.ledgerLiveConnector({
@@ -65327,7 +65439,7 @@ var queryFn$5 = async ({ enabledChainsMap, queryParams }) => {
65327
65439
  };
65328
65440
  var getConfig$3 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65329
65441
  staleTime: staleTime$7,
65330
- queryKey: queryKey$4,
65442
+ queryKey: queryKey$3,
65331
65443
  queryFn: () => queryFn$5(opts)
65332
65444
  })).mapLeft((e) => {
65333
65445
  console.log(e);
@@ -65335,7 +65447,7 @@ var getConfig$3 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65335
65447
  });
65336
65448
  //#endregion
65337
65449
  //#region src/providers/misc/config.ts
65338
- var queryKey$3 = [config.appPrefix, "misc-config"];
65450
+ var queryKey$2 = [config.appPrefix, "misc-config"];
65339
65451
  var staleTime$6 = Number.POSITIVE_INFINITY;
65340
65452
  var queryFn$4 = async ({ enabledNetworks, forceWalletConnectOnly, solanaWallets, solanaConnection, variant, tonConnectManifestUrl }) => {
65341
65453
  const filteredMiscChainsMap = typeSafeObjectFromEntries(typeSafeObjectEntries(miscChainsMap).filter(([_, v]) => enabledNetworks.has(v.skChainName)));
@@ -65358,7 +65470,7 @@ var queryFn$4 = async ({ enabledNetworks, forceWalletConnectOnly, solanaWallets,
65358
65470
  };
65359
65471
  var getConfig$2 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65360
65472
  staleTime: staleTime$6,
65361
- queryKey: queryKey$3,
65473
+ queryKey: queryKey$2,
65362
65474
  queryFn: () => queryFn$4(opts)
65363
65475
  })).mapLeft((e) => {
65364
65476
  console.log(e);
@@ -65409,7 +65521,7 @@ var useSKQueryClient = () => {
65409
65521
  };
65410
65522
  //#endregion
65411
65523
  //#region src/providers/safe/config.ts
65412
- var queryKey$2 = [config.appPrefix, "safe-config"];
65524
+ var queryKey$1 = [config.appPrefix, "safe-config"];
65413
65525
  var staleTime$5 = Number.POSITIVE_INFINITY;
65414
65526
  var queryFn$3 = async () => {
65415
65527
  return EitherAsync(() => import("./safe-connector-B8DuxkSp.js")).mapLeft(() => /* @__PURE__ */ new Error("Could not import safe-connector")).map((v) => v.safeConnector()).chainLeft((e) => EitherAsync.liftEither(e ? left(e) : right(null))).caseOf({
@@ -65419,7 +65531,7 @@ var queryFn$3 = async () => {
65419
65531
  };
65420
65532
  var getConfig$1 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65421
65533
  staleTime: staleTime$5,
65422
- queryKey: queryKey$2,
65534
+ queryKey: queryKey$1,
65423
65535
  queryFn: () => queryFn$3()
65424
65536
  })).mapLeft((e) => {
65425
65537
  console.log(e);
@@ -65427,7 +65539,7 @@ var getConfig$1 = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65427
65539
  });
65428
65540
  //#endregion
65429
65541
  //#region src/providers/substrate/config.ts
65430
- var queryKey$1 = [config.appPrefix, "substrate-config"];
65542
+ var queryKey = [config.appPrefix, "substrate-config"];
65431
65543
  var staleTime$4 = Number.POSITIVE_INFINITY;
65432
65544
  var queryFn$2 = async ({ apiClient, queryClient, forceWalletConnectOnly }) => getEnabledNetworks({
65433
65545
  apiClient,
@@ -65454,7 +65566,7 @@ var queryFn$2 = async ({ apiClient, queryClient, forceWalletConnectOnly }) => ge
65454
65566
  });
65455
65567
  var getConfig = (opts) => EitherAsync(() => opts.queryClient.fetchQuery({
65456
65568
  staleTime: staleTime$4,
65457
- queryKey: queryKey$1,
65569
+ queryKey,
65458
65570
  queryFn: () => queryFn$2(opts)
65459
65571
  })).mapLeft((e) => {
65460
65572
  console.log(e);
@@ -65471,6 +65583,7 @@ var omitEnsUniversalResolver = (chain) => {
65471
65583
  contracts
65472
65584
  };
65473
65585
  };
65586
+ var withoutEmptyWalletGroups = (walletList) => walletList.filter((walletGroup) => walletGroup.wallets.length > 0);
65474
65587
  var buildWagmiConfig = async (opts) => {
65475
65588
  return getEnabledNetworks({
65476
65589
  apiClient: opts.apiClient,
@@ -65478,6 +65591,7 @@ var buildWagmiConfig = async (opts) => {
65478
65591
  }).chain((networks) => EitherAsync.fromPromise(() => Promise.all([
65479
65592
  getConfig$4({
65480
65593
  forceWalletConnectOnly: opts.forceWalletConnectOnly,
65594
+ institutionalWallets: opts.institutionalWallets,
65481
65595
  queryClient: opts.queryClient,
65482
65596
  variant: opts.variant,
65483
65597
  apiClient: opts.apiClient
@@ -65560,14 +65674,14 @@ var buildWagmiConfig = async (opts) => {
65560
65674
  const chainsWithoutEnsProfileLookups = chains.map(omitEnsUniversalResolver);
65561
65675
  const multiInjectedProviderDiscovery = !opts.disableInjectedProviderDiscovery && !opts.externalProviders && !val.ledgerLiveConnector && !val.safeConnector && opts.variant !== "porto";
65562
65676
  const walletList = just(null).map(() => {
65563
- if (evmConfig.fineryWallets) return [
65677
+ if (evmConfig.institutionalWallets) return [
65564
65678
  {
65565
65679
  groupName: "Primary",
65566
- wallets: evmConfig.fineryWallets.primaryWallets
65680
+ wallets: evmConfig.institutionalWallets.primaryWallets
65567
65681
  },
65568
65682
  {
65569
65683
  groupName: "Other",
65570
- wallets: evmConfig.fineryWallets.otherWallets
65684
+ wallets: evmConfig.institutionalWallets.otherWallets
65571
65685
  },
65572
65686
  ...Maybe.catMaybes(miscConfig.connectors)
65573
65687
  ];
@@ -65595,7 +65709,7 @@ var buildWagmiConfig = async (opts) => {
65595
65709
  })
65596
65710
  } : wallet;
65597
65711
  })
65598
- }))).map((walletList) => opts.mapWalletListFn?.(walletList) ?? walletList).map((walletList) => {
65712
+ }))).map((walletList) => opts.mapWalletListFn?.(walletList) ?? walletList).map(withoutEmptyWalletGroups).map((walletList) => {
65599
65713
  return walletList.map((wg) => ({
65600
65714
  ...wg,
65601
65715
  wallets: wg.wallets.map((createWalletFn) => (details) => {
@@ -65649,56 +65763,80 @@ var buildWagmiConfig = async (opts) => {
65649
65763
  }
65650
65764
  });
65651
65765
  };
65652
- var queryKey = [config.appPrefix, "wagmi-config"];
65653
65766
  var staleTime$3 = Number.POSITIVE_INFINITY;
65654
65767
  var useWagmiConfig = () => {
65655
- const $ = c(15);
65656
- const { wagmi, externalProviders, isSafe, disableInjectedProviderDiscovery, mapWalletFn, chainIconMapping, variant, mapWalletListFn, tonConnectManifestUrl } = useSettings();
65768
+ const $ = c(23);
65769
+ const { wagmi, externalProviders, isSafe, disableInjectedProviderDiscovery, mapWalletFn, chainIconMapping, institutionalWallets, variant, mapWalletListFn, tonConnectManifestUrl } = useSettings();
65657
65770
  const solanaWallets = useWallet();
65658
65771
  const solanaConnection = useConnection();
65659
65772
  const queryClient = useSKQueryClient();
65660
65773
  const apiClient = useApiClient();
65661
65774
  const externalProvidersRef = useSavedRef(externalProviders);
65662
- let t0;
65663
- if ($[0] !== apiClient || $[1] !== chainIconMapping || $[2] !== disableInjectedProviderDiscovery || $[3] !== externalProvidersRef || $[4] !== isSafe || $[5] !== mapWalletFn || $[6] !== mapWalletListFn || $[7] !== queryClient || $[8] !== solanaConnection || $[9] !== solanaWallets || $[10] !== tonConnectManifestUrl || $[11] !== variant || $[12] !== wagmi?.__customConnectors__ || $[13] !== wagmi?.forceWalletConnectOnly) {
65664
- t0 = {
65775
+ const t0 = !!institutionalWallets;
65776
+ const t1 = !!wagmi?.forceWalletConnectOnly;
65777
+ let t2;
65778
+ if ($[0] !== t0 || $[1] !== t1 || $[2] !== variant) {
65779
+ t2 = [
65780
+ config.appPrefix,
65781
+ "wagmi-config",
65782
+ variant,
65783
+ t0,
65784
+ t1
65785
+ ];
65786
+ $[0] = t0;
65787
+ $[1] = t1;
65788
+ $[2] = variant;
65789
+ $[3] = t2;
65790
+ } else t2 = $[3];
65791
+ let t3;
65792
+ if ($[4] !== apiClient || $[5] !== chainIconMapping || $[6] !== disableInjectedProviderDiscovery || $[7] !== externalProvidersRef || $[8] !== institutionalWallets || $[9] !== isSafe || $[10] !== mapWalletFn || $[11] !== mapWalletListFn || $[12] !== queryClient || $[13] !== solanaConnection || $[14] !== solanaWallets || $[15] !== tonConnectManifestUrl || $[16] !== variant || $[17] !== wagmi?.__customConnectors__ || $[18] !== wagmi?.forceWalletConnectOnly) {
65793
+ t3 = () => buildWagmiConfig({
65794
+ mapWalletFn,
65795
+ disableInjectedProviderDiscovery: !!disableInjectedProviderDiscovery,
65796
+ forceWalletConnectOnly: !!wagmi?.forceWalletConnectOnly,
65797
+ customConnectors: wagmi?.__customConnectors__,
65798
+ queryClient,
65799
+ apiClient,
65800
+ isLedgerLive: isLedgerDappBrowserProvider(),
65801
+ isSafe: !!isSafe,
65802
+ ...externalProvidersRef.current && { externalProviders: externalProvidersRef },
65803
+ chainIconMapping,
65804
+ institutionalWallets: !!institutionalWallets,
65805
+ variant,
65806
+ solanaWallets: solanaWallets.wallets,
65807
+ solanaConnection: solanaConnection.connection,
65808
+ mapWalletListFn,
65809
+ tonConnectManifestUrl
65810
+ });
65811
+ $[4] = apiClient;
65812
+ $[5] = chainIconMapping;
65813
+ $[6] = disableInjectedProviderDiscovery;
65814
+ $[7] = externalProvidersRef;
65815
+ $[8] = institutionalWallets;
65816
+ $[9] = isSafe;
65817
+ $[10] = mapWalletFn;
65818
+ $[11] = mapWalletListFn;
65819
+ $[12] = queryClient;
65820
+ $[13] = solanaConnection;
65821
+ $[14] = solanaWallets;
65822
+ $[15] = tonConnectManifestUrl;
65823
+ $[16] = variant;
65824
+ $[17] = wagmi?.__customConnectors__;
65825
+ $[18] = wagmi?.forceWalletConnectOnly;
65826
+ $[19] = t3;
65827
+ } else t3 = $[19];
65828
+ let t4;
65829
+ if ($[20] !== t2 || $[21] !== t3) {
65830
+ t4 = {
65665
65831
  staleTime: staleTime$3,
65666
- queryKey,
65667
- queryFn: () => buildWagmiConfig({
65668
- mapWalletFn,
65669
- disableInjectedProviderDiscovery: !!disableInjectedProviderDiscovery,
65670
- forceWalletConnectOnly: !!wagmi?.forceWalletConnectOnly,
65671
- customConnectors: wagmi?.__customConnectors__,
65672
- queryClient,
65673
- apiClient,
65674
- isLedgerLive: isLedgerDappBrowserProvider(),
65675
- isSafe: !!isSafe,
65676
- ...externalProvidersRef.current && { externalProviders: externalProvidersRef },
65677
- chainIconMapping,
65678
- variant,
65679
- solanaWallets: solanaWallets.wallets,
65680
- solanaConnection: solanaConnection.connection,
65681
- mapWalletListFn,
65682
- tonConnectManifestUrl
65683
- })
65832
+ queryKey: t2,
65833
+ queryFn: t3
65684
65834
  };
65685
- $[0] = apiClient;
65686
- $[1] = chainIconMapping;
65687
- $[2] = disableInjectedProviderDiscovery;
65688
- $[3] = externalProvidersRef;
65689
- $[4] = isSafe;
65690
- $[5] = mapWalletFn;
65691
- $[6] = mapWalletListFn;
65692
- $[7] = queryClient;
65693
- $[8] = solanaConnection;
65694
- $[9] = solanaWallets;
65695
- $[10] = tonConnectManifestUrl;
65696
- $[11] = variant;
65697
- $[12] = wagmi?.__customConnectors__;
65698
- $[13] = wagmi?.forceWalletConnectOnly;
65699
- $[14] = t0;
65700
- } else t0 = $[14];
65701
- return useQuery$1(t0);
65835
+ $[20] = t2;
65836
+ $[21] = t3;
65837
+ $[22] = t4;
65838
+ } else t4 = $[22];
65839
+ return useQuery$1(t4);
65702
65840
  };
65703
65841
  var defaultConfig = createConfig({
65704
65842
  chains: [omitEnsUniversalResolver(mainnet)],
@@ -65740,7 +65878,7 @@ var useCosmosCW = (connector) => {
65740
65878
  let t0;
65741
65879
  if ($[0] !== connector || $[1] !== subject) {
65742
65880
  t0 = (onChange) => {
65743
- if (!connector || !isCosmosConnector(connector)) return _temp2$65;
65881
+ if (!connector || !isCosmosConnector(connector)) return _temp2$64;
65744
65882
  const sub = connector.$chainWallet.subscribe((val) => {
65745
65883
  subject.next(val);
65746
65884
  onChange();
@@ -65770,7 +65908,7 @@ var useCosmosCW = (connector) => {
65770
65908
  function _temp$106() {
65771
65909
  return new BehaviorSubject(null);
65772
65910
  }
65773
- function _temp2$65() {}
65911
+ function _temp2$64() {}
65774
65912
  //#endregion
65775
65913
  //#region src/providers/sk-wallet/use-additional-addresses.ts
65776
65914
  var useAdditionalAddresses = (t0) => {
@@ -65859,7 +65997,7 @@ var useConnectorChains = (t0) => {
65859
65997
  let t1;
65860
65998
  if ($[0] !== connector || $[1] !== subject) {
65861
65999
  t1 = (onChange) => {
65862
- if (!connector || !isConnectorWithFilteredChains(connector)) return _temp2$64;
66000
+ if (!connector || !isConnectorWithFilteredChains(connector)) return _temp2$63;
65863
66001
  const sub = connector.$filteredChains.subscribe((val) => {
65864
66002
  subject.next(val);
65865
66003
  onChange();
@@ -65896,7 +66034,7 @@ var defaultValue = [];
65896
66034
  function _temp$105() {
65897
66035
  return new BehaviorSubject([]);
65898
66036
  }
65899
- function _temp2$64() {}
66037
+ function _temp2$63() {}
65900
66038
  //#endregion
65901
66039
  //#region src/providers/sk-wallet/use-init.ts
65902
66040
  var useInit = () => {
@@ -65917,10 +66055,10 @@ var useInit = () => {
65917
66055
  if (!config) return;
65918
66056
  return EitherAsync(() => reconnect(config)).chainLeft(_temp$104).chain(async (reconnectVal) => {
65919
66057
  if (externalProviders || reconnectVal?.length || isLedgerDappBrowserProvider() || !isMobile$2()) return right(null);
65920
- return EitherAsync.liftEither(List.find(_temp2$63, config.connectors).toEither(/* @__PURE__ */ new Error("Could not find injected connector"))).chain((injConnector) => EitherAsync(() => connect(config, {
66058
+ return EitherAsync.liftEither(List.find(_temp2$62, config.connectors).toEither(/* @__PURE__ */ new Error("Could not find injected connector"))).chain((injConnector) => EitherAsync(() => connect(config, {
65921
66059
  connector: injConnector,
65922
66060
  chainId: queryParamsInitChainId
65923
- }))).chainLeft(_temp3$40);
66061
+ }))).chainLeft(_temp3$39);
65924
66062
  }).chain(() => {
65925
66063
  if (queryParamsInitChainId && config.state.chainId !== queryParamsInitChainId) return EitherAsync(() => switchChain(config, { chainId: queryParamsInitChainId })).chainLeft(_temp4$26);
65926
66064
  return EitherAsync.liftEither(right(null));
@@ -65948,10 +66086,10 @@ var useInit = () => {
65948
66086
  async function _temp$104() {
65949
66087
  return right(null);
65950
66088
  }
65951
- function _temp2$63(c) {
66089
+ function _temp2$62(c) {
65952
66090
  return c.id === "injected" || c.id === configMeta$1.id;
65953
66091
  }
65954
- async function _temp3$40() {
66092
+ async function _temp3$39() {
65955
66093
  return right(null);
65956
66094
  }
65957
66095
  async function _temp4$26() {
@@ -65968,7 +66106,7 @@ var useLedgerAccounts = (connector) => {
65968
66106
  let t0;
65969
66107
  if ($[0] !== connector || $[1] !== subject) {
65970
66108
  t0 = (onChange) => {
65971
- if (!connector || !isLedgerLiveConnector(connector)) return _temp2$62;
66109
+ if (!connector || !isLedgerLiveConnector(connector)) return _temp2$61;
65972
66110
  const sub = connector.$accountsOnCurrentChain.subscribe((val) => {
65973
66111
  subject.next(val);
65974
66112
  onChange();
@@ -65998,7 +66136,7 @@ var useLedgerAccounts = (connector) => {
65998
66136
  function _temp$103() {
65999
66137
  return new BehaviorSubject([]);
66000
66138
  }
66001
- function _temp2$62() {}
66139
+ function _temp2$61() {}
66002
66140
  //#endregion
66003
66141
  //#region src/providers/sk-wallet/use-ledger-current-account-id.ts
66004
66142
  var useLedgerCurrentAccountId = (connector) => {
@@ -66007,7 +66145,7 @@ var useLedgerCurrentAccountId = (connector) => {
66007
66145
  let t0;
66008
66146
  if ($[0] !== connector || $[1] !== subject) {
66009
66147
  t0 = (onChange) => {
66010
- if (!connector || !isLedgerLiveConnector(connector)) return _temp2$61;
66148
+ if (!connector || !isLedgerLiveConnector(connector)) return _temp2$60;
66011
66149
  const sub = connector.$currentAccountId.subscribe((val) => {
66012
66150
  subject.next(val);
66013
66151
  onChange();
@@ -66037,7 +66175,7 @@ var useLedgerCurrentAccountId = (connector) => {
66037
66175
  function _temp$102() {
66038
66176
  return new BehaviorSubject(void 0);
66039
66177
  }
66040
- function _temp2$61() {}
66178
+ function _temp2$60() {}
66041
66179
  //#endregion
66042
66180
  //#region src/hooks/use-first-mount-state.ts
66043
66181
  var useFirstMountState = () => {
@@ -67634,7 +67772,7 @@ var useYieldBalancesScan = (opts) => {
67634
67772
  t1 = Maybe.fromRecord({
67635
67773
  address: Maybe.fromNullable(address),
67636
67774
  network: Maybe.fromNullable(network)
67637
- }).mapOrDefault(_temp2$60, {
67775
+ }).mapOrDefault(_temp2$59, {
67638
67776
  enabled: false,
67639
67777
  dto: { queries: [{
67640
67778
  address: "",
@@ -67742,7 +67880,7 @@ var getYieldYieldBalancesScanQueryKey = (dto) => [
67742
67880
  function _temp$99(v) {
67743
67881
  return v.timestamp;
67744
67882
  }
67745
- function _temp2$60(val) {
67883
+ function _temp2$59(val) {
67746
67884
  return {
67747
67885
  enabled: true,
67748
67886
  dto: { queries: [{
@@ -71158,7 +71296,7 @@ var multiYieldsStore = createStore$1({
71158
71296
  return { data: newMap };
71159
71297
  } }
71160
71298
  });
71161
- var useStreamMultiYields = (yieldIds) => {
71299
+ var useStreamYieldSummaries = (yieldIds) => {
71162
71300
  const $ = c(16);
71163
71301
  const { network, isConnected, isLedgerLive } = useSKWallet();
71164
71302
  const apiClient = useApiClient();
@@ -71192,7 +71330,7 @@ var useStreamMultiYields = (yieldIds) => {
71192
71330
  let t4;
71193
71331
  if ($[8] !== argsRef || $[9] !== hashedKey || $[10] !== validatorsConfig || $[11] !== yieldIds) {
71194
71332
  t3 = () => {
71195
- const sub = multipleYields$({
71333
+ const sub = multipleYieldSummaries$({
71196
71334
  ...argsRef.current,
71197
71335
  yieldIds,
71198
71336
  validatorsConfig
@@ -71315,9 +71453,19 @@ var multipleYields$ = (args) => args.yieldIds.length === 0 ? EMPTY : from$1(getY
71315
71453
  network: args.network,
71316
71454
  isLedgerLive: args.isLedgerLive
71317
71455
  }).length > 0)));
71456
+ var multipleYieldSummaries$ = (args) => args.yieldIds.length === 0 ? EMPTY : from$1(fetchYieldSummariesWithProvidersByIds({
71457
+ apiClient: args.apiClient,
71458
+ queryClient: args.queryClient,
71459
+ yieldIds: args.yieldIds
71460
+ })).pipe(mergeMap((v) => from$1(v)), filter$3((v) => !!(v && defaultFiltered({
71461
+ data: [v],
71462
+ isConnected: args.isConnected,
71463
+ network: args.network,
71464
+ isLedgerLive: args.isLedgerLive
71465
+ }).length > 0)));
71318
71466
  var firstEligibleYield$ = (args) => {
71319
71467
  let defaultYield = null;
71320
- const successStream = multipleYields$(args).pipe(tap$3((v) => {
71468
+ const successStream = multipleYieldSummaries$(args).pipe(tap$3((v) => {
71321
71469
  if (isNonZeroRewardRateYield(v) || !defaultYield) defaultYield = v;
71322
71470
  }), filter$3((y) => {
71323
71471
  const preferredYieldId = Maybe.fromNullable(args.preferredTokenYieldsPerNetwork?.[y.token.network]?.[tokenString(y.token)]).altLazy(() => Maybe.fromNullable(args.preferredTokenYieldsPerNetwork).chainNullable((v) => Object.values(v)[0][tokenString(y.token)])).extractNullable();
@@ -71328,11 +71476,20 @@ var firstEligibleYield$ = (args) => {
71328
71476
  tokenBalanceAmount: args.tokenBalanceAmount,
71329
71477
  positionsData: args.positionsData
71330
71478
  });
71331
- }), take(1), defaultIfEmpty(null));
71479
+ }), take(1), defaultIfEmpty(null), mergeMap((yieldSummary) => {
71480
+ const selectedYield = yieldSummary ?? defaultYield;
71481
+ if (!selectedYield) return of$1(null);
71482
+ return from$1(getYieldOpportunityFromSummary({
71483
+ isLedgerLive: args.isLedgerLive,
71484
+ yieldDto: selectedYield,
71485
+ queryClient: args.queryClient,
71486
+ apiClient: args.apiClient
71487
+ })).pipe(map$6((v) => v.isRight() ? v.extract() : null));
71488
+ }));
71332
71489
  return new Observable((subscriber) => {
71333
71490
  successStream.subscribe({
71334
71491
  complete: () => subscriber.complete(),
71335
- next: (v) => subscriber.next(v ?? defaultYield),
71492
+ next: (v) => subscriber.next(v),
71336
71493
  error: (e) => subscriber.error(e)
71337
71494
  });
71338
71495
  });
@@ -82641,7 +82798,7 @@ var useLogout = () => {
82641
82798
  let t0;
82642
82799
  if ($[0] !== disconnect) {
82643
82800
  t0 = { mutationFn: async () => {
82644
- await EitherAsync(disconnect).chain(_temp2$59).ifRight(_temp4$25);
82801
+ await EitherAsync(disconnect).chain(_temp2$58).ifRight(_temp4$25);
82645
82802
  return null;
82646
82803
  } };
82647
82804
  $[0] = disconnect;
@@ -82652,14 +82809,14 @@ var useLogout = () => {
82652
82809
  function _temp$92() {
82653
82810
  return indexedDB.databases();
82654
82811
  }
82655
- function _temp2$59() {
82812
+ function _temp2$58() {
82656
82813
  return EitherAsync(_temp$92);
82657
82814
  }
82658
- function _temp3$39(db) {
82815
+ function _temp3$38(db) {
82659
82816
  return db.name && indexedDB.deleteDatabase(db.name);
82660
82817
  }
82661
82818
  function _temp4$25(dbs) {
82662
- return dbs.forEach(_temp3$39);
82819
+ return dbs.forEach(_temp3$38);
82663
82820
  }
82664
82821
  //#endregion
82665
82822
  //#region src/hooks/use-sync-element-height.ts
@@ -83377,7 +83534,7 @@ var PendingCompletePage = () => {
83377
83534
  useTrackPage("pendingActionCompelete");
83378
83535
  let t5;
83379
83536
  if ($[9] !== positionBalances.data) {
83380
- t5 = positionBalances.data.map(_temp2$58);
83537
+ t5 = positionBalances.data.map(_temp2$57);
83381
83538
  $[9] = positionBalances.data;
83382
83539
  $[10] = t5;
83383
83540
  } else t5 = $[10];
@@ -83400,7 +83557,7 @@ var PendingCompletePage = () => {
83400
83557
  const providerDetails = useProvidersDetails(t7);
83401
83558
  let t8;
83402
83559
  if ($[15] !== integrationData) {
83403
- t8 = integrationData.map(_temp3$38);
83560
+ t8 = integrationData.map(_temp3$37);
83404
83561
  $[15] = integrationData;
83405
83562
  $[16] = t8;
83406
83563
  } else t8 = $[16];
@@ -83414,7 +83571,7 @@ var PendingCompletePage = () => {
83414
83571
  const network = t9;
83415
83572
  let t10;
83416
83573
  if ($[19] !== pendingRequest.requestDto.arguments?.amount) {
83417
- t10 = () => Maybe.fromNullable(pendingRequest.requestDto.arguments?.amount).map(_temp5$18).mapOrDefault(_temp6$14, "");
83574
+ t10 = () => Maybe.fromNullable(pendingRequest.requestDto.arguments?.amount).map(_temp5$18).mapOrDefault(_temp6$13, "");
83418
83575
  $[19] = pendingRequest.requestDto.arguments?.amount;
83419
83576
  $[20] = t10;
83420
83577
  } else t10 = $[20];
@@ -83429,7 +83586,7 @@ var PendingCompletePage = () => {
83429
83586
  const t12 = useYieldType(integrationData);
83430
83587
  let t13;
83431
83588
  if ($[23] !== t12) {
83432
- t13 = t12.map(_temp7$10);
83589
+ t13 = t12.map(_temp7$9);
83433
83590
  $[23] = t12;
83434
83591
  $[24] = t13;
83435
83592
  } else t13 = $[24];
@@ -83461,10 +83618,10 @@ var PendingCompletePage = () => {
83461
83618
  function _temp$90(state) {
83462
83619
  return state.context.data;
83463
83620
  }
83464
- function _temp2$58(p) {
83621
+ function _temp2$57(p) {
83465
83622
  return p.type === "validators" ? p.validators : [];
83466
83623
  }
83467
- function _temp3$38(yieldDto) {
83624
+ function _temp3$37(yieldDto) {
83468
83625
  return {
83469
83626
  logoURI: yieldDto.metadata.logoURI,
83470
83627
  name: yieldDto.metadata.name,
@@ -83477,10 +83634,10 @@ function _temp4$24(t) {
83477
83634
  function _temp5$18(val) {
83478
83635
  return new BigNumber(val ?? 0);
83479
83636
  }
83480
- function _temp6$14(v) {
83637
+ function _temp6$13(v) {
83481
83638
  return defaultFormattedNumber(v);
83482
83639
  }
83483
- function _temp7$10(v_0) {
83640
+ function _temp7$9(v_0) {
83484
83641
  return v_0.type;
83485
83642
  }
83486
83643
  //#endregion
@@ -83547,14 +83704,14 @@ var StakeCompletePage = () => {
83547
83704
  const selectedToken = t3;
83548
83705
  let t4;
83549
83706
  if ($[6] !== selectedStake) {
83550
- t4 = selectedStake.map(_temp2$57);
83707
+ t4 = selectedStake.map(_temp2$56);
83551
83708
  $[6] = selectedStake;
83552
83709
  $[7] = t4;
83553
83710
  } else t4 = $[7];
83554
83711
  const metadata = t4;
83555
83712
  let t5;
83556
83713
  if ($[8] !== selectedToken) {
83557
- t5 = selectedToken.mapOrDefault(_temp3$37, "");
83714
+ t5 = selectedToken.mapOrDefault(_temp3$36, "");
83558
83715
  $[8] = selectedToken;
83559
83716
  $[9] = t5;
83560
83717
  } else t5 = $[9];
@@ -83633,14 +83790,14 @@ var StakeCompletePage = () => {
83633
83790
  function _temp$89(state) {
83634
83791
  return state.context.data;
83635
83792
  }
83636
- function _temp2$57(yieldDto) {
83793
+ function _temp2$56(yieldDto) {
83637
83794
  return {
83638
83795
  logoURI: yieldDto.metadata.logoURI,
83639
83796
  name: yieldDto.metadata.name,
83640
83797
  provider: yieldDto.provider
83641
83798
  };
83642
83799
  }
83643
- function _temp3$37(y) {
83800
+ function _temp3$36(y) {
83644
83801
  return y.symbol;
83645
83802
  }
83646
83803
  function _temp4$23(v) {
@@ -83715,7 +83872,7 @@ var UnstakeCompletePage = () => {
83715
83872
  useTrackPage("unstakeComplete");
83716
83873
  let t4;
83717
83874
  if ($[7] !== positionBalances.data) {
83718
- t4 = positionBalances.data.map(_temp2$56);
83875
+ t4 = positionBalances.data.map(_temp2$55);
83719
83876
  $[7] = positionBalances.data;
83720
83877
  $[8] = t4;
83721
83878
  } else t4 = $[8];
@@ -83745,7 +83902,7 @@ var UnstakeCompletePage = () => {
83745
83902
  const token = t7;
83746
83903
  let t8;
83747
83904
  if ($[15] !== integrationData) {
83748
- t8 = integrationData.map(_temp3$36);
83905
+ t8 = integrationData.map(_temp3$35);
83749
83906
  $[15] = integrationData;
83750
83907
  $[16] = t8;
83751
83908
  } else t8 = $[16];
@@ -83804,10 +83961,10 @@ var UnstakeCompletePage = () => {
83804
83961
  function _temp$88(state) {
83805
83962
  return state.context.data;
83806
83963
  }
83807
- function _temp2$56(p) {
83964
+ function _temp2$55(p) {
83808
83965
  return p.type === "validators" ? p.validators : [];
83809
83966
  }
83810
- function _temp3$36(yieldDto) {
83967
+ function _temp3$35(yieldDto) {
83811
83968
  return {
83812
83969
  logoURI: yieldDto.metadata.logoURI,
83813
83970
  name: yieldDto.metadata.name,
@@ -83869,6 +84026,110 @@ var mapKycStatusToGate = ({ status, yieldDto }) => {
83869
84026
  };
83870
84027
  var isKycGateBlocking = (gate) => gate.state !== "pass";
83871
84028
  //#endregion
84029
+ //#region src/hooks/api/use-dashboard-yield-catalog.ts
84030
+ var staleTime$2 = 1e3 * 60 * 2;
84031
+ /**
84032
+ * Discovers available dashboard earn categories with one network-scoped,
84033
+ * reward-rate-sorted probe per category (no dependency on the wallet's token
84034
+ * holdings, no per-yield legacy hydration). The first visible summary of each
84035
+ * probe seeds that category's initial token + yield selection.
84036
+ */
84037
+ var useDashboardYieldCatalog = (t0) => {
84038
+ const $ = c(18);
84039
+ let t1;
84040
+ if ($[0] !== t0) {
84041
+ t1 = t0 === void 0 ? {} : t0;
84042
+ $[0] = t0;
84043
+ $[1] = t1;
84044
+ } else t1 = $[1];
84045
+ const { enabled: t2, network } = t1;
84046
+ const enabled = t2 === void 0 ? true : t2;
84047
+ const { network: walletNetwork } = useSKWallet();
84048
+ const apiClient = useApiClient();
84049
+ const catalogNetwork = network === null ? null : network ?? walletNetwork;
84050
+ const probeEnabled = enabled && (network === null || !!catalogNetwork);
84051
+ let t3;
84052
+ if ($[2] !== apiClient || $[3] !== catalogNetwork || $[4] !== probeEnabled) {
84053
+ t3 = dashboardYieldCategories.map((category) => {
84054
+ const params = {
84055
+ ...catalogNetwork ? { network: catalogNetwork } : {},
84056
+ types: getApiYieldTypesForDashboardCategory(category),
84057
+ sort: "rewardRateDesc",
84058
+ limit: 50
84059
+ };
84060
+ return {
84061
+ enabled: probeEnabled,
84062
+ staleTime: staleTime$2,
84063
+ queryKey: getYieldSummariesQueryKey(params),
84064
+ queryFn: (t4) => {
84065
+ const { signal } = t4;
84066
+ return fetchYieldSummariesPage({
84067
+ apiClient,
84068
+ params,
84069
+ signal
84070
+ });
84071
+ }
84072
+ };
84073
+ });
84074
+ $[2] = apiClient;
84075
+ $[3] = catalogNetwork;
84076
+ $[4] = probeEnabled;
84077
+ $[5] = t3;
84078
+ } else t3 = $[5];
84079
+ let t4;
84080
+ if ($[6] !== t3) {
84081
+ t4 = { queries: t3 };
84082
+ $[6] = t3;
84083
+ $[7] = t4;
84084
+ } else t4 = $[7];
84085
+ const results = useQueries(t4);
84086
+ let availableCategories;
84087
+ let initialSelectionByCategory;
84088
+ if ($[8] !== results) {
84089
+ initialSelectionByCategory = /* @__PURE__ */ new Map();
84090
+ availableCategories = [];
84091
+ dashboardYieldCategories.forEach((category_0, index) => {
84092
+ const firstVisible = (results[index]?.data ?? []).find(isVisibleYieldSummary);
84093
+ if (!firstVisible) return;
84094
+ availableCategories.push(category_0);
84095
+ initialSelectionByCategory.set(category_0, {
84096
+ token: firstVisible.token,
84097
+ yieldDto: firstVisible,
84098
+ yieldId: firstVisible.id
84099
+ });
84100
+ });
84101
+ $[8] = results;
84102
+ $[9] = availableCategories;
84103
+ $[10] = initialSelectionByCategory;
84104
+ } else {
84105
+ availableCategories = $[9];
84106
+ initialSelectionByCategory = $[10];
84107
+ }
84108
+ let t5;
84109
+ if ($[11] !== probeEnabled || $[12] !== results) {
84110
+ t5 = probeEnabled && results.some(_temp$87);
84111
+ $[11] = probeEnabled;
84112
+ $[12] = results;
84113
+ $[13] = t5;
84114
+ } else t5 = $[13];
84115
+ let t6;
84116
+ if ($[14] !== availableCategories || $[15] !== initialSelectionByCategory || $[16] !== t5) {
84117
+ t6 = {
84118
+ availableCategories,
84119
+ initialSelectionByCategory,
84120
+ isLoading: t5
84121
+ };
84122
+ $[14] = availableCategories;
84123
+ $[15] = initialSelectionByCategory;
84124
+ $[16] = t5;
84125
+ $[17] = t6;
84126
+ } else t6 = $[17];
84127
+ return t6;
84128
+ };
84129
+ function _temp$87(result) {
84130
+ return result.isLoading;
84131
+ }
84132
+ //#endregion
83872
84133
  //#region src/hooks/api/use-default-tokens.ts
83873
84134
  var getTokenGetTokensQueryKey = (params) => ["/v1/tokens", ...params ? [params] : []];
83874
84135
  var useDefaultTokens = () => {
@@ -84024,6 +84285,15 @@ var getTokenTokenBalancesScanQueryKey = (tokenBalanceScanDto) => {
84024
84285
  return ["/v1/tokens/balances/scan", tokenBalanceScanDto];
84025
84286
  };
84026
84287
  //#endregion
84288
+ //#region src/hooks/api/use-token-list-yields.ts
84289
+ var getDashboardCategoryYieldIdsForToken = (availableYieldIds, yieldsById, category) => availableYieldIds.filter((id) => {
84290
+ const yieldDto = yieldsById.get(id);
84291
+ return !!yieldDto && isVisibleYieldSummary(yieldDto) && getDashboardYieldCategoryForApiYieldType(yieldDto.mechanics.type) === category;
84292
+ }).sort((a, b) => {
84293
+ const left = yieldsById.get(a)?.rewardRate?.total ?? 0;
84294
+ return (yieldsById.get(b)?.rewardRate?.total ?? 0) - left;
84295
+ });
84296
+ //#endregion
84027
84297
  //#region src/utils/mappers.ts
84028
84298
  var priceDtoToPrice = (priceDto) => ({
84029
84299
  price: priceDto.price,
@@ -84079,14 +84349,14 @@ var useTokensPrices = (t0) => {
84079
84349
  t1 = Maybe.fromRecord({
84080
84350
  yieldDto,
84081
84351
  token
84082
- }).map(_temp$87).extractNullable();
84352
+ }).map(_temp$86).extractNullable();
84083
84353
  $[0] = token;
84084
84354
  $[1] = yieldDto;
84085
84355
  $[2] = t1;
84086
84356
  } else t1 = $[2];
84087
84357
  return usePrices(t1);
84088
84358
  };
84089
- function _temp$87(val) {
84359
+ function _temp$86(val) {
84090
84360
  return {
84091
84361
  currency: config.currency,
84092
84362
  tokenList: [
@@ -84149,7 +84419,7 @@ var useYieldKycGate = (t0) => {
84149
84419
  };
84150
84420
  //#endregion
84151
84421
  //#region src/hooks/api/use-yield-opportunity/index.ts
84152
- var staleTime$2 = 1e3 * 60 * 2;
84422
+ var staleTime$1 = 1e3 * 60 * 2;
84153
84423
  var getKey = (params) => [
84154
84424
  "yield-opportunity",
84155
84425
  params.yieldId,
@@ -84199,7 +84469,7 @@ var useYieldOpportunity = (integrationId) => {
84199
84469
  t3 = {
84200
84470
  queryKey: t0,
84201
84471
  enabled: t1,
84202
- staleTime: staleTime$2,
84472
+ staleTime: staleTime$1,
84203
84473
  queryFn: t2
84204
84474
  };
84205
84475
  $[10] = t0;
@@ -84463,7 +84733,7 @@ var useYieldValidators = (t0) => {
84463
84733
  ...t3,
84464
84734
  enabled: t4,
84465
84735
  placeholderData: keepPreviousData,
84466
- select: _temp2$55
84736
+ select: _temp2$54
84467
84737
  };
84468
84738
  $[7] = t3;
84469
84739
  $[8] = t4;
@@ -84471,11 +84741,11 @@ var useYieldValidators = (t0) => {
84471
84741
  } else t5 = $[9];
84472
84742
  return useInfiniteQuery(t5);
84473
84743
  };
84474
- function _temp$86(page) {
84744
+ function _temp$85(page) {
84475
84745
  return page.validators;
84476
84746
  }
84477
- function _temp2$55(data) {
84478
- return data.pages.flatMap(_temp$86);
84747
+ function _temp2$54(data) {
84748
+ return data.pages.flatMap(_temp$85);
84479
84749
  }
84480
84750
  //#endregion
84481
84751
  //#region src/hooks/navigation/use-navigate-with-scroll-to-top.ts
@@ -84594,7 +84864,7 @@ var useEstimatedRewards = (t0) => {
84594
84864
  $[12] = stakeAmount;
84595
84865
  $[13] = t5;
84596
84866
  } else t5 = $[13];
84597
- t3 = selectedStake.filter(_temp$85).chain(t4).chainNullable(_temp2$54).map(t5).orDefault(stakeAmount);
84867
+ t3 = selectedStake.filter(_temp$84).chain(t4).chainNullable(_temp2$53).map(t5).orDefault(stakeAmount);
84598
84868
  $[6] = selectedStake;
84599
84869
  $[7] = selectedValidators;
84600
84870
  $[8] = stakeAmount;
@@ -84626,19 +84896,19 @@ var useEstimatedRewards = (t0) => {
84626
84896
  } else t4 = $[17];
84627
84897
  return t4;
84628
84898
  };
84629
- function _temp$85(val) {
84899
+ function _temp$84(val) {
84630
84900
  return isBittensorStaking(val.id);
84631
84901
  }
84632
- function _temp2$54(validator) {
84902
+ function _temp2$53(validator) {
84633
84903
  return validator.subnet?.pricePerShare;
84634
84904
  }
84635
- function _temp3$35(acc, val_1) {
84905
+ function _temp3$34(acc, val_1) {
84636
84906
  return acc.plus(new BigNumber(val_1.rewardRate ?? 0));
84637
84907
  }
84638
84908
  function _temp4$21(val_0) {
84639
84909
  return {
84640
84910
  ...val_0,
84641
- rewardRateAverage: val_0.providersDetails.reduce(_temp3$35, new BigNumber(0)).dividedBy(val_0.providersDetails.length)
84911
+ rewardRateAverage: val_0.providersDetails.reduce(_temp3$34, new BigNumber(0)).dividedBy(val_0.providersDetails.length)
84642
84912
  };
84643
84913
  }
84644
84914
  //#endregion
@@ -84704,7 +84974,7 @@ var useMaxMinYieldAmount = (t0) => {
84704
84974
  const isForceMax = useForceMaxAmount(t1);
84705
84975
  let t2;
84706
84976
  if ($[3] !== availableAmount || $[4] !== isForceMax || $[5] !== positionsData || $[6] !== pricePerShare || $[7] !== type || $[8] !== yieldOpportunity) {
84707
- t2 = isForceMax ? availableAmount : yieldOpportunity.chainNullable((y) => type === "enter" ? getMinStakeAmount(y, positionsData) : getMinUnstakeAmount(y, pricePerShare)).map(_temp$84);
84977
+ t2 = isForceMax ? availableAmount : yieldOpportunity.chainNullable((y) => type === "enter" ? getMinStakeAmount(y, positionsData) : getMinUnstakeAmount(y, pricePerShare)).map(_temp$83);
84708
84978
  $[3] = availableAmount;
84709
84979
  $[4] = isForceMax;
84710
84980
  $[5] = positionsData;
@@ -84716,7 +84986,7 @@ var useMaxMinYieldAmount = (t0) => {
84716
84986
  const minIntegrationAmount = t2;
84717
84987
  let t3;
84718
84988
  if ($[10] !== availableAmount || $[11] !== isForceMax || $[12] !== type || $[13] !== yieldOpportunity) {
84719
- t3 = isForceMax ? availableAmount : yieldOpportunity.chainNullable((y_0) => getYieldActionArg(y_0, type, "amount")?.maximum).map(_temp2$53).filter(_temp3$34);
84989
+ t3 = isForceMax ? availableAmount : yieldOpportunity.chainNullable((y_0) => getYieldActionArg(y_0, type, "amount")?.maximum).map(_temp2$52).filter(_temp3$33);
84720
84990
  $[10] = availableAmount;
84721
84991
  $[11] = isForceMax;
84722
84992
  $[12] = type;
@@ -84761,13 +85031,13 @@ var useMaxMinYieldAmount = (t0) => {
84761
85031
  } else t6 = $[25];
84762
85032
  return t6;
84763
85033
  };
84764
- function _temp$84(a) {
85034
+ function _temp$83(a) {
84765
85035
  return new BigNumber(a);
84766
85036
  }
84767
- function _temp2$53(a_0) {
85037
+ function _temp2$52(a_0) {
84768
85038
  return new BigNumber(a_0);
84769
85039
  }
84770
- function _temp3$34(v) {
85040
+ function _temp3$33(v) {
84771
85041
  return v.isGreaterThan(0);
84772
85042
  }
84773
85043
  //#endregion
@@ -84802,19 +85072,19 @@ var useRewardTokenDetails = (yieldOpportunity) => {
84802
85072
  const $ = c(2);
84803
85073
  let t0;
84804
85074
  if ($[0] !== yieldOpportunity) {
84805
- t0 = yieldOpportunity.chain(_temp$83).map(_temp2$52);
85075
+ t0 = yieldOpportunity.chain(_temp$82).map(_temp2$51);
84806
85076
  $[0] = yieldOpportunity;
84807
85077
  $[1] = t0;
84808
85078
  } else t0 = $[1];
84809
85079
  return t0;
84810
85080
  };
84811
- function _temp$83(y) {
85081
+ function _temp$82(y) {
84812
85082
  return Maybe.fromNullable(y.provider).map((p) => ({
84813
85083
  p,
84814
85084
  rt: getYieldRewardTokens(y)
84815
85085
  }));
84816
85086
  }
84817
- function _temp2$52(t0) {
85087
+ function _temp2$51(t0) {
84818
85088
  const { p: p_0, rt } = t0;
84819
85089
  return {
84820
85090
  logoUri: p_0.logoURI ?? null,
@@ -85067,17 +85337,17 @@ var useAmountValidation = (t0) => {
85067
85337
  //#endregion
85068
85338
  //#region src/pages/details/earn-page/state/use-get-token-balances-map.ts
85069
85339
  var useGetTokenBalancesMap = () => {
85070
- return _temp3$33;
85340
+ return _temp3$32;
85071
85341
  };
85072
- function _temp$82(v) {
85342
+ function _temp$81(v) {
85073
85343
  return [tokenString(v.token), v];
85074
85344
  }
85075
- function _temp2$51(v_0) {
85345
+ function _temp2$50(v_0) {
85076
85346
  return [tokenString(v_0.token), v_0];
85077
85347
  }
85078
- function _temp3$33(t0) {
85348
+ function _temp3$32(t0) {
85079
85349
  const { defaultTokens, tokenBalancesScan } = t0;
85080
- return new Map([...(defaultTokens ?? []).map(_temp$82), ...(tokenBalancesScan ?? []).map(_temp2$51)]);
85350
+ return new Map([...(defaultTokens ?? []).map(_temp$81), ...(tokenBalancesScan ?? []).map(_temp2$50)]);
85081
85351
  }
85082
85352
  //#endregion
85083
85353
  //#region src/pages/details/earn-page/state/use-token-balances-map.ts
@@ -85358,14 +85628,14 @@ var useTokenBalance = (t0) => {
85358
85628
  const tokenBalance = t1;
85359
85629
  let t2;
85360
85630
  if ($[5] !== tokenBalance) {
85361
- t2 = tokenBalance.map(_temp$81);
85631
+ t2 = tokenBalance.map(_temp$80);
85362
85632
  $[5] = tokenBalance;
85363
85633
  $[6] = t2;
85364
85634
  } else t2 = $[6];
85365
85635
  const availableAmount = t2;
85366
85636
  let t3;
85367
85637
  if ($[7] !== tokenBalance) {
85368
- t3 = tokenBalance.map(_temp2$50);
85638
+ t3 = tokenBalance.map(_temp2$49);
85369
85639
  $[7] = tokenBalance;
85370
85640
  $[8] = t3;
85371
85641
  } else t3 = $[8];
@@ -85384,10 +85654,10 @@ var useTokenBalance = (t0) => {
85384
85654
  } else t4 = $[12];
85385
85655
  return t4;
85386
85656
  };
85387
- function _temp$81(v) {
85657
+ function _temp$80(v) {
85388
85658
  return new BigNumber(v.amount);
85389
85659
  }
85390
- function _temp2$50(v_0) {
85660
+ function _temp2$49(v_0) {
85391
85661
  return v_0.availableYields;
85392
85662
  }
85393
85663
  //#endregion
@@ -85472,6 +85742,7 @@ var EarnPageStateUsageBoundaryProvider = (t0) => {
85472
85742
  var getInitialState$1 = () => ({
85473
85743
  selectedToken: Maybe.empty(),
85474
85744
  selectedStakeId: Maybe.empty(),
85745
+ autoSelectYield: true,
85475
85746
  selectedValidators: /* @__PURE__ */ new Map(),
85476
85747
  stakeAmount: new BigNumber(0),
85477
85748
  useMaxAmount: false,
@@ -85479,7 +85750,7 @@ var getInitialState$1 = () => ({
85479
85750
  selectedProviderYieldId: Maybe.empty()
85480
85751
  });
85481
85752
  var EarnPageStateProvider = (t0) => {
85482
- const $ = c(94);
85753
+ const $ = c(98);
85483
85754
  const { children } = t0;
85484
85755
  const { network, isConnected } = useSKWallet();
85485
85756
  const getInitYield = useGetInitYield();
@@ -85488,13 +85759,26 @@ var EarnPageStateProvider = (t0) => {
85488
85759
  if ($[0] !== getInitYield || $[1] !== positionsData.data) {
85489
85760
  t1 = (state, action) => {
85490
85761
  switch (action.type) {
85491
- case "token/select": return Maybe.fromFalsy(state.selectedToken.map((v_0) => !equalTokens(v_0, action.data)).orDefault(true)).chain(() => getInitYield({ selectedToken: action.data }).map((val_0) => onYieldSelectState({
85492
- yieldDto: val_0,
85762
+ case "token/select": return Maybe.fromFalsy(state.selectedToken.map((v_3) => !equalTokens(v_3, action.data)).orDefault(true)).chain(() => getInitYield({ selectedToken: action.data }).map((val_1) => onYieldSelectState({
85763
+ yieldDto: val_1,
85493
85764
  positionsData: positionsData.data
85494
- })).alt(Maybe.of(null))).map((val_1) => ({
85765
+ })).alt(Maybe.of(null))).map((val_2) => ({
85495
85766
  ...getInitialState$1(),
85496
85767
  selectedToken: Maybe.of(action.data),
85497
- ...val_1
85768
+ ...val_2
85769
+ })).orDefault(state);
85770
+ case "token-only/select": return Maybe.fromFalsy(state.selectedToken.map((v_2) => !equalTokens(v_2, action.data)).orDefault(true) || state.selectedStakeId.isJust()).map(() => ({
85771
+ ...getInitialState$1(),
85772
+ selectedToken: Maybe.of(action.data),
85773
+ autoSelectYield: false
85774
+ })).orDefault(state);
85775
+ case "dashboard/token-yield/select": return Maybe.fromFalsy(state.selectedToken.map((v_1) => !equalTokens(v_1, action.data.token)).orDefault(true) || state.selectedStakeId.map((v_0) => v_0 !== action.data.yieldDto.id).orDefault(true)).map(() => onYieldSelectState({
85776
+ yieldDto: action.data.yieldDto,
85777
+ positionsData: positionsData.data
85778
+ })).map((val_0) => ({
85779
+ ...getInitialState$1(),
85780
+ selectedToken: Maybe.of(action.data.token),
85781
+ ...val_0
85498
85782
  })).orDefault(state);
85499
85783
  case "yield/select": return Maybe.fromFalsy(state.selectedStakeId.map((v) => v !== action.data.id).orDefault(true)).map(() => onYieldSelectState({
85500
85784
  yieldDto: action.data,
@@ -85563,7 +85847,7 @@ var EarnPageStateProvider = (t0) => {
85563
85847
  $[3] = t2;
85564
85848
  } else t2 = $[3];
85565
85849
  const [state_0, dispatch] = useReducer(reducer, t2);
85566
- const { selectedToken, selectedStakeId, selectedValidators: selectedValidators_1, stakeAmount: _stakeAmount, useMaxAmount, tronResource, selectedProviderYieldId } = state_0;
85850
+ const { selectedToken, selectedStakeId, autoSelectYield, selectedValidators: selectedValidators_1, stakeAmount: _stakeAmount, useMaxAmount, tronResource, selectedProviderYieldId } = state_0;
85567
85851
  const initTokenRes = useInitToken();
85568
85852
  let t3;
85569
85853
  if ($[4] !== initTokenRes.data) {
@@ -85740,104 +86024,113 @@ var EarnPageStateProvider = (t0) => {
85740
86024
  useEffect(t19, t20);
85741
86025
  let t21;
85742
86026
  let t22;
85743
- if ($[49] !== initYield || $[50] !== shouldWaitForPositionsData) {
86027
+ if ($[49] !== autoSelectYield || $[50] !== initYield || $[51] !== selectedStakeId || $[52] !== shouldWaitForPositionsData) {
85744
86028
  t21 = () => {
85745
86029
  if (shouldWaitForPositionsData) return;
85746
- initYield.ifJust(setYield);
86030
+ if (!autoSelectYield) return;
86031
+ selectedStakeId.ifNothing(() => initYield.ifJust(setYield));
85747
86032
  };
85748
86033
  t22 = [
86034
+ autoSelectYield,
85749
86035
  initYield,
86036
+ selectedStakeId,
85750
86037
  shouldWaitForPositionsData,
85751
86038
  setYield
85752
86039
  ];
85753
- $[49] = initYield;
85754
- $[50] = shouldWaitForPositionsData;
85755
- $[51] = t21;
85756
- $[52] = t22;
86040
+ $[49] = autoSelectYield;
86041
+ $[50] = initYield;
86042
+ $[51] = selectedStakeId;
86043
+ $[52] = shouldWaitForPositionsData;
86044
+ $[53] = t21;
86045
+ $[54] = t22;
85757
86046
  } else {
85758
- t21 = $[51];
85759
- t22 = $[52];
86047
+ t21 = $[53];
86048
+ t22 = $[54];
85760
86049
  }
85761
86050
  useEffect(t21, t22);
85762
86051
  let t23;
85763
86052
  let t24;
85764
- if ($[53] !== initYieldRef || $[54] !== selectedStakeId || $[55] !== shouldWaitForPositionsData) {
86053
+ if ($[55] !== autoSelectYield || $[56] !== initYieldRef || $[57] !== selectedStakeId || $[58] !== shouldWaitForPositionsData) {
85765
86054
  t23 = () => {
85766
86055
  if (shouldWaitForPositionsData) return;
86056
+ if (!autoSelectYield) return;
85767
86057
  selectedStakeId.ifNothing(() => initYieldRef.current.ifJust(setYield));
85768
86058
  };
85769
86059
  t24 = [
86060
+ autoSelectYield,
85770
86061
  initYieldRef,
85771
86062
  shouldWaitForPositionsData,
85772
86063
  selectedStakeId,
85773
86064
  setYield
85774
86065
  ];
85775
- $[53] = initYieldRef;
85776
- $[54] = selectedStakeId;
85777
- $[55] = shouldWaitForPositionsData;
85778
- $[56] = t23;
85779
- $[57] = t24;
86066
+ $[55] = autoSelectYield;
86067
+ $[56] = initYieldRef;
86068
+ $[57] = selectedStakeId;
86069
+ $[58] = shouldWaitForPositionsData;
86070
+ $[59] = t23;
86071
+ $[60] = t24;
85780
86072
  } else {
85781
- t23 = $[56];
85782
- t24 = $[57];
86073
+ t23 = $[59];
86074
+ t24 = $[60];
85783
86075
  }
85784
86076
  useEffect(t23, t24);
85785
86077
  let t25;
85786
86078
  let t26;
85787
- if ($[58] !== initToken || $[59] !== selectedToken) {
86079
+ if ($[61] !== initToken || $[62] !== selectedToken) {
85788
86080
  t25 = () => {
85789
86081
  initToken.ifNothing(() => selectedToken.ifJust(() => dispatch({ type: "state/reset" })));
85790
86082
  };
85791
86083
  t26 = [initToken, selectedToken];
85792
- $[58] = initToken;
85793
- $[59] = selectedToken;
85794
- $[60] = t25;
85795
- $[61] = t26;
86084
+ $[61] = initToken;
86085
+ $[62] = selectedToken;
86086
+ $[63] = t25;
86087
+ $[64] = t26;
85796
86088
  } else {
85797
- t25 = $[60];
85798
- t26 = $[61];
86089
+ t25 = $[63];
86090
+ t26 = $[64];
85799
86091
  }
85800
86092
  useEffect(t25, t26);
85801
86093
  let t27;
85802
- if ($[62] !== initToken || $[63] !== initYield) {
86094
+ if ($[65] !== initToken || $[66] !== initYield) {
85803
86095
  t27 = {
85804
86096
  initToken,
85805
86097
  initYield
85806
86098
  };
85807
- $[62] = initToken;
85808
- $[63] = initYield;
85809
- $[64] = t27;
85810
- } else t27 = $[64];
86099
+ $[65] = initToken;
86100
+ $[66] = initYield;
86101
+ $[67] = t27;
86102
+ } else t27 = $[67];
85811
86103
  useTrackStateEvents(t27);
85812
86104
  let t28;
85813
- if ($[65] !== maxEnterOrExitAmount) {
86105
+ if ($[68] !== maxEnterOrExitAmount) {
85814
86106
  t28 = { onMaxClick: () => dispatch({
85815
86107
  type: "stakeAmount/max",
85816
86108
  data: maxEnterOrExitAmount
85817
86109
  }) };
85818
- $[65] = maxEnterOrExitAmount;
85819
- $[66] = t28;
85820
- } else t28 = $[66];
86110
+ $[68] = maxEnterOrExitAmount;
86111
+ $[69] = t28;
86112
+ } else t28 = $[69];
85821
86113
  const actions = t28;
85822
86114
  let t29;
85823
- if ($[67] !== availableAmount || $[68] !== maxEnterOrExitAmount || $[69] !== minEnterOrExitAmount || $[70] !== stakeAmount) {
86115
+ if ($[70] !== availableAmount || $[71] !== maxEnterOrExitAmount || $[72] !== minEnterOrExitAmount || $[73] !== stakeAmount) {
85824
86116
  t29 = {
85825
86117
  availableAmount,
85826
86118
  stakeAmount,
85827
86119
  maxEnterOrExitAmount,
85828
86120
  minEnterOrExitAmount
85829
86121
  };
85830
- $[67] = availableAmount;
85831
- $[68] = maxEnterOrExitAmount;
85832
- $[69] = minEnterOrExitAmount;
85833
- $[70] = stakeAmount;
85834
- $[71] = t29;
85835
- } else t29 = $[71];
86122
+ $[70] = availableAmount;
86123
+ $[71] = maxEnterOrExitAmount;
86124
+ $[72] = minEnterOrExitAmount;
86125
+ $[73] = stakeAmount;
86126
+ $[74] = t29;
86127
+ } else t29 = $[74];
85836
86128
  const { stakeAmountGreaterThanAvailableAmount, stakeAmountGreaterThanMax, stakeAmountLessThanMin, stakeAmountIsZero } = useAmountValidation(t29);
85837
86129
  let t30;
85838
- if ($[72] !== actions || $[73] !== availableAmount || $[74] !== availableYields || $[75] !== hasNotYieldsForToken || $[76] !== selectedProviderYieldId || $[77] !== selectedStake || $[78] !== selectedStakeId || $[79] !== selectedToken || $[80] !== selectedValidators_1 || $[81] !== stakeAmount || $[82] !== stakeAmountGreaterThanAvailableAmount || $[83] !== stakeAmountGreaterThanMax || $[84] !== stakeAmountIsZero || $[85] !== stakeAmountLessThanMin || $[86] !== tronResource || $[87] !== useMaxAmount) {
86130
+ if ($[75] !== actions || $[76] !== autoSelectYield || $[77] !== availableAmount || $[78] !== availableYields || $[79] !== hasNotYieldsForToken || $[80] !== selectedProviderYieldId || $[81] !== selectedStake || $[82] !== selectedStakeId || $[83] !== selectedToken || $[84] !== selectedValidators_1 || $[85] !== stakeAmount || $[86] !== stakeAmountGreaterThanAvailableAmount || $[87] !== stakeAmountGreaterThanMax || $[88] !== stakeAmountIsZero || $[89] !== stakeAmountLessThanMin || $[90] !== tronResource || $[91] !== useMaxAmount) {
85839
86131
  t30 = {
85840
86132
  selectedStakeId,
86133
+ autoSelectYield,
85841
86134
  selectedStake,
85842
86135
  selectedValidators: selectedValidators_1,
85843
86136
  stakeAmount,
@@ -85854,44 +86147,45 @@ var EarnPageStateProvider = (t0) => {
85854
86147
  hasNotYieldsForToken,
85855
86148
  selectedProviderYieldId
85856
86149
  };
85857
- $[72] = actions;
85858
- $[73] = availableAmount;
85859
- $[74] = availableYields;
85860
- $[75] = hasNotYieldsForToken;
85861
- $[76] = selectedProviderYieldId;
85862
- $[77] = selectedStake;
85863
- $[78] = selectedStakeId;
85864
- $[79] = selectedToken;
85865
- $[80] = selectedValidators_1;
85866
- $[81] = stakeAmount;
85867
- $[82] = stakeAmountGreaterThanAvailableAmount;
85868
- $[83] = stakeAmountGreaterThanMax;
85869
- $[84] = stakeAmountIsZero;
85870
- $[85] = stakeAmountLessThanMin;
85871
- $[86] = tronResource;
85872
- $[87] = useMaxAmount;
85873
- $[88] = t30;
85874
- } else t30 = $[88];
86150
+ $[75] = actions;
86151
+ $[76] = autoSelectYield;
86152
+ $[77] = availableAmount;
86153
+ $[78] = availableYields;
86154
+ $[79] = hasNotYieldsForToken;
86155
+ $[80] = selectedProviderYieldId;
86156
+ $[81] = selectedStake;
86157
+ $[82] = selectedStakeId;
86158
+ $[83] = selectedToken;
86159
+ $[84] = selectedValidators_1;
86160
+ $[85] = stakeAmount;
86161
+ $[86] = stakeAmountGreaterThanAvailableAmount;
86162
+ $[87] = stakeAmountGreaterThanMax;
86163
+ $[88] = stakeAmountIsZero;
86164
+ $[89] = stakeAmountLessThanMin;
86165
+ $[90] = tronResource;
86166
+ $[91] = useMaxAmount;
86167
+ $[92] = t30;
86168
+ } else t30 = $[92];
85875
86169
  const value = t30;
85876
86170
  let t31;
85877
- if ($[89] !== children) {
86171
+ if ($[93] !== children) {
85878
86172
  t31 = /* @__PURE__ */ jsx(EarnPageDispatchContext.Provider, {
85879
86173
  value: dispatch,
85880
86174
  children
85881
86175
  });
85882
- $[89] = children;
85883
- $[90] = t31;
85884
- } else t31 = $[90];
86176
+ $[93] = children;
86177
+ $[94] = t31;
86178
+ } else t31 = $[94];
85885
86179
  let t32;
85886
- if ($[91] !== t31 || $[92] !== value) {
86180
+ if ($[95] !== t31 || $[96] !== value) {
85887
86181
  t32 = /* @__PURE__ */ jsx(EarnPageStateContext.Provider, {
85888
86182
  value,
85889
86183
  children: t31
85890
86184
  });
85891
- $[91] = t31;
85892
- $[92] = value;
85893
- $[93] = t32;
85894
- } else t32 = $[93];
86185
+ $[95] = t31;
86186
+ $[96] = value;
86187
+ $[97] = t32;
86188
+ } else t32 = $[97];
85895
86189
  return t32;
85896
86190
  };
85897
86191
  var useUsageCheck = () => {
@@ -86063,16 +86357,15 @@ var useStakeEnterRequestDto = () => {
86063
86357
  const validators = [...selectedValidators.values()];
86064
86358
  const providerIdRequired = !!getYieldActionArg(selectedStake_0, "enter", "providerId")?.required;
86065
86359
  const providerId = selectedProviderYieldId.extract();
86066
- if (providerIdRequired && !providerId && !isYieldIntegrationAggregator(selectedStake_0)) return Maybe.empty();
86067
- const selectedProviderArgs = isYieldIntegrationAggregator(selectedStake_0) ? {} : { providerId };
86360
+ if (providerIdRequired && !providerId) return Maybe.empty();
86361
+ const selectedProviderArgs = providerId ? { providerId } : {};
86068
86362
  return (() => {
86069
- if (isYieldIntegrationAggregator(selectedStake_0)) return List.head(validators).chainNullable(_temp$80).map(_temp2$49);
86070
- if (getYieldActionArg(selectedStake_0, "enter", "validatorAddresses")?.required) return validators.length > 0 ? Maybe.of({ validatorAddresses: validators.map(_temp3$32) }) : Maybe.empty();
86363
+ if (getYieldActionArg(selectedStake_0, "enter", "validatorAddresses")?.required) return validators.length > 0 ? Maybe.of({ validatorAddresses: validators.map(_temp$79) }) : Maybe.empty();
86071
86364
  const subnetIdRequired = !!getYieldActionArg(selectedStake_0, "enter", "subnetId")?.required;
86072
86365
  if (!!!getYieldActionArg(selectedStake_0, "enter", "validatorAddress")?.required && !subnetIdRequired) return Maybe.of({});
86073
- return List.head(validators).map((v_1) => ({
86074
- validatorAddress: v_1.address,
86075
- subnetId: subnetIdRequired ? v_1.subnet?.id : void 0
86366
+ return List.head(validators).map((v_0) => ({
86367
+ validatorAddress: v_0.address,
86368
+ subnetId: subnetIdRequired ? v_0.subnet?.id : void 0
86076
86369
  }));
86077
86370
  })().map((validatorsOrProvider_0) => ({
86078
86371
  selectedValidators,
@@ -86126,25 +86419,21 @@ var useStakeEnterRequestDto = () => {
86126
86419
  } else t0 = $[10];
86127
86420
  return t0;
86128
86421
  };
86129
- function _temp$80(v) {
86130
- return v.providerId;
86131
- }
86132
- function _temp2$49(providerId_0) {
86133
- return { providerId: providerId_0 };
86134
- }
86135
- function _temp3$32(v_0) {
86136
- return v_0.address;
86422
+ function _temp$79(v) {
86423
+ return v.address;
86137
86424
  }
86138
86425
  //#endregion
86139
86426
  //#region src/pages/details/earn-page/state/earn-page-context.tsx
86140
86427
  var EarnPageContext = createContext(void 0);
86141
86428
  var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86142
- const { actions: { onMaxClick: _onMaxClick }, selectedToken, selectedStakeId, selectedValidators, stakeAmount, selectedStake, tronResource, stakeAmountGreaterThanAvailableAmount, stakeAmountGreaterThanMax, stakeAmountLessThanMin, stakeAmountIsZero, availableAmount, availableYields, hasNotYieldsForToken, selectedProviderYieldId } = useEarnPageState();
86429
+ const { actions: { onMaxClick: _onMaxClick }, selectedToken, selectedStakeId, autoSelectYield, selectedValidators, stakeAmount, selectedStake, tronResource, stakeAmountGreaterThanAvailableAmount, stakeAmountGreaterThanMax, stakeAmountLessThanMin, stakeAmountIsZero, availableAmount, availableYields, hasNotYieldsForToken, selectedProviderYieldId } = useEarnPageState();
86143
86430
  const dispatch = useEarnPageDispatch();
86144
86431
  const { t } = useTranslation();
86145
86432
  const initParams = useInitParams();
86146
86433
  const { dashboardVariant, externalProviders, variant } = useSettings();
86147
- const { isConnected, isConnecting, isLedgerLiveAccountPlaceholder, chain } = useSKWallet();
86434
+ const { isConnected, isConnecting, isLedgerLiveAccountPlaceholder, isLedgerLive, chain } = useSKWallet();
86435
+ const apiClient = useApiClient();
86436
+ const queryClient = useSKQueryClient();
86148
86437
  const yieldType = useYieldType(selectedStake).mapOrDefault((y) => y.title, "");
86149
86438
  const initYieldRes = useInitYield({ selectedToken });
86150
86439
  const estimatedRewards = useEstimatedRewards({
@@ -86197,7 +86486,7 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86197
86486
  const normalizedValidatorSearch = validatorSearch.trim();
86198
86487
  const debouncedValidatorSearch = useDebouncedValue(normalizedValidatorSearch, 300);
86199
86488
  const validatorSearchDebouncing = normalizedValidatorSearch !== debouncedValidatorSearch;
86200
- const multiYields = useStreamMultiYields(useMemo(() => availableYields.orDefault([]), [availableYields]));
86489
+ const yieldSummaries = useStreamYieldSummaries(useMemo(() => availableYields.orDefault([]), [availableYields]));
86201
86490
  const tokenBalancesScan = useTokenBalancesScan();
86202
86491
  const defaultTokens = useDefaultTokens();
86203
86492
  const tokenBalancesData = useMemo(() => Maybe.fromRecord({
@@ -86230,17 +86519,43 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86230
86519
  deferredTokenSearch,
86231
86520
  tokenBalancesScan.data
86232
86521
  ]);
86233
- const dashboardYields = useStreamMultiYields(useMemo(() => tokenBalancesData.map((data) => [...new Set(data.all.flatMap((token) => token.availableYields))]).orDefault([]), [tokenBalancesData]));
86234
- const availableDashboardYieldCategories = useMemo(() => dashboardYields.length > 0 ? getAvailableDashboardYieldCategories(dashboardYields) : [], [dashboardYields]);
86235
- const selectedDashboardYieldCategory = selectedStake.chainNullable(getDashboardYieldCategory).extractNullable();
86236
- const selectedStakeData = useMemo(() => Maybe.of(multiYields).map((val_5) => [...val_5].sort((a, b_0) => b_0.rewardRate.total - a.rewardRate.total)).map((val_6) => val_6.filter(isNonZeroRewardRateYield)).chain((yieldDtos) => Maybe.of(deferredStakeSearch).chain((val_7) => val_7.length >= 1 ? Maybe.of(val_7.toLowerCase()) : Maybe.empty()).map((lowerSearch_0) => ({
86522
+ const dashboardYieldCatalog = useDashboardYieldCatalog({
86523
+ enabled: dashboardVariant,
86524
+ network: null
86525
+ });
86526
+ const availableDashboardYieldCategories = dashboardYieldCatalog.availableCategories;
86527
+ const selectedStakeDashboardYieldCategory = selectedStake.chainNullable(getDashboardYieldCategory).extractNullable();
86528
+ const [selectedDashboardYieldCategoryFallback, setSelectedDashboardYieldCategoryFallback] = useState(null);
86529
+ const selectedDashboardYieldCategory = selectedStakeDashboardYieldCategory ?? selectedDashboardYieldCategoryFallback;
86530
+ useEffect(() => {
86531
+ if (!selectedStakeDashboardYieldCategory) return;
86532
+ setSelectedDashboardYieldCategoryFallback(selectedStakeDashboardYieldCategory);
86533
+ }, [selectedStakeDashboardYieldCategory]);
86534
+ const dashboardSelectionByCategoryRef = useRef(/* @__PURE__ */ new Map());
86535
+ useEffect(() => {
86536
+ if (!dashboardVariant) return;
86537
+ const token = selectedToken.extractNullable();
86538
+ const yieldDto = selectedStake.extractNullable();
86539
+ const category = yieldDto ? getDashboardYieldCategory(yieldDto) : null;
86540
+ if (!token || !yieldDto || !category) return;
86541
+ dashboardSelectionByCategoryRef.current.set(category, {
86542
+ token,
86543
+ yieldDto,
86544
+ yieldId: yieldDto.id
86545
+ });
86546
+ }, [
86547
+ dashboardVariant,
86548
+ selectedStake,
86549
+ selectedToken
86550
+ ]);
86551
+ const selectedStakeData = useMemo(() => Maybe.of(yieldSummaries).map((val_5) => selectedStake.filter((stake) => !val_5.some((yieldDto_0) => yieldDto_0.id === stake.id)).map((stake_0) => [stake_0, ...val_5]).orDefault(val_5)).map((val_6) => [...val_6].sort((a, b_0) => b_0.rewardRate.total - a.rewardRate.total)).map((val_7) => val_7.filter(isNonZeroRewardRateYield)).chain((yieldDtos) => Maybe.of(deferredStakeSearch).chain((val_8) => val_8.length >= 1 ? Maybe.of(val_8.toLowerCase()) : Maybe.empty()).map((lowerSearch_0) => ({
86237
86552
  all: yieldDtos,
86238
86553
  filteredDtos: yieldDtos.filter((d) => d.token.name.toLowerCase().includes(lowerSearch_0) || d.token.symbol.toLowerCase().includes(lowerSearch_0) || d.metadata.name.toLowerCase().includes(lowerSearch_0) || getYieldRewardTokens(d).some((rt_0) => rt_0.name.toLowerCase().includes(lowerSearch_0) || rt_0.symbol.toLowerCase().includes(lowerSearch_0)))
86239
86554
  })).alt(Maybe.of({
86240
86555
  all: yieldDtos,
86241
86556
  filteredDtos: yieldDtos
86242
86557
  }))).map(({ all, filteredDtos }) => {
86243
- const sorted = [...dashboardVariant && selectedDashboardYieldCategory ? filteredDtos.filter((yieldDto) => getDashboardYieldCategory(yieldDto) === selectedDashboardYieldCategory) : filteredDtos].sort((a_0, b_1) => getYieldTypesSortRank(a_0) - getYieldTypesSortRank(b_1));
86558
+ const sorted = [...dashboardVariant && selectedDashboardYieldCategory ? filteredDtos.filter((yieldDto_1) => getDashboardYieldCategory(yieldDto_1) === selectedDashboardYieldCategory) : filteredDtos].sort((a_0, b_1) => getYieldTypesSortRank(a_0) - getYieldTypesSortRank(b_1));
86244
86559
  return {
86245
86560
  all,
86246
86561
  filtered: sorted,
@@ -86264,7 +86579,8 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86264
86579
  }), [
86265
86580
  dashboardVariant,
86266
86581
  deferredStakeSearch,
86267
- multiYields,
86582
+ selectedStake,
86583
+ yieldSummaries,
86268
86584
  selectedDashboardYieldCategory,
86269
86585
  t
86270
86586
  ]);
@@ -86277,7 +86593,7 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86277
86593
  });
86278
86594
  const initialValidatorSelectionYieldIdRef = useRef(null);
86279
86595
  useEffect(() => {
86280
- const currentYieldId = selectedStake.map((val_8) => val_8.id).extractNullable();
86596
+ const currentYieldId = selectedStake.map((val_9) => val_9.id).extractNullable();
86281
86597
  if (!currentYieldId) {
86282
86598
  initialValidatorSelectionYieldIdRef.current = null;
86283
86599
  return;
@@ -86316,31 +86632,119 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86316
86632
  variant,
86317
86633
  yieldValidators.data
86318
86634
  ]);
86319
- const onYieldSearch = (val_9) => setStakeSearch(val_9);
86320
- const onTokenSearch = (val_10) => setTokenSearch(val_10);
86321
- const onValidatorSearch = (val_11) => setValidatorSearch(val_11);
86322
- const onTokenBalanceSelect = useCallback((tokenBalance) => dispatch({
86323
- type: "token/select",
86324
- data: tokenBalance.token
86325
- }), [dispatch]);
86326
- const onYieldSelect = (yieldId) => {
86327
- Maybe.fromNullable(multiYields).chain((val_12) => List.find((v_0) => v_0.id === yieldId, val_12)).ifJust((val_13) => dispatch({
86328
- type: "yield/select",
86329
- data: val_13
86330
- }));
86331
- };
86332
- const onDashboardYieldCategorySelect = (category) => {
86333
- if (selectedDashboardYieldCategory === category) return;
86334
- const targetYield = [...new Map([...selectedStakeData.map((data_0) => data_0.all).orDefault([]), ...dashboardYields].map((yieldDto_0) => [yieldDto_0.id, yieldDto_0])).values()].filter((yieldDto_1) => getDashboardYieldCategory(yieldDto_1) === category).sort((a_2, b_3) => b_3.rewardRate.total - a_2.rewardRate.total)[0];
86335
- if (!targetYield) return;
86336
- dispatch({
86337
- type: "token/select",
86338
- data: targetYield.token
86635
+ const onYieldSearch = (val_10) => setStakeSearch(val_10);
86636
+ const onTokenSearch = (val_11) => setTokenSearch(val_11);
86637
+ const onValidatorSearch = (val_12) => setValidatorSearch(val_12);
86638
+ const selectDashboardTokenYield = useCallback(({ token: token_0, yieldDto: yieldDto_2, yieldId }) => {
86639
+ (yieldDto_2 ? getYieldOpportunityFromSummary({
86640
+ yieldDto: yieldDto_2,
86641
+ isLedgerLive,
86642
+ apiClient,
86643
+ queryClient
86644
+ }) : getYieldOpportunity({
86645
+ yieldId,
86646
+ isLedgerLive,
86647
+ apiClient,
86648
+ queryClient
86649
+ })).map((yieldDto_3) => {
86650
+ dispatch({
86651
+ type: "dashboard/token-yield/select",
86652
+ data: {
86653
+ token: token_0,
86654
+ yieldDto: yieldDto_3
86655
+ }
86656
+ });
86657
+ return yieldDto_3;
86658
+ }).run();
86659
+ }, [
86660
+ apiClient,
86661
+ dispatch,
86662
+ isLedgerLive,
86663
+ queryClient
86664
+ ]);
86665
+ const getDashboardTokenYield = useCallback(async ({ category: category_0, tokenBalance }) => {
86666
+ const yieldSummaries_0 = await queryClient.fetchQuery({
86667
+ queryKey: [
86668
+ "dashboard-token-yield-summaries",
86669
+ tokenString(tokenBalance.token),
86670
+ tokenBalance.availableYields
86671
+ ],
86672
+ staleTime: 1e3 * 60 * 2,
86673
+ queryFn: ({ signal }) => fetchYieldSummariesByIds({
86674
+ apiClient,
86675
+ signal,
86676
+ yieldIds: tokenBalance.availableYields
86677
+ })
86339
86678
  });
86679
+ const yieldsById = new Map(yieldSummaries_0.map((yieldDto_4) => [yieldDto_4.id, yieldDto_4]));
86680
+ const yieldId_0 = getDashboardCategoryYieldIdsForToken(tokenBalance.availableYields, yieldsById, category_0)[0];
86681
+ return yieldId_0 ? {
86682
+ yieldId: yieldId_0,
86683
+ yieldDto: yieldsById.get(yieldId_0)
86684
+ } : null;
86685
+ }, [apiClient, queryClient]);
86686
+ const dashboardTokenSelectionRequestRef = useRef(0);
86687
+ const onTokenBalanceSelect = useCallback(async (tokenBalance_0) => {
86688
+ const category_1 = dashboardVariant ? selectedDashboardYieldCategory : null;
86689
+ if (!category_1) {
86690
+ dispatch({
86691
+ type: "token/select",
86692
+ data: tokenBalance_0.token
86693
+ });
86694
+ return;
86695
+ }
86696
+ const selectionRequestId = dashboardTokenSelectionRequestRef.current + 1;
86697
+ dashboardTokenSelectionRequestRef.current = selectionRequestId;
86340
86698
  dispatch({
86341
- type: "yield/select",
86342
- data: targetYield
86699
+ type: "token-only/select",
86700
+ data: tokenBalance_0.token
86701
+ });
86702
+ const tokenYield = await getDashboardTokenYield({
86703
+ category: category_1,
86704
+ tokenBalance: tokenBalance_0
86705
+ }).catch((error) => {
86706
+ console.log(error);
86707
+ return null;
86708
+ });
86709
+ if (selectionRequestId !== dashboardTokenSelectionRequestRef.current || !tokenYield) return;
86710
+ selectDashboardTokenYield({
86711
+ token: tokenBalance_0.token,
86712
+ yieldDto: tokenYield.yieldDto,
86713
+ yieldId: tokenYield.yieldId
86343
86714
  });
86715
+ }, [
86716
+ dashboardVariant,
86717
+ dispatch,
86718
+ getDashboardTokenYield,
86719
+ selectedDashboardYieldCategory,
86720
+ selectDashboardTokenYield
86721
+ ]);
86722
+ const onYieldSelect = (yieldId_1) => {
86723
+ const yieldSummary = List.find((summary) => summary.id === yieldId_1, yieldSummaries).extractNullable();
86724
+ (yieldSummary ? getYieldOpportunityFromSummary({
86725
+ yieldDto: yieldSummary,
86726
+ isLedgerLive,
86727
+ apiClient,
86728
+ queryClient
86729
+ }) : getYieldOpportunity({
86730
+ yieldId: yieldId_1,
86731
+ isLedgerLive,
86732
+ apiClient,
86733
+ queryClient
86734
+ })).map((yieldDto_5) => {
86735
+ dispatch({
86736
+ type: "yield/select",
86737
+ data: yieldDto_5
86738
+ });
86739
+ return yieldDto_5;
86740
+ }).run();
86741
+ };
86742
+ const onDashboardYieldCategorySelect = (category_2) => {
86743
+ if (selectedDashboardYieldCategory === category_2) return;
86744
+ setSelectedDashboardYieldCategoryFallback(category_2);
86745
+ const target = dashboardSelectionByCategoryRef.current.get(category_2) ?? dashboardYieldCatalog.initialSelectionByCategory.get(category_2);
86746
+ if (!target) return;
86747
+ selectDashboardTokenYield(target);
86344
86748
  };
86345
86749
  const onValidatorSelect = (item) => selectedStake.ifJust((ss) => isYieldActionArgRequired(ss, "enter", "validatorAddresses") ? dispatch({
86346
86750
  type: "validator/multiselect",
@@ -86353,9 +86757,9 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86353
86757
  type: "validator/remove",
86354
86758
  data: item_0
86355
86759
  });
86356
- const onStakeAmountChange = (val_14) => dispatch({
86760
+ const onStakeAmountChange = (val_13) => dispatch({
86357
86761
  type: "stakeAmount/change",
86358
- data: val_14
86762
+ data: val_13
86359
86763
  });
86360
86764
  const stakeEnterRequestDto = useStakeEnterRequestDto();
86361
86765
  const yieldKycGate = useYieldKycGate({ yieldDto: selectedStake });
@@ -86375,19 +86779,19 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86375
86779
  if (stakeEnterRequestDto.isNothing()) return;
86376
86780
  if (!isConnected) return openConnectModal?.();
86377
86781
  if (kycGateIsBlocking) return;
86378
- const val_15 = Maybe.fromRecord({
86782
+ const val_14 = Maybe.fromRecord({
86379
86783
  stakeEnterRequestDto,
86380
86784
  selectedToken
86381
86785
  }).unsafeCoerce();
86382
86786
  enterStakeStore.send({
86383
86787
  type: "initFlow",
86384
86788
  data: {
86385
- addresses: val_15.stakeEnterRequestDto.addresses,
86386
- requestDto: val_15.stakeEnterRequestDto.dto,
86387
- selectedToken: val_15.selectedToken,
86388
- gasFeeToken: val_15.stakeEnterRequestDto.gasFeeToken,
86389
- selectedStake: val_15.stakeEnterRequestDto.selectedStake,
86390
- selectedValidators: val_15.stakeEnterRequestDto.selectedValidators
86789
+ addresses: val_14.stakeEnterRequestDto.addresses,
86790
+ requestDto: val_14.stakeEnterRequestDto.dto,
86791
+ selectedToken: val_14.selectedToken,
86792
+ gasFeeToken: val_14.stakeEnterRequestDto.gasFeeToken,
86793
+ selectedStake: val_14.stakeEnterRequestDto.selectedStake,
86794
+ selectedValidators: val_14.stakeEnterRequestDto.selectedValidators
86391
86795
  }
86392
86796
  });
86393
86797
  navigate(positionDetailsStakeReviewPath ?? "/review");
@@ -86401,7 +86805,7 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86401
86805
  onClickHandlerResetRef
86402
86806
  ]);
86403
86807
  const validation = useMemo(() => {
86404
- const val_16 = {
86808
+ const val_15 = {
86405
86809
  submitted: false,
86406
86810
  hasErrors: false,
86407
86811
  errors: {
@@ -86412,20 +86816,20 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86412
86816
  stakeAmountIsZero: false
86413
86817
  }
86414
86818
  };
86415
- if (!isConnected) return val_16;
86819
+ if (!isConnected) return val_15;
86416
86820
  selectedStake.ifJust((ss_0) => {
86417
- if (isYieldActionArgRequired(ss_0, "enter", "tronResource") && tronResource.isNothing()) val_16.errors.tronResource = true;
86821
+ if (isYieldActionArgRequired(ss_0, "enter", "tronResource") && tronResource.isNothing()) val_15.errors.tronResource = true;
86418
86822
  });
86419
- val_16.errors = {
86420
- ...val_16.errors,
86823
+ val_15.errors = {
86824
+ ...val_15.errors,
86421
86825
  stakeAmountGreaterThanAvailableAmount,
86422
86826
  stakeAmountGreaterThanMax,
86423
86827
  stakeAmountLessThanMin,
86424
86828
  stakeAmountIsZero
86425
86829
  };
86426
- val_16.submitted = onClickHandler.status !== "idle";
86427
- val_16.hasErrors = Object.values(val_16.errors).some(Boolean);
86428
- return val_16;
86830
+ val_15.submitted = onClickHandler.status !== "idle";
86831
+ val_15.hasErrors = Object.values(val_15.errors).some(Boolean);
86832
+ return val_15;
86429
86833
  }, [
86430
86834
  isConnected,
86431
86835
  onClickHandler.status,
@@ -86448,7 +86852,7 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86448
86852
  isForceMax,
86449
86853
  selectedStake
86450
86854
  ]);
86451
- const stakeMinAmount = useMemo(() => selectedStake.filter(() => minIntegrationAmount.isJust() && !isForceMax).map(() => minEnterOrExitAmount.toNumber()).filter((val_17) => new BigNumber(val_17).isGreaterThan(0)), [
86855
+ const stakeMinAmount = useMemo(() => selectedStake.filter(() => minIntegrationAmount.isJust() && !isForceMax).map(() => minEnterOrExitAmount.toNumber()).filter((val_16) => new BigNumber(val_16).isGreaterThan(0)), [
86452
86856
  minEnterOrExitAmount,
86453
86857
  minIntegrationAmount,
86454
86858
  isForceMax,
@@ -86466,7 +86870,7 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86466
86870
  const isFetching = tokenBalancesScan.isFetching;
86467
86871
  const isError = !tokenBalancesScan.data && tokenBalancesScan.isError;
86468
86872
  const buttonDisabled = isConnected && (isFetching || stakeEnterRequestDto.isNothing() || kycGateIsBlocking);
86469
- const buttonCTAText = useYieldType(selectedStake).mapOrDefault((v_1) => v_1.cta, "");
86873
+ const buttonCTAText = useYieldType(selectedStake).mapOrDefault((v_0) => v_0.cta, "");
86470
86874
  const providersDetails = useProvidersDetails({
86471
86875
  integrationData: selectedStake,
86472
86876
  validators: Maybe.of(selectedValidators),
@@ -86494,12 +86898,12 @@ var EarnPageContextProvider = ({ children, registerFooterButton = true }) => {
86494
86898
  const isStakeTokenSameAsGasToken = useMemo(() => Maybe.fromRecord({
86495
86899
  selectedStake,
86496
86900
  selectedToken
86497
- }).mapOrDefault((val_18) => stakeTokenSameAsGasToken({
86498
- stakeToken: val_18.selectedToken,
86499
- yieldDto: val_18.selectedStake
86901
+ }).mapOrDefault((val_17) => stakeTokenSameAsGasToken({
86902
+ stakeToken: val_17.selectedToken,
86903
+ yieldDto: val_17.selectedStake
86500
86904
  }), false), [selectedStake, selectedToken]);
86501
86905
  const selectTokenIsLoading = tokenBalancesScanLoading || defaultTokensIsLoading;
86502
- const selectYieldIsLoading = selectedStakeId.isNothing() && !hasNotYieldsForToken || initYieldRes.isLoading || yieldOpportunityLoading || tokenBalancesScanLoading || defaultTokensIsLoading;
86906
+ const selectYieldIsLoading = autoSelectYield && selectedStakeId.isNothing() && !hasNotYieldsForToken || initYieldRes.isLoading || yieldOpportunityLoading || tokenBalancesScanLoading || defaultTokensIsLoading;
86503
86907
  const selectValidatorIsLoading = defaultTokensIsLoading || tokenBalancesScanLoading || initYieldRes.isLoading || yieldOpportunityLoading || validatorSearchDebouncing || shouldFetchValidators && yieldValidators.isLoading;
86504
86908
  const footerIsLoading = defaultTokensIsLoading || tokenBalancesScanLoading || initYieldRes.isLoading || yieldOpportunityLoading;
86505
86909
  useRegisterFooterButton(useMemo(() => !registerFooterButton || hasNotYieldsForToken ? null : isConnected && !isLedgerLiveAccountPlaceholder ? {
@@ -87423,7 +87827,7 @@ var useGasWarningCheck = (props) => {
87423
87827
  tokenAddress: val.gasFeeToken.address
87424
87828
  },
87425
87829
  ...val.stakeData
87426
- })).map(_temp$79)).unsafeCoerce();
87830
+ })).map(_temp$78)).unsafeCoerce();
87427
87831
  $[8] = apiClient;
87428
87832
  $[9] = requestData;
87429
87833
  $[10] = t4;
@@ -87443,7 +87847,7 @@ var useGasWarningCheck = (props) => {
87443
87847
  } else t5 = $[14];
87444
87848
  return useQuery$1(t5);
87445
87849
  };
87446
- function _temp$79(val_0) {
87850
+ function _temp$78(val_0) {
87447
87851
  return val_0 instanceof NotEnoughGasTokenError || val_0 instanceof GasTokenMissingError;
87448
87852
  }
87449
87853
  //#endregion
@@ -87465,7 +87869,7 @@ var useFees = (t0) => {
87465
87869
  $[3] = t1;
87466
87870
  } else t1 = $[3];
87467
87871
  const getFeeInUSD = t1;
87468
- const getBpsInPercentage = _temp$78;
87872
+ const getBpsInPercentage = _temp$77;
87469
87873
  let t2;
87470
87874
  if ($[4] !== amount) {
87471
87875
  t2 = (val_0) => amount.multipliedBy(val_0).dividedBy(100);
@@ -87574,7 +87978,7 @@ var useFees = (t0) => {
87574
87978
  } else t7 = $[44];
87575
87979
  let t8;
87576
87980
  if ($[45] !== getPercentInUsd || $[46] !== t || $[47] !== yieldFee?.performance) {
87577
- t8 = () => just(yieldFee?.performance).chainNullable(_temp7$9).map((val_7) => ({
87981
+ t8 = () => just(yieldFee?.performance).chainNullable(_temp7$8).map((val_7) => ({
87578
87982
  inUSD: getPercentInUsd(val_7),
87579
87983
  inPercentage: `${val_7}%`,
87580
87984
  explanation: t("review.performance_fee_explanation"),
@@ -87585,7 +87989,7 @@ var useFees = (t0) => {
87585
87989
  $[47] = yieldFee?.performance;
87586
87990
  $[48] = t8;
87587
87991
  } else t8 = $[48];
87588
- t6 = feeConfigDto.chainNullable(_temp6$13).map(t7).altLazy(t8);
87992
+ t6 = feeConfigDto.chainNullable(_temp6$12).map(t7).altLazy(t8);
87589
87993
  $[36] = feeConfigDto;
87590
87994
  $[37] = getFeeInUSD;
87591
87995
  $[38] = getPercentInUsd;
@@ -87608,7 +88012,7 @@ var useFees = (t0) => {
87608
88012
  } else t7 = $[52];
87609
88013
  return t7;
87610
88014
  };
87611
- function _temp$78(val) {
88015
+ function _temp$77(val) {
87612
88016
  return `${bpsToPercentage(val)}%`;
87613
88017
  }
87614
88018
  function _temp2$48(v) {
@@ -87623,18 +88027,18 @@ function _temp4$20(v_1) {
87623
88027
  function _temp5$16(v_2) {
87624
88028
  return v_2;
87625
88029
  }
87626
- function _temp6$13(v_3) {
88030
+ function _temp6$12(v_3) {
87627
88031
  return v_3.performanceFeeBps;
87628
88032
  }
87629
- function _temp7$9(v_4) {
88033
+ function _temp7$8(v_4) {
87630
88034
  return v_4;
87631
88035
  }
87632
88036
  //#endregion
87633
88037
  //#region src/pages/review/hooks/use-stake-review.hook.ts
87634
88038
  var useStakeReview = () => {
87635
- const $ = c(112);
88039
+ const $ = c(110);
87636
88040
  const enterStore = useEnterStakeStore();
87637
- const t0 = useSelector$1(enterStore, _temp$77);
88041
+ const t0 = useSelector$1(enterStore, _temp$76);
87638
88042
  let t1;
87639
88043
  if ($[0] !== t0) {
87640
88044
  t1 = t0.unsafeCoerce();
@@ -87761,7 +88165,7 @@ var useStakeReview = () => {
87761
88165
  const t16 = useYieldType(selectedStake);
87762
88166
  let t17;
87763
88167
  if ($[37] !== t16) {
87764
- t17 = t16.mapOrDefault(_temp6$12, "");
88168
+ t17 = t16.mapOrDefault(_temp6$11, "");
87765
88169
  $[37] = t16;
87766
88170
  $[38] = t17;
87767
88171
  } else t17 = $[38];
@@ -87775,7 +88179,7 @@ var useStakeReview = () => {
87775
88179
  const amount = t18;
87776
88180
  let t19;
87777
88181
  if ($[41] !== estimatedRewards) {
87778
- t19 = estimatedRewards.mapOrDefault(_temp7$8, "");
88182
+ t19 = estimatedRewards.mapOrDefault(_temp7$7, "");
87779
88183
  $[41] = estimatedRewards;
87780
88184
  $[42] = t19;
87781
88185
  } else t19 = $[42];
@@ -87835,7 +88239,7 @@ var useStakeReview = () => {
87835
88239
  const { depositFee, managementFee, performanceFee } = useFees(t26);
87836
88240
  let t27;
87837
88241
  if ($[58] !== selectedStake) {
87838
- t27 = selectedStake.map(_temp8$6);
88242
+ t27 = selectedStake.map(_temp8$7);
87839
88243
  $[58] = selectedStake;
87840
88244
  $[59] = t27;
87841
88245
  } else t27 = $[59];
@@ -87949,19 +88353,18 @@ var useStakeReview = () => {
87949
88353
  $[89] = t38;
87950
88354
  } else t38 = $[89];
87951
88355
  const metaInfo = t38;
87952
- let t39;
87953
- if ($[90] !== selectedStake) {
87954
- t39 = selectedStake.chainNullable(getYieldCommission).map(_temp0$4).map(_temp1$3);
87955
- $[90] = selectedStake;
87956
- $[91] = t39;
87957
- } else t39 = $[91];
87958
- const commissionFee = t39;
87959
- const t40 = !!gasCheckWarning.data;
87960
- const t41 = actionPreviewQuery.isLoading || actionPreviewQuery.isFetching || gasCheckWarning.isLoading;
87961
- const t42 = yieldKycGate.isLoading || yieldKycGate.isFetching || yieldKycGate.isRefetching;
87962
- let t43;
87963
- if ($[92] !== actionPreviewQuery.isLoading || $[93] !== amount || $[94] !== commissionFee || $[95] !== depositFee || $[96] !== fee || $[97] !== interestRate || $[98] !== kycProviderName || $[99] !== managementFee || $[100] !== metaInfo || $[101] !== metadata || $[102] !== onKycStatusRefresh || $[103] !== performanceFee || $[104] !== rewardToken || $[105] !== selectedToken || $[106] !== t40 || $[107] !== t41 || $[108] !== t42 || $[109] !== yieldKycGate.gate || $[110] !== yieldType) {
87964
- t43 = {
88356
+ const t39 = !!gasCheckWarning.data;
88357
+ const t40 = actionPreviewQuery.isLoading || actionPreviewQuery.isFetching || gasCheckWarning.isLoading;
88358
+ const t41 = actionPreviewQuery.isLoading;
88359
+ let t42;
88360
+ if ($[90] === Symbol.for("react.memo_cache_sentinel")) {
88361
+ t42 = Maybe.empty();
88362
+ $[90] = t42;
88363
+ } else t42 = $[90];
88364
+ const t43 = yieldKycGate.isLoading || yieldKycGate.isFetching || yieldKycGate.isRefetching;
88365
+ let t44;
88366
+ if ($[91] !== actionPreviewQuery.isLoading || $[92] !== amount || $[93] !== depositFee || $[94] !== fee || $[95] !== interestRate || $[96] !== kycProviderName || $[97] !== managementFee || $[98] !== metaInfo || $[99] !== metadata || $[100] !== onKycStatusRefresh || $[101] !== performanceFee || $[102] !== rewardToken || $[103] !== selectedToken || $[104] !== t39 || $[105] !== t40 || $[106] !== t43 || $[107] !== yieldKycGate.gate || $[108] !== yieldType) {
88367
+ t44 = {
87965
88368
  token: selectedToken,
87966
88369
  amount,
87967
88370
  fee,
@@ -87970,42 +88373,41 @@ var useStakeReview = () => {
87970
88373
  rewardToken,
87971
88374
  metadata,
87972
88375
  metaInfo,
87973
- isGasCheckWarning: t40,
87974
- gasCheckLoading: t41,
88376
+ isGasCheckWarning: t39,
88377
+ gasCheckLoading: t40,
87975
88378
  depositFee,
87976
88379
  managementFee,
87977
88380
  performanceFee,
87978
- feeConfigLoading: actionPreviewQuery.isLoading,
87979
- commissionFee,
88381
+ feeConfigLoading: t41,
88382
+ commissionFee: t42,
87980
88383
  kycGate: yieldKycGate.gate,
87981
88384
  kycProviderName,
87982
- kycStatusIsChecking: t42,
88385
+ kycStatusIsChecking: t43,
87983
88386
  onKycStatusRefresh
87984
88387
  };
87985
- $[92] = actionPreviewQuery.isLoading;
87986
- $[93] = amount;
87987
- $[94] = commissionFee;
87988
- $[95] = depositFee;
87989
- $[96] = fee;
87990
- $[97] = interestRate;
87991
- $[98] = kycProviderName;
87992
- $[99] = managementFee;
87993
- $[100] = metaInfo;
87994
- $[101] = metadata;
87995
- $[102] = onKycStatusRefresh;
87996
- $[103] = performanceFee;
87997
- $[104] = rewardToken;
87998
- $[105] = selectedToken;
87999
- $[106] = t40;
88000
- $[107] = t41;
88001
- $[108] = t42;
88002
- $[109] = yieldKycGate.gate;
88003
- $[110] = yieldType;
88004
- $[111] = t43;
88005
- } else t43 = $[111];
88006
- return t43;
88007
- };
88008
- function _temp$77(state) {
88388
+ $[91] = actionPreviewQuery.isLoading;
88389
+ $[92] = amount;
88390
+ $[93] = depositFee;
88391
+ $[94] = fee;
88392
+ $[95] = interestRate;
88393
+ $[96] = kycProviderName;
88394
+ $[97] = managementFee;
88395
+ $[98] = metaInfo;
88396
+ $[99] = metadata;
88397
+ $[100] = onKycStatusRefresh;
88398
+ $[101] = performanceFee;
88399
+ $[102] = rewardToken;
88400
+ $[103] = selectedToken;
88401
+ $[104] = t39;
88402
+ $[105] = t40;
88403
+ $[106] = t43;
88404
+ $[107] = yieldKycGate.gate;
88405
+ $[108] = yieldType;
88406
+ $[109] = t44;
88407
+ } else t44 = $[109];
88408
+ return t44;
88409
+ };
88410
+ function _temp$76(state) {
88009
88411
  return state.context.data;
88010
88412
  }
88011
88413
  function _temp2$47(acc, transaction) {
@@ -88021,28 +88423,19 @@ function _temp4$19(value) {
88021
88423
  function _temp5$15(value_0) {
88022
88424
  return value_0;
88023
88425
  }
88024
- function _temp6$12(y) {
88426
+ function _temp6$11(y) {
88025
88427
  return y.review;
88026
88428
  }
88027
- function _temp7$8(r) {
88429
+ function _temp7$7(r) {
88028
88430
  return r.percentage.toString();
88029
88431
  }
88030
- function _temp8$6(yieldDto) {
88432
+ function _temp8$7(yieldDto) {
88031
88433
  return {
88032
88434
  logoURI: yieldDto.metadata.logoURI,
88033
88435
  name: yieldDto.metadata.name,
88034
88436
  provider: yieldDto.provider
88035
88437
  };
88036
88438
  }
88037
- function _temp9$5(acc_0, curr) {
88038
- return acc_0 + curr.value;
88039
- }
88040
- function _temp0$4(commission) {
88041
- return commission.reduce(_temp9$5, 0);
88042
- }
88043
- function _temp1$3(val) {
88044
- return `${APToPercentage(val)}%`;
88045
- }
88046
88439
  //#endregion
88047
88440
  //#region ../../node_modules/.pnpm/react-loading-skeleton@3.5.0_react@19.2.6/node_modules/react-loading-skeleton/dist/index.js
88048
88441
  /**
@@ -90847,7 +91240,7 @@ var useYieldMetaInfo = (t0) => {
90847
91240
  const { t } = useTranslation();
90848
91241
  let t1;
90849
91242
  if ($[0] !== t || $[1] !== validators) {
90850
- t1 = List.find(_temp$76, validators).alt(List.head(validators)).map((v_0) => t("details.selected_validators", {
91243
+ t1 = List.find(_temp$75, validators).alt(List.head(validators)).map((v_0) => t("details.selected_validators", {
90851
91244
  providerName: v_0.name ?? v_0.address,
90852
91245
  count: validators.length - 1
90853
91246
  }));
@@ -90991,7 +91384,7 @@ var ifNotFound = {
90991
91384
  withdrawnNotAvailable: null,
90992
91385
  lockupPeriod: null
90993
91386
  };
90994
- function _temp$76(v) {
91387
+ function _temp$75(v) {
90995
91388
  return !!(v.name ?? v.address);
90996
91389
  }
90997
91390
  function _temp2$46(t_0) {
@@ -91151,7 +91544,7 @@ var MetaInfo = (t0) => {
91151
91544
  t14,
91152
91545
  t16,
91153
91546
  t18
91154
- ].filter(_temp$75);
91547
+ ].filter(_temp$74);
91155
91548
  $[30] = t10;
91156
91549
  $[31] = t12;
91157
91550
  $[32] = t14;
@@ -91206,7 +91599,7 @@ var MetaInfo = (t0) => {
91206
91599
  } else t20 = $[42];
91207
91600
  return t20;
91208
91601
  };
91209
- function _temp$75(val) {
91602
+ function _temp$74(val) {
91210
91603
  return !!val.text;
91211
91604
  }
91212
91605
  //#endregion
@@ -91260,7 +91653,7 @@ var ReviewTopSection = (t0) => {
91260
91653
  t6 = Maybe.fromRecord({
91261
91654
  token,
91262
91655
  metadata
91263
- }).map(_temp$74).extractNullable();
91656
+ }).map(_temp$73).extractNullable();
91264
91657
  $[6] = metadata;
91265
91658
  $[7] = token;
91266
91659
  $[8] = t6;
@@ -91361,7 +91754,7 @@ var ReviewTopSection = (t0) => {
91361
91754
  } else t14 = $[24];
91362
91755
  return t14;
91363
91756
  };
91364
- function _temp$74(val) {
91757
+ function _temp$73(val) {
91365
91758
  return /* @__PURE__ */ jsx(TokenIcon, {
91366
91759
  token: val.token,
91367
91760
  metadata: val.metadata
@@ -91505,7 +91898,7 @@ var ReviewPage = (t0) => {
91505
91898
  } else t10 = $[35];
91506
91899
  let t11;
91507
91900
  if ($[36] !== commissionFee) {
91508
- t11 = commissionFee.map(_temp$73).extractNullable();
91901
+ t11 = commissionFee.map(_temp$72).extractNullable();
91509
91902
  $[36] = commissionFee;
91510
91903
  $[37] = t11;
91511
91904
  } else t11 = $[37];
@@ -91834,7 +92227,7 @@ var ConfigFee = (t0) => {
91834
92227
  } else t9 = $[17];
91835
92228
  return t9;
91836
92229
  };
91837
- function _temp$73(val) {
92230
+ function _temp$72(val) {
91838
92231
  return /* @__PURE__ */ jsx(CommissionFee, { commissionFee: val });
91839
92232
  }
91840
92233
  function _temp2$44(val_0) {
@@ -91948,7 +92341,7 @@ var usePendingActionReview = () => {
91948
92341
  const $ = c(73);
91949
92342
  const pendingActionStore = usePendingActionStore();
91950
92343
  const apiClient = useApiClient();
91951
- const t0 = useSelector$1(pendingActionStore, _temp$72);
92344
+ const t0 = useSelector$1(pendingActionStore, _temp$71);
91952
92345
  let t1;
91953
92346
  if ($[0] !== t0) {
91954
92347
  t1 = t0.unsafeCoerce();
@@ -92132,7 +92525,7 @@ var usePendingActionReview = () => {
92132
92525
  $[51] = pendingRequest.requestDto.action;
92133
92526
  $[52] = t20;
92134
92527
  } else t20 = $[52];
92135
- t19 = integrationData.chainNullable(_temp6$11).map(t20);
92528
+ t19 = integrationData.chainNullable(_temp6$10).map(t20);
92136
92529
  $[48] = integrationData;
92137
92530
  $[49] = pendingRequest.requestDto.action;
92138
92531
  $[50] = t19;
@@ -92205,7 +92598,7 @@ var usePendingActionReview = () => {
92205
92598
  } else t27 = $[72];
92206
92599
  return t27;
92207
92600
  };
92208
- function _temp$72(state) {
92601
+ function _temp$71(state) {
92209
92602
  return state.context.data;
92210
92603
  }
92211
92604
  function _temp2$43(acc, transaction) {
@@ -92221,7 +92614,7 @@ function _temp4$17(value) {
92221
92614
  function _temp5$14(value_0) {
92222
92615
  return value_0;
92223
92616
  }
92224
- function _temp6$11(v) {
92617
+ function _temp6$10(v) {
92225
92618
  const provider = v.provider;
92226
92619
  return provider ? {
92227
92620
  provider,
@@ -92267,7 +92660,7 @@ var PendingReviewPage = () => {
92267
92660
  } else t2 = $[7];
92268
92661
  let t3;
92269
92662
  if ($[8] !== integrationData) {
92270
- t3 = integrationData.map(_temp$71);
92663
+ t3 = integrationData.map(_temp$70);
92271
92664
  $[8] = integrationData;
92272
92665
  $[9] = t3;
92273
92666
  } else t3 = $[9];
@@ -92307,7 +92700,7 @@ var PendingReviewPage = () => {
92307
92700
  } else t5 = $[20];
92308
92701
  return t5;
92309
92702
  };
92310
- function _temp$71(yieldDto) {
92703
+ function _temp$70(yieldDto) {
92311
92704
  return {
92312
92705
  logoURI: yieldDto.metadata.logoURI,
92313
92706
  name: yieldDto.metadata.name,
@@ -92473,11 +92866,11 @@ var UnstakeSignPopup = (t0) => {
92473
92866
  //#endregion
92474
92867
  //#region src/pages/position-details/hooks/use-unstake-machine.ts
92475
92868
  var useUnstakeMachine = (t0) => {
92476
- const $ = c(16);
92869
+ const $ = c(14);
92477
92870
  const { onDone } = t0;
92478
92871
  const trackEvent = useTrackEvent();
92479
92872
  const exitStore = useExitStakeStore();
92480
- const t1 = useSelector$1(useExitStakeStore(), _temp$70);
92873
+ const t1 = useSelector$1(useExitStakeStore(), _temp$69);
92481
92874
  let t2;
92482
92875
  if ($[0] !== t1) {
92483
92876
  t2 = t1.unsafeCoerce();
@@ -92486,13 +92879,10 @@ var useUnstakeMachine = (t0) => {
92486
92879
  } else t2 = $[1];
92487
92880
  const exitRequest = t2;
92488
92881
  const apiClient = useApiClient();
92489
- const { network, address, additionalAddresses, signMessage } = useSKWallet();
92882
+ const { address, additionalAddresses } = useSKWallet();
92490
92883
  let t3;
92491
- if ($[2] !== additionalAddresses || $[3] !== address || $[4] !== exitRequest || $[5] !== network) {
92492
- t3 = () => Maybe.fromRecord({
92493
- network: Maybe.fromNullable(network),
92494
- address: Maybe.fromNullable(address)
92495
- }).map((val) => ({
92884
+ if ($[2] !== additionalAddresses || $[3] !== address || $[4] !== exitRequest) {
92885
+ t3 = () => Maybe.fromRecord({ address: Maybe.fromNullable(address) }).map((val) => ({
92496
92886
  ...val,
92497
92887
  ...exitRequest,
92498
92888
  addresses: {
@@ -92503,34 +92893,31 @@ var useUnstakeMachine = (t0) => {
92503
92893
  $[2] = additionalAddresses;
92504
92894
  $[3] = address;
92505
92895
  $[4] = exitRequest;
92506
- $[5] = network;
92507
- $[6] = t3;
92508
- } else t3 = $[6];
92896
+ $[5] = t3;
92897
+ } else t3 = $[5];
92509
92898
  let t4;
92510
- if ($[7] !== apiClient || $[8] !== exitStore || $[9] !== onDone || $[10] !== signMessage || $[11] !== t3 || $[12] !== trackEvent) {
92899
+ if ($[6] !== apiClient || $[7] !== exitStore || $[8] !== onDone || $[9] !== t3 || $[10] !== trackEvent) {
92511
92900
  t4 = {
92512
92901
  onDone,
92513
92902
  trackEvent,
92514
92903
  exitStore,
92515
92904
  apiClient,
92516
- signMessage,
92517
92905
  getData: t3
92518
92906
  };
92519
- $[7] = apiClient;
92520
- $[8] = exitStore;
92521
- $[9] = onDone;
92522
- $[10] = signMessage;
92523
- $[11] = t3;
92524
- $[12] = trackEvent;
92525
- $[13] = t4;
92526
- } else t4 = $[13];
92907
+ $[6] = apiClient;
92908
+ $[7] = exitStore;
92909
+ $[8] = onDone;
92910
+ $[9] = t3;
92911
+ $[10] = trackEvent;
92912
+ $[11] = t4;
92913
+ } else t4 = $[11];
92527
92914
  const machineParams = useSavedRef(t4);
92528
92915
  let t5;
92529
- if ($[14] !== machineParams) {
92916
+ if ($[12] !== machineParams) {
92530
92917
  t5 = () => getMachine$1(machineParams);
92531
- $[14] = machineParams;
92532
- $[15] = t5;
92533
- } else t5 = $[15];
92918
+ $[12] = machineParams;
92919
+ $[13] = t5;
92920
+ } else t5 = $[13];
92534
92921
  return useMachine(useState(t5)[0]);
92535
92922
  };
92536
92923
  var getMachine$1 = (ref) => setup({ types: {
@@ -92539,8 +92926,6 @@ var getMachine$1 = (ref) => setup({ types: {
92539
92926
  } }).createMachine({
92540
92927
  context: {
92541
92928
  error: Maybe.empty(),
92542
- transactionVerificationMessageDto: Maybe.empty(),
92543
- signedMessage: Maybe.empty(),
92544
92929
  data: Maybe.empty()
92545
92930
  },
92546
92931
  on: { UNSTAKE: {
@@ -92552,10 +92937,6 @@ var getMachine$1 = (ref) => setup({ types: {
92552
92937
  initial: {},
92553
92938
  check: {
92554
92939
  on: {
92555
- __GET_VERIFICATION_MESSAGE__: {
92556
- target: "getVerificationMessage",
92557
- actions: assign$1({ data: ({ event }) => Maybe.of(event.val) })
92558
- },
92559
92940
  __SUBMIT__: {
92560
92941
  target: "submit",
92561
92942
  actions: assign$1({ data: ({ event }) => Maybe.of(event.val) })
@@ -92568,11 +92949,7 @@ var getMachine$1 = (ref) => setup({ types: {
92568
92949
  yieldId: val.integrationData.id,
92569
92950
  amount: val.requestDto.arguments?.amount
92570
92951
  });
92571
- if (hasYieldExitSignatureVerification(val.integrationData)) self.send({
92572
- type: "__GET_VERIFICATION_MESSAGE__",
92573
- val
92574
- });
92575
- else self.send({
92952
+ self.send({
92576
92953
  type: "__SUBMIT__",
92577
92954
  val
92578
92955
  });
@@ -92580,85 +92957,6 @@ var getMachine$1 = (ref) => setup({ types: {
92580
92957
  Nothing: () => self.send({ type: "__RESET__" })
92581
92958
  })
92582
92959
  },
92583
- getVerificationMessage: {
92584
- on: {
92585
- __GET_VERIFICATION_MESSAGE_SUCCESS__: {
92586
- target: "showPopup",
92587
- actions: assign$1(({ context, event }) => ({
92588
- ...context,
92589
- transactionVerificationMessageDto: Maybe.of(event.val)
92590
- }))
92591
- },
92592
- __GET_VERIFICATION_MESSAGE_ERROR__: {
92593
- target: ".error",
92594
- actions: assign$1(({ context, event }) => ({
92595
- ...context,
92596
- error: Maybe.of(event.val)
92597
- }))
92598
- }
92599
- },
92600
- initial: "loading",
92601
- states: {
92602
- loading: { entry: ({ self, context }) => EitherAsync.liftEither(context.data.toEither(/* @__PURE__ */ new Error("Missing init values"))).chain((val) => EitherAsync(() => ref.current.apiClient.legacy.TransactionControllerGetTransactionVerificationMessageForNetwork(val.network, { payload: { addresses: {
92603
- address: val.addresses.address,
92604
- additionalAddresses: val.addresses.additionalAddresses ?? void 0
92605
- } } })).mapLeft(() => /* @__PURE__ */ new Error("Failed to get verification message"))).caseOf({
92606
- Right(v) {
92607
- self.send({
92608
- type: "__GET_VERIFICATION_MESSAGE_SUCCESS__",
92609
- val: v
92610
- });
92611
- },
92612
- Left(e) {
92613
- self.send({
92614
- type: "__GET_VERIFICATION_MESSAGE_ERROR__",
92615
- val: e
92616
- });
92617
- }
92618
- }) },
92619
- error: {}
92620
- }
92621
- },
92622
- showPopup: { on: {
92623
- CONTINUE_MESSAGE_SIGN: "signMessage",
92624
- CANCEL_MESSAGE_SIGN: "initial"
92625
- } },
92626
- signMessage: {
92627
- on: {
92628
- __SIGN_MESSAGE_SUCCESS__: {
92629
- target: "submit",
92630
- actions: assign$1(({ context, event }) => ({
92631
- ...context,
92632
- signedMessage: Maybe.of(event.val)
92633
- }))
92634
- },
92635
- __SIGN_MESSAGE_ERROR__: {
92636
- target: ".error",
92637
- actions: assign$1(({ context, event }) => ({
92638
- ...context,
92639
- error: Maybe.of(event.val)
92640
- }))
92641
- }
92642
- },
92643
- initial: "loading",
92644
- states: {
92645
- loading: { entry: ({ self, context }) => EitherAsync.liftEither(context.transactionVerificationMessageDto.toEither(/* @__PURE__ */ new Error("Missing transaction verification message"))).chain((val) => ref.current.signMessage(val.message)).caseOf({
92646
- Right(v) {
92647
- self.send({
92648
- type: "__SIGN_MESSAGE_SUCCESS__",
92649
- val: v
92650
- });
92651
- },
92652
- Left(l) {
92653
- self.send({
92654
- type: "__SIGN_MESSAGE_ERROR__",
92655
- val: l
92656
- });
92657
- }
92658
- }) },
92659
- error: {}
92660
- }
92661
- },
92662
92960
  submit: {
92663
92961
  on: {
92664
92962
  __SUBMIT_SUCCESS__: "done",
@@ -92672,25 +92970,7 @@ var getMachine$1 = (ref) => setup({ types: {
92672
92970
  },
92673
92971
  initial: "loading",
92674
92972
  states: {
92675
- loading: { entry: ({ self, context: { data, signedMessage, transactionVerificationMessageDto } }) => EitherAsync.liftEither(data.map((val) => Maybe.fromRecord({
92676
- data: Maybe.of(val),
92677
- requestDto: Maybe.of(val.requestDto),
92678
- transactionVerificationMessageDto,
92679
- signedMessage
92680
- }).map((val) => ({
92681
- ...val.data,
92682
- requestDto: {
92683
- ...val.requestDto,
92684
- address: val.data.addresses.address,
92685
- arguments: {
92686
- ...val.requestDto.arguments ?? {},
92687
- signatureVerification: {
92688
- message: val.transactionVerificationMessageDto.message,
92689
- signed: val.signedMessage
92690
- }
92691
- }
92692
- }
92693
- })).orDefault(val)).toEither(/* @__PURE__ */ new Error("Missing params"))).chain((val) => EitherAsync(() => ref.current.apiClient.yield.ActionsControllerExitYield({ payload: val.requestDto })).chain((actionDto) => EitherAsync.liftEither(getValidStakeSessionTx(actionDto))).ifRight((result) => ref.current.exitStore.send({
92973
+ loading: { entry: ({ self, context: { data } }) => EitherAsync.liftEither(data.toEither(/* @__PURE__ */ new Error("Missing params"))).chain((val) => EitherAsync(() => ref.current.apiClient.yield.ActionsControllerExitYield({ payload: val.requestDto })).chain((actionDto) => EitherAsync.liftEither(getValidStakeSessionTx(actionDto))).ifRight((result) => ref.current.exitStore.send({
92694
92974
  type: "setActionDto",
92695
92975
  data: result
92696
92976
  }))).caseOf({
@@ -92713,14 +92993,14 @@ var getMachine$1 = (ref) => setup({ types: {
92713
92993
  }
92714
92994
  }
92715
92995
  });
92716
- function _temp$70(state) {
92996
+ function _temp$69(state) {
92717
92997
  return state.context.data;
92718
92998
  }
92719
92999
  //#endregion
92720
93000
  //#region src/pages/review/hooks/use-unstake-review.hook.ts
92721
93001
  var useUnstakeActionReview = () => {
92722
- const $ = c(88);
92723
- const t0 = useSelector$1(useExitStakeStore(), _temp$69);
93002
+ const $ = c(79);
93003
+ const t0 = useSelector$1(useExitStakeStore(), _temp$68);
92724
93004
  let t1;
92725
93005
  if ($[0] !== t0) {
92726
93006
  t1 = t0.unsafeCoerce();
@@ -92879,7 +93159,7 @@ var useUnstakeActionReview = () => {
92879
93159
  const fee = t18;
92880
93160
  let t19;
92881
93161
  if ($[46] !== integrationData) {
92882
- t19 = integrationData.chainNullable(_temp6$10).map(_temp7$7);
93162
+ t19 = integrationData.chainNullable(_temp6$9).map(_temp7$6);
92883
93163
  $[46] = integrationData;
92884
93164
  $[47] = t19;
92885
93165
  } else t19 = $[47];
@@ -92899,78 +93179,57 @@ var useUnstakeActionReview = () => {
92899
93179
  const [machineState, send] = useUnstakeMachine(t21);
92900
93180
  let t22;
92901
93181
  if ($[51] !== machineState) {
92902
- t22 = machineState.matches("check") || machineState.matches({ getVerificationMessage: "loading" }) || machineState.matches({ signMessage: "loading" }) || machineState.matches({ submit: "loading" });
93182
+ t22 = machineState.matches("check") || machineState.matches({ submit: "loading" });
92903
93183
  $[51] = machineState;
92904
93184
  $[52] = t22;
92905
93185
  } else t22 = $[52];
92906
93186
  const unstakeIsLoading = t22;
92907
93187
  let t23;
92908
- if ($[53] !== machineState) {
92909
- t23 = machineState.matches("showPopup");
92910
- $[53] = machineState;
92911
- $[54] = t23;
92912
- } else t23 = $[54];
92913
- const showUnstakeSignMessagePopup = t23;
92914
- let t24;
92915
- if ($[55] !== send) {
92916
- t24 = () => send({ type: "CONTINUE_MESSAGE_SIGN" });
92917
- $[55] = send;
92918
- $[56] = t24;
92919
- } else t24 = $[56];
92920
- const onContinueUnstakeSignMessage = t24;
92921
- let t25;
92922
- if ($[57] !== send) {
92923
- t25 = () => send({ type: "CANCEL_MESSAGE_SIGN" });
92924
- $[57] = send;
92925
- $[58] = t25;
92926
- } else t25 = $[58];
92927
- const onCloseUnstakeSignMessage = t25;
92928
- let t26;
92929
- if ($[59] !== kycGateIsBlocking || $[60] !== send || $[61] !== unstakeIsLoading) {
92930
- t26 = () => {
93188
+ if ($[53] !== kycGateIsBlocking || $[54] !== send || $[55] !== unstakeIsLoading) {
93189
+ t23 = () => {
92931
93190
  if (unstakeIsLoading || kycGateIsBlocking) return;
92932
93191
  send({ type: "UNSTAKE" });
92933
93192
  };
92934
- $[59] = kycGateIsBlocking;
92935
- $[60] = send;
92936
- $[61] = unstakeIsLoading;
92937
- $[62] = t26;
92938
- } else t26 = $[62];
92939
- const onClickRef = useSavedRef(t26);
93193
+ $[53] = kycGateIsBlocking;
93194
+ $[54] = send;
93195
+ $[55] = unstakeIsLoading;
93196
+ $[56] = t23;
93197
+ } else t23 = $[56];
93198
+ const onClickRef = useSavedRef(t23);
93199
+ let t24;
93200
+ if ($[57] !== t) {
93201
+ t24 = t("shared.confirm");
93202
+ $[57] = t;
93203
+ $[58] = t24;
93204
+ } else t24 = $[58];
93205
+ let t25;
93206
+ if ($[59] !== onClickRef) {
93207
+ t25 = () => onClickRef.current();
93208
+ $[59] = onClickRef;
93209
+ $[60] = t25;
93210
+ } else t25 = $[60];
93211
+ const t26 = unstakeIsLoading || yieldKycGate.isLoading;
92940
93212
  let t27;
92941
- if ($[63] !== t) {
92942
- t27 = t("shared.confirm");
92943
- $[63] = t;
92944
- $[64] = t27;
92945
- } else t27 = $[64];
92946
- let t28;
92947
- if ($[65] !== onClickRef) {
92948
- t28 = () => onClickRef.current();
92949
- $[65] = onClickRef;
92950
- $[66] = t28;
92951
- } else t28 = $[66];
92952
- const t29 = unstakeIsLoading || yieldKycGate.isLoading;
92953
- let t30;
92954
- if ($[67] !== kycGateIsBlocking || $[68] !== t27 || $[69] !== t28 || $[70] !== t29) {
92955
- t30 = {
92956
- label: t27,
92957
- onClick: t28,
93213
+ if ($[61] !== kycGateIsBlocking || $[62] !== t24 || $[63] !== t25 || $[64] !== t26) {
93214
+ t27 = {
93215
+ label: t24,
93216
+ onClick: t25,
92958
93217
  disabled: kycGateIsBlocking,
92959
- isLoading: t29
92960
- };
92961
- $[67] = kycGateIsBlocking;
92962
- $[68] = t27;
92963
- $[69] = t28;
92964
- $[70] = t29;
92965
- $[71] = t30;
92966
- } else t30 = $[71];
92967
- useRegisterFooterButton(t30);
92968
- const t31 = actionPreviewQuery.isLoading || actionPreviewQuery.isFetching || gasWarningCheck.isLoading;
92969
- const t32 = !!gasWarningCheck.data;
92970
- const t33 = yieldKycGate.isLoading || yieldKycGate.isFetching || yieldKycGate.isRefetching;
92971
- let t34;
92972
- if ($[72] !== fee || $[73] !== formattedAmount || $[74] !== integrationData || $[75] !== interactedToken || $[76] !== kycProviderName || $[77] !== onCloseUnstakeSignMessage || $[78] !== onContinueUnstakeSignMessage || $[79] !== onKycStatusRefresh || $[80] !== rewardTokenDetailsProps || $[81] !== showUnstakeSignMessagePopup || $[82] !== t31 || $[83] !== t32 || $[84] !== t33 || $[85] !== title || $[86] !== yieldKycGate.gate) {
92973
- t34 = {
93218
+ isLoading: t26
93219
+ };
93220
+ $[61] = kycGateIsBlocking;
93221
+ $[62] = t24;
93222
+ $[63] = t25;
93223
+ $[64] = t26;
93224
+ $[65] = t27;
93225
+ } else t27 = $[65];
93226
+ useRegisterFooterButton(t27);
93227
+ const t28 = actionPreviewQuery.isLoading || actionPreviewQuery.isFetching || gasWarningCheck.isLoading;
93228
+ const t29 = !!gasWarningCheck.data;
93229
+ const t30 = yieldKycGate.isLoading || yieldKycGate.isFetching || yieldKycGate.isRefetching;
93230
+ let t31;
93231
+ if ($[66] !== fee || $[67] !== formattedAmount || $[68] !== integrationData || $[69] !== interactedToken || $[70] !== kycProviderName || $[71] !== onKycStatusRefresh || $[72] !== rewardTokenDetailsProps || $[73] !== t28 || $[74] !== t29 || $[75] !== t30 || $[76] !== title || $[77] !== yieldKycGate.gate) {
93232
+ t31 = {
92974
93233
  integrationData,
92975
93234
  title,
92976
93235
  amount: formattedAmount,
@@ -92978,36 +93237,33 @@ var useUnstakeActionReview = () => {
92978
93237
  rewardTokenDetailsProps,
92979
93238
  token: interactedToken,
92980
93239
  metaInfo,
92981
- onContinueUnstakeSignMessage,
92982
- onCloseUnstakeSignMessage,
92983
- showUnstakeSignMessagePopup,
92984
- gasCheckLoading: t31,
92985
- isGasCheckWarning: t32,
93240
+ onContinueUnstakeSignMessage: _temp8$6,
93241
+ onCloseUnstakeSignMessage: _temp9$5,
93242
+ showUnstakeSignMessagePopup: false,
93243
+ gasCheckLoading: t28,
93244
+ isGasCheckWarning: t29,
92986
93245
  kycGate: yieldKycGate.gate,
92987
93246
  kycProviderName,
92988
- kycStatusIsChecking: t33,
93247
+ kycStatusIsChecking: t30,
92989
93248
  onKycStatusRefresh
92990
93249
  };
92991
- $[72] = fee;
92992
- $[73] = formattedAmount;
92993
- $[74] = integrationData;
92994
- $[75] = interactedToken;
92995
- $[76] = kycProviderName;
92996
- $[77] = onCloseUnstakeSignMessage;
92997
- $[78] = onContinueUnstakeSignMessage;
92998
- $[79] = onKycStatusRefresh;
92999
- $[80] = rewardTokenDetailsProps;
93000
- $[81] = showUnstakeSignMessagePopup;
93001
- $[82] = t31;
93002
- $[83] = t32;
93003
- $[84] = t33;
93004
- $[85] = title;
93005
- $[86] = yieldKycGate.gate;
93006
- $[87] = t34;
93007
- } else t34 = $[87];
93008
- return t34;
93009
- };
93010
- function _temp$69(state) {
93250
+ $[66] = fee;
93251
+ $[67] = formattedAmount;
93252
+ $[68] = integrationData;
93253
+ $[69] = interactedToken;
93254
+ $[70] = kycProviderName;
93255
+ $[71] = onKycStatusRefresh;
93256
+ $[72] = rewardTokenDetailsProps;
93257
+ $[73] = t28;
93258
+ $[74] = t29;
93259
+ $[75] = t30;
93260
+ $[76] = title;
93261
+ $[77] = yieldKycGate.gate;
93262
+ $[78] = t31;
93263
+ } else t31 = $[78];
93264
+ return t31;
93265
+ };
93266
+ function _temp$68(state) {
93011
93267
  return state.context.data;
93012
93268
  }
93013
93269
  function _temp2$42(acc, transaction) {
@@ -93023,14 +93279,14 @@ function _temp4$16(value) {
93023
93279
  function _temp5$13(value_0) {
93024
93280
  return value_0;
93025
93281
  }
93026
- function _temp6$10(v) {
93282
+ function _temp6$9(v) {
93027
93283
  const provider = v.provider;
93028
93284
  return provider ? {
93029
93285
  provider,
93030
93286
  rest: v
93031
93287
  } : null;
93032
93288
  }
93033
- function _temp7$7(v_0) {
93289
+ function _temp7$6(v_0) {
93034
93290
  return {
93035
93291
  type: "unstake",
93036
93292
  rewardToken: Maybe.of({
@@ -93041,6 +93297,8 @@ function _temp7$7(v_0) {
93041
93297
  })
93042
93298
  };
93043
93299
  }
93300
+ function _temp8$6() {}
93301
+ function _temp9$5() {}
93044
93302
  //#endregion
93045
93303
  //#region src/pages/review/pages/unstake-review.page.tsx
93046
93304
  var UnstakeReviewPage = () => {
@@ -93080,7 +93338,7 @@ var UnstakeReviewPage = () => {
93080
93338
  } else t2 = $[7];
93081
93339
  let t3;
93082
93340
  if ($[8] !== integrationData) {
93083
- t3 = integrationData.map(_temp$68);
93341
+ t3 = integrationData.map(_temp$67);
93084
93342
  $[8] = integrationData;
93085
93343
  $[9] = t3;
93086
93344
  } else t3 = $[9];
@@ -93155,7 +93413,7 @@ var UnstakeReviewPage = () => {
93155
93413
  } else t8 = $[33];
93156
93414
  return t8;
93157
93415
  };
93158
- function _temp$68(yieldDto) {
93416
+ function _temp$67(yieldDto) {
93159
93417
  return {
93160
93418
  logoURI: yieldDto.metadata.logoURI,
93161
93419
  name: yieldDto.metadata.name,
@@ -93194,7 +93452,7 @@ var useStepsMachine = (t0) => {
93194
93452
  const trackEvent = useTrackEvent();
93195
93453
  let t1;
93196
93454
  if ($[0] !== transactions) {
93197
- t1 = [...transactions].sort(_temp$67);
93455
+ t1 = [...transactions].sort(_temp$66);
93198
93456
  $[0] = transactions;
93199
93457
  $[1] = t1;
93200
93458
  } else t1 = $[1];
@@ -93529,7 +93787,7 @@ var getInitContext = (transactions, yieldId) => {
93529
93787
  yieldId
93530
93788
  };
93531
93789
  };
93532
- function _temp$67(a, b) {
93790
+ function _temp$66(a, b) {
93533
93791
  return (a.stepIndex ?? 0) - (b.stepIndex ?? 0);
93534
93792
  }
93535
93793
  //#endregion
@@ -93740,7 +93998,7 @@ var useSteps = (t0) => {
93740
93998
  state: getState({
93741
93999
  txState: val_1,
93742
94000
  machineState: machineState.value,
93743
- currentTxId: machineState.context.currentTxMeta.map(_temp6$9).extractNullable()
94001
+ currentTxId: machineState.context.currentTxMeta.map(_temp6$8).extractNullable()
93744
94002
  })
93745
94003
  });
93746
94004
  $[49] = machineState.context.currentTxMeta;
@@ -93815,7 +94073,7 @@ var getState = ({ currentTxId, machineState, txState }) => {
93815
94073
  }
93816
94074
  })();
93817
94075
  };
93818
- function _temp$66(v) {
94076
+ function _temp$65(v) {
93819
94077
  return {
93820
94078
  name: v.name,
93821
94079
  address: v.address,
@@ -93826,7 +94084,7 @@ function _temp$66(v) {
93826
94084
  };
93827
94085
  }
93828
94086
  function _temp2$41(providerDetail) {
93829
- return providerDetail.map(_temp$66);
94087
+ return providerDetail.map(_temp$65);
93830
94088
  }
93831
94089
  function _temp3$25(id) {
93832
94090
  return clearTimeout(id);
@@ -93840,7 +94098,7 @@ function _temp4$15(val) {
93840
94098
  function _temp5$12(val_0) {
93841
94099
  return !!val_0.url;
93842
94100
  }
93843
- function _temp6$9(v_0) {
94101
+ function _temp6$8(v_0) {
93844
94102
  return v_0.id;
93845
94103
  }
93846
94104
  //#endregion
@@ -94285,7 +94543,7 @@ var CollapsibleRoot = (t0) => {
94285
94543
  onClick: controlledProps.onClick
94286
94544
  } : {
94287
94545
  collapsed: internalState[0],
94288
- onClick: () => internalState[1](_temp$65)
94546
+ onClick: () => internalState[1](_temp$64)
94289
94547
  };
94290
94548
  $[3] = controlledProps.collapsed;
94291
94549
  $[4] = controlledProps.onClick;
@@ -94474,7 +94732,7 @@ var AnimateContent = (t0) => {
94474
94732
  } else t6 = $[12];
94475
94733
  return t6;
94476
94734
  };
94477
- function _temp$65(prev) {
94735
+ function _temp$64(prev) {
94478
94736
  return !prev;
94479
94737
  }
94480
94738
  //#endregion
@@ -94533,7 +94791,7 @@ var TxState = (t0) => {
94533
94791
  const t4 = position === "FIRST" || position === "SINGLE" ? "0" : "4";
94534
94792
  let t5;
94535
94793
  if ($[3] !== canCollapse) {
94536
- t5 = () => canCollapse && setIsCollapsed(_temp$64);
94794
+ t5 = () => canCollapse && setIsCollapsed(_temp$63);
94537
94795
  $[3] = canCollapse;
94538
94796
  $[4] = t5;
94539
94797
  } else t5 = $[4];
@@ -95046,7 +95304,7 @@ var TxState = (t0) => {
95046
95304
  } else t74 = $[137];
95047
95305
  return t74;
95048
95306
  };
95049
- function _temp$64(prev) {
95307
+ function _temp$63(prev) {
95050
95308
  return !prev;
95051
95309
  }
95052
95310
  //#endregion
@@ -95198,7 +95456,7 @@ var StakeStepsPage = () => {
95198
95456
  const $ = c(20);
95199
95457
  useTrackPage("stakingSteps");
95200
95458
  const { address, network } = useSKWallet();
95201
- const t0 = useSelector$1(useEnterStakeStore(), _temp$63);
95459
+ const t0 = useSelector$1(useEnterStakeStore(), _temp$62);
95202
95460
  let t1;
95203
95461
  if ($[0] !== t0) {
95204
95462
  t1 = t0.unsafeCoerce();
@@ -95271,7 +95529,7 @@ var StakeStepsPage = () => {
95271
95529
  } else t11 = $[19];
95272
95530
  return t11;
95273
95531
  };
95274
- function _temp$63(state) {
95532
+ function _temp$62(state) {
95275
95533
  return state.context.data;
95276
95534
  }
95277
95535
  //#endregion
@@ -95314,7 +95572,7 @@ var ActivityStepsPage = () => {
95314
95572
  const $ = c(17);
95315
95573
  useTrackPage("activitySteps");
95316
95574
  const activityContext = useActivityContext();
95317
- const selectedAction = useSelector$1(activityContext, _temp$62).unsafeCoerce();
95575
+ const selectedAction = useSelector$1(activityContext, _temp$61).unsafeCoerce();
95318
95576
  const t0 = useSelector$1(activityContext, _temp2$40);
95319
95577
  let t1;
95320
95578
  if ($[0] !== t0) {
@@ -95382,7 +95640,7 @@ var ActivityStepsPage = () => {
95382
95640
  } else t11 = $[16];
95383
95641
  return t11;
95384
95642
  };
95385
- function _temp$62(state) {
95643
+ function _temp$61(state) {
95386
95644
  return state.context.selectedAction;
95387
95645
  }
95388
95646
  function _temp2$40(state_0) {
@@ -95396,7 +95654,7 @@ function _temp3$24(state_1) {
95396
95654
  var PendingStepsPage = () => {
95397
95655
  const $ = c(19);
95398
95656
  useTrackPage("pendingActionSteps");
95399
- const t0 = useSelector$1(usePendingActionStore(), _temp$61);
95657
+ const t0 = useSelector$1(usePendingActionStore(), _temp$60);
95400
95658
  let t1;
95401
95659
  if ($[0] !== t0) {
95402
95660
  t1 = t0.unsafeCoerce();
@@ -95467,7 +95725,7 @@ var PendingStepsPage = () => {
95467
95725
  } else t10 = $[18];
95468
95726
  return t10;
95469
95727
  };
95470
- function _temp$61(state) {
95728
+ function _temp$60(state) {
95471
95729
  return state.context.data;
95472
95730
  }
95473
95731
  function _temp2$39(p) {
@@ -95478,7 +95736,7 @@ function _temp2$39(p) {
95478
95736
  var UnstakeStepsPage = () => {
95479
95737
  const $ = c(19);
95480
95738
  useTrackPage("unstakeSteps");
95481
- const t0 = useSelector$1(useExitStakeStore(), _temp$60);
95739
+ const t0 = useSelector$1(useExitStakeStore(), _temp$59);
95482
95740
  let t1;
95483
95741
  if ($[0] !== t0) {
95484
95742
  t1 = t0.unsafeCoerce();
@@ -95549,7 +95807,7 @@ var UnstakeStepsPage = () => {
95549
95807
  } else t10 = $[18];
95550
95808
  return t10;
95551
95809
  };
95552
- function _temp$60(state) {
95810
+ function _temp$59(state) {
95553
95811
  return state.context.data;
95554
95812
  }
95555
95813
  function _temp2$38(p) {
@@ -96482,11 +96740,11 @@ var useIsTabletOrBigger = () => {
96482
96740
  const [windowWidth] = useState(_temp2$37);
96483
96741
  return windowWidth >= breakpoints.tablet;
96484
96742
  };
96485
- function _temp$59(w) {
96743
+ function _temp$58(w) {
96486
96744
  return w.innerWidth;
96487
96745
  }
96488
96746
  function _temp2$37() {
96489
- return MaybeWindow.map(_temp$59).orDefault(0);
96747
+ return MaybeWindow.map(_temp$58).orDefault(0);
96490
96748
  }
96491
96749
  //#endregion
96492
96750
  //#region src/pages/details/positions-page/style.css.ts
@@ -97234,7 +97492,7 @@ var useActivityActions = () => {
97234
97492
  offset: pageParam,
97235
97493
  network,
97236
97494
  statuses: ["SUCCESS", "FAILED"]
97237
- } })).mapLeft(_temp$58).chain(async (actionList) => EitherAsync.all((actionList.items ?? []).map((action) => getYieldOpportunity({
97495
+ } })).mapLeft(_temp$57).chain(async (actionList) => EitherAsync.all((actionList.items ?? []).map((action) => getYieldOpportunity({
97238
97496
  yieldId: action.yieldId,
97239
97497
  queryClient,
97240
97498
  isLedgerLive,
@@ -97243,7 +97501,7 @@ var useActivityActions = () => {
97243
97501
  }).map((yieldData) => ({
97244
97502
  actionData: action,
97245
97503
  yieldData
97246
- })).chainLeft(_temp3$23))).map(_temp5$11).map(_temp7$6).chain((items) => EitherAsync(() => getItemsWithValidators({
97504
+ })).chainLeft(_temp3$23))).map(_temp5$11).map(_temp7$5).chain((items) => EitherAsync(() => getItemsWithValidators({
97247
97505
  items,
97248
97506
  apiClient,
97249
97507
  queryClient
@@ -97293,7 +97551,7 @@ var useActivityActions = () => {
97293
97551
  } else t5 = $[17];
97294
97552
  return t5;
97295
97553
  };
97296
- function _temp$58() {
97554
+ function _temp$57() {
97297
97555
  return /* @__PURE__ */ new Error("Could not get action list");
97298
97556
  }
97299
97557
  function _temp2$36() {
@@ -97308,14 +97566,14 @@ function _temp4$14(x) {
97308
97566
  function _temp5$11(res) {
97309
97567
  return res.filter(_temp4$14);
97310
97568
  }
97311
- function _temp6$8(x_0) {
97569
+ function _temp6$7(x_0) {
97312
97570
  return !!getActionInputToken({
97313
97571
  actionDto: x_0.actionData,
97314
97572
  yieldDto: x_0.yieldData
97315
97573
  });
97316
97574
  }
97317
- function _temp7$6(res_0) {
97318
- return res_0.filter(_temp6$8);
97575
+ function _temp7$5(res_0) {
97576
+ return res_0.filter(_temp6$7);
97319
97577
  }
97320
97578
  function _temp8$5(lastPage) {
97321
97579
  const nextOffset = (lastPage.offset ?? 0) + (lastPage.limit ?? PAGE_SIZE);
@@ -97347,7 +97605,7 @@ var ActivityPageContextProvider = (t0) => {
97347
97605
  selectedValidators: data.validatorsData
97348
97606
  })
97349
97607
  });
97350
- const urls = data.actionData.transactions.map(_temp$57).filter(_temp2$35);
97608
+ const urls = data.actionData.transactions.map(_temp$56).filter(_temp2$35);
97351
97609
  return navigate(`/activity/${data.actionData.type === "UNSTAKE" ? "unstake" : data.actionData.type === "STAKE" ? "stake" : "pending"}-review/complete`, { state: { urls } });
97352
97610
  }
97353
97611
  if (data.actionData.status === ActionStatus.CREATED || data.actionData.status === ActionStatus.WAITING_FOR_NEXT || data.actionData.status === ActionStatus.FAILED) {
@@ -97398,7 +97656,7 @@ var useActivityPageContext = () => {
97398
97656
  if (!context) throw new Error("useActivityPageContext must be used within a ActivityPageContext");
97399
97657
  return context;
97400
97658
  };
97401
- function _temp$57(val) {
97659
+ function _temp$56(val) {
97402
97660
  return {
97403
97661
  type: val.type,
97404
97662
  url: val.explorerUrl
@@ -97548,7 +97806,7 @@ var useActivityPage = () => {
97548
97806
  display: "flex",
97549
97807
  gap: "1",
97550
97808
  flexDirection: "column",
97551
- children: [...Array(5).keys()].map(_temp$56)
97809
+ children: [...Array(5).keys()].map(_temp$55)
97552
97810
  });
97553
97811
  $[6] = t1;
97554
97812
  } else t1 = $[6];
@@ -97586,7 +97844,7 @@ var useActivityPage = () => {
97586
97844
  } else t1 = $[17];
97587
97845
  return t1;
97588
97846
  };
97589
- function _temp$56(item) {
97847
+ function _temp$55(item) {
97590
97848
  return /* @__PURE__ */ jsx(ContentLoaderSquare, { heightPx: 60 }, item);
97591
97849
  }
97592
97850
  //#endregion
@@ -97638,7 +97896,7 @@ var ActivityPageComponent$1 = () => {
97638
97896
  hasNextPage: activityActions.hasNextPage,
97639
97897
  isFetchingNextPage: activityActions.isFetchingNextPage,
97640
97898
  fetchNextPage: activityActions.fetchNextPage,
97641
- estimateSize: _temp$55,
97899
+ estimateSize: _temp$54,
97642
97900
  itemContent: (_index, item) => /* @__PURE__ */ jsx(ActionListItem, {
97643
97901
  onActionSelect,
97644
97902
  action: item
@@ -97743,7 +98001,7 @@ var ActivityPage = () => {
97743
98001
  } else t0 = $[0];
97744
98002
  return t0;
97745
98003
  };
97746
- function _temp$55() {
98004
+ function _temp$54() {
97747
98005
  return 80;
97748
98006
  }
97749
98007
  //#endregion
@@ -97753,7 +98011,7 @@ var ActivityTabPage = () => {
97753
98011
  const { variant } = useSettings();
97754
98012
  const navigate = useNavigate();
97755
98013
  const activityStore = useActivityContext();
97756
- const selectedAction = useSelector$1(activityStore, _temp$54);
98014
+ const selectedAction = useSelector$1(activityStore, _temp$53);
97757
98015
  let t0;
97758
98016
  if ($[0] !== selectedAction) {
97759
98017
  t0 = selectedAction.isJust();
@@ -97809,7 +98067,7 @@ var ActivityTabPage = () => {
97809
98067
  } else t2 = $[8];
97810
98068
  return t2;
97811
98069
  };
97812
- function _temp$54(state) {
98070
+ function _temp$53(state) {
97813
98071
  return state.context.selectedAction;
97814
98072
  }
97815
98073
  //#endregion
@@ -97818,7 +98076,7 @@ var useActivityComplete = () => {
97818
98076
  const $ = c(27);
97819
98077
  useTrackPage("activityComplete");
97820
98078
  const activityContext = useActivityContext();
97821
- const t0 = useSelector$1(activityContext, _temp$53);
98079
+ const t0 = useSelector$1(activityContext, _temp$52);
97822
98080
  let t1;
97823
98081
  if ($[0] !== t0) {
97824
98082
  t1 = t0.unsafeCoerce();
@@ -97863,7 +98121,7 @@ var useActivityComplete = () => {
97863
98121
  const metadata = t6;
97864
98122
  let t7;
97865
98123
  if ($[11] !== inputToken) {
97866
- t7 = inputToken.mapOrDefault(_temp6$7, "");
98124
+ t7 = inputToken.mapOrDefault(_temp6$6, "");
97867
98125
  $[11] = inputToken;
97868
98126
  $[12] = t7;
97869
98127
  } else t7 = $[12];
@@ -97909,7 +98167,7 @@ var useActivityComplete = () => {
97909
98167
  } else t10 = $[26];
97910
98168
  return t10;
97911
98169
  };
97912
- function _temp$53(state) {
98170
+ function _temp$52(state) {
97913
98171
  return state.context.selectedAction;
97914
98172
  }
97915
98173
  function _temp2$34(state_0) {
@@ -97928,7 +98186,7 @@ function _temp5$10(yieldDto) {
97928
98186
  provider: yieldDto.provider
97929
98187
  };
97930
98188
  }
97931
- function _temp6$7(y) {
98189
+ function _temp6$6(y) {
97932
98190
  return y.symbol;
97933
98191
  }
97934
98192
  //#endregion
@@ -97939,7 +98197,7 @@ var useActionReview = () => {
97939
98197
  const navigate = useNavigate();
97940
98198
  const { t } = useTranslation();
97941
98199
  const activityContext = useActivityContext();
97942
- const t0 = useSelector$1(activityContext, _temp$52);
98200
+ const t0 = useSelector$1(activityContext, _temp$51);
97943
98201
  let t1;
97944
98202
  if ($[0] !== t0) {
97945
98203
  t1 = t0.unsafeCoerce();
@@ -97973,7 +98231,7 @@ var useActionReview = () => {
97973
98231
  $[8] = t5;
97974
98232
  } else t5 = $[8];
97975
98233
  const transactions = t5;
97976
- const onViewTransactionClick = _temp6$6;
98234
+ const onViewTransactionClick = _temp6$5;
97977
98235
  let t6;
97978
98236
  if ($[9] !== selectedYield) {
97979
98237
  t6 = Maybe.of(selectedYield);
@@ -97983,7 +98241,7 @@ var useActionReview = () => {
97983
98241
  const t7 = useYieldType(t6);
97984
98242
  let t8;
97985
98243
  if ($[11] !== t7) {
97986
- t8 = t7.mapOrDefault(_temp7$5, "");
98244
+ t8 = t7.mapOrDefault(_temp7$4, "");
97987
98245
  $[11] = t7;
97988
98246
  $[12] = t8;
97989
98247
  } else t8 = $[12];
@@ -98089,7 +98347,7 @@ var useActionReview = () => {
98089
98347
  } else t20 = $[45];
98090
98348
  return t20;
98091
98349
  };
98092
- function _temp$52(state) {
98350
+ function _temp$51(state) {
98093
98351
  return state.context.selectedAction;
98094
98352
  }
98095
98353
  function _temp2$33(state_0) {
@@ -98104,12 +98362,12 @@ function _temp4$12(a_0, b) {
98104
98362
  function _temp5$9(tx) {
98105
98363
  return [...tx].sort(_temp4$12);
98106
98364
  }
98107
- function _temp6$6(url) {
98365
+ function _temp6$5(url) {
98108
98366
  return MaybeWindow.ifJust((w) => {
98109
98367
  w.open(url, "_blank");
98110
98368
  });
98111
98369
  }
98112
- function _temp7$5(y) {
98370
+ function _temp7$4(y) {
98113
98371
  return y.review;
98114
98372
  }
98115
98373
  function _temp8$4(tx_0) {
@@ -98250,7 +98508,7 @@ var ActionReviewPage = () => {
98250
98508
  } else t9 = $[31];
98251
98509
  return t9;
98252
98510
  };
98253
- function _temp$51(tx_0) {
98511
+ function _temp$50(tx_0) {
98254
98512
  return tx_0.replaceAll("_", " ");
98255
98513
  }
98256
98514
  function _temp2$32(e) {
@@ -98276,7 +98534,7 @@ function _temp3$20(tx) {
98276
98534
  gap: "1",
98277
98535
  children: [/* @__PURE__ */ jsx(Text$2, {
98278
98536
  color: "textMuted",
98279
- children: Maybe.of(tx.status).map(_temp$51).map(capitalizeFirstLetters).extract()
98537
+ children: Maybe.of(tx.status).map(_temp$50).map(capitalizeFirstLetters).extract()
98280
98538
  }), Maybe.fromNullable(tx.error).map(_temp2$32).extractNullable()]
98281
98539
  })]
98282
98540
  }, tx.id);
@@ -98289,7 +98547,7 @@ function _temp4$11(stx) {
98289
98547
  var ActivityDetailsPage = () => {
98290
98548
  const $ = c(6);
98291
98549
  const activityContext = useActivityContext();
98292
- const t0 = useSelector$1(activityContext, _temp$50);
98550
+ const t0 = useSelector$1(activityContext, _temp$49);
98293
98551
  let t1;
98294
98552
  if ($[0] !== t0) {
98295
98553
  t1 = t0.extractNullable();
@@ -98387,7 +98645,7 @@ var ActivityCompletePage$1 = () => {
98387
98645
  } else t5 = $[18];
98388
98646
  return t5;
98389
98647
  };
98390
- function _temp$50(state) {
98648
+ function _temp$49(state) {
98391
98649
  return state.context.selectedAction;
98392
98650
  }
98393
98651
  function _temp2$31(state_0) {
@@ -98872,7 +99130,7 @@ var Tabs$1 = () => {
98872
99130
  onDashboardYieldCategorySelect(category);
98873
99131
  navigate("/");
98874
99132
  };
98875
- selectedTab = value(current.pathname).pipe(when(startsWith("/activity"), _temp$49), when(startsWith("/manage"), _temp2$30), orElse(_temp3$18));
99133
+ selectedTab = value(current.pathname).pipe(when(startsWith("/activity"), _temp$48), when(startsWith("/manage"), _temp2$30), orElse(_temp3$18));
98876
99134
  $[0] = current.pathname;
98877
99135
  $[1] = navigate;
98878
99136
  $[2] = onDashboardYieldCategorySelect;
@@ -99007,7 +99265,7 @@ var Tabs$1 = () => {
99007
99265
  } else t12 = $[42];
99008
99266
  return t12;
99009
99267
  };
99010
- function _temp$49() {
99268
+ function _temp$48() {
99011
99269
  return "activity";
99012
99270
  }
99013
99271
  function _temp2$30() {
@@ -99896,7 +100154,7 @@ var EarnDetailsHeader = (t0) => {
99896
100154
  } else t11 = $[25];
99897
100155
  let t12;
99898
100156
  if ($[26] !== headerBadges) {
99899
- t12 = headerBadges.map(_temp$48);
100157
+ t12 = headerBadges.map(_temp$47);
99900
100158
  $[26] = headerBadges;
99901
100159
  $[27] = t12;
99902
100160
  } else t12 = $[27];
@@ -100014,7 +100272,7 @@ var formatDetailsTitle = ({ providerName, yieldDto }) => {
100014
100272
  if (getDashboardYieldCategory(yieldDto) !== "stake" || name.toLowerCase().includes(providerName.toLowerCase())) return name;
100015
100273
  return `${name} via ${providerName}`;
100016
100274
  };
100017
- function _temp$48(badge) {
100275
+ function _temp$47(badge) {
100018
100276
  return /* @__PURE__ */ jsx(Box$1, {
100019
100277
  className: badge.tone === "auto" ? headerAutoBadge : headerBadge,
100020
100278
  children: /* @__PURE__ */ jsx(Text$2, {
@@ -100036,7 +100294,7 @@ var EarnDetailsMetrics = (t0) => {
100036
100294
  const { cards } = t0;
100037
100295
  let t1;
100038
100296
  if ($[0] !== cards) {
100039
- t1 = cards.map(_temp$47);
100297
+ t1 = cards.map(_temp$46);
100040
100298
  $[0] = cards;
100041
100299
  $[1] = t1;
100042
100300
  } else t1 = $[1];
@@ -100115,7 +100373,7 @@ var MetricCard = (t0) => {
100115
100373
  } else t5 = $[10];
100116
100374
  return t5;
100117
100375
  };
100118
- function _temp$47(card) {
100376
+ function _temp$46(card) {
100119
100377
  return /* @__PURE__ */ jsx(MetricCard, { ...card }, card.label);
100120
100378
  }
100121
100379
  //#endregion
@@ -119189,7 +119447,7 @@ var HistoryChart = (t0) => {
119189
119447
  let min;
119190
119448
  let t3;
119191
119449
  if ($[4] !== data) {
119192
- const values = data.map(_temp$46);
119450
+ const values = data.map(_temp$45);
119193
119451
  min = Math.min(...values);
119194
119452
  t3 = Math.max(...values);
119195
119453
  $[4] = data;
@@ -119392,7 +119650,7 @@ var HistoryChart = (t0) => {
119392
119650
  } else t20 = $[41];
119393
119651
  return t20;
119394
119652
  };
119395
- function _temp$46(point) {
119653
+ function _temp$45(point) {
119396
119654
  return point.value;
119397
119655
  }
119398
119656
  //#endregion
@@ -119634,7 +119892,7 @@ var useMetaInfo = (t0) => {
119634
119892
  if ($[3] !== stakedBalance || $[4] !== stakedBalanceToken || $[5] !== t) {
119635
119893
  t2 = stakedBalance && stakedBalanceToken ? {
119636
119894
  title: t("details.validators_staked_balance"),
119637
- val: just(new BigNumber(stakedBalance)).filter(_temp$45).map((v_0) => `${formatNumber(v_0, 0)} ${stakedBalanceToken.symbol}`).orDefault("-")
119895
+ val: just(new BigNumber(stakedBalance)).filter(_temp$44).map((v_0) => `${formatNumber(v_0, 0)} ${stakedBalanceToken.symbol}`).orDefault("-")
119638
119896
  } : null;
119639
119897
  $[3] = stakedBalance;
119640
119898
  $[4] = stakedBalanceToken;
@@ -119778,7 +120036,7 @@ var useMetaInfo = (t0) => {
119778
120036
  } else t11 = $[41];
119779
120037
  return t11;
119780
120038
  };
119781
- function _temp$45(v) {
120039
+ function _temp$44(v) {
119782
120040
  return !v.isNaN();
119783
120041
  }
119784
120042
  function _temp2$29(v_1) {
@@ -119976,7 +120234,7 @@ var SelectValidatorList = (t0) => {
119976
120234
  if ($[12] !== groupCounts || $[13] !== t2 || $[14] !== t3) {
119977
120235
  t4 = /* @__PURE__ */ jsx(GroupedVirtualList, {
119978
120236
  increaseViewportBy: t1,
119979
- estimateSize: _temp$44,
120237
+ estimateSize: _temp$43,
119980
120238
  groupCounts,
119981
120239
  "data-rk": "select-validator-list",
119982
120240
  groupContent: t2,
@@ -120006,7 +120264,7 @@ var ValidatorMeta$1 = memo((props) => {
120006
120264
  } else t0 = $[1];
120007
120265
  return t0;
120008
120266
  });
120009
- function _temp$44() {
120267
+ function _temp$43() {
120010
120268
  return 140;
120011
120269
  }
120012
120270
  function _temp2$28(val) {
@@ -120168,7 +120426,7 @@ var SelectValidator = (t0) => {
120168
120426
  let t6;
120169
120427
  let t7;
120170
120428
  if ($[26] !== groupedItemsValues) {
120171
- t6 = groupedItemsValues.flatMap(_temp$43);
120429
+ t6 = groupedItemsValues.flatMap(_temp$42);
120172
120430
  t7 = groupedItemsValues.filter(_temp2$27);
120173
120431
  $[26] = groupedItemsValues;
120174
120432
  $[27] = t6;
@@ -120307,7 +120565,7 @@ var SelectValidator = (t0) => {
120307
120565
  } else t8 = $[72];
120308
120566
  return t8;
120309
120567
  };
120310
- function _temp$43(val_0) {
120568
+ function _temp$42(val_0) {
120311
120569
  return val_0.items;
120312
120570
  }
120313
120571
  function _temp2$27(val_1) {
@@ -120649,7 +120907,7 @@ var ProviderSelectionCard = () => {
120649
120907
  } else t20 = $[51];
120650
120908
  let t21;
120651
120909
  if ($[52] !== selectedValidatorsArr) {
120652
- t21 = new Set(selectedValidatorsArr.map(_temp$42));
120910
+ t21 = new Set(selectedValidatorsArr.map(_temp$41));
120653
120911
  $[52] = selectedValidatorsArr;
120654
120912
  $[53] = t21;
120655
120913
  } else t21 = $[53];
@@ -120773,7 +121031,7 @@ var ExternalLinkIcon = () => {
120773
121031
  } else t0 = $[0];
120774
121032
  return t0;
120775
121033
  };
120776
- function _temp$42(v) {
121034
+ function _temp$41(v) {
120777
121035
  return v.address;
120778
121036
  }
120779
121037
  function _temp2$26(item) {
@@ -121669,7 +121927,7 @@ var useYieldRewardRateHistory = (t0) => {
121669
121927
  const query = useQuery$1(t4);
121670
121928
  let t5;
121671
121929
  if ($[11] !== query.data) {
121672
- t5 = (query.data ?? []).flatMap(_temp$41).sort(_temp2$25);
121930
+ t5 = (query.data ?? []).flatMap(_temp$40).sort(_temp2$25);
121673
121931
  $[11] = query.data;
121674
121932
  $[12] = t5;
121675
121933
  } else t5 = $[12];
@@ -121686,7 +121944,7 @@ var useYieldRewardRateHistory = (t0) => {
121686
121944
  } else t6 = $[15];
121687
121945
  return t6;
121688
121946
  };
121689
- function _temp$41(item) {
121947
+ function _temp$40(item) {
121690
121948
  const date = new Date(item.timestamp);
121691
121949
  const rewardRate = BigNumber(item.rewardRate);
121692
121950
  if (Number.isNaN(date.getTime()) || !rewardRate.isFinite()) return [];
@@ -121749,7 +122007,7 @@ var useYieldTvlHistory = (t0) => {
121749
122007
  const query = useQuery$1(t4);
121750
122008
  let t5;
121751
122009
  if ($[11] !== query.data) {
121752
- t5 = (query.data ?? []).flatMap(_temp$40).sort(_temp2$24);
122010
+ t5 = (query.data ?? []).flatMap(_temp$39).sort(_temp2$24);
121753
122011
  $[11] = query.data;
121754
122012
  $[12] = t5;
121755
122013
  } else t5 = $[12];
@@ -121766,7 +122024,7 @@ var useYieldTvlHistory = (t0) => {
121766
122024
  } else t6 = $[15];
121767
122025
  return t6;
121768
122026
  };
121769
- function _temp$40(item) {
122027
+ function _temp$39(item) {
121770
122028
  const date = new Date(item.timestamp);
121771
122029
  const tvlValue = item.tvlUsd;
121772
122030
  if (!tvlValue) return [];
@@ -121918,7 +122176,7 @@ var EarnDetailsView = (t0) => {
121918
122176
  history: rewardRateHistory,
121919
122177
  onPeriodChange: setRewardRatePeriod,
121920
122178
  period: rewardRatePeriod,
121921
- tickFormatter: _temp$39,
122179
+ tickFormatter: _temp$38,
121922
122180
  title: t("dashboard.earn_details.reward_rate"),
121923
122181
  value: rewardRateFormatted
121924
122182
  });
@@ -122079,7 +122337,7 @@ var EarnDetailsView = (t0) => {
122079
122337
  } else t19 = $[67];
122080
122338
  return t19;
122081
122339
  };
122082
- function _temp$39(value) {
122340
+ function _temp$38(value) {
122083
122341
  return `${formatNumber(value, 2)}%`;
122084
122342
  }
122085
122343
  function _temp2$23(row) {
@@ -123558,7 +123816,7 @@ var ExtraArgsSelection = () => {
123558
123816
  $[11] = validation;
123559
123817
  $[12] = t1;
123560
123818
  } else t1 = $[12];
123561
- t0 = selectedStake.chainNullable(_temp$38).map(t1).extractNullable();
123819
+ t0 = selectedStake.chainNullable(_temp$37).map(t1).extractNullable();
123562
123820
  $[0] = isDashboard;
123563
123821
  $[1] = onTronResourceSelect;
123564
123822
  $[2] = selectedStake;
@@ -123569,7 +123827,7 @@ var ExtraArgsSelection = () => {
123569
123827
  } else t0 = $[6];
123570
123828
  return t0;
123571
123829
  };
123572
- function _temp$38(ss) {
123830
+ function _temp$37(ss) {
123573
123831
  return getYieldActionArg(ss, "enter", "tronResource");
123574
123832
  }
123575
123833
  function _temp2$22(v) {
@@ -123719,7 +123977,7 @@ var RootElementProvider = (t0) => {
123719
123977
  let t2;
123720
123978
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
123721
123979
  t1 = () => {
123722
- MaybeDocument.chainNullable(_temp$37).ifJust((el) => setRootElement(el));
123980
+ MaybeDocument.chainNullable(_temp$36).ifJust((el) => setRootElement(el));
123723
123981
  };
123724
123982
  t2 = [];
123725
123983
  $[0] = t1;
@@ -123746,7 +124004,7 @@ var useRootElement = () => {
123746
124004
  if (value === void 0) throw new Error("RootElementProvider not found in the tree");
123747
124005
  return value;
123748
124006
  };
123749
- function _temp$37(doc) {
124007
+ function _temp$36(doc) {
123750
124008
  return doc.querySelector(rootSelector);
123751
124009
  }
123752
124010
  //#endregion
@@ -124050,101 +124308,6 @@ var Amount = (t0) => {
124050
124308
  return t3;
124051
124309
  };
124052
124310
  //#endregion
124053
- //#region src/hooks/api/use-token-list-yields.ts
124054
- var staleTime$1 = 1e3 * 60 * 2;
124055
- var getUniqueYieldIds = (tokenBalances) => [...new Set(tokenBalances.flatMap((tb) => tb.availableYields))];
124056
- var getMaxYieldRateForToken = (availableYieldIds, yieldsById) => {
124057
- const yields = availableYieldIds.map((id) => yieldsById.get(id)).filter((yieldDto) => !!yieldDto);
124058
- if (yields.length === 0) return null;
124059
- const maxYield = yields.reduce((max, yieldDto) => (yieldDto.rewardRate?.total ?? 0) > (max.rewardRate?.total ?? 0) ? yieldDto : max);
124060
- const rewardType = maxYield.rewardRate?.rateType;
124061
- const rateFormatted = getRewardRateFormatted({ rewardRate: maxYield.rewardRate?.total });
124062
- const rateTypeLabel = getRewardTypeFormatted(rewardType);
124063
- if (rateFormatted === "- %" || !rateTypeLabel) return null;
124064
- return {
124065
- rateFormatted,
124066
- rateTypeLabel
124067
- };
124068
- };
124069
- var useTokenListYields = (tokenBalances) => {
124070
- const $ = c(19);
124071
- const apiClient = useApiClient();
124072
- let t0;
124073
- if ($[0] !== tokenBalances) {
124074
- t0 = getUniqueYieldIds(tokenBalances);
124075
- $[0] = tokenBalances;
124076
- $[1] = t0;
124077
- } else t0 = $[1];
124078
- const yieldIds = t0;
124079
- let t1;
124080
- if ($[2] !== yieldIds) {
124081
- t1 = ["token-list-yields", yieldIds];
124082
- $[2] = yieldIds;
124083
- $[3] = t1;
124084
- } else t1 = $[3];
124085
- const t2 = yieldIds.length > 0;
124086
- let t3;
124087
- if ($[4] !== apiClient || $[5] !== yieldIds) {
124088
- t3 = async (t4) => {
124089
- const { signal } = t4;
124090
- return (await apiClient.withOptions({ signal }).yield.YieldsControllerGetYields({ params: {
124091
- yieldIds,
124092
- limit: yieldIds.length
124093
- } })).items ?? [];
124094
- };
124095
- $[4] = apiClient;
124096
- $[5] = yieldIds;
124097
- $[6] = t3;
124098
- } else t3 = $[6];
124099
- let t4;
124100
- if ($[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
124101
- t4 = {
124102
- queryKey: t1,
124103
- enabled: t2,
124104
- staleTime: staleTime$1,
124105
- queryFn: t3
124106
- };
124107
- $[7] = t1;
124108
- $[8] = t2;
124109
- $[9] = t3;
124110
- $[10] = t4;
124111
- } else t4 = $[10];
124112
- const query = useQuery$1(t4);
124113
- let t5;
124114
- if ($[11] !== query.data) {
124115
- t5 = new Map((query.data ?? []).map(_temp$36));
124116
- $[11] = query.data;
124117
- $[12] = t5;
124118
- } else t5 = $[12];
124119
- const yieldsById = t5;
124120
- let map;
124121
- if ($[13] !== tokenBalances || $[14] !== yieldsById) {
124122
- map = /* @__PURE__ */ new Map();
124123
- for (const tokenBalance of tokenBalances) {
124124
- const maxYieldRate = getMaxYieldRateForToken(tokenBalance.availableYields, yieldsById);
124125
- if (maxYieldRate) map.set(tokenString(tokenBalance.token), maxYieldRate);
124126
- }
124127
- $[13] = tokenBalances;
124128
- $[14] = yieldsById;
124129
- $[15] = map;
124130
- } else map = $[15];
124131
- const maxYieldRatesByToken = map;
124132
- let t6;
124133
- if ($[16] !== maxYieldRatesByToken || $[17] !== query.isLoading) {
124134
- t6 = {
124135
- maxYieldRatesByToken,
124136
- isLoading: query.isLoading
124137
- };
124138
- $[16] = maxYieldRatesByToken;
124139
- $[17] = query.isLoading;
124140
- $[18] = t6;
124141
- } else t6 = $[18];
124142
- return t6;
124143
- };
124144
- function _temp$36(yieldDto) {
124145
- return [yieldDto.id, yieldDto];
124146
- }
124147
- //#endregion
124148
124311
  //#region src/pages/details/earn-page/styles.css.ts
124149
124312
  var selectItemText$1 = "_1a682410";
124150
124313
  var validatorVirtuosoContainer = "_1a682412 _1a682411 yv8y4r8h";
@@ -124159,90 +124322,10 @@ var selectorSummaryChangeButton = "_1a68241j _1a68241i yv8y4r63 yv8y4rlz yv8y4rm
124159
124322
  var selectorSummaryActive = "_1a68241l";
124160
124323
  var addValidatorContainer = "_1a68241p _1a68241o yv8y4rbd yv8y4r63 yv8y4rmd yv8y4rm1 yv8y4r8j yv8y4rmt yv8y4rpn";
124161
124324
  //#endregion
124162
- //#region src/pages/details/earn-page/components/select-token-section/styles.css.ts
124163
- var priceTxt = "_1dlf2pf0";
124164
- var selectTokenSection = createRuntimeFn({
124165
- defaultClassName: "_1dlf2pf6 _1dlf2pf1 yv8y4ry",
124166
- variantClassNames: {
124167
- variant: {
124168
- "default": "_1dlf2pf7 _1dlf2pf2 yv8y4r43",
124169
- utila: "_1dlf2pf8",
124170
- finery: "_1dlf2pf9",
124171
- porto: "_1dlf2pfa"
124172
- },
124173
- state: {
124174
- "default": "_1dlf2pfb",
124175
- danger: "_1dlf2pfc"
124176
- }
124177
- },
124178
- defaultVariants: {},
124179
- compoundVariants: [
124180
- [{ variant: "default" }, "_1dlf2pfd"],
124181
- [{
124182
- state: "danger",
124183
- variant: "utila"
124184
- }, "_1dlf2pf3 yv8y4r4z"],
124185
- [{
124186
- state: "default",
124187
- variant: "utila"
124188
- }, "_1dlf2pfe"],
124189
- [{
124190
- state: "danger",
124191
- variant: "finery"
124192
- }, "_1dlf2pf4 yv8y4r4z"],
124193
- [{
124194
- state: "default",
124195
- variant: "finery"
124196
- }, "_1dlf2pff"],
124197
- [{
124198
- state: "danger",
124199
- variant: "porto"
124200
- }, "_1dlf2pf5 yv8y4r4z"],
124201
- [{
124202
- state: "default",
124203
- variant: "porto"
124204
- }, "_1dlf2pfg"]
124205
- ]
124206
- });
124207
- var selectTokenTitle = createRuntimeFn({
124208
- defaultClassName: "_1dlf2pfh",
124209
- variantClassNames: { variant: {
124210
- "default": "_1dlf2pfi",
124211
- utila: "_1dlf2pfj",
124212
- porto: "_1dlf2pfk"
124213
- } },
124214
- defaultVariants: {},
124215
- compoundVariants: []
124216
- });
124217
- var selectTokenBalance = createRuntimeFn({
124218
- defaultClassName: "_1dlf2pfl",
124219
- variantClassNames: { variant: {
124220
- "default": "_1dlf2pfm",
124221
- utila: "_1dlf2pfn",
124222
- finery: "_1dlf2pfo",
124223
- porto: "_1dlf2pfp"
124224
- } },
124225
- defaultVariants: {},
124226
- compoundVariants: []
124227
- });
124228
- var maxYieldRateText = "_1dlf2pfr _1dlf2pfq yv8y4r36 yv8y4rk";
124229
- var maxYieldRateLabel = "_1dlf2pfs";
124230
- var minMaxContainer = createRuntimeFn({
124231
- defaultClassName: "_1dlf2pfx _1dlf2pft yv8y4r63 yv8y4rmf yv8y4rlz",
124232
- variantClassNames: { variant: {
124233
- "default": "_1dlf2pfy _1dlf2pfu yv8y4rbh yv8y4r8h",
124234
- utila: "_1dlf2pfz _1dlf2pfv yv8y4r8h",
124235
- porto: "_1dlf2pf10 _1dlf2pfw yv8y4r8h",
124236
- zerion: "_1dlf2pf11"
124237
- } },
124238
- defaultVariants: { variant: "default" },
124239
- compoundVariants: []
124240
- });
124241
- //#endregion
124242
124325
  //#region src/pages/details/earn-page/components/select-token-section/select-token-list-item.tsx
124243
124326
  var SelectTokenListItem = memo((t0) => {
124244
- const $ = c(36);
124245
- const { item, isConnected, isSelected, maxYieldRate, onTokenBalanceSelect } = t0;
124327
+ const $ = c(26);
124328
+ const { item, isConnected, isSelected, onTokenBalanceSelect } = t0;
124246
124329
  let t1;
124247
124330
  if ($[0] !== item.amount) {
124248
124331
  t1 = new BigNumber(item.amount).isGreaterThan(0);
@@ -124251,7 +124334,6 @@ var SelectTokenListItem = memo((t0) => {
124251
124334
  } else t1 = $[1];
124252
124335
  const amountGreaterThanZero = t1;
124253
124336
  const trackEvent = useTrackEvent();
124254
- const { t } = useTranslation();
124255
124337
  let t2;
124256
124338
  if ($[2] !== item || $[3] !== onTokenBalanceSelect || $[4] !== trackEvent) {
124257
124339
  t2 = (t3) => {
@@ -124310,66 +124392,17 @@ var SelectTokenListItem = memo((t0) => {
124310
124392
  $[14] = t7;
124311
124393
  } else t7 = $[14];
124312
124394
  let t8;
124313
- if ($[15] !== item.availableYields.length || $[16] !== item.token.name || $[17] !== t) {
124314
- t8 = t("select_token.yields_available", {
124315
- count: item.availableYields.length,
124316
- token_name: item.token.name
124317
- });
124318
- $[15] = item.availableYields.length;
124319
- $[16] = item.token.name;
124320
- $[17] = t;
124321
- $[18] = t8;
124322
- } else t8 = $[18];
124323
- let t9;
124324
- if ($[19] !== t8) {
124325
- t9 = /* @__PURE__ */ jsx(Text$2, {
124395
+ if ($[15] !== item.token.name) {
124396
+ t8 = /* @__PURE__ */ jsx(Text$2, {
124326
124397
  variant: t7,
124327
- children: t8
124328
- });
124329
- $[19] = t8;
124330
- $[20] = t9;
124331
- } else t9 = $[20];
124332
- let t10;
124333
- if ($[21] !== t6 || $[22] !== t9) {
124334
- t10 = /* @__PURE__ */ jsxs(Box$1, {
124335
- display: "flex",
124336
- flexDirection: "column",
124337
- minWidth: "0",
124338
- gap: "1",
124339
- children: [t6, t9]
124398
+ children: item.token.name
124340
124399
  });
124341
- $[21] = t6;
124342
- $[22] = t9;
124343
- $[23] = t10;
124344
- } else t10 = $[23];
124345
- let t11;
124346
- if ($[24] !== maxYieldRate || $[25] !== t) {
124347
- t11 = maxYieldRate ? /* @__PURE__ */ jsxs(Box$1, {
124348
- textAlign: "end",
124349
- flexShrink: 0,
124350
- gap: "1",
124351
- display: "flex",
124352
- flexDirection: "column",
124353
- children: [/* @__PURE__ */ jsx(Text$2, {
124354
- className: maxYieldRateText,
124355
- children: maxYieldRate.rateFormatted
124356
- }), /* @__PURE__ */ jsx(Text$2, {
124357
- className: maxYieldRateLabel,
124358
- variant: {
124359
- type: "muted",
124360
- weight: "normal",
124361
- size: "small"
124362
- },
124363
- children: t("select_token.up_to_rate_type", { rateType: maxYieldRate.rateTypeLabel })
124364
- })]
124365
- }) : null;
124366
- $[24] = maxYieldRate;
124367
- $[25] = t;
124368
- $[26] = t11;
124369
- } else t11 = $[26];
124370
- let t12;
124371
- if ($[27] !== t10 || $[28] !== t11) {
124372
- t12 = /* @__PURE__ */ jsxs(Box$1, {
124400
+ $[15] = item.token.name;
124401
+ $[16] = t8;
124402
+ } else t8 = $[16];
124403
+ let t9;
124404
+ if ($[17] !== t6 || $[18] !== t8) {
124405
+ t9 = /* @__PURE__ */ jsx(Box$1, {
124373
124406
  display: "flex",
124374
124407
  flex: 1,
124375
124408
  justifyContent: "space-between",
@@ -124377,33 +124410,39 @@ var SelectTokenListItem = memo((t0) => {
124377
124410
  marginLeft: "2",
124378
124411
  minWidth: "0",
124379
124412
  gap: "2",
124380
- children: [t10, t11]
124413
+ children: /* @__PURE__ */ jsxs(Box$1, {
124414
+ display: "flex",
124415
+ flexDirection: "column",
124416
+ minWidth: "0",
124417
+ gap: "1",
124418
+ children: [t6, t8]
124419
+ })
124381
124420
  });
124382
- $[27] = t10;
124383
- $[28] = t11;
124384
- $[29] = t12;
124385
- } else t12 = $[29];
124386
- let t13;
124387
- if ($[30] !== _onItemClick || $[31] !== isSelected || $[32] !== t12 || $[33] !== t3 || $[34] !== t4) {
124388
- t13 = /* @__PURE__ */ jsx(SelectModalItemContainer, { children: /* @__PURE__ */ jsxs(SelectModalItem, {
124421
+ $[17] = t6;
124422
+ $[18] = t8;
124423
+ $[19] = t9;
124424
+ } else t9 = $[19];
124425
+ let t10;
124426
+ if ($[20] !== _onItemClick || $[21] !== isSelected || $[22] !== t3 || $[23] !== t4 || $[24] !== t9) {
124427
+ t10 = /* @__PURE__ */ jsx(SelectModalItemContainer, { children: /* @__PURE__ */ jsxs(SelectModalItem, {
124389
124428
  selected: isSelected,
124390
124429
  variant: t3,
124391
124430
  onItemClick: _onItemClick,
124392
- children: [t4, t12]
124431
+ children: [t4, t9]
124393
124432
  }) });
124394
- $[30] = _onItemClick;
124395
- $[31] = isSelected;
124396
- $[32] = t12;
124397
- $[33] = t3;
124398
- $[34] = t4;
124399
- $[35] = t13;
124400
- } else t13 = $[35];
124401
- return t13;
124433
+ $[20] = _onItemClick;
124434
+ $[21] = isSelected;
124435
+ $[22] = t3;
124436
+ $[23] = t4;
124437
+ $[24] = t9;
124438
+ $[25] = t10;
124439
+ } else t10 = $[25];
124440
+ return t10;
124402
124441
  });
124403
124442
  //#endregion
124404
124443
  //#region src/pages/details/earn-page/components/select-token-section/select-token.tsx
124405
124444
  var SelectToken = (t0) => {
124406
- const $ = c(52);
124445
+ const $ = c(49);
124407
124446
  const { canSelect: t1 } = t0;
124408
124447
  const canSelect = t1 === void 0 ? true : t1;
124409
124448
  const { onSelectTokenClose, onTokenBalanceSelect, tokenBalancesData, selectedToken, onTokenSearch, tokenSearch } = useEarnPageContext();
@@ -124415,10 +124454,12 @@ var SelectToken = (t0) => {
124415
124454
  if ($[0] !== selectedToken || $[1] !== tokenBalancesData) {
124416
124455
  let t3;
124417
124456
  if ($[3] !== tokenBalancesData) {
124418
- t3 = (st) => ({
124419
- st,
124420
- tokenBalances: tokenBalancesData.map(_temp$35).extract() ?? []
124421
- });
124457
+ t3 = (st) => {
124458
+ return {
124459
+ st,
124460
+ tokenBalances: tokenBalancesData.map(_temp$35).extract() ?? []
124461
+ };
124462
+ };
124422
124463
  $[3] = tokenBalancesData;
124423
124464
  $[4] = t3;
124424
124465
  } else t3 = $[4];
@@ -124428,47 +124469,40 @@ var SelectToken = (t0) => {
124428
124469
  $[2] = t2;
124429
124470
  } else t2 = $[2];
124430
124471
  const data = t2;
124431
- let t3;
124432
- if ($[5] !== data?.tokenBalances) {
124433
- t3 = data?.tokenBalances ?? [];
124434
- $[5] = data?.tokenBalances;
124435
- $[6] = t3;
124436
- } else t3 = $[6];
124437
- const { maxYieldRatesByToken } = useTokenListYields(t3);
124438
124472
  if (!data) return null;
124439
124473
  if (!canSelect) {
124440
- let t4;
124441
- if ($[7] !== variant) {
124442
- t4 = combineRecipeWithVariant({
124474
+ let t3;
124475
+ if ($[5] !== variant) {
124476
+ t3 = combineRecipeWithVariant({
124443
124477
  variant,
124444
124478
  rec: selectTokenButton
124445
124479
  });
124446
- $[7] = variant;
124480
+ $[5] = variant;
124481
+ $[6] = t3;
124482
+ } else t3 = $[6];
124483
+ let t4;
124484
+ if ($[7] !== data.st) {
124485
+ t4 = /* @__PURE__ */ jsx(TokenIcon, { token: data.st });
124486
+ $[7] = data.st;
124447
124487
  $[8] = t4;
124448
124488
  } else t4 = $[8];
124449
124489
  let t5;
124450
- if ($[9] !== data.st) {
124451
- t5 = /* @__PURE__ */ jsx(TokenIcon, { token: data.st });
124452
- $[9] = data.st;
124453
- $[10] = t5;
124454
- } else t5 = $[10];
124490
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
124491
+ t5 = { weight: "bold" };
124492
+ $[9] = t5;
124493
+ } else t5 = $[9];
124455
124494
  let t6;
124456
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
124457
- t6 = { weight: "bold" };
124495
+ if ($[10] !== data.st.symbol) {
124496
+ t6 = /* @__PURE__ */ jsx(Text$2, {
124497
+ variant: t5,
124498
+ children: data.st.symbol
124499
+ });
124500
+ $[10] = data.st.symbol;
124458
124501
  $[11] = t6;
124459
124502
  } else t6 = $[11];
124460
124503
  let t7;
124461
- if ($[12] !== data.st.symbol) {
124462
- t7 = /* @__PURE__ */ jsx(Text$2, {
124463
- variant: t6,
124464
- children: data.st.symbol
124465
- });
124466
- $[12] = data.st.symbol;
124467
- $[13] = t7;
124468
- } else t7 = $[13];
124469
- let t8;
124470
- if ($[14] !== t4 || $[15] !== t5 || $[16] !== t7) {
124471
- t8 = /* @__PURE__ */ jsxs(Box$1, {
124504
+ if ($[12] !== t3 || $[13] !== t4 || $[14] !== t6) {
124505
+ t7 = /* @__PURE__ */ jsxs(Box$1, {
124472
124506
  display: "flex",
124473
124507
  justifyContent: "center",
124474
124508
  alignItems: "center",
@@ -124477,78 +124511,78 @@ var SelectToken = (t0) => {
124477
124511
  py: "1",
124478
124512
  gap: "2",
124479
124513
  "data-testid": "select-token",
124480
- className: t4,
124481
- children: [t5, t7]
124514
+ className: t3,
124515
+ children: [t4, t6]
124482
124516
  });
124483
- $[14] = t4;
124484
- $[15] = t5;
124485
- $[16] = t7;
124486
- $[17] = t8;
124487
- } else t8 = $[17];
124488
- return t8;
124517
+ $[12] = t3;
124518
+ $[13] = t4;
124519
+ $[14] = t6;
124520
+ $[15] = t7;
124521
+ } else t7 = $[15];
124522
+ return t7;
124489
124523
  }
124524
+ let t3;
124525
+ if ($[16] !== t) {
124526
+ t3 = t("select_token.title");
124527
+ $[16] = t;
124528
+ $[17] = t3;
124529
+ } else t3 = $[17];
124490
124530
  let t4;
124491
- if ($[18] !== t) {
124492
- t4 = t("select_token.title");
124493
- $[18] = t;
124531
+ if ($[18] !== trackEvent) {
124532
+ t4 = () => trackEvent("selectTokenModalOpened");
124533
+ $[18] = trackEvent;
124494
124534
  $[19] = t4;
124495
124535
  } else t4 = $[19];
124496
124536
  let t5;
124497
- if ($[20] !== trackEvent) {
124498
- t5 = () => trackEvent("selectTokenModalOpened");
124499
- $[20] = trackEvent;
124500
- $[21] = t5;
124501
- } else t5 = $[21];
124502
- let t6;
124503
- if ($[22] !== variant) {
124504
- t6 = clsx(pressAnimation, combineRecipeWithVariant({
124537
+ if ($[20] !== variant) {
124538
+ t5 = clsx(pressAnimation, combineRecipeWithVariant({
124505
124539
  variant,
124506
124540
  rec: selectTokenButton
124507
124541
  }));
124508
- $[22] = variant;
124542
+ $[20] = variant;
124543
+ $[21] = t5;
124544
+ } else t5 = $[21];
124545
+ let t6;
124546
+ if ($[22] !== data.st) {
124547
+ t6 = /* @__PURE__ */ jsx(TokenIcon, { token: data.st });
124548
+ $[22] = data.st;
124509
124549
  $[23] = t6;
124510
124550
  } else t6 = $[23];
124511
124551
  let t7;
124512
- if ($[24] !== data.st) {
124513
- t7 = /* @__PURE__ */ jsx(TokenIcon, { token: data.st });
124514
- $[24] = data.st;
124515
- $[25] = t7;
124516
- } else t7 = $[25];
124552
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
124553
+ t7 = { weight: "bold" };
124554
+ $[24] = t7;
124555
+ } else t7 = $[24];
124517
124556
  let t8;
124518
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
124519
- t8 = { weight: "bold" };
124557
+ if ($[25] !== data.st.symbol) {
124558
+ t8 = /* @__PURE__ */ jsx(Text$2, {
124559
+ variant: t7,
124560
+ children: data.st.symbol
124561
+ });
124562
+ $[25] = data.st.symbol;
124520
124563
  $[26] = t8;
124521
124564
  } else t8 = $[26];
124522
124565
  let t9;
124523
- if ($[27] !== data.st.symbol) {
124524
- t9 = /* @__PURE__ */ jsx(Text$2, {
124525
- variant: t8,
124526
- children: data.st.symbol
124527
- });
124528
- $[27] = data.st.symbol;
124529
- $[28] = t9;
124530
- } else t9 = $[28];
124531
- let t10;
124532
- if ($[29] !== t7 || $[30] !== t9) {
124533
- t10 = /* @__PURE__ */ jsxs(Box$1, {
124566
+ if ($[27] !== t6 || $[28] !== t8) {
124567
+ t9 = /* @__PURE__ */ jsxs(Box$1, {
124534
124568
  marginRight: "2",
124535
124569
  display: "flex",
124536
124570
  justifyContent: "center",
124537
124571
  alignItems: "center",
124538
- children: [t7, t9]
124572
+ children: [t6, t8]
124539
124573
  });
124540
- $[29] = t7;
124541
- $[30] = t9;
124542
- $[31] = t10;
124543
- } else t10 = $[31];
124574
+ $[27] = t6;
124575
+ $[28] = t8;
124576
+ $[29] = t9;
124577
+ } else t9 = $[29];
124578
+ let t10;
124579
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
124580
+ t10 = /* @__PURE__ */ jsx(CaretDownIcon, {});
124581
+ $[30] = t10;
124582
+ } else t10 = $[30];
124544
124583
  let t11;
124545
- if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
124546
- t11 = /* @__PURE__ */ jsx(CaretDownIcon, {});
124547
- $[32] = t11;
124548
- } else t11 = $[32];
124549
- let t12;
124550
- if ($[33] !== t10 || $[34] !== t6) {
124551
- t12 = /* @__PURE__ */ jsx(Trigger$2, {
124584
+ if ($[31] !== t5 || $[32] !== t9) {
124585
+ t11 = /* @__PURE__ */ jsx(Trigger$2, {
124552
124586
  asChild: true,
124553
124587
  children: /* @__PURE__ */ jsxs(Box$1, {
124554
124588
  as: "button",
@@ -124559,62 +124593,60 @@ var SelectToken = (t0) => {
124559
124593
  px: "2",
124560
124594
  py: "1",
124561
124595
  "data-testid": "select-token",
124562
- className: t6,
124563
- children: [t10, t11]
124596
+ className: t5,
124597
+ children: [t9, t10]
124564
124598
  })
124565
124599
  });
124566
- $[33] = t10;
124567
- $[34] = t6;
124568
- $[35] = t12;
124569
- } else t12 = $[35];
124570
- let t13;
124571
- if ($[36] !== data.st || $[37] !== isConnected || $[38] !== maxYieldRatesByToken || $[39] !== onTokenBalanceSelect) {
124572
- t13 = (_index, item) => /* @__PURE__ */ jsx(SelectTokenListItem, {
124600
+ $[31] = t5;
124601
+ $[32] = t9;
124602
+ $[33] = t11;
124603
+ } else t11 = $[33];
124604
+ let t12;
124605
+ if ($[34] !== data.st || $[35] !== isConnected || $[36] !== onTokenBalanceSelect) {
124606
+ t12 = (_index, item) => /* @__PURE__ */ jsx(SelectTokenListItem, {
124573
124607
  item,
124574
124608
  isSelected: equalTokens(item.token, data.st),
124575
- maxYieldRate: maxYieldRatesByToken.get(tokenString(item.token)),
124576
124609
  onTokenBalanceSelect,
124577
124610
  isConnected
124578
124611
  });
124579
- $[36] = data.st;
124580
- $[37] = isConnected;
124581
- $[38] = maxYieldRatesByToken;
124582
- $[39] = onTokenBalanceSelect;
124583
- $[40] = t13;
124584
- } else t13 = $[40];
124585
- let t14;
124586
- if ($[41] !== data.tokenBalances || $[42] !== t13) {
124587
- t14 = /* @__PURE__ */ jsx(VirtualList, {
124612
+ $[34] = data.st;
124613
+ $[35] = isConnected;
124614
+ $[36] = onTokenBalanceSelect;
124615
+ $[37] = t12;
124616
+ } else t12 = $[37];
124617
+ let t13;
124618
+ if ($[38] !== data.tokenBalances || $[39] !== t12) {
124619
+ t13 = /* @__PURE__ */ jsx(VirtualList, {
124588
124620
  className: validatorVirtuosoContainer,
124589
124621
  data: data.tokenBalances,
124590
124622
  estimateSize: _temp2$21,
124591
- itemContent: t13
124623
+ itemContent: t12
124592
124624
  });
124593
- $[41] = data.tokenBalances;
124594
- $[42] = t13;
124595
- $[43] = t14;
124596
- } else t14 = $[43];
124597
- let t15;
124598
- if ($[44] !== onSelectTokenClose || $[45] !== onTokenSearch || $[46] !== t12 || $[47] !== t14 || $[48] !== t4 || $[49] !== t5 || $[50] !== tokenSearch) {
124599
- t15 = /* @__PURE__ */ jsx(SelectModal, {
124600
- title: t4,
124625
+ $[38] = data.tokenBalances;
124626
+ $[39] = t12;
124627
+ $[40] = t13;
124628
+ } else t13 = $[40];
124629
+ let t14;
124630
+ if ($[41] !== onSelectTokenClose || $[42] !== onTokenSearch || $[43] !== t11 || $[44] !== t13 || $[45] !== t3 || $[46] !== t4 || $[47] !== tokenSearch) {
124631
+ t14 = /* @__PURE__ */ jsx(SelectModal, {
124632
+ title: t3,
124601
124633
  onSearch: onTokenSearch,
124602
124634
  searchValue: tokenSearch,
124603
124635
  onClose: onSelectTokenClose,
124604
- onOpen: t5,
124605
- trigger: t12,
124606
- children: t14
124636
+ onOpen: t4,
124637
+ trigger: t11,
124638
+ children: t13
124607
124639
  });
124608
- $[44] = onSelectTokenClose;
124609
- $[45] = onTokenSearch;
124610
- $[46] = t12;
124611
- $[47] = t14;
124612
- $[48] = t4;
124613
- $[49] = t5;
124614
- $[50] = tokenSearch;
124615
- $[51] = t15;
124616
- } else t15 = $[51];
124617
- return t15;
124640
+ $[41] = onSelectTokenClose;
124641
+ $[42] = onTokenSearch;
124642
+ $[43] = t11;
124643
+ $[44] = t13;
124644
+ $[45] = t3;
124645
+ $[46] = t4;
124646
+ $[47] = tokenSearch;
124647
+ $[48] = t14;
124648
+ } else t14 = $[48];
124649
+ return t14;
124618
124650
  };
124619
124651
  function _temp$35(v) {
124620
124652
  return v.filtered;
@@ -124623,6 +124655,84 @@ function _temp2$21() {
124623
124655
  return 60;
124624
124656
  }
124625
124657
  //#endregion
124658
+ //#region src/pages/details/earn-page/components/select-token-section/styles.css.ts
124659
+ var priceTxt = "_1dlf2pf0";
124660
+ var selectTokenSection = createRuntimeFn({
124661
+ defaultClassName: "_1dlf2pf6 _1dlf2pf1 yv8y4ry",
124662
+ variantClassNames: {
124663
+ variant: {
124664
+ "default": "_1dlf2pf7 _1dlf2pf2 yv8y4r43",
124665
+ utila: "_1dlf2pf8",
124666
+ finery: "_1dlf2pf9",
124667
+ porto: "_1dlf2pfa"
124668
+ },
124669
+ state: {
124670
+ "default": "_1dlf2pfb",
124671
+ danger: "_1dlf2pfc"
124672
+ }
124673
+ },
124674
+ defaultVariants: {},
124675
+ compoundVariants: [
124676
+ [{ variant: "default" }, "_1dlf2pfd"],
124677
+ [{
124678
+ state: "danger",
124679
+ variant: "utila"
124680
+ }, "_1dlf2pf3 yv8y4r4z"],
124681
+ [{
124682
+ state: "default",
124683
+ variant: "utila"
124684
+ }, "_1dlf2pfe"],
124685
+ [{
124686
+ state: "danger",
124687
+ variant: "finery"
124688
+ }, "_1dlf2pf4 yv8y4r4z"],
124689
+ [{
124690
+ state: "default",
124691
+ variant: "finery"
124692
+ }, "_1dlf2pff"],
124693
+ [{
124694
+ state: "danger",
124695
+ variant: "porto"
124696
+ }, "_1dlf2pf5 yv8y4r4z"],
124697
+ [{
124698
+ state: "default",
124699
+ variant: "porto"
124700
+ }, "_1dlf2pfg"]
124701
+ ]
124702
+ });
124703
+ var selectTokenTitle = createRuntimeFn({
124704
+ defaultClassName: "_1dlf2pfh",
124705
+ variantClassNames: { variant: {
124706
+ "default": "_1dlf2pfi",
124707
+ utila: "_1dlf2pfj",
124708
+ porto: "_1dlf2pfk"
124709
+ } },
124710
+ defaultVariants: {},
124711
+ compoundVariants: []
124712
+ });
124713
+ var selectTokenBalance = createRuntimeFn({
124714
+ defaultClassName: "_1dlf2pfl",
124715
+ variantClassNames: { variant: {
124716
+ "default": "_1dlf2pfm",
124717
+ utila: "_1dlf2pfn",
124718
+ finery: "_1dlf2pfo",
124719
+ porto: "_1dlf2pfp"
124720
+ } },
124721
+ defaultVariants: {},
124722
+ compoundVariants: []
124723
+ });
124724
+ var minMaxContainer = createRuntimeFn({
124725
+ defaultClassName: "_1dlf2pfu _1dlf2pfq yv8y4r63 yv8y4rmf yv8y4rlz",
124726
+ variantClassNames: { variant: {
124727
+ "default": "_1dlf2pfv _1dlf2pfr yv8y4rbh yv8y4r8h",
124728
+ utila: "_1dlf2pfw _1dlf2pfs yv8y4r8h",
124729
+ porto: "_1dlf2pfx _1dlf2pft yv8y4r8h",
124730
+ zerion: "_1dlf2pfy"
124731
+ } },
124732
+ defaultVariants: { variant: "default" },
124733
+ compoundVariants: []
124734
+ });
124735
+ //#endregion
124626
124736
  //#region src/pages/details/earn-page/components/select-token-section/title.tsx
124627
124737
  var SelectTokenTitle = () => {
124628
124738
  const $ = c(4);
@@ -126234,72 +126344,74 @@ var SelectYieldSection = () => {
126234
126344
  t1 = isLoading ? /* @__PURE__ */ jsx(Box$1, {
126235
126345
  marginTop: "2",
126236
126346
  children: /* @__PURE__ */ jsx(ContentLoaderSquare, { heightPx: 112.5 })
126237
- }) : selectedStakeData.map((val) => val.all.length === 0 ? /* @__PURE__ */ jsx(Box$1, {
126238
- my: "4",
126239
- display: "flex",
126240
- justifyContent: "center",
126241
- alignItems: "center",
126242
- children: /* @__PURE__ */ jsx(Text$2, { children: t("details.no_opportunities") })
126243
- }) : /* @__PURE__ */ jsxs(Box$1, { children: [
126244
- variant !== "zerion" && variant !== "utila" && variant !== "porto" && /* @__PURE__ */ jsx(Box$1, {
126245
- my: "2",
126246
- children: /* @__PURE__ */ jsx(Text$2, { children: t("details.earn") })
126247
- }),
126248
- /* @__PURE__ */ jsxs(Box$1, {
126249
- "data-rk": "stake-yield-section",
126250
- background: "stakeSectionBackground",
126251
- borderRadius: "xl",
126252
- marginTop: "2",
126253
- py: "4",
126254
- px: "4",
126255
- className: combineRecipeWithVariant({
126256
- rec: selectYieldSection,
126257
- variant
126347
+ }) : selectedStakeData.map((val) => {
126348
+ return (dashboardVariant ? val.filtered.length : val.all.length) === 0 ? /* @__PURE__ */ jsx(Box$1, {
126349
+ my: "4",
126350
+ display: "flex",
126351
+ justifyContent: "center",
126352
+ alignItems: "center",
126353
+ children: /* @__PURE__ */ jsx(Text$2, { children: t("details.no_opportunities") })
126354
+ }) : /* @__PURE__ */ jsxs(Box$1, { children: [
126355
+ variant !== "zerion" && variant !== "utila" && variant !== "porto" && /* @__PURE__ */ jsx(Box$1, {
126356
+ my: "2",
126357
+ children: /* @__PURE__ */ jsx(Text$2, { children: t("details.earn") })
126258
126358
  }),
126259
- children: [
126260
- variant === "zerion" && /* @__PURE__ */ jsx(Box$1, {
126261
- my: "1",
126262
- children: /* @__PURE__ */ jsx(Text$2, { children: t("details.earn") })
126359
+ /* @__PURE__ */ jsxs(Box$1, {
126360
+ "data-rk": "stake-yield-section",
126361
+ background: "stakeSectionBackground",
126362
+ borderRadius: "xl",
126363
+ marginTop: "2",
126364
+ py: "4",
126365
+ px: "4",
126366
+ className: combineRecipeWithVariant({
126367
+ rec: selectYieldSection,
126368
+ variant
126263
126369
  }),
126264
- /* @__PURE__ */ jsxs(Box$1, {
126265
- display: "flex",
126266
- justifyContent: "space-between",
126267
- alignItems: "center",
126268
- children: [/* @__PURE__ */ jsx(Box$1, {
126269
- minWidth: "0",
126270
- display: "flex",
126271
- marginRight: "2",
126272
- flex: 1,
126273
- children: /* @__PURE__ */ jsx(Box$1, {
126274
- position: "relative",
126275
- "data-testid": "estimated-reward__percent",
126276
- children: /* @__PURE__ */ jsx(motion.div, {
126277
- className: apyYield,
126278
- children: yieldPerc
126279
- })
126280
- })
126281
- }), /* @__PURE__ */ jsx(Box$1, {
126370
+ children: [
126371
+ variant === "zerion" && /* @__PURE__ */ jsx(Box$1, {
126372
+ my: "1",
126373
+ children: /* @__PURE__ */ jsx(Text$2, { children: t("details.earn") })
126374
+ }),
126375
+ /* @__PURE__ */ jsxs(Box$1, {
126282
126376
  display: "flex",
126283
- justifyContent: "center",
126377
+ justifyContent: "space-between",
126284
126378
  alignItems: "center",
126285
- children: /* @__PURE__ */ jsx(SelectOpportunity, {})
126286
- })]
126287
- }),
126288
- variant !== "zerion" && /* @__PURE__ */ jsx(SelectYieldRewardDetails, {})
126289
- ]
126290
- }),
126291
- variant !== "zerion" && !dashboardVariant && riskSummary,
126292
- variant === "zerion" && /* @__PURE__ */ jsxs(Box$1, {
126293
- display: "flex",
126294
- flexDirection: "column",
126295
- gap: "3",
126296
- children: [
126297
- /* @__PURE__ */ jsx(SelectYieldRewardDetails, {}),
126298
- !dashboardVariant && riskSummary,
126299
- /* @__PURE__ */ jsx(Divider, {})
126300
- ]
126301
- })
126302
- ] })).extractNullable();
126379
+ children: [/* @__PURE__ */ jsx(Box$1, {
126380
+ minWidth: "0",
126381
+ display: "flex",
126382
+ marginRight: "2",
126383
+ flex: 1,
126384
+ children: /* @__PURE__ */ jsx(Box$1, {
126385
+ position: "relative",
126386
+ "data-testid": "estimated-reward__percent",
126387
+ children: /* @__PURE__ */ jsx(motion.div, {
126388
+ className: apyYield,
126389
+ children: yieldPerc
126390
+ })
126391
+ })
126392
+ }), /* @__PURE__ */ jsx(Box$1, {
126393
+ display: "flex",
126394
+ justifyContent: "center",
126395
+ alignItems: "center",
126396
+ children: /* @__PURE__ */ jsx(SelectOpportunity, {})
126397
+ })]
126398
+ }),
126399
+ variant !== "zerion" && /* @__PURE__ */ jsx(SelectYieldRewardDetails, {})
126400
+ ]
126401
+ }),
126402
+ variant !== "zerion" && !dashboardVariant && riskSummary,
126403
+ variant === "zerion" && /* @__PURE__ */ jsxs(Box$1, {
126404
+ display: "flex",
126405
+ flexDirection: "column",
126406
+ gap: "3",
126407
+ children: [
126408
+ /* @__PURE__ */ jsx(SelectYieldRewardDetails, {}),
126409
+ !dashboardVariant && riskSummary,
126410
+ /* @__PURE__ */ jsx(Divider, {})
126411
+ ]
126412
+ })
126413
+ ] });
126414
+ }).extractNullable();
126303
126415
  $[2] = dashboardVariant;
126304
126416
  $[3] = isLoading;
126305
126417
  $[4] = riskSummary;
@@ -126837,7 +126949,7 @@ var usePositionListItem$1 = (item) => {
126837
126949
  const rewardRateAverage = t4;
126838
126950
  let t5;
126839
126951
  if ($[12] !== providersDetails) {
126840
- t5 = providersDetails.chain(_temp5$7).chainNullable(_temp6$5).map(_temp7$4).extractNullable();
126952
+ t5 = providersDetails.chain(_temp5$7).chainNullable(_temp6$4).map(_temp7$3).extractNullable();
126841
126953
  $[12] = providersDetails;
126842
126954
  $[13] = t5;
126843
126955
  } else t5 = $[13];
@@ -126938,10 +127050,10 @@ function _temp4$7(v) {
126938
127050
  function _temp5$7(val_2) {
126939
127051
  return List.find(_temp4$7, val_2);
126940
127052
  }
126941
- function _temp6$5(val_3) {
127053
+ function _temp6$4(val_3) {
126942
127054
  return val_3.status;
126943
127055
  }
126944
- function _temp7$4(v_0) {
127056
+ function _temp7$3(v_0) {
126945
127057
  return v_0;
126946
127058
  }
126947
127059
  function _temp8$3(y) {
@@ -127851,7 +127963,7 @@ var SummaryProvider = (t0) => {
127851
127963
  const allPositionsQuery = t4;
127852
127964
  let t5;
127853
127965
  if ($[17] !== rewardsSummaryQuery.data) {
127854
- t5 = Object.values(rewardsSummaryQuery.data ?? {}).map(_temp6$4);
127966
+ t5 = Object.values(rewardsSummaryQuery.data ?? {}).map(_temp6$3);
127855
127967
  $[17] = rewardsSummaryQuery.data;
127856
127968
  $[18] = t5;
127857
127969
  } else t5 = $[18];
@@ -127903,7 +128015,7 @@ var SummaryProvider = (t0) => {
127903
128015
  });
127904
128016
  return {
127905
128017
  rewardsPositions,
127906
- rewardsPositionsTotalSum: rewardsPositions.reduce(_temp7$3, new BigNumber(0)),
128018
+ rewardsPositionsTotalSum: rewardsPositions.reduce(_temp7$2, new BigNumber(0)),
127907
128019
  rewardsPositionsLastMonthSum: rewardsPositions.reduce(_temp8$2, new BigNumber(0)),
127908
128020
  rewardsPositionsLastWeekSum: rewardsPositions.reduce(_temp9$1, new BigNumber(0))
127909
128021
  };
@@ -128075,10 +128187,10 @@ function _temp4$5(val_0) {
128075
128187
  function _temp5$5(acc_0, p_1) {
128076
128188
  return acc_0.plus(p_1.usdAmount);
128077
128189
  }
128078
- function _temp6$4(v) {
128190
+ function _temp6$3(v) {
128079
128191
  return v.token;
128080
128192
  }
128081
- function _temp7$3(acc_1, p_2) {
128193
+ function _temp7$2(acc_1, p_2) {
128082
128194
  return acc_1.plus(p_2.total);
128083
128195
  }
128084
128196
  function _temp8$2(acc_2, p_3) {
@@ -128648,7 +128760,7 @@ var usePendingActions = () => {
128648
128760
  const onPendingActionClick = (t5) => {
128649
128761
  const { yieldBalance, pendingActionDto } = t5;
128650
128762
  trackEvent("pendingActionClicked", {
128651
- yieldId: integrationData.map(_temp6$3).extract(),
128763
+ yieldId: integrationData.map(_temp6$2).extract(),
128652
128764
  type: pendingActionDto.type
128653
128765
  });
128654
128766
  if (PAMultiValidatorsRequired(pendingActionDto) || PASingleValidatorRequired(pendingActionDto)) return validatorAddressesHandling.openModal({
@@ -128762,7 +128874,7 @@ function _temp4$4(val_1) {
128762
128874
  function _temp5$4(v_0) {
128763
128875
  return `$${defaultFormattedNumber(v_0)}`;
128764
128876
  }
128765
- function _temp6$3(v_1) {
128877
+ function _temp6$2(v_1) {
128766
128878
  return v_1.id;
128767
128879
  }
128768
128880
  //#endregion
@@ -128777,12 +128889,11 @@ var useStakeExitRequestDto = () => {
128777
128889
  if ($[7] !== additionalAddresses || $[8] !== unstakeAmount || $[9] !== unstakeUseMaxAmount) {
128778
128890
  t1 = (val) => {
128779
128891
  const validatorsOrProvider = just(null).chain(() => {
128780
- if (isYieldIntegrationAggregator(val.integrationData)) return List.find(_temp$18, val.stakedOrLiquidBalances).map(_temp2$9);
128781
- if (getYieldActionArg(val.integrationData, "exit", "validatorAddresses")?.required) return List.find(_temp3$4, val.stakedOrLiquidBalances).map(_temp5$3);
128782
- if (getYieldActionArg(val.integrationData, "exit", "validatorAddress")?.required) return List.find(_temp6$2, val.stakedOrLiquidBalances).map((b_4) => {
128783
- const subnetId = Maybe.fromNullable(getYieldActionArg(val.integrationData, "exit", "subnetId")?.required).chainNullable(() => b_4.validator).chainNullable(_temp7$2).extract();
128892
+ if (getYieldActionArg(val.integrationData, "exit", "validatorAddresses")?.required) return List.find(_temp$18, val.stakedOrLiquidBalances).map(_temp3$4);
128893
+ if (getYieldActionArg(val.integrationData, "exit", "validatorAddress")?.required) return List.find(_temp4$3, val.stakedOrLiquidBalances).map((b_2) => {
128894
+ const subnetId = Maybe.fromNullable(getYieldActionArg(val.integrationData, "exit", "subnetId")?.required).chainNullable(() => b_2.validator).chainNullable(_temp5$3).extract();
128784
128895
  return {
128785
- validatorAddress: b_4.validator?.address,
128896
+ validatorAddress: b_2.validator?.address,
128786
128897
  subnetId
128787
128898
  };
128788
128899
  });
@@ -128827,27 +128938,18 @@ var useStakeExitRequestDto = () => {
128827
128938
  return t0;
128828
128939
  };
128829
128940
  function _temp$18(b) {
128830
- return !!b.validator?.providerId;
128831
- }
128832
- function _temp2$9(b_0) {
128833
- return {
128834
- providerId: b_0.validator?.providerId,
128835
- validatorAddress: b_0.validator?.address
128836
- };
128837
- }
128838
- function _temp3$4(b_1) {
128839
- return !!b_1.validators?.length;
128941
+ return !!b.validators?.length;
128840
128942
  }
128841
- function _temp4$3(validator) {
128943
+ function _temp2$9(validator) {
128842
128944
  return validator.address;
128843
128945
  }
128844
- function _temp5$3(b_2) {
128845
- return { validatorAddresses: b_2.validators?.map(_temp4$3) ?? [] };
128946
+ function _temp3$4(b_0) {
128947
+ return { validatorAddresses: b_0.validators?.map(_temp2$9) ?? [] };
128846
128948
  }
128847
- function _temp6$2(b_3) {
128848
- return !!b_3.validator?.address;
128949
+ function _temp4$3(b_1) {
128950
+ return !!b_1.validator?.address;
128849
128951
  }
128850
- function _temp7$2(validator_0) {
128952
+ function _temp5$3(validator_0) {
128851
128953
  return validator_0.subnet?.id;
128852
128954
  }
128853
128955
  //#endregion