tempo.ts 0.1.5 → 0.2.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 (297) hide show
  1. package/README.md +33 -2
  2. package/dist/chains.d.ts +509 -115
  3. package/dist/chains.d.ts.map +1 -1
  4. package/dist/chains.js +20 -9
  5. package/dist/chains.js.map +1 -1
  6. package/dist/ox/Order.d.ts +92 -0
  7. package/dist/ox/Order.d.ts.map +1 -0
  8. package/dist/ox/Order.js +88 -0
  9. package/dist/ox/Order.js.map +1 -0
  10. package/dist/ox/OrdersFilters.d.ts +72 -0
  11. package/dist/ox/OrdersFilters.d.ts.map +1 -0
  12. package/dist/ox/OrdersFilters.js +100 -0
  13. package/dist/ox/OrdersFilters.js.map +1 -0
  14. package/dist/ox/Pagination.d.ts +128 -0
  15. package/dist/ox/Pagination.d.ts.map +1 -0
  16. package/dist/ox/Pagination.js +78 -0
  17. package/dist/ox/Pagination.js.map +1 -0
  18. package/dist/ox/PoolId.d.ts +18 -0
  19. package/dist/ox/PoolId.d.ts.map +1 -0
  20. package/dist/ox/PoolId.js +13 -0
  21. package/dist/ox/PoolId.js.map +1 -0
  22. package/dist/ox/RpcSchema.d.ts +32 -0
  23. package/dist/ox/RpcSchema.d.ts.map +1 -0
  24. package/dist/ox/RpcSchema.js +2 -0
  25. package/dist/ox/RpcSchema.js.map +1 -0
  26. package/dist/ox/SignatureEnvelope.d.ts +1 -1
  27. package/dist/ox/SignatureEnvelope.d.ts.map +1 -1
  28. package/dist/ox/SignatureEnvelope.js.map +1 -1
  29. package/dist/{viem → ox}/Tick.d.ts +4 -0
  30. package/dist/ox/Tick.d.ts.map +1 -0
  31. package/dist/ox/Tick.js.map +1 -0
  32. package/dist/ox/Transaction.d.ts.map +1 -1
  33. package/dist/ox/Transaction.js +2 -1
  34. package/dist/ox/Transaction.js.map +1 -1
  35. package/dist/ox/TransactionEnvelopeAA.d.ts +6 -6
  36. package/dist/ox/TransactionEnvelopeAA.d.ts.map +1 -1
  37. package/dist/ox/TransactionEnvelopeAA.js +4 -2
  38. package/dist/ox/TransactionEnvelopeAA.js.map +1 -1
  39. package/dist/ox/TransactionRequest.d.ts +4 -0
  40. package/dist/ox/TransactionRequest.d.ts.map +1 -1
  41. package/dist/ox/TransactionRequest.js.map +1 -1
  42. package/dist/ox/index.d.ts +6 -0
  43. package/dist/ox/index.d.ts.map +1 -1
  44. package/dist/ox/index.js +6 -0
  45. package/dist/ox/index.js.map +1 -1
  46. package/dist/prool/Instance.d.ts.map +1 -1
  47. package/dist/prool/Instance.js +20 -4
  48. package/dist/prool/Instance.js.map +1 -1
  49. package/dist/viem/Abis.d.ts +1469 -1082
  50. package/dist/viem/Abis.d.ts.map +1 -1
  51. package/dist/viem/Abis.js +932 -671
  52. package/dist/viem/Abis.js.map +1 -1
  53. package/dist/viem/Account.d.ts +150 -0
  54. package/dist/viem/Account.d.ts.map +1 -0
  55. package/dist/viem/Account.js +221 -0
  56. package/dist/viem/Account.js.map +1 -0
  57. package/dist/viem/Actions/amm.d.ts +144 -161
  58. package/dist/viem/Actions/amm.d.ts.map +1 -1
  59. package/dist/viem/Actions/amm.js +109 -163
  60. package/dist/viem/Actions/amm.js.map +1 -1
  61. package/dist/viem/Actions/dex.d.ts +920 -664
  62. package/dist/viem/Actions/dex.d.ts.map +1 -1
  63. package/dist/viem/Actions/dex.js +129 -30
  64. package/dist/viem/Actions/dex.js.map +1 -1
  65. package/dist/viem/Actions/faucet.d.ts +34 -0
  66. package/dist/viem/Actions/faucet.d.ts.map +1 -0
  67. package/dist/viem/Actions/faucet.js +33 -0
  68. package/dist/viem/Actions/faucet.js.map +1 -0
  69. package/dist/viem/Actions/fee.d.ts +16 -30
  70. package/dist/viem/Actions/fee.d.ts.map +1 -1
  71. package/dist/viem/Actions/fee.js +13 -13
  72. package/dist/viem/Actions/fee.js.map +1 -1
  73. package/dist/viem/Actions/index.d.ts +2 -0
  74. package/dist/viem/Actions/index.d.ts.map +1 -1
  75. package/dist/viem/Actions/index.js +2 -0
  76. package/dist/viem/Actions/index.js.map +1 -1
  77. package/dist/viem/Actions/policy.d.ts +46 -46
  78. package/dist/viem/Actions/policy.js +46 -46
  79. package/dist/viem/Actions/reward.d.ts +3236 -0
  80. package/dist/viem/Actions/reward.d.ts.map +1 -0
  81. package/dist/viem/Actions/reward.js +725 -0
  82. package/dist/viem/Actions/reward.js.map +1 -0
  83. package/dist/viem/Actions/token.d.ts +4399 -2750
  84. package/dist/viem/Actions/token.d.ts.map +1 -1
  85. package/dist/viem/Actions/token.js +361 -482
  86. package/dist/viem/Actions/token.js.map +1 -1
  87. package/dist/viem/Addresses.d.ts +1 -2
  88. package/dist/viem/Addresses.d.ts.map +1 -1
  89. package/dist/viem/Addresses.js +1 -2
  90. package/dist/viem/Addresses.js.map +1 -1
  91. package/dist/viem/Chain.d.ts +38 -12
  92. package/dist/viem/Chain.d.ts.map +1 -1
  93. package/dist/viem/Chain.js +27 -18
  94. package/dist/viem/Chain.js.map +1 -1
  95. package/dist/viem/Decorator.d.ts +1009 -428
  96. package/dist/viem/Decorator.d.ts.map +1 -1
  97. package/dist/viem/Decorator.js +17 -5
  98. package/dist/viem/Decorator.js.map +1 -1
  99. package/dist/viem/Formatters.d.ts +8 -1
  100. package/dist/viem/Formatters.d.ts.map +1 -1
  101. package/dist/viem/Formatters.js +17 -0
  102. package/dist/viem/Formatters.js.map +1 -1
  103. package/dist/viem/P256.d.ts +2 -0
  104. package/dist/viem/P256.d.ts.map +1 -0
  105. package/dist/viem/P256.js +2 -0
  106. package/dist/viem/P256.js.map +1 -0
  107. package/dist/viem/Secp256k1.d.ts +2 -0
  108. package/dist/viem/Secp256k1.d.ts.map +1 -0
  109. package/dist/viem/Secp256k1.js +2 -0
  110. package/dist/viem/Secp256k1.js.map +1 -0
  111. package/dist/viem/TokenIds.d.ts +1 -2
  112. package/dist/viem/TokenIds.d.ts.map +1 -1
  113. package/dist/viem/TokenIds.js +1 -2
  114. package/dist/viem/TokenIds.js.map +1 -1
  115. package/dist/viem/Transaction.d.ts +1 -1
  116. package/dist/viem/Transaction.d.ts.map +1 -1
  117. package/dist/viem/Transaction.js +46 -5
  118. package/dist/viem/Transaction.js.map +1 -1
  119. package/dist/viem/WebAuthnP256.d.ts +79 -0
  120. package/dist/viem/WebAuthnP256.d.ts.map +1 -0
  121. package/dist/viem/WebAuthnP256.js +95 -0
  122. package/dist/viem/WebAuthnP256.js.map +1 -0
  123. package/dist/viem/WebCryptoP256.d.ts +2 -0
  124. package/dist/viem/WebCryptoP256.d.ts.map +1 -0
  125. package/dist/viem/WebCryptoP256.js +2 -0
  126. package/dist/viem/WebCryptoP256.js.map +1 -0
  127. package/dist/viem/index.d.ts +6 -3
  128. package/dist/viem/index.d.ts.map +1 -1
  129. package/dist/viem/index.js +6 -3
  130. package/dist/viem/index.js.map +1 -1
  131. package/dist/viem/internal/account.d.ts +24 -0
  132. package/dist/viem/internal/account.d.ts.map +1 -0
  133. package/dist/viem/internal/account.js +68 -0
  134. package/dist/viem/internal/account.js.map +1 -0
  135. package/dist/viem/internal/types.d.ts +10 -0
  136. package/dist/viem/internal/types.d.ts.map +1 -1
  137. package/dist/wagmi/Actions/amm.d.ts +428 -0
  138. package/dist/wagmi/Actions/amm.d.ts.map +1 -0
  139. package/dist/wagmi/Actions/amm.js +472 -0
  140. package/dist/wagmi/Actions/amm.js.map +1 -0
  141. package/dist/wagmi/Actions/dex.d.ts +908 -0
  142. package/dist/wagmi/Actions/dex.d.ts.map +1 -0
  143. package/dist/wagmi/Actions/dex.js +1023 -0
  144. package/dist/wagmi/Actions/dex.js.map +1 -0
  145. package/dist/wagmi/Actions/faucet.d.ts +35 -0
  146. package/dist/wagmi/Actions/faucet.d.ts.map +1 -0
  147. package/dist/wagmi/Actions/faucet.js +33 -0
  148. package/dist/wagmi/Actions/faucet.js.map +1 -0
  149. package/dist/wagmi/Actions/fee.d.ts +111 -0
  150. package/dist/wagmi/Actions/fee.d.ts.map +1 -0
  151. package/dist/wagmi/Actions/fee.js +126 -0
  152. package/dist/wagmi/Actions/fee.js.map +1 -0
  153. package/dist/wagmi/Actions/index.d.ts +7 -0
  154. package/dist/wagmi/Actions/index.d.ts.map +1 -0
  155. package/dist/wagmi/Actions/index.js +7 -0
  156. package/dist/wagmi/Actions/index.js.map +1 -0
  157. package/dist/wagmi/Actions/reward.d.ts +348 -0
  158. package/dist/wagmi/Actions/reward.d.ts.map +1 -0
  159. package/dist/wagmi/Actions/reward.js +388 -0
  160. package/dist/wagmi/Actions/reward.js.map +1 -0
  161. package/dist/wagmi/Actions/token.d.ts +1546 -0
  162. package/dist/wagmi/Actions/token.d.ts.map +1 -0
  163. package/dist/wagmi/Actions/token.js +1712 -0
  164. package/dist/wagmi/Actions/token.js.map +1 -0
  165. package/dist/wagmi/Connector.d.ts +81 -0
  166. package/dist/wagmi/Connector.d.ts.map +1 -0
  167. package/dist/wagmi/Connector.js +261 -0
  168. package/dist/wagmi/Connector.js.map +1 -0
  169. package/dist/wagmi/Hooks/amm.d.ts +421 -0
  170. package/dist/wagmi/Hooks/amm.d.ts.map +1 -0
  171. package/dist/wagmi/Hooks/amm.js +504 -0
  172. package/dist/wagmi/Hooks/amm.js.map +1 -0
  173. package/dist/wagmi/Hooks/dex.d.ts +816 -0
  174. package/dist/wagmi/Hooks/dex.d.ts.map +1 -0
  175. package/dist/wagmi/Hooks/dex.js +973 -0
  176. package/dist/wagmi/Hooks/dex.js.map +1 -0
  177. package/dist/wagmi/Hooks/faucet.d.ts +39 -0
  178. package/dist/wagmi/Hooks/faucet.d.ts.map +1 -0
  179. package/dist/wagmi/Hooks/faucet.js +40 -0
  180. package/dist/wagmi/Hooks/faucet.js.map +1 -0
  181. package/dist/wagmi/Hooks/fee.d.ts +97 -0
  182. package/dist/wagmi/Hooks/fee.d.ts.map +1 -0
  183. package/dist/wagmi/Hooks/fee.js +109 -0
  184. package/dist/wagmi/Hooks/fee.js.map +1 -0
  185. package/dist/wagmi/Hooks/index.d.ts +7 -0
  186. package/dist/wagmi/Hooks/index.d.ts.map +1 -0
  187. package/dist/wagmi/Hooks/index.js +7 -0
  188. package/dist/wagmi/Hooks/index.js.map +1 -0
  189. package/dist/wagmi/Hooks/reward.d.ts +307 -0
  190. package/dist/wagmi/Hooks/reward.d.ts.map +1 -0
  191. package/dist/wagmi/Hooks/reward.js +349 -0
  192. package/dist/wagmi/Hooks/reward.js.map +1 -0
  193. package/dist/wagmi/Hooks/token.d.ts +1388 -0
  194. package/dist/wagmi/Hooks/token.d.ts.map +1 -0
  195. package/dist/wagmi/Hooks/token.js +1657 -0
  196. package/dist/wagmi/Hooks/token.js.map +1 -0
  197. package/dist/wagmi/index.d.ts +4 -0
  198. package/dist/wagmi/index.d.ts.map +1 -0
  199. package/dist/wagmi/index.js +4 -0
  200. package/dist/wagmi/index.js.map +1 -0
  201. package/package.json +54 -10
  202. package/src/chains.ts +21 -9
  203. package/src/ox/Order.test.ts +78 -0
  204. package/src/ox/Order.ts +125 -0
  205. package/src/ox/OrdersFilters.test.ts +182 -0
  206. package/src/ox/OrdersFilters.ts +125 -0
  207. package/src/ox/Pagination.test.ts +162 -0
  208. package/src/ox/Pagination.ts +164 -0
  209. package/src/ox/PoolId.test.ts +33 -0
  210. package/src/ox/PoolId.ts +27 -0
  211. package/src/ox/RpcSchema.ts +35 -0
  212. package/src/ox/SignatureEnvelope.ts +3 -1
  213. package/src/{viem → ox}/Tick.test.ts +1 -1
  214. package/src/{viem → ox}/Tick.ts +5 -0
  215. package/src/ox/Transaction.test.ts +1 -1
  216. package/src/ox/Transaction.ts +2 -1
  217. package/src/ox/TransactionEnvelopeAA.test.ts +239 -96
  218. package/src/ox/TransactionEnvelopeAA.ts +9 -7
  219. package/src/ox/TransactionRequest.ts +4 -0
  220. package/src/ox/index.ts +6 -0
  221. package/src/prool/Instance.ts +51 -37
  222. package/src/prool/internal/chain.json +104 -52
  223. package/src/tsconfig.json +9 -0
  224. package/src/viem/Abis.ts +972 -710
  225. package/src/viem/Account.ts +279 -0
  226. package/src/viem/Actions/__snapshots__/dex.test.ts.snap +850 -0
  227. package/src/viem/Actions/amm.test.ts +173 -169
  228. package/src/viem/Actions/amm.ts +131 -203
  229. package/src/viem/Actions/dex.test.ts +563 -484
  230. package/src/viem/Actions/dex.ts +203 -30
  231. package/src/viem/Actions/faucet.ts +50 -0
  232. package/src/viem/Actions/fee.test.ts +23 -34
  233. package/src/viem/Actions/fee.ts +20 -13
  234. package/src/viem/Actions/index.ts +2 -0
  235. package/src/viem/Actions/policy.test.ts +19 -33
  236. package/src/viem/Actions/policy.ts +46 -46
  237. package/src/viem/Actions/reward.test.ts +457 -0
  238. package/src/viem/Actions/reward.ts +999 -0
  239. package/src/viem/Actions/token.test.ts +453 -287
  240. package/src/viem/Actions/token.ts +605 -693
  241. package/src/viem/Addresses.ts +1 -2
  242. package/src/viem/Chain.bench-d.ts +12 -0
  243. package/src/viem/Chain.ts +70 -20
  244. package/src/viem/Decorator.bench-d.ts +1 -1
  245. package/src/viem/Decorator.test.ts +3 -1
  246. package/src/viem/Decorator.ts +1049 -442
  247. package/src/viem/Formatters.ts +31 -5
  248. package/src/viem/P256.ts +1 -0
  249. package/src/viem/Secp256k1.ts +1 -0
  250. package/src/viem/TokenIds.ts +1 -2
  251. package/src/viem/Transaction.ts +53 -7
  252. package/src/viem/WebAuthnP256.ts +140 -0
  253. package/src/viem/WebCryptoP256.ts +1 -0
  254. package/src/viem/e2e.test.ts +1126 -297
  255. package/src/viem/index.ts +6 -3
  256. package/src/viem/internal/account.ts +107 -0
  257. package/src/viem/internal/types.ts +9 -0
  258. package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +310 -0
  259. package/src/wagmi/Actions/amm.test.ts +198 -0
  260. package/src/wagmi/Actions/amm.ts +691 -0
  261. package/src/wagmi/Actions/dex.test.ts +1507 -0
  262. package/src/wagmi/Actions/dex.ts +1640 -0
  263. package/src/wagmi/Actions/faucet.ts +46 -0
  264. package/src/wagmi/Actions/fee.test.ts +63 -0
  265. package/src/wagmi/Actions/fee.ts +208 -0
  266. package/src/wagmi/Actions/index.ts +6 -0
  267. package/src/wagmi/Actions/reward.test.ts +210 -0
  268. package/src/wagmi/Actions/reward.ts +632 -0
  269. package/src/wagmi/Actions/token.test.ts +1308 -0
  270. package/src/wagmi/Actions/token.ts +2613 -0
  271. package/src/wagmi/Connector.test.ts +53 -0
  272. package/src/wagmi/Connector.ts +390 -0
  273. package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +457 -0
  274. package/src/wagmi/Hooks/amm.test.ts +424 -0
  275. package/src/wagmi/Hooks/amm.ts +806 -0
  276. package/src/wagmi/Hooks/dex.test.ts +1017 -0
  277. package/src/wagmi/Hooks/dex.ts +1685 -0
  278. package/src/wagmi/Hooks/faucet.ts +76 -0
  279. package/src/wagmi/Hooks/fee.test.ts +166 -0
  280. package/src/wagmi/Hooks/fee.ts +206 -0
  281. package/src/wagmi/Hooks/index.ts +6 -0
  282. package/src/wagmi/Hooks/reward.test.ts +219 -0
  283. package/src/wagmi/Hooks/reward.ts +672 -0
  284. package/src/wagmi/Hooks/token.test.ts +1670 -0
  285. package/src/wagmi/Hooks/token.ts +2906 -0
  286. package/src/wagmi/index.ts +3 -0
  287. package/src/wagmi/internal/types.ts +16 -0
  288. package/dist/viem/Client.d.ts +0 -27
  289. package/dist/viem/Client.d.ts.map +0 -1
  290. package/dist/viem/Client.js +0 -28
  291. package/dist/viem/Client.js.map +0 -1
  292. package/dist/viem/Tick.d.ts.map +0 -1
  293. package/dist/viem/Tick.js.map +0 -1
  294. package/src/viem/Client.bench-d.ts +0 -8
  295. package/src/viem/Client.test.ts +0 -178
  296. package/src/viem/Client.ts +0 -91
  297. /package/dist/{viem → ox}/Tick.js +0 -0
