@underscore-finance/sdk 0.0.1

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 (84) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +131 -0
  3. package/dist/contracts/AddyRegistry.d.ts +471 -0
  4. package/dist/contracts/AddyRegistry.d.ts.map +1 -0
  5. package/dist/contracts/AddyRegistry.js +592 -0
  6. package/dist/contracts/AgentFactory.d.ts +966 -0
  7. package/dist/contracts/AgentFactory.d.ts.map +1 -0
  8. package/dist/contracts/AgentFactory.js +1227 -0
  9. package/dist/contracts/AgentTemplate.d.ts +2629 -0
  10. package/dist/contracts/AgentTemplate.d.ts.map +1 -0
  11. package/dist/contracts/AgentTemplate.js +3370 -0
  12. package/dist/contracts/ChainlinkFeeds.d.ts +567 -0
  13. package/dist/contracts/ChainlinkFeeds.d.ts.map +1 -0
  14. package/dist/contracts/ChainlinkFeeds.js +735 -0
  15. package/dist/contracts/LegoAaveV3.d.ts +894 -0
  16. package/dist/contracts/LegoAaveV3.d.ts.map +1 -0
  17. package/dist/contracts/LegoAaveV3.js +1165 -0
  18. package/dist/contracts/LegoAeroClassic.d.ts +1065 -0
  19. package/dist/contracts/LegoAeroClassic.d.ts.map +1 -0
  20. package/dist/contracts/LegoAeroClassic.js +1381 -0
  21. package/dist/contracts/LegoAeroSlipstream.d.ts +1161 -0
  22. package/dist/contracts/LegoAeroSlipstream.d.ts.map +1 -0
  23. package/dist/contracts/LegoAeroSlipstream.js +1506 -0
  24. package/dist/contracts/LegoCompoundV3.d.ts +921 -0
  25. package/dist/contracts/LegoCompoundV3.d.ts.map +1 -0
  26. package/dist/contracts/LegoCompoundV3.js +1200 -0
  27. package/dist/contracts/LegoCurve.d.ts +1050 -0
  28. package/dist/contracts/LegoCurve.d.ts.map +1 -0
  29. package/dist/contracts/LegoCurve.js +1354 -0
  30. package/dist/contracts/LegoEuler.d.ts +935 -0
  31. package/dist/contracts/LegoEuler.d.ts.map +1 -0
  32. package/dist/contracts/LegoEuler.js +1218 -0
  33. package/dist/contracts/LegoFluid.d.ts +875 -0
  34. package/dist/contracts/LegoFluid.d.ts.map +1 -0
  35. package/dist/contracts/LegoFluid.js +1141 -0
  36. package/dist/contracts/LegoHelper.d.ts +1555 -0
  37. package/dist/contracts/LegoHelper.d.ts.map +1 -0
  38. package/dist/contracts/LegoHelper.js +1945 -0
  39. package/dist/contracts/LegoMoonwell.d.ts +903 -0
  40. package/dist/contracts/LegoMoonwell.d.ts.map +1 -0
  41. package/dist/contracts/LegoMoonwell.js +1177 -0
  42. package/dist/contracts/LegoMorpho.d.ts +935 -0
  43. package/dist/contracts/LegoMorpho.d.ts.map +1 -0
  44. package/dist/contracts/LegoMorpho.js +1218 -0
  45. package/dist/contracts/LegoRegistry.d.ts +589 -0
  46. package/dist/contracts/LegoRegistry.d.ts.map +1 -0
  47. package/dist/contracts/LegoRegistry.js +746 -0
  48. package/dist/contracts/LegoSky.d.ts +784 -0
  49. package/dist/contracts/LegoSky.d.ts.map +1 -0
  50. package/dist/contracts/LegoSky.js +1015 -0
  51. package/dist/contracts/LegoUniswapV2.d.ts +1065 -0
  52. package/dist/contracts/LegoUniswapV2.d.ts.map +1 -0
  53. package/dist/contracts/LegoUniswapV2.js +1381 -0
  54. package/dist/contracts/LegoUniswapV3.d.ts +1199 -0
  55. package/dist/contracts/LegoUniswapV3.d.ts.map +1 -0
  56. package/dist/contracts/LegoUniswapV3.js +1553 -0
  57. package/dist/contracts/OracleRegistry.d.ts +811 -0
  58. package/dist/contracts/OracleRegistry.d.ts.map +1 -0
  59. package/dist/contracts/OracleRegistry.js +1049 -0
  60. package/dist/contracts/PriceSheets.d.ts +1053 -0
  61. package/dist/contracts/PriceSheets.d.ts.map +1 -0
  62. package/dist/contracts/PriceSheets.js +1296 -0
  63. package/dist/contracts/PythFeeds.d.ts +501 -0
  64. package/dist/contracts/PythFeeds.d.ts.map +1 -0
  65. package/dist/contracts/PythFeeds.js +648 -0
  66. package/dist/contracts/StorkFeeds.d.ts +501 -0
  67. package/dist/contracts/StorkFeeds.d.ts.map +1 -0
  68. package/dist/contracts/StorkFeeds.js +648 -0
  69. package/dist/contracts/WalletConfig.d.ts +1398 -0
  70. package/dist/contracts/WalletConfig.d.ts.map +1 -0
  71. package/dist/contracts/WalletConfig.js +1674 -0
  72. package/dist/contracts/WalletFunds.d.ts +1978 -0
  73. package/dist/contracts/WalletFunds.d.ts.map +1 -0
  74. package/dist/contracts/WalletFunds.js +2579 -0
  75. package/dist/contracts/index.d.ts +25 -0
  76. package/dist/contracts/index.d.ts.map +1 -0
  77. package/dist/contracts/index.js +28 -0
  78. package/dist/contracts/sdk.d.ts +53 -0
  79. package/dist/contracts/sdk.d.ts.map +1 -0
  80. package/dist/contracts/sdk.js +56 -0
  81. package/dist/index.d.ts +15 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +16 -0
  84. package/package.json +31 -0
