@underscore-finance/sdk 1.2.20-next.0 → 1.2.20-next.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 (93) hide show
  1. package/AGENTS.md +28 -18
  2. package/abis.json +23476 -12295
  3. package/dist/contracts/Addys.d.ts +124 -0
  4. package/dist/contracts/Addys.d.ts.map +1 -0
  5. package/dist/contracts/Addys.js +134 -0
  6. package/dist/contracts/AgentSenderGeneric.d.ts +795 -153
  7. package/dist/contracts/AgentSenderGeneric.d.ts.map +1 -1
  8. package/dist/contracts/AgentSenderGeneric.js +892 -97
  9. package/dist/contracts/AgentSenderSpecial.d.ts +127 -0
  10. package/dist/contracts/AgentSenderSpecial.d.ts.map +1 -1
  11. package/dist/contracts/AgentSenderSpecial.js +139 -0
  12. package/dist/contracts/AgentSenderSpecialAdmin.d.ts +984 -0
  13. package/dist/contracts/AgentSenderSpecialAdmin.d.ts.map +1 -0
  14. package/dist/contracts/AgentSenderSpecialAdmin.js +1185 -0
  15. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +1010 -75
  16. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +1 -1
  17. package/dist/contracts/AgentSenderSpecialSigHelper.js +1240 -0
  18. package/dist/contracts/AgentWrapper.d.ts +164 -6
  19. package/dist/contracts/AgentWrapper.d.ts.map +1 -1
  20. package/dist/contracts/AgentWrapper.js +219 -6
  21. package/dist/contracts/ChequeBook.d.ts +360 -204
  22. package/dist/contracts/ChequeBook.d.ts.map +1 -1
  23. package/dist/contracts/ChequeBook.js +507 -298
  24. package/dist/contracts/DefaultsLocal.d.ts +320 -0
  25. package/dist/contracts/DefaultsLocal.d.ts.map +1 -0
  26. package/dist/contracts/DefaultsLocal.js +350 -0
  27. package/dist/contracts/ERC20.d.ts +552 -27
  28. package/dist/contracts/ERC20.d.ts.map +1 -1
  29. package/dist/contracts/ERC20.js +713 -66
  30. package/dist/contracts/EarnVault.d.ts +284 -255
  31. package/dist/contracts/EarnVault.d.ts.map +1 -1
  32. package/dist/contracts/EarnVault.js +488 -456
  33. package/dist/contracts/EarnVaultAgent.d.ts +127 -0
  34. package/dist/contracts/EarnVaultAgent.d.ts.map +1 -1
  35. package/dist/contracts/EarnVaultAgent.js +139 -0
  36. package/dist/contracts/EarnVaultWallet.d.ts +777 -0
  37. package/dist/contracts/EarnVaultWallet.d.ts.map +1 -0
  38. package/dist/contracts/EarnVaultWallet.js +987 -0
  39. package/dist/contracts/Erc20Token.d.ts +813 -0
  40. package/dist/contracts/Erc20Token.d.ts.map +1 -0
  41. package/dist/contracts/Erc20Token.js +1006 -0
  42. package/dist/contracts/HighCommand.d.ts +40 -0
  43. package/dist/contracts/HighCommand.d.ts.map +1 -1
  44. package/dist/contracts/HighCommand.js +45 -0
  45. package/dist/contracts/Kernel.d.ts +4 -0
  46. package/dist/contracts/Kernel.d.ts.map +1 -1
  47. package/dist/contracts/Kernel.js +4 -0
  48. package/dist/contracts/Ledger.d.ts +4 -75
  49. package/dist/contracts/Ledger.d.ts.map +1 -1
  50. package/dist/contracts/Ledger.js +4 -99
  51. package/dist/contracts/LevgVault.d.ts +299 -299
  52. package/dist/contracts/LevgVault.d.ts.map +1 -1
  53. package/dist/contracts/LevgVault.js +530 -530
  54. package/dist/contracts/LevgVaultAgent.d.ts +127 -69
  55. package/dist/contracts/LevgVaultAgent.d.ts.map +1 -1
  56. package/dist/contracts/LevgVaultAgent.js +134 -79
  57. package/dist/contracts/LevgVaultWallet.d.ts +1119 -0
  58. package/dist/contracts/LevgVaultWallet.d.ts.map +1 -0
  59. package/dist/contracts/LevgVaultWallet.js +1439 -0
  60. package/dist/contracts/LocalGov.d.ts +427 -0
  61. package/dist/contracts/LocalGov.d.ts.map +1 -0
  62. package/dist/contracts/LocalGov.js +507 -0
  63. package/dist/contracts/Migrator.d.ts +160 -0
  64. package/dist/contracts/Migrator.d.ts.map +1 -1
  65. package/dist/contracts/Migrator.js +187 -0
  66. package/dist/contracts/Ownership.d.ts +414 -0
  67. package/dist/contracts/Ownership.d.ts.map +1 -0
  68. package/dist/contracts/Ownership.js +472 -0
  69. package/dist/contracts/Paymaster.d.ts +119 -322
  70. package/dist/contracts/Paymaster.d.ts.map +1 -1
  71. package/dist/contracts/Paymaster.js +118 -404
  72. package/dist/contracts/Sentinel.d.ts +9 -6
  73. package/dist/contracts/Sentinel.d.ts.map +1 -1
  74. package/dist/contracts/Sentinel.js +8 -4
  75. package/dist/contracts/UndyToken.d.ts +821 -0
  76. package/dist/contracts/UndyToken.d.ts.map +1 -0
  77. package/dist/contracts/UndyToken.js +1017 -0
  78. package/dist/contracts/UserWalletConfig.d.ts +334 -317
  79. package/dist/contracts/UserWalletConfig.d.ts.map +1 -1
  80. package/dist/contracts/UserWalletConfig.js +391 -371
  81. package/dist/contracts/UserWalletSignatureHelper.d.ts +1520 -514
  82. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +1 -1
  83. package/dist/contracts/UserWalletSignatureHelper.js +1906 -549
  84. package/dist/contracts/VaultErc20Token.d.ts +522 -0
  85. package/dist/contracts/VaultErc20Token.d.ts.map +1 -0
  86. package/dist/contracts/VaultErc20Token.js +658 -0
  87. package/dist/contracts/index.d.ts +10 -0
  88. package/dist/contracts/index.d.ts.map +1 -1
  89. package/dist/contracts/index.js +10 -0
  90. package/dist/contracts/sdk.d.ts +20 -0
  91. package/dist/contracts/sdk.d.ts.map +1 -1
  92. package/dist/contracts/sdk.js +20 -0
  93. package/package.json +1 -1
