@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.
- package/package.json +17 -0
- package/scripts/generate-artifacts.ts +178 -0
- package/src/codec/entry-input.test.ts +198 -0
- package/src/codec/entry-input.ts +959 -0
- package/src/codec/index.ts +8 -0
- package/src/generated/contracts/CCF.registry.json +741 -0
- package/src/generated/contracts/CCF.types.ts +307 -0
- package/src/generated/contracts/GQMPROP.registry.json +518 -0
- package/src/generated/contracts/GQMPROP.types.ts +238 -0
- package/src/generated/contracts/MLM.registry.json +8 -0
- package/src/generated/contracts/MLM.types.ts +42 -0
- package/src/generated/contracts/MSVAULT.registry.json +1162 -0
- package/src/generated/contracts/MSVAULT.types.ts +598 -0
- package/src/generated/contracts/NOST.registry.json +1131 -0
- package/src/generated/contracts/NOST.types.ts +515 -0
- package/src/generated/contracts/QBAY.registry.json +1492 -0
- package/src/generated/contracts/QBAY.types.ts +681 -0
- package/src/generated/contracts/QBOND.registry.json +734 -0
- package/src/generated/contracts/QBOND.types.ts +397 -0
- package/src/generated/contracts/QDRAW.registry.json +112 -0
- package/src/generated/contracts/QDRAW.types.ts +110 -0
- package/src/generated/contracts/QDUEL.registry.json +466 -0
- package/src/generated/contracts/QDUEL.types.ts +265 -0
- package/src/generated/contracts/QEARN.registry.json +458 -0
- package/src/generated/contracts/QEARN.types.ts +265 -0
- package/src/generated/contracts/QIP.registry.json +483 -0
- package/src/generated/contracts/QIP.types.ts +194 -0
- package/src/generated/contracts/QRAFFLE.registry.json +916 -0
- package/src/generated/contracts/QRAFFLE.types.ts +446 -0
- package/src/generated/contracts/QRP.registry.json +139 -0
- package/src/generated/contracts/QRP.types.ts +144 -0
- package/src/generated/contracts/QRWA.registry.json +765 -0
- package/src/generated/contracts/QRWA.types.ts +402 -0
- package/src/generated/contracts/QSWAP.registry.json +941 -0
- package/src/generated/contracts/QSWAP.types.ts +479 -0
- package/src/generated/contracts/QTF.registry.json +480 -0
- package/src/generated/contracts/QTF.types.ts +346 -0
- package/src/generated/contracts/QUOTTERY.registry.json +530 -0
- package/src/generated/contracts/QUOTTERY.types.ts +262 -0
- package/src/generated/contracts/QUTIL.registry.json +1378 -0
- package/src/generated/contracts/QUTIL.types.ts +612 -0
- package/src/generated/contracts/QVAULT.registry.json +527 -0
- package/src/generated/contracts/QVAULT.types.ts +309 -0
- package/src/generated/contracts/QX.registry.json +610 -0
- package/src/generated/contracts/QX.types.ts +323 -0
- package/src/generated/contracts/RANDOM.registry.json +51 -0
- package/src/generated/contracts/RANDOM.types.ts +65 -0
- package/src/generated/contracts/RL.registry.json +490 -0
- package/src/generated/contracts/RL.types.ts +304 -0
- package/src/generated/contracts/SWATCH.registry.json +8 -0
- package/src/generated/contracts/SWATCH.types.ts +42 -0
- package/src/generated/core-registry.codecs.ts +6622 -0
- package/src/generated/core-registry.source.json +14342 -0
- package/src/generated/core-registry.ts +14349 -0
- package/src/generated/core-registry.types.ts +100 -0
- package/src/generator/contract-codecs.fixture.test.ts +17 -0
- package/src/generator/contract-codecs.test.ts +115 -0
- package/src/generator/contract-codecs.ts +416 -0
- package/src/generator/index.ts +14 -0
- package/src/generator/per-contract-files.test.ts +70 -0
- package/src/generator/per-contract-files.ts +122 -0
- package/src/generator/registry-runtime.fixture.test.ts +17 -0
- package/src/generator/registry-runtime.test.ts +55 -0
- package/src/generator/registry-runtime.ts +28 -0
- package/src/generator/registry-types.fixture.test.ts +17 -0
- package/src/generator/registry-types.test.ts +55 -0
- package/src/generator/registry-types.ts +75 -0
- package/src/index.test.ts +29 -0
- package/src/index.ts +49 -0
- package/src/registry/index.ts +17 -0
- package/src/registry/io-layout.fixture.test.ts +24 -0
- package/src/registry/io-layout.test.ts +93 -0
- package/src/registry/io-layout.ts +57 -0
- package/src/registry/normalize.ts +61 -0
- package/src/registry/schema.fixture.test.ts +21 -0
- package/src/registry/schema.ts +97 -0
- package/src/registry/types.ts +98 -0
- package/test/fixtures/io-layout.contracts.json +32 -0
- package/test/fixtures/io-layout.layouts.json +14 -0
- package/test/fixtures/registry.sample.codecs.ts +100 -0
- package/test/fixtures/registry.sample.json +27 -0
- package/test/fixtures/registry.sample.runtime.ts +54 -0
- package/test/fixtures/registry.sample.types.ts +16 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* This file is generated. Do not edit manually. */
|
|
3
|
+
|
|
4
|
+
export type QBOND_AddAskOrder_input = {
|
|
5
|
+
readonly epoch: bigint;
|
|
6
|
+
readonly price: bigint;
|
|
7
|
+
readonly numberOfMBonds: bigint;
|
|
8
|
+
};
|
|
9
|
+
export type QBOND_AddAskOrder_output = {
|
|
10
|
+
readonly addedMBondsAmount: bigint;
|
|
11
|
+
};
|
|
12
|
+
export type QBOND_AddBidOrder_input = {
|
|
13
|
+
readonly epoch: bigint;
|
|
14
|
+
readonly price: bigint;
|
|
15
|
+
readonly numberOfMBonds: bigint;
|
|
16
|
+
};
|
|
17
|
+
export type QBOND_AddBidOrder_output = {
|
|
18
|
+
readonly addedMBondsAmount: bigint;
|
|
19
|
+
};
|
|
20
|
+
export type QBOND_BurnQU_input = {
|
|
21
|
+
readonly amount: bigint;
|
|
22
|
+
};
|
|
23
|
+
export type QBOND_BurnQU_output = {
|
|
24
|
+
readonly amount: bigint;
|
|
25
|
+
};
|
|
26
|
+
export type QBOND_GetCFA_input = Record<string, never>;
|
|
27
|
+
export type QBOND_GetCFA_output = {
|
|
28
|
+
readonly commissionFreeAddresses: ReadonlyArray<string>;
|
|
29
|
+
};
|
|
30
|
+
export type QBOND_GetEarnedFees_input = Record<string, never>;
|
|
31
|
+
export type QBOND_GetEarnedFees_output = {
|
|
32
|
+
readonly stakeFees: bigint;
|
|
33
|
+
readonly tradeFees: bigint;
|
|
34
|
+
};
|
|
35
|
+
export type QBOND_GetFees_input = Record<string, never>;
|
|
36
|
+
export type QBOND_GetFees_output = {
|
|
37
|
+
readonly stakeFeePercent: bigint;
|
|
38
|
+
readonly tradeFeePercent: bigint;
|
|
39
|
+
readonly transferFee: bigint;
|
|
40
|
+
};
|
|
41
|
+
export type QBOND_GetInfoPerEpoch_input = {
|
|
42
|
+
readonly epoch: bigint;
|
|
43
|
+
};
|
|
44
|
+
export type QBOND_GetInfoPerEpoch_output = {
|
|
45
|
+
readonly stakersAmount: bigint;
|
|
46
|
+
readonly totalStaked: bigint;
|
|
47
|
+
readonly apy: bigint;
|
|
48
|
+
};
|
|
49
|
+
export type QBOND_GetMBondsTable_input = Record<string, never>;
|
|
50
|
+
export type QBOND_GetMBondsTable_output = {
|
|
51
|
+
readonly info: ReadonlyArray<QBOND_TableEntry>;
|
|
52
|
+
};
|
|
53
|
+
export type QBOND_GetOrders_input = {
|
|
54
|
+
readonly epoch: bigint;
|
|
55
|
+
readonly askOrdersOffset: bigint;
|
|
56
|
+
readonly bidOrdersOffset: bigint;
|
|
57
|
+
};
|
|
58
|
+
export type QBOND_GetOrders_output = {
|
|
59
|
+
readonly askOrders: ReadonlyArray<QBOND_Order>;
|
|
60
|
+
readonly bidOrders: ReadonlyArray<QBOND_Order>;
|
|
61
|
+
};
|
|
62
|
+
export type QBOND_GetUserMBonds_input = {
|
|
63
|
+
readonly owner: string;
|
|
64
|
+
};
|
|
65
|
+
export type QBOND_GetUserMBonds_output = {
|
|
66
|
+
readonly totalMBondsAmount: bigint;
|
|
67
|
+
readonly mbonds: ReadonlyArray<QBOND_MBondEntity>;
|
|
68
|
+
};
|
|
69
|
+
export type QBOND_GetUserOrders_input = {
|
|
70
|
+
readonly owner: string;
|
|
71
|
+
readonly askOrdersOffset: bigint;
|
|
72
|
+
readonly bidOrdersOffset: bigint;
|
|
73
|
+
};
|
|
74
|
+
export type QBOND_GetUserOrders_output = {
|
|
75
|
+
readonly askOrders: ReadonlyArray<QBOND_Order>;
|
|
76
|
+
readonly bidOrders: ReadonlyArray<QBOND_Order>;
|
|
77
|
+
};
|
|
78
|
+
export type QBOND_MBondEntity = {
|
|
79
|
+
readonly epoch: bigint;
|
|
80
|
+
readonly amount: bigint;
|
|
81
|
+
readonly apy: bigint;
|
|
82
|
+
};
|
|
83
|
+
export type QBOND_Order = {
|
|
84
|
+
readonly owner: string;
|
|
85
|
+
readonly epoch: bigint;
|
|
86
|
+
readonly numberOfMBonds: bigint;
|
|
87
|
+
readonly price: bigint;
|
|
88
|
+
};
|
|
89
|
+
export type QBOND_RemoveAskOrder_input = {
|
|
90
|
+
readonly epoch: bigint;
|
|
91
|
+
readonly price: bigint;
|
|
92
|
+
readonly numberOfMBonds: bigint;
|
|
93
|
+
};
|
|
94
|
+
export type QBOND_RemoveAskOrder_output = {
|
|
95
|
+
readonly removedMBondsAmount: bigint;
|
|
96
|
+
};
|
|
97
|
+
export type QBOND_RemoveBidOrder_input = {
|
|
98
|
+
readonly epoch: bigint;
|
|
99
|
+
readonly price: bigint;
|
|
100
|
+
readonly numberOfMBonds: bigint;
|
|
101
|
+
};
|
|
102
|
+
export type QBOND_RemoveBidOrder_output = {
|
|
103
|
+
readonly removedMBondsAmount: bigint;
|
|
104
|
+
};
|
|
105
|
+
export type QBOND_Stake_input = {
|
|
106
|
+
readonly quMillions: bigint;
|
|
107
|
+
};
|
|
108
|
+
export type QBOND_Stake_output = Record<string, never>;
|
|
109
|
+
export type QBOND_TableEntry = {
|
|
110
|
+
readonly epoch: bigint;
|
|
111
|
+
readonly totalStakedQBond: bigint;
|
|
112
|
+
readonly totalStakedQEarn: bigint;
|
|
113
|
+
readonly apy: bigint;
|
|
114
|
+
};
|
|
115
|
+
export type QBOND_TransferMBondOwnershipAndPossession_input = {
|
|
116
|
+
readonly newOwnerAndPossessor: string;
|
|
117
|
+
readonly epoch: bigint;
|
|
118
|
+
readonly numberOfMBonds: bigint;
|
|
119
|
+
};
|
|
120
|
+
export type QBOND_TransferMBondOwnershipAndPossession_output = {
|
|
121
|
+
readonly transferredMBonds: bigint;
|
|
122
|
+
};
|
|
123
|
+
export type QBOND_UpdateCFA_input = {
|
|
124
|
+
readonly user: string;
|
|
125
|
+
readonly operation: boolean;
|
|
126
|
+
};
|
|
127
|
+
export type QBOND_UpdateCFA_output = {
|
|
128
|
+
readonly result: boolean;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export interface ContractTypeMap {
|
|
132
|
+
QBOND: {
|
|
133
|
+
readonly contractIndex: 17;
|
|
134
|
+
readonly functions: {
|
|
135
|
+
GetFees: {
|
|
136
|
+
readonly kind: "function";
|
|
137
|
+
readonly inputType: 1;
|
|
138
|
+
readonly inputTypeName: "GetFees_input";
|
|
139
|
+
readonly outputTypeName: "GetFees_output";
|
|
140
|
+
readonly input: QBOND_GetFees_input;
|
|
141
|
+
readonly output: QBOND_GetFees_output;
|
|
142
|
+
};
|
|
143
|
+
GetEarnedFees: {
|
|
144
|
+
readonly kind: "function";
|
|
145
|
+
readonly inputType: 2;
|
|
146
|
+
readonly inputTypeName: "GetEarnedFees_input";
|
|
147
|
+
readonly outputTypeName: "GetEarnedFees_output";
|
|
148
|
+
readonly input: QBOND_GetEarnedFees_input;
|
|
149
|
+
readonly output: QBOND_GetEarnedFees_output;
|
|
150
|
+
};
|
|
151
|
+
GetInfoPerEpoch: {
|
|
152
|
+
readonly kind: "function";
|
|
153
|
+
readonly inputType: 3;
|
|
154
|
+
readonly inputTypeName: "GetInfoPerEpoch_input";
|
|
155
|
+
readonly outputTypeName: "GetInfoPerEpoch_output";
|
|
156
|
+
readonly input: QBOND_GetInfoPerEpoch_input;
|
|
157
|
+
readonly output: QBOND_GetInfoPerEpoch_output;
|
|
158
|
+
};
|
|
159
|
+
GetOrders: {
|
|
160
|
+
readonly kind: "function";
|
|
161
|
+
readonly inputType: 4;
|
|
162
|
+
readonly inputTypeName: "GetOrders_input";
|
|
163
|
+
readonly outputTypeName: "GetOrders_output";
|
|
164
|
+
readonly input: QBOND_GetOrders_input;
|
|
165
|
+
readonly output: QBOND_GetOrders_output;
|
|
166
|
+
};
|
|
167
|
+
GetUserOrders: {
|
|
168
|
+
readonly kind: "function";
|
|
169
|
+
readonly inputType: 5;
|
|
170
|
+
readonly inputTypeName: "GetUserOrders_input";
|
|
171
|
+
readonly outputTypeName: "GetUserOrders_output";
|
|
172
|
+
readonly input: QBOND_GetUserOrders_input;
|
|
173
|
+
readonly output: QBOND_GetUserOrders_output;
|
|
174
|
+
};
|
|
175
|
+
GetMBondsTable: {
|
|
176
|
+
readonly kind: "function";
|
|
177
|
+
readonly inputType: 6;
|
|
178
|
+
readonly inputTypeName: "GetMBondsTable_input";
|
|
179
|
+
readonly outputTypeName: "GetMBondsTable_output";
|
|
180
|
+
readonly input: QBOND_GetMBondsTable_input;
|
|
181
|
+
readonly output: QBOND_GetMBondsTable_output;
|
|
182
|
+
};
|
|
183
|
+
GetUserMBonds: {
|
|
184
|
+
readonly kind: "function";
|
|
185
|
+
readonly inputType: 7;
|
|
186
|
+
readonly inputTypeName: "GetUserMBonds_input";
|
|
187
|
+
readonly outputTypeName: "GetUserMBonds_output";
|
|
188
|
+
readonly input: QBOND_GetUserMBonds_input;
|
|
189
|
+
readonly output: QBOND_GetUserMBonds_output;
|
|
190
|
+
};
|
|
191
|
+
GetCFA: {
|
|
192
|
+
readonly kind: "function";
|
|
193
|
+
readonly inputType: 8;
|
|
194
|
+
readonly inputTypeName: "GetCFA_input";
|
|
195
|
+
readonly outputTypeName: "GetCFA_output";
|
|
196
|
+
readonly input: QBOND_GetCFA_input;
|
|
197
|
+
readonly output: QBOND_GetCFA_output;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
readonly procedures: {
|
|
201
|
+
Stake: {
|
|
202
|
+
readonly kind: "procedure";
|
|
203
|
+
readonly inputType: 1;
|
|
204
|
+
readonly inputTypeName: "Stake_input";
|
|
205
|
+
readonly outputTypeName: "Stake_output";
|
|
206
|
+
readonly input: QBOND_Stake_input;
|
|
207
|
+
readonly output: QBOND_Stake_output;
|
|
208
|
+
};
|
|
209
|
+
TransferMBondOwnershipAndPossession: {
|
|
210
|
+
readonly kind: "procedure";
|
|
211
|
+
readonly inputType: 2;
|
|
212
|
+
readonly inputTypeName: "TransferMBondOwnershipAndPossession_input";
|
|
213
|
+
readonly outputTypeName: "TransferMBondOwnershipAndPossession_output";
|
|
214
|
+
readonly input: QBOND_TransferMBondOwnershipAndPossession_input;
|
|
215
|
+
readonly output: QBOND_TransferMBondOwnershipAndPossession_output;
|
|
216
|
+
};
|
|
217
|
+
AddAskOrder: {
|
|
218
|
+
readonly kind: "procedure";
|
|
219
|
+
readonly inputType: 3;
|
|
220
|
+
readonly inputTypeName: "AddAskOrder_input";
|
|
221
|
+
readonly outputTypeName: "AddAskOrder_output";
|
|
222
|
+
readonly input: QBOND_AddAskOrder_input;
|
|
223
|
+
readonly output: QBOND_AddAskOrder_output;
|
|
224
|
+
};
|
|
225
|
+
RemoveAskOrder: {
|
|
226
|
+
readonly kind: "procedure";
|
|
227
|
+
readonly inputType: 4;
|
|
228
|
+
readonly inputTypeName: "RemoveAskOrder_input";
|
|
229
|
+
readonly outputTypeName: "RemoveAskOrder_output";
|
|
230
|
+
readonly input: QBOND_RemoveAskOrder_input;
|
|
231
|
+
readonly output: QBOND_RemoveAskOrder_output;
|
|
232
|
+
};
|
|
233
|
+
AddBidOrder: {
|
|
234
|
+
readonly kind: "procedure";
|
|
235
|
+
readonly inputType: 5;
|
|
236
|
+
readonly inputTypeName: "AddBidOrder_input";
|
|
237
|
+
readonly outputTypeName: "AddBidOrder_output";
|
|
238
|
+
readonly input: QBOND_AddBidOrder_input;
|
|
239
|
+
readonly output: QBOND_AddBidOrder_output;
|
|
240
|
+
};
|
|
241
|
+
RemoveBidOrder: {
|
|
242
|
+
readonly kind: "procedure";
|
|
243
|
+
readonly inputType: 6;
|
|
244
|
+
readonly inputTypeName: "RemoveBidOrder_input";
|
|
245
|
+
readonly outputTypeName: "RemoveBidOrder_output";
|
|
246
|
+
readonly input: QBOND_RemoveBidOrder_input;
|
|
247
|
+
readonly output: QBOND_RemoveBidOrder_output;
|
|
248
|
+
};
|
|
249
|
+
BurnQU: {
|
|
250
|
+
readonly kind: "procedure";
|
|
251
|
+
readonly inputType: 7;
|
|
252
|
+
readonly inputTypeName: "BurnQU_input";
|
|
253
|
+
readonly outputTypeName: "BurnQU_output";
|
|
254
|
+
readonly input: QBOND_BurnQU_input;
|
|
255
|
+
readonly output: QBOND_BurnQU_output;
|
|
256
|
+
};
|
|
257
|
+
UpdateCFA: {
|
|
258
|
+
readonly kind: "procedure";
|
|
259
|
+
readonly inputType: 8;
|
|
260
|
+
readonly inputTypeName: "UpdateCFA_input";
|
|
261
|
+
readonly outputTypeName: "UpdateCFA_output";
|
|
262
|
+
readonly input: QBOND_UpdateCFA_input;
|
|
263
|
+
readonly output: QBOND_UpdateCFA_output;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export type ContractName = keyof ContractTypeMap & string;
|
|
270
|
+
export type FunctionName<C extends ContractName> = keyof ContractTypeMap[C]["functions"] & string;
|
|
271
|
+
export type ProcedureName<C extends ContractName> = keyof ContractTypeMap[C]["procedures"] & string;
|
|
272
|
+
|
|
273
|
+
export type FunctionInput<
|
|
274
|
+
C extends ContractName,
|
|
275
|
+
F extends FunctionName<C>,
|
|
276
|
+
> = ContractTypeMap[C]["functions"][F]["input"];
|
|
277
|
+
export type FunctionOutput<
|
|
278
|
+
C extends ContractName,
|
|
279
|
+
F extends FunctionName<C>,
|
|
280
|
+
> = ContractTypeMap[C]["functions"][F]["output"];
|
|
281
|
+
|
|
282
|
+
export type ProcedureInput<
|
|
283
|
+
C extends ContractName,
|
|
284
|
+
P extends ProcedureName<C>,
|
|
285
|
+
> = ContractTypeMap[C]["procedures"][P]["input"];
|
|
286
|
+
export type ProcedureOutput<
|
|
287
|
+
C extends ContractName,
|
|
288
|
+
P extends ProcedureName<C>,
|
|
289
|
+
> = ContractTypeMap[C]["procedures"][P]["output"];
|
|
290
|
+
|
|
291
|
+
export const contractCodecRegistry = {
|
|
292
|
+
QBOND: {
|
|
293
|
+
contractIndex: 17,
|
|
294
|
+
functions: {
|
|
295
|
+
GetFees: {
|
|
296
|
+
kind: "function",
|
|
297
|
+
inputType: 1,
|
|
298
|
+
inputTypeName: "GetFees_input",
|
|
299
|
+
outputTypeName: "GetFees_output",
|
|
300
|
+
},
|
|
301
|
+
GetEarnedFees: {
|
|
302
|
+
kind: "function",
|
|
303
|
+
inputType: 2,
|
|
304
|
+
inputTypeName: "GetEarnedFees_input",
|
|
305
|
+
outputTypeName: "GetEarnedFees_output",
|
|
306
|
+
},
|
|
307
|
+
GetInfoPerEpoch: {
|
|
308
|
+
kind: "function",
|
|
309
|
+
inputType: 3,
|
|
310
|
+
inputTypeName: "GetInfoPerEpoch_input",
|
|
311
|
+
outputTypeName: "GetInfoPerEpoch_output",
|
|
312
|
+
},
|
|
313
|
+
GetOrders: {
|
|
314
|
+
kind: "function",
|
|
315
|
+
inputType: 4,
|
|
316
|
+
inputTypeName: "GetOrders_input",
|
|
317
|
+
outputTypeName: "GetOrders_output",
|
|
318
|
+
},
|
|
319
|
+
GetUserOrders: {
|
|
320
|
+
kind: "function",
|
|
321
|
+
inputType: 5,
|
|
322
|
+
inputTypeName: "GetUserOrders_input",
|
|
323
|
+
outputTypeName: "GetUserOrders_output",
|
|
324
|
+
},
|
|
325
|
+
GetMBondsTable: {
|
|
326
|
+
kind: "function",
|
|
327
|
+
inputType: 6,
|
|
328
|
+
inputTypeName: "GetMBondsTable_input",
|
|
329
|
+
outputTypeName: "GetMBondsTable_output",
|
|
330
|
+
},
|
|
331
|
+
GetUserMBonds: {
|
|
332
|
+
kind: "function",
|
|
333
|
+
inputType: 7,
|
|
334
|
+
inputTypeName: "GetUserMBonds_input",
|
|
335
|
+
outputTypeName: "GetUserMBonds_output",
|
|
336
|
+
},
|
|
337
|
+
GetCFA: {
|
|
338
|
+
kind: "function",
|
|
339
|
+
inputType: 8,
|
|
340
|
+
inputTypeName: "GetCFA_input",
|
|
341
|
+
outputTypeName: "GetCFA_output",
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
procedures: {
|
|
345
|
+
Stake: {
|
|
346
|
+
kind: "procedure",
|
|
347
|
+
inputType: 1,
|
|
348
|
+
inputTypeName: "Stake_input",
|
|
349
|
+
outputTypeName: "Stake_output",
|
|
350
|
+
},
|
|
351
|
+
TransferMBondOwnershipAndPossession: {
|
|
352
|
+
kind: "procedure",
|
|
353
|
+
inputType: 2,
|
|
354
|
+
inputTypeName: "TransferMBondOwnershipAndPossession_input",
|
|
355
|
+
outputTypeName: "TransferMBondOwnershipAndPossession_output",
|
|
356
|
+
},
|
|
357
|
+
AddAskOrder: {
|
|
358
|
+
kind: "procedure",
|
|
359
|
+
inputType: 3,
|
|
360
|
+
inputTypeName: "AddAskOrder_input",
|
|
361
|
+
outputTypeName: "AddAskOrder_output",
|
|
362
|
+
},
|
|
363
|
+
RemoveAskOrder: {
|
|
364
|
+
kind: "procedure",
|
|
365
|
+
inputType: 4,
|
|
366
|
+
inputTypeName: "RemoveAskOrder_input",
|
|
367
|
+
outputTypeName: "RemoveAskOrder_output",
|
|
368
|
+
},
|
|
369
|
+
AddBidOrder: {
|
|
370
|
+
kind: "procedure",
|
|
371
|
+
inputType: 5,
|
|
372
|
+
inputTypeName: "AddBidOrder_input",
|
|
373
|
+
outputTypeName: "AddBidOrder_output",
|
|
374
|
+
},
|
|
375
|
+
RemoveBidOrder: {
|
|
376
|
+
kind: "procedure",
|
|
377
|
+
inputType: 6,
|
|
378
|
+
inputTypeName: "RemoveBidOrder_input",
|
|
379
|
+
outputTypeName: "RemoveBidOrder_output",
|
|
380
|
+
},
|
|
381
|
+
BurnQU: {
|
|
382
|
+
kind: "procedure",
|
|
383
|
+
inputType: 7,
|
|
384
|
+
inputTypeName: "BurnQU_input",
|
|
385
|
+
outputTypeName: "BurnQU_output",
|
|
386
|
+
},
|
|
387
|
+
UpdateCFA: {
|
|
388
|
+
kind: "procedure",
|
|
389
|
+
inputType: 8,
|
|
390
|
+
inputTypeName: "UpdateCFA_input",
|
|
391
|
+
outputTypeName: "UpdateCFA_output",
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
} as const satisfies Readonly<Record<ContractName, unknown>>;
|
|
396
|
+
|
|
397
|
+
export type RuntimeContractCodecRegistry = typeof contractCodecRegistry;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractName": "QDRAW",
|
|
3
|
+
"contractIndex": 15,
|
|
4
|
+
"filename": "Qdraw.h",
|
|
5
|
+
"address": "PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYVRC",
|
|
6
|
+
"entries": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "function",
|
|
9
|
+
"name": "getInfo",
|
|
10
|
+
"inputType": 2,
|
|
11
|
+
"inputTypeName": "getInfo_input",
|
|
12
|
+
"outputTypeName": "getInfo_output"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"kind": "function",
|
|
16
|
+
"name": "getParticipants",
|
|
17
|
+
"inputType": 3,
|
|
18
|
+
"inputTypeName": "getParticipants_input",
|
|
19
|
+
"outputTypeName": "getParticipants_output"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"kind": "procedure",
|
|
23
|
+
"name": "buyTicket",
|
|
24
|
+
"inputType": 1,
|
|
25
|
+
"inputTypeName": "buyTicket_input",
|
|
26
|
+
"outputTypeName": "buyTicket_output"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"ioTypes": [
|
|
30
|
+
{
|
|
31
|
+
"kind": "struct",
|
|
32
|
+
"name": "buyTicket_input",
|
|
33
|
+
"fields": [
|
|
34
|
+
{
|
|
35
|
+
"name": "ticketCount",
|
|
36
|
+
"type": "uint64"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"kind": "struct",
|
|
42
|
+
"name": "buyTicket_output",
|
|
43
|
+
"fields": []
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"kind": "struct",
|
|
47
|
+
"name": "getInfo_input",
|
|
48
|
+
"fields": []
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "struct",
|
|
52
|
+
"name": "getInfo_output",
|
|
53
|
+
"fields": [
|
|
54
|
+
{
|
|
55
|
+
"name": "pot",
|
|
56
|
+
"type": "sint64"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "participantCount",
|
|
60
|
+
"type": "uint64"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "lastWinner",
|
|
64
|
+
"type": "id"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "lastWinAmount",
|
|
68
|
+
"type": "sint64"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "lastDrawHour",
|
|
72
|
+
"type": "uint8"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "currentHour",
|
|
76
|
+
"type": "uint8"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "nextDrawHour",
|
|
80
|
+
"type": "uint8"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "struct",
|
|
86
|
+
"name": "getParticipants_input",
|
|
87
|
+
"fields": []
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"kind": "struct",
|
|
91
|
+
"name": "getParticipants_output",
|
|
92
|
+
"fields": [
|
|
93
|
+
{
|
|
94
|
+
"name": "participantCount",
|
|
95
|
+
"type": "uint64"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "uniqueParticipantCount",
|
|
99
|
+
"type": "uint64"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "participants",
|
|
103
|
+
"type": "Array<id, QDRAW_MAX_PARTICIPANTS>"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "ticketCounts",
|
|
107
|
+
"type": "Array<uint64, QDRAW_MAX_PARTICIPANTS>"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* This file is generated. Do not edit manually. */
|
|
3
|
+
|
|
4
|
+
export type QDRAW_buyTicket_input = {
|
|
5
|
+
readonly ticketCount: bigint;
|
|
6
|
+
};
|
|
7
|
+
export type QDRAW_buyTicket_output = Record<string, never>;
|
|
8
|
+
export type QDRAW_getInfo_input = Record<string, never>;
|
|
9
|
+
export type QDRAW_getInfo_output = {
|
|
10
|
+
readonly pot: bigint;
|
|
11
|
+
readonly participantCount: bigint;
|
|
12
|
+
readonly lastWinner: string;
|
|
13
|
+
readonly lastWinAmount: bigint;
|
|
14
|
+
readonly lastDrawHour: number;
|
|
15
|
+
readonly currentHour: number;
|
|
16
|
+
readonly nextDrawHour: number;
|
|
17
|
+
};
|
|
18
|
+
export type QDRAW_getParticipants_input = Record<string, never>;
|
|
19
|
+
export type QDRAW_getParticipants_output = {
|
|
20
|
+
readonly participantCount: bigint;
|
|
21
|
+
readonly uniqueParticipantCount: bigint;
|
|
22
|
+
readonly participants: ReadonlyArray<string>;
|
|
23
|
+
readonly ticketCounts: ReadonlyArray<bigint>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export interface ContractTypeMap {
|
|
27
|
+
QDRAW: {
|
|
28
|
+
readonly contractIndex: 15;
|
|
29
|
+
readonly functions: {
|
|
30
|
+
getInfo: {
|
|
31
|
+
readonly kind: "function";
|
|
32
|
+
readonly inputType: 2;
|
|
33
|
+
readonly inputTypeName: "getInfo_input";
|
|
34
|
+
readonly outputTypeName: "getInfo_output";
|
|
35
|
+
readonly input: QDRAW_getInfo_input;
|
|
36
|
+
readonly output: QDRAW_getInfo_output;
|
|
37
|
+
};
|
|
38
|
+
getParticipants: {
|
|
39
|
+
readonly kind: "function";
|
|
40
|
+
readonly inputType: 3;
|
|
41
|
+
readonly inputTypeName: "getParticipants_input";
|
|
42
|
+
readonly outputTypeName: "getParticipants_output";
|
|
43
|
+
readonly input: QDRAW_getParticipants_input;
|
|
44
|
+
readonly output: QDRAW_getParticipants_output;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly procedures: {
|
|
48
|
+
buyTicket: {
|
|
49
|
+
readonly kind: "procedure";
|
|
50
|
+
readonly inputType: 1;
|
|
51
|
+
readonly inputTypeName: "buyTicket_input";
|
|
52
|
+
readonly outputTypeName: "buyTicket_output";
|
|
53
|
+
readonly input: QDRAW_buyTicket_input;
|
|
54
|
+
readonly output: QDRAW_buyTicket_output;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type ContractName = keyof ContractTypeMap & string;
|
|
61
|
+
export type FunctionName<C extends ContractName> = keyof ContractTypeMap[C]["functions"] & string;
|
|
62
|
+
export type ProcedureName<C extends ContractName> = keyof ContractTypeMap[C]["procedures"] & string;
|
|
63
|
+
|
|
64
|
+
export type FunctionInput<
|
|
65
|
+
C extends ContractName,
|
|
66
|
+
F extends FunctionName<C>,
|
|
67
|
+
> = ContractTypeMap[C]["functions"][F]["input"];
|
|
68
|
+
export type FunctionOutput<
|
|
69
|
+
C extends ContractName,
|
|
70
|
+
F extends FunctionName<C>,
|
|
71
|
+
> = ContractTypeMap[C]["functions"][F]["output"];
|
|
72
|
+
|
|
73
|
+
export type ProcedureInput<
|
|
74
|
+
C extends ContractName,
|
|
75
|
+
P extends ProcedureName<C>,
|
|
76
|
+
> = ContractTypeMap[C]["procedures"][P]["input"];
|
|
77
|
+
export type ProcedureOutput<
|
|
78
|
+
C extends ContractName,
|
|
79
|
+
P extends ProcedureName<C>,
|
|
80
|
+
> = ContractTypeMap[C]["procedures"][P]["output"];
|
|
81
|
+
|
|
82
|
+
export const contractCodecRegistry = {
|
|
83
|
+
QDRAW: {
|
|
84
|
+
contractIndex: 15,
|
|
85
|
+
functions: {
|
|
86
|
+
getInfo: {
|
|
87
|
+
kind: "function",
|
|
88
|
+
inputType: 2,
|
|
89
|
+
inputTypeName: "getInfo_input",
|
|
90
|
+
outputTypeName: "getInfo_output",
|
|
91
|
+
},
|
|
92
|
+
getParticipants: {
|
|
93
|
+
kind: "function",
|
|
94
|
+
inputType: 3,
|
|
95
|
+
inputTypeName: "getParticipants_input",
|
|
96
|
+
outputTypeName: "getParticipants_output",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
procedures: {
|
|
100
|
+
buyTicket: {
|
|
101
|
+
kind: "procedure",
|
|
102
|
+
inputType: 1,
|
|
103
|
+
inputTypeName: "buyTicket_input",
|
|
104
|
+
outputTypeName: "buyTicket_output",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
} as const satisfies Readonly<Record<ContractName, unknown>>;
|
|
109
|
+
|
|
110
|
+
export type RuntimeContractCodecRegistry = typeof contractCodecRegistry;
|