tempo.ts 0.0.0 → 0.0.2

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 (153) hide show
  1. package/README.md +92 -0
  2. package/dist/chains.d.ts +1477 -0
  3. package/dist/chains.d.ts.map +1 -0
  4. package/dist/chains.js +43 -0
  5. package/dist/chains.js.map +1 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +2 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/internal/types.d.ts +284 -0
  11. package/dist/internal/types.d.ts.map +1 -0
  12. package/dist/internal/types.js +2 -0
  13. package/dist/internal/types.js.map +1 -0
  14. package/dist/ox/TokenId.d.ts +18 -0
  15. package/dist/ox/TokenId.d.ts.map +1 -0
  16. package/dist/ox/TokenId.js +29 -0
  17. package/dist/ox/TokenId.js.map +1 -0
  18. package/dist/ox/TokenRole.d.ts +11 -0
  19. package/dist/ox/TokenRole.d.ts.map +1 -0
  20. package/dist/ox/TokenRole.js +22 -0
  21. package/dist/ox/TokenRole.js.map +1 -0
  22. package/dist/ox/Transaction.d.ts +161 -0
  23. package/dist/ox/Transaction.d.ts.map +1 -0
  24. package/dist/ox/Transaction.js +117 -0
  25. package/dist/ox/Transaction.js.map +1 -0
  26. package/dist/ox/TransactionEnvelopeFeeToken.d.ts +393 -0
  27. package/dist/ox/TransactionEnvelopeFeeToken.d.ts.map +1 -0
  28. package/dist/ox/TransactionEnvelopeFeeToken.js +452 -0
  29. package/dist/ox/TransactionEnvelopeFeeToken.js.map +1 -0
  30. package/dist/ox/TransactionRequest.d.ts +62 -0
  31. package/dist/ox/TransactionRequest.d.ts.map +1 -0
  32. package/dist/ox/TransactionRequest.js +66 -0
  33. package/dist/ox/TransactionRequest.js.map +1 -0
  34. package/dist/ox/index.d.ts +5 -0
  35. package/dist/ox/index.d.ts.map +1 -0
  36. package/dist/ox/index.js +5 -0
  37. package/dist/ox/index.js.map +1 -0
  38. package/dist/prool/Instance.d.ts +92 -0
  39. package/dist/prool/Instance.d.ts.map +1 -0
  40. package/dist/prool/Instance.js +96 -0
  41. package/dist/prool/Instance.js.map +1 -0
  42. package/dist/prool/index.d.ts +2 -0
  43. package/dist/prool/index.d.ts.map +1 -0
  44. package/dist/prool/index.js +2 -0
  45. package/dist/prool/index.js.map +1 -0
  46. package/dist/viem/abis.d.ts +2058 -0
  47. package/dist/viem/abis.d.ts.map +1 -0
  48. package/dist/viem/abis.js +1599 -0
  49. package/dist/viem/abis.js.map +1 -0
  50. package/dist/viem/actions/amm.d.ts +2091 -0
  51. package/dist/viem/actions/amm.d.ts.map +1 -0
  52. package/dist/viem/actions/amm.js +876 -0
  53. package/dist/viem/actions/amm.js.map +1 -0
  54. package/dist/viem/actions/fee.d.ts +727 -0
  55. package/dist/viem/actions/fee.d.ts.map +1 -0
  56. package/dist/viem/actions/fee.js +230 -0
  57. package/dist/viem/actions/fee.js.map +1 -0
  58. package/dist/viem/actions/index.d.ts +5 -0
  59. package/dist/viem/actions/index.d.ts.map +1 -0
  60. package/dist/viem/actions/index.js +5 -0
  61. package/dist/viem/actions/index.js.map +1 -0
  62. package/dist/viem/actions/policy.d.ts +1900 -0
  63. package/dist/viem/actions/policy.d.ts.map +1 -0
  64. package/dist/viem/actions/policy.js +841 -0
  65. package/dist/viem/actions/policy.js.map +1 -0
  66. package/dist/viem/actions/token.d.ts +13759 -0
  67. package/dist/viem/actions/token.d.ts.map +1 -0
  68. package/dist/viem/actions/token.js +2579 -0
  69. package/dist/viem/actions/token.js.map +1 -0
  70. package/dist/viem/addresses.d.ts +8 -0
  71. package/dist/viem/addresses.d.ts.map +1 -0
  72. package/dist/viem/addresses.js +8 -0
  73. package/dist/viem/addresses.js.map +1 -0
  74. package/dist/viem/chain.d.ts +341 -0
  75. package/dist/viem/chain.d.ts.map +1 -0
  76. package/dist/viem/chain.js +22 -0
  77. package/dist/viem/chain.js.map +1 -0
  78. package/dist/viem/client.d.ts +27 -0
  79. package/dist/viem/client.d.ts.map +1 -0
  80. package/dist/viem/client.js +28 -0
  81. package/dist/viem/client.js.map +1 -0
  82. package/dist/viem/decorator.d.ts +1636 -0
  83. package/dist/viem/decorator.d.ts.map +1 -0
  84. package/dist/viem/decorator.js +95 -0
  85. package/dist/viem/decorator.js.map +1 -0
  86. package/dist/viem/formatters.d.ts +4 -0
  87. package/dist/viem/formatters.d.ts.map +1 -0
  88. package/dist/viem/formatters.js +69 -0
  89. package/dist/viem/formatters.js.map +1 -0
  90. package/dist/viem/index.d.ts +10 -0
  91. package/dist/viem/index.d.ts.map +1 -0
  92. package/dist/viem/index.js +10 -0
  93. package/dist/viem/index.js.map +1 -0
  94. package/dist/viem/transaction.d.ts +54 -0
  95. package/dist/viem/transaction.d.ts.map +1 -0
  96. package/dist/viem/transaction.js +108 -0
  97. package/dist/viem/transaction.js.map +1 -0
  98. package/dist/viem/transport.d.ts +16 -0
  99. package/dist/viem/transport.d.ts.map +1 -0
  100. package/dist/viem/transport.js +33 -0
  101. package/dist/viem/transport.js.map +1 -0
  102. package/dist/viem/types.d.ts +10 -0
  103. package/dist/viem/types.d.ts.map +1 -0
  104. package/dist/viem/types.js +2 -0
  105. package/dist/viem/types.js.map +1 -0
  106. package/dist/viem/utils.d.ts +8 -0
  107. package/dist/viem/utils.d.ts.map +1 -0
  108. package/dist/viem/utils.js +9 -0
  109. package/dist/viem/utils.js.map +1 -0
  110. package/package.json +100 -2
  111. package/src/chains.ts +46 -0
  112. package/src/index.ts +1 -0
  113. package/src/internal/types.ts +414 -0
  114. package/src/ox/TokenId.test.ts +29 -0
  115. package/src/ox/TokenId.ts +35 -0
  116. package/src/ox/TokenRole.test.ts +20 -0
  117. package/src/ox/TokenRole.ts +27 -0
  118. package/src/ox/Transaction.test.ts +257 -0
  119. package/src/ox/Transaction.ts +247 -0
  120. package/src/ox/TransactionEnvelopeFeeToken.test.ts +1119 -0
  121. package/src/ox/TransactionEnvelopeFeeToken.ts +717 -0
  122. package/src/ox/TransactionRequest.ts +100 -0
  123. package/src/ox/index.ts +4 -0
  124. package/src/prool/Instance.test.ts +43 -0
  125. package/src/prool/Instance.ts +190 -0
  126. package/src/prool/index.ts +1 -0
  127. package/src/prool/internal/chain.json +106 -0
  128. package/src/prool/internal/consensus.toml +32 -0
  129. package/src/viem/abis.ts +1606 -0
  130. package/src/viem/actions/amm.test.ts +425 -0
  131. package/src/viem/actions/amm.ts +1308 -0
  132. package/src/viem/actions/fee.test.ts +281 -0
  133. package/src/viem/actions/fee.ts +362 -0
  134. package/src/viem/actions/index.ts +4 -0
  135. package/src/viem/actions/policy.test.ts +514 -0
  136. package/src/viem/actions/policy.ts +1284 -0
  137. package/src/viem/actions/token.test.ts +2172 -0
  138. package/src/viem/actions/token.ts +3830 -0
  139. package/src/viem/addresses.ts +10 -0
  140. package/src/viem/chain.ts +27 -0
  141. package/src/viem/client.bench-d.ts +8 -0
  142. package/src/viem/client.test.ts +152 -0
  143. package/src/viem/client.ts +91 -0
  144. package/src/viem/decorator.bench-d.ts +11 -0
  145. package/src/viem/decorator.test.ts +35 -0
  146. package/src/viem/decorator.ts +1914 -0
  147. package/src/viem/e2e.test.ts +410 -0
  148. package/src/viem/formatters.ts +100 -0
  149. package/src/viem/index.ts +9 -0
  150. package/src/viem/transaction.ts +253 -0
  151. package/src/viem/transport.ts +47 -0
  152. package/src/viem/types.ts +55 -0
  153. package/src/viem/utils.ts +37 -0
