@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,678 @@
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 { filterQueryOptions } from '../../query/utils.js'
6
+ import type {
7
+ ChainIdParameter,
8
+ ConnectorParameter,
9
+ } from '../../types/properties.js'
10
+ import type { UnionLooseOmit } from '../../types/utils.js'
11
+ import type { QueryOptions, QueryParameter } from './utils.js'
12
+
13
+ /**
14
+ * Gets the reserves for a liquidity pool.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { createConfig, http } from '@wagmi/core'
19
+ * import { tempo } from '@wagmi/core/chains'
20
+ * import { Actions } from '@wagmi/core/tempo'
21
+ *
22
+ * const config = createConfig({
23
+ * chains: [tempoModerato],
24
+ * transports: {
25
+ * [tempo.id]: http(),
26
+ * },
27
+ * })
28
+ *
29
+ * const pool = await Actions.amm.getPool(config, {
30
+ * userToken: '0x...',
31
+ * validatorToken: '0x...',
32
+ * })
33
+ * ```
34
+ *
35
+ * @param config - Config.
36
+ * @param parameters - Parameters.
37
+ * @returns The pool reserves.
38
+ */
39
+ export function getPool<config extends Config>(
40
+ config: config,
41
+ parameters: getPool.Parameters<config>,
42
+ ): Promise<getPool.ReturnValue> {
43
+ const { chainId, ...rest } = parameters
44
+ const client = config.getClient({ chainId })
45
+ return Actions.amm.getPool(client, rest)
46
+ }
47
+
48
+ export namespace getPool {
49
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
50
+ Actions.amm.getPool.Parameters
51
+
52
+ export type ReturnValue = Actions.amm.getPool.ReturnValue
53
+
54
+ export type ErrorType = BaseErrorType
55
+
56
+ export function queryKey<config extends Config>(
57
+ parameters: Parameters<config>,
58
+ ) {
59
+ return ['getPool', filterQueryOptions(parameters)] as const
60
+ }
61
+
62
+ export type QueryKey<config extends Config> = ReturnType<
63
+ typeof queryKey<config>
64
+ >
65
+
66
+ export function queryOptions<config extends Config, selectData = ReturnValue>(
67
+ config: Config,
68
+ parameters: queryOptions.Parameters<config, selectData>,
69
+ ): queryOptions.ReturnValue<config, selectData> {
70
+ const { query, ...rest } = parameters
71
+ return {
72
+ ...query,
73
+ enabled: Boolean(
74
+ rest.userToken && rest.validatorToken && (query?.enabled ?? true),
75
+ ),
76
+ queryKey: queryKey(rest),
77
+ async queryFn({ queryKey }) {
78
+ const [, parameters] = queryKey
79
+ return await getPool(config, parameters)
80
+ },
81
+ }
82
+ }
83
+
84
+ export declare namespace queryOptions {
85
+ export type Parameters<
86
+ config extends Config,
87
+ selectData = getPool.ReturnValue,
88
+ > = getPool.Parameters<config> &
89
+ QueryParameter<
90
+ getPool.ReturnValue,
91
+ getPool.ErrorType,
92
+ selectData,
93
+ getPool.QueryKey<config>
94
+ >
95
+
96
+ export type ReturnValue<
97
+ config extends Config,
98
+ selectData = getPool.ReturnValue,
99
+ > = QueryOptions<
100
+ getPool.ReturnValue,
101
+ getPool.ErrorType,
102
+ selectData,
103
+ getPool.QueryKey<config>
104
+ >
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Gets the LP token balance for an account in a specific pool.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * import { createConfig, http } from '@wagmi/core'
114
+ * import { tempo } from '@wagmi/core/chains'
115
+ * import { Actions } from '@wagmi/core/tempo'
116
+ *
117
+ * const config = createConfig({
118
+ * chains: [tempoModerato],
119
+ * transports: {
120
+ * [tempo.id]: http(),
121
+ * },
122
+ * })
123
+ *
124
+ * const poolId = await Actions.amm.getPoolId(config, {
125
+ * userToken: '0x...',
126
+ * validatorToken: '0x...',
127
+ * })
128
+ *
129
+ * const balance = await Actions.amm.getLiquidityBalance(config, {
130
+ * poolId,
131
+ * address: '0x...',
132
+ * })
133
+ * ```
134
+ *
135
+ * @param config - Config.
136
+ * @param parameters - Parameters.
137
+ * @returns The LP token balance.
138
+ */
139
+ export function getLiquidityBalance<config extends Config>(
140
+ config: config,
141
+ parameters: getLiquidityBalance.Parameters<config>,
142
+ ): Promise<getLiquidityBalance.ReturnValue> {
143
+ const { chainId, ...rest } = parameters
144
+ const client = config.getClient({ chainId })
145
+ return Actions.amm.getLiquidityBalance(client, rest)
146
+ }
147
+
148
+ export namespace getLiquidityBalance {
149
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
150
+ Actions.amm.getLiquidityBalance.Parameters
151
+
152
+ export type ReturnValue = Actions.amm.getLiquidityBalance.ReturnValue
153
+
154
+ export type ErrorType = BaseErrorType
155
+
156
+ export function queryKey<config extends Config>(
157
+ parameters: Parameters<config>,
158
+ ) {
159
+ return ['getLiquidityBalance', filterQueryOptions(parameters)] as const
160
+ }
161
+
162
+ export type QueryKey<config extends Config> = ReturnType<
163
+ typeof queryKey<config>
164
+ >
165
+
166
+ export function queryOptions<config extends Config, selectData = ReturnValue>(
167
+ config: Config,
168
+ parameters: queryOptions.Parameters<config, selectData>,
169
+ ): queryOptions.ReturnValue<config, selectData> {
170
+ const { query, ...rest } = parameters
171
+ return {
172
+ ...query,
173
+ enabled: Boolean(
174
+ rest.address &&
175
+ (rest.poolId ||
176
+ (rest.userToken !== undefined &&
177
+ rest.validatorToken !== undefined)) &&
178
+ (query?.enabled ?? true),
179
+ ),
180
+ queryKey: queryKey(rest),
181
+ async queryFn({ queryKey }) {
182
+ const [, parameters] = queryKey
183
+ return await getLiquidityBalance(config, parameters)
184
+ },
185
+ }
186
+ }
187
+
188
+ export declare namespace queryOptions {
189
+ export type Parameters<
190
+ config extends Config,
191
+ selectData = getLiquidityBalance.ReturnValue,
192
+ > = getLiquidityBalance.Parameters<config> &
193
+ QueryParameter<
194
+ getLiquidityBalance.ReturnValue,
195
+ getLiquidityBalance.ErrorType,
196
+ selectData,
197
+ getLiquidityBalance.QueryKey<config>
198
+ >
199
+
200
+ export type ReturnValue<
201
+ config extends Config,
202
+ selectData = getLiquidityBalance.ReturnValue,
203
+ > = QueryOptions<
204
+ getLiquidityBalance.ReturnValue,
205
+ getLiquidityBalance.ErrorType,
206
+ selectData,
207
+ getLiquidityBalance.QueryKey<config>
208
+ >
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Performs a rebalance swap from validator token to user token.
214
+ *
215
+ * @example
216
+ * ```ts
217
+ * import { createConfig, http } from '@wagmi/core'
218
+ * import { tempo } from '@wagmi/core/chains'
219
+ * import { Actions } from '@wagmi/core/tempo'
220
+ *
221
+ * const config = createConfig({
222
+ * chains: [tempoModerato],
223
+ * transports: {
224
+ * [tempo.id]: http(),
225
+ * },
226
+ * })
227
+ *
228
+ * const hash = await Actions.amm.rebalanceSwap(config, {
229
+ * userToken: '0x...',
230
+ * validatorToken: '0x...',
231
+ * amountOut: 100n,
232
+ * to: '0x...',
233
+ * })
234
+ * ```
235
+ *
236
+ * @param config - Config.
237
+ * @param parameters - Parameters.
238
+ * @returns The transaction hash.
239
+ */
240
+ export async function rebalanceSwap<config extends Config>(
241
+ config: config,
242
+ parameters: rebalanceSwap.Parameters<config>,
243
+ ): Promise<Actions.amm.rebalanceSwap.ReturnValue> {
244
+ const { account, chainId, connector } = parameters
245
+
246
+ const client = await getConnectorClient(config, {
247
+ account,
248
+ assertChainId: false,
249
+ chainId,
250
+ connector,
251
+ })
252
+
253
+ return Actions.amm.rebalanceSwap(client, parameters as never)
254
+ }
255
+
256
+ export declare namespace rebalanceSwap {
257
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
258
+ ConnectorParameter &
259
+ UnionLooseOmit<
260
+ Actions.amm.rebalanceSwap.Parameters<config['chains'][number], Account>,
261
+ 'chain'
262
+ >
263
+
264
+ export type ReturnValue = Actions.amm.rebalanceSwap.ReturnValue
265
+
266
+ export type ErrorType = BaseErrorType
267
+ }
268
+
269
+ /**
270
+ * Performs a rebalance swap from validator token to user token.
271
+ *
272
+ * @example
273
+ * ```ts
274
+ * import { createConfig, http } from '@wagmi/core'
275
+ * import { tempo } from '@wagmi/core/chains'
276
+ * import { Actions } from '@wagmi/core/tempo'
277
+ *
278
+ * const config = createConfig({
279
+ * chains: [tempoModerato],
280
+ * transports: {
281
+ * [tempo.id]: http(),
282
+ * },
283
+ * })
284
+ *
285
+ * const result = await Actions.amm.rebalanceSwapSync(config, {
286
+ * userToken: '0x...',
287
+ * validatorToken: '0x...',
288
+ * amountOut: 100n,
289
+ * to: '0x...',
290
+ * })
291
+ * ```
292
+ *
293
+ * @param config - Config.
294
+ * @param parameters - Parameters.
295
+ * @returns The transaction receipt and event data.
296
+ */
297
+ export async function rebalanceSwapSync<config extends Config>(
298
+ config: config,
299
+ parameters: rebalanceSwapSync.Parameters<config>,
300
+ ): Promise<Actions.amm.rebalanceSwapSync.ReturnValue> {
301
+ const { account, chainId, connector } = parameters
302
+
303
+ const client = await getConnectorClient(config, {
304
+ account,
305
+ assertChainId: false,
306
+ chainId,
307
+ connector,
308
+ })
309
+
310
+ return Actions.amm.rebalanceSwapSync(client, parameters as never)
311
+ }
312
+
313
+ export declare namespace rebalanceSwapSync {
314
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
315
+ ConnectorParameter &
316
+ UnionLooseOmit<
317
+ Actions.amm.rebalanceSwapSync.Parameters<
318
+ config['chains'][number],
319
+ Account
320
+ >,
321
+ 'chain'
322
+ >
323
+
324
+ export type ReturnValue = Actions.amm.rebalanceSwapSync.ReturnValue
325
+
326
+ export type ErrorType = BaseErrorType
327
+ }
328
+
329
+ /**
330
+ * Adds liquidity to a pool.
331
+ *
332
+ * @example
333
+ * ```ts
334
+ * import { createConfig, http } from '@wagmi/core'
335
+ * import { tempo } from '@wagmi/core/chains'
336
+ * import { Actions } from '@wagmi/core/tempo'
337
+ *
338
+ * const config = createConfig({
339
+ * chains: [tempoModerato],
340
+ * transports: {
341
+ * [tempo.id]: http(),
342
+ * },
343
+ * })
344
+ *
345
+ * const hash = await Actions.amm.mint(config, {
346
+ * userTokenAddress: '0x20c0...beef',
347
+ * validatorTokenAddress: '0x20c0...babe',
348
+ * validatorTokenAmount: 100n,
349
+ * to: '0xfeed...fede',
350
+ * })
351
+ * ```
352
+ *
353
+ * @param config - Config.
354
+ * @param parameters - Parameters.
355
+ * @returns The transaction hash.
356
+ */
357
+ export async function mint<config extends Config>(
358
+ config: config,
359
+ parameters: mint.Parameters<config>,
360
+ ): Promise<Actions.amm.mint.ReturnValue> {
361
+ const { account, chainId, connector } = parameters
362
+
363
+ const client = await getConnectorClient(config, {
364
+ account,
365
+ assertChainId: false,
366
+ chainId,
367
+ connector,
368
+ })
369
+
370
+ return Actions.amm.mint(client, parameters as never)
371
+ }
372
+
373
+ export declare namespace mint {
374
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
375
+ ConnectorParameter &
376
+ UnionLooseOmit<
377
+ Actions.amm.mint.Parameters<config['chains'][number], Account>,
378
+ 'chain'
379
+ >
380
+
381
+ export type ReturnValue = Actions.amm.mint.ReturnValue
382
+
383
+ export type ErrorType = BaseErrorType
384
+ }
385
+
386
+ /**
387
+ * Adds liquidity to a pool.
388
+ *
389
+ * @example
390
+ * ```ts
391
+ * import { createConfig, http } from '@wagmi/core'
392
+ * import { tempo } from '@wagmi/core/chains'
393
+ * import { Actions } from '@wagmi/core/tempo'
394
+ *
395
+ * const config = createConfig({
396
+ * chains: [tempoModerato],
397
+ * transports: {
398
+ * [tempo.id]: http(),
399
+ * },
400
+ * })
401
+ *
402
+ * const result = await Actions.amm.mintSync(config, {
403
+ * userTokenAddress: '0x20c0...beef',
404
+ * validatorTokenAddress: '0x20c0...babe',
405
+ * validatorTokenAmount: 100n,
406
+ * to: '0xfeed...fede',
407
+ * })
408
+ * ```
409
+ *
410
+ * @param config - Config.
411
+ * @param parameters - Parameters.
412
+ * @returns The transaction receipt and event data.
413
+ */
414
+ export async function mintSync<config extends Config>(
415
+ config: config,
416
+ parameters: mintSync.Parameters<config>,
417
+ ): Promise<Actions.amm.mintSync.ReturnValue> {
418
+ const { account, chainId, connector } = parameters
419
+
420
+ const client = await getConnectorClient(config, {
421
+ account,
422
+ assertChainId: false,
423
+ chainId,
424
+ connector,
425
+ })
426
+
427
+ return Actions.amm.mintSync(client, parameters as never)
428
+ }
429
+
430
+ export declare namespace mintSync {
431
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
432
+ ConnectorParameter &
433
+ UnionLooseOmit<
434
+ Actions.amm.mintSync.Parameters<config['chains'][number], Account>,
435
+ 'chain'
436
+ >
437
+
438
+ export type ReturnValue = Actions.amm.mintSync.ReturnValue
439
+
440
+ export type ErrorType = BaseErrorType
441
+ }
442
+
443
+ /**
444
+ * Removes liquidity from a pool.
445
+ *
446
+ * @example
447
+ * ```ts
448
+ * import { createConfig, http } from '@wagmi/core'
449
+ * import { tempo } from '@wagmi/core/chains'
450
+ * import { Actions } from '@wagmi/core/tempo'
451
+ *
452
+ * const config = createConfig({
453
+ * chains: [tempoModerato],
454
+ * transports: {
455
+ * [tempo.id]: http(),
456
+ * },
457
+ * })
458
+ *
459
+ * const hash = await Actions.amm.burn(config, {
460
+ * userToken: '0x20c0...beef',
461
+ * validatorToken: '0x20c0...babe',
462
+ * liquidity: 50n,
463
+ * to: '0xfeed...fede',
464
+ * })
465
+ * ```
466
+ *
467
+ * @param config - Config.
468
+ * @param parameters - Parameters.
469
+ * @returns The transaction hash.
470
+ */
471
+ export async function burn<config extends Config>(
472
+ config: config,
473
+ parameters: burn.Parameters<config>,
474
+ ): Promise<Actions.amm.burn.ReturnValue> {
475
+ const { account, chainId, connector } = parameters
476
+
477
+ const client = await getConnectorClient(config, {
478
+ account,
479
+ assertChainId: false,
480
+ chainId,
481
+ connector,
482
+ })
483
+
484
+ return Actions.amm.burn(client, parameters as never)
485
+ }
486
+
487
+ export declare namespace burn {
488
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
489
+ ConnectorParameter &
490
+ UnionLooseOmit<
491
+ Actions.amm.burn.Parameters<config['chains'][number], Account>,
492
+ 'chain'
493
+ >
494
+
495
+ export type ReturnValue = Actions.amm.burn.ReturnValue
496
+
497
+ export type ErrorType = BaseErrorType
498
+ }
499
+
500
+ /**
501
+ * Removes liquidity from a pool.
502
+ *
503
+ * @example
504
+ * ```ts
505
+ * import { createConfig, http } from '@wagmi/core'
506
+ * import { tempo } from '@wagmi/core/chains'
507
+ * import { Actions } from '@wagmi/core/tempo'
508
+ *
509
+ * const config = createConfig({
510
+ * chains: [tempoModerato],
511
+ * transports: {
512
+ * [tempo.id]: http(),
513
+ * },
514
+ * })
515
+ *
516
+ * const result = await Actions.amm.burnSync(config, {
517
+ * userToken: '0x20c0...beef',
518
+ * validatorToken: '0x20c0...babe',
519
+ * liquidity: 50n,
520
+ * to: '0xfeed...fede',
521
+ * })
522
+ * ```
523
+ *
524
+ * @param config - Config.
525
+ * @param parameters - Parameters.
526
+ * @returns The transaction receipt and event data.
527
+ */
528
+ export async function burnSync<config extends Config>(
529
+ config: config,
530
+ parameters: burnSync.Parameters<config>,
531
+ ): Promise<Actions.amm.burnSync.ReturnValue> {
532
+ const { account, chainId, connector } = parameters
533
+
534
+ const client = await getConnectorClient(config, {
535
+ account,
536
+ assertChainId: false,
537
+ chainId,
538
+ connector,
539
+ })
540
+
541
+ return Actions.amm.burnSync(client, parameters as never)
542
+ }
543
+
544
+ export declare namespace burnSync {
545
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
546
+ ConnectorParameter &
547
+ UnionLooseOmit<
548
+ Actions.amm.burnSync.Parameters<config['chains'][number], Account>,
549
+ 'chain'
550
+ >
551
+
552
+ export type ReturnValue = Actions.amm.burnSync.ReturnValue
553
+
554
+ export type ErrorType = BaseErrorType
555
+ }
556
+
557
+ /**
558
+ * Watches for rebalance swap events.
559
+ *
560
+ * @example
561
+ * ```ts
562
+ * import { createConfig, http } from '@wagmi/core'
563
+ * import { tempo } from '@wagmi/core/chains'
564
+ * import { Actions } from '@wagmi/core/tempo'
565
+ *
566
+ * const config = createConfig({
567
+ * chains: [tempoModerato],
568
+ * transports: {
569
+ * [tempo.id]: http(),
570
+ * },
571
+ * })
572
+ *
573
+ * const unwatch = Actions.amm.watchRebalanceSwap(config, {
574
+ * onRebalanceSwap: (args, log) => {
575
+ * console.log('Rebalance swap:', args)
576
+ * },
577
+ * })
578
+ * ```
579
+ *
580
+ * @param config - Config.
581
+ * @param parameters - Parameters.
582
+ * @returns A function to unsubscribe from the event.
583
+ */
584
+ export function watchRebalanceSwap<config extends Config>(
585
+ config: config,
586
+ parameters: watchRebalanceSwap.Parameters<config>,
587
+ ) {
588
+ const { chainId, ...rest } = parameters
589
+ const client = config.getClient({ chainId })
590
+ return Actions.amm.watchRebalanceSwap(client, rest)
591
+ }
592
+
593
+ export declare namespace watchRebalanceSwap {
594
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
595
+ Actions.amm.watchRebalanceSwap.Parameters
596
+ }
597
+
598
+ /**
599
+ * Watches for liquidity mint events.
600
+ *
601
+ * @example
602
+ * ```ts
603
+ * import { createConfig, http } from '@wagmi/core'
604
+ * import { tempo } from '@wagmi/core/chains'
605
+ * import { Actions } from '@wagmi/core/tempo'
606
+ *
607
+ * const config = createConfig({
608
+ * chains: [tempoModerato],
609
+ * transports: {
610
+ * [tempo.id]: http(),
611
+ * },
612
+ * })
613
+ *
614
+ * const unwatch = Actions.amm.watchMint(config, {
615
+ * onMint: (args, log) => {
616
+ * console.log('Liquidity added:', args)
617
+ * },
618
+ * })
619
+ * ```
620
+ *
621
+ * @param config - Config.
622
+ * @param parameters - Parameters.
623
+ * @returns A function to unsubscribe from the event.
624
+ */
625
+ export function watchMint<config extends Config>(
626
+ config: config,
627
+ parameters: watchMint.Parameters<config>,
628
+ ) {
629
+ const { chainId, ...rest } = parameters
630
+ const client = config.getClient({ chainId })
631
+ return Actions.amm.watchMint(client, rest)
632
+ }
633
+
634
+ export declare namespace watchMint {
635
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
636
+ Actions.amm.watchMint.Parameters
637
+ }
638
+
639
+ /**
640
+ * Watches for liquidity burn events.
641
+ *
642
+ * @example
643
+ * ```ts
644
+ * import { createConfig, http } from '@wagmi/core'
645
+ * import { tempo } from '@wagmi/core/chains'
646
+ * import { Actions } from '@wagmi/core/tempo'
647
+ *
648
+ * const config = createConfig({
649
+ * chains: [tempoModerato],
650
+ * transports: {
651
+ * [tempo.id]: http(),
652
+ * },
653
+ * })
654
+ *
655
+ * const unwatch = Actions.amm.watchBurn(config, {
656
+ * onBurn: (args, log) => {
657
+ * console.log('Liquidity removed:', args)
658
+ * },
659
+ * })
660
+ * ```
661
+ *
662
+ * @param config - Config.
663
+ * @param parameters - Parameters.
664
+ * @returns A function to unsubscribe from the event.
665
+ */
666
+ export function watchBurn<config extends Config>(
667
+ config: config,
668
+ parameters: watchBurn.Parameters<config>,
669
+ ) {
670
+ const { chainId, ...rest } = parameters
671
+ const client = config.getClient({ chainId })
672
+ return Actions.amm.watchBurn(client, rest)
673
+ }
674
+
675
+ export declare namespace watchBurn {
676
+ export type Parameters<config extends Config> = ChainIdParameter<config> &
677
+ Actions.amm.watchBurn.Parameters
678
+ }