@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.
- package/LICENSE +41 -0
- package/README.md +15 -18
- package/dist/__generated__/computorcontrolledfund.d.ts +1 -1
- package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -1
- package/dist/__generated__/computorcontrolledfund.js +8 -8
- package/dist/__generated__/computorcontrolledfund.js.map +1 -1
- package/dist/__generated__/escrow.d.ts +1 -1
- package/dist/__generated__/escrow.d.ts.map +1 -1
- package/dist/__generated__/escrow.js +3 -3
- package/dist/__generated__/escrow.js.map +1 -1
- package/dist/__generated__/generalquorumproposal.d.ts +1 -1
- package/dist/__generated__/generalquorumproposal.d.ts.map +1 -1
- package/dist/__generated__/generalquorumproposal.js +6 -6
- package/dist/__generated__/generalquorumproposal.js.map +1 -1
- package/dist/__generated__/ggwp.d.ts +265 -0
- package/dist/__generated__/ggwp.d.ts.map +1 -0
- package/dist/__generated__/ggwp.js +825 -0
- package/dist/__generated__/ggwp.js.map +1 -0
- package/dist/__generated__/index.d.ts +1 -0
- package/dist/__generated__/index.d.ts.map +1 -1
- package/dist/__generated__/index.js +1 -0
- package/dist/__generated__/index.js.map +1 -1
- package/dist/__generated__/msvault.d.ts +1 -1
- package/dist/__generated__/msvault.d.ts.map +1 -1
- package/dist/__generated__/msvault.js +19 -19
- package/dist/__generated__/msvault.js.map +1 -1
- package/dist/__generated__/multisignvault.d.ts +25 -25
- package/dist/__generated__/multisignvault.d.ts.map +1 -1
- package/dist/__generated__/multisignvault.js +25 -25
- package/dist/__generated__/multisignvault.js.map +1 -1
- package/dist/__generated__/nostromo.d.ts +1 -1
- package/dist/__generated__/nostromo.d.ts.map +1 -1
- package/dist/__generated__/nostromo.js +15 -15
- package/dist/__generated__/nostromo.js.map +1 -1
- package/dist/__generated__/pulse.d.ts +1 -1
- package/dist/__generated__/pulse.d.ts.map +1 -1
- package/dist/__generated__/pulse.js +26 -26
- package/dist/__generated__/pulse.js.map +1 -1
- package/dist/__generated__/qbay.d.ts +1 -1
- package/dist/__generated__/qbay.d.ts.map +1 -1
- package/dist/__generated__/qbay.js +23 -23
- package/dist/__generated__/qbay.js.map +1 -1
- package/dist/__generated__/qbond.d.ts +1 -1
- package/dist/__generated__/qbond.d.ts.map +1 -1
- package/dist/__generated__/qbond.js +14 -14
- package/dist/__generated__/qbond.js.map +1 -1
- package/dist/__generated__/qdraw.d.ts +1 -1
- package/dist/__generated__/qdraw.d.ts.map +1 -1
- package/dist/__generated__/qdraw.js.map +1 -1
- package/dist/__generated__/qduel.d.ts +1 -1
- package/dist/__generated__/qduel.d.ts.map +1 -1
- package/dist/__generated__/qduel.js +11 -11
- package/dist/__generated__/qduel.js.map +1 -1
- package/dist/__generated__/qearn.d.ts +1 -1
- package/dist/__generated__/qearn.d.ts.map +1 -1
- package/dist/__generated__/qearn.js +10 -10
- package/dist/__generated__/qearn.js.map +1 -1
- package/dist/__generated__/qip.d.ts +18 -1
- package/dist/__generated__/qip.d.ts.map +1 -1
- package/dist/__generated__/qip.js +64 -3
- package/dist/__generated__/qip.js.map +1 -1
- package/dist/__generated__/qraffle.d.ts +1 -1
- package/dist/__generated__/qraffle.d.ts.map +1 -1
- package/dist/__generated__/qraffle.js +12 -12
- package/dist/__generated__/qraffle.js.map +1 -1
- package/dist/__generated__/qreservepool.d.ts +1 -1
- package/dist/__generated__/qreservepool.d.ts.map +1 -1
- package/dist/__generated__/qreservepool.js +5 -5
- package/dist/__generated__/qreservepool.js.map +1 -1
- package/dist/__generated__/qrwa.d.ts +1 -1
- package/dist/__generated__/qrwa.d.ts.map +1 -1
- package/dist/__generated__/qrwa.js +18 -18
- package/dist/__generated__/qrwa.js.map +1 -1
- package/dist/__generated__/qswap.d.ts +3 -1
- package/dist/__generated__/qswap.d.ts.map +1 -1
- package/dist/__generated__/qswap.js +30 -18
- package/dist/__generated__/qswap.js.map +1 -1
- package/dist/__generated__/qthirtyfour.d.ts +1 -1
- package/dist/__generated__/qthirtyfour.d.ts.map +1 -1
- package/dist/__generated__/qthirtyfour.js +19 -19
- package/dist/__generated__/qthirtyfour.js.map +1 -1
- package/dist/__generated__/qubicicoportal.d.ts +4 -4
- package/dist/__generated__/qubicicoportal.d.ts.map +1 -1
- package/dist/__generated__/qubicicoportal.js +4 -4
- package/dist/__generated__/qubicicoportal.js.map +1 -1
- package/dist/__generated__/quottery.d.ts +1 -1
- package/dist/__generated__/quottery.d.ts.map +1 -1
- package/dist/__generated__/quottery.js +14 -14
- package/dist/__generated__/quottery.js.map +1 -1
- package/dist/__generated__/qusino.d.ts +1 -1
- package/dist/__generated__/qusino.d.ts.map +1 -1
- package/dist/__generated__/qusino.js +13 -13
- package/dist/__generated__/qusino.js.map +1 -1
- package/dist/__generated__/qutil.d.ts +1 -1
- package/dist/__generated__/qutil.d.ts.map +1 -1
- package/dist/__generated__/qutil.js +22 -22
- package/dist/__generated__/qutil.js.map +1 -1
- package/dist/__generated__/qvault.d.ts +14 -2
- package/dist/__generated__/qvault.d.ts.map +1 -1
- package/dist/__generated__/qvault.js +70 -32
- package/dist/__generated__/qvault.js.map +1 -1
- package/dist/__generated__/qx.d.ts +1 -1
- package/dist/__generated__/qx.d.ts.map +1 -1
- package/dist/__generated__/qx.js +12 -12
- package/dist/__generated__/qx.js.map +1 -1
- package/dist/__generated__/random.d.ts +24 -1
- package/dist/__generated__/random.d.ts.map +1 -1
- package/dist/__generated__/random.js +68 -0
- package/dist/__generated__/random.js.map +1 -1
- package/dist/__generated__/randomlottery.d.ts +1 -1
- package/dist/__generated__/randomlottery.d.ts.map +1 -1
- package/dist/__generated__/randomlottery.js +12 -12
- package/dist/__generated__/randomlottery.js.map +1 -1
- package/dist/__generated__/vottunbridge.d.ts +1 -1
- package/dist/__generated__/vottunbridge.d.ts.map +1 -1
- package/dist/__generated__/vottunbridge.js +13 -13
- package/dist/__generated__/vottunbridge.js.map +1 -1
- package/dist/call-contract.d.ts.map +1 -1
- package/dist/call-contract.js +6 -1
- package/dist/call-contract.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/__generated__/computorcontrolledfund.ts +1066 -0
- package/src/__generated__/escrow.ts +529 -0
- package/src/__generated__/generalquorumproposal.ts +691 -0
- package/src/__generated__/ggwp.ts +1241 -0
- package/src/__generated__/index.ts +28 -0
- package/src/__generated__/msvault.ts +1716 -0
- package/src/__generated__/multisignvault.ts +1511 -0
- package/src/__generated__/mylastmatch.ts +12 -0
- package/src/__generated__/nostromo.ts +1551 -0
- package/src/__generated__/pulse.ts +1512 -0
- package/src/__generated__/qbay.ts +2097 -0
- package/src/__generated__/qbond.ts +1016 -0
- package/src/__generated__/qdraw.ts +188 -0
- package/src/__generated__/qduel.ts +827 -0
- package/src/__generated__/qearn.ts +696 -0
- package/src/__generated__/qip.ts +501 -0
- package/src/__generated__/qraffle.ts +1162 -0
- package/src/__generated__/qreservepool.ts +281 -0
- package/src/__generated__/qrwa.ts +1491 -0
- package/src/__generated__/qswap.ts +1336 -0
- package/src/__generated__/qthirtyfour.ts +1131 -0
- package/src/__generated__/qubicicoportal.ts +386 -0
- package/src/__generated__/quottery.ts +1519 -0
- package/src/__generated__/qusino.ts +799 -0
- package/src/__generated__/qutil.ts +1506 -0
- package/src/__generated__/qvault.ts +2911 -0
- package/src/__generated__/qx.ts +861 -0
- package/src/__generated__/random.ts +145 -0
- package/src/__generated__/randomlottery.ts +653 -0
- package/src/__generated__/supplywatcher.ts +12 -0
- package/src/__generated__/vottunbridge.ts +1162 -0
- package/src/__tests__/contracts.test.ts +933 -0
- package/src/call-contract.ts +87 -0
- package/src/index.ts +9 -0
- package/dist/result.d.ts +0 -12
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -7
- package/dist/result.js.map +0 -1
|
@@ -0,0 +1,1519 @@
|
|
|
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 QUOTTERY_CONTRACT_INDEX = 2
|
|
9
|
+
|
|
10
|
+
export interface QuotteryQtryEventInfoStruct {
|
|
11
|
+
eid: bigint
|
|
12
|
+
openDate: QuotteryDateAndTimeStruct
|
|
13
|
+
endDate: QuotteryDateAndTimeStruct
|
|
14
|
+
desc: string[]
|
|
15
|
+
option0Desc: string[]
|
|
16
|
+
option1Desc: string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface QuotteryQtryGOVStruct {
|
|
20
|
+
mShareHolderFee: bigint
|
|
21
|
+
mBurnFee: bigint
|
|
22
|
+
mOperationFee: bigint
|
|
23
|
+
mFeePerDay: bigint
|
|
24
|
+
mDepositAmountForDispute: bigint
|
|
25
|
+
mOperationId: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface QuotteryAssetStruct {
|
|
29
|
+
issuer: string
|
|
30
|
+
assetName: bigint
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface QuotteryDepositInfoStruct {
|
|
34
|
+
pubkey: string
|
|
35
|
+
amount: bigint
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface QuotteryPositionInfoStruct {
|
|
39
|
+
eo: bigint
|
|
40
|
+
amount: bigint
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface QuotteryQtryOrderWithPriceStruct {
|
|
44
|
+
qo: QuotteryQtryOrderStruct
|
|
45
|
+
price: bigint
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface QuotteryProposalInfoStruct {
|
|
49
|
+
proposed: QuotteryQtryGOVStruct
|
|
50
|
+
totalVotes: bigint
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface QuotteryDateAndTimeStruct {
|
|
54
|
+
value: bigint
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface QuotteryQtryOrderStruct {
|
|
58
|
+
entity: string
|
|
59
|
+
amount: bigint
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const STRUCTS: Record<string, NamedStruct> = {
|
|
63
|
+
'QtryEventInfo': {
|
|
64
|
+
name: 'QtryEventInfo',
|
|
65
|
+
byteLength: 280,
|
|
66
|
+
fields: [
|
|
67
|
+
{
|
|
68
|
+
name: 'eid',
|
|
69
|
+
type: 'uint64',
|
|
70
|
+
offset: 0,
|
|
71
|
+
byteLength: 8,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'openDate',
|
|
75
|
+
type: 'struct',
|
|
76
|
+
offset: 8,
|
|
77
|
+
byteLength: 8,
|
|
78
|
+
structRef: 'DateAndTime',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'endDate',
|
|
82
|
+
type: 'struct',
|
|
83
|
+
offset: 16,
|
|
84
|
+
byteLength: 8,
|
|
85
|
+
structRef: 'DateAndTime',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'desc',
|
|
89
|
+
type: 'array',
|
|
90
|
+
offset: 24,
|
|
91
|
+
byteLength: 128,
|
|
92
|
+
arrayLength: 4,
|
|
93
|
+
arrayItemType: 'id',
|
|
94
|
+
arrayItemByteLength: 32,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'option0Desc',
|
|
98
|
+
type: 'array',
|
|
99
|
+
offset: 152,
|
|
100
|
+
byteLength: 64,
|
|
101
|
+
arrayLength: 2,
|
|
102
|
+
arrayItemType: 'id',
|
|
103
|
+
arrayItemByteLength: 32,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'option1Desc',
|
|
107
|
+
type: 'array',
|
|
108
|
+
offset: 216,
|
|
109
|
+
byteLength: 64,
|
|
110
|
+
arrayLength: 2,
|
|
111
|
+
arrayItemType: 'id',
|
|
112
|
+
arrayItemByteLength: 32,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
'QtryGOV': {
|
|
117
|
+
name: 'QtryGOV',
|
|
118
|
+
byteLength: 72,
|
|
119
|
+
fields: [
|
|
120
|
+
{
|
|
121
|
+
name: 'mShareHolderFee',
|
|
122
|
+
type: 'uint64',
|
|
123
|
+
offset: 0,
|
|
124
|
+
byteLength: 8,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'mBurnFee',
|
|
128
|
+
type: 'uint64',
|
|
129
|
+
offset: 8,
|
|
130
|
+
byteLength: 8,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'mOperationFee',
|
|
134
|
+
type: 'uint64',
|
|
135
|
+
offset: 16,
|
|
136
|
+
byteLength: 8,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'mFeePerDay',
|
|
140
|
+
type: 'sint64',
|
|
141
|
+
offset: 24,
|
|
142
|
+
byteLength: 8,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'mDepositAmountForDispute',
|
|
146
|
+
type: 'sint64',
|
|
147
|
+
offset: 32,
|
|
148
|
+
byteLength: 8,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'mOperationId',
|
|
152
|
+
type: 'id',
|
|
153
|
+
offset: 40,
|
|
154
|
+
byteLength: 32,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
'Asset': {
|
|
159
|
+
name: 'Asset',
|
|
160
|
+
byteLength: 40,
|
|
161
|
+
fields: [
|
|
162
|
+
{
|
|
163
|
+
name: 'issuer',
|
|
164
|
+
type: 'id',
|
|
165
|
+
offset: 0,
|
|
166
|
+
byteLength: 32,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'assetName',
|
|
170
|
+
type: 'uint64',
|
|
171
|
+
offset: 32,
|
|
172
|
+
byteLength: 8,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
'DepositInfo': {
|
|
177
|
+
name: 'DepositInfo',
|
|
178
|
+
byteLength: 40,
|
|
179
|
+
fields: [
|
|
180
|
+
{
|
|
181
|
+
name: 'pubkey',
|
|
182
|
+
type: 'id',
|
|
183
|
+
offset: 0,
|
|
184
|
+
byteLength: 32,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'amount',
|
|
188
|
+
type: 'sint64',
|
|
189
|
+
offset: 32,
|
|
190
|
+
byteLength: 8,
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
'PositionInfo': {
|
|
195
|
+
name: 'PositionInfo',
|
|
196
|
+
byteLength: 16,
|
|
197
|
+
fields: [
|
|
198
|
+
{
|
|
199
|
+
name: 'eo',
|
|
200
|
+
type: 'uint64',
|
|
201
|
+
offset: 0,
|
|
202
|
+
byteLength: 8,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'amount',
|
|
206
|
+
type: 'sint64',
|
|
207
|
+
offset: 8,
|
|
208
|
+
byteLength: 8,
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
'QtryOrderWithPrice': {
|
|
213
|
+
name: 'QtryOrderWithPrice',
|
|
214
|
+
byteLength: 48,
|
|
215
|
+
fields: [
|
|
216
|
+
{
|
|
217
|
+
name: 'qo',
|
|
218
|
+
type: 'struct',
|
|
219
|
+
offset: 0,
|
|
220
|
+
byteLength: 40,
|
|
221
|
+
structRef: 'QtryOrder',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'price',
|
|
225
|
+
type: 'sint64',
|
|
226
|
+
offset: 40,
|
|
227
|
+
byteLength: 8,
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
'ProposalInfo': {
|
|
232
|
+
name: 'ProposalInfo',
|
|
233
|
+
byteLength: 80,
|
|
234
|
+
fields: [
|
|
235
|
+
{
|
|
236
|
+
name: 'proposed',
|
|
237
|
+
type: 'struct',
|
|
238
|
+
offset: 0,
|
|
239
|
+
byteLength: 72,
|
|
240
|
+
structRef: 'QtryGOV',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'totalVotes',
|
|
244
|
+
type: 'sint64',
|
|
245
|
+
offset: 72,
|
|
246
|
+
byteLength: 8,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
'DateAndTime': {
|
|
251
|
+
name: 'DateAndTime',
|
|
252
|
+
byteLength: 8,
|
|
253
|
+
fields: [
|
|
254
|
+
{
|
|
255
|
+
name: 'value',
|
|
256
|
+
type: 'uint64',
|
|
257
|
+
offset: 0,
|
|
258
|
+
byteLength: 8,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
'QtryOrder': {
|
|
263
|
+
name: 'QtryOrder',
|
|
264
|
+
byteLength: 40,
|
|
265
|
+
fields: [
|
|
266
|
+
{
|
|
267
|
+
name: 'entity',
|
|
268
|
+
type: 'id',
|
|
269
|
+
offset: 0,
|
|
270
|
+
byteLength: 32,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: 'amount',
|
|
274
|
+
type: 'sint64',
|
|
275
|
+
offset: 32,
|
|
276
|
+
byteLength: 8,
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export const QUOTTERY_CREATE_EVENT_INPUT_TYPE = 1
|
|
283
|
+
|
|
284
|
+
export interface QuotteryCreateEventInput {
|
|
285
|
+
qei: QuotteryQtryEventInfoStruct
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const QUOTTERY_CREATE_EVENT_INPUT_FIELDS: BinaryField[] = [
|
|
289
|
+
{
|
|
290
|
+
name: 'qei',
|
|
291
|
+
type: 'struct',
|
|
292
|
+
offset: 0,
|
|
293
|
+
byteLength: 280,
|
|
294
|
+
structRef: 'QtryEventInfo',
|
|
295
|
+
},
|
|
296
|
+
]
|
|
297
|
+
|
|
298
|
+
export function buildQuotteryCreateEventInput(
|
|
299
|
+
input: QuotteryCreateEventInput,
|
|
300
|
+
): ContractCall {
|
|
301
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_CREATE_EVENT_INPUT_TYPE, payload: buildPayload(QUOTTERY_CREATE_EVENT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export const QUOTTERY_ADD_TO_ASK_ORDER_INPUT_TYPE = 2
|
|
305
|
+
|
|
306
|
+
export interface QuotteryAddToAskOrderInput {
|
|
307
|
+
eventId: bigint
|
|
308
|
+
option: bigint
|
|
309
|
+
amount: bigint
|
|
310
|
+
price: bigint
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const QUOTTERY_ADD_TO_ASK_ORDER_INPUT_FIELDS: BinaryField[] = [
|
|
314
|
+
{
|
|
315
|
+
name: 'eventId',
|
|
316
|
+
type: 'uint64',
|
|
317
|
+
offset: 0,
|
|
318
|
+
byteLength: 8,
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: 'option',
|
|
322
|
+
type: 'uint64',
|
|
323
|
+
offset: 8,
|
|
324
|
+
byteLength: 8,
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: 'amount',
|
|
328
|
+
type: 'uint64',
|
|
329
|
+
offset: 16,
|
|
330
|
+
byteLength: 8,
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'price',
|
|
334
|
+
type: 'sint64',
|
|
335
|
+
offset: 24,
|
|
336
|
+
byteLength: 8,
|
|
337
|
+
},
|
|
338
|
+
]
|
|
339
|
+
|
|
340
|
+
export function buildQuotteryAddToAskOrderInput(
|
|
341
|
+
input: QuotteryAddToAskOrderInput,
|
|
342
|
+
): ContractCall {
|
|
343
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_ADD_TO_ASK_ORDER_INPUT_TYPE, payload: buildPayload(QUOTTERY_ADD_TO_ASK_ORDER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface QuotteryAddToAskOrderOutput {
|
|
347
|
+
status: bigint
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const QUOTTERY_ADD_TO_ASK_ORDER_OUTPUT_FIELDS: BinaryField[] = [
|
|
351
|
+
{
|
|
352
|
+
name: 'status',
|
|
353
|
+
type: 'sint64',
|
|
354
|
+
offset: 0,
|
|
355
|
+
byteLength: 8,
|
|
356
|
+
},
|
|
357
|
+
]
|
|
358
|
+
|
|
359
|
+
export function decodeQuotteryAddToAskOrderOutput(
|
|
360
|
+
data: Uint8Array,
|
|
361
|
+
): QuotteryAddToAskOrderOutput {
|
|
362
|
+
return decodePayload(data, QUOTTERY_ADD_TO_ASK_ORDER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryAddToAskOrderOutput
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export const QUOTTERY_REMOVE_ASK_ORDER_INPUT_TYPE = 3
|
|
366
|
+
|
|
367
|
+
export interface QuotteryRemoveAskOrderInput {
|
|
368
|
+
eventId: bigint
|
|
369
|
+
option: bigint
|
|
370
|
+
amount: bigint
|
|
371
|
+
price: bigint
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const QUOTTERY_REMOVE_ASK_ORDER_INPUT_FIELDS: BinaryField[] = [
|
|
375
|
+
{
|
|
376
|
+
name: 'eventId',
|
|
377
|
+
type: 'uint64',
|
|
378
|
+
offset: 0,
|
|
379
|
+
byteLength: 8,
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: 'option',
|
|
383
|
+
type: 'uint64',
|
|
384
|
+
offset: 8,
|
|
385
|
+
byteLength: 8,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: 'amount',
|
|
389
|
+
type: 'uint64',
|
|
390
|
+
offset: 16,
|
|
391
|
+
byteLength: 8,
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: 'price',
|
|
395
|
+
type: 'sint64',
|
|
396
|
+
offset: 24,
|
|
397
|
+
byteLength: 8,
|
|
398
|
+
},
|
|
399
|
+
]
|
|
400
|
+
|
|
401
|
+
export function buildQuotteryRemoveAskOrderInput(
|
|
402
|
+
input: QuotteryRemoveAskOrderInput,
|
|
403
|
+
): ContractCall {
|
|
404
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_REMOVE_ASK_ORDER_INPUT_TYPE, payload: buildPayload(QUOTTERY_REMOVE_ASK_ORDER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface QuotteryRemoveAskOrderOutput {
|
|
408
|
+
status: bigint
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const QUOTTERY_REMOVE_ASK_ORDER_OUTPUT_FIELDS: BinaryField[] = [
|
|
412
|
+
{
|
|
413
|
+
name: 'status',
|
|
414
|
+
type: 'sint64',
|
|
415
|
+
offset: 0,
|
|
416
|
+
byteLength: 8,
|
|
417
|
+
},
|
|
418
|
+
]
|
|
419
|
+
|
|
420
|
+
export function decodeQuotteryRemoveAskOrderOutput(
|
|
421
|
+
data: Uint8Array,
|
|
422
|
+
): QuotteryRemoveAskOrderOutput {
|
|
423
|
+
return decodePayload(data, QUOTTERY_REMOVE_ASK_ORDER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryRemoveAskOrderOutput
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export const QUOTTERY_ADD_TO_BID_ORDER_INPUT_TYPE = 4
|
|
427
|
+
|
|
428
|
+
export interface QuotteryAddToBidOrderInput {
|
|
429
|
+
eventId: bigint
|
|
430
|
+
option: bigint
|
|
431
|
+
amount: bigint
|
|
432
|
+
price: bigint
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const QUOTTERY_ADD_TO_BID_ORDER_INPUT_FIELDS: BinaryField[] = [
|
|
436
|
+
{
|
|
437
|
+
name: 'eventId',
|
|
438
|
+
type: 'uint64',
|
|
439
|
+
offset: 0,
|
|
440
|
+
byteLength: 8,
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: 'option',
|
|
444
|
+
type: 'uint64',
|
|
445
|
+
offset: 8,
|
|
446
|
+
byteLength: 8,
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: 'amount',
|
|
450
|
+
type: 'sint64',
|
|
451
|
+
offset: 16,
|
|
452
|
+
byteLength: 8,
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: 'price',
|
|
456
|
+
type: 'sint64',
|
|
457
|
+
offset: 24,
|
|
458
|
+
byteLength: 8,
|
|
459
|
+
},
|
|
460
|
+
]
|
|
461
|
+
|
|
462
|
+
export function buildQuotteryAddToBidOrderInput(
|
|
463
|
+
input: QuotteryAddToBidOrderInput,
|
|
464
|
+
): ContractCall {
|
|
465
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_ADD_TO_BID_ORDER_INPUT_TYPE, payload: buildPayload(QUOTTERY_ADD_TO_BID_ORDER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface QuotteryAddToBidOrderOutput {
|
|
469
|
+
status: bigint
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const QUOTTERY_ADD_TO_BID_ORDER_OUTPUT_FIELDS: BinaryField[] = [
|
|
473
|
+
{
|
|
474
|
+
name: 'status',
|
|
475
|
+
type: 'sint64',
|
|
476
|
+
offset: 0,
|
|
477
|
+
byteLength: 8,
|
|
478
|
+
},
|
|
479
|
+
]
|
|
480
|
+
|
|
481
|
+
export function decodeQuotteryAddToBidOrderOutput(
|
|
482
|
+
data: Uint8Array,
|
|
483
|
+
): QuotteryAddToBidOrderOutput {
|
|
484
|
+
return decodePayload(data, QUOTTERY_ADD_TO_BID_ORDER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryAddToBidOrderOutput
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export const QUOTTERY_REMOVE_BID_ORDER_INPUT_TYPE = 5
|
|
488
|
+
|
|
489
|
+
export interface QuotteryRemoveBidOrderInput {
|
|
490
|
+
eventId: bigint
|
|
491
|
+
option: bigint
|
|
492
|
+
amount: bigint
|
|
493
|
+
price: bigint
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const QUOTTERY_REMOVE_BID_ORDER_INPUT_FIELDS: BinaryField[] = [
|
|
497
|
+
{
|
|
498
|
+
name: 'eventId',
|
|
499
|
+
type: 'uint64',
|
|
500
|
+
offset: 0,
|
|
501
|
+
byteLength: 8,
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: 'option',
|
|
505
|
+
type: 'uint64',
|
|
506
|
+
offset: 8,
|
|
507
|
+
byteLength: 8,
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: 'amount',
|
|
511
|
+
type: 'uint64',
|
|
512
|
+
offset: 16,
|
|
513
|
+
byteLength: 8,
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: 'price',
|
|
517
|
+
type: 'sint64',
|
|
518
|
+
offset: 24,
|
|
519
|
+
byteLength: 8,
|
|
520
|
+
},
|
|
521
|
+
]
|
|
522
|
+
|
|
523
|
+
export function buildQuotteryRemoveBidOrderInput(
|
|
524
|
+
input: QuotteryRemoveBidOrderInput,
|
|
525
|
+
): ContractCall {
|
|
526
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_REMOVE_BID_ORDER_INPUT_TYPE, payload: buildPayload(QUOTTERY_REMOVE_BID_ORDER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export interface QuotteryRemoveBidOrderOutput {
|
|
530
|
+
status: bigint
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
const QUOTTERY_REMOVE_BID_ORDER_OUTPUT_FIELDS: BinaryField[] = [
|
|
534
|
+
{
|
|
535
|
+
name: 'status',
|
|
536
|
+
type: 'sint64',
|
|
537
|
+
offset: 0,
|
|
538
|
+
byteLength: 8,
|
|
539
|
+
},
|
|
540
|
+
]
|
|
541
|
+
|
|
542
|
+
export function decodeQuotteryRemoveBidOrderOutput(
|
|
543
|
+
data: Uint8Array,
|
|
544
|
+
): QuotteryRemoveBidOrderOutput {
|
|
545
|
+
return decodePayload(data, QUOTTERY_REMOVE_BID_ORDER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryRemoveBidOrderOutput
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export const QUOTTERY_PUBLISH_RESULT_INPUT_TYPE = 6
|
|
549
|
+
|
|
550
|
+
export interface QuotteryPublishResultInput {
|
|
551
|
+
eventId: bigint
|
|
552
|
+
option: bigint
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
const QUOTTERY_PUBLISH_RESULT_INPUT_FIELDS: BinaryField[] = [
|
|
556
|
+
{
|
|
557
|
+
name: 'eventId',
|
|
558
|
+
type: 'uint64',
|
|
559
|
+
offset: 0,
|
|
560
|
+
byteLength: 8,
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
name: 'option',
|
|
564
|
+
type: 'uint64',
|
|
565
|
+
offset: 8,
|
|
566
|
+
byteLength: 8,
|
|
567
|
+
},
|
|
568
|
+
]
|
|
569
|
+
|
|
570
|
+
export function buildQuotteryPublishResultInput(
|
|
571
|
+
input: QuotteryPublishResultInput,
|
|
572
|
+
): ContractCall {
|
|
573
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_PUBLISH_RESULT_INPUT_TYPE, payload: buildPayload(QUOTTERY_PUBLISH_RESULT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export const QUOTTERY_TRY_FINALIZE_EVENT_INPUT_TYPE = 7
|
|
577
|
+
|
|
578
|
+
export interface QuotteryTryFinalizeEventInput {
|
|
579
|
+
eventId: bigint
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const QUOTTERY_TRY_FINALIZE_EVENT_INPUT_FIELDS: BinaryField[] = [
|
|
583
|
+
{
|
|
584
|
+
name: 'eventId',
|
|
585
|
+
type: 'uint64',
|
|
586
|
+
offset: 0,
|
|
587
|
+
byteLength: 8,
|
|
588
|
+
},
|
|
589
|
+
]
|
|
590
|
+
|
|
591
|
+
export function buildQuotteryTryFinalizeEventInput(
|
|
592
|
+
input: QuotteryTryFinalizeEventInput,
|
|
593
|
+
): ContractCall {
|
|
594
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_TRY_FINALIZE_EVENT_INPUT_TYPE, payload: buildPayload(QUOTTERY_TRY_FINALIZE_EVENT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export const QUOTTERY_DISPUTE_INPUT_TYPE = 8
|
|
598
|
+
|
|
599
|
+
export interface QuotteryDisputeInput {
|
|
600
|
+
eventId: bigint
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
const QUOTTERY_DISPUTE_INPUT_FIELDS: BinaryField[] = [
|
|
604
|
+
{
|
|
605
|
+
name: 'eventId',
|
|
606
|
+
type: 'uint64',
|
|
607
|
+
offset: 0,
|
|
608
|
+
byteLength: 8,
|
|
609
|
+
},
|
|
610
|
+
]
|
|
611
|
+
|
|
612
|
+
export function buildQuotteryDisputeInput(
|
|
613
|
+
input: QuotteryDisputeInput,
|
|
614
|
+
): ContractCall {
|
|
615
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_DISPUTE_INPUT_TYPE, payload: buildPayload(QUOTTERY_DISPUTE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export const QUOTTERY_RESOLVE_DISPUTE_INPUT_TYPE = 9
|
|
619
|
+
|
|
620
|
+
export interface QuotteryResolveDisputeInput {
|
|
621
|
+
eventId: bigint
|
|
622
|
+
vote: bigint
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
const QUOTTERY_RESOLVE_DISPUTE_INPUT_FIELDS: BinaryField[] = [
|
|
626
|
+
{
|
|
627
|
+
name: 'eventId',
|
|
628
|
+
type: 'uint64',
|
|
629
|
+
offset: 0,
|
|
630
|
+
byteLength: 8,
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
name: 'vote',
|
|
634
|
+
type: 'sint64',
|
|
635
|
+
offset: 8,
|
|
636
|
+
byteLength: 8,
|
|
637
|
+
},
|
|
638
|
+
]
|
|
639
|
+
|
|
640
|
+
export function buildQuotteryResolveDisputeInput(
|
|
641
|
+
input: QuotteryResolveDisputeInput,
|
|
642
|
+
): ContractCall {
|
|
643
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_RESOLVE_DISPUTE_INPUT_TYPE, payload: buildPayload(QUOTTERY_RESOLVE_DISPUTE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
export const QUOTTERY_USER_CLAIM_REWARD_INPUT_TYPE = 10
|
|
647
|
+
|
|
648
|
+
export interface QuotteryUserClaimRewardInput {
|
|
649
|
+
eventId: bigint
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const QUOTTERY_USER_CLAIM_REWARD_INPUT_FIELDS: BinaryField[] = [
|
|
653
|
+
{
|
|
654
|
+
name: 'eventId',
|
|
655
|
+
type: 'uint64',
|
|
656
|
+
offset: 0,
|
|
657
|
+
byteLength: 8,
|
|
658
|
+
},
|
|
659
|
+
]
|
|
660
|
+
|
|
661
|
+
export function buildQuotteryUserClaimRewardInput(
|
|
662
|
+
input: QuotteryUserClaimRewardInput,
|
|
663
|
+
): ContractCall {
|
|
664
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_USER_CLAIM_REWARD_INPUT_TYPE, payload: buildPayload(QUOTTERY_USER_CLAIM_REWARD_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
export const QUOTTERY_GO_FORCE_CLAIM_REWARD_INPUT_TYPE = 11
|
|
668
|
+
|
|
669
|
+
export interface QuotteryGOForceClaimRewardInput {
|
|
670
|
+
eventId: bigint
|
|
671
|
+
pubkeys: string[]
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
const QUOTTERY_GO_FORCE_CLAIM_REWARD_INPUT_FIELDS: BinaryField[] = [
|
|
675
|
+
{
|
|
676
|
+
name: 'eventId',
|
|
677
|
+
type: 'uint64',
|
|
678
|
+
offset: 0,
|
|
679
|
+
byteLength: 8,
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: 'pubkeys',
|
|
683
|
+
type: 'array',
|
|
684
|
+
offset: 8,
|
|
685
|
+
byteLength: 512,
|
|
686
|
+
arrayLength: 16,
|
|
687
|
+
arrayItemType: 'id',
|
|
688
|
+
arrayItemByteLength: 32,
|
|
689
|
+
},
|
|
690
|
+
]
|
|
691
|
+
|
|
692
|
+
export function buildQuotteryGOForceClaimRewardInput(
|
|
693
|
+
input: QuotteryGOForceClaimRewardInput,
|
|
694
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
695
|
+
): ContractCall {
|
|
696
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_GO_FORCE_CLAIM_REWARD_INPUT_TYPE, payload: buildPayload(QUOTTERY_GO_FORCE_CLAIM_REWARD_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export const QUOTTERY_TRANSFER_QUSD_INPUT_TYPE = 12
|
|
700
|
+
|
|
701
|
+
export interface QuotteryTransferQUSDInput {
|
|
702
|
+
receiver: string
|
|
703
|
+
amount: bigint
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
const QUOTTERY_TRANSFER_QUSD_INPUT_FIELDS: BinaryField[] = [
|
|
707
|
+
{
|
|
708
|
+
name: 'receiver',
|
|
709
|
+
type: 'id',
|
|
710
|
+
offset: 0,
|
|
711
|
+
byteLength: 32,
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
name: 'amount',
|
|
715
|
+
type: 'sint64',
|
|
716
|
+
offset: 32,
|
|
717
|
+
byteLength: 8,
|
|
718
|
+
},
|
|
719
|
+
]
|
|
720
|
+
|
|
721
|
+
export function buildQuotteryTransferQUSDInput(
|
|
722
|
+
input: QuotteryTransferQUSDInput,
|
|
723
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
724
|
+
): ContractCall {
|
|
725
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_TRANSFER_QUSD_INPUT_TYPE, payload: buildPayload(QUOTTERY_TRANSFER_QUSD_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
export interface QuotteryTransferQUSDOutput {
|
|
729
|
+
amount: bigint
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
const QUOTTERY_TRANSFER_QUSD_OUTPUT_FIELDS: BinaryField[] = [
|
|
733
|
+
{
|
|
734
|
+
name: 'amount',
|
|
735
|
+
type: 'uint64',
|
|
736
|
+
offset: 0,
|
|
737
|
+
byteLength: 8,
|
|
738
|
+
},
|
|
739
|
+
]
|
|
740
|
+
|
|
741
|
+
export function decodeQuotteryTransferQUSDOutput(
|
|
742
|
+
data: Uint8Array,
|
|
743
|
+
): QuotteryTransferQUSDOutput {
|
|
744
|
+
return decodePayload(data, QUOTTERY_TRANSFER_QUSD_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryTransferQUSDOutput
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export const QUOTTERY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE = 13
|
|
748
|
+
|
|
749
|
+
export interface QuotteryTransferShareManagementRightsInput {
|
|
750
|
+
asset: QuotteryAssetStruct
|
|
751
|
+
numberOfShares: bigint
|
|
752
|
+
newManagingContractIndex: number
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
const QUOTTERY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS: BinaryField[] = [
|
|
756
|
+
{
|
|
757
|
+
name: 'asset',
|
|
758
|
+
type: 'struct',
|
|
759
|
+
offset: 0,
|
|
760
|
+
byteLength: 40,
|
|
761
|
+
structRef: 'Asset',
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
name: 'numberOfShares',
|
|
765
|
+
type: 'sint64',
|
|
766
|
+
offset: 40,
|
|
767
|
+
byteLength: 8,
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: 'newManagingContractIndex',
|
|
771
|
+
type: 'uint32',
|
|
772
|
+
offset: 48,
|
|
773
|
+
byteLength: 4,
|
|
774
|
+
},
|
|
775
|
+
]
|
|
776
|
+
|
|
777
|
+
export function buildQuotteryTransferShareManagementRightsInput(
|
|
778
|
+
input: QuotteryTransferShareManagementRightsInput,
|
|
779
|
+
): ContractCall {
|
|
780
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE, payload: buildPayload(QUOTTERY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export interface QuotteryTransferShareManagementRightsOutput {
|
|
784
|
+
transferredNumberOfShares: bigint
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
const QUOTTERY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS: BinaryField[] = [
|
|
788
|
+
{
|
|
789
|
+
name: 'transferredNumberOfShares',
|
|
790
|
+
type: 'sint64',
|
|
791
|
+
offset: 0,
|
|
792
|
+
byteLength: 8,
|
|
793
|
+
},
|
|
794
|
+
]
|
|
795
|
+
|
|
796
|
+
export function decodeQuotteryTransferShareManagementRightsOutput(
|
|
797
|
+
data: Uint8Array,
|
|
798
|
+
): QuotteryTransferShareManagementRightsOutput {
|
|
799
|
+
return decodePayload(data, QUOTTERY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryTransferShareManagementRightsOutput
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
export const QUOTTERY_CLEAN_MEMORY_INPUT_TYPE = 14
|
|
803
|
+
|
|
804
|
+
export const QUOTTERY_TRANSFER_QTRYGOV_INPUT_TYPE = 15
|
|
805
|
+
|
|
806
|
+
export interface QuotteryTransferQTRYGOVInput {
|
|
807
|
+
receiver: string
|
|
808
|
+
amount: bigint
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
const QUOTTERY_TRANSFER_QTRYGOV_INPUT_FIELDS: BinaryField[] = [
|
|
812
|
+
{
|
|
813
|
+
name: 'receiver',
|
|
814
|
+
type: 'id',
|
|
815
|
+
offset: 0,
|
|
816
|
+
byteLength: 32,
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
name: 'amount',
|
|
820
|
+
type: 'sint64',
|
|
821
|
+
offset: 32,
|
|
822
|
+
byteLength: 8,
|
|
823
|
+
},
|
|
824
|
+
]
|
|
825
|
+
|
|
826
|
+
export function buildQuotteryTransferQTRYGOVInput(
|
|
827
|
+
input: QuotteryTransferQTRYGOVInput,
|
|
828
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
829
|
+
): ContractCall {
|
|
830
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_TRANSFER_QTRYGOV_INPUT_TYPE, payload: buildPayload(QUOTTERY_TRANSFER_QTRYGOV_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
export interface QuotteryTransferQTRYGOVOutput {
|
|
834
|
+
amount: bigint
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
const QUOTTERY_TRANSFER_QTRYGOV_OUTPUT_FIELDS: BinaryField[] = [
|
|
838
|
+
{
|
|
839
|
+
name: 'amount',
|
|
840
|
+
type: 'uint64',
|
|
841
|
+
offset: 0,
|
|
842
|
+
byteLength: 8,
|
|
843
|
+
},
|
|
844
|
+
]
|
|
845
|
+
|
|
846
|
+
export function decodeQuotteryTransferQTRYGOVOutput(
|
|
847
|
+
data: Uint8Array,
|
|
848
|
+
): QuotteryTransferQTRYGOVOutput {
|
|
849
|
+
return decodePayload(data, QUOTTERY_TRANSFER_QTRYGOV_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryTransferQTRYGOVOutput
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
export const QUOTTERY_UPDATE_FEE_DISCOUNT_LIST_INPUT_TYPE = 20
|
|
853
|
+
|
|
854
|
+
export interface QuotteryUpdateFeeDiscountListInput {
|
|
855
|
+
userId: string
|
|
856
|
+
newFeeRate: bigint
|
|
857
|
+
ops: bigint
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const QUOTTERY_UPDATE_FEE_DISCOUNT_LIST_INPUT_FIELDS: BinaryField[] = [
|
|
861
|
+
{
|
|
862
|
+
name: 'userId',
|
|
863
|
+
type: 'id',
|
|
864
|
+
offset: 0,
|
|
865
|
+
byteLength: 32,
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
name: 'newFeeRate',
|
|
869
|
+
type: 'uint64',
|
|
870
|
+
offset: 32,
|
|
871
|
+
byteLength: 8,
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
name: 'ops',
|
|
875
|
+
type: 'uint64',
|
|
876
|
+
offset: 40,
|
|
877
|
+
byteLength: 8,
|
|
878
|
+
},
|
|
879
|
+
]
|
|
880
|
+
|
|
881
|
+
export function buildQuotteryUpdateFeeDiscountListInput(
|
|
882
|
+
input: QuotteryUpdateFeeDiscountListInput,
|
|
883
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
884
|
+
): ContractCall {
|
|
885
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_UPDATE_FEE_DISCOUNT_LIST_INPUT_TYPE, payload: buildPayload(QUOTTERY_UPDATE_FEE_DISCOUNT_LIST_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
export const QUOTTERY_PROPOSAL_VOTE_INPUT_TYPE = 100
|
|
889
|
+
|
|
890
|
+
export interface QuotteryProposalVoteInput {
|
|
891
|
+
proposed: QuotteryQtryGOVStruct
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
const QUOTTERY_PROPOSAL_VOTE_INPUT_FIELDS: BinaryField[] = [
|
|
895
|
+
{
|
|
896
|
+
name: 'proposed',
|
|
897
|
+
type: 'struct',
|
|
898
|
+
offset: 0,
|
|
899
|
+
byteLength: 72,
|
|
900
|
+
structRef: 'QtryGOV',
|
|
901
|
+
},
|
|
902
|
+
]
|
|
903
|
+
|
|
904
|
+
export function buildQuotteryProposalVoteInput(
|
|
905
|
+
input: QuotteryProposalVoteInput,
|
|
906
|
+
): ContractCall {
|
|
907
|
+
return { contractIndex: QUOTTERY_CONTRACT_INDEX, inputType: QUOTTERY_PROPOSAL_VOTE_INPUT_TYPE, payload: buildPayload(QUOTTERY_PROPOSAL_VOTE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
export const QUOTTERY_BASIC_INFO_INPUT_TYPE = 1
|
|
911
|
+
export const QUOTTERY_BASIC_INFO_INPUT_SIZE = 0
|
|
912
|
+
|
|
913
|
+
export interface QuotteryBasicInfoOutput {
|
|
914
|
+
operationFee: bigint
|
|
915
|
+
shareholderFee: bigint
|
|
916
|
+
burnFee: bigint
|
|
917
|
+
nIssuedEvent: bigint
|
|
918
|
+
shareholdersRevenue: bigint
|
|
919
|
+
operationRevenue: bigint
|
|
920
|
+
burnedAmount: bigint
|
|
921
|
+
mFeePerDay: bigint
|
|
922
|
+
antiSpamAmount: bigint
|
|
923
|
+
depositAmountForDispute: bigint
|
|
924
|
+
gameOperator: string
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
const QUOTTERY_BASIC_INFO_OUTPUT_FIELDS: BinaryField[] = [
|
|
928
|
+
{
|
|
929
|
+
name: 'operationFee',
|
|
930
|
+
type: 'uint64',
|
|
931
|
+
offset: 0,
|
|
932
|
+
byteLength: 8,
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
name: 'shareholderFee',
|
|
936
|
+
type: 'uint64',
|
|
937
|
+
offset: 8,
|
|
938
|
+
byteLength: 8,
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
name: 'burnFee',
|
|
942
|
+
type: 'uint64',
|
|
943
|
+
offset: 16,
|
|
944
|
+
byteLength: 8,
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
name: 'nIssuedEvent',
|
|
948
|
+
type: 'uint64',
|
|
949
|
+
offset: 24,
|
|
950
|
+
byteLength: 8,
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
name: 'shareholdersRevenue',
|
|
954
|
+
type: 'uint64',
|
|
955
|
+
offset: 32,
|
|
956
|
+
byteLength: 8,
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: 'operationRevenue',
|
|
960
|
+
type: 'uint64',
|
|
961
|
+
offset: 40,
|
|
962
|
+
byteLength: 8,
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: 'burnedAmount',
|
|
966
|
+
type: 'uint64',
|
|
967
|
+
offset: 48,
|
|
968
|
+
byteLength: 8,
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
name: 'mFeePerDay',
|
|
972
|
+
type: 'uint64',
|
|
973
|
+
offset: 56,
|
|
974
|
+
byteLength: 8,
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
name: 'antiSpamAmount',
|
|
978
|
+
type: 'uint64',
|
|
979
|
+
offset: 64,
|
|
980
|
+
byteLength: 8,
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
name: 'depositAmountForDispute',
|
|
984
|
+
type: 'uint64',
|
|
985
|
+
offset: 72,
|
|
986
|
+
byteLength: 8,
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
name: 'gameOperator',
|
|
990
|
+
type: 'id',
|
|
991
|
+
offset: 80,
|
|
992
|
+
byteLength: 32,
|
|
993
|
+
},
|
|
994
|
+
]
|
|
995
|
+
|
|
996
|
+
export function decodeQuotteryBasicInfoOutput(
|
|
997
|
+
data: Uint8Array,
|
|
998
|
+
publicKeyToIdentity: (pk: Uint8Array) => string,
|
|
999
|
+
): QuotteryBasicInfoOutput {
|
|
1000
|
+
return decodePayload(data, QUOTTERY_BASIC_INFO_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QuotteryBasicInfoOutput
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
export async function quotteryBasicInfo(
|
|
1004
|
+
live: SmartContractCaller,
|
|
1005
|
+
options?: ContractCallOptions,
|
|
1006
|
+
): Promise<Result<QuotteryBasicInfoOutput, QubicRpcError>> {
|
|
1007
|
+
return callContractFunction({
|
|
1008
|
+
live,
|
|
1009
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1010
|
+
inputType: QUOTTERY_BASIC_INFO_INPUT_TYPE,
|
|
1011
|
+
inputSize: QUOTTERY_BASIC_INFO_INPUT_SIZE,
|
|
1012
|
+
inputFields: [],
|
|
1013
|
+
outputFields: QUOTTERY_BASIC_INFO_OUTPUT_FIELDS,
|
|
1014
|
+
structs: STRUCTS,
|
|
1015
|
+
input: {},
|
|
1016
|
+
...options,
|
|
1017
|
+
})
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
export const QUOTTERY_GET_EVENT_INFO_INPUT_TYPE = 2
|
|
1021
|
+
export const QUOTTERY_GET_EVENT_INFO_INPUT_SIZE = 8
|
|
1022
|
+
|
|
1023
|
+
export interface QuotteryGetEventInfoInput {
|
|
1024
|
+
eventId: bigint
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
const QUOTTERY_GET_EVENT_INFO_INPUT_FIELDS: BinaryField[] = [
|
|
1028
|
+
{
|
|
1029
|
+
name: 'eventId',
|
|
1030
|
+
type: 'uint64',
|
|
1031
|
+
offset: 0,
|
|
1032
|
+
byteLength: 8,
|
|
1033
|
+
},
|
|
1034
|
+
]
|
|
1035
|
+
|
|
1036
|
+
export function buildQuotteryGetEventInfoInput(
|
|
1037
|
+
input: QuotteryGetEventInfoInput,
|
|
1038
|
+
): Uint8Array {
|
|
1039
|
+
return buildPayload(QUOTTERY_GET_EVENT_INFO_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
export interface QuotteryGetEventInfoOutput {
|
|
1043
|
+
qei: QuotteryQtryEventInfoStruct
|
|
1044
|
+
resultByGO: number
|
|
1045
|
+
publishTickTime: number
|
|
1046
|
+
disputerInfo: QuotteryDepositInfoStruct
|
|
1047
|
+
computorsVote0: number
|
|
1048
|
+
computorsVote1: number
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
const QUOTTERY_GET_EVENT_INFO_OUTPUT_FIELDS: BinaryField[] = [
|
|
1052
|
+
{
|
|
1053
|
+
name: 'qei',
|
|
1054
|
+
type: 'struct',
|
|
1055
|
+
offset: 0,
|
|
1056
|
+
byteLength: 280,
|
|
1057
|
+
structRef: 'QtryEventInfo',
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: 'resultByGO',
|
|
1061
|
+
type: 'sint32',
|
|
1062
|
+
offset: 280,
|
|
1063
|
+
byteLength: 4,
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
name: 'publishTickTime',
|
|
1067
|
+
type: 'uint32',
|
|
1068
|
+
offset: 284,
|
|
1069
|
+
byteLength: 4,
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
name: 'disputerInfo',
|
|
1073
|
+
type: 'struct',
|
|
1074
|
+
offset: 288,
|
|
1075
|
+
byteLength: 40,
|
|
1076
|
+
structRef: 'DepositInfo',
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
name: 'computorsVote0',
|
|
1080
|
+
type: 'uint32',
|
|
1081
|
+
offset: 328,
|
|
1082
|
+
byteLength: 4,
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
name: 'computorsVote1',
|
|
1086
|
+
type: 'uint32',
|
|
1087
|
+
offset: 332,
|
|
1088
|
+
byteLength: 4,
|
|
1089
|
+
},
|
|
1090
|
+
]
|
|
1091
|
+
|
|
1092
|
+
export function decodeQuotteryGetEventInfoOutput(
|
|
1093
|
+
data: Uint8Array,
|
|
1094
|
+
): QuotteryGetEventInfoOutput {
|
|
1095
|
+
return decodePayload(data, QUOTTERY_GET_EVENT_INFO_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetEventInfoOutput
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
export async function quotteryGetEventInfo(
|
|
1099
|
+
live: SmartContractCaller,
|
|
1100
|
+
input: QuotteryGetEventInfoInput,
|
|
1101
|
+
options?: ContractCallOptions,
|
|
1102
|
+
): Promise<Result<QuotteryGetEventInfoOutput, QubicRpcError>> {
|
|
1103
|
+
return callContractFunction({
|
|
1104
|
+
live,
|
|
1105
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1106
|
+
inputType: QUOTTERY_GET_EVENT_INFO_INPUT_TYPE,
|
|
1107
|
+
inputSize: QUOTTERY_GET_EVENT_INFO_INPUT_SIZE,
|
|
1108
|
+
inputFields: QUOTTERY_GET_EVENT_INFO_INPUT_FIELDS,
|
|
1109
|
+
outputFields: QUOTTERY_GET_EVENT_INFO_OUTPUT_FIELDS,
|
|
1110
|
+
structs: STRUCTS,
|
|
1111
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1112
|
+
...options,
|
|
1113
|
+
})
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
export const QUOTTERY_GET_ORDERS_INPUT_TYPE = 3
|
|
1117
|
+
export const QUOTTERY_GET_ORDERS_INPUT_SIZE = 32
|
|
1118
|
+
|
|
1119
|
+
export interface QuotteryGetOrdersInput {
|
|
1120
|
+
eventId: bigint
|
|
1121
|
+
option: bigint
|
|
1122
|
+
isBid: bigint
|
|
1123
|
+
offset: bigint
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
const QUOTTERY_GET_ORDERS_INPUT_FIELDS: BinaryField[] = [
|
|
1127
|
+
{
|
|
1128
|
+
name: 'eventId',
|
|
1129
|
+
type: 'uint64',
|
|
1130
|
+
offset: 0,
|
|
1131
|
+
byteLength: 8,
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
name: 'option',
|
|
1135
|
+
type: 'uint64',
|
|
1136
|
+
offset: 8,
|
|
1137
|
+
byteLength: 8,
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
name: 'isBid',
|
|
1141
|
+
type: 'uint64',
|
|
1142
|
+
offset: 16,
|
|
1143
|
+
byteLength: 8,
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
name: 'offset',
|
|
1147
|
+
type: 'uint64',
|
|
1148
|
+
offset: 24,
|
|
1149
|
+
byteLength: 8,
|
|
1150
|
+
},
|
|
1151
|
+
]
|
|
1152
|
+
|
|
1153
|
+
export function buildQuotteryGetOrdersInput(
|
|
1154
|
+
input: QuotteryGetOrdersInput,
|
|
1155
|
+
): Uint8Array {
|
|
1156
|
+
return buildPayload(QUOTTERY_GET_ORDERS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
export interface QuotteryGetOrdersOutput {
|
|
1160
|
+
orders: number[]
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
const QUOTTERY_GET_ORDERS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1164
|
+
{
|
|
1165
|
+
name: 'orders',
|
|
1166
|
+
type: 'array',
|
|
1167
|
+
offset: 0,
|
|
1168
|
+
byteLength: 12288,
|
|
1169
|
+
arrayLength: 256,
|
|
1170
|
+
arrayItemByteLength: 48,
|
|
1171
|
+
arrayItemStructRef: 'QtryOrderWithPrice',
|
|
1172
|
+
},
|
|
1173
|
+
]
|
|
1174
|
+
|
|
1175
|
+
export function decodeQuotteryGetOrdersOutput(
|
|
1176
|
+
data: Uint8Array,
|
|
1177
|
+
): QuotteryGetOrdersOutput {
|
|
1178
|
+
return decodePayload(data, QUOTTERY_GET_ORDERS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetOrdersOutput
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export async function quotteryGetOrders(
|
|
1182
|
+
live: SmartContractCaller,
|
|
1183
|
+
input: QuotteryGetOrdersInput,
|
|
1184
|
+
options?: ContractCallOptions,
|
|
1185
|
+
): Promise<Result<QuotteryGetOrdersOutput, QubicRpcError>> {
|
|
1186
|
+
return callContractFunction({
|
|
1187
|
+
live,
|
|
1188
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1189
|
+
inputType: QUOTTERY_GET_ORDERS_INPUT_TYPE,
|
|
1190
|
+
inputSize: QUOTTERY_GET_ORDERS_INPUT_SIZE,
|
|
1191
|
+
inputFields: QUOTTERY_GET_ORDERS_INPUT_FIELDS,
|
|
1192
|
+
outputFields: QUOTTERY_GET_ORDERS_OUTPUT_FIELDS,
|
|
1193
|
+
structs: STRUCTS,
|
|
1194
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1195
|
+
...options,
|
|
1196
|
+
})
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
export const QUOTTERY_GET_ACTIVE_EVENT_INPUT_TYPE = 4
|
|
1200
|
+
export const QUOTTERY_GET_ACTIVE_EVENT_INPUT_SIZE = 0
|
|
1201
|
+
|
|
1202
|
+
export interface QuotteryGetActiveEventOutput {
|
|
1203
|
+
recentActiveEvent: bigint[]
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
const QUOTTERY_GET_ACTIVE_EVENT_OUTPUT_FIELDS: BinaryField[] = [
|
|
1207
|
+
{
|
|
1208
|
+
name: 'recentActiveEvent',
|
|
1209
|
+
type: 'array',
|
|
1210
|
+
offset: 0,
|
|
1211
|
+
byteLength: 0,
|
|
1212
|
+
arrayLength: 0,
|
|
1213
|
+
arrayItemType: 'uint64',
|
|
1214
|
+
arrayItemByteLength: 8,
|
|
1215
|
+
},
|
|
1216
|
+
]
|
|
1217
|
+
|
|
1218
|
+
export function decodeQuotteryGetActiveEventOutput(
|
|
1219
|
+
data: Uint8Array,
|
|
1220
|
+
): QuotteryGetActiveEventOutput {
|
|
1221
|
+
return decodePayload(data, QUOTTERY_GET_ACTIVE_EVENT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetActiveEventOutput
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
export async function quotteryGetActiveEvent(
|
|
1225
|
+
live: SmartContractCaller,
|
|
1226
|
+
options?: ContractCallOptions,
|
|
1227
|
+
): Promise<Result<QuotteryGetActiveEventOutput, QubicRpcError>> {
|
|
1228
|
+
return callContractFunction({
|
|
1229
|
+
live,
|
|
1230
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1231
|
+
inputType: QUOTTERY_GET_ACTIVE_EVENT_INPUT_TYPE,
|
|
1232
|
+
inputSize: QUOTTERY_GET_ACTIVE_EVENT_INPUT_SIZE,
|
|
1233
|
+
inputFields: [],
|
|
1234
|
+
outputFields: QUOTTERY_GET_ACTIVE_EVENT_OUTPUT_FIELDS,
|
|
1235
|
+
structs: STRUCTS,
|
|
1236
|
+
input: {},
|
|
1237
|
+
...options,
|
|
1238
|
+
})
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
export const QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_TYPE = 5
|
|
1242
|
+
export const QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_SIZE = 512
|
|
1243
|
+
|
|
1244
|
+
export interface QuotteryGetEventInfoBatchInput {
|
|
1245
|
+
eventIds: bigint[]
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
const QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_FIELDS: BinaryField[] = [
|
|
1249
|
+
{
|
|
1250
|
+
name: 'eventIds',
|
|
1251
|
+
type: 'array',
|
|
1252
|
+
offset: 0,
|
|
1253
|
+
byteLength: 512,
|
|
1254
|
+
arrayLength: 64,
|
|
1255
|
+
arrayItemType: 'uint64',
|
|
1256
|
+
arrayItemByteLength: 8,
|
|
1257
|
+
},
|
|
1258
|
+
]
|
|
1259
|
+
|
|
1260
|
+
export function buildQuotteryGetEventInfoBatchInput(
|
|
1261
|
+
input: QuotteryGetEventInfoBatchInput,
|
|
1262
|
+
): Uint8Array {
|
|
1263
|
+
return buildPayload(QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
export interface QuotteryGetEventInfoBatchOutput {
|
|
1267
|
+
aqei: number[]
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
const QUOTTERY_GET_EVENT_INFO_BATCH_OUTPUT_FIELDS: BinaryField[] = [
|
|
1271
|
+
{
|
|
1272
|
+
name: 'aqei',
|
|
1273
|
+
type: 'array',
|
|
1274
|
+
offset: 0,
|
|
1275
|
+
byteLength: 17920,
|
|
1276
|
+
arrayLength: 64,
|
|
1277
|
+
arrayItemByteLength: 280,
|
|
1278
|
+
arrayItemStructRef: 'QtryEventInfo',
|
|
1279
|
+
},
|
|
1280
|
+
]
|
|
1281
|
+
|
|
1282
|
+
export function decodeQuotteryGetEventInfoBatchOutput(
|
|
1283
|
+
data: Uint8Array,
|
|
1284
|
+
): QuotteryGetEventInfoBatchOutput {
|
|
1285
|
+
return decodePayload(data, QUOTTERY_GET_EVENT_INFO_BATCH_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetEventInfoBatchOutput
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
export async function quotteryGetEventInfoBatch(
|
|
1289
|
+
live: SmartContractCaller,
|
|
1290
|
+
input: QuotteryGetEventInfoBatchInput,
|
|
1291
|
+
options?: ContractCallOptions,
|
|
1292
|
+
): Promise<Result<QuotteryGetEventInfoBatchOutput, QubicRpcError>> {
|
|
1293
|
+
return callContractFunction({
|
|
1294
|
+
live,
|
|
1295
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1296
|
+
inputType: QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_TYPE,
|
|
1297
|
+
inputSize: QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_SIZE,
|
|
1298
|
+
inputFields: QUOTTERY_GET_EVENT_INFO_BATCH_INPUT_FIELDS,
|
|
1299
|
+
outputFields: QUOTTERY_GET_EVENT_INFO_BATCH_OUTPUT_FIELDS,
|
|
1300
|
+
structs: STRUCTS,
|
|
1301
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1302
|
+
...options,
|
|
1303
|
+
})
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
export const QUOTTERY_GET_USER_POSITION_INPUT_TYPE = 6
|
|
1307
|
+
export const QUOTTERY_GET_USER_POSITION_INPUT_SIZE = 32
|
|
1308
|
+
|
|
1309
|
+
export interface QuotteryGetUserPositionInput {
|
|
1310
|
+
uid: string
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
const QUOTTERY_GET_USER_POSITION_INPUT_FIELDS: BinaryField[] = [
|
|
1314
|
+
{
|
|
1315
|
+
name: 'uid',
|
|
1316
|
+
type: 'id',
|
|
1317
|
+
offset: 0,
|
|
1318
|
+
byteLength: 32,
|
|
1319
|
+
},
|
|
1320
|
+
]
|
|
1321
|
+
|
|
1322
|
+
export function buildQuotteryGetUserPositionInput(
|
|
1323
|
+
input: QuotteryGetUserPositionInput,
|
|
1324
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
1325
|
+
): Uint8Array {
|
|
1326
|
+
return buildPayload(QUOTTERY_GET_USER_POSITION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
export interface QuotteryGetUserPositionOutput {
|
|
1330
|
+
count: bigint
|
|
1331
|
+
p: number[]
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
const QUOTTERY_GET_USER_POSITION_OUTPUT_FIELDS: BinaryField[] = [
|
|
1335
|
+
{
|
|
1336
|
+
name: 'count',
|
|
1337
|
+
type: 'sint64',
|
|
1338
|
+
offset: 0,
|
|
1339
|
+
byteLength: 8,
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
name: 'p',
|
|
1343
|
+
type: 'array',
|
|
1344
|
+
offset: 8,
|
|
1345
|
+
byteLength: 16384,
|
|
1346
|
+
arrayLength: 1024,
|
|
1347
|
+
arrayItemByteLength: 16,
|
|
1348
|
+
arrayItemStructRef: 'PositionInfo',
|
|
1349
|
+
},
|
|
1350
|
+
]
|
|
1351
|
+
|
|
1352
|
+
export function decodeQuotteryGetUserPositionOutput(
|
|
1353
|
+
data: Uint8Array,
|
|
1354
|
+
): QuotteryGetUserPositionOutput {
|
|
1355
|
+
return decodePayload(data, QUOTTERY_GET_USER_POSITION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetUserPositionOutput
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
export async function quotteryGetUserPosition(
|
|
1359
|
+
live: SmartContractCaller,
|
|
1360
|
+
input: QuotteryGetUserPositionInput,
|
|
1361
|
+
options?: ContractCallOptions,
|
|
1362
|
+
): Promise<Result<QuotteryGetUserPositionOutput, QubicRpcError>> {
|
|
1363
|
+
return callContractFunction({
|
|
1364
|
+
live,
|
|
1365
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1366
|
+
inputType: QUOTTERY_GET_USER_POSITION_INPUT_TYPE,
|
|
1367
|
+
inputSize: QUOTTERY_GET_USER_POSITION_INPUT_SIZE,
|
|
1368
|
+
inputFields: QUOTTERY_GET_USER_POSITION_INPUT_FIELDS,
|
|
1369
|
+
outputFields: QUOTTERY_GET_USER_POSITION_OUTPUT_FIELDS,
|
|
1370
|
+
structs: STRUCTS,
|
|
1371
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1372
|
+
...options,
|
|
1373
|
+
})
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
export const QUOTTERY_GET_APPROVED_AMOUNT_INPUT_TYPE = 7
|
|
1377
|
+
export const QUOTTERY_GET_APPROVED_AMOUNT_INPUT_SIZE = 32
|
|
1378
|
+
|
|
1379
|
+
export interface QuotteryGetApprovedAmountInput {
|
|
1380
|
+
pk: string
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
const QUOTTERY_GET_APPROVED_AMOUNT_INPUT_FIELDS: BinaryField[] = [
|
|
1384
|
+
{
|
|
1385
|
+
name: 'pk',
|
|
1386
|
+
type: 'id',
|
|
1387
|
+
offset: 0,
|
|
1388
|
+
byteLength: 32,
|
|
1389
|
+
},
|
|
1390
|
+
]
|
|
1391
|
+
|
|
1392
|
+
export function buildQuotteryGetApprovedAmountInput(
|
|
1393
|
+
input: QuotteryGetApprovedAmountInput,
|
|
1394
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
1395
|
+
): Uint8Array {
|
|
1396
|
+
return buildPayload(QUOTTERY_GET_APPROVED_AMOUNT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
export interface QuotteryGetApprovedAmountOutput {
|
|
1400
|
+
amount: bigint
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
const QUOTTERY_GET_APPROVED_AMOUNT_OUTPUT_FIELDS: BinaryField[] = [
|
|
1404
|
+
{
|
|
1405
|
+
name: 'amount',
|
|
1406
|
+
type: 'uint64',
|
|
1407
|
+
offset: 0,
|
|
1408
|
+
byteLength: 8,
|
|
1409
|
+
},
|
|
1410
|
+
]
|
|
1411
|
+
|
|
1412
|
+
export function decodeQuotteryGetApprovedAmountOutput(
|
|
1413
|
+
data: Uint8Array,
|
|
1414
|
+
): QuotteryGetApprovedAmountOutput {
|
|
1415
|
+
return decodePayload(data, QUOTTERY_GET_APPROVED_AMOUNT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetApprovedAmountOutput
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
export async function quotteryGetApprovedAmount(
|
|
1419
|
+
live: SmartContractCaller,
|
|
1420
|
+
input: QuotteryGetApprovedAmountInput,
|
|
1421
|
+
options?: ContractCallOptions,
|
|
1422
|
+
): Promise<Result<QuotteryGetApprovedAmountOutput, QubicRpcError>> {
|
|
1423
|
+
return callContractFunction({
|
|
1424
|
+
live,
|
|
1425
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1426
|
+
inputType: QUOTTERY_GET_APPROVED_AMOUNT_INPUT_TYPE,
|
|
1427
|
+
inputSize: QUOTTERY_GET_APPROVED_AMOUNT_INPUT_SIZE,
|
|
1428
|
+
inputFields: QUOTTERY_GET_APPROVED_AMOUNT_INPUT_FIELDS,
|
|
1429
|
+
outputFields: QUOTTERY_GET_APPROVED_AMOUNT_OUTPUT_FIELDS,
|
|
1430
|
+
structs: STRUCTS,
|
|
1431
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1432
|
+
...options,
|
|
1433
|
+
})
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
export const QUOTTERY_GET_TOP_PROPOSALS_INPUT_TYPE = 8
|
|
1437
|
+
export const QUOTTERY_GET_TOP_PROPOSALS_INPUT_SIZE = 0
|
|
1438
|
+
|
|
1439
|
+
export interface QuotteryGetTopProposalsOutput {
|
|
1440
|
+
top: number[]
|
|
1441
|
+
uniqueCount: number
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
const QUOTTERY_GET_TOP_PROPOSALS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1445
|
+
{
|
|
1446
|
+
name: 'top',
|
|
1447
|
+
type: 'array',
|
|
1448
|
+
offset: 0,
|
|
1449
|
+
byteLength: 320,
|
|
1450
|
+
arrayLength: 4,
|
|
1451
|
+
arrayItemByteLength: 80,
|
|
1452
|
+
arrayItemStructRef: 'ProposalInfo',
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
name: 'uniqueCount',
|
|
1456
|
+
type: 'sint32',
|
|
1457
|
+
offset: 320,
|
|
1458
|
+
byteLength: 4,
|
|
1459
|
+
},
|
|
1460
|
+
]
|
|
1461
|
+
|
|
1462
|
+
export function decodeQuotteryGetTopProposalsOutput(
|
|
1463
|
+
data: Uint8Array,
|
|
1464
|
+
): QuotteryGetTopProposalsOutput {
|
|
1465
|
+
return decodePayload(data, QUOTTERY_GET_TOP_PROPOSALS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QuotteryGetTopProposalsOutput
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
export async function quotteryGetTopProposals(
|
|
1469
|
+
live: SmartContractCaller,
|
|
1470
|
+
options?: ContractCallOptions,
|
|
1471
|
+
): Promise<Result<QuotteryGetTopProposalsOutput, QubicRpcError>> {
|
|
1472
|
+
return callContractFunction({
|
|
1473
|
+
live,
|
|
1474
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1475
|
+
inputType: QUOTTERY_GET_TOP_PROPOSALS_INPUT_TYPE,
|
|
1476
|
+
inputSize: QUOTTERY_GET_TOP_PROPOSALS_INPUT_SIZE,
|
|
1477
|
+
inputFields: [],
|
|
1478
|
+
outputFields: QUOTTERY_GET_TOP_PROPOSALS_OUTPUT_FIELDS,
|
|
1479
|
+
structs: STRUCTS,
|
|
1480
|
+
input: {},
|
|
1481
|
+
...options,
|
|
1482
|
+
})
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
export const quottery = {
|
|
1486
|
+
contractIndex: QUOTTERY_CONTRACT_INDEX,
|
|
1487
|
+
BasicInfo: quotteryBasicInfo,
|
|
1488
|
+
GetEventInfo: quotteryGetEventInfo,
|
|
1489
|
+
GetOrders: quotteryGetOrders,
|
|
1490
|
+
GetActiveEvent: quotteryGetActiveEvent,
|
|
1491
|
+
GetEventInfoBatch: quotteryGetEventInfoBatch,
|
|
1492
|
+
GetUserPosition: quotteryGetUserPosition,
|
|
1493
|
+
GetApprovedAmount: quotteryGetApprovedAmount,
|
|
1494
|
+
GetTopProposals: quotteryGetTopProposals,
|
|
1495
|
+
buildCreateEventInput: buildQuotteryCreateEventInput,
|
|
1496
|
+
buildAddToAskOrderInput: buildQuotteryAddToAskOrderInput,
|
|
1497
|
+
decodeAddToAskOrderOutput: decodeQuotteryAddToAskOrderOutput,
|
|
1498
|
+
buildRemoveAskOrderInput: buildQuotteryRemoveAskOrderInput,
|
|
1499
|
+
decodeRemoveAskOrderOutput: decodeQuotteryRemoveAskOrderOutput,
|
|
1500
|
+
buildAddToBidOrderInput: buildQuotteryAddToBidOrderInput,
|
|
1501
|
+
decodeAddToBidOrderOutput: decodeQuotteryAddToBidOrderOutput,
|
|
1502
|
+
buildRemoveBidOrderInput: buildQuotteryRemoveBidOrderInput,
|
|
1503
|
+
decodeRemoveBidOrderOutput: decodeQuotteryRemoveBidOrderOutput,
|
|
1504
|
+
buildPublishResultInput: buildQuotteryPublishResultInput,
|
|
1505
|
+
buildTryFinalizeEventInput: buildQuotteryTryFinalizeEventInput,
|
|
1506
|
+
buildDisputeInput: buildQuotteryDisputeInput,
|
|
1507
|
+
buildResolveDisputeInput: buildQuotteryResolveDisputeInput,
|
|
1508
|
+
buildUserClaimRewardInput: buildQuotteryUserClaimRewardInput,
|
|
1509
|
+
buildGOForceClaimRewardInput: buildQuotteryGOForceClaimRewardInput,
|
|
1510
|
+
buildTransferQUSDInput: buildQuotteryTransferQUSDInput,
|
|
1511
|
+
decodeTransferQUSDOutput: decodeQuotteryTransferQUSDOutput,
|
|
1512
|
+
buildTransferShareManagementRightsInput: buildQuotteryTransferShareManagementRightsInput,
|
|
1513
|
+
decodeTransferShareManagementRightsOutput: decodeQuotteryTransferShareManagementRightsOutput,
|
|
1514
|
+
buildTransferQTRYGOVInput: buildQuotteryTransferQTRYGOVInput,
|
|
1515
|
+
decodeTransferQTRYGOVOutput: decodeQuotteryTransferQTRYGOVOutput,
|
|
1516
|
+
buildUpdateFeeDiscountListInput: buildQuotteryUpdateFeeDiscountListInput,
|
|
1517
|
+
buildProposalVoteInput: buildQuotteryProposalVoteInput,
|
|
1518
|
+
}
|
|
1519
|
+
|