@wagmi/core 3.0.2 → 3.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.
Files changed (83) hide show
  1. package/dist/esm/exports/internal.js.map +1 -1
  2. package/dist/esm/exports/query.js +1 -1
  3. package/dist/esm/exports/query.js.map +1 -1
  4. package/dist/esm/exports/tempo.js +9 -0
  5. package/dist/esm/exports/tempo.js.map +1 -0
  6. package/dist/esm/tempo/Actions/amm.js +469 -0
  7. package/dist/esm/tempo/Actions/amm.js.map +1 -0
  8. package/dist/esm/tempo/Actions/dex.js +983 -0
  9. package/dist/esm/tempo/Actions/dex.js.map +1 -0
  10. package/dist/esm/tempo/Actions/faucet.js +64 -0
  11. package/dist/esm/tempo/Actions/faucet.js.map +1 -0
  12. package/dist/esm/tempo/Actions/fee.js +160 -0
  13. package/dist/esm/tempo/Actions/fee.js.map +1 -0
  14. package/dist/esm/tempo/Actions/index.js +11 -0
  15. package/dist/esm/tempo/Actions/index.js.map +1 -0
  16. package/dist/esm/tempo/Actions/nonce.js +176 -0
  17. package/dist/esm/tempo/Actions/nonce.js.map +1 -0
  18. package/dist/esm/tempo/Actions/policy.js +532 -0
  19. package/dist/esm/tempo/Actions/policy.js.map +1 -0
  20. package/dist/esm/tempo/Actions/reward.js +384 -0
  21. package/dist/esm/tempo/Actions/reward.js.map +1 -0
  22. package/dist/esm/tempo/Actions/token.js +1717 -0
  23. package/dist/esm/tempo/Actions/token.js.map +1 -0
  24. package/dist/esm/tempo/Actions/utils.js +2 -0
  25. package/dist/esm/tempo/Actions/utils.js.map +1 -0
  26. package/dist/esm/tempo/Connectors.js +534 -0
  27. package/dist/esm/tempo/Connectors.js.map +1 -0
  28. package/dist/esm/tempo/KeyManager.js +106 -0
  29. package/dist/esm/tempo/KeyManager.js.map +1 -0
  30. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  31. package/dist/esm/version.js +1 -1
  32. package/dist/types/exports/internal.d.ts +1 -1
  33. package/dist/types/exports/internal.d.ts.map +1 -1
  34. package/dist/types/exports/query.d.ts +1 -1
  35. package/dist/types/exports/query.d.ts.map +1 -1
  36. package/dist/types/exports/tempo.d.ts +5 -0
  37. package/dist/types/exports/tempo.d.ts.map +1 -0
  38. package/dist/types/tempo/Actions/amm.d.ts +418 -0
  39. package/dist/types/tempo/Actions/amm.d.ts.map +1 -0
  40. package/dist/types/tempo/Actions/dex.d.ts +858 -0
  41. package/dist/types/tempo/Actions/dex.d.ts.map +1 -0
  42. package/dist/types/tempo/Actions/faucet.d.ts +70 -0
  43. package/dist/types/tempo/Actions/faucet.d.ts.map +1 -0
  44. package/dist/types/tempo/Actions/fee.d.ts +141 -0
  45. package/dist/types/tempo/Actions/fee.d.ts.map +1 -0
  46. package/dist/types/tempo/Actions/index.d.ts +10 -0
  47. package/dist/types/tempo/Actions/index.d.ts.map +1 -0
  48. package/dist/types/tempo/Actions/nonce.d.ts +150 -0
  49. package/dist/types/tempo/Actions/nonce.d.ts.map +1 -0
  50. package/dist/types/tempo/Actions/policy.d.ts +478 -0
  51. package/dist/types/tempo/Actions/policy.d.ts.map +1 -0
  52. package/dist/types/tempo/Actions/reward.d.ts +340 -0
  53. package/dist/types/tempo/Actions/reward.d.ts.map +1 -0
  54. package/dist/types/tempo/Actions/token.d.ts +1531 -0
  55. package/dist/types/tempo/Actions/token.d.ts.map +1 -0
  56. package/dist/types/tempo/Actions/utils.d.ts +9 -0
  57. package/dist/types/tempo/Actions/utils.d.ts.map +1 -0
  58. package/dist/types/tempo/Connectors.d.ts +99 -0
  59. package/dist/types/tempo/Connectors.d.ts.map +1 -0
  60. package/dist/types/tempo/KeyManager.d.ts +71 -0
  61. package/dist/types/tempo/KeyManager.d.ts.map +1 -0
  62. package/dist/types/types/utils.d.ts +16 -0
  63. package/dist/types/types/utils.d.ts.map +1 -1
  64. package/dist/types/version.d.ts +1 -1
  65. package/package.json +14 -2
  66. package/src/exports/internal.ts +3 -0
  67. package/src/exports/query.ts +4 -1
  68. package/src/exports/tempo.ts +14 -0
  69. package/src/tempo/Actions/amm.ts +719 -0
  70. package/src/tempo/Actions/dex.ts +1571 -0
  71. package/src/tempo/Actions/faucet.ts +95 -0
  72. package/src/tempo/Actions/fee.ts +259 -0
  73. package/src/tempo/Actions/index.ts +10 -0
  74. package/src/tempo/Actions/nonce.ts +283 -0
  75. package/src/tempo/Actions/policy.ts +827 -0
  76. package/src/tempo/Actions/reward.ts +621 -0
  77. package/src/tempo/Actions/token.ts +2598 -0
  78. package/src/tempo/Actions/utils.ts +26 -0
  79. package/src/tempo/Connectors.ts +762 -0
  80. package/src/tempo/KeyManager.ts +176 -0
  81. package/src/types/utils.ts +19 -0
  82. package/src/version.ts +1 -1
  83. package/tempo/package.json +5 -0
