@qubic.ts/contracts 0.1.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 (83) hide show
  1. package/package.json +17 -0
  2. package/scripts/generate-artifacts.ts +178 -0
  3. package/src/codec/entry-input.test.ts +198 -0
  4. package/src/codec/entry-input.ts +959 -0
  5. package/src/codec/index.ts +8 -0
  6. package/src/generated/contracts/CCF.registry.json +741 -0
  7. package/src/generated/contracts/CCF.types.ts +307 -0
  8. package/src/generated/contracts/GQMPROP.registry.json +518 -0
  9. package/src/generated/contracts/GQMPROP.types.ts +238 -0
  10. package/src/generated/contracts/MLM.registry.json +8 -0
  11. package/src/generated/contracts/MLM.types.ts +42 -0
  12. package/src/generated/contracts/MSVAULT.registry.json +1162 -0
  13. package/src/generated/contracts/MSVAULT.types.ts +598 -0
  14. package/src/generated/contracts/NOST.registry.json +1131 -0
  15. package/src/generated/contracts/NOST.types.ts +515 -0
  16. package/src/generated/contracts/QBAY.registry.json +1492 -0
  17. package/src/generated/contracts/QBAY.types.ts +681 -0
  18. package/src/generated/contracts/QBOND.registry.json +734 -0
  19. package/src/generated/contracts/QBOND.types.ts +397 -0
  20. package/src/generated/contracts/QDRAW.registry.json +112 -0
  21. package/src/generated/contracts/QDRAW.types.ts +110 -0
  22. package/src/generated/contracts/QDUEL.registry.json +466 -0
  23. package/src/generated/contracts/QDUEL.types.ts +265 -0
  24. package/src/generated/contracts/QEARN.registry.json +458 -0
  25. package/src/generated/contracts/QEARN.types.ts +265 -0
  26. package/src/generated/contracts/QIP.registry.json +483 -0
  27. package/src/generated/contracts/QIP.types.ts +194 -0
  28. package/src/generated/contracts/QRAFFLE.registry.json +916 -0
  29. package/src/generated/contracts/QRAFFLE.types.ts +446 -0
  30. package/src/generated/contracts/QRP.registry.json +139 -0
  31. package/src/generated/contracts/QRP.types.ts +144 -0
  32. package/src/generated/contracts/QRWA.registry.json +765 -0
  33. package/src/generated/contracts/QRWA.types.ts +402 -0
  34. package/src/generated/contracts/QSWAP.registry.json +941 -0
  35. package/src/generated/contracts/QSWAP.types.ts +479 -0
  36. package/src/generated/contracts/QTF.registry.json +480 -0
  37. package/src/generated/contracts/QTF.types.ts +346 -0
  38. package/src/generated/contracts/QUOTTERY.registry.json +530 -0
  39. package/src/generated/contracts/QUOTTERY.types.ts +262 -0
  40. package/src/generated/contracts/QUTIL.registry.json +1378 -0
  41. package/src/generated/contracts/QUTIL.types.ts +612 -0
  42. package/src/generated/contracts/QVAULT.registry.json +527 -0
  43. package/src/generated/contracts/QVAULT.types.ts +309 -0
  44. package/src/generated/contracts/QX.registry.json +610 -0
  45. package/src/generated/contracts/QX.types.ts +323 -0
  46. package/src/generated/contracts/RANDOM.registry.json +51 -0
  47. package/src/generated/contracts/RANDOM.types.ts +65 -0
  48. package/src/generated/contracts/RL.registry.json +490 -0
  49. package/src/generated/contracts/RL.types.ts +304 -0
  50. package/src/generated/contracts/SWATCH.registry.json +8 -0
  51. package/src/generated/contracts/SWATCH.types.ts +42 -0
  52. package/src/generated/core-registry.codecs.ts +6622 -0
  53. package/src/generated/core-registry.source.json +14342 -0
  54. package/src/generated/core-registry.ts +14349 -0
  55. package/src/generated/core-registry.types.ts +100 -0
  56. package/src/generator/contract-codecs.fixture.test.ts +17 -0
  57. package/src/generator/contract-codecs.test.ts +115 -0
  58. package/src/generator/contract-codecs.ts +416 -0
  59. package/src/generator/index.ts +14 -0
  60. package/src/generator/per-contract-files.test.ts +70 -0
  61. package/src/generator/per-contract-files.ts +122 -0
  62. package/src/generator/registry-runtime.fixture.test.ts +17 -0
  63. package/src/generator/registry-runtime.test.ts +55 -0
  64. package/src/generator/registry-runtime.ts +28 -0
  65. package/src/generator/registry-types.fixture.test.ts +17 -0
  66. package/src/generator/registry-types.test.ts +55 -0
  67. package/src/generator/registry-types.ts +75 -0
  68. package/src/index.test.ts +29 -0
  69. package/src/index.ts +49 -0
  70. package/src/registry/index.ts +17 -0
  71. package/src/registry/io-layout.fixture.test.ts +24 -0
  72. package/src/registry/io-layout.test.ts +93 -0
  73. package/src/registry/io-layout.ts +57 -0
  74. package/src/registry/normalize.ts +61 -0
  75. package/src/registry/schema.fixture.test.ts +21 -0
  76. package/src/registry/schema.ts +97 -0
  77. package/src/registry/types.ts +98 -0
  78. package/test/fixtures/io-layout.contracts.json +32 -0
  79. package/test/fixtures/io-layout.layouts.json +14 -0
  80. package/test/fixtures/registry.sample.codecs.ts +100 -0
  81. package/test/fixtures/registry.sample.json +27 -0
  82. package/test/fixtures/registry.sample.runtime.ts +54 -0
  83. package/test/fixtures/registry.sample.types.ts +16 -0