@@ -1,5 +1,4 @@
1
1
  import * as Hex from 'ox/Hex';
2
- import * as Signature from 'ox/Signature';
3
2
  import { encodeFunctionData, parseEventLogs, } from 'viem';
4
3
  import { parseAccount } from 'viem/accounts';
5
4
  import { multicall, readContract, sendTransaction, sendTransactionSync, watchContractEvent, writeContract, writeContractSync, } from 'viem/actions';
@@ -15,16 +14,16 @@ import { defineCall } from '../internal/utils.js';
15
14
  * ```ts
16
15
  * import { createClient, http } from 'viem'
17
16
  * import { tempo } from 'tempo.ts/chains'
18
- * import * as actions from 'tempo.ts/viem/actions'
17
+ * import { Actions } from 'tempo.ts/viem'
19
18
  * import { privateKeyToAccount } from 'viem/accounts'
20
19
  *
21
20
  * const client = createClient({
22
21
  * account: privateKeyToAccount('0x...'),
23
- * chain: tempo,
22
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
24
23
  * transport: http(),
25
24
  * })
26
25
  *
27
- * const result = await actions.token.approve(client, {
26
+ * const result = await Actions.token.approve(client, {
28
27
  * spender: '0x...',
29
28
  * amount: 100n,
30
29
  * })
@@ -35,7 +34,7 @@ import { defineCall } from '../internal/utils.js';
35
34
  * @returns The transaction hash.
36
35
  */
37
36
  export async function approve(client, parameters) {
38
- const { token = Addresses.defaultFeeToken, ...rest } = parameters;
37
+ const { token, ...rest } = parameters;
39
38
  return approve.inner(writeContract, client, parameters, { ...rest, token });
40
39
  }
41
40
  (function (approve) {
@@ -60,10 +59,10 @@ export async function approve(client, parameters) {
60
59
  * ```ts
61
60
  * import { createClient, http, walletActions } from 'viem'
62
61
  * import { tempo } from 'tempo.ts/chains'
63
- * import * as actions from 'tempo.ts/viem/actions'
62
+ * import { Actions } from 'tempo.ts/viem'
64
63
  *
65
64
  * const client = createClient({
66
- * chain: tempo,
65
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
67
66
  * transport: http(),
68
67
  * }).extend(walletActions)
69
68
  *
