tempo.ts 0.0.1 → 0.0.3

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 (38) hide show
  1. package/dist/ox/TokenRole.d.ts +1 -1
  2. package/dist/ox/TokenRole.d.ts.map +1 -1
  3. package/dist/viem/abis.d.ts +763 -1454
  4. package/dist/viem/abis.d.ts.map +1 -1
  5. package/dist/viem/abis.js +486 -1224
  6. package/dist/viem/abis.js.map +1 -1
  7. package/dist/viem/actions/amm.d.ts +630 -715
  8. package/dist/viem/actions/amm.d.ts.map +1 -1
  9. package/dist/viem/actions/fee.d.ts +65 -418
  10. package/dist/viem/actions/fee.d.ts.map +1 -1
  11. package/dist/viem/actions/policy.d.ts +365 -593
  12. package/dist/viem/actions/policy.d.ts.map +1 -1
  13. package/dist/viem/actions/policy.js +9 -4
  14. package/dist/viem/actions/policy.js.map +1 -1
  15. package/dist/viem/actions/token.d.ts +4768 -7384
  16. package/dist/viem/actions/token.d.ts.map +1 -1
  17. package/dist/viem/actions/token.js +57 -4
  18. package/dist/viem/actions/token.js.map +1 -1
  19. package/dist/viem/decorator.d.ts +23 -0
  20. package/dist/viem/decorator.d.ts.map +1 -1
  21. package/dist/viem/decorator.js +1 -0
  22. package/dist/viem/decorator.js.map +1 -1
  23. package/dist/viem/index.d.ts +1 -0
  24. package/dist/viem/index.d.ts.map +1 -1
  25. package/dist/viem/index.js +1 -0
  26. package/dist/viem/index.js.map +1 -1
  27. package/package.json +2 -2
  28. package/src/ox/TokenRole.test.ts +0 -4
  29. package/src/ox/TokenRole.ts +1 -1
  30. package/src/ox/TransactionEnvelopeFeeToken.test.ts +6 -102
  31. package/src/viem/abis.ts +495 -1234
  32. package/src/viem/actions/policy.ts +9 -4
  33. package/src/viem/actions/token.test.ts +190 -0
  34. package/src/viem/actions/token.ts +82 -4
  35. package/src/viem/client.test.ts +1 -0
  36. package/src/viem/decorator.bench-d.ts +1 -1
  37. package/src/viem/decorator.ts +26 -0
  38. package/src/viem/index.ts +1 -0
package/src/viem/abis.ts CHANGED
@@ -1,1606 +1,867 @@
1
1
  // Generated with `bun run gen:abis`. Do not modify manually.
2
2
 
