@reserve-protocol/react-sdk 0.0.1 → 0.1.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.
package/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
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";
2
+ import { Amount, BuildIndexDtfBasketProposalParams, BuildIndexDtfBasketSettingsProposalParams, BuildIndexDtfDaoSettingsProposalParams, BuildIndexDtfSettingsProposalParams, BuiltIndexDtfBasketProposal, BuiltIndexDtfProposal, CancelIndexDtfProposalParams, DecodeIndexDtfProposalParams, DiscoverDtf, DtfParams, DtfSdk, DtfSdkConfig, ExecuteIndexDtfProposalParams, GetDiscoverDtfsOptions, GetFullIndexDtfParams, GetIndexDtfBasketParams, GetIndexDtfDelegatesParams, GetIndexDtfGuardiansParams, GetIndexDtfOptimisticGovernanceParams, GetIndexDtfOptimisticProposalContextParams, GetIndexDtfOptimisticProposalVoterStateParams, GetIndexDtfOptimisticVotesParams, GetIndexDtfParams, GetIndexDtfPastOptimisticVotesParams, GetIndexDtfPriceHistoryParams, GetIndexDtfPriceParams, GetIndexDtfProposalParams, GetIndexDtfProposalThrottleChargesParams, GetIndexDtfProposalVoterStateParams, GetIndexDtfProposalVotesParams, GetIndexDtfProposalVotingSnapshotParams, GetIndexDtfProposalsParams, GetIndexDtfProposerStateParams, GetIndexDtfVersionParams, GetIndexDtfVoterStateParams, Governance, IndexDtfBasket, IndexDtfBrand, IndexDtfCall, IndexDtfDelegates, IndexDtfFull, IndexDtfGuardians, IndexDtfOptimisticGovernance, IndexDtfOptimisticProposalContext, IndexDtfOptimisticProposalVoterState, IndexDtfPrice, IndexDtfPricePoint, IndexDtfProposalDecoded, IndexDtfProposalDetail, IndexDtfProposalList, IndexDtfProposalSummary, IndexDtfProposalVoterState, IndexDtfProposalVotes, IndexDtfProposalVotingSnapshot, IndexDtfProposerState, IndexDtfVoterState, ListIndexDtfsParams, QueueIndexDtfProposalParams, SupportedChainId, Timelock, Token, TokenWithSnapshot, VoteIndexDtfProposalParams } from "@reserve-protocol/sdk";
3
3
  import * as _$react from "react";
4
4
  import { PropsWithChildren } from "react";
5
5
  import * as _$_tanstack_react_query0 from "@tanstack/react-query";
6
6
  import { DefaultError, QueryKey, UseQueryOptions } from "@tanstack/react-query";
7
+ import { Address } from "viem";
7
8
  export * from "@reserve-protocol/sdk";
8
9
 
9
10
  //#region src/provider.d.ts
@@ -15,17 +16,112 @@ declare function DtfSdkProvider({
15
16
  chains,
16
17
  children,
17
18
  client,
19
+ etherscanApiKey,
18
20
  sdk
19
21
  }: DtfSdkProviderProps): _$react.FunctionComponentElement<_$react.ProviderProps<DtfSdk | undefined>>;
20
22
  declare function useDtfSdk(): DtfSdk;
21
23
  //#endregion
24
+ //#region src/index-dtf/index-dtf-provider.d.ts
25
+ type IndexDtfIdentity = {
26
+ readonly address: Address;
27
+ readonly chainId: SupportedChainId;
28
+ };
29
+ type IndexDtfProviderProps = PropsWithChildren<IndexDtfIdentity & {
30
+ readonly prefetch?: boolean;
31
+ }>;
32
+ declare function IndexDtfProvider({
33
+ address,
34
+ chainId,
35
+ children,
36
+ prefetch
37
+ }: IndexDtfProviderProps): _$react.FunctionComponentElement<_$react.ProviderProps<IndexDtfIdentity | undefined>>;
38
+ declare function useIndexDtfIdentity(): IndexDtfIdentity;
39
+ //#endregion
40
+ //#region src/index-dtf/index-dtf-data.d.ts
41
+ type IndexDtfGovernanceData = Omit<Governance, "timelock"> & {
42
+ readonly id: Address;
43
+ readonly timelock: Omit<Timelock, "guardians" | "optimisticProposers"> & {
44
+ readonly id: Address;
45
+ readonly guardians: Address[];
46
+ readonly optimisticProposers: Address[];
47
+ };
48
+ };
49
+ type IndexDtfTokenData = TokenWithSnapshot & {
50
+ readonly id: Address;
51
+ readonly totalSupply: Amount;
52
+ readonly currentHolderCount: number;
53
+ };
54
+ type IndexDtfVoteLockData = {
55
+ readonly id: Address;
56
+ readonly chainId: number;
57
+ readonly token: {
58
+ readonly id?: Address;
59
+ readonly address?: Address;
60
+ readonly symbol: string;
61
+ readonly name: string;
62
+ readonly decimals: number;
63
+ readonly totalSupply: Amount;
64
+ readonly currentHolderCount?: number;
65
+ readonly snapshot?: TokenWithSnapshot["snapshot"];
66
+ };
67
+ readonly underlying: Token;
68
+ readonly governance?: IndexDtfGovernanceData;
69
+ readonly legacyGovernance: Address[];
70
+ readonly rewardTokens: Token[];
71
+ readonly totalDelegates: number;
72
+ readonly currentDelegates: number;
73
+ readonly totalOptimisticDelegates: number;
74
+ readonly currentOptimisticDelegates: number;
75
+ };
76
+ type IndexDtfData = Omit<IndexDtfFull, "token"> & {
77
+ readonly token: IndexDtfTokenData;
78
+ readonly proxyAdmin: Address;
79
+ readonly timestamp: number;
80
+ readonly deployer: Address;
81
+ readonly ownerAddress: Address;
82
+ readonly mintingFee: number;
83
+ readonly tvlFee: number;
84
+ readonly annualizedTvlFee: number;
85
+ readonly auctionDelay: number;
86
+ readonly auctionLength: number;
87
+ readonly auctionApprovers: Address[];
88
+ readonly auctionLaunchers: Address[];
89
+ readonly brandManagers: Address[];
90
+ readonly feeRecipients: IndexDtfFull["fees"]["recipients"];
91
+ readonly ownerGovernance?: IndexDtfGovernanceData;
92
+ readonly tradingGovernance?: IndexDtfGovernanceData;
93
+ readonly legacyAdmins: Address[];
94
+ readonly legacyAuctionApprovers: Address[];
95
+ readonly stToken?: IndexDtfVoteLockData;
96
+ readonly totalRevenue: number;
97
+ readonly protocolRevenue: number;
98
+ readonly governanceRevenue: number;
99
+ readonly externalRevenue: number;
100
+ };
101
+ declare function mapIndexDtfData(dtf: IndexDtfFull): IndexDtfData;
102
+ //#endregion
103
+ //#region src/query.d.ts
104
+ type DtfQueryOptions<TQueryFnData, TData = TQueryFnData> = Omit<UseQueryOptions<TQueryFnData, DefaultError, TData, QueryKey>, "enabled" | "queryFn" | "queryKey"> & {
105
+ readonly enabled?: boolean;
106
+ };
107
+ type DtfQueryOptionsResult<TQueryFnData, TData = TQueryFnData> = UseQueryOptions<TQueryFnData, DefaultError, TData, QueryKey> & {
108
+ readonly queryKey: QueryKey;
109
+ readonly queryFn: () => Promise<TQueryFnData>;
110
+ };
111
+ //#endregion
112
+ //#region src/index-dtf/use-current-index-dtf.d.ts
113
+ declare function useCurrentIndexDtf(options?: Omit<DtfQueryOptions<IndexDtfFull, IndexDtfData>, "select">): _$_tanstack_react_query0.UseQueryResult<IndexDtfData, Error>;
114
+ //#endregion
115
+ //#region src/index-dtf/use-current-index-dtf-basket.d.ts
116
+ declare function useCurrentIndexDtfBasket(): Record<`0x${string}`, _$_reserve_protocol_sdk0.IndexDtfBasketAssetWithPrice> | undefined;
117
+ //#endregion
22
118
  //#region src/normalize-query-key.d.ts
23
119
  declare function normalizeQueryKeyValue(value: unknown): unknown;
24
120
  //#endregion
25
121
  //#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"> & {
122
+ type IndexMethod$2<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
123
+ type IndexMethodParams<TKey extends keyof DtfSdk["index"]> = Parameters<IndexMethod$2<TKey>>[0];
124
+ type PastOptimisticVotesQueryKeyParams = Omit<IndexMethodParams<"getPastOptimisticVotes">, "timepoint"> & {
29
125
  readonly timepoint: bigint;
30
126
  };
