@qubic.org/contracts 0.2.6 → 1.0.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 (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 +7 -6
  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,1716 @@
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 MS_VAULT_CONTRACT_INDEX = 11
9
+
10
+ export interface MsVaultAssetStruct {
11
+ issuer: string
12
+ assetName: bigint
13
+ }
14
+
15
+ export interface MsVaultAssetBalanceStruct {
16
+ asset: MsVaultAssetStruct
17
+ balance: bigint
18
+ }
19
+
20
+ export interface MsVaultMsVaultFeeVoteStruct {
21
+ registeringFee: bigint
22
+ releaseFee: bigint
23
+ releaseResetFee: bigint
24
+ holdingFee: bigint
25
+ depositFee: bigint
26
+ burnFee: bigint
27
+ }
28
+
29
+ const STRUCTS: Record<string, NamedStruct> = {
30
+ 'Asset': {
31
+ name: 'Asset',
32
+ byteLength: 40,
33
+ fields: [
34
+ {
35
+ name: 'issuer',
36
+ type: 'id',
37
+ offset: 0,
38
+ byteLength: 32,
39
+ },
40
+ {
41
+ name: 'assetName',
42
+ type: 'uint64',
43
+ offset: 32,
44
+ byteLength: 8,
45
+ },
46
+ ],
47
+ },
48
+ 'AssetBalance': {
49
+ name: 'AssetBalance',
50
+ byteLength: 48,
51
+ fields: [
52
+ {
53
+ name: 'asset',
54
+ type: 'struct',
55
+ offset: 0,
56
+ byteLength: 40,
57
+ structRef: 'Asset',
58
+ },
59
+ {
60
+ name: 'balance',
61
+ type: 'uint64',
62
+ offset: 40,
63
+ byteLength: 8,
64
+ },
65
+ ],
66
+ },
67
+ 'MsVaultFeeVote': {
68
+ name: 'MsVaultFeeVote',
69
+ byteLength: 48,
70
+ fields: [
71
+ {
72
+ name: 'registeringFee',
73
+ type: 'uint64',
74
+ offset: 0,
75
+ byteLength: 8,
76
+ },
77
+ {
78
+ name: 'releaseFee',
79
+ type: 'uint64',
80
+ offset: 8,
81
+ byteLength: 8,
82
+ },
83
+ {
84
+ name: 'releaseResetFee',
85
+ type: 'uint64',
86
+ offset: 16,
87
+ byteLength: 8,
88
+ },
89
+ {
90
+ name: 'holdingFee',
91
+ type: 'uint64',
92
+ offset: 24,
93
+ byteLength: 8,
94
+ },
95
+ {
96
+ name: 'depositFee',
97
+ type: 'uint64',
98
+ offset: 32,
99
+ byteLength: 8,
100
+ },
101
+ {
102
+ name: 'burnFee',
103
+ type: 'uint64',
104
+ offset: 40,
105
+ byteLength: 8,
106
+ },
107
+ ],
108
+ },
109
+ }
110
+
111
+ export const MS_VAULT_REGISTER_VAULT_INPUT_TYPE = 1
112
+
113
+ export interface MsVaultRegisterVaultInput {
114
+ vaultName: string
115
+ owners: string[]
116
+ requiredApprovals: bigint
117
+ }
118
+
119
+ const MS_VAULT_REGISTER_VAULT_INPUT_FIELDS: BinaryField[] = [
120
+ {
121
+ name: 'vaultName',
122
+ type: 'id',
123
+ offset: 0,
124
+ byteLength: 32,
125
+ },
126
+ {
127
+ name: 'owners',
128
+ type: 'array',
129
+ offset: 32,
130
+ byteLength: 512,
131
+ arrayLength: 16,
132
+ arrayItemType: 'id',
133
+ arrayItemByteLength: 32,
134
+ },
135
+ {
136
+ name: 'requiredApprovals',
137
+ type: 'uint64',
138
+ offset: 544,
139
+ byteLength: 8,
140
+ },
141
+ ]
142
+
143
+ export function buildMsVaultRegisterVaultInput(
144
+ input: MsVaultRegisterVaultInput,
145
+ identityToPublicKey: (identity: string) => Uint8Array,
146
+ ): ContractCall {
147
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_REGISTER_VAULT_INPUT_TYPE, payload: buildPayload(MS_VAULT_REGISTER_VAULT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
148
+ }
149
+
150
+ export interface MsVaultRegisterVaultOutput {
151
+ status: bigint
152
+ }
153
+
154
+ const MS_VAULT_REGISTER_VAULT_OUTPUT_FIELDS: BinaryField[] = [
155
+ {
156
+ name: 'status',
157
+ type: 'uint64',
158
+ offset: 0,
159
+ byteLength: 8,
160
+ },
161
+ ]
162
+
163
+ export function decodeMsVaultRegisterVaultOutput(
164
+ data: Uint8Array,
165
+ ): MsVaultRegisterVaultOutput {
166
+ return decodePayload(data, MS_VAULT_REGISTER_VAULT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultRegisterVaultOutput
167
+ }
168
+
169
+ export const MS_VAULT_DEPOSIT_INPUT_TYPE = 2
170
+
171
+ export interface MsVaultDepositInput {
172
+ vaultId: bigint
173
+ }
174
+
175
+ const MS_VAULT_DEPOSIT_INPUT_FIELDS: BinaryField[] = [
176
+ {
177
+ name: 'vaultId',
178
+ type: 'uint64',
179
+ offset: 0,
180
+ byteLength: 8,
181
+ },
182
+ ]
183
+
184
+ export function buildMsVaultDepositInput(
185
+ input: MsVaultDepositInput,
186
+ ): ContractCall {
187
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_DEPOSIT_INPUT_TYPE, payload: buildPayload(MS_VAULT_DEPOSIT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
188
+ }
189
+
190
+ export interface MsVaultDepositOutput {
191
+ status: bigint
192
+ }
193
+
194
+ const MS_VAULT_DEPOSIT_OUTPUT_FIELDS: BinaryField[] = [
195
+ {
196
+ name: 'status',
197
+ type: 'uint64',
198
+ offset: 0,
199
+ byteLength: 8,
200
+ },
201
+ ]
202
+
203
+ export function decodeMsVaultDepositOutput(
204
+ data: Uint8Array,
205
+ ): MsVaultDepositOutput {
206
+ return decodePayload(data, MS_VAULT_DEPOSIT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultDepositOutput
207
+ }
208
+
209
+ export const MS_VAULT_RELEASE_TO_INPUT_TYPE = 3
210
+
211
+ export interface MsVaultReleaseToInput {
212
+ vaultId: bigint
213
+ amount: bigint
214
+ destination: string
215
+ }
216
+
217
+ const MS_VAULT_RELEASE_TO_INPUT_FIELDS: BinaryField[] = [
218
+ {
219
+ name: 'vaultId',
220
+ type: 'uint64',
221
+ offset: 0,
222
+ byteLength: 8,
223
+ },
224
+ {
225
+ name: 'amount',
226
+ type: 'uint64',
227
+ offset: 8,
228
+ byteLength: 8,
229
+ },
230
+ {
231
+ name: 'destination',
232
+ type: 'id',
233
+ offset: 16,
234
+ byteLength: 32,
235
+ },
236
+ ]
237
+
238
+ export function buildMsVaultReleaseToInput(
239
+ input: MsVaultReleaseToInput,
240
+ identityToPublicKey: (identity: string) => Uint8Array,
241
+ ): ContractCall {
242
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_RELEASE_TO_INPUT_TYPE, payload: buildPayload(MS_VAULT_RELEASE_TO_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
243
+ }
244
+
245
+ export interface MsVaultReleaseToOutput {
246
+ status: bigint
247
+ }
248
+
249
+ const MS_VAULT_RELEASE_TO_OUTPUT_FIELDS: BinaryField[] = [
250
+ {
251
+ name: 'status',
252
+ type: 'uint64',
253
+ offset: 0,
254
+ byteLength: 8,
255
+ },
256
+ ]
257
+
258
+ export function decodeMsVaultReleaseToOutput(
259
+ data: Uint8Array,
260
+ ): MsVaultReleaseToOutput {
261
+ return decodePayload(data, MS_VAULT_RELEASE_TO_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultReleaseToOutput
262
+ }
263
+
264
+ export const MS_VAULT_RESET_RELEASE_INPUT_TYPE = 4
265
+
266
+ export interface MsVaultResetReleaseInput {
267
+ vaultId: bigint
268
+ }
269
+
270
+ const MS_VAULT_RESET_RELEASE_INPUT_FIELDS: BinaryField[] = [
271
+ {
272
+ name: 'vaultId',
273
+ type: 'uint64',
274
+ offset: 0,
275
+ byteLength: 8,
276
+ },
277
+ ]
278
+
279
+ export function buildMsVaultResetReleaseInput(
280
+ input: MsVaultResetReleaseInput,
281
+ ): ContractCall {
282
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_RESET_RELEASE_INPUT_TYPE, payload: buildPayload(MS_VAULT_RESET_RELEASE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
283
+ }
284
+
285
+ export interface MsVaultResetReleaseOutput {
286
+ status: bigint
287
+ }
288
+
289
+ const MS_VAULT_RESET_RELEASE_OUTPUT_FIELDS: BinaryField[] = [
290
+ {
291
+ name: 'status',
292
+ type: 'uint64',
293
+ offset: 0,
294
+ byteLength: 8,
295
+ },
296
+ ]
297
+
298
+ export function decodeMsVaultResetReleaseOutput(
299
+ data: Uint8Array,
300
+ ): MsVaultResetReleaseOutput {
301
+ return decodePayload(data, MS_VAULT_RESET_RELEASE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultResetReleaseOutput
302
+ }
303
+
304
+ export const MS_VAULT_VOTE_FEE_CHANGE_INPUT_TYPE = 13
305
+
306
+ export interface MsVaultVoteFeeChangeInput {
307
+ newRegisteringFee: bigint
308
+ newReleaseFee: bigint
309
+ newReleaseResetFee: bigint
310
+ newHoldingFee: bigint
311
+ newDepositFee: bigint
312
+ burnFee: bigint
313
+ }
314
+
315
+ const MS_VAULT_VOTE_FEE_CHANGE_INPUT_FIELDS: BinaryField[] = [
316
+ {
317
+ name: 'newRegisteringFee',
318
+ type: 'uint64',
319
+ offset: 0,
320
+ byteLength: 8,
321
+ },
322
+ {
323
+ name: 'newReleaseFee',
324
+ type: 'uint64',
325
+ offset: 8,
326
+ byteLength: 8,
327
+ },
328
+ {
329
+ name: 'newReleaseResetFee',
330
+ type: 'uint64',
331
+ offset: 16,
332
+ byteLength: 8,
333
+ },
334
+ {
335
+ name: 'newHoldingFee',
336
+ type: 'uint64',
337
+ offset: 24,
338
+ byteLength: 8,
339
+ },
340
+ {
341
+ name: 'newDepositFee',
342
+ type: 'uint64',
343
+ offset: 32,
344
+ byteLength: 8,
345
+ },
346
+ {
347
+ name: 'burnFee',
348
+ type: 'uint64',
349
+ offset: 40,
350
+ byteLength: 8,
351
+ },
352
+ ]
353
+
354
+ export function buildMsVaultVoteFeeChangeInput(
355
+ input: MsVaultVoteFeeChangeInput,
356
+ ): ContractCall {
357
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_VOTE_FEE_CHANGE_INPUT_TYPE, payload: buildPayload(MS_VAULT_VOTE_FEE_CHANGE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
358
+ }
359
+
360
+ export interface MsVaultVoteFeeChangeOutput {
361
+ status: bigint
362
+ }
363
+
364
+ const MS_VAULT_VOTE_FEE_CHANGE_OUTPUT_FIELDS: BinaryField[] = [
365
+ {
366
+ name: 'status',
367
+ type: 'uint64',
368
+ offset: 0,
369
+ byteLength: 8,
370
+ },
371
+ ]
372
+
373
+ export function decodeMsVaultVoteFeeChangeOutput(
374
+ data: Uint8Array,
375
+ ): MsVaultVoteFeeChangeOutput {
376
+ return decodePayload(data, MS_VAULT_VOTE_FEE_CHANGE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultVoteFeeChangeOutput
377
+ }
378
+
379
+ export const MS_VAULT_DEPOSIT_ASSET_INPUT_TYPE = 19
380
+
381
+ export interface MsVaultDepositAssetInput {
382
+ vaultId: bigint
383
+ asset: MsVaultAssetStruct
384
+ amount: bigint
385
+ }
386
+
387
+ const MS_VAULT_DEPOSIT_ASSET_INPUT_FIELDS: BinaryField[] = [
388
+ {
389
+ name: 'vaultId',
390
+ type: 'uint64',
391
+ offset: 0,
392
+ byteLength: 8,
393
+ },
394
+ {
395
+ name: 'asset',
396
+ type: 'struct',
397
+ offset: 8,
398
+ byteLength: 40,
399
+ structRef: 'Asset',
400
+ },
401
+ {
402
+ name: 'amount',
403
+ type: 'uint64',
404
+ offset: 48,
405
+ byteLength: 8,
406
+ },
407
+ ]
408
+
409
+ export function buildMsVaultDepositAssetInput(
410
+ input: MsVaultDepositAssetInput,
411
+ ): ContractCall {
412
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_DEPOSIT_ASSET_INPUT_TYPE, payload: buildPayload(MS_VAULT_DEPOSIT_ASSET_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
413
+ }
414
+
415
+ export interface MsVaultDepositAssetOutput {
416
+ status: bigint
417
+ }
418
+
419
+ const MS_VAULT_DEPOSIT_ASSET_OUTPUT_FIELDS: BinaryField[] = [
420
+ {
421
+ name: 'status',
422
+ type: 'uint64',
423
+ offset: 0,
424
+ byteLength: 8,
425
+ },
426
+ ]
427
+
428
+ export function decodeMsVaultDepositAssetOutput(
429
+ data: Uint8Array,
430
+ ): MsVaultDepositAssetOutput {
431
+ return decodePayload(data, MS_VAULT_DEPOSIT_ASSET_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultDepositAssetOutput
432
+ }
433
+
434
+ export const MS_VAULT_RELEASE_ASSET_TO_INPUT_TYPE = 20
435
+
436
+ export interface MsVaultReleaseAssetToInput {
437
+ vaultId: bigint
438
+ asset: MsVaultAssetStruct
439
+ amount: bigint
440
+ destination: string
441
+ }
442
+
443
+ const MS_VAULT_RELEASE_ASSET_TO_INPUT_FIELDS: BinaryField[] = [
444
+ {
445
+ name: 'vaultId',
446
+ type: 'uint64',
447
+ offset: 0,
448
+ byteLength: 8,
449
+ },
450
+ {
451
+ name: 'asset',
452
+ type: 'struct',
453
+ offset: 8,
454
+ byteLength: 40,
455
+ structRef: 'Asset',
456
+ },
457
+ {
458
+ name: 'amount',
459
+ type: 'uint64',
460
+ offset: 48,
461
+ byteLength: 8,
462
+ },
463
+ {
464
+ name: 'destination',
465
+ type: 'id',
466
+ offset: 56,
467
+ byteLength: 32,
468
+ },
469
+ ]
470
+
471
+ export function buildMsVaultReleaseAssetToInput(
472
+ input: MsVaultReleaseAssetToInput,
473
+ identityToPublicKey: (identity: string) => Uint8Array,
474
+ ): ContractCall {
475
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_RELEASE_ASSET_TO_INPUT_TYPE, payload: buildPayload(MS_VAULT_RELEASE_ASSET_TO_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
476
+ }
477
+
478
+ export interface MsVaultReleaseAssetToOutput {
479
+ status: bigint
480
+ }
481
+
482
+ const MS_VAULT_RELEASE_ASSET_TO_OUTPUT_FIELDS: BinaryField[] = [
483
+ {
484
+ name: 'status',
485
+ type: 'uint64',
486
+ offset: 0,
487
+ byteLength: 8,
488
+ },
489
+ ]
490
+
491
+ export function decodeMsVaultReleaseAssetToOutput(
492
+ data: Uint8Array,
493
+ ): MsVaultReleaseAssetToOutput {
494
+ return decodePayload(data, MS_VAULT_RELEASE_ASSET_TO_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultReleaseAssetToOutput
495
+ }
496
+
497
+ export const MS_VAULT_RESET_ASSET_RELEASE_INPUT_TYPE = 21
498
+
499
+ export interface MsVaultResetAssetReleaseInput {
500
+ vaultId: bigint
501
+ }
502
+
503
+ const MS_VAULT_RESET_ASSET_RELEASE_INPUT_FIELDS: BinaryField[] = [
504
+ {
505
+ name: 'vaultId',
506
+ type: 'uint64',
507
+ offset: 0,
508
+ byteLength: 8,
509
+ },
510
+ ]
511
+
512
+ export function buildMsVaultResetAssetReleaseInput(
513
+ input: MsVaultResetAssetReleaseInput,
514
+ ): ContractCall {
515
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_RESET_ASSET_RELEASE_INPUT_TYPE, payload: buildPayload(MS_VAULT_RESET_ASSET_RELEASE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
516
+ }
517
+
518
+ export interface MsVaultResetAssetReleaseOutput {
519
+ status: bigint
520
+ }
521
+
522
+ const MS_VAULT_RESET_ASSET_RELEASE_OUTPUT_FIELDS: BinaryField[] = [
523
+ {
524
+ name: 'status',
525
+ type: 'uint64',
526
+ offset: 0,
527
+ byteLength: 8,
528
+ },
529
+ ]
530
+
531
+ export function decodeMsVaultResetAssetReleaseOutput(
532
+ data: Uint8Array,
533
+ ): MsVaultResetAssetReleaseOutput {
534
+ return decodePayload(data, MS_VAULT_RESET_ASSET_RELEASE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultResetAssetReleaseOutput
535
+ }
536
+
537
+ export const MS_VAULT_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_TYPE = 25
538
+
539
+ export interface MsVaultRevokeAssetManagementRightsInput {
540
+ asset: MsVaultAssetStruct
541
+ numberOfShares: bigint
542
+ }
543
+
544
+ const MS_VAULT_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_FIELDS: BinaryField[] = [
545
+ {
546
+ name: 'asset',
547
+ type: 'struct',
548
+ offset: 0,
549
+ byteLength: 40,
550
+ structRef: 'Asset',
551
+ },
552
+ {
553
+ name: 'numberOfShares',
554
+ type: 'sint64',
555
+ offset: 40,
556
+ byteLength: 8,
557
+ },
558
+ ]
559
+
560
+ export function buildMsVaultRevokeAssetManagementRightsInput(
561
+ input: MsVaultRevokeAssetManagementRightsInput,
562
+ ): ContractCall {
563
+ return { contractIndex: MS_VAULT_CONTRACT_INDEX, inputType: MS_VAULT_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_TYPE, payload: buildPayload(MS_VAULT_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
564
+ }
565
+
566
+ export interface MsVaultRevokeAssetManagementRightsOutput {
567
+ transferredNumberOfShares: bigint
568
+ status: bigint
569
+ }
570
+
571
+ const MS_VAULT_REVOKE_ASSET_MANAGEMENT_RIGHTS_OUTPUT_FIELDS: BinaryField[] = [
572
+ {
573
+ name: 'transferredNumberOfShares',
574
+ type: 'sint64',
575
+ offset: 0,
576
+ byteLength: 8,
577
+ },
578
+ {
579
+ name: 'status',
580
+ type: 'uint64',
581
+ offset: 8,
582
+ byteLength: 8,
583
+ },
584
+ ]
585
+
586
+ export function decodeMsVaultRevokeAssetManagementRightsOutput(
587
+ data: Uint8Array,
588
+ ): MsVaultRevokeAssetManagementRightsOutput {
589
+ return decodePayload(data, MS_VAULT_REVOKE_ASSET_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultRevokeAssetManagementRightsOutput
590
+ }
591
+
592
+ export const MS_VAULT_GET_VAULTS_INPUT_TYPE = 5
593
+ export const MS_VAULT_GET_VAULTS_INPUT_SIZE = 32
594
+
595
+ export interface MsVaultGetVaultsInput {
596
+ publicKey: string
597
+ }
598
+
599
+ const MS_VAULT_GET_VAULTS_INPUT_FIELDS: BinaryField[] = [
600
+ {
601
+ name: 'publicKey',
602
+ type: 'id',
603
+ offset: 0,
604
+ byteLength: 32,
605
+ },
606
+ ]
607
+
608
+ export function buildMsVaultGetVaultsInput(
609
+ input: MsVaultGetVaultsInput,
610
+ identityToPublicKey: (identity: string) => Uint8Array,
611
+ ): Uint8Array {
612
+ return buildPayload(MS_VAULT_GET_VAULTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
613
+ }
614
+
615
+ export interface MsVaultGetVaultsOutput {
616
+ numberOfVaults: bigint
617
+ vaultIds: bigint[]
618
+ vaultNames: string[]
619
+ }
620
+
621
+ const MS_VAULT_GET_VAULTS_OUTPUT_FIELDS: BinaryField[] = [
622
+ {
623
+ name: 'numberOfVaults',
624
+ type: 'uint64',
625
+ offset: 0,
626
+ byteLength: 8,
627
+ },
628
+ {
629
+ name: 'vaultIds',
630
+ type: 'array',
631
+ offset: 8,
632
+ byteLength: 64,
633
+ arrayLength: 8,
634
+ arrayItemType: 'uint64',
635
+ arrayItemByteLength: 8,
636
+ },
637
+ {
638
+ name: 'vaultNames',
639
+ type: 'array',
640
+ offset: 72,
641
+ byteLength: 256,
642
+ arrayLength: 8,
643
+ arrayItemType: 'id',
644
+ arrayItemByteLength: 32,
645
+ },
646
+ ]
647
+
648
+ export function decodeMsVaultGetVaultsOutput(
649
+ data: Uint8Array,
650
+ publicKeyToIdentity: (pk: Uint8Array) => string,
651
+ ): MsVaultGetVaultsOutput {
652
+ return decodePayload(data, MS_VAULT_GET_VAULTS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as MsVaultGetVaultsOutput
653
+ }
654
+
655
+ export async function msVaultGetVaults(
656
+ live: SmartContractCaller,
657
+ input: MsVaultGetVaultsInput,
658
+ options?: ContractCallOptions,
659
+ ): Promise<Result<MsVaultGetVaultsOutput, QubicRpcError>> {
660
+ return callContractFunction({
661
+ live,
662
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
663
+ inputType: MS_VAULT_GET_VAULTS_INPUT_TYPE,
664
+ inputSize: MS_VAULT_GET_VAULTS_INPUT_SIZE,
665
+ inputFields: MS_VAULT_GET_VAULTS_INPUT_FIELDS,
666
+ outputFields: MS_VAULT_GET_VAULTS_OUTPUT_FIELDS,
667
+ structs: STRUCTS,
668
+ input: (input as unknown as Record<string, unknown>),
669
+ ...options,
670
+ })
671
+ }
672
+
673
+ export const MS_VAULT_GET_RELEASE_STATUS_INPUT_TYPE = 6
674
+ export const MS_VAULT_GET_RELEASE_STATUS_INPUT_SIZE = 8
675
+
676
+ export interface MsVaultGetReleaseStatusInput {
677
+ vaultId: bigint
678
+ }
679
+
680
+ const MS_VAULT_GET_RELEASE_STATUS_INPUT_FIELDS: BinaryField[] = [
681
+ {
682
+ name: 'vaultId',
683
+ type: 'uint64',
684
+ offset: 0,
685
+ byteLength: 8,
686
+ },
687
+ ]
688
+
689
+ export function buildMsVaultGetReleaseStatusInput(
690
+ input: MsVaultGetReleaseStatusInput,
691
+ ): Uint8Array {
692
+ return buildPayload(MS_VAULT_GET_RELEASE_STATUS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
693
+ }
694
+
695
+ export interface MsVaultGetReleaseStatusOutput {
696
+ status: bigint
697
+ amounts: bigint[]
698
+ destinations: string[]
699
+ }
700
+
701
+ const MS_VAULT_GET_RELEASE_STATUS_OUTPUT_FIELDS: BinaryField[] = [
702
+ {
703
+ name: 'status',
704
+ type: 'uint64',
705
+ offset: 0,
706
+ byteLength: 8,
707
+ },
708
+ {
709
+ name: 'amounts',
710
+ type: 'array',
711
+ offset: 8,
712
+ byteLength: 128,
713
+ arrayLength: 16,
714
+ arrayItemType: 'uint64',
715
+ arrayItemByteLength: 8,
716
+ },
717
+ {
718
+ name: 'destinations',
719
+ type: 'array',
720
+ offset: 136,
721
+ byteLength: 512,
722
+ arrayLength: 16,
723
+ arrayItemType: 'id',
724
+ arrayItemByteLength: 32,
725
+ },
726
+ ]
727
+
728
+ export function decodeMsVaultGetReleaseStatusOutput(
729
+ data: Uint8Array,
730
+ publicKeyToIdentity: (pk: Uint8Array) => string,
731
+ ): MsVaultGetReleaseStatusOutput {
732
+ return decodePayload(data, MS_VAULT_GET_RELEASE_STATUS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as MsVaultGetReleaseStatusOutput
733
+ }
734
+
735
+ export async function msVaultGetReleaseStatus(
736
+ live: SmartContractCaller,
737
+ input: MsVaultGetReleaseStatusInput,
738
+ options?: ContractCallOptions,
739
+ ): Promise<Result<MsVaultGetReleaseStatusOutput, QubicRpcError>> {
740
+ return callContractFunction({
741
+ live,
742
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
743
+ inputType: MS_VAULT_GET_RELEASE_STATUS_INPUT_TYPE,
744
+ inputSize: MS_VAULT_GET_RELEASE_STATUS_INPUT_SIZE,
745
+ inputFields: MS_VAULT_GET_RELEASE_STATUS_INPUT_FIELDS,
746
+ outputFields: MS_VAULT_GET_RELEASE_STATUS_OUTPUT_FIELDS,
747
+ structs: STRUCTS,
748
+ input: (input as unknown as Record<string, unknown>),
749
+ ...options,
750
+ })
751
+ }
752
+
753
+ export const MS_VAULT_GET_BALANCE_OF_INPUT_TYPE = 7
754
+ export const MS_VAULT_GET_BALANCE_OF_INPUT_SIZE = 8
755
+
756
+ export interface MsVaultGetBalanceOfInput {
757
+ vaultId: bigint
758
+ }
759
+
760
+ const MS_VAULT_GET_BALANCE_OF_INPUT_FIELDS: BinaryField[] = [
761
+ {
762
+ name: 'vaultId',
763
+ type: 'uint64',
764
+ offset: 0,
765
+ byteLength: 8,
766
+ },
767
+ ]
768
+
769
+ export function buildMsVaultGetBalanceOfInput(
770
+ input: MsVaultGetBalanceOfInput,
771
+ ): Uint8Array {
772
+ return buildPayload(MS_VAULT_GET_BALANCE_OF_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
773
+ }
774
+
775
+ export interface MsVaultGetBalanceOfOutput {
776
+ status: bigint
777
+ balance: bigint
778
+ }
779
+
780
+ const MS_VAULT_GET_BALANCE_OF_OUTPUT_FIELDS: BinaryField[] = [
781
+ {
782
+ name: 'status',
783
+ type: 'uint64',
784
+ offset: 0,
785
+ byteLength: 8,
786
+ },
787
+ {
788
+ name: 'balance',
789
+ type: 'sint64',
790
+ offset: 8,
791
+ byteLength: 8,
792
+ },
793
+ ]
794
+
795
+ export function decodeMsVaultGetBalanceOfOutput(
796
+ data: Uint8Array,
797
+ ): MsVaultGetBalanceOfOutput {
798
+ return decodePayload(data, MS_VAULT_GET_BALANCE_OF_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetBalanceOfOutput
799
+ }
800
+
801
+ export async function msVaultGetBalanceOf(
802
+ live: SmartContractCaller,
803
+ input: MsVaultGetBalanceOfInput,
804
+ options?: ContractCallOptions,
805
+ ): Promise<Result<MsVaultGetBalanceOfOutput, QubicRpcError>> {
806
+ return callContractFunction({
807
+ live,
808
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
809
+ inputType: MS_VAULT_GET_BALANCE_OF_INPUT_TYPE,
810
+ inputSize: MS_VAULT_GET_BALANCE_OF_INPUT_SIZE,
811
+ inputFields: MS_VAULT_GET_BALANCE_OF_INPUT_FIELDS,
812
+ outputFields: MS_VAULT_GET_BALANCE_OF_OUTPUT_FIELDS,
813
+ structs: STRUCTS,
814
+ input: (input as unknown as Record<string, unknown>),
815
+ ...options,
816
+ })
817
+ }
818
+
819
+ export const MS_VAULT_GET_VAULT_NAME_INPUT_TYPE = 8
820
+ export const MS_VAULT_GET_VAULT_NAME_INPUT_SIZE = 8
821
+
822
+ export interface MsVaultGetVaultNameInput {
823
+ vaultId: bigint
824
+ }
825
+
826
+ const MS_VAULT_GET_VAULT_NAME_INPUT_FIELDS: BinaryField[] = [
827
+ {
828
+ name: 'vaultId',
829
+ type: 'uint64',
830
+ offset: 0,
831
+ byteLength: 8,
832
+ },
833
+ ]
834
+
835
+ export function buildMsVaultGetVaultNameInput(
836
+ input: MsVaultGetVaultNameInput,
837
+ ): Uint8Array {
838
+ return buildPayload(MS_VAULT_GET_VAULT_NAME_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
839
+ }
840
+
841
+ export interface MsVaultGetVaultNameOutput {
842
+ status: bigint
843
+ vaultName: string
844
+ }
845
+
846
+ const MS_VAULT_GET_VAULT_NAME_OUTPUT_FIELDS: BinaryField[] = [
847
+ {
848
+ name: 'status',
849
+ type: 'uint64',
850
+ offset: 0,
851
+ byteLength: 8,
852
+ },
853
+ {
854
+ name: 'vaultName',
855
+ type: 'id',
856
+ offset: 8,
857
+ byteLength: 32,
858
+ },
859
+ ]
860
+
861
+ export function decodeMsVaultGetVaultNameOutput(
862
+ data: Uint8Array,
863
+ publicKeyToIdentity: (pk: Uint8Array) => string,
864
+ ): MsVaultGetVaultNameOutput {
865
+ return decodePayload(data, MS_VAULT_GET_VAULT_NAME_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as MsVaultGetVaultNameOutput
866
+ }
867
+
868
+ export async function msVaultGetVaultName(
869
+ live: SmartContractCaller,
870
+ input: MsVaultGetVaultNameInput,
871
+ options?: ContractCallOptions,
872
+ ): Promise<Result<MsVaultGetVaultNameOutput, QubicRpcError>> {
873
+ return callContractFunction({
874
+ live,
875
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
876
+ inputType: MS_VAULT_GET_VAULT_NAME_INPUT_TYPE,
877
+ inputSize: MS_VAULT_GET_VAULT_NAME_INPUT_SIZE,
878
+ inputFields: MS_VAULT_GET_VAULT_NAME_INPUT_FIELDS,
879
+ outputFields: MS_VAULT_GET_VAULT_NAME_OUTPUT_FIELDS,
880
+ structs: STRUCTS,
881
+ input: (input as unknown as Record<string, unknown>),
882
+ ...options,
883
+ })
884
+ }
885
+
886
+ export const MS_VAULT_GET_REVENUE_INFO_INPUT_TYPE = 9
887
+ export const MS_VAULT_GET_REVENUE_INFO_INPUT_SIZE = 0
888
+
889
+ export interface MsVaultGetRevenueInfoOutput {
890
+ numberOfActiveVaults: bigint
891
+ totalRevenue: bigint
892
+ totalDistributedToShareholders: bigint
893
+ burnedAmount: bigint
894
+ }
895
+
896
+ const MS_VAULT_GET_REVENUE_INFO_OUTPUT_FIELDS: BinaryField[] = [
897
+ {
898
+ name: 'numberOfActiveVaults',
899
+ type: 'uint64',
900
+ offset: 0,
901
+ byteLength: 8,
902
+ },
903
+ {
904
+ name: 'totalRevenue',
905
+ type: 'uint64',
906
+ offset: 8,
907
+ byteLength: 8,
908
+ },
909
+ {
910
+ name: 'totalDistributedToShareholders',
911
+ type: 'uint64',
912
+ offset: 16,
913
+ byteLength: 8,
914
+ },
915
+ {
916
+ name: 'burnedAmount',
917
+ type: 'uint64',
918
+ offset: 24,
919
+ byteLength: 8,
920
+ },
921
+ ]
922
+
923
+ export function decodeMsVaultGetRevenueInfoOutput(
924
+ data: Uint8Array,
925
+ ): MsVaultGetRevenueInfoOutput {
926
+ return decodePayload(data, MS_VAULT_GET_REVENUE_INFO_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetRevenueInfoOutput
927
+ }
928
+
929
+ export async function msVaultGetRevenueInfo(
930
+ live: SmartContractCaller,
931
+ options?: ContractCallOptions,
932
+ ): Promise<Result<MsVaultGetRevenueInfoOutput, QubicRpcError>> {
933
+ return callContractFunction({
934
+ live,
935
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
936
+ inputType: MS_VAULT_GET_REVENUE_INFO_INPUT_TYPE,
937
+ inputSize: MS_VAULT_GET_REVENUE_INFO_INPUT_SIZE,
938
+ inputFields: [],
939
+ outputFields: MS_VAULT_GET_REVENUE_INFO_OUTPUT_FIELDS,
940
+ structs: STRUCTS,
941
+ input: {},
942
+ ...options,
943
+ })
944
+ }
945
+
946
+ export const MS_VAULT_GET_FEES_INPUT_TYPE = 10
947
+ export const MS_VAULT_GET_FEES_INPUT_SIZE = 0
948
+
949
+ export interface MsVaultGetFeesOutput {
950
+ registeringFee: bigint
951
+ releaseFee: bigint
952
+ releaseResetFee: bigint
953
+ holdingFee: bigint
954
+ depositFee: bigint
955
+ burnFee: bigint
956
+ }
957
+
958
+ const MS_VAULT_GET_FEES_OUTPUT_FIELDS: BinaryField[] = [
959
+ {
960
+ name: 'registeringFee',
961
+ type: 'uint64',
962
+ offset: 0,
963
+ byteLength: 8,
964
+ },
965
+ {
966
+ name: 'releaseFee',
967
+ type: 'uint64',
968
+ offset: 8,
969
+ byteLength: 8,
970
+ },
971
+ {
972
+ name: 'releaseResetFee',
973
+ type: 'uint64',
974
+ offset: 16,
975
+ byteLength: 8,
976
+ },
977
+ {
978
+ name: 'holdingFee',
979
+ type: 'uint64',
980
+ offset: 24,
981
+ byteLength: 8,
982
+ },
983
+ {
984
+ name: 'depositFee',
985
+ type: 'uint64',
986
+ offset: 32,
987
+ byteLength: 8,
988
+ },
989
+ {
990
+ name: 'burnFee',
991
+ type: 'uint64',
992
+ offset: 40,
993
+ byteLength: 8,
994
+ },
995
+ ]
996
+
997
+ export function decodeMsVaultGetFeesOutput(
998
+ data: Uint8Array,
999
+ ): MsVaultGetFeesOutput {
1000
+ return decodePayload(data, MS_VAULT_GET_FEES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetFeesOutput
1001
+ }
1002
+
1003
+ export async function msVaultGetFees(
1004
+ live: SmartContractCaller,
1005
+ options?: ContractCallOptions,
1006
+ ): Promise<Result<MsVaultGetFeesOutput, QubicRpcError>> {
1007
+ return callContractFunction({
1008
+ live,
1009
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1010
+ inputType: MS_VAULT_GET_FEES_INPUT_TYPE,
1011
+ inputSize: MS_VAULT_GET_FEES_INPUT_SIZE,
1012
+ inputFields: [],
1013
+ outputFields: MS_VAULT_GET_FEES_OUTPUT_FIELDS,
1014
+ structs: STRUCTS,
1015
+ input: {},
1016
+ ...options,
1017
+ })
1018
+ }
1019
+
1020
+ export const MS_VAULT_GET_VAULT_OWNERS_INPUT_TYPE = 11
1021
+ export const MS_VAULT_GET_VAULT_OWNERS_INPUT_SIZE = 8
1022
+
1023
+ export interface MsVaultGetVaultOwnersInput {
1024
+ vaultId: bigint
1025
+ }
1026
+
1027
+ const MS_VAULT_GET_VAULT_OWNERS_INPUT_FIELDS: BinaryField[] = [
1028
+ {
1029
+ name: 'vaultId',
1030
+ type: 'uint64',
1031
+ offset: 0,
1032
+ byteLength: 8,
1033
+ },
1034
+ ]
1035
+
1036
+ export function buildMsVaultGetVaultOwnersInput(
1037
+ input: MsVaultGetVaultOwnersInput,
1038
+ ): Uint8Array {
1039
+ return buildPayload(MS_VAULT_GET_VAULT_OWNERS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1040
+ }
1041
+
1042
+ export interface MsVaultGetVaultOwnersOutput {
1043
+ status: bigint
1044
+ numberOfOwners: bigint
1045
+ owners: string[]
1046
+ requiredApprovals: bigint
1047
+ }
1048
+
1049
+ const MS_VAULT_GET_VAULT_OWNERS_OUTPUT_FIELDS: BinaryField[] = [
1050
+ {
1051
+ name: 'status',
1052
+ type: 'uint64',
1053
+ offset: 0,
1054
+ byteLength: 8,
1055
+ },
1056
+ {
1057
+ name: 'numberOfOwners',
1058
+ type: 'uint64',
1059
+ offset: 8,
1060
+ byteLength: 8,
1061
+ },
1062
+ {
1063
+ name: 'owners',
1064
+ type: 'array',
1065
+ offset: 16,
1066
+ byteLength: 512,
1067
+ arrayLength: 16,
1068
+ arrayItemType: 'id',
1069
+ arrayItemByteLength: 32,
1070
+ },
1071
+ {
1072
+ name: 'requiredApprovals',
1073
+ type: 'uint64',
1074
+ offset: 528,
1075
+ byteLength: 8,
1076
+ },
1077
+ ]
1078
+
1079
+ export function decodeMsVaultGetVaultOwnersOutput(
1080
+ data: Uint8Array,
1081
+ publicKeyToIdentity: (pk: Uint8Array) => string,
1082
+ ): MsVaultGetVaultOwnersOutput {
1083
+ return decodePayload(data, MS_VAULT_GET_VAULT_OWNERS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as MsVaultGetVaultOwnersOutput
1084
+ }
1085
+
1086
+ export async function msVaultGetVaultOwners(
1087
+ live: SmartContractCaller,
1088
+ input: MsVaultGetVaultOwnersInput,
1089
+ options?: ContractCallOptions,
1090
+ ): Promise<Result<MsVaultGetVaultOwnersOutput, QubicRpcError>> {
1091
+ return callContractFunction({
1092
+ live,
1093
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1094
+ inputType: MS_VAULT_GET_VAULT_OWNERS_INPUT_TYPE,
1095
+ inputSize: MS_VAULT_GET_VAULT_OWNERS_INPUT_SIZE,
1096
+ inputFields: MS_VAULT_GET_VAULT_OWNERS_INPUT_FIELDS,
1097
+ outputFields: MS_VAULT_GET_VAULT_OWNERS_OUTPUT_FIELDS,
1098
+ structs: STRUCTS,
1099
+ input: (input as unknown as Record<string, unknown>),
1100
+ ...options,
1101
+ })
1102
+ }
1103
+
1104
+ export const MS_VAULT_IS_SHARE_HOLDER_INPUT_TYPE = 12
1105
+ export const MS_VAULT_IS_SHARE_HOLDER_INPUT_SIZE = 32
1106
+
1107
+ export interface MsVaultIsShareHolderInput {
1108
+ candidate: string
1109
+ }
1110
+
1111
+ const MS_VAULT_IS_SHARE_HOLDER_INPUT_FIELDS: BinaryField[] = [
1112
+ {
1113
+ name: 'candidate',
1114
+ type: 'id',
1115
+ offset: 0,
1116
+ byteLength: 32,
1117
+ },
1118
+ ]
1119
+
1120
+ export function buildMsVaultIsShareHolderInput(
1121
+ input: MsVaultIsShareHolderInput,
1122
+ identityToPublicKey: (identity: string) => Uint8Array,
1123
+ ): Uint8Array {
1124
+ return buildPayload(MS_VAULT_IS_SHARE_HOLDER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
1125
+ }
1126
+
1127
+ export interface MsVaultIsShareHolderOutput {
1128
+ result: bigint
1129
+ }
1130
+
1131
+ const MS_VAULT_IS_SHARE_HOLDER_OUTPUT_FIELDS: BinaryField[] = [
1132
+ {
1133
+ name: 'result',
1134
+ type: 'uint64',
1135
+ offset: 0,
1136
+ byteLength: 8,
1137
+ },
1138
+ ]
1139
+
1140
+ export function decodeMsVaultIsShareHolderOutput(
1141
+ data: Uint8Array,
1142
+ ): MsVaultIsShareHolderOutput {
1143
+ return decodePayload(data, MS_VAULT_IS_SHARE_HOLDER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultIsShareHolderOutput
1144
+ }
1145
+
1146
+ export async function msVaultIsShareHolder(
1147
+ live: SmartContractCaller,
1148
+ input: MsVaultIsShareHolderInput,
1149
+ options?: ContractCallOptions,
1150
+ ): Promise<Result<MsVaultIsShareHolderOutput, QubicRpcError>> {
1151
+ return callContractFunction({
1152
+ live,
1153
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1154
+ inputType: MS_VAULT_IS_SHARE_HOLDER_INPUT_TYPE,
1155
+ inputSize: MS_VAULT_IS_SHARE_HOLDER_INPUT_SIZE,
1156
+ inputFields: MS_VAULT_IS_SHARE_HOLDER_INPUT_FIELDS,
1157
+ outputFields: MS_VAULT_IS_SHARE_HOLDER_OUTPUT_FIELDS,
1158
+ structs: STRUCTS,
1159
+ input: (input as unknown as Record<string, unknown>),
1160
+ ...options,
1161
+ })
1162
+ }
1163
+
1164
+ export const MS_VAULT_GET_FEE_VOTES_INPUT_TYPE = 14
1165
+ export const MS_VAULT_GET_FEE_VOTES_INPUT_SIZE = 0
1166
+
1167
+ export interface MsVaultGetFeeVotesOutput {
1168
+ status: bigint
1169
+ numberOfFeeVotes: bigint
1170
+ feeVotes: number[]
1171
+ }
1172
+
1173
+ const MS_VAULT_GET_FEE_VOTES_OUTPUT_FIELDS: BinaryField[] = [
1174
+ {
1175
+ name: 'status',
1176
+ type: 'uint64',
1177
+ offset: 0,
1178
+ byteLength: 8,
1179
+ },
1180
+ {
1181
+ name: 'numberOfFeeVotes',
1182
+ type: 'uint64',
1183
+ offset: 8,
1184
+ byteLength: 8,
1185
+ },
1186
+ {
1187
+ name: 'feeVotes',
1188
+ type: 'array',
1189
+ offset: 16,
1190
+ byteLength: 3072,
1191
+ arrayLength: 64,
1192
+ arrayItemByteLength: 48,
1193
+ arrayItemStructRef: 'MsVaultFeeVote',
1194
+ },
1195
+ ]
1196
+
1197
+ export function decodeMsVaultGetFeeVotesOutput(
1198
+ data: Uint8Array,
1199
+ ): MsVaultGetFeeVotesOutput {
1200
+ return decodePayload(data, MS_VAULT_GET_FEE_VOTES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetFeeVotesOutput
1201
+ }
1202
+
1203
+ export async function msVaultGetFeeVotes(
1204
+ live: SmartContractCaller,
1205
+ options?: ContractCallOptions,
1206
+ ): Promise<Result<MsVaultGetFeeVotesOutput, QubicRpcError>> {
1207
+ return callContractFunction({
1208
+ live,
1209
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1210
+ inputType: MS_VAULT_GET_FEE_VOTES_INPUT_TYPE,
1211
+ inputSize: MS_VAULT_GET_FEE_VOTES_INPUT_SIZE,
1212
+ inputFields: [],
1213
+ outputFields: MS_VAULT_GET_FEE_VOTES_OUTPUT_FIELDS,
1214
+ structs: STRUCTS,
1215
+ input: {},
1216
+ ...options,
1217
+ })
1218
+ }
1219
+
1220
+ export const MS_VAULT_GET_FEE_VOTES_OWNER_INPUT_TYPE = 15
1221
+ export const MS_VAULT_GET_FEE_VOTES_OWNER_INPUT_SIZE = 0
1222
+
1223
+ export interface MsVaultGetFeeVotesOwnerOutput {
1224
+ status: bigint
1225
+ numberOfFeeVotes: bigint
1226
+ feeVotesOwner: string[]
1227
+ }
1228
+
1229
+ const MS_VAULT_GET_FEE_VOTES_OWNER_OUTPUT_FIELDS: BinaryField[] = [
1230
+ {
1231
+ name: 'status',
1232
+ type: 'uint64',
1233
+ offset: 0,
1234
+ byteLength: 8,
1235
+ },
1236
+ {
1237
+ name: 'numberOfFeeVotes',
1238
+ type: 'uint64',
1239
+ offset: 8,
1240
+ byteLength: 8,
1241
+ },
1242
+ {
1243
+ name: 'feeVotesOwner',
1244
+ type: 'array',
1245
+ offset: 16,
1246
+ byteLength: 2048,
1247
+ arrayLength: 64,
1248
+ arrayItemType: 'id',
1249
+ arrayItemByteLength: 32,
1250
+ },
1251
+ ]
1252
+
1253
+ export function decodeMsVaultGetFeeVotesOwnerOutput(
1254
+ data: Uint8Array,
1255
+ publicKeyToIdentity: (pk: Uint8Array) => string,
1256
+ ): MsVaultGetFeeVotesOwnerOutput {
1257
+ return decodePayload(data, MS_VAULT_GET_FEE_VOTES_OWNER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as MsVaultGetFeeVotesOwnerOutput
1258
+ }
1259
+
1260
+ export async function msVaultGetFeeVotesOwner(
1261
+ live: SmartContractCaller,
1262
+ options?: ContractCallOptions,
1263
+ ): Promise<Result<MsVaultGetFeeVotesOwnerOutput, QubicRpcError>> {
1264
+ return callContractFunction({
1265
+ live,
1266
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1267
+ inputType: MS_VAULT_GET_FEE_VOTES_OWNER_INPUT_TYPE,
1268
+ inputSize: MS_VAULT_GET_FEE_VOTES_OWNER_INPUT_SIZE,
1269
+ inputFields: [],
1270
+ outputFields: MS_VAULT_GET_FEE_VOTES_OWNER_OUTPUT_FIELDS,
1271
+ structs: STRUCTS,
1272
+ input: {},
1273
+ ...options,
1274
+ })
1275
+ }
1276
+
1277
+ export const MS_VAULT_GET_FEE_VOTES_SCORE_INPUT_TYPE = 16
1278
+ export const MS_VAULT_GET_FEE_VOTES_SCORE_INPUT_SIZE = 0
1279
+
1280
+ export interface MsVaultGetFeeVotesScoreOutput {
1281
+ status: bigint
1282
+ numberOfFeeVotes: bigint
1283
+ feeVotesScore: bigint[]
1284
+ }
1285
+
1286
+ const MS_VAULT_GET_FEE_VOTES_SCORE_OUTPUT_FIELDS: BinaryField[] = [
1287
+ {
1288
+ name: 'status',
1289
+ type: 'uint64',
1290
+ offset: 0,
1291
+ byteLength: 8,
1292
+ },
1293
+ {
1294
+ name: 'numberOfFeeVotes',
1295
+ type: 'uint64',
1296
+ offset: 8,
1297
+ byteLength: 8,
1298
+ },
1299
+ {
1300
+ name: 'feeVotesScore',
1301
+ type: 'array',
1302
+ offset: 16,
1303
+ byteLength: 512,
1304
+ arrayLength: 64,
1305
+ arrayItemType: 'uint64',
1306
+ arrayItemByteLength: 8,
1307
+ },
1308
+ ]
1309
+
1310
+ export function decodeMsVaultGetFeeVotesScoreOutput(
1311
+ data: Uint8Array,
1312
+ ): MsVaultGetFeeVotesScoreOutput {
1313
+ return decodePayload(data, MS_VAULT_GET_FEE_VOTES_SCORE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetFeeVotesScoreOutput
1314
+ }
1315
+
1316
+ export async function msVaultGetFeeVotesScore(
1317
+ live: SmartContractCaller,
1318
+ options?: ContractCallOptions,
1319
+ ): Promise<Result<MsVaultGetFeeVotesScoreOutput, QubicRpcError>> {
1320
+ return callContractFunction({
1321
+ live,
1322
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1323
+ inputType: MS_VAULT_GET_FEE_VOTES_SCORE_INPUT_TYPE,
1324
+ inputSize: MS_VAULT_GET_FEE_VOTES_SCORE_INPUT_SIZE,
1325
+ inputFields: [],
1326
+ outputFields: MS_VAULT_GET_FEE_VOTES_SCORE_OUTPUT_FIELDS,
1327
+ structs: STRUCTS,
1328
+ input: {},
1329
+ ...options,
1330
+ })
1331
+ }
1332
+
1333
+ export const MS_VAULT_GET_UNIQUE_FEE_VOTES_INPUT_TYPE = 17
1334
+ export const MS_VAULT_GET_UNIQUE_FEE_VOTES_INPUT_SIZE = 0
1335
+
1336
+ export interface MsVaultGetUniqueFeeVotesOutput {
1337
+ status: bigint
1338
+ numberOfUniqueFeeVotes: bigint
1339
+ uniqueFeeVotes: number[]
1340
+ }
1341
+
1342
+ const MS_VAULT_GET_UNIQUE_FEE_VOTES_OUTPUT_FIELDS: BinaryField[] = [
1343
+ {
1344
+ name: 'status',
1345
+ type: 'uint64',
1346
+ offset: 0,
1347
+ byteLength: 8,
1348
+ },
1349
+ {
1350
+ name: 'numberOfUniqueFeeVotes',
1351
+ type: 'uint64',
1352
+ offset: 8,
1353
+ byteLength: 8,
1354
+ },
1355
+ {
1356
+ name: 'uniqueFeeVotes',
1357
+ type: 'array',
1358
+ offset: 16,
1359
+ byteLength: 3072,
1360
+ arrayLength: 64,
1361
+ arrayItemByteLength: 48,
1362
+ arrayItemStructRef: 'MsVaultFeeVote',
1363
+ },
1364
+ ]
1365
+
1366
+ export function decodeMsVaultGetUniqueFeeVotesOutput(
1367
+ data: Uint8Array,
1368
+ ): MsVaultGetUniqueFeeVotesOutput {
1369
+ return decodePayload(data, MS_VAULT_GET_UNIQUE_FEE_VOTES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetUniqueFeeVotesOutput
1370
+ }
1371
+
1372
+ export async function msVaultGetUniqueFeeVotes(
1373
+ live: SmartContractCaller,
1374
+ options?: ContractCallOptions,
1375
+ ): Promise<Result<MsVaultGetUniqueFeeVotesOutput, QubicRpcError>> {
1376
+ return callContractFunction({
1377
+ live,
1378
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1379
+ inputType: MS_VAULT_GET_UNIQUE_FEE_VOTES_INPUT_TYPE,
1380
+ inputSize: MS_VAULT_GET_UNIQUE_FEE_VOTES_INPUT_SIZE,
1381
+ inputFields: [],
1382
+ outputFields: MS_VAULT_GET_UNIQUE_FEE_VOTES_OUTPUT_FIELDS,
1383
+ structs: STRUCTS,
1384
+ input: {},
1385
+ ...options,
1386
+ })
1387
+ }
1388
+
1389
+ export const MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_INPUT_TYPE = 18
1390
+ export const MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_INPUT_SIZE = 0
1391
+
1392
+ export interface MsVaultGetUniqueFeeVotesRankingOutput {
1393
+ status: bigint
1394
+ numberOfUniqueFeeVotes: bigint
1395
+ uniqueFeeVotesRanking: bigint[]
1396
+ }
1397
+
1398
+ const MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_OUTPUT_FIELDS: BinaryField[] = [
1399
+ {
1400
+ name: 'status',
1401
+ type: 'uint64',
1402
+ offset: 0,
1403
+ byteLength: 8,
1404
+ },
1405
+ {
1406
+ name: 'numberOfUniqueFeeVotes',
1407
+ type: 'uint64',
1408
+ offset: 8,
1409
+ byteLength: 8,
1410
+ },
1411
+ {
1412
+ name: 'uniqueFeeVotesRanking',
1413
+ type: 'array',
1414
+ offset: 16,
1415
+ byteLength: 512,
1416
+ arrayLength: 64,
1417
+ arrayItemType: 'uint64',
1418
+ arrayItemByteLength: 8,
1419
+ },
1420
+ ]
1421
+
1422
+ export function decodeMsVaultGetUniqueFeeVotesRankingOutput(
1423
+ data: Uint8Array,
1424
+ ): MsVaultGetUniqueFeeVotesRankingOutput {
1425
+ return decodePayload(data, MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetUniqueFeeVotesRankingOutput
1426
+ }
1427
+
1428
+ export async function msVaultGetUniqueFeeVotesRanking(
1429
+ live: SmartContractCaller,
1430
+ options?: ContractCallOptions,
1431
+ ): Promise<Result<MsVaultGetUniqueFeeVotesRankingOutput, QubicRpcError>> {
1432
+ return callContractFunction({
1433
+ live,
1434
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1435
+ inputType: MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_INPUT_TYPE,
1436
+ inputSize: MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_INPUT_SIZE,
1437
+ inputFields: [],
1438
+ outputFields: MS_VAULT_GET_UNIQUE_FEE_VOTES_RANKING_OUTPUT_FIELDS,
1439
+ structs: STRUCTS,
1440
+ input: {},
1441
+ ...options,
1442
+ })
1443
+ }
1444
+
1445
+ export const MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_TYPE = 22
1446
+ export const MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_SIZE = 8
1447
+
1448
+ export interface MsVaultGetVaultAssetBalancesInput {
1449
+ vaultId: bigint
1450
+ }
1451
+
1452
+ const MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_FIELDS: BinaryField[] = [
1453
+ {
1454
+ name: 'vaultId',
1455
+ type: 'uint64',
1456
+ offset: 0,
1457
+ byteLength: 8,
1458
+ },
1459
+ ]
1460
+
1461
+ export function buildMsVaultGetVaultAssetBalancesInput(
1462
+ input: MsVaultGetVaultAssetBalancesInput,
1463
+ ): Uint8Array {
1464
+ return buildPayload(MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1465
+ }
1466
+
1467
+ export interface MsVaultGetVaultAssetBalancesOutput {
1468
+ status: bigint
1469
+ numberOfAssetTypes: bigint
1470
+ assetBalances: number[]
1471
+ }
1472
+
1473
+ const MS_VAULT_GET_VAULT_ASSET_BALANCES_OUTPUT_FIELDS: BinaryField[] = [
1474
+ {
1475
+ name: 'status',
1476
+ type: 'uint64',
1477
+ offset: 0,
1478
+ byteLength: 8,
1479
+ },
1480
+ {
1481
+ name: 'numberOfAssetTypes',
1482
+ type: 'uint64',
1483
+ offset: 8,
1484
+ byteLength: 8,
1485
+ },
1486
+ {
1487
+ name: 'assetBalances',
1488
+ type: 'array',
1489
+ offset: 16,
1490
+ byteLength: 384,
1491
+ arrayLength: 8,
1492
+ arrayItemByteLength: 48,
1493
+ arrayItemStructRef: 'AssetBalance',
1494
+ },
1495
+ ]
1496
+
1497
+ export function decodeMsVaultGetVaultAssetBalancesOutput(
1498
+ data: Uint8Array,
1499
+ ): MsVaultGetVaultAssetBalancesOutput {
1500
+ return decodePayload(data, MS_VAULT_GET_VAULT_ASSET_BALANCES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetVaultAssetBalancesOutput
1501
+ }
1502
+
1503
+ export async function msVaultGetVaultAssetBalances(
1504
+ live: SmartContractCaller,
1505
+ input: MsVaultGetVaultAssetBalancesInput,
1506
+ options?: ContractCallOptions,
1507
+ ): Promise<Result<MsVaultGetVaultAssetBalancesOutput, QubicRpcError>> {
1508
+ return callContractFunction({
1509
+ live,
1510
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1511
+ inputType: MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_TYPE,
1512
+ inputSize: MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_SIZE,
1513
+ inputFields: MS_VAULT_GET_VAULT_ASSET_BALANCES_INPUT_FIELDS,
1514
+ outputFields: MS_VAULT_GET_VAULT_ASSET_BALANCES_OUTPUT_FIELDS,
1515
+ structs: STRUCTS,
1516
+ input: (input as unknown as Record<string, unknown>),
1517
+ ...options,
1518
+ })
1519
+ }
1520
+
1521
+ export const MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_TYPE = 23
1522
+ export const MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_SIZE = 8
1523
+
1524
+ export interface MsVaultGetAssetReleaseStatusInput {
1525
+ vaultId: bigint
1526
+ }
1527
+
1528
+ const MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_FIELDS: BinaryField[] = [
1529
+ {
1530
+ name: 'vaultId',
1531
+ type: 'uint64',
1532
+ offset: 0,
1533
+ byteLength: 8,
1534
+ },
1535
+ ]
1536
+
1537
+ export function buildMsVaultGetAssetReleaseStatusInput(
1538
+ input: MsVaultGetAssetReleaseStatusInput,
1539
+ ): Uint8Array {
1540
+ return buildPayload(MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1541
+ }
1542
+
1543
+ export interface MsVaultGetAssetReleaseStatusOutput {
1544
+ status: bigint
1545
+ assets: number[]
1546
+ amounts: bigint[]
1547
+ destinations: string[]
1548
+ }
1549
+
1550
+ const MS_VAULT_GET_ASSET_RELEASE_STATUS_OUTPUT_FIELDS: BinaryField[] = [
1551
+ {
1552
+ name: 'status',
1553
+ type: 'uint64',
1554
+ offset: 0,
1555
+ byteLength: 8,
1556
+ },
1557
+ {
1558
+ name: 'assets',
1559
+ type: 'array',
1560
+ offset: 8,
1561
+ byteLength: 640,
1562
+ arrayLength: 16,
1563
+ arrayItemByteLength: 40,
1564
+ arrayItemStructRef: 'Asset',
1565
+ },
1566
+ {
1567
+ name: 'amounts',
1568
+ type: 'array',
1569
+ offset: 648,
1570
+ byteLength: 128,
1571
+ arrayLength: 16,
1572
+ arrayItemType: 'uint64',
1573
+ arrayItemByteLength: 8,
1574
+ },
1575
+ {
1576
+ name: 'destinations',
1577
+ type: 'array',
1578
+ offset: 776,
1579
+ byteLength: 512,
1580
+ arrayLength: 16,
1581
+ arrayItemType: 'id',
1582
+ arrayItemByteLength: 32,
1583
+ },
1584
+ ]
1585
+
1586
+ export function decodeMsVaultGetAssetReleaseStatusOutput(
1587
+ data: Uint8Array,
1588
+ publicKeyToIdentity: (pk: Uint8Array) => string,
1589
+ ): MsVaultGetAssetReleaseStatusOutput {
1590
+ return decodePayload(data, MS_VAULT_GET_ASSET_RELEASE_STATUS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as MsVaultGetAssetReleaseStatusOutput
1591
+ }
1592
+
1593
+ export async function msVaultGetAssetReleaseStatus(
1594
+ live: SmartContractCaller,
1595
+ input: MsVaultGetAssetReleaseStatusInput,
1596
+ options?: ContractCallOptions,
1597
+ ): Promise<Result<MsVaultGetAssetReleaseStatusOutput, QubicRpcError>> {
1598
+ return callContractFunction({
1599
+ live,
1600
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1601
+ inputType: MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_TYPE,
1602
+ inputSize: MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_SIZE,
1603
+ inputFields: MS_VAULT_GET_ASSET_RELEASE_STATUS_INPUT_FIELDS,
1604
+ outputFields: MS_VAULT_GET_ASSET_RELEASE_STATUS_OUTPUT_FIELDS,
1605
+ structs: STRUCTS,
1606
+ input: (input as unknown as Record<string, unknown>),
1607
+ ...options,
1608
+ })
1609
+ }
1610
+
1611
+ export const MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_TYPE = 24
1612
+ export const MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_SIZE = 72
1613
+
1614
+ export interface MsVaultGetManagedAssetBalanceInput {
1615
+ asset: MsVaultAssetStruct
1616
+ owner: string
1617
+ }
1618
+
1619
+ const MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_FIELDS: BinaryField[] = [
1620
+ {
1621
+ name: 'asset',
1622
+ type: 'struct',
1623
+ offset: 0,
1624
+ byteLength: 40,
1625
+ structRef: 'Asset',
1626
+ },
1627
+ {
1628
+ name: 'owner',
1629
+ type: 'id',
1630
+ offset: 40,
1631
+ byteLength: 32,
1632
+ },
1633
+ ]
1634
+
1635
+ export function buildMsVaultGetManagedAssetBalanceInput(
1636
+ input: MsVaultGetManagedAssetBalanceInput,
1637
+ identityToPublicKey: (identity: string) => Uint8Array,
1638
+ ): Uint8Array {
1639
+ return buildPayload(MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
1640
+ }
1641
+
1642
+ export interface MsVaultGetManagedAssetBalanceOutput {
1643
+ balance: bigint
1644
+ }
1645
+
1646
+ const MS_VAULT_GET_MANAGED_ASSET_BALANCE_OUTPUT_FIELDS: BinaryField[] = [
1647
+ {
1648
+ name: 'balance',
1649
+ type: 'sint64',
1650
+ offset: 0,
1651
+ byteLength: 8,
1652
+ },
1653
+ ]
1654
+
1655
+ export function decodeMsVaultGetManagedAssetBalanceOutput(
1656
+ data: Uint8Array,
1657
+ ): MsVaultGetManagedAssetBalanceOutput {
1658
+ return decodePayload(data, MS_VAULT_GET_MANAGED_ASSET_BALANCE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as MsVaultGetManagedAssetBalanceOutput
1659
+ }
1660
+
1661
+ export async function msVaultGetManagedAssetBalance(
1662
+ live: SmartContractCaller,
1663
+ input: MsVaultGetManagedAssetBalanceInput,
1664
+ options?: ContractCallOptions,
1665
+ ): Promise<Result<MsVaultGetManagedAssetBalanceOutput, QubicRpcError>> {
1666
+ return callContractFunction({
1667
+ live,
1668
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1669
+ inputType: MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_TYPE,
1670
+ inputSize: MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_SIZE,
1671
+ inputFields: MS_VAULT_GET_MANAGED_ASSET_BALANCE_INPUT_FIELDS,
1672
+ outputFields: MS_VAULT_GET_MANAGED_ASSET_BALANCE_OUTPUT_FIELDS,
1673
+ structs: STRUCTS,
1674
+ input: (input as unknown as Record<string, unknown>),
1675
+ ...options,
1676
+ })
1677
+ }
1678
+
1679
+ export const msVault = {
1680
+ contractIndex: MS_VAULT_CONTRACT_INDEX,
1681
+ getVaults: msVaultGetVaults,
1682
+ getReleaseStatus: msVaultGetReleaseStatus,
1683
+ getBalanceOf: msVaultGetBalanceOf,
1684
+ getVaultName: msVaultGetVaultName,
1685
+ getRevenueInfo: msVaultGetRevenueInfo,
1686
+ getFees: msVaultGetFees,
1687
+ getVaultOwners: msVaultGetVaultOwners,
1688
+ isShareHolder: msVaultIsShareHolder,
1689
+ getFeeVotes: msVaultGetFeeVotes,
1690
+ getFeeVotesOwner: msVaultGetFeeVotesOwner,
1691
+ getFeeVotesScore: msVaultGetFeeVotesScore,
1692
+ getUniqueFeeVotes: msVaultGetUniqueFeeVotes,
1693
+ getUniqueFeeVotesRanking: msVaultGetUniqueFeeVotesRanking,
1694
+ getVaultAssetBalances: msVaultGetVaultAssetBalances,
1695
+ getAssetReleaseStatus: msVaultGetAssetReleaseStatus,
1696
+ getManagedAssetBalance: msVaultGetManagedAssetBalance,
1697
+ buildRegisterVaultInput: buildMsVaultRegisterVaultInput,
1698
+ decodeRegisterVaultOutput: decodeMsVaultRegisterVaultOutput,
1699
+ buildDepositInput: buildMsVaultDepositInput,
1700
+ decodeDepositOutput: decodeMsVaultDepositOutput,
1701
+ buildReleaseToInput: buildMsVaultReleaseToInput,
1702
+ decodeReleaseToOutput: decodeMsVaultReleaseToOutput,
1703
+ buildResetReleaseInput: buildMsVaultResetReleaseInput,
1704
+ decodeResetReleaseOutput: decodeMsVaultResetReleaseOutput,
1705
+ buildVoteFeeChangeInput: buildMsVaultVoteFeeChangeInput,
1706
+ decodeVoteFeeChangeOutput: decodeMsVaultVoteFeeChangeOutput,
1707
+ buildDepositAssetInput: buildMsVaultDepositAssetInput,
1708
+ decodeDepositAssetOutput: decodeMsVaultDepositAssetOutput,
1709
+ buildReleaseAssetToInput: buildMsVaultReleaseAssetToInput,
1710
+ decodeReleaseAssetToOutput: decodeMsVaultReleaseAssetToOutput,
1711
+ buildResetAssetReleaseInput: buildMsVaultResetAssetReleaseInput,
1712
+ decodeResetAssetReleaseOutput: decodeMsVaultResetAssetReleaseOutput,
1713
+ buildRevokeAssetManagementRightsInput: buildMsVaultRevokeAssetManagementRightsInput,
1714
+ decodeRevokeAssetManagementRightsOutput: decodeMsVaultRevokeAssetManagementRightsOutput,
1715
+ }
1716
+