viem 2.43.5 → 2.44.1

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 (229) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js +11 -1
  3. package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -1
  4. package/_cjs/actions/wallet/sendTransactionSync.js +1 -0
  5. package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -1
  6. package/_cjs/chains/definitions/codex.js +47 -0
  7. package/_cjs/chains/definitions/codex.js.map +1 -0
  8. package/_cjs/chains/definitions/codexTestnet.js +47 -0
  9. package/_cjs/chains/definitions/codexTestnet.js.map +1 -0
  10. package/_cjs/chains/definitions/paseoPassetHub.js +26 -0
  11. package/_cjs/chains/definitions/paseoPassetHub.js.map +1 -0
  12. package/_cjs/chains/definitions/{tempoTestnet.js → tempoAndantino.js} +5 -5
  13. package/_cjs/chains/definitions/tempoAndantino.js.map +1 -0
  14. package/_cjs/chains/definitions/tempoDevnet.js +6 -0
  15. package/_cjs/chains/definitions/tempoDevnet.js.map +1 -1
  16. package/_cjs/chains/definitions/tempoModerato.js +28 -0
  17. package/_cjs/chains/definitions/tempoModerato.js.map +1 -0
  18. package/_cjs/chains/index.js +23 -14
  19. package/_cjs/chains/index.js.map +1 -1
  20. package/_cjs/errors/version.js +1 -1
  21. package/_cjs/index.js.map +1 -1
  22. package/_cjs/tempo/Abis.js +610 -752
  23. package/_cjs/tempo/Abis.js.map +1 -1
  24. package/_cjs/tempo/Addresses.js +2 -2
  25. package/_cjs/tempo/Addresses.js.map +1 -1
  26. package/_cjs/tempo/Decorator.js +5 -5
  27. package/_cjs/tempo/Decorator.js.map +1 -1
  28. package/_cjs/tempo/actions/amm.js +4 -38
  29. package/_cjs/tempo/actions/amm.js.map +1 -1
  30. package/_cjs/tempo/actions/dex.js +98 -46
  31. package/_cjs/tempo/actions/dex.js.map +1 -1
  32. package/_cjs/tempo/actions/nonce.js +0 -35
  33. package/_cjs/tempo/actions/nonce.js.map +1 -1
  34. package/_cjs/tempo/actions/reward.js +81 -62
  35. package/_cjs/tempo/actions/reward.js.map +1 -1
  36. package/_cjs/tempo/actions/token.js +11 -2
  37. package/_cjs/tempo/actions/token.js.map +1 -1
  38. package/_cjs/tempo/chainConfig.js +7 -6
  39. package/_cjs/tempo/chainConfig.js.map +1 -1
  40. package/_cjs/tempo/index.js +2 -1
  41. package/_cjs/tempo/index.js.map +1 -1
  42. package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js +16 -2
  43. package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -1
  44. package/_esm/actions/wallet/sendTransactionSync.js +1 -0
  45. package/_esm/actions/wallet/sendTransactionSync.js.map +1 -1
  46. package/_esm/chains/definitions/codex.js +44 -0
  47. package/_esm/chains/definitions/codex.js.map +1 -0
  48. package/_esm/chains/definitions/codexTestnet.js +44 -0
  49. package/_esm/chains/definitions/codexTestnet.js.map +1 -0
  50. package/_esm/chains/definitions/paseoPassetHub.js +23 -0
  51. package/_esm/chains/definitions/paseoPassetHub.js.map +1 -0
  52. package/_esm/chains/definitions/{tempoTestnet.js → tempoAndantino.js} +4 -4
  53. package/_esm/chains/definitions/tempoAndantino.js.map +1 -0
  54. package/_esm/chains/definitions/tempoDevnet.js +6 -0
  55. package/_esm/chains/definitions/tempoDevnet.js.map +1 -1
  56. package/_esm/chains/definitions/tempoModerato.js +25 -0
  57. package/_esm/chains/definitions/tempoModerato.js.map +1 -0
  58. package/_esm/chains/index.js +9 -1
  59. package/_esm/chains/index.js.map +1 -1
  60. package/_esm/errors/version.js +1 -1
  61. package/_esm/index.js.map +1 -1
  62. package/_esm/tempo/Abis.js +609 -751
  63. package/_esm/tempo/Abis.js.map +1 -1
  64. package/_esm/tempo/Addresses.js +1 -1
  65. package/_esm/tempo/Addresses.js.map +1 -1
  66. package/_esm/tempo/Decorator.js +5 -5
  67. package/_esm/tempo/Decorator.js.map +1 -1
  68. package/_esm/tempo/actions/amm.js +4 -62
  69. package/_esm/tempo/actions/amm.js.map +1 -1
  70. package/_esm/tempo/actions/dex.js +192 -48
  71. package/_esm/tempo/actions/dex.js.map +1 -1
  72. package/_esm/tempo/actions/nonce.js +0 -94
  73. package/_esm/tempo/actions/nonce.js.map +1 -1
  74. package/_esm/tempo/actions/reward.js +227 -189
  75. package/_esm/tempo/actions/reward.js.map +1 -1
  76. package/_esm/tempo/actions/token.js +11 -2
  77. package/_esm/tempo/actions/token.js.map +1 -1
  78. package/_esm/tempo/chainConfig.js +5 -3
  79. package/_esm/tempo/chainConfig.js.map +1 -1
  80. package/_esm/tempo/index.js +1 -1
  81. package/_esm/tempo/index.js.map +1 -1
  82. package/_types/account-abstraction/utils/userOperation/toPackedUserOperation.d.ts.map +1 -1
  83. package/_types/actions/wallet/sendTransactionSync.d.ts.map +1 -1
  84. package/_types/celo/chainConfig.d.ts +22 -22
  85. package/_types/celo/formatters.d.ts +11 -11
  86. package/_types/chains/definitions/abstract.d.ts +14 -14
  87. package/_types/chains/definitions/abstractTestnet.d.ts +14 -14
  88. package/_types/chains/definitions/ancient8.d.ts +3 -3
  89. package/_types/chains/definitions/ancient8Sepolia.d.ts +3 -3
  90. package/_types/chains/definitions/base.d.ts +6 -6
  91. package/_types/chains/definitions/baseGoerli.d.ts +3 -3
  92. package/_types/chains/definitions/baseSepolia.d.ts +6 -6
  93. package/_types/chains/definitions/blast.d.ts +3 -3
  94. package/_types/chains/definitions/bob.d.ts +3 -3
  95. package/_types/chains/definitions/bobSepolia.d.ts +3 -3
  96. package/_types/chains/definitions/celo.d.ts +22 -22
  97. package/_types/chains/definitions/celoAlfajores.d.ts +22 -22
  98. package/_types/chains/definitions/celoSepolia.d.ts +22 -22
  99. package/_types/chains/definitions/codex.d.ts +310 -0
  100. package/_types/chains/definitions/codex.d.ts.map +1 -0
  101. package/_types/chains/definitions/codexTestnet.d.ts +310 -0
  102. package/_types/chains/definitions/codexTestnet.d.ts.map +1 -0
  103. package/_types/chains/definitions/dchain.d.ts +3 -3
  104. package/_types/chains/definitions/dchainTestnet.d.ts +3 -3
  105. package/_types/chains/definitions/elysiumTestnet.d.ts +3 -3
  106. package/_types/chains/definitions/fraxtal.d.ts +3 -3
  107. package/_types/chains/definitions/fraxtalTestnet.d.ts +3 -3
  108. package/_types/chains/definitions/funkiMainnet.d.ts +3 -3
  109. package/_types/chains/definitions/funkiSepolia.d.ts +3 -3
  110. package/_types/chains/definitions/garnet.d.ts +3 -3
  111. package/_types/chains/definitions/giwaSepolia.d.ts +6 -6
  112. package/_types/chains/definitions/ink.d.ts +3 -3
  113. package/_types/chains/definitions/inkSepolia.d.ts +3 -3
  114. package/_types/chains/definitions/lisk.d.ts +3 -3
  115. package/_types/chains/definitions/liskSepolia.d.ts +3 -3
  116. package/_types/chains/definitions/metalL2.d.ts +3 -3
  117. package/_types/chains/definitions/mode.d.ts +3 -3
  118. package/_types/chains/definitions/modeTestnet.d.ts +3 -3
  119. package/_types/chains/definitions/optimism.d.ts +3 -3
  120. package/_types/chains/definitions/optimismGoerli.d.ts +3 -3
  121. package/_types/chains/definitions/optimismSepolia.d.ts +3 -3
  122. package/_types/chains/definitions/paseoPassetHub.d.ts +48 -0
  123. package/_types/chains/definitions/paseoPassetHub.d.ts.map +1 -0
  124. package/_types/chains/definitions/pgn.d.ts +3 -3
  125. package/_types/chains/definitions/pgnTestnet.d.ts +3 -3
  126. package/_types/chains/definitions/playfiAlbireo.d.ts +14 -14
  127. package/_types/chains/definitions/pyrope.d.ts +3 -3
  128. package/_types/chains/definitions/redstone.d.ts +3 -3
  129. package/_types/chains/definitions/rss3.d.ts +3 -3
  130. package/_types/chains/definitions/rss3Sepolia.d.ts +3 -3
  131. package/_types/chains/definitions/shape.d.ts +3 -3
  132. package/_types/chains/definitions/shapeSepolia.d.ts +3 -3
  133. package/_types/chains/definitions/snax.d.ts +3 -3
  134. package/_types/chains/definitions/snaxTestnet.d.ts +3 -3
  135. package/_types/chains/definitions/soneium.d.ts +3 -3
  136. package/_types/chains/definitions/soneiumMinato.d.ts +3 -3
  137. package/_types/chains/definitions/sophon.d.ts +14 -14
  138. package/_types/chains/definitions/sophonTestnet.d.ts +14 -14
  139. package/_types/chains/definitions/superseed.d.ts +3 -3
  140. package/_types/chains/definitions/superseedSepolia.d.ts +3 -3
  141. package/_types/chains/definitions/swellchain.d.ts +3 -3
  142. package/_types/chains/definitions/swellchainTestnet.d.ts +3 -3
  143. package/_types/chains/definitions/{tempoTestnet.d.ts → tempoAndantino.d.ts} +34 -34
  144. package/_types/chains/definitions/tempoAndantino.d.ts.map +1 -0
  145. package/_types/chains/definitions/tempoDevnet.d.ts +39 -39
  146. package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
  147. package/_types/chains/definitions/tempoLocalnet.d.ts +28 -28
  148. package/_types/chains/definitions/tempoModerato.d.ts +916 -0
  149. package/_types/chains/definitions/{tempoTestnet.d.ts.map → tempoModerato.d.ts.map} +1 -1
  150. package/_types/chains/definitions/treasure.d.ts +14 -14
  151. package/_types/chains/definitions/treasureTopaz.d.ts +14 -14
  152. package/_types/chains/definitions/unichain.d.ts +3 -3
  153. package/_types/chains/definitions/unichainSepolia.d.ts +3 -3
  154. package/_types/chains/definitions/worldchain.d.ts +3 -3
  155. package/_types/chains/definitions/worldchainSepolia.d.ts +3 -3
  156. package/_types/chains/definitions/zircuit.d.ts +3 -3
  157. package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts +3 -3
  158. package/_types/chains/definitions/zircuitTestnet.d.ts +3 -3
  159. package/_types/chains/definitions/zksync.d.ts +14 -14
  160. package/_types/chains/definitions/zksyncInMemoryNode.d.ts +14 -14
  161. package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +14 -14
  162. package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +14 -14
  163. package/_types/chains/definitions/zksyncLocalNode.d.ts +14 -14
  164. package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +14 -14
  165. package/_types/chains/definitions/zora.d.ts +3 -3
  166. package/_types/chains/definitions/zoraSepolia.d.ts +3 -3
  167. package/_types/chains/definitions/zoraTestnet.d.ts +3 -3
  168. package/_types/chains/index.d.ts +9 -1
  169. package/_types/chains/index.d.ts.map +1 -1
  170. package/_types/errors/version.d.ts +1 -1
  171. package/_types/index.d.ts +2 -0
  172. package/_types/index.d.ts.map +1 -1
  173. package/_types/op-stack/chainConfig.d.ts +3 -3
  174. package/_types/op-stack/formatters.d.ts +3 -3
  175. package/_types/tempo/Abis.d.ts +937 -1194
  176. package/_types/tempo/Abis.d.ts.map +1 -1
  177. package/_types/tempo/Addresses.d.ts +1 -1
  178. package/_types/tempo/Addresses.d.ts.map +1 -1
  179. package/_types/tempo/Decorator.d.ts +91 -85
  180. package/_types/tempo/Decorator.d.ts.map +1 -1
  181. package/_types/tempo/actions/amm.d.ts +19 -360
  182. package/_types/tempo/actions/amm.d.ts.map +1 -1
  183. package/_types/tempo/actions/dex.d.ts +765 -237
  184. package/_types/tempo/actions/dex.d.ts.map +1 -1
  185. package/_types/tempo/actions/fee.d.ts +30 -11
  186. package/_types/tempo/actions/fee.d.ts.map +1 -1
  187. package/_types/tempo/actions/nonce.d.ts +0 -105
  188. package/_types/tempo/actions/nonce.d.ts.map +1 -1
  189. package/_types/tempo/actions/policy.d.ts +60 -0
  190. package/_types/tempo/actions/policy.d.ts.map +1 -1
  191. package/_types/tempo/actions/reward.d.ts +350 -526
  192. package/_types/tempo/actions/reward.d.ts.map +1 -1
  193. package/_types/tempo/actions/token.d.ts +368 -1984
  194. package/_types/tempo/actions/token.d.ts.map +1 -1
  195. package/_types/tempo/chainConfig.d.ts +15 -16
  196. package/_types/tempo/chainConfig.d.ts.map +1 -1
  197. package/_types/tempo/index.d.ts +1 -1
  198. package/_types/tempo/index.d.ts.map +1 -1
  199. package/_types/tempo/internal/types.d.ts +1 -1
  200. package/_types/tempo/internal/types.d.ts.map +1 -1
  201. package/_types/utils/formatters/transaction.d.ts +1 -1
  202. package/_types/utils/formatters/transactionRequest.d.ts +1 -1
  203. package/_types/zksync/chainConfig.d.ts +14 -14
  204. package/_types/zksync/formatters.d.ts +14 -14
  205. package/account-abstraction/utils/userOperation/toPackedUserOperation.ts +17 -2
  206. package/actions/wallet/sendTransactionSync.ts +1 -0
  207. package/chains/definitions/codex.ts +45 -0
  208. package/chains/definitions/codexTestnet.ts +45 -0
  209. package/chains/definitions/paseoPassetHub.ts +23 -0
  210. package/chains/definitions/{tempoTestnet.ts → tempoAndantino.ts} +3 -3
  211. package/chains/definitions/tempoDevnet.ts +6 -0
  212. package/chains/definitions/tempoModerato.ts +25 -0
  213. package/chains/index.ts +10 -1
  214. package/errors/version.ts +1 -1
  215. package/index.ts +9 -0
  216. package/package.json +2 -2
  217. package/tempo/Abis.ts +607 -752
  218. package/tempo/Addresses.ts +1 -1
  219. package/tempo/Decorator.ts +115 -106
  220. package/tempo/actions/amm.ts +13 -115
  221. package/tempo/actions/dex.ts +274 -72
  222. package/tempo/actions/nonce.ts +0 -148
  223. package/tempo/actions/reward.ts +310 -257
  224. package/tempo/actions/token.ts +16 -2
  225. package/tempo/chainConfig.ts +7 -4
  226. package/tempo/index.ts +1 -1
  227. package/tempo/internal/types.ts +6 -1
  228. package/_cjs/chains/definitions/tempoTestnet.js.map +0 -1
  229. package/_esm/chains/definitions/tempoTestnet.js.map +0 -1
