@qubic.org/contracts 0.2.0

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 (134) hide show
  1. package/README.md +285 -0
  2. package/dist/__generated__/computorcontrolledfund.d.ts +185 -0
  3. package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -0
  4. package/dist/__generated__/computorcontrolledfund.js +805 -0
  5. package/dist/__generated__/computorcontrolledfund.js.map +1 -0
  6. package/dist/__generated__/escrow.d.ts +103 -0
  7. package/dist/__generated__/escrow.d.ts.map +1 -0
  8. package/dist/__generated__/escrow.js +383 -0
  9. package/dist/__generated__/escrow.js.map +1 -0
  10. package/dist/__generated__/generalquorumproposal.d.ts +130 -0
  11. package/dist/__generated__/generalquorumproposal.d.ts.map +1 -0
  12. package/dist/__generated__/generalquorumproposal.js +499 -0
  13. package/dist/__generated__/generalquorumproposal.js.map +1 -0
  14. package/dist/__generated__/index.d.ts +28 -0
  15. package/dist/__generated__/index.d.ts.map +1 -0
  16. package/dist/__generated__/index.js +28 -0
  17. package/dist/__generated__/index.js.map +1 -0
  18. package/dist/__generated__/msvault.d.ts +336 -0
  19. package/dist/__generated__/msvault.d.ts.map +1 -0
  20. package/dist/__generated__/msvault.js +1187 -0
  21. package/dist/__generated__/msvault.js.map +1 -0
  22. package/dist/__generated__/multisignvault.d.ts +348 -0
  23. package/dist/__generated__/multisignvault.d.ts.map +1 -0
  24. package/dist/__generated__/multisignvault.js +913 -0
  25. package/dist/__generated__/multisignvault.js.map +1 -0
  26. package/dist/__generated__/mylastmatch.d.ts +5 -0
  27. package/dist/__generated__/mylastmatch.d.ts.map +1 -0
  28. package/dist/__generated__/mylastmatch.js +7 -0
  29. package/dist/__generated__/mylastmatch.js.map +1 -0
  30. package/dist/__generated__/nostromo.d.ts +295 -0
  31. package/dist/__generated__/nostromo.d.ts.map +1 -0
  32. package/dist/__generated__/nostromo.js +1113 -0
  33. package/dist/__generated__/nostromo.js.map +1 -0
  34. package/dist/__generated__/pulse.d.ts +320 -0
  35. package/dist/__generated__/pulse.d.ts.map +1 -0
  36. package/dist/__generated__/pulse.js +1024 -0
  37. package/dist/__generated__/pulse.js.map +1 -0
  38. package/dist/__generated__/qbay.d.ts +415 -0
  39. package/dist/__generated__/qbay.d.ts.map +1 -0
  40. package/dist/__generated__/qbay.js +1486 -0
  41. package/dist/__generated__/qbay.js.map +1 -0
  42. package/dist/__generated__/qbond.d.ts +210 -0
  43. package/dist/__generated__/qbond.d.ts.map +1 -0
  44. package/dist/__generated__/qbond.js +694 -0
  45. package/dist/__generated__/qbond.js.map +1 -0
  46. package/dist/__generated__/qdraw.d.ts +39 -0
  47. package/dist/__generated__/qdraw.d.ts.map +1 -0
  48. package/dist/__generated__/qdraw.js +135 -0
  49. package/dist/__generated__/qdraw.js.map +1 -0
  50. package/dist/__generated__/qduel.d.ts +171 -0
  51. package/dist/__generated__/qduel.d.ts.map +1 -0
  52. package/dist/__generated__/qduel.js +573 -0
  53. package/dist/__generated__/qduel.js.map +1 -0
  54. package/dist/__generated__/qearn.d.ts +139 -0
  55. package/dist/__generated__/qearn.d.ts.map +1 -0
  56. package/dist/__generated__/qearn.js +471 -0
  57. package/dist/__generated__/qearn.js.map +1 -0
  58. package/dist/__generated__/qip.d.ts +84 -0
  59. package/dist/__generated__/qip.d.ts.map +1 -0
  60. package/dist/__generated__/qip.js +303 -0
  61. package/dist/__generated__/qip.js.map +1 -0
  62. package/dist/__generated__/qraffle.d.ts +235 -0
  63. package/dist/__generated__/qraffle.d.ts.map +1 -0
  64. package/dist/__generated__/qraffle.js +798 -0
  65. package/dist/__generated__/qraffle.js.map +1 -0
  66. package/dist/__generated__/qreservepool.d.ts +70 -0
  67. package/dist/__generated__/qreservepool.d.ts.map +1 -0
  68. package/dist/__generated__/qreservepool.js +177 -0
  69. package/dist/__generated__/qreservepool.js.map +1 -0
  70. package/dist/__generated__/qrwa.d.ts +285 -0
  71. package/dist/__generated__/qrwa.d.ts.map +1 -0
  72. package/dist/__generated__/qrwa.js +1063 -0
  73. package/dist/__generated__/qrwa.js.map +1 -0
  74. package/dist/__generated__/qswap.d.ts +273 -0
  75. package/dist/__generated__/qswap.d.ts.map +1 -0
  76. package/dist/__generated__/qswap.js +897 -0
  77. package/dist/__generated__/qswap.js.map +1 -0
  78. package/dist/__generated__/qthirtyfour.d.ts +231 -0
  79. package/dist/__generated__/qthirtyfour.d.ts.map +1 -0
  80. package/dist/__generated__/qthirtyfour.js +790 -0
  81. package/dist/__generated__/qthirtyfour.js.map +1 -0
  82. package/dist/__generated__/qubicicoportal.d.ts +81 -0
  83. package/dist/__generated__/qubicicoportal.d.ts.map +1 -0
  84. package/dist/__generated__/qubicicoportal.js +260 -0
  85. package/dist/__generated__/qubicicoportal.js.map +1 -0
  86. package/dist/__generated__/quottery.d.ts +308 -0
  87. package/dist/__generated__/quottery.d.ts.map +1 -0
  88. package/dist/__generated__/quottery.js +1062 -0
  89. package/dist/__generated__/quottery.js.map +1 -0
  90. package/dist/__generated__/qusino.d.ts +172 -0
  91. package/dist/__generated__/qusino.d.ts.map +1 -0
  92. package/dist/__generated__/qusino.js +533 -0
  93. package/dist/__generated__/qusino.js.map +1 -0
  94. package/dist/__generated__/qutil.d.ts +310 -0
  95. package/dist/__generated__/qutil.d.ts.map +1 -0
  96. package/dist/__generated__/qutil.js +1033 -0
  97. package/dist/__generated__/qutil.js.map +1 -0
  98. package/dist/__generated__/qvault.d.ts +535 -0
  99. package/dist/__generated__/qvault.d.ts.map +1 -0
  100. package/dist/__generated__/qvault.js +2047 -0
  101. package/dist/__generated__/qvault.js.map +1 -0
  102. package/dist/__generated__/qx.d.ts +178 -0
  103. package/dist/__generated__/qx.d.ts.map +1 -0
  104. package/dist/__generated__/qx.js +586 -0
  105. package/dist/__generated__/qx.js.map +1 -0
  106. package/dist/__generated__/random.d.ts +12 -0
  107. package/dist/__generated__/random.d.ts.map +1 -0
  108. package/dist/__generated__/random.js +26 -0
  109. package/dist/__generated__/random.js.map +1 -0
  110. package/dist/__generated__/randomlottery.d.ts +135 -0
  111. package/dist/__generated__/randomlottery.d.ts.map +1 -0
  112. package/dist/__generated__/randomlottery.js +451 -0
  113. package/dist/__generated__/randomlottery.js.map +1 -0
  114. package/dist/__generated__/supplywatcher.d.ts +5 -0
  115. package/dist/__generated__/supplywatcher.d.ts.map +1 -0
  116. package/dist/__generated__/supplywatcher.js +7 -0
  117. package/dist/__generated__/supplywatcher.js.map +1 -0
  118. package/dist/__generated__/vottunbridge.d.ts +226 -0
  119. package/dist/__generated__/vottunbridge.d.ts.map +1 -0
  120. package/dist/__generated__/vottunbridge.js +835 -0
  121. package/dist/__generated__/vottunbridge.js.map +1 -0
  122. package/dist/call-contract.d.ts +25 -0
  123. package/dist/call-contract.d.ts.map +1 -0
  124. package/dist/call-contract.js +41 -0
  125. package/dist/call-contract.js.map +1 -0
  126. package/dist/index.d.ts +6 -0
  127. package/dist/index.d.ts.map +1 -0
  128. package/dist/index.js +4 -0
  129. package/dist/index.js.map +1 -0
  130. package/dist/result.d.ts +12 -0
  131. package/dist/result.d.ts.map +1 -0
  132. package/dist/result.js +7 -0
  133. package/dist/result.js.map +1 -0
  134. package/package.json +32 -0
