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