@curator-studio/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,846 @@
1
+ import { Address, WalletClient, PublicClient, Abi } from 'viem';
2
+ import { Client, gql } from '@urql/core';
3
+ import { PropsWithChildren } from 'react';
4
+ import * as _tanstack_react_query from '@tanstack/react-query';
5
+ import { UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
6
+
7
+ type Allocation$1 = {
8
+ recipient: Address;
9
+ weight: string;
10
+ label?: string;
11
+ };
12
+ type Strategy = {
13
+ id: Address;
14
+ chainId: number;
15
+ tenantId: string | null;
16
+ owner: Address;
17
+ sourceStrategy: Address | null;
18
+ metadataURI: string | null;
19
+ feeRecipient: Address | null;
20
+ feeBps: number;
21
+ ensLabel: string | null;
22
+ metadata: {
23
+ title: string;
24
+ description: string;
25
+ image?: string;
26
+ };
27
+ allocations: Allocation$1[];
28
+ allocationsVersion: number;
29
+ timesForked: number;
30
+ uniqueDonors: number;
31
+ createdAt: bigint;
32
+ createdAtBlock: bigint;
33
+ lastUpdatedAt: bigint;
34
+ lastUpdatedAtBlock: bigint;
35
+ };
36
+ type Distribution = {
37
+ id: string;
38
+ strategyId: Address;
39
+ token: Address;
40
+ totalAmount: string;
41
+ totalAmountUSD: string;
42
+ allocationsVersion: number;
43
+ allocations: Allocation$1[];
44
+ timestamp: bigint;
45
+ blockNumber: bigint;
46
+ txHash: Address;
47
+ };
48
+ type Payout = {
49
+ id: string;
50
+ strategyId: Address;
51
+ distributionId: string;
52
+ recipient: Address;
53
+ token: Address;
54
+ amount: string;
55
+ amountUSD: string;
56
+ timestamp: bigint;
57
+ blockNumber: bigint;
58
+ txHash: Address;
59
+ };
60
+ type Transfer = {
61
+ id: string;
62
+ strategyId: Address;
63
+ token: Address;
64
+ from: Address;
65
+ to: Address;
66
+ amount: string;
67
+ amountUSD: string;
68
+ direction: "in" | "out";
69
+ timestamp: bigint;
70
+ blockNumber: bigint;
71
+ txHash: Address;
72
+ };
73
+ type Donor = {
74
+ id: string;
75
+ strategyId: Address;
76
+ address: Address;
77
+ firstDonationAt: bigint;
78
+ lastDonationAt: bigint;
79
+ totalDonations: number;
80
+ };
81
+ type StrategyBalance = {
82
+ id: string;
83
+ strategyId: Address;
84
+ token: Address;
85
+ balance: string;
86
+ totalReceived: string;
87
+ totalDistributed: string;
88
+ totalReceivedUSD: string;
89
+ totalDistributedUSD: string;
90
+ lastUpdatedAt: bigint;
91
+ };
92
+ type Fork = {
93
+ id: string;
94
+ sourceStrategyId: Address;
95
+ childStrategyId: Address;
96
+ createdAt: bigint;
97
+ };
98
+ type WarehouseBalance = {
99
+ id: string;
100
+ user: Address;
101
+ token: Address;
102
+ balance: string;
103
+ totalEarned: string;
104
+ totalClaimed: string;
105
+ totalEarnedUSD: string;
106
+ lastUpdatedAt: bigint;
107
+ };
108
+ type YieldRedirector = {
109
+ id: Address;
110
+ owner: Address;
111
+ sourceVault: Address;
112
+ yieldRecipient: Address;
113
+ asset: Address;
114
+ name: string | null;
115
+ symbol: string | null;
116
+ principal: string;
117
+ totalHarvested: string;
118
+ totalHarvestedUSD: string;
119
+ harvestCount: number;
120
+ lastHarvestAt: bigint | null;
121
+ createdAt: bigint;
122
+ createdAtBlock: bigint;
123
+ };
124
+ type Harvest = {
125
+ id: string;
126
+ redirectorId: Address;
127
+ amount: string;
128
+ amountUSD: string;
129
+ recipient: Address;
130
+ timestamp: bigint;
131
+ blockNumber: bigint;
132
+ txHash: Address;
133
+ };
134
+ type Page<T> = {
135
+ items: T[];
136
+ totalCount: number;
137
+ pageInfo: {
138
+ hasNextPage: boolean;
139
+ endCursor?: string;
140
+ };
141
+ };
142
+ type StrategyFilter = {
143
+ id?: string;
144
+ id_in?: string[];
145
+ tenantId?: string;
146
+ tenantId_in?: string[];
147
+ owner?: string;
148
+ owner_in?: string[];
149
+ sourceStrategy?: string;
150
+ sourceStrategy_in?: string[];
151
+ };
152
+ type DistributionFilter = {
153
+ strategyId?: string;
154
+ strategyId_in?: string[];
155
+ token?: string;
156
+ token_in?: string[];
157
+ };
158
+ type PayoutFilter = {
159
+ strategyId?: string;
160
+ strategyId_in?: string[];
161
+ distributionId?: string;
162
+ recipient?: string;
163
+ recipient_in?: string[];
164
+ token?: string;
165
+ };
166
+ type TransferFilter = {
167
+ strategyId?: string;
168
+ strategyId_in?: string[];
169
+ token?: string;
170
+ from?: string;
171
+ to?: string;
172
+ direction?: "in" | "out";
173
+ };
174
+ type DonorFilter = {
175
+ strategyId?: string;
176
+ strategyId_in?: string[];
177
+ address?: string;
178
+ address_in?: string[];
179
+ };
180
+ type StrategyBalanceFilter = {
181
+ strategyId?: string;
182
+ strategyId_in?: string[];
183
+ token?: string;
184
+ token_in?: string[];
185
+ };
186
+ type ForkFilter = {
187
+ sourceStrategyId?: string;
188
+ sourceStrategyId_in?: string[];
189
+ childStrategyId?: string;
190
+ childStrategyId_in?: string[];
191
+ };
192
+ type WarehouseBalanceFilter = {
193
+ user?: string;
194
+ user_in?: string[];
195
+ token?: string;
196
+ token_in?: string[];
197
+ };
198
+ type YieldRedirectorFilter = {
199
+ id?: string;
200
+ id_in?: string[];
201
+ owner?: string;
202
+ owner_in?: string[];
203
+ sourceVault?: string;
204
+ yieldRecipient?: string;
205
+ yieldRecipient_in?: string[];
206
+ };
207
+ type HarvestFilter = {
208
+ redirectorId?: string;
209
+ redirectorId_in?: string[];
210
+ recipient?: string;
211
+ recipient_in?: string[];
212
+ };
213
+ type QueryVariables<TFilter> = {
214
+ where?: TFilter;
215
+ orderBy?: string;
216
+ orderDirection?: "asc" | "desc";
217
+ limit?: number;
218
+ after?: string;
219
+ };
220
+ type TrendingStrategy = Strategy & {
221
+ trendingStats: {
222
+ transferCount: number;
223
+ totalAmount: string;
224
+ };
225
+ };
226
+ type TrendingResponse = {
227
+ data: TrendingStrategy[];
228
+ period: "24h" | "7d";
229
+ };
230
+ type TokenTotals = {
231
+ token: Address;
232
+ totalReceived: string;
233
+ totalDistributed: string;
234
+ };
235
+ type ProtocolStats = {
236
+ totalStrategies: number;
237
+ totalCurators: number;
238
+ totalDonors: number;
239
+ totalDistributions: number;
240
+ totalAllocatedUSD: string;
241
+ totalsByToken: TokenTotals[];
242
+ };
243
+ type StatsResponse = {
244
+ data: ProtocolStats;
245
+ };
246
+ type StrategyLineage = {
247
+ strategy: Address;
248
+ sourceStrategy: Address | null;
249
+ ancestors: Address[];
250
+ children: Address[];
251
+ depth: number;
252
+ };
253
+ type LineageResponse = {
254
+ data: StrategyLineage;
255
+ };
256
+ type IndexerBase = {
257
+ client: Client;
258
+ gql: typeof gql;
259
+ baseUrl: string;
260
+ strategy: {
261
+ get: (id: Address) => Promise<Strategy | null>;
262
+ query: (variables?: QueryVariables<StrategyFilter>) => Promise<Page<Strategy> | null>;
263
+ };
264
+ distribution: {
265
+ query: (variables?: QueryVariables<DistributionFilter>) => Promise<Page<Distribution> | null>;
266
+ };
267
+ payout: {
268
+ query: (variables?: QueryVariables<PayoutFilter>) => Promise<Page<Payout> | null>;
269
+ };
270
+ donor: {
271
+ query: (variables?: QueryVariables<DonorFilter>) => Promise<Page<Donor> | null>;
272
+ };
273
+ strategyBalance: {
274
+ query: (variables?: QueryVariables<StrategyBalanceFilter>) => Promise<Page<StrategyBalance> | null>;
275
+ };
276
+ fork: {
277
+ query: (variables?: QueryVariables<ForkFilter>) => Promise<Page<Fork> | null>;
278
+ };
279
+ warehouseBalance: {
280
+ query: (variables?: QueryVariables<WarehouseBalanceFilter>) => Promise<Page<WarehouseBalance> | null>;
281
+ };
282
+ yieldRedirector: {
283
+ get: (id: Address) => Promise<YieldRedirector | null>;
284
+ query: (variables?: QueryVariables<YieldRedirectorFilter>) => Promise<Page<YieldRedirector> | null>;
285
+ };
286
+ harvest: {
287
+ query: (variables?: QueryVariables<HarvestFilter>) => Promise<Page<Harvest> | null>;
288
+ };
289
+ trending: (options?: {
290
+ period?: "24h" | "7d";
291
+ limit?: number;
292
+ }) => Promise<TrendingResponse>;
293
+ stats: () => Promise<ProtocolStats>;
294
+ lineage: (strategyAddress: Address) => Promise<StrategyLineage | null>;
295
+ };
296
+ type Indexer = IndexerBase & {
297
+ extend<T>(extension: IndexerExtension<T>): Indexer & T;
298
+ };
299
+ type IndexerExtension<T> = (indexer: Indexer) => T;
300
+ declare function createIndexer(url: string, tenant?: string): Indexer;
301
+
302
+ type SupportedChainId = 1 | 11155111 | 84532 | 31337;
303
+ type ChainConfig = {
304
+ warehouse?: `0x${string}`;
305
+ nameWrapper?: `0x${string}`;
306
+ ensUniversalResolver?: `0x${string}`;
307
+ };
308
+ /**
309
+ * Per-tenant, per-chain configuration.
310
+ * Each tenant deploys its own StrategyFactory under its own ENS domain.
311
+ */
312
+ type TenantConfig = {
313
+ ensDomain: string;
314
+ factory?: `0x${string}`;
315
+ startBlock?: number;
316
+ foreverSubnameRegistrar?: `0x${string}`;
317
+ };
318
+ /**
319
+ * All tenants across all chains.
320
+ * Auto-populated from deployments.json tenants section + legacy flat StrategyFactory fallback.
321
+ */
322
+ declare const tenants: Record<string, Partial<Record<SupportedChainId, TenantConfig>>>;
323
+ declare const config: Record<SupportedChainId, ChainConfig>;
324
+ /**
325
+ * Returns a map of factory address (lowercase) → tenant ID for a given chain.
326
+ * Used by the indexer to derive tenantId from factory address on each event.
327
+ */
328
+ declare function getFactoryTenantMap(chainId: SupportedChainId): Map<string, string>;
329
+ /**
330
+ * Returns all tenant factory addresses for a given chain.
331
+ * Used by ponder.config.ts to watch all tenant factories.
332
+ */
333
+ declare function getAllFactoryAddresses(chainId: SupportedChainId): `0x${string}`[];
334
+ /**
335
+ * Returns the tenant config for a given tenant and chain.
336
+ */
337
+ declare function getTenantConfig(tenantId: string, chainId: SupportedChainId): TenantConfig | undefined;
338
+ declare const ENS_DOMAIN: string;
339
+
340
+ type Allocation = {
341
+ recipient: Address;
342
+ weight: bigint;
343
+ label?: string;
344
+ };
345
+ type StrategyMetadata = {
346
+ title: string;
347
+ description?: string;
348
+ image?: string;
349
+ };
350
+ /**
351
+ * Strategy configuration for creation
352
+ * Note: Fee is handled as the first allocation by convention
353
+ */
354
+ type StrategyConfig = {
355
+ owner: Address;
356
+ sourceStrategy: Address;
357
+ allocations: Allocation[];
358
+ metadata: StrategyMetadata;
359
+ ensLabel: string;
360
+ };
361
+ /**
362
+ * Strategy data returned from contract
363
+ * Note: Fee is calculated from first allocation
364
+ */
365
+ type StrategyData = {
366
+ owner: Address;
367
+ sourceStrategy: Address;
368
+ allocations: Allocation[];
369
+ totalWeight: bigint;
370
+ metadataURI: string;
371
+ };
372
+ type ChainDeployments$3 = {
373
+ Strategy: {
374
+ abi: unknown;
375
+ };
376
+ StrategyFactory: {
377
+ abi: unknown;
378
+ address: string;
379
+ };
380
+ };
381
+ type UploadMetadataFn = (metadata: StrategyMetadata) => Promise<string>;
382
+ declare function createStrategyMethods(wallet: WalletClient | undefined, publicClient: PublicClient, deployments: ChainDeployments$3, uploadMetadata: UploadMetadataFn | undefined): {
383
+ /**
384
+ * Create a new strategy with optional ENS subdomain.
385
+ * Metadata is uploaded to the configured uploadUrl (defaults to inline data URI if not set).
386
+ */
387
+ create: (config: StrategyConfig) => Promise<{
388
+ strategy: Address;
389
+ config: StrategyConfig;
390
+ }>;
391
+ /**
392
+ * Get strategy data including owner, allocations, and metadata
393
+ * Note: Fee is the first allocation by convention
394
+ */
395
+ getData: (strategyAddress: Address) => Promise<StrategyData>;
396
+ /**
397
+ * Get the balance of a token held by the strategy
398
+ */
399
+ balanceOf: (strategyAddress: Address, token: Address) => Promise<bigint>;
400
+ /**
401
+ * Update the allocation configuration and metadata (owner only).
402
+ * Metadata is uploaded to the configured uploadUrl (defaults to inline data URI if not set).
403
+ */
404
+ rebalance: (strategyAddress: Address, allocations: Allocation[], metadata: StrategyMetadata) => Promise<{
405
+ hash: `0x${string}`;
406
+ }>;
407
+ /**
408
+ * Distribute the strategy's token balance to recipients according to allocations
409
+ */
410
+ distribute: (strategyAddress: Address, token: Address) => Promise<{
411
+ hash: `0x${string}`;
412
+ }>;
413
+ /**
414
+ * Set ENS subdomain name for an existing strategy
415
+ * @param strategyAddress The strategy address to set ENS name for
416
+ * @param label ENS subdomain label (e.g., "mystrategy")
417
+ * @dev Automatically handles two cases:
418
+ * 1. If factory doesn't own the name: registers it via ENS registrar
419
+ * 2. If factory owns the name: connects pre-registered name
420
+ */
421
+ setENSName: (strategyAddress: Address, label: string) => Promise<{
422
+ hash: `0x${string}`;
423
+ }>;
424
+ };
425
+
426
+ type ENSNameData = {
427
+ owner: Address;
428
+ expiry: bigint;
429
+ };
430
+ type ChainDeployments$2 = {
431
+ ForeverSubnameRegistrar: {
432
+ abi: unknown;
433
+ address?: string;
434
+ };
435
+ PublicResolver: {
436
+ abi: unknown;
437
+ address: string;
438
+ };
439
+ ReverseRegistrar: {
440
+ abi: unknown;
441
+ address: string;
442
+ };
443
+ };
444
+ declare function createENSMethods(wallet: WalletClient | undefined, publicClient: PublicClient, chainId: SupportedChainId, deployments: ChainDeployments$2): {
445
+ /**
446
+ * Check if a subdomain label is available for registration
447
+ * Works on any network where ForeverSubnameRegistrar is deployed
448
+ */
449
+ available: (label: string) => Promise<boolean>;
450
+ /**
451
+ * Register a subdomain via ForeverSubnameRegistrar
452
+ * Works on any network where ForeverSubnameRegistrar is deployed
453
+ */
454
+ register: (label: string, owner?: Address) => Promise<{
455
+ label: string;
456
+ owner: Address;
457
+ node: `0x${string}`;
458
+ }>;
459
+ /**
460
+ * Get the address record for an ENS name (forward resolution)
461
+ * @param name Full ENS name (e.g., "mystrategy.support.eth" - see ENS_DOMAIN config)
462
+ * @returns The resolved address or null if not set
463
+ */
464
+ getAddress: (name: string) => Promise<Address | null>;
465
+ /**
466
+ * Set the address record for an ENS name (forward resolution)
467
+ * @param name Full ENS name (e.g., "mystrategy.support.eth" - see ENS_DOMAIN config)
468
+ * @param address The address the name should resolve to
469
+ */
470
+ setAddress: (name: string, address: Address) => Promise<{
471
+ hash: `0x${string}`;
472
+ }>;
473
+ /**
474
+ * Set the reverse name record for the caller's address
475
+ * This allows resolving your wallet address back to an ENS name
476
+ * Note: You can only set reverse records for addresses you control
477
+ * @param name The full ENS name (e.g., "mystrategy.support.eth" - see ENS_DOMAIN config)
478
+ */
479
+ setReverseRecord: (name: string) => Promise<{
480
+ hash: `0x${string}`;
481
+ }>;
482
+ /**
483
+ * Set the reverse name record for any address (requires authorization)
484
+ * This allows resolving an address back to its ENS name
485
+ * Note: Only works if you're authorized to set reverse records for the address
486
+ * @param addr The address to set the reverse record for
487
+ * @param name The full ENS name (e.g., "mystrategy.support.eth" - see ENS_DOMAIN config)
488
+ */
489
+ setReverseNameForAddr: (addr: Address, name: string) => Promise<{
490
+ hash: `0x${string}`;
491
+ }>;
492
+ /**
493
+ * Register a subdomain and set up full address resolution
494
+ * 1. Registers the subdomain
495
+ * 2. Sets forward resolution (name -> address)
496
+ * @param label The subdomain label (e.g., "mystrategy" for "mystrategy.support.eth" - see ENS_DOMAIN config)
497
+ * @param resolveToAddress The address the name should resolve to
498
+ * @param owner Optional owner of the ENS name (defaults to wallet address)
499
+ */
500
+ registerWithAddress: (label: string, resolveToAddress: Address, owner?: Address) => Promise<{
501
+ label: string;
502
+ owner: Address;
503
+ node: `0x${string}`;
504
+ }>;
505
+ };
506
+
507
+ type ChainDeployments$1 = {
508
+ SplitsWarehouse: {
509
+ abi: unknown;
510
+ };
511
+ };
512
+ declare function createWarehouseMethods(wallet: WalletClient | undefined, publicClient: PublicClient, chainId: SupportedChainId, deployments: ChainDeployments$1): {
513
+ /**
514
+ * Withdraw tokens from the SplitsWarehouse
515
+ * @param owner Address to withdraw for (usually msg.sender)
516
+ * @param token Token address to withdraw
517
+ */
518
+ withdraw: (owner: Address, token: Address) => Promise<{
519
+ hash: `0x${string}`;
520
+ }>;
521
+ /**
522
+ * Get warehouse balance for a user/token
523
+ * @param owner Address to check balance for
524
+ * @param token Token address
525
+ */
526
+ balanceOf: (owner: Address, token: Address) => Promise<bigint>;
527
+ };
528
+
529
+ type ChainDeployments = {
530
+ YieldRedirectorFactory: {
531
+ abi: unknown;
532
+ address: string;
533
+ };
534
+ YieldRedirector4626: {
535
+ abi: unknown;
536
+ };
537
+ };
538
+ declare function createYieldRedirectorMethods(wallet: WalletClient | undefined, publicClient: PublicClient, deployments: ChainDeployments): {
539
+ /**
540
+ * Create a new yield redirector
541
+ * @param sourceVault ERC-4626 vault address that generates yield
542
+ * @param yieldRecipient Address to receive harvested yield (typically a Strategy)
543
+ * @param owner Address that can update yield recipient
544
+ */
545
+ create: (sourceVault: Address, yieldRecipient: Address, owner: Address) => Promise<{
546
+ redirector: Address;
547
+ sourceVault: Address;
548
+ yieldRecipient: Address;
549
+ owner: Address;
550
+ }>;
551
+ /**
552
+ * Create a new yield redirector with deterministic address
553
+ * @param sourceVault ERC-4626 vault address that generates yield
554
+ * @param yieldRecipient Address to receive harvested yield (typically a Strategy)
555
+ * @param owner Address that can update yield recipient
556
+ * @param salt Bytes32 salt for deterministic address generation
557
+ */
558
+ createDeterministic: (sourceVault: Address, yieldRecipient: Address, owner: Address, salt: `0x${string}`) => Promise<{
559
+ redirector: Address;
560
+ sourceVault: Address;
561
+ yieldRecipient: Address;
562
+ owner: Address;
563
+ }>;
564
+ /**
565
+ * Harvest yield from a redirector and send to recipient
566
+ * @param redirectorAddress The yield redirector contract address
567
+ */
568
+ harvest: (redirectorAddress: Address) => Promise<{
569
+ hash: `0x${string}`;
570
+ }>;
571
+ /**
572
+ * Get the current surplus (harvestable yield) from a redirector
573
+ * @param redirectorAddress The yield redirector contract address
574
+ */
575
+ surplus: (redirectorAddress: Address) => Promise<bigint>;
576
+ /**
577
+ * Get the principal deposited in a redirector
578
+ * @param redirectorAddress The yield redirector contract address
579
+ */
580
+ principal: (redirectorAddress: Address) => Promise<bigint>;
581
+ /**
582
+ * Get the total value in the source vault (principal + yield)
583
+ * @param redirectorAddress The yield redirector contract address
584
+ */
585
+ sourceVaultValue: (redirectorAddress: Address) => Promise<bigint>;
586
+ /**
587
+ * Update the yield recipient (owner only)
588
+ * @param redirectorAddress The yield redirector contract address
589
+ * @param newRecipient New address to receive harvested yield
590
+ */
591
+ setYieldRecipient: (redirectorAddress: Address, newRecipient: Address) => Promise<{
592
+ hash: `0x${string}`;
593
+ }>;
594
+ };
595
+
596
+ /**
597
+ * Execute a transaction and extract a specific event from the logs.
598
+ */
599
+ declare function writeAndParse<T>(wallet: WalletClient, hash: `0x${string}`, abi: Abi, eventName: string): Promise<T>;
600
+ /**
601
+ * Execute a transaction without parsing events, just wait for confirmation.
602
+ */
603
+ declare function writeAndWait(wallet: WalletClient, hash: `0x${string}`): Promise<{
604
+ hash: `0x${string}`;
605
+ }>;
606
+
607
+ type CuratorProviderProps<T extends CuratorSDK> = PropsWithChildren<{
608
+ client?: WalletClient;
609
+ defaultChain?: SupportedChainId;
610
+ /** Tenant ENS name (e.g. "support.eth"). Scopes the SDK to this tenant's factory. */
611
+ tenant?: string;
612
+ /** GraphQL endpoint for the indexer (e.g. "https://...railway.app/graphql") */
613
+ indexerUrl?: string;
614
+ /** Function to upload strategy metadata and return a public URL. Use createUploadFn() for the standard implementation. */
615
+ uploadMetadata?: UploadMetadataFn;
616
+ }>;
617
+ declare function CuratorProvider<T extends CuratorSDK = CuratorSDK>({ children, client, defaultChain, tenant, indexerUrl, uploadMetadata, }: CuratorProviderProps<T>): React.ReactNode;
618
+ declare function useCuratorSDK<T extends CuratorSDK = CuratorSDK>(): {
619
+ sdk: T | null;
620
+ };
621
+
622
+ declare const INVALIDATION_TIMEOUT_MS = 3000;
623
+ declare const ENS_INVALIDATION_TIMEOUT_MS = 1000;
624
+ declare function useInvalidate(): (queryKeys: unknown[][]) => void;
625
+ /**
626
+ * Invalidate all ENS-related queries (both custom and wagmi's)
627
+ */
628
+ declare function useInvalidateENS(): () => void;
629
+
630
+ type QueryOptions$4 = {
631
+ enabled?: boolean;
632
+ refetchInterval?: number;
633
+ };
634
+ /**
635
+ * Resolve an ENS name to an address (forward resolution)
636
+ * Uses the SDK's configured public client with local ENS support
637
+ */
638
+ declare function useENSGetAddress(name: string, opts?: QueryOptions$4): UseQueryResult<Address | null>;
639
+ /**
640
+ * Check if a subdomain label is available for registration
641
+ * Works on any network where ForeverSubnameRegistrar is deployed
642
+ */
643
+ declare function useENSAvailable(label: string, opts?: QueryOptions$4): UseQueryResult<boolean | null>;
644
+
645
+ type QueryOptions$3 = {
646
+ enabled?: boolean;
647
+ refetchInterval?: number;
648
+ };
649
+ declare function useStrategyData(strategyAddress: Address | undefined, opts?: QueryOptions$3): UseQueryResult<StrategyData | null>;
650
+ declare function useStrategyBalance(strategyAddress: Address | undefined, token: Address | undefined, opts?: QueryOptions$3): UseQueryResult<bigint | null>;
651
+ declare function useCreateStrategy(opts?: UseMutationOptions<{
652
+ strategy: Address;
653
+ config: StrategyConfig;
654
+ }, Error, StrategyConfig>): _tanstack_react_query.UseMutationResult<{
655
+ strategy: Address;
656
+ config: StrategyConfig;
657
+ }, Error, StrategyConfig, unknown>;
658
+ declare function useRebalanceStrategy(opts?: UseMutationOptions<{
659
+ hash: `0x${string}`;
660
+ }, Error, {
661
+ strategyAddress: Address;
662
+ allocations: Allocation[];
663
+ metadata: StrategyMetadata;
664
+ }>): _tanstack_react_query.UseMutationResult<{
665
+ hash: `0x${string}`;
666
+ }, Error, {
667
+ strategyAddress: Address;
668
+ allocations: Allocation[];
669
+ metadata: StrategyMetadata;
670
+ }, unknown>;
671
+ declare function useDistributeStrategy(opts?: UseMutationOptions<{
672
+ hash: `0x${string}`;
673
+ }, Error, {
674
+ strategyAddress: Address;
675
+ token: Address;
676
+ }>): _tanstack_react_query.UseMutationResult<{
677
+ hash: `0x${string}`;
678
+ }, Error, {
679
+ strategyAddress: Address;
680
+ token: Address;
681
+ }, unknown>;
682
+ /**
683
+ * Set ENS subdomain name for an existing strategy
684
+ */
685
+ declare function useSetENSName(opts?: UseMutationOptions<{
686
+ hash: `0x${string}`;
687
+ }, Error, {
688
+ strategyAddress: Address;
689
+ label: string;
690
+ }>): _tanstack_react_query.UseMutationResult<{
691
+ hash: `0x${string}`;
692
+ }, Error, {
693
+ strategyAddress: Address;
694
+ label: string;
695
+ }, unknown>;
696
+
697
+ type QueryOptions$2 = {
698
+ enabled?: boolean;
699
+ refetchInterval?: number;
700
+ };
701
+ declare function useWarehouseBalances(variables?: QueryVariables<WarehouseBalanceFilter>, opts?: QueryOptions$2): UseQueryResult<Page<WarehouseBalance> | null>;
702
+ declare function useWarehouseBalance(user: Address | undefined, token: Address | undefined, opts?: QueryOptions$2): UseQueryResult<WarehouseBalance | null>;
703
+ declare function useWithdrawFromWarehouse(opts?: UseMutationOptions<{
704
+ hash: `0x${string}`;
705
+ }, Error, {
706
+ owner: Address;
707
+ token: Address;
708
+ }>): _tanstack_react_query.UseMutationResult<{
709
+ hash: `0x${string}`;
710
+ }, Error, {
711
+ owner: Address;
712
+ token: Address;
713
+ }, unknown>;
714
+
715
+ type QueryOptions$1 = {
716
+ enabled?: boolean;
717
+ refetchInterval?: number;
718
+ };
719
+ declare function useYieldRedirectors(variables?: QueryVariables<YieldRedirectorFilter>, opts?: QueryOptions$1): UseQueryResult<Page<YieldRedirector> | null>;
720
+ declare function useYieldRedirectorById(id: Address | undefined, opts?: QueryOptions$1): UseQueryResult<YieldRedirector | null>;
721
+ declare function useHarvests(variables?: QueryVariables<HarvestFilter>, opts?: QueryOptions$1): UseQueryResult<Page<Harvest> | null>;
722
+ /**
723
+ * Create a new yield redirector
724
+ */
725
+ declare function useCreateYieldRedirector(opts?: UseMutationOptions<{
726
+ redirector: Address;
727
+ }, Error, {
728
+ sourceVault: Address;
729
+ yieldRecipient: Address;
730
+ owner: Address;
731
+ }>): _tanstack_react_query.UseMutationResult<{
732
+ redirector: Address;
733
+ }, Error, {
734
+ sourceVault: Address;
735
+ yieldRecipient: Address;
736
+ owner: Address;
737
+ }, unknown>;
738
+ /**
739
+ * Harvest yield from a redirector
740
+ */
741
+ declare function useHarvestYield(opts?: UseMutationOptions<{
742
+ hash: `0x${string}`;
743
+ }, Error, Address>): _tanstack_react_query.UseMutationResult<{
744
+ hash: `0x${string}`;
745
+ }, Error, `0x${string}`, unknown>;
746
+
747
+ type QueryOptions = {
748
+ enabled?: boolean;
749
+ refetchInterval?: number;
750
+ };
751
+ declare function useStrategies(variables?: QueryVariables<StrategyFilter>, opts?: QueryOptions): UseQueryResult<Page<Strategy> | null>;
752
+ declare function useStrategyById(id: Address, opts?: QueryOptions): UseQueryResult<Strategy | null>;
753
+ declare function useDistributions(variables?: QueryVariables<DistributionFilter>, opts?: QueryOptions): UseQueryResult<Page<Distribution> | null>;
754
+ declare function usePayouts(variables?: QueryVariables<PayoutFilter>, opts?: QueryOptions): UseQueryResult<Page<Payout> | null>;
755
+ declare function useDonors(variables?: QueryVariables<DonorFilter>, opts?: QueryOptions): UseQueryResult<Page<Donor> | null>;
756
+ declare function useStrategyBalances(variables?: QueryVariables<StrategyBalanceFilter>, opts?: QueryOptions): UseQueryResult<Page<StrategyBalance> | null>;
757
+ declare function useForks(variables?: QueryVariables<ForkFilter>, opts?: QueryOptions): UseQueryResult<Page<Fork> | null>;
758
+ declare function useTrendingStrategies(options?: {
759
+ period?: "24h" | "7d";
760
+ limit?: number;
761
+ }, opts?: QueryOptions): UseQueryResult<TrendingResponse | null>;
762
+ declare function useProtocolStats(opts?: QueryOptions): UseQueryResult<ProtocolStats | null>;
763
+ declare function useStrategyLineage(strategyAddress: Address | undefined, opts?: QueryOptions): UseQueryResult<StrategyLineage | null>;
764
+
765
+ type TokenConfig = {
766
+ address: Address;
767
+ symbol: string;
768
+ name: string;
769
+ decimals: number;
770
+ logoURI?: string;
771
+ };
772
+ /**
773
+ * Native ETH address per ERC-7528 standard
774
+ * Used throughout the system to represent native ETH
775
+ */
776
+ declare const NATIVE_TOKEN = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
777
+ declare const isNativeToken: (token?: string) => boolean;
778
+ /**
779
+ * Native ETH token config
780
+ */
781
+ declare const ETH_TOKEN: TokenConfig;
782
+ /**
783
+ * Get all available tokens for a chain
784
+ */
785
+ declare function getTokens(chainId: number): TokenConfig[];
786
+ /**
787
+ * Get a token by symbol for a chain
788
+ */
789
+ declare function getToken(chainId: number, symbol: string): TokenConfig | undefined;
790
+ /**
791
+ * Get a token by address for a chain
792
+ */
793
+ declare function getTokenByAddress(chainId: number, address: Address): TokenConfig | undefined;
794
+ /**
795
+ * Get token addresses for a chain (useful for indexer)
796
+ */
797
+ declare function getTokenAddresses(chainId: number): Address[];
798
+
799
+ type VaultConfig = {
800
+ address: Address;
801
+ name: string;
802
+ symbol: string;
803
+ asset: Address;
804
+ };
805
+ /**
806
+ * Get all available vaults for a chain
807
+ */
808
+ declare function getVaults(chainId: number): VaultConfig[];
809
+ /**
810
+ * Get a vault by address for a chain
811
+ */
812
+ declare function getVaultByAddress(chainId: number, address: Address): VaultConfig | undefined;
813
+ /**
814
+ * Get vault addresses for a chain
815
+ */
816
+ declare function getVaultAddresses(chainId: number): Address[];
817
+
818
+ /**
819
+ * Creates an upload function for use with CuratorSDKOptions.uploadMetadata.
820
+ * Posts metadata JSON to the given URL with a Bearer token.
821
+ */
822
+ declare function createUploadFn(url: string, token: string): UploadMetadataFn;
823
+
824
+ type CuratorSDKOptions = {
825
+ chain?: SupportedChainId;
826
+ tenant?: string;
827
+ /** GraphQL endpoint for the indexer (e.g. "https://...railway.app/graphql") */
828
+ indexerUrl?: string;
829
+ /** Function to upload strategy metadata and return a public URL. Use createUploadFn() for the standard implementation. */
830
+ uploadMetadata?: UploadMetadataFn;
831
+ };
832
+ declare class CuratorSDK {
833
+ #private;
834
+ ens: ReturnType<typeof createENSMethods>;
835
+ strategy: ReturnType<typeof createStrategyMethods>;
836
+ warehouse: ReturnType<typeof createWarehouseMethods>;
837
+ yieldRedirector: ReturnType<typeof createYieldRedirectorMethods>;
838
+ constructor(wallet?: WalletClient, options?: CuratorSDKOptions | SupportedChainId);
839
+ get wallet(): WalletClient | undefined;
840
+ get publicClient(): PublicClient;
841
+ get chainId(): SupportedChainId;
842
+ get tenant(): string | undefined;
843
+ get indexer(): Indexer | null;
844
+ }
845
+
846
+ export { type Allocation, CuratorProvider, CuratorSDK, type CuratorSDKOptions, type Distribution, type DistributionFilter, type Donor, type DonorFilter, type ENSNameData, ENS_DOMAIN, ENS_INVALIDATION_TIMEOUT_MS, ETH_TOKEN, type Fork, type ForkFilter, type Harvest, type HarvestFilter, INVALIDATION_TIMEOUT_MS, type Indexer, type IndexerExtension, type LineageResponse, NATIVE_TOKEN, type Page, type Payout, type PayoutFilter, type ProtocolStats, type QueryVariables, type StatsResponse, type Strategy, type StrategyBalance, type StrategyBalanceFilter, type StrategyConfig, type StrategyData, type StrategyFilter, type StrategyLineage, type StrategyMetadata, type SupportedChainId, type TenantConfig, type TokenConfig, type TokenTotals, type Transfer, type TransferFilter, type TrendingResponse, type TrendingStrategy, type UploadMetadataFn, type VaultConfig, type WarehouseBalance, type WarehouseBalanceFilter, type YieldRedirector, type YieldRedirectorFilter, config, createIndexer, createUploadFn, getAllFactoryAddresses, getFactoryTenantMap, getTenantConfig, getToken, getTokenAddresses, getTokenByAddress, getTokens, getVaultAddresses, getVaultByAddress, getVaults, isNativeToken, tenants, useCreateStrategy, useCreateYieldRedirector, useCuratorSDK, useDistributeStrategy, useDistributions, useDonors, useENSAvailable, useENSGetAddress, useForks, useHarvestYield, useHarvests, useInvalidate, useInvalidateENS, usePayouts, useProtocolStats, useRebalanceStrategy, useSetENSName, useStrategies, useStrategyBalance, useStrategyBalances, useStrategyById, useStrategyData, useStrategyLineage, useTrendingStrategies, useWarehouseBalance, useWarehouseBalances, useWithdrawFromWarehouse, useYieldRedirectorById, useYieldRedirectors, writeAndParse, writeAndWait };