@qubic.org/contracts 0.2.7 → 1.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 (163) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +15 -18
  3. package/dist/__generated__/computorcontrolledfund.d.ts +1 -1
  4. package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -1
  5. package/dist/__generated__/computorcontrolledfund.js +8 -8
  6. package/dist/__generated__/computorcontrolledfund.js.map +1 -1
  7. package/dist/__generated__/escrow.d.ts +1 -1
  8. package/dist/__generated__/escrow.d.ts.map +1 -1
  9. package/dist/__generated__/escrow.js +3 -3
  10. package/dist/__generated__/escrow.js.map +1 -1
  11. package/dist/__generated__/generalquorumproposal.d.ts +1 -1
  12. package/dist/__generated__/generalquorumproposal.d.ts.map +1 -1
  13. package/dist/__generated__/generalquorumproposal.js +6 -6
  14. package/dist/__generated__/generalquorumproposal.js.map +1 -1
  15. package/dist/__generated__/ggwp.d.ts +265 -0
  16. package/dist/__generated__/ggwp.d.ts.map +1 -0
  17. package/dist/__generated__/ggwp.js +825 -0
  18. package/dist/__generated__/ggwp.js.map +1 -0
  19. package/dist/__generated__/index.d.ts +1 -0
  20. package/dist/__generated__/index.d.ts.map +1 -1
  21. package/dist/__generated__/index.js +1 -0
  22. package/dist/__generated__/index.js.map +1 -1
  23. package/dist/__generated__/msvault.d.ts +1 -1
  24. package/dist/__generated__/msvault.d.ts.map +1 -1
  25. package/dist/__generated__/msvault.js +19 -19
  26. package/dist/__generated__/msvault.js.map +1 -1
  27. package/dist/__generated__/multisignvault.d.ts +25 -25
  28. package/dist/__generated__/multisignvault.d.ts.map +1 -1
  29. package/dist/__generated__/multisignvault.js +25 -25
  30. package/dist/__generated__/multisignvault.js.map +1 -1
  31. package/dist/__generated__/nostromo.d.ts +1 -1
  32. package/dist/__generated__/nostromo.d.ts.map +1 -1
  33. package/dist/__generated__/nostromo.js +15 -15
  34. package/dist/__generated__/nostromo.js.map +1 -1
  35. package/dist/__generated__/pulse.d.ts +1 -1
  36. package/dist/__generated__/pulse.d.ts.map +1 -1
  37. package/dist/__generated__/pulse.js +26 -26
  38. package/dist/__generated__/pulse.js.map +1 -1
  39. package/dist/__generated__/qbay.d.ts +1 -1
  40. package/dist/__generated__/qbay.d.ts.map +1 -1
  41. package/dist/__generated__/qbay.js +23 -23
  42. package/dist/__generated__/qbay.js.map +1 -1
  43. package/dist/__generated__/qbond.d.ts +1 -1
  44. package/dist/__generated__/qbond.d.ts.map +1 -1
  45. package/dist/__generated__/qbond.js +14 -14
  46. package/dist/__generated__/qbond.js.map +1 -1
  47. package/dist/__generated__/qdraw.d.ts +1 -1
  48. package/dist/__generated__/qdraw.d.ts.map +1 -1
  49. package/dist/__generated__/qdraw.js.map +1 -1
  50. package/dist/__generated__/qduel.d.ts +1 -1
  51. package/dist/__generated__/qduel.d.ts.map +1 -1
  52. package/dist/__generated__/qduel.js +11 -11
  53. package/dist/__generated__/qduel.js.map +1 -1
  54. package/dist/__generated__/qearn.d.ts +1 -1
  55. package/dist/__generated__/qearn.d.ts.map +1 -1
  56. package/dist/__generated__/qearn.js +10 -10
  57. package/dist/__generated__/qearn.js.map +1 -1
  58. package/dist/__generated__/qip.d.ts +18 -1
  59. package/dist/__generated__/qip.d.ts.map +1 -1
  60. package/dist/__generated__/qip.js +64 -3
  61. package/dist/__generated__/qip.js.map +1 -1
  62. package/dist/__generated__/qraffle.d.ts +1 -1
  63. package/dist/__generated__/qraffle.d.ts.map +1 -1
  64. package/dist/__generated__/qraffle.js +12 -12
  65. package/dist/__generated__/qraffle.js.map +1 -1
  66. package/dist/__generated__/qreservepool.d.ts +1 -1
  67. package/dist/__generated__/qreservepool.d.ts.map +1 -1
  68. package/dist/__generated__/qreservepool.js +5 -5
  69. package/dist/__generated__/qreservepool.js.map +1 -1
  70. package/dist/__generated__/qrwa.d.ts +1 -1
  71. package/dist/__generated__/qrwa.d.ts.map +1 -1
  72. package/dist/__generated__/qrwa.js +18 -18
  73. package/dist/__generated__/qrwa.js.map +1 -1
  74. package/dist/__generated__/qswap.d.ts +3 -1
  75. package/dist/__generated__/qswap.d.ts.map +1 -1
  76. package/dist/__generated__/qswap.js +30 -18
  77. package/dist/__generated__/qswap.js.map +1 -1
  78. package/dist/__generated__/qthirtyfour.d.ts +1 -1
  79. package/dist/__generated__/qthirtyfour.d.ts.map +1 -1
  80. package/dist/__generated__/qthirtyfour.js +19 -19
  81. package/dist/__generated__/qthirtyfour.js.map +1 -1
  82. package/dist/__generated__/qubicicoportal.d.ts +4 -4
  83. package/dist/__generated__/qubicicoportal.d.ts.map +1 -1
  84. package/dist/__generated__/qubicicoportal.js +4 -4
  85. package/dist/__generated__/qubicicoportal.js.map +1 -1
  86. package/dist/__generated__/quottery.d.ts +1 -1
  87. package/dist/__generated__/quottery.d.ts.map +1 -1
  88. package/dist/__generated__/quottery.js +14 -14
  89. package/dist/__generated__/quottery.js.map +1 -1
  90. package/dist/__generated__/qusino.d.ts +1 -1
  91. package/dist/__generated__/qusino.d.ts.map +1 -1
  92. package/dist/__generated__/qusino.js +13 -13
  93. package/dist/__generated__/qusino.js.map +1 -1
  94. package/dist/__generated__/qutil.d.ts +1 -1
  95. package/dist/__generated__/qutil.d.ts.map +1 -1
  96. package/dist/__generated__/qutil.js +22 -22
  97. package/dist/__generated__/qutil.js.map +1 -1
  98. package/dist/__generated__/qvault.d.ts +14 -2
  99. package/dist/__generated__/qvault.d.ts.map +1 -1
  100. package/dist/__generated__/qvault.js +70 -32
  101. package/dist/__generated__/qvault.js.map +1 -1
  102. package/dist/__generated__/qx.d.ts +1 -1
  103. package/dist/__generated__/qx.d.ts.map +1 -1
  104. package/dist/__generated__/qx.js +12 -12
  105. package/dist/__generated__/qx.js.map +1 -1
  106. package/dist/__generated__/random.d.ts +24 -1
  107. package/dist/__generated__/random.d.ts.map +1 -1
  108. package/dist/__generated__/random.js +68 -0
  109. package/dist/__generated__/random.js.map +1 -1
  110. package/dist/__generated__/randomlottery.d.ts +1 -1
  111. package/dist/__generated__/randomlottery.d.ts.map +1 -1
  112. package/dist/__generated__/randomlottery.js +12 -12
  113. package/dist/__generated__/randomlottery.js.map +1 -1
  114. package/dist/__generated__/vottunbridge.d.ts +1 -1
  115. package/dist/__generated__/vottunbridge.d.ts.map +1 -1
  116. package/dist/__generated__/vottunbridge.js +13 -13
  117. package/dist/__generated__/vottunbridge.js.map +1 -1
  118. package/dist/call-contract.d.ts.map +1 -1
  119. package/dist/call-contract.js +6 -1
  120. package/dist/call-contract.js.map +1 -1
  121. package/dist/index.d.ts +2 -2
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +1 -1
  124. package/dist/index.js.map +1 -1
  125. package/package.json +8 -7
  126. package/src/__generated__/computorcontrolledfund.ts +1066 -0
  127. package/src/__generated__/escrow.ts +529 -0
  128. package/src/__generated__/generalquorumproposal.ts +691 -0
  129. package/src/__generated__/ggwp.ts +1241 -0
  130. package/src/__generated__/index.ts +28 -0
  131. package/src/__generated__/msvault.ts +1716 -0
  132. package/src/__generated__/multisignvault.ts +1511 -0
  133. package/src/__generated__/mylastmatch.ts +12 -0
  134. package/src/__generated__/nostromo.ts +1551 -0
  135. package/src/__generated__/pulse.ts +1512 -0
  136. package/src/__generated__/qbay.ts +2097 -0
  137. package/src/__generated__/qbond.ts +1016 -0
  138. package/src/__generated__/qdraw.ts +188 -0
  139. package/src/__generated__/qduel.ts +827 -0
  140. package/src/__generated__/qearn.ts +696 -0
  141. package/src/__generated__/qip.ts +501 -0
  142. package/src/__generated__/qraffle.ts +1162 -0
  143. package/src/__generated__/qreservepool.ts +281 -0
  144. package/src/__generated__/qrwa.ts +1491 -0
  145. package/src/__generated__/qswap.ts +1336 -0
  146. package/src/__generated__/qthirtyfour.ts +1131 -0
  147. package/src/__generated__/qubicicoportal.ts +386 -0
  148. package/src/__generated__/quottery.ts +1519 -0
  149. package/src/__generated__/qusino.ts +799 -0
  150. package/src/__generated__/qutil.ts +1506 -0
  151. package/src/__generated__/qvault.ts +2911 -0
  152. package/src/__generated__/qx.ts +861 -0
  153. package/src/__generated__/random.ts +145 -0
  154. package/src/__generated__/randomlottery.ts +653 -0
  155. package/src/__generated__/supplywatcher.ts +12 -0
  156. package/src/__generated__/vottunbridge.ts +1162 -0
  157. package/src/__tests__/contracts.test.ts +933 -0
  158. package/src/call-contract.ts +87 -0
  159. package/src/index.ts +9 -0
  160. package/dist/result.d.ts +0 -12
  161. package/dist/result.d.ts.map +0 -1
  162. package/dist/result.js +0 -7
  163. package/dist/result.js.map +0 -1
