@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,265 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* This file is generated. Do not edit manually. */
|
|
3
|
+
|
|
4
|
+
export type QEARN_getBurnedAndBoostedStats_input = Record<string, never>;
|
|
5
|
+
export type QEARN_getBurnedAndBoostedStats_output = {
|
|
6
|
+
readonly burnedAmount: bigint;
|
|
7
|
+
readonly averageBurnedPercent: bigint;
|
|
8
|
+
readonly boostedAmount: bigint;
|
|
9
|
+
readonly averageBoostedPercent: bigint;
|
|
10
|
+
readonly rewardedAmount: bigint;
|
|
11
|
+
readonly averageRewardedPercent: bigint;
|
|
12
|
+
};
|
|
13
|
+
export type QEARN_getBurnedAndBoostedStatsPerEpoch_input = {
|
|
14
|
+
readonly epoch: number;
|
|
15
|
+
};
|
|
16
|
+
export type QEARN_getBurnedAndBoostedStatsPerEpoch_output = {
|
|
17
|
+
readonly burnedAmount: bigint;
|
|
18
|
+
readonly burnedPercent: bigint;
|
|
19
|
+
readonly boostedAmount: bigint;
|
|
20
|
+
readonly boostedPercent: bigint;
|
|
21
|
+
readonly rewardedAmount: bigint;
|
|
22
|
+
readonly rewardedPercent: bigint;
|
|
23
|
+
};
|
|
24
|
+
export type QEARN_getEndedStatus_input = {
|
|
25
|
+
readonly user: string;
|
|
26
|
+
};
|
|
27
|
+
export type QEARN_getEndedStatus_output = {
|
|
28
|
+
readonly fullyUnlockedAmount: bigint;
|
|
29
|
+
readonly fullyRewardedAmount: bigint;
|
|
30
|
+
readonly earlyUnlockedAmount: bigint;
|
|
31
|
+
readonly earlyRewardedAmount: bigint;
|
|
32
|
+
};
|
|
33
|
+
export type QEARN_getLockInfoPerEpoch_input = {
|
|
34
|
+
readonly Epoch: number;
|
|
35
|
+
};
|
|
36
|
+
export type QEARN_getLockInfoPerEpoch_output = {
|
|
37
|
+
readonly lockedAmount: bigint;
|
|
38
|
+
readonly bonusAmount: bigint;
|
|
39
|
+
readonly currentLockedAmount: bigint;
|
|
40
|
+
readonly currentBonusAmount: bigint;
|
|
41
|
+
readonly yield: bigint;
|
|
42
|
+
};
|
|
43
|
+
export type QEARN_getStateOfRound_input = {
|
|
44
|
+
readonly epoch: number;
|
|
45
|
+
};
|
|
46
|
+
export type QEARN_getStateOfRound_output = {
|
|
47
|
+
readonly state: number;
|
|
48
|
+
};
|
|
49
|
+
export type QEARN_getStatsPerEpoch_input = {
|
|
50
|
+
readonly epoch: number;
|
|
51
|
+
};
|
|
52
|
+
export type QEARN_getStatsPerEpoch_output = {
|
|
53
|
+
readonly earlyUnlockedAmount: bigint;
|
|
54
|
+
readonly earlyUnlockedPercent: bigint;
|
|
55
|
+
readonly totalLockedAmount: bigint;
|
|
56
|
+
readonly averageAPY: bigint;
|
|
57
|
+
};
|
|
58
|
+
export type QEARN_getUserLockedInfo_input = {
|
|
59
|
+
readonly user: string;
|
|
60
|
+
readonly epoch: number;
|
|
61
|
+
};
|
|
62
|
+
export type QEARN_getUserLockedInfo_output = {
|
|
63
|
+
readonly lockedAmount: bigint;
|
|
64
|
+
};
|
|
65
|
+
export type QEARN_getUserLockStatus_input = {
|
|
66
|
+
readonly user: string;
|
|
67
|
+
};
|
|
68
|
+
export type QEARN_getUserLockStatus_output = {
|
|
69
|
+
readonly status: bigint;
|
|
70
|
+
};
|
|
71
|
+
export type QEARN_lock_input = Record<string, never>;
|
|
72
|
+
export type QEARN_lock_output = {
|
|
73
|
+
readonly returnCode: number;
|
|
74
|
+
};
|
|
75
|
+
export type QEARN_unlock_input = {
|
|
76
|
+
readonly amount: bigint;
|
|
77
|
+
readonly lockedEpoch: number;
|
|
78
|
+
};
|
|
79
|
+
export type QEARN_unlock_output = {
|
|
80
|
+
readonly returnCode: number;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export interface ContractTypeMap {
|
|
84
|
+
QEARN: {
|
|
85
|
+
readonly contractIndex: 9;
|
|
86
|
+
readonly functions: {
|
|
87
|
+
getLockInfoPerEpoch: {
|
|
88
|
+
readonly kind: "function";
|
|
89
|
+
readonly inputType: 1;
|
|
90
|
+
readonly inputTypeName: "getLockInfoPerEpoch_input";
|
|
91
|
+
readonly outputTypeName: "getLockInfoPerEpoch_output";
|
|
92
|
+
readonly input: QEARN_getLockInfoPerEpoch_input;
|
|
93
|
+
readonly output: QEARN_getLockInfoPerEpoch_output;
|
|
94
|
+
};
|
|
95
|
+
getUserLockedInfo: {
|
|
96
|
+
readonly kind: "function";
|
|
97
|
+
readonly inputType: 2;
|
|
98
|
+
readonly inputTypeName: "getUserLockedInfo_input";
|
|
99
|
+
readonly outputTypeName: "getUserLockedInfo_output";
|
|
100
|
+
readonly input: QEARN_getUserLockedInfo_input;
|
|
101
|
+
readonly output: QEARN_getUserLockedInfo_output;
|
|
102
|
+
};
|
|
103
|
+
getStateOfRound: {
|
|
104
|
+
readonly kind: "function";
|
|
105
|
+
readonly inputType: 3;
|
|
106
|
+
readonly inputTypeName: "getStateOfRound_input";
|
|
107
|
+
readonly outputTypeName: "getStateOfRound_output";
|
|
108
|
+
readonly input: QEARN_getStateOfRound_input;
|
|
109
|
+
readonly output: QEARN_getStateOfRound_output;
|
|
110
|
+
};
|
|
111
|
+
getUserLockStatus: {
|
|
112
|
+
readonly kind: "function";
|
|
113
|
+
readonly inputType: 4;
|
|
114
|
+
readonly inputTypeName: "getUserLockStatus_input";
|
|
115
|
+
readonly outputTypeName: "getUserLockStatus_output";
|
|
116
|
+
readonly input: QEARN_getUserLockStatus_input;
|
|
117
|
+
readonly output: QEARN_getUserLockStatus_output;
|
|
118
|
+
};
|
|
119
|
+
getEndedStatus: {
|
|
120
|
+
readonly kind: "function";
|
|
121
|
+
readonly inputType: 5;
|
|
122
|
+
readonly inputTypeName: "getEndedStatus_input";
|
|
123
|
+
readonly outputTypeName: "getEndedStatus_output";
|
|
124
|
+
readonly input: QEARN_getEndedStatus_input;
|
|
125
|
+
readonly output: QEARN_getEndedStatus_output;
|
|
126
|
+
};
|
|
127
|
+
getStatsPerEpoch: {
|
|
128
|
+
readonly kind: "function";
|
|
129
|
+
readonly inputType: 6;
|
|
130
|
+
readonly inputTypeName: "getStatsPerEpoch_input";
|
|
131
|
+
readonly outputTypeName: "getStatsPerEpoch_output";
|
|
132
|
+
readonly input: QEARN_getStatsPerEpoch_input;
|
|
133
|
+
readonly output: QEARN_getStatsPerEpoch_output;
|
|
134
|
+
};
|
|
135
|
+
getBurnedAndBoostedStats: {
|
|
136
|
+
readonly kind: "function";
|
|
137
|
+
readonly inputType: 7;
|
|
138
|
+
readonly inputTypeName: "getBurnedAndBoostedStats_input";
|
|
139
|
+
readonly outputTypeName: "getBurnedAndBoostedStats_output";
|
|
140
|
+
readonly input: QEARN_getBurnedAndBoostedStats_input;
|
|
141
|
+
readonly output: QEARN_getBurnedAndBoostedStats_output;
|
|
142
|
+
};
|
|
143
|
+
getBurnedAndBoostedStatsPerEpoch: {
|
|
144
|
+
readonly kind: "function";
|
|
145
|
+
readonly inputType: 8;
|
|
146
|
+
readonly inputTypeName: "getBurnedAndBoostedStatsPerEpoch_input";
|
|
147
|
+
readonly outputTypeName: "getBurnedAndBoostedStatsPerEpoch_output";
|
|
148
|
+
readonly input: QEARN_getBurnedAndBoostedStatsPerEpoch_input;
|
|
149
|
+
readonly output: QEARN_getBurnedAndBoostedStatsPerEpoch_output;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly procedures: {
|
|
153
|
+
lock: {
|
|
154
|
+
readonly kind: "procedure";
|
|
155
|
+
readonly inputType: 1;
|
|
156
|
+
readonly inputTypeName: "lock_input";
|
|
157
|
+
readonly outputTypeName: "lock_output";
|
|
158
|
+
readonly input: QEARN_lock_input;
|
|
159
|
+
readonly output: QEARN_lock_output;
|
|
160
|
+
};
|
|
161
|
+
unlock: {
|
|
162
|
+
readonly kind: "procedure";
|
|
163
|
+
readonly inputType: 2;
|
|
164
|
+
readonly inputTypeName: "unlock_input";
|
|
165
|
+
readonly outputTypeName: "unlock_output";
|
|
166
|
+
readonly input: QEARN_unlock_input;
|
|
167
|
+
readonly output: QEARN_unlock_output;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type ContractName = keyof ContractTypeMap & string;
|
|
174
|
+
export type FunctionName<C extends ContractName> = keyof ContractTypeMap[C]["functions"] & string;
|
|
175
|
+
export type ProcedureName<C extends ContractName> = keyof ContractTypeMap[C]["procedures"] & string;
|
|
176
|
+
|
|
177
|
+
export type FunctionInput<
|
|
178
|
+
C extends ContractName,
|
|
179
|
+
F extends FunctionName<C>,
|
|
180
|
+
> = ContractTypeMap[C]["functions"][F]["input"];
|
|
181
|
+
export type FunctionOutput<
|
|
182
|
+
C extends ContractName,
|
|
183
|
+
F extends FunctionName<C>,
|
|
184
|
+
> = ContractTypeMap[C]["functions"][F]["output"];
|
|
185
|
+
|
|
186
|
+
export type ProcedureInput<
|
|
187
|
+
C extends ContractName,
|
|
188
|
+
P extends ProcedureName<C>,
|
|
189
|
+
> = ContractTypeMap[C]["procedures"][P]["input"];
|
|
190
|
+
export type ProcedureOutput<
|
|
191
|
+
C extends ContractName,
|
|
192
|
+
P extends ProcedureName<C>,
|
|
193
|
+
> = ContractTypeMap[C]["procedures"][P]["output"];
|
|
194
|
+
|
|
195
|
+
export const contractCodecRegistry = {
|
|
196
|
+
QEARN: {
|
|
197
|
+
contractIndex: 9,
|
|
198
|
+
functions: {
|
|
199
|
+
getLockInfoPerEpoch: {
|
|
200
|
+
kind: "function",
|
|
201
|
+
inputType: 1,
|
|
202
|
+
inputTypeName: "getLockInfoPerEpoch_input",
|
|
203
|
+
outputTypeName: "getLockInfoPerEpoch_output",
|
|
204
|
+
},
|
|
205
|
+
getUserLockedInfo: {
|
|
206
|
+
kind: "function",
|
|
207
|
+
inputType: 2,
|
|
208
|
+
inputTypeName: "getUserLockedInfo_input",
|
|
209
|
+
outputTypeName: "getUserLockedInfo_output",
|
|
210
|
+
},
|
|
211
|
+
getStateOfRound: {
|
|
212
|
+
kind: "function",
|
|
213
|
+
inputType: 3,
|
|
214
|
+
inputTypeName: "getStateOfRound_input",
|
|
215
|
+
outputTypeName: "getStateOfRound_output",
|
|
216
|
+
},
|
|
217
|
+
getUserLockStatus: {
|
|
218
|
+
kind: "function",
|
|
219
|
+
inputType: 4,
|
|
220
|
+
inputTypeName: "getUserLockStatus_input",
|
|
221
|
+
outputTypeName: "getUserLockStatus_output",
|
|
222
|
+
},
|
|
223
|
+
getEndedStatus: {
|
|
224
|
+
kind: "function",
|
|
225
|
+
inputType: 5,
|
|
226
|
+
inputTypeName: "getEndedStatus_input",
|
|
227
|
+
outputTypeName: "getEndedStatus_output",
|
|
228
|
+
},
|
|
229
|
+
getStatsPerEpoch: {
|
|
230
|
+
kind: "function",
|
|
231
|
+
inputType: 6,
|
|
232
|
+
inputTypeName: "getStatsPerEpoch_input",
|
|
233
|
+
outputTypeName: "getStatsPerEpoch_output",
|
|
234
|
+
},
|
|
235
|
+
getBurnedAndBoostedStats: {
|
|
236
|
+
kind: "function",
|
|
237
|
+
inputType: 7,
|
|
238
|
+
inputTypeName: "getBurnedAndBoostedStats_input",
|
|
239
|
+
outputTypeName: "getBurnedAndBoostedStats_output",
|
|
240
|
+
},
|
|
241
|
+
getBurnedAndBoostedStatsPerEpoch: {
|
|
242
|
+
kind: "function",
|
|
243
|
+
inputType: 8,
|
|
244
|
+
inputTypeName: "getBurnedAndBoostedStatsPerEpoch_input",
|
|
245
|
+
outputTypeName: "getBurnedAndBoostedStatsPerEpoch_output",
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
procedures: {
|
|
249
|
+
lock: {
|
|
250
|
+
kind: "procedure",
|
|
251
|
+
inputType: 1,
|
|
252
|
+
inputTypeName: "lock_input",
|
|
253
|
+
outputTypeName: "lock_output",
|
|
254
|
+
},
|
|
255
|
+
unlock: {
|
|
256
|
+
kind: "procedure",
|
|
257
|
+
inputType: 2,
|
|
258
|
+
inputTypeName: "unlock_input",
|
|
259
|
+
outputTypeName: "unlock_output",
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
} as const satisfies Readonly<Record<ContractName, unknown>>;
|
|
264
|
+
|
|
265
|
+
export type RuntimeContractCodecRegistry = typeof contractCodecRegistry;
|