@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,480 @@
1
+ {
2
+ "contractName": "QTF",
3
+ "contractIndex": 22,
4
+ "filename": "QThirtyFour.h",
5
+ "address": "WAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVDQA",
6
+ "entries": [
7
+ {
8
+ "kind": "function",
9
+ "name": "GetTicketPrice",
10
+ "inputType": 1,
11
+ "inputTypeName": "GetTicketPrice_input",
12
+ "outputTypeName": "GetTicketPrice_output"
13
+ },
14
+ {
15
+ "kind": "function",
16
+ "name": "GetNextEpochData",
17
+ "inputType": 2,
18
+ "inputTypeName": "GetNextEpochData_input",
19
+ "outputTypeName": "GetNextEpochData_output"
20
+ },
21
+ {
22
+ "kind": "function",
23
+ "name": "GetWinnerData",
24
+ "inputType": 3,
25
+ "inputTypeName": "GetWinnerData_input",
26
+ "outputTypeName": "GetWinnerData_output"
27
+ },
28
+ {
29
+ "kind": "function",
30
+ "name": "GetPools",
31
+ "inputType": 4,
32
+ "inputTypeName": "GetPools_input",
33
+ "outputTypeName": "GetPools_output"
34
+ },
35
+ {
36
+ "kind": "function",
37
+ "name": "GetSchedule",
38
+ "inputType": 5,
39
+ "inputTypeName": "GetSchedule_input",
40
+ "outputTypeName": "GetSchedule_output"
41
+ },
42
+ {
43
+ "kind": "function",
44
+ "name": "GetDrawHour",
45
+ "inputType": 6,
46
+ "inputTypeName": "GetDrawHour_input",
47
+ "outputTypeName": "GetDrawHour_output"
48
+ },
49
+ {
50
+ "kind": "function",
51
+ "name": "GetState",
52
+ "inputType": 7,
53
+ "inputTypeName": "GetState_input",
54
+ "outputTypeName": "GetState_output"
55
+ },
56
+ {
57
+ "kind": "function",
58
+ "name": "GetFees",
59
+ "inputType": 8,
60
+ "inputTypeName": "GetFees_input",
61
+ "outputTypeName": "GetFees_output"
62
+ },
63
+ {
64
+ "kind": "function",
65
+ "name": "EstimatePrizePayouts",
66
+ "inputType": 9,
67
+ "inputTypeName": "EstimatePrizePayouts_input",
68
+ "outputTypeName": "EstimatePrizePayouts_output"
69
+ },
70
+ {
71
+ "kind": "procedure",
72
+ "name": "BuyTicket",
73
+ "inputType": 1,
74
+ "inputTypeName": "BuyTicket_input",
75
+ "outputTypeName": "BuyTicket_output"
76
+ },
77
+ {
78
+ "kind": "procedure",
79
+ "name": "SetPrice",
80
+ "inputType": 2,
81
+ "inputTypeName": "SetPrice_input",
82
+ "outputTypeName": "SetPrice_output"
83
+ },
84
+ {
85
+ "kind": "procedure",
86
+ "name": "SetSchedule",
87
+ "inputType": 3,
88
+ "inputTypeName": "SetSchedule_input",
89
+ "outputTypeName": "SetSchedule_output"
90
+ },
91
+ {
92
+ "kind": "procedure",
93
+ "name": "SetTargetJackpot",
94
+ "inputType": 4,
95
+ "inputTypeName": "SetTargetJackpot_input",
96
+ "outputTypeName": "SetTargetJackpot_output"
97
+ },
98
+ {
99
+ "kind": "procedure",
100
+ "name": "SetDrawHour",
101
+ "inputType": 5,
102
+ "inputTypeName": "SetDrawHour_input",
103
+ "outputTypeName": "SetDrawHour_output"
104
+ }
105
+ ],
106
+ "ioTypes": [
107
+ {
108
+ "kind": "struct",
109
+ "name": "BuyTicket_input",
110
+ "fields": [
111
+ {
112
+ "name": "randomValues",
113
+ "type": "Array<uint8, QTF_RANDOM_VALUES_COUNT>"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "kind": "struct",
119
+ "name": "BuyTicket_output",
120
+ "fields": [
121
+ {
122
+ "name": "returnCode",
123
+ "type": "uint8"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "kind": "struct",
129
+ "name": "EstimatePrizePayouts_input",
130
+ "fields": [
131
+ {
132
+ "name": "k2WinnerCount",
133
+ "type": "uint64"
134
+ },
135
+ {
136
+ "name": "k3WinnerCount",
137
+ "type": "uint64"
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "kind": "struct",
143
+ "name": "EstimatePrizePayouts_output",
144
+ "fields": [
145
+ {
146
+ "name": "k2PayoutPerWinner",
147
+ "type": "uint64"
148
+ },
149
+ {
150
+ "name": "k3PayoutPerWinner",
151
+ "type": "uint64"
152
+ },
153
+ {
154
+ "name": "k2MinFloor",
155
+ "type": "uint64"
156
+ },
157
+ {
158
+ "name": "k3MinFloor",
159
+ "type": "uint64"
160
+ },
161
+ {
162
+ "name": "perWinnerCap",
163
+ "type": "uint64"
164
+ },
165
+ {
166
+ "name": "totalRevenue",
167
+ "type": "uint64"
168
+ },
169
+ {
170
+ "name": "k2Pool",
171
+ "type": "uint64"
172
+ },
173
+ {
174
+ "name": "k3Pool",
175
+ "type": "uint64"
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "kind": "struct",
181
+ "name": "GetDrawHour_input",
182
+ "fields": []
183
+ },
184
+ {
185
+ "kind": "struct",
186
+ "name": "GetDrawHour_output",
187
+ "fields": [
188
+ {
189
+ "name": "drawHour",
190
+ "type": "uint8"
191
+ }
192
+ ]
193
+ },
194
+ {
195
+ "kind": "struct",
196
+ "name": "GetFees_input",
197
+ "fields": []
198
+ },
199
+ {
200
+ "kind": "struct",
201
+ "name": "GetFees_output",
202
+ "fields": [
203
+ {
204
+ "name": "teamFeePercent",
205
+ "type": "uint8"
206
+ },
207
+ {
208
+ "name": "distributionFeePercent",
209
+ "type": "uint8"
210
+ },
211
+ {
212
+ "name": "winnerFeePercent",
213
+ "type": "uint8"
214
+ },
215
+ {
216
+ "name": "burnPercent",
217
+ "type": "uint8"
218
+ },
219
+ {
220
+ "name": "returnCode",
221
+ "type": "uint8"
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ "kind": "struct",
227
+ "name": "GetNextEpochData_input",
228
+ "fields": []
229
+ },
230
+ {
231
+ "kind": "struct",
232
+ "name": "GetNextEpochData_output",
233
+ "fields": [
234
+ {
235
+ "name": "nextEpochData",
236
+ "type": "NextEpochData"
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "kind": "struct",
242
+ "name": "GetPools_input",
243
+ "fields": []
244
+ },
245
+ {
246
+ "kind": "struct",
247
+ "name": "GetPools_output",
248
+ "fields": [
249
+ {
250
+ "name": "pools",
251
+ "type": "PoolsSnapshot"
252
+ }
253
+ ]
254
+ },
255
+ {
256
+ "kind": "struct",
257
+ "name": "GetSchedule_input",
258
+ "fields": []
259
+ },
260
+ {
261
+ "kind": "struct",
262
+ "name": "GetSchedule_output",
263
+ "fields": [
264
+ {
265
+ "name": "schedule",
266
+ "type": "uint8"
267
+ }
268
+ ]
269
+ },
270
+ {
271
+ "kind": "struct",
272
+ "name": "GetState_input",
273
+ "fields": []
274
+ },
275
+ {
276
+ "kind": "struct",
277
+ "name": "GetState_output",
278
+ "fields": [
279
+ {
280
+ "name": "currentState",
281
+ "type": "uint8"
282
+ }
283
+ ]
284
+ },
285
+ {
286
+ "kind": "struct",
287
+ "name": "GetTicketPrice_input",
288
+ "fields": []
289
+ },
290
+ {
291
+ "kind": "struct",
292
+ "name": "GetTicketPrice_output",
293
+ "fields": [
294
+ {
295
+ "name": "ticketPrice",
296
+ "type": "uint64"
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ "kind": "struct",
302
+ "name": "GetWinnerData_input",
303
+ "fields": []
304
+ },
305
+ {
306
+ "kind": "struct",
307
+ "name": "GetWinnerData_output",
308
+ "fields": [
309
+ {
310
+ "name": "winnerData",
311
+ "type": "WinnerData"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "kind": "struct",
317
+ "name": "NextEpochData",
318
+ "fields": [
319
+ {
320
+ "name": "newTicketPrice",
321
+ "type": "uint64"
322
+ },
323
+ {
324
+ "name": "newTargetJackpot",
325
+ "type": "uint64"
326
+ },
327
+ {
328
+ "name": "newSchedule",
329
+ "type": "uint8"
330
+ },
331
+ {
332
+ "name": "newDrawHour",
333
+ "type": "uint8"
334
+ }
335
+ ]
336
+ },
337
+ {
338
+ "kind": "struct",
339
+ "name": "PlayerData",
340
+ "fields": [
341
+ {
342
+ "name": "player",
343
+ "type": "id"
344
+ },
345
+ {
346
+ "name": "randomValues",
347
+ "type": "Array<uint8, QTF_RANDOM_VALUES_COUNT>"
348
+ }
349
+ ]
350
+ },
351
+ {
352
+ "kind": "struct",
353
+ "name": "PoolsSnapshot",
354
+ "fields": [
355
+ {
356
+ "name": "jackpot",
357
+ "type": "uint64"
358
+ },
359
+ {
360
+ "name": "reserve",
361
+ "type": "uint64"
362
+ },
363
+ {
364
+ "name": "targetJackpot",
365
+ "type": "uint64"
366
+ },
367
+ {
368
+ "name": "frActive",
369
+ "type": "uint8"
370
+ },
371
+ {
372
+ "name": "roundsSinceK4",
373
+ "type": "uint16"
374
+ }
375
+ ]
376
+ },
377
+ {
378
+ "kind": "struct",
379
+ "name": "SetDrawHour_input",
380
+ "fields": [
381
+ {
382
+ "name": "newDrawHour",
383
+ "type": "uint8"
384
+ }
385
+ ]
386
+ },
387
+ {
388
+ "kind": "struct",
389
+ "name": "SetDrawHour_output",
390
+ "fields": [
391
+ {
392
+ "name": "returnCode",
393
+ "type": "uint8"
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "kind": "struct",
399
+ "name": "SetPrice_input",
400
+ "fields": [
401
+ {
402
+ "name": "newPrice",
403
+ "type": "uint64"
404
+ }
405
+ ]
406
+ },
407
+ {
408
+ "kind": "struct",
409
+ "name": "SetPrice_output",
410
+ "fields": [
411
+ {
412
+ "name": "returnCode",
413
+ "type": "uint8"
414
+ }
415
+ ]
416
+ },
417
+ {
418
+ "kind": "struct",
419
+ "name": "SetSchedule_input",
420
+ "fields": [
421
+ {
422
+ "name": "newSchedule",
423
+ "type": "uint8"
424
+ }
425
+ ]
426
+ },
427
+ {
428
+ "kind": "struct",
429
+ "name": "SetSchedule_output",
430
+ "fields": [
431
+ {
432
+ "name": "returnCode",
433
+ "type": "uint8"
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "kind": "struct",
439
+ "name": "SetTargetJackpot_input",
440
+ "fields": [
441
+ {
442
+ "name": "newTargetJackpot",
443
+ "type": "uint64"
444
+ }
445
+ ]
446
+ },
447
+ {
448
+ "kind": "struct",
449
+ "name": "SetTargetJackpot_output",
450
+ "fields": [
451
+ {
452
+ "name": "returnCode",
453
+ "type": "uint8"
454
+ }
455
+ ]
456
+ },
457
+ {
458
+ "kind": "struct",
459
+ "name": "WinnerData",
460
+ "fields": [
461
+ {
462
+ "name": "winners",
463
+ "type": "Array<PlayerData, QTF_MAX_NUMBER_OF_PLAYERS>"
464
+ },
465
+ {
466
+ "name": "winnerValues",
467
+ "type": "Array<uint8, QTF_RANDOM_VALUES_COUNT>"
468
+ },
469
+ {
470
+ "name": "winnerCounter",
471
+ "type": "uint64"
472
+ },
473
+ {
474
+ "name": "epoch",
475
+ "type": "uint16"
476
+ }
477
+ ]
478
+ }
479
+ ]
480
+ }