@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.
- package/dist/bundle/index.bundle.css +1 -1
- package/dist/bundle/index.bundle.js +54 -54
- package/dist/package/index.package.css +0 -7
- package/dist/package/index.package.js +1311 -1209
- package/dist/types/components/molecules/select-opportunity-list-item/index.d.ts +7 -5
- package/dist/types/domain/types/stake.d.ts +3 -3
- package/dist/types/domain/types/yields.d.ts +14 -17
- package/dist/types/hooks/api/use-dashboard-yield-catalog.d.ts +23 -0
- package/dist/types/hooks/api/use-multi-yields.d.ts +2 -1
- package/dist/types/hooks/api/use-token-list-yields.d.ts +10 -5
- package/dist/types/hooks/api/use-yield-opportunity/get-yield-opportunity.d.ts +5 -1
- package/dist/types/hooks/api/use-yield-providers.d.ts +13 -0
- package/dist/types/hooks/api/use-yield-summaries.d.ts +58 -0
- package/dist/types/pages/details/earn-page/components/select-token-section/select-token-list-item.d.ts +1 -3
- package/dist/types/pages/details/earn-page/components/select-token-section/styles.css.d.ts +0 -2
- package/dist/types/pages/details/earn-page/state/types.d.ts +7 -1
- package/dist/types/pages/details/earn-page/types.d.ts +3 -3
- package/dist/types/pages/position-details/hooks/use-unstake-machine.d.ts +7 -118
- package/dist/types/pages/review/hooks/use-stake-review.hook.d.ts +37 -1
- package/dist/types/providers/api/api-client-provider.d.ts +6 -22
- package/dist/types/providers/api/api-client.d.ts +6 -22
- package/dist/types/providers/ethereum/config.d.ts +4 -3
- package/dist/types/providers/settings/types.d.ts +1 -0
- package/dist/types/providers/wagmi/index.d.ts +1 -0
- package/dist/website/assets/{basic-ThspdnuL.js → basic-AvmmQyRT.js} +1 -1
- package/dist/website/assets/{basic-Bo7SBwII.js → basic-B4L21H7R.js} +1 -1
- package/dist/website/assets/{browser-DskDvf4V.js → browser-CD2gtnKg.js} +1 -1
- package/dist/website/assets/{build-BmJ27Vry.js → build-CEL1SZmV.js} +1 -1
- package/dist/website/assets/{build-DN0pJtdR.js → build-DWB27dsZ.js} +1 -1
- package/dist/website/assets/{cardano-connector-B2Ea9uXJ.js → cardano-connector-BNJvqm1_.js} +1 -1
- package/dist/website/assets/{core-BFFu4TZK.js → core-NRhVeH3P.js} +2 -2
- package/dist/website/assets/{dist-BC-yZnz1.js → dist-CH4nKZqs.js} +1 -1
- package/dist/website/assets/{dist-DwMZ-Epn.js → dist-DRLRXyTA.js} +1 -1
- package/dist/website/assets/en_US-IFPOGBSL-DcKUUZBp.js +1 -0
- package/dist/website/assets/{esm-Bvq2M2B2.js → esm-CX7v7VH6.js} +1 -1
- package/dist/website/assets/{exports-BEqJeoxC.js → exports-CZja-uIB.js} +1 -1
- package/dist/website/assets/{index-DTVV95ia.js → index-BEIkkHR9.js} +43 -43
- package/dist/website/assets/{index-E_6jknHw.css → index-BmH6Rgkr.css} +1 -1
- package/dist/website/assets/{index.es-qQnPYJtJ.js → index.es-C4PtkNtC.js} +2 -2
- package/dist/website/assets/{ledger-connector-C520fQQY.js → ledger-connector-CQI9gS0Q.js} +1 -1
- package/dist/website/assets/{receive-Dcx0aHWA.js → receive-D87X5CO9.js} +1 -1
- package/dist/website/assets/{registry-CvkKYDcW.js → registry-DFrHgvrU.js} +1 -1
- package/dist/website/assets/{safe-connector-CDGYW3b8.js → safe-connector-D5A7hhAW.js} +1 -1
- package/dist/website/assets/{socials-BDwTFvCa.js → socials-DlOk7Wls.js} +1 -1
- package/dist/website/assets/{solana-connector-BcHaSaSq.js → solana-connector-C1qGbaG8.js} +1 -1
- package/dist/website/assets/{substrate-connector-DxYe9s4o.js → substrate-connector-DfJfljNz.js} +1 -1
- package/dist/website/assets/{ton-connector-sD5IEuy2.js → ton-connector-DA1-w57X.js} +1 -1
- package/dist/website/assets/{tron-connector-DgBR_biA.js → tron-connector-BTe1GdWY.js} +3 -3
- package/dist/website/assets/tx-zX2fdmDi.js +1 -0
- package/dist/website/assets/{wallet-manager-4JkYZ_Wn.js → wallet-manager-pYzGZQVw.js} +3 -3
- package/dist/website/assets/{wui-qr-code-CadVdoQK.js → wui-qr-code-BgRoILGj.js} +1 -1
- package/dist/website/index.html +2 -2
- package/package.json +1 -1
- package/dist/website/assets/en_US-IFPOGBSL-DY8aJwVh.js +0 -1
- package/dist/website/assets/tx-Cjn1Xzt5.js +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
item:
|
|
4
|
-
onYieldSelect: (item:
|
|
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
|
-
}
|
|
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:
|
|
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:
|
|
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
|
|
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 & {});
|
|
@@ -45,17 +44,18 @@ export type ValidatorsConfig = Map<SupportedSKChains | "*", {
|
|
|
45
44
|
}>;
|
|
46
45
|
export type DashboardYieldCategory = "stake" | "defi" | "rwa";
|
|
47
46
|
export declare const dashboardYieldCategories: readonly ["stake", "defi", "rwa"];
|
|
48
|
-
export declare const
|
|
49
|
-
export declare const
|
|
47
|
+
export declare const getApiYieldTypesForDashboardCategory: (category: DashboardYieldCategory) => ApiYieldType[];
|
|
48
|
+
export declare const getDashboardYieldCategoryForApiYieldType: (yieldType: ApiYieldType) => DashboardYieldCategory;
|
|
49
|
+
export declare const getDashboardYieldCategory: (yieldDto: YieldBase) => DashboardYieldCategory | null;
|
|
50
50
|
export declare const filterValidators: ({ validatorsConfig, validators, network, yieldId, }: {
|
|
51
51
|
validatorsConfig: ValidatorsConfig;
|
|
52
52
|
validators: ValidatorDto[];
|
|
53
53
|
network: Yield["token"]["network"];
|
|
54
54
|
yieldId?: Yield["id"];
|
|
55
55
|
}) => ValidatorDto[];
|
|
56
|
-
export declare const getYieldActionArg: (yieldDto:
|
|
57
|
-
export declare const isYieldActionArgRequired: (yieldDto:
|
|
58
|
-
export declare const getYieldRewardTokens: (yieldDto:
|
|
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) => {
|
|
59
59
|
readonly symbol: string;
|
|
60
60
|
readonly name: string;
|
|
61
61
|
readonly decimals: number;
|
|
@@ -74,15 +74,13 @@ export declare const getYieldCooldownPeriod: (yieldDto: Yield) => {
|
|
|
74
74
|
export declare const getYieldWarmupPeriod: (yieldDto: Yield) => {
|
|
75
75
|
days: number;
|
|
76
76
|
} | undefined;
|
|
77
|
-
export declare const getYieldCommission: (yieldDto: Yield) => readonly import("../../generated/api/legacy").YieldCommissionDto[] | undefined;
|
|
78
77
|
export declare const getYieldTvlUsd: (yieldDto: Yield) => string | null;
|
|
79
78
|
export declare const getYieldFeePercent: (yieldDto: Yield) => number | null;
|
|
80
79
|
export declare const getYieldLockupPeriod: (yieldDto: Yield) => {
|
|
81
80
|
days: number;
|
|
82
81
|
} | undefined;
|
|
83
|
-
export declare const
|
|
84
|
-
export declare const
|
|
85
|
-
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<{
|
|
86
84
|
readonly symbol: string;
|
|
87
85
|
readonly name: string;
|
|
88
86
|
readonly decimals: number;
|
|
@@ -94,11 +92,10 @@ export declare const getYieldOutputToken: (yieldDto: Yield) => import("purify-ts
|
|
|
94
92
|
}>;
|
|
95
93
|
export declare const isUnstakeYieldType: (yieldType: ExtendedYieldType) => yieldType is "native_staking" | "staking" | "restaking" | "pooled_staking";
|
|
96
94
|
export declare const isDepositYieldType: (yieldType: ExtendedYieldType) => yieldType is "vault" | "lending" | "fixed_yield" | "real_world_asset" | "concentrated_liquidity_pool" | "liquidity_pool";
|
|
97
|
-
export declare const getYieldTypeLabels: (yieldDto:
|
|
98
|
-
export declare const getYieldTypesSortRank: (yieldDto:
|
|
99
|
-
export declare const isYieldWithProviderOptions: (yieldDto:
|
|
100
|
-
export declare const getYieldProviderYieldIds: (yieldDto:
|
|
101
|
-
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[];
|
|
102
99
|
export declare const isYieldValidatorSelectionRequired: (yieldDto: Yield) => boolean;
|
|
103
100
|
export declare const isEthenaUsdeStaking: (yieldId: string) => yieldId is "ethena-usde-staking";
|
|
104
101
|
export declare const isBittensorStaking: (yieldId: string) => yieldId is "bittensor-native-staking";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TokenDto } from "../../domain/types/tokens";
|
|
2
|
+
import { type DashboardYieldCategory } from "../../domain/types/yields";
|
|
3
|
+
import { type YieldSummary } from "./use-yield-summaries";
|
|
4
|
+
type DashboardCategoryInitialSelection = {
|
|
5
|
+
token: TokenDto;
|
|
6
|
+
yieldDto: YieldSummary;
|
|
7
|
+
yieldId: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Discovers available dashboard earn categories with one network-scoped,
|
|
11
|
+
* reward-rate-sorted probe per category (no dependency on the wallet's token
|
|
12
|
+
* holdings, no per-yield legacy hydration). The first visible summary of each
|
|
13
|
+
* probe seeds that category's initial token + yield selection.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useDashboardYieldCatalog: ({ enabled, network, }?: {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
network?: TokenDto["network"] | null;
|
|
18
|
+
}) => {
|
|
19
|
+
availableCategories: DashboardYieldCategory[];
|
|
20
|
+
initialSelectionByCategory: Map<DashboardYieldCategory, DashboardCategoryInitialSelection>;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -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
|
-
|
|
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,11 +1,16 @@
|
|
|
1
1
|
import type { TokenBalanceScanResponseDto } from "../../domain/types/token-balance";
|
|
2
|
+
import { type DashboardYieldCategory } from "../../domain/types/yields";
|
|
2
3
|
import type { YieldDto } from "../../generated/api/yield";
|
|
3
|
-
|
|
4
|
+
import type { useApiClient } from "../../providers/api/api-client-provider";
|
|
5
|
+
type TokenMaxYieldRate = {
|
|
4
6
|
rateFormatted: string;
|
|
5
7
|
rateTypeLabel: string;
|
|
6
8
|
};
|
|
9
|
+
export declare const fetchTokenListYieldSummaries: ({ apiClient, signal, tokenBalances, }: {
|
|
10
|
+
apiClient: ReturnType<typeof useApiClient>;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
tokenBalances: ReadonlyArray<TokenBalanceScanResponseDto>;
|
|
13
|
+
}) => Promise<YieldDto[]>;
|
|
14
|
+
export declare const getDashboardCategoryYieldIdsForToken: (availableYieldIds: ReadonlyArray<string>, yieldsById: ReadonlyMap<string, YieldDto>, category: DashboardYieldCategory) => string[];
|
|
7
15
|
export declare const getMaxYieldRateForToken: (availableYieldIds: ReadonlyArray<string>, yieldsById: ReadonlyMap<string, YieldDto>) => TokenMaxYieldRate | null;
|
|
8
|
-
export
|
|
9
|
-
maxYieldRatesByToken: Map<string, TokenMaxYieldRate>;
|
|
10
|
-
isLoading: boolean;
|
|
11
|
-
};
|
|
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>>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { type YieldProviderDetails } from "../../domain/types/yields";
|
|
3
|
+
import type { YieldDto, YieldsControllerGetYieldsParams } from "../../generated/api/yield";
|
|
4
|
+
import type { useApiClient } from "../../providers/api/api-client-provider";
|
|
5
|
+
/**
|
|
6
|
+
* A yield "summary" is the new yields API DTO, returned by
|
|
7
|
+
* `YieldsControllerGetYields`. It contains everything category discovery and
|
|
8
|
+
* list rendering need (`token`, `rewardRate`, `status`, `metadata`,
|
|
9
|
+
* `mechanics.type`, `providerId`).
|
|
10
|
+
*/
|
|
11
|
+
export type YieldSummary = YieldDto;
|
|
12
|
+
export type YieldSummaryWithProvider = YieldSummary & {
|
|
13
|
+
provider?: YieldProviderDetails;
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_YIELD_SUMMARIES_PAGE_LIMIT = 50;
|
|
16
|
+
export type YieldSummariesParams = Pick<YieldsControllerGetYieldsParams, "network" | "types" | "inputToken" | "sort" | "limit">;
|
|
17
|
+
/**
|
|
18
|
+
* A summary is "visible" when it is enterable, on a supported chain, and has a
|
|
19
|
+
* non-zero reward rate (matching the dashboard catalog's display semantics).
|
|
20
|
+
*/
|
|
21
|
+
export declare const isVisibleYieldSummary: (summary: YieldSummary) => boolean;
|
|
22
|
+
export declare const getYieldSummariesQueryKey: (params: YieldSummariesParams & {
|
|
23
|
+
allPages?: boolean;
|
|
24
|
+
}) => (string | (YieldSummariesParams & {
|
|
25
|
+
allPages?: boolean;
|
|
26
|
+
}))[];
|
|
27
|
+
type FetchArgs = {
|
|
28
|
+
apiClient: ReturnType<typeof useApiClient>;
|
|
29
|
+
params: YieldSummariesParams;
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
};
|
|
32
|
+
type FetchByIdsArgs = {
|
|
33
|
+
apiClient: ReturnType<typeof useApiClient>;
|
|
34
|
+
chunkSize?: number;
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
suppressRichErrors?: boolean;
|
|
37
|
+
yieldIds: ReadonlyArray<string>;
|
|
38
|
+
};
|
|
39
|
+
type FetchByIdsWithProvidersArgs = FetchByIdsArgs & {
|
|
40
|
+
queryClient: QueryClient;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Fetch a single page of yield summaries.
|
|
44
|
+
*/
|
|
45
|
+
export declare const fetchYieldSummariesPage: ({ apiClient, params, signal, }: FetchArgs) => Promise<YieldSummary[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Fetch yield summaries by ID without ever sending an unbounded `yieldIds`
|
|
48
|
+
* query array. Results are ordered according to the first occurrence of each
|
|
49
|
+
* requested ID.
|
|
50
|
+
*/
|
|
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[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Fetch every page of yield summaries for the given params, looping `offset`
|
|
55
|
+
* until all `total` items have been retrieved.
|
|
56
|
+
*/
|
|
57
|
+
export declare const fetchAllYieldSummaries: ({ apiClient, params, signal, }: FetchArgs) => Promise<YieldSummary[]>;
|
|
58
|
+
export {};
|
|
@@ -1,11 +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
|
-
maxYieldRate?: TokenMaxYieldRate;
|
|
8
6
|
onTokenBalanceSelect: (tokenBalance: TokenBalanceScanResponseDto) => void;
|
|
9
7
|
};
|
|
10
|
-
export declare const SelectTokenListItem: import("react").MemoExoticComponent<({ item, isConnected, isSelected,
|
|
8
|
+
export declare const SelectTokenListItem: import("react").MemoExoticComponent<({ item, isConnected, isSelected, onTokenBalanceSelect }: Props) => import("react/jsx-runtime").JSX.Element>;
|
|
11
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;
|
|
@@ -14,6 +14,7 @@ import type { SelectedStakeData } from "../types";
|
|
|
14
14
|
export type State = {
|
|
15
15
|
selectedToken: Maybe<TokenDto>;
|
|
16
16
|
selectedStakeId: Maybe<TokenBalanceScanResponseDto["availableYields"][number]>;
|
|
17
|
+
autoSelectYield: boolean;
|
|
17
18
|
selectedValidators: Map<ValidatorDto["address"], ValidatorDto>;
|
|
18
19
|
stakeAmount: BigNumber;
|
|
19
20
|
useMaxAmount: boolean;
|
|
@@ -21,6 +22,11 @@ export type State = {
|
|
|
21
22
|
selectedProviderYieldId: Maybe<Yield["id"]>;
|
|
22
23
|
};
|
|
23
24
|
type TokenBalanceSelectAction = Action<"token/select", TokenDto>;
|
|
25
|
+
type TokenOnlySelectAction = Action<"token-only/select", TokenDto>;
|
|
26
|
+
type DashboardTokenYieldSelectAction = Action<"dashboard/token-yield/select", {
|
|
27
|
+
token: TokenDto;
|
|
28
|
+
yieldDto: Yield;
|
|
29
|
+
}>;
|
|
24
30
|
type YieldSelectAction = Action<"yield/select", Yield>;
|
|
25
31
|
type StakeAmountChangeAction = Action<"stakeAmount/change", BigNumber>;
|
|
26
32
|
type StakeAmountMaxAction = Action<"stakeAmount/max", BigNumber>;
|
|
@@ -30,7 +36,7 @@ type ValidatorMultiSelectAction = Action<"validator/multiselect", ValidatorDto>;
|
|
|
30
36
|
type ValidatorRemoveAction = Action<"validator/remove", ValidatorDto>;
|
|
31
37
|
type SelectTronResourceAction = Action<"tronResource/select", TronResourceType>;
|
|
32
38
|
type ProviderYieldIdSelectAction = Action<"providerYieldId/select", Yield["id"]>;
|
|
33
|
-
export type Actions = TokenBalanceSelectAction | 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;
|
|
34
40
|
export type ExtraData = {
|
|
35
41
|
actions: {
|
|
36
42
|
onMaxClick: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ExtendedYieldType,
|
|
1
|
+
import type { ExtendedYieldType, YieldBase } from "../../../domain/types/yields";
|
|
2
2
|
export type SelectedStakeData = {
|
|
3
|
-
all:
|
|
4
|
-
filtered:
|
|
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
|
-
|
|
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
|
-
|
|
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" |
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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" |
|
|
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:
|
|
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;
|