@ripe-finance/sdk 0.0.9 → 0.1.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 (59) hide show
  1. package/dist/contracts/BlueChipYieldPrices.d.ts +21 -0
  2. package/dist/contracts/BlueChipYieldPrices.d.ts.map +1 -1
  3. package/dist/contracts/BlueChipYieldPrices.js +26 -1
  4. package/dist/contracts/BondBooster.d.ts +546 -0
  5. package/dist/contracts/BondBooster.d.ts.map +1 -0
  6. package/dist/contracts/BondBooster.js +643 -0
  7. package/dist/contracts/BondRoom.d.ts +40 -1
  8. package/dist/contracts/BondRoom.d.ts.map +1 -1
  9. package/dist/contracts/BondRoom.js +50 -1
  10. package/dist/contracts/ChainlinkPrices.d.ts +21 -0
  11. package/dist/contracts/ChainlinkPrices.d.ts.map +1 -1
  12. package/dist/contracts/ChainlinkPrices.js +26 -1
  13. package/dist/contracts/CurvePrices.d.ts +21 -0
  14. package/dist/contracts/CurvePrices.d.ts.map +1 -1
  15. package/dist/contracts/CurvePrices.js +26 -1
  16. package/dist/contracts/DefaultsBase.d.ts +3 -0
  17. package/dist/contracts/DefaultsBase.d.ts.map +1 -1
  18. package/dist/contracts/DefaultsBase.js +5 -1
  19. package/dist/contracts/Endaoment.d.ts +1009 -732
  20. package/dist/contracts/Endaoment.d.ts.map +1 -1
  21. package/dist/contracts/Endaoment.js +1280 -880
  22. package/dist/contracts/PriceDesk.d.ts +21 -0
  23. package/dist/contracts/PriceDesk.d.ts.map +1 -1
  24. package/dist/contracts/PriceDesk.js +26 -1
  25. package/dist/contracts/PythPrices.d.ts +21 -0
  26. package/dist/contracts/PythPrices.d.ts.map +1 -1
  27. package/dist/contracts/PythPrices.js +26 -1
  28. package/dist/contracts/StorkPrices.d.ts +21 -0
  29. package/dist/contracts/StorkPrices.d.ts.map +1 -1
  30. package/dist/contracts/StorkPrices.js +26 -1
  31. package/dist/contracts/Switchboard.d.ts +21 -0
  32. package/dist/contracts/Switchboard.d.ts.map +1 -1
  33. package/dist/contracts/Switchboard.js +26 -1
  34. package/dist/contracts/SwitchboardAlpha.d.ts +21 -0
  35. package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -1
  36. package/dist/contracts/SwitchboardAlpha.js +26 -1
  37. package/dist/contracts/SwitchboardBravo.d.ts +21 -0
  38. package/dist/contracts/SwitchboardBravo.d.ts.map +1 -1
  39. package/dist/contracts/SwitchboardBravo.js +26 -1
  40. package/dist/contracts/SwitchboardCharlie.d.ts +235 -411
  41. package/dist/contracts/SwitchboardCharlie.d.ts.map +1 -1
  42. package/dist/contracts/SwitchboardCharlie.js +292 -527
  43. package/dist/contracts/SwitchboardDelta.d.ts +273 -0
  44. package/dist/contracts/SwitchboardDelta.d.ts.map +1 -1
  45. package/dist/contracts/SwitchboardDelta.js +337 -1
  46. package/dist/contracts/Teller.js +1 -1
  47. package/dist/contracts/VaultBook.d.ts +21 -0
  48. package/dist/contracts/VaultBook.d.ts.map +1 -1
  49. package/dist/contracts/VaultBook.js +26 -1
  50. package/dist/contracts/index.d.ts +1 -0
  51. package/dist/contracts/index.d.ts.map +1 -1
  52. package/dist/contracts/index.js +1 -0
  53. package/dist/contracts/sdk.d.ts +2 -0
  54. package/dist/contracts/sdk.d.ts.map +1 -1
  55. package/dist/contracts/sdk.js +2 -0
  56. package/dist/index.d.ts +87 -23
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +13 -1
  59. package/package.json +1 -1