31
127
  declare const dtfQueryKeys: {
@@ -37,22 +133,26 @@ declare const dtfQueryKeys: {
37
133
  readonly dtf: (params?: GetIndexDtfParams) => readonly ["dtf", "index", "dtf", unknown];
38
134
  readonly full: (params?: GetFullIndexDtfParams) => readonly ["dtf", "index", "full", unknown];
39
135
  readonly basket: (params?: GetIndexDtfBasketParams) => readonly ["dtf", "index", "basket", unknown];
136
+ readonly version: (params?: GetIndexDtfVersionParams) => readonly ["dtf", "index", "version", unknown];
40
137
  readonly brand: (params?: DtfParams) => readonly ["dtf", "index", "brand", unknown];
41
138
  readonly price: (params?: GetIndexDtfPriceParams) => readonly ["dtf", "index", "price", unknown];
42
139
  readonly priceHistory: (params?: GetIndexDtfPriceHistoryParams) => readonly ["dtf", "index", "price-history", unknown];
43
140
  readonly governance: {
44
141
  readonly all: () => readonly ["dtf", "index", "governance"];
45
- readonly proposals: (params?: GetIndexDtfProposalsParams) => readonly ["dtf", "index", "governance", "proposals", unknown];
142
+ readonly proposalList: (params?: GetIndexDtfProposalsParams) => readonly ["dtf", "index", "governance", "proposal-list", unknown];
143
+ readonly proposals: (params?: GetIndexDtfProposalsParams) => readonly ["dtf", "index", "governance", "proposal-list", unknown];
46
144
  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];
145
+ readonly proposalDecode: (params?: DecodeIndexDtfProposalParams) => readonly ["dtf", "index", "governance", "proposal-decode", unknown];
146
+ readonly proposalVotingSnapshot: (params?: GetIndexDtfProposalVotingSnapshotParams) => readonly ["dtf", "index", "governance", "proposal-voting-snapshot", unknown];
147
+ readonly optimisticGovernance: (params?: IndexMethodParams<"getOptimisticGovernance">) => readonly ["dtf", "index", "governance", "optimistic-governance", unknown];
148
+ readonly optimisticProposalContext: (params?: IndexMethodParams<"getOptimisticProposalContext">) => readonly ["dtf", "index", "governance", "optimistic-proposal-context", unknown];
149
+ readonly optimisticTimelockRoles: (params?: IndexMethodParams<"getOptimisticTimelockRoles">) => readonly ["dtf", "index", "governance", "optimistic-timelock-roles", unknown];
150
+ readonly optimisticVotes: (params?: IndexMethodParams<"getOptimisticVotes">) => readonly ["dtf", "index", "governance", "optimistic-votes", unknown];
51
151
  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];
152
+ readonly proposalThrottleCharges: (params?: IndexMethodParams<"getProposalThrottleCharges">) => readonly ["dtf", "index", "governance", "proposal-throttle-charges", unknown];
153
+ readonly selectorRegistryTargets: (params?: IndexMethodParams<"getSelectorRegistryTargets">) => readonly ["dtf", "index", "governance", "selector-registry-targets", unknown];
154
+ readonly selectorRegistryAllowedSelectors: (params?: IndexMethodParams<"getSelectorRegistryAllowedSelectors">) => readonly ["dtf", "index", "governance", "selector-registry-allowed-selectors", unknown];
155
+ readonly selectorRegistryIsAllowed: (params?: IndexMethodParams<"getSelectorRegistryIsAllowed">) => readonly ["dtf", "index", "governance", "selector-registry-is-allowed", unknown];
56
156
  readonly buildBasketProposal: (params?: BuildIndexDtfBasketProposalParams) => readonly ["dtf", "index", "governance", "build-basket-proposal", unknown];
57
157
  readonly buildBasketSettingsProposal: (params?: BuildIndexDtfBasketSettingsProposalParams) => readonly ["dtf", "index", "governance", "build-basket-settings-proposal", unknown];
58
158
  readonly buildDaoSettingsProposal: (params?: BuildIndexDtfDaoSettingsProposalParams) => readonly ["dtf", "index", "governance", "build-dao-settings-proposal", unknown];
@@ -68,89 +168,141 @@ declare const dtfQueryKeys: {
68
168
  };
69
169
  };
70
170
  //#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"> & {
