tempo.ts 0.10.5 → 0.11.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 (224) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +0 -41
  3. package/dist/viem/Account.d.ts +8 -3
  4. package/dist/viem/Account.d.ts.map +1 -1
  5. package/dist/viem/Account.js +9 -2
  6. package/dist/viem/Account.js.map +1 -1
  7. package/dist/viem/Actions/amm.d.ts +1 -1
  8. package/dist/viem/Actions/amm.d.ts.map +1 -1
  9. package/dist/viem/Actions/amm.js +1 -2
  10. package/dist/viem/Actions/amm.js.map +1 -1
  11. package/dist/viem/Actions/dex.d.ts +0 -35
  12. package/dist/viem/Actions/dex.d.ts.map +1 -1
  13. package/dist/viem/Actions/dex.js +0 -43
  14. package/dist/viem/Actions/dex.js.map +1 -1
  15. package/dist/viem/Actions/fee.d.ts +1 -1
  16. package/dist/viem/Actions/fee.d.ts.map +1 -1
  17. package/dist/viem/Actions/fee.js +1 -1
  18. package/dist/viem/Actions/fee.js.map +1 -1
  19. package/dist/viem/Actions/nonce.d.ts.map +1 -1
  20. package/dist/viem/Actions/nonce.js +6 -4
  21. package/dist/viem/Actions/nonce.js.map +1 -1
  22. package/dist/viem/Actions/token.d.ts +1 -2
  23. package/dist/viem/Actions/token.d.ts.map +1 -1
  24. package/dist/viem/Actions/token.js +1 -2
  25. package/dist/viem/Actions/token.js.map +1 -1
  26. package/dist/viem/Chain.d.ts +34 -34
  27. package/dist/viem/Chain.d.ts.map +1 -1
  28. package/dist/viem/Chain.js +2 -0
  29. package/dist/viem/Chain.js.map +1 -1
  30. package/dist/viem/Formatters.d.ts.map +1 -1
  31. package/dist/viem/Formatters.js +5 -3
  32. package/dist/viem/Formatters.js.map +1 -1
  33. package/dist/viem/Transaction.d.ts +8 -5
  34. package/dist/viem/Transaction.d.ts.map +1 -1
  35. package/dist/viem/Transaction.js +13 -3
  36. package/dist/viem/Transaction.js.map +1 -1
  37. package/dist/viem/internal/types.d.ts +1 -1
  38. package/dist/viem/internal/types.d.ts.map +1 -1
  39. package/dist/wagmi/Actions/dex.d.ts +1 -45
  40. package/dist/wagmi/Actions/dex.d.ts.map +1 -1
  41. package/dist/wagmi/Actions/dex.js +0 -55
  42. package/dist/wagmi/Actions/dex.js.map +1 -1
  43. package/dist/wagmi/Connector.d.ts +1 -1
  44. package/dist/wagmi/Connector.d.ts.map +1 -1
  45. package/dist/wagmi/Connector.js +1 -2
  46. package/dist/wagmi/Connector.js.map +1 -1
  47. package/dist/wagmi/Hooks/dex.d.ts +3 -46
  48. package/dist/wagmi/Hooks/dex.d.ts.map +1 -1
  49. package/dist/wagmi/Hooks/dex.js +2 -54
  50. package/dist/wagmi/Hooks/dex.js.map +1 -1
  51. package/dist/wagmi/index.d.ts +1 -1
  52. package/dist/wagmi/index.d.ts.map +1 -1
  53. package/dist/wagmi/index.js +1 -1
  54. package/dist/wagmi/index.js.map +1 -1
  55. package/package.json +5 -23
  56. package/src/viem/Account.test.ts +1 -1
  57. package/src/viem/Account.ts +11 -2
  58. package/src/viem/Actions/account.ts +1 -1
  59. package/src/viem/Actions/amm.ts +1 -2
  60. package/src/viem/Actions/dex.test.ts +1 -195
  61. package/src/viem/Actions/dex.ts +0 -53
  62. package/src/viem/Actions/fee.test.ts +2 -2
  63. package/src/viem/Actions/fee.ts +1 -1
  64. package/src/viem/Actions/nonce.test.ts +27 -14
  65. package/src/viem/Actions/nonce.ts +6 -4
  66. package/src/viem/Actions/token.test.ts +18 -52
  67. package/src/viem/Actions/token.ts +1 -2
  68. package/src/viem/Chain.ts +3 -1
  69. package/src/viem/Decorator.ts +0 -30
  70. package/src/viem/Formatters.ts +9 -3
  71. package/src/viem/Transaction.ts +23 -7
  72. package/src/viem/e2e.test.ts +19 -0
  73. package/src/viem/index.ts +12 -1
  74. package/src/viem/internal/types.ts +1 -1
  75. package/src/wagmi/Actions/dex.test.ts +0 -26
  76. package/src/wagmi/Actions/dex.ts +1 -111
  77. package/src/wagmi/Actions/nonce.test.ts +8 -4
  78. package/src/wagmi/Actions/token.test.ts +2 -2
  79. package/src/wagmi/Connector.ts +1 -2
  80. package/src/wagmi/Hooks/dex.test.ts +0 -26
  81. package/src/wagmi/Hooks/dex.ts +1 -88
  82. package/src/wagmi/Hooks/nonce.test.ts +3 -3
  83. package/src/wagmi/index.ts +4 -1
  84. package/dist/chains.d.ts +0 -73
  85. package/dist/chains.d.ts.map +0 -1
  86. package/dist/chains.js +0 -51
  87. package/dist/chains.js.map +0 -1
  88. package/dist/ox/AuthorizationTempo.d.ts +0 -450
  89. package/dist/ox/AuthorizationTempo.d.ts.map +0 -1
  90. package/dist/ox/AuthorizationTempo.js +0 -433
  91. package/dist/ox/AuthorizationTempo.js.map +0 -1
  92. package/dist/ox/KeyAuthorization.d.ts +0 -356
  93. package/dist/ox/KeyAuthorization.d.ts.map +0 -1
  94. package/dist/ox/KeyAuthorization.js +0 -359
  95. package/dist/ox/KeyAuthorization.js.map +0 -1
  96. package/dist/ox/Order.d.ts +0 -92
  97. package/dist/ox/Order.d.ts.map +0 -1
  98. package/dist/ox/Order.js +0 -88
  99. package/dist/ox/Order.js.map +0 -1
  100. package/dist/ox/OrdersFilters.d.ts +0 -72
  101. package/dist/ox/OrdersFilters.d.ts.map +0 -1
  102. package/dist/ox/OrdersFilters.js +0 -100
  103. package/dist/ox/OrdersFilters.js.map +0 -1
  104. package/dist/ox/Pagination.d.ts +0 -128
  105. package/dist/ox/Pagination.d.ts.map +0 -1
  106. package/dist/ox/Pagination.js +0 -78
  107. package/dist/ox/Pagination.js.map +0 -1
  108. package/dist/ox/PoolId.d.ts +0 -18
  109. package/dist/ox/PoolId.d.ts.map +0 -1
  110. package/dist/ox/PoolId.js +0 -13
  111. package/dist/ox/PoolId.js.map +0 -1
  112. package/dist/ox/RpcSchema.d.ts +0 -32
  113. package/dist/ox/RpcSchema.d.ts.map +0 -1
  114. package/dist/ox/RpcSchema.js +0 -2
  115. package/dist/ox/RpcSchema.js.map +0 -1
  116. package/dist/ox/SignatureEnvelope.d.ts +0 -260
  117. package/dist/ox/SignatureEnvelope.d.ts.map +0 -1
  118. package/dist/ox/SignatureEnvelope.js +0 -477
  119. package/dist/ox/SignatureEnvelope.js.map +0 -1
  120. package/dist/ox/Tick.d.ts +0 -115
  121. package/dist/ox/Tick.d.ts.map +0 -1
  122. package/dist/ox/Tick.js +0 -127
  123. package/dist/ox/Tick.js.map +0 -1
  124. package/dist/ox/TokenId.d.ts +0 -25
  125. package/dist/ox/TokenId.d.ts.map +0 -1
  126. package/dist/ox/TokenId.js +0 -41
  127. package/dist/ox/TokenId.js.map +0 -1
  128. package/dist/ox/TokenRole.d.ts +0 -11
  129. package/dist/ox/TokenRole.d.ts.map +0 -1
  130. package/dist/ox/TokenRole.js +0 -22
  131. package/dist/ox/TokenRole.js.map +0 -1
  132. package/dist/ox/Transaction.d.ts +0 -201
  133. package/dist/ox/Transaction.d.ts.map +0 -1
  134. package/dist/ox/Transaction.js +0 -167
  135. package/dist/ox/Transaction.js.map +0 -1
  136. package/dist/ox/TransactionEnvelopeTempo.d.ts +0 -470
  137. package/dist/ox/TransactionEnvelopeTempo.d.ts.map +0 -1
  138. package/dist/ox/TransactionEnvelopeTempo.js +0 -547
  139. package/dist/ox/TransactionEnvelopeTempo.js.map +0 -1
  140. package/dist/ox/TransactionReceipt.d.ts +0 -155
  141. package/dist/ox/TransactionReceipt.d.ts.map +0 -1
  142. package/dist/ox/TransactionReceipt.js +0 -136
  143. package/dist/ox/TransactionReceipt.js.map +0 -1
  144. package/dist/ox/TransactionRequest.d.ts +0 -76
  145. package/dist/ox/TransactionRequest.d.ts.map +0 -1
  146. package/dist/ox/TransactionRequest.js +0 -93
  147. package/dist/ox/TransactionRequest.js.map +0 -1
  148. package/dist/ox/index.d.ts +0 -14
  149. package/dist/ox/index.d.ts.map +0 -1
  150. package/dist/ox/index.js +0 -14
  151. package/dist/ox/index.js.map +0 -1
  152. package/dist/prool/Instance.d.ts +0 -101
  153. package/dist/prool/Instance.d.ts.map +0 -1
  154. package/dist/prool/Instance.js +0 -136
  155. package/dist/prool/Instance.js.map +0 -1
  156. package/dist/prool/chain.json +0 -238
  157. package/dist/prool/index.d.ts +0 -2
  158. package/dist/prool/index.d.ts.map +0 -1
  159. package/dist/prool/index.js +0 -2
  160. package/dist/prool/index.js.map +0 -1
  161. package/dist/viem/Actions/account.d.ts +0 -40
  162. package/dist/viem/Actions/account.d.ts.map +0 -1
  163. package/dist/viem/Actions/account.js +0 -86
  164. package/dist/viem/Actions/account.js.map +0 -1
  165. package/dist/viem/Actions/index.d.ts +0 -10
  166. package/dist/viem/Actions/index.d.ts.map +0 -1
  167. package/dist/viem/Actions/index.js +0 -10
  168. package/dist/viem/Actions/index.js.map +0 -1
  169. package/dist/viem/Decorator.d.ts +0 -2810
  170. package/dist/viem/Decorator.d.ts.map +0 -1
  171. package/dist/viem/Decorator.js +0 -138
  172. package/dist/viem/Decorator.js.map +0 -1
  173. package/dist/viem/P256.d.ts +0 -2
  174. package/dist/viem/P256.d.ts.map +0 -1
  175. package/dist/viem/P256.js +0 -2
  176. package/dist/viem/P256.js.map +0 -1
  177. package/dist/viem/Secp256k1.d.ts +0 -2
  178. package/dist/viem/Secp256k1.d.ts.map +0 -1
  179. package/dist/viem/Secp256k1.js +0 -2
  180. package/dist/viem/Secp256k1.js.map +0 -1
  181. package/dist/viem/TokenIds.d.ts +0 -2
  182. package/dist/viem/TokenIds.d.ts.map +0 -1
  183. package/dist/viem/TokenIds.js +0 -2
  184. package/dist/viem/TokenIds.js.map +0 -1
  185. package/dist/viem/index.d.ts +0 -17
  186. package/dist/viem/index.d.ts.map +0 -1
  187. package/dist/viem/index.js +0 -17
  188. package/dist/viem/index.js.map +0 -1
  189. package/src/ox/AuthorizationTempo.test.ts +0 -1256
  190. package/src/ox/AuthorizationTempo.ts +0 -648
  191. package/src/ox/KeyAuthorization.test.ts +0 -1332
  192. package/src/ox/KeyAuthorization.ts +0 -540
  193. package/src/ox/Order.test.ts +0 -78
  194. package/src/ox/Order.ts +0 -125
  195. package/src/ox/OrdersFilters.test.ts +0 -182
  196. package/src/ox/OrdersFilters.ts +0 -125
  197. package/src/ox/Pagination.test.ts +0 -162
  198. package/src/ox/Pagination.ts +0 -164
  199. package/src/ox/PoolId.test.ts +0 -33
  200. package/src/ox/PoolId.ts +0 -27
  201. package/src/ox/RpcSchema.ts +0 -35
  202. package/src/ox/SignatureEnvelope.test.ts +0 -1876
  203. package/src/ox/SignatureEnvelope.ts +0 -791
  204. package/src/ox/Tick.test.ts +0 -281
  205. package/src/ox/Tick.ts +0 -181
  206. package/src/ox/TokenId.test.ts +0 -40
  207. package/src/ox/TokenId.ts +0 -50
  208. package/src/ox/TokenRole.test.ts +0 -16
  209. package/src/ox/TokenRole.ts +0 -27
  210. package/src/ox/Transaction.test.ts +0 -523
  211. package/src/ox/Transaction.ts +0 -332
  212. package/src/ox/TransactionEnvelopeTempo.test.ts +0 -1352
  213. package/src/ox/TransactionEnvelopeTempo.ts +0 -905
  214. package/src/ox/TransactionReceipt.ts +0 -190
  215. package/src/ox/TransactionRequest.ts +0 -147
  216. package/src/ox/e2e.test.ts +0 -1393
  217. package/src/ox/index.ts +0 -13
  218. package/src/prool/Instance.test.ts +0 -43
  219. package/src/prool/Instance.ts +0 -247
  220. package/src/prool/chain.json +0 -238
  221. package/src/prool/index.ts +0 -1
  222. package/src/viem/Actions/__snapshots__/dex.test.ts.snap +0 -850
  223. package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +0 -310
  224. package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +0 -457