3
- import * as Abi from 'ox/Abi'
4
-
5
- export const feeAmmAbi = Abi.from([
6
- { type: 'constructor', inputs: [], stateMutability: 'nonpayable' },
3
+ export const tip20Abi = [
7
4
  {
5
+ name: 'name',
8
6
  type: 'function',
9
- name: 'M',
10
- inputs: [],
11
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
12
7
  stateMutability: 'view',
13
- },
14
- {
15
- type: 'function',
16
- name: 'MIN_LIQUIDITY',
17
8
  inputs: [],
18
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
19
- stateMutability: 'view',
9
+ outputs: [{ type: 'string' }],
20
10
  },
21
11
  {
12
+ name: 'symbol',
22
13
  type: 'function',
23
- name: 'N',
24
- inputs: [],
25
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
26
14
  stateMutability: 'view',
27
- },
28
- {
29
- type: 'function',
30
- name: 'SCALE',
31
15
  inputs: [],
32
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
33
- stateMutability: 'view',
34
- },
35
- {
36
- type: 'function',
37
- name: 'burn',
38
- inputs: [
39
- { name: 'userToken', type: 'address', internalType: 'address' },
40
- { name: 'validatorToken', type: 'address', internalType: 'address' },
41
- { name: 'liquidity', type: 'uint256', internalType: 'uint256' },
42
- { name: 'to', type: 'address', internalType: 'address' },
43
- ],
44
- outputs: [
45
- { name: 'amountUserToken', type: 'uint256', internalType: 'uint256' },
46
- {
47
- name: 'amountValidatorToken',
48
- type: 'uint256',
49
- internalType: 'uint256',
50
- },
51
- ],
52
- stateMutability: 'nonpayable',
16
+ outputs: [{ type: 'string' }],
53
17
  },
54
18
  {
19
+ name: 'decimals',
55
20
  type: 'function',
56
- name: 'getPool',
57
- inputs: [
58
- { name: 'userToken', type: 'address', internalType: 'address' },
59
- { name: 'validatorToken', type: 'address', internalType: 'address' },
60
- ],
61
- outputs: [
62
- {
63
- name: '',
64
- type: 'tuple',
65
- internalType: 'struct FeeAMM.Pool',
66
- components: [
67
- {
68
- name: 'reserveUserToken',
69
- type: 'uint128',
70
- internalType: 'uint128',
71
- },
72
- {
73
- name: 'reserveValidatorToken',
74
- type: 'uint128',
75
- internalType: 'uint128',
76
- },
77
- ],
78
- },
79
- ],
80
21
  stateMutability: 'view',
22
+ inputs: [],
23
+ outputs: [{ type: 'uint8' }],
81
24
  },
82
25
  {
26
+ name: 'totalSupply',
83
27
  type: 'function',
84
- name: 'getPoolId',
85
- inputs: [
86
- { name: 'userToken', type: 'address', internalType: 'address' },
87
- { name: 'validatorToken', type: 'address', internalType: 'address' },
88
- ],
89
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
90
- stateMutability: 'pure',
28
+ stateMutability: 'view',
29
+ inputs: [],
30
+ outputs: [{ type: 'uint256' }],
91
31
  },
92
32
  {
33
+ name: 'balanceOf',
93
34
  type: 'function',
94
- name: 'liquidityBalances',
95
- inputs: [
96
- { name: '', type: 'bytes32', internalType: 'bytes32' },
97
- { name: '', type: 'address', internalType: 'address' },
98
- ],
99
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
100
35
  stateMutability: 'view',
36
+ inputs: [{ type: 'address', name: 'account' }],
37
+ outputs: [{ type: 'uint256' }],
101
38
  },
102
39
  {
40
+ name: 'transfer',
103
41
  type: 'function',
104
- name: 'mint',
105
- inputs: [
106
- { name: 'userToken', type: 'address', internalType: 'address' },
107
- { name: 'validatorToken', type: 'address', internalType: 'address' },
108
- { name: 'amountUserToken', type: 'uint256', internalType: 'uint256' },
109
- {
110
- name: 'amountValidatorToken',
111
- type: 'uint256',
112
- internalType: 'uint256',
113
- },
114
- { name: 'to', type: 'address', internalType: 'address' },
115
- ],
116
- outputs: [{ name: 'liquidity', type: 'uint256', internalType: 'uint256' }],
117
42
  stateMutability: 'nonpayable',
118
- },
119
- {
120
- type: 'function',
121
- name: 'pools',
122
- inputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
123
- outputs: [
124
- { name: 'reserveUserToken', type: 'uint128', internalType: 'uint128' },
125
- {
126
- name: 'reserveValidatorToken',
127
- type: 'uint128',
128
- internalType: 'uint128',
129
- },
43
+ inputs: [
44
+ { type: 'address', name: 'to' },
45
+ { type: 'uint256', name: 'amount' },
130
46
  ],
131
- stateMutability: 'view',
47
+ outputs: [{ type: 'bool' }],
132
48
  },
133
49
  {
50
+ name: 'approve',
134
51
  type: 'function',
135
- name: 'rebalanceSwap',
52
+ stateMutability: 'nonpayable',
136
53
  inputs: [
137
- { name: 'userToken', type: 'address', internalType: 'address' },
138
- { name: 'validatorToken', type: 'address', internalType: 'address' },
139
- { name: 'amountOut', type: 'uint256', internalType: 'uint256' },
140
- { name: 'to', type: 'address', internalType: 'address' },
54
+ { type: 'address', name: 'spender' },
55
+ { type: 'uint256', name: 'amount' },
141
56
  ],
142
- outputs: [{ name: 'amountIn', type: 'uint256', internalType: 'uint256' }],
143
- stateMutability: 'nonpayable',
57
+ outputs: [{ type: 'bool' }],
144
58
  },
145
59
  {
60
+ name: 'allowance',
146
61
  type: 'function',
147
- name: 'totalSupply',
148
- inputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
149
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
150
62
  stateMutability: 'view',
151
- },
152
- {
153
- type: 'event',
154
- name: 'Burn',
155
63
  inputs: [
156
- {
157
- name: 'sender',
158
- type: 'address',
159
- indexed: true,
160
- internalType: 'address',
161
- },
162
- {
163
- name: 'userToken',
164
- type: 'address',
165
- indexed: true,
166
- internalType: 'address',
167
- },
168
- {
169
- name: 'validatorToken',
170
- type: 'address',
171
- indexed: true,
172
- internalType: 'address',
173
- },
174
- {
175
- name: 'amountUserToken',
176
- type: 'uint256',
177
- indexed: false,
178
- internalType: 'uint256',
179
- },
180
- {
181
- name: 'amountValidatorToken',
182
- type: 'uint256',
183
- indexed: false,
184
- internalType: 'uint256',
185
- },
186
- {
187
- name: 'liquidity',
188
- type: 'uint256',
189
- indexed: false,
190
- internalType: 'uint256',
191
- },
192
- { name: 'to', type: 'address', indexed: false, internalType: 'address' },
64
+ { type: 'address', name: 'owner' },
65
+ { type: 'address', name: 'spender' },
193
66
  ],
194
- anonymous: false,
67
+ outputs: [{ type: 'uint256' }],
195
68
  },
196
69
  {
197
- type: 'event',
198
- name: 'FeeSwap',
199
- inputs: [
200
- {
201
- name: 'userToken',
202
- type: 'address',
203
- indexed: true,
204
- internalType: 'address',
205
- },
206
- {
207
- name: 'validatorToken',
208
- type: 'address',
209
- indexed: true,
210
- internalType: 'address',
211
- },
212
- {
213
- name: 'amountIn',
214
- type: 'uint256',
215
- indexed: false,
216
- internalType: 'uint256',
217
- },
218
- {
219
- name: 'amountOut',
220
- type: 'uint256',
221
- indexed: false,
222
- internalType: 'uint256',
223
- },
224
- ],
225
- anonymous: false,
226
- },
227
- {
228
- type: 'event',
229
- name: 'Mint',
230
- inputs: [
231
- {
232
- name: 'sender',
233
- type: 'address',
234
- indexed: true,
235
- internalType: 'address',
236
- },
237
- {
238
- name: 'userToken',
239
- type: 'address',
240
- indexed: true,
241
- internalType: 'address',
242
- },
243
- {
244
- name: 'validatorToken',
245
- type: 'address',
246
- indexed: true,
247
- internalType: 'address',
248
- },
249
- {
250
- name: 'amountUserToken',
251
- type: 'uint256',
252
- indexed: false,
253
- internalType: 'uint256',
254
- },
255
- {
256
- name: 'amountValidatorToken',
257
- type: 'uint256',
258
- indexed: false,
259
- internalType: 'uint256',
260
- },
261
- {
262
- name: 'liquidity',
263
- type: 'uint256',
264
- indexed: false,
265
- internalType: 'uint256',
266
- },
267
- ],
268
- anonymous: false,
269
- },
270
- {
271
- type: 'event',
272
- name: 'RebalanceSwap',
273
- inputs: [
274
- {
275
- name: 'userToken',
276
- type: 'address',
277
- indexed: true,
278
- internalType: 'address',
279
- },
280
- {
281
- name: 'validatorToken',
282
- type: 'address',
283
- indexed: true,
284
- internalType: 'address',
285
- },
286
- {
287
- name: 'swapper',
288
- type: 'address',
289
- indexed: true,
290
- internalType: 'address',
291
- },
292
- {
293
- name: 'amountIn',
294
- type: 'uint256',
295
- indexed: false,
296
- internalType: 'uint256',
297
- },
298
- {
299
- name: 'amountOut',
300
- type: 'uint256',
301
- indexed: false,
302
- internalType: 'uint256',
303
- },
304
- ],
305
- anonymous: false,
306
- },
307
- ])
308
-
309
- export const tip20RolesAuthAbi = Abi.from([
310
- {
70
+ name: 'transferFrom',
311
71
  type: 'function',
312
- name: 'grantRole',
72
+ stateMutability: 'nonpayable',
313
73
  inputs: [
314
- { name: 'role', type: 'bytes32', internalType: 'bytes32' },
315
- { name: 'account', type: 'address', internalType: 'address' },
74
+ { type: 'address', name: 'from' },
75
+ { type: 'address', name: 'to' },
76
+ { type: 'uint256', name: 'amount' },
316
77
  ],
317
- outputs: [],
318
- stateMutability: 'nonpayable',
78
+ outputs: [{ type: 'bool' }],
319
79
  },
320
80
  {
81
+ name: 'mint',
321
82
  type: 'function',
322
- name: 'renounceRole',
323
- inputs: [{ name: 'role', type: 'bytes32', internalType: 'bytes32' }],
324
- outputs: [],
325
83
  stateMutability: 'nonpayable',
326
- },
327
- {
328
- type: 'function',
329
- name: 'revokeRole',
330
84
  inputs: [
331
- { name: 'role', type: 'bytes32', internalType: 'bytes32' },
332
- { name: 'account', type: 'address', internalType: 'address' },
85
+ { type: 'address', name: 'to' },
86
+ { type: 'uint256', name: 'amount' },
333
87
  ],
334
88
  outputs: [],
335
- stateMutability: 'nonpayable',
336
89
  },
337
90
  {
91
+ name: 'burn',
338
92
  type: 'function',
339
- name: 'setRoleAdmin',
340
- inputs: [
341
- { name: 'role', type: 'bytes32', internalType: 'bytes32' },
342
- { name: 'adminRole', type: 'bytes32', internalType: 'bytes32' },
343
- ],
344
- outputs: [],
345
93
  stateMutability: 'nonpayable',
94
+ inputs: [{ type: 'uint256', name: 'amount' }],
95
+ outputs: [],
346
96
  },
347
97
  {
348
- type: 'event',
349
- name: 'RoleAdminUpdated',
350
- inputs: [
351
- { name: 'role', type: 'bytes32', indexed: true, internalType: 'bytes32' },
352
- {
353
- name: 'newAdminRole',
354
- type: 'bytes32',
355
- indexed: true,
356
- internalType: 'bytes32',
357
- },
358
- {
359
- name: 'sender',
360
- type: 'address',
361
- indexed: true,
362
- internalType: 'address',
363
- },
364
- ],
365
- anonymous: false,
366
- },
367
- {
368
- type: 'event',
369
- name: 'RoleMembershipUpdated',
370
- inputs: [
371
- { name: 'role', type: 'bytes32', indexed: true, internalType: 'bytes32' },
372
- {
373
- name: 'account',
374
- type: 'address',
375
- indexed: true,
376
- internalType: 'address',
377
- },
378
- {
379
- name: 'sender',
380
- type: 'address',
381
- indexed: true,
382
- internalType: 'address',
383
- },
384
- { name: 'hasRole', type: 'bool', indexed: false, internalType: 'bool' },
385
- ],
386
- anonymous: false,
98
+ name: 'currency',
99
+ type: 'function',
100
+ stateMutability: 'view',
101
+ inputs: [],
102
+ outputs: [{ type: 'string' }],
387
103
  },
388
- { type: 'error', name: 'Unauthorized', inputs: [] },
389
- ])
390
-
391
- export const feeManagerAbi = Abi.from([
392
- { type: 'constructor', inputs: [], stateMutability: 'nonpayable' },
393
104
  {
105
+ name: 'supplyCap',
394
106
  type: 'function',
395
- name: 'M',
396
- inputs: [],
397
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
398
107
  stateMutability: 'view',
108
+ inputs: [],
109
+ outputs: [{ type: 'uint256' }],
399
110
  },
400
111
  {
112
+ name: 'paused',
401
113
  type: 'function',
402
- name: 'MIN_LIQUIDITY',
403
- inputs: [],
404
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
405
114
  stateMutability: 'view',
115
+ inputs: [],
116
+ outputs: [{ type: 'bool' }],
406
117
  },
407
118
  {
119
+ name: 'transferPolicyId',
408
120
  type: 'function',
409
- name: 'N',
410
- inputs: [],
411
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
412
121
  stateMutability: 'view',
122
+ inputs: [],
123
+ outputs: [{ type: 'uint64' }],
413
124
  },
414
125
  {
126
+ name: 'nonces',
415
127
  type: 'function',
416
- name: 'SCALE',
417
- inputs: [],
418
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
419
128
  stateMutability: 'view',
129
+ inputs: [{ type: 'address', name: 'owner' }],
130
+ outputs: [{ type: 'uint256' }],
420
131
  },
421
132
  {
133
+ name: 'salts',
422
134
  type: 'function',
423
- name: 'burn',
135
+ stateMutability: 'view',
424
136
  inputs: [
425
- { name: 'userToken', type: 'address', internalType: 'address' },
426
- { name: 'validatorToken', type: 'address', internalType: 'address' },
427
- { name: 'liquidity', type: 'uint256', internalType: 'uint256' },
428
- { name: 'to', type: 'address', internalType: 'address' },
137
+ { type: 'address', name: 'owner' },
138
+ { type: 'bytes4', name: 'salt' },
429
139
  ],
430
- outputs: [
431
- { name: 'amountUserToken', type: 'uint256', internalType: 'uint256' },
432
- {
433
- name: 'amountValidatorToken',
434
- type: 'uint256',
435
- internalType: 'uint256',
436
- },
437
- ],
438
- stateMutability: 'nonpayable',
140
+ outputs: [{ type: 'bool' }],
439
141
  },
440
142
  {
143
+ name: 'burnBlocked',
441
144
  type: 'function',
442
- name: 'collectFeePostTx',
145
+ stateMutability: 'nonpayable',
443
146
  inputs: [
444
- { name: 'user', type: 'address', internalType: 'address' },
445
- { name: 'maxAmount', type: 'uint256', internalType: 'uint256' },
446
- { name: 'actualUsed', type: 'uint256', internalType: 'uint256' },
447
- { name: 'userToken', type: 'address', internalType: 'address' },
448
- { name: 'validatorToken', type: 'address', internalType: 'address' },
147
+ { type: 'address', name: 'from' },
148
+ { type: 'uint256', name: 'amount' },
449
149
  ],
450
150
  outputs: [],
451
- stateMutability: 'nonpayable',
452
151
  },
453
152
  {
153
+ name: 'mintWithMemo',
454
154
  type: 'function',
455
- name: 'collectFeePreTx',
155
+ stateMutability: 'nonpayable',
456
156
  inputs: [
457
- { name: 'user', type: 'address', internalType: 'address' },
458
- { name: 'txToAddress', type: 'address', internalType: 'address' },
459
- { name: 'maxAmount', type: 'uint256', internalType: 'uint256' },
157
+ { type: 'address', name: 'to' },
158
+ { type: 'uint256', name: 'amount' },
159
+ { type: 'bytes32', name: 'memo' },
460
160
  ],
461
- outputs: [{ name: 'userToken', type: 'address', internalType: 'address' }],
462
- stateMutability: 'nonpayable',
463
- },
464
- {
465
- type: 'function',
466
- name: 'executeBlock',
467
- inputs: [],
468
161
  outputs: [],
469
- stateMutability: 'nonpayable',
470
162
  },
471
163
  {
164
+ name: 'burnWithMemo',
472
165
  type: 'function',
473
- name: 'getPool',
166
+ stateMutability: 'nonpayable',
474
167
  inputs: [
475
- { name: 'userToken', type: 'address', internalType: 'address' },
476
- { name: 'validatorToken', type: 'address', internalType: 'address' },
168
+ { type: 'uint256', name: 'amount' },
169
+ { type: 'bytes32', name: 'memo' },
477
170
  ],
478
- outputs: [
479
- {
480
- name: '',
481
- type: 'tuple',
482
- internalType: 'struct FeeAMM.Pool',
483
- components: [
484
- {
485
- name: 'reserveUserToken',
486
- type: 'uint128',
487
- internalType: 'uint128',
488
- },
489
- {
490
- name: 'reserveValidatorToken',
491
- type: 'uint128',
492
- internalType: 'uint128',
493
- },
494
- ],
495
- },
496
- ],
497
- stateMutability: 'view',
171
+ outputs: [],
498
172
  },
499
173
  {
174
+ name: 'transferWithMemo',
500
175
  type: 'function',
501
- name: 'getPoolId',
176
+ stateMutability: 'nonpayable',
502
177
  inputs: [
503
- { name: 'userToken', type: 'address', internalType: 'address' },
504
- { name: 'validatorToken', type: 'address', internalType: 'address' },
178
+ { type: 'address', name: 'to' },
179
+ { type: 'uint256', name: 'amount' },
180
+ { type: 'bytes32', name: 'memo' },
505
181
  ],
506
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
507
- stateMutability: 'pure',
182
+ outputs: [],
508
183
  },
509
184
  {
185
+ name: 'transferFromWithMemo',
510
186
  type: 'function',
511
- name: 'liquidityBalances',
187
+ stateMutability: 'nonpayable',
512
188
  inputs: [
513
- { name: '', type: 'bytes32', internalType: 'bytes32' },
514
- { name: '', type: 'address', internalType: 'address' },
189
+ { type: 'address', name: 'from' },
190
+ { type: 'address', name: 'to' },
191
+ { type: 'uint256', name: 'amount' },
192
+ { type: 'bytes32', name: 'memo' },
515
193
  ],
516
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
517
- stateMutability: 'view',
194
+ outputs: [],
518
195
  },
519
196
  {
197
+ name: 'changeTransferPolicyId',
520
198
  type: 'function',
521
- name: 'mint',
522
- inputs: [
523
- { name: 'userToken', type: 'address', internalType: 'address' },
524
- { name: 'validatorToken', type: 'address', internalType: 'address' },
525
- { name: 'amountUserToken', type: 'uint256', internalType: 'uint256' },
526
- {
527
- name: 'amountValidatorToken',
528
- type: 'uint256',
529
- internalType: 'uint256',
530
- },
531
- { name: 'to', type: 'address', internalType: 'address' },
532
- ],
533
- outputs: [{ name: 'liquidity', type: 'uint256', internalType: 'uint256' }],
534
199
  stateMutability: 'nonpayable',
200
+ inputs: [{ type: 'uint64', name: 'newPolicyId' }],
201
+ outputs: [],
535
202
  },
536
203
  {
204
+ name: 'setSupplyCap',
537
205
  type: 'function',
538
- name: 'pools',
539
- inputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
540
- outputs: [
541
- { name: 'reserveUserToken', type: 'uint128', internalType: 'uint128' },
542
- {
543
- name: 'reserveValidatorToken',
544
- type: 'uint128',
545
- internalType: 'uint128',
546
- },
547
- ],
548
- stateMutability: 'view',
549
- },
550
- {
551
- type: 'function',
552
- name: 'rebalanceSwap',
553
- inputs: [
554
- { name: 'userToken', type: 'address', internalType: 'address' },
555
- { name: 'validatorToken', type: 'address', internalType: 'address' },
556
- { name: 'amountOut', type: 'uint256', internalType: 'uint256' },
557
- { name: 'to', type: 'address', internalType: 'address' },
558
- ],
559
- outputs: [{ name: 'amountIn', type: 'uint256', internalType: 'uint256' }],
560
206
  stateMutability: 'nonpayable',
561
- },
562
- {
563
- type: 'function',
564
- name: 'setUserToken',
565
- inputs: [{ name: 'token', type: 'address', internalType: 'address' }],
207
+ inputs: [{ type: 'uint256', name: 'newSupplyCap' }],
566
208
  outputs: [],
567
- stateMutability: 'nonpayable',
568
209
  },
569
210
  {
211
+ name: 'pause',
570
212
  type: 'function',
571
- name: 'setValidatorToken',
572
- inputs: [{ name: 'token', type: 'address', internalType: 'address' }],
573
- outputs: [],
574
213
  stateMutability: 'nonpayable',
214
+ inputs: [],
215
+ outputs: [],
575
216
  },
576
217
  {
218
+ name: 'unpause',
577
219
  type: 'function',
578
- name: 'totalSupply',
579
- inputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
580
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
581
- stateMutability: 'view',
220
+ stateMutability: 'nonpayable',
221
+ inputs: [],
222
+ outputs: [],
582
223
  },
583
224
  {
225
+ name: 'permit',
584
226
  type: 'function',
585
- name: 'userTokens',
586
- inputs: [{ name: '', type: 'address', internalType: 'address' }],
587
- outputs: [{ name: '', type: 'address', internalType: 'address' }],
588
- stateMutability: 'view',
227
+ stateMutability: 'nonpayable',
228
+ inputs: [
229
+ { type: 'address', name: 'owner' },
230
+ { type: 'address', name: 'spender' },
231
+ { type: 'uint256', name: 'value' },
232
+ { type: 'uint256', name: 'deadline' },
233
+ { type: 'uint8', name: 'v' },
234
+ { type: 'bytes32', name: 'r' },
235
+ { type: 'bytes32', name: 's' },
236
+ ],
237
+ outputs: [],
589
238
  },
590
239
  {
240
+ name: 'DOMAIN_SEPARATOR',
591
241
  type: 'function',
592
- name: 'validatorTokens',
593
- inputs: [{ name: '', type: 'address', internalType: 'address' }],
594
- outputs: [{ name: '', type: 'address', internalType: 'address' }],
595
242
  stateMutability: 'view',
243
+ inputs: [],
244
+ outputs: [{ type: 'bytes32' }],
596
245
  },
597
246
  {
247
+ name: 'Transfer',
598
248
  type: 'event',
599
- name: 'Burn',
600
249
  inputs: [
601
- {
602
- name: 'sender',
603
- type: 'address',
604
- indexed: true,
605
- internalType: 'address',
606
- },
607
- {
608
- name: 'userToken',
609
- type: 'address',
610
- indexed: true,
611
- internalType: 'address',
612
- },
613
- {
614
- name: 'validatorToken',
615
- type: 'address',
616
- indexed: true,
617
- internalType: 'address',
618
- },
619
- {
620
- name: 'amountUserToken',
621
- type: 'uint256',
622
- indexed: false,
623
- internalType: 'uint256',
624
- },
625
- {
626
- name: 'amountValidatorToken',
627
- type: 'uint256',
628
- indexed: false,
629
- internalType: 'uint256',
630
- },
631
- {
632
- name: 'liquidity',
633
- type: 'uint256',
634
- indexed: false,
635
- internalType: 'uint256',
636
- },
637
- { name: 'to', type: 'address', indexed: false, internalType: 'address' },
250
+ { type: 'address', name: 'from', indexed: true },
251
+ { type: 'address', name: 'to', indexed: true },
252
+ { type: 'uint256', name: 'amount' },
638
253
  ],
639
- anonymous: false,
640
254
  },
641
255
  {
256
+ name: 'Approval',
642
257
  type: 'event',
643
- name: 'FeeSwap',
644
258
  inputs: [
645
- {
646
- name: 'userToken',
647
- type: 'address',
648
- indexed: true,
649
- internalType: 'address',
650
- },
651
- {
652
- name: 'validatorToken',
653
- type: 'address',
654
- indexed: true,
655
- internalType: 'address',
656
- },
657
- {
658
- name: 'amountIn',
659
- type: 'uint256',
660
- indexed: false,
661
- internalType: 'uint256',
662
- },
663
- {
664
- name: 'amountOut',
665
- type: 'uint256',
666
- indexed: false,
667
- internalType: 'uint256',
668
- },
259
+ { type: 'address', name: 'owner', indexed: true },
260
+ { type: 'address', name: 'spender', indexed: true },
261
+ { type: 'uint256', name: 'amount' },
669
262
  ],
670
- anonymous: false,
671
263
  },
672
264
  {
673
- type: 'event',
674
265
  name: 'Mint',
266
+ type: 'event',
675
267
  inputs: [
676
- {
677
- name: 'sender',
678
- type: 'address',
679
- indexed: true,
680
- internalType: 'address',
681
- },
682
- {
683
- name: 'userToken',
684
- type: 'address',
685
- indexed: true,
686
- internalType: 'address',
687
- },
688
- {
689
- name: 'validatorToken',
690
- type: 'address',
691
- indexed: true,
692
- internalType: 'address',
693
- },
694
- {
695
- name: 'amountUserToken',
696
- type: 'uint256',
697
- indexed: false,
698
- internalType: 'uint256',
699
- },
700
- {
701
- name: 'amountValidatorToken',
702
- type: 'uint256',
703
- indexed: false,
704
- internalType: 'uint256',
705
- },
706
- {
707
- name: 'liquidity',
708
- type: 'uint256',
709
- indexed: false,
710
- internalType: 'uint256',
711
- },
268
+ { type: 'address', name: 'to', indexed: true },
269
+ { type: 'uint256', name: 'amount' },
712
270
  ],
713
- anonymous: false,
714
271
  },
715
272
  {
273
+ name: 'Burn',
716
274
  type: 'event',
717
- name: 'RebalanceSwap',
718
275
  inputs: [
719
- {
720
- name: 'userToken',
721
- type: 'address',
722
- indexed: true,
723
- internalType: 'address',
724
- },
725
- {
726
- name: 'validatorToken',
727
- type: 'address',
728
- indexed: true,
729
- internalType: 'address',
730
- },
731
- {
732
- name: 'swapper',
733
- type: 'address',
734
- indexed: true,
735
- internalType: 'address',
736
- },
737
- {
738
- name: 'amountIn',
739
- type: 'uint256',
740
- indexed: false,
741
- internalType: 'uint256',
742
- },
743
- {
744
- name: 'amountOut',
745
- type: 'uint256',
746
- indexed: false,
747
- internalType: 'uint256',
748
- },
276
+ { type: 'address', name: 'from', indexed: true },
277
+ { type: 'uint256', name: 'amount' },
749
278
  ],
750
- anonymous: false,
751
279
  },
752
280
  {
281
+ name: 'BurnBlocked',
753
282
  type: 'event',
754
- name: 'UserTokenSet',
755
283
  inputs: [
756
- { name: 'user', type: 'address', indexed: true, internalType: 'address' },
757
- {
758
- name: 'token',
759
- type: 'address',
760
- indexed: true,
761
- internalType: 'address',
762
- },
284
+ { type: 'address', name: 'from', indexed: true },
285
+ { type: 'uint256', name: 'amount' },
763
286
  ],
764
- anonymous: false,
765
287
  },
766
288
  {
289
+ name: 'TransferWithMemo',
767
290
  type: 'event',
768
- name: 'ValidatorTokenSet',
769
291
  inputs: [
770
- {
771
- name: 'validator',
772
- type: 'address',
773
- indexed: true,
774
- internalType: 'address',
775
- },
776
- {
777
- name: 'token',
778
- type: 'address',
779
- indexed: true,
780
- internalType: 'address',
781
- },
292
+ { type: 'address', name: 'from', indexed: true },
293
+ { type: 'address', name: 'to', indexed: true },
294
+ { type: 'uint256', name: 'amount' },
295
+ { type: 'bytes32', name: 'memo' },
782
296
  ],
783
- anonymous: false,
784
297
  },
785
- ])
786
-
787
- export const tip20Abi = Abi.from([
788
298
  {
789
- type: 'constructor',
299
+ name: 'TransferPolicyUpdate',
300
+ type: 'event',
790
301
  inputs: [
791
- { name: '_name', type: 'string', internalType: 'string' },
792
- { name: '_symbol', type: 'string', internalType: 'string' },
793
- { name: '_currency', type: 'string', internalType: 'string' },
794
- { name: 'admin', type: 'address', internalType: 'address' },
302
+ { type: 'address', name: 'updater', indexed: true },
303
+ { type: 'uint64', name: 'newPolicyId', indexed: true },
795
304
  ],
796
- stateMutability: 'nonpayable',
797
- },
798
- {
799
- type: 'function',
800
- name: 'BURN_BLOCKED_ROLE',
801
- inputs: [],
802
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
803
- stateMutability: 'view',
804
- },
805
- {
806
- type: 'function',
807
- name: 'DOMAIN_SEPARATOR',
808
- inputs: [],
809
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
810
- stateMutability: 'view',
811
- },
812
- {
813
- type: 'function',
814
- name: 'ISSUER_ROLE',
815
- inputs: [],
816
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
817
- stateMutability: 'view',
818
305
  },
819
306
  {
820
- type: 'function',
821
- name: 'PAUSE_ROLE',
822
- inputs: [],
823
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
824
- stateMutability: 'view',
825
- },
826
- {
827
- type: 'function',
828
- name: 'UNPAUSE_ROLE',
829
- inputs: [],
830
- outputs: [{ name: '', type: 'bytes32', internalType: 'bytes32' }],
831
- stateMutability: 'view',
832
- },
833
- {
834
- type: 'function',
835
- name: 'allowance',
307
+ name: 'SupplyCapUpdate',
308
+ type: 'event',
836
309
  inputs: [
837
- { name: '', type: 'address', internalType: 'address' },
838
- { name: '', type: 'address', internalType: 'address' },
310
+ { type: 'address', name: 'updater', indexed: true },
311
+ { type: 'uint256', name: 'newSupplyCap', indexed: true },
839
312
  ],
840
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
841
- stateMutability: 'view',
842
313
  },
843
314
  {
844
- type: 'function',
845
- name: 'approve',
315
+ name: 'PauseStateUpdate',
316
+ type: 'event',
846
317
  inputs: [
847
- { name: 'spender', type: 'address', internalType: 'address' },
848
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
318
+ { type: 'address', name: 'updater', indexed: true },
319
+ { type: 'bool', name: 'isPaused' },
849
320
  ],
850
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
851
- stateMutability: 'nonpayable',
852
- },
853
- {
854
- type: 'function',
855
- name: 'balanceOf',
856
- inputs: [{ name: '', type: 'address', internalType: 'address' }],
857
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
858
- stateMutability: 'view',
859
321
  },
322
+ { name: 'InsufficientBalance', type: 'error', inputs: [] },
323
+ { name: 'InsufficientAllowance', type: 'error', inputs: [] },
324
+ { name: 'SupplyCapExceeded', type: 'error', inputs: [] },
325
+ { name: 'InvalidSignature', type: 'error', inputs: [] },
326
+ { name: 'InvalidPayload', type: 'error', inputs: [] },
327
+ { name: 'InvalidNonce', type: 'error', inputs: [] },
328
+ { name: 'StringTooLong', type: 'error', inputs: [] },
329
+ { name: 'PolicyForbids', type: 'error', inputs: [] },
330
+ { name: 'InvalidRecipient', type: 'error', inputs: [] },
331
+ { name: 'Expired', type: 'error', inputs: [] },
332
+ { name: 'SaltAlreadyUsed', type: 'error', inputs: [] },
333
+ { name: 'ContractPaused', type: 'error', inputs: [] },
334
+ { name: 'InvalidCurrency', type: 'error', inputs: [] },
860
335
  {
336
+ name: 'grantRole',
861
337
  type: 'function',
862
- name: 'burn',
863
- inputs: [{ name: 'amount', type: 'uint256', internalType: 'uint256' }],
864
- outputs: [],
865
338
  stateMutability: 'nonpayable',
866
- },
867
- {
868
- type: 'function',
869
- name: 'burnBlocked',
870
339
  inputs: [
871
- { name: 'from', type: 'address', internalType: 'address' },
872
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
340
+ { type: 'bytes32', name: 'role' },
341
+ { type: 'address', name: 'account' },
873
342
  ],
874
343
  outputs: [],
875
- stateMutability: 'nonpayable',
876
344
  },
877
345
  {
346
+ name: 'revokeRole',
878
347
  type: 'function',
879
- name: 'burnWithMemo',
348
+ stateMutability: 'nonpayable',
880
349
  inputs: [
881
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
882
- { name: 'memo', type: 'bytes32', internalType: 'bytes32' },
350
+ { type: 'bytes32', name: 'role' },
351
+ { type: 'address', name: 'account' },
883
352
  ],
884
353
  outputs: [],
885
- stateMutability: 'nonpayable',
886
354
  },
887
355
  {
356
+ name: 'renounceRole',
888
357
  type: 'function',
889
- name: 'changeTransferPolicyId',
890
- inputs: [{ name: 'newPolicyId', type: 'uint64', internalType: 'uint64' }],
891
- outputs: [],
892
358
  stateMutability: 'nonpayable',
893
- },
894
- {
895
- type: 'function',
896
- name: 'currency',
897
- inputs: [],
898
- outputs: [{ name: '', type: 'string', internalType: 'string' }],
899
- stateMutability: 'view',
900
- },
901
- {
902
- type: 'function',
903
- name: 'decimals',
904
- inputs: [],
905
- outputs: [{ name: '', type: 'uint8', internalType: 'uint8' }],
906
- stateMutability: 'view',
907
- },
908
- {
909
- type: 'function',
910
- name: 'grantRole',
911
- inputs: [
912
- { name: 'role', type: 'bytes32', internalType: 'bytes32' },
913
- { name: 'account', type: 'address', internalType: 'address' },
914
- ],
359
+ inputs: [{ type: 'bytes32', name: 'role' }],
915
360
  outputs: [],
916
- stateMutability: 'nonpayable',
917
361
  },
918
362
  {
363
+ name: 'setRoleAdmin',
919
364
  type: 'function',
920
- name: 'mint',
921
- inputs: [
922
- { name: 'to', type: 'address', internalType: 'address' },
923
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
924
- ],
925
- outputs: [],
926
365
  stateMutability: 'nonpayable',
927
- },
928
- {
929
- type: 'function',
930
- name: 'mintWithMemo',
931
366
  inputs: [
932
- { name: 'to', type: 'address', internalType: 'address' },
933
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
934
- { name: 'memo', type: 'bytes32', internalType: 'bytes32' },
367
+ { type: 'bytes32', name: 'role' },
368
+ { type: 'bytes32', name: 'adminRole' },
935
369
  ],
936
370
  outputs: [],
937
- stateMutability: 'nonpayable',
938
371
  },
939
372
  {
373
+ name: 'hasRole',
940
374
  type: 'function',
941
- name: 'name',
942
- inputs: [],
943
- outputs: [{ name: '', type: 'string', internalType: 'string' }],
944
375
  stateMutability: 'view',
945
- },
946
- {
947
- type: 'function',
948
- name: 'nonces',
949
- inputs: [{ name: '', type: 'address', internalType: 'address' }],
950
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
951
- stateMutability: 'view',
952
- },
953
- {
954
- type: 'function',
955
- name: 'pause',
956
- inputs: [],
957
- outputs: [],
958
- stateMutability: 'nonpayable',
959
- },
960
- {
961
- type: 'function',
962
- name: 'paused',
963
- inputs: [],
964
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
965
- stateMutability: 'view',
966
- },
967
- {
968
- type: 'function',
969
- name: 'permit',
970
376
  inputs: [
971
- { name: 'owner', type: 'address', internalType: 'address' },
972
- { name: 'spender', type: 'address', internalType: 'address' },
973
- { name: 'value', type: 'uint256', internalType: 'uint256' },
974
- { name: 'deadline', type: 'uint256', internalType: 'uint256' },
975
- { name: 'v', type: 'uint8', internalType: 'uint8' },
976
- { name: 'r', type: 'bytes32', internalType: 'bytes32' },
977
- { name: 's', type: 'bytes32', internalType: 'bytes32' },
377
+ { type: 'address', name: 'account' },
378
+ { type: 'bytes32', name: 'role' },
978
379
  ],
979
- outputs: [],
980
- stateMutability: 'nonpayable',
380
+ outputs: [{ type: 'bool' }],
981
381
  },
982
382
  {
383
+ name: 'getRoleAdmin',
983
384
  type: 'function',
984
- name: 'renounceRole',
985
- inputs: [{ name: 'role', type: 'bytes32', internalType: 'bytes32' }],
986
- outputs: [],
987
- stateMutability: 'nonpayable',
385
+ stateMutability: 'view',
386
+ inputs: [{ type: 'bytes32', name: 'role' }],
387
+ outputs: [{ type: 'bytes32' }],
988
388
  },
989
389
  {
990
- type: 'function',
991
- name: 'revokeRole',
390
+ name: 'RoleMembershipUpdated',
391
+ type: 'event',
992
392
  inputs: [
993
- { name: 'role', type: 'bytes32', internalType: 'bytes32' },
994
- { name: 'account', type: 'address', internalType: 'address' },
393
+ { type: 'bytes32', name: 'role', indexed: true },
394
+ { type: 'address', name: 'account', indexed: true },
395
+ { type: 'address', name: 'sender', indexed: true },
396
+ { type: 'bool', name: 'hasRole' },
995
397
  ],
996
- outputs: [],
997
- stateMutability: 'nonpayable',
998
398
  },
999
399
  {
1000
- type: 'function',
1001
- name: 'setRoleAdmin',
400
+ name: 'RoleAdminUpdated',
401
+ type: 'event',
1002
402
  inputs: [
1003
- { name: 'role', type: 'bytes32', internalType: 'bytes32' },
1004
- { name: 'adminRole', type: 'bytes32', internalType: 'bytes32' },
403
+ { type: 'bytes32', name: 'role', indexed: true },
404
+ { type: 'bytes32', name: 'newAdminRole', indexed: true },
405
+ { type: 'address', name: 'sender', indexed: true },
1005
406
  ],
1006
- outputs: [],
1007
- stateMutability: 'nonpayable',
1008
407
  },
408
+ { name: 'Unauthorized', type: 'error', inputs: [] },
409
+ ] as const
410
+
411
+ export const tip20FactoryAbi = [
1009
412
  {
413
+ name: 'createToken',
1010
414
  type: 'function',
1011
- name: 'setSupplyCap',
415
+ stateMutability: 'nonpayable',
1012
416
  inputs: [
1013
- { name: 'newSupplyCap', type: 'uint256', internalType: 'uint256' },
417
+ { type: 'string', name: 'name' },
418
+ { type: 'string', name: 'symbol' },
419
+ { type: 'string', name: 'currency' },
420
+ { type: 'address', name: 'admin' },
1014
421
  ],
1015
- outputs: [],
1016
- stateMutability: 'nonpayable',
422
+ outputs: [{ type: 'uint256' }],
1017
423
  },
1018
424
  {
425
+ name: 'tokenIdCounter',
1019
426
  type: 'function',
1020
- name: 'supplyCap',
1021
- inputs: [],
1022
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
1023
427
  stateMutability: 'view',
1024
- },
1025
- {
1026
- type: 'function',
1027
- name: 'symbol',
1028
428
  inputs: [],
1029
- outputs: [{ name: '', type: 'string', internalType: 'string' }],
1030
- stateMutability: 'view',
429
+ outputs: [{ type: 'uint256' }],
1031
430
  },
1032
431
  {
1033
- type: 'function',
1034
- name: 'systemTransferFrom',
432
+ name: 'TokenCreated',
433
+ type: 'event',
1035
434
  inputs: [
1036
- { name: 'from', type: 'address', internalType: 'address' },
1037
- { name: 'to', type: 'address', internalType: 'address' },
1038
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
435
+ { type: 'address', name: 'token', indexed: true },
436
+ { type: 'uint256', name: 'tokenId', indexed: true },
437
+ { type: 'string', name: 'name' },
438
+ { type: 'string', name: 'symbol' },
439
+ { type: 'string', name: 'currency' },
440
+ { type: 'address', name: 'admin' },
1039
441
  ],
1040
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
1041
- stateMutability: 'nonpayable',
1042
442
  },
443
+ ] as const
444
+
445
+ export const tip403RegistryAbi = [
1043
446
  {
447
+ name: 'policyIdCounter',
1044
448
  type: 'function',
1045
- name: 'totalSupply',
1046
- inputs: [],
1047
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
1048
449
  stateMutability: 'view',
450
+ inputs: [],
451
+ outputs: [{ type: 'uint64' }],
1049
452
  },
1050
453
  {
454
+ name: 'policyData',
1051
455
  type: 'function',
1052
- name: 'transfer',
1053
- inputs: [
1054
- { name: 'to', type: 'address', internalType: 'address' },
1055
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
1056
- ],
1057
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
1058
- stateMutability: 'nonpayable',
1059
- },
1060
- {
1061
- type: 'function',
1062
- name: 'transferFeePostTx',
1063
- inputs: [
1064
- { name: 'to', type: 'address', internalType: 'address' },
1065
- { name: 'refund', type: 'uint256', internalType: 'uint256' },
1066
- { name: 'actualUsed', type: 'uint256', internalType: 'uint256' },
1067
- ],
1068
- outputs: [],
1069
- stateMutability: 'nonpayable',
456
+ stateMutability: 'view',
457
+ inputs: [{ type: 'uint64', name: 'policyId' }],
458
+ outputs: [
459
+ { type: 'uint8', name: 'policyType' },
460
+ { type: 'address', name: 'admin' },
461
+ ],
1070
462
  },
1071
463
  {
464
+ name: 'isAuthorized',
1072
465
  type: 'function',
1073
- name: 'transferFeePreTx',
466
+ stateMutability: 'view',
1074
467
  inputs: [
1075
- { name: 'from', type: 'address', internalType: 'address' },
1076
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
468
+ { type: 'uint64', name: 'policyId' },
469
+ { type: 'address', name: 'user' },
1077
470
  ],
1078
- outputs: [],
1079
- stateMutability: 'nonpayable',
471
+ outputs: [{ type: 'bool' }],
1080
472
  },
1081
473
  {
474
+ name: 'createPolicy',
1082
475
  type: 'function',
1083
- name: 'transferFrom',
476
+ stateMutability: 'nonpayable',
1084
477
  inputs: [
1085
- { name: 'from', type: 'address', internalType: 'address' },
1086
- { name: 'to', type: 'address', internalType: 'address' },
1087
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
478
+ { type: 'address', name: 'admin' },
479
+ { type: 'uint8', name: 'policyType' },
1088
480
  ],
1089
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
1090
- stateMutability: 'nonpayable',
481
+ outputs: [{ type: 'uint64' }],
1091
482
  },
1092
483
  {
484
+ name: 'createPolicyWithAccounts',
1093
485
  type: 'function',
1094
- name: 'transferFromWithMemo',
486
+ stateMutability: 'nonpayable',
1095
487
  inputs: [
1096
- { name: 'from', type: 'address', internalType: 'address' },
1097
- { name: 'to', type: 'address', internalType: 'address' },
1098
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
1099
- { name: 'memo', type: 'bytes32', internalType: 'bytes32' },
488
+ { type: 'address', name: 'admin' },
489
+ { type: 'uint8', name: 'policyType' },
490
+ { type: 'address[]', name: 'accounts' },
1100
491
  ],
1101
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
1102
- stateMutability: 'nonpayable',
492
+ outputs: [{ type: 'uint64' }],
1103
493
  },
1104
494
  {
495
+ name: 'setPolicyAdmin',
1105
496
  type: 'function',
1106
- name: 'transferPolicyId',
1107
- inputs: [],
1108
- outputs: [{ name: '', type: 'uint64', internalType: 'uint64' }],
1109
- stateMutability: 'view',
497
+ stateMutability: 'nonpayable',
498
+ inputs: [
499
+ { type: 'uint64', name: 'policyId' },
500
+ { type: 'address', name: 'admin' },
501
+ ],
502
+ outputs: [],
1110
503
  },
1111
504
  {
505
+ name: 'modifyPolicyWhitelist',
1112
506
  type: 'function',
1113
- name: 'transferWithMemo',
507
+ stateMutability: 'nonpayable',
1114
508
  inputs: [
1115
- { name: 'to', type: 'address', internalType: 'address' },
1116
- { name: 'amount', type: 'uint256', internalType: 'uint256' },
1117
- { name: 'memo', type: 'bytes32', internalType: 'bytes32' },
509
+ { type: 'uint64', name: 'policyId' },
510
+ { type: 'address', name: 'account' },
511
+ { type: 'bool', name: 'allowed' },
1118
512
  ],
1119
513
  outputs: [],
1120
- stateMutability: 'nonpayable',
1121
514
  },
1122
515
  {
516
+ name: 'modifyPolicyBlacklist',
1123
517
  type: 'function',
1124
- name: 'unpause',
1125
- inputs: [],
1126
- outputs: [],
1127
518
  stateMutability: 'nonpayable',
1128
- },
1129
- {
1130
- type: 'event',
1131
- name: 'Approval',
1132
519
  inputs: [
1133
- {
1134
- name: 'owner',
1135
- type: 'address',
1136
- indexed: true,
1137
- internalType: 'address',
1138
- },
1139
- {
1140
- name: 'spender',
1141
- type: 'address',
1142
- indexed: true,
1143
- internalType: 'address',
1144
- },
1145
- {
1146
- name: 'amount',
1147
- type: 'uint256',
1148
- indexed: false,
1149
- internalType: 'uint256',
1150
- },
520
+ { type: 'uint64', name: 'policyId' },
521
+ { type: 'address', name: 'account' },
522
+ { type: 'bool', name: 'restricted' },
1151
523
  ],
1152
- anonymous: false,
524
+ outputs: [],
1153
525
  },
1154
526
  {
527
+ name: 'PolicyAdminUpdated',
1155
528
  type: 'event',
1156
- name: 'Burn',
1157
529
  inputs: [
1158
- { name: 'from', type: 'address', indexed: true, internalType: 'address' },
1159
- {
1160
- name: 'amount',
1161
- type: 'uint256',
1162
- indexed: false,
1163
- internalType: 'uint256',
1164
- },
530
+ { type: 'uint64', name: 'policyId', indexed: true },
531
+ { type: 'address', name: 'updater', indexed: true },
532
+ { type: 'address', name: 'admin', indexed: true },
1165
533
  ],
1166
- anonymous: false,
1167
534
  },
1168
535
  {
536
+ name: 'PolicyCreated',
1169
537
  type: 'event',
1170
- name: 'BurnBlocked',
1171
538
  inputs: [
1172
- { name: 'from', type: 'address', indexed: true, internalType: 'address' },
1173
- {
1174
- name: 'amount',
1175
- type: 'uint256',
1176
- indexed: false,
1177
- internalType: 'uint256',
1178
- },
539
+ { type: 'uint64', name: 'policyId', indexed: true },
540
+ { type: 'address', name: 'updater', indexed: true },
541
+ { type: 'uint8', name: 'policyType' },
1179
542
  ],
1180
- anonymous: false,
1181
543
  },
1182
544
  {
545
+ name: 'WhitelistUpdated',
1183
546
  type: 'event',
1184
- name: 'Mint',
1185
547
  inputs: [
1186
- { name: 'to', type: 'address', indexed: true, internalType: 'address' },
1187
- {
1188
- name: 'amount',
1189
- type: 'uint256',
1190
- indexed: false,
1191
- internalType: 'uint256',
1192
- },
548
+ { type: 'uint64', name: 'policyId', indexed: true },
549
+ { type: 'address', name: 'updater', indexed: true },
550
+ { type: 'address', name: 'account', indexed: true },
551
+ { type: 'bool', name: 'allowed' },
1193
552
  ],
1194
- anonymous: false,
1195
553
  },
1196
554
  {
555
+ name: 'BlacklistUpdated',
1197
556
  type: 'event',
1198
- name: 'PauseStateUpdate',
1199
557
  inputs: [
1200
- {
1201
- name: 'updater',
1202
- type: 'address',
1203
- indexed: true,
1204
- internalType: 'address',
1205
- },
1206
- { name: 'isPaused', type: 'bool', indexed: false, internalType: 'bool' },
558
+ { type: 'uint64', name: 'policyId', indexed: true },
559
+ { type: 'address', name: 'updater', indexed: true },
560
+ { type: 'address', name: 'account', indexed: true },
561
+ { type: 'bool', name: 'restricted' },
1207
562
  ],
1208
- anonymous: false,
1209
563
  },
564
+ { name: 'Unauthorized', type: 'error', inputs: [] },
565
+ { name: 'IncompatiblePolicyType', type: 'error', inputs: [] },
566
+ { name: 'SelfOwnedPolicyMustBeWhitelist', type: 'error', inputs: [] },
567
+ ] as const
568
+
569
+ export const tip4217RegistryAbi = [
1210
570
  {
1211
- type: 'event',
1212
- name: 'RoleAdminUpdated',
1213
- inputs: [
1214
- { name: 'role', type: 'bytes32', indexed: true, internalType: 'bytes32' },
1215
- {
1216
- name: 'newAdminRole',
1217
- type: 'bytes32',
1218
- indexed: true,
1219
- internalType: 'bytes32',
1220
- },
1221
- {
1222
- name: 'sender',
1223
- type: 'address',
1224
- indexed: true,
1225
- internalType: 'address',
1226
- },
1227
- ],
1228
- anonymous: false,
571
+ name: 'getCurrencyDecimals',
572
+ type: 'function',
573
+ stateMutability: 'view',
574
+ inputs: [{ type: 'string', name: 'currency' }],
575
+ outputs: [{ type: 'uint8' }],
1229
576
  },
577
+ ] as const
578
+
579
+ export const tipAccountRegistrarAbi = [
1230
580
  {
1231
- type: 'event',
1232
- name: 'RoleMembershipUpdated',
581
+ name: 'delegateToDefault',
582
+ type: 'function',
583
+ stateMutability: 'nonpayable',
1233
584
  inputs: [
1234
- { name: 'role', type: 'bytes32', indexed: true, internalType: 'bytes32' },
1235
- {
1236
- name: 'account',
1237
- type: 'address',
1238
- indexed: true,
1239
- internalType: 'address',
1240
- },
1241
- {
1242
- name: 'sender',
1243
- type: 'address',
1244
- indexed: true,
1245
- internalType: 'address',
1246
- },
1247
- { name: 'hasRole', type: 'bool', indexed: false, internalType: 'bool' },
585
+ { type: 'bytes32', name: 'hash' },
586
+ { type: 'bytes', name: 'signature' },
1248
587
  ],
1249
- anonymous: false,
588
+ outputs: [{ type: 'address', name: 'authority' }],
1250
589
  },
1251
590
  {
1252
- type: 'event',
1253
- name: 'SupplyCapUpdate',
591
+ name: 'getDelegationMessage',
592
+ type: 'function',
593
+ stateMutability: 'pure',
594
+ inputs: [],
595
+ outputs: [{ type: 'string' }],
596
+ },
597
+ { name: 'InvalidSignature', type: 'error', inputs: [] },
598
+ { name: 'CodeNotEmpty', type: 'error', inputs: [] },
599
+ { name: 'NonceNotZero', type: 'error', inputs: [] },
600
+ ] as const
601
+
602
+ export const feeAmmAbi = [
603
+ {
604
+ name: 'getPoolId',
605
+ type: 'function',
606
+ stateMutability: 'pure',
1254
607
  inputs: [
1255
- {
1256
- name: 'updater',
1257
- type: 'address',
1258
- indexed: true,
1259
- internalType: 'address',
1260
- },
1261
- {
1262
- name: 'newSupplyCap',
1263
- type: 'uint256',
1264
- indexed: true,
1265
- internalType: 'uint256',
1266
- },
608
+ { type: 'address', name: 'userToken' },
609
+ { type: 'address', name: 'validatorToken' },
1267
610
  ],
1268
- anonymous: false,
611
+ outputs: [{ type: 'bytes32' }],
1269
612
  },
1270
613
  {
1271
- type: 'event',
1272
- name: 'Transfer',
614
+ name: 'getPool',
615
+ type: 'function',
616
+ stateMutability: 'view',
1273
617
  inputs: [
1274
- { name: 'from', type: 'address', indexed: true, internalType: 'address' },
1275
- { name: 'to', type: 'address', indexed: true, internalType: 'address' },
618
+ { type: 'address', name: 'userToken' },
619
+ { type: 'address', name: 'validatorToken' },
620
+ ],
621
+ outputs: [
1276
622
  {
1277
- name: 'amount',
1278
- type: 'uint256',
1279
- indexed: false,
1280
- internalType: 'uint256',
623
+ type: 'tuple',
624
+ components: [
625
+ { type: 'uint128', name: 'reserveUserToken' },
626
+ { type: 'uint128', name: 'reserveValidatorToken' },
627
+ ],
1281
628
  },
1282
629
  ],
1283
- anonymous: false,
1284
630
  },
1285
631
  {
1286
- type: 'event',
1287
- name: 'TransferPolicyUpdate',
1288
- inputs: [
1289
- {
1290
- name: 'updater',
1291
- type: 'address',
1292
- indexed: true,
1293
- internalType: 'address',
1294
- },
632
+ name: 'pools',
633
+ type: 'function',
634
+ stateMutability: 'view',
635
+ inputs: [{ type: 'bytes32', name: 'poolId' }],
636
+ outputs: [
1295
637
  {
1296
- name: 'newPolicyId',
1297
- type: 'uint64',
1298
- indexed: true,
1299
- internalType: 'uint64',
638
+ type: 'tuple',
639
+ components: [
640
+ { type: 'uint128', name: 'reserveUserToken' },
641
+ { type: 'uint128', name: 'reserveValidatorToken' },
642
+ ],
1300
643
  },
1301
644
  ],
1302
- anonymous: false,
1303
645
  },
1304
646
  {
1305
- type: 'event',
1306
- name: 'TransferWithMemo',
647
+ name: 'mint',
648
+ type: 'function',
649
+ stateMutability: 'nonpayable',
1307
650
  inputs: [
1308
- { name: 'from', type: 'address', indexed: true, internalType: 'address' },
1309
- { name: 'to', type: 'address', indexed: true, internalType: 'address' },
1310
- {
1311
- name: 'amount',
1312
- type: 'uint256',
1313
- indexed: false,
1314
- internalType: 'uint256',
1315
- },
1316
- { name: 'memo', type: 'bytes32', indexed: true, internalType: 'bytes32' },
651
+ { type: 'address', name: 'userToken' },
652
+ { type: 'address', name: 'validatorToken' },
653
+ { type: 'uint256', name: 'amountUserToken' },
654
+ { type: 'uint256', name: 'amountValidatorToken' },
655
+ { type: 'address', name: 'to' },
1317
656
  ],
1318
- anonymous: false,
1319
- },
1320
- { type: 'error', name: 'ContractPaused', inputs: [] },
1321
- { type: 'error', name: 'Expired', inputs: [] },
1322
- { type: 'error', name: 'InsufficientAllowance', inputs: [] },
1323
- { type: 'error', name: 'InsufficientBalance', inputs: [] },
1324
- { type: 'error', name: 'InvalidCurrency', inputs: [] },
1325
- { type: 'error', name: 'InvalidRecipient', inputs: [] },
1326
- { type: 'error', name: 'InvalidSignature', inputs: [] },
1327
- { type: 'error', name: 'PolicyForbids', inputs: [] },
1328
- { type: 'error', name: 'SupplyCapExceeded', inputs: [] },
1329
- { type: 'error', name: 'Unauthorized', inputs: [] },
1330
- ])
1331
-
1332
- export const tip20FactoryAbi = Abi.from([
657
+ outputs: [{ type: 'uint256', name: 'liquidity' }],
658
+ },
1333
659
  {
660
+ name: 'burn',
1334
661
  type: 'function',
1335
- name: 'createToken',
662
+ stateMutability: 'nonpayable',
1336
663
  inputs: [
1337
- { name: 'name', type: 'string', internalType: 'string' },
1338
- { name: 'symbol', type: 'string', internalType: 'string' },
1339
- { name: 'currency', type: 'string', internalType: 'string' },
1340
- { name: 'admin', type: 'address', internalType: 'address' },
664
+ { type: 'address', name: 'userToken' },
665
+ { type: 'address', name: 'validatorToken' },
666
+ { type: 'uint256', name: 'liquidity' },
667
+ { type: 'address', name: 'to' },
668
+ ],
669
+ outputs: [
670
+ { type: 'uint256', name: 'amountUserToken' },
671
+ { type: 'uint256', name: 'amountValidatorToken' },
1341
672
  ],
1342
- outputs: [{ name: '', type: 'address', internalType: 'address' }],
1343
- stateMutability: 'nonpayable',
1344
673
  },
1345
674
  {
675
+ name: 'totalSupply',
1346
676
  type: 'function',
1347
- name: 'tokenIdCounter',
1348
- inputs: [],
1349
- outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
1350
677
  stateMutability: 'view',
678
+ inputs: [{ type: 'bytes32', name: 'poolId' }],
679
+ outputs: [{ type: 'uint256' }],
1351
680
  },
1352
681
  {
1353
- type: 'event',
1354
- name: 'TokenCreated',
682
+ name: 'liquidityBalances',
683
+ type: 'function',
684
+ stateMutability: 'view',
1355
685
  inputs: [
1356
- {
1357
- name: 'token',
1358
- type: 'address',
1359
- indexed: true,
1360
- internalType: 'address',
1361
- },
1362
- {
1363
- name: 'tokenId',
1364
- type: 'uint256',
1365
- indexed: true,
1366
- internalType: 'uint256',
1367
- },
1368
- { name: 'name', type: 'string', indexed: false, internalType: 'string' },
1369
- {
1370
- name: 'symbol',
1371
- type: 'string',
1372
- indexed: false,
1373
- internalType: 'string',
1374
- },
1375
- {
1376
- name: 'currency',
1377
- type: 'string',
1378
- indexed: false,
1379
- internalType: 'string',
1380
- },
1381
- {
1382
- name: 'admin',
1383
- type: 'address',
1384
- indexed: false,
1385
- internalType: 'address',
1386
- },
686
+ { type: 'bytes32', name: 'poolId' },
687
+ { type: 'address', name: 'user' },
1387
688
  ],
1388
- anonymous: false,
689
+ outputs: [{ type: 'uint256' }],
1389
690
  },
1390
- ])
1391
-
1392
- export const tip4217RegistryAbi = Abi.from([
1393
691
  {
692
+ name: 'rebalanceSwap',
1394
693
  type: 'function',
1395
- name: 'getCurrencyDecimals',
1396
- inputs: [{ name: 'currency', type: 'string', internalType: 'string' }],
1397
- outputs: [{ name: '', type: 'uint8', internalType: 'uint8' }],
1398
- stateMutability: 'view',
694
+ stateMutability: 'nonpayable',
695
+ inputs: [
696
+ { type: 'address', name: 'userToken' },
697
+ { type: 'address', name: 'validatorToken' },
698
+ { type: 'uint256', name: 'amountOut' },
699
+ { type: 'address', name: 'to' },
700
+ ],
701
+ outputs: [{ type: 'uint256', name: 'amountIn' }],
1399
702
  },
1400
- ])
1401
-
1402
- export const tip403RegistryAbi = Abi.from([
1403
703
  {
704
+ name: 'calculateLiquidity',
1404
705
  type: 'function',
1405
- name: 'createPolicy',
706
+ stateMutability: 'pure',
1406
707
  inputs: [
1407
- { name: 'admin', type: 'address', internalType: 'address' },
1408
- {
1409
- name: 'policyType',
1410
- type: 'uint8',
1411
- internalType: 'enum TIP403Registry.PolicyType',
1412
- },
1413
- { name: 'accounts', type: 'address[]', internalType: 'address[]' },
708
+ { type: 'uint256', name: 'x' },
709
+ { type: 'uint256', name: 'y' },
1414
710
  ],
1415
- outputs: [{ name: 'newPolicyId', type: 'uint64', internalType: 'uint64' }],
1416
- stateMutability: 'nonpayable',
711
+ outputs: [{ type: 'uint256' }],
1417
712
  },
1418
713
  {
1419
- type: 'function',
1420
- name: 'createPolicy',
714
+ name: 'Mint',
715
+ type: 'event',
1421
716
  inputs: [
1422
- { name: 'admin', type: 'address', internalType: 'address' },
1423
- {
1424
- name: 'policyType',
1425
- type: 'uint8',
1426
- internalType: 'enum TIP403Registry.PolicyType',
1427
- },
717
+ { type: 'address', name: 'sender', indexed: true },
718
+ { type: 'address', name: 'userToken', indexed: true },
719
+ { type: 'address', name: 'validatorToken', indexed: true },
720
+ { type: 'uint256', name: 'amountUserToken' },
721
+ { type: 'uint256', name: 'amountValidatorToken' },
722
+ { type: 'uint256', name: 'liquidity' },
1428
723
  ],
1429
- outputs: [{ name: 'newPolicyId', type: 'uint64', internalType: 'uint64' }],
1430
- stateMutability: 'nonpayable',
1431
724
  },
1432
725
  {
1433
- type: 'function',
1434
- name: 'isAuthorized',
726
+ name: 'Burn',
727
+ type: 'event',
1435
728
  inputs: [
1436
- { name: 'policyId', type: 'uint64', internalType: 'uint64' },
1437
- { name: 'user', type: 'address', internalType: 'address' },
729
+ { type: 'address', name: 'sender', indexed: true },
730
+ { type: 'address', name: 'userToken', indexed: true },
731
+ { type: 'address', name: 'validatorToken', indexed: true },
732
+ { type: 'uint256', name: 'amountUserToken' },
733
+ { type: 'uint256', name: 'amountValidatorToken' },
734
+ { type: 'uint256', name: 'liquidity' },
735
+ { type: 'address', name: 'to' },
1438
736
  ],
1439
- outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
1440
- stateMutability: 'view',
1441
737
  },
1442
738
  {
1443
- type: 'function',
1444
- name: 'modifyPolicyBlacklist',
739
+ name: 'RebalanceSwap',
740
+ type: 'event',
1445
741
  inputs: [
1446
- { name: 'policyId', type: 'uint64', internalType: 'uint64' },
1447
- { name: 'account', type: 'address', internalType: 'address' },
1448
- { name: 'restricted', type: 'bool', internalType: 'bool' },
742
+ { type: 'address', name: 'userToken', indexed: true },
743
+ { type: 'address', name: 'validatorToken', indexed: true },
744
+ { type: 'address', name: 'swapper', indexed: true },
745
+ { type: 'uint256', name: 'amountIn' },
746
+ { type: 'uint256', name: 'amountOut' },
1449
747
  ],
1450
- outputs: [],
1451
- stateMutability: 'nonpayable',
1452
748
  },
1453
749
  {
1454
- type: 'function',
1455
- name: 'modifyPolicyWhitelist',
750
+ name: 'FeeSwap',
751
+ type: 'event',
1456
752
  inputs: [
1457
- { name: 'policyId', type: 'uint64', internalType: 'uint64' },
1458
- { name: 'account', type: 'address', internalType: 'address' },
1459
- { name: 'allowed', type: 'bool', internalType: 'bool' },
1460
- ],
1461
- outputs: [],
1462
- stateMutability: 'nonpayable',
753
+ { type: 'address', name: 'userToken', indexed: true },
754
+ { type: 'address', name: 'validatorToken', indexed: true },
755
+ { type: 'uint256', name: 'amountIn' },
756
+ { type: 'uint256', name: 'amountOut' },
757
+ ],
758
+ },
759
+ { name: 'IdenticalAddresses', type: 'error', inputs: [] },
760
+ { name: 'ZeroAddress', type: 'error', inputs: [] },
761
+ { name: 'PoolExists', type: 'error', inputs: [] },
762
+ { name: 'PoolDoesNotExist', type: 'error', inputs: [] },
763
+ { name: 'InvalidToken', type: 'error', inputs: [] },
764
+ { name: 'InsufficientLiquidity', type: 'error', inputs: [] },
765
+ { name: 'OnlyProtocol', type: 'error', inputs: [] },
766
+ { name: 'InsufficientPoolBalance', type: 'error', inputs: [] },
767
+ { name: 'InsufficientReserves', type: 'error', inputs: [] },
768
+ { name: 'InsufficientLiquidityBalance', type: 'error', inputs: [] },
769
+ { name: 'MustDepositLowerBalanceToken', type: 'error', inputs: [] },
770
+ { name: 'InvalidAmount', type: 'error', inputs: [] },
771
+ { name: 'InvalidRebalanceState', type: 'error', inputs: [] },
772
+ { name: 'InvalidRebalanceDirection', type: 'error', inputs: [] },
773
+ { name: 'InvalidNewReserves', type: 'error', inputs: [] },
774
+ { name: 'CannotSupportPendingSwaps', type: 'error', inputs: [] },
775
+ { name: 'DivisionByZero', type: 'error', inputs: [] },
776
+ { name: 'InvalidSwapCalculation', type: 'error', inputs: [] },
777
+ { name: 'InsufficientLiquidityForPending', type: 'error', inputs: [] },
778
+ { name: 'TokenTransferFailed', type: 'error', inputs: [] },
779
+ { name: 'InternalError', type: 'error', inputs: [] },
780
+ ] as const
781
+
782
+ export const feeManagerAbi = [
783
+ {
784
+ name: 'BASIS_POINTS',
785
+ type: 'function',
786
+ stateMutability: 'pure',
787
+ inputs: [],
788
+ outputs: [{ type: 'uint256' }],
1463
789
  },
1464
790
  {
791
+ name: 'FEE_BPS',
792
+ type: 'function',
793
+ stateMutability: 'pure',
794
+ inputs: [],
795
+ outputs: [{ type: 'uint256' }],
796
+ },
797
+ {
798
+ name: 'userTokens',
1465
799
  type: 'function',
1466
- name: 'policyData',
1467
- inputs: [{ name: '', type: 'uint64', internalType: 'uint64' }],
1468
- outputs: [
1469
- {
1470
- name: 'policyType',
1471
- type: 'uint8',
1472
- internalType: 'enum TIP403Registry.PolicyType',
1473
- },
1474
- { name: 'admin', type: 'address', internalType: 'address' },
1475
- ],
1476
800
  stateMutability: 'view',
801
+ inputs: [{ type: 'address', name: 'user' }],
802
+ outputs: [{ type: 'address' }],
1477
803
  },
1478
804
  {
805
+ name: 'validatorTokens',
1479
806
  type: 'function',
1480
- name: 'policyIdCounter',
1481
- inputs: [],
1482
- outputs: [{ name: '', type: 'uint64', internalType: 'uint64' }],
1483
807
  stateMutability: 'view',
808
+ inputs: [{ type: 'address', name: 'validator' }],
809
+ outputs: [{ type: 'address' }],
1484
810
  },
1485
811
  {
812
+ name: 'setUserToken',
1486
813
  type: 'function',
1487
- name: 'setPolicyAdmin',
1488
- inputs: [
1489
- { name: 'policyId', type: 'uint64', internalType: 'uint64' },
1490
- { name: 'admin', type: 'address', internalType: 'address' },
1491
- ],
814
+ stateMutability: 'nonpayable',
815
+ inputs: [{ type: 'address', name: 'token' }],
1492
816
  outputs: [],
817
+ },
818
+ {
819
+ name: 'setValidatorToken',
820
+ type: 'function',
1493
821
  stateMutability: 'nonpayable',
822
+ inputs: [{ type: 'address', name: 'token' }],
823
+ outputs: [],
1494
824
  },
1495
825
  {
1496
- type: 'event',
1497
- name: 'BlacklistUpdated',
826
+ name: 'getFeeTokenBalance',
827
+ type: 'function',
828
+ stateMutability: 'view',
1498
829
  inputs: [
1499
- {
1500
- name: 'policyId',
1501
- type: 'uint64',
1502
- indexed: true,
1503
- internalType: 'uint64',
1504
- },
1505
- {
1506
- name: 'updater',
1507
- type: 'address',
1508
- indexed: true,
1509
- internalType: 'address',
1510
- },
1511
- {
1512
- name: 'account',
1513
- type: 'address',
1514
- indexed: true,
1515
- internalType: 'address',
1516
- },
1517
- {
1518
- name: 'restricted',
1519
- type: 'bool',
1520
- indexed: false,
1521
- internalType: 'bool',
1522
- },
830
+ { type: 'address', name: 'sender' },
831
+ { type: 'address', name: 'validator' },
1523
832
  ],
1524
- anonymous: false,
833
+ outputs: [{ type: 'address' }, { type: 'uint256' }],
1525
834
  },
1526
835
  {
1527
- type: 'event',
1528
- name: 'PolicyAdminUpdated',
1529
- inputs: [
1530
- {
1531
- name: 'policyId',
1532
- type: 'uint64',
1533
- indexed: true,
1534
- internalType: 'uint64',
1535
- },
1536
- {
1537
- name: 'updater',
1538
- type: 'address',
1539
- indexed: true,
1540
- internalType: 'address',
1541
- },
1542
- {
1543
- name: 'admin',
1544
- type: 'address',
1545
- indexed: true,
1546
- internalType: 'address',
1547
- },
1548
- ],
1549
- anonymous: false,
836
+ name: 'executeBlock',
837
+ type: 'function',
838
+ stateMutability: 'nonpayable',
839
+ inputs: [],
840
+ outputs: [],
1550
841
  },
1551
842
  {
843
+ name: 'UserTokenSet',
1552
844
  type: 'event',
1553
- name: 'PolicyCreated',
1554
845
  inputs: [
1555
- {
1556
- name: 'policyId',
1557
- type: 'uint64',
1558
- indexed: true,
1559
- internalType: 'uint64',
1560
- },
1561
- {
1562
- name: 'updater',
1563
- type: 'address',
1564
- indexed: true,
1565
- internalType: 'address',
1566
- },
1567
- {
1568
- name: 'policyType',
1569
- type: 'uint8',
1570
- indexed: false,
1571
- internalType: 'enum TIP403Registry.PolicyType',
1572
- },
846
+ { type: 'address', name: 'user', indexed: true },
847
+ { type: 'address', name: 'token', indexed: true },
1573
848
  ],
1574
- anonymous: false,
1575
849
  },
1576
850
  {
851
+ name: 'ValidatorTokenSet',
1577
852
  type: 'event',
1578
- name: 'WhitelistUpdated',
1579
853
  inputs: [
1580
- {
1581
- name: 'policyId',
1582
- type: 'uint64',
1583
- indexed: true,
1584
- internalType: 'uint64',
1585
- },
1586
- {
1587
- name: 'updater',
1588
- type: 'address',
1589
- indexed: true,
1590
- internalType: 'address',
1591
- },
1592
- {
1593
- name: 'account',
1594
- type: 'address',
1595
- indexed: true,
1596
- internalType: 'address',
1597
- },
1598
- { name: 'allowed', type: 'bool', indexed: false, internalType: 'bool' },
854
+ { type: 'address', name: 'validator', indexed: true },
855
+ { type: 'address', name: 'token', indexed: true },
1599
856
  ],
1600
- anonymous: false,
1601
857
  },
1602
- { type: 'error', name: 'ArrayLengthMismatch', inputs: [] },
1603
- { type: 'error', name: 'IncompatiblePolicyType', inputs: [] },
1604
- { type: 'error', name: 'PolicyDoesNotExist', inputs: [] },
1605
- { type: 'error', name: 'Unauthorized', inputs: [] },
1606
- ])
858
+ { name: 'OnlyValidator', type: 'error', inputs: [] },
859
+ { name: 'OnlySystemContract', type: 'error', inputs: [] },
860
+ { name: 'InvalidToken', type: 'error', inputs: [] },
861
+ { name: 'PoolDoesNotExist', type: 'error', inputs: [] },
862
+ { name: 'InsufficientLiquidity', type: 'error', inputs: [] },
863
+ { name: 'InsufficientFeeTokenBalance', type: 'error', inputs: [] },
864
+ { name: 'InternalError', type: 'error', inputs: [] },
865
+ { name: 'CannotChangeWithinBlock', type: 'error', inputs: [] },
866
+ { name: 'TokenPolicyForbids', type: 'error', inputs: [] },
867
+ ] as const