@@ -0,0 +1,507 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ import { encodeEventTopics, parseEventLogs } from 'viem';
7
+ export const abi = [
8
+ {
9
+ "name": "GovChangeStarted",
10
+ "inputs": [
11
+ {
12
+ "name": "prevGov",
13
+ "type": "address",
14
+ "indexed": true
15
+ },
16
+ {
17
+ "name": "newGov",
18
+ "type": "address",
19
+ "indexed": true
20
+ },
21
+ {
22
+ "name": "confirmBlock",
23
+ "type": "uint256",
24
+ "indexed": false
25
+ }
26
+ ],
27
+ "anonymous": false,
28
+ "type": "event"
29
+ },
30
+ {
31
+ "name": "GovChangeConfirmed",
32
+ "inputs": [
33
+ {
34
+ "name": "prevGov",
35
+ "type": "address",
36
+ "indexed": true
37
+ },
38
+ {
39
+ "name": "newGov",
40
+ "type": "address",
41
+ "indexed": true
42
+ },
43
+ {
44
+ "name": "initiatedBlock",
45
+ "type": "uint256",
46
+ "indexed": false
47
+ },
48
+ {
49
+ "name": "confirmBlock",
50
+ "type": "uint256",
51
+ "indexed": false
52
+ }
53
+ ],
54
+ "anonymous": false,
55
+ "type": "event"
56
+ },
57
+ {
58
+ "name": "GovChangeCancelled",
59
+ "inputs": [
60
+ {
61
+ "name": "cancelledGov",
62
+ "type": "address",
63
+ "indexed": true
64
+ },
65
+ {
66
+ "name": "initiatedBlock",
67
+ "type": "uint256",
68
+ "indexed": false
69
+ },
70
+ {
71
+ "name": "confirmBlock",
72
+ "type": "uint256",
73
+ "indexed": false
74
+ }
75
+ ],
76
+ "anonymous": false,
77
+ "type": "event"
78
+ },
79
+ {
80
+ "name": "GovRelinquished",
81
+ "inputs": [
82
+ {
83
+ "name": "prevGov",
84
+ "type": "address",
85
+ "indexed": true
86
+ }
87
+ ],
88
+ "anonymous": false,
89
+ "type": "event"
90
+ },
91
+ {
92
+ "name": "GovChangeTimeLockModified",
93
+ "inputs": [
94
+ {
95
+ "name": "prevTimeLock",
96
+ "type": "uint256",
97
+ "indexed": false
98
+ },
99
+ {
100
+ "name": "newTimeLock",
101
+ "type": "uint256",
102
+ "indexed": false
103
+ }
104
+ ],
105
+ "anonymous": false,
106
+ "type": "event"
107
+ },
108
+ {
109
+ "name": "UndyHqSetupFinished",
110
+ "inputs": [
111
+ {
112
+ "name": "prevGov",
113
+ "type": "address",
114
+ "indexed": true
115
+ },
116
+ {
117
+ "name": "newGov",
118
+ "type": "address",
119
+ "indexed": true
120
+ },
121
+ {
122
+ "name": "timeLock",
123
+ "type": "uint256",
124
+ "indexed": false
125
+ }
126
+ ],
127
+ "anonymous": false,
128
+ "type": "event"
129
+ },
130
+ {
131
+ "stateMutability": "view",
132
+ "type": "function",
133
+ "name": "getUndyHqFromGov",
134
+ "inputs": [],
135
+ "outputs": [
136
+ {
137
+ "name": "",
138
+ "type": "address"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "stateMutability": "view",
144
+ "type": "function",
145
+ "name": "canGovern",
146
+ "inputs": [
147
+ {
148
+ "name": "_addr",
149
+ "type": "address"
150
+ }
151
+ ],
152
+ "outputs": [
153
+ {
154
+ "name": "",
155
+ "type": "bool"
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "stateMutability": "view",
161
+ "type": "function",
162
+ "name": "getGovernors",
163
+ "inputs": [],
164
+ "outputs": [
165
+ {
166
+ "name": "",
167
+ "type": "address[]"
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ "stateMutability": "view",
173
+ "type": "function",
174
+ "name": "hasPendingGovChange",
175
+ "inputs": [],
176
+ "outputs": [
177
+ {
178
+ "name": "",
179
+ "type": "bool"
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ "stateMutability": "nonpayable",
185
+ "type": "function",
186
+ "name": "startGovernanceChange",
187
+ "inputs": [
188
+ {
189
+ "name": "_newGov",
190
+ "type": "address"
191
+ }
192
+ ],
193
+ "outputs": []
194
+ },
195
+ {
196
+ "stateMutability": "nonpayable",
197
+ "type": "function",
198
+ "name": "confirmGovernanceChange",
199
+ "inputs": [],
200
+ "outputs": []
201
+ },
202
+ {
203
+ "stateMutability": "nonpayable",
204
+ "type": "function",
205
+ "name": "cancelGovernanceChange",
206
+ "inputs": [],
207
+ "outputs": []
208
+ },
209
+ {
210
+ "stateMutability": "nonpayable",
211
+ "type": "function",
212
+ "name": "relinquishGov",
213
+ "inputs": [],
214
+ "outputs": []
215
+ },
216
+ {
217
+ "stateMutability": "nonpayable",
218
+ "type": "function",
219
+ "name": "setGovTimeLock",
220
+ "inputs": [
221
+ {
222
+ "name": "_numBlocks",
223
+ "type": "uint256"
224
+ }
225
+ ],
226
+ "outputs": [
227
+ {
228
+ "name": "",
229
+ "type": "bool"
230
+ }
231
+ ]
232
+ },
233
+ {
234
+ "stateMutability": "view",
235
+ "type": "function",
236
+ "name": "isValidGovTimeLock",
237
+ "inputs": [
238
+ {
239
+ "name": "_newTimeLock",
240
+ "type": "uint256"
241
+ }
242
+ ],
243
+ "outputs": [
244
+ {
245
+ "name": "",
246
+ "type": "bool"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "stateMutability": "view",
252
+ "type": "function",
253
+ "name": "minGovChangeTimeLock",
254
+ "inputs": [],
255
+ "outputs": [
256
+ {
257
+ "name": "",
258
+ "type": "uint256"
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "stateMutability": "view",
264
+ "type": "function",
265
+ "name": "maxGovChangeTimeLock",
266
+ "inputs": [],
267
+ "outputs": [
268
+ {
269
+ "name": "",
270
+ "type": "uint256"
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "stateMutability": "nonpayable",
276
+ "type": "function",
277
+ "name": "finishUndyHqSetup",
278
+ "inputs": [
279
+ {
280
+ "name": "_newGov",
281
+ "type": "address"
282
+ }
283
+ ],
284
+ "outputs": [
285
+ {
286
+ "name": "",
287
+ "type": "bool"
288
+ }
289
+ ]
290
+ },
291
+ {
292
+ "stateMutability": "nonpayable",
293
+ "type": "function",
294
+ "name": "finishUndyHqSetup",
295
+ "inputs": [
296
+ {
297
+ "name": "_newGov",
298
+ "type": "address"
299
+ },
300
+ {
301
+ "name": "_timeLock",
302
+ "type": "uint256"
303
+ }
304
+ ],
305
+ "outputs": [
306
+ {
307
+ "name": "",
308
+ "type": "bool"
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ "stateMutability": "view",
314
+ "type": "function",
315
+ "name": "governance",
316
+ "inputs": [],
317
+ "outputs": [
318
+ {
319
+ "name": "",
320
+ "type": "address"
321
+ }
322
+ ]
323
+ },
324
+ {
325
+ "stateMutability": "view",
326
+ "type": "function",
327
+ "name": "pendingGov",
328
+ "inputs": [],
329
+ "outputs": [
330
+ {
331
+ "name": "",
332
+ "type": "tuple",
333
+ "components": [
334
+ {
335
+ "name": "newGov",
336
+ "type": "address"
337
+ },
338
+ {
339
+ "name": "initiatedBlock",
340
+ "type": "uint256"
341
+ },
342
+ {
343
+ "name": "confirmBlock",
344
+ "type": "uint256"
345
+ }
346
+ ]
347
+ }
348
+ ]
349
+ },
350
+ {
351
+ "stateMutability": "view",
352
+ "type": "function",
353
+ "name": "numGovChanges",
354
+ "inputs": [],
355
+ "outputs": [
356
+ {
357
+ "name": "",
358
+ "type": "uint256"
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ "stateMutability": "view",
364
+ "type": "function",
365
+ "name": "govChangeTimeLock",
366
+ "inputs": [],
367
+ "outputs": [
368
+ {
369
+ "name": "",
370
+ "type": "uint256"
371
+ }
372
+ ]
373
+ },
374
+ {
375
+ "stateMutability": "nonpayable",
376
+ "type": "constructor",
377
+ "inputs": [
378
+ {
379
+ "name": "_undyHq",
380
+ "type": "address"
381
+ },
382
+ {
383
+ "name": "_initialGov",
384
+ "type": "address"
385
+ },
386
+ {
387
+ "name": "_minTimeLock",
388
+ "type": "uint256"
389
+ },
390
+ {
391
+ "name": "_maxTimeLock",
392
+ "type": "uint256"
393
+ },
394
+ {
395
+ "name": "_initialTimeLock",
396
+ "type": "uint256"
397
+ }
398
+ ],
399
+ "outputs": []
400
+ }
401
+ ];
402
+ export const deployAddress = undefined;
403
+ function getRequest(method, args, contractAddressOrOptions) {
404
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
405
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
406
+ const call = {
407
+ contractName: 'LocalGov',
408
+ method,
409
+ args,
410
+ address,
411
+ deployAddress,
412
+ defaultValue,
413
+ getAbi: () => abi,
414
+ with: (options) => {
415
+ call.address = options.contractAddress;
416
+ call.defaultValue = options.defaultValue;
417
+ return call;
418
+ },
419
+ defaultTo: (defaultValue) => {
420
+ call.defaultValue = defaultValue;
421
+ return call;
422
+ },
423
+ at: (address) => {
424
+ call.address = address;
425
+ return call;
426
+ },
427
+ };
428
+ return call;
429
+ }
430
+ export const call = {
431
+ getUndyHqFromGov: (...args) => getRequest('getUndyHqFromGov', args),
432
+ canGovern: (...args) => getRequest('canGovern', args),
433
+ getGovernors: (...args) => getRequest('getGovernors', args),
434
+ hasPendingGovChange: (...args) => getRequest('hasPendingGovChange', args),
435
+ isValidGovTimeLock: (...args) => getRequest('isValidGovTimeLock', args),
436
+ minGovChangeTimeLock: (...args) => getRequest('minGovChangeTimeLock', args),
437
+ maxGovChangeTimeLock: (...args) => getRequest('maxGovChangeTimeLock', args),
438
+ governance: (...args) => getRequest('governance', args),
439
+ pendingGov: (...args) => getRequest('pendingGov', args),
440
+ numGovChanges: (...args) => getRequest('numGovChanges', args),
441
+ govChangeTimeLock: (...args) => getRequest('govChangeTimeLock', args),
442
+ };
443
+ function getMutation(functionName) {
444
+ return {
445
+ contractName: 'LocalGov',
446
+ functionName,
447
+ deployAddress,
448
+ argsType: undefined,
449
+ getAbi: () => abi,
450
+ };
451
+ }
452
+ export const mutation = {
453
+ startGovernanceChange: getMutation('startGovernanceChange'),
454
+ confirmGovernanceChange: getMutation('confirmGovernanceChange'),
455
+ cancelGovernanceChange: getMutation('cancelGovernanceChange'),
456
+ relinquishGov: getMutation('relinquishGov'),
457
+ setGovTimeLock: getMutation('setGovTimeLock'),
458
+ finishUndyHqSetup: getMutation('finishUndyHqSetup'),
459
+ };
460
+ export function parseEvents(eventName, events) {
461
+ return events.map((event) => {
462
+ return {
463
+ event,
464
+ parsed: parseEventLogs({
465
+ abi,
466
+ eventName,
467
+ logs: [event],
468
+ }),
469
+ };
470
+ });
471
+ }
472
+ export function getEventTopic(eventName) {
473
+ return encodeEventTopics({ abi, eventName })[0];
474
+ }
475
+ export function toSdk(deployAddress, publicClient, walletClient, addressResolver) {
476
+ return {
477
+ deployAddress,
478
+ abi,
479
+ events: {
480
+ GovChangeStarted: { topic: getEventTopic('GovChangeStarted'), parse: (events) => parseEvents('GovChangeStarted', events) },
481
+ GovChangeConfirmed: { topic: getEventTopic('GovChangeConfirmed'), parse: (events) => parseEvents('GovChangeConfirmed', events) },
482
+ GovChangeCancelled: { topic: getEventTopic('GovChangeCancelled'), parse: (events) => parseEvents('GovChangeCancelled', events) },
483
+ GovRelinquished: { topic: getEventTopic('GovRelinquished'), parse: (events) => parseEvents('GovRelinquished', events) },
484
+ GovChangeTimeLockModified: { topic: getEventTopic('GovChangeTimeLockModified'), parse: (events) => parseEvents('GovChangeTimeLockModified', events) },
485
+ UndyHqSetupFinished: { topic: getEventTopic('UndyHqSetupFinished'), parse: (events) => parseEvents('UndyHqSetupFinished', events) },
486
+ },
487
+ // Queries
488
+ getUndyHqFromGov: (...args) => singleQuery(publicClient, call.getUndyHqFromGov(...args).at(deployAddress), {}, addressResolver),
489
+ canGovern: (...args) => singleQuery(publicClient, call.canGovern(...args).at(deployAddress), {}, addressResolver),
490
+ getGovernors: (...args) => singleQuery(publicClient, call.getGovernors(...args).at(deployAddress), {}, addressResolver),
491
+ hasPendingGovChange: (...args) => singleQuery(publicClient, call.hasPendingGovChange(...args).at(deployAddress), {}, addressResolver),
492
+ isValidGovTimeLock: (...args) => singleQuery(publicClient, call.isValidGovTimeLock(...args).at(deployAddress), {}, addressResolver),
493
+ minGovChangeTimeLock: (...args) => singleQuery(publicClient, call.minGovChangeTimeLock(...args).at(deployAddress), {}, addressResolver),
494
+ maxGovChangeTimeLock: (...args) => singleQuery(publicClient, call.maxGovChangeTimeLock(...args).at(deployAddress), {}, addressResolver),
495
+ governance: (...args) => singleQuery(publicClient, call.governance(...args).at(deployAddress), {}, addressResolver),
496
+ pendingGov: (...args) => singleQuery(publicClient, call.pendingGov(...args).at(deployAddress), {}, addressResolver),
497
+ numGovChanges: (...args) => singleQuery(publicClient, call.numGovChanges(...args).at(deployAddress), {}, addressResolver),
498
+ govChangeTimeLock: (...args) => singleQuery(publicClient, call.govChangeTimeLock(...args).at(deployAddress), {}, addressResolver),
499
+ // Mutations
500
+ startGovernanceChange: (...args) => mutate(walletClient, mutation.startGovernanceChange, { address: deployAddress, addressResolver })(...args),
501
+ confirmGovernanceChange: (...args) => mutate(walletClient, mutation.confirmGovernanceChange, { address: deployAddress, addressResolver })(...args),
502
+ cancelGovernanceChange: (...args) => mutate(walletClient, mutation.cancelGovernanceChange, { address: deployAddress, addressResolver })(...args),
503
+ relinquishGov: (...args) => mutate(walletClient, mutation.relinquishGov, { address: deployAddress, addressResolver })(...args),
504
+ setGovTimeLock: (...args) => mutate(walletClient, mutation.setGovTimeLock, { address: deployAddress, addressResolver })(...args),
505
+ finishUndyHqSetup: (...args) => mutate(walletClient, mutation.finishUndyHqSetup, { address: deployAddress, addressResolver })(...args),
506
+ };
507
+ }