@@ -0,0 +1,2047 @@
1
+ import { buildPayload, decodePayload } from '@qubic.org/registry';
2
+ import { callContractFunction } from '../call-contract.js';
3
+ export const QVAULT_CONTRACT_INDEX = 10;
4
+ const STRUCTS = {
5
+ 'Asset': {
6
+ name: 'Asset',
7
+ byteLength: 40,
8
+ fields: [
9
+ {
10
+ name: 'issuer',
11
+ type: 'id',
12
+ offset: 0,
13
+ byteLength: 32,
14
+ },
15
+ {
16
+ name: 'assetName',
17
+ type: 'uint64',
18
+ offset: 32,
19
+ byteLength: 8,
20
+ },
21
+ ],
22
+ },
23
+ 'GPInfo': {
24
+ name: 'GPInfo',
25
+ byteLength: 309,
26
+ fields: [
27
+ {
28
+ name: 'proposer',
29
+ type: 'id',
30
+ offset: 0,
31
+ byteLength: 32,
32
+ },
33
+ {
34
+ name: 'currentTotalVotingPower',
35
+ type: 'uint32',
36
+ offset: 32,
37
+ byteLength: 4,
38
+ },
39
+ {
40
+ name: 'numberOfYes',
41
+ type: 'uint32',
42
+ offset: 36,
43
+ byteLength: 4,
44
+ },
45
+ {
46
+ name: 'numberOfNo',
47
+ type: 'uint32',
48
+ offset: 40,
49
+ byteLength: 4,
50
+ },
51
+ {
52
+ name: 'proposedEpoch',
53
+ type: 'uint32',
54
+ offset: 44,
55
+ byteLength: 4,
56
+ },
57
+ {
58
+ name: 'currentQuorumPercent',
59
+ type: 'uint32',
60
+ offset: 48,
61
+ byteLength: 4,
62
+ },
63
+ {
64
+ name: 'url',
65
+ type: 'array',
66
+ offset: 52,
67
+ byteLength: 256,
68
+ arrayLength: 256,
69
+ arrayItemType: 'uint8',
70
+ arrayItemByteLength: 1,
71
+ },
72
+ {
73
+ name: 'result',
74
+ type: 'uint8',
75
+ offset: 308,
76
+ byteLength: 1,
77
+ },
78
+ ],
79
+ },
80
+ 'QCPInfo': {
81
+ name: 'QCPInfo',
82
+ byteLength: 313,
83
+ fields: [
84
+ {
85
+ name: 'proposer',
86
+ type: 'id',
87
+ offset: 0,
88
+ byteLength: 32,
89
+ },
90
+ {
91
+ name: 'currentTotalVotingPower',
92
+ type: 'uint32',
93
+ offset: 32,
94
+ byteLength: 4,
95
+ },
96
+ {
97
+ name: 'numberOfYes',
98
+ type: 'uint32',
99
+ offset: 36,
100
+ byteLength: 4,
101
+ },
102
+ {
103
+ name: 'numberOfNo',
104
+ type: 'uint32',
105
+ offset: 40,
106
+ byteLength: 4,
107
+ },
108
+ {
109
+ name: 'proposedEpoch',
110
+ type: 'uint32',
111
+ offset: 44,
112
+ byteLength: 4,
113
+ },
114
+ {
115
+ name: 'currentQuorumPercent',
116
+ type: 'uint32',
117
+ offset: 48,
118
+ byteLength: 4,
119
+ },
120
+ {
121
+ name: 'newQuorumPercent',
122
+ type: 'uint32',
123
+ offset: 52,
124
+ byteLength: 4,
125
+ },
126
+ {
127
+ name: 'url',
128
+ type: 'array',
129
+ offset: 56,
130
+ byteLength: 256,
131
+ arrayLength: 256,
132
+ arrayItemType: 'uint8',
133
+ arrayItemByteLength: 1,
134
+ },
135
+ {
136
+ name: 'result',
137
+ type: 'uint8',
138
+ offset: 312,
139
+ byteLength: 1,
140
+ },
141
+ ],
142
+ },
143
+ 'IPOPInfo': {
144
+ name: 'IPOPInfo',
145
+ byteLength: 329,
146
+ fields: [
147
+ {
148
+ name: 'proposer',
149
+ type: 'id',
150
+ offset: 0,
151
+ byteLength: 32,
152
+ },
153
+ {
154
+ name: 'totalWeight',
155
+ type: 'uint64',
156
+ offset: 32,
157
+ byteLength: 8,
158
+ },
159
+ {
160
+ name: 'assignedFund',
161
+ type: 'uint64',
162
+ offset: 40,
163
+ byteLength: 8,
164
+ },
165
+ {
166
+ name: 'currentTotalVotingPower',
167
+ type: 'uint32',
168
+ offset: 48,
169
+ byteLength: 4,
170
+ },
171
+ {
172
+ name: 'numberOfYes',
173
+ type: 'uint32',
174
+ offset: 52,
175
+ byteLength: 4,
176
+ },
177
+ {
178
+ name: 'numberOfNo',
179
+ type: 'uint32',
180
+ offset: 56,
181
+ byteLength: 4,
182
+ },
183
+ {
184
+ name: 'proposedEpoch',
185
+ type: 'uint32',
186
+ offset: 60,
187
+ byteLength: 4,
188
+ },
189
+ {
190
+ name: 'ipoContractIndex',
191
+ type: 'uint32',
192
+ offset: 64,
193
+ byteLength: 4,
194
+ },
195
+ {
196
+ name: 'currentQuorumPercent',
197
+ type: 'uint32',
198
+ offset: 68,
199
+ byteLength: 4,
200
+ },
201
+ {
202
+ name: 'url',
203
+ type: 'array',
204
+ offset: 72,
205
+ byteLength: 256,
206
+ arrayLength: 256,
207
+ arrayItemType: 'uint8',
208
+ arrayItemByteLength: 1,
209
+ },
210
+ {
211
+ name: 'result',
212
+ type: 'uint8',
213
+ offset: 328,
214
+ byteLength: 1,
215
+ },
216
+ ],
217
+ },
218
+ 'QEarnPInfo': {
219
+ name: 'QEarnPInfo',
220
+ byteLength: 326,
221
+ fields: [
222
+ {
223
+ name: 'proposer',
224
+ type: 'id',
225
+ offset: 0,
226
+ byteLength: 32,
227
+ },
228
+ {
229
+ name: 'amountOfInvestPerEpoch',
230
+ type: 'uint64',
231
+ offset: 32,
232
+ byteLength: 8,
233
+ },
234
+ {
235
+ name: 'assignedFundPerEpoch',
236
+ type: 'uint64',
237
+ offset: 40,
238
+ byteLength: 8,
239
+ },
240
+ {
241
+ name: 'currentTotalVotingPower',
242
+ type: 'uint32',
243
+ offset: 48,
244
+ byteLength: 4,
245
+ },
246
+ {
247
+ name: 'numberOfYes',
248
+ type: 'uint32',
249
+ offset: 52,
250
+ byteLength: 4,
251
+ },
252
+ {
253
+ name: 'numberOfNo',
254
+ type: 'uint32',
255
+ offset: 56,
256
+ byteLength: 4,
257
+ },
258
+ {
259
+ name: 'proposedEpoch',
260
+ type: 'uint32',
261
+ offset: 60,
262
+ byteLength: 4,
263
+ },
264
+ {
265
+ name: 'currentQuorumPercent',
266
+ type: 'uint32',
267
+ offset: 64,
268
+ byteLength: 4,
269
+ },
270
+ {
271
+ name: 'url',
272
+ type: 'array',
273
+ offset: 68,
274
+ byteLength: 256,
275
+ arrayLength: 256,
276
+ arrayItemType: 'uint8',
277
+ arrayItemByteLength: 1,
278
+ },
279
+ {
280
+ name: 'numberOfEpoch',
281
+ type: 'uint8',
282
+ offset: 324,
283
+ byteLength: 1,
284
+ },
285
+ {
286
+ name: 'result',
287
+ type: 'uint8',
288
+ offset: 325,
289
+ byteLength: 1,
290
+ },
291
+ ],
292
+ },
293
+ 'FundPInfo': {
294
+ name: 'FundPInfo',
295
+ byteLength: 325,
296
+ fields: [
297
+ {
298
+ name: 'proposer',
299
+ type: 'id',
300
+ offset: 0,
301
+ byteLength: 32,
302
+ },
303
+ {
304
+ name: 'pricePerOneQcap',
305
+ type: 'uint64',
306
+ offset: 32,
307
+ byteLength: 8,
308
+ },
309
+ {
310
+ name: 'currentTotalVotingPower',
311
+ type: 'uint32',
312
+ offset: 40,
313
+ byteLength: 4,
314
+ },
315
+ {
316
+ name: 'numberOfYes',
317
+ type: 'uint32',
318
+ offset: 44,
319
+ byteLength: 4,
320
+ },
321
+ {
322
+ name: 'numberOfNo',
323
+ type: 'uint32',
324
+ offset: 48,
325
+ byteLength: 4,
326
+ },
327
+ {
328
+ name: 'amountOfQcap',
329
+ type: 'uint32',
330
+ offset: 52,
331
+ byteLength: 4,
332
+ },
333
+ {
334
+ name: 'restSaleAmount',
335
+ type: 'uint32',
336
+ offset: 56,
337
+ byteLength: 4,
338
+ },
339
+ {
340
+ name: 'proposedEpoch',
341
+ type: 'uint32',
342
+ offset: 60,
343
+ byteLength: 4,
344
+ },
345
+ {
346
+ name: 'currentQuorumPercent',
347
+ type: 'uint32',
348
+ offset: 64,
349
+ byteLength: 4,
350
+ },
351
+ {
352
+ name: 'url',
353
+ type: 'array',
354
+ offset: 68,
355
+ byteLength: 256,
356
+ arrayLength: 256,
357
+ arrayItemType: 'uint8',
358
+ arrayItemByteLength: 1,
359
+ },
360
+ {
361
+ name: 'result',
362
+ type: 'uint8',
363
+ offset: 324,
364
+ byteLength: 1,
365
+ },
366
+ ],
367
+ },
368
+ 'MKTPInfo': {
369
+ name: 'MKTPInfo',
370
+ byteLength: 337,
371
+ fields: [
372
+ {
373
+ name: 'proposer',
374
+ type: 'id',
375
+ offset: 0,
376
+ byteLength: 32,
377
+ },
378
+ {
379
+ name: 'amountOfQubic',
380
+ type: 'uint64',
381
+ offset: 32,
382
+ byteLength: 8,
383
+ },
384
+ {
385
+ name: 'shareName',
386
+ type: 'uint64',
387
+ offset: 40,
388
+ byteLength: 8,
389
+ },
390
+ {
391
+ name: 'currentTotalVotingPower',
392
+ type: 'uint32',
393
+ offset: 48,
394
+ byteLength: 4,
395
+ },
396
+ {
397
+ name: 'numberOfYes',
398
+ type: 'uint32',
399
+ offset: 52,
400
+ byteLength: 4,
401
+ },
402
+ {
403
+ name: 'numberOfNo',
404
+ type: 'uint32',
405
+ offset: 56,
406
+ byteLength: 4,
407
+ },
408
+ {
409
+ name: 'amountOfQcap',
410
+ type: 'uint32',
411
+ offset: 60,
412
+ byteLength: 4,
413
+ },
414
+ {
415
+ name: 'currentQuorumPercent',
416
+ type: 'uint32',
417
+ offset: 64,
418
+ byteLength: 4,
419
+ },
420
+ {
421
+ name: 'proposedEpoch',
422
+ type: 'uint32',
423
+ offset: 68,
424
+ byteLength: 4,
425
+ },
426
+ {
427
+ name: 'shareIndex',
428
+ type: 'uint32',
429
+ offset: 72,
430
+ byteLength: 4,
431
+ },
432
+ {
433
+ name: 'amountOfShare',
434
+ type: 'uint32',
435
+ offset: 76,
436
+ byteLength: 4,
437
+ },
438
+ {
439
+ name: 'url',
440
+ type: 'array',
441
+ offset: 80,
442
+ byteLength: 256,
443
+ arrayLength: 256,
444
+ arrayItemType: 'uint8',
445
+ arrayItemByteLength: 1,
446
+ },
447
+ {
448
+ name: 'result',
449
+ type: 'uint8',
450
+ offset: 336,
451
+ byteLength: 1,
452
+ },
453
+ ],
454
+ },
455
+ 'AlloPInfo': {
456
+ name: 'AlloPInfo',
457
+ byteLength: 321,
458
+ fields: [
459
+ {
460
+ name: 'proposer',
461
+ type: 'id',
462
+ offset: 0,
463
+ byteLength: 32,
464
+ },
465
+ {
466
+ name: 'currentTotalVotingPower',
467
+ type: 'uint32',
468
+ offset: 32,
469
+ byteLength: 4,
470
+ },
471
+ {
472
+ name: 'numberOfYes',
473
+ type: 'uint32',
474
+ offset: 36,
475
+ byteLength: 4,
476
+ },
477
+ {
478
+ name: 'numberOfNo',
479
+ type: 'uint32',
480
+ offset: 40,
481
+ byteLength: 4,
482
+ },
483
+ {
484
+ name: 'proposedEpoch',
485
+ type: 'uint32',
486
+ offset: 44,
487
+ byteLength: 4,
488
+ },
489
+ {
490
+ name: 'currentQuorumPercent',
491
+ type: 'uint32',
492
+ offset: 48,
493
+ byteLength: 4,
494
+ },
495
+ {
496
+ name: 'reinvested',
497
+ type: 'uint32',
498
+ offset: 52,
499
+ byteLength: 4,
500
+ },
501
+ {
502
+ name: 'distributed',
503
+ type: 'uint32',
504
+ offset: 56,
505
+ byteLength: 4,
506
+ },
507
+ {
508
+ name: 'burnQcap',
509
+ type: 'uint32',
510
+ offset: 60,
511
+ byteLength: 4,
512
+ },
513
+ {
514
+ name: 'url',
515
+ type: 'array',
516
+ offset: 64,
517
+ byteLength: 256,
518
+ arrayLength: 256,
519
+ arrayItemType: 'uint8',
520
+ arrayItemByteLength: 1,
521
+ },
522
+ {
523
+ name: 'result',
524
+ type: 'uint8',
525
+ offset: 320,
526
+ byteLength: 1,
527
+ },
528
+ ],
529
+ },
530
+ };
531
+ export const QVAULT_STAKE_INPUT_TYPE = 2;
532
+ const QVAULT_STAKE_INPUT_FIELDS = [
533
+ {
534
+ name: 'amount',
535
+ type: 'uint32',
536
+ offset: 0,
537
+ byteLength: 4,
538
+ },
539
+ ];
540
+ export function buildQVAULTStakeInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
541
+ return buildPayload(QVAULT_STAKE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
542
+ }
543
+ const QVAULT_STAKE_OUTPUT_FIELDS = [
544
+ {
545
+ name: 'returnCode',
546
+ type: 'sint32',
547
+ offset: 0,
548
+ byteLength: 4,
549
+ },
550
+ ];
551
+ export function decodeQVAULTStakeOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
552
+ return decodePayload(data, QVAULT_STAKE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
553
+ }
554
+ export const QVAULT_UN_STAKE_INPUT_TYPE = 3;
555
+ const QVAULT_UN_STAKE_INPUT_FIELDS = [
556
+ {
557
+ name: 'amount',
558
+ type: 'uint32',
559
+ offset: 0,
560
+ byteLength: 4,
561
+ },
562
+ ];
563
+ export function buildQVAULTUnStakeInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
564
+ return buildPayload(QVAULT_UN_STAKE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
565
+ }
566
+ const QVAULT_UN_STAKE_OUTPUT_FIELDS = [
567
+ {
568
+ name: 'returnCode',
569
+ type: 'sint32',
570
+ offset: 0,
571
+ byteLength: 4,
572
+ },
573
+ ];
574
+ export function decodeQVAULTUnStakeOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
575
+ return decodePayload(data, QVAULT_UN_STAKE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
576
+ }
577
+ export const QVAULT_SUBMIT_GP_INPUT_TYPE = 4;
578
+ const QVAULT_SUBMIT_GP_INPUT_FIELDS = [
579
+ {
580
+ name: 'url',
581
+ type: 'array',
582
+ offset: 0,
583
+ byteLength: 256,
584
+ arrayLength: 256,
585
+ arrayItemType: 'uint8',
586
+ arrayItemByteLength: 1,
587
+ },
588
+ ];
589
+ export function buildQVAULTSubmitGPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
590
+ return buildPayload(QVAULT_SUBMIT_GP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
591
+ }
592
+ const QVAULT_SUBMIT_GP_OUTPUT_FIELDS = [
593
+ {
594
+ name: 'returnCode',
595
+ type: 'sint32',
596
+ offset: 0,
597
+ byteLength: 4,
598
+ },
599
+ ];
600
+ export function decodeQVAULTSubmitGPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
601
+ return decodePayload(data, QVAULT_SUBMIT_GP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
602
+ }
603
+ export const QVAULT_SUBMIT_QCP_INPUT_TYPE = 5;
604
+ const QVAULT_SUBMIT_QCP_INPUT_FIELDS = [
605
+ {
606
+ name: 'newQuorumPercent',
607
+ type: 'uint32',
608
+ offset: 0,
609
+ byteLength: 4,
610
+ },
611
+ {
612
+ name: 'url',
613
+ type: 'array',
614
+ offset: 4,
615
+ byteLength: 256,
616
+ arrayLength: 256,
617
+ arrayItemType: 'uint8',
618
+ arrayItemByteLength: 1,
619
+ },
620
+ ];
621
+ export function buildQVAULTSubmitQCPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
622
+ return buildPayload(QVAULT_SUBMIT_QCP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
623
+ }
624
+ const QVAULT_SUBMIT_QCP_OUTPUT_FIELDS = [
625
+ {
626
+ name: 'returnCode',
627
+ type: 'sint32',
628
+ offset: 0,
629
+ byteLength: 4,
630
+ },
631
+ ];
632
+ export function decodeQVAULTSubmitQCPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
633
+ return decodePayload(data, QVAULT_SUBMIT_QCP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
634
+ }
635
+ export const QVAULT_SUBMIT_IPOP_INPUT_TYPE = 6;
636
+ const QVAULT_SUBMIT_IPOP_INPUT_FIELDS = [
637
+ {
638
+ name: 'ipoContractIndex',
639
+ type: 'uint32',
640
+ offset: 0,
641
+ byteLength: 4,
642
+ },
643
+ {
644
+ name: 'url',
645
+ type: 'array',
646
+ offset: 4,
647
+ byteLength: 256,
648
+ arrayLength: 256,
649
+ arrayItemType: 'uint8',
650
+ arrayItemByteLength: 1,
651
+ },
652
+ ];
653
+ export function buildQVAULTSubmitIPOPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
654
+ return buildPayload(QVAULT_SUBMIT_IPOP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
655
+ }
656
+ const QVAULT_SUBMIT_IPOP_OUTPUT_FIELDS = [
657
+ {
658
+ name: 'returnCode',
659
+ type: 'sint32',
660
+ offset: 0,
661
+ byteLength: 4,
662
+ },
663
+ ];
664
+ export function decodeQVAULTSubmitIPOPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
665
+ return decodePayload(data, QVAULT_SUBMIT_IPOP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
666
+ }
667
+ export const QVAULT_SUBMIT_Q_EARN_P_INPUT_TYPE = 7;
668
+ const QVAULT_SUBMIT_Q_EARN_P_INPUT_FIELDS = [
669
+ {
670
+ name: 'amountPerEpoch',
671
+ type: 'uint64',
672
+ offset: 0,
673
+ byteLength: 8,
674
+ },
675
+ {
676
+ name: 'numberOfEpoch',
677
+ type: 'uint32',
678
+ offset: 8,
679
+ byteLength: 4,
680
+ },
681
+ {
682
+ name: 'url',
683
+ type: 'array',
684
+ offset: 12,
685
+ byteLength: 256,
686
+ arrayLength: 256,
687
+ arrayItemType: 'uint8',
688
+ arrayItemByteLength: 1,
689
+ },
690
+ ];
691
+ export function buildQVAULTSubmitQEarnPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
692
+ return buildPayload(QVAULT_SUBMIT_Q_EARN_P_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
693
+ }
694
+ const QVAULT_SUBMIT_Q_EARN_P_OUTPUT_FIELDS = [
695
+ {
696
+ name: 'returnCode',
697
+ type: 'sint32',
698
+ offset: 0,
699
+ byteLength: 4,
700
+ },
701
+ ];
702
+ export function decodeQVAULTSubmitQEarnPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
703
+ return decodePayload(data, QVAULT_SUBMIT_Q_EARN_P_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
704
+ }
705
+ export const QVAULT_SUBMIT_FUND_P_INPUT_TYPE = 8;
706
+ const QVAULT_SUBMIT_FUND_P_INPUT_FIELDS = [
707
+ {
708
+ name: 'priceOfOneQcap',
709
+ type: 'uint64',
710
+ offset: 0,
711
+ byteLength: 8,
712
+ },
713
+ {
714
+ name: 'amountOfQcap',
715
+ type: 'uint32',
716
+ offset: 8,
717
+ byteLength: 4,
718
+ },
719
+ {
720
+ name: 'url',
721
+ type: 'array',
722
+ offset: 12,
723
+ byteLength: 256,
724
+ arrayLength: 256,
725
+ arrayItemType: 'uint8',
726
+ arrayItemByteLength: 1,
727
+ },
728
+ ];
729
+ export function buildQVAULTSubmitFundPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
730
+ return buildPayload(QVAULT_SUBMIT_FUND_P_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
731
+ }
732
+ const QVAULT_SUBMIT_FUND_P_OUTPUT_FIELDS = [
733
+ {
734
+ name: 'returnCode',
735
+ type: 'sint32',
736
+ offset: 0,
737
+ byteLength: 4,
738
+ },
739
+ ];
740
+ export function decodeQVAULTSubmitFundPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
741
+ return decodePayload(data, QVAULT_SUBMIT_FUND_P_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
742
+ }
743
+ export const QVAULT_SUBMIT_MKTP_INPUT_TYPE = 9;
744
+ const QVAULT_SUBMIT_MKTP_INPUT_FIELDS = [
745
+ {
746
+ name: 'amountOfQubic',
747
+ type: 'uint64',
748
+ offset: 0,
749
+ byteLength: 8,
750
+ },
751
+ {
752
+ name: 'shareName',
753
+ type: 'uint64',
754
+ offset: 8,
755
+ byteLength: 8,
756
+ },
757
+ {
758
+ name: 'amountOfQcap',
759
+ type: 'uint32',
760
+ offset: 16,
761
+ byteLength: 4,
762
+ },
763
+ {
764
+ name: 'indexOfShare',
765
+ type: 'uint32',
766
+ offset: 20,
767
+ byteLength: 4,
768
+ },
769
+ {
770
+ name: 'amountOfShare',
771
+ type: 'uint32',
772
+ offset: 24,
773
+ byteLength: 4,
774
+ },
775
+ {
776
+ name: 'url',
777
+ type: 'array',
778
+ offset: 28,
779
+ byteLength: 256,
780
+ arrayLength: 256,
781
+ arrayItemType: 'uint8',
782
+ arrayItemByteLength: 1,
783
+ },
784
+ ];
785
+ export function buildQVAULTSubmitMKTPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
786
+ return buildPayload(QVAULT_SUBMIT_MKTP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
787
+ }
788
+ const QVAULT_SUBMIT_MKTP_OUTPUT_FIELDS = [
789
+ {
790
+ name: 'returnCode',
791
+ type: 'sint32',
792
+ offset: 0,
793
+ byteLength: 4,
794
+ },
795
+ ];
796
+ export function decodeQVAULTSubmitMKTPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
797
+ return decodePayload(data, QVAULT_SUBMIT_MKTP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
798
+ }
799
+ export const QVAULT_SUBMIT_ALLO_P_INPUT_TYPE = 10;
800
+ const QVAULT_SUBMIT_ALLO_P_INPUT_FIELDS = [
801
+ {
802
+ name: 'reinvested',
803
+ type: 'uint32',
804
+ offset: 0,
805
+ byteLength: 4,
806
+ },
807
+ {
808
+ name: 'burn',
809
+ type: 'uint32',
810
+ offset: 4,
811
+ byteLength: 4,
812
+ },
813
+ {
814
+ name: 'distribute',
815
+ type: 'uint32',
816
+ offset: 8,
817
+ byteLength: 4,
818
+ },
819
+ {
820
+ name: 'url',
821
+ type: 'array',
822
+ offset: 12,
823
+ byteLength: 256,
824
+ arrayLength: 256,
825
+ arrayItemType: 'uint8',
826
+ arrayItemByteLength: 1,
827
+ },
828
+ ];
829
+ export function buildQVAULTSubmitAlloPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
830
+ return buildPayload(QVAULT_SUBMIT_ALLO_P_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
831
+ }
832
+ const QVAULT_SUBMIT_ALLO_P_OUTPUT_FIELDS = [
833
+ {
834
+ name: 'returnCode',
835
+ type: 'sint32',
836
+ offset: 0,
837
+ byteLength: 4,
838
+ },
839
+ ];
840
+ export function decodeQVAULTSubmitAlloPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
841
+ return decodePayload(data, QVAULT_SUBMIT_ALLO_P_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
842
+ }
843
+ export const QVAULT_VOTE_IN_PROPOSAL_INPUT_TYPE = 11;
844
+ const QVAULT_VOTE_IN_PROPOSAL_INPUT_FIELDS = [
845
+ {
846
+ name: 'priceOfIPO',
847
+ type: 'uint64',
848
+ offset: 0,
849
+ byteLength: 8,
850
+ },
851
+ {
852
+ name: 'proposalType',
853
+ type: 'uint32',
854
+ offset: 8,
855
+ byteLength: 4,
856
+ },
857
+ {
858
+ name: 'proposalId',
859
+ type: 'uint32',
860
+ offset: 12,
861
+ byteLength: 4,
862
+ },
863
+ {
864
+ name: 'yes',
865
+ type: 'uint8',
866
+ offset: 16,
867
+ byteLength: 1,
868
+ },
869
+ ];
870
+ export function buildQVAULTVoteInProposalInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
871
+ return buildPayload(QVAULT_VOTE_IN_PROPOSAL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
872
+ }
873
+ const QVAULT_VOTE_IN_PROPOSAL_OUTPUT_FIELDS = [
874
+ {
875
+ name: 'returnCode',
876
+ type: 'sint32',
877
+ offset: 0,
878
+ byteLength: 4,
879
+ },
880
+ ];
881
+ export function decodeQVAULTVoteInProposalOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
882
+ return decodePayload(data, QVAULT_VOTE_IN_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
883
+ }
884
+ export const QVAULT_BUY_QCAP_INPUT_TYPE = 12;
885
+ const QVAULT_BUY_QCAP_INPUT_FIELDS = [
886
+ {
887
+ name: 'amount',
888
+ type: 'uint32',
889
+ offset: 0,
890
+ byteLength: 4,
891
+ },
892
+ ];
893
+ export function buildQVAULTBuyQcapInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
894
+ return buildPayload(QVAULT_BUY_QCAP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
895
+ }
896
+ const QVAULT_BUY_QCAP_OUTPUT_FIELDS = [
897
+ {
898
+ name: 'returnCode',
899
+ type: 'sint32',
900
+ offset: 0,
901
+ byteLength: 4,
902
+ },
903
+ ];
904
+ export function decodeQVAULTBuyQcapOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
905
+ return decodePayload(data, QVAULT_BUY_QCAP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
906
+ }
907
+ export const QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE = 13;
908
+ const QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS = [
909
+ {
910
+ name: 'asset',
911
+ type: 'struct',
912
+ offset: 0,
913
+ byteLength: 40,
914
+ structRef: 'Asset',
915
+ },
916
+ {
917
+ name: 'numberOfShares',
918
+ type: 'sint64',
919
+ offset: 40,
920
+ byteLength: 8,
921
+ },
922
+ {
923
+ name: 'newManagingContractIndex',
924
+ type: 'uint32',
925
+ offset: 48,
926
+ byteLength: 4,
927
+ },
928
+ ];
929
+ export function buildQVAULTTransferShareManagementRightsInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
930
+ return buildPayload(QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
931
+ }
932
+ const QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS = [
933
+ {
934
+ name: 'transferredNumberOfShares',
935
+ type: 'sint64',
936
+ offset: 0,
937
+ byteLength: 8,
938
+ },
939
+ {
940
+ name: 'returnCode',
941
+ type: 'sint32',
942
+ offset: 8,
943
+ byteLength: 4,
944
+ },
945
+ ];
946
+ export function decodeQVAULTTransferShareManagementRightsOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
947
+ return decodePayload(data, QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
948
+ }
949
+ export const QVAULT_GET_DATA_INPUT_TYPE = 1;
950
+ export const QVAULT_GET_DATA_INPUT_SIZE = 0;
951
+ const QVAULT_GET_DATA_OUTPUT_FIELDS = [
952
+ {
953
+ name: 'returnCode',
954
+ type: 'sint32',
955
+ offset: 0,
956
+ byteLength: 4,
957
+ },
958
+ {
959
+ name: 'totalVotingPower',
960
+ type: 'uint64',
961
+ offset: 4,
962
+ byteLength: 8,
963
+ },
964
+ {
965
+ name: 'proposalCreateFund',
966
+ type: 'uint64',
967
+ offset: 12,
968
+ byteLength: 8,
969
+ },
970
+ {
971
+ name: 'reinvestingFund',
972
+ type: 'uint64',
973
+ offset: 20,
974
+ byteLength: 8,
975
+ },
976
+ {
977
+ name: 'totalEpochRevenue',
978
+ type: 'uint64',
979
+ offset: 28,
980
+ byteLength: 8,
981
+ },
982
+ {
983
+ name: 'fundForBurn',
984
+ type: 'uint64',
985
+ offset: 36,
986
+ byteLength: 8,
987
+ },
988
+ {
989
+ name: 'totalStakedQcapAmount',
990
+ type: 'uint64',
991
+ offset: 44,
992
+ byteLength: 8,
993
+ },
994
+ {
995
+ name: 'qcapMarketCap',
996
+ type: 'uint64',
997
+ offset: 52,
998
+ byteLength: 8,
999
+ },
1000
+ {
1001
+ name: 'raisedFundByQcap',
1002
+ type: 'uint64',
1003
+ offset: 60,
1004
+ byteLength: 8,
1005
+ },
1006
+ {
1007
+ name: 'lastRoundPriceOfQcap',
1008
+ type: 'uint64',
1009
+ offset: 68,
1010
+ byteLength: 8,
1011
+ },
1012
+ {
1013
+ name: 'revenueByQearn',
1014
+ type: 'uint64',
1015
+ offset: 76,
1016
+ byteLength: 8,
1017
+ },
1018
+ {
1019
+ name: 'qcapSoldAmount',
1020
+ type: 'uint32',
1021
+ offset: 84,
1022
+ byteLength: 4,
1023
+ },
1024
+ {
1025
+ name: 'shareholderDividend',
1026
+ type: 'uint32',
1027
+ offset: 88,
1028
+ byteLength: 4,
1029
+ },
1030
+ {
1031
+ name: 'QCAPHolderPermille',
1032
+ type: 'uint32',
1033
+ offset: 92,
1034
+ byteLength: 4,
1035
+ },
1036
+ {
1037
+ name: 'reinvestingPermille',
1038
+ type: 'uint32',
1039
+ offset: 96,
1040
+ byteLength: 4,
1041
+ },
1042
+ {
1043
+ name: 'burnPermille',
1044
+ type: 'uint32',
1045
+ offset: 100,
1046
+ byteLength: 4,
1047
+ },
1048
+ {
1049
+ name: 'qcapBurnPermille',
1050
+ type: 'uint32',
1051
+ offset: 104,
1052
+ byteLength: 4,
1053
+ },
1054
+ {
1055
+ name: 'numberOfStaker',
1056
+ type: 'uint32',
1057
+ offset: 108,
1058
+ byteLength: 4,
1059
+ },
1060
+ {
1061
+ name: 'numberOfVotingPower',
1062
+ type: 'uint32',
1063
+ offset: 112,
1064
+ byteLength: 4,
1065
+ },
1066
+ {
1067
+ name: 'numberOfGP',
1068
+ type: 'uint32',
1069
+ offset: 116,
1070
+ byteLength: 4,
1071
+ },
1072
+ {
1073
+ name: 'numberOfQCP',
1074
+ type: 'uint32',
1075
+ offset: 120,
1076
+ byteLength: 4,
1077
+ },
1078
+ {
1079
+ name: 'numberOfIPOP',
1080
+ type: 'uint32',
1081
+ offset: 124,
1082
+ byteLength: 4,
1083
+ },
1084
+ {
1085
+ name: 'numberOfQEarnP',
1086
+ type: 'uint32',
1087
+ offset: 128,
1088
+ byteLength: 4,
1089
+ },
1090
+ {
1091
+ name: 'numberOfFundP',
1092
+ type: 'uint32',
1093
+ offset: 132,
1094
+ byteLength: 4,
1095
+ },
1096
+ {
1097
+ name: 'numberOfMKTP',
1098
+ type: 'uint32',
1099
+ offset: 136,
1100
+ byteLength: 4,
1101
+ },
1102
+ {
1103
+ name: 'numberOfAlloP',
1104
+ type: 'uint32',
1105
+ offset: 140,
1106
+ byteLength: 4,
1107
+ },
1108
+ {
1109
+ name: 'transferRightsFee',
1110
+ type: 'uint32',
1111
+ offset: 144,
1112
+ byteLength: 4,
1113
+ },
1114
+ {
1115
+ name: 'minQuorumRq',
1116
+ type: 'uint32',
1117
+ offset: 148,
1118
+ byteLength: 4,
1119
+ },
1120
+ {
1121
+ name: 'maxQuorumRq',
1122
+ type: 'uint32',
1123
+ offset: 152,
1124
+ byteLength: 4,
1125
+ },
1126
+ {
1127
+ name: 'totalQcapBurntAmount',
1128
+ type: 'uint32',
1129
+ offset: 156,
1130
+ byteLength: 4,
1131
+ },
1132
+ {
1133
+ name: 'circulatingSupply',
1134
+ type: 'uint32',
1135
+ offset: 160,
1136
+ byteLength: 4,
1137
+ },
1138
+ {
1139
+ name: 'quorumPercent',
1140
+ type: 'uint32',
1141
+ offset: 164,
1142
+ byteLength: 4,
1143
+ },
1144
+ ];
1145
+ export function decodeQVAULTGetDataOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1146
+ return decodePayload(data, QVAULT_GET_DATA_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1147
+ }
1148
+ export async function qVAULTGetData(live, options) {
1149
+ return callContractFunction({
1150
+ live,
1151
+ contractIndex: QVAULT_CONTRACT_INDEX,
1152
+ inputType: QVAULT_GET_DATA_INPUT_TYPE,
1153
+ inputSize: QVAULT_GET_DATA_INPUT_SIZE,
1154
+ inputFields: [],
1155
+ outputFields: QVAULT_GET_DATA_OUTPUT_FIELDS,
1156
+ structs: STRUCTS,
1157
+ input: {},
1158
+ ...options,
1159
+ });
1160
+ }
1161
+ export const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_TYPE = 14;
1162
+ export const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_SIZE = 32;
1163
+ const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_FIELDS = [
1164
+ {
1165
+ name: 'address',
1166
+ type: 'id',
1167
+ offset: 0,
1168
+ byteLength: 32,
1169
+ },
1170
+ ];
1171
+ export function buildQVAULTGetStakedAmountAndVotingPowerInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1172
+ return buildPayload(QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1173
+ }
1174
+ const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_OUTPUT_FIELDS = [
1175
+ {
1176
+ name: 'returnCode',
1177
+ type: 'sint32',
1178
+ offset: 0,
1179
+ byteLength: 4,
1180
+ },
1181
+ {
1182
+ name: 'stakedAmount',
1183
+ type: 'uint32',
1184
+ offset: 4,
1185
+ byteLength: 4,
1186
+ },
1187
+ {
1188
+ name: 'votingPower',
1189
+ type: 'uint32',
1190
+ offset: 8,
1191
+ byteLength: 4,
1192
+ },
1193
+ ];
1194
+ export function decodeQVAULTGetStakedAmountAndVotingPowerOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1195
+ return decodePayload(data, QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1196
+ }
1197
+ export async function qVAULTGetStakedAmountAndVotingPower(live, input, options) {
1198
+ return callContractFunction({
1199
+ live,
1200
+ contractIndex: QVAULT_CONTRACT_INDEX,
1201
+ inputType: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_TYPE,
1202
+ inputSize: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_SIZE,
1203
+ inputFields: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_FIELDS,
1204
+ outputFields: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_OUTPUT_FIELDS,
1205
+ structs: STRUCTS,
1206
+ input: input,
1207
+ ...options,
1208
+ });
1209
+ }
1210
+ export const QVAULT_GET_GP_INPUT_TYPE = 15;
1211
+ export const QVAULT_GET_GP_INPUT_SIZE = 4;
1212
+ const QVAULT_GET_GP_INPUT_FIELDS = [
1213
+ {
1214
+ name: 'proposalId',
1215
+ type: 'uint32',
1216
+ offset: 0,
1217
+ byteLength: 4,
1218
+ },
1219
+ ];
1220
+ export function buildQVAULTGetGPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1221
+ return buildPayload(QVAULT_GET_GP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1222
+ }
1223
+ const QVAULT_GET_GP_OUTPUT_FIELDS = [
1224
+ {
1225
+ name: 'returnCode',
1226
+ type: 'sint32',
1227
+ offset: 0,
1228
+ byteLength: 4,
1229
+ },
1230
+ {
1231
+ name: 'proposal',
1232
+ type: 'struct',
1233
+ offset: 4,
1234
+ byteLength: 309,
1235
+ structRef: 'GPInfo',
1236
+ },
1237
+ ];
1238
+ export function decodeQVAULTGetGPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1239
+ return decodePayload(data, QVAULT_GET_GP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1240
+ }
1241
+ export async function qVAULTGetGP(live, input, options) {
1242
+ return callContractFunction({
1243
+ live,
1244
+ contractIndex: QVAULT_CONTRACT_INDEX,
1245
+ inputType: QVAULT_GET_GP_INPUT_TYPE,
1246
+ inputSize: QVAULT_GET_GP_INPUT_SIZE,
1247
+ inputFields: QVAULT_GET_GP_INPUT_FIELDS,
1248
+ outputFields: QVAULT_GET_GP_OUTPUT_FIELDS,
1249
+ structs: STRUCTS,
1250
+ input: input,
1251
+ ...options,
1252
+ });
1253
+ }
1254
+ export const QVAULT_GET_QCP_INPUT_TYPE = 16;
1255
+ export const QVAULT_GET_QCP_INPUT_SIZE = 4;
1256
+ const QVAULT_GET_QCP_INPUT_FIELDS = [
1257
+ {
1258
+ name: 'proposalId',
1259
+ type: 'uint32',
1260
+ offset: 0,
1261
+ byteLength: 4,
1262
+ },
1263
+ ];
1264
+ export function buildQVAULTGetQCPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1265
+ return buildPayload(QVAULT_GET_QCP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1266
+ }
1267
+ const QVAULT_GET_QCP_OUTPUT_FIELDS = [
1268
+ {
1269
+ name: 'returnCode',
1270
+ type: 'sint32',
1271
+ offset: 0,
1272
+ byteLength: 4,
1273
+ },
1274
+ {
1275
+ name: 'proposal',
1276
+ type: 'struct',
1277
+ offset: 4,
1278
+ byteLength: 313,
1279
+ structRef: 'QCPInfo',
1280
+ },
1281
+ ];
1282
+ export function decodeQVAULTGetQCPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1283
+ return decodePayload(data, QVAULT_GET_QCP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1284
+ }
1285
+ export async function qVAULTGetQCP(live, input, options) {
1286
+ return callContractFunction({
1287
+ live,
1288
+ contractIndex: QVAULT_CONTRACT_INDEX,
1289
+ inputType: QVAULT_GET_QCP_INPUT_TYPE,
1290
+ inputSize: QVAULT_GET_QCP_INPUT_SIZE,
1291
+ inputFields: QVAULT_GET_QCP_INPUT_FIELDS,
1292
+ outputFields: QVAULT_GET_QCP_OUTPUT_FIELDS,
1293
+ structs: STRUCTS,
1294
+ input: input,
1295
+ ...options,
1296
+ });
1297
+ }
1298
+ export const QVAULT_GET_IPOP_INPUT_TYPE = 17;
1299
+ export const QVAULT_GET_IPOP_INPUT_SIZE = 4;
1300
+ const QVAULT_GET_IPOP_INPUT_FIELDS = [
1301
+ {
1302
+ name: 'proposalId',
1303
+ type: 'uint32',
1304
+ offset: 0,
1305
+ byteLength: 4,
1306
+ },
1307
+ ];
1308
+ export function buildQVAULTGetIPOPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1309
+ return buildPayload(QVAULT_GET_IPOP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1310
+ }
1311
+ const QVAULT_GET_IPOP_OUTPUT_FIELDS = [
1312
+ {
1313
+ name: 'returnCode',
1314
+ type: 'sint32',
1315
+ offset: 0,
1316
+ byteLength: 4,
1317
+ },
1318
+ {
1319
+ name: 'proposal',
1320
+ type: 'struct',
1321
+ offset: 4,
1322
+ byteLength: 329,
1323
+ structRef: 'IPOPInfo',
1324
+ },
1325
+ ];
1326
+ export function decodeQVAULTGetIPOPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1327
+ return decodePayload(data, QVAULT_GET_IPOP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1328
+ }
1329
+ export async function qVAULTGetIPOP(live, input, options) {
1330
+ return callContractFunction({
1331
+ live,
1332
+ contractIndex: QVAULT_CONTRACT_INDEX,
1333
+ inputType: QVAULT_GET_IPOP_INPUT_TYPE,
1334
+ inputSize: QVAULT_GET_IPOP_INPUT_SIZE,
1335
+ inputFields: QVAULT_GET_IPOP_INPUT_FIELDS,
1336
+ outputFields: QVAULT_GET_IPOP_OUTPUT_FIELDS,
1337
+ structs: STRUCTS,
1338
+ input: input,
1339
+ ...options,
1340
+ });
1341
+ }
1342
+ export const QVAULT_GET_Q_EARN_P_INPUT_TYPE = 18;
1343
+ export const QVAULT_GET_Q_EARN_P_INPUT_SIZE = 4;
1344
+ const QVAULT_GET_Q_EARN_P_INPUT_FIELDS = [
1345
+ {
1346
+ name: 'proposalId',
1347
+ type: 'uint32',
1348
+ offset: 0,
1349
+ byteLength: 4,
1350
+ },
1351
+ ];
1352
+ export function buildQVAULTGetQEarnPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1353
+ return buildPayload(QVAULT_GET_Q_EARN_P_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1354
+ }
1355
+ const QVAULT_GET_Q_EARN_P_OUTPUT_FIELDS = [
1356
+ {
1357
+ name: 'returnCode',
1358
+ type: 'sint32',
1359
+ offset: 0,
1360
+ byteLength: 4,
1361
+ },
1362
+ {
1363
+ name: 'proposal',
1364
+ type: 'struct',
1365
+ offset: 4,
1366
+ byteLength: 326,
1367
+ structRef: 'QEarnPInfo',
1368
+ },
1369
+ ];
1370
+ export function decodeQVAULTGetQEarnPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1371
+ return decodePayload(data, QVAULT_GET_Q_EARN_P_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1372
+ }
1373
+ export async function qVAULTGetQEarnP(live, input, options) {
1374
+ return callContractFunction({
1375
+ live,
1376
+ contractIndex: QVAULT_CONTRACT_INDEX,
1377
+ inputType: QVAULT_GET_Q_EARN_P_INPUT_TYPE,
1378
+ inputSize: QVAULT_GET_Q_EARN_P_INPUT_SIZE,
1379
+ inputFields: QVAULT_GET_Q_EARN_P_INPUT_FIELDS,
1380
+ outputFields: QVAULT_GET_Q_EARN_P_OUTPUT_FIELDS,
1381
+ structs: STRUCTS,
1382
+ input: input,
1383
+ ...options,
1384
+ });
1385
+ }
1386
+ export const QVAULT_GET_FUND_P_INPUT_TYPE = 19;
1387
+ export const QVAULT_GET_FUND_P_INPUT_SIZE = 4;
1388
+ const QVAULT_GET_FUND_P_INPUT_FIELDS = [
1389
+ {
1390
+ name: 'proposalId',
1391
+ type: 'uint32',
1392
+ offset: 0,
1393
+ byteLength: 4,
1394
+ },
1395
+ ];
1396
+ export function buildQVAULTGetFundPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1397
+ return buildPayload(QVAULT_GET_FUND_P_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1398
+ }
1399
+ const QVAULT_GET_FUND_P_OUTPUT_FIELDS = [
1400
+ {
1401
+ name: 'returnCode',
1402
+ type: 'sint32',
1403
+ offset: 0,
1404
+ byteLength: 4,
1405
+ },
1406
+ {
1407
+ name: 'proposal',
1408
+ type: 'struct',
1409
+ offset: 4,
1410
+ byteLength: 325,
1411
+ structRef: 'FundPInfo',
1412
+ },
1413
+ ];
1414
+ export function decodeQVAULTGetFundPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1415
+ return decodePayload(data, QVAULT_GET_FUND_P_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1416
+ }
1417
+ export async function qVAULTGetFundP(live, input, options) {
1418
+ return callContractFunction({
1419
+ live,
1420
+ contractIndex: QVAULT_CONTRACT_INDEX,
1421
+ inputType: QVAULT_GET_FUND_P_INPUT_TYPE,
1422
+ inputSize: QVAULT_GET_FUND_P_INPUT_SIZE,
1423
+ inputFields: QVAULT_GET_FUND_P_INPUT_FIELDS,
1424
+ outputFields: QVAULT_GET_FUND_P_OUTPUT_FIELDS,
1425
+ structs: STRUCTS,
1426
+ input: input,
1427
+ ...options,
1428
+ });
1429
+ }
1430
+ export const QVAULT_GET_MKTP_INPUT_TYPE = 20;
1431
+ export const QVAULT_GET_MKTP_INPUT_SIZE = 4;
1432
+ const QVAULT_GET_MKTP_INPUT_FIELDS = [
1433
+ {
1434
+ name: 'proposalId',
1435
+ type: 'uint32',
1436
+ offset: 0,
1437
+ byteLength: 4,
1438
+ },
1439
+ ];
1440
+ export function buildQVAULTGetMKTPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1441
+ return buildPayload(QVAULT_GET_MKTP_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1442
+ }
1443
+ const QVAULT_GET_MKTP_OUTPUT_FIELDS = [
1444
+ {
1445
+ name: 'returnCode',
1446
+ type: 'sint32',
1447
+ offset: 0,
1448
+ byteLength: 4,
1449
+ },
1450
+ {
1451
+ name: 'proposal',
1452
+ type: 'struct',
1453
+ offset: 4,
1454
+ byteLength: 337,
1455
+ structRef: 'MKTPInfo',
1456
+ },
1457
+ ];
1458
+ export function decodeQVAULTGetMKTPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1459
+ return decodePayload(data, QVAULT_GET_MKTP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1460
+ }
1461
+ export async function qVAULTGetMKTP(live, input, options) {
1462
+ return callContractFunction({
1463
+ live,
1464
+ contractIndex: QVAULT_CONTRACT_INDEX,
1465
+ inputType: QVAULT_GET_MKTP_INPUT_TYPE,
1466
+ inputSize: QVAULT_GET_MKTP_INPUT_SIZE,
1467
+ inputFields: QVAULT_GET_MKTP_INPUT_FIELDS,
1468
+ outputFields: QVAULT_GET_MKTP_OUTPUT_FIELDS,
1469
+ structs: STRUCTS,
1470
+ input: input,
1471
+ ...options,
1472
+ });
1473
+ }
1474
+ export const QVAULT_GET_ALLO_P_INPUT_TYPE = 21;
1475
+ export const QVAULT_GET_ALLO_P_INPUT_SIZE = 4;
1476
+ const QVAULT_GET_ALLO_P_INPUT_FIELDS = [
1477
+ {
1478
+ name: 'proposalId',
1479
+ type: 'uint32',
1480
+ offset: 0,
1481
+ byteLength: 4,
1482
+ },
1483
+ ];
1484
+ export function buildQVAULTGetAlloPInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1485
+ return buildPayload(QVAULT_GET_ALLO_P_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1486
+ }
1487
+ const QVAULT_GET_ALLO_P_OUTPUT_FIELDS = [
1488
+ {
1489
+ name: 'returnCode',
1490
+ type: 'sint32',
1491
+ offset: 0,
1492
+ byteLength: 4,
1493
+ },
1494
+ {
1495
+ name: 'proposal',
1496
+ type: 'struct',
1497
+ offset: 4,
1498
+ byteLength: 321,
1499
+ structRef: 'AlloPInfo',
1500
+ },
1501
+ ];
1502
+ export function decodeQVAULTGetAlloPOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1503
+ return decodePayload(data, QVAULT_GET_ALLO_P_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1504
+ }
1505
+ export async function qVAULTGetAlloP(live, input, options) {
1506
+ return callContractFunction({
1507
+ live,
1508
+ contractIndex: QVAULT_CONTRACT_INDEX,
1509
+ inputType: QVAULT_GET_ALLO_P_INPUT_TYPE,
1510
+ inputSize: QVAULT_GET_ALLO_P_INPUT_SIZE,
1511
+ inputFields: QVAULT_GET_ALLO_P_INPUT_FIELDS,
1512
+ outputFields: QVAULT_GET_ALLO_P_OUTPUT_FIELDS,
1513
+ structs: STRUCTS,
1514
+ input: input,
1515
+ ...options,
1516
+ });
1517
+ }
1518
+ export const QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_TYPE = 22;
1519
+ export const QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_SIZE = 8;
1520
+ const QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_FIELDS = [
1521
+ {
1522
+ name: 'offset',
1523
+ type: 'uint32',
1524
+ offset: 0,
1525
+ byteLength: 4,
1526
+ },
1527
+ {
1528
+ name: 'count',
1529
+ type: 'uint32',
1530
+ offset: 4,
1531
+ byteLength: 4,
1532
+ },
1533
+ ];
1534
+ export function buildQVAULTGetIdentitiesHvVtPwInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1535
+ return buildPayload(QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1536
+ }
1537
+ const QVAULT_GET_IDENTITIES_HV_VT_PW_OUTPUT_FIELDS = [
1538
+ {
1539
+ name: 'returnCode',
1540
+ type: 'sint32',
1541
+ offset: 0,
1542
+ byteLength: 4,
1543
+ },
1544
+ {
1545
+ name: 'idList',
1546
+ type: 'array',
1547
+ offset: 4,
1548
+ byteLength: 8192,
1549
+ arrayLength: 256,
1550
+ arrayItemType: 'id',
1551
+ arrayItemByteLength: 32,
1552
+ },
1553
+ {
1554
+ name: 'amountList',
1555
+ type: 'array',
1556
+ offset: 8196,
1557
+ byteLength: 1024,
1558
+ arrayLength: 256,
1559
+ arrayItemType: 'uint32',
1560
+ arrayItemByteLength: 4,
1561
+ },
1562
+ ];
1563
+ export function decodeQVAULTGetIdentitiesHvVtPwOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1564
+ return decodePayload(data, QVAULT_GET_IDENTITIES_HV_VT_PW_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1565
+ }
1566
+ export async function qVAULTGetIdentitiesHvVtPw(live, input, options) {
1567
+ return callContractFunction({
1568
+ live,
1569
+ contractIndex: QVAULT_CONTRACT_INDEX,
1570
+ inputType: QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_TYPE,
1571
+ inputSize: QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_SIZE,
1572
+ inputFields: QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_FIELDS,
1573
+ outputFields: QVAULT_GET_IDENTITIES_HV_VT_PW_OUTPUT_FIELDS,
1574
+ structs: STRUCTS,
1575
+ input: input,
1576
+ ...options,
1577
+ });
1578
+ }
1579
+ export const QVAULT_PP_CREATION_POWER_INPUT_TYPE = 23;
1580
+ export const QVAULT_PP_CREATION_POWER_INPUT_SIZE = 32;
1581
+ const QVAULT_PP_CREATION_POWER_INPUT_FIELDS = [
1582
+ {
1583
+ name: 'address',
1584
+ type: 'id',
1585
+ offset: 0,
1586
+ byteLength: 32,
1587
+ },
1588
+ ];
1589
+ export function buildQVAULTPpCreationPowerInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1590
+ return buildPayload(QVAULT_PP_CREATION_POWER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1591
+ }
1592
+ const QVAULT_PP_CREATION_POWER_OUTPUT_FIELDS = [
1593
+ {
1594
+ name: 'returnCode',
1595
+ type: 'sint32',
1596
+ offset: 0,
1597
+ byteLength: 4,
1598
+ },
1599
+ {
1600
+ name: 'status',
1601
+ type: 'uint8',
1602
+ offset: 4,
1603
+ byteLength: 1,
1604
+ },
1605
+ ];
1606
+ export function decodeQVAULTPpCreationPowerOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1607
+ return decodePayload(data, QVAULT_PP_CREATION_POWER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1608
+ }
1609
+ export async function qVAULTPpCreationPower(live, input, options) {
1610
+ return callContractFunction({
1611
+ live,
1612
+ contractIndex: QVAULT_CONTRACT_INDEX,
1613
+ inputType: QVAULT_PP_CREATION_POWER_INPUT_TYPE,
1614
+ inputSize: QVAULT_PP_CREATION_POWER_INPUT_SIZE,
1615
+ inputFields: QVAULT_PP_CREATION_POWER_INPUT_FIELDS,
1616
+ outputFields: QVAULT_PP_CREATION_POWER_OUTPUT_FIELDS,
1617
+ structs: STRUCTS,
1618
+ input: input,
1619
+ ...options,
1620
+ });
1621
+ }
1622
+ export const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_TYPE = 24;
1623
+ export const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_SIZE = 4;
1624
+ const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_FIELDS = [
1625
+ {
1626
+ name: 'numberOfLastEpoches',
1627
+ type: 'uint32',
1628
+ offset: 0,
1629
+ byteLength: 4,
1630
+ },
1631
+ ];
1632
+ export function buildQVAULTGetQcapBurntAmountInLastEpochesInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1633
+ return buildPayload(QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1634
+ }
1635
+ const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_OUTPUT_FIELDS = [
1636
+ {
1637
+ name: 'returnCode',
1638
+ type: 'sint32',
1639
+ offset: 0,
1640
+ byteLength: 4,
1641
+ },
1642
+ {
1643
+ name: 'burntAmount',
1644
+ type: 'uint32',
1645
+ offset: 4,
1646
+ byteLength: 4,
1647
+ },
1648
+ ];
1649
+ export function decodeQVAULTGetQcapBurntAmountInLastEpochesOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1650
+ return decodePayload(data, QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1651
+ }
1652
+ export async function qVAULTGetQcapBurntAmountInLastEpoches(live, input, options) {
1653
+ return callContractFunction({
1654
+ live,
1655
+ contractIndex: QVAULT_CONTRACT_INDEX,
1656
+ inputType: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_TYPE,
1657
+ inputSize: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_SIZE,
1658
+ inputFields: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_FIELDS,
1659
+ outputFields: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_OUTPUT_FIELDS,
1660
+ structs: STRUCTS,
1661
+ input: input,
1662
+ ...options,
1663
+ });
1664
+ }
1665
+ export const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_TYPE = 25;
1666
+ export const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_SIZE = 4;
1667
+ const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_FIELDS = [
1668
+ {
1669
+ name: 'year',
1670
+ type: 'uint32',
1671
+ offset: 0,
1672
+ byteLength: 4,
1673
+ },
1674
+ ];
1675
+ export function buildQVAULTGetAmountToBeSoldPerYearInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1676
+ return buildPayload(QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1677
+ }
1678
+ const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_OUTPUT_FIELDS = [
1679
+ {
1680
+ name: 'amount',
1681
+ type: 'uint32',
1682
+ offset: 0,
1683
+ byteLength: 4,
1684
+ },
1685
+ ];
1686
+ export function decodeQVAULTGetAmountToBeSoldPerYearOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1687
+ return decodePayload(data, QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1688
+ }
1689
+ export async function qVAULTGetAmountToBeSoldPerYear(live, input, options) {
1690
+ return callContractFunction({
1691
+ live,
1692
+ contractIndex: QVAULT_CONTRACT_INDEX,
1693
+ inputType: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_TYPE,
1694
+ inputSize: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_SIZE,
1695
+ inputFields: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_FIELDS,
1696
+ outputFields: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_OUTPUT_FIELDS,
1697
+ structs: STRUCTS,
1698
+ input: input,
1699
+ ...options,
1700
+ });
1701
+ }
1702
+ export const QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_TYPE = 26;
1703
+ export const QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_SIZE = 0;
1704
+ const QVAULT_GET_TOTAL_REVENUE_IN_QCAP_OUTPUT_FIELDS = [
1705
+ {
1706
+ name: 'revenue',
1707
+ type: 'uint64',
1708
+ offset: 0,
1709
+ byteLength: 8,
1710
+ },
1711
+ ];
1712
+ export function decodeQVAULTGetTotalRevenueInQcapOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1713
+ return decodePayload(data, QVAULT_GET_TOTAL_REVENUE_IN_QCAP_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1714
+ }
1715
+ export async function qVAULTGetTotalRevenueInQcap(live, options) {
1716
+ return callContractFunction({
1717
+ live,
1718
+ contractIndex: QVAULT_CONTRACT_INDEX,
1719
+ inputType: QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_TYPE,
1720
+ inputSize: QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_SIZE,
1721
+ inputFields: [],
1722
+ outputFields: QVAULT_GET_TOTAL_REVENUE_IN_QCAP_OUTPUT_FIELDS,
1723
+ structs: STRUCTS,
1724
+ input: {},
1725
+ ...options,
1726
+ });
1727
+ }
1728
+ export const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_TYPE = 27;
1729
+ export const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_SIZE = 4;
1730
+ const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_FIELDS = [
1731
+ {
1732
+ name: 'epoch',
1733
+ type: 'uint32',
1734
+ offset: 0,
1735
+ byteLength: 4,
1736
+ },
1737
+ ];
1738
+ export function buildQVAULTGetRevenueInQcapPerEpochInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1739
+ return buildPayload(QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1740
+ }
1741
+ const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_OUTPUT_FIELDS = [
1742
+ {
1743
+ name: 'epochTotalRevenue',
1744
+ type: 'uint64',
1745
+ offset: 0,
1746
+ byteLength: 8,
1747
+ },
1748
+ {
1749
+ name: 'epochOneQcapRevenue',
1750
+ type: 'uint64',
1751
+ offset: 8,
1752
+ byteLength: 8,
1753
+ },
1754
+ {
1755
+ name: 'epochOneQvaultRevenue',
1756
+ type: 'uint64',
1757
+ offset: 16,
1758
+ byteLength: 8,
1759
+ },
1760
+ {
1761
+ name: 'epochReinvestAmount',
1762
+ type: 'uint64',
1763
+ offset: 24,
1764
+ byteLength: 8,
1765
+ },
1766
+ ];
1767
+ export function decodeQVAULTGetRevenueInQcapPerEpochOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1768
+ return decodePayload(data, QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1769
+ }
1770
+ export async function qVAULTGetRevenueInQcapPerEpoch(live, input, options) {
1771
+ return callContractFunction({
1772
+ live,
1773
+ contractIndex: QVAULT_CONTRACT_INDEX,
1774
+ inputType: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_TYPE,
1775
+ inputSize: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_SIZE,
1776
+ inputFields: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_FIELDS,
1777
+ outputFields: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_OUTPUT_FIELDS,
1778
+ structs: STRUCTS,
1779
+ input: input,
1780
+ ...options,
1781
+ });
1782
+ }
1783
+ export const QVAULT_GET_REVENUE_PER_SHARE_INPUT_TYPE = 28;
1784
+ export const QVAULT_GET_REVENUE_PER_SHARE_INPUT_SIZE = 4;
1785
+ const QVAULT_GET_REVENUE_PER_SHARE_INPUT_FIELDS = [
1786
+ {
1787
+ name: 'contractIndex',
1788
+ type: 'uint32',
1789
+ offset: 0,
1790
+ byteLength: 4,
1791
+ },
1792
+ ];
1793
+ export function buildQVAULTGetRevenuePerShareInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1794
+ return buildPayload(QVAULT_GET_REVENUE_PER_SHARE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1795
+ }
1796
+ const QVAULT_GET_REVENUE_PER_SHARE_OUTPUT_FIELDS = [
1797
+ {
1798
+ name: 'revenue',
1799
+ type: 'uint64',
1800
+ offset: 0,
1801
+ byteLength: 8,
1802
+ },
1803
+ ];
1804
+ export function decodeQVAULTGetRevenuePerShareOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1805
+ return decodePayload(data, QVAULT_GET_REVENUE_PER_SHARE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1806
+ }
1807
+ export async function qVAULTGetRevenuePerShare(live, input, options) {
1808
+ return callContractFunction({
1809
+ live,
1810
+ contractIndex: QVAULT_CONTRACT_INDEX,
1811
+ inputType: QVAULT_GET_REVENUE_PER_SHARE_INPUT_TYPE,
1812
+ inputSize: QVAULT_GET_REVENUE_PER_SHARE_INPUT_SIZE,
1813
+ inputFields: QVAULT_GET_REVENUE_PER_SHARE_INPUT_FIELDS,
1814
+ outputFields: QVAULT_GET_REVENUE_PER_SHARE_OUTPUT_FIELDS,
1815
+ structs: STRUCTS,
1816
+ input: input,
1817
+ ...options,
1818
+ });
1819
+ }
1820
+ export const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_TYPE = 29;
1821
+ export const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_SIZE = 40;
1822
+ const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_FIELDS = [
1823
+ {
1824
+ name: 'assetInfo',
1825
+ type: 'struct',
1826
+ offset: 0,
1827
+ byteLength: 40,
1828
+ structRef: 'Asset',
1829
+ },
1830
+ ];
1831
+ export function buildQVAULTGetAmountOfShareQvaultHoldInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1832
+ return buildPayload(QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1833
+ }
1834
+ const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_OUTPUT_FIELDS = [
1835
+ {
1836
+ name: 'amount',
1837
+ type: 'uint32',
1838
+ offset: 0,
1839
+ byteLength: 4,
1840
+ },
1841
+ ];
1842
+ export function decodeQVAULTGetAmountOfShareQvaultHoldOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1843
+ return decodePayload(data, QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1844
+ }
1845
+ export async function qVAULTGetAmountOfShareQvaultHold(live, input, options) {
1846
+ return callContractFunction({
1847
+ live,
1848
+ contractIndex: QVAULT_CONTRACT_INDEX,
1849
+ inputType: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_TYPE,
1850
+ inputSize: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_SIZE,
1851
+ inputFields: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_FIELDS,
1852
+ outputFields: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_OUTPUT_FIELDS,
1853
+ structs: STRUCTS,
1854
+ input: input,
1855
+ ...options,
1856
+ });
1857
+ }
1858
+ export const QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_TYPE = 30;
1859
+ export const QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_SIZE = 0;
1860
+ const QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_OUTPUT_FIELDS = [
1861
+ {
1862
+ name: 'returnCode',
1863
+ type: 'sint32',
1864
+ offset: 0,
1865
+ byteLength: 4,
1866
+ },
1867
+ {
1868
+ name: 'numberOfQcapHolder',
1869
+ type: 'uint32',
1870
+ offset: 4,
1871
+ byteLength: 4,
1872
+ },
1873
+ {
1874
+ name: 'avgAmount',
1875
+ type: 'uint32',
1876
+ offset: 8,
1877
+ byteLength: 4,
1878
+ },
1879
+ ];
1880
+ export function decodeQVAULTGetNumberOfHolderAndAvgAmOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1881
+ return decodePayload(data, QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1882
+ }
1883
+ export async function qVAULTGetNumberOfHolderAndAvgAm(live, options) {
1884
+ return callContractFunction({
1885
+ live,
1886
+ contractIndex: QVAULT_CONTRACT_INDEX,
1887
+ inputType: QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_TYPE,
1888
+ inputSize: QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_SIZE,
1889
+ inputFields: [],
1890
+ outputFields: QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_OUTPUT_FIELDS,
1891
+ structs: STRUCTS,
1892
+ input: {},
1893
+ ...options,
1894
+ });
1895
+ }
1896
+ export const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_TYPE = 31;
1897
+ export const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_SIZE = 4;
1898
+ const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_FIELDS = [
1899
+ {
1900
+ name: 'epoch',
1901
+ type: 'uint32',
1902
+ offset: 0,
1903
+ byteLength: 4,
1904
+ },
1905
+ ];
1906
+ export function buildQVAULTGetAmountForQearnInUpcomingEpochInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1907
+ return buildPayload(QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1908
+ }
1909
+ const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_OUTPUT_FIELDS = [
1910
+ {
1911
+ name: 'returnCode',
1912
+ type: 'sint32',
1913
+ offset: 0,
1914
+ byteLength: 4,
1915
+ },
1916
+ {
1917
+ name: 'amount',
1918
+ type: 'uint64',
1919
+ offset: 4,
1920
+ byteLength: 8,
1921
+ },
1922
+ ];
1923
+ export function decodeQVAULTGetAmountForQearnInUpcomingEpochOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1924
+ return decodePayload(data, QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1925
+ }
1926
+ export async function qVAULTGetAmountForQearnInUpcomingEpoch(live, input, options) {
1927
+ return callContractFunction({
1928
+ live,
1929
+ contractIndex: QVAULT_CONTRACT_INDEX,
1930
+ inputType: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_TYPE,
1931
+ inputSize: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_SIZE,
1932
+ inputFields: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_FIELDS,
1933
+ outputFields: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_OUTPUT_FIELDS,
1934
+ structs: STRUCTS,
1935
+ input: input,
1936
+ ...options,
1937
+ });
1938
+ }
1939
+ export const QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_TYPE = 32;
1940
+ export const QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_SIZE = 48;
1941
+ const QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_FIELDS = [
1942
+ {
1943
+ name: 'userID',
1944
+ type: 'id',
1945
+ offset: 0,
1946
+ byteLength: 32,
1947
+ },
1948
+ {
1949
+ name: 'proposalType',
1950
+ type: 'uint64',
1951
+ offset: 32,
1952
+ byteLength: 8,
1953
+ },
1954
+ {
1955
+ name: 'proposalId',
1956
+ type: 'uint64',
1957
+ offset: 40,
1958
+ byteLength: 8,
1959
+ },
1960
+ ];
1961
+ export function buildQVAULTGetVoteInProposalInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
1962
+ return buildPayload(QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
1963
+ }
1964
+ const QVAULT_GET_VOTE_IN_PROPOSAL_OUTPUT_FIELDS = [
1965
+ {
1966
+ name: 'returnCode',
1967
+ type: 'sint64',
1968
+ offset: 0,
1969
+ byteLength: 8,
1970
+ },
1971
+ {
1972
+ name: 'isVoted',
1973
+ type: 'sint64',
1974
+ offset: 8,
1975
+ byteLength: 8,
1976
+ },
1977
+ {
1978
+ name: 'votingDecision',
1979
+ type: 'sint64',
1980
+ offset: 16,
1981
+ byteLength: 8,
1982
+ },
1983
+ ];
1984
+ export function decodeQVAULTGetVoteInProposalOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
1985
+ return decodePayload(data, QVAULT_GET_VOTE_IN_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
1986
+ }
1987
+ export async function qVAULTGetVoteInProposal(live, input, options) {
1988
+ return callContractFunction({
1989
+ live,
1990
+ contractIndex: QVAULT_CONTRACT_INDEX,
1991
+ inputType: QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_TYPE,
1992
+ inputSize: QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_SIZE,
1993
+ inputFields: QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_FIELDS,
1994
+ outputFields: QVAULT_GET_VOTE_IN_PROPOSAL_OUTPUT_FIELDS,
1995
+ structs: STRUCTS,
1996
+ input: input,
1997
+ ...options,
1998
+ });
1999
+ }
2000
+ export const qVAULT = {
2001
+ contractIndex: QVAULT_CONTRACT_INDEX,
2002
+ getData: qVAULTGetData,
2003
+ getStakedAmountAndVotingPower: qVAULTGetStakedAmountAndVotingPower,
2004
+ getGP: qVAULTGetGP,
2005
+ getQCP: qVAULTGetQCP,
2006
+ getIPOP: qVAULTGetIPOP,
2007
+ getQEarnP: qVAULTGetQEarnP,
2008
+ getFundP: qVAULTGetFundP,
2009
+ getMKTP: qVAULTGetMKTP,
2010
+ getAlloP: qVAULTGetAlloP,
2011
+ getIdentitiesHvVtPw: qVAULTGetIdentitiesHvVtPw,
2012
+ ppCreationPower: qVAULTPpCreationPower,
2013
+ getQcapBurntAmountInLastEpoches: qVAULTGetQcapBurntAmountInLastEpoches,
2014
+ getAmountToBeSoldPerYear: qVAULTGetAmountToBeSoldPerYear,
2015
+ getTotalRevenueInQcap: qVAULTGetTotalRevenueInQcap,
2016
+ getRevenueInQcapPerEpoch: qVAULTGetRevenueInQcapPerEpoch,
2017
+ getRevenuePerShare: qVAULTGetRevenuePerShare,
2018
+ getAmountOfShareQvaultHold: qVAULTGetAmountOfShareQvaultHold,
2019
+ getNumberOfHolderAndAvgAm: qVAULTGetNumberOfHolderAndAvgAm,
2020
+ getAmountForQearnInUpcomingEpoch: qVAULTGetAmountForQearnInUpcomingEpoch,
2021
+ getVoteInProposal: qVAULTGetVoteInProposal,
2022
+ buildStakeInput: buildQVAULTStakeInput,
2023
+ decodeStakeOutput: decodeQVAULTStakeOutput,
2024
+ buildUnStakeInput: buildQVAULTUnStakeInput,
2025
+ decodeUnStakeOutput: decodeQVAULTUnStakeOutput,
2026
+ buildSubmitGPInput: buildQVAULTSubmitGPInput,
2027
+ decodeSubmitGPOutput: decodeQVAULTSubmitGPOutput,
2028
+ buildSubmitQCPInput: buildQVAULTSubmitQCPInput,
2029
+ decodeSubmitQCPOutput: decodeQVAULTSubmitQCPOutput,
2030
+ buildSubmitIPOPInput: buildQVAULTSubmitIPOPInput,
2031
+ decodeSubmitIPOPOutput: decodeQVAULTSubmitIPOPOutput,
2032
+ buildSubmitQEarnPInput: buildQVAULTSubmitQEarnPInput,
2033
+ decodeSubmitQEarnPOutput: decodeQVAULTSubmitQEarnPOutput,
2034
+ buildSubmitFundPInput: buildQVAULTSubmitFundPInput,
2035
+ decodeSubmitFundPOutput: decodeQVAULTSubmitFundPOutput,
2036
+ buildSubmitMKTPInput: buildQVAULTSubmitMKTPInput,
2037
+ decodeSubmitMKTPOutput: decodeQVAULTSubmitMKTPOutput,
2038
+ buildSubmitAlloPInput: buildQVAULTSubmitAlloPInput,
2039
+ decodeSubmitAlloPOutput: decodeQVAULTSubmitAlloPOutput,
2040
+ buildVoteInProposalInput: buildQVAULTVoteInProposalInput,
2041
+ decodeVoteInProposalOutput: decodeQVAULTVoteInProposalOutput,
2042
+ buildBuyQcapInput: buildQVAULTBuyQcapInput,
2043
+ decodeBuyQcapOutput: decodeQVAULTBuyQcapOutput,
2044
+ buildTransferShareManagementRightsInput: buildQVAULTTransferShareManagementRightsInput,
2045
+ decodeTransferShareManagementRightsOutput: decodeQVAULTTransferShareManagementRightsOutput,
2046
+ };
2047
+ //# sourceMappingURL=qvault.js.map