@@ -1,2810 +0,0 @@
1
- import type { Account, Chain, Client, Transport } from 'viem';
2
- import type { VerifyHashParameters, VerifyHashReturnType } from 'viem/actions';
3
- import type { PartialBy } from '../internal/types.js';
4
- import * as ammActions from './Actions/amm.js';
5
- import * as dexActions from './Actions/dex.js';
6
- import * as faucetActions from './Actions/faucet.js';
7
- import * as feeActions from './Actions/fee.js';
8
- import * as policyActions from './Actions/policy.js';
9
- import * as rewardActions from './Actions/reward.js';
10
- import * as tokenActions from './Actions/token.js';
11
- export type Decorator<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
12
- /**
13
- * Verifies that a signature is valid for a given hash and address.
14
- * Supports Secp256k1, P256, WebCrypto P256, and WebAuthn signatures.
15
- *
16
- * @example
17
- * ```ts
18
- * import { createClient, http } from 'viem'
19
- * import { tempo } from 'tempo.ts/chains'
20
- * import { tempoActions } from 'tempo.ts/viem'
21
- *
22
- * const client = createClient({
23
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
24
- * transport: http(),
25
- * }).extend(tempoActions())
26
- *
27
- * const valid = await client.verifyHash({
28
- * address: '0x...',
29
- * hash: '0x...',
30
- * signature: '0x...',
31
- * })
32
- * ```
33
- *
34
- * @param parameters - Parameters.
35
- * @returns Whether the signature is valid.
36
- */
37
- verifyHash: (parameters: PartialBy<VerifyHashParameters, 'address'>) => Promise<VerifyHashReturnType>;
38
- amm: {
39
- /**
40
- * Gets the reserves for a liquidity pool.
41
- *
42
- * @example
43
- * ```ts
44
- * import { createClient, http } from 'viem'
45
- * import { tempo } from 'tempo.ts/chains'
46
- * import { tempoActions } from 'tempo.ts/viem'
47
- *
48
- * const client = createClient({
49
- * chain: tempo({ feeToken: '0x20c...001' }),
50
- * transport: http(),
51
- * }).extend(tempoActions())
52
- *
53
- * const pool = await client.amm.getPool({
54
- * userToken: '0x...',
55
- * validatorToken: '0x...',
56
- * })
57
- * ```
58
- *
59
- * @param parameters - Parameters.
60
- * @returns The pool reserves.
61
- */
62
- getPool: (parameters: ammActions.getPool.Parameters) => Promise<ammActions.getPool.ReturnValue>;
63
- /**
64
- * Gets the LP token balance for an account in a specific pool.
65
- *
66
- * @example
67
- * ```ts
68
- * import { createClient, http } from 'viem'
69
- * import { tempo } from 'tempo.ts/chains'
70
- * import { tempoActions } from 'tempo.ts/viem'
71
- *
72
- * const client = createClient({
73
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
74
- * transport: http(),
75
- * }).extend(tempoActions())
76
- *
77
- * const poolId = await client.amm.getPoolId({
78
- * userToken: '0x...',
79
- * validatorToken: '0x...',
80
- * })
81
- *
82
- * const balance = await client.amm.getLiquidityBalance({
83
- * poolId,
84
- * address: '0x...',
85
- * })
86
- * ```
87
- *
88
- * @param parameters - Parameters.
89
- * @returns The LP token balance.
90
- */
91
- getLiquidityBalance: (parameters: ammActions.getLiquidityBalance.Parameters) => Promise<ammActions.getLiquidityBalance.ReturnValue>;
92
- /**
93
- * Removes liquidity from a pool.
94
- *
95
- * @example
96
- * ```ts
97
- * import { createClient, http } from 'viem'
98
- * import { privateKeyToAccount } from 'viem/accounts'
99
- * import { tempo } from 'tempo.ts/chains'
100
- * import { tempoActions } from 'tempo.ts/viem'
101
- *
102
- * const client = createClient({
103
- * account: privateKeyToAccount('0x...'),
104
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
105
- * transport: http(),
106
- * }).extend(tempoActions())
107
- *
108
- * const hash = await client.amm.burn({
109
- * userToken: '0x...',
110
- * validatorToken: '0x...',
111
- * liquidity: 50n,
112
- * to: '0x...',
113
- * })
114
- * ```
115
- *
116
- * @param parameters - Parameters.
117
- * @returns The transaction hash.
118
- */
119
- burn: (parameters: ammActions.burn.Parameters<chain, account>) => Promise<ammActions.burn.ReturnValue>;
120
- /**
121
- * Removes liquidity from a pool and waits for confirmation.
122
- *
123
- * @example
124
- * ```ts
125
- * import { createClient, http } from 'viem'
126
- * import { privateKeyToAccount } from 'viem/accounts'
127
- * import { tempo } from 'tempo.ts/chains'
128
- * import { tempoActions } from 'tempo.ts/viem'
129
- *
130
- * const client = createClient({
131
- * account: privateKeyToAccount('0x...'),
132
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
133
- * transport: http(),
134
- * }).extend(tempoActions())
135
- *
136
- * const { receipt, ...result } = await client.amm.burnSync({
137
- * userToken: '0x...',
138
- * validatorToken: '0x...',
139
- * liquidity: 50n,
140
- * to: '0x...',
141
- * })
142
- * ```
143
- *
144
- * @param parameters - Parameters.
145
- * @returns The transaction receipt and event data.
146
- */
147
- burnSync: (parameters: ammActions.burnSync.Parameters<chain, account>) => Promise<ammActions.burnSync.ReturnValue>;
148
- /**
149
- * Adds liquidity to a pool.
150
- *
151
- * @example
152
- * ```ts
153
- * import { createClient, http } from 'viem'
154
- * import { privateKeyToAccount } from 'viem/accounts'
155
- * import { tempo } from 'tempo.ts/chains'
156
- * import { tempoActions } from 'tempo.ts/viem'
157
- *
158
- * const client = createClient({
159
- * account: privateKeyToAccount('0x...'),
160
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
161
- * transport: http(),
162
- * }).extend(tempoActions())
163
- *
164
- * const hash = await client.amm.mint({
165
- * userTokenAddress: '0x...',
166
- * validatorTokenAddress: '0x...',
167
- * validatorTokenAmount: 100n,
168
- * to: '0x...',
169
- * })
170
- * ```
171
- *
172
- * @param parameters - Parameters.
173
- * @returns The transaction hash.
174
- */
175
- mint: (parameters: ammActions.mint.Parameters<chain, account>) => Promise<ammActions.mint.ReturnValue>;
176
- /**
177
- * Adds liquidity to a pool.
178
- *
179
- * @example
180
- * ```ts
181
- * import { createClient, http } from 'viem'
182
- * import { privateKeyToAccount } from 'viem/accounts'
183
- * import { tempo } from 'tempo.ts/chains'
184
- * import { tempoActions } from 'tempo.ts/viem'
185
- *
186
- * const client = createClient({
187
- * account: privateKeyToAccount('0x...'),
188
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
189
- * transport: http(),
190
- * }).extend(tempoActions())
191
- *
192
- * const result = await client.amm.mintSync({
193
- * userTokenAddress: '0x...',
194
- * validatorTokenAddress: '0x...',
195
- * validatorTokenAmount: 100n,
196
- * to: '0x...',
197
- * })
198
- * ```
199
- *
200
- * @param parameters - Parameters.
201
- * @returns The transaction receipt and event data.
202
- */
203
- mintSync: (parameters: ammActions.mintSync.Parameters<chain, account>) => Promise<ammActions.mintSync.ReturnValue>;
204
- /**
205
- * Swaps tokens during a rebalance operation.
206
- *
207
- * @example
208
- * ```ts
209
- * import { createClient, http } from 'viem'
210
- * import { privateKeyToAccount } from 'viem/accounts'
211
- * import { tempo } from 'tempo.ts/chains'
212
- * import { tempoActions } from 'tempo.ts/viem'
213
- *
214
- * const client = createClient({
215
- * account: privateKeyToAccount('0x...'),
216
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
217
- * transport: http(),
218
- * }).extend(tempoActions())
219
- *
220
- * const hash = await client.amm.rebalanceSwap({
221
- * userToken: '0x...',
222
- * validatorToken: '0x...',
223
- * amountOut: 100n,
224
- * to: '0x...',
225
- * })
226
- * ```
227
- *
228
- * @param parameters - Parameters.
229
- * @returns The transaction hash.
230
- */
231
- rebalanceSwap: (parameters: ammActions.rebalanceSwap.Parameters<chain, account>) => Promise<ammActions.rebalanceSwap.ReturnValue>;
232
- /**
233
- * Swaps tokens during a rebalance operation and waits for confirmation.
234
- *
235
- * @example
236
- * ```ts
237
- * import { createClient, http } from 'viem'
238
- * import { privateKeyToAccount } from 'viem/accounts'
239
- * import { tempo } from 'tempo.ts/chains'
240
- * import { tempoActions } from 'tempo.ts/viem'
241
- *
242
- * const client = createClient({
243
- * account: privateKeyToAccount('0x...'),
244
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
245
- * transport: http(),
246
- * }).extend(tempoActions())
247
- *
248
- * const { receipt, ...result } = await client.amm.rebalanceSwapSync({
249
- * userToken: '0x...',
250
- * validatorToken: '0x...',
251
- * amountOut: 100n,
252
- * to: '0x...',
253
- * })
254
- * ```
255
- *
256
- * @param parameters - Parameters.
257
- * @returns The transaction receipt and event data.
258
- */
259
- rebalanceSwapSync: (parameters: ammActions.rebalanceSwapSync.Parameters<chain, account>) => Promise<ammActions.rebalanceSwapSync.ReturnValue>;
260
- /**
261
- * Watches for burn (liquidity removal) events.
262
- *
263
- * @example
264
- * ```ts
265
- * import { createClient, http } from 'viem'
266
- * import { tempo } from 'tempo.ts/chains'
267
- * import { tempoActions } from 'tempo.ts/viem'
268
- *
269
- * const client = createClient({
270
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
271
- * transport: http(),
272
- * }).extend(tempoActions())
273
- *
274
- * const unwatch = client.amm.watchBurn({
275
- * onBurn: (args, log) => {
276
- * console.log('Liquidity removed:', args)
277
- * },
278
- * })
279
- * ```
280
- *
281
- * @param parameters - Parameters.
282
- * @returns A function to unsubscribe from the event.
283
- */
284
- watchBurn: (parameters: ammActions.watchBurn.Parameters) => () => void;
285
- /**
286
- * Watches for fee swap events.
287
- *
288
- * @example
289
- * ```ts
290
- * import { createClient, http } from 'viem'
291
- * import { tempo } from 'tempo.ts/chains'
292
- * import { tempoActions } from 'tempo.ts/viem'
293
- *
294
- * const client = createClient({
295
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
296
- * transport: http(),
297
- * }).extend(tempoActions())
298
- *
299
- * const unwatch = client.amm.watchFeeSwap({
300
- * onFeeSwap: (args, log) => {
301
- * console.log('Fee swap:', args)
302
- * },
303
- * })
304
- * ```
305
- *
306
- * @param parameters - Parameters.
307
- * @returns A function to unsubscribe from the event.
308
- */
309
- watchFeeSwap: (parameters: ammActions.watchFeeSwap.Parameters) => () => void;
310
- /**
311
- * Watches for liquidity mint events.
312
- *
313
- * @example
314
- * ```ts
315
- * import { createClient, http } from 'viem'
316
- * import { tempo } from 'tempo.ts/chains'
317
- * import { tempoActions } from 'tempo.ts/viem'
318
- *
319
- * const client = createClient({
320
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
321
- * transport: http(),
322
- * }).extend(tempoActions())
323
- *
324
- * const unwatch = client.amm.watchMint({
325
- * onMint: (args, log) => {
326
- * console.log('Liquidity added:', args)
327
- * },
328
- * })
329
- * ```
330
- *
331
- * @param parameters - Parameters.
332
- * @returns A function to unsubscribe from the event.
333
- */
334
- watchMint: (parameters: ammActions.watchMint.Parameters) => () => void;
335
- /**
336
- * Watches for rebalance swap events.
337
- *
338
- * @example
339
- * ```ts
340
- * import { createClient, http } from 'viem'
341
- * import { tempo } from 'tempo.ts/chains'
342
- * import { tempoActions } from 'tempo.ts/viem'
343
- *
344
- * const client = createClient({
345
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
346
- * transport: http(),
347
- * }).extend(tempoActions())
348
- *
349
- * const unwatch = client.amm.watchRebalanceSwap({
350
- * onRebalanceSwap: (args, log) => {
351
- * console.log('Rebalance swap:', args)
352
- * },
353
- * })
354
- * ```
355
- *
356
- * @param parameters - Parameters.
357
- * @returns A function to unsubscribe from the event.
358
- */
359
- watchRebalanceSwap: (parameters: ammActions.watchRebalanceSwap.Parameters) => () => void;
360
- };
361
- dex: {
362
- /**
363
- * Buys a specific amount of tokens.
364
- *
365
- * @example
366
- * ```ts
367
- * import { createClient, http } from 'viem'
368
- * import { privateKeyToAccount } from 'viem/accounts'
369
- * import { tempo } from 'tempo.ts/chains'
370
- * import { tempoActions } from 'tempo.ts/viem'
371
- *
372
- * const client = createClient({
373
- * account: privateKeyToAccount('0x...'),
374
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
375
- * transport: http(),
376
- * }).extend(tempoActions())
377
- *
378
- * const hash = await client.dex.buy({
379
- * tokenIn: '0x20c...11',
380
- * tokenOut: '0x20c...20',
381
- * amountOut: 100n,
382
- * maxAmountIn: 105n,
383
- * })
384
- * ```
385
- *
386
- * @param parameters - Parameters.
387
- * @returns The transaction hash.
388
- */
389
- buy: (parameters: dexActions.buy.Parameters<chain, account>) => Promise<dexActions.buy.ReturnValue>;
390
- /**
391
- * Buys a specific amount of tokens.
392
- *
393
- * @example
394
- * ```ts
395
- * import { createClient, http } from 'viem'
396
- * import { privateKeyToAccount } from 'viem/accounts'
397
- * import { tempo } from 'tempo.ts/chains'
398
- * import { tempoActions } from 'tempo.ts/viem'
399
- *
400
- * const client = createClient({
401
- * account: privateKeyToAccount('0x...'),
402
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
403
- * transport: http(),
404
- * }).extend(tempoActions())
405
- *
406
- * const result = await client.dex.buySync({
407
- * tokenIn: '0x20c...11',
408
- * tokenOut: '0x20c...20',
409
- * amountOut: 100n,
410
- * maxAmountIn: 105n,
411
- * })
412
- * ```
413
- *
414
- * @param parameters - Parameters.
415
- * @returns The transaction receipt.
416
- */
417
- buySync: (parameters: dexActions.buySync.Parameters<chain, account>) => Promise<dexActions.buySync.ReturnValue>;
418
- /**
419
- * Cancels an order from the orderbook.
420
- *
421
- * @example
422
- * ```ts
423
- * import { createClient, http } from 'viem'
424
- * import { privateKeyToAccount } from 'viem/accounts'
425
- * import { tempo } from 'tempo.ts/chains'
426
- * import { tempoActions } from 'tempo.ts/viem'
427
- *
428
- * const client = createClient({
429
- * account: privateKeyToAccount('0x...'),
430
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
431
- * transport: http(),
432
- * }).extend(tempoActions())
433
- *
434
- * const hash = await client.dex.cancel({
435
- * orderId: 123n,
436
- * })
437
- * ```
438
- *
439
- * @param parameters - Parameters.
440
- * @returns The transaction hash.
441
- */
442
- cancel: (parameters: dexActions.cancel.Parameters<chain, account>) => Promise<dexActions.cancel.ReturnValue>;
443
- /**
444
- * Cancels an order from the orderbook.
445
- *
446
- * @example
447
- * ```ts
448
- * import { createClient, http } from 'viem'
449
- * import { privateKeyToAccount } from 'viem/accounts'
450
- * import { tempo } from 'tempo.ts/chains'
451
- * import { tempoActions } from 'tempo.ts/viem'
452
- *
453
- * const client = createClient({
454
- * account: privateKeyToAccount('0x...'),
455
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
456
- * transport: http(),
457
- * }).extend(tempoActions())
458
- *
459
- * const result = await client.dex.cancelSync({
460
- * orderId: 123n,
461
- * })
462
- * ```
463
- *
464
- * @param parameters - Parameters.
465
- * @returns The transaction receipt and event data.
466
- */
467
- cancelSync: (parameters: dexActions.cancelSync.Parameters<chain, account>) => Promise<dexActions.cancelSync.ReturnValue>;
468
- /**
469
- * Creates a new trading pair on the DEX.
470
- *
471
- * @example
472
- * ```ts
473
- * import { createClient, http } from 'viem'
474
- * import { privateKeyToAccount } from 'viem/accounts'
475
- * import { tempo } from 'tempo.ts/chains'
476
- * import { tempoActions } from 'tempo.ts/viem'
477
- *
478
- * const client = createClient({
479
- * account: privateKeyToAccount('0x...'),
480
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
481
- * transport: http(),
482
- * }).extend(tempoActions())
483
- *
484
- * const hash = await client.dex.createPair({
485
- * base: '0x20c...11',
486
- * })
487
- * ```
488
- *
489
- * @param parameters - Parameters.
490
- * @returns The transaction hash.
491
- */
492
- createPair: (parameters: dexActions.createPair.Parameters<chain, account>) => Promise<dexActions.createPair.ReturnValue>;
493
- /**
494
- * Creates a new trading pair on the DEX.
495
- *
496
- * @example
497
- * ```ts
498
- * import { createClient, http } from 'viem'
499
- * import { privateKeyToAccount } from 'viem/accounts'
500
- * import { tempo } from 'tempo.ts/chains'
501
- * import { tempoActions } from 'tempo.ts/viem'
502
- *
503
- * const client = createClient({
504
- * account: privateKeyToAccount('0x...'),
505
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
506
- * transport: http(),
507
- * }).extend(tempoActions())
508
- *
509
- * const result = await client.dex.createPairSync({
510
- * base: '0x20c...11',
511
- * })
512
- * ```
513
- *
514
- * @param parameters - Parameters.
515
- * @returns The transaction receipt and event data.
516
- */
517
- createPairSync: (parameters: dexActions.createPairSync.Parameters<chain, account>) => Promise<dexActions.createPairSync.ReturnValue>;
518
- /**
519
- * Gets a user's token balance on the DEX.
520
- *
521
- * @example
522
- * ```ts
523
- * import { createClient, http } from 'viem'
524
- * import { tempo } from 'tempo.ts/chains'
525
- * import { tempoActions } from 'tempo.ts/viem'
526
- *
527
- * const client = createClient({
528
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
529
- * transport: http(),
530
- * }).extend(tempoActions())
531
- *
532
- * const balance = await client.dex.getBalance({
533
- * account: '0x...',
534
- * token: '0x20c...11',
535
- * })
536
- * ```
537
- *
538
- * @param parameters - Parameters.
539
- * @returns The user's token balance on the DEX.
540
- */
541
- getBalance: (parameters: dexActions.getBalance.Parameters<account>) => Promise<dexActions.getBalance.ReturnValue>;
542
- /**
543
- * Gets the quote for buying a specific amount of tokens.
544
- *
545
- * @example
546
- * ```ts
547
- * import { createClient, http } from 'viem'
548
- * import { tempo } from 'tempo.ts/chains'
549
- * import { tempoActions } from 'tempo.ts/viem'
550
- *
551
- * const client = createClient({
552
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
553
- * transport: http(),
554
- * }).extend(tempoActions())
555
- *
556
- * const amountIn = await client.dex.getBuyQuote({
557
- * tokenIn: '0x20c...11',
558
- * tokenOut: '0x20c...20',
559
- * amountOut: 100n,
560
- * })
561
- * ```
562
- *
563
- * @param parameters - Parameters.
564
- * @returns The amount of tokenIn needed to buy the specified amountOut.
565
- */
566
- getBuyQuote: (parameters: dexActions.getBuyQuote.Parameters) => Promise<dexActions.getBuyQuote.ReturnValue>;
567
- /**
568
- * Gets an order's details from the orderbook.
569
- *
570
- * @example
571
- * ```ts
572
- * import { createClient, http } from 'viem'
573
- * import { tempo } from 'tempo.ts/chains'
574
- * import { tempoActions } from 'tempo.ts/viem'
575
- *
576
- * const client = createClient({
577
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
578
- * transport: http(),
579
- * }).extend(tempoActions())
580
- *
581
- * const order = await client.dex.getOrder({
582
- * orderId: 123n,
583
- * })
584
- * ```
585
- *
586
- * @param parameters - Parameters.
587
- * @returns The order details.
588
- */
589
- getOrder: (parameters: dexActions.getOrder.Parameters) => Promise<dexActions.getOrder.ReturnValue>;
590
- /**
591
- * Gets paginated orders from the orderbook.
592
- *
593
- * @example
594
- * ```ts
595
- * import { createClient, http } from 'viem'
596
- * import { tempo } from 'tempo.ts/chains'
597
- * import { tempoActions } from 'tempo.ts/viem'
598
- *
599
- * const client = createClient({
600
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
601
- * transport: http(),
602
- * }).extend(tempoActions())
603
- *
604
- * const { orders, nextCursor } = await client.dex.getOrders({
605
- * limit: 100,
606
- * filters: {
607
- * baseToken: '0x20c0...',
608
- * isBid: true,
609
- * }
610
- * })
611
- * ```
612
- *
613
- * @param parameters - Parameters.
614
- * @returns Paginated orders and next cursor.
615
- */
616
- getOrders: (parameters?: dexActions.getOrders.Parameters) => Promise<dexActions.getOrders.ReturnValue>;
617
- /**
618
- * Gets the price level information at a specific tick.
619
- *
620
- * @example
621
- * ```ts
622
- * import { createClient, http } from 'viem'
623
- * import { tempo } from 'tempo.ts/chains'
624
- * import { tempoActions, Tick } from 'tempo.ts/viem'
625
- *
626
- * const client = createClient({
627
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
628
- * transport: http(),
629
- * }).extend(tempoActions())
630
- *
631
- * const level = await client.dex.getTickLevel({
632
- * base: '0x20c...11',
633
- * tick: Tick.fromPrice('1.001'),
634
- * isBid: true,
635
- * })
636
- * ```
637
- *
638
- * @param parameters - Parameters.
639
- * @returns The price level information.
640
- */
641
- getTickLevel: (parameters: dexActions.getTickLevel.Parameters) => Promise<dexActions.getTickLevel.ReturnValue>;
642
- /**
643
- * Gets the quote for selling a specific amount of tokens.
644
- *
645
- * @example
646
- * ```ts
647
- * import { createClient, http } from 'viem'
648
- * import { tempo } from 'tempo.ts/chains'
649
- * import { tempoActions } from 'tempo.ts/viem'
650
- *
651
- * const client = createClient({
652
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
653
- * transport: http(),
654
- * }).extend(tempoActions())
655
- *
656
- * const amountOut = await client.dex.getSellQuote({
657
- * tokenIn: '0x20c...11',
658
- * tokenOut: '0x20c...20',
659
- * amountIn: 100n,
660
- * })
661
- * ```
662
- *
663
- * @param parameters - Parameters.
664
- * @returns The amount of tokenOut received for selling the specified amountIn.
665
- */
666
- getSellQuote: (parameters: dexActions.getSellQuote.Parameters) => Promise<dexActions.getSellQuote.ReturnValue>;
667
- /**
668
- * Places a limit order on the orderbook.
669
- *
670
- * @example
671
- * ```ts
672
- * import { createClient, http } from 'viem'
673
- * import { privateKeyToAccount } from 'viem/accounts'
674
- * import { tempo } from 'tempo.ts/chains'
675
- * import { tempoActions, Tick } from 'tempo.ts/viem'
676
- *
677
- * const client = createClient({
678
- * account: privateKeyToAccount('0x...'),
679
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
680
- * transport: http(),
681
- * }).extend(tempoActions())
682
- *
683
- * const hash = await client.dex.place({
684
- * token: '0x20c...11',
685
- * amount: 100n,
686
- * type: 'buy',
687
- * tick: Tick.fromPrice('0.99'),
688
- * })
689
- * ```
690
- *
691
- * @param parameters - Parameters.
692
- * @returns The transaction hash.
693
- */
694
- place: (parameters: dexActions.place.Parameters<chain, account>) => Promise<dexActions.place.ReturnValue>;
695
- /**
696
- * Places a limit order on the orderbook.
697
- *
698
- * @example
699
- * ```ts
700
- * import { createClient, http } from 'viem'
701
- * import { privateKeyToAccount } from 'viem/accounts'
702
- * import { tempo } from 'tempo.ts/chains'
703
- * import { tempoActions, Tick } from 'tempo.ts/viem'
704
- *
705
- * const client = createClient({
706
- * account: privateKeyToAccount('0x...'),
707
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
708
- * transport: http(),
709
- * }).extend(tempoActions())
710
- *
711
- * const result = await client.dex.placeSync({
712
- * token: '0x20c...11',
713
- * amount: 100n,
714
- * type: 'buy',
715
- * tick: Tick.fromPrice('0.99'),
716
- * })
717
- * ```
718
- *
719
- * @param parameters - Parameters.
720
- * @returns The transaction receipt and event data.
721
- */
722
- placeSync: (parameters: dexActions.placeSync.Parameters<chain, account>) => Promise<dexActions.placeSync.ReturnValue>;
723
- /**
724
- * Places a flip order that automatically flips when filled.
725
- *
726
- * @example
727
- * ```ts
728
- * import { createClient, http } from 'viem'
729
- * import { privateKeyToAccount } from 'viem/accounts'
730
- * import { tempo } from 'tempo.ts/chains'
731
- * import { tempoActions, Tick } from 'tempo.ts/viem'
732
- *
733
- * const client = createClient({
734
- * account: privateKeyToAccount('0x...'),
735
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
736
- * transport: http(),
737
- * }).extend(tempoActions())
738
- *
739
- * const hash = await client.dex.placeFlip({
740
- * token: '0x20c...11',
741
- * amount: 100n,
742
- * type: 'buy',
743
- * tick: Tick.fromPrice('0.99'),
744
- * flipTick: Tick.fromPrice('1.01'),
745
- * })
746
- * ```
747
- *
748
- * @param parameters - Parameters.
749
- * @returns The transaction hash.
750
- */
751
- placeFlip: (parameters: dexActions.placeFlip.Parameters<chain, account>) => Promise<dexActions.placeFlip.ReturnValue>;
752
- /**
753
- * Places a flip order that automatically flips when filled.
754
- *
755
- * @example
756
- * ```ts
757
- * import { createClient, http } from 'viem'
758
- * import { privateKeyToAccount } from 'viem/accounts'
759
- * import { tempo } from 'tempo.ts/chains'
760
- * import { tempoActions, Tick } from 'tempo.ts/viem'
761
- *
762
- * const client = createClient({
763
- * account: privateKeyToAccount('0x...'),
764
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
765
- * transport: http(),
766
- * }).extend(tempoActions())
767
- *
768
- * const result = await client.dex.placeFlipSync({
769
- * token: '0x20c...11',
770
- * amount: 100n,
771
- * type: 'buy',
772
- * tick: Tick.fromPrice('0.99'),
773
- * flipTick: Tick.fromPrice('1.01'),
774
- * })
775
- * ```
776
- *
777
- * @param parameters - Parameters.
778
- * @returns The transaction receipt and event data.
779
- */
780
- placeFlipSync: (parameters: dexActions.placeFlipSync.Parameters<chain, account>) => Promise<dexActions.placeFlipSync.ReturnValue>;
781
- /**
782
- * Sells a specific amount of tokens.
783
- *
784
- * @example
785
- * ```ts
786
- * import { createClient, http } from 'viem'
787
- * import { privateKeyToAccount } from 'viem/accounts'
788
- * import { tempo } from 'tempo.ts/chains'
789
- * import { tempoActions } from 'tempo.ts/viem'
790
- *
791
- * const client = createClient({
792
- * account: privateKeyToAccount('0x...'),
793
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
794
- * transport: http(),
795
- * }).extend(tempoActions())
796
- *
797
- * const hash = await client.dex.sell({
798
- * tokenIn: '0x20c...11',
799
- * tokenOut: '0x20c...20',
800
- * amountIn: 100n,
801
- * minAmountOut: 95n,
802
- * })
803
- * ```
804
- *
805
- * @param parameters - Parameters.
806
- * @returns The transaction hash.
807
- */
808
- sell: (parameters: dexActions.sell.Parameters<chain, account>) => Promise<dexActions.sell.ReturnValue>;
809
- /**
810
- * Sells a specific amount of tokens.
811
- *
812
- * @example
813
- * ```ts
814
- * import { createClient, http } from 'viem'
815
- * import { privateKeyToAccount } from 'viem/accounts'
816
- * import { tempo } from 'tempo.ts/chains'
817
- * import { tempoActions } from 'tempo.ts/viem'
818
- *
819
- * const client = createClient({
820
- * account: privateKeyToAccount('0x...'),
821
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
822
- * transport: http(),
823
- * }).extend(tempoActions())
824
- *
825
- * const result = await client.dex.sellSync({
826
- * tokenIn: '0x20c...11',
827
- * tokenOut: '0x20c...20',
828
- * amountIn: 100n,
829
- * minAmountOut: 95n,
830
- * })
831
- * ```
832
- *
833
- * @param parameters - Parameters.
834
- * @returns The transaction receipt.
835
- */
836
- sellSync: (parameters: dexActions.sellSync.Parameters<chain, account>) => Promise<dexActions.sellSync.ReturnValue>;
837
- /**
838
- * Withdraws tokens from the DEX to the caller's wallet.
839
- *
840
- * @example
841
- * ```ts
842
- * import { createClient, http } from 'viem'
843
- * import { privateKeyToAccount } from 'viem/accounts'
844
- * import { tempo } from 'tempo.ts/chains'
845
- * import { tempoActions } from 'tempo.ts/viem'
846
- *
847
- * const client = createClient({
848
- * account: privateKeyToAccount('0x...'),
849
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
850
- * transport: http(),
851
- * }).extend(tempoActions())
852
- *
853
- * const hash = await client.dex.withdraw({
854
- * token: '0x20c...11',
855
- * amount: 100n,
856
- * })
857
- * ```
858
- *
859
- * @param parameters - Parameters.
860
- * @returns The transaction hash.
861
- */
862
- withdraw: (parameters: dexActions.withdraw.Parameters<chain, account>) => Promise<dexActions.withdraw.ReturnValue>;
863
- /**
864
- * Withdraws tokens from the DEX to the caller's wallet.
865
- *
866
- * @example
867
- * ```ts
868
- * import { createClient, http } from 'viem'
869
- * import { privateKeyToAccount } from 'viem/accounts'
870
- * import { tempo } from 'tempo.ts/chains'
871
- * import { tempoActions } from 'tempo.ts/viem'
872
- *
873
- * const client = createClient({
874
- * account: privateKeyToAccount('0x...'),
875
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
876
- * transport: http(),
877
- * }).extend(tempoActions())
878
- *
879
- * const result = await client.dex.withdrawSync({
880
- * token: '0x20c...11',
881
- * amount: 100n,
882
- * })
883
- * ```
884
- *
885
- * @param parameters - Parameters.
886
- * @returns The transaction receipt.
887
- */
888
- withdrawSync: (parameters: dexActions.withdrawSync.Parameters<chain, account>) => Promise<dexActions.withdrawSync.ReturnValue>;
889
- /**
890
- * Watches for flip order placed events.
891
- *
892
- * @example
893
- * ```ts
894
- * import { createClient, http } from 'viem'
895
- * import { tempo } from 'tempo.ts/chains'
896
- * import { tempoActions } from 'tempo.ts/viem'
897
- *
898
- * const client = createClient({
899
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
900
- * transport: http(),
901
- * }).extend(tempoActions())
902
- *
903
- * const unwatch = client.dex.watchFlipOrderPlaced({
904
- * onFlipOrderPlaced: (args, log) => {
905
- * console.log('Flip order placed:', args)
906
- * },
907
- * })
908
- * ```
909
- *
910
- * @param parameters - Parameters.
911
- * @returns A function to unsubscribe from the event.
912
- */
913
- watchFlipOrderPlaced: (parameters: dexActions.watchFlipOrderPlaced.Parameters) => () => void;
914
- /**
915
- * Watches for order cancelled events.
916
- *
917
- * @example
918
- * ```ts
919
- * import { createClient, http } from 'viem'
920
- * import { tempo } from 'tempo.ts/chains'
921
- * import { tempoActions } from 'tempo.ts/viem'
922
- *
923
- * const client = createClient({
924
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
925
- * transport: http(),
926
- * }).extend(tempoActions())
927
- *
928
- * const unwatch = client.dex.watchOrderCancelled({
929
- * onOrderCancelled: (args, log) => {
930
- * console.log('Order cancelled:', args)
931
- * },
932
- * })
933
- * ```
934
- *
935
- * @param parameters - Parameters.
936
- * @returns A function to unsubscribe from the event.
937
- */
938
- watchOrderCancelled: (parameters: dexActions.watchOrderCancelled.Parameters) => () => void;
939
- /**
940
- * Watches for order filled events.
941
- *
942
- * @example
943
- * ```ts
944
- * import { createClient, http } from 'viem'
945
- * import { tempo } from 'tempo.ts/chains'
946
- * import { tempoActions } from 'tempo.ts/viem'
947
- *
948
- * const client = createClient({
949
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
950
- * transport: http(),
951
- * }).extend(tempoActions())
952
- *
953
- * const unwatch = client.dex.watchOrderFilled({
954
- * onOrderFilled: (args, log) => {
955
- * console.log('Order filled:', args)
956
- * },
957
- * })
958
- * ```
959
- *
960
- * @param parameters - Parameters.
961
- * @returns A function to unsubscribe from the event.
962
- */
963
- watchOrderFilled: (parameters: dexActions.watchOrderFilled.Parameters) => () => void;
964
- /**
965
- * Watches for order placed events.
966
- *
967
- * @example
968
- * ```ts
969
- * import { createClient, http } from 'viem'
970
- * import { tempo } from 'tempo.ts/chains'
971
- * import { tempoActions } from 'tempo.ts/viem'
972
- *
973
- * const client = createClient({
974
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
975
- * transport: http(),
976
- * }).extend(tempoActions())
977
- *
978
- * const unwatch = client.dex.watchOrderPlaced({
979
- * onOrderPlaced: (args, log) => {
980
- * console.log('Order placed:', args)
981
- * },
982
- * })
983
- * ```
984
- *
985
- * @param parameters - Parameters.
986
- * @returns A function to unsubscribe from the event.
987
- */
988
- watchOrderPlaced: (parameters: dexActions.watchOrderPlaced.Parameters) => () => void;
989
- };
990
- faucet: {
991
- /**
992
- * Funds an account with an initial amount of set token(s)
993
- * on Tempo's testnet.
994
- *
995
- * @example
996
- * ```ts
997
- * import { createClient, http } from 'viem'
998
- * import { tempo } from 'tempo.ts/chains'
999
- * import { tempoActions } from 'tempo.ts/viem'
1000
- *
1001
- * const client = createClient({
1002
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1003
- * transport: http(),
1004
- * }).extend(tempoActions())
1005
- *
1006
- * const hashes = await client.faucet.fund({
1007
- * account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
1008
- * })
1009
- * ```
1010
- *
1011
- * @param parameters - Parameters.
1012
- * @returns The transaction hashes.
1013
- */
1014
- fund: (parameters: faucetActions.fund.Parameters) => Promise<faucetActions.fund.ReturnValue>;
1015
- };
1016
- fee: {
1017
- /**
1018
- * Gets the user's default fee token.
1019
- *
1020
- * @example
1021
- * ```ts
1022
- * import { createClient, http } from 'viem'
1023
- * import { privateKeyToAccount } from 'viem/accounts'
1024
- * import { tempo } from 'tempo.ts/chains'
1025
- * import { tempoActions } from 'tempo.ts/viem'
1026
- *
1027
- * const client = createClient({
1028
- * account: privateKeyToAccount('0x...'),
1029
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1030
- * transport: http(),
1031
- * }).extend(tempoActions())
1032
- *
1033
- * const { address, id } = await client.token.getUserToken()
1034
- * ```
1035
- *
1036
- * @param client - Client.
1037
- * @param parameters - Parameters.
1038
- * @returns The transaction hash.
1039
- */
1040
- getUserToken: (...parameters: account extends Account ? [feeActions.getUserToken.Parameters<account>] | [] : [feeActions.getUserToken.Parameters<account>]) => Promise<feeActions.getUserToken.ReturnValue>;
1041
- /**
1042
- * Sets the user's default fee token.
1043
- *
1044
- * @example
1045
- * ```ts
1046
- * import { createClient, http } from 'viem'
1047
- * import { privateKeyToAccount } from 'viem/accounts'
1048
- * import { tempo } from 'tempo.ts/chains'
1049
- * import { tempoActions } from 'tempo.ts/viem'
1050
- *
1051
- * const client = createClient({
1052
- * account: privateKeyToAccount('0x...'),
1053
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1054
- * transport: http(),
1055
- * }).extend(tempoActions())
1056
- *
1057
- * const hash = await client.token.setUserToken({
1058
- * token: '0x...',
1059
- * })
1060
- * ```
1061
- *
1062
- * @param client - Client.
1063
- * @param parameters - Parameters.
1064
- * @returns The transaction hash.
1065
- */
1066
- setUserToken: (parameters: feeActions.setUserToken.Parameters<chain, account>) => Promise<feeActions.setUserToken.ReturnValue>;
1067
- /**
1068
- * Sets the user's default fee token.
1069
- *
1070
- * @example
1071
- * ```ts
1072
- * import { createClient, http } from 'viem'
1073
- * import { privateKeyToAccount } from 'viem/accounts'
1074
- * import { tempo } from 'tempo.ts/chains'
1075
- * import { tempoActions } from 'tempo.ts/viem'
1076
- *
1077
- * const client = createClient({
1078
- * account: privateKeyToAccount('0x...'),
1079
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1080
- * transport: http(),
1081
- * }).extend(tempoActions())
1082
- *
1083
- * const result = await client.fee.setUserTokenSync({
1084
- * token: '0x...',
1085
- * })
1086
- * ```
1087
- *
1088
- * @param parameters - Parameters.
1089
- * @returns The transaction receipt and event data.
1090
- */
1091
- setUserTokenSync: (parameters: feeActions.setUserTokenSync.Parameters<chain, account>) => Promise<feeActions.setUserTokenSync.ReturnValue>;
1092
- /**
1093
- * Watches for user token set events.
1094
- *
1095
- * @example
1096
- * ```ts
1097
- * import { createClient, http } from 'viem'
1098
- * import { tempo } from 'tempo.ts/chains'
1099
- * import { tempoActions } from 'tempo.ts/viem'
1100
- *
1101
- * const client = createClient({
1102
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1103
- * transport: http(),
1104
- * }).extend(tempoActions())
1105
- *
1106
- * const unwatch = client.token.watchSetUserToken({
1107
- * onUserTokenSet: (args, log) => {
1108
- * console.log('User token set:', args)
1109
- * },
1110
- * })
1111
- * ```
1112
- *
1113
- * @param client - Client.
1114
- * @param parameters - Parameters.
1115
- * @returns A function to unsubscribe from the event.
1116
- */
1117
- watchSetUserToken: (parameters: feeActions.watchSetUserToken.Parameters) => () => void;
1118
- };
1119
- policy: {
1120
- /**
1121
- * Creates a new policy.
1122
- *
1123
- * @example
1124
- * ```ts
1125
- * import { createClient, http } from 'viem'
1126
- * import { privateKeyToAccount } from 'viem/accounts'
1127
- * import { tempo } from 'tempo.ts/chains'
1128
- * import { tempoActions } from 'tempo.ts/viem'
1129
- *
1130
- * const client = createClient({
1131
- * account: privateKeyToAccount('0x...'),
1132
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1133
- * transport: http(),
1134
- * }).extend(tempoActions())
1135
- *
1136
- * const hash = await client.policy.create({
1137
- * admin: '0x...',
1138
- * type: 'whitelist',
1139
- * })
1140
- * ```
1141
- *
1142
- * @param parameters - Parameters.
1143
- * @returns The transaction hash.
1144
- */
1145
- create: (parameters: policyActions.create.Parameters<chain, account>) => Promise<policyActions.create.ReturnValue>;
1146
- /**
1147
- * Creates a new policy.
1148
- *
1149
- * @example
1150
- * ```ts
1151
- * import { createClient, http } from 'viem'
1152
- * import { privateKeyToAccount } from 'viem/accounts'
1153
- * import { tempo } from 'tempo.ts/chains'
1154
- * import { tempoActions } from 'tempo.ts/viem'
1155
- *
1156
- * const client = createClient({
1157
- * account: privateKeyToAccount('0x...'),
1158
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1159
- * transport: http(),
1160
- * }).extend(tempoActions())
1161
- *
1162
- * const result = await client.policy.createSync({
1163
- * admin: '0x...',
1164
- * type: 'whitelist',
1165
- * })
1166
- * ```
1167
- *
1168
- * @param parameters - Parameters.
1169
- * @returns The transaction receipt and event data.
1170
- */
1171
- createSync: (parameters: policyActions.createSync.Parameters<chain, account>) => Promise<policyActions.createSync.ReturnValue>;
1172
- /**
1173
- * Sets the admin for a policy.
1174
- *
1175
- * @example
1176
- * ```ts
1177
- * import { createClient, http } from 'viem'
1178
- * import { privateKeyToAccount } from 'viem/accounts'
1179
- * import { tempo } from 'tempo.ts/chains'
1180
- * import { tempoActions } from 'tempo.ts/viem'
1181
- *
1182
- * const client = createClient({
1183
- * account: privateKeyToAccount('0x...'),
1184
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1185
- * transport: http(),
1186
- * }).extend(tempoActions())
1187
- *
1188
- * const hash = await client.policy.setAdmin({
1189
- * policyId: 2n,
1190
- * admin: '0x...',
1191
- * })
1192
- * ```
1193
- *
1194
- * @param parameters - Parameters.
1195
- * @returns The transaction hash.
1196
- */
1197
- setAdmin: (parameters: policyActions.setAdmin.Parameters<chain, account>) => Promise<policyActions.setAdmin.ReturnValue>;
1198
- /**
1199
- * Sets the admin for a policy.
1200
- *
1201
- * @example
1202
- * ```ts
1203
- * import { createClient, http } from 'viem'
1204
- * import { privateKeyToAccount } from 'viem/accounts'
1205
- * import { tempo } from 'tempo.ts/chains'
1206
- * import { tempoActions } from 'tempo.ts/viem'
1207
- *
1208
- * const client = createClient({
1209
- * account: privateKeyToAccount('0x...'),
1210
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1211
- * transport: http(),
1212
- * }).extend(tempoActions())
1213
- *
1214
- * const result = await client.policy.setAdminSync({
1215
- * policyId: 2n,
1216
- * admin: '0x...',
1217
- * })
1218
- * ```
1219
- *
1220
- * @param parameters - Parameters.
1221
- * @returns The transaction receipt and event data.
1222
- */
1223
- setAdminSync: (parameters: policyActions.setAdminSync.Parameters<chain, account>) => Promise<policyActions.setAdminSync.ReturnValue>;
1224
- /**
1225
- * Modifies a policy whitelist.
1226
- *
1227
- * @example
1228
- * ```ts
1229
- * import { createClient, http } from 'viem'
1230
- * import { privateKeyToAccount } from 'viem/accounts'
1231
- * import { tempo } from 'tempo.ts/chains'
1232
- * import { tempoActions } from 'tempo.ts/viem'
1233
- *
1234
- * const client = createClient({
1235
- * account: privateKeyToAccount('0x...'),
1236
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1237
- * transport: http(),
1238
- * }).extend(tempoActions())
1239
- *
1240
- * const hash = await client.policy.modifyWhitelist({
1241
- * policyId: 2n,
1242
- * address: '0x...',
1243
- * allowed: true,
1244
- * })
1245
- * ```
1246
- *
1247
- * @param parameters - Parameters.
1248
- * @returns The transaction hash.
1249
- */
1250
- modifyWhitelist: (parameters: policyActions.modifyWhitelist.Parameters<chain, account>) => Promise<policyActions.modifyWhitelist.ReturnValue>;
1251
- /**
1252
- * Modifies a policy whitelist.
1253
- *
1254
- * @example
1255
- * ```ts
1256
- * import { createClient, http } from 'viem'
1257
- * import { privateKeyToAccount } from 'viem/accounts'
1258
- * import { tempo } from 'tempo.ts/chains'
1259
- * import { tempoActions } from 'tempo.ts/viem'
1260
- *
1261
- * const client = createClient({
1262
- * account: privateKeyToAccount('0x...'),
1263
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1264
- * transport: http(),
1265
- * }).extend(tempoActions())
1266
- *
1267
- * const result = await client.policy.modifyWhitelistSync({
1268
- * policyId: 2n,
1269
- * address: '0x...',
1270
- * allowed: true,
1271
- * })
1272
- * ```
1273
- *
1274
- * @param parameters - Parameters.
1275
- * @returns The transaction receipt and event data.
1276
- */
1277
- modifyWhitelistSync: (parameters: policyActions.modifyWhitelistSync.Parameters<chain, account>) => Promise<policyActions.modifyWhitelistSync.ReturnValue>;
1278
- /**
1279
- * Modifies a policy blacklist.
1280
- *
1281
- * @example
1282
- * ```ts
1283
- * import { createClient, http } from 'viem'
1284
- * import { privateKeyToAccount } from 'viem/accounts'
1285
- * import { tempo } from 'tempo.ts/chains'
1286
- * import { tempoActions } from 'tempo.ts/viem'
1287
- *
1288
- * const client = createClient({
1289
- * account: privateKeyToAccount('0x...'),
1290
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1291
- * transport: http(),
1292
- * }).extend(tempoActions())
1293
- *
1294
- * const hash = await client.policy.modifyBlacklist({
1295
- * policyId: 2n,
1296
- * address: '0x...',
1297
- * restricted: true,
1298
- * })
1299
- * ```
1300
- *
1301
- * @param parameters - Parameters.
1302
- * @returns The transaction hash.
1303
- */
1304
- modifyBlacklist: (parameters: policyActions.modifyBlacklist.Parameters<chain, account>) => Promise<policyActions.modifyBlacklist.ReturnValue>;
1305
- /**
1306
- * Modifies a policy blacklist.
1307
- *
1308
- * @example
1309
- * ```ts
1310
- * import { createClient, http } from 'viem'
1311
- * import { privateKeyToAccount } from 'viem/accounts'
1312
- * import { tempo } from 'tempo.ts/chains'
1313
- * import { tempoActions } from 'tempo.ts/viem'
1314
- *
1315
- * const client = createClient({
1316
- * account: privateKeyToAccount('0x...'),
1317
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1318
- * transport: http(),
1319
- * }).extend(tempoActions())
1320
- *
1321
- * const result = await client.policy.modifyBlacklistSync({
1322
- * policyId: 2n,
1323
- * address: '0x...',
1324
- * restricted: true,
1325
- * })
1326
- * ```
1327
- *
1328
- * @param parameters - Parameters.
1329
- * @returns The transaction receipt and event data.
1330
- */
1331
- modifyBlacklistSync: (parameters: policyActions.modifyBlacklistSync.Parameters<chain, account>) => Promise<policyActions.modifyBlacklistSync.ReturnValue>;
1332
- /**
1333
- * Gets policy data.
1334
- *
1335
- * @example
1336
- * ```ts
1337
- * import { createClient, http } from 'viem'
1338
- * import { tempo } from 'tempo.ts/chains'
1339
- * import { tempoActions } from 'tempo.ts/viem'
1340
- *
1341
- * const client = createClient({
1342
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1343
- * transport: http(),
1344
- * }).extend(tempoActions())
1345
- *
1346
- * const data = await client.policy.getData({
1347
- * policyId: 2n,
1348
- * })
1349
- * ```
1350
- *
1351
- * @param parameters - Parameters.
1352
- * @returns The policy data.
1353
- */
1354
- getData: (parameters: policyActions.getData.Parameters) => Promise<policyActions.getData.ReturnValue>;
1355
- /**
1356
- * Checks if a user is authorized by a policy.
1357
- *
1358
- * @example
1359
- * ```ts
1360
- * import { createClient, http } from 'viem'
1361
- * import { tempo } from 'tempo.ts/chains'
1362
- * import { tempoActions } from 'tempo.ts/viem'
1363
- *
1364
- * const client = createClient({
1365
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1366
- * transport: http(),
1367
- * }).extend(tempoActions())
1368
- *
1369
- * const authorized = await client.policy.isAuthorized({
1370
- * policyId: 2n,
1371
- * user: '0x...',
1372
- * })
1373
- * ```
1374
- *
1375
- * @param parameters - Parameters.
1376
- * @returns Whether the user is authorized.
1377
- */
1378
- isAuthorized: (parameters: policyActions.isAuthorized.Parameters) => Promise<policyActions.isAuthorized.ReturnValue>;
1379
- /**
1380
- * Watches for policy creation events.
1381
- *
1382
- * @example
1383
- * ```ts
1384
- * import { createClient, http } from 'viem'
1385
- * import { tempo } from 'tempo.ts/chains'
1386
- * import { tempoActions } from 'tempo.ts/viem'
1387
- *
1388
- * const client = createClient({
1389
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1390
- * transport: http(),
1391
- * }).extend(tempoActions())
1392
- *
1393
- * const unwatch = client.policy.watchCreate({
1394
- * onPolicyCreated: (args, log) => {
1395
- * console.log('Policy created:', args)
1396
- * },
1397
- * })
1398
- * ```
1399
- *
1400
- * @param parameters - Parameters.
1401
- * @returns A function to unsubscribe from the event.
1402
- */
1403
- watchCreate: (parameters: policyActions.watchCreate.Parameters) => () => void;
1404
- /**
1405
- * Watches for policy admin update events.
1406
- *
1407
- * @example
1408
- * ```ts
1409
- * import { createClient, http } from 'viem'
1410
- * import { tempo } from 'tempo.ts/chains'
1411
- * import { tempoActions } from 'tempo.ts/viem'
1412
- *
1413
- * const client = createClient({
1414
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1415
- * transport: http(),
1416
- * }).extend(tempoActions())
1417
- *
1418
- * const unwatch = client.policy.watchAdminUpdated({
1419
- * onAdminUpdated: (args, log) => {
1420
- * console.log('Policy admin updated:', args)
1421
- * },
1422
- * })
1423
- * ```
1424
- *
1425
- * @param parameters - Parameters.
1426
- * @returns A function to unsubscribe from the event.
1427
- */
1428
- watchAdminUpdated: (parameters: policyActions.watchAdminUpdated.Parameters) => () => void;
1429
- /**
1430
- * Watches for whitelist update events.
1431
- *
1432
- * @example
1433
- * ```ts
1434
- * import { createClient, http } from 'viem'
1435
- * import { tempo } from 'tempo.ts/chains'
1436
- * import { tempoActions } from 'tempo.ts/viem'
1437
- *
1438
- * const client = createClient({
1439
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1440
- * transport: http(),
1441
- * }).extend(tempoActions())
1442
- *
1443
- * const unwatch = client.policy.watchWhitelistUpdated({
1444
- * onWhitelistUpdated: (args, log) => {
1445
- * console.log('Whitelist updated:', args)
1446
- * },
1447
- * })
1448
- * ```
1449
- *
1450
- * @param parameters - Parameters.
1451
- * @returns A function to unsubscribe from the event.
1452
- */
1453
- watchWhitelistUpdated: (parameters: policyActions.watchWhitelistUpdated.Parameters) => () => void;
1454
- /**
1455
- * Watches for blacklist update events.
1456
- *
1457
- * @example
1458
- * ```ts
1459
- * import { createClient, http } from 'viem'
1460
- * import { tempo } from 'tempo.ts/chains'
1461
- * import { tempoActions } from 'tempo.ts/viem'
1462
- *
1463
- * const client = createClient({
1464
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1465
- * transport: http(),
1466
- * }).extend(tempoActions())
1467
- *
1468
- * const unwatch = client.policy.watchBlacklistUpdated({
1469
- * onBlacklistUpdated: (args, log) => {
1470
- * console.log('Blacklist updated:', args)
1471
- * },
1472
- * })
1473
- * ```
1474
- *
1475
- * @param parameters - Parameters.
1476
- * @returns A function to unsubscribe from the event.
1477
- */
1478
- watchBlacklistUpdated: (parameters: policyActions.watchBlacklistUpdated.Parameters) => () => void;
1479
- };
1480
- reward: {
1481
- /**
1482
- * Claims accumulated rewards for a recipient.
1483
- *
1484
- * @example
1485
- * ```ts
1486
- * import { createClient, http } from 'viem'
1487
- * import { privateKeyToAccount } from 'viem/accounts'
1488
- * import { tempo } from 'tempo.ts/chains'
1489
- * import { tempoActions } from 'tempo.ts/viem'
1490
- *
1491
- * const client = createClient({
1492
- * account: privateKeyToAccount('0x...'),
1493
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1494
- * transport: http(),
1495
- * }).extend(tempoActions())
1496
- *
1497
- * const hash = await client.reward.claim({
1498
- * token: '0x20c0000000000000000000000000000000000001',
1499
- * })
1500
- * ```
1501
- *
1502
- * @param parameters - Parameters.
1503
- * @returns The transaction hash.
1504
- */
1505
- claim: (parameters: rewardActions.claim.Parameters<chain, account>) => Promise<rewardActions.claim.ReturnValue>;
1506
- /**
1507
- * Claims accumulated rewards for a recipient and waits for confirmation.
1508
- *
1509
- * @example
1510
- * ```ts
1511
- * import { createClient, http } from 'viem'
1512
- * import { privateKeyToAccount } from 'viem/accounts'
1513
- * import { tempo } from 'tempo.ts/chains'
1514
- * import { tempoActions } from 'tempo.ts/viem'
1515
- *
1516
- * const client = createClient({
1517
- * account: privateKeyToAccount('0x...'),
1518
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1519
- * transport: http(),
1520
- * }).extend(tempoActions())
1521
- *
1522
- * const result = await client.reward.claimSync({
1523
- * token: '0x20c0000000000000000000000000000000000001',
1524
- * })
1525
- * ```
1526
- *
1527
- * @param parameters - Parameters.
1528
- * @returns The amount claimed and transaction receipt.
1529
- */
1530
- claimSync: (parameters: rewardActions.claimSync.Parameters<chain, account>) => Promise<rewardActions.claimSync.ReturnValue>;
1531
- /**
1532
- * Gets the total reward per second rate for all active streams.
1533
- *
1534
- * @example
1535
- * ```ts
1536
- * import { createClient, http } from 'viem'
1537
- * import { tempo } from 'tempo.ts/chains'
1538
- * import { tempoActions } from 'tempo.ts/viem'
1539
- *
1540
- * const client = createClient({
1541
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1542
- * transport: http(),
1543
- * }).extend(tempoActions())
1544
- *
1545
- * const rate = await client.reward.getTotalPerSecond({
1546
- * token: '0x20c0000000000000000000000000000000000001',
1547
- * })
1548
- * ```
1549
- *
1550
- * @param parameters - Parameters.
1551
- * @returns The total reward per second (scaled by 1e18).
1552
- */
1553
- getTotalPerSecond: (parameters: rewardActions.getTotalPerSecond.Parameters) => Promise<rewardActions.getTotalPerSecond.ReturnValue>;
1554
- /**
1555
- * Gets the reward information for a specific account.
1556
- *
1557
- * @example
1558
- * ```ts
1559
- * import { createClient, http } from 'viem'
1560
- * import { tempo } from 'tempo.ts/chains'
1561
- * import { tempoActions } from 'tempo.ts/viem'
1562
- *
1563
- * const client = createClient({
1564
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1565
- * transport: http(),
1566
- * }).extend(tempoActions())
1567
- *
1568
- * const info = await client.reward.getUserRewardInfo({
1569
- * token: '0x20c0000000000000000000000000000000000001',
1570
- * account: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
1571
- * })
1572
- * ```
1573
- *
1574
- * @param parameters - Parameters.
1575
- * @returns The user's reward information (recipient, rewardPerToken, rewardBalance).
1576
- */
1577
- getUserRewardInfo: (parameters: rewardActions.getUserRewardInfo.Parameters) => Promise<rewardActions.getUserRewardInfo.ReturnValue>;
1578
- /**
1579
- * Sets or changes the reward recipient for a token holder.
1580
- *
1581
- * @example
1582
- * ```ts
1583
- * import { createClient, http } from 'viem'
1584
- * import { privateKeyToAccount } from 'viem/accounts'
1585
- * import { tempo } from 'tempo.ts/chains'
1586
- * import { tempoActions } from 'tempo.ts/viem'
1587
- *
1588
- * const client = createClient({
1589
- * account: privateKeyToAccount('0x...'),
1590
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1591
- * transport: http(),
1592
- * }).extend(tempoActions())
1593
- *
1594
- * const hash = await client.reward.setRecipient({
1595
- * recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
1596
- * token: '0x20c0000000000000000000000000000000000001',
1597
- * })
1598
- * ```
1599
- *
1600
- * @param parameters - Parameters.
1601
- * @returns The transaction hash.
1602
- */
1603
- setRecipient: (parameters: rewardActions.setRecipient.Parameters<chain, account>) => Promise<rewardActions.setRecipient.ReturnValue>;
1604
- /**
1605
- * Sets or changes the reward recipient for a token holder and waits for confirmation.
1606
- *
1607
- * @example
1608
- * ```ts
1609
- * import { createClient, http } from 'viem'
1610
- * import { privateKeyToAccount } from 'viem/accounts'
1611
- * import { tempo } from 'tempo.ts/chains'
1612
- * import { tempoActions } from 'tempo.ts/viem'
1613
- *
1614
- * const client = createClient({
1615
- * account: privateKeyToAccount('0x...'),
1616
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1617
- * transport: http(),
1618
- * }).extend(tempoActions())
1619
- *
1620
- * const result = await client.reward.setRecipientSync({
1621
- * recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
1622
- * token: '0x20c0000000000000000000000000000000000001',
1623
- * })
1624
- * ```
1625
- *
1626
- * @param parameters - Parameters.
1627
- * @returns The transaction receipt and event data.
1628
- */
1629
- setRecipientSync: (parameters: rewardActions.setRecipientSync.Parameters<chain, account>) => Promise<rewardActions.setRecipientSync.ReturnValue>;
1630
- /**
1631
- * Starts a new reward stream that distributes tokens to opted-in holders.
1632
- *
1633
- * @example
1634
- * ```ts
1635
- * import { createClient, http } from 'viem'
1636
- * import { privateKeyToAccount } from 'viem/accounts'
1637
- * import { tempo } from 'tempo.ts/chains'
1638
- * import { tempoActions } from 'tempo.ts/viem'
1639
- *
1640
- * const client = createClient({
1641
- * account: privateKeyToAccount('0x...'),
1642
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1643
- * transport: http(),
1644
- * }).extend(tempoActions())
1645
- *
1646
- * const hash = await client.reward.start({
1647
- * amount: 100000000000000000000n,
1648
- * seconds: 86400,
1649
- * token: '0x20c0000000000000000000000000000000000001',
1650
- * })
1651
- * ```
1652
- *
1653
- * @param parameters - Parameters.
1654
- * @returns The transaction hash.
1655
- */
1656
- start: (parameters: rewardActions.start.Parameters<chain, account>) => Promise<rewardActions.start.ReturnValue>;
1657
- /**
1658
- * Starts a new reward stream that distributes tokens to opted-in holders and waits for confirmation.
1659
- *
1660
- * @example
1661
- * ```ts
1662
- * import { createClient, http } from 'viem'
1663
- * import { privateKeyToAccount } from 'viem/accounts'
1664
- * import { tempo } from 'tempo.ts/chains'
1665
- * import { tempoActions } from 'tempo.ts/viem'
1666
- *
1667
- * const client = createClient({
1668
- * account: privateKeyToAccount('0x...'),
1669
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1670
- * transport: http(),
1671
- * }).extend(tempoActions())
1672
- *
1673
- * const result = await client.reward.startSync({
1674
- * amount: 100000000000000000000n,
1675
- * seconds: 86400,
1676
- * token: '0x20c0000000000000000000000000000000000001',
1677
- * })
1678
- * ```
1679
- *
1680
- * @param parameters - Parameters.
1681
- * @returns The transaction receipt and event data.
1682
- */
1683
- startSync: (parameters: rewardActions.startSync.Parameters<chain, account>) => Promise<rewardActions.startSync.ReturnValue>;
1684
- /**
1685
- * Watches for reward recipient set events.
1686
- *
1687
- * @example
1688
- * ```ts
1689
- * import { createClient, http } from 'viem'
1690
- * import { tempo } from 'tempo.ts/chains'
1691
- * import { tempoActions } from 'tempo.ts/viem'
1692
- *
1693
- * const client = createClient({
1694
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1695
- * transport: http(),
1696
- * }).extend(tempoActions())
1697
- *
1698
- * const unwatch = client.reward.watchRewardRecipientSet({
1699
- * token: '0x20c0000000000000000000000000000000000001',
1700
- * onRewardRecipientSet: (args, log) => {
1701
- * console.log('Reward recipient set:', args)
1702
- * },
1703
- * })
1704
- * ```
1705
- *
1706
- * @param parameters - Parameters.
1707
- * @returns A function to unsubscribe from the event.
1708
- */
1709
- watchRewardRecipientSet: (parameters: rewardActions.watchRewardRecipientSet.Parameters) => () => void;
1710
- /**
1711
- * Watches for reward scheduled events.
1712
- *
1713
- * @example
1714
- * ```ts
1715
- * import { createClient, http } from 'viem'
1716
- * import { tempo } from 'tempo.ts/chains'
1717
- * import { tempoActions } from 'tempo.ts/viem'
1718
- *
1719
- * const client = createClient({
1720
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1721
- * transport: http(),
1722
- * }).extend(tempoActions())
1723
- *
1724
- * const unwatch = client.reward.watchRewardScheduled({
1725
- * token: '0x20c0000000000000000000000000000000000001',
1726
- * onRewardScheduled: (args, log) => {
1727
- * console.log('Reward scheduled:', args)
1728
- * },
1729
- * })
1730
- * ```
1731
- *
1732
- * @param parameters - Parameters.
1733
- * @returns A function to unsubscribe from the event.
1734
- */
1735
- watchRewardScheduled: (parameters: rewardActions.watchRewardScheduled.Parameters) => () => void;
1736
- };
1737
- token: {
1738
- /**
1739
- * Approves a spender to transfer TIP20 tokens on behalf of the caller.
1740
- *
1741
- * @example
1742
- * ```ts
1743
- * import { createClient, http } from 'viem'
1744
- * import { privateKeyToAccount } from 'viem/accounts'
1745
- * import { tempo } from 'tempo.ts/chains'
1746
- * import { tempoActions } from 'tempo.ts/viem'
1747
- *
1748
- * const client = createClient({
1749
- * account: privateKeyToAccount('0x...'),
1750
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1751
- * transport: http(),
1752
- * }).extend(tempoActions())
1753
- *
1754
- * const hash = await client.token.approve({
1755
- * spender: '0x...',
1756
- * amount: 100n,
1757
- * })
1758
- * ```
1759
- *
1760
- * @param client - Client.
1761
- * @param parameters - Parameters.
1762
- * @returns The transaction hash.
1763
- */
1764
- approve: (parameters: tokenActions.approve.Parameters<chain, account>) => Promise<tokenActions.approve.ReturnValue>;
1765
- /**
1766
- * Approves a spender to transfer TIP20 tokens on behalf of the caller.
1767
- *
1768
- * @example
1769
- * ```ts
1770
- * import { createClient, http } from 'viem'
1771
- * import { privateKeyToAccount } from 'viem/accounts'
1772
- * import { tempo } from 'tempo.ts/chains'
1773
- * import { tempoActions } from 'tempo.ts/viem'
1774
- *
1775
- * const client = createClient({
1776
- * account: privateKeyToAccount('0x...'),
1777
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1778
- * transport: http(),
1779
- * }).extend(tempoActions())
1780
- *
1781
- * const result = await client.token.approveSync({
1782
- * spender: '0x...',
1783
- * amount: 100n,
1784
- * })
1785
- * ```
1786
- *
1787
- * @param client - Client.
1788
- * @param parameters - Parameters.
1789
- * @returns The transaction receipt and event data.
1790
- */
1791
- approveSync: (parameters: tokenActions.approveSync.Parameters<chain, account>) => Promise<tokenActions.approveSync.ReturnValue>;
1792
- /**
1793
- * Burns TIP20 tokens from a blocked address.
1794
- *
1795
- * @example
1796
- * ```ts
1797
- * import { createClient, http } from 'viem'
1798
- * import { privateKeyToAccount } from 'viem/accounts'
1799
- * import { tempo } from 'tempo.ts/chains'
1800
- * import { tempoActions } from 'tempo.ts/viem'
1801
- *
1802
- * const client = createClient({
1803
- * account: privateKeyToAccount('0x...'),
1804
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1805
- * transport: http(),
1806
- * }).extend(tempoActions())
1807
- *
1808
- * const hash = await client.token.burnBlocked({
1809
- * from: '0x...',
1810
- * amount: 100n,
1811
- * token: '0x...',
1812
- * })
1813
- * ```
1814
- *
1815
- * @param client - Client.
1816
- * @param parameters - Parameters.
1817
- * @returns The transaction hash.
1818
- */
1819
- burnBlocked: (parameters: tokenActions.burnBlocked.Parameters<chain, account>) => Promise<tokenActions.burnBlocked.ReturnValue>;
1820
- /**
1821
- * Burns TIP20 tokens from a blocked address.
1822
- *
1823
- * @example
1824
- * ```ts
1825
- * import { createClient, http } from 'viem'
1826
- * import { privateKeyToAccount } from 'viem/accounts'
1827
- * import { tempo } from 'tempo.ts/chains'
1828
- * import { tempoActions } from 'tempo.ts/viem'
1829
- *
1830
- * const client = createClient({
1831
- * account: privateKeyToAccount('0x...'),
1832
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1833
- * transport: http(),
1834
- * }).extend(tempoActions())
1835
- *
1836
- * const result = await client.token.burnBlockedSync({
1837
- * from: '0x...',
1838
- * amount: 100n,
1839
- * token: '0x...',
1840
- * })
1841
- * ```
1842
- *
1843
- * @param client - Client.
1844
- * @param parameters - Parameters.
1845
- * @returns The transaction receipt and event data.
1846
- */
1847
- burnBlockedSync: (parameters: tokenActions.burnBlockedSync.Parameters<chain, account>) => Promise<tokenActions.burnBlockedSync.ReturnValue>;
1848
- /**
1849
- * Burns TIP20 tokens from the caller's balance.
1850
- *
1851
- * @example
1852
- * ```ts
1853
- * import { createClient, http } from 'viem'
1854
- * import { privateKeyToAccount } from 'viem/accounts'
1855
- * import { tempo } from 'tempo.ts/chains'
1856
- * import { tempoActions } from 'tempo.ts/viem'
1857
- *
1858
- * const client = createClient({
1859
- * account: privateKeyToAccount('0x...'),
1860
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1861
- * transport: http(),
1862
- * }).extend(tempoActions())
1863
- *
1864
- * const hash = await client.token.burn({
1865
- * amount: 100n,
1866
- * token: '0x...',
1867
- * })
1868
- * ```
1869
- *
1870
- * @param client - Client.
1871
- * @param parameters - Parameters.
1872
- * @returns The transaction hash.
1873
- */
1874
- burn: (parameters: tokenActions.burn.Parameters<chain, account>) => Promise<tokenActions.burn.ReturnValue>;
1875
- /**
1876
- * Burns TIP20 tokens from the caller's balance.
1877
- *
1878
- * @example
1879
- * ```ts
1880
- * import { createClient, http } from 'viem'
1881
- * import { privateKeyToAccount } from 'viem/accounts'
1882
- * import { tempo } from 'tempo.ts/chains'
1883
- * import { tempoActions } from 'tempo.ts/viem'
1884
- *
1885
- * const client = createClient({
1886
- * account: privateKeyToAccount('0x...'),
1887
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1888
- * transport: http(),
1889
- * }).extend(tempoActions())
1890
- *
1891
- * const result = await client.token.burnSync({
1892
- * amount: 100n,
1893
- * token: '0x...',
1894
- * })
1895
- * ```
1896
- *
1897
- * @param client - Client.
1898
- * @param parameters - Parameters.
1899
- * @returns The transaction receipt and event data.
1900
- */
1901
- burnSync: (parameters: tokenActions.burnSync.Parameters<chain, account>) => Promise<tokenActions.burnSync.ReturnValue>;
1902
- /**
1903
- * Changes the transfer policy ID for a TIP20 token.
1904
- *
1905
- * @example
1906
- * ```ts
1907
- * import { createClient, http } from 'viem'
1908
- * import { privateKeyToAccount } from 'viem/accounts'
1909
- * import { tempo } from 'tempo.ts/chains'
1910
- * import { tempoActions } from 'tempo.ts/viem'
1911
- *
1912
- * const client = createClient({
1913
- * account: privateKeyToAccount('0x...'),
1914
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1915
- * transport: http(),
1916
- * }).extend(tempoActions())
1917
- *
1918
- * const hash = await client.token.changeTransferPolicy({
1919
- * token: '0x...',
1920
- * policyId: 1n,
1921
- * })
1922
- * ```
1923
- *
1924
- * @param client - Client.
1925
- * @param parameters - Parameters.
1926
- * @returns The transaction hash.
1927
- */
1928
- changeTransferPolicy: (parameters: tokenActions.changeTransferPolicy.Parameters<chain, account>) => Promise<tokenActions.changeTransferPolicy.ReturnValue>;
1929
- /**
1930
- * Changes the transfer policy ID for a TIP20 token.
1931
- *
1932
- * @example
1933
- * ```ts
1934
- * import { createClient, http } from 'viem'
1935
- * import { privateKeyToAccount } from 'viem/accounts'
1936
- * import { tempo } from 'tempo.ts/chains'
1937
- * import { tempoActions } from 'tempo.ts/viem'
1938
- *
1939
- * const client = createClient({
1940
- * account: privateKeyToAccount('0x...'),
1941
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1942
- * transport: http(),
1943
- * }).extend(tempoActions())
1944
- *
1945
- * const result = await client.token.changeTransferPolicySync({
1946
- * token: '0x...',
1947
- * policyId: 1n,
1948
- * })
1949
- * ```
1950
- *
1951
- * @param client - Client.
1952
- * @param parameters - Parameters.
1953
- * @returns The transaction receipt and event data.
1954
- */
1955
- changeTransferPolicySync: (parameters: tokenActions.changeTransferPolicySync.Parameters<chain, account>) => Promise<tokenActions.changeTransferPolicySync.ReturnValue>;
1956
- /**
1957
- * Creates a new TIP20 token.
1958
- *
1959
- * @example
1960
- * ```ts
1961
- * import { createClient, http } from 'viem'
1962
- * import { privateKeyToAccount } from 'viem/accounts'
1963
- * import { tempo } from 'tempo.ts/chains'
1964
- * import { tempoActions } from 'tempo.ts/viem'
1965
- *
1966
- * const client = createClient({
1967
- * account: privateKeyToAccount('0x...'),
1968
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1969
- * transport: http(),
1970
- * }).extend(tempoActions())
1971
- *
1972
- * const { hash, id, address } = await client.token.create({
1973
- * name: 'My Token',
1974
- * symbol: 'MTK',
1975
- * currency: 'USD',
1976
- * })
1977
- * ```
1978
- *
1979
- * @param client - Client.
1980
- * @param parameters - Parameters.
1981
- * @returns The transaction hash.
1982
- */
1983
- create: (parameters: tokenActions.create.Parameters<chain, account>) => Promise<tokenActions.create.ReturnValue>;
1984
- /**
1985
- * Creates a new TIP20 token.
1986
- *
1987
- * @example
1988
- * ```ts
1989
- * import { createClient, http } from 'viem'
1990
- * import { privateKeyToAccount } from 'viem/accounts'
1991
- * import { tempo } from 'tempo.ts/chains'
1992
- * import { tempoActions } from 'tempo.ts/viem'
1993
- *
1994
- * const client = createClient({
1995
- * account: privateKeyToAccount('0x...'),
1996
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1997
- * transport: http(),
1998
- * }).extend(tempoActions())
1999
- *
2000
- * const result = await client.token.createSync({
2001
- * name: 'My Token',
2002
- * symbol: 'MTK',
2003
- * currency: 'USD',
2004
- * })
2005
- * ```
2006
- *
2007
- * @param client - Client.
2008
- * @param parameters - Parameters.
2009
- * @returns The transaction receipt and event data.
2010
- */
2011
- createSync: (parameters: tokenActions.createSync.Parameters<chain, account>) => Promise<tokenActions.createSync.ReturnValue>;
2012
- /**
2013
- * Gets TIP20 token allowance.
2014
- *
2015
- * @example
2016
- * ```ts
2017
- * import { createClient, http } from 'viem'
2018
- * import { privateKeyToAccount } from 'viem/accounts'
2019
- * import { tempo } from 'tempo.ts/chains'
2020
- * import { tempoActions } from 'tempo.ts/viem'
2021
- *
2022
- * const client = createClient({
2023
- * account: privateKeyToAccount('0x...'),
2024
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2025
- * transport: http(),
2026
- * }).extend(tempoActions())
2027
- *
2028
- * const allowance = await client.token.getAllowance({
2029
- * spender: '0x...',
2030
- * })
2031
- * ```
2032
- *
2033
- * @param client - Client.
2034
- * @param parameters - Parameters.
2035
- * @returns The token allowance.
2036
- */
2037
- getAllowance: (parameters: tokenActions.getAllowance.Parameters) => Promise<tokenActions.getAllowance.ReturnValue>;
2038
- /**
2039
- * Gets TIP20 token balance for an address.
2040
- *
2041
- * @example
2042
- * ```ts
2043
- * import { createClient, http } from 'viem'
2044
- * import { privateKeyToAccount } from 'viem/accounts'
2045
- * import { tempo } from 'tempo.ts/chains'
2046
- * import { tempoActions } from 'tempo.ts/viem'
2047
- *
2048
- * const client = createClient({
2049
- * account: privateKeyToAccount('0x...'),
2050
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2051
- * transport: http(),
2052
- * }).extend(tempoActions())
2053
- *
2054
- * const balance = await client.token.getBalance()
2055
- * ```
2056
- *
2057
- * @param client - Client.
2058
- * @param parameters - Parameters.
2059
- * @returns The token balance.
2060
- */
2061
- getBalance: (parameters: tokenActions.getBalance.Parameters<account>) => Promise<tokenActions.getBalance.ReturnValue>;
2062
- /**
2063
- * Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
2064
- *
2065
- * @example
2066
- * ```ts
2067
- * import { createClient, http } from 'viem'
2068
- * import { tempo } from 'tempo.ts/chains'
2069
- * import { tempoActions } from 'tempo.ts/viem'
2070
- *
2071
- * const client = createClient({
2072
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2073
- * transport: http(),
2074
- * }).extend(tempoActions())
2075
- *
2076
- * const metadata = await client.token.getMetadata({
2077
- * token: '0x...',
2078
- * })
2079
- * ```
2080
- *
2081
- * @param client - Client.
2082
- * @param parameters - Parameters.
2083
- * @returns The token metadata.
2084
- */
2085
- getMetadata: (parameters: tokenActions.getMetadata.Parameters) => Promise<tokenActions.getMetadata.ReturnValue>;
2086
- /**
2087
- * Gets the admin role for a specific role in a TIP20 token.
2088
- *
2089
- * @example
2090
- * ```ts
2091
- * import { createClient, http } from 'viem'
2092
- * import { tempo } from 'tempo.ts/chains'
2093
- * import { tempoActions } from 'tempo.ts/viem'
2094
- *
2095
- * const client = createClient({
2096
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2097
- * transport: http(),
2098
- * }).extend(tempoActions())
2099
- *
2100
- * const adminRole = await client.token.getRoleAdmin({
2101
- * role: 'issuer',
2102
- * token: '0x...',
2103
- * })
2104
- * ```
2105
- *
2106
- * @param client - Client.
2107
- * @param parameters - Parameters.
2108
- * @returns The admin role hash.
2109
- */
2110
- getRoleAdmin: (parameters: tokenActions.getRoleAdmin.Parameters) => Promise<tokenActions.getRoleAdmin.ReturnValue>;
2111
- /**
2112
- * Checks if an account has a specific role for a TIP20 token.
2113
- *
2114
- * @example
2115
- * ```ts
2116
- * import { createClient, http } from 'viem'
2117
- * import { privateKeyToAccount } from 'viem/accounts'
2118
- * import { tempo } from 'tempo.ts/chains'
2119
- * import { tempoActions } from 'tempo.ts/viem'
2120
- *
2121
- * const client = createClient({
2122
- * account: privateKeyToAccount('0x...'),
2123
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2124
- * transport: http(),
2125
- * }).extend(tempoActions())
2126
- *
2127
- * const hasRole = await client.token.hasRole({
2128
- * token: '0x...',
2129
- * role: 'issuer',
2130
- * })
2131
- * ```
2132
- *
2133
- * @param client - Client.
2134
- * @param parameters - Parameters.
2135
- * @returns Whether the account has the role.
2136
- */
2137
- hasRole: (parameters: tokenActions.hasRole.Parameters<account>) => Promise<tokenActions.hasRole.ReturnValue>;
2138
- /**
2139
- * Grants a role for a TIP20 token.
2140
- *
2141
- * @example
2142
- * ```ts
2143
- * import { createClient, http } from 'viem'
2144
- * import { privateKeyToAccount } from 'viem/accounts'
2145
- * import { tempo } from 'tempo.ts/chains'
2146
- * import { tempoActions } from 'tempo.ts/viem'
2147
- *
2148
- * const client = createClient({
2149
- * account: privateKeyToAccount('0x...'),
2150
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2151
- * transport: http(),
2152
- * }).extend(tempoActions())
2153
- *
2154
- * const hash = await client.token.grantRoles({
2155
- * token: '0x...',
2156
- * to: '0x...',
2157
- * roles: ['issuer'],
2158
- * })
2159
- * ```
2160
- *
2161
- * @param client - Client.
2162
- * @param parameters - Parameters.
2163
- * @returns The transaction hash.
2164
- */
2165
- grantRoles: (parameters: tokenActions.grantRoles.Parameters<chain, account>) => Promise<tokenActions.grantRoles.ReturnValue>;
2166
- /**
2167
- * Grants a role for a TIP20 token.
2168
- *
2169
- * @example
2170
- * ```ts
2171
- * import { createClient, http } from 'viem'
2172
- * import { privateKeyToAccount } from 'viem/accounts'
2173
- * import { tempo } from 'tempo.ts/chains'
2174
- * import { tempoActions } from 'tempo.ts/viem'
2175
- *
2176
- * const client = createClient({
2177
- * account: privateKeyToAccount('0x...'),
2178
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2179
- * transport: http(),
2180
- * }).extend(tempoActions())
2181
- *
2182
- * const result = await client.token.grantRolesSync({
2183
- * token: '0x...',
2184
- * to: '0x...',
2185
- * roles: ['issuer'],
2186
- * })
2187
- * ```
2188
- *
2189
- * @param parameters - Parameters.
2190
- * @returns The transaction receipt and event data.
2191
- */
2192
- grantRolesSync: (parameters: tokenActions.grantRolesSync.Parameters<chain, account>) => Promise<tokenActions.grantRolesSync.ReturnValue>;
2193
- /**
2194
- * Mints TIP20 tokens to an address.
2195
- *
2196
- * @example
2197
- * ```ts
2198
- * import { createClient, http } from 'viem'
2199
- * import { privateKeyToAccount } from 'viem/accounts'
2200
- * import { tempo } from 'tempo.ts/chains'
2201
- * import { tempoActions } from 'tempo.ts/viem'
2202
- *
2203
- * const client = createClient({
2204
- * account: privateKeyToAccount('0x...'),
2205
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2206
- * transport: http(),
2207
- * }).extend(tempoActions())
2208
- *
2209
- * const hash = await client.token.mint({
2210
- * to: '0x...',
2211
- * amount: 100n,
2212
- * token: '0x...',
2213
- * })
2214
- * ```
2215
- *
2216
- * @param client - Client.
2217
- * @param parameters - Parameters.
2218
- * @returns The transaction hash.
2219
- */
2220
- mint: (parameters: tokenActions.mint.Parameters<chain, account>) => Promise<tokenActions.mint.ReturnValue>;
2221
- /**
2222
- * Mints TIP20 tokens to an address.
2223
- *
2224
- * @example
2225
- * ```ts
2226
- * import { createClient, http } from 'viem'
2227
- * import { privateKeyToAccount } from 'viem/accounts'
2228
- * import { tempo } from 'tempo.ts/chains'
2229
- * import { tempoActions } from 'tempo.ts/viem'
2230
- *
2231
- * const client = createClient({
2232
- * account: privateKeyToAccount('0x...'),
2233
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2234
- * transport: http(),
2235
- * }).extend(tempoActions())
2236
- *
2237
- * const result = await client.token.mintSync({
2238
- * to: '0x...',
2239
- * amount: 100n,
2240
- * token: '0x...',
2241
- * })
2242
- * ```
2243
- *
2244
- * @param client - Client.
2245
- * @param parameters - Parameters.
2246
- * @returns The transaction receipt and event data.
2247
- */
2248
- mintSync: (parameters: tokenActions.mintSync.Parameters<chain, account>) => Promise<tokenActions.mintSync.ReturnValue>;
2249
- /**
2250
- * Pauses a TIP20 token.
2251
- *
2252
- * @example
2253
- * ```ts
2254
- * import { createClient, http } from 'viem'
2255
- * import { privateKeyToAccount } from 'viem/accounts'
2256
- * import { tempo } from 'tempo.ts/chains'
2257
- * import { tempoActions } from 'tempo.ts/viem'
2258
- *
2259
- * const client = createClient({
2260
- * account: privateKeyToAccount('0x...'),
2261
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2262
- * transport: http(),
2263
- * }).extend(tempoActions())
2264
- *
2265
- * const hash = await client.token.pause({
2266
- * token: '0x...',
2267
- * })
2268
- * ```
2269
- *
2270
- * @param client - Client.
2271
- * @param parameters - Parameters.
2272
- * @returns The transaction hash.
2273
- */
2274
- pause: (parameters: tokenActions.pause.Parameters<chain, account>) => Promise<tokenActions.pause.ReturnValue>;
2275
- /**
2276
- * Pauses a TIP20 token.
2277
- *
2278
- * @example
2279
- * ```ts
2280
- * import { createClient, http } from 'viem'
2281
- * import { privateKeyToAccount } from 'viem/accounts'
2282
- * import { tempo } from 'tempo.ts/chains'
2283
- * import { tempoActions } from 'tempo.ts/viem'
2284
- *
2285
- * const client = createClient({
2286
- * account: privateKeyToAccount('0x...'),
2287
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2288
- * transport: http(),
2289
- * }).extend(tempoActions())
2290
- *
2291
- * const result = await client.token.pauseSync({
2292
- * token: '0x...',
2293
- * })
2294
- * ```
2295
- *
2296
- * @param client - Client.
2297
- * @param parameters - Parameters.
2298
- * @returns The transaction receipt and event data.
2299
- */
2300
- pauseSync: (parameters: tokenActions.pauseSync.Parameters<chain, account>) => Promise<tokenActions.pauseSync.ReturnValue>;
2301
- /**
2302
- * Renounces a role for a TIP20 token.
2303
- *
2304
- * @example
2305
- * ```ts
2306
- * import { createClient, http } from 'viem'
2307
- * import { privateKeyToAccount } from 'viem/accounts'
2308
- * import { tempo } from 'tempo.ts/chains'
2309
- * import { tempoActions } from 'tempo.ts/viem'
2310
- *
2311
- * const client = createClient({
2312
- * account: privateKeyToAccount('0x...'),
2313
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2314
- * transport: http(),
2315
- * }).extend(tempoActions())
2316
- *
2317
- * const hash = await client.token.renounceRoles({
2318
- * token: '0x...',
2319
- * roles: ['issuer'],
2320
- * })
2321
- * ```
2322
- *
2323
- * @param client - Client.
2324
- * @param parameters - Parameters.
2325
- * @returns The transaction hash.
2326
- */
2327
- renounceRoles: (parameters: tokenActions.renounceRoles.Parameters<chain, account>) => Promise<tokenActions.renounceRoles.ReturnValue>;
2328
- /**
2329
- * Renounces a role for a TIP20 token.
2330
- *
2331
- * @example
2332
- * ```ts
2333
- * import { createClient, http } from 'viem'
2334
- * import { privateKeyToAccount } from 'viem/accounts'
2335
- * import { tempo } from 'tempo.ts/chains'
2336
- * import { tempoActions } from 'tempo.ts/viem'
2337
- *
2338
- * const client = createClient({
2339
- * account: privateKeyToAccount('0x...'),
2340
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2341
- * transport: http(),
2342
- * }).extend(tempoActions())
2343
- *
2344
- * const result = await client.token.renounceRolesSync({
2345
- * token: '0x...',
2346
- * roles: ['issuer'],
2347
- * })
2348
- * ```
2349
- *
2350
- * @param parameters - Parameters.
2351
- * @returns The transaction receipt and event data.
2352
- */
2353
- renounceRolesSync: (parameters: tokenActions.renounceRolesSync.Parameters<chain, account>) => Promise<tokenActions.renounceRolesSync.ReturnValue>;
2354
- /**
2355
- * Revokes a role for a TIP20 token.
2356
- *
2357
- * @example
2358
- * ```ts
2359
- * import { createClient, http } from 'viem'
2360
- * import { privateKeyToAccount } from 'viem/accounts'
2361
- * import { tempo } from 'tempo.ts/chains'
2362
- * import { tempoActions } from 'tempo.ts/viem'
2363
- *
2364
- * const client = createClient({
2365
- * account: privateKeyToAccount('0x...'),
2366
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2367
- * transport: http(),
2368
- * }).extend(tempoActions())
2369
- *
2370
- * const hash = await client.token.revokeRoles({
2371
- * token: '0x...',
2372
- * from: '0x...',
2373
- * roles: ['issuer'],
2374
- * })
2375
- * ```
2376
- *
2377
- * @param client - Client.
2378
- * @param parameters - Parameters.
2379
- * @returns The transaction hash.
2380
- */
2381
- revokeRoles: (parameters: tokenActions.revokeRoles.Parameters<chain, account>) => Promise<tokenActions.revokeRoles.ReturnValue>;
2382
- /**
2383
- * Revokes a role for a TIP20 token.
2384
- *
2385
- * @example
2386
- * ```ts
2387
- * import { createClient, http } from 'viem'
2388
- * import { privateKeyToAccount } from 'viem/accounts'
2389
- * import { tempo } from 'tempo.ts/chains'
2390
- * import { tempoActions } from 'tempo.ts/viem'
2391
- *
2392
- * const client = createClient({
2393
- * account: privateKeyToAccount('0x...'),
2394
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2395
- * transport: http(),
2396
- * }).extend(tempoActions())
2397
- *
2398
- * const result = await client.token.revokeRolesSync({
2399
- * token: '0x...',
2400
- * from: '0x...',
2401
- * roles: ['issuer'],
2402
- * })
2403
- * ```
2404
- *
2405
- * @param parameters - Parameters.
2406
- * @returns The transaction receipt and event data.
2407
- */
2408
- revokeRolesSync: (parameters: tokenActions.revokeRolesSync.Parameters<chain, account>) => Promise<tokenActions.revokeRolesSync.ReturnValue>;
2409
- /**
2410
- * Sets the supply cap for a TIP20 token.
2411
- *
2412
- * @example
2413
- * ```ts
2414
- * import { createClient, http } from 'viem'
2415
- * import { privateKeyToAccount } from 'viem/accounts'
2416
- * import { tempo } from 'tempo.ts/chains'
2417
- * import { tempoActions } from 'tempo.ts/viem'
2418
- *
2419
- * const client = createClient({
2420
- * account: privateKeyToAccount('0x...'),
2421
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2422
- * transport: http(),
2423
- * }).extend(tempoActions())
2424
- *
2425
- * const hash = await client.token.setSupplyCap({
2426
- * token: '0x...',
2427
- * supplyCap: 1000000n,
2428
- * })
2429
- * ```
2430
- *
2431
- * @param client - Client.
2432
- * @param parameters - Parameters.
2433
- * @returns The transaction hash.
2434
- */
2435
- setSupplyCap: (parameters: tokenActions.setSupplyCap.Parameters<chain, account>) => Promise<tokenActions.setSupplyCap.ReturnValue>;
2436
- /**
2437
- * Sets the supply cap for a TIP20 token.
2438
- *
2439
- * @example
2440
- * ```ts
2441
- * import { createClient, http } from 'viem'
2442
- * import { privateKeyToAccount } from 'viem/accounts'
2443
- * import { tempo } from 'tempo.ts/chains'
2444
- * import { tempoActions } from 'tempo.ts/viem'
2445
- *
2446
- * const client = createClient({
2447
- * account: privateKeyToAccount('0x...'),
2448
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2449
- * transport: http(),
2450
- * }).extend(tempoActions())
2451
- *
2452
- * const result = await client.token.setSupplyCapSync({
2453
- * token: '0x...',
2454
- * supplyCap: 1000000n,
2455
- * })
2456
- * ```
2457
- *
2458
- * @param client - Client.
2459
- * @param parameters - Parameters.
2460
- * @returns The transaction receipt and event data.
2461
- */
2462
- setSupplyCapSync: (parameters: tokenActions.setSupplyCapSync.Parameters<chain, account>) => Promise<tokenActions.setSupplyCapSync.ReturnValue>;
2463
- /**
2464
- * Sets the admin role for a specific role in a TIP20 token.
2465
- *
2466
- * @example
2467
- * ```ts
2468
- * import { createClient, http } from 'viem'
2469
- * import { privateKeyToAccount } from 'viem/accounts'
2470
- * import { tempo } from 'tempo.ts/chains'
2471
- * import { tempoActions } from 'tempo.ts/viem'
2472
- *
2473
- * const client = createClient({
2474
- * account: privateKeyToAccount('0x...'),
2475
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2476
- * transport: http(),
2477
- * }).extend(tempoActions())
2478
- *
2479
- * const hash = await client.token.setRoleAdmin({
2480
- * token: '0x...',
2481
- * role: 'issuer',
2482
- * adminRole: 'admin',
2483
- * })
2484
- * ```
2485
- *
2486
- * @param client - Client.
2487
- * @param parameters - Parameters.
2488
- * @returns The transaction hash.
2489
- */
2490
- setRoleAdmin: (parameters: tokenActions.setRoleAdmin.Parameters<chain, account>) => Promise<tokenActions.setRoleAdmin.ReturnValue>;
2491
- /**
2492
- * Sets the admin role for a specific role in a TIP20 token.
2493
- *
2494
- * @example
2495
- * ```ts
2496
- * import { createClient, http } from 'viem'
2497
- * import { privateKeyToAccount } from 'viem/accounts'
2498
- * import { tempo } from 'tempo.ts/chains'
2499
- * import { tempoActions } from 'tempo.ts/viem'
2500
- *
2501
- * const client = createClient({
2502
- * account: privateKeyToAccount('0x...'),
2503
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2504
- * transport: http(),
2505
- * }).extend(tempoActions())
2506
- *
2507
- * const result = await client.token.setRoleAdminSync({
2508
- * token: '0x...',
2509
- * role: 'issuer',
2510
- * adminRole: 'admin',
2511
- * })
2512
- * ```
2513
- *
2514
- * @param client - Client.
2515
- * @param parameters - Parameters.
2516
- * @returns The transaction receipt and event data.
2517
- */
2518
- setRoleAdminSync: (parameters: tokenActions.setRoleAdminSync.Parameters<chain, account>) => Promise<tokenActions.setRoleAdminSync.ReturnValue>;
2519
- /**
2520
- * Transfers TIP20 tokens to another address.
2521
- *
2522
- * @example
2523
- * ```ts
2524
- * import { createClient, http } from 'viem'
2525
- * import { privateKeyToAccount } from 'viem/accounts'
2526
- * import { tempo } from 'tempo.ts/chains'
2527
- * import { tempoActions } from 'tempo.ts/viem'
2528
- *
2529
- * const client = createClient({
2530
- * account: privateKeyToAccount('0x...'),
2531
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2532
- * transport: http(),
2533
- * }).extend(tempoActions())
2534
- *
2535
- * const hash = await client.token.transfer({
2536
- * to: '0x...',
2537
- * amount: 100n,
2538
- * })
2539
- * ```
2540
- *
2541
- * @param client - Client.
2542
- * @param parameters - Parameters.
2543
- * @returns The transaction hash.
2544
- */
2545
- transfer: (parameters: tokenActions.transfer.Parameters<chain, account>) => Promise<tokenActions.transfer.ReturnValue>;
2546
- /**
2547
- * Transfers TIP20 tokens to another address.
2548
- *
2549
- * @example
2550
- * ```ts
2551
- * import { createClient, http } from 'viem'
2552
- * import { privateKeyToAccount } from 'viem/accounts'
2553
- * import { tempo } from 'tempo.ts/chains'
2554
- * import { tempoActions } from 'tempo.ts/viem'
2555
- *
2556
- * const client = createClient({
2557
- * account: privateKeyToAccount('0x...'),
2558
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2559
- * transport: http(),
2560
- * }).extend(tempoActions())
2561
- *
2562
- * const result = await client.token.transferSync({
2563
- * to: '0x...',
2564
- * amount: 100n,
2565
- * })
2566
- * ```
2567
- *
2568
- * @param client - Client.
2569
- * @param parameters - Parameters.
2570
- * @returns The transaction receipt and event data.
2571
- */
2572
- transferSync: (parameters: tokenActions.transferSync.Parameters<chain, account>) => Promise<tokenActions.transferSync.ReturnValue>;
2573
- /**
2574
- * Unpauses a TIP20 token.
2575
- *
2576
- * @example
2577
- * ```ts
2578
- * import { createClient, http } from 'viem'
2579
- * import { privateKeyToAccount } from 'viem/accounts'
2580
- * import { tempo } from 'tempo.ts/chains'
2581
- * import { tempoActions } from 'tempo.ts/viem'
2582
- *
2583
- * const client = createClient({
2584
- * account: privateKeyToAccount('0x...'),
2585
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2586
- * transport: http(),
2587
- * }).extend(tempoActions())
2588
- *
2589
- * const hash = await client.token.unpause({
2590
- * token: '0x...',
2591
- * })
2592
- * ```
2593
- *
2594
- * @param client - Client.
2595
- * @param parameters - Parameters.
2596
- * @returns The transaction hash.
2597
- */
2598
- unpause: (parameters: tokenActions.unpause.Parameters<chain, account>) => Promise<tokenActions.unpause.ReturnValue>;
2599
- /**
2600
- * Unpauses a TIP20 token.
2601
- *
2602
- * @example
2603
- * ```ts
2604
- * import { createClient, http } from 'viem'
2605
- * import { privateKeyToAccount } from 'viem/accounts'
2606
- * import { tempo } from 'tempo.ts/chains'
2607
- * import { tempoActions } from 'tempo.ts/viem'
2608
- *
2609
- * const client = createClient({
2610
- * account: privateKeyToAccount('0x...'),
2611
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2612
- * transport: http(),
2613
- * }).extend(tempoActions())
2614
- *
2615
- * const result = await client.token.unpauseSync({
2616
- * token: '0x...',
2617
- * })
2618
- * ```
2619
- *
2620
- * @param client - Client.
2621
- * @param parameters - Parameters.
2622
- * @returns The transaction receipt and event data.
2623
- */
2624
- unpauseSync: (parameters: tokenActions.unpauseSync.Parameters<chain, account>) => Promise<tokenActions.unpauseSync.ReturnValue>;
2625
- /**
2626
- * Watches for TIP20 token approval events.
2627
- *
2628
- * @example
2629
- * ```ts
2630
- * import { createClient, http } from 'viem'
2631
- * import { tempo } from 'tempo.ts/chains'
2632
- * import { tempoActions } from 'tempo.ts/viem'
2633
- *
2634
- * const client = createClient({
2635
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2636
- * transport: http(),
2637
- * }).extend(tempoActions())
2638
- *
2639
- * const unwatch = client.token.watchApprove({
2640
- * onApproval: (args, log) => {
2641
- * console.log('Approval:', args)
2642
- * },
2643
- * })
2644
- * ```
2645
- *
2646
- * @param client - Client.
2647
- * @param parameters - Parameters.
2648
- * @returns A function to unsubscribe from the event.
2649
- */
2650
- watchApprove: (parameters: tokenActions.watchApprove.Parameters) => () => void;
2651
- /**
2652
- * Watches for TIP20 token burn events.
2653
- *
2654
- * @example
2655
- * ```ts
2656
- * import { createClient, http } from 'viem'
2657
- * import { tempo } from 'tempo.ts/chains'
2658
- * import { tempoActions } from 'tempo.ts/viem'
2659
- *
2660
- * const client = createClient({
2661
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2662
- * transport: http(),
2663
- * }).extend(tempoActions())
2664
- *
2665
- * const unwatch = client.token.watchBurn({
2666
- * onBurn: (args, log) => {
2667
- * console.log('Burn:', args)
2668
- * },
2669
- * })
2670
- * ```
2671
- *
2672
- * @param client - Client.
2673
- * @param parameters - Parameters.
2674
- * @returns A function to unsubscribe from the event.
2675
- */
2676
- watchBurn: (parameters: tokenActions.watchBurn.Parameters) => () => void;
2677
- /**
2678
- * Watches for new TIP20 tokens created.
2679
- *
2680
- * @example
2681
- * ```ts
2682
- * import { createClient, http } from 'viem'
2683
- * import { tempo } from 'tempo.ts/chains'
2684
- * import { tempoActions } from 'tempo.ts/viem'
2685
- *
2686
- * const client = createClient({
2687
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2688
- * transport: http(),
2689
- * }).extend(tempoActions())
2690
- *
2691
- * const unwatch = client.token.watchCreate({
2692
- * onTokenCreated: (args, log) => {
2693
- * console.log('Token created:', args)
2694
- * },
2695
- * })
2696
- * ```
2697
- *
2698
- * @param client - Client.
2699
- * @param parameters - Parameters.
2700
- * @returns A function to unsubscribe from the event.
2701
- */
2702
- watchCreate: (parameters: tokenActions.watchCreate.Parameters) => () => void;
2703
- /**
2704
- * Watches for TIP20 token mint events.
2705
- *
2706
- * @example
2707
- * ```ts
2708
- * import { createClient, http } from 'viem'
2709
- * import { tempo } from 'tempo.ts/chains'
2710
- * import { tempoActions } from 'tempo.ts/viem'
2711
- *
2712
- * const client = createClient({
2713
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2714
- * transport: http(),
2715
- * }).extend(tempoActions())
2716
- *
2717
- * const unwatch = client.token.watchMint({
2718
- * onMint: (args, log) => {
2719
- * console.log('Mint:', args)
2720
- * },
2721
- * })
2722
- * ```
2723
- *
2724
- * @param client - Client.
2725
- * @param parameters - Parameters.
2726
- * @returns A function to unsubscribe from the event.
2727
- */
2728
- watchMint: (parameters: tokenActions.watchMint.Parameters) => () => void;
2729
- /**
2730
- * Watches for TIP20 token role admin updates.
2731
- *
2732
- * @example
2733
- * ```ts
2734
- * import { createClient, http } from 'viem'
2735
- * import { tempo } from 'tempo.ts/chains'
2736
- * import { tempoActions } from 'tempo.ts/viem'
2737
- *
2738
- * const client = createClient({
2739
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2740
- * transport: http(),
2741
- * }).extend(tempoActions())
2742
- *
2743
- * const unwatch = client.token.watchAdminRole({
2744
- * onRoleAdminUpdated: (args, log) => {
2745
- * console.log('Role admin updated:', args)
2746
- * },
2747
- * })
2748
- * ```
2749
- *
2750
- * @param client - Client.
2751
- * @param parameters - Parameters.
2752
- * @returns A function to unsubscribe from the event.
2753
- */
2754
- watchAdminRole: (parameters: tokenActions.watchAdminRole.Parameters) => () => void;
2755
- /**
2756
- * Watches for TIP20 token role membership updates.
2757
- *
2758
- * @example
2759
- * ```ts
2760
- * import { createClient, http } from 'viem'
2761
- * import { tempo } from 'tempo.ts/chains'
2762
- * import { tempoActions } from 'tempo.ts/viem'
2763
- *
2764
- * const client = createClient({
2765
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2766
- * transport: http(),
2767
- * }).extend(tempoActions())
2768
- *
2769
- * const unwatch = client.token.watchRole({
2770
- * onRoleUpdated: (args, log) => {
2771
- * console.log('Role updated:', args)
2772
- * },
2773
- * })
2774
- * ```
2775
- *
2776
- * @param client - Client.
2777
- * @param parameters - Parameters.
2778
- * @returns A function to unsubscribe from the event.
2779
- */
2780
- watchRole: (parameters: tokenActions.watchRole.Parameters) => () => void;
2781
- /**
2782
- * Watches for TIP20 token transfer events.
2783
- *
2784
- * @example
2785
- * ```ts
2786
- * import { createClient, http } from 'viem'
2787
- * import { tempo } from 'tempo.ts/chains'
2788
- * import { tempoActions } from 'tempo.ts/viem'
2789
- *
2790
- * const client = createClient({
2791
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
2792
- * transport: http(),
2793
- * }).extend(tempoActions())
2794
- *
2795
- * const unwatch = client.token.watchTransfer({
2796
- * onTransfer: (args, log) => {
2797
- * console.log('Transfer:', args)
2798
- * },
2799
- * })
2800
- * ```
2801
- *
2802
- * @param client - Client.
2803
- * @param parameters - Parameters.
2804
- * @returns A function to unsubscribe from the event.
2805
- */
2806
- watchTransfer: (parameters: tokenActions.watchTransfer.Parameters) => () => void;
2807
- };
2808
- };
2809
- export declare function decorator(): <transport extends Transport, chain extends Chain | undefined, account extends Account | undefined>(client: Client<transport, chain, account>) => Decorator<chain, account>;
2810
- //# sourceMappingURL=Decorator.d.ts.map