@obelyzk/sdk 0.5.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,1367 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { N as Network, U as HttpConfig, _ as ContractConfig, B as BitSageClient, H as HttpClient, I as ContractClient, aa as ContractRegistry, ac as MiningClient, ae as DashboardClient, ag as BatchClient, aj as PaymentsClient, al as StakingClient, as as WorkersClient, ax as GovernanceClient, aA as StwoClient, aD as TeeClient, av as PrivacyClient, E as ECPoint, bk as PrivacyAsset, bl as PrivateAccount, d as EncryptedBalance, W as WsConfig, a as WebSocketClient, V as JobUpdateEvent, X as WorkerUpdateEvent, Y as NetworkStatsEvent, Z as ProofVerifiedEvent, r as SubmitJobResponse, q as SubmitJobRequest, s as JobStatusResponse, L as ListJobsParams, u as ListJobsResponse, t as JobResult, i as JobStatus, cU as GpuTier, cl as RewardResult, ci as WorkerMiningStats, cj as MiningPoolStatus, cg as StakeTier, cV as StakeInfo, b5 as StakingConfig, b1 as WorkerTier, b8 as WorkerTierBenefits, b9 as UnstakeRequest, cW as WorkerInfo, bd as WorkerProfile, bf as LeaderboardMetric, bg as LeaderboardEntry, bh as RegisterWorkerParams, be as PerformanceData, P as PrivacyKeyPair, bw as StealthAddress, bB as GovernanceProposal, bN as CreateProposalParams, bO as VoteDirection, bC as GovernanceRights, bD as GovernanceStats, bE as PoolBalances, bF as VestingStatus, aH as ValidatorStatusResponse, aJ as GpuMetricsResponse, aK as RewardsInfo, aL as HistoryPeriod, aM as RewardHistoryEntry, aO as JobAnalytics, aP as RecentJob, cX as NetworkStats, aQ as WorkerSummary } from '../tee-CiR0hpfm.mjs';
3
+
4
+ /**
5
+ * BitSage Provider
6
+ * Main context provider for BitSage SDK in React applications
7
+ */
8
+
9
+ /**
10
+ * Wallet configuration for signing transactions
11
+ */
12
+ interface WalletConfig {
13
+ /** Account address */
14
+ address: string;
15
+ /** Private key for signing (or use external signer) */
16
+ privateKey?: string;
17
+ }
18
+ /**
19
+ * BitSage SDK context value
20
+ */
21
+ interface BitSageContextValue {
22
+ /** Main BitSage client */
23
+ client: BitSageClient;
24
+ /** HTTP client for API calls */
25
+ http: HttpClient;
26
+ /** Contract client for on-chain interactions */
27
+ contract: ContractClient;
28
+ /** Contract addresses for current network */
29
+ contracts: ContractRegistry;
30
+ /** Current network */
31
+ network: Network;
32
+ /** Whether wallet is connected */
33
+ isConnected: boolean;
34
+ /** Connected wallet address */
35
+ address: string | null;
36
+ /** Connect wallet */
37
+ connect: (wallet: WalletConfig) => void;
38
+ /** Disconnect wallet */
39
+ disconnect: () => void;
40
+ mining: MiningClient;
41
+ dashboard: DashboardClient;
42
+ batch: BatchClient;
43
+ payments: PaymentsClient;
44
+ staking: StakingClient;
45
+ workers: WorkersClient;
46
+ governance: GovernanceClient;
47
+ stwo: StwoClient;
48
+ tee: TeeClient;
49
+ }
50
+ /**
51
+ * BitSage Provider props
52
+ */
53
+ interface BitSageProviderProps {
54
+ /** Child components */
55
+ children: ReactNode;
56
+ /** Network to connect to */
57
+ network?: Network;
58
+ /** API base URL override */
59
+ apiUrl?: string;
60
+ /** RPC URL override */
61
+ rpcUrl?: string;
62
+ /** Initial wallet configuration */
63
+ wallet?: WalletConfig;
64
+ /** HTTP client config overrides */
65
+ httpConfig?: Partial<HttpConfig>;
66
+ /** Contract client config overrides */
67
+ contractConfig?: Partial<ContractConfig>;
68
+ }
69
+ declare const BitSageContext: React.Context<BitSageContextValue | undefined>;
70
+ /**
71
+ * BitSage Provider Component
72
+ *
73
+ * Provides SDK context to React application including:
74
+ * - Main BitSage client
75
+ * - Module-specific clients (mining, staking, etc.)
76
+ * - Wallet connection management
77
+ * - Network configuration
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * import { BitSageProvider } from '@bitsage/sdk/react';
82
+ *
83
+ * function App() {
84
+ * return (
85
+ * <BitSageProvider network="sepolia">
86
+ * <MyComponent />
87
+ * </BitSageProvider>
88
+ * );
89
+ * }
90
+ * ```
91
+ */
92
+ declare function BitSageProvider({ children, network, apiUrl, rpcUrl, wallet: initialWallet, httpConfig, contractConfig, }: BitSageProviderProps): JSX.Element;
93
+ /**
94
+ * Hook to access BitSage SDK context
95
+ *
96
+ * @throws Error if used outside of BitSageProvider
97
+ *
98
+ * @example
99
+ * ```tsx
100
+ * function MyComponent() {
101
+ * const { client, isConnected, connect } = useBitSage();
102
+ *
103
+ * if (!isConnected) {
104
+ * return <button onClick={() => connect({ address: '0x...' })}>Connect</button>;
105
+ * }
106
+ *
107
+ * return <div>Connected!</div>;
108
+ * }
109
+ * ```
110
+ */
111
+ declare function useBitSage(): BitSageContextValue;
112
+ /**
113
+ * Hook to access the main BitSage client
114
+ */
115
+ declare function useBitSageClient(): BitSageClient;
116
+ /**
117
+ * Hook to access wallet connection state
118
+ */
119
+ declare function useWallet(): {
120
+ isConnected: boolean;
121
+ address: string | null;
122
+ connect: (wallet: WalletConfig) => void;
123
+ disconnect: () => void;
124
+ };
125
+ /**
126
+ * Hook to access current network
127
+ */
128
+ declare function useNetwork(): Network;
129
+ /**
130
+ * Hook to access contract addresses
131
+ */
132
+ declare function useContracts(): ContractRegistry;
133
+
134
+ /**
135
+ * Privacy Provider
136
+ * Context provider for Obelysk privacy features
137
+ */
138
+
139
+ /**
140
+ * Privacy context value
141
+ */
142
+ interface PrivacyContextValue {
143
+ /** Privacy client instance */
144
+ privacy: PrivacyClient | null;
145
+ /** Whether privacy keys are loaded */
146
+ hasKeys: boolean;
147
+ /** Public key (if loaded) */
148
+ publicKey: ECPoint | null;
149
+ /** Whether privacy is initializing */
150
+ isInitializing: boolean;
151
+ /** Error message if initialization failed */
152
+ error: string | null;
153
+ /** Generate new privacy keys */
154
+ generateKeys: () => Promise<void>;
155
+ /** Derive keys from wallet signature */
156
+ deriveKeysFromWallet: (signature: string) => Promise<void>;
157
+ /** Load keys from encrypted storage */
158
+ loadKeys: (password: string) => Promise<boolean>;
159
+ /** Store keys to encrypted storage */
160
+ storeKeys: (password: string) => Promise<void>;
161
+ /** Clear loaded keys */
162
+ clearKeys: () => void;
163
+ /** Get decrypted balance for current account */
164
+ getDecryptedBalance: (asset?: PrivacyAsset) => Promise<bigint | null>;
165
+ /** Refresh balances */
166
+ refreshBalances: () => Promise<void>;
167
+ /** Private account info */
168
+ account: PrivateAccount | null;
169
+ /** Encrypted balances by asset */
170
+ balances: Map<PrivacyAsset, EncryptedBalance>;
171
+ }
172
+ /**
173
+ * Privacy Provider props
174
+ */
175
+ interface PrivacyProviderProps {
176
+ /** Child components */
177
+ children: ReactNode;
178
+ /** Auto-load keys from storage on mount */
179
+ autoLoad?: boolean;
180
+ /** Storage key prefix */
181
+ storagePrefix?: string;
182
+ }
183
+ declare const PrivacyContext: React.Context<PrivacyContextValue | undefined>;
184
+ /**
185
+ * Privacy Provider Component
186
+ *
187
+ * Provides privacy key management and encrypted balance operations.
188
+ * Must be used within a BitSageProvider.
189
+ *
190
+ * @example
191
+ * ```tsx
192
+ * import { BitSageProvider, PrivacyProvider } from '@bitsage/sdk/react';
193
+ *
194
+ * function App() {
195
+ * return (
196
+ * <BitSageProvider network="sepolia">
197
+ * <PrivacyProvider>
198
+ * <PrivacyWallet />
199
+ * </PrivacyProvider>
200
+ * </BitSageProvider>
201
+ * );
202
+ * }
203
+ * ```
204
+ */
205
+ declare function PrivacyProvider({ children, autoLoad, storagePrefix, }: PrivacyProviderProps): JSX.Element;
206
+ /**
207
+ * Hook to access privacy context
208
+ *
209
+ * @throws Error if used outside of PrivacyProvider
210
+ */
211
+ declare function usePrivacy(): PrivacyContextValue;
212
+ /**
213
+ * Hook to check if privacy keys are available
214
+ */
215
+ declare function usePrivacyKeys(): {
216
+ hasKeys: boolean;
217
+ publicKey: ECPoint | null;
218
+ generateKeys: () => Promise<void>;
219
+ deriveKeysFromWallet: (signature: string) => Promise<void>;
220
+ clearKeys: () => void;
221
+ };
222
+ /**
223
+ * Hook to access privacy client (if keys are loaded)
224
+ */
225
+ declare function usePrivacyClient(): PrivacyClient | null;
226
+
227
+ /**
228
+ * WebSocket Provider
229
+ * Context provider for real-time updates via WebSocket
230
+ */
231
+
232
+ /**
233
+ * Connection state
234
+ */
235
+ type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
236
+ /**
237
+ * WebSocket context value
238
+ */
239
+ interface WebSocketContextValue {
240
+ /** WebSocket client instance */
241
+ ws: WebSocketClient | null;
242
+ /** Current connection state */
243
+ connectionState: ConnectionState;
244
+ /** Whether connected */
245
+ isConnected: boolean;
246
+ /** Last error message */
247
+ error: string | null;
248
+ /** Reconnect attempt count */
249
+ reconnectAttempts: number;
250
+ /** Connect to WebSocket server */
251
+ connect: () => Promise<void>;
252
+ /** Disconnect from WebSocket server */
253
+ disconnect: () => void;
254
+ /** Force reconnect */
255
+ reconnect: () => Promise<void>;
256
+ /** Subscribe to job updates */
257
+ subscribeToJob: (jobId: string, callback: (event: JobUpdateEvent) => void) => () => void;
258
+ /** Subscribe to worker updates */
259
+ subscribeToWorker: (workerId: string, callback: (event: WorkerUpdateEvent) => void) => () => void;
260
+ /** Subscribe to network stats */
261
+ subscribeToNetworkStats: (callback: (event: NetworkStatsEvent) => void) => () => void;
262
+ /** Subscribe to proof verification events */
263
+ subscribeToProofVerified: (proofHash: string, callback: (event: ProofVerifiedEvent) => void) => () => void;
264
+ /** Latest network stats event */
265
+ latestNetworkStats: NetworkStatsEvent | null;
266
+ }
267
+ /**
268
+ * WebSocket Provider props
269
+ */
270
+ interface WebSocketProviderProps {
271
+ /** Child components */
272
+ children: ReactNode;
273
+ /** WebSocket URL override */
274
+ url?: string;
275
+ /** Auto-connect on mount */
276
+ autoConnect?: boolean;
277
+ /** WebSocket configuration */
278
+ config?: Partial<WsConfig>;
279
+ }
280
+ declare const WebSocketContext: React.Context<WebSocketContextValue | undefined>;
281
+ /**
282
+ * WebSocket Provider Component
283
+ *
284
+ * Provides real-time WebSocket connection for:
285
+ * - Job status updates
286
+ * - Worker status updates
287
+ * - Network statistics
288
+ * - Proof verification events
289
+ *
290
+ * @example
291
+ * ```tsx
292
+ * import { BitSageProvider, WebSocketProvider } from '@bitsage/sdk/react';
293
+ *
294
+ * function App() {
295
+ * return (
296
+ * <BitSageProvider network="sepolia">
297
+ * <WebSocketProvider autoConnect>
298
+ * <Dashboard />
299
+ * </WebSocketProvider>
300
+ * </BitSageProvider>
301
+ * );
302
+ * }
303
+ * ```
304
+ */
305
+ declare function WebSocketProvider({ children, url, autoConnect, config, }: WebSocketProviderProps): JSX.Element;
306
+ /**
307
+ * Hook to access WebSocket context
308
+ *
309
+ * @throws Error if used outside of WebSocketProvider
310
+ */
311
+ declare function useWebSocket(): WebSocketContextValue;
312
+ /**
313
+ * Hook to get WebSocket connection state
314
+ */
315
+ declare function useWebSocketConnection(): {
316
+ connectionState: ConnectionState;
317
+ isConnected: boolean;
318
+ error: string | null;
319
+ connect: () => Promise<void>;
320
+ disconnect: () => void;
321
+ reconnect: () => Promise<void>;
322
+ };
323
+
324
+ /**
325
+ * Job Hooks
326
+ * React hooks for job operations
327
+ */
328
+
329
+ /**
330
+ * Mutation state for async operations
331
+ */
332
+ interface MutationState$4<T> {
333
+ data: T | null;
334
+ isLoading: boolean;
335
+ error: Error | null;
336
+ }
337
+ /**
338
+ * Query state for data fetching
339
+ */
340
+ interface QueryState$6<T> {
341
+ data: T | null;
342
+ isLoading: boolean;
343
+ error: Error | null;
344
+ refetch: () => Promise<void>;
345
+ }
346
+ /**
347
+ * Hook to submit a job
348
+ *
349
+ * @example
350
+ * ```tsx
351
+ * function SubmitJobForm() {
352
+ * const { submit, isLoading, data, error } = useSubmitJob();
353
+ *
354
+ * const handleSubmit = async () => {
355
+ * await submit({
356
+ * job_type: { type: 'ai_inference', model_type: 'llama-7b', batch_size: 1 },
357
+ * input_data: btoa('Hello!'),
358
+ * max_cost_sage: 100n,
359
+ * max_duration_secs: 3600,
360
+ * priority: 5,
361
+ * require_tee: false,
362
+ * });
363
+ * };
364
+ *
365
+ * return (
366
+ * <div>
367
+ * <button onClick={handleSubmit} disabled={isLoading}>
368
+ * {isLoading ? 'Submitting...' : 'Submit Job'}
369
+ * </button>
370
+ * {data && <p>Job ID: {data.job_id}</p>}
371
+ * {error && <p>Error: {error.message}</p>}
372
+ * </div>
373
+ * );
374
+ * }
375
+ * ```
376
+ */
377
+ declare function useSubmitJob(): MutationState$4<SubmitJobResponse> & {
378
+ submit: (request: SubmitJobRequest) => Promise<SubmitJobResponse>;
379
+ reset: () => void;
380
+ };
381
+ /**
382
+ * Hook to get job status
383
+ *
384
+ * @param jobId - Job ID to query
385
+ * @param options - Query options
386
+ *
387
+ * @example
388
+ * ```tsx
389
+ * function JobStatus({ jobId }: { jobId: string }) {
390
+ * const { data, isLoading, error, refetch } = useJobStatus(jobId);
391
+ *
392
+ * if (isLoading) return <p>Loading...</p>;
393
+ * if (error) return <p>Error: {error.message}</p>;
394
+ * if (!data) return <p>No job found</p>;
395
+ *
396
+ * return (
397
+ * <div>
398
+ * <p>Status: {data.status}</p>
399
+ * <p>Worker: {data.worker_id || 'Pending'}</p>
400
+ * <button onClick={refetch}>Refresh</button>
401
+ * </div>
402
+ * );
403
+ * }
404
+ * ```
405
+ */
406
+ declare function useJobStatus(jobId: string | undefined, options?: {
407
+ /** Polling interval in ms (0 to disable) */
408
+ pollingInterval?: number;
409
+ /** Whether to start fetching immediately */
410
+ enabled?: boolean;
411
+ }): QueryState$6<JobStatusResponse>;
412
+ /**
413
+ * Hook to list jobs
414
+ *
415
+ * @param params - List parameters
416
+ *
417
+ * @example
418
+ * ```tsx
419
+ * function JobList() {
420
+ * const { data, isLoading, refetch } = useJobs({
421
+ * status: 'completed',
422
+ * limit: 10,
423
+ * });
424
+ *
425
+ * if (isLoading) return <p>Loading...</p>;
426
+ *
427
+ * return (
428
+ * <ul>
429
+ * {data?.jobs.map((job) => (
430
+ * <li key={job.job_id}>{job.job_id} - {job.status}</li>
431
+ * ))}
432
+ * </ul>
433
+ * );
434
+ * }
435
+ * ```
436
+ */
437
+ declare function useJobs(params?: ListJobsParams): QueryState$6<ListJobsResponse>;
438
+ /**
439
+ * Hook to wait for job completion
440
+ *
441
+ * @param jobId - Job ID to wait for
442
+ * @param options - Wait options
443
+ *
444
+ * @example
445
+ * ```tsx
446
+ * function JobWaiter({ jobId }: { jobId: string }) {
447
+ * const { result, isWaiting, error, start, cancel } = useWaitForJob(jobId);
448
+ *
449
+ * return (
450
+ * <div>
451
+ * {isWaiting ? (
452
+ * <button onClick={cancel}>Cancel</button>
453
+ * ) : (
454
+ * <button onClick={start}>Start Waiting</button>
455
+ * )}
456
+ * {result && <pre>{JSON.stringify(result, null, 2)}</pre>}
457
+ * </div>
458
+ * );
459
+ * }
460
+ * ```
461
+ */
462
+ declare function useWaitForJob(jobId: string | undefined, options?: {
463
+ /** Polling interval in ms */
464
+ pollInterval?: number;
465
+ /** Timeout in ms */
466
+ timeout?: number;
467
+ /** Auto-start waiting */
468
+ autoStart?: boolean;
469
+ }): {
470
+ result: JobResult | null;
471
+ status: JobStatus | null;
472
+ isWaiting: boolean;
473
+ error: Error | null;
474
+ start: () => void;
475
+ cancel: () => void;
476
+ };
477
+ /**
478
+ * Hook to cancel a job
479
+ *
480
+ * @example
481
+ * ```tsx
482
+ * function CancelButton({ jobId }: { jobId: string }) {
483
+ * const { cancel, isLoading, error } = useCancelJob();
484
+ *
485
+ * return (
486
+ * <button onClick={() => cancel(jobId)} disabled={isLoading}>
487
+ * {isLoading ? 'Cancelling...' : 'Cancel Job'}
488
+ * </button>
489
+ * );
490
+ * }
491
+ * ```
492
+ */
493
+ declare function useCancelJob(): MutationState$4<void> & {
494
+ cancel: (jobId: string) => Promise<void>;
495
+ };
496
+ /**
497
+ * Hook to get job result
498
+ *
499
+ * @param jobId - Job ID to get result for
500
+ *
501
+ * @example
502
+ * ```tsx
503
+ * function JobResult({ jobId }: { jobId: string }) {
504
+ * const { data, isLoading, error } = useJobResult(jobId);
505
+ *
506
+ * if (isLoading) return <p>Loading...</p>;
507
+ * if (error) return <p>Error: {error.message}</p>;
508
+ * if (!data) return <p>No result yet</p>;
509
+ *
510
+ * return <pre>{atob(data.output_data)}</pre>;
511
+ * }
512
+ * ```
513
+ */
514
+ declare function useJobResult(jobId: string | undefined): QueryState$6<JobResult>;
515
+
516
+ /**
517
+ * Mining Hooks
518
+ * React hooks for mining and rewards operations
519
+ */
520
+
521
+ /**
522
+ * Query state for data fetching
523
+ */
524
+ interface QueryState$5<T> {
525
+ data: T | null;
526
+ isLoading: boolean;
527
+ error: Error | null;
528
+ refetch: () => Promise<void>;
529
+ }
530
+ /**
531
+ * Hook to get mining reward estimate
532
+ *
533
+ * @param gpuTier - GPU tier to estimate rewards for
534
+ *
535
+ * @example
536
+ * ```tsx
537
+ * function RewardEstimate() {
538
+ * const { data, isLoading } = useMiningRewardEstimate('DataCenter');
539
+ *
540
+ * if (isLoading) return <p>Loading...</p>;
541
+ *
542
+ * return (
543
+ * <div>
544
+ * <p>Estimated reward: {data?.amount.toString()} SAGE</p>
545
+ * {data?.capped && <p>Daily cap reached!</p>}
546
+ * </div>
547
+ * );
548
+ * }
549
+ * ```
550
+ */
551
+ declare function useMiningRewardEstimate(gpuTier: GpuTier | undefined): QueryState$5<RewardResult>;
552
+ /**
553
+ * Hook to get worker mining stats
554
+ *
555
+ * @param workerId - Worker ID to get stats for
556
+ *
557
+ * @example
558
+ * ```tsx
559
+ * function WorkerStats({ workerId }: { workerId: string }) {
560
+ * const { data, isLoading } = useWorkerMiningStats(workerId);
561
+ *
562
+ * return (
563
+ * <div>
564
+ * <p>Total jobs: {data?.total_jobs.toString()}</p>
565
+ * <p>Total earned: {data?.total_earned.toString()} SAGE</p>
566
+ * </div>
567
+ * );
568
+ * }
569
+ * ```
570
+ */
571
+ declare function useWorkerMiningStats(workerId: string | undefined): QueryState$5<WorkerMiningStats>;
572
+ /**
573
+ * Hook to get mining pool status
574
+ *
575
+ * @example
576
+ * ```tsx
577
+ * function PoolStatus() {
578
+ * const { data, isLoading, refetch } = useMiningPoolStatus();
579
+ *
580
+ * return (
581
+ * <div>
582
+ * <p>Total distributed: {data?.totalDistributed.toString()}</p>
583
+ * <p>Remaining pool: {data?.remainingPool.toString()}</p>
584
+ * <p>Current base reward: {data?.currentBaseReward.toString()}</p>
585
+ * <button onClick={refetch}>Refresh</button>
586
+ * </div>
587
+ * );
588
+ * }
589
+ * ```
590
+ */
591
+ declare function useMiningPoolStatus(): QueryState$5<MiningPoolStatus>;
592
+ /**
593
+ * Hook to get daily cap for a stake tier
594
+ *
595
+ * @param stakeTier - Stake tier to get cap for
596
+ *
597
+ * @example
598
+ * ```tsx
599
+ * function DailyCap({ tier }: { tier: StakeTier }) {
600
+ * const { data, isLoading } = useDailyCap(tier);
601
+ *
602
+ * return <p>Daily cap: {data?.toString() || 'Loading...'}</p>;
603
+ * }
604
+ * ```
605
+ */
606
+ declare function useDailyCap(stakeTier: StakeTier | undefined): QueryState$5<bigint>;
607
+ /**
608
+ * Hook to get current base reward
609
+ *
610
+ * @example
611
+ * ```tsx
612
+ * function BaseReward() {
613
+ * const { data, isLoading } = useCurrentBaseReward();
614
+ *
615
+ * return <p>Base reward: {data?.toString() || 'Loading...'} SAGE</p>;
616
+ * }
617
+ * ```
618
+ */
619
+ declare function useCurrentBaseReward(): QueryState$5<bigint>;
620
+ /**
621
+ * Hook to get GPU multiplier
622
+ *
623
+ * @param gpuTier - GPU tier to get multiplier for
624
+ *
625
+ * @example
626
+ * ```tsx
627
+ * function GpuMultiplier({ tier }: { tier: GpuTier }) {
628
+ * const { data } = useGpuMultiplier(tier);
629
+ *
630
+ * return <p>Multiplier: {data?.toFixed(2) || '1.00'}x</p>;
631
+ * }
632
+ * ```
633
+ */
634
+ declare function useGpuMultiplier(gpuTier: GpuTier | undefined): QueryState$5<number>;
635
+ /**
636
+ * Hook to get remaining daily cap for a worker
637
+ *
638
+ * @param workerAddress - Worker address
639
+ *
640
+ * @example
641
+ * ```tsx
642
+ * function RemainingCap({ address }: { address: string }) {
643
+ * const { data, isLoading } = useRemainingDailyCap(address);
644
+ *
645
+ * return <p>Remaining today: {data?.toString() || '...'} SAGE</p>;
646
+ * }
647
+ * ```
648
+ */
649
+ declare function useRemainingDailyCap(workerAddress: string | undefined): QueryState$5<bigint>;
650
+ /**
651
+ * Combined hook for mining overview
652
+ *
653
+ * @param workerId - Optional worker ID for worker-specific stats
654
+ *
655
+ * @example
656
+ * ```tsx
657
+ * function MiningOverview({ workerId }: { workerId?: string }) {
658
+ * const { poolStatus, workerStats, baseReward, isLoading } = useMiningOverview(workerId);
659
+ *
660
+ * return (
661
+ * <div>
662
+ * <p>Pool remaining: {poolStatus?.remainingPool.toString()}</p>
663
+ * <p>Base reward: {baseReward?.toString()}</p>
664
+ * {workerStats && <p>Your earnings: {workerStats.total_earned.toString()}</p>}
665
+ * </div>
666
+ * );
667
+ * }
668
+ * ```
669
+ */
670
+ declare function useMiningOverview(workerId?: string): {
671
+ poolStatus: MiningPoolStatus | null;
672
+ workerStats: WorkerMiningStats | null;
673
+ baseReward: bigint | null;
674
+ isLoading: boolean;
675
+ error: Error | null;
676
+ refetch: () => Promise<void>;
677
+ };
678
+
679
+ /**
680
+ * Staking Hooks
681
+ * React hooks for staking operations
682
+ */
683
+
684
+ /**
685
+ * Query state for data fetching
686
+ */
687
+ interface QueryState$4<T> {
688
+ data: T | null;
689
+ isLoading: boolean;
690
+ error: Error | null;
691
+ refetch: () => Promise<void>;
692
+ }
693
+ /**
694
+ * Mutation state for async operations
695
+ */
696
+ interface MutationState$3<T> {
697
+ data: T | null;
698
+ isLoading: boolean;
699
+ error: Error | null;
700
+ }
701
+ /**
702
+ * Transaction result
703
+ */
704
+ interface TxResult$3 {
705
+ transaction_hash: string;
706
+ status: 'pending' | 'accepted' | 'rejected';
707
+ }
708
+ /**
709
+ * Hook to get stake info for an address
710
+ *
711
+ * @param address - Address to get stake info for
712
+ *
713
+ * @example
714
+ * ```tsx
715
+ * function StakeInfo({ address }: { address: string }) {
716
+ * const { data, isLoading } = useStakeInfo(address);
717
+ *
718
+ * return (
719
+ * <div>
720
+ * <p>Staked: {data?.amount.toString()} SAGE</p>
721
+ * <p>GPU Tier: {data?.gpu_tier}</p>
722
+ * <p>Active: {data?.is_active ? 'Yes' : 'No'}</p>
723
+ * </div>
724
+ * );
725
+ * }
726
+ * ```
727
+ */
728
+ declare function useStakeInfo(address: string | undefined): QueryState$4<StakeInfo>;
729
+ /**
730
+ * Hook to stake tokens
731
+ *
732
+ * @example
733
+ * ```tsx
734
+ * function StakeForm() {
735
+ * const { stake, isLoading, error } = useStake();
736
+ *
737
+ * const handleStake = async () => {
738
+ * await stake(1000n * 10n ** 18n, 'DataCenter');
739
+ * };
740
+ *
741
+ * return (
742
+ * <button onClick={handleStake} disabled={isLoading}>
743
+ * {isLoading ? 'Staking...' : 'Stake 1000 SAGE'}
744
+ * </button>
745
+ * );
746
+ * }
747
+ * ```
748
+ */
749
+ declare function useStake(): MutationState$3<TxResult$3> & {
750
+ stake: (amount: bigint, gpuTier: GpuTier) => Promise<TxResult$3>;
751
+ stakeWithTee: (amount: bigint, gpuTier: GpuTier, hasTee: boolean) => Promise<TxResult$3>;
752
+ };
753
+ /**
754
+ * Hook to unstake tokens
755
+ *
756
+ * @example
757
+ * ```tsx
758
+ * function UnstakeForm() {
759
+ * const { unstake, isLoading } = useUnstake();
760
+ *
761
+ * return (
762
+ * <button onClick={() => unstake(500n * 10n ** 18n)} disabled={isLoading}>
763
+ * Unstake 500 SAGE
764
+ * </button>
765
+ * );
766
+ * }
767
+ * ```
768
+ */
769
+ declare function useUnstake(): MutationState$3<TxResult$3> & {
770
+ unstake: (amount: bigint) => Promise<TxResult$3>;
771
+ };
772
+ /**
773
+ * Hook to claim staking rewards
774
+ *
775
+ * @example
776
+ * ```tsx
777
+ * function ClaimButton() {
778
+ * const { claim, isLoading, data } = useClaimRewards();
779
+ *
780
+ * return (
781
+ * <div>
782
+ * <button onClick={claim} disabled={isLoading}>
783
+ * {isLoading ? 'Claiming...' : 'Claim Rewards'}
784
+ * </button>
785
+ * {data && <p>Claimed! TX: {data.transaction_hash}</p>}
786
+ * </div>
787
+ * );
788
+ * }
789
+ * ```
790
+ */
791
+ declare function useClaimRewards(): MutationState$3<TxResult$3> & {
792
+ claim: () => Promise<TxResult$3>;
793
+ };
794
+ /**
795
+ * Hook to get staking configuration
796
+ *
797
+ * @example
798
+ * ```tsx
799
+ * function StakingConfig() {
800
+ * const { data } = useStakingConfig();
801
+ *
802
+ * return (
803
+ * <div>
804
+ * <p>Min stake (Consumer): {data?.minStake.Consumer.toString()}</p>
805
+ * <p>Unstake lockup: {data?.unstakeLockupSecs}s</p>
806
+ * </div>
807
+ * );
808
+ * }
809
+ * ```
810
+ */
811
+ declare function useStakingConfig(): QueryState$4<StakingConfig>;
812
+ /**
813
+ * Hook to get worker tier
814
+ *
815
+ * @param workerAddress - Worker address
816
+ *
817
+ * @example
818
+ * ```tsx
819
+ * function WorkerTierDisplay({ address }: { address: string }) {
820
+ * const { data } = useWorkerTier(address);
821
+ *
822
+ * return <p>Worker Tier: {data || 'Loading...'}</p>;
823
+ * }
824
+ * ```
825
+ */
826
+ declare function useWorkerTier(workerAddress: string | undefined): QueryState$4<WorkerTier>;
827
+ /**
828
+ * Hook to get worker tier benefits
829
+ *
830
+ * @param tier - Worker tier
831
+ *
832
+ * @example
833
+ * ```tsx
834
+ * function TierBenefits({ tier }: { tier: WorkerTier }) {
835
+ * const { data } = useWorkerTierBenefits(tier);
836
+ *
837
+ * return (
838
+ * <div>
839
+ * <p>Fee discount: {data?.feeDiscountBps}bps</p>
840
+ * <p>Priority boost: {data?.priorityBoost}</p>
841
+ * </div>
842
+ * );
843
+ * }
844
+ * ```
845
+ */
846
+ declare function useWorkerTierBenefits(tier: WorkerTier | undefined): QueryState$4<WorkerTierBenefits>;
847
+ /**
848
+ * Hook to get minimum stake for a GPU tier
849
+ *
850
+ * @param gpuTier - GPU tier
851
+ * @param hasTee - Whether worker has TEE
852
+ * @param reputation - Worker reputation score
853
+ *
854
+ * @example
855
+ * ```tsx
856
+ * function MinStake() {
857
+ * const { data } = useMinStake('DataCenter', true, 95);
858
+ *
859
+ * return <p>Minimum stake: {data?.toString()} SAGE</p>;
860
+ * }
861
+ * ```
862
+ */
863
+ declare function useMinStake(gpuTier: GpuTier | undefined, hasTee?: boolean, reputation?: number): QueryState$4<bigint>;
864
+ /**
865
+ * Hook to get pending unstake requests
866
+ *
867
+ * @param address - Address to get requests for
868
+ *
869
+ * @example
870
+ * ```tsx
871
+ * function PendingUnstakes({ address }: { address: string }) {
872
+ * const { data, isLoading } = usePendingUnstakes(address);
873
+ *
874
+ * return (
875
+ * <ul>
876
+ * {data?.map((req) => (
877
+ * <li key={req.request_id.toString()}>
878
+ * {req.amount.toString()} SAGE - unlocks at {new Date(req.unlock_time * 1000).toLocaleString()}
879
+ * </li>
880
+ * ))}
881
+ * </ul>
882
+ * );
883
+ * }
884
+ * ```
885
+ */
886
+ declare function usePendingUnstakes(address: string | undefined): QueryState$4<UnstakeRequest[]>;
887
+ /**
888
+ * Hook to delegate stake to a worker
889
+ *
890
+ * @example
891
+ * ```tsx
892
+ * function DelegateForm() {
893
+ * const { delegate, isLoading } = useDelegateStake();
894
+ *
895
+ * return (
896
+ * <button onClick={() => delegate('0x...worker', 100n * 10n ** 18n)}>
897
+ * Delegate 100 SAGE
898
+ * </button>
899
+ * );
900
+ * }
901
+ * ```
902
+ */
903
+ declare function useDelegateStake(): MutationState$3<TxResult$3> & {
904
+ delegate: (worker: string, amount: bigint) => Promise<TxResult$3>;
905
+ };
906
+ /**
907
+ * Hook to get total staked amount
908
+ *
909
+ * @example
910
+ * ```tsx
911
+ * function TotalStaked() {
912
+ * const { data } = useTotalStaked();
913
+ *
914
+ * return <p>Total staked: {data?.toString()} SAGE</p>;
915
+ * }
916
+ * ```
917
+ */
918
+ declare function useTotalStaked(): QueryState$4<bigint>;
919
+ /**
920
+ * Combined hook for current user's staking status
921
+ *
922
+ * @example
923
+ * ```tsx
924
+ * function MyStaking() {
925
+ * const { address } = useWallet();
926
+ * const { stakeInfo, tier, pendingUnstakes, isLoading } = useMyStaking();
927
+ *
928
+ * return (
929
+ * <div>
930
+ * <p>Staked: {stakeInfo?.amount.toString()}</p>
931
+ * <p>Tier: {tier}</p>
932
+ * <p>Pending unstakes: {pendingUnstakes?.length || 0}</p>
933
+ * </div>
934
+ * );
935
+ * }
936
+ * ```
937
+ */
938
+ declare function useMyStaking(): {
939
+ stakeInfo: StakeInfo | null;
940
+ tier: WorkerTier | null;
941
+ pendingUnstakes: UnstakeRequest[] | null;
942
+ isLoading: boolean;
943
+ error: Error | null;
944
+ refetch: () => Promise<void>;
945
+ };
946
+
947
+ /**
948
+ * Worker Hooks
949
+ * React hooks for worker operations
950
+ */
951
+
952
+ interface QueryState$3<T> {
953
+ data: T | null;
954
+ isLoading: boolean;
955
+ error: Error | null;
956
+ refetch: () => Promise<void>;
957
+ }
958
+ interface MutationState$2<T> {
959
+ data: T | null;
960
+ isLoading: boolean;
961
+ error: Error | null;
962
+ }
963
+ interface TxResult$2 {
964
+ transaction_hash: string;
965
+ status: 'pending' | 'accepted' | 'rejected';
966
+ }
967
+ /**
968
+ * Hook to list all workers
969
+ */
970
+ declare function useWorkers(options?: {
971
+ pollingInterval?: number;
972
+ }): QueryState$3<WorkerInfo[]>;
973
+ /**
974
+ * Hook to get worker by ID
975
+ */
976
+ declare function useWorker(workerId: string | undefined): QueryState$3<WorkerInfo>;
977
+ /**
978
+ * Hook to get worker profile
979
+ */
980
+ declare function useWorkerProfile(workerId: string | undefined): QueryState$3<WorkerProfile>;
981
+ /**
982
+ * Hook to get worker leaderboard
983
+ */
984
+ declare function useLeaderboard(metric?: LeaderboardMetric, limit?: number): QueryState$3<LeaderboardEntry[]>;
985
+ /**
986
+ * Hook to register as a worker
987
+ */
988
+ declare function useRegisterWorker(): MutationState$2<TxResult$2> & {
989
+ register: (params: RegisterWorkerParams) => Promise<TxResult$2>;
990
+ };
991
+ /**
992
+ * Hook to submit worker heartbeat
993
+ */
994
+ declare function useHeartbeat(): MutationState$2<TxResult$2> & {
995
+ submitHeartbeat: (data: PerformanceData) => Promise<TxResult$2>;
996
+ };
997
+ /**
998
+ * Hook to get workers by capability
999
+ */
1000
+ declare function useWorkersByCapability(flags: number, minReputation?: number): QueryState$3<string[]>;
1001
+
1002
+ /**
1003
+ * Privacy Hooks
1004
+ * React hooks for privacy operations (uses PrivacyProvider)
1005
+ */
1006
+
1007
+ interface QueryState$2<T> {
1008
+ data: T | null;
1009
+ isLoading: boolean;
1010
+ error: Error | null;
1011
+ refetch: () => Promise<void>;
1012
+ }
1013
+ interface MutationState$1<T> {
1014
+ data: T | null;
1015
+ isLoading: boolean;
1016
+ error: Error | null;
1017
+ }
1018
+ interface TxResult$1 {
1019
+ transaction_hash: string;
1020
+ status: 'pending' | 'accepted' | 'rejected';
1021
+ }
1022
+ /**
1023
+ * Hook to get private account info
1024
+ */
1025
+ declare function usePrivateAccount(): QueryState$2<PrivateAccount>;
1026
+ /**
1027
+ * Hook to get decrypted private balance
1028
+ */
1029
+ declare function usePrivateBalance(asset?: PrivacyAsset): QueryState$2<bigint> & {
1030
+ encrypted: EncryptedBalance | null;
1031
+ };
1032
+ /** Transfer parameters for private transfers */
1033
+ interface PrivateTransferInput {
1034
+ to: string;
1035
+ amount: bigint;
1036
+ keys: PrivacyKeyPair;
1037
+ }
1038
+ /**
1039
+ * Hook for private transfers
1040
+ */
1041
+ declare function usePrivateTransfer(): MutationState$1<TxResult$1> & {
1042
+ transfer: (params: PrivateTransferInput) => Promise<TxResult$1>;
1043
+ };
1044
+ /**
1045
+ * Hook to register a private account
1046
+ */
1047
+ declare function useRegisterPrivateAccount(): MutationState$1<TxResult$1> & {
1048
+ register: () => Promise<TxResult$1>;
1049
+ };
1050
+ /**
1051
+ * Hook to generate stealth address
1052
+ */
1053
+ declare function useStealthAddress(): {
1054
+ generate: (recipientPublicKey: {
1055
+ x: bigint;
1056
+ y: bigint;
1057
+ }) => Promise<StealthAddress>;
1058
+ isLoading: boolean;
1059
+ error: Error | null;
1060
+ };
1061
+ /**
1062
+ * Hook to refresh all private balances
1063
+ */
1064
+ declare function useRefreshPrivateBalances(): {
1065
+ refresh: () => Promise<void>;
1066
+ isLoading: boolean;
1067
+ error: Error | null;
1068
+ };
1069
+ /**
1070
+ * Hook to get all private balances
1071
+ */
1072
+ declare function useAllPrivateBalances(): {
1073
+ balances: Map<PrivacyAsset, {
1074
+ encrypted: EncryptedBalance;
1075
+ decrypted: bigint | null;
1076
+ }>;
1077
+ isLoading: boolean;
1078
+ error: Error | null;
1079
+ refresh: () => Promise<void>;
1080
+ };
1081
+
1082
+ /**
1083
+ * Governance Hooks
1084
+ * React hooks for governance operations
1085
+ */
1086
+
1087
+ interface QueryState$1<T> {
1088
+ data: T | null;
1089
+ isLoading: boolean;
1090
+ error: Error | null;
1091
+ refetch: () => Promise<void>;
1092
+ }
1093
+ interface MutationState<T> {
1094
+ data: T | null;
1095
+ isLoading: boolean;
1096
+ error: Error | null;
1097
+ }
1098
+ interface TxResult {
1099
+ transaction_hash: string;
1100
+ status: 'pending' | 'accepted' | 'rejected';
1101
+ }
1102
+ /**
1103
+ * Hook to get a governance proposal
1104
+ */
1105
+ declare function useProposal(proposalId: bigint | undefined): QueryState$1<GovernanceProposal>;
1106
+ /**
1107
+ * Hook to list all proposals
1108
+ */
1109
+ declare function useProposals(): QueryState$1<GovernanceProposal[]>;
1110
+ /**
1111
+ * Hook to create a proposal
1112
+ */
1113
+ declare function useCreateProposal(): MutationState<TxResult> & {
1114
+ create: (params: CreateProposalParams) => Promise<TxResult>;
1115
+ };
1116
+ /**
1117
+ * Hook to vote on a proposal
1118
+ */
1119
+ declare function useVote(): MutationState<TxResult> & {
1120
+ vote: (proposalId: bigint, direction: VoteDirection) => Promise<TxResult>;
1121
+ };
1122
+ /**
1123
+ * Hook to get voting power
1124
+ */
1125
+ declare function useVotingPower(address: string | undefined): QueryState$1<bigint>;
1126
+ /**
1127
+ * Hook to get governance rights
1128
+ */
1129
+ declare function useGovernanceRights(address: string | undefined): QueryState$1<GovernanceRights>;
1130
+ /**
1131
+ * Hook to delegate voting power
1132
+ */
1133
+ declare function useDelegate(): MutationState<TxResult> & {
1134
+ delegate: (delegatee: string) => Promise<TxResult>;
1135
+ };
1136
+ /**
1137
+ * Hook to get governance stats
1138
+ */
1139
+ declare function useGovernanceStats(): QueryState$1<GovernanceStats>;
1140
+ /**
1141
+ * Hook to get pool balances (treasury, rewards, etc.)
1142
+ */
1143
+ declare function usePoolBalances(): QueryState$1<PoolBalances>;
1144
+ /**
1145
+ * Hook to get total burned tokens
1146
+ */
1147
+ declare function useTotalBurned(): QueryState$1<bigint>;
1148
+ /**
1149
+ * Hook to get vesting status
1150
+ */
1151
+ declare function useVestingStatus(): QueryState$1<VestingStatus>;
1152
+
1153
+ /**
1154
+ * Dashboard Hooks
1155
+ * React hooks for dashboard and metrics
1156
+ */
1157
+
1158
+ interface QueryState<T> {
1159
+ data: T | null;
1160
+ isLoading: boolean;
1161
+ error: Error | null;
1162
+ refetch: () => Promise<void>;
1163
+ }
1164
+ /**
1165
+ * Hook to get validator status
1166
+ */
1167
+ declare function useValidatorStatus(options?: {
1168
+ pollingInterval?: number;
1169
+ }): QueryState<ValidatorStatusResponse>;
1170
+ /**
1171
+ * Hook to get GPU metrics
1172
+ */
1173
+ declare function useGpuMetrics(options?: {
1174
+ pollingInterval?: number;
1175
+ }): QueryState<GpuMetricsResponse>;
1176
+ /**
1177
+ * Hook to get rewards info
1178
+ */
1179
+ declare function useRewardsInfo(): QueryState<RewardsInfo>;
1180
+ /**
1181
+ * Hook to get rewards history
1182
+ */
1183
+ declare function useRewardsHistory(period?: HistoryPeriod): QueryState<RewardHistoryEntry[]>;
1184
+ /**
1185
+ * Hook to get job analytics
1186
+ */
1187
+ declare function useJobAnalytics(): QueryState<JobAnalytics>;
1188
+ /**
1189
+ * Hook to get recent jobs
1190
+ */
1191
+ declare function useRecentJobs(limit?: number): QueryState<RecentJob[]>;
1192
+ /**
1193
+ * Hook to get network stats
1194
+ */
1195
+ declare function useNetworkStats(options?: {
1196
+ pollingInterval?: number;
1197
+ }): QueryState<NetworkStats>;
1198
+ /**
1199
+ * Hook to get network workers
1200
+ */
1201
+ declare function useNetworkWorkers(): QueryState<WorkerSummary[]>;
1202
+ /**
1203
+ * Combined dashboard hook for validator overview
1204
+ */
1205
+ declare function useValidatorOverview(options?: {
1206
+ pollingInterval?: number;
1207
+ }): {
1208
+ status: ValidatorStatusResponse | null;
1209
+ gpuMetrics: GpuMetricsResponse | null;
1210
+ rewards: RewardsInfo | null;
1211
+ isLoading: boolean;
1212
+ error: Error | null;
1213
+ refetch: () => Promise<void>;
1214
+ };
1215
+
1216
+ /**
1217
+ * WebSocket Hooks
1218
+ * React hooks for real-time WebSocket subscriptions
1219
+ */
1220
+
1221
+ /**
1222
+ * Hook to subscribe to job updates
1223
+ *
1224
+ * @param jobId - Job ID to subscribe to
1225
+ *
1226
+ * @example
1227
+ * ```tsx
1228
+ * function JobProgress({ jobId }: { jobId: string }) {
1229
+ * const { event, isSubscribed } = useJobUpdates(jobId);
1230
+ *
1231
+ * return (
1232
+ * <div>
1233
+ * <p>Status: {event?.status || 'Waiting...'}</p>
1234
+ * {event?.progress && <p>Progress: {event.progress}%</p>}
1235
+ * </div>
1236
+ * );
1237
+ * }
1238
+ * ```
1239
+ */
1240
+ declare function useJobUpdates(jobId: string | undefined): {
1241
+ event: JobUpdateEvent | null;
1242
+ isSubscribed: boolean;
1243
+ history: JobUpdateEvent[];
1244
+ };
1245
+ /**
1246
+ * Hook to subscribe to worker updates
1247
+ *
1248
+ * @param workerId - Worker ID to subscribe to
1249
+ *
1250
+ * @example
1251
+ * ```tsx
1252
+ * function WorkerStatus({ workerId }: { workerId: string }) {
1253
+ * const { event } = useWorkerUpdates(workerId);
1254
+ *
1255
+ * return (
1256
+ * <div>
1257
+ * <p>Online: {event?.online ? 'Yes' : 'No'}</p>
1258
+ * <p>Load: {event?.load || 0}%</p>
1259
+ * </div>
1260
+ * );
1261
+ * }
1262
+ * ```
1263
+ */
1264
+ declare function useWorkerUpdates(workerId: string | undefined): {
1265
+ event: WorkerUpdateEvent | null;
1266
+ isSubscribed: boolean;
1267
+ };
1268
+ /**
1269
+ * Hook to subscribe to network stats updates
1270
+ *
1271
+ * @example
1272
+ * ```tsx
1273
+ * function NetworkDashboard() {
1274
+ * const { stats } = useNetworkStatsStream();
1275
+ *
1276
+ * return (
1277
+ * <div>
1278
+ * <p>Active workers: {stats?.active_workers || 0}</p>
1279
+ * <p>Jobs in queue: {stats?.jobs_pending || 0}</p>
1280
+ * <p>Total FLOPS: {stats?.total_flops || '0'}</p>
1281
+ * </div>
1282
+ * );
1283
+ * }
1284
+ * ```
1285
+ */
1286
+ declare function useNetworkStatsStream(): {
1287
+ stats: NetworkStatsEvent | null;
1288
+ isSubscribed: boolean;
1289
+ };
1290
+ /**
1291
+ * Hook to subscribe to proof verification events
1292
+ *
1293
+ * @param proofHash - Proof hash to subscribe to
1294
+ *
1295
+ * @example
1296
+ * ```tsx
1297
+ * function ProofStatus({ proofHash }: { proofHash: string }) {
1298
+ * const { event, isVerified } = useProofVerified(proofHash);
1299
+ *
1300
+ * return (
1301
+ * <div>
1302
+ * {isVerified ? (
1303
+ * <p>Proof verified at block {event?.block_number}</p>
1304
+ * ) : (
1305
+ * <p>Waiting for verification...</p>
1306
+ * )}
1307
+ * </div>
1308
+ * );
1309
+ * }
1310
+ * ```
1311
+ */
1312
+ declare function useProofVerified(proofHash: string | undefined): {
1313
+ event: ProofVerifiedEvent | null;
1314
+ isVerified: boolean;
1315
+ isSubscribed: boolean;
1316
+ };
1317
+ /**
1318
+ * Hook to subscribe to multiple jobs
1319
+ *
1320
+ * @param jobIds - Array of job IDs to subscribe to
1321
+ *
1322
+ * @example
1323
+ * ```tsx
1324
+ * function BatchJobProgress({ jobIds }: { jobIds: string[] }) {
1325
+ * const { events, completedCount } = useMultipleJobUpdates(jobIds);
1326
+ *
1327
+ * return (
1328
+ * <div>
1329
+ * <p>Completed: {completedCount} / {jobIds.length}</p>
1330
+ * {Object.entries(events).map(([id, event]) => (
1331
+ * <p key={id}>{id}: {event?.status}</p>
1332
+ * ))}
1333
+ * </div>
1334
+ * );
1335
+ * }
1336
+ * ```
1337
+ */
1338
+ declare function useMultipleJobUpdates(jobIds: string[]): {
1339
+ events: Record<string, JobUpdateEvent | null>;
1340
+ completedCount: number;
1341
+ failedCount: number;
1342
+ };
1343
+ /**
1344
+ * Hook to get real-time metrics with smoothing
1345
+ *
1346
+ * @example
1347
+ * ```tsx
1348
+ * function SmoothMetrics() {
1349
+ * const { currentValue, average, trend } = useSmoothedNetworkStats('jobs_pending');
1350
+ *
1351
+ * return (
1352
+ * <div>
1353
+ * <p>Current: {currentValue}</p>
1354
+ * <p>Avg (30s): {average.toFixed(2)}</p>
1355
+ * <p>Trend: {trend > 0 ? '↑' : trend < 0 ? '↓' : '→'}</p>
1356
+ * </div>
1357
+ * );
1358
+ * }
1359
+ * ```
1360
+ */
1361
+ declare function useSmoothedNetworkStats(metric: keyof NetworkStatsEvent, windowSize?: number): {
1362
+ currentValue: number;
1363
+ average: number;
1364
+ trend: number;
1365
+ };
1366
+
1367
+ export { BitSageContext, type BitSageContextValue, BitSageProvider, type BitSageProviderProps, type ConnectionState, PrivacyContext, type PrivacyContextValue, PrivacyProvider, type PrivacyProviderProps, type WalletConfig, WebSocketContext, type WebSocketContextValue, WebSocketProvider, type WebSocketProviderProps, useAllPrivateBalances, useBitSage, useBitSageClient, useCancelJob, useClaimRewards, useContracts, useCreateProposal, useCurrentBaseReward, useDailyCap, useDelegate, useDelegateStake, useGovernanceRights, useGovernanceStats, useGpuMetrics, useGpuMultiplier, useHeartbeat, useJobAnalytics, useJobResult, useJobStatus, useJobUpdates, useJobs, useLeaderboard, useMinStake, useMiningOverview, useMiningPoolStatus, useMiningRewardEstimate, useMultipleJobUpdates, useMyStaking, useNetwork, useNetworkStats, useNetworkStatsStream, useNetworkWorkers, usePendingUnstakes, usePoolBalances, usePrivacy, usePrivacyClient, usePrivacyKeys, usePrivateAccount, usePrivateBalance, usePrivateTransfer, useProofVerified, useProposal, useProposals, useRecentJobs, useRefreshPrivateBalances, useRegisterPrivateAccount, useRegisterWorker, useRemainingDailyCap, useRewardsHistory, useRewardsInfo, useSmoothedNetworkStats, useStake, useStakeInfo, useStakingConfig, useStealthAddress, useSubmitJob, useTotalBurned, useTotalStaked, useUnstake, useValidatorOverview, useValidatorStatus, useVestingStatus, useVote, useVotingPower, useWaitForJob, useWallet, useWebSocket, useWebSocketConnection, useWorker, useWorkerMiningStats, useWorkerProfile, useWorkerTier, useWorkerTierBenefits, useWorkerUpdates, useWorkers, useWorkersByCapability };