@@ -0,0 +1,309 @@
1
+ /* eslint-disable */
2
+ /* This file is generated. Do not edit manually. */
3
+
4
+ export type QVAULT_changeAdminAddress_input = {
5
+ readonly newAddress: string;
6
+ };
7
+ export type QVAULT_changeAdminAddress_output = Record<string, never>;
8
+ export type QVAULT_changeAuthAddress_input = {
9
+ readonly numberOfChangedAddress: number;
10
+ };
11
+ export type QVAULT_changeAuthAddress_output = Record<string, never>;
12
+ export type QVAULT_changeDistributionPermille_input = {
13
+ readonly newQCAPHolderPermille: number;
14
+ readonly newReinvestingPermille: number;
15
+ readonly newDevPermille: number;
16
+ };
17
+ export type QVAULT_changeDistributionPermille_output = Record<string, never>;
18
+ export type QVAULT_changeReinvestingAddress_input = {
19
+ readonly newAddress: string;
20
+ };
21
+ export type QVAULT_changeReinvestingAddress_output = Record<string, never>;
22
+ export type QVAULT_getData_input = Record<string, never>;
23
+ export type QVAULT_getData_output = {
24
+ readonly numberOfBannedAddress: bigint;
25
+ readonly shareholderDividend: number;
26
+ readonly QCAPHolderPermille: number;
27
+ readonly reinvestingPermille: number;
28
+ readonly devPermille: number;
29
+ readonly authAddress1: string;
30
+ readonly authAddress2: string;
31
+ readonly authAddress3: string;
32
+ readonly reinvestingAddress: string;
33
+ readonly adminAddress: string;
34
+ readonly newAuthAddress1: string;
35
+ readonly newAuthAddress2: string;
36
+ readonly newAuthAddress3: string;
37
+ readonly newReinvestingAddress1: string;
38
+ readonly newReinvestingAddress2: string;
39
+ readonly newReinvestingAddress3: string;
40
+ readonly newAdminAddress1: string;
41
+ readonly newAdminAddress2: string;
42
+ readonly newAdminAddress3: string;
43
+ readonly bannedAddress1: string;
44
+ readonly bannedAddress2: string;
45
+ readonly bannedAddress3: string;
46
+ readonly unbannedAddress1: string;
47
+ readonly unbannedAddress2: string;
48
+ readonly unbannedAddress3: string;
49
+ };
50
+ export type QVAULT_saveBannedAddress_input = {
51
+ readonly bannedAddress: string;
52
+ };
53
+ export type QVAULT_saveBannedAddress_output = Record<string, never>;
54
+ export type QVAULT_submitAdminAddress_input = {
55
+ readonly newAddress: string;
56
+ };
57
+ export type QVAULT_submitAdminAddress_output = Record<string, never>;
58
+ export type QVAULT_submitAuthAddress_input = {
59
+ readonly newAddress: string;
60
+ };
61
+ export type QVAULT_submitAuthAddress_output = Record<string, never>;
62
+ export type QVAULT_submitBannedAddress_input = {
63
+ readonly bannedAddress: string;
64
+ };
65
+ export type QVAULT_submitBannedAddress_output = Record<string, never>;
66
+ export type QVAULT_submitDistributionPermille_input = {
67
+ readonly newQCAPHolderPermille: number;
68
+ readonly newReinvestingPermille: number;
69
+ readonly newDevPermille: number;
70
+ };
71
+ export type QVAULT_submitDistributionPermille_output = Record<string, never>;
72
+ export type QVAULT_submitReinvestingAddress_input = {
73
+ readonly newAddress: string;
74
+ };
75
+ export type QVAULT_submitReinvestingAddress_output = Record<string, never>;
76
+ export type QVAULT_submitUnbannedAddress_input = {
77
+ readonly unbannedAddress: string;
78
+ };
79
+ export type QVAULT_submitUnbannedAddress_output = Record<string, never>;
80
+ export type QVAULT_unblockBannedAddress_input = {
81
+ readonly unbannedAddress: string;
82
+ };
83
+ export type QVAULT_unblockBannedAddress_output = Record<string, never>;
84
+
85
+ export interface ContractTypeMap {
86
+ QVAULT: {
87
+ readonly contractIndex: 10;
88
+ readonly functions: {
89
+ getData: {
90
+ readonly kind: "function";
91
+ readonly inputType: 1;
92
+ readonly inputTypeName: "getData_input";
93
+ readonly outputTypeName: "getData_output";
94
+ readonly input: QVAULT_getData_input;
95
+ readonly output: QVAULT_getData_output;
96
+ };
97
+ };
98
+ readonly procedures: {
99
+ submitAuthAddress: {
100
+ readonly kind: "procedure";
101
+ readonly inputType: 1;
102
+ readonly inputTypeName: "submitAuthAddress_input";
103
+ readonly outputTypeName: "submitAuthAddress_output";
104
+ readonly input: QVAULT_submitAuthAddress_input;
105
+ readonly output: QVAULT_submitAuthAddress_output;
106
+ };
107
+ changeAuthAddress: {
108
+ readonly kind: "procedure";
109
+ readonly inputType: 2;
110
+ readonly inputTypeName: "changeAuthAddress_input";
111
+ readonly outputTypeName: "changeAuthAddress_output";
112
+ readonly input: QVAULT_changeAuthAddress_input;
113
+ readonly output: QVAULT_changeAuthAddress_output;
114
+ };
115
+ submitDistributionPermille: {
116
+ readonly kind: "procedure";
117
+ readonly inputType: 3;
118
+ readonly inputTypeName: "submitDistributionPermille_input";
119
+ readonly outputTypeName: "submitDistributionPermille_output";
120
+ readonly input: QVAULT_submitDistributionPermille_input;
121
+ readonly output: QVAULT_submitDistributionPermille_output;
122
+ };
123
+ changeDistributionPermille: {
124
+ readonly kind: "procedure";
125
+ readonly inputType: 4;
126
+ readonly inputTypeName: "changeDistributionPermille_input";
127
+ readonly outputTypeName: "changeDistributionPermille_output";
128
+ readonly input: QVAULT_changeDistributionPermille_input;
129
+ readonly output: QVAULT_changeDistributionPermille_output;
130
+ };
131
+ submitReinvestingAddress: {
132
+ readonly kind: "procedure";
133
+ readonly inputType: 5;
134
+ readonly inputTypeName: "submitReinvestingAddress_input";
135
+ readonly outputTypeName: "submitReinvestingAddress_output";
136
+ readonly input: QVAULT_submitReinvestingAddress_input;
137
+ readonly output: QVAULT_submitReinvestingAddress_output;
138
+ };
139
+ changeReinvestingAddress: {
140
+ readonly kind: "procedure";
141
+ readonly inputType: 6;
142
+ readonly inputTypeName: "changeReinvestingAddress_input";
143
+ readonly outputTypeName: "changeReinvestingAddress_output";
144
+ readonly input: QVAULT_changeReinvestingAddress_input;
145
+ readonly output: QVAULT_changeReinvestingAddress_output;
146
+ };
147
+ submitAdminAddress: {
148
+ readonly kind: "procedure";
149
+ readonly inputType: 7;
150
+ readonly inputTypeName: "submitAdminAddress_input";
151
+ readonly outputTypeName: "submitAdminAddress_output";
152
+ readonly input: QVAULT_submitAdminAddress_input;
153
+ readonly output: QVAULT_submitAdminAddress_output;
154
+ };
155
+ changeAdminAddress: {
156
+ readonly kind: "procedure";
157
+ readonly inputType: 8;
158
+ readonly inputTypeName: "changeAdminAddress_input";
159
+ readonly outputTypeName: "changeAdminAddress_output";
160
+ readonly input: QVAULT_changeAdminAddress_input;
161
+ readonly output: QVAULT_changeAdminAddress_output;
162
+ };
163
+ submitBannedAddress: {
164
+ readonly kind: "procedure";
165
+ readonly inputType: 9;
166
+ readonly inputTypeName: "submitBannedAddress_input";
167
+ readonly outputTypeName: "submitBannedAddress_output";
168
+ readonly input: QVAULT_submitBannedAddress_input;
169
+ readonly output: QVAULT_submitBannedAddress_output;
170
+ };
171
+ saveBannedAddress: {
172
+ readonly kind: "procedure";
173
+ readonly inputType: 10;
174
+ readonly inputTypeName: "saveBannedAddress_input";
175
+ readonly outputTypeName: "saveBannedAddress_output";
176
+ readonly input: QVAULT_saveBannedAddress_input;
177
+ readonly output: QVAULT_saveBannedAddress_output;
178
+ };
179
+ submitUnbannedAddress: {
180
+ readonly kind: "procedure";
181
+ readonly inputType: 11;
182
+ readonly inputTypeName: "submitUnbannedAddress_input";
183
+ readonly outputTypeName: "submitUnbannedAddress_output";
184
+ readonly input: QVAULT_submitUnbannedAddress_input;
185
+ readonly output: QVAULT_submitUnbannedAddress_output;
186
+ };
187
+ unblockBannedAddress: {
188
+ readonly kind: "procedure";
189
+ readonly inputType: 12;
190
+ readonly inputTypeName: "unblockBannedAddress_input";
191
+ readonly outputTypeName: "unblockBannedAddress_output";
192
+ readonly input: QVAULT_unblockBannedAddress_input;
193
+ readonly output: QVAULT_unblockBannedAddress_output;
194
+ };
195
+ };
196
+ };
197
+ }
198
+
199
+ export type ContractName = keyof ContractTypeMap & string;
200
+ export type FunctionName<C extends ContractName> = keyof ContractTypeMap[C]["functions"] & string;
201
+ export type ProcedureName<C extends ContractName> = keyof ContractTypeMap[C]["procedures"] & string;
202
+
203
+ export type FunctionInput<
204
+ C extends ContractName,
205
+ F extends FunctionName<C>,
206
+ > = ContractTypeMap[C]["functions"][F]["input"];
207
+ export type FunctionOutput<
208
+ C extends ContractName,
209
+ F extends FunctionName<C>,
210
+ > = ContractTypeMap[C]["functions"][F]["output"];
211
+
212
+ export type ProcedureInput<
213
+ C extends ContractName,
214
+ P extends ProcedureName<C>,
215
+ > = ContractTypeMap[C]["procedures"][P]["input"];
216
+ export type ProcedureOutput<
217
+ C extends ContractName,
218
+ P extends ProcedureName<C>,
219
+ > = ContractTypeMap[C]["procedures"][P]["output"];
220
+
221
+ export const contractCodecRegistry = {
222
+ QVAULT: {
223
+ contractIndex: 10,
224
+ functions: {
225
+ getData: {
226
+ kind: "function",
227
+ inputType: 1,
228
+ inputTypeName: "getData_input",
229
+ outputTypeName: "getData_output",
230
+ },
231
+ },
232
+ procedures: {
233
+ submitAuthAddress: {
234
+ kind: "procedure",
235
+ inputType: 1,
236
+ inputTypeName: "submitAuthAddress_input",
237
+ outputTypeName: "submitAuthAddress_output",
238
+ },
239
+ changeAuthAddress: {
240
+ kind: "procedure",
241
+ inputType: 2,
242
+ inputTypeName: "changeAuthAddress_input",
243
+ outputTypeName: "changeAuthAddress_output",
244
+ },
245
+ submitDistributionPermille: {
246
+ kind: "procedure",
247
+ inputType: 3,
248
+ inputTypeName: "submitDistributionPermille_input",
249
+ outputTypeName: "submitDistributionPermille_output",
250
+ },
251
+ changeDistributionPermille: {
252
+ kind: "procedure",
253
+ inputType: 4,
254
+ inputTypeName: "changeDistributionPermille_input",
255
+ outputTypeName: "changeDistributionPermille_output",
256
+ },
257
+ submitReinvestingAddress: {
258
+ kind: "procedure",
259
+ inputType: 5,
260
+ inputTypeName: "submitReinvestingAddress_input",
261
+ outputTypeName: "submitReinvestingAddress_output",
262
+ },
263
+ changeReinvestingAddress: {
264
+ kind: "procedure",
265
+ inputType: 6,
266
+ inputTypeName: "changeReinvestingAddress_input",
267
+ outputTypeName: "changeReinvestingAddress_output",
268
+ },
269
+ submitAdminAddress: {
270
+ kind: "procedure",
271
+ inputType: 7,
272
+ inputTypeName: "submitAdminAddress_input",
273
+ outputTypeName: "submitAdminAddress_output",
274
+ },
275
+ changeAdminAddress: {
276
+ kind: "procedure",
277
+ inputType: 8,
278
+ inputTypeName: "changeAdminAddress_input",
279
+ outputTypeName: "changeAdminAddress_output",
280
+ },
281
+ submitBannedAddress: {
282
+ kind: "procedure",
283
+ inputType: 9,
284
+ inputTypeName: "submitBannedAddress_input",
285
+ outputTypeName: "submitBannedAddress_output",
286
+ },
287
+ saveBannedAddress: {
288
+ kind: "procedure",
289
+ inputType: 10,
290
+ inputTypeName: "saveBannedAddress_input",
291
+ outputTypeName: "saveBannedAddress_output",
292
+ },
293
+ submitUnbannedAddress: {
294
+ kind: "procedure",
295
+ inputType: 11,
296
+ inputTypeName: "submitUnbannedAddress_input",
297
+ outputTypeName: "submitUnbannedAddress_output",
298
+ },
299
+ unblockBannedAddress: {
300
+ kind: "procedure",
301
+ inputType: 12,
302
+ inputTypeName: "unblockBannedAddress_input",
303
+ outputTypeName: "unblockBannedAddress_output",
304
+ },
305
+ },
306
+ },
307
+ } as const satisfies Readonly<Record<ContractName, unknown>>;
308
+
309
+ export type RuntimeContractCodecRegistry = typeof contractCodecRegistry;