@@ -0,0 +1,1636 @@
1
+ import type { Account, Chain, Client, Transport } from 'viem';
2
+ import * as ammActions from "./actions/amm.js";
3
+ import * as feeActions from "./actions/fee.js";
4
+ import * as policyActions from "./actions/policy.js";
5
+ import * as tokenActions from "./actions/token.js";
6
+ export type Decorator<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
7
+ amm: {
8
+ /**
9
+ * Gets the pool ID for a token pair.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { createTempoClient } from 'tempo.ts/viem'
14
+ *
15
+ * const client = createTempoClient()
16
+ *
17
+ * const poolId = await client.amm.getPoolId({
18
+ * userToken: '0x...',
19
+ * validatorToken: '0x...',
20
+ * })
21
+ * ```
22
+ *
23
+ * @param parameters - Parameters.
24
+ * @returns The pool ID.
25
+ */
26
+ getPoolId: (parameters: ammActions.getPoolId.Parameters) => Promise<ammActions.getPoolId.ReturnValue>;
27
+ /**
28
+ * Gets the reserves for a liquidity pool.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * import { createTempoClient } from 'tempo.ts/viem'
33
+ *
34
+ * const client = createTempoClient()
35
+ *
36
+ * const pool = await client.amm.getPool({
37
+ * userToken: '0x...',
38
+ * validatorToken: '0x...',
39
+ * })
40
+ * ```
41
+ *
42
+ * @param parameters - Parameters.
43
+ * @returns The pool reserves.
44
+ */
45
+ getPool: (parameters: ammActions.getPool.Parameters) => Promise<ammActions.getPool.ReturnValue>;
46
+ /**
47
+ * Gets the total supply of LP tokens for a pool.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * import { createTempoClient } from 'tempo.ts/viem'
52
+ *
53
+ * const client = createTempoClient()
54
+ *
55
+ * const poolId = await client.amm.getPoolId({
56
+ * userToken: '0x...',
57
+ * validatorToken: '0x...',
58
+ * })
59
+ *
60
+ * const totalSupply = await client.amm.getTotalSupply({ poolId })
61
+ * ```
62
+ *
63
+ * @param parameters - Parameters.
64
+ * @returns The total supply of LP tokens.
65
+ */
66
+ getTotalSupply: (parameters: ammActions.getTotalSupply.Parameters) => Promise<ammActions.getTotalSupply.ReturnValue>;
67
+ /**
68
+ * Gets the LP token balance for an account in a specific pool.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * import { createTempoClient } from 'tempo.ts/viem'
73
+ *
74
+ * const client = createTempoClient()
75
+ *
76
+ * const poolId = await client.amm.getPoolId({
77
+ * userToken: '0x...',
78
+ * validatorToken: '0x...',
79
+ * })
80
+ *
81
+ * const balance = await client.amm.getLiquidityBalance({
82
+ * poolId,
83
+ * address: '0x...',
84
+ * })
85
+ * ```
86
+ *
87
+ * @param parameters - Parameters.
88
+ * @returns The LP token balance.
89
+ */
90
+ getLiquidityBalance: (parameters: ammActions.getLiquidityBalance.Parameters) => Promise<ammActions.getLiquidityBalance.ReturnValue>;
91
+ /**
92
+ * Performs a rebalance swap from validator token to user token.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { createTempoClient } from 'tempo.ts/viem'
97
+ * import { privateKeyToAccount } from 'viem/accounts'
98
+ *
99
+ * const client = createTempoClient({
100
+ * account: privateKeyToAccount('0x...')
101
+ * })
102
+ *
103
+ * const hash = await client.amm.rebalanceSwap({
104
+ * userToken: '0x...',
105
+ * validatorToken: '0x...',
106
+ * amountOut: 100n,
107
+ * to: '0x...',
108
+ * })
109
+ * ```
110
+ *
111
+ * @param parameters - Parameters.
112
+ * @returns The transaction hash.
113
+ */
114
+ rebalanceSwap: (parameters: ammActions.rebalanceSwap.Parameters<chain, account>) => Promise<ammActions.rebalanceSwap.ReturnValue>;
115
+ /**
116
+ * Performs a rebalance swap from validator token to user token.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * import { createTempoClient } from 'tempo.ts/viem'
121
+ * import { privateKeyToAccount } from 'viem/accounts'
122
+ *
123
+ * const client = createTempoClient({
124
+ * account: privateKeyToAccount('0x...')
125
+ * })
126
+ *
127
+ * const result = await client.amm.rebalanceSwapSync({
128
+ * userToken: '0x...',
129
+ * validatorToken: '0x...',
130
+ * amountOut: 100n,
131
+ * to: '0x...',
132
+ * })
133
+ * ```
134
+ *
135
+ * @param parameters - Parameters.
136
+ * @returns The transaction receipt and event data.
137
+ */
138
+ rebalanceSwapSync: (parameters: ammActions.rebalanceSwapSync.Parameters<chain, account>) => Promise<ammActions.rebalanceSwapSync.ReturnValue>;
139
+ /**
140
+ * Adds liquidity to a pool.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * import { createTempoClient } from 'tempo.ts/viem'
145
+ * import { privateKeyToAccount } from 'viem/accounts'
146
+ *
147
+ * const client = createTempoClient({
148
+ * account: privateKeyToAccount('0x...')
149
+ * })
150
+ *
151
+ * const hash = await client.amm.mint({
152
+ * userToken: {
153
+ * address: '0x...',
154
+ * amount: 100n,
155
+ * },
156
+ * validatorToken: {
157
+ * address: '0x...',
158
+ * amount: 100n,
159
+ * },
160
+ * to: '0x...',
161
+ * })
162
+ * ```
163
+ *
164
+ * @param parameters - Parameters.
165
+ * @returns The transaction hash.
166
+ */
167
+ mint: (parameters: ammActions.mint.Parameters<chain, account>) => Promise<ammActions.mint.ReturnValue>;
168
+ /**
169
+ * Adds liquidity to a pool.
170
+ *
171
+ * @example
172
+ * ```ts
173
+ * import { createTempoClient } from 'tempo.ts/viem'
174
+ * import { privateKeyToAccount } from 'viem/accounts'
175
+ *
176
+ * const client = createTempoClient({
177
+ * account: privateKeyToAccount('0x...')
178
+ * })
179
+ *
180
+ * const result = await client.amm.mintSync({
181
+ * userToken: {
182
+ * address: '0x...',
183
+ * amount: 100n,
184
+ * },
185
+ * validatorToken: {
186
+ * address: '0x...',
187
+ * amount: 100n,
188
+ * },
189
+ * to: '0x...',
190
+ * })
191
+ * ```
192
+ *
193
+ * @param parameters - Parameters.
194
+ * @returns The transaction receipt and event data.
195
+ */
196
+ mintSync: (parameters: ammActions.mintSync.Parameters<chain, account>) => Promise<ammActions.mintSync.ReturnValue>;
197
+ /**
198
+ * Removes liquidity from a pool.
199
+ *
200
+ * @example
201
+ * ```ts
202
+ * import { createTempoClient } from 'tempo.ts/viem'
203
+ * import { privateKeyToAccount } from 'viem/accounts'
204
+ *
205
+ * const client = createTempoClient({
206
+ * account: privateKeyToAccount('0x...')
207
+ * })
208
+ *
209
+ * const hash = await client.amm.burn({
210
+ * userToken: '0x...',
211
+ * validatorToken: '0x...',
212
+ * liquidity: 50n,
213
+ * to: '0x...',
214
+ * })
215
+ * ```
216
+ *
217
+ * @param parameters - Parameters.
218
+ * @returns The transaction hash.
219
+ */
220
+ burn: (parameters: ammActions.burn.Parameters<chain, account>) => Promise<ammActions.burn.ReturnValue>;
221
+ /**
222
+ * Removes liquidity from a pool.
223
+ *
224
+ * @example
225
+ * ```ts
226
+ * import { createTempoClient } from 'tempo.ts/viem'
227
+ * import { privateKeyToAccount } from 'viem/accounts'
228
+ *
229
+ * const client = createTempoClient({
230
+ * account: privateKeyToAccount('0x...')
231
+ * })
232
+ *
233
+ * const result = await client.amm.burnSync({
234
+ * userToken: '0x...',
235
+ * validatorToken: '0x...',
236
+ * liquidity: 50n,
237
+ * to: '0x...',
238
+ * })
239
+ * ```
240
+ *
241
+ * @param parameters - Parameters.
242
+ * @returns The transaction receipt and event data.
243
+ */
244
+ burnSync: (parameters: ammActions.burnSync.Parameters<chain, account>) => Promise<ammActions.burnSync.ReturnValue>;
245
+ /**
246
+ * Watches for rebalance swap events.
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * import { createTempoClient } from 'tempo.ts/viem'
251
+ *
252
+ * const client = createTempoClient()
253
+ *
254
+ * const unwatch = client.amm.watchRebalanceSwap({
255
+ * onRebalanceSwap: (args, log) => {
256
+ * console.log('Rebalance swap:', args)
257
+ * },
258
+ * })
259
+ * ```
260
+ *
261
+ * @param parameters - Parameters.
262
+ * @returns A function to unsubscribe from the event.
263
+ */
264
+ watchRebalanceSwap: (parameters: ammActions.watchRebalanceSwap.Parameters) => () => void;
265
+ /**
266
+ * Watches for fee swap events.
267
+ *
268
+ * @example
269
+ * ```ts
270
+ * import { createTempoClient } from 'tempo.ts/viem'
271
+ *
272
+ * const client = createTempoClient()
273
+ *
274
+ * const unwatch = client.amm.watchFeeSwap({
275
+ * onFeeSwap: (args, log) => {
276
+ * console.log('Fee swap:', args)
277
+ * },
278
+ * })
279
+ * ```
280
+ *
281
+ * @param parameters - Parameters.
282
+ * @returns A function to unsubscribe from the event.
283
+ */
284
+ watchFeeSwap: (parameters: ammActions.watchFeeSwap.Parameters) => () => void;
285
+ /**
286
+ * Watches for liquidity mint events.
287
+ *
288
+ * @example
289
+ * ```ts
290
+ * import { createTempoClient } from 'tempo.ts/viem'
291
+ *
292
+ * const client = createTempoClient()
293
+ *
294
+ * const unwatch = client.amm.watchMint({
295
+ * onMint: (args, log) => {
296
+ * console.log('Liquidity added:', args)
297
+ * },
298
+ * })
299
+ * ```
300
+ *
301
+ * @param parameters - Parameters.
302
+ * @returns A function to unsubscribe from the event.
303
+ */
304
+ watchMint: (parameters: ammActions.watchMint.Parameters) => () => void;
305
+ /**
306
+ * Watches for liquidity burn events.
307
+ *
308
+ * @example
309
+ * ```ts
310
+ * import { createTempoClient } from 'tempo.ts/viem'
311
+ *
312
+ * const client = createTempoClient()
313
+ *
314
+ * const unwatch = client.amm.watchBurn({
315
+ * onBurn: (args, log) => {
316
+ * console.log('Liquidity removed:', args)
317
+ * },
318
+ * })
319
+ * ```
320
+ *
321
+ * @param parameters - Parameters.
322
+ * @returns A function to unsubscribe from the event.
323
+ */
324
+ watchBurn: (parameters: ammActions.watchBurn.Parameters) => () => void;
325
+ };
326
+ fee: {
327
+ /**
328
+ * Gets the user's default fee token.
329
+ *
330
+ * @example
331
+ * ```ts
332
+ * import { createTempoClient } from 'tempo.ts/viem'
333
+ * import { privateKeyToAccount } from 'viem/accounts'
334
+ *
335
+ * const client = createTempoClient({
336
+ * account: privateKeyToAccount('0x...')
337
+ * })
338
+ *
339
+ * const { address, id } = await client.token.getUserToken()
340
+ * ```
341
+ *
342
+ * @param client - Client.
343
+ * @param parameters - Parameters.
344
+ * @returns The transaction hash.
345
+ */
346
+ getUserToken: (...parameters: account extends Account ? [feeActions.getUserToken.Parameters<account>] | [] : [feeActions.getUserToken.Parameters<account>]) => Promise<feeActions.getUserToken.ReturnValue>;
347
+ /**
348
+ * Sets the user's default fee token.
349
+ *
350
+ * @example
351
+ * ```ts
352
+ * import { createTempoClient } from 'tempo.ts/viem'
353
+ * import { privateKeyToAccount } from 'viem/accounts'
354
+ *
355
+ * const client = createTempoClient({
356
+ * account: privateKeyToAccount('0x...')
357
+ * })
358
+ *
359
+ * const hash = await client.token.setUserToken({
360
+ * token: '0x...',
361
+ * })
362
+ * ```
363
+ *
364
+ * @param client - Client.
365
+ * @param parameters - Parameters.
366
+ * @returns The transaction hash.
367
+ */
368
+ setUserToken: (parameters: feeActions.setUserToken.Parameters<chain, account>) => Promise<feeActions.setUserToken.ReturnValue>;
369
+ /**
370
+ * Sets the user's default fee token.
371
+ *
372
+ * @example
373
+ * ```ts
374
+ * import { createTempoClient } from 'tempo.ts/viem'
375
+ * import { privateKeyToAccount } from 'viem/accounts'
376
+ *
377
+ * const client = createTempoClient({
378
+ * account: privateKeyToAccount('0x...')
379
+ * })
380
+ *
381
+ * const result = await client.fee.setUserTokenSync({
382
+ * token: '0x...',
383
+ * })
384
+ * ```
385
+ *
386
+ * @param parameters - Parameters.
387
+ * @returns The transaction receipt and event data.
388
+ */
389
+ setUserTokenSync: (parameters: feeActions.setUserTokenSync.Parameters<chain, account>) => Promise<feeActions.setUserTokenSync.ReturnValue>;
390
+ /**
391
+ * Watches for user token set events.
392
+ *
393
+ * @example
394
+ * ```ts
395
+ * import { createTempoClient } from 'tempo.ts/viem'
396
+ *
397
+ * const client = createTempoClient()
398
+ *
399
+ * const unwatch = client.token.watchSetUserToken({
400
+ * onUserTokenSet: (args, log) => {
401
+ * console.log('User token set:', args)
402
+ * },
403
+ * })
404
+ * ```
405
+ *
406
+ * @param client - Client.
407
+ * @param parameters - Parameters.
408
+ * @returns A function to unsubscribe from the event.
409
+ */
410
+ watchSetUserToken: (parameters: feeActions.watchSetUserToken.Parameters) => () => void;
411
+ };
412
+ policy: {
413
+ /**
414
+ * Creates a new policy.
415
+ *
416
+ * @example
417
+ * ```ts
418
+ * import { createTempoClient } from 'tempo.ts/viem'
419
+ * import { privateKeyToAccount } from 'viem/accounts'
420
+ *
421
+ * const client = createTempoClient({
422
+ * account: privateKeyToAccount('0x...')
423
+ * })
424
+ *
425
+ * const hash = await client.policy.create({
426
+ * admin: '0x...',
427
+ * type: 'whitelist',
428
+ * })
429
+ * ```
430
+ *
431
+ * @param parameters - Parameters.
432
+ * @returns The transaction hash.
433
+ */
434
+ create: (parameters: policyActions.create.Parameters<chain, account>) => Promise<policyActions.create.ReturnValue>;
435
+ /**
436
+ * Creates a new policy.
437
+ *
438
+ * @example
439
+ * ```ts
440
+ * import { createTempoClient } from 'tempo.ts/viem'
441
+ * import { privateKeyToAccount } from 'viem/accounts'
442
+ *
443
+ * const client = createTempoClient({
444
+ * account: privateKeyToAccount('0x...')
445
+ * })
446
+ *
447
+ * const result = await client.policy.createSync({
448
+ * admin: '0x...',
449
+ * type: 'whitelist',
450
+ * })
451
+ * ```
452
+ *
453
+ * @param parameters - Parameters.
454
+ * @returns The transaction receipt and event data.
455
+ */
456
+ createSync: (parameters: policyActions.createSync.Parameters<chain, account>) => Promise<policyActions.createSync.ReturnValue>;
457
+ /**
458
+ * Sets the admin for a policy.
459
+ *
460
+ * @example
461
+ * ```ts
462
+ * import { createTempoClient } from 'tempo.ts/viem'
463
+ * import { privateKeyToAccount } from 'viem/accounts'
464
+ *
465
+ * const client = createTempoClient({
466
+ * account: privateKeyToAccount('0x...')
467
+ * })
468
+ *
469
+ * const hash = await client.policy.setAdmin({
470
+ * policyId: 2n,
471
+ * admin: '0x...',
472
+ * })
473
+ * ```
474
+ *
475
+ * @param parameters - Parameters.
476
+ * @returns The transaction hash.
477
+ */
478
+ setAdmin: (parameters: policyActions.setAdmin.Parameters<chain, account>) => Promise<policyActions.setAdmin.ReturnValue>;
479
+ /**
480
+ * Sets the admin for a policy.
481
+ *
482
+ * @example
483
+ * ```ts
484
+ * import { createTempoClient } from 'tempo.ts/viem'
485
+ * import { privateKeyToAccount } from 'viem/accounts'
486
+ *
487
+ * const client = createTempoClient({
488
+ * account: privateKeyToAccount('0x...')
489
+ * })
490
+ *
491
+ * const result = await client.policy.setAdminSync({
492
+ * policyId: 2n,
493
+ * admin: '0x...',
494
+ * })
495
+ * ```
496
+ *
497
+ * @param parameters - Parameters.
498
+ * @returns The transaction receipt and event data.
499
+ */
500
+ setAdminSync: (parameters: policyActions.setAdminSync.Parameters<chain, account>) => Promise<policyActions.setAdminSync.ReturnValue>;
501
+ /**
502
+ * Modifies a policy whitelist.
503
+ *
504
+ * @example
505
+ * ```ts
506
+ * import { createTempoClient } from 'tempo.ts/viem'
507
+ * import { privateKeyToAccount } from 'viem/accounts'
508
+ *
509
+ * const client = createTempoClient({
510
+ * account: privateKeyToAccount('0x...')
511
+ * })
512
+ *
513
+ * const hash = await client.policy.modifyWhitelist({
514
+ * policyId: 2n,
515
+ * address: '0x...',
516
+ * allowed: true,
517
+ * })
518
+ * ```
519
+ *
520
+ * @param parameters - Parameters.
521
+ * @returns The transaction hash.
522
+ */
523
+ modifyWhitelist: (parameters: policyActions.modifyWhitelist.Parameters<chain, account>) => Promise<policyActions.modifyWhitelist.ReturnValue>;
524
+ /**
525
+ * Modifies a policy whitelist.
526
+ *
527
+ * @example
528
+ * ```ts
529
+ * import { createTempoClient } from 'tempo.ts/viem'
530
+ * import { privateKeyToAccount } from 'viem/accounts'
531
+ *
532
+ * const client = createTempoClient({
533
+ * account: privateKeyToAccount('0x...')
534
+ * })
535
+ *
536
+ * const result = await client.policy.modifyWhitelistSync({
537
+ * policyId: 2n,
538
+ * address: '0x...',
539
+ * allowed: true,
540
+ * })
541
+ * ```
542
+ *
543
+ * @param parameters - Parameters.
544
+ * @returns The transaction receipt and event data.
545
+ */
546
+ modifyWhitelistSync: (parameters: policyActions.modifyWhitelistSync.Parameters<chain, account>) => Promise<policyActions.modifyWhitelistSync.ReturnValue>;
547
+ /**
548
+ * Modifies a policy blacklist.
549
+ *
550
+ * @example
551
+ * ```ts
552
+ * import { createTempoClient } from 'tempo.ts/viem'
553
+ * import { privateKeyToAccount } from 'viem/accounts'
554
+ *
555
+ * const client = createTempoClient({
556
+ * account: privateKeyToAccount('0x...')
557
+ * })
558
+ *
559
+ * const hash = await client.policy.modifyBlacklist({
560
+ * policyId: 2n,
561
+ * address: '0x...',
562
+ * restricted: true,
563
+ * })
564
+ * ```
565
+ *
566
+ * @param parameters - Parameters.
567
+ * @returns The transaction hash.
568
+ */
569
+ modifyBlacklist: (parameters: policyActions.modifyBlacklist.Parameters<chain, account>) => Promise<policyActions.modifyBlacklist.ReturnValue>;
570
+ /**
571
+ * Modifies a policy blacklist.
572
+ *
573
+ * @example
574
+ * ```ts
575
+ * import { createTempoClient } from 'tempo.ts/viem'
576
+ * import { privateKeyToAccount } from 'viem/accounts'
577
+ *
578
+ * const client = createTempoClient({
579
+ * account: privateKeyToAccount('0x...')
580
+ * })
581
+ *
582
+ * const result = await client.policy.modifyBlacklistSync({
583
+ * policyId: 2n,
584
+ * address: '0x...',
585
+ * restricted: true,
586
+ * })
587
+ * ```
588
+ *
589
+ * @param parameters - Parameters.
590
+ * @returns The transaction receipt and event data.
591
+ */
592
+ modifyBlacklistSync: (parameters: policyActions.modifyBlacklistSync.Parameters<chain, account>) => Promise<policyActions.modifyBlacklistSync.ReturnValue>;
593
+ /**
594
+ * Gets policy data.
595
+ *
596
+ * @example
597
+ * ```ts
598
+ * import { createTempoClient } from 'tempo.ts/viem'
599
+ *
600
+ * const client = createTempoClient()
601
+ *
602
+ * const data = await client.policy.getData({
603
+ * policyId: 2n,
604
+ * })
605
+ * ```
606
+ *
607
+ * @param parameters - Parameters.
608
+ * @returns The policy data.
609
+ */
610
+ getData: (parameters: policyActions.getData.Parameters) => Promise<policyActions.getData.ReturnValue>;
611
+ /**
612
+ * Checks if a user is authorized by a policy.
613
+ *
614
+ * @example
615
+ * ```ts
616
+ * import { createTempoClient } from 'tempo.ts/viem'
617
+ *
618
+ * const client = createTempoClient()
619
+ *
620
+ * const authorized = await client.policy.isAuthorized({
621
+ * policyId: 2n,
622
+ * user: '0x...',
623
+ * })
624
+ * ```
625
+ *
626
+ * @param parameters - Parameters.
627
+ * @returns Whether the user is authorized.
628
+ */
629
+ isAuthorized: (parameters: policyActions.isAuthorized.Parameters) => Promise<policyActions.isAuthorized.ReturnValue>;
630
+ /**
631
+ * Watches for policy creation events.
632
+ *
633
+ * @example
634
+ * ```ts
635
+ * import { createTempoClient } from 'tempo.ts/viem'
636
+ *
637
+ * const client = createTempoClient()
638
+ *
639
+ * const unwatch = client.policy.watchCreate({
640
+ * onPolicyCreated: (args, log) => {
641
+ * console.log('Policy created:', args)
642
+ * },
643
+ * })
644
+ * ```
645
+ *
646
+ * @param parameters - Parameters.
647
+ * @returns A function to unsubscribe from the event.
648
+ */
649
+ watchCreate: (parameters: policyActions.watchCreate.Parameters) => () => void;
650
+ /**
651
+ * Watches for policy admin update events.
652
+ *
653
+ * @example
654
+ * ```ts
655
+ * import { createTempoClient } from 'tempo.ts/viem'
656
+ *
657
+ * const client = createTempoClient()
658
+ *
659
+ * const unwatch = client.policy.watchAdminUpdated({
660
+ * onAdminUpdated: (args, log) => {
661
+ * console.log('Policy admin updated:', args)
662
+ * },
663
+ * })
664
+ * ```
665
+ *
666
+ * @param parameters - Parameters.
667
+ * @returns A function to unsubscribe from the event.
668
+ */
669
+ watchAdminUpdated: (parameters: policyActions.watchAdminUpdated.Parameters) => () => void;
670
+ /**
671
+ * Watches for whitelist update events.
672
+ *
673
+ * @example
674
+ * ```ts
675
+ * import { createTempoClient } from 'tempo.ts/viem'
676
+ *
677
+ * const client = createTempoClient()
678
+ *
679
+ * const unwatch = client.policy.watchWhitelistUpdated({
680
+ * onWhitelistUpdated: (args, log) => {
681
+ * console.log('Whitelist updated:', args)
682
+ * },
683
+ * })
684
+ * ```
685
+ *
686
+ * @param parameters - Parameters.
687
+ * @returns A function to unsubscribe from the event.
688
+ */
689
+ watchWhitelistUpdated: (parameters: policyActions.watchWhitelistUpdated.Parameters) => () => void;
690
+ /**
691
+ * Watches for blacklist update events.
692
+ *
693
+ * @example
694
+ * ```ts
695
+ * import { createTempoClient } from 'tempo.ts/viem'
696
+ *
697
+ * const client = createTempoClient()
698
+ *
699
+ * const unwatch = client.policy.watchBlacklistUpdated({
700
+ * onBlacklistUpdated: (args, log) => {
701
+ * console.log('Blacklist updated:', args)
702
+ * },
703
+ * })
704
+ * ```
705
+ *
706
+ * @param parameters - Parameters.
707
+ * @returns A function to unsubscribe from the event.
708
+ */
709
+ watchBlacklistUpdated: (parameters: policyActions.watchBlacklistUpdated.Parameters) => () => void;
710
+ };
711
+ token: {
712
+ /**
713
+ * Approves a spender to transfer TIP20 tokens on behalf of the caller.
714
+ *
715
+ * @example
716
+ * ```ts
717
+ * import { createTempoClient } from 'tempo.ts/viem'
718
+ * import { privateKeyToAccount } from 'viem/accounts'
719
+ *
720
+ * const client = createTempoClient({
721
+ * account: privateKeyToAccount('0x...')
722
+ * })
723
+ *
724
+ * const hash = await client.token.approve({
725
+ * spender: '0x...',
726
+ * amount: 100n,
727
+ * })
728
+ * ```
729
+ *
730
+ * @param client - Client.
731
+ * @param parameters - Parameters.
732
+ * @returns The transaction hash.
733
+ */
734
+ approve: (parameters: tokenActions.approve.Parameters<chain, account>) => Promise<tokenActions.approve.ReturnValue>;
735
+ /**
736
+ * Approves a spender to transfer TIP20 tokens on behalf of the caller.
737
+ *
738
+ * @example
739
+ * ```ts
740
+ * import { createTempoClient } from 'tempo.ts/viem'
741
+ * import { privateKeyToAccount } from 'viem/accounts'
742
+ *
743
+ * const client = createTempoClient({
744
+ * account: privateKeyToAccount('0x...')
745
+ * })
746
+ *
747
+ * const result = await client.token.approveSync({
748
+ * spender: '0x...',
749
+ * amount: 100n,
750
+ * })
751
+ * ```
752
+ *
753
+ * @param client - Client.
754
+ * @param parameters - Parameters.
755
+ * @returns The transaction receipt and event data.
756
+ */
757
+ approveSync: (parameters: tokenActions.approveSync.Parameters<chain, account>) => Promise<tokenActions.approveSync.ReturnValue>;
758
+ /**
759
+ * Burns TIP20 tokens from a blocked address.
760
+ *
761
+ * @example
762
+ * ```ts
763
+ * import { createTempoClient } from 'tempo.ts/viem'
764
+ * import { privateKeyToAccount } from 'viem/accounts'
765
+ *
766
+ * const client = createTempoClient({
767
+ * account: privateKeyToAccount('0x...')
768
+ * })
769
+ *
770
+ * const hash = await client.token.burnBlocked({
771
+ * from: '0x...',
772
+ * amount: 100n,
773
+ * token: '0x...',
774
+ * })
775
+ * ```
776
+ *
777
+ * @param client - Client.
778
+ * @param parameters - Parameters.
779
+ * @returns The transaction hash.
780
+ */
781
+ burnBlocked: (parameters: tokenActions.burnBlocked.Parameters<chain, account>) => Promise<tokenActions.burnBlocked.ReturnValue>;
782
+ /**
783
+ * Burns TIP20 tokens from a blocked address.
784
+ *
785
+ * @example
786
+ * ```ts
787
+ * import { createTempoClient } from 'tempo.ts/viem'
788
+ * import { privateKeyToAccount } from 'viem/accounts'
789
+ *
790
+ * const client = createTempoClient({
791
+ * account: privateKeyToAccount('0x...')
792
+ * })
793
+ *
794
+ * const result = await client.token.burnBlockedSync({
795
+ * from: '0x...',
796
+ * amount: 100n,
797
+ * token: '0x...',
798
+ * })
799
+ * ```
800
+ *
801
+ * @param client - Client.
802
+ * @param parameters - Parameters.
803
+ * @returns The transaction receipt and event data.
804
+ */
805
+ burnBlockedSync: (parameters: tokenActions.burnBlockedSync.Parameters<chain, account>) => Promise<tokenActions.burnBlockedSync.ReturnValue>;
806
+ /**
807
+ * Burns TIP20 tokens from the caller's balance.
808
+ *
809
+ * @example
810
+ * ```ts
811
+ * import { createTempoClient } from 'tempo.ts/viem'
812
+ * import { privateKeyToAccount } from 'viem/accounts'
813
+ *
814
+ * const client = createTempoClient({
815
+ * account: privateKeyToAccount('0x...')
816
+ * })
817
+ *
818
+ * const hash = await client.token.burn({
819
+ * amount: 100n,
820
+ * token: '0x...',
821
+ * })
822
+ * ```
823
+ *
824
+ * @param client - Client.
825
+ * @param parameters - Parameters.
826
+ * @returns The transaction hash.
827
+ */
828
+ burn: (parameters: tokenActions.burn.Parameters<chain, account>) => Promise<tokenActions.burn.ReturnValue>;
829
+ /**
830
+ * Burns TIP20 tokens from the caller's balance.
831
+ *
832
+ * @example
833
+ * ```ts
834
+ * import { createTempoClient } from 'tempo.ts/viem'
835
+ * import { privateKeyToAccount } from 'viem/accounts'
836
+ *
837
+ * const client = createTempoClient({
838
+ * account: privateKeyToAccount('0x...')
839
+ * })
840
+ *
841
+ * const result = await client.token.burnSync({
842
+ * amount: 100n,
843
+ * token: '0x...',
844
+ * })
845
+ * ```
846
+ *
847
+ * @param client - Client.
848
+ * @param parameters - Parameters.
849
+ * @returns The transaction receipt and event data.
850
+ */
851
+ burnSync: (parameters: tokenActions.burnSync.Parameters<chain, account>) => Promise<tokenActions.burnSync.ReturnValue>;
852
+ /**
853
+ * Changes the transfer policy ID for a TIP20 token.
854
+ *
855
+ * @example
856
+ * ```ts
857
+ * import { createTempoClient } from 'tempo.ts/viem'
858
+ * import { privateKeyToAccount } from 'viem/accounts'
859
+ *
860
+ * const client = createTempoClient({
861
+ * account: privateKeyToAccount('0x...')
862
+ * })
863
+ *
864
+ * const hash = await client.token.changeTransferPolicy({
865
+ * token: '0x...',
866
+ * policyId: 1n,
867
+ * })
868
+ * ```
869
+ *
870
+ * @param client - Client.
871
+ * @param parameters - Parameters.
872
+ * @returns The transaction hash.
873
+ */
874
+ changeTransferPolicy: (parameters: tokenActions.changeTransferPolicy.Parameters<chain, account>) => Promise<tokenActions.changeTransferPolicy.ReturnValue>;
875
+ /**
876
+ * Changes the transfer policy ID for a TIP20 token.
877
+ *
878
+ * @example
879
+ * ```ts
880
+ * import { createTempoClient } from 'tempo.ts/viem'
881
+ * import { privateKeyToAccount } from 'viem/accounts'
882
+ *
883
+ * const client = createTempoClient({
884
+ * account: privateKeyToAccount('0x...')
885
+ * })
886
+ *
887
+ * const result = await client.token.changeTransferPolicySync({
888
+ * token: '0x...',
889
+ * policyId: 1n,
890
+ * })
891
+ * ```
892
+ *
893
+ * @param client - Client.
894
+ * @param parameters - Parameters.
895
+ * @returns The transaction receipt and event data.
896
+ */
897
+ changeTransferPolicySync: (parameters: tokenActions.changeTransferPolicySync.Parameters<chain, account>) => Promise<tokenActions.changeTransferPolicySync.ReturnValue>;
898
+ /**
899
+ * Creates a new TIP20 token.
900
+ *
901
+ * @example
902
+ * ```ts
903
+ * import { createTempoClient } from 'tempo.ts/viem'
904
+ * import { privateKeyToAccount } from 'viem/accounts'
905
+ *
906
+ * const client = createTempoClient({
907
+ * account: privateKeyToAccount('0x...')
908
+ * })
909
+ *
910
+ * const { hash, id, address } = await client.token.create({
911
+ * name: 'My Token',
912
+ * symbol: 'MTK',
913
+ * currency: 'USD',
914
+ * })
915
+ * ```
916
+ *
917
+ * @param client - Client.
918
+ * @param parameters - Parameters.
919
+ * @returns The transaction hash.
920
+ */
921
+ create: (parameters: tokenActions.create.Parameters<chain, account>) => Promise<tokenActions.create.ReturnValue>;
922
+ /**
923
+ * Creates a new TIP20 token.
924
+ *
925
+ * @example
926
+ * ```ts
927
+ * import { createTempoClient } from 'tempo.ts/viem'
928
+ * import { privateKeyToAccount } from 'viem/accounts'
929
+ *
930
+ * const client = createTempoClient({
931
+ * account: privateKeyToAccount('0x...')
932
+ * })
933
+ *
934
+ * const result = await client.token.createSync({
935
+ * name: 'My Token',
936
+ * symbol: 'MTK',
937
+ * currency: 'USD',
938
+ * })
939
+ * ```
940
+ *
941
+ * @param client - Client.
942
+ * @param parameters - Parameters.
943
+ * @returns The transaction receipt and event data.
944
+ */
945
+ createSync: (parameters: tokenActions.createSync.Parameters<chain, account>) => Promise<tokenActions.createSync.ReturnValue>;
946
+ /**
947
+ * Gets TIP20 token allowance.
948
+ *
949
+ * @example
950
+ * ```ts
951
+ * import { createTempoClient } from 'tempo.ts/viem'
952
+ * import { privateKeyToAccount } from 'viem/accounts'
953
+ *
954
+ * const client = createTempoClient({
955
+ * account: privateKeyToAccount('0x...')
956
+ * })
957
+ *
958
+ * const allowance = await client.token.getAllowance({
959
+ * spender: '0x...',
960
+ * })
961
+ * ```
962
+ *
963
+ * @param client - Client.
964
+ * @param parameters - Parameters.
965
+ * @returns The token allowance.
966
+ */
967
+ getAllowance: (parameters: tokenActions.getAllowance.Parameters) => Promise<tokenActions.getAllowance.ReturnValue>;
968
+ /**
969
+ * Gets TIP20 token balance for an address.
970
+ *
971
+ * @example
972
+ * ```ts
973
+ * import { createTempoClient } from 'tempo.ts/viem'
974
+ * import { privateKeyToAccount } from 'viem/accounts'
975
+ *
976
+ * const client = createTempoClient({
977
+ * account: privateKeyToAccount('0x...')
978
+ * })
979
+ *
980
+ * const balance = await client.token.getBalance()
981
+ * ```
982
+ *
983
+ * @param client - Client.
984
+ * @param parameters - Parameters.
985
+ * @returns The token balance.
986
+ */
987
+ getBalance: (...parameters: account extends Account ? [tokenActions.getBalance.Parameters<account>] | [] : [tokenActions.getBalance.Parameters<account>]) => Promise<tokenActions.getBalance.ReturnValue>;
988
+ /**
989
+ * Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
990
+ *
991
+ * @example
992
+ * ```ts
993
+ * import { createTempoClient } from 'tempo.ts/viem'
994
+ *
995
+ * const client = createTempoClient()
996
+ *
997
+ * const metadata = await client.token.getMetadata({
998
+ * token: '0x...',
999
+ * })
1000
+ * ```
1001
+ *
1002
+ * @param client - Client.
1003
+ * @param parameters - Parameters.
1004
+ * @returns The token metadata.
1005
+ */
1006
+ getMetadata: (parameters: tokenActions.getMetadata.Parameters) => Promise<tokenActions.getMetadata.ReturnValue>;
1007
+ /**
1008
+ * Grants a role for a TIP20 token.
1009
+ *
1010
+ * @example
1011
+ * ```ts
1012
+ * import { createTempoClient } from 'tempo.ts/viem'
1013
+ * import { privateKeyToAccount } from 'viem/accounts'
1014
+ *
1015
+ * const client = createTempoClient({
1016
+ * account: privateKeyToAccount('0x...')
1017
+ * })
1018
+ *
1019
+ * const hash = await client.token.grantRoles({
1020
+ * token: '0x...',
1021
+ * to: '0x...',
1022
+ * roles: ['minter'],
1023
+ * })
1024
+ * ```
1025
+ *
1026
+ * @param client - Client.
1027
+ * @param parameters - Parameters.
1028
+ * @returns The transaction hash.
1029
+ */
1030
+ grantRoles: (parameters: tokenActions.grantRoles.Parameters<chain, account>) => Promise<tokenActions.grantRoles.ReturnValue>;
1031
+ /**
1032
+ * Grants a role for a TIP20 token.
1033
+ *
1034
+ * @example
1035
+ * ```ts
1036
+ * import { createTempoClient } from 'tempo.ts/viem'
1037
+ * import { tempo } from 'tempo.ts/chains'
1038
+ * import { http } from 'viem'
1039
+ * import { privateKeyToAccount } from 'viem/accounts'
1040
+ *
1041
+ * const client = createTempoClient({
1042
+ * account: privateKeyToAccount('0x...'),
1043
+ * chain: tempo,
1044
+ * transport: http(),
1045
+ * })
1046
+ *
1047
+ * const result = await client.token.grantRolesSync({
1048
+ * token: '0x...',
1049
+ * to: '0x...',
1050
+ * roles: ['minter'],
1051
+ * })
1052
+ * ```
1053
+ *
1054
+ * @param parameters - Parameters.
1055
+ * @returns The transaction receipt and event data.
1056
+ */
1057
+ grantRolesSync: (parameters: tokenActions.grantRolesSync.Parameters<chain, account>) => Promise<tokenActions.grantRolesSync.ReturnValue>;
1058
+ /**
1059
+ * Mints TIP20 tokens to an address.
1060
+ *
1061
+ * @example
1062
+ * ```ts
1063
+ * import { createTempoClient } from 'tempo.ts/viem'
1064
+ * import { privateKeyToAccount } from 'viem/accounts'
1065
+ *
1066
+ * const client = createTempoClient({
1067
+ * account: privateKeyToAccount('0x...')
1068
+ * })
1069
+ *
1070
+ * const hash = await client.token.mint({
1071
+ * to: '0x...',
1072
+ * amount: 100n,
1073
+ * token: '0x...',
1074
+ * })
1075
+ * ```
1076
+ *
1077
+ * @param client - Client.
1078
+ * @param parameters - Parameters.
1079
+ * @returns The transaction hash.
1080
+ */
1081
+ mint: (parameters: tokenActions.mint.Parameters<chain, account>) => Promise<tokenActions.mint.ReturnValue>;
1082
+ /**
1083
+ * Mints TIP20 tokens to an address.
1084
+ *
1085
+ * @example
1086
+ * ```ts
1087
+ * import { createTempoClient } from 'tempo.ts/viem'
1088
+ * import { privateKeyToAccount } from 'viem/accounts'
1089
+ *
1090
+ * const client = createTempoClient({
1091
+ * account: privateKeyToAccount('0x...')
1092
+ * })
1093
+ *
1094
+ * const result = await client.token.mintSync({
1095
+ * to: '0x...',
1096
+ * amount: 100n,
1097
+ * token: '0x...',
1098
+ * })
1099
+ * ```
1100
+ *
1101
+ * @param client - Client.
1102
+ * @param parameters - Parameters.
1103
+ * @returns The transaction receipt and event data.
1104
+ */
1105
+ mintSync: (parameters: tokenActions.mintSync.Parameters<chain, account>) => Promise<tokenActions.mintSync.ReturnValue>;
1106
+ /**
1107
+ * Pauses a TIP20 token.
1108
+ *
1109
+ * @example
1110
+ * ```ts
1111
+ * import { createTempoClient } from 'tempo.ts/viem'
1112
+ * import { privateKeyToAccount } from 'viem/accounts'
1113
+ *
1114
+ * const client = createTempoClient({
1115
+ * account: privateKeyToAccount('0x...')
1116
+ * })
1117
+ *
1118
+ * const hash = await client.token.pause({
1119
+ * token: '0x...',
1120
+ * })
1121
+ * ```
1122
+ *
1123
+ * @param client - Client.
1124
+ * @param parameters - Parameters.
1125
+ * @returns The transaction hash.
1126
+ */
1127
+ pause: (parameters: tokenActions.pause.Parameters<chain, account>) => Promise<tokenActions.pause.ReturnValue>;
1128
+ /**
1129
+ * Pauses a TIP20 token.
1130
+ *
1131
+ * @example
1132
+ * ```ts
1133
+ * import { createTempoClient } from 'tempo.ts/viem'
1134
+ * import { privateKeyToAccount } from 'viem/accounts'
1135
+ *
1136
+ * const client = createTempoClient({
1137
+ * account: privateKeyToAccount('0x...')
1138
+ * })
1139
+ *
1140
+ * const result = await client.token.pauseSync({
1141
+ * token: '0x...',
1142
+ * })
1143
+ * ```
1144
+ *
1145
+ * @param client - Client.
1146
+ * @param parameters - Parameters.
1147
+ * @returns The transaction receipt and event data.
1148
+ */
1149
+ pauseSync: (parameters: tokenActions.pauseSync.Parameters<chain, account>) => Promise<tokenActions.pauseSync.ReturnValue>;
1150
+ /**
1151
+ * Approves a spender using a signed permit.
1152
+ *
1153
+ * @example
1154
+ * ```ts
1155
+ * import { createTempoClient } from 'tempo.ts/viem'
1156
+ * import { privateKeyToAccount } from 'viem/accounts'
1157
+ *
1158
+ * const client = createTempoClient({
1159
+ * account: privateKeyToAccount('0x...')
1160
+ * })
1161
+ *
1162
+ * const hash = await client.token.permit({
1163
+ * owner: '0x...',
1164
+ * spender: '0x...',
1165
+ * value: 100n,
1166
+ * deadline: 1234567890n,
1167
+ * signature: { r: 0n, s: 0n, yParity: 0 },
1168
+ * })
1169
+ * ```
1170
+ *
1171
+ * @param client - Client.
1172
+ * @param parameters - Parameters.
1173
+ * @returns The transaction hash.
1174
+ */
1175
+ permit: (parameters: tokenActions.permit.Parameters<chain, account>) => Promise<tokenActions.permit.ReturnValue>;
1176
+ /**
1177
+ * Approves a spender using a signed permit.
1178
+ *
1179
+ * @example
1180
+ * ```ts
1181
+ * import { createTempoClient } from 'tempo.ts/viem'
1182
+ * import { privateKeyToAccount } from 'viem/accounts'
1183
+ *
1184
+ * const client = createTempoClient({
1185
+ * account: privateKeyToAccount('0x...')
1186
+ * })
1187
+ *
1188
+ * const result = await client.token.permitSync({
1189
+ * owner: '0x...',
1190
+ * spender: '0x...',
1191
+ * value: 100n,
1192
+ * deadline: 1234567890n,
1193
+ * signature: { r: 0n, s: 0n, yParity: 0 },
1194
+ * })
1195
+ * ```
1196
+ *
1197
+ * @param client - Client.
1198
+ * @param parameters - Parameters.
1199
+ * @returns The transaction receipt and event data.
1200
+ */
1201
+ permitSync: (parameters: tokenActions.permitSync.Parameters<chain, account>) => Promise<tokenActions.permitSync.ReturnValue>;
1202
+ /**
1203
+ * Renounces a role for a TIP20 token.
1204
+ *
1205
+ * @example
1206
+ * ```ts
1207
+ * import { createTempoClient } from 'tempo.ts/viem'
1208
+ * import { privateKeyToAccount } from 'viem/accounts'
1209
+ *
1210
+ * const client = createTempoClient({
1211
+ * account: privateKeyToAccount('0x...')
1212
+ * })
1213
+ *
1214
+ * const hash = await client.token.renounceRoles({
1215
+ * token: '0x...',
1216
+ * roles: ['minter'],
1217
+ * })
1218
+ * ```
1219
+ *
1220
+ * @param client - Client.
1221
+ * @param parameters - Parameters.
1222
+ * @returns The transaction hash.
1223
+ */
1224
+ renounceRoles: (parameters: tokenActions.renounceRoles.Parameters<chain, account>) => Promise<tokenActions.renounceRoles.ReturnValue>;
1225
+ /**
1226
+ * Renounces a role for a TIP20 token.
1227
+ *
1228
+ * @example
1229
+ * ```ts
1230
+ * import { createTempoClient } from 'tempo.ts/viem'
1231
+ * import { tempo } from 'tempo.ts/chains'
1232
+ * import { http } from 'viem'
1233
+ * import { privateKeyToAccount } from 'viem/accounts'
1234
+ *
1235
+ * const client = createTempoClient({
1236
+ * account: privateKeyToAccount('0x...'),
1237
+ * chain: tempo,
1238
+ * transport: http(),
1239
+ * })
1240
+ *
1241
+ * const result = await client.token.renounceRolesSync({
1242
+ * token: '0x...',
1243
+ * roles: ['minter'],
1244
+ * })
1245
+ * ```
1246
+ *
1247
+ * @param parameters - Parameters.
1248
+ * @returns The transaction receipt and event data.
1249
+ */
1250
+ renounceRolesSync: (parameters: tokenActions.renounceRolesSync.Parameters<chain, account>) => Promise<tokenActions.renounceRolesSync.ReturnValue>;
1251
+ /**
1252
+ * Revokes a role for a TIP20 token.
1253
+ *
1254
+ * @example
1255
+ * ```ts
1256
+ * import { createTempoClient } from 'tempo.ts/viem'
1257
+ * import { privateKeyToAccount } from 'viem/accounts'
1258
+ *
1259
+ * const client = createTempoClient({
1260
+ * account: privateKeyToAccount('0x...')
1261
+ * })
1262
+ *
1263
+ * const hash = await client.token.revokeRoles({
1264
+ * token: '0x...',
1265
+ * from: '0x...',
1266
+ * roles: ['minter'],
1267
+ * })
1268
+ * ```
1269
+ *
1270
+ * @param client - Client.
1271
+ * @param parameters - Parameters.
1272
+ * @returns The transaction hash.
1273
+ */
1274
+ revokeRoles: (parameters: tokenActions.revokeRoles.Parameters<chain, account>) => Promise<tokenActions.revokeRoles.ReturnValue>;
1275
+ /**
1276
+ * Revokes a role for a TIP20 token.
1277
+ *
1278
+ * @example
1279
+ * ```ts
1280
+ * import { createTempoClient } from 'tempo.ts/viem'
1281
+ * import { tempo } from 'tempo.ts/chains'
1282
+ * import { http } from 'viem'
1283
+ * import { privateKeyToAccount } from 'viem/accounts'
1284
+ *
1285
+ * const client = createTempoClient({
1286
+ * account: privateKeyToAccount('0x...'),
1287
+ * chain: tempo,
1288
+ * transport: http(),
1289
+ * })
1290
+ *
1291
+ * const result = await client.token.revokeRolesSync({
1292
+ * token: '0x...',
1293
+ * from: '0x...',
1294
+ * roles: ['minter'],
1295
+ * })
1296
+ * ```
1297
+ *
1298
+ * @param parameters - Parameters.
1299
+ * @returns The transaction receipt and event data.
1300
+ */
1301
+ revokeRolesSync: (parameters: tokenActions.revokeRolesSync.Parameters<chain, account>) => Promise<tokenActions.revokeRolesSync.ReturnValue>;
1302
+ /**
1303
+ * Sets the supply cap for a TIP20 token.
1304
+ *
1305
+ * @example
1306
+ * ```ts
1307
+ * import { createTempoClient } from 'tempo.ts/viem'
1308
+ * import { privateKeyToAccount } from 'viem/accounts'
1309
+ *
1310
+ * const client = createTempoClient({
1311
+ * account: privateKeyToAccount('0x...')
1312
+ * })
1313
+ *
1314
+ * const hash = await client.token.setSupplyCap({
1315
+ * token: '0x...',
1316
+ * supplyCap: 1000000n,
1317
+ * })
1318
+ * ```
1319
+ *
1320
+ * @param client - Client.
1321
+ * @param parameters - Parameters.
1322
+ * @returns The transaction hash.
1323
+ */
1324
+ setSupplyCap: (parameters: tokenActions.setSupplyCap.Parameters<chain, account>) => Promise<tokenActions.setSupplyCap.ReturnValue>;
1325
+ /**
1326
+ * Sets the supply cap for a TIP20 token.
1327
+ *
1328
+ * @example
1329
+ * ```ts
1330
+ * import { createTempoClient } from 'tempo.ts/viem'
1331
+ * import { privateKeyToAccount } from 'viem/accounts'
1332
+ *
1333
+ * const client = createTempoClient({
1334
+ * account: privateKeyToAccount('0x...')
1335
+ * })
1336
+ *
1337
+ * const result = await client.token.setSupplyCapSync({
1338
+ * token: '0x...',
1339
+ * supplyCap: 1000000n,
1340
+ * })
1341
+ * ```
1342
+ *
1343
+ * @param client - Client.
1344
+ * @param parameters - Parameters.
1345
+ * @returns The transaction receipt and event data.
1346
+ */
1347
+ setSupplyCapSync: (parameters: tokenActions.setSupplyCapSync.Parameters<chain, account>) => Promise<tokenActions.setSupplyCapSync.ReturnValue>;
1348
+ /**
1349
+ * Sets the admin role for a specific role in a TIP20 token.
1350
+ *
1351
+ * @example
1352
+ * ```ts
1353
+ * import { createTempoClient } from 'tempo.ts/viem'
1354
+ * import { privateKeyToAccount } from 'viem/accounts'
1355
+ *
1356
+ * const client = createTempoClient({
1357
+ * account: privateKeyToAccount('0x...')
1358
+ * })
1359
+ *
1360
+ * const hash = await client.token.setRoleAdmin({
1361
+ * token: '0x...',
1362
+ * role: 'minter',
1363
+ * adminRole: 'admin',
1364
+ * })
1365
+ * ```
1366
+ *
1367
+ * @param client - Client.
1368
+ * @param parameters - Parameters.
1369
+ * @returns The transaction hash.
1370
+ */
1371
+ setRoleAdmin: (parameters: tokenActions.setRoleAdmin.Parameters<chain, account>) => Promise<tokenActions.setRoleAdmin.ReturnValue>;
1372
+ /**
1373
+ * Sets the admin role for a specific role in a TIP20 token.
1374
+ *
1375
+ * @example
1376
+ * ```ts
1377
+ * import { createTempoClient } from 'tempo.ts/viem'
1378
+ * import { privateKeyToAccount } from 'viem/accounts'
1379
+ *
1380
+ * const client = createTempoClient({
1381
+ * account: privateKeyToAccount('0x...')
1382
+ * })
1383
+ *
1384
+ * const result = await client.token.setRoleAdminSync({
1385
+ * token: '0x...',
1386
+ * role: 'minter',
1387
+ * adminRole: 'admin',
1388
+ * })
1389
+ * ```
1390
+ *
1391
+ * @param client - Client.
1392
+ * @param parameters - Parameters.
1393
+ * @returns The transaction receipt and event data.
1394
+ */
1395
+ setRoleAdminSync: (parameters: tokenActions.setRoleAdminSync.Parameters<chain, account>) => Promise<tokenActions.setRoleAdminSync.ReturnValue>;
1396
+ /**
1397
+ * Transfers TIP20 tokens to another address.
1398
+ *
1399
+ * @example
1400
+ * ```ts
1401
+ * import { createTempoClient } from 'tempo.ts/viem'
1402
+ * import { privateKeyToAccount } from 'viem/accounts'
1403
+ *
1404
+ * const client = createTempoClient({
1405
+ * account: privateKeyToAccount('0x...')
1406
+ * })
1407
+ *
1408
+ * const hash = await client.token.transfer({
1409
+ * to: '0x...',
1410
+ * amount: 100n,
1411
+ * })
1412
+ * ```
1413
+ *
1414
+ * @param client - Client.
1415
+ * @param parameters - Parameters.
1416
+ * @returns The transaction hash.
1417
+ */
1418
+ transfer: (parameters: tokenActions.transfer.Parameters<chain, account>) => Promise<tokenActions.transfer.ReturnValue>;
1419
+ /**
1420
+ * Transfers TIP20 tokens to another address.
1421
+ *
1422
+ * @example
1423
+ * ```ts
1424
+ * import { createTempoClient } from 'tempo.ts/viem'
1425
+ * import { privateKeyToAccount } from 'viem/accounts'
1426
+ *
1427
+ * const client = createTempoClient({
1428
+ * account: privateKeyToAccount('0x...')
1429
+ * })
1430
+ *
1431
+ * const result = await client.token.transferSync({
1432
+ * to: '0x...',
1433
+ * amount: 100n,
1434
+ * })
1435
+ * ```
1436
+ *
1437
+ * @param client - Client.
1438
+ * @param parameters - Parameters.
1439
+ * @returns The transaction receipt and event data.
1440
+ */
1441
+ transferSync: (parameters: tokenActions.transferSync.Parameters<chain, account>) => Promise<tokenActions.transferSync.ReturnValue>;
1442
+ /**
1443
+ * Unpauses a TIP20 token.
1444
+ *
1445
+ * @example
1446
+ * ```ts
1447
+ * import { createTempoClient } from 'tempo.ts/viem'
1448
+ * import { privateKeyToAccount } from 'viem/accounts'
1449
+ *
1450
+ * const client = createTempoClient({
1451
+ * account: privateKeyToAccount('0x...')
1452
+ * })
1453
+ *
1454
+ * const hash = await client.token.unpause({
1455
+ * token: '0x...',
1456
+ * })
1457
+ * ```
1458
+ *
1459
+ * @param client - Client.
1460
+ * @param parameters - Parameters.
1461
+ * @returns The transaction hash.
1462
+ */
1463
+ unpause: (parameters: tokenActions.unpause.Parameters<chain, account>) => Promise<tokenActions.unpause.ReturnValue>;
1464
+ /**
1465
+ * Unpauses a TIP20 token.
1466
+ *
1467
+ * @example
1468
+ * ```ts
1469
+ * import { createTempoClient } from 'tempo.ts/viem'
1470
+ * import { privateKeyToAccount } from 'viem/accounts'
1471
+ *
1472
+ * const client = createTempoClient({
1473
+ * account: privateKeyToAccount('0x...')
1474
+ * })
1475
+ *
1476
+ * const result = await client.token.unpauseSync({
1477
+ * token: '0x...',
1478
+ * })
1479
+ * ```
1480
+ *
1481
+ * @param client - Client.
1482
+ * @param parameters - Parameters.
1483
+ * @returns The transaction receipt and event data.
1484
+ */
1485
+ unpauseSync: (parameters: tokenActions.unpauseSync.Parameters<chain, account>) => Promise<tokenActions.unpauseSync.ReturnValue>;
1486
+ /**
1487
+ * Watches for TIP20 token approval events.
1488
+ *
1489
+ * @example
1490
+ * ```ts
1491
+ * import { createTempoClient } from 'tempo.ts/viem'
1492
+ *
1493
+ * const client = createTempoClient()
1494
+ *
1495
+ * const unwatch = client.token.watchApprove({
1496
+ * onApproval: (args, log) => {
1497
+ * console.log('Approval:', args)
1498
+ * },
1499
+ * })
1500
+ * ```
1501
+ *
1502
+ * @param client - Client.
1503
+ * @param parameters - Parameters.
1504
+ * @returns A function to unsubscribe from the event.
1505
+ */
1506
+ watchApprove: (parameters: tokenActions.watchApprove.Parameters) => () => void;
1507
+ /**
1508
+ * Watches for TIP20 token burn events.
1509
+ *
1510
+ * @example
1511
+ * ```ts
1512
+ * import { createTempoClient } from 'tempo.ts/viem'
1513
+ *
1514
+ * const client = createTempoClient()
1515
+ *
1516
+ * const unwatch = client.token.watchBurn({
1517
+ * onBurn: (args, log) => {
1518
+ * console.log('Burn:', args)
1519
+ * },
1520
+ * })
1521
+ * ```
1522
+ *
1523
+ * @param client - Client.
1524
+ * @param parameters - Parameters.
1525
+ * @returns A function to unsubscribe from the event.
1526
+ */
1527
+ watchBurn: (parameters: tokenActions.watchBurn.Parameters) => () => void;
1528
+ /**
1529
+ * Watches for new TIP20 tokens created.
1530
+ *
1531
+ * @example
1532
+ * ```ts
1533
+ * import { createTempoClient } from 'tempo.ts/viem'
1534
+ *
1535
+ * const client = createTempoClient()
1536
+ *
1537
+ * const unwatch = client.token.watchCreate({
1538
+ * onTokenCreated: (args, log) => {
1539
+ * console.log('Token created:', args)
1540
+ * },
1541
+ * })
1542
+ * ```
1543
+ *
1544
+ * @param client - Client.
1545
+ * @param parameters - Parameters.
1546
+ * @returns A function to unsubscribe from the event.
1547
+ */
1548
+ watchCreate: (parameters: tokenActions.watchCreate.Parameters) => () => void;
1549
+ /**
1550
+ * Watches for TIP20 token mint events.
1551
+ *
1552
+ * @example
1553
+ * ```ts
1554
+ * import { createTempoClient } from 'tempo.ts/viem'
1555
+ *
1556
+ * const client = createTempoClient()
1557
+ *
1558
+ * const unwatch = client.token.watchMint({
1559
+ * onMint: (args, log) => {
1560
+ * console.log('Mint:', args)
1561
+ * },
1562
+ * })
1563
+ * ```
1564
+ *
1565
+ * @param client - Client.
1566
+ * @param parameters - Parameters.
1567
+ * @returns A function to unsubscribe from the event.
1568
+ */
1569
+ watchMint: (parameters: tokenActions.watchMint.Parameters) => () => void;
1570
+ /**
1571
+ * Watches for TIP20 token role admin updates.
1572
+ *
1573
+ * @example
1574
+ * ```ts
1575
+ * import { createTempoClient } from 'tempo.ts/viem'
1576
+ *
1577
+ * const client = createTempoClient()
1578
+ *
1579
+ * const unwatch = client.token.watchAdminRole({
1580
+ * onRoleAdminUpdated: (args, log) => {
1581
+ * console.log('Role admin updated:', args)
1582
+ * },
1583
+ * })
1584
+ * ```
1585
+ *
1586
+ * @param client - Client.
1587
+ * @param parameters - Parameters.
1588
+ * @returns A function to unsubscribe from the event.
1589
+ */
1590
+ watchAdminRole: (parameters: tokenActions.watchAdminRole.Parameters) => () => void;
1591
+ /**
1592
+ * Watches for TIP20 token role membership updates.
1593
+ *
1594
+ * @example
1595
+ * ```ts
1596
+ * import { createTempoClient } from 'tempo.ts/viem'
1597
+ *
1598
+ * const client = createTempoClient()
1599
+ *
1600
+ * const unwatch = client.token.watchRole({
1601
+ * onRoleUpdated: (args, log) => {
1602
+ * console.log('Role updated:', args)
1603
+ * },
1604
+ * })
1605
+ * ```
1606
+ *
1607
+ * @param client - Client.
1608
+ * @param parameters - Parameters.
1609
+ * @returns A function to unsubscribe from the event.
1610
+ */
1611
+ watchRole: (parameters: tokenActions.watchRole.Parameters) => () => void;
1612
+ /**
1613
+ * Watches for TIP20 token transfer events.
1614
+ *
1615
+ * @example
1616
+ * ```ts
1617
+ * import { createTempoClient } from 'tempo.ts/viem'
1618
+ *
1619
+ * const client = createTempoClient()
1620
+ *
1621
+ * const unwatch = client.token.watchTransfer({
1622
+ * onTransfer: (args, log) => {
1623
+ * console.log('Transfer:', args)
1624
+ * },
1625
+ * })
1626
+ * ```
1627
+ *
1628
+ * @param client - Client.
1629
+ * @param parameters - Parameters.
1630
+ * @returns A function to unsubscribe from the event.
1631
+ */
1632
+ watchTransfer: (parameters: tokenActions.watchTransfer.Parameters) => () => void;
1633
+ };
1634
+ };
1635
+ export declare function decorator(): <transport extends Transport, chain extends Chain | undefined, account extends Account | undefined>(client: Client<transport, chain, account>) => Decorator<chain, account>;
1636
+ //# sourceMappingURL=decorator.d.ts.map