@@ -0,0 +1,621 @@
1
+ import type { Account, BaseErrorType } from 'viem'
2
+ import { Actions } from 'viem/tempo'
3
+ import { getConnectorClient } from '../../actions/getConnectorClient.js'
4
+ import type { Config } from '../../createConfig.js'
5
+ import type {
6
+ ChainIdParameter,
7
+ ConnectorParameter,
8
+ } from '../../types/properties.js'
9
+ import type { UnionLooseOmit } from '../../types/utils.js'
10
+ import type { QueryOptions, QueryParameter } from './utils.js'
11
+
12
+ /**
13
+ * Claims accumulated rewards for a recipient.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * import { createConfig, http } from '@wagmi/core'
18
+ * import { tempo } from '@wagmi/core/chains'
19
+ * import { Actions } from '@wagmi/core/tempo'
20
+ *
21
+ * const config = createConfig({
22
+ * chains: [tempoTestnet],
23
+ * transports: {
24
+ * [tempo.id]: http(),
25
+ * },
26
+ * })
27
+ *
28
+ * const hash = await Actions.reward.claim(config, {
29
+ * token: '0x20c0000000000000000000000000000000000001',
30
+ * })
31
+ * ```
32
+ *
33
+ * @param config - Config.
34
+ * @param parameters - Parameters.
35
+ * @returns The transaction hash.
36
+ */
37
+ export async function claim<config extends Config>(
38
+ config: config,
39
+ parameters: claim.Parameters<config>,
40
+ ): Promise<Actions.reward.claim.ReturnValue> {
41
+ const { account, chainId, connector } = parameters
42
+
43
+ const client = await getConnectorClient(config, {
44
+ account,
45
+ assertChainId: false,
46
+ chainId,
47
+ connector,
48
+ })
49
+
50
+ return Actions.reward.claim(client, parameters as never)
51
+ }
52
+
53
+ export declare namespace claim {
54
+ export type Parameters<config extends Config = Config> =
55
+ ChainIdParameter<config> &
56
+ ConnectorParameter &
57
+ UnionLooseOmit<
58
+ Actions.reward.claim.Parameters<config['chains'][number], Account>,
59
+ 'chain'
60
+ >
61
+
62
+ export type ReturnValue = Actions.reward.claim.ReturnValue
63
+
64
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.claim.ErrorType
65
+ }
66
+
67
+ /**
68
+ * Claims accumulated rewards for a recipient and waits for confirmation.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * import { createConfig, http } from '@wagmi/core'
73
+ * import { tempo } from '@wagmi/core/chains'
74
+ * import { Actions } from '@wagmi/core/tempo'
75
+ *
76
+ * const config = createConfig({
77
+ * chains: [tempoTestnet],
78
+ * transports: {
79
+ * [tempo.id]: http(),
80
+ * },
81
+ * })
82
+ *
83
+ * const result = await Actions.reward.claimSync(config, {
84
+ * token: '0x20c0000000000000000000000000000000000001',
85
+ * })
86
+ * ```
87
+ *
88
+ * @param config - Config.
89
+ * @param parameters - Parameters.
90
+ * @returns The transaction receipt.
91
+ */
92
+ export async function claimSync<config extends Config>(
93
+ config: config,
94
+ parameters: claimSync.Parameters<config>,
95
+ ): Promise<Actions.reward.claimSync.ReturnValue> {
96
+ const { account, chainId, connector } = parameters
97
+
98
+ const client = await getConnectorClient(config, {
99
+ account,
100
+ assertChainId: false,
101
+ chainId,
102
+ connector,
103
+ })
104
+
105
+ return Actions.reward.claimSync(client, parameters as never)
106
+ }
107
+
108
+ export declare namespace claimSync {
109
+ export type Parameters<config extends Config = Config> =
110
+ ChainIdParameter<config> &
111
+ ConnectorParameter &
112
+ UnionLooseOmit<
113
+ Actions.reward.claimSync.Parameters<config['chains'][number], Account>,
114
+ 'chain'
115
+ >
116
+
117
+ export type ReturnValue = Actions.reward.claimSync.ReturnValue
118
+
119
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.claimSync.ErrorType
120
+ }
121
+
122
+ /**
123
+ * Gets the total reward per second rate for all active streams.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * import { createConfig, http } from '@wagmi/core'
128
+ * import { tempo } from '@wagmi/core/chains'
129
+ * import { Actions } from '@wagmi/core/tempo'
130
+ *
131
+ * const config = createConfig({
132
+ * chains: [tempoTestnet],
133
+ * transports: {
134
+ * [tempo.id]: http(),
135
+ * },
136
+ * })
137
+ *
138
+ * const rate = await Actions.reward.getTotalPerSecond(config, {
139
+ * token: '0x20c0000000000000000000000000000000000001',
140
+ * })
141
+ * ```
142
+ *
143
+ * @param config - Config.
144
+ * @param parameters - Parameters.
145
+ * @returns The total reward per second (scaled by 1e18).
146
+ */
147
+ export function getTotalPerSecond<config extends Config>(
148
+ config: config,
149
+ parameters: getTotalPerSecond.Parameters<config>,
150
+ ): Promise<getTotalPerSecond.ReturnValue> {
151
+ const { chainId, ...rest } = parameters
152
+ const client = config.getClient({ chainId })
153
+ return Actions.reward.getTotalPerSecond(client, rest)
154
+ }
155
+
156
+ export namespace getTotalPerSecond {
157
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
158
+ Actions.reward.getTotalPerSecond.Parameters
159
+
160
+ export type ReturnValue = Actions.reward.getTotalPerSecond.ReturnValue
161
+
162
+ export type ErrorType = BaseErrorType
163
+
164
+ export function queryKey<config extends Config>(
165
+ parameters: Parameters<config>,
166
+ ) {
167
+ return ['getTotalPerSecond', parameters] as const
168
+ }
169
+
170
+ export type QueryKey<config extends Config> = ReturnType<
171
+ typeof queryKey<config>
172
+ >
173
+
174
+ export function queryOptions<config extends Config, selectData = ReturnValue>(
175
+ config: Config,
176
+ parameters: queryOptions.Parameters<config, selectData>,
177
+ ): queryOptions.ReturnValue<config, selectData> {
178
+ const { query, ...rest } = parameters
179
+ return {
180
+ ...query,
181
+ enabled: Boolean(rest.token && (query?.enabled ?? true)),
182
+ queryKey: queryKey(rest),
183
+ async queryFn({ queryKey }) {
184
+ const [, parameters] = queryKey
185
+ return await getTotalPerSecond(config, parameters)
186
+ },
187
+ }
188
+ }
189
+
190
+ export declare namespace queryOptions {
191
+ export type Parameters<
192
+ config extends Config,
193
+ selectData = getTotalPerSecond.ReturnValue,
194
+ > = getTotalPerSecond.Parameters<config> &
195
+ QueryParameter<
196
+ getTotalPerSecond.ReturnValue,
197
+ getTotalPerSecond.ErrorType,
198
+ selectData,
199
+ getTotalPerSecond.QueryKey<config>
200
+ >
201
+
202
+ export type ReturnValue<
203
+ config extends Config,
204
+ selectData = getTotalPerSecond.ReturnValue,
205
+ > = QueryOptions<
206
+ getTotalPerSecond.ReturnValue,
207
+ getTotalPerSecond.ErrorType,
208
+ selectData,
209
+ getTotalPerSecond.QueryKey<config>
210
+ >
211
+ }
212
+ }
213
+
214
+ /**
215
+ * Gets the reward information for a specific account.
216
+ *
217
+ * @example
218
+ * ```ts
219
+ * import { createConfig, http } from '@wagmi/core'
220
+ * import { tempo } from '@wagmi/core/chains'
221
+ * import { Actions } from '@wagmi/core/tempo'
222
+ *
223
+ * const config = createConfig({
224
+ * chains: [tempoTestnet],
225
+ * transports: {
226
+ * [tempo.id]: http(),
227
+ * },
228
+ * })
229
+ *
230
+ * const info = await Actions.reward.getUserRewardInfo(config, {
231
+ * token: '0x20c0000000000000000000000000000000000001',
232
+ * account: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
233
+ * })
234
+ * ```
235
+ *
236
+ * @param config - Config.
237
+ * @param parameters - Parameters.
238
+ * @returns The user's reward information (recipient, rewardPerToken, rewardBalance).
239
+ */
240
+ export function getUserRewardInfo<config extends Config>(
241
+ config: config,
242
+ parameters: getUserRewardInfo.Parameters<config>,
243
+ ): Promise<getUserRewardInfo.ReturnValue> {
244
+ const { chainId, ...rest } = parameters
245
+ const client = config.getClient({ chainId })
246
+ return Actions.reward.getUserRewardInfo(client, rest)
247
+ }
248
+
249
+ export namespace getUserRewardInfo {
250
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
251
+ Actions.reward.getUserRewardInfo.Parameters
252
+
253
+ export type ReturnValue = Actions.reward.getUserRewardInfo.ReturnValue
254
+
255
+ export type ErrorType = BaseErrorType
256
+
257
+ export function queryKey<config extends Config>(
258
+ parameters: Parameters<config>,
259
+ ) {
260
+ return ['getUserRewardInfo', parameters] as const
261
+ }
262
+
263
+ export type QueryKey<config extends Config> = ReturnType<
264
+ typeof queryKey<config>
265
+ >
266
+
267
+ export function queryOptions<config extends Config, selectData = ReturnValue>(
268
+ config: Config,
269
+ parameters: queryOptions.Parameters<config, selectData>,
270
+ ): queryOptions.ReturnValue<config, selectData> {
271
+ const { query, ...rest } = parameters
272
+ return {
273
+ ...query,
274
+ enabled: Boolean(rest.token && rest.account && (query?.enabled ?? true)),
275
+ queryKey: queryKey(rest),
276
+ async queryFn({ queryKey }) {
277
+ const [, parameters] = queryKey
278
+ return await getUserRewardInfo(config, parameters)
279
+ },
280
+ }
281
+ }
282
+
283
+ export declare namespace queryOptions {
284
+ export type Parameters<
285
+ config extends Config,
286
+ selectData = getUserRewardInfo.ReturnValue,
287
+ > = getUserRewardInfo.Parameters<config> &
288
+ QueryParameter<
289
+ getUserRewardInfo.ReturnValue,
290
+ getUserRewardInfo.ErrorType,
291
+ selectData,
292
+ getUserRewardInfo.QueryKey<config>
293
+ >
294
+
295
+ export type ReturnValue<
296
+ config extends Config,
297
+ selectData = getUserRewardInfo.ReturnValue,
298
+ > = QueryOptions<
299
+ getUserRewardInfo.ReturnValue,
300
+ getUserRewardInfo.ErrorType,
301
+ selectData,
302
+ getUserRewardInfo.QueryKey<config>
303
+ >
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Sets or changes the reward recipient for a token holder.
309
+ *
310
+ * @example
311
+ * ```ts
312
+ * import { createConfig, http } from '@wagmi/core'
313
+ * import { tempo } from '@wagmi/core/chains'
314
+ * import { Actions } from '@wagmi/core/tempo'
315
+ *
316
+ * const config = createConfig({
317
+ * chains: [tempoTestnet],
318
+ * transports: {
319
+ * [tempo.id]: http(),
320
+ * },
321
+ * })
322
+ *
323
+ * const hash = await Actions.reward.setRecipient(config, {
324
+ * recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
325
+ * token: '0x20c0000000000000000000000000000000000001',
326
+ * })
327
+ * ```
328
+ *
329
+ * @param config - Config.
330
+ * @param parameters - Parameters.
331
+ * @returns The transaction hash.
332
+ */
333
+ export async function setRecipient<config extends Config>(
334
+ config: config,
335
+ parameters: setRecipient.Parameters<config>,
336
+ ): Promise<Actions.reward.setRecipient.ReturnValue> {
337
+ const { account, chainId, connector } = parameters
338
+
339
+ const client = await getConnectorClient(config, {
340
+ account,
341
+ assertChainId: false,
342
+ chainId,
343
+ connector,
344
+ })
345
+
346
+ return Actions.reward.setRecipient(client, parameters as never)
347
+ }
348
+
349
+ export declare namespace setRecipient {
350
+ export type Parameters<config extends Config = Config> =
351
+ ChainIdParameter<config> &
352
+ ConnectorParameter &
353
+ UnionLooseOmit<
354
+ Actions.reward.setRecipient.Parameters<
355
+ config['chains'][number],
356
+ Account
357
+ >,
358
+ 'chain'
359
+ >
360
+
361
+ export type ReturnValue = Actions.reward.setRecipient.ReturnValue
362
+
363
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.setRecipient.ErrorType
364
+ }
365
+
366
+ /**
367
+ * Sets or changes the reward recipient for a token holder and waits for confirmation.
368
+ *
369
+ * @example
370
+ * ```ts
371
+ * import { createConfig, http } from '@wagmi/core'
372
+ * import { tempo } from '@wagmi/core/chains'
373
+ * import { Actions } from '@wagmi/core/tempo'
374
+ *
375
+ * const config = createConfig({
376
+ * chains: [tempoTestnet],
377
+ * transports: {
378
+ * [tempo.id]: http(),
379
+ * },
380
+ * })
381
+ *
382
+ * const result = await Actions.reward.setRecipientSync(config, {
383
+ * recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
384
+ * token: '0x20c0000000000000000000000000000000000001',
385
+ * })
386
+ * ```
387
+ *
388
+ * @param config - Config.
389
+ * @param parameters - Parameters.
390
+ * @returns The transaction receipt and event data.
391
+ */
392
+ export async function setRecipientSync<config extends Config>(
393
+ config: config,
394
+ parameters: setRecipientSync.Parameters<config>,
395
+ ): Promise<Actions.reward.setRecipientSync.ReturnValue> {
396
+ const { account, chainId, connector } = parameters
397
+
398
+ const client = await getConnectorClient(config, {
399
+ account,
400
+ assertChainId: false,
401
+ chainId,
402
+ connector,
403
+ })
404
+
405
+ return Actions.reward.setRecipientSync(client, parameters as never)
406
+ }
407
+
408
+ export declare namespace setRecipientSync {
409
+ export type Parameters<config extends Config = Config> =
410
+ ChainIdParameter<config> &
411
+ ConnectorParameter &
412
+ UnionLooseOmit<
413
+ Actions.reward.setRecipientSync.Parameters<
414
+ config['chains'][number],
415
+ Account
416
+ >,
417
+ 'chain'
418
+ >
419
+
420
+ export type ReturnValue = Actions.reward.setRecipientSync.ReturnValue
421
+
422
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.setRecipientSync.ErrorType
423
+ }
424
+
425
+ /**
426
+ * Starts a new reward stream that distributes tokens to opted-in holders.
427
+ *
428
+ * @example
429
+ * ```ts
430
+ * import { createConfig, http } from '@wagmi/core'
431
+ * import { tempo } from '@wagmi/core/chains'
432
+ * import { Actions } from '@wagmi/core/tempo'
433
+ *
434
+ * const config = createConfig({
435
+ * chains: [tempoTestnet],
436
+ * transports: {
437
+ * [tempo.id]: http(),
438
+ * },
439
+ * })
440
+ *
441
+ * const hash = await Actions.reward.start(config, {
442
+ * amount: 100000000000000000000n,
443
+ * seconds: 86400,
444
+ * token: '0x20c0000000000000000000000000000000000001',
445
+ * })
446
+ * ```
447
+ *
448
+ * @param config - Config.
449
+ * @param parameters - Parameters.
450
+ * @returns The transaction hash.
451
+ */
452
+ export async function start<config extends Config>(
453
+ config: config,
454
+ parameters: start.Parameters<config>,
455
+ ): Promise<Actions.reward.start.ReturnValue> {
456
+ const { account, chainId, connector } = parameters
457
+
458
+ const client = await getConnectorClient(config, {
459
+ account,
460
+ assertChainId: false,
461
+ chainId,
462
+ connector,
463
+ })
464
+
465
+ return Actions.reward.start(client, parameters as never)
466
+ }
467
+
468
+ export declare namespace start {
469
+ export type Parameters<config extends Config = Config> =
470
+ ChainIdParameter<config> &
471
+ ConnectorParameter &
472
+ UnionLooseOmit<
473
+ Actions.reward.start.Parameters<config['chains'][number], Account>,
474
+ 'chain'
475
+ >
476
+
477
+ export type ReturnValue = Actions.reward.start.ReturnValue
478
+
479
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.start.ErrorType
480
+ }
481
+
482
+ /**
483
+ * Starts a new reward stream that distributes tokens to opted-in holders and waits for confirmation.
484
+ *
485
+ * @example
486
+ * ```ts
487
+ * import { createConfig, http } from '@wagmi/core'
488
+ * import { tempo } from '@wagmi/core/chains'
489
+ * import { Actions } from '@wagmi/core/tempo'
490
+ *
491
+ * const config = createConfig({
492
+ * chains: [tempoTestnet],
493
+ * transports: {
494
+ * [tempo.id]: http(),
495
+ * },
496
+ * })
497
+ *
498
+ * const result = await Actions.reward.startSync(config, {
499
+ * amount: 100000000000000000000n,
500
+ * seconds: 86400,
501
+ * token: '0x20c0000000000000000000000000000000000001',
502
+ * })
503
+ * ```
504
+ *
505
+ * @param config - Config.
506
+ * @param parameters - Parameters.
507
+ * @returns The transaction receipt and event data.
508
+ */
509
+ export async function startSync<config extends Config>(
510
+ config: config,
511
+ parameters: startSync.Parameters<config>,
512
+ ): Promise<Actions.reward.startSync.ReturnValue> {
513
+ const { account, chainId, connector } = parameters
514
+
515
+ const client = await getConnectorClient(config, {
516
+ account,
517
+ assertChainId: false,
518
+ chainId,
519
+ connector,
520
+ })
521
+
522
+ return Actions.reward.startSync(client, parameters as never)
523
+ }
524
+
525
+ export declare namespace startSync {
526
+ export type Parameters<config extends Config = Config> =
527
+ ChainIdParameter<config> &
528
+ ConnectorParameter &
529
+ UnionLooseOmit<
530
+ Actions.reward.startSync.Parameters<config['chains'][number], Account>,
531
+ 'chain'
532
+ >
533
+
534
+ export type ReturnValue = Actions.reward.startSync.ReturnValue
535
+
536
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.startSync.ErrorType
537
+ }
538
+
539
+ /**
540
+ * Watches for reward scheduled events.
541
+ *
542
+ * @example
543
+ * ```ts
544
+ * import { createConfig, http } from '@wagmi/core'
545
+ * import { tempo } from '@wagmi/core/chains'
546
+ * import { Actions } from '@wagmi/core/tempo'
547
+ *
548
+ * const config = createConfig({
549
+ * chains: [tempoTestnet],
550
+ * transports: {
551
+ * [tempo.id]: http(),
552
+ * },
553
+ * })
554
+ *
555
+ * const unwatch = Actions.reward.watchRewardScheduled(config, {
556
+ * token: '0x20c0000000000000000000000000000000000001',
557
+ * onRewardScheduled: (args, log) => {
558
+ * console.log('Reward scheduled:', args)
559
+ * },
560
+ * })
561
+ * ```
562
+ *
563
+ * @param config - Config.
564
+ * @param parameters - Parameters.
565
+ * @returns A function to unsubscribe from the event.
566
+ */
567
+ export function watchRewardScheduled<config extends Config>(
568
+ config: config,
569
+ parameters: watchRewardScheduled.Parameters<config>,
570
+ ) {
571
+ const { chainId, ...rest } = parameters
572
+ const client = config.getClient({ chainId })
573
+ return Actions.reward.watchRewardScheduled(client, rest)
574
+ }
575
+
576
+ export declare namespace watchRewardScheduled {
577
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
578
+ Actions.reward.watchRewardScheduled.Parameters
579
+ }
580
+
581
+ /**
582
+ * Watches for reward recipient set events.
583
+ *
584
+ * @example
585
+ * ```ts
586
+ * import { createConfig, http } from '@wagmi/core'
587
+ * import { tempo } from '@wagmi/core/chains'
588
+ * import { Actions } from '@wagmi/core/tempo'
589
+ *
590
+ * const config = createConfig({
591
+ * chains: [tempoTestnet],
592
+ * transports: {
593
+ * [tempo.id]: http(),
594
+ * },
595
+ * })
596
+ *
597
+ * const unwatch = Actions.reward.watchRewardRecipientSet(config, {
598
+ * token: '0x20c0000000000000000000000000000000000001',
599
+ * onRewardRecipientSet: (args, log) => {
600
+ * console.log('Reward recipient set:', args)
601
+ * },
602
+ * })
603
+ * ```
604
+ *
605
+ * @param config - Config.
606
+ * @param parameters - Parameters.
607
+ * @returns A function to unsubscribe from the event.
608
+ */
609
+ export function watchRewardRecipientSet<config extends Config>(
610
+ config: config,
611
+ parameters: watchRewardRecipientSet.Parameters<config>,
612
+ ) {
613
+ const { chainId, ...rest } = parameters
614
+ const client = config.getClient({ chainId })
615
+ return Actions.reward.watchRewardRecipientSet(client, rest)
616
+ }
617
+
618
+ export declare namespace watchRewardRecipientSet {
619
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
620
+ Actions.reward.watchRewardRecipientSet.Parameters
621
+ }