viem 2.44.2 → 2.45.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 (217) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +4 -2
  3. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
  4. package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
  5. package/_cjs/account-abstraction/clients/createBundlerClient.js +8 -2
  6. package/_cjs/account-abstraction/clients/createBundlerClient.js.map +1 -1
  7. package/_cjs/actions/public/estimateContractGas.js +3 -1
  8. package/_cjs/actions/public/estimateContractGas.js.map +1 -1
  9. package/_cjs/actions/public/simulateContract.js +3 -1
  10. package/_cjs/actions/public/simulateContract.js.map +1 -1
  11. package/_cjs/actions/wallet/sendCalls.js +17 -1
  12. package/_cjs/actions/wallet/sendCalls.js.map +1 -1
  13. package/_cjs/actions/wallet/sendTransaction.js +11 -7
  14. package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
  15. package/_cjs/actions/wallet/sendTransactionSync.js +11 -7
  16. package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -1
  17. package/_cjs/actions/wallet/writeContract.js +2 -2
  18. package/_cjs/actions/wallet/writeContract.js.map +1 -1
  19. package/_cjs/chains/definitions/megaeth.js +33 -0
  20. package/_cjs/chains/definitions/megaeth.js.map +1 -0
  21. package/_cjs/chains/definitions/megaethTestnet.js +6 -1
  22. package/_cjs/chains/definitions/megaethTestnet.js.map +1 -1
  23. package/_cjs/chains/definitions/rise.js +28 -0
  24. package/_cjs/chains/definitions/rise.js.map +1 -0
  25. package/_cjs/chains/definitions/stable.js +35 -0
  26. package/_cjs/chains/definitions/stable.js.map +1 -0
  27. package/_cjs/chains/definitions/stableTestnet.js +10 -3
  28. package/_cjs/chains/definitions/stableTestnet.js.map +1 -1
  29. package/_cjs/chains/index.js +13 -7
  30. package/_cjs/chains/index.js.map +1 -1
  31. package/_cjs/clients/createClient.js +2 -1
  32. package/_cjs/clients/createClient.js.map +1 -1
  33. package/_cjs/clients/createWalletClient.js.map +1 -1
  34. package/_cjs/errors/version.js +1 -1
  35. package/_cjs/index.js.map +1 -1
  36. package/_cjs/op-stack/index.js +9 -1
  37. package/_cjs/op-stack/index.js.map +1 -1
  38. package/_cjs/tempo/Abis.js +2 -2
  39. package/_cjs/tempo/Abis.js.map +1 -1
  40. package/_cjs/tempo/Addresses.js +2 -1
  41. package/_cjs/tempo/Addresses.js.map +1 -1
  42. package/_cjs/tempo/Decorator.js +19 -0
  43. package/_cjs/tempo/Decorator.js.map +1 -1
  44. package/_cjs/tempo/Transport.js +1 -1
  45. package/_cjs/tempo/Transport.js.map +1 -1
  46. package/_cjs/tempo/actions/fee.js +91 -0
  47. package/_cjs/tempo/actions/fee.js.map +1 -1
  48. package/_cjs/tempo/actions/index.js +2 -1
  49. package/_cjs/tempo/actions/index.js.map +1 -1
  50. package/_cjs/tempo/actions/validator.js +308 -0
  51. package/_cjs/tempo/actions/validator.js.map +1 -0
  52. package/_cjs/types/dataSuffix.js +3 -0
  53. package/_cjs/types/dataSuffix.js.map +1 -0
  54. package/_cjs/utils/abi/decodeEventLog.js +29 -12
  55. package/_cjs/utils/abi/decodeEventLog.js.map +1 -1
  56. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +4 -2
  57. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
  58. package/_esm/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
  59. package/_esm/account-abstraction/clients/createBundlerClient.js +8 -2
  60. package/_esm/account-abstraction/clients/createBundlerClient.js.map +1 -1
  61. package/_esm/actions/public/estimateContractGas.js +3 -1
  62. package/_esm/actions/public/estimateContractGas.js.map +1 -1
  63. package/_esm/actions/public/simulateContract.js +3 -1
  64. package/_esm/actions/public/simulateContract.js.map +1 -1
  65. package/_esm/actions/wallet/sendCalls.js +17 -1
  66. package/_esm/actions/wallet/sendCalls.js.map +1 -1
  67. package/_esm/actions/wallet/sendTransaction.js +11 -7
  68. package/_esm/actions/wallet/sendTransaction.js.map +1 -1
  69. package/_esm/actions/wallet/sendTransactionSync.js +11 -7
  70. package/_esm/actions/wallet/sendTransactionSync.js.map +1 -1
  71. package/_esm/actions/wallet/writeContract.js +2 -2
  72. package/_esm/actions/wallet/writeContract.js.map +1 -1
  73. package/_esm/chains/definitions/megaeth.js +30 -0
  74. package/_esm/chains/definitions/megaeth.js.map +1 -0
  75. package/_esm/chains/definitions/megaethTestnet.js +6 -1
  76. package/_esm/chains/definitions/megaethTestnet.js.map +1 -1
  77. package/_esm/chains/definitions/rise.js +25 -0
  78. package/_esm/chains/definitions/rise.js.map +1 -0
  79. package/_esm/chains/definitions/stable.js +32 -0
  80. package/_esm/chains/definitions/stable.js.map +1 -0
  81. package/_esm/chains/definitions/stableTestnet.js +10 -3
  82. package/_esm/chains/definitions/stableTestnet.js.map +1 -1
  83. package/_esm/chains/index.js +3 -0
  84. package/_esm/chains/index.js.map +1 -1
  85. package/_esm/clients/createClient.js +2 -1
  86. package/_esm/clients/createClient.js.map +1 -1
  87. package/_esm/clients/createWalletClient.js.map +1 -1
  88. package/_esm/errors/version.js +1 -1
  89. package/_esm/index.js.map +1 -1
  90. package/_esm/op-stack/index.js +4 -0
  91. package/_esm/op-stack/index.js.map +1 -1
  92. package/_esm/tempo/Abis.js +1 -1
  93. package/_esm/tempo/Abis.js.map +1 -1
  94. package/_esm/tempo/Account.js +6 -6
  95. package/_esm/tempo/Addresses.js +1 -0
  96. package/_esm/tempo/Addresses.js.map +1 -1
  97. package/_esm/tempo/Decorator.js +19 -0
  98. package/_esm/tempo/Decorator.js.map +1 -1
  99. package/_esm/tempo/Transport.js +1 -1
  100. package/_esm/tempo/Transport.js.map +1 -1
  101. package/_esm/tempo/WebAuthnP256.js +2 -2
  102. package/_esm/tempo/actions/amm.js +28 -28
  103. package/_esm/tempo/actions/dex.js +68 -68
  104. package/_esm/tempo/actions/faucet.js +4 -4
  105. package/_esm/tempo/actions/fee.js +236 -10
  106. package/_esm/tempo/actions/fee.js.map +1 -1
  107. package/_esm/tempo/actions/index.js +1 -0
  108. package/_esm/tempo/actions/index.js.map +1 -1
  109. package/_esm/tempo/actions/nonce.js +4 -4
  110. package/_esm/tempo/actions/policy.js +36 -36
  111. package/_esm/tempo/actions/reward.js +28 -28
  112. package/_esm/tempo/actions/token.js +122 -122
  113. package/_esm/tempo/actions/validator.js +1017 -0
  114. package/_esm/tempo/actions/validator.js.map +1 -0
  115. package/_esm/types/dataSuffix.js +2 -0
  116. package/_esm/types/dataSuffix.js.map +1 -0
  117. package/_esm/utils/abi/decodeEventLog.js +34 -13
  118. package/_esm/utils/abi/decodeEventLog.js.map +1 -1
  119. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts +2 -0
  120. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -1
  121. package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts +2 -0
  122. package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts.map +1 -1
  123. package/_types/account-abstraction/clients/createBundlerClient.d.ts +4 -0
  124. package/_types/account-abstraction/clients/createBundlerClient.d.ts.map +1 -1
  125. package/_types/actions/public/estimateContractGas.d.ts.map +1 -1
  126. package/_types/actions/public/simulateContract.d.ts.map +1 -1
  127. package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
  128. package/_types/actions/wallet/sendTransaction.d.ts +7 -2
  129. package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
  130. package/_types/actions/wallet/sendTransactionSync.d.ts +5 -0
  131. package/_types/actions/wallet/sendTransactionSync.d.ts.map +1 -1
  132. package/_types/actions/wallet/writeContract.d.ts.map +1 -1
  133. package/_types/chains/definitions/megaeth.d.ts +46 -0
  134. package/_types/chains/definitions/megaeth.d.ts.map +1 -0
  135. package/_types/chains/definitions/megaethTestnet.d.ts +6 -1
  136. package/_types/chains/definitions/megaethTestnet.d.ts.map +1 -1
  137. package/_types/chains/definitions/rise.d.ts +46 -0
  138. package/_types/chains/definitions/rise.d.ts.map +1 -0
  139. package/_types/chains/definitions/stable.d.ts +47 -0
  140. package/_types/chains/definitions/stable.d.ts.map +1 -0
  141. package/_types/chains/definitions/stableTestnet.d.ts +10 -13
  142. package/_types/chains/definitions/stableTestnet.d.ts.map +1 -1
  143. package/_types/chains/index.d.ts +3 -0
  144. package/_types/chains/index.d.ts.map +1 -1
  145. package/_types/clients/createClient.d.ts +5 -0
  146. package/_types/clients/createClient.d.ts.map +1 -1
  147. package/_types/clients/createWalletClient.d.ts +1 -1
  148. package/_types/clients/createWalletClient.d.ts.map +1 -1
  149. package/_types/errors/version.d.ts +1 -1
  150. package/_types/index.d.ts +2 -1
  151. package/_types/index.d.ts.map +1 -1
  152. package/_types/op-stack/index.d.ts +4 -0
  153. package/_types/op-stack/index.d.ts.map +1 -1
  154. package/_types/tempo/Abis.d.ts +1 -1
  155. package/_types/tempo/Abis.d.ts.map +1 -1
  156. package/_types/tempo/Account.d.ts +6 -6
  157. package/_types/tempo/Addresses.d.ts +1 -0
  158. package/_types/tempo/Addresses.d.ts.map +1 -1
  159. package/_types/tempo/Decorator.d.ts +607 -208
  160. package/_types/tempo/Decorator.d.ts.map +1 -1
  161. package/_types/tempo/Transport.d.ts.map +1 -1
  162. package/_types/tempo/WebAuthnP256.d.ts +2 -2
  163. package/_types/tempo/actions/amm.d.ts +28 -28
  164. package/_types/tempo/actions/dex.d.ts +68 -68
  165. package/_types/tempo/actions/faucet.d.ts +4 -4
  166. package/_types/tempo/actions/fee.d.ts +380 -10
  167. package/_types/tempo/actions/fee.d.ts.map +1 -1
  168. package/_types/tempo/actions/index.d.ts +1 -0
  169. package/_types/tempo/actions/index.d.ts.map +1 -1
  170. package/_types/tempo/actions/nonce.d.ts +4 -4
  171. package/_types/tempo/actions/policy.d.ts +36 -36
  172. package/_types/tempo/actions/reward.d.ts +28 -28
  173. package/_types/tempo/actions/token.d.ts +122 -122
  174. package/_types/tempo/actions/validator.d.ts +1174 -0
  175. package/_types/tempo/actions/validator.d.ts.map +1 -0
  176. package/_types/types/dataSuffix.d.ts +16 -0
  177. package/_types/types/dataSuffix.d.ts.map +1 -0
  178. package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
  179. package/account-abstraction/actions/bundler/prepareUserOperation.ts +7 -1
  180. package/account-abstraction/actions/bundler/sendUserOperation.ts +2 -0
  181. package/account-abstraction/clients/createBundlerClient.ts +12 -1
  182. package/actions/public/estimateContractGas.ts +11 -2
  183. package/actions/public/simulateContract.ts +11 -2
  184. package/actions/wallet/sendCalls.ts +18 -1
  185. package/actions/wallet/sendTransaction.ts +19 -8
  186. package/actions/wallet/sendTransactionSync.ts +17 -7
  187. package/actions/wallet/writeContract.ts +1 -2
  188. package/chains/definitions/megaeth.ts +30 -0
  189. package/chains/definitions/megaethTestnet.ts +6 -1
  190. package/chains/definitions/rise.ts +25 -0
  191. package/chains/definitions/stable.ts +32 -0
  192. package/chains/definitions/stableTestnet.ts +10 -3
  193. package/chains/index.ts +3 -0
  194. package/clients/createClient.ts +7 -0
  195. package/clients/createWalletClient.ts +1 -0
  196. package/errors/version.ts +1 -1
  197. package/index.ts +2 -0
  198. package/op-stack/index.ts +24 -0
  199. package/package.json +1 -1
  200. package/tempo/Abis.ts +1 -1
  201. package/tempo/Account.ts +6 -6
  202. package/tempo/Addresses.ts +1 -0
  203. package/tempo/Decorator.ts +672 -208
  204. package/tempo/Transport.ts +4 -1
  205. package/tempo/WebAuthnP256.ts +2 -2
  206. package/tempo/actions/amm.ts +28 -28
  207. package/tempo/actions/dex.ts +68 -68
  208. package/tempo/actions/faucet.ts +4 -4
  209. package/tempo/actions/fee.ts +346 -10
  210. package/tempo/actions/index.ts +1 -0
  211. package/tempo/actions/nonce.ts +4 -4
  212. package/tempo/actions/policy.ts +36 -36
  213. package/tempo/actions/reward.ts +28 -28
  214. package/tempo/actions/token.ts +122 -122
  215. package/tempo/actions/validator.ts +1417 -0
  216. package/types/dataSuffix.ts +18 -0
  217. package/utils/abi/decodeEventLog.ts +38 -14