171
+ //#region src/index-dtf/use-index-dtf-delegates.d.ts
172
+ declare function indexDtfDelegatesQueryOptions<TData = IndexDtfDelegates>(sdk: DtfSdk, params: GetIndexDtfDelegatesParams | undefined, options?: DtfQueryOptions<IndexDtfDelegates, TData>): DtfQueryOptionsResult<IndexDtfDelegates, TData>;
173
+ declare function useIndexDtfDelegates<TData = IndexDtfDelegates>(params: GetIndexDtfDelegatesParams | undefined, options?: DtfQueryOptions<IndexDtfDelegates, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
174
+ //#endregion
175
+ //#region src/index-dtf/use-index-dtf-guardians.d.ts
176
+ declare function indexDtfGuardiansQueryOptions<TData = IndexDtfGuardians>(sdk: DtfSdk, params: GetIndexDtfGuardiansParams | undefined, options?: DtfQueryOptions<IndexDtfGuardians, TData>): DtfQueryOptionsResult<IndexDtfGuardians, TData>;
177
+ declare function useIndexDtfGuardians<TData = IndexDtfGuardians>(params: GetIndexDtfGuardiansParams | undefined, options?: DtfQueryOptions<IndexDtfGuardians, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
178
+ //#endregion
179
+ //#region src/index-dtf/use-index-dtf-optimistic-governance.d.ts
180
+ declare function indexDtfOptimisticGovernanceQueryOptions<TData = IndexDtfOptimisticGovernance>(sdk: DtfSdk, params: GetIndexDtfOptimisticGovernanceParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticGovernance, TData>): DtfQueryOptionsResult<IndexDtfOptimisticGovernance, TData>;
181
+ declare function useIndexDtfOptimisticGovernance<TData = IndexDtfOptimisticGovernance>(params: GetIndexDtfOptimisticGovernanceParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticGovernance, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
182
+ //#endregion
183
+ //#region src/index-dtf/use-index-dtf-optimistic-proposal-context.d.ts
184
+ declare function indexDtfOptimisticProposalContextQueryOptions<TData = IndexDtfOptimisticProposalContext | null>(sdk: DtfSdk, params: GetIndexDtfOptimisticProposalContextParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticProposalContext | null, TData>): DtfQueryOptionsResult<IndexDtfOptimisticProposalContext | null, TData>;
185
+ declare function useIndexDtfOptimisticProposalContext<TData = IndexDtfOptimisticProposalContext | null>(params: GetIndexDtfOptimisticProposalContextParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticProposalContext | null, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
186
+ //#endregion
187
+ //#region src/index-dtf/use-index-dtf-optimistic-proposal-voter-state.d.ts
188
+ declare function indexDtfOptimisticProposalVoterStateQueryOptions<TData = IndexDtfOptimisticProposalVoterState>(sdk: DtfSdk, params: GetIndexDtfOptimisticProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticProposalVoterState, TData>): DtfQueryOptionsResult<IndexDtfOptimisticProposalVoterState, TData>;
189
+ declare function useIndexDtfOptimisticProposalVoterState<TData = IndexDtfOptimisticProposalVoterState>(params: GetIndexDtfOptimisticProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfOptimisticProposalVoterState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
190
+ //#endregion
191
+ //#region src/index-dtf/use-index-dtf-optimistic-timelock-roles.d.ts
192
+ type Params$3 = Parameters<DtfSdk["index"]["getOptimisticTimelockRoles"]>[0];
193
+ type Result$3 = Awaited<ReturnType<DtfSdk["index"]["getOptimisticTimelockRoles"]>>;
194
+ declare function indexDtfOptimisticTimelockRolesQueryOptions<TData = Result$3>(sdk: DtfSdk, params: Params$3 | undefined, options?: DtfQueryOptions<Result$3, TData>): DtfQueryOptionsResult<{
195
+ optimisticProposers: `0x${string}`[];
196
+ guardians: `0x${string}`[];
197
+ }, TData>;
198
+ declare function useIndexDtfOptimisticTimelockRoles<TData = Result$3>(params: Params$3 | undefined, options?: DtfQueryOptions<Result$3, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
199
+ //#endregion
200
+ //#region src/index-dtf/use-index-dtf-optimistic-votes.d.ts
201
+ declare function indexDtfOptimisticVotesQueryOptions<TData = Amount>(sdk: DtfSdk, params: GetIndexDtfOptimisticVotesParams | undefined, options?: DtfQueryOptions<Amount, TData>): DtfQueryOptionsResult<Amount, TData>;
202
+ declare function useIndexDtfOptimisticVotes<TData = Amount>(params: GetIndexDtfOptimisticVotesParams | undefined, options?: DtfQueryOptions<Amount, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
203
+ //#endregion
204
+ //#region src/index-dtf/use-index-dtf-past-optimistic-votes.d.ts
205
+ type IndexDtfPastOptimisticVotesQueryParams = Omit<GetIndexDtfPastOptimisticVotesParams, "timepoint"> & {
77
206
  readonly timepoint: bigint;
78
207
  };
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>;
208
+ declare function indexDtfPastOptimisticVotesQueryOptions<TData = Amount>(sdk: DtfSdk, params: IndexDtfPastOptimisticVotesQueryParams | undefined, options?: DtfQueryOptions<Amount, TData>): DtfQueryOptionsResult<Amount, TData>;
209
+ declare function useIndexDtfPastOptimisticVotes<TData = Amount>(params: IndexDtfPastOptimisticVotesQueryParams | undefined, options?: DtfQueryOptions<Amount, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
210
+ //#endregion
211
+ //#region src/index-dtf/use-index-dtf-proposal.d.ts
212
+ declare function indexDtfProposalQueryOptions<TData = IndexDtfProposalDetail>(sdk: DtfSdk, params: GetIndexDtfProposalParams | undefined, options?: DtfQueryOptions<IndexDtfProposalDetail, TData>): DtfQueryOptionsResult<IndexDtfProposalDetail, TData>;
213
+ declare function useIndexDtfProposal<TData = IndexDtfProposalDetail>(params: GetIndexDtfProposalParams | undefined, options?: DtfQueryOptions<IndexDtfProposalDetail, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
214
+ //#endregion
215
+ //#region src/index-dtf/use-index-dtf-proposal-decode.d.ts
216
+ declare function indexDtfProposalDecodeQueryOptions<TData = IndexDtfProposalDecoded>(sdk: DtfSdk, params: DecodeIndexDtfProposalParams | undefined, options?: DtfQueryOptions<IndexDtfProposalDecoded, TData>): DtfQueryOptionsResult<IndexDtfProposalDecoded, TData>;
217
+ declare function useIndexDtfProposalDecode<TData = IndexDtfProposalDecoded>(params: DecodeIndexDtfProposalParams | undefined, options?: DtfQueryOptions<IndexDtfProposalDecoded, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
218
+ //#endregion
219
+ //#region src/index-dtf/use-index-dtf-proposal-throttle-charges.d.ts
220
+ declare function indexDtfProposalThrottleChargesQueryOptions<TData = bigint>(sdk: DtfSdk, params: GetIndexDtfProposalThrottleChargesParams | undefined, options?: DtfQueryOptions<bigint, TData>): DtfQueryOptionsResult<bigint, TData>;
221
+ declare function useIndexDtfProposalThrottleCharges<TData = bigint>(params: GetIndexDtfProposalThrottleChargesParams | undefined, options?: DtfQueryOptions<bigint, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
222
+ //#endregion
223
+ //#region src/index-dtf/use-index-dtf-proposal-voter-state.d.ts
224
+ declare function indexDtfProposalVoterStateQueryOptions<TData = IndexDtfProposalVoterState>(sdk: DtfSdk, params: GetIndexDtfProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVoterState, TData>): DtfQueryOptionsResult<IndexDtfProposalVoterState, TData>;
225
+ declare function useIndexDtfProposalVoterState<TData = IndexDtfProposalVoterState>(params: GetIndexDtfProposalVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVoterState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
226
+ //#endregion
227
+ //#region src/index-dtf/use-index-dtf-proposal-voting-snapshot.d.ts
228
+ declare function indexDtfProposalVotingSnapshotQueryOptions<TData = IndexDtfProposalVotingSnapshot>(sdk: DtfSdk, params: GetIndexDtfProposalVotingSnapshotParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVotingSnapshot, TData>): DtfQueryOptionsResult<IndexDtfProposalVotingSnapshot, TData>;
229
+ declare function useIndexDtfProposalVotingSnapshot<TData = IndexDtfProposalVotingSnapshot>(params: GetIndexDtfProposalVotingSnapshotParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVotingSnapshot, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
230
+ //#endregion
231
+ //#region src/index-dtf/use-index-dtf-proposal-votes.d.ts
232
+ declare function indexDtfProposalVotesQueryOptions<TData = IndexDtfProposalVotes>(sdk: DtfSdk, params: GetIndexDtfProposalVotesParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVotes, TData>): DtfQueryOptionsResult<IndexDtfProposalVotes, TData>;
233
+ declare function useIndexDtfProposalVotes<TData = IndexDtfProposalVotes>(params: GetIndexDtfProposalVotesParams | undefined, options?: DtfQueryOptions<IndexDtfProposalVotes, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
234
+ //#endregion
235
+ //#region src/index-dtf/use-index-dtf-proposals.d.ts
236
+ type IndexDtfProposalsQueryOptions<TData> = Omit<DtfQueryOptions<IndexDtfProposalList, TData>, "select"> & {
237
+ readonly select?: (data: readonly IndexDtfProposalSummary[]) => TData;
85
238
  };
239
+ declare function indexDtfProposalsQueryOptions<TData = readonly IndexDtfProposalSummary[]>(sdk: DtfSdk, params: GetIndexDtfProposalsParams | undefined, options?: IndexDtfProposalsQueryOptions<TData>): DtfQueryOptionsResult<IndexDtfProposalList, TData>;
240
+ declare function indexDtfProposalListQueryOptions<TData = IndexDtfProposalList>(sdk: DtfSdk, params: GetIndexDtfProposalsParams | undefined, options?: DtfQueryOptions<IndexDtfProposalList, TData>): DtfQueryOptionsResult<IndexDtfProposalList, TData>;
241
+ declare function useIndexDtfProposals<TData = readonly IndexDtfProposalSummary[]>(params: GetIndexDtfProposalsParams | undefined, options?: IndexDtfProposalsQueryOptions<TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
242
+ declare function useIndexDtfProposalList<TData = IndexDtfProposalList>(params: GetIndexDtfProposalsParams | undefined, options?: DtfQueryOptions<IndexDtfProposalList, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
243
+ //#endregion
244
+ //#region src/index-dtf/use-index-dtf-proposer-state.d.ts
245
+ declare function indexDtfProposerStateQueryOptions<TData = IndexDtfProposerState>(sdk: DtfSdk, params: GetIndexDtfProposerStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposerState, TData>): DtfQueryOptionsResult<IndexDtfProposerState, TData>;
246
+ declare function useIndexDtfProposerState<TData = IndexDtfProposerState>(params: GetIndexDtfProposerStateParams | undefined, options?: DtfQueryOptions<IndexDtfProposerState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
247
+ //#endregion
248
+ //#region src/index-dtf/use-index-dtf-selector-registry-allowed-selectors.d.ts
249
+ type Params$2 = Parameters<DtfSdk["index"]["getSelectorRegistryAllowedSelectors"]>[0];
250
+ type Result$2 = Awaited<ReturnType<DtfSdk["index"]["getSelectorRegistryAllowedSelectors"]>>;
251
+ declare function indexDtfSelectorRegistryAllowedSelectorsQueryOptions<TData = Result$2>(sdk: DtfSdk, params: Params$2 | undefined, options?: DtfQueryOptions<Result$2, TData>): DtfQueryOptionsResult<readonly `0x${string}`[], TData>;
252
+ declare function useIndexDtfSelectorRegistryAllowedSelectors<TData = Result$2>(params: Params$2 | undefined, options?: DtfQueryOptions<Result$2, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
253
+ //#endregion
254
+ //#region src/index-dtf/use-index-dtf-selector-registry-is-allowed.d.ts
255
+ type Params$1 = Parameters<DtfSdk["index"]["getSelectorRegistryIsAllowed"]>[0];
256
+ type Result$1 = Awaited<ReturnType<DtfSdk["index"]["getSelectorRegistryIsAllowed"]>>;
257
+ declare function indexDtfSelectorRegistryIsAllowedQueryOptions<TData = Result$1>(sdk: DtfSdk, params: Params$1 | undefined, options?: DtfQueryOptions<Result$1, TData>): DtfQueryOptionsResult<boolean, TData>;
258
+ declare function useIndexDtfSelectorRegistryIsAllowed<TData = Result$1>(params: Params$1 | undefined, options?: DtfQueryOptions<Result$1, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
259
+ //#endregion
260
+ //#region src/index-dtf/use-index-dtf-selector-registry-targets.d.ts
261
+ type Params = Parameters<DtfSdk["index"]["getSelectorRegistryTargets"]>[0];
262
+ type Result = Awaited<ReturnType<DtfSdk["index"]["getSelectorRegistryTargets"]>>;
263
+ declare function indexDtfSelectorRegistryTargetsQueryOptions<TData = Result>(sdk: DtfSdk, params: Params | undefined, options?: DtfQueryOptions<Result, TData>): DtfQueryOptionsResult<readonly `0x${string}`[], TData>;
264
+ declare function useIndexDtfSelectorRegistryTargets<TData = Result>(params: Params | undefined, options?: DtfQueryOptions<Result, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
265
+ //#endregion
266
+ //#region src/index-dtf/use-index-dtf-voter-state.d.ts
267
+ declare function indexDtfVoterStateQueryOptions<TData = IndexDtfVoterState>(sdk: DtfSdk, params: GetIndexDtfVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfVoterState, TData>): DtfQueryOptionsResult<IndexDtfVoterState, TData>;
268
+ declare function useIndexDtfVoterState<TData = IndexDtfVoterState>(params: GetIndexDtfVoterStateParams | undefined, options?: DtfQueryOptions<IndexDtfVoterState, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
269
+ //#endregion
270
+ //#region src/query-options.d.ts
271
+ type IndexDtfList = Awaited<ReturnType<DtfSdk["index"]["list"]>>;
86
272
  declare function discoverDtfsQueryOptions<TData = readonly DiscoverDtf[]>(sdk: DtfSdk, params?: GetDiscoverDtfsOptions, options?: DtfQueryOptions<readonly DiscoverDtf[], TData>): DtfQueryOptionsResult<readonly DiscoverDtf[], TData>;
87
273
  declare function indexDtfListQueryOptions<TData = IndexDtfList>(sdk: DtfSdk, params?: ListIndexDtfsParams, options?: DtfQueryOptions<IndexDtfList, TData>): DtfQueryOptionsResult<readonly _$_reserve_protocol_sdk0.IndexDtfCatalogEntry[], TData>;
88
274
  declare function indexDtfQueryOptions<TData = IndexDtfFull>(sdk: DtfSdk, params: GetIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): DtfQueryOptionsResult<IndexDtfFull, TData>;
89
275
  declare function fullIndexDtfQueryOptions<TData = IndexDtfFull>(sdk: DtfSdk, params: GetFullIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): DtfQueryOptionsResult<IndexDtfFull, TData>;
90
276
  declare function indexDtfBasketQueryOptions<TData = IndexDtfBasket>(sdk: DtfSdk, params: GetIndexDtfBasketParams | undefined, options?: DtfQueryOptions<IndexDtfBasket, TData>): DtfQueryOptionsResult<IndexDtfBasket, TData>;
277
+ declare function indexDtfVersionQueryOptions<TData = string>(sdk: DtfSdk, params: GetIndexDtfVersionParams | undefined, options?: DtfQueryOptions<string, TData>): DtfQueryOptionsResult<string, TData>;
91
278
  declare function indexDtfBrandQueryOptions<TData = IndexDtfBrand | undefined>(sdk: DtfSdk, params: DtfParams | undefined, options?: DtfQueryOptions<IndexDtfBrand | undefined, TData>): DtfQueryOptionsResult<IndexDtfBrand | undefined, TData>;
92
279
  declare function indexDtfPriceQueryOptions<TData = IndexDtfPrice>(sdk: DtfSdk, params: GetIndexDtfPriceParams | undefined, options?: DtfQueryOptions<IndexDtfPrice, TData>): DtfQueryOptionsResult<IndexDtfPrice, TData>;
93
280
  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
281
  declare function buildIndexDtfBasketProposalQueryOptions<TData = BuiltIndexDtfBasketProposal>(sdk: DtfSdk, params: BuildIndexDtfBasketProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfBasketProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfBasketProposal, TData>;
109
282
  declare function buildIndexDtfBasketSettingsProposalQueryOptions<TData = BuiltIndexDtfProposal>(sdk: DtfSdk, params: BuildIndexDtfBasketSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfProposal, TData>;
110
283
  declare function buildIndexDtfDaoSettingsProposalQueryOptions<TData = BuiltIndexDtfProposal>(sdk: DtfSdk, params: BuildIndexDtfDaoSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): DtfQueryOptionsResult<BuiltIndexDtfProposal, TData>;
111
284
  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>;
285
+ //#endregion
286
+ //#region src/index-dtf/use-index-dtf-proposal-actions.d.ts
287
+ declare function useIndexDtfVoteCall(params: VoteIndexDtfProposalParams | undefined): IndexDtfCall | undefined;
288
+ declare function useIndexDtfQueueProposalCall(params: QueueIndexDtfProposalParams | undefined): IndexDtfCall | undefined;
289
+ declare function useIndexDtfExecuteProposalCall(params: ExecuteIndexDtfProposalParams | undefined): IndexDtfCall | undefined;
290
+ declare function useIndexDtfCancelProposalCall(params: CancelIndexDtfProposalParams | undefined): IndexDtfCall | undefined;
119
291
  //#endregion
120
292
  //#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
293
  declare function useDiscoverDtfs<TData = readonly DiscoverDtf[]>(params?: GetDiscoverDtfsOptions, options?: DtfQueryOptions<readonly DiscoverDtf[], TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
125
294
  declare function useIndexDtfList<TData = IndexDtfList>(params?: ListIndexDtfsParams, options?: DtfQueryOptions<IndexDtfList, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
126
295
  declare function useIndexDtf<TData = IndexDtfFull>(params: GetIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
127
296
  declare function useFullIndexDtf<TData = IndexDtfFull>(params: GetFullIndexDtfParams | undefined, options?: DtfQueryOptions<IndexDtfFull, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
128
297
  declare function useIndexDtfBasket<TData = IndexDtfBasket>(params: GetIndexDtfBasketParams | undefined, options?: DtfQueryOptions<IndexDtfBasket, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
298
+ declare function useIndexDtfVersion<TData = string>(params: GetIndexDtfVersionParams | undefined, options?: DtfQueryOptions<string, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
129
299
  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
300
  declare function useIndexDtfPrice<TData = IndexDtfPrice>(params: GetIndexDtfPriceParams | undefined, options?: DtfQueryOptions<IndexDtfPrice, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
131
301
  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
302
  declare function useBuildIndexDtfBasketProposal<TData = BuiltIndexDtfBasketProposal>(params: BuildIndexDtfBasketProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfBasketProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
144
303
  declare function useBuildIndexDtfBasketSettingsProposal<TData = BuiltIndexDtfProposal>(params: BuildIndexDtfBasketSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
145
304
  declare function useBuildIndexDtfDaoSettingsProposal<TData = BuiltIndexDtfProposal>(params: BuildIndexDtfDaoSettingsProposalParams | undefined, options?: DtfQueryOptions<BuiltIndexDtfProposal, TData>): _$_tanstack_react_query0.UseQueryResult<_$_tanstack_react_query0.NoInfer<TData>, Error>;
146
305
  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
306
  //#endregion
155
307
  //#region src/index-dtf-query-options.d.ts
156
308
  type IndexMethod$1<TKey extends keyof DtfSdk["index"]> = DtfSdk["index"][TKey] extends ((...args: any) => any) ? DtfSdk["index"][TKey] : never;
@@ -182,4 +334,4 @@ declare function useIndexDtfCurrentRebalance<TData = MethodResult<IndexMethod<"g
182
334
  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
335
  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
336
  //#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 };
337
+ export { type DtfQueryOptions, type DtfQueryOptionsResult, DtfSdkProvider, type DtfSdkProviderProps, type IndexDtfData, type IndexDtfIdentity, type IndexDtfPastOptimisticVotesQueryParams, IndexDtfProvider, type IndexDtfProviderProps, accountPortfolioQueryOptions, buildIndexDtfBasketProposalQueryOptions, buildIndexDtfBasketSettingsProposalQueryOptions, buildIndexDtfDaoSettingsProposalQueryOptions, buildIndexDtfSettingsProposalQueryOptions, discoverDtfsQueryOptions, dtfQueryKeys, fullIndexDtfQueryOptions, indexDtfBasketQueryOptions, indexDtfBrandQueryOptions, indexDtfCurrentRebalanceQueryOptions, indexDtfDelegatesQueryOptions, indexDtfExposureQueryOptions, indexDtfGuardiansQueryOptions, indexDtfIssuanceStateQueryOptions, indexDtfListQueryOptions, indexDtfOptimisticGovernanceQueryOptions, indexDtfOptimisticProposalContextQueryOptions, indexDtfOptimisticProposalVoterStateQueryOptions, indexDtfOptimisticTimelockRolesQueryOptions, indexDtfOptimisticVotesQueryOptions, indexDtfPastOptimisticVotesQueryOptions, indexDtfPriceHistoryQueryOptions, indexDtfPriceQueryOptions, indexDtfProposalDecodeQueryOptions, indexDtfProposalListQueryOptions, indexDtfProposalQueryOptions, indexDtfProposalThrottleChargesQueryOptions, indexDtfProposalVoterStateQueryOptions, indexDtfProposalVotesQueryOptions, indexDtfProposalVotingSnapshotQueryOptions, indexDtfProposalsQueryOptions, indexDtfProposerStateQueryOptions, indexDtfQueryOptions, indexDtfRebalancesQueryOptions, indexDtfRevenueQueryOptions, indexDtfSelectorRegistryAllowedSelectorsQueryOptions, indexDtfSelectorRegistryIsAllowedQueryOptions, indexDtfSelectorRegistryTargetsQueryOptions, indexDtfStatusQueryOptions, indexDtfTransactionsQueryOptions, indexDtfVersionQueryOptions, indexDtfVoteLockStateQueryOptions, indexDtfVoterStateQueryOptions, mapIndexDtfData, normalizeQueryKeyValue, useAccountPortfolio, useBuildIndexDtfBasketProposal, useBuildIndexDtfBasketSettingsProposal, useBuildIndexDtfDaoSettingsProposal, useBuildIndexDtfSettingsProposal, useCurrentIndexDtf, useCurrentIndexDtfBasket, useDiscoverDtfs, useDtfSdk, useFullIndexDtf, useIndexDtf, useIndexDtfBasket, useIndexDtfBrand, useIndexDtfCancelProposalCall, useIndexDtfCurrentRebalance, useIndexDtfDelegates, useIndexDtfExecuteProposalCall, useIndexDtfExposure, useIndexDtfGuardians, useIndexDtfIdentity, useIndexDtfIssuanceState, useIndexDtfList, useIndexDtfOptimisticGovernance, useIndexDtfOptimisticProposalContext, useIndexDtfOptimisticProposalVoterState, useIndexDtfOptimisticTimelockRoles, useIndexDtfOptimisticVotes, useIndexDtfPastOptimisticVotes, useIndexDtfPrice, useIndexDtfPriceHistory, useIndexDtfProposal, useIndexDtfProposalDecode, useIndexDtfProposalList, useIndexDtfProposalThrottleCharges, useIndexDtfProposalVoterState, useIndexDtfProposalVotes, useIndexDtfProposalVotingSnapshot, useIndexDtfProposals, useIndexDtfProposerState, useIndexDtfQueueProposalCall, useIndexDtfRebalances, useIndexDtfRevenue, useIndexDtfSelectorRegistryAllowedSelectors, useIndexDtfSelectorRegistryIsAllowed, useIndexDtfSelectorRegistryTargets, useIndexDtfStatus, useIndexDtfTransactions, useIndexDtfVersion, useIndexDtfVoteCall, useIndexDtfVoteLockState, useIndexDtfVoterState };
package/dist/index.mjs CHANGED
@@ -1,22 +1,24 @@
1
1
  import { createDtfSdk, getDiscoverDtfs, getIndexDtfProposalGovernanceAddresses } from "@reserve-protocol/sdk";
2
2
  import { createContext, createElement, useContext, useMemo } from "react";
3
- import { isAddress } from "viem";
4
3
  import { useQuery } from "@tanstack/react-query";
4
+ import { isAddress } from "viem";
5
5
  export * from "@reserve-protocol/sdk";
6
6
  //#region src/provider.ts
7
7
  const DtfSdkContext = createContext(void 0);
8
- function DtfSdkProvider({ apiBaseUrl, chains, children, client, sdk }) {
8
+ function DtfSdkProvider({ apiBaseUrl, chains, children, client, etherscanApiKey, sdk }) {
9
9
  const value = useMemo(() => {
10
10
  if (sdk) return sdk;
11
11
  return createDtfSdk({
12
12
  ...apiBaseUrl ? { apiBaseUrl } : {},
13
13
  ...chains ? { chains } : {},
14
- ...client ? { client } : {}
14
+ ...client ? { client } : {},
15
+ ...etherscanApiKey ? { etherscanApiKey } : {}
15
16
  });
16
17
  }, [
17
18
  apiBaseUrl,
18
19
  chains,
19
20
  client,
21
+ etherscanApiKey,
20
22
  sdk
21
23
  ]);
22
24
  return createElement(DtfSdkContext.Provider, { value }, children);
@@ -80,8 +82,11 @@ function proposalVoterStateKeyParams(params) {
80
82
  governance: params.governance,
81
83
  proposal: {
82
84
  id: params.proposal.id,
85
+ isOptimistic: params.proposal.isOptimistic === true,
86
+ optimisticSnapshot: params.proposal.optimistic?.snapshot ?? null,
83
87
  vote: vote?.choice ?? null,
84
- voteStart: params.proposal.voteStart
88
+ voteStart: params.proposal.voteStart,
89
+ voteToken: params.proposal.optimistic?.voteToken ?? params.proposal.voteToken
85
90
  }
86
91
  };
87
92
  }
@@ -94,10 +99,10 @@ function optimisticProposalVoterStateKeyParams(params) {
94
99
  governance: params.governance,
95
100
  proposal: {
96
101
  id: params.proposal.id,
97
- optimisticSnapshot: params.proposal.optimistic?.snapshot,
102
+ optimisticSnapshot: params.proposal.optimistic?.snapshot ?? null,
98
103
  vote: vote?.choice ?? null,
99
104
  voteStart: params.proposal.voteStart,
100
- voteToken: params.proposal.voteToken
105
+ voteToken: params.proposal.optimistic?.voteToken ?? params.proposal.voteToken
101
106
  }
102
107
  };
103
108
  }
@@ -156,6 +161,11 @@ const dtfQueryKeys = {
156
161
  "basket",
157
162
  keyParams(params)
158
163
  ],
164
+ version: (params) => [
165
+ ...dtfQueryKeys.index.all(),
166
+ "version",
167
+ keyParams(params)
168
+ ],
159
169
  brand: (params) => [
160
170
  ...dtfQueryKeys.index.all(),
161
171
  "brand",
@@ -173,16 +183,27 @@ const dtfQueryKeys = {
173
183
  ],
174
184
  governance: {
175
185
  all: () => [...dtfQueryKeys.index.all(), "governance"],
176
- proposals: (params) => [
186
+ proposalList: (params) => [
177
187
  ...dtfQueryKeys.index.governance.all(),
178
- "proposals",
188
+ "proposal-list",
179
189
  keyParams(indexDtfProposalsKeyParams(params))
180
190
  ],
191
+ proposals: (params) => dtfQueryKeys.index.governance.proposalList(params),
181
192
  proposal: (params) => [
182
193
  ...dtfQueryKeys.index.governance.all(),
183
194
  "proposal",
184
195
  keyParams(params)
185
196
  ],
197
+ proposalDecode: (params) => [
198
+ ...dtfQueryKeys.index.governance.all(),
199
+ "proposal-decode",
200
+ keyParams(params)
201
+ ],
202
+ proposalVotingSnapshot: (params) => [
203
+ ...dtfQueryKeys.index.governance.all(),
204
+ "proposal-voting-snapshot",
205
+ keyParams(params)
206
+ ],
186
207
  optimisticGovernance: (params) => [
187
208
  ...dtfQueryKeys.index.governance.all(),
188
209
  "optimistic-governance",
@@ -287,7 +308,7 @@ const dtfQueryKeys = {
287
308
  }
288
309
  };
289
310
  //#endregion
290
- //#region src/query-options.ts
311
+ //#region src/query.ts
291
312
  function createDtfQueryOptions(queryKey, queryFn, enabled, options = {}) {
292
313
  return {
293
314
  ...options,
@@ -300,63 +321,205 @@ function requireParams$1(params, method) {
300
321
  if (params === void 0) throw new Error(`${method} params are required.`);
301
322
  return params;
302
323
  }
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);
324
+ //#endregion
325
+ //#region src/index-dtf/use-index-dtf-delegates.ts
326
+ function indexDtfDelegatesQueryOptions(sdk, params, options) {
327
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.delegates(params), () => sdk.index.getDelegates(requireParams$1(params, "indexDtfDelegatesQueryOptions")), params !== void 0, options);
323
328
  }
324
- function indexDtfPriceHistoryQueryOptions(sdk, params, options) {
325
- return createDtfQueryOptions(dtfQueryKeys.index.priceHistory(params), () => sdk.index.getPriceHistory(requireParams$1(params, "indexDtfPriceHistoryQueryOptions")), params !== void 0, options);
329
+ function useIndexDtfDelegates(params, options) {
330
+ return useQuery(indexDtfDelegatesQueryOptions(useDtfSdk(), params, options));
326
331
  }
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);
332
+ //#endregion
333
+ //#region src/index-dtf/use-index-dtf-guardians.ts
334
+ function indexDtfGuardiansQueryOptions(sdk, params, options) {
335
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.guardians(params), () => sdk.index.getGuardians(requireParams$1(params, "indexDtfGuardiansQueryOptions")), params !== void 0, options);
329
336
  }
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);
337
+ function useIndexDtfGuardians(params, options) {
338
+ return useQuery(indexDtfGuardiansQueryOptions(useDtfSdk(), params, options));
332
339
  }
340
+ //#endregion
341
+ //#region src/index-dtf/use-index-dtf-optimistic-governance.ts
333
342
  function indexDtfOptimisticGovernanceQueryOptions(sdk, params, options) {
334
343
  return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticGovernance(params), () => sdk.index.getOptimisticGovernance(requireParams$1(params, "indexDtfOptimisticGovernanceQueryOptions")), params !== void 0, options);
335
344
  }
345
+ function useIndexDtfOptimisticGovernance(params, options) {
346
+ return useQuery(indexDtfOptimisticGovernanceQueryOptions(useDtfSdk(), params, options));
347
+ }
348
+ //#endregion
349
+ //#region src/index-dtf/use-index-dtf-optimistic-proposal-context.ts
336
350
  function indexDtfOptimisticProposalContextQueryOptions(sdk, params, options) {
337
351
  return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticProposalContext(params), () => sdk.index.getOptimisticProposalContext(requireParams$1(params, "indexDtfOptimisticProposalContextQueryOptions")), params !== void 0, options);
338
352
  }
353
+ function useIndexDtfOptimisticProposalContext(params, options) {
354
+ return useQuery(indexDtfOptimisticProposalContextQueryOptions(useDtfSdk(), params, options));
355
+ }
356
+ //#endregion
357
+ //#region src/index-dtf/use-index-dtf-optimistic-proposal-voter-state.ts
358
+ function indexDtfOptimisticProposalVoterStateQueryOptions(sdk, params, options) {
359
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticProposalVoterState(params), () => sdk.index.getOptimisticProposalVoterState(requireParams$1(params, "indexDtfOptimisticProposalVoterStateQueryOptions")), params !== void 0, options);
360
+ }
361
+ function useIndexDtfOptimisticProposalVoterState(params, options) {
362
+ return useQuery(indexDtfOptimisticProposalVoterStateQueryOptions(useDtfSdk(), params, options));
363
+ }
364
+ //#endregion
365
+ //#region src/index-dtf/use-index-dtf-optimistic-timelock-roles.ts
339
366
  function indexDtfOptimisticTimelockRolesQueryOptions(sdk, params, options) {
340
367
  return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticTimelockRoles(params), () => sdk.index.getOptimisticTimelockRoles(requireParams$1(params, "indexDtfOptimisticTimelockRolesQueryOptions")), params !== void 0, options);
341
368
  }
369
+ function useIndexDtfOptimisticTimelockRoles(params, options) {
370
+ return useQuery(indexDtfOptimisticTimelockRolesQueryOptions(useDtfSdk(), params, options));
371
+ }
372
+ //#endregion
373
+ //#region src/index-dtf/use-index-dtf-optimistic-votes.ts
342
374
  function indexDtfOptimisticVotesQueryOptions(sdk, params, options) {
343
375
  return createDtfQueryOptions(dtfQueryKeys.index.governance.optimisticVotes(params), () => sdk.index.getOptimisticVotes(requireParams$1(params, "indexDtfOptimisticVotesQueryOptions")), params !== void 0, options);
344
376
  }
377
+ function useIndexDtfOptimisticVotes(params, options) {
378
+ return useQuery(indexDtfOptimisticVotesQueryOptions(useDtfSdk(), params, options));
379
+ }
380
+ //#endregion
381
+ //#region src/index-dtf/use-index-dtf-past-optimistic-votes.ts
345
382
  function indexDtfPastOptimisticVotesQueryOptions(sdk, params, options) {
346
383
  return createDtfQueryOptions(dtfQueryKeys.index.governance.pastOptimisticVotes(params), () => sdk.index.getPastOptimisticVotes(requireParams$1(params, "indexDtfPastOptimisticVotesQueryOptions")), params !== void 0, options);
347
384
  }
385
+ function useIndexDtfPastOptimisticVotes(params, options) {
386
+ return useQuery(indexDtfPastOptimisticVotesQueryOptions(useDtfSdk(), params, options));
387
+ }
388
+ //#endregion
389
+ //#region src/index-dtf/use-index-dtf-proposal.ts
390
+ function indexDtfProposalQueryOptions(sdk, params, options) {
391
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposal(params), () => sdk.index.getProposal(requireParams$1(params, "indexDtfProposalQueryOptions")), params !== void 0, options);
392
+ }
393
+ function useIndexDtfProposal(params, options) {
394
+ return useQuery(indexDtfProposalQueryOptions(useDtfSdk(), params, options));
395
+ }
396
+ //#endregion
397
+ //#region src/index-dtf/use-index-dtf-proposal-decode.ts
398
+ function indexDtfProposalDecodeQueryOptions(sdk, params, options) {
399
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalDecode(params), () => sdk.index.decodeProposalCalldatas(requireParams$1(params, "indexDtfProposalDecodeQueryOptions")), params !== void 0, options);
400
+ }
401
+ function useIndexDtfProposalDecode(params, options) {
402
+ return useQuery(indexDtfProposalDecodeQueryOptions(useDtfSdk(), params, options));
403
+ }
404
+ //#endregion
405
+ //#region src/index-dtf/use-index-dtf-proposal-throttle-charges.ts
348
406
  function indexDtfProposalThrottleChargesQueryOptions(sdk, params, options) {
349
407
  return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalThrottleCharges(params), () => sdk.index.getProposalThrottleCharges(requireParams$1(params, "indexDtfProposalThrottleChargesQueryOptions")), params !== void 0, options);
350
408
  }
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);
409
+ function useIndexDtfProposalThrottleCharges(params, options) {
410
+ return useQuery(indexDtfProposalThrottleChargesQueryOptions(useDtfSdk(), params, options));
411
+ }
412
+ //#endregion
413
+ //#region src/index-dtf/use-index-dtf-proposal-voter-state.ts
414
+ function indexDtfProposalVoterStateQueryOptions(sdk, params, options) {
415
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalVoterState(params), () => sdk.index.getProposalVoterState(requireParams$1(params, "indexDtfProposalVoterStateQueryOptions")), params !== void 0, options);
416
+ }
417
+ function useIndexDtfProposalVoterState(params, options) {
418
+ return useQuery(indexDtfProposalVoterStateQueryOptions(useDtfSdk(), params, options));
419
+ }
420
+ //#endregion
421
+ //#region src/index-dtf/use-index-dtf-proposal-voting-snapshot.ts
422
+ function indexDtfProposalVotingSnapshotQueryOptions(sdk, params, options) {
423
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalVotingSnapshot(params), () => sdk.index.getProposalVotingSnapshot(requireParams$1(params, "indexDtfProposalVotingSnapshotQueryOptions")), params !== void 0, options);
424
+ }
425
+ function useIndexDtfProposalVotingSnapshot(params, options) {
426
+ return useQuery(indexDtfProposalVotingSnapshotQueryOptions(useDtfSdk(), params, options));
427
+ }
428
+ //#endregion
429
+ //#region src/index-dtf/use-index-dtf-proposal-votes.ts
430
+ function indexDtfProposalVotesQueryOptions(sdk, params, options) {
431
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalVotes(params), () => sdk.index.getProposalVotes(requireParams$1(params, "indexDtfProposalVotesQueryOptions")), params !== void 0, options);
432
+ }
433
+ function useIndexDtfProposalVotes(params, options) {
434
+ return useQuery(indexDtfProposalVotesQueryOptions(useDtfSdk(), params, options));
435
+ }
436
+ //#endregion
437
+ //#region src/index-dtf/use-index-dtf-proposals.ts
438
+ function indexDtfProposalsQueryOptions(sdk, params, options) {
439
+ const { select, ...queryOptions } = options ?? {};
440
+ return indexDtfProposalListQueryOptions(sdk, params, {
441
+ ...queryOptions,
442
+ select: (data) => select ? select(data.proposals) : data.proposals
443
+ });
444
+ }
445
+ function indexDtfProposalListQueryOptions(sdk, params, options) {
446
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposalList(params), () => sdk.index.getProposalList(requireParams$1(params, "indexDtfProposalListQueryOptions")), params !== void 0, options);
447
+ }
448
+ function useIndexDtfProposals(params, options) {
449
+ return useQuery(indexDtfProposalsQueryOptions(useDtfSdk(), params, options));
450
+ }
451
+ function useIndexDtfProposalList(params, options) {
452
+ return useQuery(indexDtfProposalListQueryOptions(useDtfSdk(), params, options));
453
+ }
454
+ //#endregion
455
+ //#region src/index-dtf/use-index-dtf-proposer-state.ts
456
+ function indexDtfProposerStateQueryOptions(sdk, params, options) {
457
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.proposerState(params), () => sdk.index.getProposerState(requireParams$1(params, "indexDtfProposerStateQueryOptions")), params !== void 0, options);
353
458
  }
459
+ function useIndexDtfProposerState(params, options) {
460
+ return useQuery(indexDtfProposerStateQueryOptions(useDtfSdk(), params, options));
461
+ }
462
+ //#endregion
463
+ //#region src/index-dtf/use-index-dtf-selector-registry-allowed-selectors.ts
354
464
  function indexDtfSelectorRegistryAllowedSelectorsQueryOptions(sdk, params, options) {
355
465
  return createDtfQueryOptions(dtfQueryKeys.index.governance.selectorRegistryAllowedSelectors(params), () => sdk.index.getSelectorRegistryAllowedSelectors(requireParams$1(params, "indexDtfSelectorRegistryAllowedSelectorsQueryOptions")), params !== void 0, options);
356
466
  }
467
+ function useIndexDtfSelectorRegistryAllowedSelectors(params, options) {
468
+ return useQuery(indexDtfSelectorRegistryAllowedSelectorsQueryOptions(useDtfSdk(), params, options));
469
+ }
470
+ //#endregion
471
+ //#region src/index-dtf/use-index-dtf-selector-registry-is-allowed.ts
357
472
  function indexDtfSelectorRegistryIsAllowedQueryOptions(sdk, params, options) {
358
473
  return createDtfQueryOptions(dtfQueryKeys.index.governance.selectorRegistryIsAllowed(params), () => sdk.index.getSelectorRegistryIsAllowed(requireParams$1(params, "indexDtfSelectorRegistryIsAllowedQueryOptions")), params !== void 0, options);
359
474
  }
475
+ function useIndexDtfSelectorRegistryIsAllowed(params, options) {
476
+ return useQuery(indexDtfSelectorRegistryIsAllowedQueryOptions(useDtfSdk(), params, options));
477
+ }
478
+ //#endregion
479
+ //#region src/index-dtf/use-index-dtf-selector-registry-targets.ts
480
+ function indexDtfSelectorRegistryTargetsQueryOptions(sdk, params, options) {
481
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.selectorRegistryTargets(params), () => sdk.index.getSelectorRegistryTargets(requireParams$1(params, "indexDtfSelectorRegistryTargetsQueryOptions")), params !== void 0, options);
482
+ }
483
+ function useIndexDtfSelectorRegistryTargets(params, options) {
484
+ return useQuery(indexDtfSelectorRegistryTargetsQueryOptions(useDtfSdk(), params, options));
485
+ }
486
+ //#endregion
487
+ //#region src/index-dtf/use-index-dtf-voter-state.ts
488
+ function indexDtfVoterStateQueryOptions(sdk, params, options) {
489
+ return createDtfQueryOptions(dtfQueryKeys.index.governance.voterState(params), () => sdk.index.getVoterState(requireParams$1(params, "indexDtfVoterStateQueryOptions")), params !== void 0, options);
490
+ }
491
+ function useIndexDtfVoterState(params, options) {
492
+ return useQuery(indexDtfVoterStateQueryOptions(useDtfSdk(), params, options));
493
+ }
494
+ //#endregion
495
+ //#region src/query-options.ts
496
+ function discoverDtfsQueryOptions(sdk, params, options) {
497
+ return createDtfQueryOptions(dtfQueryKeys.discover(params), () => getDiscoverDtfs(sdk.client, params), true, options);
498
+ }
499
+ function indexDtfListQueryOptions(sdk, params, options) {
500
+ return createDtfQueryOptions(dtfQueryKeys.index.list(params), () => sdk.index.list(params), true, options);
501
+ }
502
+ function indexDtfQueryOptions(sdk, params, options) {
503
+ return createDtfQueryOptions(dtfQueryKeys.index.full(params), () => sdk.index.get(requireParams$1(params, "indexDtfQueryOptions")), params !== void 0, options);
504
+ }
505
+ function fullIndexDtfQueryOptions(sdk, params, options) {
506
+ return createDtfQueryOptions(dtfQueryKeys.index.full(params), () => sdk.index.getFull(requireParams$1(params, "fullIndexDtfQueryOptions")), params !== void 0, options);
507
+ }
508
+ function indexDtfBasketQueryOptions(sdk, params, options) {
509
+ return createDtfQueryOptions(dtfQueryKeys.index.basket(params), () => sdk.index.getBasket(requireParams$1(params, "indexDtfBasketQueryOptions")), params !== void 0, options);
510
+ }
511
+ function indexDtfVersionQueryOptions(sdk, params, options) {
512
+ return createDtfQueryOptions(dtfQueryKeys.index.version(params), () => sdk.index.getVersion(requireParams$1(params, "indexDtfVersionQueryOptions")), params !== void 0, options);
513
+ }
514
+ function indexDtfBrandQueryOptions(sdk, params, options) {
515
+ return createDtfQueryOptions(dtfQueryKeys.index.brand(params), () => sdk.index.getBrand(requireParams$1(params, "indexDtfBrandQueryOptions")), params !== void 0, options);
516
+ }
517
+ function indexDtfPriceQueryOptions(sdk, params, options) {
518
+ return createDtfQueryOptions(dtfQueryKeys.index.price(params), () => sdk.index.getPrice(requireParams$1(params, "indexDtfPriceQueryOptions")), params !== void 0, options);
519
+ }
520
+ function indexDtfPriceHistoryQueryOptions(sdk, params, options) {
521
+ return createDtfQueryOptions(dtfQueryKeys.index.priceHistory(params), () => sdk.index.getPriceHistory(requireParams$1(params, "indexDtfPriceHistoryQueryOptions")), params !== void 0, options);
522
+ }
360
523
  function buildIndexDtfBasketProposalQueryOptions(sdk, params, options) {
361
524
  return createDtfQueryOptions(dtfQueryKeys.index.governance.buildBasketProposal(params), () => sdk.index.buildBasketProposal(requireParams$1(params, "buildIndexDtfBasketProposalQueryOptions")), params !== void 0, options);
362
525
  }
@@ -369,27 +532,6 @@ function buildIndexDtfDaoSettingsProposalQueryOptions(sdk, params, options) {
369
532
  function buildIndexDtfSettingsProposalQueryOptions(sdk, params, options) {
370
533
  return createDtfQueryOptions(dtfQueryKeys.index.governance.buildSettingsProposal(params), () => sdk.index.buildSettingsProposal(requireParams$1(params, "buildIndexDtfSettingsProposalQueryOptions")), params !== void 0, options);
371
534
  }
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
535
  //#endregion
394
536
  //#region src/hooks.ts
395
537
  function useDiscoverDtfs(params, options) {
@@ -407,6 +549,9 @@ function useFullIndexDtf(params, options) {
407
549
  function useIndexDtfBasket(params, options) {
408
550
  return useQuery(indexDtfBasketQueryOptions(useDtfSdk(), params, options));
409
551
  }
552
+ function useIndexDtfVersion(params, options) {
553
+ return useQuery(indexDtfVersionQueryOptions(useDtfSdk(), params, options));
554
+ }
410
555
  function useIndexDtfBrand(params, options) {
411
556
  return useQuery(indexDtfBrandQueryOptions(useDtfSdk(), params, options));
412
557
  }
@@ -416,39 +561,6 @@ function useIndexDtfPrice(params, options) {
416
561
  function useIndexDtfPriceHistory(params, options) {
417
562
  return useQuery(indexDtfPriceHistoryQueryOptions(useDtfSdk(), params, options));
418
563
  }
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
564
  function useBuildIndexDtfBasketProposal(params, options) {
453
565
  return useQuery(buildIndexDtfBasketProposalQueryOptions(useDtfSdk(), params, options));
454
566
  }
@@ -461,26 +573,238 @@ function useBuildIndexDtfDaoSettingsProposal(params, options) {
461
573
  function useBuildIndexDtfSettingsProposal(params, options) {
462
574
  return useQuery(buildIndexDtfSettingsProposalQueryOptions(useDtfSdk(), params, options));
463
575
  }
464
- function useIndexDtfDelegates(params, options) {
465
- return useQuery(indexDtfDelegatesQueryOptions(useDtfSdk(), params, options));
576
+ //#endregion
577
+ //#region src/index-dtf/index-dtf-provider.ts
578
+ const IndexDtfContext = createContext(void 0);
579
+ function IndexDtfProvider({ address, chainId, children, prefetch = false }) {
580
+ const value = useMemo(() => ({
581
+ address,
582
+ chainId
583
+ }), [address, chainId]);
584
+ return createElement(IndexDtfContext.Provider, { value }, prefetch ? createElement(IndexDtfPrefetch) : null, children);
585
+ }
586
+ function useIndexDtfIdentity() {
587
+ const identity = useContext(IndexDtfContext);
588
+ if (!identity) throw new Error("useIndexDtfIdentity must be used inside IndexDtfProvider.");
589
+ return identity;
590
+ }
591
+ function IndexDtfPrefetch() {
592
+ useFullIndexDtf({
593
+ ...useIndexDtfIdentity(),
594
+ brand: true
595
+ });
596
+ return null;
466
597
  }
467
- function useIndexDtfGuardians(params, options) {
468
- return useQuery(indexDtfGuardiansQueryOptions(useDtfSdk(), params, options));
598
+ //#endregion
599
+ //#region src/index-dtf/index-dtf-data.ts
600
+ function mapIndexDtfData(dtf) {
601
+ const ownerGovernance = getAuthorityGovernance(dtf.governance.admin.primary);
602
+ const tradingGovernance = getAuthorityGovernance(dtf.governance.rebalance.primary);
603
+ return {
604
+ ...dtf,
605
+ token: {
606
+ ...dtf.token,
607
+ id: dtf.token.address,
608
+ totalSupply: dtf.token.snapshot.totalSupply,
609
+ currentHolderCount: dtf.token.snapshot.currentHolderCount
610
+ },
611
+ proxyAdmin: dtf.roles.deployment.proxyAdmin,
612
+ timestamp: dtf.createdAt,
613
+ deployer: dtf.roles.deployment.deployer,
614
+ ownerAddress: dtf.roles.admin.primary,
615
+ mintingFee: Number(dtf.fees.mintingFee.formatted),
616
+ tvlFee: Number(dtf.fees.tvlFee.formatted),
617
+ annualizedTvlFee: dtf.fees.annualizedTvlFee,
618
+ auctionDelay: dtf.rebalance.auctionDelay,
619
+ auctionLength: dtf.rebalance.auctionLength,
620
+ auctionApprovers: [...dtf.roles.rebalance.auctionApprovers],
621
+ auctionLaunchers: [...dtf.roles.rebalance.auctionLaunchers],
622
+ brandManagers: [...dtf.roles.metadata.brandManagers],
623
+ feeRecipients: dtf.fees.recipients,
624
+ ...ownerGovernance ? { ownerGovernance } : {},
625
+ ...tradingGovernance ? { tradingGovernance } : {},
626
+ legacyAdmins: [...dtf.roles.admin.legacy],
627
+ legacyAuctionApprovers: [...dtf.roles.rebalance.legacyAuctionApprovers],
628
+ ...dtf.voteLockVault ? { stToken: {
629
+ id: dtf.voteLockVault.token.address,
630
+ chainId: dtf.chainId,
631
+ token: {
632
+ ...dtf.voteLockVault.token,
633
+ id: dtf.voteLockVault.token.address,
634
+ totalSupply: dtf.voteLockVault.token.snapshot.totalSupply
635
+ },
636
+ underlying: dtf.voteLockVault.underlying,
637
+ ...dtf.voteLockVault.governance ? { governance: mapGovernanceData(dtf.voteLockVault.governance) } : {},
638
+ legacyGovernance: [...dtf.voteLockVault.legacyGovernance],
639
+ rewardTokens: [...dtf.voteLockVault.rewardTokens],
640
+ totalDelegates: dtf.voteLockVault.delegation.totalDelegates,
641
+ currentDelegates: dtf.voteLockVault.delegation.currentDelegates,
642
+ totalOptimisticDelegates: dtf.voteLockVault.delegation.totalOptimisticDelegates,
643
+ currentOptimisticDelegates: dtf.voteLockVault.delegation.currentOptimisticDelegates
644
+ } } : {},
645
+ totalRevenue: dtf.financials.totalRevenue,
646
+ protocolRevenue: dtf.financials.protocolRevenue,
647
+ governanceRevenue: dtf.financials.governanceRevenue,
648
+ externalRevenue: dtf.financials.externalRevenue
649
+ };
469
650
  }
470
- function useIndexDtfVoterState(params, options) {
471
- return useQuery(indexDtfVoterStateQueryOptions(useDtfSdk(), params, options));
651
+ function getAuthorityGovernance(authority) {
652
+ if (authority?.type !== "governance") return;
653
+ return mapGovernanceData(authority.governance);
472
654
  }
473
- function useIndexDtfProposerState(params, options) {
474
- return useQuery(indexDtfProposerStateQueryOptions(useDtfSdk(), params, options));
655
+ function mapGovernanceData(governance) {
656
+ return {
657
+ ...governance,
658
+ id: governance.address,
659
+ timelock: {
660
+ ...governance.timelock,
661
+ id: governance.timelock.address,
662
+ guardians: [...governance.timelock.guardians],
663
+ optimisticProposers: [...governance.timelock.optimisticProposers]
664
+ }
665
+ };
475
666
  }
476
- function useIndexDtfProposalVotes(params, options) {
477
- return useQuery(indexDtfProposalVotesQueryOptions(useDtfSdk(), params, options));
667
+ //#endregion
668
+ //#region src/index-dtf/use-current-index-dtf.ts
669
+ function useCurrentIndexDtf(options) {
670
+ return useFullIndexDtf({
671
+ ...useIndexDtfIdentity(),
672
+ brand: true
673
+ }, {
674
+ ...options,
675
+ select: mapIndexDtfData
676
+ });
478
677
  }
479
- function useIndexDtfProposalVoterState(params, options) {
480
- return useQuery(indexDtfProposalVoterStateQueryOptions(useDtfSdk(), params, options));
678
+ //#endregion
679
+ //#region src/index-dtf/use-current-index-dtf-basket.ts
680
+ function useCurrentIndexDtfBasket() {
681
+ return useCurrentIndexDtf().data?.basket;
481
682
  }
482
- function useIndexDtfOptimisticProposalVoterState(params, options) {
483
- return useQuery(indexDtfOptimisticProposalVoterStateQueryOptions(useDtfSdk(), params, options));
683
+ //#endregion
684
+ //#region src/index-dtf/use-index-dtf-proposal-actions.ts
685
+ function useIndexDtfVoteCall(params) {
686
+ const sdk = useDtfSdk();
687
+ const chainId = params?.chainId;
688
+ const governance = params?.governance;
689
+ const proposalId = params?.proposalId;
690
+ const support = params?.support;
691
+ return useMemo(() => {
692
+ if (chainId === void 0 || !governance || proposalId === void 0 || support === void 0) return;
693
+ return sdk.index.prepareVote({
694
+ chainId,
695
+ governance,
696
+ proposalId,
697
+ support
698
+ });
699
+ }, [
700
+ chainId,
701
+ governance,
702
+ proposalId,
703
+ support,
704
+ sdk
705
+ ]);
706
+ }
707
+ function useIndexDtfQueueProposalCall(params) {
708
+ const sdk = useDtfSdk();
709
+ const proposal = params?.proposal;
710
+ const chainId = params?.chainId;
711
+ const governance = proposal?.governance;
712
+ const timelock = proposal?.timelock;
713
+ const timelockId = proposal?.timelockId;
714
+ const targets = proposal?.targets;
715
+ const calldatas = proposal?.calldatas;
716
+ const description = proposal?.description;
717
+ return useMemo(() => {
718
+ if (chainId === void 0 || !governance || !targets || !calldatas || description === void 0) return;
719
+ return sdk.index.prepareQueueProposal({
720
+ chainId,
721
+ proposal: {
722
+ governance,
723
+ targets,
724
+ calldatas,
725
+ description,
726
+ ...timelock === void 0 ? {} : { timelock },
727
+ ...timelockId === void 0 ? {} : { timelockId }
728
+ }
729
+ });
730
+ }, [
731
+ chainId,
732
+ governance,
733
+ timelock,
734
+ timelockId,
735
+ targets,
736
+ calldatas,
737
+ description,
738
+ sdk
739
+ ]);
740
+ }
741
+ function useIndexDtfExecuteProposalCall(params) {
742
+ const sdk = useDtfSdk();
743
+ const proposal = params?.proposal;
744
+ const chainId = params?.chainId;
745
+ const governance = proposal?.governance;
746
+ const timelock = proposal?.timelock;
747
+ const timelockId = proposal?.timelockId;
748
+ const targets = proposal?.targets;
749
+ const calldatas = proposal?.calldatas;
750
+ const description = proposal?.description;
751
+ return useMemo(() => {
752
+ if (chainId === void 0 || !governance || !targets || !calldatas || description === void 0) return;
753
+ return sdk.index.prepareExecuteProposal({
754
+ chainId,
755
+ proposal: {
756
+ governance,
757
+ targets,
758
+ calldatas,
759
+ description,
760
+ ...timelock === void 0 ? {} : { timelock },
761
+ ...timelockId === void 0 ? {} : { timelockId }
762
+ }
763
+ });
764
+ }, [
765
+ chainId,
766
+ governance,
767
+ timelock,
768
+ timelockId,
769
+ targets,
770
+ calldatas,
771
+ description,
772
+ sdk
773
+ ]);
774
+ }
775
+ function useIndexDtfCancelProposalCall(params) {
776
+ const sdk = useDtfSdk();
777
+ const proposal = params?.proposal;
778
+ const chainId = params?.chainId;
779
+ const governance = proposal?.governance;
780
+ const timelock = proposal?.timelock;
781
+ const timelockId = proposal?.timelockId;
782
+ const targets = proposal?.targets;
783
+ const calldatas = proposal?.calldatas;
784
+ const description = proposal?.description;
785
+ return useMemo(() => {
786
+ if (chainId === void 0 || !governance || !timelock || !targets || !calldatas || description === void 0) return;
787
+ return sdk.index.prepareCancelProposal({
788
+ chainId,
789
+ proposal: {
790
+ governance,
791
+ timelock,
792
+ targets,
793
+ calldatas,
794
+ description,
795
+ ...timelockId === void 0 ? {} : { timelockId }
796
+ }
797
+ });
798
+ }, [
799
+ chainId,
800
+ governance,
801
+ timelock,
802
+ timelockId,
803
+ targets,
804
+ calldatas,
805
+ description,
806
+ sdk
807
+ ]);
484
808
  }
485
809
  //#endregion
486
810
  //#region src/index-dtf-query-options.ts
@@ -565,4 +889,4 @@ function useAccountPortfolio(params, options) {
565
889
  return useQuery(accountPortfolioQueryOptions(useDtfSdk(), params, options));
566
890
  }
567
891
  //#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 };
892
+ export { DtfSdkProvider, IndexDtfProvider, accountPortfolioQueryOptions, buildIndexDtfBasketProposalQueryOptions, buildIndexDtfBasketSettingsProposalQueryOptions, buildIndexDtfDaoSettingsProposalQueryOptions, buildIndexDtfSettingsProposalQueryOptions, discoverDtfsQueryOptions, dtfQueryKeys, fullIndexDtfQueryOptions, indexDtfBasketQueryOptions, indexDtfBrandQueryOptions, indexDtfCurrentRebalanceQueryOptions, indexDtfDelegatesQueryOptions, indexDtfExposureQueryOptions, indexDtfGuardiansQueryOptions, indexDtfIssuanceStateQueryOptions, indexDtfListQueryOptions, indexDtfOptimisticGovernanceQueryOptions, indexDtfOptimisticProposalContextQueryOptions, indexDtfOptimisticProposalVoterStateQueryOptions, indexDtfOptimisticTimelockRolesQueryOptions, indexDtfOptimisticVotesQueryOptions, indexDtfPastOptimisticVotesQueryOptions, indexDtfPriceHistoryQueryOptions, indexDtfPriceQueryOptions, indexDtfProposalDecodeQueryOptions, indexDtfProposalListQueryOptions, indexDtfProposalQueryOptions, indexDtfProposalThrottleChargesQueryOptions, indexDtfProposalVoterStateQueryOptions, indexDtfProposalVotesQueryOptions, indexDtfProposalVotingSnapshotQueryOptions, indexDtfProposalsQueryOptions, indexDtfProposerStateQueryOptions, indexDtfQueryOptions, indexDtfRebalancesQueryOptions, indexDtfRevenueQueryOptions, indexDtfSelectorRegistryAllowedSelectorsQueryOptions, indexDtfSelectorRegistryIsAllowedQueryOptions, indexDtfSelectorRegistryTargetsQueryOptions, indexDtfStatusQueryOptions, indexDtfTransactionsQueryOptions, indexDtfVersionQueryOptions, indexDtfVoteLockStateQueryOptions, indexDtfVoterStateQueryOptions, mapIndexDtfData, normalizeQueryKeyValue, useAccountPortfolio, useBuildIndexDtfBasketProposal, useBuildIndexDtfBasketSettingsProposal, useBuildIndexDtfDaoSettingsProposal, useBuildIndexDtfSettingsProposal, useCurrentIndexDtf, useCurrentIndexDtfBasket, useDiscoverDtfs, useDtfSdk, useFullIndexDtf, useIndexDtf, useIndexDtfBasket, useIndexDtfBrand, useIndexDtfCancelProposalCall, useIndexDtfCurrentRebalance, useIndexDtfDelegates, useIndexDtfExecuteProposalCall, useIndexDtfExposure, useIndexDtfGuardians, useIndexDtfIdentity, useIndexDtfIssuanceState, useIndexDtfList, useIndexDtfOptimisticGovernance, useIndexDtfOptimisticProposalContext, useIndexDtfOptimisticProposalVoterState, useIndexDtfOptimisticTimelockRoles, useIndexDtfOptimisticVotes, useIndexDtfPastOptimisticVotes, useIndexDtfPrice, useIndexDtfPriceHistory, useIndexDtfProposal, useIndexDtfProposalDecode, useIndexDtfProposalList, useIndexDtfProposalThrottleCharges, useIndexDtfProposalVoterState, useIndexDtfProposalVotes, useIndexDtfProposalVotingSnapshot, useIndexDtfProposals, useIndexDtfProposerState, useIndexDtfQueueProposalCall, useIndexDtfRebalances, useIndexDtfRevenue, useIndexDtfSelectorRegistryAllowedSelectors, useIndexDtfSelectorRegistryIsAllowed, useIndexDtfSelectorRegistryTargets, useIndexDtfStatus, useIndexDtfTransactions, useIndexDtfVersion, useIndexDtfVoteCall, useIndexDtfVoteLockState, useIndexDtfVoterState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reserve-protocol/react-sdk",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "React Query hooks for DTF interface integrations.",
5
5
  "keywords": [
6
6
  "dtf",
@@ -8,6 +8,11 @@
8
8
  "sdk"
9
9
  ],
10
10
  "license": "MIT",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/reserve-protocol/dtf-interface",
14
+ "directory": "packages/react-sdk"
15
+ },
11
16
  "files": [
12
17
  "dist"
13
18
  ],
@@ -28,13 +33,13 @@
28
33
  "access": "public"
29
34
  },
30
35
  "dependencies": {
31
- "@reserve-protocol/sdk": "0.0.1"
36
+ "@reserve-protocol/sdk": "0.1.1"
32
37
  },
33
38
  "devDependencies": {
34
39
  "@tanstack/react-query": "^5.100.9",
35
40
  "@types/node": "^24.12.2",
36
- "@types/react": "^19.2.14",
37
- "react": "^19.2.6",
41
+ "@types/react": "^18.3.28",
42
+ "react": "^18.3.1",
38
43
  "tsdown": "^0.21.10",
39
44
  "typescript": "^6.0.3",
40
45
  "viem": "^2.48.8",