@wagmi/core 3.0.2 → 3.2.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/Connectors.js +534 -0
  7. package/dist/esm/tempo/Connectors.js.map +1 -0
  8. package/dist/esm/tempo/KeyManager.js +106 -0
  9. package/dist/esm/tempo/KeyManager.js.map +1 -0
  10. package/dist/esm/tempo/actions/amm.js +437 -0
  11. package/dist/esm/tempo/actions/amm.js.map +1 -0
  12. package/dist/esm/tempo/actions/dex.js +1059 -0
  13. package/dist/esm/tempo/actions/dex.js.map +1 -0
  14. package/dist/esm/tempo/actions/faucet.js +64 -0
  15. package/dist/esm/tempo/actions/faucet.js.map +1 -0
  16. package/dist/esm/tempo/actions/fee.js +160 -0
  17. package/dist/esm/tempo/actions/fee.js.map +1 -0
  18. package/dist/esm/tempo/actions/index.js +11 -0
  19. package/dist/esm/tempo/actions/index.js.map +1 -0
  20. package/dist/esm/tempo/actions/nonce.js +91 -0
  21. package/dist/esm/tempo/actions/nonce.js.map +1 -0
  22. package/dist/esm/tempo/actions/policy.js +532 -0
  23. package/dist/esm/tempo/actions/policy.js.map +1 -0
  24. package/dist/esm/tempo/actions/reward.js +384 -0
  25. package/dist/esm/tempo/actions/reward.js.map +1 -0
  26. package/dist/esm/tempo/actions/token.js +1717 -0
  27. package/dist/esm/tempo/actions/token.js.map +1 -0
  28. package/dist/esm/tempo/actions/utils.js +2 -0
  29. package/dist/esm/tempo/actions/utils.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/Connectors.d.ts +99 -0
  39. package/dist/types/tempo/Connectors.d.ts.map +1 -0
  40. package/dist/types/tempo/KeyManager.d.ts +71 -0
  41. package/dist/types/tempo/KeyManager.d.ts.map +1 -0
  42. package/dist/types/tempo/actions/amm.d.ts +387 -0
  43. package/dist/types/tempo/actions/amm.d.ts.map +1 -0
  44. package/dist/types/tempo/actions/dex.d.ts +926 -0
  45. package/dist/types/tempo/actions/dex.d.ts.map +1 -0
  46. package/dist/types/tempo/actions/faucet.d.ts +70 -0
  47. package/dist/types/tempo/actions/faucet.d.ts.map +1 -0
  48. package/dist/types/tempo/actions/fee.d.ts +141 -0
  49. package/dist/types/tempo/actions/fee.d.ts.map +1 -0
  50. package/dist/types/tempo/actions/index.d.ts +10 -0
  51. package/dist/types/tempo/actions/index.d.ts.map +1 -0
  52. package/dist/types/tempo/actions/nonce.d.ts +79 -0
  53. package/dist/types/tempo/actions/nonce.d.ts.map +1 -0
  54. package/dist/types/tempo/actions/policy.d.ts +478 -0
  55. package/dist/types/tempo/actions/policy.d.ts.map +1 -0
  56. package/dist/types/tempo/actions/reward.d.ts +340 -0
  57. package/dist/types/tempo/actions/reward.d.ts.map +1 -0
  58. package/dist/types/tempo/actions/token.d.ts +1531 -0
  59. package/dist/types/tempo/actions/token.d.ts.map +1 -0
  60. package/dist/types/tempo/actions/utils.d.ts +9 -0
  61. package/dist/types/tempo/actions/utils.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/Connectors.ts +762 -0
  70. package/src/tempo/KeyManager.ts +176 -0
  71. package/src/tempo/actions/amm.ts +678 -0
  72. package/src/tempo/actions/dex.ts +1685 -0
  73. package/src/tempo/actions/faucet.ts +95 -0
  74. package/src/tempo/actions/fee.ts +259 -0
  75. package/src/tempo/actions/index.ts +10 -0
  76. package/src/tempo/actions/nonce.ts +147 -0
  77. package/src/tempo/actions/policy.ts +827 -0
  78. package/src/tempo/actions/reward.ts +624 -0
  79. package/src/tempo/actions/token.ts +2598 -0
  80. package/src/tempo/actions/utils.ts +26 -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,624 @@
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 global reward per token value for a token.
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: [tempoModerato],
133
+ * transports: {
134
+ * [tempo.id]: http(),
135
+ * },
136
+ * })
137
+ *
138
+ * const value = await Actions.reward.getGlobalRewardPerToken(config, {
139
+ * token: '0x20c0000000000000000000000000000000000001',
140
+ * })
141
+ * ```
142
+ *
143
+ * @param config - Config.
144
+ * @param parameters - Parameters.
145
+ * @returns The global reward per token value (scaled by 1e18).
146
+ */
147
+ export function getGlobalRewardPerToken<config extends Config>(
148
+ config: config,
149
+ parameters: getGlobalRewardPerToken.Parameters<config>,
150
+ ): Promise<getGlobalRewardPerToken.ReturnValue> {
151
+ const { chainId, ...rest } = parameters
152
+ const client = config.getClient({ chainId })
153
+ return Actions.reward.getGlobalRewardPerToken(client, rest)
154
+ }
155
+
156
+ export namespace getGlobalRewardPerToken {
157
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
158
+ Actions.reward.getGlobalRewardPerToken.Parameters
159
+
160
+ export type ReturnValue = Actions.reward.getGlobalRewardPerToken.ReturnValue
161
+
162
+ export type ErrorType = BaseErrorType
163
+
164
+ export function queryKey<config extends Config>(
165
+ parameters: Parameters<config>,
166
+ ) {
167
+ return ['getGlobalRewardPerToken', 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 getGlobalRewardPerToken(config, parameters)
186
+ },
187
+ }
188
+ }
189
+
190
+ export declare namespace queryOptions {
191
+ export type Parameters<
192
+ config extends Config,
193
+ selectData = getGlobalRewardPerToken.ReturnValue,
194
+ > = getGlobalRewardPerToken.Parameters<config> &
195
+ QueryParameter<
196
+ getGlobalRewardPerToken.ReturnValue,
197
+ getGlobalRewardPerToken.ErrorType,
198
+ selectData,
199
+ getGlobalRewardPerToken.QueryKey<config>
200
+ >
201
+
202
+ export type ReturnValue<
203
+ config extends Config,
204
+ selectData = getGlobalRewardPerToken.ReturnValue,
205
+ > = QueryOptions<
206
+ getGlobalRewardPerToken.ReturnValue,
207
+ getGlobalRewardPerToken.ErrorType,
208
+ selectData,
209
+ getGlobalRewardPerToken.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
+ * 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.distribute(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 distribute<config extends Config>(
453
+ config: config,
454
+ parameters: distribute.Parameters<config>,
455
+ ): Promise<Actions.reward.distribute.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.distribute(client, parameters as never)
466
+ }
467
+
468
+ export declare namespace distribute {
469
+ export type Parameters<config extends Config = Config> =
470
+ ChainIdParameter<config> &
471
+ ConnectorParameter &
472
+ UnionLooseOmit<
473
+ Actions.reward.distribute.Parameters<config['chains'][number], Account>,
474
+ 'chain'
475
+ >
476
+
477
+ export type ReturnValue = Actions.reward.distribute.ReturnValue
478
+
479
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.distribute.ErrorType
480
+ }
481
+
482
+ /**
483
+ * 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.distributeSync(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 distributeSync<config extends Config>(
510
+ config: config,
511
+ parameters: distributeSync.Parameters<config>,
512
+ ): Promise<Actions.reward.distributeSync.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.distributeSync(client, parameters as never)
523
+ }
524
+
525
+ export declare namespace distributeSync {
526
+ export type Parameters<config extends Config = Config> =
527
+ ChainIdParameter<config> &
528
+ ConnectorParameter &
529
+ UnionLooseOmit<
530
+ Actions.reward.distributeSync.Parameters<
531
+ config['chains'][number],
532
+ Account
533
+ >,
534
+ 'chain'
535
+ >
536
+
537
+ export type ReturnValue = Actions.reward.distributeSync.ReturnValue
538
+
539
+ export type ErrorType = BaseErrorType // TODO: Actions.reward.distributeSync.ErrorType
540
+ }
541
+
542
+ /**
543
+ * Watches for reward distributed events.
544
+ *
545
+ * @example
546
+ * ```ts
547
+ * import { createConfig, http } from '@wagmi/core'
548
+ * import { tempo } from '@wagmi/core/chains'
549
+ * import { Actions } from '@wagmi/core/tempo'
550
+ *
551
+ * const config = createConfig({
552
+ * chains: [tempoTestnet],
553
+ * transports: {
554
+ * [tempo.id]: http(),
555
+ * },
556
+ * })
557
+ *
558
+ * const unwatch = Actions.reward.watchRewardDistributed(config, {
559
+ * token: '0x20c0000000000000000000000000000000000001',
560
+ * onRewardDistributed: (args, log) => {
561
+ * console.log('Reward distributed:', args)
562
+ * },
563
+ * })
564
+ * ```
565
+ *
566
+ * @param config - Config.
567
+ * @param parameters - Parameters.
568
+ * @returns A function to unsubscribe from the event.
569
+ */
570
+ export function watchRewardDistributed<config extends Config>(
571
+ config: config,
572
+ parameters: watchRewardDistributed.Parameters<config>,
573
+ ) {
574
+ const { chainId, ...rest } = parameters
575
+ const client = config.getClient({ chainId })
576
+ return Actions.reward.watchRewardDistributed(client, rest)
577
+ }
578
+
579
+ export declare namespace watchRewardDistributed {
580
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
581
+ Actions.reward.watchRewardDistributed.Parameters
582
+ }
583
+
584
+ /**
585
+ * Watches for reward recipient set events.
586
+ *
587
+ * @example
588
+ * ```ts
589
+ * import { createConfig, http } from '@wagmi/core'
590
+ * import { tempo } from '@wagmi/core/chains'
591
+ * import { Actions } from '@wagmi/core/tempo'
592
+ *
593
+ * const config = createConfig({
594
+ * chains: [tempoTestnet],
595
+ * transports: {
596
+ * [tempo.id]: http(),
597
+ * },
598
+ * })
599
+ *
600
+ * const unwatch = Actions.reward.watchRewardRecipientSet(config, {
601
+ * token: '0x20c0000000000000000000000000000000000001',
602
+ * onRewardRecipientSet: (args, log) => {
603
+ * console.log('Reward recipient set:', args)
604
+ * },
605
+ * })
606
+ * ```
607
+ *
608
+ * @param config - Config.
609
+ * @param parameters - Parameters.
610
+ * @returns A function to unsubscribe from the event.
611
+ */
612
+ export function watchRewardRecipientSet<config extends Config>(
613
+ config: config,
614
+ parameters: watchRewardRecipientSet.Parameters<config>,
615
+ ) {
616
+ const { chainId, ...rest } = parameters
617
+ const client = config.getClient({ chainId })
618
+ return Actions.reward.watchRewardRecipientSet(client, rest)
619
+ }
620
+
621
+ export declare namespace watchRewardRecipientSet {
622
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
623
+ Actions.reward.watchRewardRecipientSet.Parameters
624
+ }