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,727 @@
1
+ import { type Account, type Address, type Chain, type Client, type ExtractAbiItem, type GetEventArgs, type Log, type TransactionReceipt, type Transport, type Log as viem_Log, type WatchContractEventParameters, type WriteContractReturnType } from 'viem';
2
+ import { writeContract, writeContractSync } from 'viem/actions';
3
+ import type { Compute, UnionOmit } from "../../internal/types.js";
4
+ import * as TokenId from "../../ox/TokenId.js";
5
+ import { feeManagerAbi } from "../abis.js";
6
+ import type { GetAccountParameter, ReadParameters, WriteParameters } from "../types.js";
7
+ /**
8
+ * Gets the user's default fee token.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createClient, http } from 'viem'
13
+ * import { tempo } from 'tempo.ts/chains'
14
+ * import * as actions from 'tempo.ts/viem/actions'
15
+ * import { privateKeyToAccount } from 'viem/accounts'
16
+ *
17
+ * const client = createClient({
18
+ * account: privateKeyToAccount('0x...'),
19
+ * chain: tempo,
20
+ * transport: http(),
21
+ * })
22
+ *
23
+ * const { address, id } = await actions.fee.getUserToken(client)
24
+ * ```
25
+ *
26
+ * @param client - Client.
27
+ * @param parameters - Parameters.
28
+ * @returns The transaction hash.
29
+ */
30
+ export declare function getUserToken<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, ...parameters: account extends Account ? [getUserToken.Parameters<account>] | [] : [getUserToken.Parameters<account>]): Promise<getUserToken.ReturnValue>;
31
+ export declare namespace getUserToken {
32
+ type Parameters<account extends Account | undefined = Account | undefined> = ReadParameters & GetAccountParameter<account>;
33
+ type Args = {
34
+ /** Account address. */
35
+ account: Address;
36
+ };
37
+ type ReturnValue = Compute<{
38
+ address: Address;
39
+ id: bigint;
40
+ }>;
41
+ /**
42
+ * Defines a call to the `userTokens` function.
43
+ *
44
+ * @param args - Arguments.
45
+ * @returns The call.
46
+ */
47
+ function call(args: Args): {
48
+ abi: [{
49
+ readonly type: "function";
50
+ readonly name: "userTokens";
51
+ readonly inputs: readonly [{
52
+ readonly name: "";
53
+ readonly type: "address";
54
+ readonly internalType: "address";
55
+ }];
56
+ readonly outputs: readonly [{
57
+ readonly name: "";
58
+ readonly type: "address";
59
+ readonly internalType: "address";
60
+ }];
61
+ readonly stateMutability: "view";
62
+ }];
63
+ functionName: "userTokens";
64
+ args?: readonly [`0x${string}`] | undefined;
65
+ } & {
66
+ args: readonly [`0x${string}`];
67
+ } & {
68
+ address: Address;
69
+ } & {
70
+ data: import("viem").Hex;
71
+ to: Address;
72
+ };
73
+ }
74
+ /**
75
+ * Sets the user's default fee token.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * import { createClient, http } from 'viem'
80
+ * import { tempo } from 'tempo.ts/chains'
81
+ * import * as actions from 'tempo.ts/viem/actions'
82
+ * import { privateKeyToAccount } from 'viem/accounts'
83
+ *
84
+ * const client = createClient({
85
+ * account: privateKeyToAccount('0x...'),
86
+ * chain: tempo,
87
+ * transport: http(),
88
+ * })
89
+ *
90
+ * const hash = await actions.fee.setUserToken(client, {
91
+ * token: '0x...',
92
+ * })
93
+ * ```
94
+ *
95
+ * @param client - Client.
96
+ * @param parameters - Parameters.
97
+ * @returns The transaction hash.
98
+ */
99
+ export declare function setUserToken<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: setUserToken.Parameters<chain, account>): Promise<setUserToken.ReturnValue>;
100
+ export declare namespace setUserToken {
101
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
102
+ type Args = {
103
+ /** Address or ID of the TIP20 token. */
104
+ token: TokenId.TokenIdOrAddress;
105
+ };
106
+ type ReturnValue = WriteContractReturnType;
107
+ /** @internal */
108
+ function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: setUserToken.Parameters<chain, account>): Promise<ReturnType<action>>;
109
+ /**
110
+ * Defines a call to the `setUserToken` function.
111
+ *
112
+ * Can be passed as a parameter to:
113
+ * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
114
+ * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
115
+ * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * import { createClient, http, walletActions } from 'viem'
120
+ * import { tempo } from 'tempo.ts/chains'
121
+ * import * as actions from 'tempo.ts/viem/actions'
122
+ *
123
+ * const client = createClient({
124
+ * chain: tempo,
125
+ * transport: http(),
126
+ * }).extend(walletActions)
127
+ *
128
+ * const { result } = await client.sendCalls({
129
+ * calls: [
130
+ * actions.fee.setUserToken.call({
131
+ * token: '0x20c0...beef',
132
+ * }),
133
+ * actions.fee.setUserToken.call({
134
+ * token: '0x20c0...babe',
135
+ * }),
136
+ * ]
137
+ * })
138
+ * ```
139
+ *
140
+ * @param args - Arguments.
141
+ * @returns The call.
142
+ */
143
+ function call(args: Args): {
144
+ abi: [{
145
+ readonly type: "function";
146
+ readonly name: "setUserToken";
147
+ readonly inputs: readonly [{
148
+ readonly name: "token";
149
+ readonly type: "address";
150
+ readonly internalType: "address";
151
+ }];
152
+ readonly outputs: readonly [];
153
+ readonly stateMutability: "nonpayable";
154
+ }];
155
+ functionName: "setUserToken";
156
+ args?: readonly [`0x${string}`] | undefined;
157
+ } & {
158
+ args: readonly [`0x${string}`];
159
+ } & {
160
+ address: Address;
161
+ } & {
162
+ data: import("viem").Hex;
163
+ to: Address;
164
+ };
165
+ function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
166
+ readonly type: "constructor";
167
+ readonly inputs: readonly [];
168
+ readonly stateMutability: "nonpayable";
169
+ }, {
170
+ readonly type: "function";
171
+ readonly name: "M";
172
+ readonly inputs: readonly [];
173
+ readonly outputs: readonly [{
174
+ readonly name: "";
175
+ readonly type: "uint256";
176
+ readonly internalType: "uint256";
177
+ }];
178
+ readonly stateMutability: "view";
179
+ }, {
180
+ readonly type: "function";
181
+ readonly name: "MIN_LIQUIDITY";
182
+ readonly inputs: readonly [];
183
+ readonly outputs: readonly [{
184
+ readonly name: "";
185
+ readonly type: "uint256";
186
+ readonly internalType: "uint256";
187
+ }];
188
+ readonly stateMutability: "view";
189
+ }, {
190
+ readonly type: "function";
191
+ readonly name: "N";
192
+ readonly inputs: readonly [];
193
+ readonly outputs: readonly [{
194
+ readonly name: "";
195
+ readonly type: "uint256";
196
+ readonly internalType: "uint256";
197
+ }];
198
+ readonly stateMutability: "view";
199
+ }, {
200
+ readonly type: "function";
201
+ readonly name: "SCALE";
202
+ readonly inputs: readonly [];
203
+ readonly outputs: readonly [{
204
+ readonly name: "";
205
+ readonly type: "uint256";
206
+ readonly internalType: "uint256";
207
+ }];
208
+ readonly stateMutability: "view";
209
+ }, {
210
+ readonly type: "function";
211
+ readonly name: "burn";
212
+ readonly inputs: readonly [{
213
+ readonly name: "userToken";
214
+ readonly type: "address";
215
+ readonly internalType: "address";
216
+ }, {
217
+ readonly name: "validatorToken";
218
+ readonly type: "address";
219
+ readonly internalType: "address";
220
+ }, {
221
+ readonly name: "liquidity";
222
+ readonly type: "uint256";
223
+ readonly internalType: "uint256";
224
+ }, {
225
+ readonly name: "to";
226
+ readonly type: "address";
227
+ readonly internalType: "address";
228
+ }];
229
+ readonly outputs: readonly [{
230
+ readonly name: "amountUserToken";
231
+ readonly type: "uint256";
232
+ readonly internalType: "uint256";
233
+ }, {
234
+ readonly name: "amountValidatorToken";
235
+ readonly type: "uint256";
236
+ readonly internalType: "uint256";
237
+ }];
238
+ readonly stateMutability: "nonpayable";
239
+ }, {
240
+ readonly type: "function";
241
+ readonly name: "collectFeePostTx";
242
+ readonly inputs: readonly [{
243
+ readonly name: "user";
244
+ readonly type: "address";
245
+ readonly internalType: "address";
246
+ }, {
247
+ readonly name: "maxAmount";
248
+ readonly type: "uint256";
249
+ readonly internalType: "uint256";
250
+ }, {
251
+ readonly name: "actualUsed";
252
+ readonly type: "uint256";
253
+ readonly internalType: "uint256";
254
+ }, {
255
+ readonly name: "userToken";
256
+ readonly type: "address";
257
+ readonly internalType: "address";
258
+ }, {
259
+ readonly name: "validatorToken";
260
+ readonly type: "address";
261
+ readonly internalType: "address";
262
+ }];
263
+ readonly outputs: readonly [];
264
+ readonly stateMutability: "nonpayable";
265
+ }, {
266
+ readonly type: "function";
267
+ readonly name: "collectFeePreTx";
268
+ readonly inputs: readonly [{
269
+ readonly name: "user";
270
+ readonly type: "address";
271
+ readonly internalType: "address";
272
+ }, {
273
+ readonly name: "txToAddress";
274
+ readonly type: "address";
275
+ readonly internalType: "address";
276
+ }, {
277
+ readonly name: "maxAmount";
278
+ readonly type: "uint256";
279
+ readonly internalType: "uint256";
280
+ }];
281
+ readonly outputs: readonly [{
282
+ readonly name: "userToken";
283
+ readonly type: "address";
284
+ readonly internalType: "address";
285
+ }];
286
+ readonly stateMutability: "nonpayable";
287
+ }, {
288
+ readonly type: "function";
289
+ readonly name: "executeBlock";
290
+ readonly inputs: readonly [];
291
+ readonly outputs: readonly [];
292
+ readonly stateMutability: "nonpayable";
293
+ }, {
294
+ readonly type: "function";
295
+ readonly name: "getPool";
296
+ readonly inputs: readonly [{
297
+ readonly name: "userToken";
298
+ readonly type: "address";
299
+ readonly internalType: "address";
300
+ }, {
301
+ readonly name: "validatorToken";
302
+ readonly type: "address";
303
+ readonly internalType: "address";
304
+ }];
305
+ readonly outputs: readonly [{
306
+ readonly name: "";
307
+ readonly type: "tuple";
308
+ readonly internalType: "struct FeeAMM.Pool";
309
+ readonly components: readonly [{
310
+ readonly name: "reserveUserToken";
311
+ readonly type: "uint128";
312
+ readonly internalType: "uint128";
313
+ }, {
314
+ readonly name: "reserveValidatorToken";
315
+ readonly type: "uint128";
316
+ readonly internalType: "uint128";
317
+ }];
318
+ }];
319
+ readonly stateMutability: "view";
320
+ }, {
321
+ readonly type: "function";
322
+ readonly name: "getPoolId";
323
+ readonly inputs: readonly [{
324
+ readonly name: "userToken";
325
+ readonly type: "address";
326
+ readonly internalType: "address";
327
+ }, {
328
+ readonly name: "validatorToken";
329
+ readonly type: "address";
330
+ readonly internalType: "address";
331
+ }];
332
+ readonly outputs: readonly [{
333
+ readonly name: "";
334
+ readonly type: "bytes32";
335
+ readonly internalType: "bytes32";
336
+ }];
337
+ readonly stateMutability: "pure";
338
+ }, {
339
+ readonly type: "function";
340
+ readonly name: "liquidityBalances";
341
+ readonly inputs: readonly [{
342
+ readonly name: "";
343
+ readonly type: "bytes32";
344
+ readonly internalType: "bytes32";
345
+ }, {
346
+ readonly name: "";
347
+ readonly type: "address";
348
+ readonly internalType: "address";
349
+ }];
350
+ readonly outputs: readonly [{
351
+ readonly name: "";
352
+ readonly type: "uint256";
353
+ readonly internalType: "uint256";
354
+ }];
355
+ readonly stateMutability: "view";
356
+ }, {
357
+ readonly type: "function";
358
+ readonly name: "mint";
359
+ readonly inputs: readonly [{
360
+ readonly name: "userToken";
361
+ readonly type: "address";
362
+ readonly internalType: "address";
363
+ }, {
364
+ readonly name: "validatorToken";
365
+ readonly type: "address";
366
+ readonly internalType: "address";
367
+ }, {
368
+ readonly name: "amountUserToken";
369
+ readonly type: "uint256";
370
+ readonly internalType: "uint256";
371
+ }, {
372
+ readonly name: "amountValidatorToken";
373
+ readonly type: "uint256";
374
+ readonly internalType: "uint256";
375
+ }, {
376
+ readonly name: "to";
377
+ readonly type: "address";
378
+ readonly internalType: "address";
379
+ }];
380
+ readonly outputs: readonly [{
381
+ readonly name: "liquidity";
382
+ readonly type: "uint256";
383
+ readonly internalType: "uint256";
384
+ }];
385
+ readonly stateMutability: "nonpayable";
386
+ }, {
387
+ readonly type: "function";
388
+ readonly name: "pools";
389
+ readonly inputs: readonly [{
390
+ readonly name: "";
391
+ readonly type: "bytes32";
392
+ readonly internalType: "bytes32";
393
+ }];
394
+ readonly outputs: readonly [{
395
+ readonly name: "reserveUserToken";
396
+ readonly type: "uint128";
397
+ readonly internalType: "uint128";
398
+ }, {
399
+ readonly name: "reserveValidatorToken";
400
+ readonly type: "uint128";
401
+ readonly internalType: "uint128";
402
+ }];
403
+ readonly stateMutability: "view";
404
+ }, {
405
+ readonly type: "function";
406
+ readonly name: "rebalanceSwap";
407
+ readonly inputs: readonly [{
408
+ readonly name: "userToken";
409
+ readonly type: "address";
410
+ readonly internalType: "address";
411
+ }, {
412
+ readonly name: "validatorToken";
413
+ readonly type: "address";
414
+ readonly internalType: "address";
415
+ }, {
416
+ readonly name: "amountOut";
417
+ readonly type: "uint256";
418
+ readonly internalType: "uint256";
419
+ }, {
420
+ readonly name: "to";
421
+ readonly type: "address";
422
+ readonly internalType: "address";
423
+ }];
424
+ readonly outputs: readonly [{
425
+ readonly name: "amountIn";
426
+ readonly type: "uint256";
427
+ readonly internalType: "uint256";
428
+ }];
429
+ readonly stateMutability: "nonpayable";
430
+ }, {
431
+ readonly type: "function";
432
+ readonly name: "setUserToken";
433
+ readonly inputs: readonly [{
434
+ readonly name: "token";
435
+ readonly type: "address";
436
+ readonly internalType: "address";
437
+ }];
438
+ readonly outputs: readonly [];
439
+ readonly stateMutability: "nonpayable";
440
+ }, {
441
+ readonly type: "function";
442
+ readonly name: "setValidatorToken";
443
+ readonly inputs: readonly [{
444
+ readonly name: "token";
445
+ readonly type: "address";
446
+ readonly internalType: "address";
447
+ }];
448
+ readonly outputs: readonly [];
449
+ readonly stateMutability: "nonpayable";
450
+ }, {
451
+ readonly type: "function";
452
+ readonly name: "totalSupply";
453
+ readonly inputs: readonly [{
454
+ readonly name: "";
455
+ readonly type: "bytes32";
456
+ readonly internalType: "bytes32";
457
+ }];
458
+ readonly outputs: readonly [{
459
+ readonly name: "";
460
+ readonly type: "uint256";
461
+ readonly internalType: "uint256";
462
+ }];
463
+ readonly stateMutability: "view";
464
+ }, {
465
+ readonly type: "function";
466
+ readonly name: "userTokens";
467
+ readonly inputs: readonly [{
468
+ readonly name: "";
469
+ readonly type: "address";
470
+ readonly internalType: "address";
471
+ }];
472
+ readonly outputs: readonly [{
473
+ readonly name: "";
474
+ readonly type: "address";
475
+ readonly internalType: "address";
476
+ }];
477
+ readonly stateMutability: "view";
478
+ }, {
479
+ readonly type: "function";
480
+ readonly name: "validatorTokens";
481
+ readonly inputs: readonly [{
482
+ readonly name: "";
483
+ readonly type: "address";
484
+ readonly internalType: "address";
485
+ }];
486
+ readonly outputs: readonly [{
487
+ readonly name: "";
488
+ readonly type: "address";
489
+ readonly internalType: "address";
490
+ }];
491
+ readonly stateMutability: "view";
492
+ }, {
493
+ readonly type: "event";
494
+ readonly name: "Burn";
495
+ readonly inputs: readonly [{
496
+ readonly name: "sender";
497
+ readonly type: "address";
498
+ readonly indexed: true;
499
+ readonly internalType: "address";
500
+ }, {
501
+ readonly name: "userToken";
502
+ readonly type: "address";
503
+ readonly indexed: true;
504
+ readonly internalType: "address";
505
+ }, {
506
+ readonly name: "validatorToken";
507
+ readonly type: "address";
508
+ readonly indexed: true;
509
+ readonly internalType: "address";
510
+ }, {
511
+ readonly name: "amountUserToken";
512
+ readonly type: "uint256";
513
+ readonly indexed: false;
514
+ readonly internalType: "uint256";
515
+ }, {
516
+ readonly name: "amountValidatorToken";
517
+ readonly type: "uint256";
518
+ readonly indexed: false;
519
+ readonly internalType: "uint256";
520
+ }, {
521
+ readonly name: "liquidity";
522
+ readonly type: "uint256";
523
+ readonly indexed: false;
524
+ readonly internalType: "uint256";
525
+ }, {
526
+ readonly name: "to";
527
+ readonly type: "address";
528
+ readonly indexed: false;
529
+ readonly internalType: "address";
530
+ }];
531
+ readonly anonymous: false;
532
+ }, {
533
+ readonly type: "event";
534
+ readonly name: "FeeSwap";
535
+ readonly inputs: readonly [{
536
+ readonly name: "userToken";
537
+ readonly type: "address";
538
+ readonly indexed: true;
539
+ readonly internalType: "address";
540
+ }, {
541
+ readonly name: "validatorToken";
542
+ readonly type: "address";
543
+ readonly indexed: true;
544
+ readonly internalType: "address";
545
+ }, {
546
+ readonly name: "amountIn";
547
+ readonly type: "uint256";
548
+ readonly indexed: false;
549
+ readonly internalType: "uint256";
550
+ }, {
551
+ readonly name: "amountOut";
552
+ readonly type: "uint256";
553
+ readonly indexed: false;
554
+ readonly internalType: "uint256";
555
+ }];
556
+ readonly anonymous: false;
557
+ }, {
558
+ readonly type: "event";
559
+ readonly name: "Mint";
560
+ readonly inputs: readonly [{
561
+ readonly name: "sender";
562
+ readonly type: "address";
563
+ readonly indexed: true;
564
+ readonly internalType: "address";
565
+ }, {
566
+ readonly name: "userToken";
567
+ readonly type: "address";
568
+ readonly indexed: true;
569
+ readonly internalType: "address";
570
+ }, {
571
+ readonly name: "validatorToken";
572
+ readonly type: "address";
573
+ readonly indexed: true;
574
+ readonly internalType: "address";
575
+ }, {
576
+ readonly name: "amountUserToken";
577
+ readonly type: "uint256";
578
+ readonly indexed: false;
579
+ readonly internalType: "uint256";
580
+ }, {
581
+ readonly name: "amountValidatorToken";
582
+ readonly type: "uint256";
583
+ readonly indexed: false;
584
+ readonly internalType: "uint256";
585
+ }, {
586
+ readonly name: "liquidity";
587
+ readonly type: "uint256";
588
+ readonly indexed: false;
589
+ readonly internalType: "uint256";
590
+ }];
591
+ readonly anonymous: false;
592
+ }, {
593
+ readonly type: "event";
594
+ readonly name: "RebalanceSwap";
595
+ readonly inputs: readonly [{
596
+ readonly name: "userToken";
597
+ readonly type: "address";
598
+ readonly indexed: true;
599
+ readonly internalType: "address";
600
+ }, {
601
+ readonly name: "validatorToken";
602
+ readonly type: "address";
603
+ readonly indexed: true;
604
+ readonly internalType: "address";
605
+ }, {
606
+ readonly name: "swapper";
607
+ readonly type: "address";
608
+ readonly indexed: true;
609
+ readonly internalType: "address";
610
+ }, {
611
+ readonly name: "amountIn";
612
+ readonly type: "uint256";
613
+ readonly indexed: false;
614
+ readonly internalType: "uint256";
615
+ }, {
616
+ readonly name: "amountOut";
617
+ readonly type: "uint256";
618
+ readonly indexed: false;
619
+ readonly internalType: "uint256";
620
+ }];
621
+ readonly anonymous: false;
622
+ }, {
623
+ readonly type: "event";
624
+ readonly name: "UserTokenSet";
625
+ readonly inputs: readonly [{
626
+ readonly name: "user";
627
+ readonly type: "address";
628
+ readonly indexed: true;
629
+ readonly internalType: "address";
630
+ }, {
631
+ readonly name: "token";
632
+ readonly type: "address";
633
+ readonly indexed: true;
634
+ readonly internalType: "address";
635
+ }];
636
+ readonly anonymous: false;
637
+ }, {
638
+ readonly type: "event";
639
+ readonly name: "ValidatorTokenSet";
640
+ readonly inputs: readonly [{
641
+ readonly name: "validator";
642
+ readonly type: "address";
643
+ readonly indexed: true;
644
+ readonly internalType: "address";
645
+ }, {
646
+ readonly name: "token";
647
+ readonly type: "address";
648
+ readonly indexed: true;
649
+ readonly internalType: "address";
650
+ }];
651
+ readonly anonymous: false;
652
+ }], "UserTokenSet">;
653
+ }
654
+ /**
655
+ * Sets the user's default fee token.
656
+ *
657
+ * @example
658
+ * ```ts
659
+ * import { createClient, http } from 'viem'
660
+ * import { tempo } from 'tempo.ts/chains'
661
+ * import * as actions from 'tempo.ts/viem/actions'
662
+ * import { privateKeyToAccount } from 'viem/accounts'
663
+ *
664
+ * const client = createClient({
665
+ * account: privateKeyToAccount('0x...'),
666
+ * chain: tempo,
667
+ * transport: http(),
668
+ * })
669
+ *
670
+ * const result = await actions.fee.setUserTokenSync(client, {
671
+ * token: '0x...',
672
+ * })
673
+ * ```
674
+ *
675
+ * @param client - Client.
676
+ * @param parameters - Parameters.
677
+ * @returns The transaction receipt and event data.
678
+ */
679
+ export declare function setUserTokenSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: setUserTokenSync.Parameters<chain, account>): Promise<setUserTokenSync.ReturnValue>;
680
+ export declare namespace setUserTokenSync {
681
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = setUserToken.Parameters<chain, account>;
682
+ type Args = setUserToken.Args;
683
+ type ReturnValue = Compute<GetEventArgs<typeof feeManagerAbi, 'UserTokenSet', {
684
+ IndexedOnly: false;
685
+ Required: true;
686
+ }> & {
687
+ receipt: TransactionReceipt;
688
+ }>;
689
+ }
690
+ /**
691
+ * Watches for user token set events.
692
+ *
693
+ * @example
694
+ * ```ts
695
+ * import { createClient, http } from 'viem'
696
+ * import { tempo } from 'tempo.ts/chains'
697
+ * import * as actions from 'tempo.ts/viem/actions'
698
+ *
699
+ * const client = createClient({
700
+ * chain: tempo,
701
+ * transport: http(),
702
+ * })
703
+ *
704
+ * const unwatch = actions.fee.watchSetUserToken(client, {
705
+ * onUserTokenSet: (args, log) => {
706
+ * console.log('User token set:', args)
707
+ * },
708
+ * })
709
+ * ```
710
+ *
711
+ * @param client - Client.
712
+ * @param parameters - Parameters.
713
+ * @returns A function to unsubscribe from the event.
714
+ */
715
+ export declare function watchSetUserToken<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchSetUserToken.Parameters): import("viem").WatchContractEventReturnType;
716
+ export declare namespace watchSetUserToken {
717
+ type Args = GetEventArgs<typeof feeManagerAbi, 'UserTokenSet', {
718
+ IndexedOnly: false;
719
+ Required: true;
720
+ }>;
721
+ type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof feeManagerAbi, 'UserTokenSet'>, true>;
722
+ type Parameters = UnionOmit<WatchContractEventParameters<typeof feeManagerAbi, 'UserTokenSet', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
723
+ /** Callback to invoke when a user token is set. */
724
+ onUserTokenSet: (args: Args, log: Log) => void;
725
+ };
726
+ }
727
+ //# sourceMappingURL=fee.d.ts.map