@@ -4,6 +4,6 @@ export const accountRegistrar = '0x7702ac0000000000000000000000000000000000'
4
4
  export const feeManager = '0xfeec000000000000000000000000000000000000'
5
5
  export const nonceManager = '0x4e4F4E4345000000000000000000000000000000'
6
6
  export const pathUsd = '0x20c0000000000000000000000000000000000000'
7
- export const stablecoinExchange = '0xdec0000000000000000000000000000000000000'
7
+ export const stablecoinDex = '0xdec0000000000000000000000000000000000000'
8
8
  export const tip20Factory = '0x20fc000000000000000000000000000000000000'
9
9
  export const tip403Registry = '0x403c000000000000000000000000000000000000'
@@ -277,31 +277,6 @@ export type Decorator<
277
277
  * @returns A function to unsubscribe from the event.
278
278
  */
279
279
  watchBurn: (parameters: ammActions.watchBurn.Parameters) => () => void
280
- /**
281
- * Watches for fee swap events.
282
- *
283
- * @example
284
- * ```ts
285
- * import { createClient, http } from 'viem'
286
- * import { tempo } from 'tempo.ts/chains'
287
- * import { tempoActions } from 'tempo.ts/viem'
288
- *
289
- * const client = createClient({
290
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
291
- * transport: http(),
292
- * }).extend(tempoActions())
293
- *
294
- * const unwatch = client.amm.watchFeeSwap({
295
- * onFeeSwap: (args, log) => {
296
- * console.log('Fee swap:', args)
297
- * },
298
- * })
299
- * ```
300
- *
301
- * @param parameters - Parameters.
302
- * @returns A function to unsubscribe from the event.
303
- */
304
- watchFeeSwap: (parameters: ammActions.watchFeeSwap.Parameters) => () => void
305
280
  /**
306
281
  * Watches for liquidity mint events.
307
282
  *
@@ -470,6 +445,66 @@ export type Decorator<
470
445
  cancelSync: (
471
446
  parameters: dexActions.cancelSync.Parameters<chain, account>,
472
447
  ) => Promise<dexActions.cancelSync.ReturnValue>
448
+ /**
449
+ * Cancels a stale order from the orderbook.
450
+ *
451
+ * A stale order is one where the maker has been blacklisted by a TIP-403 policy.
452
+ * Anyone can cancel stale orders.
453
+ *
454
+ * @example
455
+ * ```ts
456
+ * import { createClient, http } from 'viem'
457
+ * import { privateKeyToAccount } from 'viem/accounts'
458
+ * import { tempo } from 'tempo.ts/chains'
459
+ * import { tempoActions } from 'tempo.ts/viem'
460
+ *
461
+ * const client = createClient({
462
+ * account: privateKeyToAccount('0x...'),
463
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
464
+ * transport: http(),
465
+ * }).extend(tempoActions())
466
+ *
467
+ * const hash = await client.dex.cancelStale({
468
+ * orderId: 123n,
469
+ * })
470
+ * ```
471
+ *
472
+ * @param parameters - Parameters.
473
+ * @returns The transaction hash.
474
+ */
475
+ cancelStale: (
476
+ parameters: dexActions.cancelStale.Parameters<chain, account>,
477
+ ) => Promise<dexActions.cancelStale.ReturnValue>
478
+ /**
479
+ * Cancels a stale order from the orderbook and waits for confirmation.
480
+ *
481
+ * A stale order is one where the maker has been blacklisted by a TIP-403 policy.
482
+ * Anyone can cancel stale orders.
483
+ *
484
+ * @example
485
+ * ```ts
486
+ * import { createClient, http } from 'viem'
487
+ * import { privateKeyToAccount } from 'viem/accounts'
488
+ * import { tempo } from 'tempo.ts/chains'
489
+ * import { tempoActions } from 'tempo.ts/viem'
490
+ *
491
+ * const client = createClient({
492
+ * account: privateKeyToAccount('0x...'),
493
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
494
+ * transport: http(),
495
+ * }).extend(tempoActions())
496
+ *
497
+ * const result = await client.dex.cancelStaleSync({
498
+ * orderId: 123n,
499
+ * })
500
+ * ```
501
+ *
502
+ * @param parameters - Parameters.
503
+ * @returns The transaction receipt and event data.
504
+ */
505
+ cancelStaleSync: (
506
+ parameters: dexActions.cancelStaleSync.Parameters<chain, account>,
507
+ ) => Promise<dexActions.cancelStaleSync.ReturnValue>
473
508
  /**
474
509
  * Creates a new trading pair on the DEX.
475
510
  *
@@ -1589,30 +1624,61 @@ export type Decorator<
1589
1624
  parameters: rewardActions.claimSync.Parameters<chain, account>,
1590
1625
  ) => Promise<rewardActions.claimSync.ReturnValue>
1591
1626
  /**
1592
- * Gets the total reward per second rate for all active streams.
1627
+ * Distributes rewards to opted-in token holders.
1628
+ *
1629
+ * @example
1630
+ * ```ts
1631
+ * import { createClient, http } from 'viem'
1632
+ * import { privateKeyToAccount } from 'viem/accounts'
1633
+ * import { tempo } from 'tempo.ts/chains'
1634
+ * import { tempoActions } from 'tempo.ts/viem'
1635
+ *
1636
+ * const client = createClient({
1637
+ * account: privateKeyToAccount('0x...'),
1638
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1639
+ * transport: http(),
1640
+ * }).extend(tempoActions())
1641
+ *
1642
+ * const hash = await client.reward.distribute({
1643
+ * amount: 100000000000000000000n,
1644
+ * token: '0x20c0000000000000000000000000000000000001',
1645
+ * })
1646
+ * ```
1647
+ *
1648
+ * @param parameters - Parameters.
1649
+ * @returns The transaction hash.
1650
+ */
1651
+ distribute: (
1652
+ parameters: rewardActions.distribute.Parameters<chain, account>,
1653
+ ) => Promise<rewardActions.distribute.ReturnValue>
1654
+ /**
1655
+ * Distributes rewards to opted-in token holders and waits for confirmation.
1593
1656
  *
1594
1657
  * @example
1595
1658
  * ```ts
1596
1659
  * import { createClient, http } from 'viem'
1660
+ * import { privateKeyToAccount } from 'viem/accounts'
1597
1661
  * import { tempo } from 'tempo.ts/chains'
1598
1662
  * import { tempoActions } from 'tempo.ts/viem'
1599
1663
  *
1600
1664
  * const client = createClient({
1665
+ * account: privateKeyToAccount('0x...'),
1601
1666
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1602
1667
  * transport: http(),
1603
1668
  * }).extend(tempoActions())
1604
1669
  *
1605
- * const rate = await client.reward.getTotalPerSecond({
1670
+ * const { funder, amount, receipt } = await client.reward.distributeSync({
1671
+ * amount: 100000000000000000000n,
1606
1672
  * token: '0x20c0000000000000000000000000000000000001',
1607
1673
  * })
1608
1674
  * ```
1609
1675
  *
1610
1676
  * @param parameters - Parameters.
1611
- * @returns The total reward per second (scaled by 1e18).
1677
+ * @returns The funder, amount, and transaction receipt.
1612
1678
  */