@@ -0,0 +1,643 @@
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
+ name: 'BondBoostModified',
9
+ inputs: [
10
+ {
11
+ name: 'user',
12
+ type: 'address',
13
+ indexed: false,
14
+ },
15
+ {
16
+ name: 'ripePerUnit',
17
+ type: 'uint256',
18
+ indexed: false,
19
+ },
20
+ {
21
+ name: 'maxUnitsAllowed',
22
+ type: 'uint256',
23
+ indexed: false,
24
+ },
25
+ {
26
+ name: 'expireBlock',
27
+ type: 'uint256',
28
+ indexed: false,
29
+ },
30
+ ],
31
+ anonymous: false,
32
+ type: 'event',
33
+ },
34
+ {
35
+ name: 'ManyBondBoostersSet',
36
+ inputs: [
37
+ {
38
+ name: 'numBoosters',
39
+ type: 'uint256',
40
+ indexed: false,
41
+ },
42
+ ],
43
+ anonymous: false,
44
+ type: 'event',
45
+ },
46
+ {
47
+ name: 'BondBoostRemoved',
48
+ inputs: [
49
+ {
50
+ name: 'user',
51
+ type: 'address',
52
+ indexed: false,
53
+ },
54
+ ],
55
+ anonymous: false,
56
+ type: 'event',
57
+ },
58
+ {
59
+ name: 'MaxBoostAndMaxUnitsSet',
60
+ inputs: [
61
+ {
62
+ name: 'maxBoost',
63
+ type: 'uint256',
64
+ indexed: false,
65
+ },
66
+ {
67
+ name: 'maxUnits',
68
+ type: 'uint256',
69
+ indexed: false,
70
+ },
71
+ ],
72
+ anonymous: false,
73
+ type: 'event',
74
+ },
75
+ {
76
+ name: 'DepartmentPauseModified',
77
+ inputs: [
78
+ {
79
+ name: 'isPaused',
80
+ type: 'bool',
81
+ indexed: false,
82
+ },
83
+ ],
84
+ anonymous: false,
85
+ type: 'event',
86
+ },
87
+ {
88
+ name: 'DepartmentFundsRecovered',
89
+ inputs: [
90
+ {
91
+ name: 'asset',
92
+ type: 'address',
93
+ indexed: true,
94
+ },
95
+ {
96
+ name: 'recipient',
97
+ type: 'address',
98
+ indexed: true,
99
+ },
100
+ {
101
+ name: 'balance',
102
+ type: 'uint256',
103
+ indexed: false,
104
+ },
105
+ ],
106
+ anonymous: false,
107
+ type: 'event',
108
+ },
109
+ {
110
+ stateMutability: 'view',
111
+ type: 'function',
112
+ name: 'getAddys',
113
+ inputs: [],
114
+ outputs: [
115
+ {
116
+ name: '',
117
+ type: 'tuple',
118
+ components: [
119
+ {
120
+ name: 'hq',
121
+ type: 'address',
122
+ },
123
+ {
124
+ name: 'greenToken',
125
+ type: 'address',
126
+ },
127
+ {
128
+ name: 'savingsGreen',
129
+ type: 'address',
130
+ },
131
+ {
132
+ name: 'ripeToken',
133
+ type: 'address',
134
+ },
135
+ {
136
+ name: 'ledger',
137
+ type: 'address',
138
+ },
139
+ {
140
+ name: 'missionControl',
141
+ type: 'address',
142
+ },
143
+ {
144
+ name: 'switchboard',
145
+ type: 'address',
146
+ },
147
+ {
148
+ name: 'priceDesk',
149
+ type: 'address',
150
+ },
151
+ {
152
+ name: 'vaultBook',
153
+ type: 'address',
154
+ },
155
+ {
156
+ name: 'auctionHouse',
157
+ type: 'address',
158
+ },
159
+ {
160
+ name: 'auctionHouseNft',
161
+ type: 'address',
162
+ },
163
+ {
164
+ name: 'boardroom',
165
+ type: 'address',
166
+ },
167
+ {
168
+ name: 'bondRoom',
169
+ type: 'address',
170
+ },
171
+ {
172
+ name: 'creditEngine',
173
+ type: 'address',
174
+ },
175
+ {
176
+ name: 'endaoment',
177
+ type: 'address',
178
+ },
179
+ {
180
+ name: 'humanResources',
181
+ type: 'address',
182
+ },
183
+ {
184
+ name: 'lootbox',
185
+ type: 'address',
186
+ },
187
+ {
188
+ name: 'teller',
189
+ type: 'address',
190
+ },
191
+ ],
192
+ },
193
+ ],
194
+ },
195
+ {
196
+ stateMutability: 'view',
197
+ type: 'function',
198
+ name: 'getRipeHq',
199
+ inputs: [],
200
+ outputs: [
201
+ {
202
+ name: '',
203
+ type: 'address',
204
+ },
205
+ ],
206
+ },
207
+ {
208
+ stateMutability: 'view',
209
+ type: 'function',
210
+ name: 'canMintGreen',
211
+ inputs: [],
212
+ outputs: [
213
+ {
214
+ name: '',
215
+ type: 'bool',
216
+ },
217
+ ],
218
+ },
219
+ {
220
+ stateMutability: 'view',
221
+ type: 'function',
222
+ name: 'canMintRipe',
223
+ inputs: [],
224
+ outputs: [
225
+ {
226
+ name: '',
227
+ type: 'bool',
228
+ },
229
+ ],
230
+ },
231
+ {
232
+ stateMutability: 'nonpayable',
233
+ type: 'function',
234
+ name: 'pause',
235
+ inputs: [
236
+ {
237
+ name: '_shouldPause',
238
+ type: 'bool',
239
+ },
240
+ ],
241
+ outputs: [],
242
+ },
243
+ {
244
+ stateMutability: 'nonpayable',
245
+ type: 'function',
246
+ name: 'recoverFunds',
247
+ inputs: [
248
+ {
249
+ name: '_recipient',
250
+ type: 'address',
251
+ },
252
+ {
253
+ name: '_asset',
254
+ type: 'address',
255
+ },
256
+ ],
257
+ outputs: [],
258
+ },
259
+ {
260
+ stateMutability: 'nonpayable',
261
+ type: 'function',
262
+ name: 'recoverFundsMany',
263
+ inputs: [
264
+ {
265
+ name: '_recipient',
266
+ type: 'address',
267
+ },
268
+ {
269
+ name: '_assets',
270
+ type: 'address[]',
271
+ },
272
+ ],
273
+ outputs: [],
274
+ },
275
+ {
276
+ stateMutability: 'view',
277
+ type: 'function',
278
+ name: 'isPaused',
279
+ inputs: [],
280
+ outputs: [
281
+ {
282
+ name: '',
283
+ type: 'bool',
284
+ },
285
+ ],
286
+ },
287
+ {
288
+ stateMutability: 'view',
289
+ type: 'function',
290
+ name: 'getBoostedRipe',
291
+ inputs: [
292
+ {
293
+ name: '_user',
294
+ type: 'address',
295
+ },
296
+ {
297
+ name: '_units',
298
+ type: 'uint256',
299
+ },
300
+ ],
301
+ outputs: [
302
+ {
303
+ name: '',
304
+ type: 'uint256',
305
+ },
306
+ ],
307
+ },
308
+ {
309
+ stateMutability: 'nonpayable',
310
+ type: 'function',
311
+ name: 'addNewUnitsUsed',
312
+ inputs: [
313
+ {
314
+ name: '_user',
315
+ type: 'address',
316
+ },
317
+ {
318
+ name: '_newUnits',
319
+ type: 'uint256',
320
+ },
321
+ ],
322
+ outputs: [],
323
+ },
324
+ {
325
+ stateMutability: 'nonpayable',
326
+ type: 'function',
327
+ name: 'setBondBooster',
328
+ inputs: [
329
+ {
330
+ name: '_config',
331
+ type: 'tuple',
332
+ components: [
333
+ {
334
+ name: 'user',
335
+ type: 'address',
336
+ },
337
+ {
338
+ name: 'ripePerUnit',
339
+ type: 'uint256',
340
+ },
341
+ {
342
+ name: 'maxUnitsAllowed',
343
+ type: 'uint256',
344
+ },
345
+ {
346
+ name: 'expireBlock',
347
+ type: 'uint256',
348
+ },
349
+ ],
350
+ },
351
+ ],
352
+ outputs: [],
353
+ },
354
+ {
355
+ stateMutability: 'nonpayable',
356
+ type: 'function',
357
+ name: 'setManyBondBoosters',
358
+ inputs: [
359
+ {
360
+ name: '_boosters',
361
+ type: 'tuple[]',
362
+ components: [
363
+ {
364
+ name: 'user',
365
+ type: 'address',
366
+ },
367
+ {
368
+ name: 'ripePerUnit',
369
+ type: 'uint256',
370
+ },
371
+ {
372
+ name: 'maxUnitsAllowed',
373
+ type: 'uint256',
374
+ },
375
+ {
376
+ name: 'expireBlock',
377
+ type: 'uint256',
378
+ },
379
+ ],
380
+ },
381
+ ],
382
+ outputs: [],
383
+ },
384
+ {
385
+ stateMutability: 'nonpayable',
386
+ type: 'function',
387
+ name: 'removeManyBondBoosters',
388
+ inputs: [
389
+ {
390
+ name: '_users',
391
+ type: 'address[]',
392
+ },
393
+ ],
394
+ outputs: [],
395
+ },
396
+ {
397
+ stateMutability: 'nonpayable',
398
+ type: 'function',
399
+ name: 'removeBondBooster',
400
+ inputs: [
401
+ {
402
+ name: '_user',
403
+ type: 'address',
404
+ },
405
+ ],
406
+ outputs: [],
407
+ },
408
+ {
409
+ stateMutability: 'nonpayable',
410
+ type: 'function',
411
+ name: 'setMaxBoostAndMaxUnits',
412
+ inputs: [
413
+ {
414
+ name: '_maxBoost',
415
+ type: 'uint256',
416
+ },
417
+ {
418
+ name: '_maxUnits',
419
+ type: 'uint256',
420
+ },
421
+ ],
422
+ outputs: [],
423
+ },
424
+ {
425
+ stateMutability: 'view',
426
+ type: 'function',
427
+ name: 'isValidBooster',
428
+ inputs: [
429
+ {
430
+ name: '_config',
431
+ type: 'tuple',
432
+ components: [
433
+ {
434
+ name: 'user',
435
+ type: 'address',
436
+ },
437
+ {
438
+ name: 'ripePerUnit',
439
+ type: 'uint256',
440
+ },
441
+ {
442
+ name: 'maxUnitsAllowed',
443
+ type: 'uint256',
444
+ },
445
+ {
446
+ name: 'expireBlock',
447
+ type: 'uint256',
448
+ },
449
+ ],
450
+ },
451
+ ],
452
+ outputs: [
453
+ {
454
+ name: '',
455
+ type: 'bool',
456
+ },
457
+ ],
458
+ },
459
+ {
460
+ stateMutability: 'view',
461
+ type: 'function',
462
+ name: 'config',
463
+ inputs: [
464
+ {
465
+ name: 'arg0',
466
+ type: 'address',
467
+ },
468
+ ],
469
+ outputs: [
470
+ {
471
+ name: '',
472
+ type: 'tuple',
473
+ components: [
474
+ {
475
+ name: 'user',
476
+ type: 'address',
477
+ },
478
+ {
479
+ name: 'ripePerUnit',
480
+ type: 'uint256',
481
+ },
482
+ {
483
+ name: 'maxUnitsAllowed',
484
+ type: 'uint256',
485
+ },
486
+ {
487
+ name: 'expireBlock',
488
+ type: 'uint256',
489
+ },
490
+ ],
491
+ },
492
+ ],
493
+ },
494
+ {
495
+ stateMutability: 'view',
496
+ type: 'function',
497
+ name: 'unitsUsed',
498
+ inputs: [
499
+ {
500
+ name: 'arg0',
501
+ type: 'address',
502
+ },
503
+ ],
504
+ outputs: [
505
+ {
506
+ name: '',
507
+ type: 'uint256',
508
+ },
509
+ ],
510
+ },
511
+ {
512
+ stateMutability: 'view',
513
+ type: 'function',
514
+ name: 'maxBoost',
515
+ inputs: [],
516
+ outputs: [
517
+ {
518
+ name: '',
519
+ type: 'uint256',
520
+ },
521
+ ],
522
+ },
523
+ {
524
+ stateMutability: 'view',
525
+ type: 'function',
526
+ name: 'maxUnits',
527
+ inputs: [],
528
+ outputs: [
529
+ {
530
+ name: '',
531
+ type: 'uint256',
532
+ },
533
+ ],
534
+ },
535
+ {
536
+ stateMutability: 'nonpayable',
537
+ type: 'constructor',
538
+ inputs: [
539
+ {
540
+ name: '_ripeHq',
541
+ type: 'address',
542
+ },
543
+ {
544
+ name: '_maxBoost',
545
+ type: 'uint256',
546
+ },
547
+ {
548
+ name: '_maxUnits',
549
+ type: 'uint256',
550
+ },
551
+ ],
552
+ outputs: [],
553
+ },
554
+ ];
555
+ export const deployAddress = '0x1f922CdB18d5566D77B1b2Fbe01c9285dCbc3c52';
556
+ function getRequest(method, args, contractAddressOrOptions) {
557
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
558
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
559
+ const call = {
560
+ contractName: 'BondBooster',
561
+ method,
562
+ args,
563
+ address,
564
+ deployAddress,
565
+ defaultValue,
566
+ getAbi: () => abi,
567
+ with: (options) => {
568
+ call.address = options.contractAddress;
569
+ call.defaultValue = options.defaultValue;
570
+ return call;
571
+ },
572
+ defaultTo: (defaultValue) => {
573
+ call.defaultValue = defaultValue;
574
+ return call;
575
+ },
576
+ at: (address) => {
577
+ call.address = address;
578
+ return call;
579
+ },
580
+ };
581
+ return call;
582
+ }
583
+ export const call = {
584
+ getAddys: (...args) => getRequest('getAddys', args),
585
+ getRipeHq: (...args) => getRequest('getRipeHq', args),
586
+ canMintGreen: (...args) => getRequest('canMintGreen', args),
587
+ canMintRipe: (...args) => getRequest('canMintRipe', args),
588
+ isPaused: (...args) => getRequest('isPaused', args),
589
+ getBoostedRipe: (...args) => getRequest('getBoostedRipe', args),
590
+ isValidBooster: (...args) => getRequest('isValidBooster', args),
591
+ config: (...args) => getRequest('config', args),
592
+ unitsUsed: (...args) => getRequest('unitsUsed', args),
593
+ maxBoost: (...args) => getRequest('maxBoost', args),
594
+ maxUnits: (...args) => getRequest('maxUnits', args),
595
+ };
596
+ function getMutation(functionName) {
597
+ return {
598
+ contractName: 'BondBooster',
599
+ functionName,
600
+ deployAddress,
601
+ argsType: undefined,
602
+ getAbi: () => abi,
603
+ };
604
+ }
605
+ export const mutation = {
606
+ pause: getMutation('pause'),
607
+ recoverFunds: getMutation('recoverFunds'),
608
+ recoverFundsMany: getMutation('recoverFundsMany'),
609
+ addNewUnitsUsed: getMutation('addNewUnitsUsed'),
610
+ setBondBooster: getMutation('setBondBooster'),
611
+ setManyBondBoosters: getMutation('setManyBondBoosters'),
612
+ removeManyBondBoosters: getMutation('removeManyBondBoosters'),
613
+ removeBondBooster: getMutation('removeBondBooster'),
614
+ setMaxBoostAndMaxUnits: getMutation('setMaxBoostAndMaxUnits'),
615
+ };
616
+ export function toSdk(publicClient, walletClient) {
617
+ return {
618
+ deployAddress,
619
+ abi,
620
+ // Queries
621
+ getAddys: (...args) => singleQuery(publicClient, call.getAddys(...args)),
622
+ getRipeHq: (...args) => singleQuery(publicClient, call.getRipeHq(...args)),
623
+ canMintGreen: (...args) => singleQuery(publicClient, call.canMintGreen(...args)),
624
+ canMintRipe: (...args) => singleQuery(publicClient, call.canMintRipe(...args)),
625
+ isPaused: (...args) => singleQuery(publicClient, call.isPaused(...args)),
626
+ getBoostedRipe: (...args) => singleQuery(publicClient, call.getBoostedRipe(...args)),
627
+ isValidBooster: (...args) => singleQuery(publicClient, call.isValidBooster(...args)),
628
+ config: (...args) => singleQuery(publicClient, call.config(...args)),
629
+ unitsUsed: (...args) => singleQuery(publicClient, call.unitsUsed(...args)),
630
+ maxBoost: (...args) => singleQuery(publicClient, call.maxBoost(...args)),
631
+ maxUnits: (...args) => singleQuery(publicClient, call.maxUnits(...args)),
632
+ // Mutations
633
+ pause: (...args) => mutate(walletClient, mutation.pause)(...args),
634
+ recoverFunds: (...args) => mutate(walletClient, mutation.recoverFunds)(...args),
635
+ recoverFundsMany: (...args) => mutate(walletClient, mutation.recoverFundsMany)(...args),
636
+ addNewUnitsUsed: (...args) => mutate(walletClient, mutation.addNewUnitsUsed)(...args),
637
+ setBondBooster: (...args) => mutate(walletClient, mutation.setBondBooster)(...args),
638
+ setManyBondBoosters: (...args) => mutate(walletClient, mutation.setManyBondBoosters)(...args),
639
+ removeManyBondBoosters: (...args) => mutate(walletClient, mutation.removeManyBondBoosters)(...args),
640
+ removeBondBooster: (...args) => mutate(walletClient, mutation.removeBondBooster)(...args),
641
+ setMaxBoostAndMaxUnits: (...args) => mutate(walletClient, mutation.setMaxBoostAndMaxUnits)(...args),
642
+ };
643
+ }