@qubic.org/contracts 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +285 -0
  2. package/dist/__generated__/computorcontrolledfund.d.ts +185 -0
  3. package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -0
  4. package/dist/__generated__/computorcontrolledfund.js +805 -0
  5. package/dist/__generated__/computorcontrolledfund.js.map +1 -0
  6. package/dist/__generated__/escrow.d.ts +103 -0
  7. package/dist/__generated__/escrow.d.ts.map +1 -0
  8. package/dist/__generated__/escrow.js +383 -0
  9. package/dist/__generated__/escrow.js.map +1 -0
  10. package/dist/__generated__/generalquorumproposal.d.ts +130 -0
  11. package/dist/__generated__/generalquorumproposal.d.ts.map +1 -0
  12. package/dist/__generated__/generalquorumproposal.js +499 -0
  13. package/dist/__generated__/generalquorumproposal.js.map +1 -0
  14. package/dist/__generated__/index.d.ts +28 -0
  15. package/dist/__generated__/index.d.ts.map +1 -0
  16. package/dist/__generated__/index.js +28 -0
  17. package/dist/__generated__/index.js.map +1 -0
  18. package/dist/__generated__/msvault.d.ts +336 -0
  19. package/dist/__generated__/msvault.d.ts.map +1 -0
  20. package/dist/__generated__/msvault.js +1187 -0
  21. package/dist/__generated__/msvault.js.map +1 -0
  22. package/dist/__generated__/multisignvault.d.ts +348 -0
  23. package/dist/__generated__/multisignvault.d.ts.map +1 -0
  24. package/dist/__generated__/multisignvault.js +913 -0
  25. package/dist/__generated__/multisignvault.js.map +1 -0
  26. package/dist/__generated__/mylastmatch.d.ts +5 -0
  27. package/dist/__generated__/mylastmatch.d.ts.map +1 -0
  28. package/dist/__generated__/mylastmatch.js +7 -0
  29. package/dist/__generated__/mylastmatch.js.map +1 -0
  30. package/dist/__generated__/nostromo.d.ts +295 -0
  31. package/dist/__generated__/nostromo.d.ts.map +1 -0
  32. package/dist/__generated__/nostromo.js +1113 -0
  33. package/dist/__generated__/nostromo.js.map +1 -0
  34. package/dist/__generated__/pulse.d.ts +320 -0
  35. package/dist/__generated__/pulse.d.ts.map +1 -0
  36. package/dist/__generated__/pulse.js +1024 -0
  37. package/dist/__generated__/pulse.js.map +1 -0
  38. package/dist/__generated__/qbay.d.ts +415 -0
  39. package/dist/__generated__/qbay.d.ts.map +1 -0
  40. package/dist/__generated__/qbay.js +1486 -0
  41. package/dist/__generated__/qbay.js.map +1 -0
  42. package/dist/__generated__/qbond.d.ts +210 -0
  43. package/dist/__generated__/qbond.d.ts.map +1 -0
  44. package/dist/__generated__/qbond.js +694 -0
  45. package/dist/__generated__/qbond.js.map +1 -0
  46. package/dist/__generated__/qdraw.d.ts +39 -0
  47. package/dist/__generated__/qdraw.d.ts.map +1 -0
  48. package/dist/__generated__/qdraw.js +135 -0
  49. package/dist/__generated__/qdraw.js.map +1 -0
  50. package/dist/__generated__/qduel.d.ts +171 -0
  51. package/dist/__generated__/qduel.d.ts.map +1 -0
  52. package/dist/__generated__/qduel.js +573 -0
  53. package/dist/__generated__/qduel.js.map +1 -0
  54. package/dist/__generated__/qearn.d.ts +139 -0
  55. package/dist/__generated__/qearn.d.ts.map +1 -0
  56. package/dist/__generated__/qearn.js +471 -0
  57. package/dist/__generated__/qearn.js.map +1 -0
  58. package/dist/__generated__/qip.d.ts +84 -0
  59. package/dist/__generated__/qip.d.ts.map +1 -0
  60. package/dist/__generated__/qip.js +303 -0
  61. package/dist/__generated__/qip.js.map +1 -0
  62. package/dist/__generated__/qraffle.d.ts +235 -0
  63. package/dist/__generated__/qraffle.d.ts.map +1 -0
  64. package/dist/__generated__/qraffle.js +798 -0
  65. package/dist/__generated__/qraffle.js.map +1 -0
  66. package/dist/__generated__/qreservepool.d.ts +70 -0
  67. package/dist/__generated__/qreservepool.d.ts.map +1 -0
  68. package/dist/__generated__/qreservepool.js +177 -0
  69. package/dist/__generated__/qreservepool.js.map +1 -0
  70. package/dist/__generated__/qrwa.d.ts +285 -0
  71. package/dist/__generated__/qrwa.d.ts.map +1 -0
  72. package/dist/__generated__/qrwa.js +1063 -0
  73. package/dist/__generated__/qrwa.js.map +1 -0
  74. package/dist/__generated__/qswap.d.ts +273 -0
  75. package/dist/__generated__/qswap.d.ts.map +1 -0
  76. package/dist/__generated__/qswap.js +897 -0
  77. package/dist/__generated__/qswap.js.map +1 -0
  78. package/dist/__generated__/qthirtyfour.d.ts +231 -0
  79. package/dist/__generated__/qthirtyfour.d.ts.map +1 -0
  80. package/dist/__generated__/qthirtyfour.js +790 -0
  81. package/dist/__generated__/qthirtyfour.js.map +1 -0
  82. package/dist/__generated__/qubicicoportal.d.ts +81 -0
  83. package/dist/__generated__/qubicicoportal.d.ts.map +1 -0
  84. package/dist/__generated__/qubicicoportal.js +260 -0
  85. package/dist/__generated__/qubicicoportal.js.map +1 -0
  86. package/dist/__generated__/quottery.d.ts +308 -0
  87. package/dist/__generated__/quottery.d.ts.map +1 -0
  88. package/dist/__generated__/quottery.js +1062 -0
  89. package/dist/__generated__/quottery.js.map +1 -0
  90. package/dist/__generated__/qusino.d.ts +172 -0
  91. package/dist/__generated__/qusino.d.ts.map +1 -0
  92. package/dist/__generated__/qusino.js +533 -0
  93. package/dist/__generated__/qusino.js.map +1 -0
  94. package/dist/__generated__/qutil.d.ts +310 -0
  95. package/dist/__generated__/qutil.d.ts.map +1 -0
  96. package/dist/__generated__/qutil.js +1033 -0
  97. package/dist/__generated__/qutil.js.map +1 -0
  98. package/dist/__generated__/qvault.d.ts +535 -0
  99. package/dist/__generated__/qvault.d.ts.map +1 -0
  100. package/dist/__generated__/qvault.js +2047 -0
  101. package/dist/__generated__/qvault.js.map +1 -0
  102. package/dist/__generated__/qx.d.ts +178 -0
  103. package/dist/__generated__/qx.d.ts.map +1 -0
  104. package/dist/__generated__/qx.js +586 -0
  105. package/dist/__generated__/qx.js.map +1 -0
  106. package/dist/__generated__/random.d.ts +12 -0
  107. package/dist/__generated__/random.d.ts.map +1 -0
  108. package/dist/__generated__/random.js +26 -0
  109. package/dist/__generated__/random.js.map +1 -0
  110. package/dist/__generated__/randomlottery.d.ts +135 -0
  111. package/dist/__generated__/randomlottery.d.ts.map +1 -0
  112. package/dist/__generated__/randomlottery.js +451 -0
  113. package/dist/__generated__/randomlottery.js.map +1 -0
  114. package/dist/__generated__/supplywatcher.d.ts +5 -0
  115. package/dist/__generated__/supplywatcher.d.ts.map +1 -0
  116. package/dist/__generated__/supplywatcher.js +7 -0
  117. package/dist/__generated__/supplywatcher.js.map +1 -0
  118. package/dist/__generated__/vottunbridge.d.ts +226 -0
  119. package/dist/__generated__/vottunbridge.d.ts.map +1 -0
  120. package/dist/__generated__/vottunbridge.js +835 -0
  121. package/dist/__generated__/vottunbridge.js.map +1 -0
  122. package/dist/call-contract.d.ts +25 -0
  123. package/dist/call-contract.d.ts.map +1 -0
  124. package/dist/call-contract.js +41 -0
  125. package/dist/call-contract.js.map +1 -0
  126. package/dist/index.d.ts +6 -0
  127. package/dist/index.d.ts.map +1 -0
  128. package/dist/index.js +4 -0
  129. package/dist/index.js.map +1 -0
  130. package/dist/result.d.ts +12 -0
  131. package/dist/result.d.ts.map +1 -0
  132. package/dist/result.js +7 -0
  133. package/dist/result.js.map +1 -0
  134. package/package.json +32 -0