1613
- getTotalPerSecond: (
1614
- parameters: rewardActions.getTotalPerSecond.Parameters,
1615
- ) => Promise<rewardActions.getTotalPerSecond.ReturnValue>
1679
+ distributeSync: (
1680
+ parameters: rewardActions.distributeSync.Parameters<chain, account>,
1681
+ ) => Promise<rewardActions.distributeSync.ReturnValue>
1616
1682
  /**
1617
1683
  * Gets the reward information for a specific account.
1618
1684
  *
@@ -1696,63 +1762,33 @@ export type Decorator<
1696
1762
  parameters: rewardActions.setRecipientSync.Parameters<chain, account>,
1697
1763
  ) => Promise<rewardActions.setRecipientSync.ReturnValue>
1698
1764
  /**
1699
- * Starts a new reward stream that distributes tokens to opted-in holders.
1700
- *
1701
- * @example
1702
- * ```ts
1703
- * import { createClient, http } from 'viem'
1704
- * import { privateKeyToAccount } from 'viem/accounts'
1705
- * import { tempo } from 'tempo.ts/chains'
1706
- * import { tempoActions } from 'tempo.ts/viem'
1707
- *
1708
- * const client = createClient({
1709
- * account: privateKeyToAccount('0x...'),
1710
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1711
- * transport: http(),
1712
- * }).extend(tempoActions())
1713
- *
1714
- * const hash = await client.reward.start({
1715
- * amount: 100000000000000000000n,
1716
- * seconds: 86400,
1717
- * token: '0x20c0000000000000000000000000000000000001',
1718
- * })
1719
- * ```
1720
- *
1721
- * @param parameters - Parameters.
1722
- * @returns The transaction hash.
1723
- */
1724
- start: (
1725
- parameters: rewardActions.start.Parameters<chain, account>,
1726
- ) => Promise<rewardActions.start.ReturnValue>
1727
- /**
1728
- * Starts a new reward stream that distributes tokens to opted-in holders and waits for confirmation.
1765
+ * Watches for reward distributed events.
1729
1766
  *
1730
1767
  * @example
1731
1768
  * ```ts
1732
1769
  * import { createClient, http } from 'viem'
1733
- * import { privateKeyToAccount } from 'viem/accounts'
1734
1770
  * import { tempo } from 'tempo.ts/chains'
1735
1771
  * import { tempoActions } from 'tempo.ts/viem'
1736
1772
  *
1737
1773
  * const client = createClient({
1738
- * account: privateKeyToAccount('0x...'),
1739
1774
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1740
1775
  * transport: http(),
1741
1776
  * }).extend(tempoActions())
1742
1777
  *
1743
- * const result = await client.reward.startSync({
1744
- * amount: 100000000000000000000n,
1745
- * seconds: 86400,
1778
+ * const unwatch = client.reward.watchRewardDistributed({
1746
1779
  * token: '0x20c0000000000000000000000000000000000001',
1780
+ * onRewardDistributed: (args, log) => {
1781
+ * console.log('Reward distributed:', args)
1782
+ * },
1747
1783
  * })
1748
1784
  * ```
1749
1785
  *
1750
1786
  * @param parameters - Parameters.
1751
- * @returns The transaction receipt and event data.
1787
+ * @returns A function to unsubscribe from the event.
1752
1788
  */