@@ -0,0 +1,592 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ export const abi = [
7
+ {
8
+ "anonymous": false,
9
+ "inputs": [
10
+ {
11
+ "indexed": true,
12
+ "name": "addr",
13
+ "type": "address"
14
+ },
15
+ {
16
+ "indexed": false,
17
+ "name": "addyId",
18
+ "type": "uint256"
19
+ },
20
+ {
21
+ "indexed": false,
22
+ "name": "description",
23
+ "type": "string"
24
+ }
25
+ ],
26
+ "name": "NewAddyRegistered",
27
+ "type": "event"
28
+ },
29
+ {
30
+ "anonymous": false,
31
+ "inputs": [
32
+ {
33
+ "indexed": true,
34
+ "name": "newAddr",
35
+ "type": "address"
36
+ },
37
+ {
38
+ "indexed": true,
39
+ "name": "prevAddy",
40
+ "type": "address"
41
+ },
42
+ {
43
+ "indexed": false,
44
+ "name": "addyId",
45
+ "type": "uint256"
46
+ },
47
+ {
48
+ "indexed": false,
49
+ "name": "version",
50
+ "type": "uint256"
51
+ },
52
+ {
53
+ "indexed": false,
54
+ "name": "description",
55
+ "type": "string"
56
+ }
57
+ ],
58
+ "name": "AddyIdUpdated",
59
+ "type": "event"
60
+ },
61
+ {
62
+ "anonymous": false,
63
+ "inputs": [
64
+ {
65
+ "indexed": true,
66
+ "name": "prevAddy",
67
+ "type": "address"
68
+ },
69
+ {
70
+ "indexed": false,
71
+ "name": "addyId",
72
+ "type": "uint256"
73
+ },
74
+ {
75
+ "indexed": false,
76
+ "name": "version",
77
+ "type": "uint256"
78
+ },
79
+ {
80
+ "indexed": false,
81
+ "name": "description",
82
+ "type": "string"
83
+ }
84
+ ],
85
+ "name": "AddyIdDisabled",
86
+ "type": "event"
87
+ },
88
+ {
89
+ "anonymous": false,
90
+ "inputs": [
91
+ {
92
+ "indexed": true,
93
+ "name": "governor",
94
+ "type": "address"
95
+ }
96
+ ],
97
+ "name": "AddyRegistryGovernorSet",
98
+ "type": "event"
99
+ },
100
+ {
101
+ "anonymous": false,
102
+ "inputs": [
103
+ {
104
+ "indexed": false,
105
+ "name": "isActivated",
106
+ "type": "bool"
107
+ }
108
+ ],
109
+ "name": "AddyRegistryActivated",
110
+ "type": "event"
111
+ },
112
+ {
113
+ "inputs": [
114
+ {
115
+ "name": "_addy",
116
+ "type": "address"
117
+ }
118
+ ],
119
+ "name": "isValidNewAddy",
120
+ "outputs": [
121
+ {
122
+ "name": "",
123
+ "type": "bool"
124
+ }
125
+ ],
126
+ "stateMutability": "view",
127
+ "type": "function"
128
+ },
129
+ {
130
+ "inputs": [
131
+ {
132
+ "name": "_addy",
133
+ "type": "address"
134
+ },
135
+ {
136
+ "name": "_description",
137
+ "type": "string"
138
+ }
139
+ ],
140
+ "name": "registerNewAddy",
141
+ "outputs": [
142
+ {
143
+ "name": "",
144
+ "type": "uint256"
145
+ }
146
+ ],
147
+ "stateMutability": "nonpayable",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "inputs": [
152
+ {
153
+ "name": "_addyId",
154
+ "type": "uint256"
155
+ },
156
+ {
157
+ "name": "_newAddy",
158
+ "type": "address"
159
+ }
160
+ ],
161
+ "name": "isValidAddyUpdate",
162
+ "outputs": [
163
+ {
164
+ "name": "",
165
+ "type": "bool"
166
+ }
167
+ ],
168
+ "stateMutability": "view",
169
+ "type": "function"
170
+ },
171
+ {
172
+ "inputs": [
173
+ {
174
+ "name": "_addyId",
175
+ "type": "uint256"
176
+ },
177
+ {
178
+ "name": "_newAddy",
179
+ "type": "address"
180
+ }
181
+ ],
182
+ "name": "updateAddy",
183
+ "outputs": [
184
+ {
185
+ "name": "",
186
+ "type": "bool"
187
+ }
188
+ ],
189
+ "stateMutability": "nonpayable",
190
+ "type": "function"
191
+ },
192
+ {
193
+ "inputs": [
194
+ {
195
+ "name": "_addyId",
196
+ "type": "uint256"
197
+ }
198
+ ],
199
+ "name": "isValidAddyDisable",
200
+ "outputs": [
201
+ {
202
+ "name": "",
203
+ "type": "bool"
204
+ }
205
+ ],
206
+ "stateMutability": "view",
207
+ "type": "function"
208
+ },
209
+ {
210
+ "inputs": [
211
+ {
212
+ "name": "_addyId",
213
+ "type": "uint256"
214
+ }
215
+ ],
216
+ "name": "disableAddy",
217
+ "outputs": [
218
+ {
219
+ "name": "",
220
+ "type": "bool"
221
+ }
222
+ ],
223
+ "stateMutability": "nonpayable",
224
+ "type": "function"
225
+ },
226
+ {
227
+ "inputs": [
228
+ {
229
+ "name": "_addy",
230
+ "type": "address"
231
+ }
232
+ ],
233
+ "name": "isValidAddy",
234
+ "outputs": [
235
+ {
236
+ "name": "",
237
+ "type": "bool"
238
+ }
239
+ ],
240
+ "stateMutability": "view",
241
+ "type": "function"
242
+ },
243
+ {
244
+ "inputs": [
245
+ {
246
+ "name": "_addyId",
247
+ "type": "uint256"
248
+ }
249
+ ],
250
+ "name": "isValidAddyId",
251
+ "outputs": [
252
+ {
253
+ "name": "",
254
+ "type": "bool"
255
+ }
256
+ ],
257
+ "stateMutability": "view",
258
+ "type": "function"
259
+ },
260
+ {
261
+ "inputs": [
262
+ {
263
+ "name": "_addy",
264
+ "type": "address"
265
+ }
266
+ ],
267
+ "name": "getAddyId",
268
+ "outputs": [
269
+ {
270
+ "name": "",
271
+ "type": "uint256"
272
+ }
273
+ ],
274
+ "stateMutability": "view",
275
+ "type": "function"
276
+ },
277
+ {
278
+ "inputs": [
279
+ {
280
+ "name": "_addyId",
281
+ "type": "uint256"
282
+ }
283
+ ],
284
+ "name": "getAddy",
285
+ "outputs": [
286
+ {
287
+ "name": "",
288
+ "type": "address"
289
+ }
290
+ ],
291
+ "stateMutability": "view",
292
+ "type": "function"
293
+ },
294
+ {
295
+ "inputs": [
296
+ {
297
+ "name": "_addyId",
298
+ "type": "uint256"
299
+ }
300
+ ],
301
+ "name": "getAddyInfo",
302
+ "outputs": [
303
+ {
304
+ "components": [
305
+ {
306
+ "name": "addr",
307
+ "type": "address"
308
+ },
309
+ {
310
+ "name": "version",
311
+ "type": "uint256"
312
+ },
313
+ {
314
+ "name": "lastModified",
315
+ "type": "uint256"
316
+ },
317
+ {
318
+ "name": "description",
319
+ "type": "string"
320
+ }
321
+ ],
322
+ "name": "",
323
+ "type": "tuple"
324
+ }
325
+ ],
326
+ "stateMutability": "view",
327
+ "type": "function"
328
+ },
329
+ {
330
+ "inputs": [
331
+ {
332
+ "name": "_addyId",
333
+ "type": "uint256"
334
+ }
335
+ ],
336
+ "name": "getAddyDescription",
337
+ "outputs": [
338
+ {
339
+ "name": "",
340
+ "type": "string"
341
+ }
342
+ ],
343
+ "stateMutability": "view",
344
+ "type": "function"
345
+ },
346
+ {
347
+ "inputs": [],
348
+ "name": "getNumAddys",
349
+ "outputs": [
350
+ {
351
+ "name": "",
352
+ "type": "uint256"
353
+ }
354
+ ],
355
+ "stateMutability": "view",
356
+ "type": "function"
357
+ },
358
+ {
359
+ "inputs": [],
360
+ "name": "getLastAddy",
361
+ "outputs": [
362
+ {
363
+ "name": "",
364
+ "type": "address"
365
+ }
366
+ ],
367
+ "stateMutability": "view",
368
+ "type": "function"
369
+ },
370
+ {
371
+ "inputs": [],
372
+ "name": "getLastAddyId",
373
+ "outputs": [
374
+ {
375
+ "name": "",
376
+ "type": "uint256"
377
+ }
378
+ ],
379
+ "stateMutability": "view",
380
+ "type": "function"
381
+ },
382
+ {
383
+ "inputs": [
384
+ {
385
+ "name": "_newGovernor",
386
+ "type": "address"
387
+ }
388
+ ],
389
+ "name": "isValidGovernor",
390
+ "outputs": [
391
+ {
392
+ "name": "",
393
+ "type": "bool"
394
+ }
395
+ ],
396
+ "stateMutability": "view",
397
+ "type": "function"
398
+ },
399
+ {
400
+ "inputs": [
401
+ {
402
+ "name": "_newGovernor",
403
+ "type": "address"
404
+ }
405
+ ],
406
+ "name": "setGovernor",
407
+ "outputs": [
408
+ {
409
+ "name": "",
410
+ "type": "bool"
411
+ }
412
+ ],
413
+ "stateMutability": "nonpayable",
414
+ "type": "function"
415
+ },
416
+ {
417
+ "inputs": [
418
+ {
419
+ "name": "arg0",
420
+ "type": "uint256"
421
+ }
422
+ ],
423
+ "name": "addyInfo",
424
+ "outputs": [
425
+ {
426
+ "components": [
427
+ {
428
+ "name": "addr",
429
+ "type": "address"
430
+ },
431
+ {
432
+ "name": "version",
433
+ "type": "uint256"
434
+ },
435
+ {
436
+ "name": "lastModified",
437
+ "type": "uint256"
438
+ },
439
+ {
440
+ "name": "description",
441
+ "type": "string"
442
+ }
443
+ ],
444
+ "name": "",
445
+ "type": "tuple"
446
+ }
447
+ ],
448
+ "stateMutability": "view",
449
+ "type": "function"
450
+ },
451
+ {
452
+ "inputs": [
453
+ {
454
+ "name": "arg0",
455
+ "type": "address"
456
+ }
457
+ ],
458
+ "name": "addyToId",
459
+ "outputs": [
460
+ {
461
+ "name": "",
462
+ "type": "uint256"
463
+ }
464
+ ],
465
+ "stateMutability": "view",
466
+ "type": "function"
467
+ },
468
+ {
469
+ "inputs": [],
470
+ "name": "numAddys",
471
+ "outputs": [
472
+ {
473
+ "name": "",
474
+ "type": "uint256"
475
+ }
476
+ ],
477
+ "stateMutability": "view",
478
+ "type": "function"
479
+ },
480
+ {
481
+ "inputs": [],
482
+ "name": "governor",
483
+ "outputs": [
484
+ {
485
+ "name": "",
486
+ "type": "address"
487
+ }
488
+ ],
489
+ "stateMutability": "view",
490
+ "type": "function"
491
+ },
492
+ {
493
+ "inputs": [
494
+ {
495
+ "name": "_governor",
496
+ "type": "address"
497
+ }
498
+ ],
499
+ "outputs": [],
500
+ "stateMutability": "nonpayable",
501
+ "type": "constructor"
502
+ }
503
+ ];
504
+ export const deployAddress = undefined;
505
+ function getRequest(method, args, contractAddressOrOptions) {
506
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
507
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
508
+ const call = {
509
+ contractName: 'AddyRegistry',
510
+ method,
511
+ args,
512
+ address,
513
+ deployAddress,
514
+ defaultValue,
515
+ getAbi: () => abi,
516
+ with: (options) => {
517
+ call.address = options.contractAddress;
518
+ call.defaultValue = options.defaultValue;
519
+ return call;
520
+ },
521
+ defaultTo: (defaultValue) => {
522
+ call.defaultValue = defaultValue;
523
+ return call;
524
+ },
525
+ at: (address) => {
526
+ call.address = address;
527
+ return call;
528
+ },
529
+ };
530
+ return call;
531
+ }
532
+ export const call = {
533
+ isValidNewAddy: (...args) => getRequest('isValidNewAddy', args),
534
+ isValidAddyUpdate: (...args) => getRequest('isValidAddyUpdate', args),
535
+ isValidAddyDisable: (...args) => getRequest('isValidAddyDisable', args),
536
+ isValidAddy: (...args) => getRequest('isValidAddy', args),
537
+ isValidAddyId: (...args) => getRequest('isValidAddyId', args),
538
+ getAddyId: (...args) => getRequest('getAddyId', args),
539
+ getAddy: (...args) => getRequest('getAddy', args),
540
+ getAddyInfo: (...args) => getRequest('getAddyInfo', args),
541
+ getAddyDescription: (...args) => getRequest('getAddyDescription', args),
542
+ getNumAddys: (...args) => getRequest('getNumAddys', args),
543
+ getLastAddy: (...args) => getRequest('getLastAddy', args),
544
+ getLastAddyId: (...args) => getRequest('getLastAddyId', args),
545
+ isValidGovernor: (...args) => getRequest('isValidGovernor', args),
546
+ addyInfo: (...args) => getRequest('addyInfo', args),
547
+ addyToId: (...args) => getRequest('addyToId', args),
548
+ numAddys: (...args) => getRequest('numAddys', args),
549
+ governor: (...args) => getRequest('governor', args),
550
+ };
551
+ function getMutation(functionName) {
552
+ return {
553
+ contractName: 'AddyRegistry',
554
+ functionName,
555
+ deployAddress,
556
+ argsType: undefined,
557
+ getAbi: () => abi,
558
+ };
559
+ }
560
+ export const mutation = {
561
+ registerNewAddy: getMutation('registerNewAddy'),
562
+ updateAddy: getMutation('updateAddy'),
563
+ disableAddy: getMutation('disableAddy'),
564
+ setGovernor: getMutation('setGovernor'),
565
+ };
566
+ export function toSdk(publicClient, walletClient) {
567
+ return {
568
+ // Queries
569
+ isValidNewAddy: (...args) => singleQuery(publicClient, call.isValidNewAddy(...args)),
570
+ isValidAddyUpdate: (...args) => singleQuery(publicClient, call.isValidAddyUpdate(...args)),
571
+ isValidAddyDisable: (...args) => singleQuery(publicClient, call.isValidAddyDisable(...args)),
572
+ isValidAddy: (...args) => singleQuery(publicClient, call.isValidAddy(...args)),
573
+ isValidAddyId: (...args) => singleQuery(publicClient, call.isValidAddyId(...args)),
574
+ getAddyId: (...args) => singleQuery(publicClient, call.getAddyId(...args)),
575
+ getAddy: (...args) => singleQuery(publicClient, call.getAddy(...args)),
576
+ getAddyInfo: (...args) => singleQuery(publicClient, call.getAddyInfo(...args)),
577
+ getAddyDescription: (...args) => singleQuery(publicClient, call.getAddyDescription(...args)),
578
+ getNumAddys: (...args) => singleQuery(publicClient, call.getNumAddys(...args)),
579
+ getLastAddy: (...args) => singleQuery(publicClient, call.getLastAddy(...args)),
580
+ getLastAddyId: (...args) => singleQuery(publicClient, call.getLastAddyId(...args)),
581
+ isValidGovernor: (...args) => singleQuery(publicClient, call.isValidGovernor(...args)),
582
+ addyInfo: (...args) => singleQuery(publicClient, call.addyInfo(...args)),
583
+ addyToId: (...args) => singleQuery(publicClient, call.addyToId(...args)),
584
+ numAddys: (...args) => singleQuery(publicClient, call.numAddys(...args)),
585
+ governor: (...args) => singleQuery(publicClient, call.governor(...args)),
586
+ // Mutations
587
+ registerNewAddy: (...args) => mutate(walletClient, mutation.registerNewAddy)(...args),
588
+ updateAddy: (...args) => mutate(walletClient, mutation.updateAddy)(...args),
589
+ disableAddy: (...args) => mutate(walletClient, mutation.disableAddy)(...args),
590
+ setGovernor: (...args) => mutate(walletClient, mutation.setGovernor)(...args),
591
+ };
592
+ }