@@ -0,0 +1,1033 @@
1
+ import { buildPayload, decodePayload } from '@qubic.org/registry';
2
+ import { callContractFunction } from '../call-contract.js';
3
+ export const Q_UTIL_CONTRACT_INDEX = 4;
4
+ const STRUCTS = {
5
+ 'Asset': {
6
+ name: 'Asset',
7
+ byteLength: 40,
8
+ fields: [
9
+ {
10
+ name: 'issuer',
11
+ type: 'id',
12
+ offset: 0,
13
+ byteLength: 32,
14
+ },
15
+ {
16
+ name: 'assetName',
17
+ type: 'uint64',
18
+ offset: 32,
19
+ byteLength: 8,
20
+ },
21
+ ],
22
+ },
23
+ 'OI::Price::OracleQuery': {
24
+ name: 'OI::Price::OracleQuery',
25
+ byteLength: 104,
26
+ fields: [
27
+ {
28
+ name: 'oracle',
29
+ type: 'id',
30
+ offset: 0,
31
+ byteLength: 32,
32
+ },
33
+ {
34
+ name: 'timestamp',
35
+ type: 'struct',
36
+ offset: 32,
37
+ byteLength: 8,
38
+ structRef: 'DateAndTime',
39
+ },
40
+ {
41
+ name: 'currency1',
42
+ type: 'id',
43
+ offset: 40,
44
+ byteLength: 32,
45
+ },
46
+ {
47
+ name: 'currency2',
48
+ type: 'id',
49
+ offset: 72,
50
+ byteLength: 32,
51
+ },
52
+ ],
53
+ },
54
+ 'Poll': {
55
+ name: 'Poll',
56
+ byteLength: 736,
57
+ fields: [
58
+ {
59
+ name: 'poll_name',
60
+ type: 'id',
61
+ offset: 0,
62
+ byteLength: 32,
63
+ },
64
+ {
65
+ name: 'poll_type',
66
+ type: 'uint64',
67
+ offset: 32,
68
+ byteLength: 8,
69
+ },
70
+ {
71
+ name: 'min_amount',
72
+ type: 'uint64',
73
+ offset: 40,
74
+ byteLength: 8,
75
+ },
76
+ {
77
+ name: 'is_active',
78
+ type: 'uint64',
79
+ offset: 48,
80
+ byteLength: 8,
81
+ },
82
+ {
83
+ name: 'creator',
84
+ type: 'id',
85
+ offset: 56,
86
+ byteLength: 32,
87
+ },
88
+ {
89
+ name: 'allowed_assets',
90
+ type: 'array',
91
+ offset: 88,
92
+ byteLength: 640,
93
+ arrayLength: 16,
94
+ arrayItemByteLength: 40,
95
+ arrayItemStructRef: 'Asset',
96
+ },
97
+ {
98
+ name: 'num_assets',
99
+ type: 'uint64',
100
+ offset: 728,
101
+ byteLength: 8,
102
+ },
103
+ ],
104
+ },
105
+ 'DateAndTime': {
106
+ name: 'DateAndTime',
107
+ byteLength: 8,
108
+ fields: [
109
+ {
110
+ name: 'value',
111
+ type: 'uint64',
112
+ offset: 0,
113
+ byteLength: 8,
114
+ },
115
+ ],
116
+ },
117
+ };
118
+ export const Q_UTIL_SEND_TO_MANY_V1_INPUT_TYPE = 5;
119
+ const Q_UTIL_SEND_TO_MANY_V1_INPUT_FIELDS = [
120
+ {
121
+ name: 'dst0',
122
+ type: 'id',
123
+ offset: 0,
124
+ byteLength: 32,
125
+ },
126
+ {
127
+ name: 'amt0',
128
+ type: 'sint64',
129
+ offset: 32,
130
+ byteLength: 8,
131
+ },
132
+ ];
133
+ export function buildQUtilSendToManyV1Input(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
134
+ return buildPayload(Q_UTIL_SEND_TO_MANY_V1_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
135
+ }
136
+ const Q_UTIL_SEND_TO_MANY_V1_OUTPUT_FIELDS = [
137
+ {
138
+ name: 'returnCode',
139
+ type: 'sint32',
140
+ offset: 0,
141
+ byteLength: 4,
142
+ },
143
+ ];
144
+ export function decodeQUtilSendToManyV1Output(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
145
+ return decodePayload(data, Q_UTIL_SEND_TO_MANY_V1_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
146
+ }
147
+ export const Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_TYPE = 7;
148
+ const Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_FIELDS = [
149
+ {
150
+ name: 'issuer',
151
+ type: 'id',
152
+ offset: 0,
153
+ byteLength: 32,
154
+ },
155
+ {
156
+ name: 'assetName',
157
+ type: 'uint64',
158
+ offset: 32,
159
+ byteLength: 8,
160
+ },
161
+ {
162
+ name: 'dst0',
163
+ type: 'id',
164
+ offset: 40,
165
+ byteLength: 32,
166
+ },
167
+ {
168
+ name: 'amt0',
169
+ type: 'sint64',
170
+ offset: 72,
171
+ byteLength: 8,
172
+ },
173
+ ];
174
+ export function buildQUtilTransferSharesToManyV1Input(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
175
+ return buildPayload(Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
176
+ }
177
+ const Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_OUTPUT_FIELDS = [
178
+ {
179
+ name: 'returnCode',
180
+ type: 'sint32',
181
+ offset: 0,
182
+ byteLength: 4,
183
+ },
184
+ ];
185
+ export function decodeQUtilTransferSharesToManyV1Output(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
186
+ return decodePayload(data, Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
187
+ }
188
+ export const Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_TYPE = 8;
189
+ const Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_FIELDS = [
190
+ {
191
+ name: 'asset',
192
+ type: 'struct',
193
+ offset: 0,
194
+ byteLength: 40,
195
+ structRef: 'Asset',
196
+ },
197
+ {
198
+ name: 'numberOfShares',
199
+ type: 'sint64',
200
+ offset: 40,
201
+ byteLength: 8,
202
+ },
203
+ {
204
+ name: 'newManagingContractIndex',
205
+ type: 'uint32',
206
+ offset: 48,
207
+ byteLength: 4,
208
+ },
209
+ ];
210
+ export function buildQUtilTransferSharesManagementRightsInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
211
+ return buildPayload(Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
212
+ }
213
+ const Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_OUTPUT_FIELDS = [
214
+ {
215
+ name: 'transferredNumberOfShares',
216
+ type: 'sint64',
217
+ offset: 0,
218
+ byteLength: 8,
219
+ },
220
+ ];
221
+ export function decodeQUtilTransferSharesManagementRightsOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
222
+ return decodePayload(data, Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
223
+ }
224
+ export const Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_TYPE = 9;
225
+ const Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_FIELDS = [
226
+ {
227
+ name: 'dstCount',
228
+ type: 'sint64',
229
+ offset: 0,
230
+ byteLength: 8,
231
+ },
232
+ {
233
+ name: 'numTransfersEach',
234
+ type: 'sint64',
235
+ offset: 8,
236
+ byteLength: 8,
237
+ },
238
+ ];
239
+ export function buildQUtilSendToManyBenchmarkInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
240
+ return buildPayload(Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
241
+ }
242
+ const Q_UTIL_SEND_TO_MANY_BENCHMARK_OUTPUT_FIELDS = [
243
+ {
244
+ name: 'dstCount',
245
+ type: 'sint64',
246
+ offset: 0,
247
+ byteLength: 8,
248
+ },
249
+ {
250
+ name: 'returnCode',
251
+ type: 'sint32',
252
+ offset: 8,
253
+ byteLength: 4,
254
+ },
255
+ {
256
+ name: 'total',
257
+ type: 'sint64',
258
+ offset: 12,
259
+ byteLength: 8,
260
+ },
261
+ ];
262
+ export function decodeQUtilSendToManyBenchmarkOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
263
+ return decodePayload(data, Q_UTIL_SEND_TO_MANY_BENCHMARK_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
264
+ }
265
+ export const Q_UTIL_BURN_QUBIC_INPUT_TYPE = 10;
266
+ const Q_UTIL_BURN_QUBIC_INPUT_FIELDS = [
267
+ {
268
+ name: 'amount',
269
+ type: 'sint64',
270
+ offset: 0,
271
+ byteLength: 8,
272
+ },
273
+ ];
274
+ export function buildQUtilBurnQubicInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
275
+ return buildPayload(Q_UTIL_BURN_QUBIC_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
276
+ }
277
+ const Q_UTIL_BURN_QUBIC_OUTPUT_FIELDS = [
278
+ {
279
+ name: 'amount',
280
+ type: 'sint64',
281
+ offset: 0,
282
+ byteLength: 8,
283
+ },
284
+ ];
285
+ export function decodeQUtilBurnQubicOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
286
+ return decodePayload(data, Q_UTIL_BURN_QUBIC_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
287
+ }
288
+ export const Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_TYPE = 11;
289
+ const Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_FIELDS = [
290
+ {
291
+ name: 'contractIndexBurnedFor',
292
+ type: 'uint32',
293
+ offset: 0,
294
+ byteLength: 4,
295
+ },
296
+ ];
297
+ export function buildQUtilBurnQubicForContractInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
298
+ return buildPayload(Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
299
+ }
300
+ const Q_UTIL_BURN_QUBIC_FOR_CONTRACT_OUTPUT_FIELDS = [
301
+ {
302
+ name: 'amount',
303
+ type: 'sint64',
304
+ offset: 0,
305
+ byteLength: 8,
306
+ },
307
+ ];
308
+ export function decodeQUtilBurnQubicForContractOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
309
+ return decodePayload(data, Q_UTIL_BURN_QUBIC_FOR_CONTRACT_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
310
+ }
311
+ export const Q_UTIL_CREATE_POLL_INPUT_TYPE = 14;
312
+ const Q_UTIL_CREATE_POLL_INPUT_FIELDS = [
313
+ {
314
+ name: 'poll_name',
315
+ type: 'id',
316
+ offset: 0,
317
+ byteLength: 32,
318
+ },
319
+ {
320
+ name: 'poll_type',
321
+ type: 'uint64',
322
+ offset: 32,
323
+ byteLength: 8,
324
+ },
325
+ {
326
+ name: 'min_amount',
327
+ type: 'uint64',
328
+ offset: 40,
329
+ byteLength: 8,
330
+ },
331
+ {
332
+ name: 'github_link',
333
+ type: 'array',
334
+ offset: 48,
335
+ byteLength: 256,
336
+ arrayLength: 256,
337
+ arrayItemType: 'uint8',
338
+ arrayItemByteLength: 1,
339
+ },
340
+ {
341
+ name: 'allowed_assets',
342
+ type: 'array',
343
+ offset: 304,
344
+ byteLength: 640,
345
+ arrayLength: 16,
346
+ arrayItemByteLength: 40,
347
+ arrayItemStructRef: 'Asset',
348
+ },
349
+ {
350
+ name: 'num_assets',
351
+ type: 'uint64',
352
+ offset: 944,
353
+ byteLength: 8,
354
+ },
355
+ ];
356
+ export function buildQUtilCreatePollInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
357
+ return buildPayload(Q_UTIL_CREATE_POLL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
358
+ }
359
+ const Q_UTIL_CREATE_POLL_OUTPUT_FIELDS = [
360
+ {
361
+ name: 'poll_id',
362
+ type: 'uint64',
363
+ offset: 0,
364
+ byteLength: 8,
365
+ },
366
+ ];
367
+ export function decodeQUtilCreatePollOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
368
+ return decodePayload(data, Q_UTIL_CREATE_POLL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
369
+ }
370
+ export const Q_UTIL_VOTE_INPUT_TYPE = 15;
371
+ const Q_UTIL_VOTE_INPUT_FIELDS = [
372
+ {
373
+ name: 'poll_id',
374
+ type: 'uint64',
375
+ offset: 0,
376
+ byteLength: 8,
377
+ },
378
+ {
379
+ name: 'address',
380
+ type: 'id',
381
+ offset: 8,
382
+ byteLength: 32,
383
+ },
384
+ {
385
+ name: 'amount',
386
+ type: 'uint64',
387
+ offset: 40,
388
+ byteLength: 8,
389
+ },
390
+ {
391
+ name: 'chosen_option',
392
+ type: 'uint64',
393
+ offset: 48,
394
+ byteLength: 8,
395
+ },
396
+ ];
397
+ export function buildQUtilVoteInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
398
+ return buildPayload(Q_UTIL_VOTE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
399
+ }
400
+ const Q_UTIL_VOTE_OUTPUT_FIELDS = [
401
+ {
402
+ name: 'success',
403
+ type: 'uint8',
404
+ offset: 0,
405
+ byteLength: 1,
406
+ },
407
+ ];
408
+ export function decodeQUtilVoteOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
409
+ return decodePayload(data, Q_UTIL_VOTE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
410
+ }
411
+ export const Q_UTIL_CANCEL_POLL_INPUT_TYPE = 16;
412
+ const Q_UTIL_CANCEL_POLL_INPUT_FIELDS = [
413
+ {
414
+ name: 'poll_id',
415
+ type: 'uint64',
416
+ offset: 0,
417
+ byteLength: 8,
418
+ },
419
+ ];
420
+ export function buildQUtilCancelPollInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
421
+ return buildPayload(Q_UTIL_CANCEL_POLL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
422
+ }
423
+ const Q_UTIL_CANCEL_POLL_OUTPUT_FIELDS = [
424
+ {
425
+ name: 'success',
426
+ type: 'uint8',
427
+ offset: 0,
428
+ byteLength: 1,
429
+ },
430
+ ];
431
+ export function decodeQUtilCancelPollOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
432
+ return decodePayload(data, Q_UTIL_CANCEL_POLL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
433
+ }
434
+ export const Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_TYPE = 22;
435
+ const Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_FIELDS = [
436
+ {
437
+ name: 'asset',
438
+ type: 'struct',
439
+ offset: 0,
440
+ byteLength: 40,
441
+ structRef: 'Asset',
442
+ },
443
+ ];
444
+ export function buildQUtilDistributeQuToShareholdersInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
445
+ return buildPayload(Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
446
+ }
447
+ const Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_OUTPUT_FIELDS = [
448
+ {
449
+ name: 'shareholders',
450
+ type: 'sint64',
451
+ offset: 0,
452
+ byteLength: 8,
453
+ },
454
+ {
455
+ name: 'totalShares',
456
+ type: 'sint64',
457
+ offset: 8,
458
+ byteLength: 8,
459
+ },
460
+ {
461
+ name: 'amountPerShare',
462
+ type: 'sint64',
463
+ offset: 16,
464
+ byteLength: 8,
465
+ },
466
+ {
467
+ name: 'fees',
468
+ type: 'sint64',
469
+ offset: 24,
470
+ byteLength: 8,
471
+ },
472
+ ];
473
+ export function decodeQUtilDistributeQuToShareholdersOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
474
+ return decodePayload(data, Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
475
+ }
476
+ export const Q_UTIL_QUERY_PRICE_ORACLE_INPUT_TYPE = 23;
477
+ const Q_UTIL_QUERY_PRICE_ORACLE_INPUT_FIELDS = [
478
+ {
479
+ name: 'priceOracleQuery',
480
+ type: 'struct',
481
+ offset: 0,
482
+ byteLength: 104,
483
+ structRef: 'OI::Price::OracleQuery',
484
+ },
485
+ {
486
+ name: 'timeoutMilliseconds',
487
+ type: 'uint32',
488
+ offset: 104,
489
+ byteLength: 4,
490
+ },
491
+ ];
492
+ export function buildQUtilQueryPriceOracleInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
493
+ return buildPayload(Q_UTIL_QUERY_PRICE_ORACLE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
494
+ }
495
+ const Q_UTIL_QUERY_PRICE_ORACLE_OUTPUT_FIELDS = [
496
+ {
497
+ name: 'oracleQueryId',
498
+ type: 'sint64',
499
+ offset: 0,
500
+ byteLength: 8,
501
+ },
502
+ ];
503
+ export function decodeQUtilQueryPriceOracleOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
504
+ return decodePayload(data, Q_UTIL_QUERY_PRICE_ORACLE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
505
+ }
506
+ export const Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_TYPE = 24;
507
+ const Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_FIELDS = [
508
+ {
509
+ name: 'priceOracleQuery',
510
+ type: 'struct',
511
+ offset: 0,
512
+ byteLength: 104,
513
+ structRef: 'OI::Price::OracleQuery',
514
+ },
515
+ {
516
+ name: 'subscriptionPeriodMilliseconds',
517
+ type: 'uint32',
518
+ offset: 104,
519
+ byteLength: 4,
520
+ },
521
+ {
522
+ name: 'notifyPreviousValue',
523
+ type: 'uint8',
524
+ offset: 108,
525
+ byteLength: 1,
526
+ },
527
+ ];
528
+ export function buildQUtilSubscribePriceOracleInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
529
+ return buildPayload(Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
530
+ }
531
+ const Q_UTIL_SUBSCRIBE_PRICE_ORACLE_OUTPUT_FIELDS = [
532
+ {
533
+ name: 'oracleSubscriptionId',
534
+ type: 'sint32',
535
+ offset: 0,
536
+ byteLength: 4,
537
+ },
538
+ ];
539
+ export function decodeQUtilSubscribePriceOracleOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
540
+ return decodePayload(data, Q_UTIL_SUBSCRIBE_PRICE_ORACLE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
541
+ }
542
+ export const Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_TYPE = 25;
543
+ const Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_FIELDS = [
544
+ {
545
+ name: 'subscriptionId',
546
+ type: 'sint32',
547
+ offset: 0,
548
+ byteLength: 4,
549
+ },
550
+ ];
551
+ export function buildQUtilUnsubscribeOracleInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
552
+ return buildPayload(Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
553
+ }
554
+ const Q_UTIL_UNSUBSCRIBE_ORACLE_OUTPUT_FIELDS = [
555
+ {
556
+ name: 'success',
557
+ type: 'uint8',
558
+ offset: 0,
559
+ byteLength: 1,
560
+ },
561
+ ];
562
+ export function decodeQUtilUnsubscribeOracleOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
563
+ return decodePayload(data, Q_UTIL_UNSUBSCRIBE_ORACLE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
564
+ }
565
+ export const Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_TYPE = 6;
566
+ export const Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_SIZE = 0;
567
+ const Q_UTIL_GET_SEND_TO_MANY_V1FEE_OUTPUT_FIELDS = [
568
+ {
569
+ name: 'fee',
570
+ type: 'sint64',
571
+ offset: 0,
572
+ byteLength: 8,
573
+ },
574
+ ];
575
+ export function decodeQUtilGetSendToManyV1FeeOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
576
+ return decodePayload(data, Q_UTIL_GET_SEND_TO_MANY_V1FEE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
577
+ }
578
+ export async function qUtilGetSendToManyV1Fee(live, options) {
579
+ return callContractFunction({
580
+ live,
581
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
582
+ inputType: Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_TYPE,
583
+ inputSize: Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_SIZE,
584
+ inputFields: [],
585
+ outputFields: Q_UTIL_GET_SEND_TO_MANY_V1FEE_OUTPUT_FIELDS,
586
+ structs: STRUCTS,
587
+ input: {},
588
+ ...options,
589
+ });
590
+ }
591
+ export const Q_UTIL_QUERY_FEE_RESERVE_INPUT_TYPE = 12;
592
+ export const Q_UTIL_QUERY_FEE_RESERVE_INPUT_SIZE = 4;
593
+ const Q_UTIL_QUERY_FEE_RESERVE_INPUT_FIELDS = [
594
+ {
595
+ name: 'contractIndex',
596
+ type: 'uint32',
597
+ offset: 0,
598
+ byteLength: 4,
599
+ },
600
+ ];
601
+ export function buildQUtilQueryFeeReserveInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
602
+ return buildPayload(Q_UTIL_QUERY_FEE_RESERVE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
603
+ }
604
+ const Q_UTIL_QUERY_FEE_RESERVE_OUTPUT_FIELDS = [
605
+ {
606
+ name: 'reserveAmount',
607
+ type: 'sint64',
608
+ offset: 0,
609
+ byteLength: 8,
610
+ },
611
+ ];
612
+ export function decodeQUtilQueryFeeReserveOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
613
+ return decodePayload(data, Q_UTIL_QUERY_FEE_RESERVE_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
614
+ }
615
+ export async function qUtilQueryFeeReserve(live, input, options) {
616
+ return callContractFunction({
617
+ live,
618
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
619
+ inputType: Q_UTIL_QUERY_FEE_RESERVE_INPUT_TYPE,
620
+ inputSize: Q_UTIL_QUERY_FEE_RESERVE_INPUT_SIZE,
621
+ inputFields: Q_UTIL_QUERY_FEE_RESERVE_INPUT_FIELDS,
622
+ outputFields: Q_UTIL_QUERY_FEE_RESERVE_OUTPUT_FIELDS,
623
+ structs: STRUCTS,
624
+ input: input,
625
+ ...options,
626
+ });
627
+ }
628
+ export const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_TYPE = 13;
629
+ export const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_SIZE = 40;
630
+ const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_FIELDS = [
631
+ {
632
+ name: 'issuer',
633
+ type: 'id',
634
+ offset: 0,
635
+ byteLength: 32,
636
+ },
637
+ {
638
+ name: 'assetName',
639
+ type: 'uint64',
640
+ offset: 32,
641
+ byteLength: 8,
642
+ },
643
+ ];
644
+ export function buildQUtilGetTotalNumberOfAssetSharesInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
645
+ return buildPayload(Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
646
+ }
647
+ const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_OUTPUT_FIELDS = [
648
+ {
649
+ name: 'value',
650
+ type: 'sint64',
651
+ offset: 0,
652
+ byteLength: 8,
653
+ },
654
+ ];
655
+ export function decodeQUtilGetTotalNumberOfAssetSharesOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
656
+ return decodePayload(data, Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
657
+ }
658
+ export async function qUtilGetTotalNumberOfAssetShares(live, input, options) {
659
+ return callContractFunction({
660
+ live,
661
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
662
+ inputType: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_TYPE,
663
+ inputSize: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_SIZE,
664
+ inputFields: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_FIELDS,
665
+ outputFields: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_OUTPUT_FIELDS,
666
+ structs: STRUCTS,
667
+ input: input,
668
+ ...options,
669
+ });
670
+ }
671
+ export const Q_UTIL_GET_CURRENT_RESULT_INPUT_TYPE = 17;
672
+ export const Q_UTIL_GET_CURRENT_RESULT_INPUT_SIZE = 8;
673
+ const Q_UTIL_GET_CURRENT_RESULT_INPUT_FIELDS = [
674
+ {
675
+ name: 'poll_id',
676
+ type: 'uint64',
677
+ offset: 0,
678
+ byteLength: 8,
679
+ },
680
+ ];
681
+ export function buildQUtilGetCurrentResultInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
682
+ return buildPayload(Q_UTIL_GET_CURRENT_RESULT_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
683
+ }
684
+ const Q_UTIL_GET_CURRENT_RESULT_OUTPUT_FIELDS = [
685
+ {
686
+ name: 'result',
687
+ type: 'array',
688
+ offset: 0,
689
+ byteLength: 512,
690
+ arrayLength: 64,
691
+ arrayItemType: 'uint64',
692
+ arrayItemByteLength: 8,
693
+ },
694
+ {
695
+ name: 'voter_count',
696
+ type: 'array',
697
+ offset: 512,
698
+ byteLength: 512,
699
+ arrayLength: 64,
700
+ arrayItemType: 'uint64',
701
+ arrayItemByteLength: 8,
702
+ },
703
+ {
704
+ name: 'is_active',
705
+ type: 'uint64',
706
+ offset: 1024,
707
+ byteLength: 8,
708
+ },
709
+ ];
710
+ export function decodeQUtilGetCurrentResultOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
711
+ return decodePayload(data, Q_UTIL_GET_CURRENT_RESULT_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
712
+ }
713
+ export async function qUtilGetCurrentResult(live, input, options) {
714
+ return callContractFunction({
715
+ live,
716
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
717
+ inputType: Q_UTIL_GET_CURRENT_RESULT_INPUT_TYPE,
718
+ inputSize: Q_UTIL_GET_CURRENT_RESULT_INPUT_SIZE,
719
+ inputFields: Q_UTIL_GET_CURRENT_RESULT_INPUT_FIELDS,
720
+ outputFields: Q_UTIL_GET_CURRENT_RESULT_OUTPUT_FIELDS,
721
+ structs: STRUCTS,
722
+ input: input,
723
+ ...options,
724
+ });
725
+ }
726
+ export const Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_TYPE = 18;
727
+ export const Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_SIZE = 32;
728
+ const Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_FIELDS = [
729
+ {
730
+ name: 'creator',
731
+ type: 'id',
732
+ offset: 0,
733
+ byteLength: 32,
734
+ },
735
+ ];
736
+ export function buildQUtilGetPollsByCreatorInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
737
+ return buildPayload(Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
738
+ }
739
+ const Q_UTIL_GET_POLLS_BY_CREATOR_OUTPUT_FIELDS = [
740
+ {
741
+ name: 'poll_ids',
742
+ type: 'array',
743
+ offset: 0,
744
+ byteLength: 512,
745
+ arrayLength: 64,
746
+ arrayItemType: 'uint64',
747
+ arrayItemByteLength: 8,
748
+ },
749
+ {
750
+ name: 'count',
751
+ type: 'uint64',
752
+ offset: 512,
753
+ byteLength: 8,
754
+ },
755
+ ];
756
+ export function decodeQUtilGetPollsByCreatorOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
757
+ return decodePayload(data, Q_UTIL_GET_POLLS_BY_CREATOR_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
758
+ }
759
+ export async function qUtilGetPollsByCreator(live, input, options) {
760
+ return callContractFunction({
761
+ live,
762
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
763
+ inputType: Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_TYPE,
764
+ inputSize: Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_SIZE,
765
+ inputFields: Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_FIELDS,
766
+ outputFields: Q_UTIL_GET_POLLS_BY_CREATOR_OUTPUT_FIELDS,
767
+ structs: STRUCTS,
768
+ input: input,
769
+ ...options,
770
+ });
771
+ }
772
+ export const Q_UTIL_GET_CURRENT_POLL_ID_INPUT_TYPE = 19;
773
+ export const Q_UTIL_GET_CURRENT_POLL_ID_INPUT_SIZE = 0;
774
+ const Q_UTIL_GET_CURRENT_POLL_ID_OUTPUT_FIELDS = [
775
+ {
776
+ name: 'current_poll_id',
777
+ type: 'uint64',
778
+ offset: 0,
779
+ byteLength: 8,
780
+ },
781
+ {
782
+ name: 'active_poll_ids',
783
+ type: 'array',
784
+ offset: 8,
785
+ byteLength: 512,
786
+ arrayLength: 64,
787
+ arrayItemType: 'uint64',
788
+ arrayItemByteLength: 8,
789
+ },
790
+ {
791
+ name: 'active_count',
792
+ type: 'uint64',
793
+ offset: 520,
794
+ byteLength: 8,
795
+ },
796
+ ];
797
+ export function decodeQUtilGetCurrentPollIdOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
798
+ return decodePayload(data, Q_UTIL_GET_CURRENT_POLL_ID_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
799
+ }
800
+ export async function qUtilGetCurrentPollId(live, options) {
801
+ return callContractFunction({
802
+ live,
803
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
804
+ inputType: Q_UTIL_GET_CURRENT_POLL_ID_INPUT_TYPE,
805
+ inputSize: Q_UTIL_GET_CURRENT_POLL_ID_INPUT_SIZE,
806
+ inputFields: [],
807
+ outputFields: Q_UTIL_GET_CURRENT_POLL_ID_OUTPUT_FIELDS,
808
+ structs: STRUCTS,
809
+ input: {},
810
+ ...options,
811
+ });
812
+ }
813
+ export const Q_UTIL_GET_POLL_INFO_INPUT_TYPE = 20;
814
+ export const Q_UTIL_GET_POLL_INFO_INPUT_SIZE = 8;
815
+ const Q_UTIL_GET_POLL_INFO_INPUT_FIELDS = [
816
+ {
817
+ name: 'poll_id',
818
+ type: 'uint64',
819
+ offset: 0,
820
+ byteLength: 8,
821
+ },
822
+ ];
823
+ export function buildQUtilGetPollInfoInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
824
+ return buildPayload(Q_UTIL_GET_POLL_INFO_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
825
+ }
826
+ const Q_UTIL_GET_POLL_INFO_OUTPUT_FIELDS = [
827
+ {
828
+ name: 'found',
829
+ type: 'uint64',
830
+ offset: 0,
831
+ byteLength: 8,
832
+ },
833
+ {
834
+ name: 'poll_info',
835
+ type: 'struct',
836
+ offset: 8,
837
+ byteLength: 736,
838
+ structRef: 'Poll',
839
+ },
840
+ {
841
+ name: 'poll_link',
842
+ type: 'array',
843
+ offset: 744,
844
+ byteLength: 256,
845
+ arrayLength: 256,
846
+ arrayItemType: 'uint8',
847
+ arrayItemByteLength: 1,
848
+ },
849
+ ];
850
+ export function decodeQUtilGetPollInfoOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
851
+ return decodePayload(data, Q_UTIL_GET_POLL_INFO_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
852
+ }
853
+ export async function qUtilGetPollInfo(live, input, options) {
854
+ return callContractFunction({
855
+ live,
856
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
857
+ inputType: Q_UTIL_GET_POLL_INFO_INPUT_TYPE,
858
+ inputSize: Q_UTIL_GET_POLL_INFO_INPUT_SIZE,
859
+ inputFields: Q_UTIL_GET_POLL_INFO_INPUT_FIELDS,
860
+ outputFields: Q_UTIL_GET_POLL_INFO_OUTPUT_FIELDS,
861
+ structs: STRUCTS,
862
+ input: input,
863
+ ...options,
864
+ });
865
+ }
866
+ export const Q_UTIL_GET_FEES_INPUT_TYPE = 21;
867
+ export const Q_UTIL_GET_FEES_INPUT_SIZE = 0;
868
+ const Q_UTIL_GET_FEES_OUTPUT_FIELDS = [
869
+ {
870
+ name: 'smt1InvocationFee',
871
+ type: 'sint64',
872
+ offset: 0,
873
+ byteLength: 8,
874
+ },
875
+ {
876
+ name: 'pollCreationFee',
877
+ type: 'sint64',
878
+ offset: 8,
879
+ byteLength: 8,
880
+ },
881
+ {
882
+ name: 'pollVoteFee',
883
+ type: 'sint64',
884
+ offset: 16,
885
+ byteLength: 8,
886
+ },
887
+ {
888
+ name: 'distributeQuToShareholderFeePerShareholder',
889
+ type: 'sint64',
890
+ offset: 24,
891
+ byteLength: 8,
892
+ },
893
+ {
894
+ name: 'shareholderProposalFee',
895
+ type: 'sint64',
896
+ offset: 32,
897
+ byteLength: 8,
898
+ },
899
+ {
900
+ name: '_futureFeePlaceholder0',
901
+ type: 'sint64',
902
+ offset: 40,
903
+ byteLength: 8,
904
+ },
905
+ {
906
+ name: '_futureFeePlaceholder1',
907
+ type: 'sint64',
908
+ offset: 48,
909
+ byteLength: 8,
910
+ },
911
+ {
912
+ name: '_futureFeePlaceholder2',
913
+ type: 'sint64',
914
+ offset: 56,
915
+ byteLength: 8,
916
+ },
917
+ {
918
+ name: '_futureFeePlaceholder3',
919
+ type: 'sint64',
920
+ offset: 64,
921
+ byteLength: 8,
922
+ },
923
+ {
924
+ name: '_futureFeePlaceholder4',
925
+ type: 'sint64',
926
+ offset: 72,
927
+ byteLength: 8,
928
+ },
929
+ {
930
+ name: '_futureFeePlaceholder5',
931
+ type: 'sint64',
932
+ offset: 80,
933
+ byteLength: 8,
934
+ },
935
+ ];
936
+ export function decodeQUtilGetFeesOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
937
+ return decodePayload(data, Q_UTIL_GET_FEES_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
938
+ }
939
+ export async function qUtilGetFees(live, options) {
940
+ return callContractFunction({
941
+ live,
942
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
943
+ inputType: Q_UTIL_GET_FEES_INPUT_TYPE,
944
+ inputSize: Q_UTIL_GET_FEES_INPUT_SIZE,
945
+ inputFields: [],
946
+ outputFields: Q_UTIL_GET_FEES_OUTPUT_FIELDS,
947
+ structs: STRUCTS,
948
+ input: {},
949
+ ...options,
950
+ });
951
+ }
952
+ export const Q_UTIL_GET_BALANCES16_INPUT_TYPE = 27;
953
+ export const Q_UTIL_GET_BALANCES16_INPUT_SIZE = 512;
954
+ const Q_UTIL_GET_BALANCES16_INPUT_FIELDS = [
955
+ {
956
+ name: 'publicKeys',
957
+ type: 'array',
958
+ offset: 0,
959
+ byteLength: 512,
960
+ arrayLength: 16,
961
+ arrayItemType: 'id',
962
+ arrayItemByteLength: 32,
963
+ },
964
+ ];
965
+ export function buildQUtilGetBalances16Input(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
966
+ return buildPayload(Q_UTIL_GET_BALANCES16_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
967
+ }
968
+ const Q_UTIL_GET_BALANCES16_OUTPUT_FIELDS = [
969
+ {
970
+ name: 'balances',
971
+ type: 'array',
972
+ offset: 0,
973
+ byteLength: 128,
974
+ arrayLength: 16,
975
+ arrayItemType: 'sint64',
976
+ arrayItemByteLength: 8,
977
+ },
978
+ ];
979
+ export function decodeQUtilGetBalances16Output(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
980
+ return decodePayload(data, Q_UTIL_GET_BALANCES16_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
981
+ }
982
+ export async function qUtilGetBalances16(live, input, options) {
983
+ return callContractFunction({
984
+ live,
985
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
986
+ inputType: Q_UTIL_GET_BALANCES16_INPUT_TYPE,
987
+ inputSize: Q_UTIL_GET_BALANCES16_INPUT_SIZE,
988
+ inputFields: Q_UTIL_GET_BALANCES16_INPUT_FIELDS,
989
+ outputFields: Q_UTIL_GET_BALANCES16_OUTPUT_FIELDS,
990
+ structs: STRUCTS,
991
+ input: input,
992
+ ...options,
993
+ });
994
+ }
995
+ export const qUtil = {
996
+ contractIndex: Q_UTIL_CONTRACT_INDEX,
997
+ GetSendToManyV1Fee: qUtilGetSendToManyV1Fee,
998
+ QueryFeeReserve: qUtilQueryFeeReserve,
999
+ GetTotalNumberOfAssetShares: qUtilGetTotalNumberOfAssetShares,
1000
+ GetCurrentResult: qUtilGetCurrentResult,
1001
+ GetPollsByCreator: qUtilGetPollsByCreator,
1002
+ GetCurrentPollId: qUtilGetCurrentPollId,
1003
+ GetPollInfo: qUtilGetPollInfo,
1004
+ GetFees: qUtilGetFees,
1005
+ GetBalances16: qUtilGetBalances16,
1006
+ buildSendToManyV1Input: buildQUtilSendToManyV1Input,
1007
+ decodeSendToManyV1Output: decodeQUtilSendToManyV1Output,
1008
+ buildTransferSharesToManyV1Input: buildQUtilTransferSharesToManyV1Input,
1009
+ decodeTransferSharesToManyV1Output: decodeQUtilTransferSharesToManyV1Output,
1010
+ buildTransferSharesManagementRightsInput: buildQUtilTransferSharesManagementRightsInput,
1011
+ decodeTransferSharesManagementRightsOutput: decodeQUtilTransferSharesManagementRightsOutput,
1012
+ buildSendToManyBenchmarkInput: buildQUtilSendToManyBenchmarkInput,
1013
+ decodeSendToManyBenchmarkOutput: decodeQUtilSendToManyBenchmarkOutput,
1014
+ buildBurnQubicInput: buildQUtilBurnQubicInput,
1015
+ decodeBurnQubicOutput: decodeQUtilBurnQubicOutput,
1016
+ buildBurnQubicForContractInput: buildQUtilBurnQubicForContractInput,
1017
+ decodeBurnQubicForContractOutput: decodeQUtilBurnQubicForContractOutput,
1018
+ buildCreatePollInput: buildQUtilCreatePollInput,
1019
+ decodeCreatePollOutput: decodeQUtilCreatePollOutput,
1020
+ buildVoteInput: buildQUtilVoteInput,
1021
+ decodeVoteOutput: decodeQUtilVoteOutput,
1022
+ buildCancelPollInput: buildQUtilCancelPollInput,
1023
+ decodeCancelPollOutput: decodeQUtilCancelPollOutput,
1024
+ buildDistributeQuToShareholdersInput: buildQUtilDistributeQuToShareholdersInput,
1025
+ decodeDistributeQuToShareholdersOutput: decodeQUtilDistributeQuToShareholdersOutput,
1026
+ buildQueryPriceOracleInput: buildQUtilQueryPriceOracleInput,
1027
+ decodeQueryPriceOracleOutput: decodeQUtilQueryPriceOracleOutput,
1028
+ buildSubscribePriceOracleInput: buildQUtilSubscribePriceOracleInput,
1029
+ decodeSubscribePriceOracleOutput: decodeQUtilSubscribePriceOracleOutput,
1030
+ buildUnsubscribeOracleInput: buildQUtilUnsubscribeOracleInput,
1031
+ decodeUnsubscribeOracleOutput: decodeQUtilUnsubscribeOracleOutput,
1032
+ };
1033
+ //# sourceMappingURL=qutil.js.map