@stakekit/widget 0.0.274 → 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 (56) 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 +2182 -2285
  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 +12 -16
  8. package/dist/types/hooks/api/use-dashboard-yield-catalog.d.ts +4 -1
  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 +3 -8
  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 +10 -2
  14. package/dist/types/pages/details/earn-page/components/select-token-section/select-token-list-item.d.ts +1 -5
  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 +3 -5
  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-CibIan8y.js → basic-AvmmQyRT.js} +1 -1
  26. package/dist/website/assets/{basic-BVJnMIHl.js → basic-B4L21H7R.js} +1 -1
  27. package/dist/website/assets/{browser--EMMYaan.js → browser-CD2gtnKg.js} +1 -1
  28. package/dist/website/assets/{build-DFEPAT8y.js → build-CEL1SZmV.js} +1 -1
  29. package/dist/website/assets/{build-BPw0SHWb.js → build-DWB27dsZ.js} +1 -1
  30. package/dist/website/assets/{cardano-connector-CbHZBb34.js → cardano-connector-BNJvqm1_.js} +1 -1
  31. package/dist/website/assets/{core-BSLy_t4A.js → core-NRhVeH3P.js} +2 -2
  32. package/dist/website/assets/{dist-BRCQU1Li.js → dist-CH4nKZqs.js} +1 -1
  33. package/dist/website/assets/{dist-DAbkzFAO.js → dist-DRLRXyTA.js} +1 -1
  34. package/dist/website/assets/en_US-IFPOGBSL-DcKUUZBp.js +1 -0
  35. package/dist/website/assets/{esm-FztE-O2S.js → esm-CX7v7VH6.js} +1 -1
  36. package/dist/website/assets/{exports-DiWzDOxG.js → exports-CZja-uIB.js} +1 -1
  37. package/dist/website/assets/index-BEIkkHR9.js +2044 -0
  38. package/dist/website/assets/{index-E_6jknHw.css → index-BmH6Rgkr.css} +1 -1
  39. package/dist/website/assets/{index.es-D3Xa7Qme.js → index.es-C4PtkNtC.js} +2 -2
  40. package/dist/website/assets/{ledger-connector-6wqonZoy.js → ledger-connector-CQI9gS0Q.js} +1 -1
  41. package/dist/website/assets/{receive-BN_rE1dd.js → receive-D87X5CO9.js} +1 -1
  42. package/dist/website/assets/{registry-DLj0P6dj.js → registry-DFrHgvrU.js} +1 -1
  43. package/dist/website/assets/{safe-connector-NQlNJxmf.js → safe-connector-D5A7hhAW.js} +1 -1
  44. package/dist/website/assets/{socials-C3M2JNCz.js → socials-DlOk7Wls.js} +1 -1
  45. package/dist/website/assets/{solana-connector-hzwYOzto.js → solana-connector-C1qGbaG8.js} +1 -1
  46. package/dist/website/assets/{substrate-connector-CCxDFYG6.js → substrate-connector-DfJfljNz.js} +1 -1
  47. package/dist/website/assets/{ton-connector-DlVKNF8w.js → ton-connector-DA1-w57X.js} +1 -1
  48. package/dist/website/assets/{tron-connector-C6xS9wMC.js → tron-connector-BTe1GdWY.js} +3 -3
  49. package/dist/website/assets/tx-zX2fdmDi.js +1 -0
  50. package/dist/website/assets/{wallet-manager-BxPcB4lR.js → wallet-manager-pYzGZQVw.js} +3 -3
  51. package/dist/website/assets/{wui-qr-code-CNh2d2fT.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-BzV0u3lE.js +0 -1
  55. package/dist/website/assets/index-BIOEiLJw.js +0 -2044
  56. package/dist/website/assets/tx-CXZ9mGxZ.js +0 -1
@@ -1,7 +1,9 @@
1
- import type { Yield } from "../../../domain/types/yields";
2
- export declare const SelectOpportunityListItem: ({ item, onYieldSelect, testId, selected, }: {
3
- item: Yield;
4
- onYieldSelect: (item: Yield) => void;
1
+ import type { YieldBase } from "../../../domain/types/yields";
2
+ type SelectOpportunityListItemProps<T extends YieldBase> = {
3
+ item: T;
4
+ onYieldSelect: (item: T) => void;
5
5
  testId?: string;
6
6
  selected?: boolean;
7
- }) => import("react/jsx-runtime").JSX.Element;
7
+ };
8
+ export declare const SelectOpportunityListItem: <T extends YieldBase>({ item, onYieldSelect, testId, selected, }: SelectOpportunityListItemProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -7,7 +7,7 @@ import type { InitParams } from "./init-params";
7
7
  import type { PositionsData } from "./positions";
8
8
  import type { TokenBalanceScanResponseDto } from "./token-balance";
9
9
  import type { TokenString } from "./tokens";
10
- import { type Yield } from "./yields";
10
+ import { type Yield, type YieldBase } from "./yields";
11
11
  export type PreferredTokenYieldsPerNetwork = {
12
12
  [Key in SupportedSKChains]?: Record<TokenString, "*" | (Yield["id"] & {})>;
13
13
  };
@@ -20,7 +20,7 @@ export declare const getInitialToken: (args: {
20
20
  }) => import("purify-ts/Maybe").Maybe<import("../../generated/api/legacy").TokenDto>;
21
21
  export declare const canBeInitialYield: (args: {
22
22
  initQueryParams: Maybe<InitParams>;
23
- yieldDto: Yield;
23
+ yieldDto: YieldBase;
24
24
  tokenBalanceAmount: BigNumber;
25
25
  positionsData: PositionsData;
26
26
  }) => boolean;
@@ -33,5 +33,5 @@ export declare const isForceMaxAmount: (args: {
33
33
  maximum?: number | null;
34
34
  } | null | undefined) => boolean;
35
35
  export declare const isNetworkWithEnterMinBasedOnPosition: (network: Networks) => boolean;
36
- export declare const getMinStakeAmount: (yieldDto: Yield, positionsData: PositionsData) => BigNumber;
36
+ export declare const getMinStakeAmount: (yieldDto: YieldBase, positionsData: PositionsData) => BigNumber;
37
37
  export declare const getMinUnstakeAmount: (yieldDto: Yield, pricePerShare: string | null) => BigNumber;
@@ -1,12 +1,11 @@
1
1
  import type { TFunction } from "i18next";
2
- import type { YieldDto as OldYieldDto } from "../../generated/api/legacy";
3
2
  import type { YieldType as ApiYieldType, ArgumentFieldDto, ProviderDto, ValidatorDto, YieldDto as YieldApiYieldDto, YieldRiskEntryDto } from "../../generated/api/yield";
4
3
  import type { SupportedSKChains } from "./chains";
4
+ export type YieldProviderDetails = ProviderDto;
5
5
  export type Yield = YieldApiYieldDto & {
6
- __fallback__: OldYieldDto;
7
6
  provider?: YieldProviderDetails;
8
7
  };
9
- export type YieldProviderDetails = ProviderDto;
8
+ export type YieldBase = Yield;
10
9
  type YieldRiskRatingTone = "positive" | "warning" | "danger" | "neutral";
11
10
  type KnownYieldRiskRatingSource = YieldRiskEntryDto["source"];
12
11
  type YieldRiskRatingSource = KnownYieldRiskRatingSource | (string & {});
@@ -47,16 +46,16 @@ export type DashboardYieldCategory = "stake" | "defi" | "rwa";
47
46
  export declare const dashboardYieldCategories: readonly ["stake", "defi", "rwa"];
48
47
  export declare const getApiYieldTypesForDashboardCategory: (category: DashboardYieldCategory) => ApiYieldType[];
49
48
  export declare const getDashboardYieldCategoryForApiYieldType: (yieldType: ApiYieldType) => DashboardYieldCategory;
50
- export declare const getDashboardYieldCategory: (yieldDto: Yield) => DashboardYieldCategory | null;
49
+ export declare const getDashboardYieldCategory: (yieldDto: YieldBase) => DashboardYieldCategory | null;
51
50
  export declare const filterValidators: ({ validatorsConfig, validators, network, yieldId, }: {
52
51
  validatorsConfig: ValidatorsConfig;
53
52
  validators: ValidatorDto[];
54
53
  network: Yield["token"]["network"];
55
54
  yieldId?: Yield["id"];
56
55
  }) => ValidatorDto[];
57
- export declare const getYieldActionArg: (yieldDto: Yield, type: YieldActionType, name: YieldArgumentName) => YieldArgumentConfig | null;
58
- export declare const isYieldActionArgRequired: (yieldDto: Yield, type: YieldActionType, name: YieldArgumentName) => boolean;
59
- export declare const getYieldRewardTokens: (yieldDto: Yield) => {
56
+ export declare const getYieldActionArg: (yieldDto: YieldBase, type: YieldActionType, name: YieldArgumentName) => YieldArgumentConfig | null;
57
+ export declare const isYieldActionArgRequired: (yieldDto: YieldBase, type: YieldActionType, name: YieldArgumentName) => boolean;
58
+ export declare const getYieldRewardTokens: (yieldDto: YieldBase) => {
60
59
  readonly symbol: string;
61
60
  readonly name: string;
62
61
  readonly decimals: number;
@@ -75,15 +74,13 @@ export declare const getYieldCooldownPeriod: (yieldDto: Yield) => {
75
74
  export declare const getYieldWarmupPeriod: (yieldDto: Yield) => {
76
75
  days: number;
77
76
  } | undefined;
78
- export declare const getYieldCommission: (yieldDto: Yield) => readonly import("../../generated/api/legacy").YieldCommissionDto[] | undefined;
79
77
  export declare const getYieldTvlUsd: (yieldDto: Yield) => string | null;
80
78
  export declare const getYieldFeePercent: (yieldDto: Yield) => number | null;
81
79
  export declare const getYieldLockupPeriod: (yieldDto: Yield) => {
82
80
  days: number;
83
81
  } | undefined;
84
- export declare const hasYieldExitSignatureVerification: (yieldDto: Yield) => boolean;
85
- export declare const getExtendedYieldType: (yieldDto: Yield) => ExtendedYieldType;
86
- export declare const getYieldOutputToken: (yieldDto: Yield) => import("purify-ts/Maybe").Maybe<{
82
+ export declare const getExtendedYieldType: (yieldDto: YieldBase) => ExtendedYieldType;
83
+ export declare const getYieldOutputToken: (yieldDto: YieldBase) => import("purify-ts/Maybe").Maybe<{
87
84
  readonly symbol: string;
88
85
  readonly name: string;
89
86
  readonly decimals: number;
@@ -95,11 +92,10 @@ export declare const getYieldOutputToken: (yieldDto: Yield) => import("purify-ts
95
92
  }>;
96
93
  export declare const isUnstakeYieldType: (yieldType: ExtendedYieldType) => yieldType is "native_staking" | "staking" | "restaking" | "pooled_staking";
97
94
  export declare const isDepositYieldType: (yieldType: ExtendedYieldType) => yieldType is "vault" | "lending" | "fixed_yield" | "real_world_asset" | "concentrated_liquidity_pool" | "liquidity_pool";
98
- export declare const getYieldTypeLabels: (yieldDto: Yield, t: TFunction) => YieldTypeLabelsMap[keyof YieldTypeLabelsMap];
99
- export declare const getYieldTypesSortRank: (yieldDto: Yield) => number;
100
- export declare const isYieldWithProviderOptions: (yieldDto: Yield) => boolean;
101
- export declare const getYieldProviderYieldIds: (yieldDto: Yield) => string[];
102
- export declare const isYieldIntegrationAggregator: (yieldDto: Yield) => boolean;
95
+ export declare const getYieldTypeLabels: (yieldDto: YieldBase, t: TFunction) => YieldTypeLabelsMap[keyof YieldTypeLabelsMap];
96
+ export declare const getYieldTypesSortRank: (yieldDto: YieldBase) => number;
97
+ export declare const isYieldWithProviderOptions: (yieldDto: YieldBase) => boolean;
98
+ export declare const getYieldProviderYieldIds: (yieldDto: YieldBase) => string[];
103
99
  export declare const isYieldValidatorSelectionRequired: (yieldDto: Yield) => boolean;
104
100
  export declare const isEthenaUsdeStaking: (yieldId: string) => yieldId is "ethena-usde-staking";
105
101
  export declare const isBittensorStaking: (yieldId: string) => yieldId is "bittensor-native-staking";
@@ -1,7 +1,9 @@
1
1
  import type { TokenDto } from "../../domain/types/tokens";
2
2
  import { type DashboardYieldCategory } from "../../domain/types/yields";
3
+ import { type YieldSummary } from "./use-yield-summaries";
3
4
  type DashboardCategoryInitialSelection = {
4
5
  token: TokenDto;
6
+ yieldDto: YieldSummary;
5
7
  yieldId: string;
6
8
  };
7
9
  /**
@@ -10,8 +12,9 @@ type DashboardCategoryInitialSelection = {
10
12
  * holdings, no per-yield legacy hydration). The first visible summary of each
11
13
  * probe seeds that category's initial token + yield selection.
12
14
  */
13
- export declare const useDashboardYieldCatalog: ({ enabled, }?: {
15
+ export declare const useDashboardYieldCatalog: ({ enabled, network, }?: {
14
16
  enabled?: boolean;
17
+ network?: TokenDto["network"] | null;
15
18
  }) => {
16
19
  availableCategories: DashboardYieldCategory[];
17
20
  initialSelectionByCategory: Map<DashboardYieldCategory, DashboardCategoryInitialSelection>;
@@ -8,7 +8,8 @@ import { type PreferredTokenYieldsPerNetwork } from "../../domain/types/stake";
8
8
  import type { SKWallet } from "../../domain/types/wallet";
9
9
  import { type ValidatorsConfig, type Yield } from "../../domain/types/yields";
10
10
  import { useApiClient } from "../../providers/api/api-client-provider";
11
- export declare const useStreamMultiYields: (yieldIds: ReadonlyArray<string>) => Yield[];
11
+ import { type YieldSummaryWithProvider } from "./use-yield-summaries";
12
+ export declare const useStreamYieldSummaries: (yieldIds: ReadonlyArray<string>) => YieldSummaryWithProvider[];
12
13
  export declare const useMultiYields: <T = Yield[]>(yieldIds: ReadonlyArray<string>, opts?: {
13
14
  select?: (val: Yield[]) => T;
14
15
  enabled?: boolean;
@@ -1,8 +1,8 @@
1
1
  import type { TokenBalanceScanResponseDto } from "../../domain/types/token-balance";
2
2
  import { type DashboardYieldCategory } from "../../domain/types/yields";
3
3
  import type { YieldDto } from "../../generated/api/yield";
4
- import { useApiClient } from "../../providers/api/api-client-provider";
5
- export type TokenMaxYieldRate = {
4
+ import type { useApiClient } from "../../providers/api/api-client-provider";
5
+ type TokenMaxYieldRate = {
6
6
  rateFormatted: string;
7
7
  rateTypeLabel: string;
8
8
  };
@@ -13,9 +13,4 @@ export declare const fetchTokenListYieldSummaries: ({ apiClient, signal, tokenBa
13
13
  }) => Promise<YieldDto[]>;
14
14
  export declare const getDashboardCategoryYieldIdsForToken: (availableYieldIds: ReadonlyArray<string>, yieldsById: ReadonlyMap<string, YieldDto>, category: DashboardYieldCategory) => string[];
15
15
  export declare const getMaxYieldRateForToken: (availableYieldIds: ReadonlyArray<string>, yieldsById: ReadonlyMap<string, YieldDto>) => TokenMaxYieldRate | null;
16
- export declare const useTokenListYields: (tokenBalances: ReadonlyArray<TokenBalanceScanResponseDto>, dashboardYieldCategory?: DashboardYieldCategory | null) => {
17
- yieldIdsByToken: Map<string, string[]>;
18
- yieldCountsByToken: Map<string, number>;
19
- maxYieldRatesByToken: Map<string, TokenMaxYieldRate>;
20
- isLoading: boolean;
21
- };
16
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { QueryClient } from "@tanstack/react-query";
2
2
  import { EitherAsync } from "purify-ts";
3
- import { type Yield } from "../../../domain/types/yields";
3
+ import { type Yield, type YieldBase } from "../../../domain/types/yields";
4
4
  import type { ApiClient } from "../../../providers/api/api-client";
5
5
  type Params = {
6
6
  yieldId: string;
@@ -15,10 +15,14 @@ type MultiParams = Omit<Params, "yieldId"> & {
15
15
  type ParamsWithQueryClient = Params & {
16
16
  queryClient: QueryClient;
17
17
  };
18
+ type ParamsWithYieldDto = Omit<ParamsWithQueryClient, "yieldId"> & {
19
+ yieldDto: YieldBase;
20
+ };
18
21
  type MultiParamsWithQueryClient = MultiParams & {
19
22
  queryClient: QueryClient;
20
23
  };
21
24
  export declare const getYieldOpportunity: (params: ParamsWithQueryClient) => EitherAsync<Error, Yield>;
25
+ export declare const getYieldOpportunityFromSummary: (params: ParamsWithYieldDto) => EitherAsync<Error, Yield>;
22
26
  export declare const getYieldOpportunities: (params: MultiParamsWithQueryClient) => EitherAsync<Error, Yield[]>;
23
27
  export declare const queryFn: (params: ParamsWithQueryClient & {
24
28
  signal?: AbortSignal;
@@ -0,0 +1,13 @@
1
+ import type { QueryClient } from "@tanstack/react-query";
2
+ import type { YieldProviderDetails } from "../../domain/types/yields";
3
+ import type { ApiClient } from "../../providers/api/api-client";
4
+ export declare const fetchYieldProvider: ({ client, providerId, queryClient, }: {
5
+ client: ReturnType<ApiClient["withOptions"]>;
6
+ providerId: string;
7
+ queryClient: QueryClient;
8
+ }) => Promise<YieldProviderDetails | undefined>;
9
+ export declare const fetchYieldProviders: ({ client, providerIds, queryClient, }: {
10
+ client: ReturnType<ApiClient["withOptions"]>;
11
+ providerIds: ReadonlyArray<string>;
12
+ queryClient: QueryClient;
13
+ }) => Promise<Map<string, import("../../generated/api/yield").ProviderDto>>;
@@ -1,13 +1,17 @@
1
+ import type { QueryClient } from "@tanstack/react-query";
2
+ import { type YieldProviderDetails } from "../../domain/types/yields";
1
3
  import type { YieldDto, YieldsControllerGetYieldsParams } from "../../generated/api/yield";
2
4
  import type { useApiClient } from "../../providers/api/api-client-provider";
3
5
  /**
4
6
  * A yield "summary" is the new yields API DTO, returned by
5
7
  * `YieldsControllerGetYields`. It contains everything category discovery and
6
8
  * list rendering need (`token`, `rewardRate`, `status`, `metadata`,
7
- * `mechanics.type`, `providerId`) and intentionally does NOT include the legacy
8
- * `__fallback__` hydration, which is only required for a selected yield.
9
+ * `mechanics.type`, `providerId`).
9
10
  */
10
11
  export type YieldSummary = YieldDto;
12
+ export type YieldSummaryWithProvider = YieldSummary & {
13
+ provider?: YieldProviderDetails;
14
+ };
11
15
  export declare const DEFAULT_YIELD_SUMMARIES_PAGE_LIMIT = 50;
12
16
  export type YieldSummariesParams = Pick<YieldsControllerGetYieldsParams, "network" | "types" | "inputToken" | "sort" | "limit">;
13
17
  /**
@@ -32,6 +36,9 @@ type FetchByIdsArgs = {
32
36
  suppressRichErrors?: boolean;
33
37
  yieldIds: ReadonlyArray<string>;
34
38
  };
39
+ type FetchByIdsWithProvidersArgs = FetchByIdsArgs & {
40
+ queryClient: QueryClient;
41
+ };
35
42
  /**
36
43
  * Fetch a single page of yield summaries.
37
44
  */
@@ -42,6 +49,7 @@ export declare const fetchYieldSummariesPage: ({ apiClient, params, signal, }: F
42
49
  * requested ID.
43
50
  */
44
51
  export declare const fetchYieldSummariesByIds: ({ apiClient, chunkSize, signal, suppressRichErrors, yieldIds, }: FetchByIdsArgs) => Promise<YieldSummary[]>;
52
+ export declare const fetchYieldSummariesWithProvidersByIds: ({ apiClient, queryClient, signal, suppressRichErrors, yieldIds, }: FetchByIdsWithProvidersArgs) => Promise<YieldSummaryWithProvider[]>;
45
53
  /**
46
54
  * Fetch every page of yield summaries for the given params, looping `offset`
47
55
  * until all `total` items have been retrieved.
@@ -1,13 +1,9 @@
1
1
  import type { TokenBalanceScanResponseDto } from "../../../../../domain/types/token-balance";
2
- import type { TokenMaxYieldRate } from "../../../../../hooks/api/use-token-list-yields";
3
2
  type Props = {
4
3
  item: TokenBalanceScanResponseDto;
5
4
  isConnected: boolean;
6
5
  isSelected: boolean;
7
- availableYieldsCount?: number;
8
- canSelectToken?: boolean;
9
- maxYieldRate?: TokenMaxYieldRate;
10
6
  onTokenBalanceSelect: (tokenBalance: TokenBalanceScanResponseDto) => void;
11
7
  };
12
- export declare const SelectTokenListItem: import("react").MemoExoticComponent<({ item, isConnected, isSelected, availableYieldsCount, canSelectToken, maxYieldRate, onTokenBalanceSelect, }: Props) => import("react/jsx-runtime").JSX.Element>;
8
+ export declare const SelectTokenListItem: import("react").MemoExoticComponent<({ item, isConnected, isSelected, onTokenBalanceSelect }: Props) => import("react/jsx-runtime").JSX.Element>;
13
9
  export {};
@@ -36,8 +36,6 @@ export declare const selectTokenBalance: import("@vanilla-extract/recipes").Runt
36
36
  porto: {};
37
37
  };
38
38
  }>;
39
- export declare const maxYieldRateText: string;
40
- export declare const maxYieldRateLabel: string;
41
39
  export declare const minMaxContainer: import("@vanilla-extract/recipes").RuntimeFn<{
42
40
  variant: {
43
41
  default: string;
@@ -6,7 +6,6 @@ import type { TokenDto } from "../../../../domain/types/tokens";
6
6
  import type { TronResourceType } from "../../../../domain/types/tron";
7
7
  import type { DashboardYieldCategory, Yield } from "../../../../domain/types/yields";
8
8
  import type { ValidatorDto } from "../../../../generated/api/yield";
9
- import type { TokenMaxYieldRate } from "../../../../hooks/api/use-token-list-yields";
10
9
  import type { useEstimatedRewards } from "../../../../hooks/use-estimated-rewards";
11
10
  import type { useProvidersDetails } from "../../../../hooks/use-provider-details";
12
11
  import type { useRewardTokenDetails } from "../../../../hooks/use-reward-token-details";
@@ -15,6 +14,7 @@ import type { SelectedStakeData } from "../types";
15
14
  export type State = {
16
15
  selectedToken: Maybe<TokenDto>;
17
16
  selectedStakeId: Maybe<TokenBalanceScanResponseDto["availableYields"][number]>;
17
+ autoSelectYield: boolean;
18
18
  selectedValidators: Map<ValidatorDto["address"], ValidatorDto>;
19
19
  stakeAmount: BigNumber;
20
20
  useMaxAmount: boolean;
@@ -22,6 +22,7 @@ export type State = {
22
22
  selectedProviderYieldId: Maybe<Yield["id"]>;
23
23
  };
24
24
  type TokenBalanceSelectAction = Action<"token/select", TokenDto>;
25
+ type TokenOnlySelectAction = Action<"token-only/select", TokenDto>;
25
26
  type DashboardTokenYieldSelectAction = Action<"dashboard/token-yield/select", {
26
27
  token: TokenDto;
27
28
  yieldDto: Yield;
@@ -35,7 +36,7 @@ type ValidatorMultiSelectAction = Action<"validator/multiselect", ValidatorDto>;
35
36
  type ValidatorRemoveAction = Action<"validator/remove", ValidatorDto>;
36
37
  type SelectTronResourceAction = Action<"tronResource/select", TronResourceType>;
37
38
  type ProviderYieldIdSelectAction = Action<"providerYieldId/select", Yield["id"]>;
38
- export type Actions = TokenBalanceSelectAction | DashboardTokenYieldSelectAction | YieldSelectAction | StakeAmountChangeAction | StakeAmountMaxAction | StateResetAction | ValidatorSelectAction | ValidatorMultiSelectAction | ValidatorRemoveAction | SelectTronResourceAction | ProviderYieldIdSelectAction;
39
+ export type Actions = TokenBalanceSelectAction | TokenOnlySelectAction | DashboardTokenYieldSelectAction | YieldSelectAction | StakeAmountChangeAction | StakeAmountMaxAction | StateResetAction | ValidatorSelectAction | ValidatorMultiSelectAction | ValidatorRemoveAction | SelectTronResourceAction | ProviderYieldIdSelectAction;
39
40
  export type ExtraData = {
40
41
  actions: {
41
42
  onMaxClick: () => void;
@@ -97,9 +98,6 @@ export type EarnPageContextType = {
97
98
  all: TokenBalanceScanResponseDto[];
98
99
  filtered: TokenBalanceScanResponseDto[];
99
100
  }>;
100
- tokenMaxYieldRatesByToken: ReadonlyMap<string, TokenMaxYieldRate>;
101
- tokenYieldCountsByToken: ReadonlyMap<string, number>;
102
- tokenListYieldsIsLoading: boolean;
103
101
  onTokenSearch: (value: string) => void;
104
102
  onValidatorSearch: (value: string) => void;
105
103
  validatorSearch: string;
@@ -1,7 +1,7 @@
1
- import type { ExtendedYieldType, Yield } from "../../../domain/types/yields";
1
+ import type { ExtendedYieldType, YieldBase } from "../../../domain/types/yields";
2
2
  export type SelectedStakeData = {
3
- all: Yield[];
4
- filtered: Yield[];
3
+ all: YieldBase[];
4
+ filtered: YieldBase[];
5
5
  groupsWithCounts: Map<ExtendedYieldType, {
6
6
  itemsLength: number;
7
7
  title: string;
@@ -1,79 +1,34 @@
1
1
  import type { SnapshotFromStore } from "@xstate/store";
2
2
  import { Maybe } from "purify-ts";
3
- import type { TransactionVerificationMessageDto } from "../../../domain/types/transaction";
4
- import type { SKWallet } from "../../../domain/types/wallet";
5
3
  import { useExitStakeStore } from "../../../providers/exit-stake-store";
6
4
  import type { GetMaybeJust } from "../../../types/utils";
7
5
  export declare const useUnstakeMachine: ({ onDone }: {
8
6
  onDone: () => void;
9
7
  }) => [import("xstate").MachineSnapshot<{
10
8
  error: Maybe<unknown>;
11
- transactionVerificationMessageDto: Maybe<TransactionVerificationMessageDto>;
12
- signedMessage: Maybe<string>;
13
9
  data: ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
14
- network: NonNullable<SKWallet["network"]>;
15
- address: NonNullable<SKWallet["address"]>;
10
+ address: string;
16
11
  }>>;
17
12
  }, {
18
13
  type: "UNSTAKE";
19
- } | {
20
- type: "__GET_VERIFICATION_MESSAGE__";
21
- val: GetMaybeJust<ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
22
- network: NonNullable<SKWallet["network"]>;
23
- address: NonNullable<SKWallet["address"]>;
24
- }>>>;
25
14
  } | {
26
15
  type: "__SUBMIT__";
27
16
  val: GetMaybeJust<ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
28
- network: NonNullable<SKWallet["network"]>;
29
- address: NonNullable<SKWallet["address"]>;
17
+ address: string;
30
18
  }>>>;
31
19
  } | {
32
20
  type: "__RESET__";
33
- } | {
34
- type: "__GET_VERIFICATION_MESSAGE_SUCCESS__";
35
- val: TransactionVerificationMessageDto;
36
- } | {
37
- type: "__GET_VERIFICATION_MESSAGE_ERROR__";
38
- val: unknown;
39
- } | {
40
- type: "CONTINUE_MESSAGE_SIGN";
41
- } | {
42
- type: "CANCEL_MESSAGE_SIGN";
43
- } | {
44
- type: "__SIGN_MESSAGE_SUCCESS__";
45
- val: string;
46
- } | {
47
- type: "__SIGN_MESSAGE_ERROR__";
48
- val: unknown;
49
21
  } | {
50
22
  type: "__SUBMIT_SUCCESS__";
51
23
  } | {
52
24
  type: "__SUBMIT_ERROR__";
53
25
  val: unknown;
54
- }, {}, "initial" | "done" | "check" | "showPopup" | {
26
+ }, {}, "initial" | "done" | "check" | {
55
27
  submit: "error" | "loading";
56
- } | {
57
- signMessage: "error" | "loading";
58
- } | {
59
- getVerificationMessage: "error" | "loading";
60
28
  }, string, import("xstate").NonReducibleUnknown, import("xstate").MetaObject, {
61
29
  states: {
62
30
  readonly initial: {};
63
31
  readonly check: {};
64
- readonly getVerificationMessage: {
65
- states: {
66
- readonly loading: {};
67
- readonly error: {};
68
- };
69
- };
70
- readonly showPopup: {};
71
- readonly signMessage: {
72
- states: {
73
- readonly loading: {};
74
- readonly error: {};
75
- };
76
- };
77
32
  readonly submit: {
78
33
  states: {
79
34
  readonly loading: {};
@@ -84,36 +39,13 @@ export declare const useUnstakeMachine: ({ onDone }: {
84
39
  };
85
40
  }>, (event: {
86
41
  type: "UNSTAKE";
87
- } | {
88
- type: "__GET_VERIFICATION_MESSAGE__";
89
- val: GetMaybeJust<ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
90
- network: NonNullable<SKWallet["network"]>;
91
- address: NonNullable<SKWallet["address"]>;
92
- }>>>;
93
42
  } | {
94
43
  type: "__SUBMIT__";
95
44
  val: GetMaybeJust<ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
96
- network: NonNullable<SKWallet["network"]>;
97
- address: NonNullable<SKWallet["address"]>;
45
+ address: string;
98
46
  }>>>;
99
47
  } | {
100
48
  type: "__RESET__";
101
- } | {
102
- type: "__GET_VERIFICATION_MESSAGE_SUCCESS__";
103
- val: TransactionVerificationMessageDto;
104
- } | {
105
- type: "__GET_VERIFICATION_MESSAGE_ERROR__";
106
- val: unknown;
107
- } | {
108
- type: "CONTINUE_MESSAGE_SIGN";
109
- } | {
110
- type: "CANCEL_MESSAGE_SIGN";
111
- } | {
112
- type: "__SIGN_MESSAGE_SUCCESS__";
113
- val: string;
114
- } | {
115
- type: "__SIGN_MESSAGE_ERROR__";
116
- val: unknown;
117
49
  } | {
118
50
  type: "__SUBMIT_SUCCESS__";
119
51
  } | {
@@ -121,72 +53,29 @@ export declare const useUnstakeMachine: ({ onDone }: {
121
53
  val: unknown;
122
54
  }) => void, import("xstate").Actor<import("xstate").StateMachine<{
123
55
  error: Maybe<unknown>;
124
- transactionVerificationMessageDto: Maybe<TransactionVerificationMessageDto>;
125
- signedMessage: Maybe<string>;
126
56
  data: ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
127
- network: NonNullable<SKWallet["network"]>;
128
- address: NonNullable<SKWallet["address"]>;
57
+ address: string;
129
58
  }>>;
130
59
  }, {
131
60
  type: "UNSTAKE";
132
- } | {
133
- type: "__GET_VERIFICATION_MESSAGE__";
134
- val: GetMaybeJust<ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
135
- network: NonNullable<SKWallet["network"]>;
136
- address: NonNullable<SKWallet["address"]>;
137
- }>>>;
138
61
  } | {
139
62
  type: "__SUBMIT__";
140
63
  val: GetMaybeJust<ReturnType<() => Maybe<GetMaybeJust<SnapshotFromStore<ReturnType<typeof useExitStakeStore>>["context"]["data"]> & {
141
- network: NonNullable<SKWallet["network"]>;
142
- address: NonNullable<SKWallet["address"]>;
64
+ address: string;
143
65
  }>>>;
144
66
  } | {
145
67
  type: "__RESET__";
146
- } | {
147
- type: "__GET_VERIFICATION_MESSAGE_SUCCESS__";
148
- val: TransactionVerificationMessageDto;
149
- } | {
150
- type: "__GET_VERIFICATION_MESSAGE_ERROR__";
151
- val: unknown;
152
- } | {
153
- type: "CONTINUE_MESSAGE_SIGN";
154
- } | {
155
- type: "CANCEL_MESSAGE_SIGN";
156
- } | {
157
- type: "__SIGN_MESSAGE_SUCCESS__";
158
- val: string;
159
- } | {
160
- type: "__SIGN_MESSAGE_ERROR__";
161
- val: unknown;
162
68
  } | {
163
69
  type: "__SUBMIT_SUCCESS__";
164
70
  } | {
165
71
  type: "__SUBMIT_ERROR__";
166
72
  val: unknown;
167
- }, {}, never, never, never, never, "initial" | "done" | "check" | "showPopup" | {
73
+ }, {}, never, never, never, never, "initial" | "done" | "check" | {
168
74
  submit: "error" | "loading";
169
- } | {
170
- signMessage: "error" | "loading";
171
- } | {
172
- getVerificationMessage: "error" | "loading";
173
75
  }, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
174
76
  states: {
175
77
  readonly initial: {};
176
78
  readonly check: {};
177
- readonly getVerificationMessage: {
178
- states: {
179
- readonly loading: {};
180
- readonly error: {};
181
- };
182
- };
183
- readonly showPopup: {};
184
- readonly signMessage: {
185
- states: {
186
- readonly loading: {};
187
- readonly error: {};
188
- };
189
- };
190
79
  readonly submit: {
191
80
  states: {
192
81
  readonly loading: {};
@@ -42,7 +42,43 @@ export declare const useStakeReview: () => {
42
42
  managementFee: Maybe<import("../types").FeesBps>;
43
43
  performanceFee: Maybe<import("../types").FeesBps>;
44
44
  feeConfigLoading: boolean;
45
- commissionFee: import("purify-ts/Maybe").Maybe<string>;
45
+ commissionFee: {
46
+ isJust(): this is import("purify-ts").AlwaysJust;
47
+ isNothing(): this is /*elided*/ any;
48
+ inspect(): string;
49
+ toString(): string;
50
+ toJSON(): never;
51
+ equals<T>(other: import("purify-ts/Maybe").Maybe<T>): boolean;
52
+ map<U>(_: (value: never) => U): import("purify-ts/Maybe").Maybe<U>;
53
+ ap<U>(_: import("purify-ts/Maybe").Maybe<(value: never) => U>): import("purify-ts/Maybe").Maybe<U>;
54
+ alt<T>(other: import("purify-ts/Maybe").Maybe<T>): import("purify-ts/Maybe").Maybe<T>;
55
+ altLazy<T>(other: () => import("purify-ts/Maybe").Maybe<T>): import("purify-ts/Maybe").Maybe<T>;
56
+ chain<U>(_: (value: never) => import("purify-ts/Maybe").Maybe<U>): import("purify-ts/Maybe").Maybe<U>;
57
+ chainNullable<U>(_: (value: never) => U | undefined | null | void): import("purify-ts/Maybe").Maybe<U>;
58
+ join<U>(this: import("purify-ts/Maybe").Maybe<import("purify-ts/Maybe").Maybe<U>>): import("purify-ts/Maybe").Maybe<U>;
59
+ reduce<U>(_: (accumulator: U, value: never) => U, initialValue: U): U;
60
+ extend<U>(_: (value: import("purify-ts/Maybe").Maybe<never>) => U): import("purify-ts/Maybe").Maybe<U>;
61
+ unsafeCoerce<T>(): T;
62
+ caseOf<U>(patterns: import("purify-ts").MaybePatterns<never, U>): U;
63
+ orDefault<T>(defaultValue: T): T;
64
+ orDefaultLazy<T>(getDefaultValue: () => T): T;
65
+ toList<T>(): T[];
66
+ mapOrDefault<U>(_: (value: never) => U, defaultValue: U): U;
67
+ extract(): never;
68
+ extractNullable(): never;
69
+ toEither<L, T>(left: L): import("purify-ts").Either<L, T>;
70
+ ifJust(_: (value: never) => any): /*elided*/ any;
71
+ ifNothing(effect: () => any): /*elided*/ any;
72
+ filter(_: (value: never) => boolean): import("purify-ts/Maybe").Maybe<never>;
73
+ 'fantasy-land/equals': typeof this.equals;
74
+ 'fantasy-land/map': typeof this.map;
75
+ 'fantasy-land/ap': typeof this.ap;
76
+ 'fantasy-land/alt': typeof this.alt;
77
+ 'fantasy-land/chain': typeof this.chain;
78
+ 'fantasy-land/reduce': typeof this.reduce;
79
+ 'fantasy-land/extend': typeof this.extend;
80
+ 'fantasy-land/filter': typeof this.filter;
81
+ };
46
82
  kycGate: {
47
83
  state: "start_kyc";
48
84
  kycUrl?: string;
@@ -25,20 +25,15 @@ export declare const useApiClient: () => {
25
25
  readonly payload: import("../../generated/api/legacy").TokenControllerTokenBalancesScanRequestJson;
26
26
  readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
27
27
  }) => Promise<import("../../generated/api/legacy").TokenControllerTokenBalancesScan200>;
28
- TransactionControllerGetTransactionVerificationMessageForNetwork: (network: string, options: {
29
- readonly params?: import("../../generated/api/legacy").TransactionControllerGetTransactionVerificationMessageForNetworkParams | undefined;
30
- readonly payload: import("../../generated/api/legacy").TransactionControllerGetTransactionVerificationMessageForNetworkRequestJson;
28
+ YieldControllerGetMyNetworks: (options: {
29
+ readonly params?: import("../../generated/api/legacy").YieldControllerGetMyNetworksParams | undefined;
31
30
  readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
32
- }) => Promise<import("../../generated/api/legacy").TransactionVerificationMessageDto>;
31
+ } | undefined) => Promise<import("../../generated/api/legacy").YieldControllerGetMyNetworksdefault>;
33
32
  YieldControllerGetSingleYieldRewardsSummary: (integrationId: string, options: {
34
33
  readonly params?: import("../../generated/api/legacy").YieldControllerGetSingleYieldRewardsSummaryParams | undefined;
35
34
  readonly payload: import("../../generated/api/legacy").YieldControllerGetSingleYieldRewardsSummaryRequestJson;
36
35
  readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
37
36
  }) => Promise<import("../../generated/api/legacy").YieldRewardsSummaryResponseDto>;
38
- YieldControllerYieldOpportunity: (integrationId: string, options: {
39
- readonly params?: import("../../generated/api/legacy").YieldControllerYieldOpportunityParams | undefined;
40
- readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
41
- } | undefined) => Promise<import("../../generated/api/legacy").YieldDto>;
42
37
  };
43
38
  yield: {
44
39
  ActionsControllerEnterYield: (options: {
@@ -64,9 +59,6 @@ export declare const useApiClient: () => {
64
59
  readonly params: import("../../generated/api/yield").KycControllerGetStatusParams;
65
60
  readonly config?: import("../../generated/api/yield").OperationConfig | undefined;
66
61
  }) => Promise<import("../../generated/api/yield").KycStatusResponseDto>;
67
- NetworksControllerGetNetworks: (options: {
68
- readonly config?: import("../../generated/api/yield").OperationConfig | undefined;
69
- } | undefined) => Promise<import("../../generated/api/yield").NetworksControllerGetNetworks200>;
70
62
  ProvidersControllerGetProvider: (providerId: string, options: {
71
63
  readonly config?: import("../../generated/api/yield").OperationConfig | undefined;
72
64
  } | undefined) => Promise<import("../../generated/api/yield").ProviderDto>;
@@ -130,20 +122,15 @@ export declare const useApiClient: () => {
130
122
  readonly payload: import("../../generated/api/legacy").TokenControllerTokenBalancesScanRequestJson;
131
123
  readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
132
124
  }) => Promise<import("../../generated/api/legacy").TokenControllerTokenBalancesScan200>;
133
- TransactionControllerGetTransactionVerificationMessageForNetwork: (network: string, options: {
134
- readonly params?: import("../../generated/api/legacy").TransactionControllerGetTransactionVerificationMessageForNetworkParams | undefined;
135
- readonly payload: import("../../generated/api/legacy").TransactionControllerGetTransactionVerificationMessageForNetworkRequestJson;
125
+ YieldControllerGetMyNetworks: (options: {
126
+ readonly params?: import("../../generated/api/legacy").YieldControllerGetMyNetworksParams | undefined;
136
127
  readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
137
- }) => Promise<import("../../generated/api/legacy").TransactionVerificationMessageDto>;
128
+ } | undefined) => Promise<import("../../generated/api/legacy").YieldControllerGetMyNetworksdefault>;
138
129
  YieldControllerGetSingleYieldRewardsSummary: (integrationId: string, options: {
139
130
  readonly params?: import("../../generated/api/legacy").YieldControllerGetSingleYieldRewardsSummaryParams | undefined;
140
131
  readonly payload: import("../../generated/api/legacy").YieldControllerGetSingleYieldRewardsSummaryRequestJson;
141
132
  readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
142
133
  }) => Promise<import("../../generated/api/legacy").YieldRewardsSummaryResponseDto>;
143
- YieldControllerYieldOpportunity: (integrationId: string, options: {
144
- readonly params?: import("../../generated/api/legacy").YieldControllerYieldOpportunityParams | undefined;
145
- readonly config?: import("../../generated/api/legacy").OperationConfig | undefined;
146
- } | undefined) => Promise<import("../../generated/api/legacy").YieldDto>;
147
134
  };
148
135
  yield: {
149
136
  ActionsControllerEnterYield: (options: {
@@ -169,9 +156,6 @@ export declare const useApiClient: () => {
169
156
  readonly params: import("../../generated/api/yield").KycControllerGetStatusParams;
170
157
  readonly config?: import("../../generated/api/yield").OperationConfig | undefined;
171
158
  }) => Promise<import("../../generated/api/yield").KycStatusResponseDto>;
172
- NetworksControllerGetNetworks: (options: {
173
- readonly config?: import("../../generated/api/yield").OperationConfig | undefined;
174
- } | undefined) => Promise<import("../../generated/api/yield").NetworksControllerGetNetworks200>;
175
159
  ProvidersControllerGetProvider: (providerId: string, options: {
176
160
  readonly config?: import("../../generated/api/yield").OperationConfig | undefined;
177
161
  } | undefined) => Promise<import("../../generated/api/yield").ProviderDto>;