1753
- startSync: (
1754
- parameters: rewardActions.startSync.Parameters<chain, account>,
1755
- ) => Promise<rewardActions.startSync.ReturnValue>
1789
+ watchRewardDistributed: (
1790
+ parameters: rewardActions.watchRewardDistributed.Parameters,
1791
+ ) => () => void
1756
1792
  /**
1757
1793
  * Watches for reward recipient set events.
1758
1794
  *
@@ -1781,34 +1817,6 @@ export type Decorator<
1781
1817
  watchRewardRecipientSet: (
1782
1818
  parameters: rewardActions.watchRewardRecipientSet.Parameters,
1783
1819
  ) => () => void
1784
- /**
1785
- * Watches for reward scheduled events.
1786
- *
1787
- * @example
1788
- * ```ts
1789
- * import { createClient, http } from 'viem'
1790
- * import { tempo } from 'tempo.ts/chains'
1791
- * import { tempoActions } from 'tempo.ts/viem'
1792
- *
1793
- * const client = createClient({
1794
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1795
- * transport: http(),
1796
- * }).extend(tempoActions())
1797
- *
1798
- * const unwatch = client.reward.watchRewardScheduled({
1799
- * token: '0x20c0000000000000000000000000000000000001',
1800
- * onRewardScheduled: (args, log) => {
1801
- * console.log('Reward scheduled:', args)
1802
- * },
1803
- * })
1804
- * ```
1805
- *
1806
- * @param parameters - Parameters.
1807
- * @returns A function to unsubscribe from the event.
1808
- */
1809
- watchRewardScheduled: (
1810
- parameters: rewardActions.watchRewardScheduled.Parameters,
1811
- ) => () => void
1812
1820
  }
