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