@@ -82,7 +81,7 @@ export async function approve(client, parameters) {
82
81
  * @returns The call.
83
82
  */
84
83
  function call(args) {
85
- const { spender, amount, token = Addresses.defaultFeeToken } = args;
84
+ const { spender, amount, token } = args;
86
85
  return defineCall({
87
86
  address: TokenId.toAddress(token),
88
87
  abi: Abis.tip20,
@@ -110,16 +109,16 @@ export async function approve(client, parameters) {
110
109
  * ```ts
111
110
  * import { createClient, http } from 'viem'
112
111
  * import { tempo } from 'tempo.ts/chains'
113
- * import * as actions from 'tempo.ts/viem/actions'
112
+ * import { Actions } from 'tempo.ts/viem'
114
113
  * import { privateKeyToAccount } from 'viem/accounts'
115
114
  *
116
115
  * const client = createClient({
117
116
  * account: privateKeyToAccount('0x...'),
118
- * chain: tempo,
117
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
119
118
  * transport: http(),
120
119
  * })
121
120
  *
122
- * const result = await actions.token.approveSync(client, {
121
+ * const result = await Actions.token.approveSync(client, {
123
122
  * spender: '0x...',
124
123
  * amount: 100n,
125
124
  * })
@@ -130,11 +129,8 @@ export async function approve(client, parameters) {
130
129
  * @returns The transaction receipt and event data.
131
130
  */
132
131
  export async function approveSync(client, parameters) {
133
- const { throwOnReceiptRevert = true, token = Addresses.defaultFeeToken, ...rest } = parameters;
134
- const receipt = await approve.inner(writeContractSync, client, { ...parameters, throwOnReceiptRevert }, {
135
- ...rest,
136
- token,
137
- });
132
+ const { throwOnReceiptRevert = true, ...rest } = parameters;
133
+ const receipt = await approve.inner(writeContractSync, client, { ...parameters, throwOnReceiptRevert }, rest);
138
134
  const { args } = approve.extractEvent(receipt.logs);
139
135
  return {
140
136
  ...args,
@@ -148,16 +144,16 @@ export async function approveSync(client, parameters) {
148
144
  * ```ts
149
145
  * import { createClient, http } from 'viem'
150
146
  * import { tempo } from 'tempo.ts/chains'
151
- * import * as actions from 'tempo.ts/viem/actions'
147
+ * import { Actions } from 'tempo.ts/viem'
152
148
  * import { privateKeyToAccount } from 'viem/accounts'
153
149
  *
154
150
  * const client = createClient({
155
151
  * account: privateKeyToAccount('0x...'),
156
- * chain: tempo,
152
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
157
153
  * transport: http(),
158
154
  * })
159
155
  *
160
- * const result = await actions.token.burnBlocked(client, {
156
+ * const result = await Actions.token.burnBlocked(client, {
161
157
  * from: '0x...',
162
158
  * amount: 100n,
163
159
  * token: '0x...',
@@ -194,10 +190,10 @@ export async function burnBlocked(client, parameters) {
194
190
  * ```ts
195
191
  * import { createClient, http, walletActions } from 'viem'
196
192
  * import { tempo } from 'tempo.ts/chains'
197
- * import * as actions from 'tempo.ts/viem/actions'
193
+ * import { Actions } from 'tempo.ts/viem'
198
194
  *
199
195
  * const client = createClient({
200
- * chain: tempo,
196
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
201
197
  * transport: http(),
202
198
  * }).extend(walletActions)
203
199
  *
@@ -250,16 +246,16 @@ export async function burnBlocked(client, parameters) {
250
246
  * ```ts
251
247
  * import { createClient, http } from 'viem'
252
248
  * import { tempo } from 'tempo.ts/chains'
253
- * import * as actions from 'tempo.ts/viem/actions'
249
+ * import { Actions } from 'tempo.ts/viem'
254
250
  * import { privateKeyToAccount } from 'viem/accounts'
255
251
  *
256
252
  * const client = createClient({
257
253
  * account: privateKeyToAccount('0x...'),
258
- * chain: tempo,
254
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
259
255
  * transport: http(),
260
256
  * })
261
257
  *
262
- * const result = await actions.token.burnBlockedSync(client, {
258
+ * const result = await Actions.token.burnBlockedSync(client, {
263
259
  * from: '0x...',
264
260
  * amount: 100n,
265
261
  * token: '0x...',
@@ -289,16 +285,16 @@ export async function burnBlockedSync(client, parameters) {
289
285
  * ```ts
290
286
  * import { createClient, http } from 'viem'
291
287
  * import { tempo } from 'tempo.ts/chains'
292
- * import * as actions from 'tempo.ts/viem/actions'
288
+ * import { Actions } from 'tempo.ts/viem'
293
289
  * import { privateKeyToAccount } from 'viem/accounts'
294
290
  *
295
291
  * const client = createClient({
296
292
  * account: privateKeyToAccount('0x...'),
297
- * chain: tempo,
293
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
298
294
  * transport: http(),
299
295
  * })
300
296
  *
301
- * const result = await actions.token.burn(client, {
297
+ * const result = await Actions.token.burn(client, {
302
298
  * amount: 100n,
303
299
  * token: '0x...',
304
300
  * })
@@ -334,10 +330,10 @@ export async function burn(client, parameters) {
334
330
  * ```ts
335
331
  * import { createClient, http, walletActions } from 'viem'
336
332
  * import { tempo } from 'tempo.ts/chains'
337
- * import * as actions from 'tempo.ts/viem/actions'
333
+ * import { Actions } from 'tempo.ts/viem'
338
334
  *
339
335
  * const client = createClient({
340
- * chain: tempo,
336
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
341
337
  * transport: http(),
342
338
  * }).extend(walletActions)
343
339
  *
@@ -397,16 +393,16 @@ export async function burn(client, parameters) {
397
393
  * ```ts
398
394
  * import { createClient, http } from 'viem'
399
395
  * import { tempo } from 'tempo.ts/chains'
400
- * import * as actions from 'tempo.ts/viem/actions'
396
+ * import { Actions } from 'tempo.ts/viem'
401
397
  * import { privateKeyToAccount } from 'viem/accounts'
402
398
  *
403
399
  * const client = createClient({
404
400
  * account: privateKeyToAccount('0x...'),
405
- * chain: tempo,
401
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
406
402
  * transport: http(),
407
403
  * })
408
404
  *
409
- * const result = await actions.token.burnSync(client, {
405
+ * const result = await Actions.token.burnSync(client, {
410
406
  * amount: 100n,
411
407
  * token: '0x...',
412
408
  * })
@@ -435,16 +431,16 @@ export async function burnSync(client, parameters) {
435
431
  * ```ts
436
432
  * import { createClient, http } from 'viem'
437
433
  * import { tempo } from 'tempo.ts/chains'
438
- * import * as actions from 'tempo.ts/viem/actions'
434
+ * import { Actions } from 'tempo.ts/viem'
439
435
  * import { privateKeyToAccount } from 'viem/accounts'
440
436
  *
441
437
  * const client = createClient({
442
438
  * account: privateKeyToAccount('0x...'),
443
- * chain: tempo,
439
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
444
440
  * transport: http(),
445
441
  * })
446
442
  *
447
- * const result = await actions.token.changeTransferPolicy(client, {
443
+ * const result = await Actions.token.changeTransferPolicy(client, {
448
444
  * token: '0x...',
449
445
  * policyId: 1n,
450
446
  * })
@@ -480,10 +476,10 @@ export async function changeTransferPolicy(client, parameters) {
480
476
  * ```ts
481
477
  * import { createClient, http, walletActions } from 'viem'
482
478
  * import { tempo } from 'tempo.ts/chains'
483
- * import * as actions from 'tempo.ts/viem/actions'
479
+ * import { Actions } from 'tempo.ts/viem'
484
480
  *
485
481
  * const client = createClient({
486
- * chain: tempo,
482
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
487
483
  * transport: http(),
488
484
  * }).extend(walletActions)
489
485
  *
@@ -535,16 +531,16 @@ export async function changeTransferPolicy(client, parameters) {
535
531
  * ```ts
536
532
  * import { createClient, http } from 'viem'
537
533
  * import { tempo } from 'tempo.ts/chains'
538
- * import * as actions from 'tempo.ts/viem/actions'
534
+ * import { Actions } from 'tempo.ts/viem'
539
535
  * import { privateKeyToAccount } from 'viem/accounts'
540
536
  *
541
537
  * const client = createClient({
542
538
  * account: privateKeyToAccount('0x...'),
543
- * chain: tempo,
539
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
544
540
  * transport: http(),
545
541
  * })
546
542
  *
547
- * const result = await actions.token.changeTransferPolicySync(client, {
543
+ * const result = await Actions.token.changeTransferPolicySync(client, {
548
544
  * token: '0x...',
549
545
  * policyId: 1n,
550
546
  * })
@@ -573,16 +569,16 @@ export async function changeTransferPolicySync(client, parameters) {
573
569
  * ```ts
574
570
  * import { createClient, http } from 'viem'
575
571
  * import { tempo } from 'tempo.ts/chains'
576
- * import * as actions from 'tempo.ts/viem/actions'
572
+ * import { Actions } from 'tempo.ts/viem'
577
573
  * import { privateKeyToAccount } from 'viem/accounts'
578
574
  *
579
575
  * const client = createClient({
580
576
  * account: privateKeyToAccount('0x...'),
581
- * chain: tempo,
577
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
582
578
  * transport: http(),
583
579
  * })
584
580
  *
585
- * const result = await actions.token.create(client, {
581
+ * const result = await Actions.token.create(client, {
586
582
  * name: 'My Token',
587
583
  * symbol: 'MTK',
588
584
  * currency: 'USD',
@@ -624,10 +620,10 @@ export async function create(client, parameters) {
624
620
  * ```ts
625
621
  * import { createClient, http, walletActions } from 'viem'
626
622
  * import { tempo } from 'tempo.ts/chains'
627
- * import * as actions from 'tempo.ts/viem/actions'
623
+ * import { Actions } from 'tempo.ts/viem'
628
624
  *
629
625
  * const client = createClient({
630
- * chain: tempo,
626
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
631
627
  * transport: http(),
632
628
  * }).extend(walletActions)
633
629
  *
@@ -647,7 +643,7 @@ export async function create(client, parameters) {
647
643
  * @returns The call.
648
644
  */
649
645
  function call(args) {
650
- const { name, symbol, currency, quoteToken = Addresses.defaultQuoteToken, admin, } = args;
646
+ const { name, symbol, currency, quoteToken = Addresses.linkingUsd, admin, } = args;
651
647
  return defineCall({
652
648
  address: Addresses.tip20Factory,
653
649
  abi: Abis.tip20Factory,
@@ -682,16 +678,16 @@ export async function create(client, parameters) {
682
678
  * ```ts
683
679
  * import { createClient, http } from 'viem'
684
680
  * import { tempo } from 'tempo.ts/chains'
685
- * import * as actions from 'tempo.ts/viem/actions'
681
+ * import { Actions } from 'tempo.ts/viem'
686
682
  * import { privateKeyToAccount } from 'viem/accounts'
687
683
  *
688
684
  * const client = createClient({
689
685
  * account: privateKeyToAccount('0x...'),
690
- * chain: tempo,
686
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
691
687
  * transport: http(),
692
688
  * })
693
689
  *
694
- * const result = await actions.token.createSync(client, {
690
+ * const result = await Actions.token.createSync(client, {
695
691
  * name: 'My Token',
696
692
  * symbol: 'MTK',
697
693
  * currency: 'USD',
@@ -714,137 +710,6 @@ export async function createSync(client, parameters) {
714
710
  receipt,
715
711
  };
716
712
  }
717
- /**
718
- * Finalizes the quote token update for a TIP20 token.
719
- *
720
- * @example
721
- * ```ts
722
- * import { createClient, http } from 'viem'
723
- * import { tempo } from 'tempo.ts/chains'
724
- * import * as actions from 'tempo.ts/viem/actions'
725
- * import { privateKeyToAccount } from 'viem/accounts'
726
- *
727
- * const client = createClient({
728
- * account: privateKeyToAccount('0x...'),
729
- * chain: tempo,
730
- * transport: http(),
731
- * })
732
- *
733
- * const result = await actions.token.finalizeUpdateQuoteToken(client, {
734
- * token: '0x...',
735
- * })
736
- * ```
737
- *
738
- * @param client - Client.
739
- * @param parameters - Parameters.
740
- * @returns The transaction hash.
741
- */
742
- export async function finalizeUpdateQuoteToken(client, parameters) {
743
- return finalizeUpdateQuoteToken.inner(writeContract, client, parameters);
744
- }
745
- (function (finalizeUpdateQuoteToken) {
746
- /** @internal */
747
- async function inner(action, client, parameters) {
748
- const { token, ...rest } = parameters;
749
- const call = finalizeUpdateQuoteToken.call({ token });
750
- return (await action(client, {
751
- ...rest,
752
- ...call,
753
- }));
754
- }
755
- finalizeUpdateQuoteToken.inner = inner;
756
- /**
757
- * Defines a call to the `finalizeQuoteTokenUpdate` function.
758
- *
759
- * Can be passed as a parameter to:
760
- * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
761
- * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
762
- * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
763
- *
764
- * @example
765
- * ```ts
766
- * import { createClient, http, walletActions } from 'viem'
767
- * import { tempo } from 'tempo.ts/chains'
768
- * import * as actions from 'tempo.ts/viem/actions'
769
- *
770
- * const client = createClient({
771
- * chain: tempo,
772
- * transport: http(),
773
- * }).extend(walletActions)
774
- *
775
- * const { result } = await client.sendCalls({
776
- * calls: [
777
- * actions.token.finalizeUpdateQuoteToken.call({
778
- * token: '0x20c0...babe',
779
- * }),
780
- * ]
781
- * })
782
- * ```
783
- *
784
- * @param args - Arguments.
785
- * @returns The call.
786
- */
787
- function call(args) {
788
- const { token } = args;
789
- return defineCall({
790
- address: TokenId.toAddress(token),
791
- abi: Abis.tip20,
792
- functionName: 'finalizeQuoteTokenUpdate',
793
- args: [],
794
- });
795
- }
796
- finalizeUpdateQuoteToken.call = call;
797
- /**
798
- * Extracts the event from the logs.
799
- *
800
- * @param logs - Logs.
801
- * @returns The event.
802
- */
803
- function extractEvent(logs) {
804
- const [log] = parseEventLogs({
805
- abi: Abis.tip20,
806
- logs,
807
- eventName: 'QuoteTokenUpdateFinalized',
808
- });
809
- if (!log)
810
- throw new Error('`QuoteTokenUpdateFinalized` event not found.');
811
- return log;
812
- }
813
- finalizeUpdateQuoteToken.extractEvent = extractEvent;
814
- })(finalizeUpdateQuoteToken || (finalizeUpdateQuoteToken = {}));
815
- /**
816
- * Finalizes the quote token update for a TIP20 token.
817
- *
818
- * @example
819
- * ```ts
820
- * import { createClient, http } from 'viem'
821
- * import { tempo } from 'tempo.ts/chains'
822
- * import * as actions from 'tempo.ts/viem/actions'
823
- * import { privateKeyToAccount } from 'viem/accounts'
824
- *
825
- * const client = createClient({
826
- * account: privateKeyToAccount('0x...'),
827
- * chain: tempo,
828
- * transport: http(),
829
- * })
830
- *
831
- * const result = await actions.token.finalizeUpdateQuoteTokenSync(client, {
832
- * token: '0x...',
833
- * })
834
- * ```
835
- *
836
- * @param client - Client.
837
- * @param parameters - Parameters.
838
- * @returns The transaction receipt and event data.
839
- */
840
- export async function finalizeUpdateQuoteTokenSync(client, parameters) {
841
- const receipt = await finalizeUpdateQuoteToken.inner(writeContractSync, client, parameters);
842
- const { args } = finalizeUpdateQuoteToken.extractEvent(receipt.logs);
843
- return {
844
- ...args,
845
- receipt,
846
- };
847
- }
848
713
  /**
849
714
  * Gets TIP20 token allowance.
850
715
  *
@@ -852,16 +717,16 @@ export async function finalizeUpdateQuoteTokenSync(client, parameters) {
852
717
  * ```ts
853
718
  * import { createClient, http } from 'viem'
854
719
  * import { tempo } from 'tempo.ts/chains'
855
- * import * as actions from 'tempo.ts/viem/actions'
720
+ * import { Actions } from 'tempo.ts/viem'
856
721
  * import { privateKeyToAccount } from 'viem/accounts'
857
722
  *
858
723
  * const client = createClient({
859
724
  * account: privateKeyToAccount('0x...'),
860
- * chain: tempo,
725
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
861
726
  * transport: http(),
862
727
  * })
863
728
  *
864
- * const allowance = await actions.token.getAllowance(client, {
729
+ * const allowance = await Actions.token.getAllowance(client, {
865
730
  * spender: '0x...',
866
731
  * })
867
732
  * ```
@@ -888,7 +753,7 @@ export async function getAllowance(client, parameters) {
888
753
  * @returns The call.
889
754
  */
890
755
  function call(args) {
891
- const { account, spender, token = Addresses.defaultFeeToken } = args;
756
+ const { account, spender, token } = args;
892
757
  return defineCall({
893
758
  address: TokenId.toAddress(token),
894
759
  abi: Abis.tip20,
@@ -905,16 +770,16 @@ export async function getAllowance(client, parameters) {
905
770
  * ```ts
906
771
  * import { createClient, http } from 'viem'
907
772
  * import { tempo } from 'tempo.ts/chains'
908
- * import * as actions from 'tempo.ts/viem/actions'
773
+ * import { Actions } from 'tempo.ts/viem'
909
774
  * import { privateKeyToAccount } from 'viem/accounts'
910
775
  *
911
776
  * const client = createClient({
912
777
  * account: privateKeyToAccount('0x...'),
913
- * chain: tempo,
778
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
914
779
  * transport: http(),
915
780
  * })
916
781
  *
917
- * const balance = await actions.token.getBalance(client, {
782
+ * const balance = await Actions.token.getBalance(client, {
918
783
  * token: '0x...',
919
784
  * })
920
785
  * ```
@@ -923,8 +788,8 @@ export async function getAllowance(client, parameters) {
923
788
  * @param parameters - Parameters.
924
789
  * @returns The token balance.
925
790
  */
926
- export async function getBalance(client, ...parameters) {
927
- const { account = client.account, ...rest } = parameters[0] ?? {};
791
+ export async function getBalance(client, parameters) {
792
+ const { account = client.account, ...rest } = parameters;
928
793
  const address = account ? parseAccount(account).address : undefined;
929
794
  if (!address)
930
795
  throw new Error('account is required.');
@@ -941,7 +806,7 @@ export async function getBalance(client, ...parameters) {
941
806
  * @returns The call.
942
807
  */
943
808
  function call(args) {
944
- const { account, token = Addresses.defaultFeeToken } = args;
809
+ const { account, token } = args;
945
810
  return defineCall({
946
811
  address: TokenId.toAddress(token),
947
812
  abi: Abis.tip20,
@@ -958,16 +823,16 @@ export async function getBalance(client, ...parameters) {
958
823
  * ```ts
959
824
  * import { createClient, http } from 'viem'
960
825
  * import { tempo } from 'tempo.ts/chains'
961
- * import * as actions from 'tempo.ts/viem/actions'
826
+ * import { Actions } from 'tempo.ts/viem'
962
827
  * import { privateKeyToAccount } from 'viem/accounts'
963
828
  *
964
829
  * const client = createClient({
965
830
  * account: privateKeyToAccount('0x...'),
966
- * chain: tempo,
831
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
967
832
  * transport: http(),
968
833
  * })
969
834
  *
970
- * const metadata = await actions.token.getMetadata(client, {
835
+ * const metadata = await Actions.token.getMetadata(client, {
971
836
  * token: '0x...',
972
837
  * })
973
838
  * ```
@@ -976,11 +841,11 @@ export async function getBalance(client, ...parameters) {
976
841
  * @param parameters - Parameters.
977
842
  * @returns The token metadata.
978
843
  */
979
- export async function getMetadata(client, parameters = {}) {
980
- const { token = Addresses.defaultFeeToken, ...rest } = parameters;
844
+ export async function getMetadata(client, parameters) {
845
+ const { token, ...rest } = parameters;
981
846
  const address = TokenId.toAddress(token);
982
847
  const abi = Abis.tip20;
983
- if (TokenId.from(token) === TokenId.fromAddress(Addresses.defaultQuoteToken))
848
+ if (TokenId.from(token) === TokenId.fromAddress(Addresses.linkingUsd))
984
849
  return multicall(client, {
985
850
  ...rest,
986
851
  contracts: [
@@ -1082,6 +947,54 @@ export async function getMetadata(client, parameters = {}) {
1082
947
  transferPolicyId,
1083
948
  }));
1084
949
  }
950
+ /**
951
+ * Gets the admin role for a specific role in a TIP20 token.
952
+ *
953
+ * @example
954
+ * ```ts
955
+ * import { createClient, http } from 'viem'
956
+ * import { tempo } from 'tempo.ts/chains'
957
+ * import { Actions } from 'tempo.ts/viem'
958
+ *
959
+ * const client = createClient({
960
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
961
+ * transport: http(),
962
+ * })
963
+ *
964
+ * const adminRole = await Actions.token.getRoleAdmin(client, {
965
+ * role: 'minter',
966
+ * token: '0x...',
967
+ * })
968
+ * ```
969
+ *
970
+ * @param client - Client.
971
+ * @param parameters - Parameters.
972
+ * @returns The admin role hash.
973
+ */
974
+ export async function getRoleAdmin(client, parameters) {
975
+ return readContract(client, {
976
+ ...parameters,
977
+ ...getRoleAdmin.call(parameters),
978
+ });
979
+ }
980
+ (function (getRoleAdmin) {
981
+ /**
982
+ * Defines a call to the `getRoleAdmin` function.
983
+ *
984
+ * @param args - Arguments.
985
+ * @returns The call.
986
+ */
987
+ function call(args) {
988
+ const { role, token } = args;
989
+ return defineCall({
990
+ address: TokenId.toAddress(token),
991
+ abi: Abis.tip20,
992
+ functionName: 'getRoleAdmin',
993
+ args: [TokenRole.serialize(role)],
994
+ });
995
+ }
996
+ getRoleAdmin.call = call;
997
+ })(getRoleAdmin || (getRoleAdmin = {}));
1085
998
  /**
1086
999
  * Checks if an account has a specific role for a TIP20 token.
1087
1000
  *
@@ -1089,14 +1002,14 @@ export async function getMetadata(client, parameters = {}) {
1089
1002
  * ```ts
1090
1003
  * import { createClient, http } from 'viem'
1091
1004
  * import { tempo } from 'tempo.ts/chains'
1092
- * import * as actions from 'tempo.ts/viem/actions'
1005
+ * import { Actions } from 'tempo.ts/viem'
1093
1006
  *
1094
1007
  * const client = createClient({
1095
- * chain: tempo,
1008
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1096
1009
  * transport: http(),
1097
1010
  * })
1098
1011
  *
1099
- * const hasRole = await actions.token.hasRole(client, {
1012
+ * const hasRole = await Actions.token.hasRole(client, {
1100
1013
  * account: '0x...',
1101
1014
  * role: 'issuer',
1102
1015
  * token: '0x...',
@@ -1142,16 +1055,16 @@ export async function hasRole(client, parameters) {
1142
1055
  * ```ts
1143
1056
  * import { createClient, http } from 'viem'
1144
1057
  * import { tempo } from 'tempo.ts/chains'
1145
- * import * as actions from 'tempo.ts/viem/actions'
1058
+ * import { Actions } from 'tempo.ts/viem'
1146
1059
  * import { privateKeyToAccount } from 'viem/accounts'
1147
1060
  *
1148
1061
  * const client = createClient({
1149
1062
  * account: privateKeyToAccount('0x...'),
1150
- * chain: tempo,
1063
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1151
1064
  * transport: http(),
1152
1065
  * })
1153
1066
  *
1154
- * const result = await actions.token.grantRoles(client, {
1067
+ * const result = await Actions.token.grantRoles(client, {
1155
1068
  * token: '0x...',
1156
1069
  * to: '0x...',
1157
1070
  * roles: ['issuer'],
@@ -1192,10 +1105,10 @@ export async function grantRoles(client, parameters) {
1192
1105
  * ```ts
1193
1106
  * import { createClient, http, walletActions } from 'viem'
1194
1107
  * import { tempo } from 'tempo.ts/chains'
1195
- * import * as actions from 'tempo.ts/viem/actions'
1108
+ * import { Actions } from 'tempo.ts/viem'
1196
1109
  *
1197
1110
  * const client = createClient({
1198
- * chain: tempo,
1111
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1199
1112
  * transport: http(),
1200
1113
  * }).extend(walletActions)
1201
1114
  *
@@ -1249,16 +1162,16 @@ export async function grantRoles(client, parameters) {
1249
1162
  * ```ts
1250
1163
  * import { createClient, http } from 'viem'
1251
1164
  * import { tempo } from 'tempo.ts/chains'
1252
- * import * as actions from 'tempo.ts/viem/actions'
1165
+ * import { Actions } from 'tempo.ts/viem'
1253
1166
  * import { privateKeyToAccount } from 'viem/accounts'
1254
1167
  *
1255
1168
  * const client = createClient({
1256
1169
  * account: privateKeyToAccount('0x...'),
1257
- * chain: tempo,
1170
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1258
1171
  * transport: http(),
1259
1172
  * })
1260
1173
  *
1261
- * const result = await actions.token.grantRolesSync(client, {
1174
+ * const result = await Actions.token.grantRolesSync(client, {
1262
1175
  * token: '0x...',
1263
1176
  * to: '0x...',
1264
1177
  * roles: ['minter'],
@@ -1289,16 +1202,16 @@ export async function grantRolesSync(client, parameters) {
1289
1202
  * ```ts
1290
1203
  * import { createClient, http } from 'viem'
1291
1204
  * import { tempo } from 'tempo.ts/chains'
1292
- * import * as actions from 'tempo.ts/viem/actions'
1205
+ * import { Actions } from 'tempo.ts/viem'
1293
1206
  * import { privateKeyToAccount } from 'viem/accounts'
1294
1207
  *
1295
1208
  * const client = createClient({
1296
1209
  * account: privateKeyToAccount('0x...'),
1297
- * chain: tempo,
1210
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1298
1211
  * transport: http(),
1299
1212
  * })
1300
1213
  *
1301
- * const result = await actions.token.mint(client, {
1214
+ * const result = await Actions.token.mint(client, {
1302
1215
  * to: '0x...',
1303
1216
  * amount: 100n,
1304
1217
  * token: '0x...',
@@ -1334,10 +1247,10 @@ export async function mint(client, parameters) {
1334
1247
  * ```ts
1335
1248
  * import { createClient, http, walletActions } from 'viem'
1336
1249
  * import { tempo } from 'tempo.ts/chains'
1337
- * import * as actions from 'tempo.ts/viem/actions'
1250
+ * import { Actions } from 'tempo.ts/viem'
1338
1251
  *
1339
1252
  * const client = createClient({
1340
- * chain: tempo,
1253
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1341
1254
  * transport: http(),
1342
1255
  * }).extend(walletActions)
1343
1256
  *
@@ -1398,16 +1311,16 @@ export async function mint(client, parameters) {
1398
1311
  * ```ts
1399
1312
  * import { createClient, http } from 'viem'
1400
1313
  * import { tempo } from 'tempo.ts/chains'
1401
- * import * as actions from 'tempo.ts/viem/actions'
1314
+ * import { Actions } from 'tempo.ts/viem'
1402
1315
  * import { privateKeyToAccount } from 'viem/accounts'
1403
1316
  *
1404
1317
  * const client = createClient({
1405
1318
  * account: privateKeyToAccount('0x...'),
1406
- * chain: tempo,
1319
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1407
1320
  * transport: http(),
1408
1321
  * })
1409
1322
  *
1410
- * const result = await actions.token.mintSync(client, {
1323
+ * const result = await Actions.token.mintSync(client, {
1411
1324
  * to: '0x...',
1412
1325
  * amount: 100n,
1413
1326
  * token: '0x...',
@@ -1437,16 +1350,16 @@ export async function mintSync(client, parameters) {
1437
1350
  * ```ts
1438
1351
  * import { createClient, http } from 'viem'
1439
1352
  * import { tempo } from 'tempo.ts/chains'
1440
- * import * as actions from 'tempo.ts/viem/actions'
1353
+ * import { Actions } from 'tempo.ts/viem'
1441
1354
  * import { privateKeyToAccount } from 'viem/accounts'
1442
1355
  *
1443
1356
  * const client = createClient({
1444
1357
  * account: privateKeyToAccount('0x...'),
1445
- * chain: tempo,
1358
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1446
1359
  * transport: http(),
1447
1360
  * })
1448
1361
  *
1449
- * const result = await actions.token.pause(client, {
1362
+ * const result = await Actions.token.pause(client, {
1450
1363
  * token: '0x...',
1451
1364
  * })
1452
1365
  * ```
@@ -1481,10 +1394,10 @@ export async function pause(client, parameters) {
1481
1394
  * ```ts
1482
1395
  * import { createClient, http, walletActions } from 'viem'
1483
1396
  * import { tempo } from 'tempo.ts/chains'
1484
- * import * as actions from 'tempo.ts/viem/actions'
1397
+ * import { Actions } from 'tempo.ts/viem'
1485
1398
  *
1486
1399
  * const client = createClient({
1487
- * chain: tempo,
1400
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1488
1401
  * transport: http(),
1489
1402
  * }).extend(walletActions)
1490
1403
  *
@@ -1535,16 +1448,16 @@ export async function pause(client, parameters) {
1535
1448
  * ```ts
1536
1449
  * import { createClient, http } from 'viem'
1537
1450
  * import { tempo } from 'tempo.ts/chains'
1538
- * import * as actions from 'tempo.ts/viem/actions'
1451
+ * import { Actions } from 'tempo.ts/viem'
1539
1452
  * import { privateKeyToAccount } from 'viem/accounts'
1540
1453
  *
1541
1454
  * const client = createClient({
1542
1455
  * account: privateKeyToAccount('0x...'),
1543
- * chain: tempo,
1456
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1544
1457
  * transport: http(),
1545
1458
  * })
1546
1459
  *
1547
- * const result = await actions.token.pauseSync(client, {
1460
+ * const result = await Actions.token.pauseSync(client, {
1548
1461
  * token: '0x...',
1549
1462
  * })
1550
1463
  * ```
@@ -1565,171 +1478,6 @@ export async function pauseSync(client, parameters) {
1565
1478
  receipt,
1566
1479
  };
1567
1480
  }
1568
- /**
1569
- * Approves a spender using a signed permit.
1570
- *
1571
- * @example
1572
- * ```ts
1573
- * import { createClient, http } from 'viem'
1574
- * import { tempo } from 'tempo.ts/chains'
1575
- * import * as actions from 'tempo.ts/viem/actions'
1576
- * import { privateKeyToAccount } from 'viem/accounts'
1577
- *
1578
- * const client = createClient({
1579
- * account: privateKeyToAccount('0x...'),
1580
- * chain: tempo,
1581
- * transport: http(),
1582
- * })
1583
- *
1584
- * const result = await actions.token.permit(client, {
1585
- * owner: '0x...',
1586
- * spender: '0x...',
1587
- * value: 100n,
1588
- * deadline: 1234567890n,
1589
- * signature: { r: 0n, s: 0n, yParity: 0 },
1590
- * })
1591
- * ```
1592
- *
1593
- * @param client - Client.
1594
- * @param parameters - Parameters.
1595
- * @returns The transaction hash.
1596
- */
1597
- export async function permit(client, parameters) {
1598
- return permit.inner(writeContract, client, parameters);
1599
- }
1600
- (function (permit) {
1601
- /** @internal */
1602
- async function inner(action, client, parameters) {
1603
- const { owner, spender, value, deadline, signature, token, ...rest } = parameters;
1604
- const call = permit.call({
1605
- owner,
1606
- spender,
1607
- value,
1608
- deadline,
1609
- signature,
1610
- token,
1611
- });
1612
- return (await action(client, {
1613
- ...rest,
1614
- ...call,
1615
- }));
1616
- }
1617
- permit.inner = inner;
1618
- /**
1619
- * Defines a call to the `permit` function.
1620
- *
1621
- * Can be passed as a parameter to:
1622
- * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
1623
- * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
1624
- * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
1625
- *
1626
- * @example
1627
- * ```ts
1628
- * import { createClient, http, walletActions } from 'viem'
1629
- * import { tempo } from 'tempo.ts/chains'
1630
- * import * as actions from 'tempo.ts/viem/actions'
1631
- *
1632
- * const client = createClient({
1633
- * chain: tempo,
1634
- * transport: http(),
1635
- * }).extend(walletActions)
1636
- *
1637
- * const { result } = await client.sendCalls({
1638
- * calls: [
1639
- * actions.token.permit.call({
1640
- * owner: '0x20c0...beef',
1641
- * spender: '0x20c0...babe',
1642
- * value: 100n,
1643
- * deadline: 1234567890n,
1644
- * signature: { r: 0n, s: 0n, yParity: 0 },
1645
- * token: '0x20c0...cafe',
1646
- * }),
1647
- * ]
1648
- * })
1649
- * ```
1650
- *
1651
- * @param args - Arguments.
1652
- * @returns The call.
1653
- */
1654
- function call(args) {
1655
- const { owner, spender, value, deadline, signature, token = Addresses.defaultFeeToken, } = args;
1656
- const { r, s, yParity } = Signature.from(signature);
1657
- const v = Signature.yParityToV(yParity);
1658
- return defineCall({
1659
- address: TokenId.toAddress(token),
1660
- abi: Abis.tip20,
1661
- functionName: 'permit',
1662
- args: [
1663
- owner,
1664
- spender,
1665
- value,
1666
- deadline,
1667
- v,
1668
- Hex.trimLeft(Hex.fromNumber(r)),
1669
- Hex.trimLeft(Hex.fromNumber(s)),
1670
- ],
1671
- });
1672
- }
1673
- permit.call = call;
1674
- /**
1675
- * Extracts the event from the logs.
1676
- *
1677
- * @param logs - Logs.
1678
- * @returns The event.
1679
- */
1680
- function extractEvent(logs) {
1681
- const [log] = parseEventLogs({
1682
- abi: Abis.tip20,
1683
- logs,
1684
- eventName: 'Approval',
1685
- });
1686
- if (!log)
1687
- throw new Error('`Approval` event not found.');
1688
- return log;
1689
- }
1690
- permit.extractEvent = extractEvent;
1691
- })(permit || (permit = {}));
1692
- /**
1693
- * Approves a spender using a signed permit.
1694
- *
1695
- * @example
1696
- * ```ts
1697
- * import { createClient, http } from 'viem'
1698
- * import { tempo } from 'tempo.ts/chains'
1699
- * import * as actions from 'tempo.ts/viem/actions'
1700
- * import { privateKeyToAccount } from 'viem/accounts'
1701
- *
1702
- * const client = createClient({
1703
- * account: privateKeyToAccount('0x...'),
1704
- * chain: tempo,
1705
- * transport: http(),
1706
- * })
1707
- *
1708
- * const result = await actions.token.permitSync(client, {
1709
- * owner: '0x...',
1710
- * spender: '0x...',
1711
- * value: 100n,
1712
- * deadline: 1234567890n,
1713
- * signature: { r: 0n, s: 0n, yParity: 0 },
1714
- * })
1715
- * ```
1716
- *
1717
- * @param client - Client.
1718
- * @param parameters - Parameters.
1719
- * @returns The transaction receipt and event data.
1720
- */
1721
- export async function permitSync(client, parameters) {
1722
- const { throwOnReceiptRevert = true, ...rest } = parameters;
1723
- const receipt = await permit.inner(writeContractSync, client, {
1724
- ...rest,
1725
- throwOnReceiptRevert,
1726
- });
1727
- const { args } = permit.extractEvent(receipt.logs);
1728
- return {
1729
- ...args,
1730
- receipt,
1731
- };
1732
- }
1733
1481
  /**
1734
1482
  * Renounces a role for a TIP20 token.
1735
1483
  *
@@ -1737,16 +1485,16 @@ export async function permitSync(client, parameters) {
1737
1485
  * ```ts
1738
1486
  * import { createClient, http } from 'viem'
1739
1487
  * import { tempo } from 'tempo.ts/chains'
1740
- * import * as actions from 'tempo.ts/viem/actions'
1488
+ * import { Actions } from 'tempo.ts/viem'
1741
1489
  * import { privateKeyToAccount } from 'viem/accounts'
1742
1490
  *
1743
1491
  * const client = createClient({
1744
1492
  * account: privateKeyToAccount('0x...'),
1745
- * chain: tempo,
1493
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1746
1494
  * transport: http(),
1747
1495
  * })
1748
1496
  *
1749
- * const result = await actions.token.renounceRoles(client, {
1497
+ * const result = await Actions.token.renounceRoles(client, {
1750
1498
  * token: '0x...',
1751
1499
  * roles: ['minter'],
1752
1500
  * })
@@ -1786,10 +1534,10 @@ export async function renounceRoles(client, parameters) {
1786
1534
  * ```ts
1787
1535
  * import { createClient, http, walletActions } from 'viem'
1788
1536
  * import { tempo } from 'tempo.ts/chains'
1789
- * import * as actions from 'tempo.ts/viem/actions'
1537
+ * import { Actions } from 'tempo.ts/viem'
1790
1538
  *
1791
1539
  * const client = createClient({
1792
- * chain: tempo,
1540
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1793
1541
  * transport: http(),
1794
1542
  * }).extend(walletActions)
1795
1543
  *
@@ -1842,16 +1590,16 @@ export async function renounceRoles(client, parameters) {
1842
1590
  * ```ts
1843
1591
  * import { createClient, http } from 'viem'
1844
1592
  * import { tempo } from 'tempo.ts/chains'
1845
- * import * as actions from 'tempo.ts/viem/actions'
1593
+ * import { Actions } from 'tempo.ts/viem'
1846
1594
  * import { privateKeyToAccount } from 'viem/accounts'
1847
1595
  *
1848
1596
  * const client = createClient({
1849
1597
  * account: privateKeyToAccount('0x...'),
1850
- * chain: tempo,
1598
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1851
1599
  * transport: http(),
1852
1600
  * })
1853
1601
  *
1854
- * const result = await actions.token.renounceRolesSync(client, {
1602
+ * const result = await Actions.token.renounceRolesSync(client, {
1855
1603
  * token: '0x...',
1856
1604
  * roles: ['minter'],
1857
1605
  * })
@@ -1881,16 +1629,16 @@ export async function renounceRolesSync(client, parameters) {
1881
1629
  * ```ts
1882
1630
  * import { createClient, http } from 'viem'
1883
1631
  * import { tempo } from 'tempo.ts/chains'
1884
- * import * as actions from 'tempo.ts/viem/actions'
1632
+ * import { Actions } from 'tempo.ts/viem'
1885
1633
  * import { privateKeyToAccount } from 'viem/accounts'
1886
1634
  *
1887
1635
  * const client = createClient({
1888
1636
  * account: privateKeyToAccount('0x...'),
1889
- * chain: tempo,
1637
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1890
1638
  * transport: http(),
1891
1639
  * })
1892
1640
  *
1893
- * const result = await actions.token.revokeRoles(client, {
1641
+ * const result = await Actions.token.revokeRoles(client, {
1894
1642
  * token: '0x...',
1895
1643
  * from: '0x...',
1896
1644
  * roles: ['minter'],
@@ -1931,10 +1679,10 @@ export async function revokeRoles(client, parameters) {
1931
1679
  * ```ts
1932
1680
  * import { createClient, http, walletActions } from 'viem'
1933
1681
  * import { tempo } from 'tempo.ts/chains'
1934
- * import * as actions from 'tempo.ts/viem/actions'
1682
+ * import { Actions } from 'tempo.ts/viem'
1935
1683
  *
1936
1684
  * const client = createClient({
1937
- * chain: tempo,
1685
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1938
1686
  * transport: http(),
1939
1687
  * }).extend(walletActions)
1940
1688
  *
@@ -1988,16 +1736,16 @@ export async function revokeRoles(client, parameters) {
1988
1736
  * ```ts
1989
1737
  * import { createClient, http } from 'viem'
1990
1738
  * import { tempo } from 'tempo.ts/chains'
1991
- * import * as actions from 'tempo.ts/viem/actions'
1739
+ * import { Actions } from 'tempo.ts/viem'
1992
1740
  * import { privateKeyToAccount } from 'viem/accounts'
1993
1741
  *
1994
1742
  * const client = createClient({
1995
1743
  * account: privateKeyToAccount('0x...'),
1996
- * chain: tempo,
1744
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1997
1745
  * transport: http(),
1998
1746
  * })
1999
1747
  *
2000
- * const result = await actions.token.revokeRolesSync(client, {
1748
+ * const result = await Actions.token.revokeRolesSync(client, {
2001
1749
  * token: '0x...',
2002
1750
  * from: '0x...',
2003
1751
  * roles: ['minter'],
@@ -2028,16 +1776,16 @@ export async function revokeRolesSync(client, parameters) {
2028
1776
  * ```ts
2029
1777
  * import { createClient, http } from 'viem'
2030
1778
  * import { tempo } from 'tempo.ts/chains'
2031
- * import * as actions from 'tempo.ts/viem/actions'
1779
+ * import { Actions } from 'tempo.ts/viem'
2032
1780
  * import { privateKeyToAccount } from 'viem/accounts'
2033
1781
  *
2034
1782
  * const client = createClient({
2035
1783
  * account: privateKeyToAccount('0x...'),
2036
- * chain: tempo,
1784
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2037
1785
  * transport: http(),
2038
1786
  * })
2039
1787
  *
2040
- * const result = await actions.token.setSupplyCap(client, {
1788
+ * const result = await Actions.token.setSupplyCap(client, {
2041
1789
  * token: '0x...',
2042
1790
  * supplyCap: 1000000n,
2043
1791
  * })
@@ -2073,10 +1821,10 @@ export async function setSupplyCap(client, parameters) {
2073
1821
  * ```ts
2074
1822
  * import { createClient, http, walletActions } from 'viem'
2075
1823
  * import { tempo } from 'tempo.ts/chains'
2076
- * import * as actions from 'tempo.ts/viem/actions'
1824
+ * import { Actions } from 'tempo.ts/viem'
2077
1825
  *
2078
1826
  * const client = createClient({
2079
- * chain: tempo,
1827
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2080
1828
  * transport: http(),
2081
1829
  * }).extend(walletActions)
2082
1830
  *
@@ -2128,16 +1876,16 @@ export async function setSupplyCap(client, parameters) {
2128
1876
  * ```ts
2129
1877
  * import { createClient, http } from 'viem'
2130
1878
  * import { tempo } from 'tempo.ts/chains'
2131
- * import * as actions from 'tempo.ts/viem/actions'
1879
+ * import { Actions } from 'tempo.ts/viem'
2132
1880
  * import { privateKeyToAccount } from 'viem/accounts'
2133
1881
  *
2134
1882
  * const client = createClient({
2135
1883
  * account: privateKeyToAccount('0x...'),
2136
- * chain: tempo,
1884
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2137
1885
  * transport: http(),
2138
1886
  * })
2139
1887
  *
2140
- * const result = await actions.token.setSupplyCapSync(client, {
1888
+ * const result = await Actions.token.setSupplyCapSync(client, {
2141
1889
  * token: '0x...',
2142
1890
  * supplyCap: 1000000n,
2143
1891
  * })
@@ -2166,16 +1914,16 @@ export async function setSupplyCapSync(client, parameters) {
2166
1914
  * ```ts
2167
1915
  * import { createClient, http } from 'viem'
2168
1916
  * import { tempo } from 'tempo.ts/chains'
2169
- * import * as actions from 'tempo.ts/viem/actions'
1917
+ * import { Actions } from 'tempo.ts/viem'
2170
1918
  * import { privateKeyToAccount } from 'viem/accounts'
2171
1919
  *
2172
1920
  * const client = createClient({
2173
1921
  * account: privateKeyToAccount('0x...'),
2174
- * chain: tempo,
1922
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2175
1923
  * transport: http(),
2176
1924
  * })
2177
1925
  *
2178
- * const result = await actions.token.setRoleAdmin(client, {
1926
+ * const result = await Actions.token.setRoleAdmin(client, {
2179
1927
  * token: '0x...',
2180
1928
  * role: 'minter',
2181
1929
  * adminRole: 'admin',
@@ -2212,10 +1960,10 @@ export async function setRoleAdmin(client, parameters) {
2212
1960
  * ```ts
2213
1961
  * import { createClient, http, walletActions } from 'viem'
2214
1962
  * import { tempo } from 'tempo.ts/chains'
2215
- * import * as actions from 'tempo.ts/viem/actions'
1963
+ * import { Actions } from 'tempo.ts/viem'
2216
1964
  *
2217
1965
  * const client = createClient({
2218
- * chain: tempo,
1966
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2219
1967
  * transport: http(),
2220
1968
  * }).extend(walletActions)
2221
1969
  *
@@ -2270,16 +2018,16 @@ export async function setRoleAdmin(client, parameters) {
2270
2018
  * ```ts
2271
2019
  * import { createClient, http } from 'viem'
2272
2020
  * import { tempo } from 'tempo.ts/chains'
2273
- * import * as actions from 'tempo.ts/viem/actions'
2021
+ * import { Actions } from 'tempo.ts/viem'
2274
2022
  * import { privateKeyToAccount } from 'viem/accounts'
2275
2023
  *
2276
2024
  * const client = createClient({
2277
2025
  * account: privateKeyToAccount('0x...'),
2278
- * chain: tempo,
2026
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2279
2027
  * transport: http(),
2280
2028
  * })
2281
2029
  *
2282
- * const result = await actions.token.setRoleAdminSync(client, {
2030
+ * const result = await Actions.token.setRoleAdminSync(client, {
2283
2031
  * token: '0x...',
2284
2032
  * role: 'minter',
2285
2033
  * adminRole: 'admin',
@@ -2309,16 +2057,16 @@ export async function setRoleAdminSync(client, parameters) {
2309
2057
  * ```ts
2310
2058
  * import { createClient, http } from 'viem'
2311
2059
  * import { tempo } from 'tempo.ts/chains'
2312
- * import * as actions from 'tempo.ts/viem/actions'
2060
+ * import { Actions } from 'tempo.ts/viem'
2313
2061
  * import { privateKeyToAccount } from 'viem/accounts'
2314
2062
  *
2315
2063
  * const client = createClient({
2316
2064
  * account: privateKeyToAccount('0x...'),
2317
- * chain: tempo,
2065
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2318
2066
  * transport: http(),
2319
2067
  * })
2320
2068
  *
2321
- * const result = await actions.token.transfer(client, {
2069
+ * const result = await Actions.token.transfer(client, {
2322
2070
  * to: '0x...',
2323
2071
  * amount: 100n,
2324
2072
  * })
@@ -2354,10 +2102,10 @@ export async function transfer(client, parameters) {
2354
2102
  * ```ts
2355
2103
  * import { createClient, http, walletActions } from 'viem'
2356
2104
  * import { tempo } from 'tempo.ts/chains'
2357
- * import * as actions from 'tempo.ts/viem/actions'
2105
+ * import { Actions } from 'tempo.ts/viem'
2358
2106
  *
2359
2107
  * const client = createClient({
2360
- * chain: tempo,
2108
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2361
2109
  * transport: http(),
2362
2110
  * }).extend(walletActions)
2363
2111
  *
@@ -2376,7 +2124,7 @@ export async function transfer(client, parameters) {
2376
2124
  * @returns The call.
2377
2125
  */
2378
2126
  function call(args) {
2379
- const { amount, from, memo, token = Addresses.defaultFeeToken, to } = args;
2127
+ const { amount, from, memo, token, to } = args;
2380
2128
  const callArgs = (() => {
2381
2129
  if (memo && from)
2382
2130
  return {
@@ -2430,16 +2178,16 @@ export async function transfer(client, parameters) {
2430
2178
  * ```ts
2431
2179
  * import { createClient, http } from 'viem'
2432
2180
  * import { tempo } from 'tempo.ts/chains'
2433
- * import * as actions from 'tempo.ts/viem/actions'
2181
+ * import { Actions } from 'tempo.ts/viem'
2434
2182
  * import { privateKeyToAccount } from 'viem/accounts'
2435
2183
  *
2436
2184
  * const client = createClient({
2437
2185
  * account: privateKeyToAccount('0x...'),
2438
- * chain: tempo,
2186
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2439
2187
  * transport: http(),
2440
2188
  * })
2441
2189
  *
2442
- * const result = await actions.token.transferSync(client, {
2190
+ * const result = await Actions.token.transferSync(client, {
2443
2191
  * to: '0x...',
2444
2192
  * amount: 100n,
2445
2193
  * })
@@ -2468,16 +2216,16 @@ export async function transferSync(client, parameters) {
2468
2216
  * ```ts
2469
2217
  * import { createClient, http } from 'viem'
2470
2218
  * import { tempo } from 'tempo.ts/chains'
2471
- * import * as actions from 'tempo.ts/viem/actions'
2219
+ * import { Actions } from 'tempo.ts/viem'
2472
2220
  * import { privateKeyToAccount } from 'viem/accounts'
2473
2221
  *
2474
2222
  * const client = createClient({
2475
2223
  * account: privateKeyToAccount('0x...'),
2476
- * chain: tempo,
2224
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2477
2225
  * transport: http(),
2478
2226
  * })
2479
2227
  *
2480
- * const result = await actions.token.unpause(client, {
2228
+ * const result = await Actions.token.unpause(client, {
2481
2229
  * token: '0x...',
2482
2230
  * })
2483
2231
  * ```
@@ -2512,10 +2260,10 @@ export async function unpause(client, parameters) {
2512
2260
  * ```ts
2513
2261
  * import { createClient, http, walletActions } from 'viem'
2514
2262
  * import { tempo } from 'tempo.ts/chains'
2515
- * import * as actions from 'tempo.ts/viem/actions'
2263
+ * import { Actions } from 'tempo.ts/viem'
2516
2264
  *
2517
2265
  * const client = createClient({
2518
- * chain: tempo,
2266
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2519
2267
  * transport: http(),
2520
2268
  * }).extend(walletActions)
2521
2269
  *
@@ -2566,16 +2314,16 @@ export async function unpause(client, parameters) {
2566
2314
  * ```ts
2567
2315
  * import { createClient, http } from 'viem'
2568
2316
  * import { tempo } from 'tempo.ts/chains'
2569
- * import * as actions from 'tempo.ts/viem/actions'
2317
+ * import { Actions } from 'tempo.ts/viem'
2570
2318
  * import { privateKeyToAccount } from 'viem/accounts'
2571
2319
  *
2572
2320
  * const client = createClient({
2573
2321
  * account: privateKeyToAccount('0x...'),
2574
- * chain: tempo,
2322
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2575
2323
  * transport: http(),
2576
2324
  * })
2577
2325
  *
2578
- * const result = await actions.token.unpauseSync(client, {
2326
+ * const result = await Actions.token.unpauseSync(client, {
2579
2327
  * token: '0x...',
2580
2328
  * })
2581
2329
  * ```
@@ -2603,16 +2351,116 @@ export async function unpauseSync(client, parameters) {
2603
2351
  * ```ts
2604
2352
  * import { createClient, http } from 'viem'
2605
2353
  * import { tempo } from 'tempo.ts/chains'
2606
- * import * as actions from 'tempo.ts/viem/actions'
2354
+ * import { Actions } from 'tempo.ts/viem'
2355
+ * import { privateKeyToAccount } from 'viem/accounts'
2356
+ *
2357
+ * const client = createClient({
2358
+ * account: privateKeyToAccount('0x...'),
2359
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2360
+ * transport: http(),
2361
+ * })
2362
+ *
2363
+ * const result = await Actions.token.prepareUpdateQuoteToken(client, {
2364
+ * token: '0x...',
2365
+ * quoteToken: '0x...',
2366
+ * })
2367
+ * ```
2368
+ *
2369
+ * @param client - Client.
2370
+ * @param parameters - Parameters.
2371
+ * @returns The transaction hash.
2372
+ */
2373
+ export async function prepareUpdateQuoteToken(client, parameters) {
2374
+ return prepareUpdateQuoteToken.inner(writeContract, client, parameters);
2375
+ }
2376
+ (function (prepareUpdateQuoteToken) {
2377
+ /** @internal */
2378
+ async function inner(action, client, parameters) {
2379
+ const { quoteToken, token, ...rest } = parameters;
2380
+ const call = prepareUpdateQuoteToken.call({ quoteToken, token });
2381
+ return (await action(client, {
2382
+ ...rest,
2383
+ ...call,
2384
+ }));
2385
+ }
2386
+ prepareUpdateQuoteToken.inner = inner;
2387
+ /**
2388
+ * Defines a call to the `prepareUpdateQuoteToken` function.
2389
+ *
2390
+ * Can be passed as a parameter to:
2391
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
2392
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
2393
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
2394
+ *
2395
+ * @example
2396
+ * ```ts
2397
+ * import { createClient, http, walletActions } from 'viem'
2398
+ * import { tempo } from 'tempo.ts/chains'
2399
+ * import { Actions } from 'tempo.ts/viem'
2400
+ *
2401
+ * const client = createClient({
2402
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2403
+ * transport: http(),
2404
+ * }).extend(walletActions)
2405
+ *
2406
+ * const { result } = await client.sendCalls({
2407
+ * calls: [
2408
+ * actions.token.prepareUpdateQuoteToken.call({
2409
+ * token: '0x20c0...babe',
2410
+ * quoteToken: '0x20c0...cafe',
2411
+ * }),
2412
+ * ]
2413
+ * })
2414
+ * ```
2415
+ *
2416
+ * @param args - Arguments.
2417
+ * @returns The call.
2418
+ */
2419
+ function call(args) {
2420
+ const { token, quoteToken } = args;
2421
+ return defineCall({
2422
+ address: TokenId.toAddress(token),
2423
+ abi: Abis.tip20,
2424
+ functionName: 'setNextQuoteToken',
2425
+ args: [TokenId.toAddress(quoteToken)],
2426
+ });
2427
+ }
2428
+ prepareUpdateQuoteToken.call = call;
2429
+ /**
2430
+ * Extracts the event from the logs.
2431
+ *
2432
+ * @param logs - Logs.
2433
+ * @returns The event.
2434
+ */
2435
+ function extractEvent(logs) {
2436
+ const [log] = parseEventLogs({
2437
+ abi: Abis.tip20,
2438
+ logs,
2439
+ eventName: 'NextQuoteTokenSet',
2440
+ });
2441
+ if (!log)
2442
+ throw new Error('`NextQuoteTokenSet` event not found.');
2443
+ return log;
2444
+ }
2445
+ prepareUpdateQuoteToken.extractEvent = extractEvent;
2446
+ })(prepareUpdateQuoteToken || (prepareUpdateQuoteToken = {}));
2447
+ /**
2448
+ * Updates the quote token for a TIP20 token.
2449
+ *
2450
+ * @example
2451
+ * ```ts
2452
+ * import { createClient, http } from 'viem'
2453
+ * import { tempo } from 'tempo.ts/chains'
2454
+ * import { Actions } from 'tempo.ts/viem'
2607
2455
  * import { privateKeyToAccount } from 'viem/accounts'
2608
2456
  *
2609
2457
  * const client = createClient({
2610
2458
  * account: privateKeyToAccount('0x...'),
2611
- * chain: tempo,
2459
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2612
2460
  * transport: http(),
2613
2461
  * })
2614
2462
  *
2615
- * const result = await actions.token.updateQuoteToken(client, {
2463
+ * const result = await Actions.token.prepareUpdateQuoteTokenSync(client, {
2616
2464
  * token: '0x...',
2617
2465
  * quoteToken: '0x...',
2618
2466
  * })
@@ -2620,6 +2468,39 @@ export async function unpauseSync(client, parameters) {
2620
2468
  *
2621
2469
  * @param client - Client.
2622
2470
  * @param parameters - Parameters.
2471
+ * @returns The transaction receipt and event data.
2472
+ */
2473
+ export async function prepareUpdateQuoteTokenSync(client, parameters) {
2474
+ const receipt = await prepareUpdateQuoteToken.inner(writeContractSync, client, parameters);
2475
+ const { args } = prepareUpdateQuoteToken.extractEvent(receipt.logs);
2476
+ return {
2477
+ ...args,
2478
+ receipt,
2479
+ };
2480
+ }
2481
+ /**
2482
+ * Updates the quote token for a TIP20 token.
2483
+ *
2484
+ * @example
2485
+ * ```ts
2486
+ * import { createClient, http } from 'viem'
2487
+ * import { tempo } from 'tempo.ts/chains'
2488
+ * import { Actions } from 'tempo.ts/viem'
2489
+ * import { privateKeyToAccount } from 'viem/accounts'
2490
+ *
2491
+ * const client = createClient({
2492
+ * account: privateKeyToAccount('0x...'),
2493
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2494
+ * transport: http(),
2495
+ * })
2496
+ *
2497
+ * const result = await Actions.token.updateQuoteToken(client, {
2498
+ * token: '0x...',
2499
+ * })
2500
+ * ```
2501
+ *
2502
+ * @param client - Client.
2503
+ * @param parameters - Parameters.
2623
2504
  * @returns The transaction hash.
2624
2505
  */
2625
2506
  export async function updateQuoteToken(client, parameters) {
@@ -2628,8 +2509,8 @@ export async function updateQuoteToken(client, parameters) {
2628
2509
  (function (updateQuoteToken) {
2629
2510
  /** @internal */
2630
2511
  async function inner(action, client, parameters) {
2631
- const { quoteToken, token, ...rest } = parameters;
2632
- const call = updateQuoteToken.call({ quoteToken, token });
2512
+ const { token, ...rest } = parameters;
2513
+ const call = updateQuoteToken.call({ token });
2633
2514
  return (await action(client, {
2634
2515
  ...rest,
2635
2516
  ...call,
@@ -2648,10 +2529,10 @@ export async function updateQuoteToken(client, parameters) {
2648
2529
  * ```ts
2649
2530
  * import { createClient, http, walletActions } from 'viem'
2650
2531
  * import { tempo } from 'tempo.ts/chains'
2651
- * import * as actions from 'tempo.ts/viem/actions'
2532
+ * import { Actions } from 'tempo.ts/viem'
2652
2533
  *
2653
2534
  * const client = createClient({
2654
- * chain: tempo,
2535
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2655
2536
  * transport: http(),
2656
2537
  * }).extend(walletActions)
2657
2538
  *
@@ -2659,7 +2540,6 @@ export async function updateQuoteToken(client, parameters) {
2659
2540
  * calls: [
2660
2541
  * actions.token.updateQuoteToken.call({
2661
2542
  * token: '0x20c0...babe',
2662
- * quoteToken: '0x20c0...cafe',
2663
2543
  * }),
2664
2544
  * ]
2665
2545
  * })
@@ -2669,12 +2549,12 @@ export async function updateQuoteToken(client, parameters) {
2669
2549
  * @returns The call.
2670
2550
  */
2671
2551
  function call(args) {
2672
- const { token, quoteToken } = args;
2552
+ const { token } = args;
2673
2553
  return defineCall({
2674
2554
  address: TokenId.toAddress(token),
2675
2555
  abi: Abis.tip20,
2676
- functionName: 'updateQuoteToken',
2677
- args: [TokenId.toAddress(quoteToken)],
2556
+ functionName: 'completeQuoteTokenUpdate',
2557
+ args: [],
2678
2558
  });
2679
2559
  }
2680
2560
  updateQuoteToken.call = call;
@@ -2688,10 +2568,10 @@ export async function updateQuoteToken(client, parameters) {
2688
2568
  const [log] = parseEventLogs({
2689
2569
  abi: Abis.tip20,
2690
2570
  logs,
2691
- eventName: 'UpdateQuoteToken',
2571
+ eventName: 'QuoteTokenUpdate',
2692
2572
  });
2693
2573
  if (!log)
2694
- throw new Error('`UpdateQuoteToken` event not found.');
2574
+ throw new Error('`QuoteTokenUpdateCompleted` event not found.');
2695
2575
  return log;
2696
2576
  }
2697
2577
  updateQuoteToken.extractEvent = extractEvent;
@@ -2703,18 +2583,17 @@ export async function updateQuoteToken(client, parameters) {
2703
2583
  * ```ts
2704
2584
  * import { createClient, http } from 'viem'
2705
2585
  * import { tempo } from 'tempo.ts/chains'
2706
- * import * as actions from 'tempo.ts/viem/actions'
2586
+ * import { Actions } from 'tempo.ts/viem'
2707
2587
  * import { privateKeyToAccount } from 'viem/accounts'
2708
2588
  *
2709
2589
  * const client = createClient({
2710
2590
  * account: privateKeyToAccount('0x...'),
2711
- * chain: tempo,
2591
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2712
2592
  * transport: http(),
2713
2593
  * })
2714
2594
  *
2715
- * const result = await actions.token.updateQuoteTokenSync(client, {
2595
+ * const result = await Actions.token.updateQuoteTokenSync(client, {
2716
2596
  * token: '0x...',
2717
- * quoteToken: '0x...',
2718
2597
  * })
2719
2598
  * ```
2720
2599
  *
@@ -2737,10 +2616,10 @@ export async function updateQuoteTokenSync(client, parameters) {
2737
2616
  * ```ts
2738
2617
  * import { createClient, http } from 'viem'
2739
2618
  * import { tempo } from 'tempo.ts/chains'
2740
- * import * as actions from 'tempo.ts/viem/actions'
2619
+ * import { Actions } from 'tempo.ts/viem'
2741
2620
  *
2742
2621
  * const client = createClient({
2743
- * chain: tempo,
2622
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2744
2623
  * transport: http(),
2745
2624
  * })
2746
2625
  *
@@ -2756,7 +2635,7 @@ export async function updateQuoteTokenSync(client, parameters) {
2756
2635
  * @returns A function to unsubscribe from the event.
2757
2636
  */
2758
2637
  export function watchApprove(client, parameters) {
2759
- const { onApproval, token = Addresses.defaultFeeToken, ...rest } = parameters;
2638
+ const { onApproval, token, ...rest } = parameters;
2760
2639
  return watchContractEvent(client, {
2761
2640
  ...rest,
2762
2641
  address: TokenId.toAddress(token),
@@ -2776,10 +2655,10 @@ export function watchApprove(client, parameters) {
2776
2655
  * ```ts
2777
2656
  * import { createClient, http } from 'viem'
2778
2657
  * import { tempo } from 'tempo.ts/chains'
2779
- * import * as actions from 'tempo.ts/viem/actions'
2658
+ * import { Actions } from 'tempo.ts/viem'
2780
2659
  *
2781
2660
  * const client = createClient({
2782
- * chain: tempo,
2661
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2783
2662
  * transport: http(),
2784
2663
  * })
2785
2664
  *
@@ -2795,7 +2674,7 @@ export function watchApprove(client, parameters) {
2795
2674
  * @returns A function to unsubscribe from the event.
2796
2675
  */
2797
2676
  export function watchBurn(client, parameters) {
2798
- const { onBurn, token = Addresses.defaultFeeToken, ...rest } = parameters;
2677
+ const { onBurn, token, ...rest } = parameters;
2799
2678
  return watchContractEvent(client, {
2800
2679
  ...rest,
2801
2680
  address: TokenId.toAddress(token),
@@ -2815,10 +2694,10 @@ export function watchBurn(client, parameters) {
2815
2694
  * ```ts
2816
2695
  * import { createClient, http } from 'viem'
2817
2696
  * import { tempo } from 'tempo.ts/chains'
2818
- * import * as actions from 'tempo.ts/viem/actions'
2697
+ * import { Actions } from 'tempo.ts/viem'
2819
2698
  *
2820
2699
  * const client = createClient({
2821
- * chain: tempo,
2700
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2822
2701
  * transport: http(),
2823
2702
  * })
2824
2703
  *
@@ -2854,10 +2733,10 @@ export function watchCreate(client, parameters) {
2854
2733
  * ```ts
2855
2734
  * import { createClient, http } from 'viem'
2856
2735
  * import { tempo } from 'tempo.ts/chains'
2857
- * import * as actions from 'tempo.ts/viem/actions'
2736
+ * import { Actions } from 'tempo.ts/viem'
2858
2737
  *
2859
2738
  * const client = createClient({
2860
- * chain: tempo,
2739
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2861
2740
  * transport: http(),
2862
2741
  * })
2863
2742
  *
@@ -2873,7 +2752,7 @@ export function watchCreate(client, parameters) {
2873
2752
  * @returns A function to unsubscribe from the event.
2874
2753
  */
2875
2754
  export function watchMint(client, parameters) {
2876
- const { onMint, token = Addresses.defaultFeeToken, ...rest } = parameters;
2755
+ const { onMint, token, ...rest } = parameters;
2877
2756
  return watchContractEvent(client, {
2878
2757
  ...rest,
2879
2758
  address: TokenId.toAddress(token),
@@ -2893,10 +2772,10 @@ export function watchMint(client, parameters) {
2893
2772
  * ```ts
2894
2773
  * import { createClient, http } from 'viem'
2895
2774
  * import { tempo } from 'tempo.ts/chains'
2896
- * import * as actions from 'tempo.ts/viem/actions'
2775
+ * import { Actions } from 'tempo.ts/viem'
2897
2776
  *
2898
2777
  * const client = createClient({
2899
- * chain: tempo,
2778
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2900
2779
  * transport: http(),
2901
2780
  * })
2902
2781
  *
@@ -2912,7 +2791,7 @@ export function watchMint(client, parameters) {
2912
2791
  * @returns A function to unsubscribe from the event.
2913
2792
  */
2914
2793
  export function watchAdminRole(client, parameters) {
2915
- const { onRoleAdminUpdated, token = Addresses.defaultFeeToken, ...rest } = parameters;
2794
+ const { onRoleAdminUpdated, token, ...rest } = parameters;
2916
2795
  return watchContractEvent(client, {
2917
2796
  ...rest,
2918
2797
  address: TokenId.toAddress(token),
@@ -2932,10 +2811,10 @@ export function watchAdminRole(client, parameters) {
2932
2811
  * ```ts
2933
2812
  * import { createClient, http } from 'viem'
2934
2813
  * import { tempo } from 'tempo.ts/chains'
2935
- * import * as actions from 'tempo.ts/viem/actions'
2814
+ * import { Actions } from 'tempo.ts/viem'
2936
2815
  *
2937
2816
  * const client = createClient({
2938
- * chain: tempo,
2817
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2939
2818
  * transport: http(),
2940
2819
  * })
2941
2820
  *
@@ -2951,7 +2830,7 @@ export function watchAdminRole(client, parameters) {
2951
2830
  * @returns A function to unsubscribe from the event.
2952
2831
  */
2953
2832
  export function watchRole(client, parameters) {
2954
- const { onRoleUpdated, token = Addresses.defaultFeeToken, ...rest } = parameters;
2833
+ const { onRoleUpdated, token, ...rest } = parameters;
2955
2834
  return watchContractEvent(client, {
2956
2835
  ...rest,
2957
2836
  address: TokenId.toAddress(token),
@@ -2973,11 +2852,11 @@ export function watchRole(client, parameters) {
2973
2852
  * ```ts
2974
2853
  * import { createClient, http } from 'viem'
2975
2854
  * import { tempo } from 'tempo.ts/chains'
2976
- * import * as actions from 'tempo.ts/viem/actions'
2855
+ * import { Actions } from 'tempo.ts/viem'
2977
2856
  *
2978
2857
  * const client = createClient({
2979
2858
  * account: privateKeyToAccount('0x...'),
2980
- * chain: tempo,
2859
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2981
2860
  * transport: http(),
2982
2861
  * })
2983
2862
  *
@@ -2993,7 +2872,7 @@ export function watchRole(client, parameters) {
2993
2872
  * @returns A function to unsubscribe from the event.
2994
2873
  */
2995
2874
  export function watchTransfer(client, parameters) {
2996
- const { onTransfer, token = Addresses.defaultFeeToken, ...rest } = parameters;
2875
+ const { onTransfer, token, ...rest } = parameters;
2997
2876
  return watchContractEvent(client, {
2998
2877
  ...rest,
2999
2878
  address: TokenId.toAddress(token),
@@ -3013,17 +2892,17 @@ export function watchTransfer(client, parameters) {
3013
2892
  * ```ts
3014
2893
  * import { createClient, http } from 'viem'
3015
2894
  * import { tempo } from 'tempo.ts/chains'
3016
- * import * as actions from 'tempo.ts/viem/actions'
2895
+ * import { Actions } from 'tempo.ts/viem'
3017
2896
  *
3018
2897
  * const client = createClient({
3019
- * chain: tempo,
2898
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
3020
2899
  * transport: http(),
3021
2900
  * })
3022
2901
  *
3023
2902
  * const unwatch = actions.token.watchUpdateQuoteToken(client, {
3024
2903
  * onUpdateQuoteToken: (args, log) => {
3025
- * if (args.finalized)
3026
- * console.log('quote token update finalized:', args.newQuoteToken)
2904
+ * if (args.completed)
2905
+ * console.log('quote token update completed:', args.newQuoteToken)
3027
2906
  * else
3028
2907
  * console.log('quote token update proposed:', args.newQuoteToken)
3029
2908
  * },
@@ -3035,7 +2914,7 @@ export function watchTransfer(client, parameters) {
3035
2914
  * @returns A function to unsubscribe from the event.
3036
2915
  */
3037
2916
  export function watchUpdateQuoteToken(client, parameters) {
3038
- const { onUpdateQuoteToken, token = Addresses.defaultFeeToken, ...rest } = parameters;
2917
+ const { onUpdateQuoteToken, token, ...rest } = parameters;
3039
2918
  const address = TokenId.toAddress(token);
3040
2919
  return watchContractEvent(client, {
3041
2920
  ...rest,
@@ -3043,12 +2922,12 @@ export function watchUpdateQuoteToken(client, parameters) {
3043
2922
  abi: Abis.tip20,
3044
2923
  onLogs: (logs) => {
3045
2924
  for (const log of logs) {
3046
- if (log.eventName !== 'UpdateQuoteToken' &&
3047
- log.eventName !== 'QuoteTokenUpdateFinalized')
2925
+ if (log.eventName !== 'NextQuoteTokenSet' &&
2926
+ log.eventName !== 'QuoteTokenUpdate')
3048
2927
  continue;
3049
2928
  onUpdateQuoteToken({
3050
2929
  ...log.args,
3051
- finalized: log.eventName === 'QuoteTokenUpdateFinalized',
2930
+ completed: log.eventName === 'QuoteTokenUpdate',
3052
2931
  }, log);
3053
2932
  }
3054
2933
  },