@reserve-protocol/react-sdk 0.0.1

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.
@@ -0,0 +1,185 @@
1
+ import * as _$_reserve_protocol_sdk0 from "@reserve-protocol/sdk";
2
+ import { BuildIndexDtfBasketProposalParams, BuildIndexDtfBasketSettingsProposalParams, BuildIndexDtfDaoSettingsProposalParams, BuildIndexDtfSettingsProposalParams, BuiltIndexDtfBasketProposal, BuiltIndexDtfProposal, DiscoverDtf, DtfParams, DtfSdk, DtfSdkConfig, GetDiscoverDtfsOptions, GetFullIndexDtfParams, GetIndexDtfBasketParams, GetIndexDtfDelegatesParams, GetIndexDtfGuardiansParams, GetIndexDtfOptimisticProposalVoterStateParams, GetIndexDtfParams, GetIndexDtfPriceHistoryParams, GetIndexDtfPriceParams, GetIndexDtfProposalParams, GetIndexDtfProposalVoterStateParams, GetIndexDtfProposalVotesParams, GetIndexDtfProposalsParams, GetIndexDtfProposerStateParams, GetIndexDtfVoterStateParams, IndexDtfBasket, IndexDtfBrand, IndexDtfDelegate, IndexDtfFull, IndexDtfGuardians, IndexDtfOptimisticProposalVoterState, IndexDtfPrice, IndexDtfPricePoint, IndexDtfProposalDetail, IndexDtfProposalSummary, IndexDtfProposalVoterState, IndexDtfProposalVotes, IndexDtfProposerState, IndexDtfVoterState, ListIndexDtfsParams } from "@reserve-protocol/sdk";
3
+ import * as _$react from "react";
4
+ import { PropsWithChildren } from "react";
5
+ import * as _$_tanstack_react_query0 from "@tanstack/react-query";
6
+ import { DefaultError, QueryKey, UseQueryOptions } from "@tanstack/react-query";
7
+ export * from "@reserve-protocol/sdk";
8
+
9
+ //#region src/provider.d.ts
10
+ type DtfSdkProviderProps = PropsWithChildren<DtfSdkConfig & {
11
+ readonly sdk?: DtfSdk;
12
+ }>;
13
+ declare function DtfSdkProvider({
14
+ apiBaseUrl,
15
+ chains,
16
+ children,
17
+ client,
18
+ sdk
19
+ }: DtfSdkProviderProps): _$react.FunctionComponentElement<_$react.ProviderProps<DtfSdk | undefined>>;
20
+ declare function useDtfSdk(): DtfSdk;
21
+ //#endregion
22
+ //#region src/normalize-query-key.d.ts
23
+ declare function normalizeQueryKeyValue(value: unknown): unknown;
24
+ //#endregion
25
+ //#region src/query-keys.d.ts
26
+ type IndexMethod$4<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
27
+ type IndexMethodParams$2<TKey extends keyof DtfSdk["index"]> = Parameters<IndexMethod$4<TKey>>[0];
28
+ type PastOptimisticVotesQueryKeyParams = Omit<IndexMethodParams$2<"getPastOptimisticVotes">, "timepoint"> & {
29
+ readonly timepoint: bigint;
30
+ };
31
+ declare const dtfQueryKeys: {
32
+ readonly all: readonly ["dtf"];
33
+ readonly discover: (params?: GetDiscoverDtfsOptions) => readonly ["dtf", "discover", unknown];
34
+ readonly index: {
35
+ readonly all: () => readonly ["dtf", "index"];
36
+ readonly list: (params?: ListIndexDtfsParams) => readonly ["dtf", "index", "list", unknown];
37
+ readonly dtf: (params?: GetIndexDtfParams) => readonly ["dtf", "index", "dtf", unknown];
38
+ readonly full: (params?: GetFullIndexDtfParams) => readonly ["dtf", "index", "full", unknown];
39
+ readonly basket: (params?: GetIndexDtfBasketParams) => readonly ["dtf", "index", "basket", unknown];
40
+ readonly brand: (params?: DtfParams) => readonly ["dtf", "index", "brand", unknown];
41
+ readonly price: (params?: GetIndexDtfPriceParams) => readonly ["dtf", "index", "price", unknown];
42
+ readonly priceHistory: (params?: GetIndexDtfPriceHistoryParams) => readonly ["dtf", "index", "price-history", unknown];
43
+ readonly governance: {
44
+ readonly all: () => readonly ["dtf", "index", "governance"];
45
+ readonly proposals: (params?: GetIndexDtfProposalsParams) => readonly ["dtf", "index", "governance", "proposals", unknown];
46
+ readonly proposal: (params?: GetIndexDtfProposalParams) => readonly ["dtf", "index", "governance", "proposal", unknown];
47
+ readonly optimisticGovernance: (params?: IndexMethodParams$2<"getOptimisticGovernance">) => readonly ["dtf", "index", "governance", "optimistic-governance", unknown];
48
+ readonly optimisticProposalContext: (params?: IndexMethodParams$2<"getOptimisticProposalContext">) => readonly ["dtf", "index", "governance", "optimistic-proposal-context", unknown];
49
+ readonly optimisticTimelockRoles: (params?: IndexMethodParams$2<"getOptimisticTimelockRoles">) => readonly ["dtf", "index", "governance", "optimistic-timelock-roles", unknown];
50
+ readonly optimisticVotes: (params?: IndexMethodParams$2<"getOptimisticVotes">) => readonly ["dtf", "index", "governance", "optimistic-votes", unknown];
51
+ readonly pastOptimisticVotes: (params?: PastOptimisticVotesQueryKeyParams) => readonly ["dtf", "index", "governance", "past-optimistic-votes", unknown];
52
+ readonly proposalThrottleCharges: (params?: IndexMethodParams$2<"getProposalThrottleCharges">) => readonly ["dtf", "index", "governance", "proposal-throttle-charges", unknown];
53
+ readonly selectorRegistryTargets: (params?: IndexMethodParams$2<"getSelectorRegistryTargets">) => readonly ["dtf", "index", "governance", "selector-registry-targets", unknown];
54
+ readonly selectorRegistryAllowedSelectors: (params?: IndexMethodParams$2<"getSelectorRegistryAllowedSelectors">) => readonly ["dtf", "index", "governance", "selector-registry-allowed-selectors", unknown];
55
+ readonly selectorRegistryIsAllowed: (params?: IndexMethodParams$2<"getSelectorRegistryIsAllowed">) => readonly ["dtf", "index", "governance", "selector-registry-is-allowed", unknown];
56
+ readonly buildBasketProposal: (params?: BuildIndexDtfBasketProposalParams) => readonly ["dtf", "index", "governance", "build-basket-proposal", unknown];
57
+ readonly buildBasketSettingsProposal: (params?: BuildIndexDtfBasketSettingsProposalParams) => readonly ["dtf", "index", "governance", "build-basket-settings-proposal", unknown];
58
+ readonly buildDaoSettingsProposal: (params?: BuildIndexDtfDaoSettingsProposalParams) => readonly ["dtf", "index", "governance", "build-dao-settings-proposal", unknown];
59
+ readonly buildSettingsProposal: (params?: BuildIndexDtfSettingsProposalParams) => readonly ["dtf", "index", "governance", "build-settings-proposal", unknown];
60
+ readonly delegates: (params?: GetIndexDtfDelegatesParams) => readonly ["dtf", "index", "governance", "delegates", unknown];
61
+ readonly guardians: (params?: GetIndexDtfGuardiansParams) => readonly ["dtf", "index", "governance", "guardians", unknown];
62
+ readonly voterState: (params?: GetIndexDtfVoterStateParams) => readonly ["dtf", "index", "governance", "voter-state", unknown];
63
+ readonly proposerState: (params?: GetIndexDtfProposerStateParams) => readonly ["dtf", "index", "governance", "proposer-state", unknown];
64
+ readonly proposalVotes: (params?: GetIndexDtfProposalVotesParams) => readonly ["dtf", "index", "governance", "proposal-votes", unknown];
65
+ readonly proposalVoterState: (params?: GetIndexDtfProposalVoterStateParams) => readonly ["dtf", "index", "governance", "proposal-voter-state", unknown];
66
+ readonly optimisticProposalVoterState: (params?: GetIndexDtfOptimisticProposalVoterStateParams) => readonly ["dtf", "index", "governance", "optimistic-proposal-voter-state", unknown];
67
+ };
68
+ };
69
+ };
70
+ //#endregion
71
+ //#region src/query-options.d.ts
72
+ type IndexDtfList = Awaited<ReturnType<DtfSdk["index"]["list"]>>;
73
+ type IndexMethod$3<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
74
+ type IndexMethodParams$1<TKey extends keyof DtfSdk["index"]> = Parameters<IndexMethod$3<TKey>>[0];
75
+ type IndexMethodResult$1<TKey extends keyof DtfSdk["index"]> = Awaited<ReturnType<IndexMethod$3<TKey>>>;
76
+ type IndexDtfPastOptimisticVotesQueryParams = Omit<IndexMethodParams$1<"getPastOptimisticVotes">, "timepoint"> & {
77
+ readonly timepoint: bigint;
78
+ };
79
+ type DtfQueryOptions<TQueryFnData, TData = TQueryFnData> = Omit<UseQueryOptions<TQueryFnData, DefaultError, TData, QueryKey>, "enabled" | "queryFn" | "queryKey"> & {
80
+ readonly enabled?: boolean;
81
+ };
82
+ type DtfQueryOptionsResult<TQueryFnData, TData = TQueryFnData> = UseQueryOptions<TQueryFnData, DefaultError, TData, QueryKey> & {
83
+ readonly queryKey: QueryKey;
84
+ readonly queryFn: () => Promise<TQueryFnData>;
85
+ };
86
+ declare function discoverDtfsQueryOptions<TData = readonly DiscoverDtf[]>(sdk: DtfSdk, params?: GetDiscoverDtfsOptions, options?: DtfQueryOptions<readonly DiscoverDtf[], TData>): DtfQueryOptionsResult<readonly DiscoverDtf[], TData>;
87
+ declare function indexDtfListQueryOptions<TData = IndexDtfList>(sdk: DtfSdk, params?: ListIndexDtfsParams, options?: DtfQueryOptions<IndexDtfList, TData>): DtfQueryOptionsResult<readonly _$_reserve_protocol_sdk0.IndexDtfCatalogEntry[], TData>;
88
+ declare function indexDtfQueryOptions<TData = IndexDtfFull>(sdk: DtfSdk, params: GetIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): DtfQueryOptionsResult<IndexDtfFull, TData>;
89
+ declare function fullIndexDtfQueryOptions<TData = IndexDtfFull>(sdk: DtfSdk, params: GetFullIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): DtfQueryOptionsResult<IndexDtfFull, TData>;
90
+ declare function indexDtfBasketQueryOptions<TData = IndexDtfBasket>(sdk: DtfSdk, params: GetIndexDtfBasketParams | undefined, options?: DtfQueryOptions<IndexDtfBasket, TData>): DtfQueryOptionsResult<IndexDtfBasket, TData>;
91
+ declare function indexDtfBrandQueryOptions<TData = IndexDtfBrand | undefined>(sdk: DtfSdk, params: DtfParams | undefined, options?: DtfQueryOptions<IndexDtfBrand | undefined, TData>): DtfQueryOptionsResult<IndexDtfBrand | undefined, TData>;
92
+ declare function indexDtfPriceQueryOptions<TData = IndexDtfPrice>(sdk: DtfSdk, params: GetIndexDtfPriceParams | undefined, options?: DtfQueryOptions<IndexDtfPrice, TData>): DtfQueryOptionsResult<IndexDtfPrice, TData>;
93
+ declare function indexDtfPriceHistoryQueryOptions<TData = readonly IndexDtfPricePoint[]>(sdk: DtfSdk, params: GetIndexDtfPriceHistoryParams | undefined, options?: DtfQueryOptions<readonly IndexDtfPricePoint[], TData>): DtfQueryOptionsResult<readonly IndexDtfPricePoint[], TData>;
94
+ declare function indexDtfProposalsQueryOptions<TData = readonly IndexDtfProposalSummary[]>(sdk: DtfSdk, params: GetIndexDtfProposalsParams | undefined, options?: DtfQueryOptions<readonly IndexDtfProposalSummary[], TData>): DtfQueryOptionsResult<readonly IndexDtfProposalSummary[], TData>;
95
+ declare function indexDtfProposalQueryOptions<TData = IndexDtfProposalDetail>(sdk: DtfSdk, params: GetIndexDtfProposalParams | undefined, options?: DtfQueryOptions<IndexDtfProposalDetail, TData>): DtfQueryOptionsResult<IndexDtfProposalDetail, TData>;
96
+ declare function indexDtfOptimisticGovernanceQueryOptions<TData = IndexMethodResult$1<"getOptimisticGovernance">>(sdk: DtfSdk, params: IndexMethodParams$1<"getOptimisticGovernance"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getOptimisticGovernance">, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.IndexDtfOptimisticGovernance, TData>;
97
+ declare function indexDtfOptimisticProposalContextQueryOptions<TData = IndexMethodResult$1<"getOptimisticProposalContext">>(sdk: DtfSdk, params: IndexMethodParams$1<"getOptimisticProposalContext"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getOptimisticProposalContext">, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.IndexDtfOptimisticProposalContext | null, TData>;
98
+ declare function indexDtfOptimisticTimelockRolesQueryOptions<TData = IndexMethodResult$1<"getOptimisticTimelockRoles">>(sdk: DtfSdk, params: IndexMethodParams$1<"getOptimisticTimelockRoles"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getOptimisticTimelockRoles">, TData>): DtfQueryOptionsResult<{
99
+ optimisticProposers: `0x${string}`[];
100
+ guardians: `0x${string}`[];
101
+ }, TData>;
102
+ declare function indexDtfOptimisticVotesQueryOptions<TData = IndexMethodResult$1<"getOptimisticVotes">>(sdk: DtfSdk, params: IndexMethodParams$1<"getOptimisticVotes"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getOptimisticVotes">, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.Amount, TData>;
103
+ declare function indexDtfPastOptimisticVotesQueryOptions<TData = IndexMethodResult$1<"getPastOptimisticVotes">>(sdk: DtfSdk, params: IndexDtfPastOptimisticVotesQueryParams | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getPastOptimisticVotes">, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.Amount, TData>;
104
+ declare function indexDtfProposalThrottleChargesQueryOptions<TData = IndexMethodResult$1<"getProposalThrottleCharges">>(sdk: DtfSdk, params: IndexMethodParams$1<"getProposalThrottleCharges"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getProposalThrottleCharges">, TData>): DtfQueryOptionsResult<bigint, TData>;
105
+ declare function indexDtfSelectorRegistryTargetsQueryOptions<TData = IndexMethodResult$1<"getSelectorRegistryTargets">>(sdk: DtfSdk, params: IndexMethodParams$1<"getSelectorRegistryTargets"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getSelectorRegistryTargets">, TData>): DtfQueryOptionsResult<readonly `0x${string}`[], TData>;
106
+ declare function indexDtfSelectorRegistryAllowedSelectorsQueryOptions<TData = IndexMethodResult$1<"getSelectorRegistryAllowedSelectors">>(sdk: DtfSdk, params: IndexMethodParams$1<"getSelectorRegistryAllowedSelectors"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getSelectorRegistryAllowedSelectors">, TData>): DtfQueryOptionsResult<readonly `0x${string}`[], TData>;
107
+ declare function indexDtfSelectorRegistryIsAllowedQueryOptions<TData = IndexMethodResult$1<"getSelectorRegistryIsAllowed">>(sdk: DtfSdk, params: IndexMethodParams$1<"getSelectorRegistryIsAllowed"> | undefined, options?: DtfQueryOptions<IndexMethodResult$1<"getSelectorRegistryIsAllowed">, TData>): DtfQueryOptionsResult<boolean, TData>;
108
+ declare function buildIndexDtfBasketProposalQueryOptions<TData = BuiltIndexDtfBasketProposal>(sdk: DtfSdk, params: BuildIndexDtfBasketProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfBasketProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfBasketProposal, TData>;
109
+ declare function buildIndexDtfBasketSettingsProposalQueryOptions<TData = BuiltIndexDtfProposal>(sdk: DtfSdk, params: BuildIndexDtfBasketSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfProposal, TData>;
110
+ declare function buildIndexDtfDaoSettingsProposalQueryOptions<TData = BuiltIndexDtfProposal>(sdk: DtfSdk, params: BuildIndexDtfDaoSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfProposal, TData>;
111
+ declare function buildIndexDtfSettingsProposalQueryOptions<TData = BuiltIndexDtfProposal>(sdk: DtfSdk, params: BuildIndexDtfSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfProposal, TData>;
112
+ declare function indexDtfDelegatesQueryOptions<TData = readonly IndexDtfDelegate[]>(sdk: DtfSdk, params: GetIndexDtfDelegatesParams | undefined, options?: DtfQueryOptions<readonly IndexDtfDelegate[], TData>): DtfQueryOptionsResult<readonly IndexDtfDelegate[], TData>;
113
+ declare function indexDtfGuardiansQueryOptions<TData = IndexDtfGuardians>(sdk: DtfSdk, params: GetIndexDtfGuardiansParams | undefined, options?: DtfQueryOptions<IndexDtfGuardians, TData>): DtfQueryOptionsResult<IndexDtfGuardians, TData>;
114
+ declare function indexDtfVoterStateQueryOptions<TData = IndexDtfVoterState>(sdk: DtfSdk, params: GetIndexDtfVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfVoterState, TData>): DtfQueryOptionsResult<IndexDtfVoterState, TData>;
115
+ declare function indexDtfProposerStateQueryOptions<TData = IndexDtfProposerState>(sdk: DtfSdk, params: GetIndexDtfProposerStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposerState, TData>): DtfQueryOptionsResult<IndexDtfProposerState, TData>;
116
+ declare function indexDtfProposalVotesQueryOptions<TData = IndexDtfProposalVotes>(sdk: DtfSdk, params: GetIndexDtfProposalVotesParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVotes, TData>): DtfQueryOptionsResult<IndexDtfProposalVotes, TData>;
117
+ declare function indexDtfProposalVoterStateQueryOptions<TData = IndexDtfProposalVoterState>(sdk: DtfSdk, params: GetIndexDtfProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVoterState, TData>): DtfQueryOptionsResult<IndexDtfProposalVoterState, TData>;
118
+ declare function indexDtfOptimisticProposalVoterStateQueryOptions<TData = IndexDtfOptimisticProposalVoterState>(sdk: DtfSdk, params: GetIndexDtfOptimisticProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticProposalVoterState, TData>): DtfQueryOptionsResult<IndexDtfOptimisticProposalVoterState, TData>;
119
+ //#endregion
120
+ //#region src/hooks.d.ts
121
+ type IndexMethod$2<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
122
+ type IndexMethodParams<TKey extends keyof DtfSdk["index"]> = Parameters<IndexMethod$2<TKey>>[0];
123
+ type IndexMethodResult<TKey extends keyof DtfSdk["index"]> = Awaited<ReturnType<IndexMethod$2<TKey>>>;
124
+ declare function useDiscoverDtfs<TData = readonly DiscoverDtf[]>(params?: GetDiscoverDtfsOptions, options?: DtfQueryOptions<readonly DiscoverDtf[], TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
125
+ declare function useIndexDtfList<TData = IndexDtfList>(params?: ListIndexDtfsParams, options?: DtfQueryOptions<IndexDtfList, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
126
+ declare function useIndexDtf<TData = IndexDtfFull>(params: GetIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
127
+ declare function useFullIndexDtf<TData = IndexDtfFull>(params: GetFullIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
128
+ declare function useIndexDtfBasket<TData = IndexDtfBasket>(params: GetIndexDtfBasketParams | undefined, options?: DtfQueryOptions<IndexDtfBasket, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
129
+ declare function useIndexDtfBrand<TData = IndexDtfBrand | undefined>(params: DtfParams | undefined, options?: DtfQueryOptions<IndexDtfBrand | undefined, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
130
+ declare function useIndexDtfPrice<TData = IndexDtfPrice>(params: GetIndexDtfPriceParams | undefined, options?: DtfQueryOptions<IndexDtfPrice, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
131
+ declare function useIndexDtfPriceHistory<TData = readonly IndexDtfPricePoint[]>(params: GetIndexDtfPriceHistoryParams | undefined, options?: DtfQueryOptions<readonly IndexDtfPricePoint[], TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
132
+ declare function useIndexDtfProposals<TData = readonly IndexDtfProposalSummary[]>(params: GetIndexDtfProposalsParams | undefined, options?: DtfQueryOptions<readonly IndexDtfProposalSummary[], TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
133
+ declare function useIndexDtfProposal<TData = IndexDtfProposalDetail>(params: GetIndexDtfProposalParams | undefined, options?: DtfQueryOptions<IndexDtfProposalDetail, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
134
+ declare function useIndexDtfOptimisticGovernance<TData = IndexMethodResult<"getOptimisticGovernance">>(params: IndexMethodParams<"getOptimisticGovernance"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getOptimisticGovernance">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
135
+ declare function useIndexDtfOptimisticProposalContext<TData = IndexMethodResult<"getOptimisticProposalContext">>(params: IndexMethodParams<"getOptimisticProposalContext"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getOptimisticProposalContext">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
136
+ declare function useIndexDtfOptimisticTimelockRoles<TData = IndexMethodResult<"getOptimisticTimelockRoles">>(params: IndexMethodParams<"getOptimisticTimelockRoles"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getOptimisticTimelockRoles">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
137
+ declare function useIndexDtfOptimisticVotes<TData = IndexMethodResult<"getOptimisticVotes">>(params: IndexMethodParams<"getOptimisticVotes"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getOptimisticVotes">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
138
+ declare function useIndexDtfPastOptimisticVotes<TData = IndexMethodResult<"getPastOptimisticVotes">>(params: IndexDtfPastOptimisticVotesQueryParams | undefined, options?: DtfQueryOptions<IndexMethodResult<"getPastOptimisticVotes">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
139
+ declare function useIndexDtfProposalThrottleCharges<TData = IndexMethodResult<"getProposalThrottleCharges">>(params: IndexMethodParams<"getProposalThrottleCharges"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getProposalThrottleCharges">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
140
+ declare function useIndexDtfSelectorRegistryTargets<TData = IndexMethodResult<"getSelectorRegistryTargets">>(params: IndexMethodParams<"getSelectorRegistryTargets"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getSelectorRegistryTargets">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
141
+ declare function useIndexDtfSelectorRegistryAllowedSelectors<TData = IndexMethodResult<"getSelectorRegistryAllowedSelectors">>(params: IndexMethodParams<"getSelectorRegistryAllowedSelectors"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getSelectorRegistryAllowedSelectors">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
142
+ declare function useIndexDtfSelectorRegistryIsAllowed<TData = IndexMethodResult<"getSelectorRegistryIsAllowed">>(params: IndexMethodParams<"getSelectorRegistryIsAllowed"> | undefined, options?: DtfQueryOptions<IndexMethodResult<"getSelectorRegistryIsAllowed">, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
143
+ declare function useBuildIndexDtfBasketProposal<TData = BuiltIndexDtfBasketProposal>(params: BuildIndexDtfBasketProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfBasketProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
144
+ declare function useBuildIndexDtfBasketSettingsProposal<TData = BuiltIndexDtfProposal>(params: BuildIndexDtfBasketSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
145
+ declare function useBuildIndexDtfDaoSettingsProposal<TData = BuiltIndexDtfProposal>(params: BuildIndexDtfDaoSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
146
+ declare function useBuildIndexDtfSettingsProposal<TData = BuiltIndexDtfProposal>(params: BuildIndexDtfSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
147
+ declare function useIndexDtfDelegates<TData = readonly IndexDtfDelegate[]>(params: GetIndexDtfDelegatesParams | undefined, options?: DtfQueryOptions<readonly IndexDtfDelegate[], TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
148
+ declare function useIndexDtfGuardians<TData = IndexDtfGuardians>(params: GetIndexDtfGuardiansParams | undefined, options?: DtfQueryOptions<IndexDtfGuardians, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
149
+ declare function useIndexDtfVoterState<TData = IndexDtfVoterState>(params: GetIndexDtfVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfVoterState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
150
+ declare function useIndexDtfProposerState<TData = IndexDtfProposerState>(params: GetIndexDtfProposerStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposerState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
151
+ declare function useIndexDtfProposalVotes<TData = IndexDtfProposalVotes>(params: GetIndexDtfProposalVotesParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVotes, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
152
+ declare function useIndexDtfProposalVoterState<TData = IndexDtfProposalVoterState>(params: GetIndexDtfProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVoterState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
153
+ declare function useIndexDtfOptimisticProposalVoterState<TData = IndexDtfOptimisticProposalVoterState>(params: GetIndexDtfOptimisticProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticProposalVoterState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
154
+ //#endregion
155
+ //#region src/index-dtf-query-options.d.ts
156
+ type IndexMethod$1<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
157
+ type PortfolioMethod$1<TKey extends keyof DtfSdk["portfolio"]> = DtfSdk["portfolio"][TKey] extends ((...args: any) => any) ? DtfSdk["portfolio"][TKey] : never;
158
+ type MethodParams$1<TMethod extends (...args: any) => any> = Parameters<TMethod>[0];
159
+ type MethodResult$1<TMethod extends (...args: any) => any> = Awaited<ReturnType<TMethod>>;
160
+ declare function indexDtfStatusQueryOptions<TData = MethodResult$1<IndexMethod$1<"getStatus">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getStatus">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getStatus">>, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.DtfStatus, TData>;
161
+ declare function indexDtfExposureQueryOptions<TData = MethodResult$1<IndexMethod$1<"getExposure">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getExposure">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getExposure">>, TData>): DtfQueryOptionsResult<readonly _$_reserve_protocol_sdk0.IndexDtfExposureGroup[], TData>;
162
+ declare function indexDtfTransactionsQueryOptions<TData = MethodResult$1<IndexMethod$1<"getTransactions">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getTransactions">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getTransactions">>, TData>): DtfQueryOptionsResult<readonly _$_reserve_protocol_sdk0.IndexDtfTransaction[], TData>;
163
+ declare function indexDtfRevenueQueryOptions<TData = MethodResult$1<IndexMethod$1<"getRevenue">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getRevenue">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getRevenue">>, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.IndexDtfRevenue, TData>;
164
+ declare function indexDtfIssuanceStateQueryOptions<TData = MethodResult$1<IndexMethod$1<"getIssuanceState">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getIssuanceState">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getIssuanceState">>, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.IndexDtfIssuanceState, TData>;
165
+ declare function indexDtfRebalancesQueryOptions<TData = MethodResult$1<IndexMethod$1<"getRebalances">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getRebalances">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getRebalances">>, TData>): DtfQueryOptionsResult<readonly _$_reserve_protocol_sdk0.IndexDtfRebalance[], TData>;
166
+ declare function indexDtfCurrentRebalanceQueryOptions<TData = MethodResult$1<IndexMethod$1<"getCurrentRebalance">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getCurrentRebalance">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getCurrentRebalance">>, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.IndexDtfCurrentRebalanceState, TData>;
167
+ declare function indexDtfVoteLockStateQueryOptions<TData = MethodResult$1<IndexMethod$1<"getVoteLockState">>>(sdk: DtfSdk, params: MethodParams$1<IndexMethod$1<"getVoteLockState">> | undefined, options?: DtfQueryOptions<MethodResult$1<IndexMethod$1<"getVoteLockState">>, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.VoteLockState, TData>;
168
+ declare function accountPortfolioQueryOptions<TData = MethodResult$1<PortfolioMethod$1<"get">>>(sdk: DtfSdk, params: MethodParams$1<PortfolioMethod$1<"get">> | undefined, options?: DtfQueryOptions<MethodResult$1<PortfolioMethod$1<"get">>, TData>): DtfQueryOptionsResult<_$_reserve_protocol_sdk0.AccountPortfolio, TData>;
169
+ //#endregion
170
+ //#region src/index-dtf-extra-hooks.d.ts
171
+ type IndexMethod<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
172
+ type PortfolioMethod<TKey extends keyof DtfSdk["portfolio"]> = DtfSdk["portfolio"][TKey] extends ((...args: any) => any) ? DtfSdk["portfolio"][TKey] : never;
173
+ type MethodParams<TMethod extends (...args: any) => any> = Parameters<TMethod>[0];
174
+ type MethodResult<TMethod extends (...args: any) => any> = Awaited<ReturnType<TMethod>>;
175
+ declare function useIndexDtfStatus<TData = MethodResult<IndexMethod<"getStatus">>>(params: MethodParams<IndexMethod<"getStatus">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getStatus">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
176
+ declare function useIndexDtfExposure<TData = MethodResult<IndexMethod<"getExposure">>>(params: MethodParams<IndexMethod<"getExposure">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getExposure">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
177
+ declare function useIndexDtfTransactions<TData = MethodResult<IndexMethod<"getTransactions">>>(params: MethodParams<IndexMethod<"getTransactions">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getTransactions">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
178
+ declare function useIndexDtfRevenue<TData = MethodResult<IndexMethod<"getRevenue">>>(params: MethodParams<IndexMethod<"getRevenue">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getRevenue">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
179
+ declare function useIndexDtfIssuanceState<TData = MethodResult<IndexMethod<"getIssuanceState">>>(params: MethodParams<IndexMethod<"getIssuanceState">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getIssuanceState">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
180
+ declare function useIndexDtfRebalances<TData = MethodResult<IndexMethod<"getRebalances">>>(params: MethodParams<IndexMethod<"getRebalances">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getRebalances">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
181
+ declare function useIndexDtfCurrentRebalance<TData = MethodResult<IndexMethod<"getCurrentRebalance">>>(params: MethodParams<IndexMethod<"getCurrentRebalance">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getCurrentRebalance">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
182
+ declare function useIndexDtfVoteLockState<TData = MethodResult<IndexMethod<"getVoteLockState">>>(params: MethodParams<IndexMethod<"getVoteLockState">> | undefined, options?: DtfQueryOptions<MethodResult<IndexMethod<"getVoteLockState">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
183
+ declare function useAccountPortfolio<TData = MethodResult<PortfolioMethod<"get">>>(params: MethodParams<PortfolioMethod<"get">> | undefined, options?: DtfQueryOptions<MethodResult<PortfolioMethod<"get">>, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
184
+ //#endregion
185
+ export { type DtfQueryOptions, type DtfQueryOptionsResult, DtfSdkProvider, type DtfSdkProviderProps, type IndexDtfPastOptimisticVotesQueryParams, accountPortfolioQueryOptions, buildIndexDtfBasketProposalQueryOptions, buildIndexDtfBasketSettingsProposalQueryOptions, buildIndexDtfDaoSettingsProposalQueryOptions, buildIndexDtfSettingsProposalQueryOptions, discoverDtfsQueryOptions, dtfQueryKeys, fullIndexDtfQueryOptions, indexDtfBasketQueryOptions, indexDtfBrandQueryOptions, indexDtfCurrentRebalanceQueryOptions, indexDtfDelegatesQueryOptions, indexDtfExposureQueryOptions, indexDtfGuardiansQueryOptions, indexDtfIssuanceStateQueryOptions, indexDtfListQueryOptions, indexDtfOptimisticGovernanceQueryOptions, indexDtfOptimisticProposalContextQueryOptions, indexDtfOptimisticProposalVoterStateQueryOptions, indexDtfOptimisticTimelockRolesQueryOptions, indexDtfOptimisticVotesQueryOptions, indexDtfPastOptimisticVotesQueryOptions, indexDtfPriceHistoryQueryOptions, indexDtfPriceQueryOptions, indexDtfProposalQueryOptions, indexDtfProposalThrottleChargesQueryOptions, indexDtfProposalVoterStateQueryOptions, indexDtfProposalVotesQueryOptions, indexDtfProposalsQueryOptions, indexDtfProposerStateQueryOptions, indexDtfQueryOptions, indexDtfRebalancesQueryOptions, indexDtfRevenueQueryOptions, indexDtfSelectorRegistryAllowedSelectorsQueryOptions, indexDtfSelectorRegistryIsAllowedQueryOptions, indexDtfSelectorRegistryTargetsQueryOptions, indexDtfStatusQueryOptions, indexDtfTransactionsQueryOptions, indexDtfVoteLockStateQueryOptions, indexDtfVoterStateQueryOptions, normalizeQueryKeyValue, useAccountPortfolio, useBuildIndexDtfBasketProposal, useBuildIndexDtfBasketSettingsProposal, useBuildIndexDtfDaoSettingsProposal, useBuildIndexDtfSettingsProposal, useDiscoverDtfs, useDtfSdk, useFullIndexDtf, useIndexDtf, useIndexDtfBasket, useIndexDtfBrand, useIndexDtfCurrentRebalance, useIndexDtfDelegates, useIndexDtfExposure, useIndexDtfGuardians, useIndexDtfIssuanceState, useIndexDtfList, useIndexDtfOptimisticGovernance, useIndexDtfOptimisticProposalContext, useIndexDtfOptimisticProposalVoterState, useIndexDtfOptimisticTimelockRoles, useIndexDtfOptimisticVotes, useIndexDtfPastOptimisticVotes, useIndexDtfPrice, useIndexDtfPriceHistory, useIndexDtfProposal, useIndexDtfProposalThrottleCharges, useIndexDtfProposalVoterState, useIndexDtfProposalVotes, useIndexDtfProposals, useIndexDtfProposerState, useIndexDtfRebalances, useIndexDtfRevenue, useIndexDtfSelectorRegistryAllowedSelectors, useIndexDtfSelectorRegistryIsAllowed, useIndexDtfSelectorRegistryTargets, useIndexDtfStatus, useIndexDtfTransactions, useIndexDtfVoteLockState, useIndexDtfVoterState };
package/dist/index.mjs ADDED
@@ -0,0 +1,568 @@
1
+ import { createDtfSdk, getDiscoverDtfs, getIndexDtfProposalGovernanceAddresses } from "@reserve-protocol/sdk";
2
+ import { createContext, createElement, useContext, useMemo } from "react";
3
+ import { isAddress } from "viem";
4
+ import { useQuery } from "@tanstack/react-query";
5
+ export * from "@reserve-protocol/sdk";
6
+ //#region src/provider.ts
7
+ const DtfSdkContext = createContext(void 0);
8
+ function DtfSdkProvider({ apiBaseUrl, chains, children, client, sdk }) {
9
+ const value = useMemo(() => {
10
+ if (sdk) return sdk;
11
+ return createDtfSdk({
12
+ ...apiBaseUrl ? { apiBaseUrl } : {},
13
+ ...chains ? { chains } : {},
14
+ ...client ? { client } : {}
15
+ });
16
+ }, [
17
+ apiBaseUrl,
18
+ chains,
19
+ client,
20
+ sdk
21
+ ]);
22
+ return createElement(DtfSdkContext.Provider, { value }, children);
23
+ }
24
+ function useDtfSdk() {
25
+ const sdk = useContext(DtfSdkContext);
26
+ if (!sdk) throw new Error("useDtfSdk must be used inside DtfSdkProvider.");
27
+ return sdk;
28
+ }
29
+ //#endregion
30
+ //#region src/normalize-query-key.ts
31
+ function normalizeQueryKeyValue(value) {
32
+ if (typeof value === "bigint") return value.toString();
33
+ if (typeof value === "string") return isAddress(value, { strict: false }) ? value.toLowerCase() : value;
34
+ if (Array.isArray(value)) return value.map((item) => normalizeQueryKeyValue(item));
35
+ if (!value || typeof value !== "object") return value;
36
+ const normalized = {};
37
+ for (const key of Object.keys(value).sort()) {
38
+ const normalizedValue = normalizeQueryKeyValue(value[key]);
39
+ if (normalizedValue !== void 0) normalized[key] = normalizedValue;
40
+ }
41
+ return normalized;
42
+ }
43
+ //#endregion
44
+ //#region src/query-keys.ts
45
+ const defaultKey = "default";
46
+ function keyParams(params) {
47
+ return params === void 0 ? defaultKey : normalizeQueryKeyValue(params);
48
+ }
49
+ function indexDtfProposalsKeyParams(params) {
50
+ if (!params) return params;
51
+ if ("dtf" in params && params.dtf) return {
52
+ dtf: {
53
+ address: params.dtf.id,
54
+ chainId: params.dtf.chainId,
55
+ governanceAddresses: sortedAddressSet(getIndexDtfProposalGovernanceAddresses(params.dtf))
56
+ },
57
+ limit: params.limit
58
+ };
59
+ if ("governanceAddresses" in params && params.governanceAddresses) return {
60
+ ...params,
61
+ governanceAddresses: sortedAddressSet(params.governanceAddresses)
62
+ };
63
+ return params;
64
+ }
65
+ function indexDtfGuardiansKeyParams(params) {
66
+ if (!params) return params;
67
+ if ("dtf" in params) return { dtf: {
68
+ address: params.dtf.id,
69
+ chainId: params.dtf.chainId,
70
+ guardians: getGuardianKeyAddresses(params.dtf)
71
+ } };
72
+ return params;
73
+ }
74
+ function proposalVoterStateKeyParams(params) {
75
+ if (!params) return params;
76
+ const vote = params.proposal.votes.find((proposalVote) => proposalVote.voter.toLowerCase() === params.account.toLowerCase());
77
+ return {
78
+ account: params.account,
79
+ chainId: params.chainId,
80
+ governance: params.governance,
81
+ proposal: {
82
+ id: params.proposal.id,
83
+ vote: vote?.choice ?? null,
84
+ voteStart: params.proposal.voteStart
85
+ }
86
+ };
87
+ }
88
+ function optimisticProposalVoterStateKeyParams(params) {
89
+ if (!params) return params;
90
+ const vote = params.proposal.votes.find((proposalVote) => proposalVote.voter.toLowerCase() === params.account.toLowerCase());
91
+ return {
92
+ account: params.account,
93
+ chainId: params.chainId,
94
+ governance: params.governance,
95
+ proposal: {
96
+ id: params.proposal.id,
97
+ optimisticSnapshot: params.proposal.optimistic?.snapshot,
98
+ vote: vote?.choice ?? null,
99
+ voteStart: params.proposal.voteStart,
100
+ voteToken: params.proposal.voteToken
101
+ }
102
+ };
103
+ }
104
+ function selectorRegistryIsAllowedKeyParams(params) {
105
+ if (!params) return params;
106
+ return {
107
+ ...params,
108
+ selector: params.selector.toLowerCase()
109
+ };
110
+ }
111
+ function sortedAddressSet(addresses) {
112
+ return [...new Set((Array.isArray(addresses) ? addresses : [addresses]).map((address) => address.toLowerCase()))].sort();
113
+ }
114
+ function getGuardianKeyAddresses(dtf) {
115
+ return sortedAddressSet([
116
+ ...getAuthorityKeyAddresses(dtf.governance.admin.primary),
117
+ ...getAuthorityKeyAddresses(dtf.governance.rebalance.primary),
118
+ ...getAuthorityKeyAddresses(dtf.governance.voteLock)
119
+ ]);
120
+ }
121
+ function getAuthorityKeyAddresses(authority) {
122
+ if (!authority) return [];
123
+ if (authority.type === "address") return [authority.address];
124
+ return [
125
+ authority.address,
126
+ authority.governance.timelock.address,
127
+ ...authority.governance.timelock.guardians
128
+ ];
129
+ }
130
+ const dtfQueryKeys = {
131
+ all: ["dtf"],
132
+ discover: (params) => [
133
+ ...dtfQueryKeys.all,
134
+ "discover",
135
+ keyParams(params)
136
+ ],
137
+ index: {
138
+ all: () => [...dtfQueryKeys.all, "index"],
139
+ list: (params) => [
140
+ ...dtfQueryKeys.index.all(),
141
+ "list",
142
+ keyParams(params)
143
+ ],
144
+ dtf: (params) => [
145
+ ...dtfQueryKeys.index.all(),
146
+ "dtf",
147
+ keyParams(params)
148
+ ],
149
+ full: (params) => [
150
+ ...dtfQueryKeys.index.all(),
151
+ "full",
152
+ keyParams(params)
153
+ ],
154
+ basket: (params) => [
155
+ ...dtfQueryKeys.index.all(),
156
+ "basket",
157
+ keyParams(params)
158
+ ],
159
+ brand: (params) => [
160
+ ...dtfQueryKeys.index.all(),
161
+ "brand",
162
+ keyParams(params)
163
+ ],
164
+ price: (params) => [
165
+ ...dtfQueryKeys.index.all(),
166
+ "price",
167
+ keyParams(params)
168
+ ],
169
+ priceHistory: (params) => [
170
+ ...dtfQueryKeys.index.all(),
171
+ "price-history",
172
+ keyParams(params)
173
+ ],
174
+ governance: {
175
+ all: () => [...dtfQueryKeys.index.all(), "governance"],
176
+ proposals: (params) => [
177
+ ...dtfQueryKeys.index.governance.all(),
178
+ "proposals",
179
+ keyParams(indexDtfProposalsKeyParams(params))
180
+ ],
181
+ proposal: (params) => [
182
+ ...dtfQueryKeys.index.governance.all(),
183
+ "proposal",
184
+ keyParams(params)
185
+ ],
186
+ optimisticGovernance: (params) => [
187
+ ...dtfQueryKeys.index.governance.all(),
188
+ "optimistic-governance",
189
+ keyParams(params)
190
+ ],
191
+ optimisticProposalContext: (params) => [
192
+ ...dtfQueryKeys.index.governance.all(),
193
+ "optimistic-proposal-context",
194
+ keyParams(params)
195
+ ],
196
+ optimisticTimelockRoles: (params) => [
197
+ ...dtfQueryKeys.index.governance.all(),
198
+ "optimistic-timelock-roles",
199
+ keyParams(params)
200
+ ],
201
+ optimisticVotes: (params) => [
202
+ ...dtfQueryKeys.index.governance.all(),
203
+ "optimistic-votes",
204
+ keyParams(params)
205
+ ],
206
+ pastOptimisticVotes: (params) => [
207
+ ...dtfQueryKeys.index.governance.all(),
208
+ "past-optimistic-votes",
209
+ keyParams(params)
210
+ ],
211
+ proposalThrottleCharges: (params) => [
212
+ ...dtfQueryKeys.index.governance.all(),
213
+ "proposal-throttle-charges",
214
+ keyParams(params)
215
+ ],
216
+ selectorRegistryTargets: (params) => [
217
+ ...dtfQueryKeys.index.governance.all(),
218
+ "selector-registry-targets",
219
+ keyParams(params)
220
+ ],
221
+ selectorRegistryAllowedSelectors: (params) => [
222
+ ...dtfQueryKeys.index.governance.all(),
223
+ "selector-registry-allowed-selectors",
224
+ keyParams(params)
225
+ ],
226
+ selectorRegistryIsAllowed: (params) => [
227
+ ...dtfQueryKeys.index.governance.all(),
228
+ "selector-registry-is-allowed",
229
+ keyParams(selectorRegistryIsAllowedKeyParams(params))
230
+ ],
231
+ buildBasketProposal: (params) => [
232
+ ...dtfQueryKeys.index.governance.all(),
233
+ "build-basket-proposal",
234
+ keyParams(params)
235
+ ],
236
+ buildBasketSettingsProposal: (params) => [
237
+ ...dtfQueryKeys.index.governance.all(),
238
+ "build-basket-settings-proposal",
239
+ keyParams(params)
240
+ ],
241
+ buildDaoSettingsProposal: (params) => [
242
+ ...dtfQueryKeys.index.governance.all(),
243
+ "build-dao-settings-proposal",
244
+ keyParams(params)
245
+ ],
246
+ buildSettingsProposal: (params) => [
247
+ ...dtfQueryKeys.index.governance.all(),
248
+ "build-settings-proposal",
249
+ keyParams(params)
250
+ ],
251
+ delegates: (params) => [
252
+ ...dtfQueryKeys.index.governance.all(),
253
+ "delegates",
254
+ keyParams(params)
255
+ ],
256
+ guardians: (params) => [
257
+ ...dtfQueryKeys.index.governance.all(),
258
+ "guardians",
259
+ keyParams(indexDtfGuardiansKeyParams(params))
260
+ ],
261
+ voterState: (params) => [
262
+ ...dtfQueryKeys.index.governance.all(),
263
+ "voter-state",
264
+ keyParams(params)
265
+ ],
266
+ proposerState: (params) => [
267
+ ...dtfQueryKeys.index.governance.all(),
268
+ "proposer-state",
269
+ keyParams(params)
270
+ ],
271
+ proposalVotes: (params) => [
272
+ ...dtfQueryKeys.index.governance.all(),
273
+ "proposal-votes",
274
+ keyParams(params)
275
+ ],
276
+ proposalVoterState: (params) => [
277
+ ...dtfQueryKeys.index.governance.all(),
278
+ "proposal-voter-state",
279
+ keyParams(proposalVoterStateKeyParams(params))
280
+ ],
281
+ optimisticProposalVoterState: (params) => [
282
+ ...dtfQueryKeys.index.governance.all(),
283
+ "optimistic-proposal-voter-state",
284
+ keyParams(optimisticProposalVoterStateKeyParams(params))
285
+ ]
286
+ }
287
+ }
288
+ };
289
+ //#endregion
290
+ //#region src/query-options.ts
291
+ function createDtfQueryOptions(queryKey, queryFn, enabled, options = {}) {
292
+ return {
293
+ ...options,
294
+ queryKey,
295
+ queryFn,
296
+ enabled: enabled && options.enabled !== false
297
+ };
298
+ }
299
+ function requireParams$1(params, method) {
300
+ if (params === void 0) throw new Error(`${method} params are required.`);
301
+ return params;
302
+ }
303
+ function discoverDtfsQueryOptions(sdk, params, options) {
304
+ return createDtfQueryOptions(dtfQueryKeys.discover(params), () => getDiscoverDtfs(sdk.client, params), true, options);
305
+ }
306
+ function indexDtfListQueryOptions(sdk, params, options) {
307
+ return createDtfQueryOptions(dtfQueryKeys.index.list(params), () => sdk.index.list(params), true, options);
308
+ }
309
+ function indexDtfQueryOptions(sdk, params, options) {
310
+ return createDtfQueryOptions(dtfQueryKeys.index.full(params), () => sdk.index.get(requireParams$1(params, "indexDtfQueryOptions")), params !== void 0, options);
311
+ }
312
+ function fullIndexDtfQueryOptions(sdk, params, options) {
313
+ return createDtfQueryOptions(dtfQueryKeys.index.full(params), () => sdk.index.getFull(requireParams$1(params, "fullIndexDtfQueryOptions")), params !== void 0, options);
314
+ }
315
+ function indexDtfBasketQueryOptions(sdk, params, options) {
316
+ return createDtfQueryOptions(dtfQueryKeys.index.basket(params), () => sdk.index.getBasket(requireParams$1(params, "indexDtfBasketQueryOptions")), params !== void 0, options);
317
+ }
318
+ function indexDtfBrandQueryOptions(sdk, params, options) {
319
+ return createDtfQueryOptions(dtfQueryKeys.index.brand(params), () => sdk.index.getBrand(requireParams$1(params, "indexDtfBrandQueryOptions")), params !== void 0, options);
320
+ }
321
+ function indexDtfPriceQueryOptions(sdk, params, options) {
322
+ return createDtfQueryOptions(dtfQueryKeys.index.price(params), () => sdk.index.getPrice(requireParams$1(params, "indexDtfPriceQueryOptions")), params !== void 0, options);
323
+ }
324
+ function indexDtfPriceHistoryQueryOptions(sdk, params, options) {
325
+ return createDtfQueryOptions(dtfQueryKeys.index.priceHistory(params), () => sdk.index.getPriceHistory(requireParams$1(params, "indexDtfPriceHistoryQueryOptions")), params !== void 0, options);
326
+ }
327
+ function indexDtfProposalsQueryOptions(sdk, params, options) {
328
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposals(params), () => sdk.index.getProposals(requireParams$1(params, "indexDtfProposalsQueryOptions")), params !== void 0, options);
329
+ }
330
+ function indexDtfProposalQueryOptions(sdk, params, options) {
331
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposal(params), () => sdk.index.getProposal(requireParams$1(params, "indexDtfProposalQueryOptions")), params !== void 0, options);
332
+ }
333
+ function indexDtfOptimisticGovernanceQueryOptions(sdk, params, options) {
334
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticGovernance(params), () => sdk.index.getOptimisticGovernance(requireParams$1(params, "indexDtfOptimisticGovernanceQueryOptions")), params !== void 0, options);
335
+ }
336
+ function indexDtfOptimisticProposalContextQueryOptions(sdk, params, options) {
337
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticProposalContext(params), () => sdk.index.getOptimisticProposalContext(requireParams$1(params, "indexDtfOptimisticProposalContextQueryOptions")), params !== void 0, options);
338
+ }
339
+ function indexDtfOptimisticTimelockRolesQueryOptions(sdk, params, options) {
340
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticTimelockRoles(params), () => sdk.index.getOptimisticTimelockRoles(requireParams$1(params, "indexDtfOptimisticTimelockRolesQueryOptions")), params !== void 0, options);
341
+ }
342
+ function indexDtfOptimisticVotesQueryOptions(sdk, params, options) {
343
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticVotes(params), () => sdk.index.getOptimisticVotes(requireParams$1(params, "indexDtfOptimisticVotesQueryOptions")), params !== void 0, options);
344
+ }
345
+ function indexDtfPastOptimisticVotesQueryOptions(sdk, params, options) {
346
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.pastOptimisticVotes(params), () => sdk.index.getPastOptimisticVotes(requireParams$1(params, "indexDtfPastOptimisticVotesQueryOptions")), params !== void 0, options);
347
+ }
348
+ function indexDtfProposalThrottleChargesQueryOptions(sdk, params, options) {
349
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalThrottleCharges(params), () => sdk.index.getProposalThrottleCharges(requireParams$1(params, "indexDtfProposalThrottleChargesQueryOptions")), params !== void 0, options);
350
+ }
351
+ function indexDtfSelectorRegistryTargetsQueryOptions(sdk, params, options) {
352
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.selectorRegistryTargets(params), () => sdk.index.getSelectorRegistryTargets(requireParams$1(params, "indexDtfSelectorRegistryTargetsQueryOptions")), params !== void 0, options);
353
+ }
354
+ function indexDtfSelectorRegistryAllowedSelectorsQueryOptions(sdk, params, options) {
355
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.selectorRegistryAllowedSelectors(params), () => sdk.index.getSelectorRegistryAllowedSelectors(requireParams$1(params, "indexDtfSelectorRegistryAllowedSelectorsQueryOptions")), params !== void 0, options);
356
+ }
357
+ function indexDtfSelectorRegistryIsAllowedQueryOptions(sdk, params, options) {
358
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.selectorRegistryIsAllowed(params), () => sdk.index.getSelectorRegistryIsAllowed(requireParams$1(params, "indexDtfSelectorRegistryIsAllowedQueryOptions")), params !== void 0, options);
359
+ }
360
+ function buildIndexDtfBasketProposalQueryOptions(sdk, params, options) {
361
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.buildBasketProposal(params), () => sdk.index.buildBasketProposal(requireParams$1(params, "buildIndexDtfBasketProposalQueryOptions")), params !== void 0, options);
362
+ }
363
+ function buildIndexDtfBasketSettingsProposalQueryOptions(sdk, params, options) {
364
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.buildBasketSettingsProposal(params), () => sdk.index.buildBasketSettingsProposal(requireParams$1(params, "buildIndexDtfBasketSettingsProposalQueryOptions")), params !== void 0, options);
365
+ }
366
+ function buildIndexDtfDaoSettingsProposalQueryOptions(sdk, params, options) {
367
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.buildDaoSettingsProposal(params), () => sdk.index.buildDaoSettingsProposal(requireParams$1(params, "buildIndexDtfDaoSettingsProposalQueryOptions")), params !== void 0, options);
368
+ }
369
+ function buildIndexDtfSettingsProposalQueryOptions(sdk, params, options) {
370
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.buildSettingsProposal(params), () => sdk.index.buildSettingsProposal(requireParams$1(params, "buildIndexDtfSettingsProposalQueryOptions")), params !== void 0, options);
371
+ }
372
+ function indexDtfDelegatesQueryOptions(sdk, params, options) {
373
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.delegates(params), () => sdk.index.getDelegates(requireParams$1(params, "indexDtfDelegatesQueryOptions")), params !== void 0, options);
374
+ }
375
+ function indexDtfGuardiansQueryOptions(sdk, params, options) {
376
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.guardians(params), () => sdk.index.getGuardians(requireParams$1(params, "indexDtfGuardiansQueryOptions")), params !== void 0, options);
377
+ }
378
+ function indexDtfVoterStateQueryOptions(sdk, params, options) {
379
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.voterState(params), () => sdk.index.getVoterState(requireParams$1(params, "indexDtfVoterStateQueryOptions")), params !== void 0, options);
380
+ }
381
+ function indexDtfProposerStateQueryOptions(sdk, params, options) {
382
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposerState(params), () => sdk.index.getProposerState(requireParams$1(params, "indexDtfProposerStateQueryOptions")), params !== void 0, options);
383
+ }
384
+ function indexDtfProposalVotesQueryOptions(sdk, params, options) {
385
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalVotes(params), () => sdk.index.getProposalVotes(requireParams$1(params, "indexDtfProposalVotesQueryOptions")), params !== void 0, options);
386
+ }
387
+ function indexDtfProposalVoterStateQueryOptions(sdk, params, options) {
388
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalVoterState(params), () => sdk.index.getProposalVoterState(requireParams$1(params, "indexDtfProposalVoterStateQueryOptions")), params !== void 0, options);
389
+ }
390
+ function indexDtfOptimisticProposalVoterStateQueryOptions(sdk, params, options) {
391
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticProposalVoterState(params), () => sdk.index.getOptimisticProposalVoterState(requireParams$1(params, "indexDtfOptimisticProposalVoterStateQueryOptions")), params !== void 0, options);
392
+ }
393
+ //#endregion
394
+ //#region src/hooks.ts
395
+ function useDiscoverDtfs(params, options) {
396
+ return useQuery(discoverDtfsQueryOptions(useDtfSdk(), params, options));
397
+ }
398
+ function useIndexDtfList(params, options) {
399
+ return useQuery(indexDtfListQueryOptions(useDtfSdk(), params, options));
400
+ }
401
+ function useIndexDtf(params, options) {
402
+ return useQuery(indexDtfQueryOptions(useDtfSdk(), params, options));
403
+ }
404
+ function useFullIndexDtf(params, options) {
405
+ return useQuery(fullIndexDtfQueryOptions(useDtfSdk(), params, options));
406
+ }
407
+ function useIndexDtfBasket(params, options) {
408
+ return useQuery(indexDtfBasketQueryOptions(useDtfSdk(), params, options));
409
+ }
410
+ function useIndexDtfBrand(params, options) {
411
+ return useQuery(indexDtfBrandQueryOptions(useDtfSdk(), params, options));
412
+ }
413
+ function useIndexDtfPrice(params, options) {
414
+ return useQuery(indexDtfPriceQueryOptions(useDtfSdk(), params, options));
415
+ }
416
+ function useIndexDtfPriceHistory(params, options) {
417
+ return useQuery(indexDtfPriceHistoryQueryOptions(useDtfSdk(), params, options));
418
+ }
419
+ function useIndexDtfProposals(params, options) {
420
+ return useQuery(indexDtfProposalsQueryOptions(useDtfSdk(), params, options));
421
+ }
422
+ function useIndexDtfProposal(params, options) {
423
+ return useQuery(indexDtfProposalQueryOptions(useDtfSdk(), params, options));
424
+ }
425
+ function useIndexDtfOptimisticGovernance(params, options) {
426
+ return useQuery(indexDtfOptimisticGovernanceQueryOptions(useDtfSdk(), params, options));
427
+ }
428
+ function useIndexDtfOptimisticProposalContext(params, options) {
429
+ return useQuery(indexDtfOptimisticProposalContextQueryOptions(useDtfSdk(), params, options));
430
+ }
431
+ function useIndexDtfOptimisticTimelockRoles(params, options) {
432
+ return useQuery(indexDtfOptimisticTimelockRolesQueryOptions(useDtfSdk(), params, options));
433
+ }
434
+ function useIndexDtfOptimisticVotes(params, options) {
435
+ return useQuery(indexDtfOptimisticVotesQueryOptions(useDtfSdk(), params, options));
436
+ }
437
+ function useIndexDtfPastOptimisticVotes(params, options) {
438
+ return useQuery(indexDtfPastOptimisticVotesQueryOptions(useDtfSdk(), params, options));
439
+ }
440
+ function useIndexDtfProposalThrottleCharges(params, options) {
441
+ return useQuery(indexDtfProposalThrottleChargesQueryOptions(useDtfSdk(), params, options));
442
+ }
443
+ function useIndexDtfSelectorRegistryTargets(params, options) {
444
+ return useQuery(indexDtfSelectorRegistryTargetsQueryOptions(useDtfSdk(), params, options));
445
+ }
446
+ function useIndexDtfSelectorRegistryAllowedSelectors(params, options) {
447
+ return useQuery(indexDtfSelectorRegistryAllowedSelectorsQueryOptions(useDtfSdk(), params, options));
448
+ }
449
+ function useIndexDtfSelectorRegistryIsAllowed(params, options) {
450
+ return useQuery(indexDtfSelectorRegistryIsAllowedQueryOptions(useDtfSdk(), params, options));
451
+ }
452
+ function useBuildIndexDtfBasketProposal(params, options) {
453
+ return useQuery(buildIndexDtfBasketProposalQueryOptions(useDtfSdk(), params, options));
454
+ }
455
+ function useBuildIndexDtfBasketSettingsProposal(params, options) {
456
+ return useQuery(buildIndexDtfBasketSettingsProposalQueryOptions(useDtfSdk(), params, options));
457
+ }
458
+ function useBuildIndexDtfDaoSettingsProposal(params, options) {
459
+ return useQuery(buildIndexDtfDaoSettingsProposalQueryOptions(useDtfSdk(), params, options));
460
+ }
461
+ function useBuildIndexDtfSettingsProposal(params, options) {
462
+ return useQuery(buildIndexDtfSettingsProposalQueryOptions(useDtfSdk(), params, options));
463
+ }
464
+ function useIndexDtfDelegates(params, options) {
465
+ return useQuery(indexDtfDelegatesQueryOptions(useDtfSdk(), params, options));
466
+ }
467
+ function useIndexDtfGuardians(params, options) {
468
+ return useQuery(indexDtfGuardiansQueryOptions(useDtfSdk(), params, options));
469
+ }
470
+ function useIndexDtfVoterState(params, options) {
471
+ return useQuery(indexDtfVoterStateQueryOptions(useDtfSdk(), params, options));
472
+ }
473
+ function useIndexDtfProposerState(params, options) {
474
+ return useQuery(indexDtfProposerStateQueryOptions(useDtfSdk(), params, options));
475
+ }
476
+ function useIndexDtfProposalVotes(params, options) {
477
+ return useQuery(indexDtfProposalVotesQueryOptions(useDtfSdk(), params, options));
478
+ }
479
+ function useIndexDtfProposalVoterState(params, options) {
480
+ return useQuery(indexDtfProposalVoterStateQueryOptions(useDtfSdk(), params, options));
481
+ }
482
+ function useIndexDtfOptimisticProposalVoterState(params, options) {
483
+ return useQuery(indexDtfOptimisticProposalVoterStateQueryOptions(useDtfSdk(), params, options));
484
+ }
485
+ //#endregion
486
+ //#region src/index-dtf-query-options.ts
487
+ function queryOptions(key, queryFn, enabled, options = {}) {
488
+ return {
489
+ ...options,
490
+ queryKey: key,
491
+ queryFn,
492
+ enabled: enabled && options.enabled !== false
493
+ };
494
+ }
495
+ function key(scope, params) {
496
+ return [
497
+ "dtf",
498
+ "index",
499
+ scope,
500
+ normalizeQueryKeyValue(params)
501
+ ];
502
+ }
503
+ function requireParams(params, method) {
504
+ if (params === void 0) throw new Error(`${method} params are required.`);
505
+ return params;
506
+ }
507
+ function indexDtfStatusQueryOptions(sdk, params, options) {
508
+ return queryOptions(key("status", params), () => sdk.index.getStatus(requireParams(params, "indexDtfStatusQueryOptions")), params !== void 0, options);
509
+ }
510
+ function indexDtfExposureQueryOptions(sdk, params, options) {
511
+ return queryOptions(key("exposure", params), () => sdk.index.getExposure(requireParams(params, "indexDtfExposureQueryOptions")), params !== void 0, options);
512
+ }
513
+ function indexDtfTransactionsQueryOptions(sdk, params, options) {
514
+ return queryOptions(key("transactions", params), () => sdk.index.getTransactions(requireParams(params, "indexDtfTransactionsQueryOptions")), params !== void 0, options);
515
+ }
516
+ function indexDtfRevenueQueryOptions(sdk, params, options) {
517
+ return queryOptions(key("revenue", params), () => sdk.index.getRevenue(requireParams(params, "indexDtfRevenueQueryOptions")), params !== void 0, options);
518
+ }
519
+ function indexDtfIssuanceStateQueryOptions(sdk, params, options) {
520
+ return queryOptions(key("issuance-state", params), () => sdk.index.getIssuanceState(requireParams(params, "indexDtfIssuanceStateQueryOptions")), params !== void 0, options);
521
+ }
522
+ function indexDtfRebalancesQueryOptions(sdk, params, options) {
523
+ return queryOptions(key("rebalances", params), () => sdk.index.getRebalances(requireParams(params, "indexDtfRebalancesQueryOptions")), params !== void 0, options);
524
+ }
525
+ function indexDtfCurrentRebalanceQueryOptions(sdk, params, options) {
526
+ return queryOptions(key("current-rebalance", params), () => sdk.index.getCurrentRebalance(requireParams(params, "indexDtfCurrentRebalanceQueryOptions")), params !== void 0, options);
527
+ }
528
+ function indexDtfVoteLockStateQueryOptions(sdk, params, options) {
529
+ return queryOptions(key("vote-lock-state", params), () => sdk.index.getVoteLockState(requireParams(params, "indexDtfVoteLockStateQueryOptions")), params !== void 0, options);
530
+ }
531
+ function accountPortfolioQueryOptions(sdk, params, options) {
532
+ return queryOptions([
533
+ "dtf",
534
+ "portfolio",
535
+ normalizeQueryKeyValue(params)
536
+ ], () => sdk.portfolio.get(requireParams(params, "accountPortfolioQueryOptions")), params !== void 0, options);
537
+ }
538
+ //#endregion
539
+ //#region src/index-dtf-extra-hooks.ts
540
+ function useIndexDtfStatus(params, options) {
541
+ return useQuery(indexDtfStatusQueryOptions(useDtfSdk(), params, options));
542
+ }
543
+ function useIndexDtfExposure(params, options) {
544
+ return useQuery(indexDtfExposureQueryOptions(useDtfSdk(), params, options));
545
+ }
546
+ function useIndexDtfTransactions(params, options) {
547
+ return useQuery(indexDtfTransactionsQueryOptions(useDtfSdk(), params, options));
548
+ }
549
+ function useIndexDtfRevenue(params, options) {
550
+ return useQuery(indexDtfRevenueQueryOptions(useDtfSdk(), params, options));
551
+ }
552
+ function useIndexDtfIssuanceState(params, options) {
553
+ return useQuery(indexDtfIssuanceStateQueryOptions(useDtfSdk(), params, options));
554
+ }
555
+ function useIndexDtfRebalances(params, options) {
556
+ return useQuery(indexDtfRebalancesQueryOptions(useDtfSdk(), params, options));
557
+ }
558
+ function useIndexDtfCurrentRebalance(params, options) {
559
+ return useQuery(indexDtfCurrentRebalanceQueryOptions(useDtfSdk(), params, options));
560
+ }
561
+ function useIndexDtfVoteLockState(params, options) {
562
+ return useQuery(indexDtfVoteLockStateQueryOptions(useDtfSdk(), params, options));
563
+ }
564
+ function useAccountPortfolio(params, options) {
565
+ return useQuery(accountPortfolioQueryOptions(useDtfSdk(), params, options));
566
+ }
567
+ //#endregion
568
+ export { DtfSdkProvider, accountPortfolioQueryOptions, buildIndexDtfBasketProposalQueryOptions, buildIndexDtfBasketSettingsProposalQueryOptions, buildIndexDtfDaoSettingsProposalQueryOptions, buildIndexDtfSettingsProposalQueryOptions, discoverDtfsQueryOptions, dtfQueryKeys, fullIndexDtfQueryOptions, indexDtfBasketQueryOptions, indexDtfBrandQueryOptions, indexDtfCurrentRebalanceQueryOptions, indexDtfDelegatesQueryOptions, indexDtfExposureQueryOptions, indexDtfGuardiansQueryOptions, indexDtfIssuanceStateQueryOptions, indexDtfListQueryOptions, indexDtfOptimisticGovernanceQueryOptions, indexDtfOptimisticProposalContextQueryOptions, indexDtfOptimisticProposalVoterStateQueryOptions, indexDtfOptimisticTimelockRolesQueryOptions, indexDtfOptimisticVotesQueryOptions, indexDtfPastOptimisticVotesQueryOptions, indexDtfPriceHistoryQueryOptions, indexDtfPriceQueryOptions, indexDtfProposalQueryOptions, indexDtfProposalThrottleChargesQueryOptions, indexDtfProposalVoterStateQueryOptions, indexDtfProposalVotesQueryOptions, indexDtfProposalsQueryOptions, indexDtfProposerStateQueryOptions, indexDtfQueryOptions, indexDtfRebalancesQueryOptions, indexDtfRevenueQueryOptions, indexDtfSelectorRegistryAllowedSelectorsQueryOptions, indexDtfSelectorRegistryIsAllowedQueryOptions, indexDtfSelectorRegistryTargetsQueryOptions, indexDtfStatusQueryOptions, indexDtfTransactionsQueryOptions, indexDtfVoteLockStateQueryOptions, indexDtfVoterStateQueryOptions, normalizeQueryKeyValue, useAccountPortfolio, useBuildIndexDtfBasketProposal, useBuildIndexDtfBasketSettingsProposal, useBuildIndexDtfDaoSettingsProposal, useBuildIndexDtfSettingsProposal, useDiscoverDtfs, useDtfSdk, useFullIndexDtf, useIndexDtf, useIndexDtfBasket, useIndexDtfBrand, useIndexDtfCurrentRebalance, useIndexDtfDelegates, useIndexDtfExposure, useIndexDtfGuardians, useIndexDtfIssuanceState, useIndexDtfList, useIndexDtfOptimisticGovernance, useIndexDtfOptimisticProposalContext, useIndexDtfOptimisticProposalVoterState, useIndexDtfOptimisticTimelockRoles, useIndexDtfOptimisticVotes, useIndexDtfPastOptimisticVotes, useIndexDtfPrice, useIndexDtfPriceHistory, useIndexDtfProposal, useIndexDtfProposalThrottleCharges, useIndexDtfProposalVoterState, useIndexDtfProposalVotes, useIndexDtfProposals, useIndexDtfProposerState, useIndexDtfRebalances, useIndexDtfRevenue, useIndexDtfSelectorRegistryAllowedSelectors, useIndexDtfSelectorRegistryIsAllowed, useIndexDtfSelectorRegistryTargets, useIndexDtfStatus, useIndexDtfTransactions, useIndexDtfVoteLockState, useIndexDtfVoterState };
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@reserve-protocol/react-sdk",
3
+ "version": "0.0.1",
4
+ "description": "React Query hooks for DTF interface integrations.",
5
+ "keywords": [
6
+ "dtf",
7
+ "react",
8
+ "sdk"
9
+ ],
10
+ "license": "MIT",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "type": "module",
15
+ "sideEffects": false,
16
+ "main": "./dist/index.mjs",
17
+ "module": "./dist/index.mjs",
18
+ "types": "./dist/index.d.mts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.mts",
22
+ "import": "./dist/index.mjs",
23
+ "default": "./dist/index.mjs"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "dependencies": {
31
+ "@reserve-protocol/sdk": "0.0.1"
32
+ },
33
+ "devDependencies": {
34
+ "@tanstack/react-query": "^5.100.9",
35
+ "@types/node": "^24.12.2",
36
+ "@types/react": "^19.2.14",
37
+ "react": "^19.2.6",
38
+ "tsdown": "^0.21.10",
39
+ "typescript": "^6.0.3",
40
+ "viem": "^2.48.8",
41
+ "vitest": "^4.1.5",
42
+ "@dtf-interface/tsconfig": "0.0.0"
43
+ },
44
+ "peerDependencies": {
45
+ "@tanstack/react-query": "^5.99.0",
46
+ "react": "^18.3.0 || ^19.0.0",
47
+ "viem": "^2.48.0"
48
+ },
49
+ "engines": {
50
+ "node": ">=24"
51
+ },
52
+ "scripts": {
53
+ "build": "tsdown",
54
+ "clean": "rm -rf dist *.tsbuildinfo",
55
+ "dev": "tsdown --watch",
56
+ "test": "vitest run --passWithNoTests",
57
+ "typecheck": "tsc -p tsconfig.json --noEmit"
58
+ }
59
+ }