@@ -16,8 +16,8 @@ import { defineCall } from '../internal/utils.js';
16
16
  * ```ts
17
17
  * import { createClient, http, parseUnits } from 'viem'
18
18
  * import { privateKeyToAccount } from 'viem/accounts'
19
- * import { tempo } from 'tempo.ts/chains'
20
- * import { Actions } from 'tempo.ts/viem'
19
+ * import { tempo } from 'viem/chains'
20
+ * import { Actions } from 'viem/tempo'
21
21
  *
22
22
  * const client = createClient({
23
23
  * account: privateKeyToAccount('0x...'),
@@ -62,8 +62,8 @@ export async function buy(client, parameters) {
62
62
  * @example
63
63
  * ```ts
64
64
  * import { createClient, http, parseUnits, walletActions } from 'viem'
65
- * import { tempo } from 'tempo.ts/chains'
66
- * import { Actions } from 'tempo.ts/viem'
65
+ * import { tempo } from 'viem/chains'
66
+ * import { Actions } from 'viem/tempo'
67
67
  *
68
68
  * const client = createClient({
69
69
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -103,8 +103,8 @@ export async function buy(client, parameters) {
103
103
  * ```ts
104
104
  * import { createClient, http, parseUnits } from 'viem'
105
105
  * import { privateKeyToAccount } from 'viem/accounts'
106
- * import { tempo } from 'tempo.ts/chains'
107
- * import { Actions } from 'tempo.ts/viem'
106
+ * import { tempo } from 'viem/chains'
107
+ * import { Actions } from 'viem/tempo'
108
108
  *
109
109
  * const client = createClient({
110
110
  * account: privateKeyToAccount('0x...'),
@@ -139,8 +139,8 @@ export async function buySync(client, parameters) {
139
139
  * ```ts
140
140
  * import { createClient, http } from 'viem'
141
141
  * import { privateKeyToAccount } from 'viem/accounts'
142
- * import { tempo } from 'tempo.ts/chains'
143
- * import { Actions } from 'tempo.ts/viem'
142
+ * import { tempo } from 'viem/chains'
143
+ * import { Actions } from 'viem/tempo'
144
144
  *
145
145
  * const client = createClient({
146
146
  * account: privateKeyToAccount('0x...'),
@@ -182,8 +182,8 @@ export async function cancel(client, parameters) {
182
182
  * @example
183
183
  * ```ts
184
184
  * import { createClient, http, walletActions } from 'viem'
185
- * import { tempo } from 'tempo.ts/chains'
186
- * import { Actions } from 'tempo.ts/viem'
185
+ * import { tempo } from 'viem/chains'
186
+ * import { Actions } from 'viem/tempo'
187
187
  *
188
188
  * const client = createClient({
189
189
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -238,8 +238,8 @@ export async function cancel(client, parameters) {
238
238
  * ```ts
239
239
  * import { createClient, http } from 'viem'
240
240
  * import { privateKeyToAccount } from 'viem/accounts'
241
- * import { tempo } from 'tempo.ts/chains'
242
- * import { Actions } from 'tempo.ts/viem'
241
+ * import { tempo } from 'viem/chains'
242
+ * import { Actions } from 'viem/tempo'
243
243
  *
244
244
  * const client = createClient({
245
245
  * account: privateKeyToAccount('0x...'),
@@ -278,8 +278,8 @@ export async function cancelSync(client, parameters) {
278
278
  * ```ts
279
279
  * import { createClient, http } from 'viem'
280
280
  * import { privateKeyToAccount } from 'viem/accounts'
281
- * import { tempo } from 'tempo.ts/chains'
282
- * import { Actions } from 'tempo.ts/viem'
281
+ * import { tempo } from 'viem/chains'
282
+ * import { Actions } from 'viem/tempo'
283
283
  *
284
284
  * const client = createClient({
285
285
  * account: privateKeyToAccount('0x...'),
@@ -321,8 +321,8 @@ export async function cancelStale(client, parameters) {
321
321
  * @example
322
322
  * ```ts
323
323
  * import { createClient, http, walletActions } from 'viem'
324
- * import { tempo } from 'tempo.ts/chains'
325
- * import { Actions } from 'tempo.ts/viem'
324
+ * import { tempo } from 'viem/chains'
325
+ * import { Actions } from 'viem/tempo'
326
326
  *
327
327
  * const client = createClient({
328
328
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -380,8 +380,8 @@ export async function cancelStale(client, parameters) {
380
380
  * ```ts
381
381
  * import { createClient, http } from 'viem'
382
382
  * import { privateKeyToAccount } from 'viem/accounts'
383
- * import { tempo } from 'tempo.ts/chains'
384
- * import { Actions } from 'tempo.ts/viem'
383
+ * import { tempo } from 'viem/chains'
384
+ * import { Actions } from 'viem/tempo'
385
385
  *
386
386
  * const client = createClient({
387
387
  * account: privateKeyToAccount('0x...'),
@@ -417,8 +417,8 @@ export async function cancelStaleSync(client, parameters) {
417
417
  * ```ts
418
418
  * import { createClient, http } from 'viem'
419
419
  * import { privateKeyToAccount } from 'viem/accounts'
420
- * import { tempo } from 'tempo.ts/chains'
421
- * import { Actions } from 'tempo.ts/viem'
420
+ * import { tempo } from 'viem/chains'
421
+ * import { Actions } from 'viem/tempo'
422
422
  *
423
423
  * const client = createClient({
424
424
  * account: privateKeyToAccount('0x...'),
@@ -460,8 +460,8 @@ export async function createPair(client, parameters) {
460
460
  * @example
461
461
  * ```ts
462
462
  * import { createClient, http, walletActions } from 'viem'
463
- * import { tempo } from 'tempo.ts/chains'
464
- * import { Actions } from 'tempo.ts/viem'
463
+ * import { tempo } from 'viem/chains'
464
+ * import { Actions } from 'viem/tempo'
465
465
  *
466
466
  * const client = createClient({
467
467
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -516,8 +516,8 @@ export async function createPair(client, parameters) {
516
516
  * ```ts
517
517
  * import { createClient, http } from 'viem'
518
518
  * import { privateKeyToAccount } from 'viem/accounts'
519
- * import { tempo } from 'tempo.ts/chains'
520
- * import { Actions } from 'tempo.ts/viem'
519
+ * import { tempo } from 'viem/chains'
520
+ * import { Actions } from 'viem/tempo'
521
521
  *
522
522
  * const client = createClient({
523
523
  * account: privateKeyToAccount('0x...'),
@@ -552,8 +552,8 @@ export async function createPairSync(client, parameters) {
552
552
  * @example
553
553
  * ```ts
554
554
  * import { createClient, http } from 'viem'
555
- * import { tempo } from 'tempo.ts/chains'
556
- * import { Actions } from 'tempo.ts/viem'
555
+ * import { tempo } from 'viem/chains'
556
+ * import { Actions } from 'viem/tempo'
557
557
  *
558
558
  * const client = createClient({
559
559
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -604,8 +604,8 @@ export async function getBalance(client, parameters) {
604
604
  * @example
605
605
  * ```ts
606
606
  * import { createClient, http, parseUnits } from 'viem'
607
- * import { tempo } from 'tempo.ts/chains'
608
- * import { Actions } from 'tempo.ts/viem'
607
+ * import { tempo } from 'viem/chains'
608
+ * import { Actions } from 'viem/tempo'
609
609
  *
610
610
  * const client = createClient({
611
611
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -654,8 +654,8 @@ export async function getBuyQuote(client, parameters) {
654
654
  * @example
655
655
  * ```ts
656
656
  * import { createClient, http } from 'viem'
657
- * import { tempo } from 'tempo.ts/chains'
658
- * import { Actions } from 'tempo.ts/viem'
657
+ * import { tempo } from 'viem/chains'
658
+ * import { Actions } from 'viem/tempo'
659
659
  *
660
660
  * const client = createClient({
661
661
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -702,8 +702,8 @@ export async function getOrder(client, parameters) {
702
702
  * @example
703
703
  * ```ts
704
704
  * import { createClient, http } from 'viem'
705
- * import { tempo } from 'tempo.ts/chains'
706
- * import { Actions } from 'tempo.ts/viem'
705
+ * import { tempo } from 'viem/chains'
706
+ * import { Actions } from 'viem/tempo'
707
707
  *
708
708
  * const client = createClient({
709
709
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -752,8 +752,8 @@ export async function getOrderbook(client, parameters) {
752
752
  * @example
753
753
  * ```ts
754
754
  * import { createClient, http } from 'viem'
755
- * import { tempo } from 'tempo.ts/chains'
756
- * import { Actions, Tick } from 'tempo.ts/viem'
755
+ * import { tempo } from 'viem/chains'
756
+ * import { Actions, Tick } from 'viem/tempo'
757
757
  *
758
758
  * const client = createClient({
759
759
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -803,8 +803,8 @@ export async function getTickLevel(client, parameters) {
803
803
  * @example
804
804
  * ```ts
805
805
  * import { createClient, http, parseUnits } from 'viem'
806
- * import { tempo } from 'tempo.ts/chains'
807
- * import { Actions } from 'tempo.ts/viem'
806
+ * import { tempo } from 'viem/chains'
807
+ * import { Actions } from 'viem/tempo'
808
808
  *
809
809
  * const client = createClient({
810
810
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -854,8 +854,8 @@ export async function getSellQuote(client, parameters) {
854
854
  * ```ts
855
855
  * import { createClient, http, parseUnits } from 'viem'
856
856
  * import { privateKeyToAccount } from 'viem/accounts'
857
- * import { tempo } from 'tempo.ts/chains'
858
- * import { Actions, Tick } from 'tempo.ts/viem'
857
+ * import { tempo } from 'viem/chains'
858
+ * import { Actions, Tick } from 'viem/tempo'
859
859
  *
860
860
  * const client = createClient({
861
861
  * account: privateKeyToAccount('0x...'),
@@ -900,8 +900,8 @@ export async function place(client, parameters) {
900
900
  * @example
901
901
  * ```ts
902
902
  * import { createClient, http, parseUnits, walletActions } from 'viem'
903
- * import { tempo } from 'tempo.ts/chains'
904
- * import { Actions, Tick } from 'tempo.ts/viem'
903
+ * import { tempo } from 'viem/chains'
904
+ * import { Actions, Tick } from 'viem/tempo'
905
905
  *
906
906
  * const client = createClient({
907
907
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -960,8 +960,8 @@ export async function place(client, parameters) {
960
960
  * ```ts
961
961
  * import { createClient, http, parseUnits } from 'viem'
962
962
  * import { privateKeyToAccount } from 'viem/accounts'
963
- * import { tempo } from 'tempo.ts/chains'
964
- * import { Actions, Tick } from 'tempo.ts/viem'
963
+ * import { tempo } from 'viem/chains'
964
+ * import { Actions, Tick } from 'viem/tempo'
965
965
  *
966
966
  * const client = createClient({
967
967
  * account: privateKeyToAccount('0x...'),
@@ -1007,8 +1007,8 @@ export async function placeFlip(client, parameters) {
1007
1007
  * @example
1008
1008
  * ```ts
1009
1009
  * import { createClient, http, parseUnits, walletActions } from 'viem'
1010
- * import { tempo } from 'tempo.ts/chains'
1011
- * import { Actions, Tick } from 'tempo.ts/viem'
1010
+ * import { tempo } from 'viem/chains'
1011
+ * import { Actions, Tick } from 'viem/tempo'
1012
1012
  *
1013
1013
  * const client = createClient({
1014
1014
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1069,8 +1069,8 @@ export async function placeFlip(client, parameters) {
1069
1069
  * ```ts
1070
1070
  * import { createClient, http, parseUnits } from 'viem'
1071
1071
  * import { privateKeyToAccount } from 'viem/accounts'
1072
- * import { tempo } from 'tempo.ts/chains'
1073
- * import { Actions, Tick } from 'tempo.ts/viem'
1072
+ * import { tempo } from 'viem/chains'
1073
+ * import { Actions, Tick } from 'viem/tempo'
1074
1074
  *
1075
1075
  * const client = createClient({
1076
1076
  * account: privateKeyToAccount('0x...'),
@@ -1110,8 +1110,8 @@ export async function placeFlipSync(client, parameters) {
1110
1110
  * ```ts
1111
1111
  * import { createClient, http, parseUnits } from 'viem'
1112
1112
  * import { privateKeyToAccount } from 'viem/accounts'
1113
- * import { tempo } from 'tempo.ts/chains'
1114
- * import { Actions, Tick } from 'tempo.ts/viem'
1113
+ * import { tempo } from 'viem/chains'
1114
+ * import { Actions, Tick } from 'viem/tempo'
1115
1115
  *
1116
1116
  * const client = createClient({
1117
1117
  * account: privateKeyToAccount('0x...'),
@@ -1150,8 +1150,8 @@ export async function placeSync(client, parameters) {
1150
1150
  * ```ts
1151
1151
  * import { createClient, http, parseUnits } from 'viem'
1152
1152
  * import { privateKeyToAccount } from 'viem/accounts'
1153
- * import { tempo } from 'tempo.ts/chains'
1154
- * import { Actions } from 'tempo.ts/viem'
1153
+ * import { tempo } from 'viem/chains'
1154
+ * import { Actions } from 'viem/tempo'
1155
1155
  *
1156
1156
  * const client = createClient({
1157
1157
  * account: privateKeyToAccount('0x...'),
@@ -1196,8 +1196,8 @@ export async function sell(client, parameters) {
1196
1196
  * @example
1197
1197
  * ```ts
1198
1198
  * import { createClient, http, parseUnits, walletActions } from 'viem'
1199
- * import { tempo } from 'tempo.ts/chains'
1200
- * import { Actions } from 'tempo.ts/viem'
1199
+ * import { tempo } from 'viem/chains'
1200
+ * import { Actions } from 'viem/tempo'
1201
1201
  *
1202
1202
  * const client = createClient({
1203
1203
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1237,8 +1237,8 @@ export async function sell(client, parameters) {
1237
1237
  * ```ts
1238
1238
  * import { createClient, http, parseUnits } from 'viem'
1239
1239
  * import { privateKeyToAccount } from 'viem/accounts'
1240
- * import { tempo } from 'tempo.ts/chains'
1241
- * import { Actions } from 'tempo.ts/viem'
1240
+ * import { tempo } from 'viem/chains'
1241
+ * import { Actions } from 'viem/tempo'
1242
1242
  *
1243
1243
  * const client = createClient({
1244
1244
  * account: privateKeyToAccount('0x...'),
@@ -1272,8 +1272,8 @@ export async function sellSync(client, parameters) {
1272
1272
  * @example
1273
1273
  * ```ts
1274
1274
  * import { createClient, http } from 'viem'
1275
- * import { tempo } from 'tempo.ts/chains'
1276
- * import { Actions } from 'tempo.ts/viem'
1275
+ * import { tempo } from 'viem/chains'
1276
+ * import { Actions } from 'viem/tempo'
1277
1277
  *
1278
1278
  * const client = createClient({
1279
1279
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1317,8 +1317,8 @@ export function watchFlipOrderPlaced(client, parameters) {
1317
1317
  * @example
1318
1318
  * ```ts
1319
1319
  * import { createClient, http } from 'viem'
1320
- * import { tempo } from 'tempo.ts/chains'
1321
- * import { Actions } from 'tempo.ts/viem'
1320
+ * import { tempo } from 'viem/chains'
1321
+ * import { Actions } from 'viem/tempo'
1322
1322
  *
1323
1323
  * const client = createClient({
1324
1324
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1357,8 +1357,8 @@ export function watchOrderCancelled(client, parameters) {
1357
1357
  * @example
1358
1358
  * ```ts
1359
1359
  * import { createClient, http } from 'viem'
1360
- * import { tempo } from 'tempo.ts/chains'
1361
- * import { Actions } from 'tempo.ts/viem'
1360
+ * import { tempo } from 'viem/chains'
1361
+ * import { Actions } from 'viem/tempo'
1362
1362
  *
1363
1363
  * const client = createClient({
1364
1364
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1401,8 +1401,8 @@ export function watchOrderFilled(client, parameters) {
1401
1401
  * @example
1402
1402
  * ```ts
1403
1403
  * import { createClient, http } from 'viem'
1404
- * import { tempo } from 'tempo.ts/chains'
1405
- * import { Actions } from 'tempo.ts/viem'
1404
+ * import { tempo } from 'viem/chains'
1405
+ * import { Actions } from 'viem/tempo'
1406
1406
  *
1407
1407
  * const client = createClient({
1408
1408
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1445,8 +1445,8 @@ export function watchOrderPlaced(client, parameters) {
1445
1445
  * ```ts
1446
1446
  * import { createClient, http } from 'viem'
1447
1447
  * import { privateKeyToAccount } from 'viem/accounts'
1448
- * import { tempo } from 'tempo.ts/chains'
1449
- * import { Actions } from 'tempo.ts/viem'
1448
+ * import { tempo } from 'viem/chains'
1449
+ * import { Actions } from 'viem/tempo'
1450
1450
  *
1451
1451
  * const client = createClient({
1452
1452
  * account: privateKeyToAccount('0x...'),
@@ -1489,8 +1489,8 @@ export async function withdraw(client, parameters) {
1489
1489
  * @example
1490
1490
  * ```ts
1491
1491
  * import { createClient, http, parseUnits, walletActions } from 'viem'
1492
- * import { tempo } from 'tempo.ts/chains'
1493
- * import { Actions } from 'tempo.ts/viem'
1492
+ * import { tempo } from 'viem/chains'
1493
+ * import { Actions } from 'viem/tempo'
1494
1494
  *
1495
1495
  * const client = createClient({
1496
1496
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -1528,8 +1528,8 @@ export async function withdraw(client, parameters) {
1528
1528
  * ```ts
1529
1529
  * import { createClient, http } from 'viem'
1530
1530
  * import { privateKeyToAccount } from 'viem/accounts'
1531
- * import { tempo } from 'tempo.ts/chains'
1532
- * import { Actions } from 'tempo.ts/viem'
1531
+ * import { tempo } from 'viem/chains'
1532
+ * import { Actions } from 'viem/tempo'
1533
1533
  *
1534
1534
  * const client = createClient({
1535
1535
  * account: privateKeyToAccount('0x...'),
@@ -7,8 +7,8 @@ import { waitForTransactionReceipt } from '../../actions/public/waitForTransacti
7
7
  * @example
8
8
  * ```ts
9
9
  * import { createClient, http } from 'viem'
10
- * import { tempo } from 'tempo.ts/chains'
11
- * import { Actions } from 'tempo.ts/viem'
10
+ * import { tempo } from 'viem/chains'
11
+ * import { Actions } from 'viem/tempo'
12
12
  *
13
13
  * const client = createClient({
14
14
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
@@ -39,8 +39,8 @@ export async function fund(client, parameters) {
39
39
  * @example
40
40
  * ```ts
41
41
  * import { createClient, http } from 'viem'
42
- * import { tempo } from 'tempo.ts/chains'
43
- * import { Actions } from 'tempo.ts/viem'
42
+ * import { tempo } from 'viem/chains'
43
+ * import { Actions } from 'viem/tempo'
44
44
  *
45
45
  * const client = createClient({
46
46
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
@@ -15,8 +15,8 @@ import { defineCall } from '../internal/utils.js';
15
15
  * @example
16
16
  * ```ts
17
17
  * import { createClient, http } from 'viem'
18
- * import { tempo } from 'tempo.ts/chains'
19
- * import { Actions } from 'tempo.ts/viem'
18
+ * import { tempo } from 'viem/chains'
19
+ * import { Actions } from 'viem/tempo'
20
20
  * import { privateKeyToAccount } from 'viem/accounts'
21
21
  *
22
22
  * const client = createClient({
@@ -72,8 +72,8 @@ export async function getUserToken(client, ...parameters) {
72
72
  * @example
73
73
  * ```ts
74
74
  * import { createClient, http } from 'viem'
75
- * import { tempo } from 'tempo.ts/chains'
76
- * import { Actions } from 'tempo.ts/viem'
75
+ * import { tempo } from 'viem/chains'
76
+ * import { Actions } from 'viem/tempo'
77
77
  * import { privateKeyToAccount } from 'viem/accounts'
78
78
  *
79
79
  * const client = createClient({
@@ -116,8 +116,8 @@ export async function setUserToken(client, parameters) {
116
116
  * @example
117
117
  * ```ts
118
118
  * import { createClient, http, walletActions } from 'viem'
119
- * import { tempo } from 'tempo.ts/chains'
120
- * import { Actions } from 'tempo.ts/viem'
119
+ * import { tempo } from 'viem/chains'
120
+ * import { Actions } from 'viem/tempo'
121
121
  *
122
122
  * const client = createClient({
123
123
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -168,8 +168,8 @@ export async function setUserToken(client, parameters) {
168
168
  * @example
169
169
  * ```ts
170
170
  * import { createClient, http } from 'viem'
171
- * import { tempo } from 'tempo.ts/chains'
172
- * import { Actions } from 'tempo.ts/viem'
171
+ * import { tempo } from 'viem/chains'
172
+ * import { Actions } from 'viem/tempo'
173
173
  * import { privateKeyToAccount } from 'viem/accounts'
174
174
  *
175
175
  * const client = createClient({
@@ -205,8 +205,8 @@ export async function setUserTokenSync(client, parameters) {
205
205
  * @example
206
206
  * ```ts
207
207
  * import { createClient, http } from 'viem'
208
- * import { tempo } from 'tempo.ts/chains'
209
- * import { Actions } from 'tempo.ts/viem'
208
+ * import { tempo } from 'viem/chains'
209
+ * import { Actions } from 'viem/tempo'
210
210
  *
211
211
  * const client = createClient({
212
212
  * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
@@ -238,4 +238,230 @@ export function watchSetUserToken(client, parameters) {
238
238
  strict: true,
239
239
  });
240
240
  }
241
+ /**
242
+ * Gets the validator's preferred fee token.
243
+ *
244
+ * @example
245
+ * ```ts
246
+ * import { createClient, http } from 'viem'
247
+ * import { tempo } from 'viem/chains'
248
+ * import { Actions } from 'viem/tempo'
249
+ *
250
+ * const client = createClient({
251
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
252
+ * transport: http(),
253
+ * })
254
+ *
255
+ * const { address, id } = await Actions.fee.getValidatorToken(client, {
256
+ * validator: '0x...',
257
+ * })
258
+ * ```
259
+ *
260
+ * @param client - Client.
261
+ * @param parameters - Parameters.
262
+ * @returns The validator's preferred fee token, or null if not set.
263
+ */
264
+ export async function getValidatorToken(client, parameters) {
265
+ const { validator, ...rest } = parameters;
266
+ const address = await readContract(client, {
267
+ ...rest,
268
+ ...getValidatorToken.call({ validator }),
269
+ });
270
+ if (address === zeroAddress)
271
+ return null;
272
+ return {
273
+ address,
274
+ id: TokenId.fromAddress(address),
275
+ };
276
+ }
277
+ (function (getValidatorToken) {
278
+ /**
279
+ * Defines a call to the `validatorTokens` function.
280
+ *
281
+ * @param args - Arguments.
282
+ * @returns The call.
283
+ */
284
+ function call(args) {
285
+ const { validator } = args;
286
+ return defineCall({
287
+ address: Addresses.feeManager,
288
+ abi: Abis.feeManager,
289
+ args: [validator],
290
+ functionName: 'validatorTokens',
291
+ });
292
+ }
293
+ getValidatorToken.call = call;
294
+ })(getValidatorToken || (getValidatorToken = {}));
295
+ /**
296
+ * Sets the validator's preferred fee token.
297
+ *
298
+ * @example
299
+ * ```ts
300
+ * import { createClient, http } from 'viem'
301
+ * import { tempo } from 'viem/chains'
302
+ * import { Actions } from 'viem/tempo'
303
+ * import { privateKeyToAccount } from 'viem/accounts'
304
+ *
305
+ * const client = createClient({
306
+ * account: privateKeyToAccount('0x...'),
307
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
308
+ * transport: http(),
309
+ * })
310
+ *
311
+ * const hash = await Actions.fee.setValidatorToken(client, {
312
+ * token: '0x...',
313
+ * })
314
+ * ```
315
+ *
316
+ * @param client - Client.
317
+ * @param parameters - Parameters.
318
+ * @returns The transaction hash.
319
+ */
320
+ export async function setValidatorToken(client, parameters) {
321
+ return setValidatorToken.inner(writeContract, client, parameters);
322
+ }
323
+ (function (setValidatorToken) {
324
+ /** @internal */
325
+ async function inner(action, client, parameters) {
326
+ const { token, ...rest } = parameters;
327
+ const call = setValidatorToken.call({ token });
328
+ return (await action(client, {
329
+ ...rest,
330
+ ...call,
331
+ }));
332
+ }
333
+ setValidatorToken.inner = inner;
334
+ /**
335
+ * Defines a call to the `setValidatorToken` function.
336
+ *
337
+ * Can be passed as a parameter to:
338
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
339
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
340
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
341
+ *
342
+ * @example
343
+ * ```ts
344
+ * import { createClient, http, walletActions } from 'viem'
345
+ * import { tempo } from 'viem/chains'
346
+ * import { Actions } from 'viem/tempo'
347
+ *
348
+ * const client = createClient({
349
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
350
+ * transport: http(),
351
+ * }).extend(walletActions)
352
+ *
353
+ * const { result } = await client.sendCalls({
354
+ * calls: [
355
+ * actions.fee.setValidatorToken.call({
356
+ * token: '0x20c0...beef',
357
+ * }),
358
+ * actions.fee.setValidatorToken.call({
359
+ * token: '0x20c0...babe',
360
+ * }),
361
+ * ]
362
+ * })
363
+ * ```
364
+ *
365
+ * @param args - Arguments.
366
+ * @returns The call.
367
+ */
368
+ function call(args) {
369
+ const { token } = args;
370
+ return defineCall({
371
+ address: Addresses.feeManager,
372
+ abi: Abis.feeManager,
373
+ functionName: 'setValidatorToken',
374
+ args: [TokenId.toAddress(token)],
375
+ });
376
+ }
377
+ setValidatorToken.call = call;
378
+ function extractEvent(logs) {
379
+ const [log] = parseEventLogs({
380
+ abi: Abis.feeManager,
381
+ logs,
382
+ eventName: 'ValidatorTokenSet',
383
+ strict: true,
384
+ });
385
+ if (!log)
386
+ throw new Error('`ValidatorTokenSet` event not found.');
387
+ return log;
388
+ }
389
+ setValidatorToken.extractEvent = extractEvent;
390
+ })(setValidatorToken || (setValidatorToken = {}));
391
+ /**
392
+ * Sets the validator's preferred fee token.
393
+ *
394
+ * @example
395
+ * ```ts
396
+ * import { createClient, http } from 'viem'
397
+ * import { tempo } from 'viem/chains'
398
+ * import { Actions } from 'viem/tempo'
399
+ * import { privateKeyToAccount } from 'viem/accounts'
400
+ *
401
+ * const client = createClient({
402
+ * account: privateKeyToAccount('0x...'),
403
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
404
+ * transport: http(),
405
+ * })
406
+ *
407
+ * const result = await Actions.fee.setValidatorTokenSync(client, {
408
+ * token: '0x...',
409
+ * })
410
+ * ```
411
+ *
412
+ * @param client - Client.
413
+ * @param parameters - Parameters.
414
+ * @returns The transaction receipt and event data.
415
+ */
416
+ export async function setValidatorTokenSync(client, parameters) {
417
+ const { throwOnReceiptRevert = true, ...rest } = parameters;
418
+ const receipt = await setValidatorToken.inner(writeContractSync, client, {
419
+ ...rest,
420
+ throwOnReceiptRevert,
421
+ });
422
+ const { args } = setValidatorToken.extractEvent(receipt.logs);
423
+ return {
424
+ ...args,
425
+ receipt,
426
+ };
427
+ }
428
+ /**
429
+ * Watches for validator token set events.
430
+ *
431
+ * @example
432
+ * ```ts
433
+ * import { createClient, http } from 'viem'
434
+ * import { tempo } from 'viem/chains'
435
+ * import { Actions } from 'viem/tempo'
436
+ *
437
+ * const client = createClient({
438
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
439
+ * transport: http(),
440
+ * })
441
+ *
442
+ * const unwatch = actions.fee.watchSetValidatorToken(client, {
443
+ * onValidatorTokenSet: (args, log) => {
444
+ * console.log('Validator token set:', args)
445
+ * },
446
+ * })
447
+ * ```
448
+ *
449
+ * @param client - Client.
450
+ * @param parameters - Parameters.
451
+ * @returns A function to unsubscribe from the event.
452
+ */
453
+ export function watchSetValidatorToken(client, parameters) {
454
+ const { onValidatorTokenSet, ...rest } = parameters;
455
+ return watchContractEvent(client, {
456
+ ...rest,
457
+ address: Addresses.feeManager,
458
+ abi: Abis.feeManager,
459
+ eventName: 'ValidatorTokenSet',
460
+ onLogs: (logs) => {
461
+ for (const log of logs)
462
+ onValidatorTokenSet(log.args, log);
463
+ },
464
+ strict: true,
465
+ });
466
+ }
241
467
  //# sourceMappingURL=fee.js.map