1813
1821
  token: {
1814
1822
  /**
@@ -2980,8 +2988,6 @@ export function decorator() {
2980
2988
  rebalanceSwapSync: (parameters) =>
2981
2989
  ammActions.rebalanceSwapSync(client, parameters),
2982
2990
  watchBurn: (parameters) => ammActions.watchBurn(client, parameters),
2983
- watchFeeSwap: (parameters) =>
2984
- ammActions.watchFeeSwap(client, parameters),
2985
2991
  watchMint: (parameters) => ammActions.watchMint(client, parameters),
2986
2992
  watchRebalanceSwap: (parameters) =>
2987
2993
  ammActions.watchRebalanceSwap(client, parameters),
@@ -2991,6 +2997,9 @@ export function decorator() {
2991
2997
  buySync: (parameters) => dexActions.buySync(client, parameters),
2992
2998
  cancel: (parameters) => dexActions.cancel(client, parameters),
2993
2999
  cancelSync: (parameters) => dexActions.cancelSync(client, parameters),
3000
+ cancelStale: (parameters) => dexActions.cancelStale(client, parameters),
3001
+ cancelStaleSync: (parameters) =>
3002
+ dexActions.cancelStaleSync(client, parameters),
2994
3003
  createPair: (parameters) => dexActions.createPair(client, parameters),
2995
3004
  createPairSync: (parameters) =>
2996
3005
  dexActions.createPairSync(client, parameters),
@@ -3065,20 +3074,20 @@ export function decorator() {
3065
3074
  reward: {
3066
3075
  claim: (parameters) => rewardActions.claim(client, parameters),
3067
3076
  claimSync: (parameters) => rewardActions.claimSync(client, parameters),
3068
- getTotalPerSecond: (parameters) =>
3069
- rewardActions.getTotalPerSecond(client, parameters),
3077
+ distribute: (parameters) =>
3078
+ rewardActions.distribute(client, parameters),
3079
+ distributeSync: (parameters) =>
3080
+ rewardActions.distributeSync(client, parameters),
3070
3081
  getUserRewardInfo: (parameters) =>
3071
3082
  rewardActions.getUserRewardInfo(client, parameters),
3072
3083
  setRecipient: (parameters) =>
3073
3084
  rewardActions.setRecipient(client, parameters),
3074
3085
  setRecipientSync: (parameters) =>
3075
3086
  rewardActions.setRecipientSync(client, parameters),
3076
- start: (parameters) => rewardActions.start(client, parameters),
3077
- startSync: (parameters) => rewardActions.startSync(client, parameters),
3087
+ watchRewardDistributed: (parameters) =>
3088
+ rewardActions.watchRewardDistributed(client, parameters),
3078
3089
  watchRewardRecipientSet: (parameters) =>
3079
3090
  rewardActions.watchRewardRecipientSet(client, parameters),
3080
- watchRewardScheduled: (parameters) =>
3081
- rewardActions.watchRewardScheduled(client, parameters),
3082
3091
  },
3083
3092
  token: {
3084
3093
  approve: (parameters) => tokenActions.approve(client, parameters),
@@ -568,7 +568,7 @@ export namespace mint {
568
568
  return defineCall({
569
569
  address: Addresses.feeManager,
570
570
  abi: Abis.feeAmm,
571
- functionName: 'mintWithValidatorToken',
571
+ functionName: 'mint',
572
572
  args: [
573
573
  TokenId.toAddress(userTokenAddress),
574
574
  TokenId.toAddress(validatorTokenAddress),
@@ -958,86 +958,6 @@ export declare namespace watchRebalanceSwap {
958
958
  }
959
959
  }
960
960
 
961
- /**
962
- * Watches for fee swap events.
963
- *
964
- * @example
965
- * ```ts
966
- * import { createClient, http } from 'viem'
967
- * import { tempo } from 'tempo.ts/chains'
968
- * import { Actions } from 'tempo.ts/viem'
969
- *
970
- * const client = createClient({
971
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
972
- * transport: http(),
973
- * })
974
- *
975
- * const unwatch = actions.amm.watchFeeSwap(client, {
976
- * onFeeSwap: (args, log) => {
977
- * console.log('Fee swap:', args)
978
- * },
979
- * })
980
- * ```
981
- *
982
- * @param client - Client.
983
- * @param parameters - Parameters.
984
- * @returns A function to unsubscribe from the event.
985
- */
986
- export function watchFeeSwap<
987
- chain extends Chain | undefined,
988
- account extends Account | undefined,
989
- >(
990
- client: Client<Transport, chain, account>,
991
- parameters: watchFeeSwap.Parameters,
992
- ) {
993
- const { onFeeSwap, userToken, validatorToken, ...rest } = parameters
994
- return watchContractEvent(client, {
995
- ...rest,
996
- address: Addresses.feeManager,
997
- abi: Abis.feeAmm,
998
- eventName: 'FeeSwap',
999
- args:
1000
- userToken !== undefined && validatorToken !== undefined
1001
- ? {
1002
- userToken: TokenId.toAddress(userToken),
1003
- validatorToken: TokenId.toAddress(validatorToken),
1004
- }
1005
- : undefined,
1006
- onLogs: (logs) => {
1007
- for (const log of logs) onFeeSwap(log.args, log)
1008
- },
1009
- strict: true,
1010
- })
1011
- }
1012
-
1013
- export declare namespace watchFeeSwap {
1014
- export type Args = GetEventArgs<
1015
- typeof Abis.feeAmm,
1016
- 'FeeSwap',
1017
- { IndexedOnly: false; Required: true }
1018
- >
1019
-
1020
- export type Log = viem_Log<
1021
- bigint,
1022
- number,
1023
- false,
1024
- ExtractAbiItem<typeof Abis.feeAmm, 'FeeSwap'>,
1025
- true
1026
- >
1027
-
1028
- export type Parameters = UnionOmit<
1029
- WatchContractEventParameters<typeof Abis.feeAmm, 'FeeSwap', true>,
1030
- 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
1031
- > & {
1032
- /** Callback to invoke when a fee swap occurs. */
1033
- onFeeSwap: (args: Args, log: Log) => void
1034
- /** Address or ID of the user token to filter events. */
1035
- userToken?: TokenId.TokenIdOrAddress | undefined
1036
- /** Address or ID of the validator token to filter events. */
1037
- validatorToken?: TokenId.TokenIdOrAddress | undefined
1038
- }
1039
- }
1040
-
1041
961
  /**
1042
962
  * Watches for liquidity mint events.
1043
963
  *
@@ -1067,16 +987,14 @@ export function watchMint<
1067
987
  chain extends Chain | undefined,
1068
988
  account extends Account | undefined,
1069
989
  >(client: Client<Transport, chain, account>, parameters: watchMint.Parameters) {
1070
- const { onMint, sender, userToken, validatorToken, ...rest } = parameters
990
+ const { onMint, to, userToken, validatorToken, ...rest } = parameters
1071
991
  return watchContractEvent(client, {
1072
992
  ...rest,
1073
993
  address: Addresses.feeManager,
1074
994
  abi: Abis.feeAmm,
1075
995
  eventName: 'Mint',
1076
996
  args: {
1077
- ...(sender !== undefined && {
1078
- sender: TokenId.toAddress(sender),
1079
- }),
997
+ to,
1080
998
  ...(userToken !== undefined && {
1081
999
  userToken: TokenId.toAddress(userToken),
1082
1000
  }),
@@ -1085,40 +1003,18 @@ export function watchMint<
1085
1003
  }),
1086
1004
  },
1087
1005
  onLogs: (logs) => {
1088
- for (const log of logs)
1089
- onMint(
1090
- {
1091
- liquidity: log.args.liquidity,
1092
- sender: log.args.sender,
1093
- userToken: {
1094
- address: log.args.userToken,
1095
- amount: log.args.amountUserToken,
1096
- },
1097
- validatorToken: {
1098
- address: log.args.validatorToken,
1099
- amount: log.args.amountValidatorToken,
1100
- },
1101
- },
1102
- log,
1103
- )
1006
+ for (const log of logs) onMint(log.args, log)
1104
1007
  },
1105
1008
  strict: true,
1106
1009
  })
1107
1010
  }
1108
1011
 
1109
1012
  export declare namespace watchMint {
1110
- export type Args = {
1111
- liquidity: bigint
1112
- sender: Address
1113
- userToken: {
1114
- address: Address
1115
- amount: bigint
1116
- }
1117
- validatorToken: {
1118
- address: Address
1119
- amount: bigint
1120
- }
1121
- }
1013
+ export type Args = GetEventArgs<
1014
+ typeof Abis.feeAmm,
1015
+ 'Mint',
1016
+ { IndexedOnly: false; Required: true }
1017
+ >
1122
1018
 
1123
1019
  export type Log = viem_Log<
1124
1020
  bigint,
@@ -1134,8 +1030,10 @@ export declare namespace watchMint {
1134
1030
  > & {
1135
1031
  /** Callback to invoke when liquidity is added. */
1136
1032
  onMint: (args: Args, log: Log) => void
1137
- /** Address or ID of the sender to filter events. */
1138
- sender?: TokenId.TokenIdOrAddress | undefined
1033
+ /** Address of the sender to filter events. */
1034
+ sender?: Address | undefined
1035
+ /** Address of the recipient to filter events. */
1036
+ to?: Address | undefined
1139
1037
  /** Address or ID of the user token to filter events. */
1140
1038
  userToken?: TokenId.TokenIdOrAddress | undefined
1141
1039
  /** Address or ID of the validator token to filter events. */