@@ -0,0 +1,2911 @@
1
+ // @generated — do not edit by hand. Run `bun run generate` to regenerate.
2
+ import type { BinaryField, FieldValue, NamedStruct } from '@qubic.org/registry'
3
+ import { buildPayload, decodePayload } from '@qubic.org/registry'
4
+ import type { QubicRpcError } from '@qubic.org/rpc'
5
+ import type { Result } from '@qubic.org/types'
6
+ import { type ContractCall, type ContractCallOptions, type SmartContractCaller, callContractFunction } from '../call-contract.js'
7
+
8
+ export const QVAULT_CONTRACT_INDEX = 10
9
+
10
+ export interface QVAULTAssetStruct {
11
+ issuer: string
12
+ assetName: bigint
13
+ }
14
+
15
+ export interface QVAULTGPInfoStruct {
16
+ proposer: string
17
+ currentTotalVotingPower: number
18
+ numberOfYes: number
19
+ numberOfNo: number
20
+ proposedEpoch: number
21
+ currentQuorumPercent: number
22
+ url: number[]
23
+ result: number
24
+ }
25
+
26
+ export interface QVAULTQCPInfoStruct {
27
+ proposer: string
28
+ currentTotalVotingPower: number
29
+ numberOfYes: number
30
+ numberOfNo: number
31
+ proposedEpoch: number
32
+ currentQuorumPercent: number
33
+ newQuorumPercent: number
34
+ url: number[]
35
+ result: number
36
+ }
37
+
38
+ export interface QVAULTIPOPInfoStruct {
39
+ proposer: string
40
+ totalWeight: bigint
41
+ assignedFund: bigint
42
+ currentTotalVotingPower: number
43
+ numberOfYes: number
44
+ numberOfNo: number
45
+ proposedEpoch: number
46
+ ipoContractIndex: number
47
+ currentQuorumPercent: number
48
+ url: number[]
49
+ result: number
50
+ }
51
+
52
+ export interface QVAULTQEarnPInfoStruct {
53
+ proposer: string
54
+ amountOfInvestPerEpoch: bigint
55
+ assignedFundPerEpoch: bigint
56
+ currentTotalVotingPower: number
57
+ numberOfYes: number
58
+ numberOfNo: number
59
+ proposedEpoch: number
60
+ currentQuorumPercent: number
61
+ url: number[]
62
+ numberOfEpoch: number
63
+ result: number
64
+ }
65
+
66
+ export interface QVAULTFundPInfoStruct {
67
+ proposer: string
68
+ pricePerOneQcap: bigint
69
+ currentTotalVotingPower: number
70
+ numberOfYes: number
71
+ numberOfNo: number
72
+ amountOfQcap: number
73
+ restSaleAmount: number
74
+ proposedEpoch: number
75
+ currentQuorumPercent: number
76
+ url: number[]
77
+ result: number
78
+ }
79
+
80
+ export interface QVAULTMKTPInfoStruct {
81
+ proposer: string
82
+ amountOfQubic: bigint
83
+ shareName: bigint
84
+ currentTotalVotingPower: number
85
+ numberOfYes: number
86
+ numberOfNo: number
87
+ amountOfQcap: number
88
+ currentQuorumPercent: number
89
+ proposedEpoch: number
90
+ shareIndex: number
91
+ amountOfShare: number
92
+ url: number[]
93
+ result: number
94
+ }
95
+
96
+ export interface QVAULTAlloPInfoStruct {
97
+ proposer: string
98
+ currentTotalVotingPower: number
99
+ numberOfYes: number
100
+ numberOfNo: number
101
+ proposedEpoch: number
102
+ currentQuorumPercent: number
103
+ reinvested: number
104
+ distributed: number
105
+ burnQcap: number
106
+ url: number[]
107
+ result: number
108
+ }
109
+
110
+ const STRUCTS: Record<string, NamedStruct> = {
111
+ 'Asset': {
112
+ name: 'Asset',
113
+ byteLength: 40,
114
+ fields: [
115
+ {
116
+ name: 'issuer',
117
+ type: 'id',
118
+ offset: 0,
119
+ byteLength: 32,
120
+ },
121
+ {
122
+ name: 'assetName',
123
+ type: 'uint64',
124
+ offset: 32,
125
+ byteLength: 8,
126
+ },
127
+ ],
128
+ },
129
+ 'GPInfo': {
130
+ name: 'GPInfo',
131
+ byteLength: 309,
132
+ fields: [
133
+ {
134
+ name: 'proposer',
135
+ type: 'id',
136
+ offset: 0,
137
+ byteLength: 32,
138
+ },
139
+ {
140
+ name: 'currentTotalVotingPower',
141
+ type: 'uint32',
142
+ offset: 32,
143
+ byteLength: 4,
144
+ },
145
+ {
146
+ name: 'numberOfYes',
147
+ type: 'uint32',
148
+ offset: 36,
149
+ byteLength: 4,
150
+ },
151
+ {
152
+ name: 'numberOfNo',
153
+ type: 'uint32',
154
+ offset: 40,
155
+ byteLength: 4,
156
+ },
157
+ {
158
+ name: 'proposedEpoch',
159
+ type: 'uint32',
160
+ offset: 44,
161
+ byteLength: 4,
162
+ },
163
+ {
164
+ name: 'currentQuorumPercent',
165
+ type: 'uint32',
166
+ offset: 48,
167
+ byteLength: 4,
168
+ },
169
+ {
170
+ name: 'url',
171
+ type: 'array',
172
+ offset: 52,
173
+ byteLength: 256,
174
+ arrayLength: 256,
175
+ arrayItemType: 'uint8',
176
+ arrayItemByteLength: 1,
177
+ },
178
+ {
179
+ name: 'result',
180
+ type: 'uint8',
181
+ offset: 308,
182
+ byteLength: 1,
183
+ },
184
+ ],
185
+ },
186
+ 'QCPInfo': {
187
+ name: 'QCPInfo',
188
+ byteLength: 313,
189
+ fields: [
190
+ {
191
+ name: 'proposer',
192
+ type: 'id',
193
+ offset: 0,
194
+ byteLength: 32,
195
+ },
196
+ {
197
+ name: 'currentTotalVotingPower',
198
+ type: 'uint32',
199
+ offset: 32,
200
+ byteLength: 4,
201
+ },
202
+ {
203
+ name: 'numberOfYes',
204
+ type: 'uint32',
205
+ offset: 36,
206
+ byteLength: 4,
207
+ },
208
+ {
209
+ name: 'numberOfNo',
210
+ type: 'uint32',
211
+ offset: 40,
212
+ byteLength: 4,
213
+ },
214
+ {
215
+ name: 'proposedEpoch',
216
+ type: 'uint32',
217
+ offset: 44,
218
+ byteLength: 4,
219
+ },
220
+ {
221
+ name: 'currentQuorumPercent',
222
+ type: 'uint32',
223
+ offset: 48,
224
+ byteLength: 4,
225
+ },
226
+ {
227
+ name: 'newQuorumPercent',
228
+ type: 'uint32',
229
+ offset: 52,
230
+ byteLength: 4,
231
+ },
232
+ {
233
+ name: 'url',
234
+ type: 'array',
235
+ offset: 56,
236
+ byteLength: 256,
237
+ arrayLength: 256,
238
+ arrayItemType: 'uint8',
239
+ arrayItemByteLength: 1,
240
+ },
241
+ {
242
+ name: 'result',
243
+ type: 'uint8',
244
+ offset: 312,
245
+ byteLength: 1,
246
+ },
247
+ ],
248
+ },
249
+ 'IPOPInfo': {
250
+ name: 'IPOPInfo',
251
+ byteLength: 329,
252
+ fields: [
253
+ {
254
+ name: 'proposer',
255
+ type: 'id',
256
+ offset: 0,
257
+ byteLength: 32,
258
+ },
259
+ {
260
+ name: 'totalWeight',
261
+ type: 'uint64',
262
+ offset: 32,
263
+ byteLength: 8,
264
+ },
265
+ {
266
+ name: 'assignedFund',
267
+ type: 'uint64',
268
+ offset: 40,
269
+ byteLength: 8,
270
+ },
271
+ {
272
+ name: 'currentTotalVotingPower',
273
+ type: 'uint32',
274
+ offset: 48,
275
+ byteLength: 4,
276
+ },
277
+ {
278
+ name: 'numberOfYes',
279
+ type: 'uint32',
280
+ offset: 52,
281
+ byteLength: 4,
282
+ },
283
+ {
284
+ name: 'numberOfNo',
285
+ type: 'uint32',
286
+ offset: 56,
287
+ byteLength: 4,
288
+ },
289
+ {
290
+ name: 'proposedEpoch',
291
+ type: 'uint32',
292
+ offset: 60,
293
+ byteLength: 4,
294
+ },
295
+ {
296
+ name: 'ipoContractIndex',
297
+ type: 'uint32',
298
+ offset: 64,
299
+ byteLength: 4,
300
+ },
301
+ {
302
+ name: 'currentQuorumPercent',
303
+ type: 'uint32',
304
+ offset: 68,
305
+ byteLength: 4,
306
+ },
307
+ {
308
+ name: 'url',
309
+ type: 'array',
310
+ offset: 72,
311
+ byteLength: 256,
312
+ arrayLength: 256,
313
+ arrayItemType: 'uint8',
314
+ arrayItemByteLength: 1,
315
+ },
316
+ {
317
+ name: 'result',
318
+ type: 'uint8',
319
+ offset: 328,
320
+ byteLength: 1,
321
+ },
322
+ ],
323
+ },
324
+ 'QEarnPInfo': {
325
+ name: 'QEarnPInfo',
326
+ byteLength: 326,
327
+ fields: [
328
+ {
329
+ name: 'proposer',
330
+ type: 'id',
331
+ offset: 0,
332
+ byteLength: 32,
333
+ },
334
+ {
335
+ name: 'amountOfInvestPerEpoch',
336
+ type: 'uint64',
337
+ offset: 32,
338
+ byteLength: 8,
339
+ },
340
+ {
341
+ name: 'assignedFundPerEpoch',
342
+ type: 'uint64',
343
+ offset: 40,
344
+ byteLength: 8,
345
+ },
346
+ {
347
+ name: 'currentTotalVotingPower',
348
+ type: 'uint32',
349
+ offset: 48,
350
+ byteLength: 4,
351
+ },
352
+ {
353
+ name: 'numberOfYes',
354
+ type: 'uint32',
355
+ offset: 52,
356
+ byteLength: 4,
357
+ },
358
+ {
359
+ name: 'numberOfNo',
360
+ type: 'uint32',
361
+ offset: 56,
362
+ byteLength: 4,
363
+ },
364
+ {
365
+ name: 'proposedEpoch',
366
+ type: 'uint32',
367
+ offset: 60,
368
+ byteLength: 4,
369
+ },
370
+ {
371
+ name: 'currentQuorumPercent',
372
+ type: 'uint32',
373
+ offset: 64,
374
+ byteLength: 4,
375
+ },
376
+ {
377
+ name: 'url',
378
+ type: 'array',
379
+ offset: 68,
380
+ byteLength: 256,
381
+ arrayLength: 256,
382
+ arrayItemType: 'uint8',
383
+ arrayItemByteLength: 1,
384
+ },
385
+ {
386
+ name: 'numberOfEpoch',
387
+ type: 'uint8',
388
+ offset: 324,
389
+ byteLength: 1,
390
+ },
391
+ {
392
+ name: 'result',
393
+ type: 'uint8',
394
+ offset: 325,
395
+ byteLength: 1,
396
+ },
397
+ ],
398
+ },
399
+ 'FundPInfo': {
400
+ name: 'FundPInfo',
401
+ byteLength: 325,
402
+ fields: [
403
+ {
404
+ name: 'proposer',
405
+ type: 'id',
406
+ offset: 0,
407
+ byteLength: 32,
408
+ },
409
+ {
410
+ name: 'pricePerOneQcap',
411
+ type: 'uint64',
412
+ offset: 32,
413
+ byteLength: 8,
414
+ },
415
+ {
416
+ name: 'currentTotalVotingPower',
417
+ type: 'uint32',
418
+ offset: 40,
419
+ byteLength: 4,
420
+ },
421
+ {
422
+ name: 'numberOfYes',
423
+ type: 'uint32',
424
+ offset: 44,
425
+ byteLength: 4,
426
+ },
427
+ {
428
+ name: 'numberOfNo',
429
+ type: 'uint32',
430
+ offset: 48,
431
+ byteLength: 4,
432
+ },
433
+ {
434
+ name: 'amountOfQcap',
435
+ type: 'uint32',
436
+ offset: 52,
437
+ byteLength: 4,
438
+ },
439
+ {
440
+ name: 'restSaleAmount',
441
+ type: 'uint32',
442
+ offset: 56,
443
+ byteLength: 4,
444
+ },
445
+ {
446
+ name: 'proposedEpoch',
447
+ type: 'uint32',
448
+ offset: 60,
449
+ byteLength: 4,
450
+ },
451
+ {
452
+ name: 'currentQuorumPercent',
453
+ type: 'uint32',
454
+ offset: 64,
455
+ byteLength: 4,
456
+ },
457
+ {
458
+ name: 'url',
459
+ type: 'array',
460
+ offset: 68,
461
+ byteLength: 256,
462
+ arrayLength: 256,
463
+ arrayItemType: 'uint8',
464
+ arrayItemByteLength: 1,
465
+ },
466
+ {
467
+ name: 'result',
468
+ type: 'uint8',
469
+ offset: 324,
470
+ byteLength: 1,
471
+ },
472
+ ],
473
+ },
474
+ 'MKTPInfo': {
475
+ name: 'MKTPInfo',
476
+ byteLength: 337,
477
+ fields: [
478
+ {
479
+ name: 'proposer',
480
+ type: 'id',
481
+ offset: 0,
482
+ byteLength: 32,
483
+ },
484
+ {
485
+ name: 'amountOfQubic',
486
+ type: 'uint64',
487
+ offset: 32,
488
+ byteLength: 8,
489
+ },
490
+ {
491
+ name: 'shareName',
492
+ type: 'uint64',
493
+ offset: 40,
494
+ byteLength: 8,
495
+ },
496
+ {
497
+ name: 'currentTotalVotingPower',
498
+ type: 'uint32',
499
+ offset: 48,
500
+ byteLength: 4,
501
+ },
502
+ {
503
+ name: 'numberOfYes',
504
+ type: 'uint32',
505
+ offset: 52,
506
+ byteLength: 4,
507
+ },
508
+ {
509
+ name: 'numberOfNo',
510
+ type: 'uint32',
511
+ offset: 56,
512
+ byteLength: 4,
513
+ },
514
+ {
515
+ name: 'amountOfQcap',
516
+ type: 'uint32',
517
+ offset: 60,
518
+ byteLength: 4,
519
+ },
520
+ {
521
+ name: 'currentQuorumPercent',
522
+ type: 'uint32',
523
+ offset: 64,
524
+ byteLength: 4,
525
+ },
526
+ {
527
+ name: 'proposedEpoch',
528
+ type: 'uint32',
529
+ offset: 68,
530
+ byteLength: 4,
531
+ },
532
+ {
533
+ name: 'shareIndex',
534
+ type: 'uint32',
535
+ offset: 72,
536
+ byteLength: 4,
537
+ },
538
+ {
539
+ name: 'amountOfShare',
540
+ type: 'uint32',
541
+ offset: 76,
542
+ byteLength: 4,
543
+ },
544
+ {
545
+ name: 'url',
546
+ type: 'array',
547
+ offset: 80,
548
+ byteLength: 256,
549
+ arrayLength: 256,
550
+ arrayItemType: 'uint8',
551
+ arrayItemByteLength: 1,
552
+ },
553
+ {
554
+ name: 'result',
555
+ type: 'uint8',
556
+ offset: 336,
557
+ byteLength: 1,
558
+ },
559
+ ],
560
+ },
561
+ 'AlloPInfo': {
562
+ name: 'AlloPInfo',
563
+ byteLength: 321,
564
+ fields: [
565
+ {
566
+ name: 'proposer',
567
+ type: 'id',
568
+ offset: 0,
569
+ byteLength: 32,
570
+ },
571
+ {
572
+ name: 'currentTotalVotingPower',
573
+ type: 'uint32',
574
+ offset: 32,
575
+ byteLength: 4,
576
+ },
577
+ {
578
+ name: 'numberOfYes',
579
+ type: 'uint32',
580
+ offset: 36,
581
+ byteLength: 4,
582
+ },
583
+ {
584
+ name: 'numberOfNo',
585
+ type: 'uint32',
586
+ offset: 40,
587
+ byteLength: 4,
588
+ },
589
+ {
590
+ name: 'proposedEpoch',
591
+ type: 'uint32',
592
+ offset: 44,
593
+ byteLength: 4,
594
+ },
595
+ {
596
+ name: 'currentQuorumPercent',
597
+ type: 'uint32',
598
+ offset: 48,
599
+ byteLength: 4,
600
+ },
601
+ {
602
+ name: 'reinvested',
603
+ type: 'uint32',
604
+ offset: 52,
605
+ byteLength: 4,
606
+ },
607
+ {
608
+ name: 'distributed',
609
+ type: 'uint32',
610
+ offset: 56,
611
+ byteLength: 4,
612
+ },
613
+ {
614
+ name: 'burnQcap',
615
+ type: 'uint32',
616
+ offset: 60,
617
+ byteLength: 4,
618
+ },
619
+ {
620
+ name: 'url',
621
+ type: 'array',
622
+ offset: 64,
623
+ byteLength: 256,
624
+ arrayLength: 256,
625
+ arrayItemType: 'uint8',
626
+ arrayItemByteLength: 1,
627
+ },
628
+ {
629
+ name: 'result',
630
+ type: 'uint8',
631
+ offset: 320,
632
+ byteLength: 1,
633
+ },
634
+ ],
635
+ },
636
+ }
637
+
638
+ export const QVAULT_STAKE_INPUT_TYPE = 1
639
+
640
+ export interface QVAULTStakeInput {
641
+ amount: number
642
+ }
643
+
644
+ const QVAULT_STAKE_INPUT_FIELDS: BinaryField[] = [
645
+ {
646
+ name: 'amount',
647
+ type: 'uint32',
648
+ offset: 0,
649
+ byteLength: 4,
650
+ },
651
+ ]
652
+
653
+ export function buildQVAULTStakeInput(
654
+ input: QVAULTStakeInput,
655
+ ): ContractCall {
656
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_STAKE_INPUT_TYPE, payload: buildPayload(QVAULT_STAKE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
657
+ }
658
+
659
+ export interface QVAULTStakeOutput {
660
+ returnCode: number
661
+ }
662
+
663
+ const QVAULT_STAKE_OUTPUT_FIELDS: BinaryField[] = [
664
+ {
665
+ name: 'returnCode',
666
+ type: 'sint32',
667
+ offset: 0,
668
+ byteLength: 4,
669
+ },
670
+ ]
671
+
672
+ export function decodeQVAULTStakeOutput(
673
+ data: Uint8Array,
674
+ ): QVAULTStakeOutput {
675
+ return decodePayload(data, QVAULT_STAKE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTStakeOutput
676
+ }
677
+
678
+ export const QVAULT_UN_STAKE_INPUT_TYPE = 2
679
+
680
+ export interface QVAULTUnStakeInput {
681
+ amount: number
682
+ }
683
+
684
+ const QVAULT_UN_STAKE_INPUT_FIELDS: BinaryField[] = [
685
+ {
686
+ name: 'amount',
687
+ type: 'uint32',
688
+ offset: 0,
689
+ byteLength: 4,
690
+ },
691
+ ]
692
+
693
+ export function buildQVAULTUnStakeInput(
694
+ input: QVAULTUnStakeInput,
695
+ ): ContractCall {
696
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_UN_STAKE_INPUT_TYPE, payload: buildPayload(QVAULT_UN_STAKE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
697
+ }
698
+
699
+ export interface QVAULTUnStakeOutput {
700
+ returnCode: number
701
+ }
702
+
703
+ const QVAULT_UN_STAKE_OUTPUT_FIELDS: BinaryField[] = [
704
+ {
705
+ name: 'returnCode',
706
+ type: 'sint32',
707
+ offset: 0,
708
+ byteLength: 4,
709
+ },
710
+ ]
711
+
712
+ export function decodeQVAULTUnStakeOutput(
713
+ data: Uint8Array,
714
+ ): QVAULTUnStakeOutput {
715
+ return decodePayload(data, QVAULT_UN_STAKE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTUnStakeOutput
716
+ }
717
+
718
+ export const QVAULT_SUBMIT_GP_INPUT_TYPE = 3
719
+
720
+ export interface QVAULTSubmitGPInput {
721
+ url: number[]
722
+ }
723
+
724
+ const QVAULT_SUBMIT_GP_INPUT_FIELDS: BinaryField[] = [
725
+ {
726
+ name: 'url',
727
+ type: 'array',
728
+ offset: 0,
729
+ byteLength: 256,
730
+ arrayLength: 256,
731
+ arrayItemType: 'uint8',
732
+ arrayItemByteLength: 1,
733
+ },
734
+ ]
735
+
736
+ export function buildQVAULTSubmitGPInput(
737
+ input: QVAULTSubmitGPInput,
738
+ ): ContractCall {
739
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_GP_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_GP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
740
+ }
741
+
742
+ export interface QVAULTSubmitGPOutput {
743
+ returnCode: number
744
+ }
745
+
746
+ const QVAULT_SUBMIT_GP_OUTPUT_FIELDS: BinaryField[] = [
747
+ {
748
+ name: 'returnCode',
749
+ type: 'sint32',
750
+ offset: 0,
751
+ byteLength: 4,
752
+ },
753
+ ]
754
+
755
+ export function decodeQVAULTSubmitGPOutput(
756
+ data: Uint8Array,
757
+ ): QVAULTSubmitGPOutput {
758
+ return decodePayload(data, QVAULT_SUBMIT_GP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitGPOutput
759
+ }
760
+
761
+ export const QVAULT_SUBMIT_QCP_INPUT_TYPE = 4
762
+
763
+ export interface QVAULTSubmitQCPInput {
764
+ newQuorumPercent: number
765
+ url: number[]
766
+ }
767
+
768
+ const QVAULT_SUBMIT_QCP_INPUT_FIELDS: BinaryField[] = [
769
+ {
770
+ name: 'newQuorumPercent',
771
+ type: 'uint32',
772
+ offset: 0,
773
+ byteLength: 4,
774
+ },
775
+ {
776
+ name: 'url',
777
+ type: 'array',
778
+ offset: 4,
779
+ byteLength: 256,
780
+ arrayLength: 256,
781
+ arrayItemType: 'uint8',
782
+ arrayItemByteLength: 1,
783
+ },
784
+ ]
785
+
786
+ export function buildQVAULTSubmitQCPInput(
787
+ input: QVAULTSubmitQCPInput,
788
+ ): ContractCall {
789
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_QCP_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_QCP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
790
+ }
791
+
792
+ export interface QVAULTSubmitQCPOutput {
793
+ returnCode: number
794
+ }
795
+
796
+ const QVAULT_SUBMIT_QCP_OUTPUT_FIELDS: BinaryField[] = [
797
+ {
798
+ name: 'returnCode',
799
+ type: 'sint32',
800
+ offset: 0,
801
+ byteLength: 4,
802
+ },
803
+ ]
804
+
805
+ export function decodeQVAULTSubmitQCPOutput(
806
+ data: Uint8Array,
807
+ ): QVAULTSubmitQCPOutput {
808
+ return decodePayload(data, QVAULT_SUBMIT_QCP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitQCPOutput
809
+ }
810
+
811
+ export const QVAULT_SUBMIT_IPOP_INPUT_TYPE = 5
812
+
813
+ export interface QVAULTSubmitIPOPInput {
814
+ ipoContractIndex: number
815
+ url: number[]
816
+ }
817
+
818
+ const QVAULT_SUBMIT_IPOP_INPUT_FIELDS: BinaryField[] = [
819
+ {
820
+ name: 'ipoContractIndex',
821
+ type: 'uint32',
822
+ offset: 0,
823
+ byteLength: 4,
824
+ },
825
+ {
826
+ name: 'url',
827
+ type: 'array',
828
+ offset: 4,
829
+ byteLength: 256,
830
+ arrayLength: 256,
831
+ arrayItemType: 'uint8',
832
+ arrayItemByteLength: 1,
833
+ },
834
+ ]
835
+
836
+ export function buildQVAULTSubmitIPOPInput(
837
+ input: QVAULTSubmitIPOPInput,
838
+ ): ContractCall {
839
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_IPOP_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_IPOP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
840
+ }
841
+
842
+ export interface QVAULTSubmitIPOPOutput {
843
+ returnCode: number
844
+ }
845
+
846
+ const QVAULT_SUBMIT_IPOP_OUTPUT_FIELDS: BinaryField[] = [
847
+ {
848
+ name: 'returnCode',
849
+ type: 'sint32',
850
+ offset: 0,
851
+ byteLength: 4,
852
+ },
853
+ ]
854
+
855
+ export function decodeQVAULTSubmitIPOPOutput(
856
+ data: Uint8Array,
857
+ ): QVAULTSubmitIPOPOutput {
858
+ return decodePayload(data, QVAULT_SUBMIT_IPOP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitIPOPOutput
859
+ }
860
+
861
+ export const QVAULT_SUBMIT_Q_EARN_P_INPUT_TYPE = 6
862
+
863
+ export interface QVAULTSubmitQEarnPInput {
864
+ amountPerEpoch: bigint
865
+ numberOfEpoch: number
866
+ url: number[]
867
+ }
868
+
869
+ const QVAULT_SUBMIT_Q_EARN_P_INPUT_FIELDS: BinaryField[] = [
870
+ {
871
+ name: 'amountPerEpoch',
872
+ type: 'uint64',
873
+ offset: 0,
874
+ byteLength: 8,
875
+ },
876
+ {
877
+ name: 'numberOfEpoch',
878
+ type: 'uint32',
879
+ offset: 8,
880
+ byteLength: 4,
881
+ },
882
+ {
883
+ name: 'url',
884
+ type: 'array',
885
+ offset: 12,
886
+ byteLength: 256,
887
+ arrayLength: 256,
888
+ arrayItemType: 'uint8',
889
+ arrayItemByteLength: 1,
890
+ },
891
+ ]
892
+
893
+ export function buildQVAULTSubmitQEarnPInput(
894
+ input: QVAULTSubmitQEarnPInput,
895
+ ): ContractCall {
896
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_Q_EARN_P_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_Q_EARN_P_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
897
+ }
898
+
899
+ export interface QVAULTSubmitQEarnPOutput {
900
+ returnCode: number
901
+ }
902
+
903
+ const QVAULT_SUBMIT_Q_EARN_P_OUTPUT_FIELDS: BinaryField[] = [
904
+ {
905
+ name: 'returnCode',
906
+ type: 'sint32',
907
+ offset: 0,
908
+ byteLength: 4,
909
+ },
910
+ ]
911
+
912
+ export function decodeQVAULTSubmitQEarnPOutput(
913
+ data: Uint8Array,
914
+ ): QVAULTSubmitQEarnPOutput {
915
+ return decodePayload(data, QVAULT_SUBMIT_Q_EARN_P_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitQEarnPOutput
916
+ }
917
+
918
+ export const QVAULT_SUBMIT_FUND_P_INPUT_TYPE = 7
919
+
920
+ export interface QVAULTSubmitFundPInput {
921
+ priceOfOneQcap: bigint
922
+ amountOfQcap: number
923
+ url: number[]
924
+ }
925
+
926
+ const QVAULT_SUBMIT_FUND_P_INPUT_FIELDS: BinaryField[] = [
927
+ {
928
+ name: 'priceOfOneQcap',
929
+ type: 'uint64',
930
+ offset: 0,
931
+ byteLength: 8,
932
+ },
933
+ {
934
+ name: 'amountOfQcap',
935
+ type: 'uint32',
936
+ offset: 8,
937
+ byteLength: 4,
938
+ },
939
+ {
940
+ name: 'url',
941
+ type: 'array',
942
+ offset: 12,
943
+ byteLength: 256,
944
+ arrayLength: 256,
945
+ arrayItemType: 'uint8',
946
+ arrayItemByteLength: 1,
947
+ },
948
+ ]
949
+
950
+ export function buildQVAULTSubmitFundPInput(
951
+ input: QVAULTSubmitFundPInput,
952
+ ): ContractCall {
953
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_FUND_P_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_FUND_P_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
954
+ }
955
+
956
+ export interface QVAULTSubmitFundPOutput {
957
+ returnCode: number
958
+ }
959
+
960
+ const QVAULT_SUBMIT_FUND_P_OUTPUT_FIELDS: BinaryField[] = [
961
+ {
962
+ name: 'returnCode',
963
+ type: 'sint32',
964
+ offset: 0,
965
+ byteLength: 4,
966
+ },
967
+ ]
968
+
969
+ export function decodeQVAULTSubmitFundPOutput(
970
+ data: Uint8Array,
971
+ ): QVAULTSubmitFundPOutput {
972
+ return decodePayload(data, QVAULT_SUBMIT_FUND_P_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitFundPOutput
973
+ }
974
+
975
+ export const QVAULT_SUBMIT_MKTP_INPUT_TYPE = 8
976
+
977
+ export interface QVAULTSubmitMKTPInput {
978
+ amountOfQubic: bigint
979
+ shareName: bigint
980
+ amountOfQcap: number
981
+ indexOfShare: number
982
+ amountOfShare: number
983
+ url: number[]
984
+ }
985
+
986
+ const QVAULT_SUBMIT_MKTP_INPUT_FIELDS: BinaryField[] = [
987
+ {
988
+ name: 'amountOfQubic',
989
+ type: 'uint64',
990
+ offset: 0,
991
+ byteLength: 8,
992
+ },
993
+ {
994
+ name: 'shareName',
995
+ type: 'uint64',
996
+ offset: 8,
997
+ byteLength: 8,
998
+ },
999
+ {
1000
+ name: 'amountOfQcap',
1001
+ type: 'uint32',
1002
+ offset: 16,
1003
+ byteLength: 4,
1004
+ },
1005
+ {
1006
+ name: 'indexOfShare',
1007
+ type: 'uint32',
1008
+ offset: 20,
1009
+ byteLength: 4,
1010
+ },
1011
+ {
1012
+ name: 'amountOfShare',
1013
+ type: 'uint32',
1014
+ offset: 24,
1015
+ byteLength: 4,
1016
+ },
1017
+ {
1018
+ name: 'url',
1019
+ type: 'array',
1020
+ offset: 28,
1021
+ byteLength: 256,
1022
+ arrayLength: 256,
1023
+ arrayItemType: 'uint8',
1024
+ arrayItemByteLength: 1,
1025
+ },
1026
+ ]
1027
+
1028
+ export function buildQVAULTSubmitMKTPInput(
1029
+ input: QVAULTSubmitMKTPInput,
1030
+ ): ContractCall {
1031
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_MKTP_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_MKTP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
1032
+ }
1033
+
1034
+ export interface QVAULTSubmitMKTPOutput {
1035
+ returnCode: number
1036
+ }
1037
+
1038
+ const QVAULT_SUBMIT_MKTP_OUTPUT_FIELDS: BinaryField[] = [
1039
+ {
1040
+ name: 'returnCode',
1041
+ type: 'sint32',
1042
+ offset: 0,
1043
+ byteLength: 4,
1044
+ },
1045
+ ]
1046
+
1047
+ export function decodeQVAULTSubmitMKTPOutput(
1048
+ data: Uint8Array,
1049
+ ): QVAULTSubmitMKTPOutput {
1050
+ return decodePayload(data, QVAULT_SUBMIT_MKTP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitMKTPOutput
1051
+ }
1052
+
1053
+ export const QVAULT_SUBMIT_ALLO_P_INPUT_TYPE = 9
1054
+
1055
+ export interface QVAULTSubmitAlloPInput {
1056
+ reinvested: number
1057
+ burn: number
1058
+ distribute: number
1059
+ url: number[]
1060
+ }
1061
+
1062
+ const QVAULT_SUBMIT_ALLO_P_INPUT_FIELDS: BinaryField[] = [
1063
+ {
1064
+ name: 'reinvested',
1065
+ type: 'uint32',
1066
+ offset: 0,
1067
+ byteLength: 4,
1068
+ },
1069
+ {
1070
+ name: 'burn',
1071
+ type: 'uint32',
1072
+ offset: 4,
1073
+ byteLength: 4,
1074
+ },
1075
+ {
1076
+ name: 'distribute',
1077
+ type: 'uint32',
1078
+ offset: 8,
1079
+ byteLength: 4,
1080
+ },
1081
+ {
1082
+ name: 'url',
1083
+ type: 'array',
1084
+ offset: 12,
1085
+ byteLength: 256,
1086
+ arrayLength: 256,
1087
+ arrayItemType: 'uint8',
1088
+ arrayItemByteLength: 1,
1089
+ },
1090
+ ]
1091
+
1092
+ export function buildQVAULTSubmitAlloPInput(
1093
+ input: QVAULTSubmitAlloPInput,
1094
+ ): ContractCall {
1095
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_SUBMIT_ALLO_P_INPUT_TYPE, payload: buildPayload(QVAULT_SUBMIT_ALLO_P_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
1096
+ }
1097
+
1098
+ export interface QVAULTSubmitAlloPOutput {
1099
+ returnCode: number
1100
+ }
1101
+
1102
+ const QVAULT_SUBMIT_ALLO_P_OUTPUT_FIELDS: BinaryField[] = [
1103
+ {
1104
+ name: 'returnCode',
1105
+ type: 'sint32',
1106
+ offset: 0,
1107
+ byteLength: 4,
1108
+ },
1109
+ ]
1110
+
1111
+ export function decodeQVAULTSubmitAlloPOutput(
1112
+ data: Uint8Array,
1113
+ ): QVAULTSubmitAlloPOutput {
1114
+ return decodePayload(data, QVAULT_SUBMIT_ALLO_P_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTSubmitAlloPOutput
1115
+ }
1116
+
1117
+ export const QVAULT_VOTE_IN_PROPOSAL_INPUT_TYPE = 11
1118
+
1119
+ export interface QVAULTVoteInProposalInput {
1120
+ priceOfIPO: bigint
1121
+ proposalType: number
1122
+ proposalId: number
1123
+ yes: number
1124
+ }
1125
+
1126
+ const QVAULT_VOTE_IN_PROPOSAL_INPUT_FIELDS: BinaryField[] = [
1127
+ {
1128
+ name: 'priceOfIPO',
1129
+ type: 'uint64',
1130
+ offset: 0,
1131
+ byteLength: 8,
1132
+ },
1133
+ {
1134
+ name: 'proposalType',
1135
+ type: 'uint32',
1136
+ offset: 8,
1137
+ byteLength: 4,
1138
+ },
1139
+ {
1140
+ name: 'proposalId',
1141
+ type: 'uint32',
1142
+ offset: 12,
1143
+ byteLength: 4,
1144
+ },
1145
+ {
1146
+ name: 'yes',
1147
+ type: 'uint8',
1148
+ offset: 16,
1149
+ byteLength: 1,
1150
+ },
1151
+ ]
1152
+
1153
+ export function buildQVAULTVoteInProposalInput(
1154
+ input: QVAULTVoteInProposalInput,
1155
+ ): ContractCall {
1156
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_VOTE_IN_PROPOSAL_INPUT_TYPE, payload: buildPayload(QVAULT_VOTE_IN_PROPOSAL_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
1157
+ }
1158
+
1159
+ export interface QVAULTVoteInProposalOutput {
1160
+ returnCode: number
1161
+ }
1162
+
1163
+ const QVAULT_VOTE_IN_PROPOSAL_OUTPUT_FIELDS: BinaryField[] = [
1164
+ {
1165
+ name: 'returnCode',
1166
+ type: 'sint32',
1167
+ offset: 0,
1168
+ byteLength: 4,
1169
+ },
1170
+ ]
1171
+
1172
+ export function decodeQVAULTVoteInProposalOutput(
1173
+ data: Uint8Array,
1174
+ ): QVAULTVoteInProposalOutput {
1175
+ return decodePayload(data, QVAULT_VOTE_IN_PROPOSAL_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTVoteInProposalOutput
1176
+ }
1177
+
1178
+ export const QVAULT_BUY_QCAP_INPUT_TYPE = 12
1179
+
1180
+ export interface QVAULTBuyQcapInput {
1181
+ amount: number
1182
+ }
1183
+
1184
+ const QVAULT_BUY_QCAP_INPUT_FIELDS: BinaryField[] = [
1185
+ {
1186
+ name: 'amount',
1187
+ type: 'uint32',
1188
+ offset: 0,
1189
+ byteLength: 4,
1190
+ },
1191
+ ]
1192
+
1193
+ export function buildQVAULTBuyQcapInput(
1194
+ input: QVAULTBuyQcapInput,
1195
+ ): ContractCall {
1196
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_BUY_QCAP_INPUT_TYPE, payload: buildPayload(QVAULT_BUY_QCAP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
1197
+ }
1198
+
1199
+ export interface QVAULTBuyQcapOutput {
1200
+ returnCode: number
1201
+ }
1202
+
1203
+ const QVAULT_BUY_QCAP_OUTPUT_FIELDS: BinaryField[] = [
1204
+ {
1205
+ name: 'returnCode',
1206
+ type: 'sint32',
1207
+ offset: 0,
1208
+ byteLength: 4,
1209
+ },
1210
+ ]
1211
+
1212
+ export function decodeQVAULTBuyQcapOutput(
1213
+ data: Uint8Array,
1214
+ ): QVAULTBuyQcapOutput {
1215
+ return decodePayload(data, QVAULT_BUY_QCAP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTBuyQcapOutput
1216
+ }
1217
+
1218
+ export const QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE = 13
1219
+
1220
+ export interface QVAULTTransferShareManagementRightsInput {
1221
+ asset: QVAULTAssetStruct
1222
+ numberOfShares: bigint
1223
+ newManagingContractIndex: number
1224
+ }
1225
+
1226
+ const QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS: BinaryField[] = [
1227
+ {
1228
+ name: 'asset',
1229
+ type: 'struct',
1230
+ offset: 0,
1231
+ byteLength: 40,
1232
+ structRef: 'Asset',
1233
+ },
1234
+ {
1235
+ name: 'numberOfShares',
1236
+ type: 'sint64',
1237
+ offset: 40,
1238
+ byteLength: 8,
1239
+ },
1240
+ {
1241
+ name: 'newManagingContractIndex',
1242
+ type: 'uint32',
1243
+ offset: 48,
1244
+ byteLength: 4,
1245
+ },
1246
+ ]
1247
+
1248
+ export function buildQVAULTTransferShareManagementRightsInput(
1249
+ input: QVAULTTransferShareManagementRightsInput,
1250
+ ): ContractCall {
1251
+ return { contractIndex: QVAULT_CONTRACT_INDEX, inputType: QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE, payload: buildPayload(QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
1252
+ }
1253
+
1254
+ export interface QVAULTTransferShareManagementRightsOutput {
1255
+ transferredNumberOfShares: bigint
1256
+ returnCode: number
1257
+ }
1258
+
1259
+ const QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS: BinaryField[] = [
1260
+ {
1261
+ name: 'transferredNumberOfShares',
1262
+ type: 'sint64',
1263
+ offset: 0,
1264
+ byteLength: 8,
1265
+ },
1266
+ {
1267
+ name: 'returnCode',
1268
+ type: 'sint32',
1269
+ offset: 8,
1270
+ byteLength: 4,
1271
+ },
1272
+ ]
1273
+
1274
+ export function decodeQVAULTTransferShareManagementRightsOutput(
1275
+ data: Uint8Array,
1276
+ ): QVAULTTransferShareManagementRightsOutput {
1277
+ return decodePayload(data, QVAULT_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTTransferShareManagementRightsOutput
1278
+ }
1279
+
1280
+ export const QVAULT_GET_DATA_INPUT_TYPE = 1
1281
+ export const QVAULT_GET_DATA_INPUT_SIZE = 0
1282
+
1283
+ export interface QVAULTGetDataOutput {
1284
+ returnCode: number
1285
+ totalVotingPower: bigint
1286
+ proposalCreateFund: bigint
1287
+ reinvestingFund: bigint
1288
+ totalEpochRevenue: bigint
1289
+ fundForBurn: bigint
1290
+ totalStakedQcapAmount: bigint
1291
+ qcapMarketCap: bigint
1292
+ raisedFundByQcap: bigint
1293
+ lastRoundPriceOfQcap: bigint
1294
+ revenueByQearn: bigint
1295
+ qcapSoldAmount: number
1296
+ shareholderDividend: number
1297
+ QCAPHolderPermille: number
1298
+ reinvestingPermille: number
1299
+ burnPermille: number
1300
+ qcapBurnPermille: number
1301
+ numberOfStaker: number
1302
+ numberOfVotingPower: number
1303
+ numberOfGP: number
1304
+ numberOfQCP: number
1305
+ numberOfIPOP: number
1306
+ numberOfQEarnP: number
1307
+ numberOfFundP: number
1308
+ numberOfMKTP: number
1309
+ numberOfAlloP: number
1310
+ transferRightsFee: number
1311
+ minQuorumRq: number
1312
+ maxQuorumRq: number
1313
+ totalQcapBurntAmount: number
1314
+ circulatingSupply: number
1315
+ quorumPercent: number
1316
+ }
1317
+
1318
+ const QVAULT_GET_DATA_OUTPUT_FIELDS: BinaryField[] = [
1319
+ {
1320
+ name: 'returnCode',
1321
+ type: 'sint32',
1322
+ offset: 0,
1323
+ byteLength: 4,
1324
+ },
1325
+ {
1326
+ name: 'totalVotingPower',
1327
+ type: 'uint64',
1328
+ offset: 4,
1329
+ byteLength: 8,
1330
+ },
1331
+ {
1332
+ name: 'proposalCreateFund',
1333
+ type: 'uint64',
1334
+ offset: 12,
1335
+ byteLength: 8,
1336
+ },
1337
+ {
1338
+ name: 'reinvestingFund',
1339
+ type: 'uint64',
1340
+ offset: 20,
1341
+ byteLength: 8,
1342
+ },
1343
+ {
1344
+ name: 'totalEpochRevenue',
1345
+ type: 'uint64',
1346
+ offset: 28,
1347
+ byteLength: 8,
1348
+ },
1349
+ {
1350
+ name: 'fundForBurn',
1351
+ type: 'uint64',
1352
+ offset: 36,
1353
+ byteLength: 8,
1354
+ },
1355
+ {
1356
+ name: 'totalStakedQcapAmount',
1357
+ type: 'uint64',
1358
+ offset: 44,
1359
+ byteLength: 8,
1360
+ },
1361
+ {
1362
+ name: 'qcapMarketCap',
1363
+ type: 'uint64',
1364
+ offset: 52,
1365
+ byteLength: 8,
1366
+ },
1367
+ {
1368
+ name: 'raisedFundByQcap',
1369
+ type: 'uint64',
1370
+ offset: 60,
1371
+ byteLength: 8,
1372
+ },
1373
+ {
1374
+ name: 'lastRoundPriceOfQcap',
1375
+ type: 'uint64',
1376
+ offset: 68,
1377
+ byteLength: 8,
1378
+ },
1379
+ {
1380
+ name: 'revenueByQearn',
1381
+ type: 'uint64',
1382
+ offset: 76,
1383
+ byteLength: 8,
1384
+ },
1385
+ {
1386
+ name: 'qcapSoldAmount',
1387
+ type: 'uint32',
1388
+ offset: 84,
1389
+ byteLength: 4,
1390
+ },
1391
+ {
1392
+ name: 'shareholderDividend',
1393
+ type: 'uint32',
1394
+ offset: 88,
1395
+ byteLength: 4,
1396
+ },
1397
+ {
1398
+ name: 'QCAPHolderPermille',
1399
+ type: 'uint32',
1400
+ offset: 92,
1401
+ byteLength: 4,
1402
+ },
1403
+ {
1404
+ name: 'reinvestingPermille',
1405
+ type: 'uint32',
1406
+ offset: 96,
1407
+ byteLength: 4,
1408
+ },
1409
+ {
1410
+ name: 'burnPermille',
1411
+ type: 'uint32',
1412
+ offset: 100,
1413
+ byteLength: 4,
1414
+ },
1415
+ {
1416
+ name: 'qcapBurnPermille',
1417
+ type: 'uint32',
1418
+ offset: 104,
1419
+ byteLength: 4,
1420
+ },
1421
+ {
1422
+ name: 'numberOfStaker',
1423
+ type: 'uint32',
1424
+ offset: 108,
1425
+ byteLength: 4,
1426
+ },
1427
+ {
1428
+ name: 'numberOfVotingPower',
1429
+ type: 'uint32',
1430
+ offset: 112,
1431
+ byteLength: 4,
1432
+ },
1433
+ {
1434
+ name: 'numberOfGP',
1435
+ type: 'uint32',
1436
+ offset: 116,
1437
+ byteLength: 4,
1438
+ },
1439
+ {
1440
+ name: 'numberOfQCP',
1441
+ type: 'uint32',
1442
+ offset: 120,
1443
+ byteLength: 4,
1444
+ },
1445
+ {
1446
+ name: 'numberOfIPOP',
1447
+ type: 'uint32',
1448
+ offset: 124,
1449
+ byteLength: 4,
1450
+ },
1451
+ {
1452
+ name: 'numberOfQEarnP',
1453
+ type: 'uint32',
1454
+ offset: 128,
1455
+ byteLength: 4,
1456
+ },
1457
+ {
1458
+ name: 'numberOfFundP',
1459
+ type: 'uint32',
1460
+ offset: 132,
1461
+ byteLength: 4,
1462
+ },
1463
+ {
1464
+ name: 'numberOfMKTP',
1465
+ type: 'uint32',
1466
+ offset: 136,
1467
+ byteLength: 4,
1468
+ },
1469
+ {
1470
+ name: 'numberOfAlloP',
1471
+ type: 'uint32',
1472
+ offset: 140,
1473
+ byteLength: 4,
1474
+ },
1475
+ {
1476
+ name: 'transferRightsFee',
1477
+ type: 'uint32',
1478
+ offset: 144,
1479
+ byteLength: 4,
1480
+ },
1481
+ {
1482
+ name: 'minQuorumRq',
1483
+ type: 'uint32',
1484
+ offset: 148,
1485
+ byteLength: 4,
1486
+ },
1487
+ {
1488
+ name: 'maxQuorumRq',
1489
+ type: 'uint32',
1490
+ offset: 152,
1491
+ byteLength: 4,
1492
+ },
1493
+ {
1494
+ name: 'totalQcapBurntAmount',
1495
+ type: 'uint32',
1496
+ offset: 156,
1497
+ byteLength: 4,
1498
+ },
1499
+ {
1500
+ name: 'circulatingSupply',
1501
+ type: 'uint32',
1502
+ offset: 160,
1503
+ byteLength: 4,
1504
+ },
1505
+ {
1506
+ name: 'quorumPercent',
1507
+ type: 'uint32',
1508
+ offset: 164,
1509
+ byteLength: 4,
1510
+ },
1511
+ ]
1512
+
1513
+ export function decodeQVAULTGetDataOutput(
1514
+ data: Uint8Array,
1515
+ ): QVAULTGetDataOutput {
1516
+ return decodePayload(data, QVAULT_GET_DATA_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetDataOutput
1517
+ }
1518
+
1519
+ export async function qVAULTGetData(
1520
+ live: SmartContractCaller,
1521
+ options?: ContractCallOptions,
1522
+ ): Promise<Result<QVAULTGetDataOutput, QubicRpcError>> {
1523
+ return callContractFunction({
1524
+ live,
1525
+ contractIndex: QVAULT_CONTRACT_INDEX,
1526
+ inputType: QVAULT_GET_DATA_INPUT_TYPE,
1527
+ inputSize: QVAULT_GET_DATA_INPUT_SIZE,
1528
+ inputFields: [],
1529
+ outputFields: QVAULT_GET_DATA_OUTPUT_FIELDS,
1530
+ structs: STRUCTS,
1531
+ input: {},
1532
+ ...options,
1533
+ })
1534
+ }
1535
+
1536
+ export const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_TYPE = 2
1537
+ export const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_SIZE = 32
1538
+
1539
+ export interface QVAULTGetStakedAmountAndVotingPowerInput {
1540
+ address: string
1541
+ }
1542
+
1543
+ const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_FIELDS: BinaryField[] = [
1544
+ {
1545
+ name: 'address',
1546
+ type: 'id',
1547
+ offset: 0,
1548
+ byteLength: 32,
1549
+ },
1550
+ ]
1551
+
1552
+ export function buildQVAULTGetStakedAmountAndVotingPowerInput(
1553
+ input: QVAULTGetStakedAmountAndVotingPowerInput,
1554
+ identityToPublicKey: (identity: string) => Uint8Array,
1555
+ ): Uint8Array {
1556
+ return buildPayload(QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
1557
+ }
1558
+
1559
+ export interface QVAULTGetStakedAmountAndVotingPowerOutput {
1560
+ returnCode: number
1561
+ stakedAmount: number
1562
+ votingPower: number
1563
+ }
1564
+
1565
+ const QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_OUTPUT_FIELDS: BinaryField[] = [
1566
+ {
1567
+ name: 'returnCode',
1568
+ type: 'sint32',
1569
+ offset: 0,
1570
+ byteLength: 4,
1571
+ },
1572
+ {
1573
+ name: 'stakedAmount',
1574
+ type: 'uint32',
1575
+ offset: 4,
1576
+ byteLength: 4,
1577
+ },
1578
+ {
1579
+ name: 'votingPower',
1580
+ type: 'uint32',
1581
+ offset: 8,
1582
+ byteLength: 4,
1583
+ },
1584
+ ]
1585
+
1586
+ export function decodeQVAULTGetStakedAmountAndVotingPowerOutput(
1587
+ data: Uint8Array,
1588
+ ): QVAULTGetStakedAmountAndVotingPowerOutput {
1589
+ return decodePayload(data, QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetStakedAmountAndVotingPowerOutput
1590
+ }
1591
+
1592
+ export async function qVAULTGetStakedAmountAndVotingPower(
1593
+ live: SmartContractCaller,
1594
+ input: QVAULTGetStakedAmountAndVotingPowerInput,
1595
+ options?: ContractCallOptions,
1596
+ ): Promise<Result<QVAULTGetStakedAmountAndVotingPowerOutput, QubicRpcError>> {
1597
+ return callContractFunction({
1598
+ live,
1599
+ contractIndex: QVAULT_CONTRACT_INDEX,
1600
+ inputType: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_TYPE,
1601
+ inputSize: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_SIZE,
1602
+ inputFields: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_INPUT_FIELDS,
1603
+ outputFields: QVAULT_GET_STAKED_AMOUNT_AND_VOTING_POWER_OUTPUT_FIELDS,
1604
+ structs: STRUCTS,
1605
+ input: (input as unknown as Record<string, unknown>),
1606
+ ...options,
1607
+ })
1608
+ }
1609
+
1610
+ export const QVAULT_GET_GP_INPUT_TYPE = 3
1611
+ export const QVAULT_GET_GP_INPUT_SIZE = 4
1612
+
1613
+ export interface QVAULTGetGPInput {
1614
+ proposalId: number
1615
+ }
1616
+
1617
+ const QVAULT_GET_GP_INPUT_FIELDS: BinaryField[] = [
1618
+ {
1619
+ name: 'proposalId',
1620
+ type: 'uint32',
1621
+ offset: 0,
1622
+ byteLength: 4,
1623
+ },
1624
+ ]
1625
+
1626
+ export function buildQVAULTGetGPInput(
1627
+ input: QVAULTGetGPInput,
1628
+ ): Uint8Array {
1629
+ return buildPayload(QVAULT_GET_GP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1630
+ }
1631
+
1632
+ export interface QVAULTGetGPOutput {
1633
+ returnCode: number
1634
+ proposal: QVAULTGPInfoStruct
1635
+ }
1636
+
1637
+ const QVAULT_GET_GP_OUTPUT_FIELDS: BinaryField[] = [
1638
+ {
1639
+ name: 'returnCode',
1640
+ type: 'sint32',
1641
+ offset: 0,
1642
+ byteLength: 4,
1643
+ },
1644
+ {
1645
+ name: 'proposal',
1646
+ type: 'struct',
1647
+ offset: 4,
1648
+ byteLength: 309,
1649
+ structRef: 'GPInfo',
1650
+ },
1651
+ ]
1652
+
1653
+ export function decodeQVAULTGetGPOutput(
1654
+ data: Uint8Array,
1655
+ ): QVAULTGetGPOutput {
1656
+ return decodePayload(data, QVAULT_GET_GP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetGPOutput
1657
+ }
1658
+
1659
+ export async function qVAULTGetGP(
1660
+ live: SmartContractCaller,
1661
+ input: QVAULTGetGPInput,
1662
+ options?: ContractCallOptions,
1663
+ ): Promise<Result<QVAULTGetGPOutput, QubicRpcError>> {
1664
+ return callContractFunction({
1665
+ live,
1666
+ contractIndex: QVAULT_CONTRACT_INDEX,
1667
+ inputType: QVAULT_GET_GP_INPUT_TYPE,
1668
+ inputSize: QVAULT_GET_GP_INPUT_SIZE,
1669
+ inputFields: QVAULT_GET_GP_INPUT_FIELDS,
1670
+ outputFields: QVAULT_GET_GP_OUTPUT_FIELDS,
1671
+ structs: STRUCTS,
1672
+ input: (input as unknown as Record<string, unknown>),
1673
+ ...options,
1674
+ })
1675
+ }
1676
+
1677
+ export const QVAULT_GET_QCP_INPUT_TYPE = 4
1678
+ export const QVAULT_GET_QCP_INPUT_SIZE = 4
1679
+
1680
+ export interface QVAULTGetQCPInput {
1681
+ proposalId: number
1682
+ }
1683
+
1684
+ const QVAULT_GET_QCP_INPUT_FIELDS: BinaryField[] = [
1685
+ {
1686
+ name: 'proposalId',
1687
+ type: 'uint32',
1688
+ offset: 0,
1689
+ byteLength: 4,
1690
+ },
1691
+ ]
1692
+
1693
+ export function buildQVAULTGetQCPInput(
1694
+ input: QVAULTGetQCPInput,
1695
+ ): Uint8Array {
1696
+ return buildPayload(QVAULT_GET_QCP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1697
+ }
1698
+
1699
+ export interface QVAULTGetQCPOutput {
1700
+ returnCode: number
1701
+ proposal: QVAULTQCPInfoStruct
1702
+ }
1703
+
1704
+ const QVAULT_GET_QCP_OUTPUT_FIELDS: BinaryField[] = [
1705
+ {
1706
+ name: 'returnCode',
1707
+ type: 'sint32',
1708
+ offset: 0,
1709
+ byteLength: 4,
1710
+ },
1711
+ {
1712
+ name: 'proposal',
1713
+ type: 'struct',
1714
+ offset: 4,
1715
+ byteLength: 313,
1716
+ structRef: 'QCPInfo',
1717
+ },
1718
+ ]
1719
+
1720
+ export function decodeQVAULTGetQCPOutput(
1721
+ data: Uint8Array,
1722
+ ): QVAULTGetQCPOutput {
1723
+ return decodePayload(data, QVAULT_GET_QCP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetQCPOutput
1724
+ }
1725
+
1726
+ export async function qVAULTGetQCP(
1727
+ live: SmartContractCaller,
1728
+ input: QVAULTGetQCPInput,
1729
+ options?: ContractCallOptions,
1730
+ ): Promise<Result<QVAULTGetQCPOutput, QubicRpcError>> {
1731
+ return callContractFunction({
1732
+ live,
1733
+ contractIndex: QVAULT_CONTRACT_INDEX,
1734
+ inputType: QVAULT_GET_QCP_INPUT_TYPE,
1735
+ inputSize: QVAULT_GET_QCP_INPUT_SIZE,
1736
+ inputFields: QVAULT_GET_QCP_INPUT_FIELDS,
1737
+ outputFields: QVAULT_GET_QCP_OUTPUT_FIELDS,
1738
+ structs: STRUCTS,
1739
+ input: (input as unknown as Record<string, unknown>),
1740
+ ...options,
1741
+ })
1742
+ }
1743
+
1744
+ export const QVAULT_GET_IPOP_INPUT_TYPE = 5
1745
+ export const QVAULT_GET_IPOP_INPUT_SIZE = 4
1746
+
1747
+ export interface QVAULTGetIPOPInput {
1748
+ proposalId: number
1749
+ }
1750
+
1751
+ const QVAULT_GET_IPOP_INPUT_FIELDS: BinaryField[] = [
1752
+ {
1753
+ name: 'proposalId',
1754
+ type: 'uint32',
1755
+ offset: 0,
1756
+ byteLength: 4,
1757
+ },
1758
+ ]
1759
+
1760
+ export function buildQVAULTGetIPOPInput(
1761
+ input: QVAULTGetIPOPInput,
1762
+ ): Uint8Array {
1763
+ return buildPayload(QVAULT_GET_IPOP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1764
+ }
1765
+
1766
+ export interface QVAULTGetIPOPOutput {
1767
+ returnCode: number
1768
+ proposal: QVAULTIPOPInfoStruct
1769
+ }
1770
+
1771
+ const QVAULT_GET_IPOP_OUTPUT_FIELDS: BinaryField[] = [
1772
+ {
1773
+ name: 'returnCode',
1774
+ type: 'sint32',
1775
+ offset: 0,
1776
+ byteLength: 4,
1777
+ },
1778
+ {
1779
+ name: 'proposal',
1780
+ type: 'struct',
1781
+ offset: 4,
1782
+ byteLength: 329,
1783
+ structRef: 'IPOPInfo',
1784
+ },
1785
+ ]
1786
+
1787
+ export function decodeQVAULTGetIPOPOutput(
1788
+ data: Uint8Array,
1789
+ ): QVAULTGetIPOPOutput {
1790
+ return decodePayload(data, QVAULT_GET_IPOP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetIPOPOutput
1791
+ }
1792
+
1793
+ export async function qVAULTGetIPOP(
1794
+ live: SmartContractCaller,
1795
+ input: QVAULTGetIPOPInput,
1796
+ options?: ContractCallOptions,
1797
+ ): Promise<Result<QVAULTGetIPOPOutput, QubicRpcError>> {
1798
+ return callContractFunction({
1799
+ live,
1800
+ contractIndex: QVAULT_CONTRACT_INDEX,
1801
+ inputType: QVAULT_GET_IPOP_INPUT_TYPE,
1802
+ inputSize: QVAULT_GET_IPOP_INPUT_SIZE,
1803
+ inputFields: QVAULT_GET_IPOP_INPUT_FIELDS,
1804
+ outputFields: QVAULT_GET_IPOP_OUTPUT_FIELDS,
1805
+ structs: STRUCTS,
1806
+ input: (input as unknown as Record<string, unknown>),
1807
+ ...options,
1808
+ })
1809
+ }
1810
+
1811
+ export const QVAULT_GET_Q_EARN_P_INPUT_TYPE = 6
1812
+ export const QVAULT_GET_Q_EARN_P_INPUT_SIZE = 4
1813
+
1814
+ export interface QVAULTGetQEarnPInput {
1815
+ proposalId: number
1816
+ }
1817
+
1818
+ const QVAULT_GET_Q_EARN_P_INPUT_FIELDS: BinaryField[] = [
1819
+ {
1820
+ name: 'proposalId',
1821
+ type: 'uint32',
1822
+ offset: 0,
1823
+ byteLength: 4,
1824
+ },
1825
+ ]
1826
+
1827
+ export function buildQVAULTGetQEarnPInput(
1828
+ input: QVAULTGetQEarnPInput,
1829
+ ): Uint8Array {
1830
+ return buildPayload(QVAULT_GET_Q_EARN_P_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1831
+ }
1832
+
1833
+ export interface QVAULTGetQEarnPOutput {
1834
+ returnCode: number
1835
+ proposal: QVAULTQEarnPInfoStruct
1836
+ }
1837
+
1838
+ const QVAULT_GET_Q_EARN_P_OUTPUT_FIELDS: BinaryField[] = [
1839
+ {
1840
+ name: 'returnCode',
1841
+ type: 'sint32',
1842
+ offset: 0,
1843
+ byteLength: 4,
1844
+ },
1845
+ {
1846
+ name: 'proposal',
1847
+ type: 'struct',
1848
+ offset: 4,
1849
+ byteLength: 326,
1850
+ structRef: 'QEarnPInfo',
1851
+ },
1852
+ ]
1853
+
1854
+ export function decodeQVAULTGetQEarnPOutput(
1855
+ data: Uint8Array,
1856
+ ): QVAULTGetQEarnPOutput {
1857
+ return decodePayload(data, QVAULT_GET_Q_EARN_P_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetQEarnPOutput
1858
+ }
1859
+
1860
+ export async function qVAULTGetQEarnP(
1861
+ live: SmartContractCaller,
1862
+ input: QVAULTGetQEarnPInput,
1863
+ options?: ContractCallOptions,
1864
+ ): Promise<Result<QVAULTGetQEarnPOutput, QubicRpcError>> {
1865
+ return callContractFunction({
1866
+ live,
1867
+ contractIndex: QVAULT_CONTRACT_INDEX,
1868
+ inputType: QVAULT_GET_Q_EARN_P_INPUT_TYPE,
1869
+ inputSize: QVAULT_GET_Q_EARN_P_INPUT_SIZE,
1870
+ inputFields: QVAULT_GET_Q_EARN_P_INPUT_FIELDS,
1871
+ outputFields: QVAULT_GET_Q_EARN_P_OUTPUT_FIELDS,
1872
+ structs: STRUCTS,
1873
+ input: (input as unknown as Record<string, unknown>),
1874
+ ...options,
1875
+ })
1876
+ }
1877
+
1878
+ export const QVAULT_GET_FUND_P_INPUT_TYPE = 7
1879
+ export const QVAULT_GET_FUND_P_INPUT_SIZE = 4
1880
+
1881
+ export interface QVAULTGetFundPInput {
1882
+ proposalId: number
1883
+ }
1884
+
1885
+ const QVAULT_GET_FUND_P_INPUT_FIELDS: BinaryField[] = [
1886
+ {
1887
+ name: 'proposalId',
1888
+ type: 'uint32',
1889
+ offset: 0,
1890
+ byteLength: 4,
1891
+ },
1892
+ ]
1893
+
1894
+ export function buildQVAULTGetFundPInput(
1895
+ input: QVAULTGetFundPInput,
1896
+ ): Uint8Array {
1897
+ return buildPayload(QVAULT_GET_FUND_P_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1898
+ }
1899
+
1900
+ export interface QVAULTGetFundPOutput {
1901
+ returnCode: number
1902
+ proposal: QVAULTFundPInfoStruct
1903
+ }
1904
+
1905
+ const QVAULT_GET_FUND_P_OUTPUT_FIELDS: BinaryField[] = [
1906
+ {
1907
+ name: 'returnCode',
1908
+ type: 'sint32',
1909
+ offset: 0,
1910
+ byteLength: 4,
1911
+ },
1912
+ {
1913
+ name: 'proposal',
1914
+ type: 'struct',
1915
+ offset: 4,
1916
+ byteLength: 325,
1917
+ structRef: 'FundPInfo',
1918
+ },
1919
+ ]
1920
+
1921
+ export function decodeQVAULTGetFundPOutput(
1922
+ data: Uint8Array,
1923
+ ): QVAULTGetFundPOutput {
1924
+ return decodePayload(data, QVAULT_GET_FUND_P_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetFundPOutput
1925
+ }
1926
+
1927
+ export async function qVAULTGetFundP(
1928
+ live: SmartContractCaller,
1929
+ input: QVAULTGetFundPInput,
1930
+ options?: ContractCallOptions,
1931
+ ): Promise<Result<QVAULTGetFundPOutput, QubicRpcError>> {
1932
+ return callContractFunction({
1933
+ live,
1934
+ contractIndex: QVAULT_CONTRACT_INDEX,
1935
+ inputType: QVAULT_GET_FUND_P_INPUT_TYPE,
1936
+ inputSize: QVAULT_GET_FUND_P_INPUT_SIZE,
1937
+ inputFields: QVAULT_GET_FUND_P_INPUT_FIELDS,
1938
+ outputFields: QVAULT_GET_FUND_P_OUTPUT_FIELDS,
1939
+ structs: STRUCTS,
1940
+ input: (input as unknown as Record<string, unknown>),
1941
+ ...options,
1942
+ })
1943
+ }
1944
+
1945
+ export const QVAULT_GET_MKTP_INPUT_TYPE = 8
1946
+ export const QVAULT_GET_MKTP_INPUT_SIZE = 4
1947
+
1948
+ export interface QVAULTGetMKTPInput {
1949
+ proposalId: number
1950
+ }
1951
+
1952
+ const QVAULT_GET_MKTP_INPUT_FIELDS: BinaryField[] = [
1953
+ {
1954
+ name: 'proposalId',
1955
+ type: 'uint32',
1956
+ offset: 0,
1957
+ byteLength: 4,
1958
+ },
1959
+ ]
1960
+
1961
+ export function buildQVAULTGetMKTPInput(
1962
+ input: QVAULTGetMKTPInput,
1963
+ ): Uint8Array {
1964
+ return buildPayload(QVAULT_GET_MKTP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1965
+ }
1966
+
1967
+ export interface QVAULTGetMKTPOutput {
1968
+ returnCode: number
1969
+ proposal: QVAULTMKTPInfoStruct
1970
+ }
1971
+
1972
+ const QVAULT_GET_MKTP_OUTPUT_FIELDS: BinaryField[] = [
1973
+ {
1974
+ name: 'returnCode',
1975
+ type: 'sint32',
1976
+ offset: 0,
1977
+ byteLength: 4,
1978
+ },
1979
+ {
1980
+ name: 'proposal',
1981
+ type: 'struct',
1982
+ offset: 4,
1983
+ byteLength: 337,
1984
+ structRef: 'MKTPInfo',
1985
+ },
1986
+ ]
1987
+
1988
+ export function decodeQVAULTGetMKTPOutput(
1989
+ data: Uint8Array,
1990
+ ): QVAULTGetMKTPOutput {
1991
+ return decodePayload(data, QVAULT_GET_MKTP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetMKTPOutput
1992
+ }
1993
+
1994
+ export async function qVAULTGetMKTP(
1995
+ live: SmartContractCaller,
1996
+ input: QVAULTGetMKTPInput,
1997
+ options?: ContractCallOptions,
1998
+ ): Promise<Result<QVAULTGetMKTPOutput, QubicRpcError>> {
1999
+ return callContractFunction({
2000
+ live,
2001
+ contractIndex: QVAULT_CONTRACT_INDEX,
2002
+ inputType: QVAULT_GET_MKTP_INPUT_TYPE,
2003
+ inputSize: QVAULT_GET_MKTP_INPUT_SIZE,
2004
+ inputFields: QVAULT_GET_MKTP_INPUT_FIELDS,
2005
+ outputFields: QVAULT_GET_MKTP_OUTPUT_FIELDS,
2006
+ structs: STRUCTS,
2007
+ input: (input as unknown as Record<string, unknown>),
2008
+ ...options,
2009
+ })
2010
+ }
2011
+
2012
+ export const QVAULT_GET_ALLO_P_INPUT_TYPE = 9
2013
+ export const QVAULT_GET_ALLO_P_INPUT_SIZE = 4
2014
+
2015
+ export interface QVAULTGetAlloPInput {
2016
+ proposalId: number
2017
+ }
2018
+
2019
+ const QVAULT_GET_ALLO_P_INPUT_FIELDS: BinaryField[] = [
2020
+ {
2021
+ name: 'proposalId',
2022
+ type: 'uint32',
2023
+ offset: 0,
2024
+ byteLength: 4,
2025
+ },
2026
+ ]
2027
+
2028
+ export function buildQVAULTGetAlloPInput(
2029
+ input: QVAULTGetAlloPInput,
2030
+ ): Uint8Array {
2031
+ return buildPayload(QVAULT_GET_ALLO_P_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2032
+ }
2033
+
2034
+ export interface QVAULTGetAlloPOutput {
2035
+ returnCode: number
2036
+ proposal: QVAULTAlloPInfoStruct
2037
+ }
2038
+
2039
+ const QVAULT_GET_ALLO_P_OUTPUT_FIELDS: BinaryField[] = [
2040
+ {
2041
+ name: 'returnCode',
2042
+ type: 'sint32',
2043
+ offset: 0,
2044
+ byteLength: 4,
2045
+ },
2046
+ {
2047
+ name: 'proposal',
2048
+ type: 'struct',
2049
+ offset: 4,
2050
+ byteLength: 321,
2051
+ structRef: 'AlloPInfo',
2052
+ },
2053
+ ]
2054
+
2055
+ export function decodeQVAULTGetAlloPOutput(
2056
+ data: Uint8Array,
2057
+ ): QVAULTGetAlloPOutput {
2058
+ return decodePayload(data, QVAULT_GET_ALLO_P_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetAlloPOutput
2059
+ }
2060
+
2061
+ export async function qVAULTGetAlloP(
2062
+ live: SmartContractCaller,
2063
+ input: QVAULTGetAlloPInput,
2064
+ options?: ContractCallOptions,
2065
+ ): Promise<Result<QVAULTGetAlloPOutput, QubicRpcError>> {
2066
+ return callContractFunction({
2067
+ live,
2068
+ contractIndex: QVAULT_CONTRACT_INDEX,
2069
+ inputType: QVAULT_GET_ALLO_P_INPUT_TYPE,
2070
+ inputSize: QVAULT_GET_ALLO_P_INPUT_SIZE,
2071
+ inputFields: QVAULT_GET_ALLO_P_INPUT_FIELDS,
2072
+ outputFields: QVAULT_GET_ALLO_P_OUTPUT_FIELDS,
2073
+ structs: STRUCTS,
2074
+ input: (input as unknown as Record<string, unknown>),
2075
+ ...options,
2076
+ })
2077
+ }
2078
+
2079
+ export const QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_TYPE = 11
2080
+ export const QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_SIZE = 8
2081
+
2082
+ export interface QVAULTGetIdentitiesHvVtPwInput {
2083
+ offset: number
2084
+ count: number
2085
+ }
2086
+
2087
+ const QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_FIELDS: BinaryField[] = [
2088
+ {
2089
+ name: 'offset',
2090
+ type: 'uint32',
2091
+ offset: 0,
2092
+ byteLength: 4,
2093
+ },
2094
+ {
2095
+ name: 'count',
2096
+ type: 'uint32',
2097
+ offset: 4,
2098
+ byteLength: 4,
2099
+ },
2100
+ ]
2101
+
2102
+ export function buildQVAULTGetIdentitiesHvVtPwInput(
2103
+ input: QVAULTGetIdentitiesHvVtPwInput,
2104
+ ): Uint8Array {
2105
+ return buildPayload(QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2106
+ }
2107
+
2108
+ export interface QVAULTGetIdentitiesHvVtPwOutput {
2109
+ returnCode: number
2110
+ idList: string[]
2111
+ amountList: number[]
2112
+ }
2113
+
2114
+ const QVAULT_GET_IDENTITIES_HV_VT_PW_OUTPUT_FIELDS: BinaryField[] = [
2115
+ {
2116
+ name: 'returnCode',
2117
+ type: 'sint32',
2118
+ offset: 0,
2119
+ byteLength: 4,
2120
+ },
2121
+ {
2122
+ name: 'idList',
2123
+ type: 'array',
2124
+ offset: 4,
2125
+ byteLength: 8192,
2126
+ arrayLength: 256,
2127
+ arrayItemType: 'id',
2128
+ arrayItemByteLength: 32,
2129
+ },
2130
+ {
2131
+ name: 'amountList',
2132
+ type: 'array',
2133
+ offset: 8196,
2134
+ byteLength: 1024,
2135
+ arrayLength: 256,
2136
+ arrayItemType: 'uint32',
2137
+ arrayItemByteLength: 4,
2138
+ },
2139
+ ]
2140
+
2141
+ export function decodeQVAULTGetIdentitiesHvVtPwOutput(
2142
+ data: Uint8Array,
2143
+ publicKeyToIdentity: (pk: Uint8Array) => string,
2144
+ ): QVAULTGetIdentitiesHvVtPwOutput {
2145
+ return decodePayload(data, QVAULT_GET_IDENTITIES_HV_VT_PW_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QVAULTGetIdentitiesHvVtPwOutput
2146
+ }
2147
+
2148
+ export async function qVAULTGetIdentitiesHvVtPw(
2149
+ live: SmartContractCaller,
2150
+ input: QVAULTGetIdentitiesHvVtPwInput,
2151
+ options?: ContractCallOptions,
2152
+ ): Promise<Result<QVAULTGetIdentitiesHvVtPwOutput, QubicRpcError>> {
2153
+ return callContractFunction({
2154
+ live,
2155
+ contractIndex: QVAULT_CONTRACT_INDEX,
2156
+ inputType: QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_TYPE,
2157
+ inputSize: QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_SIZE,
2158
+ inputFields: QVAULT_GET_IDENTITIES_HV_VT_PW_INPUT_FIELDS,
2159
+ outputFields: QVAULT_GET_IDENTITIES_HV_VT_PW_OUTPUT_FIELDS,
2160
+ structs: STRUCTS,
2161
+ input: (input as unknown as Record<string, unknown>),
2162
+ ...options,
2163
+ })
2164
+ }
2165
+
2166
+ export const QVAULT_PP_CREATION_POWER_INPUT_TYPE = 12
2167
+ export const QVAULT_PP_CREATION_POWER_INPUT_SIZE = 32
2168
+
2169
+ export interface QVAULTPpCreationPowerInput {
2170
+ address: string
2171
+ }
2172
+
2173
+ const QVAULT_PP_CREATION_POWER_INPUT_FIELDS: BinaryField[] = [
2174
+ {
2175
+ name: 'address',
2176
+ type: 'id',
2177
+ offset: 0,
2178
+ byteLength: 32,
2179
+ },
2180
+ ]
2181
+
2182
+ export function buildQVAULTPpCreationPowerInput(
2183
+ input: QVAULTPpCreationPowerInput,
2184
+ identityToPublicKey: (identity: string) => Uint8Array,
2185
+ ): Uint8Array {
2186
+ return buildPayload(QVAULT_PP_CREATION_POWER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
2187
+ }
2188
+
2189
+ export interface QVAULTPpCreationPowerOutput {
2190
+ returnCode: number
2191
+ status: number
2192
+ }
2193
+
2194
+ const QVAULT_PP_CREATION_POWER_OUTPUT_FIELDS: BinaryField[] = [
2195
+ {
2196
+ name: 'returnCode',
2197
+ type: 'sint32',
2198
+ offset: 0,
2199
+ byteLength: 4,
2200
+ },
2201
+ {
2202
+ name: 'status',
2203
+ type: 'uint8',
2204
+ offset: 4,
2205
+ byteLength: 1,
2206
+ },
2207
+ ]
2208
+
2209
+ export function decodeQVAULTPpCreationPowerOutput(
2210
+ data: Uint8Array,
2211
+ ): QVAULTPpCreationPowerOutput {
2212
+ return decodePayload(data, QVAULT_PP_CREATION_POWER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTPpCreationPowerOutput
2213
+ }
2214
+
2215
+ export async function qVAULTPpCreationPower(
2216
+ live: SmartContractCaller,
2217
+ input: QVAULTPpCreationPowerInput,
2218
+ options?: ContractCallOptions,
2219
+ ): Promise<Result<QVAULTPpCreationPowerOutput, QubicRpcError>> {
2220
+ return callContractFunction({
2221
+ live,
2222
+ contractIndex: QVAULT_CONTRACT_INDEX,
2223
+ inputType: QVAULT_PP_CREATION_POWER_INPUT_TYPE,
2224
+ inputSize: QVAULT_PP_CREATION_POWER_INPUT_SIZE,
2225
+ inputFields: QVAULT_PP_CREATION_POWER_INPUT_FIELDS,
2226
+ outputFields: QVAULT_PP_CREATION_POWER_OUTPUT_FIELDS,
2227
+ structs: STRUCTS,
2228
+ input: (input as unknown as Record<string, unknown>),
2229
+ ...options,
2230
+ })
2231
+ }
2232
+
2233
+ export const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_TYPE = 13
2234
+ export const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_SIZE = 4
2235
+
2236
+ export interface QVAULTGetQcapBurntAmountInLastEpochesInput {
2237
+ numberOfLastEpoches: number
2238
+ }
2239
+
2240
+ const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_FIELDS: BinaryField[] = [
2241
+ {
2242
+ name: 'numberOfLastEpoches',
2243
+ type: 'uint32',
2244
+ offset: 0,
2245
+ byteLength: 4,
2246
+ },
2247
+ ]
2248
+
2249
+ export function buildQVAULTGetQcapBurntAmountInLastEpochesInput(
2250
+ input: QVAULTGetQcapBurntAmountInLastEpochesInput,
2251
+ ): Uint8Array {
2252
+ return buildPayload(QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2253
+ }
2254
+
2255
+ export interface QVAULTGetQcapBurntAmountInLastEpochesOutput {
2256
+ returnCode: number
2257
+ burntAmount: number
2258
+ }
2259
+
2260
+ const QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_OUTPUT_FIELDS: BinaryField[] = [
2261
+ {
2262
+ name: 'returnCode',
2263
+ type: 'sint32',
2264
+ offset: 0,
2265
+ byteLength: 4,
2266
+ },
2267
+ {
2268
+ name: 'burntAmount',
2269
+ type: 'uint32',
2270
+ offset: 4,
2271
+ byteLength: 4,
2272
+ },
2273
+ ]
2274
+
2275
+ export function decodeQVAULTGetQcapBurntAmountInLastEpochesOutput(
2276
+ data: Uint8Array,
2277
+ ): QVAULTGetQcapBurntAmountInLastEpochesOutput {
2278
+ return decodePayload(data, QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetQcapBurntAmountInLastEpochesOutput
2279
+ }
2280
+
2281
+ export async function qVAULTGetQcapBurntAmountInLastEpoches(
2282
+ live: SmartContractCaller,
2283
+ input: QVAULTGetQcapBurntAmountInLastEpochesInput,
2284
+ options?: ContractCallOptions,
2285
+ ): Promise<Result<QVAULTGetQcapBurntAmountInLastEpochesOutput, QubicRpcError>> {
2286
+ return callContractFunction({
2287
+ live,
2288
+ contractIndex: QVAULT_CONTRACT_INDEX,
2289
+ inputType: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_TYPE,
2290
+ inputSize: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_SIZE,
2291
+ inputFields: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_INPUT_FIELDS,
2292
+ outputFields: QVAULT_GET_QCAP_BURNT_AMOUNT_IN_LAST_EPOCHES_OUTPUT_FIELDS,
2293
+ structs: STRUCTS,
2294
+ input: (input as unknown as Record<string, unknown>),
2295
+ ...options,
2296
+ })
2297
+ }
2298
+
2299
+ export const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_TYPE = 14
2300
+ export const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_SIZE = 4
2301
+
2302
+ export interface QVAULTGetAmountToBeSoldPerYearInput {
2303
+ year: number
2304
+ }
2305
+
2306
+ const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_FIELDS: BinaryField[] = [
2307
+ {
2308
+ name: 'year',
2309
+ type: 'uint32',
2310
+ offset: 0,
2311
+ byteLength: 4,
2312
+ },
2313
+ ]
2314
+
2315
+ export function buildQVAULTGetAmountToBeSoldPerYearInput(
2316
+ input: QVAULTGetAmountToBeSoldPerYearInput,
2317
+ ): Uint8Array {
2318
+ return buildPayload(QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2319
+ }
2320
+
2321
+ export interface QVAULTGetAmountToBeSoldPerYearOutput {
2322
+ amount: number
2323
+ }
2324
+
2325
+ const QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_OUTPUT_FIELDS: BinaryField[] = [
2326
+ {
2327
+ name: 'amount',
2328
+ type: 'uint32',
2329
+ offset: 0,
2330
+ byteLength: 4,
2331
+ },
2332
+ ]
2333
+
2334
+ export function decodeQVAULTGetAmountToBeSoldPerYearOutput(
2335
+ data: Uint8Array,
2336
+ ): QVAULTGetAmountToBeSoldPerYearOutput {
2337
+ return decodePayload(data, QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetAmountToBeSoldPerYearOutput
2338
+ }
2339
+
2340
+ export async function qVAULTGetAmountToBeSoldPerYear(
2341
+ live: SmartContractCaller,
2342
+ input: QVAULTGetAmountToBeSoldPerYearInput,
2343
+ options?: ContractCallOptions,
2344
+ ): Promise<Result<QVAULTGetAmountToBeSoldPerYearOutput, QubicRpcError>> {
2345
+ return callContractFunction({
2346
+ live,
2347
+ contractIndex: QVAULT_CONTRACT_INDEX,
2348
+ inputType: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_TYPE,
2349
+ inputSize: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_SIZE,
2350
+ inputFields: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_INPUT_FIELDS,
2351
+ outputFields: QVAULT_GET_AMOUNT_TO_BE_SOLD_PER_YEAR_OUTPUT_FIELDS,
2352
+ structs: STRUCTS,
2353
+ input: (input as unknown as Record<string, unknown>),
2354
+ ...options,
2355
+ })
2356
+ }
2357
+
2358
+ export const QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_TYPE = 15
2359
+ export const QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_SIZE = 0
2360
+
2361
+ export interface QVAULTGetTotalRevenueInQcapOutput {
2362
+ revenue: bigint
2363
+ }
2364
+
2365
+ const QVAULT_GET_TOTAL_REVENUE_IN_QCAP_OUTPUT_FIELDS: BinaryField[] = [
2366
+ {
2367
+ name: 'revenue',
2368
+ type: 'uint64',
2369
+ offset: 0,
2370
+ byteLength: 8,
2371
+ },
2372
+ ]
2373
+
2374
+ export function decodeQVAULTGetTotalRevenueInQcapOutput(
2375
+ data: Uint8Array,
2376
+ ): QVAULTGetTotalRevenueInQcapOutput {
2377
+ return decodePayload(data, QVAULT_GET_TOTAL_REVENUE_IN_QCAP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetTotalRevenueInQcapOutput
2378
+ }
2379
+
2380
+ export async function qVAULTGetTotalRevenueInQcap(
2381
+ live: SmartContractCaller,
2382
+ options?: ContractCallOptions,
2383
+ ): Promise<Result<QVAULTGetTotalRevenueInQcapOutput, QubicRpcError>> {
2384
+ return callContractFunction({
2385
+ live,
2386
+ contractIndex: QVAULT_CONTRACT_INDEX,
2387
+ inputType: QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_TYPE,
2388
+ inputSize: QVAULT_GET_TOTAL_REVENUE_IN_QCAP_INPUT_SIZE,
2389
+ inputFields: [],
2390
+ outputFields: QVAULT_GET_TOTAL_REVENUE_IN_QCAP_OUTPUT_FIELDS,
2391
+ structs: STRUCTS,
2392
+ input: {},
2393
+ ...options,
2394
+ })
2395
+ }
2396
+
2397
+ export const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_TYPE = 16
2398
+ export const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_SIZE = 4
2399
+
2400
+ export interface QVAULTGetRevenueInQcapPerEpochInput {
2401
+ epoch: number
2402
+ }
2403
+
2404
+ const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_FIELDS: BinaryField[] = [
2405
+ {
2406
+ name: 'epoch',
2407
+ type: 'uint32',
2408
+ offset: 0,
2409
+ byteLength: 4,
2410
+ },
2411
+ ]
2412
+
2413
+ export function buildQVAULTGetRevenueInQcapPerEpochInput(
2414
+ input: QVAULTGetRevenueInQcapPerEpochInput,
2415
+ ): Uint8Array {
2416
+ return buildPayload(QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2417
+ }
2418
+
2419
+ export interface QVAULTGetRevenueInQcapPerEpochOutput {
2420
+ epochTotalRevenue: bigint
2421
+ epochOneQcapRevenue: bigint
2422
+ epochOneQvaultRevenue: bigint
2423
+ epochReinvestAmount: bigint
2424
+ }
2425
+
2426
+ const QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_OUTPUT_FIELDS: BinaryField[] = [
2427
+ {
2428
+ name: 'epochTotalRevenue',
2429
+ type: 'uint64',
2430
+ offset: 0,
2431
+ byteLength: 8,
2432
+ },
2433
+ {
2434
+ name: 'epochOneQcapRevenue',
2435
+ type: 'uint64',
2436
+ offset: 8,
2437
+ byteLength: 8,
2438
+ },
2439
+ {
2440
+ name: 'epochOneQvaultRevenue',
2441
+ type: 'uint64',
2442
+ offset: 16,
2443
+ byteLength: 8,
2444
+ },
2445
+ {
2446
+ name: 'epochReinvestAmount',
2447
+ type: 'uint64',
2448
+ offset: 24,
2449
+ byteLength: 8,
2450
+ },
2451
+ ]
2452
+
2453
+ export function decodeQVAULTGetRevenueInQcapPerEpochOutput(
2454
+ data: Uint8Array,
2455
+ ): QVAULTGetRevenueInQcapPerEpochOutput {
2456
+ return decodePayload(data, QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetRevenueInQcapPerEpochOutput
2457
+ }
2458
+
2459
+ export async function qVAULTGetRevenueInQcapPerEpoch(
2460
+ live: SmartContractCaller,
2461
+ input: QVAULTGetRevenueInQcapPerEpochInput,
2462
+ options?: ContractCallOptions,
2463
+ ): Promise<Result<QVAULTGetRevenueInQcapPerEpochOutput, QubicRpcError>> {
2464
+ return callContractFunction({
2465
+ live,
2466
+ contractIndex: QVAULT_CONTRACT_INDEX,
2467
+ inputType: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_TYPE,
2468
+ inputSize: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_SIZE,
2469
+ inputFields: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_INPUT_FIELDS,
2470
+ outputFields: QVAULT_GET_REVENUE_IN_QCAP_PER_EPOCH_OUTPUT_FIELDS,
2471
+ structs: STRUCTS,
2472
+ input: (input as unknown as Record<string, unknown>),
2473
+ ...options,
2474
+ })
2475
+ }
2476
+
2477
+ export const QVAULT_GET_REVENUE_PER_SHARE_INPUT_TYPE = 17
2478
+ export const QVAULT_GET_REVENUE_PER_SHARE_INPUT_SIZE = 4
2479
+
2480
+ export interface QVAULTGetRevenuePerShareInput {
2481
+ contractIndex: number
2482
+ }
2483
+
2484
+ const QVAULT_GET_REVENUE_PER_SHARE_INPUT_FIELDS: BinaryField[] = [
2485
+ {
2486
+ name: 'contractIndex',
2487
+ type: 'uint32',
2488
+ offset: 0,
2489
+ byteLength: 4,
2490
+ },
2491
+ ]
2492
+
2493
+ export function buildQVAULTGetRevenuePerShareInput(
2494
+ input: QVAULTGetRevenuePerShareInput,
2495
+ ): Uint8Array {
2496
+ return buildPayload(QVAULT_GET_REVENUE_PER_SHARE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2497
+ }
2498
+
2499
+ export interface QVAULTGetRevenuePerShareOutput {
2500
+ revenue: bigint
2501
+ }
2502
+
2503
+ const QVAULT_GET_REVENUE_PER_SHARE_OUTPUT_FIELDS: BinaryField[] = [
2504
+ {
2505
+ name: 'revenue',
2506
+ type: 'uint64',
2507
+ offset: 0,
2508
+ byteLength: 8,
2509
+ },
2510
+ ]
2511
+
2512
+ export function decodeQVAULTGetRevenuePerShareOutput(
2513
+ data: Uint8Array,
2514
+ ): QVAULTGetRevenuePerShareOutput {
2515
+ return decodePayload(data, QVAULT_GET_REVENUE_PER_SHARE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetRevenuePerShareOutput
2516
+ }
2517
+
2518
+ export async function qVAULTGetRevenuePerShare(
2519
+ live: SmartContractCaller,
2520
+ input: QVAULTGetRevenuePerShareInput,
2521
+ options?: ContractCallOptions,
2522
+ ): Promise<Result<QVAULTGetRevenuePerShareOutput, QubicRpcError>> {
2523
+ return callContractFunction({
2524
+ live,
2525
+ contractIndex: QVAULT_CONTRACT_INDEX,
2526
+ inputType: QVAULT_GET_REVENUE_PER_SHARE_INPUT_TYPE,
2527
+ inputSize: QVAULT_GET_REVENUE_PER_SHARE_INPUT_SIZE,
2528
+ inputFields: QVAULT_GET_REVENUE_PER_SHARE_INPUT_FIELDS,
2529
+ outputFields: QVAULT_GET_REVENUE_PER_SHARE_OUTPUT_FIELDS,
2530
+ structs: STRUCTS,
2531
+ input: (input as unknown as Record<string, unknown>),
2532
+ ...options,
2533
+ })
2534
+ }
2535
+
2536
+ export const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_TYPE = 18
2537
+ export const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_SIZE = 40
2538
+
2539
+ export interface QVAULTGetAmountOfShareQvaultHoldInput {
2540
+ assetInfo: QVAULTAssetStruct
2541
+ }
2542
+
2543
+ const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_FIELDS: BinaryField[] = [
2544
+ {
2545
+ name: 'assetInfo',
2546
+ type: 'struct',
2547
+ offset: 0,
2548
+ byteLength: 40,
2549
+ structRef: 'Asset',
2550
+ },
2551
+ ]
2552
+
2553
+ export function buildQVAULTGetAmountOfShareQvaultHoldInput(
2554
+ input: QVAULTGetAmountOfShareQvaultHoldInput,
2555
+ ): Uint8Array {
2556
+ return buildPayload(QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2557
+ }
2558
+
2559
+ export interface QVAULTGetAmountOfShareQvaultHoldOutput {
2560
+ amount: number
2561
+ }
2562
+
2563
+ const QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_OUTPUT_FIELDS: BinaryField[] = [
2564
+ {
2565
+ name: 'amount',
2566
+ type: 'uint32',
2567
+ offset: 0,
2568
+ byteLength: 4,
2569
+ },
2570
+ ]
2571
+
2572
+ export function decodeQVAULTGetAmountOfShareQvaultHoldOutput(
2573
+ data: Uint8Array,
2574
+ ): QVAULTGetAmountOfShareQvaultHoldOutput {
2575
+ return decodePayload(data, QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetAmountOfShareQvaultHoldOutput
2576
+ }
2577
+
2578
+ export async function qVAULTGetAmountOfShareQvaultHold(
2579
+ live: SmartContractCaller,
2580
+ input: QVAULTGetAmountOfShareQvaultHoldInput,
2581
+ options?: ContractCallOptions,
2582
+ ): Promise<Result<QVAULTGetAmountOfShareQvaultHoldOutput, QubicRpcError>> {
2583
+ return callContractFunction({
2584
+ live,
2585
+ contractIndex: QVAULT_CONTRACT_INDEX,
2586
+ inputType: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_TYPE,
2587
+ inputSize: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_SIZE,
2588
+ inputFields: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_INPUT_FIELDS,
2589
+ outputFields: QVAULT_GET_AMOUNT_OF_SHARE_QVAULT_HOLD_OUTPUT_FIELDS,
2590
+ structs: STRUCTS,
2591
+ input: (input as unknown as Record<string, unknown>),
2592
+ ...options,
2593
+ })
2594
+ }
2595
+
2596
+ export const QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_TYPE = 19
2597
+ export const QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_SIZE = 0
2598
+
2599
+ export interface QVAULTGetNumberOfHolderAndAvgAmOutput {
2600
+ returnCode: number
2601
+ numberOfQcapHolder: number
2602
+ avgAmount: number
2603
+ }
2604
+
2605
+ const QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_OUTPUT_FIELDS: BinaryField[] = [
2606
+ {
2607
+ name: 'returnCode',
2608
+ type: 'sint32',
2609
+ offset: 0,
2610
+ byteLength: 4,
2611
+ },
2612
+ {
2613
+ name: 'numberOfQcapHolder',
2614
+ type: 'uint32',
2615
+ offset: 4,
2616
+ byteLength: 4,
2617
+ },
2618
+ {
2619
+ name: 'avgAmount',
2620
+ type: 'uint32',
2621
+ offset: 8,
2622
+ byteLength: 4,
2623
+ },
2624
+ ]
2625
+
2626
+ export function decodeQVAULTGetNumberOfHolderAndAvgAmOutput(
2627
+ data: Uint8Array,
2628
+ ): QVAULTGetNumberOfHolderAndAvgAmOutput {
2629
+ return decodePayload(data, QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetNumberOfHolderAndAvgAmOutput
2630
+ }
2631
+
2632
+ export async function qVAULTGetNumberOfHolderAndAvgAm(
2633
+ live: SmartContractCaller,
2634
+ options?: ContractCallOptions,
2635
+ ): Promise<Result<QVAULTGetNumberOfHolderAndAvgAmOutput, QubicRpcError>> {
2636
+ return callContractFunction({
2637
+ live,
2638
+ contractIndex: QVAULT_CONTRACT_INDEX,
2639
+ inputType: QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_TYPE,
2640
+ inputSize: QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_INPUT_SIZE,
2641
+ inputFields: [],
2642
+ outputFields: QVAULT_GET_NUMBER_OF_HOLDER_AND_AVG_AM_OUTPUT_FIELDS,
2643
+ structs: STRUCTS,
2644
+ input: {},
2645
+ ...options,
2646
+ })
2647
+ }
2648
+
2649
+ export const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_TYPE = 20
2650
+ export const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_SIZE = 4
2651
+
2652
+ export interface QVAULTGetAmountForQearnInUpcomingEpochInput {
2653
+ epoch: number
2654
+ }
2655
+
2656
+ const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_FIELDS: BinaryField[] = [
2657
+ {
2658
+ name: 'epoch',
2659
+ type: 'uint32',
2660
+ offset: 0,
2661
+ byteLength: 4,
2662
+ },
2663
+ ]
2664
+
2665
+ export function buildQVAULTGetAmountForQearnInUpcomingEpochInput(
2666
+ input: QVAULTGetAmountForQearnInUpcomingEpochInput,
2667
+ ): Uint8Array {
2668
+ return buildPayload(QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
2669
+ }
2670
+
2671
+ export interface QVAULTGetAmountForQearnInUpcomingEpochOutput {
2672
+ returnCode: number
2673
+ amount: bigint
2674
+ }
2675
+
2676
+ const QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_OUTPUT_FIELDS: BinaryField[] = [
2677
+ {
2678
+ name: 'returnCode',
2679
+ type: 'sint32',
2680
+ offset: 0,
2681
+ byteLength: 4,
2682
+ },
2683
+ {
2684
+ name: 'amount',
2685
+ type: 'uint64',
2686
+ offset: 4,
2687
+ byteLength: 8,
2688
+ },
2689
+ ]
2690
+
2691
+ export function decodeQVAULTGetAmountForQearnInUpcomingEpochOutput(
2692
+ data: Uint8Array,
2693
+ ): QVAULTGetAmountForQearnInUpcomingEpochOutput {
2694
+ return decodePayload(data, QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetAmountForQearnInUpcomingEpochOutput
2695
+ }
2696
+
2697
+ export async function qVAULTGetAmountForQearnInUpcomingEpoch(
2698
+ live: SmartContractCaller,
2699
+ input: QVAULTGetAmountForQearnInUpcomingEpochInput,
2700
+ options?: ContractCallOptions,
2701
+ ): Promise<Result<QVAULTGetAmountForQearnInUpcomingEpochOutput, QubicRpcError>> {
2702
+ return callContractFunction({
2703
+ live,
2704
+ contractIndex: QVAULT_CONTRACT_INDEX,
2705
+ inputType: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_TYPE,
2706
+ inputSize: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_SIZE,
2707
+ inputFields: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_INPUT_FIELDS,
2708
+ outputFields: QVAULT_GET_AMOUNT_FOR_QEARN_IN_UPCOMING_EPOCH_OUTPUT_FIELDS,
2709
+ structs: STRUCTS,
2710
+ input: (input as unknown as Record<string, unknown>),
2711
+ ...options,
2712
+ })
2713
+ }
2714
+
2715
+ export const QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_TYPE = 21
2716
+ export const QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_SIZE = 48
2717
+
2718
+ export interface QVAULTGetVoteInProposalInput {
2719
+ userID: string
2720
+ proposalType: bigint
2721
+ proposalId: bigint
2722
+ }
2723
+
2724
+ const QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_FIELDS: BinaryField[] = [
2725
+ {
2726
+ name: 'userID',
2727
+ type: 'id',
2728
+ offset: 0,
2729
+ byteLength: 32,
2730
+ },
2731
+ {
2732
+ name: 'proposalType',
2733
+ type: 'uint64',
2734
+ offset: 32,
2735
+ byteLength: 8,
2736
+ },
2737
+ {
2738
+ name: 'proposalId',
2739
+ type: 'uint64',
2740
+ offset: 40,
2741
+ byteLength: 8,
2742
+ },
2743
+ ]
2744
+
2745
+ export function buildQVAULTGetVoteInProposalInput(
2746
+ input: QVAULTGetVoteInProposalInput,
2747
+ identityToPublicKey: (identity: string) => Uint8Array,
2748
+ ): Uint8Array {
2749
+ return buildPayload(QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
2750
+ }
2751
+
2752
+ export interface QVAULTGetVoteInProposalOutput {
2753
+ returnCode: bigint
2754
+ voteStatus: bigint
2755
+ votingDecision: bigint
2756
+ }
2757
+
2758
+ const QVAULT_GET_VOTE_IN_PROPOSAL_OUTPUT_FIELDS: BinaryField[] = [
2759
+ {
2760
+ name: 'returnCode',
2761
+ type: 'sint64',
2762
+ offset: 0,
2763
+ byteLength: 8,
2764
+ },
2765
+ {
2766
+ name: 'voteStatus',
2767
+ type: 'sint64',
2768
+ offset: 8,
2769
+ byteLength: 8,
2770
+ },
2771
+ {
2772
+ name: 'votingDecision',
2773
+ type: 'sint64',
2774
+ offset: 16,
2775
+ byteLength: 8,
2776
+ },
2777
+ ]
2778
+
2779
+ export function decodeQVAULTGetVoteInProposalOutput(
2780
+ data: Uint8Array,
2781
+ ): QVAULTGetVoteInProposalOutput {
2782
+ return decodePayload(data, QVAULT_GET_VOTE_IN_PROPOSAL_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetVoteInProposalOutput
2783
+ }
2784
+
2785
+ export async function qVAULTGetVoteInProposal(
2786
+ live: SmartContractCaller,
2787
+ input: QVAULTGetVoteInProposalInput,
2788
+ options?: ContractCallOptions,
2789
+ ): Promise<Result<QVAULTGetVoteInProposalOutput, QubicRpcError>> {
2790
+ return callContractFunction({
2791
+ live,
2792
+ contractIndex: QVAULT_CONTRACT_INDEX,
2793
+ inputType: QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_TYPE,
2794
+ inputSize: QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_SIZE,
2795
+ inputFields: QVAULT_GET_VOTE_IN_PROPOSAL_INPUT_FIELDS,
2796
+ outputFields: QVAULT_GET_VOTE_IN_PROPOSAL_OUTPUT_FIELDS,
2797
+ structs: STRUCTS,
2798
+ input: (input as unknown as Record<string, unknown>),
2799
+ ...options,
2800
+ })
2801
+ }
2802
+
2803
+ export const QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_TYPE = 22
2804
+ export const QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_SIZE = 32
2805
+
2806
+ export interface QVAULTGetStakeEpochFlagInput {
2807
+ userID: string
2808
+ }
2809
+
2810
+ const QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_FIELDS: BinaryField[] = [
2811
+ {
2812
+ name: 'userID',
2813
+ type: 'id',
2814
+ offset: 0,
2815
+ byteLength: 32,
2816
+ },
2817
+ ]
2818
+
2819
+ export function buildQVAULTGetStakeEpochFlagInput(
2820
+ input: QVAULTGetStakeEpochFlagInput,
2821
+ identityToPublicKey: (identity: string) => Uint8Array,
2822
+ ): Uint8Array {
2823
+ return buildPayload(QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
2824
+ }
2825
+
2826
+ export interface QVAULTGetStakeEpochFlagOutput {
2827
+ flag: number
2828
+ }
2829
+
2830
+ const QVAULT_GET_STAKE_EPOCH_FLAG_OUTPUT_FIELDS: BinaryField[] = [
2831
+ {
2832
+ name: 'flag',
2833
+ type: 'uint8',
2834
+ offset: 0,
2835
+ byteLength: 1,
2836
+ },
2837
+ ]
2838
+
2839
+ export function decodeQVAULTGetStakeEpochFlagOutput(
2840
+ data: Uint8Array,
2841
+ ): QVAULTGetStakeEpochFlagOutput {
2842
+ return decodePayload(data, QVAULT_GET_STAKE_EPOCH_FLAG_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QVAULTGetStakeEpochFlagOutput
2843
+ }
2844
+
2845
+ export async function qVAULTGetStakeEpochFlag(
2846
+ live: SmartContractCaller,
2847
+ input: QVAULTGetStakeEpochFlagInput,
2848
+ options?: ContractCallOptions,
2849
+ ): Promise<Result<QVAULTGetStakeEpochFlagOutput, QubicRpcError>> {
2850
+ return callContractFunction({
2851
+ live,
2852
+ contractIndex: QVAULT_CONTRACT_INDEX,
2853
+ inputType: QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_TYPE,
2854
+ inputSize: QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_SIZE,
2855
+ inputFields: QVAULT_GET_STAKE_EPOCH_FLAG_INPUT_FIELDS,
2856
+ outputFields: QVAULT_GET_STAKE_EPOCH_FLAG_OUTPUT_FIELDS,
2857
+ structs: STRUCTS,
2858
+ input: (input as unknown as Record<string, unknown>),
2859
+ ...options,
2860
+ })
2861
+ }
2862
+
2863
+ export const qVAULT = {
2864
+ contractIndex: QVAULT_CONTRACT_INDEX,
2865
+ getData: qVAULTGetData,
2866
+ getStakedAmountAndVotingPower: qVAULTGetStakedAmountAndVotingPower,
2867
+ getGP: qVAULTGetGP,
2868
+ getQCP: qVAULTGetQCP,
2869
+ getIPOP: qVAULTGetIPOP,
2870
+ getQEarnP: qVAULTGetQEarnP,
2871
+ getFundP: qVAULTGetFundP,
2872
+ getMKTP: qVAULTGetMKTP,
2873
+ getAlloP: qVAULTGetAlloP,
2874
+ getIdentitiesHvVtPw: qVAULTGetIdentitiesHvVtPw,
2875
+ ppCreationPower: qVAULTPpCreationPower,
2876
+ getQcapBurntAmountInLastEpoches: qVAULTGetQcapBurntAmountInLastEpoches,
2877
+ getAmountToBeSoldPerYear: qVAULTGetAmountToBeSoldPerYear,
2878
+ getTotalRevenueInQcap: qVAULTGetTotalRevenueInQcap,
2879
+ getRevenueInQcapPerEpoch: qVAULTGetRevenueInQcapPerEpoch,
2880
+ getRevenuePerShare: qVAULTGetRevenuePerShare,
2881
+ getAmountOfShareQvaultHold: qVAULTGetAmountOfShareQvaultHold,
2882
+ getNumberOfHolderAndAvgAm: qVAULTGetNumberOfHolderAndAvgAm,
2883
+ getAmountForQearnInUpcomingEpoch: qVAULTGetAmountForQearnInUpcomingEpoch,
2884
+ getVoteInProposal: qVAULTGetVoteInProposal,
2885
+ getStakeEpochFlag: qVAULTGetStakeEpochFlag,
2886
+ buildStakeInput: buildQVAULTStakeInput,
2887
+ decodeStakeOutput: decodeQVAULTStakeOutput,
2888
+ buildUnStakeInput: buildQVAULTUnStakeInput,
2889
+ decodeUnStakeOutput: decodeQVAULTUnStakeOutput,
2890
+ buildSubmitGPInput: buildQVAULTSubmitGPInput,
2891
+ decodeSubmitGPOutput: decodeQVAULTSubmitGPOutput,
2892
+ buildSubmitQCPInput: buildQVAULTSubmitQCPInput,
2893
+ decodeSubmitQCPOutput: decodeQVAULTSubmitQCPOutput,
2894
+ buildSubmitIPOPInput: buildQVAULTSubmitIPOPInput,
2895
+ decodeSubmitIPOPOutput: decodeQVAULTSubmitIPOPOutput,
2896
+ buildSubmitQEarnPInput: buildQVAULTSubmitQEarnPInput,
2897
+ decodeSubmitQEarnPOutput: decodeQVAULTSubmitQEarnPOutput,
2898
+ buildSubmitFundPInput: buildQVAULTSubmitFundPInput,
2899
+ decodeSubmitFundPOutput: decodeQVAULTSubmitFundPOutput,
2900
+ buildSubmitMKTPInput: buildQVAULTSubmitMKTPInput,
2901
+ decodeSubmitMKTPOutput: decodeQVAULTSubmitMKTPOutput,
2902
+ buildSubmitAlloPInput: buildQVAULTSubmitAlloPInput,
2903
+ decodeSubmitAlloPOutput: decodeQVAULTSubmitAlloPOutput,
2904
+ buildVoteInProposalInput: buildQVAULTVoteInProposalInput,
2905
+ decodeVoteInProposalOutput: decodeQVAULTVoteInProposalOutput,
2906
+ buildBuyQcapInput: buildQVAULTBuyQcapInput,
2907
+ decodeBuyQcapOutput: decodeQVAULTBuyQcapOutput,
2908
+ buildTransferShareManagementRightsInput: buildQVAULTTransferShareManagementRightsInput,
2909
+ decodeTransferShareManagementRightsOutput: decodeQVAULTTransferShareManagementRightsOutput,
2910
+ }
2911
+