@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,1506 @@
|
|
|
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 Q_UTIL_CONTRACT_INDEX = 4
|
|
9
|
+
|
|
10
|
+
export interface QUtilAssetStruct {
|
|
11
|
+
issuer: string
|
|
12
|
+
assetName: bigint
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface QUtilOIPriceOracleQueryStruct {
|
|
16
|
+
oracle: string
|
|
17
|
+
timestamp: QUtilDateAndTimeStruct
|
|
18
|
+
currency1: string
|
|
19
|
+
currency2: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface QUtilPollStruct {
|
|
23
|
+
poll_name: string
|
|
24
|
+
poll_type: bigint
|
|
25
|
+
min_amount: bigint
|
|
26
|
+
is_active: bigint
|
|
27
|
+
creator: string
|
|
28
|
+
allowed_assets: number[]
|
|
29
|
+
num_assets: bigint
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface QUtilDateAndTimeStruct {
|
|
33
|
+
value: bigint
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const STRUCTS: Record<string, NamedStruct> = {
|
|
37
|
+
'Asset': {
|
|
38
|
+
name: 'Asset',
|
|
39
|
+
byteLength: 40,
|
|
40
|
+
fields: [
|
|
41
|
+
{
|
|
42
|
+
name: 'issuer',
|
|
43
|
+
type: 'id',
|
|
44
|
+
offset: 0,
|
|
45
|
+
byteLength: 32,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'assetName',
|
|
49
|
+
type: 'uint64',
|
|
50
|
+
offset: 32,
|
|
51
|
+
byteLength: 8,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
'OI::Price::OracleQuery': {
|
|
56
|
+
name: 'OI::Price::OracleQuery',
|
|
57
|
+
byteLength: 104,
|
|
58
|
+
fields: [
|
|
59
|
+
{
|
|
60
|
+
name: 'oracle',
|
|
61
|
+
type: 'id',
|
|
62
|
+
offset: 0,
|
|
63
|
+
byteLength: 32,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'timestamp',
|
|
67
|
+
type: 'struct',
|
|
68
|
+
offset: 32,
|
|
69
|
+
byteLength: 8,
|
|
70
|
+
structRef: 'DateAndTime',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'currency1',
|
|
74
|
+
type: 'id',
|
|
75
|
+
offset: 40,
|
|
76
|
+
byteLength: 32,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'currency2',
|
|
80
|
+
type: 'id',
|
|
81
|
+
offset: 72,
|
|
82
|
+
byteLength: 32,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
'Poll': {
|
|
87
|
+
name: 'Poll',
|
|
88
|
+
byteLength: 736,
|
|
89
|
+
fields: [
|
|
90
|
+
{
|
|
91
|
+
name: 'poll_name',
|
|
92
|
+
type: 'id',
|
|
93
|
+
offset: 0,
|
|
94
|
+
byteLength: 32,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'poll_type',
|
|
98
|
+
type: 'uint64',
|
|
99
|
+
offset: 32,
|
|
100
|
+
byteLength: 8,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'min_amount',
|
|
104
|
+
type: 'uint64',
|
|
105
|
+
offset: 40,
|
|
106
|
+
byteLength: 8,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'is_active',
|
|
110
|
+
type: 'uint64',
|
|
111
|
+
offset: 48,
|
|
112
|
+
byteLength: 8,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'creator',
|
|
116
|
+
type: 'id',
|
|
117
|
+
offset: 56,
|
|
118
|
+
byteLength: 32,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'allowed_assets',
|
|
122
|
+
type: 'array',
|
|
123
|
+
offset: 88,
|
|
124
|
+
byteLength: 640,
|
|
125
|
+
arrayLength: 16,
|
|
126
|
+
arrayItemByteLength: 40,
|
|
127
|
+
arrayItemStructRef: 'Asset',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'num_assets',
|
|
131
|
+
type: 'uint64',
|
|
132
|
+
offset: 728,
|
|
133
|
+
byteLength: 8,
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
'DateAndTime': {
|
|
138
|
+
name: 'DateAndTime',
|
|
139
|
+
byteLength: 8,
|
|
140
|
+
fields: [
|
|
141
|
+
{
|
|
142
|
+
name: 'value',
|
|
143
|
+
type: 'uint64',
|
|
144
|
+
offset: 0,
|
|
145
|
+
byteLength: 8,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const Q_UTIL_SEND_TO_MANY_V1_INPUT_TYPE = 1
|
|
152
|
+
|
|
153
|
+
export interface QUtilSendToManyV1Input {
|
|
154
|
+
dst0: string
|
|
155
|
+
amt0: bigint
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const Q_UTIL_SEND_TO_MANY_V1_INPUT_FIELDS: BinaryField[] = [
|
|
159
|
+
{
|
|
160
|
+
name: 'dst0',
|
|
161
|
+
type: 'id',
|
|
162
|
+
offset: 0,
|
|
163
|
+
byteLength: 32,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'amt0',
|
|
167
|
+
type: 'sint64',
|
|
168
|
+
offset: 32,
|
|
169
|
+
byteLength: 8,
|
|
170
|
+
},
|
|
171
|
+
]
|
|
172
|
+
|
|
173
|
+
export function buildQUtilSendToManyV1Input(
|
|
174
|
+
input: QUtilSendToManyV1Input,
|
|
175
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
176
|
+
): ContractCall {
|
|
177
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_SEND_TO_MANY_V1_INPUT_TYPE, payload: buildPayload(Q_UTIL_SEND_TO_MANY_V1_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface QUtilSendToManyV1Output {
|
|
181
|
+
returnCode: number
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const Q_UTIL_SEND_TO_MANY_V1_OUTPUT_FIELDS: BinaryField[] = [
|
|
185
|
+
{
|
|
186
|
+
name: 'returnCode',
|
|
187
|
+
type: 'sint32',
|
|
188
|
+
offset: 0,
|
|
189
|
+
byteLength: 4,
|
|
190
|
+
},
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
export function decodeQUtilSendToManyV1Output(
|
|
194
|
+
data: Uint8Array,
|
|
195
|
+
): QUtilSendToManyV1Output {
|
|
196
|
+
return decodePayload(data, Q_UTIL_SEND_TO_MANY_V1_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilSendToManyV1Output
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const Q_UTIL_BURN_QUBIC_INPUT_TYPE = 2
|
|
200
|
+
|
|
201
|
+
export interface QUtilBurnQubicInput {
|
|
202
|
+
amount: bigint
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const Q_UTIL_BURN_QUBIC_INPUT_FIELDS: BinaryField[] = [
|
|
206
|
+
{
|
|
207
|
+
name: 'amount',
|
|
208
|
+
type: 'sint64',
|
|
209
|
+
offset: 0,
|
|
210
|
+
byteLength: 8,
|
|
211
|
+
},
|
|
212
|
+
]
|
|
213
|
+
|
|
214
|
+
export function buildQUtilBurnQubicInput(
|
|
215
|
+
input: QUtilBurnQubicInput,
|
|
216
|
+
): ContractCall {
|
|
217
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_BURN_QUBIC_INPUT_TYPE, payload: buildPayload(Q_UTIL_BURN_QUBIC_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface QUtilBurnQubicOutput {
|
|
221
|
+
amount: bigint
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const Q_UTIL_BURN_QUBIC_OUTPUT_FIELDS: BinaryField[] = [
|
|
225
|
+
{
|
|
226
|
+
name: 'amount',
|
|
227
|
+
type: 'sint64',
|
|
228
|
+
offset: 0,
|
|
229
|
+
byteLength: 8,
|
|
230
|
+
},
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
export function decodeQUtilBurnQubicOutput(
|
|
234
|
+
data: Uint8Array,
|
|
235
|
+
): QUtilBurnQubicOutput {
|
|
236
|
+
return decodePayload(data, Q_UTIL_BURN_QUBIC_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilBurnQubicOutput
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export const Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_TYPE = 3
|
|
240
|
+
|
|
241
|
+
export interface QUtilSendToManyBenchmarkInput {
|
|
242
|
+
dstCount: bigint
|
|
243
|
+
numTransfersEach: bigint
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_FIELDS: BinaryField[] = [
|
|
247
|
+
{
|
|
248
|
+
name: 'dstCount',
|
|
249
|
+
type: 'sint64',
|
|
250
|
+
offset: 0,
|
|
251
|
+
byteLength: 8,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: 'numTransfersEach',
|
|
255
|
+
type: 'sint64',
|
|
256
|
+
offset: 8,
|
|
257
|
+
byteLength: 8,
|
|
258
|
+
},
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
export function buildQUtilSendToManyBenchmarkInput(
|
|
262
|
+
input: QUtilSendToManyBenchmarkInput,
|
|
263
|
+
): ContractCall {
|
|
264
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_TYPE, payload: buildPayload(Q_UTIL_SEND_TO_MANY_BENCHMARK_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface QUtilSendToManyBenchmarkOutput {
|
|
268
|
+
dstCount: bigint
|
|
269
|
+
returnCode: number
|
|
270
|
+
total: bigint
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const Q_UTIL_SEND_TO_MANY_BENCHMARK_OUTPUT_FIELDS: BinaryField[] = [
|
|
274
|
+
{
|
|
275
|
+
name: 'dstCount',
|
|
276
|
+
type: 'sint64',
|
|
277
|
+
offset: 0,
|
|
278
|
+
byteLength: 8,
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: 'returnCode',
|
|
282
|
+
type: 'sint32',
|
|
283
|
+
offset: 8,
|
|
284
|
+
byteLength: 4,
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'total',
|
|
288
|
+
type: 'sint64',
|
|
289
|
+
offset: 12,
|
|
290
|
+
byteLength: 8,
|
|
291
|
+
},
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
export function decodeQUtilSendToManyBenchmarkOutput(
|
|
295
|
+
data: Uint8Array,
|
|
296
|
+
): QUtilSendToManyBenchmarkOutput {
|
|
297
|
+
return decodePayload(data, Q_UTIL_SEND_TO_MANY_BENCHMARK_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilSendToManyBenchmarkOutput
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export const Q_UTIL_CREATE_POLL_INPUT_TYPE = 4
|
|
301
|
+
|
|
302
|
+
export interface QUtilCreatePollInput {
|
|
303
|
+
poll_name: string
|
|
304
|
+
poll_type: bigint
|
|
305
|
+
min_amount: bigint
|
|
306
|
+
github_link: number[]
|
|
307
|
+
allowed_assets: number[]
|
|
308
|
+
num_assets: bigint
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const Q_UTIL_CREATE_POLL_INPUT_FIELDS: BinaryField[] = [
|
|
312
|
+
{
|
|
313
|
+
name: 'poll_name',
|
|
314
|
+
type: 'id',
|
|
315
|
+
offset: 0,
|
|
316
|
+
byteLength: 32,
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: 'poll_type',
|
|
320
|
+
type: 'uint64',
|
|
321
|
+
offset: 32,
|
|
322
|
+
byteLength: 8,
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: 'min_amount',
|
|
326
|
+
type: 'uint64',
|
|
327
|
+
offset: 40,
|
|
328
|
+
byteLength: 8,
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
name: 'github_link',
|
|
332
|
+
type: 'array',
|
|
333
|
+
offset: 48,
|
|
334
|
+
byteLength: 256,
|
|
335
|
+
arrayLength: 256,
|
|
336
|
+
arrayItemType: 'uint8',
|
|
337
|
+
arrayItemByteLength: 1,
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: 'allowed_assets',
|
|
341
|
+
type: 'array',
|
|
342
|
+
offset: 304,
|
|
343
|
+
byteLength: 640,
|
|
344
|
+
arrayLength: 16,
|
|
345
|
+
arrayItemByteLength: 40,
|
|
346
|
+
arrayItemStructRef: 'Asset',
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'num_assets',
|
|
350
|
+
type: 'uint64',
|
|
351
|
+
offset: 944,
|
|
352
|
+
byteLength: 8,
|
|
353
|
+
},
|
|
354
|
+
]
|
|
355
|
+
|
|
356
|
+
export function buildQUtilCreatePollInput(
|
|
357
|
+
input: QUtilCreatePollInput,
|
|
358
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
359
|
+
): ContractCall {
|
|
360
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_CREATE_POLL_INPUT_TYPE, payload: buildPayload(Q_UTIL_CREATE_POLL_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export interface QUtilCreatePollOutput {
|
|
364
|
+
poll_id: bigint
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const Q_UTIL_CREATE_POLL_OUTPUT_FIELDS: BinaryField[] = [
|
|
368
|
+
{
|
|
369
|
+
name: 'poll_id',
|
|
370
|
+
type: 'uint64',
|
|
371
|
+
offset: 0,
|
|
372
|
+
byteLength: 8,
|
|
373
|
+
},
|
|
374
|
+
]
|
|
375
|
+
|
|
376
|
+
export function decodeQUtilCreatePollOutput(
|
|
377
|
+
data: Uint8Array,
|
|
378
|
+
): QUtilCreatePollOutput {
|
|
379
|
+
return decodePayload(data, Q_UTIL_CREATE_POLL_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilCreatePollOutput
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export const Q_UTIL_VOTE_INPUT_TYPE = 5
|
|
383
|
+
|
|
384
|
+
export interface QUtilVoteInput {
|
|
385
|
+
poll_id: bigint
|
|
386
|
+
address: string
|
|
387
|
+
amount: bigint
|
|
388
|
+
chosen_option: bigint
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const Q_UTIL_VOTE_INPUT_FIELDS: BinaryField[] = [
|
|
392
|
+
{
|
|
393
|
+
name: 'poll_id',
|
|
394
|
+
type: 'uint64',
|
|
395
|
+
offset: 0,
|
|
396
|
+
byteLength: 8,
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'address',
|
|
400
|
+
type: 'id',
|
|
401
|
+
offset: 8,
|
|
402
|
+
byteLength: 32,
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: 'amount',
|
|
406
|
+
type: 'uint64',
|
|
407
|
+
offset: 40,
|
|
408
|
+
byteLength: 8,
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'chosen_option',
|
|
412
|
+
type: 'uint64',
|
|
413
|
+
offset: 48,
|
|
414
|
+
byteLength: 8,
|
|
415
|
+
},
|
|
416
|
+
]
|
|
417
|
+
|
|
418
|
+
export function buildQUtilVoteInput(
|
|
419
|
+
input: QUtilVoteInput,
|
|
420
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
421
|
+
): ContractCall {
|
|
422
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_VOTE_INPUT_TYPE, payload: buildPayload(Q_UTIL_VOTE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export interface QUtilVoteOutput {
|
|
426
|
+
success: number
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const Q_UTIL_VOTE_OUTPUT_FIELDS: BinaryField[] = [
|
|
430
|
+
{
|
|
431
|
+
name: 'success',
|
|
432
|
+
type: 'uint8',
|
|
433
|
+
offset: 0,
|
|
434
|
+
byteLength: 1,
|
|
435
|
+
},
|
|
436
|
+
]
|
|
437
|
+
|
|
438
|
+
export function decodeQUtilVoteOutput(
|
|
439
|
+
data: Uint8Array,
|
|
440
|
+
): QUtilVoteOutput {
|
|
441
|
+
return decodePayload(data, Q_UTIL_VOTE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilVoteOutput
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export const Q_UTIL_CANCEL_POLL_INPUT_TYPE = 6
|
|
445
|
+
|
|
446
|
+
export interface QUtilCancelPollInput {
|
|
447
|
+
poll_id: bigint
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const Q_UTIL_CANCEL_POLL_INPUT_FIELDS: BinaryField[] = [
|
|
451
|
+
{
|
|
452
|
+
name: 'poll_id',
|
|
453
|
+
type: 'uint64',
|
|
454
|
+
offset: 0,
|
|
455
|
+
byteLength: 8,
|
|
456
|
+
},
|
|
457
|
+
]
|
|
458
|
+
|
|
459
|
+
export function buildQUtilCancelPollInput(
|
|
460
|
+
input: QUtilCancelPollInput,
|
|
461
|
+
): ContractCall {
|
|
462
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_CANCEL_POLL_INPUT_TYPE, payload: buildPayload(Q_UTIL_CANCEL_POLL_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export interface QUtilCancelPollOutput {
|
|
466
|
+
success: number
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const Q_UTIL_CANCEL_POLL_OUTPUT_FIELDS: BinaryField[] = [
|
|
470
|
+
{
|
|
471
|
+
name: 'success',
|
|
472
|
+
type: 'uint8',
|
|
473
|
+
offset: 0,
|
|
474
|
+
byteLength: 1,
|
|
475
|
+
},
|
|
476
|
+
]
|
|
477
|
+
|
|
478
|
+
export function decodeQUtilCancelPollOutput(
|
|
479
|
+
data: Uint8Array,
|
|
480
|
+
): QUtilCancelPollOutput {
|
|
481
|
+
return decodePayload(data, Q_UTIL_CANCEL_POLL_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilCancelPollOutput
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export const Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_TYPE = 7
|
|
485
|
+
|
|
486
|
+
export interface QUtilDistributeQuToShareholdersInput {
|
|
487
|
+
asset: QUtilAssetStruct
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_FIELDS: BinaryField[] = [
|
|
491
|
+
{
|
|
492
|
+
name: 'asset',
|
|
493
|
+
type: 'struct',
|
|
494
|
+
offset: 0,
|
|
495
|
+
byteLength: 40,
|
|
496
|
+
structRef: 'Asset',
|
|
497
|
+
},
|
|
498
|
+
]
|
|
499
|
+
|
|
500
|
+
export function buildQUtilDistributeQuToShareholdersInput(
|
|
501
|
+
input: QUtilDistributeQuToShareholdersInput,
|
|
502
|
+
): ContractCall {
|
|
503
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_TYPE, payload: buildPayload(Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export interface QUtilDistributeQuToShareholdersOutput {
|
|
507
|
+
shareholders: bigint
|
|
508
|
+
totalShares: bigint
|
|
509
|
+
amountPerShare: bigint
|
|
510
|
+
fees: bigint
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_OUTPUT_FIELDS: BinaryField[] = [
|
|
514
|
+
{
|
|
515
|
+
name: 'shareholders',
|
|
516
|
+
type: 'sint64',
|
|
517
|
+
offset: 0,
|
|
518
|
+
byteLength: 8,
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: 'totalShares',
|
|
522
|
+
type: 'sint64',
|
|
523
|
+
offset: 8,
|
|
524
|
+
byteLength: 8,
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
name: 'amountPerShare',
|
|
528
|
+
type: 'sint64',
|
|
529
|
+
offset: 16,
|
|
530
|
+
byteLength: 8,
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'fees',
|
|
534
|
+
type: 'sint64',
|
|
535
|
+
offset: 24,
|
|
536
|
+
byteLength: 8,
|
|
537
|
+
},
|
|
538
|
+
]
|
|
539
|
+
|
|
540
|
+
export function decodeQUtilDistributeQuToShareholdersOutput(
|
|
541
|
+
data: Uint8Array,
|
|
542
|
+
): QUtilDistributeQuToShareholdersOutput {
|
|
543
|
+
return decodePayload(data, Q_UTIL_DISTRIBUTE_QU_TO_SHAREHOLDERS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilDistributeQuToShareholdersOutput
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export const Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_TYPE = 8
|
|
547
|
+
|
|
548
|
+
export interface QUtilBurnQubicForContractInput {
|
|
549
|
+
contractIndexBurnedFor: number
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
const Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_FIELDS: BinaryField[] = [
|
|
553
|
+
{
|
|
554
|
+
name: 'contractIndexBurnedFor',
|
|
555
|
+
type: 'uint32',
|
|
556
|
+
offset: 0,
|
|
557
|
+
byteLength: 4,
|
|
558
|
+
},
|
|
559
|
+
]
|
|
560
|
+
|
|
561
|
+
export function buildQUtilBurnQubicForContractInput(
|
|
562
|
+
input: QUtilBurnQubicForContractInput,
|
|
563
|
+
): ContractCall {
|
|
564
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_TYPE, payload: buildPayload(Q_UTIL_BURN_QUBIC_FOR_CONTRACT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export interface QUtilBurnQubicForContractOutput {
|
|
568
|
+
amount: bigint
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const Q_UTIL_BURN_QUBIC_FOR_CONTRACT_OUTPUT_FIELDS: BinaryField[] = [
|
|
572
|
+
{
|
|
573
|
+
name: 'amount',
|
|
574
|
+
type: 'sint64',
|
|
575
|
+
offset: 0,
|
|
576
|
+
byteLength: 8,
|
|
577
|
+
},
|
|
578
|
+
]
|
|
579
|
+
|
|
580
|
+
export function decodeQUtilBurnQubicForContractOutput(
|
|
581
|
+
data: Uint8Array,
|
|
582
|
+
): QUtilBurnQubicForContractOutput {
|
|
583
|
+
return decodePayload(data, Q_UTIL_BURN_QUBIC_FOR_CONTRACT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilBurnQubicForContractOutput
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export const Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_TYPE = 9
|
|
587
|
+
|
|
588
|
+
export interface QUtilTransferSharesToManyV1Input {
|
|
589
|
+
issuer: string
|
|
590
|
+
assetName: bigint
|
|
591
|
+
dst0: string
|
|
592
|
+
amt0: bigint
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
const Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_FIELDS: BinaryField[] = [
|
|
596
|
+
{
|
|
597
|
+
name: 'issuer',
|
|
598
|
+
type: 'id',
|
|
599
|
+
offset: 0,
|
|
600
|
+
byteLength: 32,
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: 'assetName',
|
|
604
|
+
type: 'uint64',
|
|
605
|
+
offset: 32,
|
|
606
|
+
byteLength: 8,
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: 'dst0',
|
|
610
|
+
type: 'id',
|
|
611
|
+
offset: 40,
|
|
612
|
+
byteLength: 32,
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: 'amt0',
|
|
616
|
+
type: 'sint64',
|
|
617
|
+
offset: 72,
|
|
618
|
+
byteLength: 8,
|
|
619
|
+
},
|
|
620
|
+
]
|
|
621
|
+
|
|
622
|
+
export function buildQUtilTransferSharesToManyV1Input(
|
|
623
|
+
input: QUtilTransferSharesToManyV1Input,
|
|
624
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
625
|
+
): ContractCall {
|
|
626
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_TYPE, payload: buildPayload(Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export interface QUtilTransferSharesToManyV1Output {
|
|
630
|
+
returnCode: number
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
const Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_OUTPUT_FIELDS: BinaryField[] = [
|
|
634
|
+
{
|
|
635
|
+
name: 'returnCode',
|
|
636
|
+
type: 'sint32',
|
|
637
|
+
offset: 0,
|
|
638
|
+
byteLength: 4,
|
|
639
|
+
},
|
|
640
|
+
]
|
|
641
|
+
|
|
642
|
+
export function decodeQUtilTransferSharesToManyV1Output(
|
|
643
|
+
data: Uint8Array,
|
|
644
|
+
): QUtilTransferSharesToManyV1Output {
|
|
645
|
+
return decodePayload(data, Q_UTIL_TRANSFER_SHARES_TO_MANY_V1_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilTransferSharesToManyV1Output
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export const Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_TYPE = 10
|
|
649
|
+
|
|
650
|
+
export interface QUtilTransferSharesManagementRightsInput {
|
|
651
|
+
asset: QUtilAssetStruct
|
|
652
|
+
numberOfShares: bigint
|
|
653
|
+
newManagingContractIndex: number
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
const Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_FIELDS: BinaryField[] = [
|
|
657
|
+
{
|
|
658
|
+
name: 'asset',
|
|
659
|
+
type: 'struct',
|
|
660
|
+
offset: 0,
|
|
661
|
+
byteLength: 40,
|
|
662
|
+
structRef: 'Asset',
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
name: 'numberOfShares',
|
|
666
|
+
type: 'sint64',
|
|
667
|
+
offset: 40,
|
|
668
|
+
byteLength: 8,
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
name: 'newManagingContractIndex',
|
|
672
|
+
type: 'uint32',
|
|
673
|
+
offset: 48,
|
|
674
|
+
byteLength: 4,
|
|
675
|
+
},
|
|
676
|
+
]
|
|
677
|
+
|
|
678
|
+
export function buildQUtilTransferSharesManagementRightsInput(
|
|
679
|
+
input: QUtilTransferSharesManagementRightsInput,
|
|
680
|
+
): ContractCall {
|
|
681
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_TYPE, payload: buildPayload(Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export interface QUtilTransferSharesManagementRightsOutput {
|
|
685
|
+
transferredNumberOfShares: bigint
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_OUTPUT_FIELDS: BinaryField[] = [
|
|
689
|
+
{
|
|
690
|
+
name: 'transferredNumberOfShares',
|
|
691
|
+
type: 'sint64',
|
|
692
|
+
offset: 0,
|
|
693
|
+
byteLength: 8,
|
|
694
|
+
},
|
|
695
|
+
]
|
|
696
|
+
|
|
697
|
+
export function decodeQUtilTransferSharesManagementRightsOutput(
|
|
698
|
+
data: Uint8Array,
|
|
699
|
+
): QUtilTransferSharesManagementRightsOutput {
|
|
700
|
+
return decodePayload(data, Q_UTIL_TRANSFER_SHARES_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilTransferSharesManagementRightsOutput
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export const Q_UTIL_QUERY_PRICE_ORACLE_INPUT_TYPE = 100
|
|
704
|
+
|
|
705
|
+
export interface QUtilQueryPriceOracleInput {
|
|
706
|
+
priceOracleQuery: QUtilOIPriceOracleQueryStruct
|
|
707
|
+
timeoutMilliseconds: number
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
const Q_UTIL_QUERY_PRICE_ORACLE_INPUT_FIELDS: BinaryField[] = [
|
|
711
|
+
{
|
|
712
|
+
name: 'priceOracleQuery',
|
|
713
|
+
type: 'struct',
|
|
714
|
+
offset: 0,
|
|
715
|
+
byteLength: 104,
|
|
716
|
+
structRef: 'OI::Price::OracleQuery',
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
name: 'timeoutMilliseconds',
|
|
720
|
+
type: 'uint32',
|
|
721
|
+
offset: 104,
|
|
722
|
+
byteLength: 4,
|
|
723
|
+
},
|
|
724
|
+
]
|
|
725
|
+
|
|
726
|
+
export function buildQUtilQueryPriceOracleInput(
|
|
727
|
+
input: QUtilQueryPriceOracleInput,
|
|
728
|
+
): ContractCall {
|
|
729
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_QUERY_PRICE_ORACLE_INPUT_TYPE, payload: buildPayload(Q_UTIL_QUERY_PRICE_ORACLE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export interface QUtilQueryPriceOracleOutput {
|
|
733
|
+
oracleQueryId: bigint
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
const Q_UTIL_QUERY_PRICE_ORACLE_OUTPUT_FIELDS: BinaryField[] = [
|
|
737
|
+
{
|
|
738
|
+
name: 'oracleQueryId',
|
|
739
|
+
type: 'sint64',
|
|
740
|
+
offset: 0,
|
|
741
|
+
byteLength: 8,
|
|
742
|
+
},
|
|
743
|
+
]
|
|
744
|
+
|
|
745
|
+
export function decodeQUtilQueryPriceOracleOutput(
|
|
746
|
+
data: Uint8Array,
|
|
747
|
+
): QUtilQueryPriceOracleOutput {
|
|
748
|
+
return decodePayload(data, Q_UTIL_QUERY_PRICE_ORACLE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilQueryPriceOracleOutput
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export const Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_TYPE = 101
|
|
752
|
+
|
|
753
|
+
export interface QUtilSubscribePriceOracleInput {
|
|
754
|
+
priceOracleQuery: QUtilOIPriceOracleQueryStruct
|
|
755
|
+
subscriptionPeriodMilliseconds: number
|
|
756
|
+
notifyPreviousValue: number
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
const Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_FIELDS: BinaryField[] = [
|
|
760
|
+
{
|
|
761
|
+
name: 'priceOracleQuery',
|
|
762
|
+
type: 'struct',
|
|
763
|
+
offset: 0,
|
|
764
|
+
byteLength: 104,
|
|
765
|
+
structRef: 'OI::Price::OracleQuery',
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
name: 'subscriptionPeriodMilliseconds',
|
|
769
|
+
type: 'uint32',
|
|
770
|
+
offset: 104,
|
|
771
|
+
byteLength: 4,
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
name: 'notifyPreviousValue',
|
|
775
|
+
type: 'uint8',
|
|
776
|
+
offset: 108,
|
|
777
|
+
byteLength: 1,
|
|
778
|
+
},
|
|
779
|
+
]
|
|
780
|
+
|
|
781
|
+
export function buildQUtilSubscribePriceOracleInput(
|
|
782
|
+
input: QUtilSubscribePriceOracleInput,
|
|
783
|
+
): ContractCall {
|
|
784
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_TYPE, payload: buildPayload(Q_UTIL_SUBSCRIBE_PRICE_ORACLE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export interface QUtilSubscribePriceOracleOutput {
|
|
788
|
+
oracleSubscriptionId: number
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
const Q_UTIL_SUBSCRIBE_PRICE_ORACLE_OUTPUT_FIELDS: BinaryField[] = [
|
|
792
|
+
{
|
|
793
|
+
name: 'oracleSubscriptionId',
|
|
794
|
+
type: 'sint32',
|
|
795
|
+
offset: 0,
|
|
796
|
+
byteLength: 4,
|
|
797
|
+
},
|
|
798
|
+
]
|
|
799
|
+
|
|
800
|
+
export function decodeQUtilSubscribePriceOracleOutput(
|
|
801
|
+
data: Uint8Array,
|
|
802
|
+
): QUtilSubscribePriceOracleOutput {
|
|
803
|
+
return decodePayload(data, Q_UTIL_SUBSCRIBE_PRICE_ORACLE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilSubscribePriceOracleOutput
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export const Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_TYPE = 102
|
|
807
|
+
|
|
808
|
+
export interface QUtilUnsubscribeOracleInput {
|
|
809
|
+
subscriptionId: number
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_FIELDS: BinaryField[] = [
|
|
813
|
+
{
|
|
814
|
+
name: 'subscriptionId',
|
|
815
|
+
type: 'sint32',
|
|
816
|
+
offset: 0,
|
|
817
|
+
byteLength: 4,
|
|
818
|
+
},
|
|
819
|
+
]
|
|
820
|
+
|
|
821
|
+
export function buildQUtilUnsubscribeOracleInput(
|
|
822
|
+
input: QUtilUnsubscribeOracleInput,
|
|
823
|
+
): ContractCall {
|
|
824
|
+
return { contractIndex: Q_UTIL_CONTRACT_INDEX, inputType: Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_TYPE, payload: buildPayload(Q_UTIL_UNSUBSCRIBE_ORACLE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
export interface QUtilUnsubscribeOracleOutput {
|
|
828
|
+
success: number
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
const Q_UTIL_UNSUBSCRIBE_ORACLE_OUTPUT_FIELDS: BinaryField[] = [
|
|
832
|
+
{
|
|
833
|
+
name: 'success',
|
|
834
|
+
type: 'uint8',
|
|
835
|
+
offset: 0,
|
|
836
|
+
byteLength: 1,
|
|
837
|
+
},
|
|
838
|
+
]
|
|
839
|
+
|
|
840
|
+
export function decodeQUtilUnsubscribeOracleOutput(
|
|
841
|
+
data: Uint8Array,
|
|
842
|
+
): QUtilUnsubscribeOracleOutput {
|
|
843
|
+
return decodePayload(data, Q_UTIL_UNSUBSCRIBE_ORACLE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilUnsubscribeOracleOutput
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export const Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_TYPE = 1
|
|
847
|
+
export const Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_SIZE = 0
|
|
848
|
+
|
|
849
|
+
export interface QUtilGetSendToManyV1FeeOutput {
|
|
850
|
+
fee: bigint
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
const Q_UTIL_GET_SEND_TO_MANY_V1FEE_OUTPUT_FIELDS: BinaryField[] = [
|
|
854
|
+
{
|
|
855
|
+
name: 'fee',
|
|
856
|
+
type: 'sint64',
|
|
857
|
+
offset: 0,
|
|
858
|
+
byteLength: 8,
|
|
859
|
+
},
|
|
860
|
+
]
|
|
861
|
+
|
|
862
|
+
export function decodeQUtilGetSendToManyV1FeeOutput(
|
|
863
|
+
data: Uint8Array,
|
|
864
|
+
): QUtilGetSendToManyV1FeeOutput {
|
|
865
|
+
return decodePayload(data, Q_UTIL_GET_SEND_TO_MANY_V1FEE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetSendToManyV1FeeOutput
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export async function qUtilGetSendToManyV1Fee(
|
|
869
|
+
live: SmartContractCaller,
|
|
870
|
+
options?: ContractCallOptions,
|
|
871
|
+
): Promise<Result<QUtilGetSendToManyV1FeeOutput, QubicRpcError>> {
|
|
872
|
+
return callContractFunction({
|
|
873
|
+
live,
|
|
874
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
875
|
+
inputType: Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_TYPE,
|
|
876
|
+
inputSize: Q_UTIL_GET_SEND_TO_MANY_V1FEE_INPUT_SIZE,
|
|
877
|
+
inputFields: [],
|
|
878
|
+
outputFields: Q_UTIL_GET_SEND_TO_MANY_V1FEE_OUTPUT_FIELDS,
|
|
879
|
+
structs: STRUCTS,
|
|
880
|
+
input: {},
|
|
881
|
+
...options,
|
|
882
|
+
})
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_TYPE = 2
|
|
886
|
+
export const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_SIZE = 40
|
|
887
|
+
|
|
888
|
+
export interface QUtilGetTotalNumberOfAssetSharesInput {
|
|
889
|
+
issuer: string
|
|
890
|
+
assetName: bigint
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_FIELDS: BinaryField[] = [
|
|
894
|
+
{
|
|
895
|
+
name: 'issuer',
|
|
896
|
+
type: 'id',
|
|
897
|
+
offset: 0,
|
|
898
|
+
byteLength: 32,
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: 'assetName',
|
|
902
|
+
type: 'uint64',
|
|
903
|
+
offset: 32,
|
|
904
|
+
byteLength: 8,
|
|
905
|
+
},
|
|
906
|
+
]
|
|
907
|
+
|
|
908
|
+
export function buildQUtilGetTotalNumberOfAssetSharesInput(
|
|
909
|
+
input: QUtilGetTotalNumberOfAssetSharesInput,
|
|
910
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
911
|
+
): Uint8Array {
|
|
912
|
+
return buildPayload(Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export interface QUtilGetTotalNumberOfAssetSharesOutput {
|
|
916
|
+
value: bigint
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
const Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_OUTPUT_FIELDS: BinaryField[] = [
|
|
920
|
+
{
|
|
921
|
+
name: 'value',
|
|
922
|
+
type: 'sint64',
|
|
923
|
+
offset: 0,
|
|
924
|
+
byteLength: 8,
|
|
925
|
+
},
|
|
926
|
+
]
|
|
927
|
+
|
|
928
|
+
export function decodeQUtilGetTotalNumberOfAssetSharesOutput(
|
|
929
|
+
data: Uint8Array,
|
|
930
|
+
): QUtilGetTotalNumberOfAssetSharesOutput {
|
|
931
|
+
return decodePayload(data, Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetTotalNumberOfAssetSharesOutput
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export async function qUtilGetTotalNumberOfAssetShares(
|
|
935
|
+
live: SmartContractCaller,
|
|
936
|
+
input: QUtilGetTotalNumberOfAssetSharesInput,
|
|
937
|
+
options?: ContractCallOptions,
|
|
938
|
+
): Promise<Result<QUtilGetTotalNumberOfAssetSharesOutput, QubicRpcError>> {
|
|
939
|
+
return callContractFunction({
|
|
940
|
+
live,
|
|
941
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
942
|
+
inputType: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_TYPE,
|
|
943
|
+
inputSize: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_SIZE,
|
|
944
|
+
inputFields: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_INPUT_FIELDS,
|
|
945
|
+
outputFields: Q_UTIL_GET_TOTAL_NUMBER_OF_ASSET_SHARES_OUTPUT_FIELDS,
|
|
946
|
+
structs: STRUCTS,
|
|
947
|
+
input: (input as unknown as Record<string, unknown>),
|
|
948
|
+
...options,
|
|
949
|
+
})
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export const Q_UTIL_GET_CURRENT_RESULT_INPUT_TYPE = 3
|
|
953
|
+
export const Q_UTIL_GET_CURRENT_RESULT_INPUT_SIZE = 8
|
|
954
|
+
|
|
955
|
+
export interface QUtilGetCurrentResultInput {
|
|
956
|
+
poll_id: bigint
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
const Q_UTIL_GET_CURRENT_RESULT_INPUT_FIELDS: BinaryField[] = [
|
|
960
|
+
{
|
|
961
|
+
name: 'poll_id',
|
|
962
|
+
type: 'uint64',
|
|
963
|
+
offset: 0,
|
|
964
|
+
byteLength: 8,
|
|
965
|
+
},
|
|
966
|
+
]
|
|
967
|
+
|
|
968
|
+
export function buildQUtilGetCurrentResultInput(
|
|
969
|
+
input: QUtilGetCurrentResultInput,
|
|
970
|
+
): Uint8Array {
|
|
971
|
+
return buildPayload(Q_UTIL_GET_CURRENT_RESULT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export interface QUtilGetCurrentResultOutput {
|
|
975
|
+
result: bigint[]
|
|
976
|
+
voter_count: bigint[]
|
|
977
|
+
is_active: bigint
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
const Q_UTIL_GET_CURRENT_RESULT_OUTPUT_FIELDS: BinaryField[] = [
|
|
981
|
+
{
|
|
982
|
+
name: 'result',
|
|
983
|
+
type: 'array',
|
|
984
|
+
offset: 0,
|
|
985
|
+
byteLength: 512,
|
|
986
|
+
arrayLength: 64,
|
|
987
|
+
arrayItemType: 'uint64',
|
|
988
|
+
arrayItemByteLength: 8,
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
name: 'voter_count',
|
|
992
|
+
type: 'array',
|
|
993
|
+
offset: 512,
|
|
994
|
+
byteLength: 512,
|
|
995
|
+
arrayLength: 64,
|
|
996
|
+
arrayItemType: 'uint64',
|
|
997
|
+
arrayItemByteLength: 8,
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
name: 'is_active',
|
|
1001
|
+
type: 'uint64',
|
|
1002
|
+
offset: 1024,
|
|
1003
|
+
byteLength: 8,
|
|
1004
|
+
},
|
|
1005
|
+
]
|
|
1006
|
+
|
|
1007
|
+
export function decodeQUtilGetCurrentResultOutput(
|
|
1008
|
+
data: Uint8Array,
|
|
1009
|
+
): QUtilGetCurrentResultOutput {
|
|
1010
|
+
return decodePayload(data, Q_UTIL_GET_CURRENT_RESULT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetCurrentResultOutput
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
export async function qUtilGetCurrentResult(
|
|
1014
|
+
live: SmartContractCaller,
|
|
1015
|
+
input: QUtilGetCurrentResultInput,
|
|
1016
|
+
options?: ContractCallOptions,
|
|
1017
|
+
): Promise<Result<QUtilGetCurrentResultOutput, QubicRpcError>> {
|
|
1018
|
+
return callContractFunction({
|
|
1019
|
+
live,
|
|
1020
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1021
|
+
inputType: Q_UTIL_GET_CURRENT_RESULT_INPUT_TYPE,
|
|
1022
|
+
inputSize: Q_UTIL_GET_CURRENT_RESULT_INPUT_SIZE,
|
|
1023
|
+
inputFields: Q_UTIL_GET_CURRENT_RESULT_INPUT_FIELDS,
|
|
1024
|
+
outputFields: Q_UTIL_GET_CURRENT_RESULT_OUTPUT_FIELDS,
|
|
1025
|
+
structs: STRUCTS,
|
|
1026
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1027
|
+
...options,
|
|
1028
|
+
})
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
export const Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_TYPE = 4
|
|
1032
|
+
export const Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_SIZE = 32
|
|
1033
|
+
|
|
1034
|
+
export interface QUtilGetPollsByCreatorInput {
|
|
1035
|
+
creator: string
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
const Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_FIELDS: BinaryField[] = [
|
|
1039
|
+
{
|
|
1040
|
+
name: 'creator',
|
|
1041
|
+
type: 'id',
|
|
1042
|
+
offset: 0,
|
|
1043
|
+
byteLength: 32,
|
|
1044
|
+
},
|
|
1045
|
+
]
|
|
1046
|
+
|
|
1047
|
+
export function buildQUtilGetPollsByCreatorInput(
|
|
1048
|
+
input: QUtilGetPollsByCreatorInput,
|
|
1049
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
1050
|
+
): Uint8Array {
|
|
1051
|
+
return buildPayload(Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
export interface QUtilGetPollsByCreatorOutput {
|
|
1055
|
+
poll_ids: bigint[]
|
|
1056
|
+
count: bigint
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
const Q_UTIL_GET_POLLS_BY_CREATOR_OUTPUT_FIELDS: BinaryField[] = [
|
|
1060
|
+
{
|
|
1061
|
+
name: 'poll_ids',
|
|
1062
|
+
type: 'array',
|
|
1063
|
+
offset: 0,
|
|
1064
|
+
byteLength: 512,
|
|
1065
|
+
arrayLength: 64,
|
|
1066
|
+
arrayItemType: 'uint64',
|
|
1067
|
+
arrayItemByteLength: 8,
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
name: 'count',
|
|
1071
|
+
type: 'uint64',
|
|
1072
|
+
offset: 512,
|
|
1073
|
+
byteLength: 8,
|
|
1074
|
+
},
|
|
1075
|
+
]
|
|
1076
|
+
|
|
1077
|
+
export function decodeQUtilGetPollsByCreatorOutput(
|
|
1078
|
+
data: Uint8Array,
|
|
1079
|
+
): QUtilGetPollsByCreatorOutput {
|
|
1080
|
+
return decodePayload(data, Q_UTIL_GET_POLLS_BY_CREATOR_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetPollsByCreatorOutput
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
export async function qUtilGetPollsByCreator(
|
|
1084
|
+
live: SmartContractCaller,
|
|
1085
|
+
input: QUtilGetPollsByCreatorInput,
|
|
1086
|
+
options?: ContractCallOptions,
|
|
1087
|
+
): Promise<Result<QUtilGetPollsByCreatorOutput, QubicRpcError>> {
|
|
1088
|
+
return callContractFunction({
|
|
1089
|
+
live,
|
|
1090
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1091
|
+
inputType: Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_TYPE,
|
|
1092
|
+
inputSize: Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_SIZE,
|
|
1093
|
+
inputFields: Q_UTIL_GET_POLLS_BY_CREATOR_INPUT_FIELDS,
|
|
1094
|
+
outputFields: Q_UTIL_GET_POLLS_BY_CREATOR_OUTPUT_FIELDS,
|
|
1095
|
+
structs: STRUCTS,
|
|
1096
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1097
|
+
...options,
|
|
1098
|
+
})
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
export const Q_UTIL_GET_CURRENT_POLL_ID_INPUT_TYPE = 5
|
|
1102
|
+
export const Q_UTIL_GET_CURRENT_POLL_ID_INPUT_SIZE = 0
|
|
1103
|
+
|
|
1104
|
+
export interface QUtilGetCurrentPollIdOutput {
|
|
1105
|
+
current_poll_id: bigint
|
|
1106
|
+
active_poll_ids: bigint[]
|
|
1107
|
+
active_count: bigint
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
const Q_UTIL_GET_CURRENT_POLL_ID_OUTPUT_FIELDS: BinaryField[] = [
|
|
1111
|
+
{
|
|
1112
|
+
name: 'current_poll_id',
|
|
1113
|
+
type: 'uint64',
|
|
1114
|
+
offset: 0,
|
|
1115
|
+
byteLength: 8,
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
name: 'active_poll_ids',
|
|
1119
|
+
type: 'array',
|
|
1120
|
+
offset: 8,
|
|
1121
|
+
byteLength: 512,
|
|
1122
|
+
arrayLength: 64,
|
|
1123
|
+
arrayItemType: 'uint64',
|
|
1124
|
+
arrayItemByteLength: 8,
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
name: 'active_count',
|
|
1128
|
+
type: 'uint64',
|
|
1129
|
+
offset: 520,
|
|
1130
|
+
byteLength: 8,
|
|
1131
|
+
},
|
|
1132
|
+
]
|
|
1133
|
+
|
|
1134
|
+
export function decodeQUtilGetCurrentPollIdOutput(
|
|
1135
|
+
data: Uint8Array,
|
|
1136
|
+
): QUtilGetCurrentPollIdOutput {
|
|
1137
|
+
return decodePayload(data, Q_UTIL_GET_CURRENT_POLL_ID_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetCurrentPollIdOutput
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
export async function qUtilGetCurrentPollId(
|
|
1141
|
+
live: SmartContractCaller,
|
|
1142
|
+
options?: ContractCallOptions,
|
|
1143
|
+
): Promise<Result<QUtilGetCurrentPollIdOutput, QubicRpcError>> {
|
|
1144
|
+
return callContractFunction({
|
|
1145
|
+
live,
|
|
1146
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1147
|
+
inputType: Q_UTIL_GET_CURRENT_POLL_ID_INPUT_TYPE,
|
|
1148
|
+
inputSize: Q_UTIL_GET_CURRENT_POLL_ID_INPUT_SIZE,
|
|
1149
|
+
inputFields: [],
|
|
1150
|
+
outputFields: Q_UTIL_GET_CURRENT_POLL_ID_OUTPUT_FIELDS,
|
|
1151
|
+
structs: STRUCTS,
|
|
1152
|
+
input: {},
|
|
1153
|
+
...options,
|
|
1154
|
+
})
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
export const Q_UTIL_GET_POLL_INFO_INPUT_TYPE = 6
|
|
1158
|
+
export const Q_UTIL_GET_POLL_INFO_INPUT_SIZE = 8
|
|
1159
|
+
|
|
1160
|
+
export interface QUtilGetPollInfoInput {
|
|
1161
|
+
poll_id: bigint
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
const Q_UTIL_GET_POLL_INFO_INPUT_FIELDS: BinaryField[] = [
|
|
1165
|
+
{
|
|
1166
|
+
name: 'poll_id',
|
|
1167
|
+
type: 'uint64',
|
|
1168
|
+
offset: 0,
|
|
1169
|
+
byteLength: 8,
|
|
1170
|
+
},
|
|
1171
|
+
]
|
|
1172
|
+
|
|
1173
|
+
export function buildQUtilGetPollInfoInput(
|
|
1174
|
+
input: QUtilGetPollInfoInput,
|
|
1175
|
+
): Uint8Array {
|
|
1176
|
+
return buildPayload(Q_UTIL_GET_POLL_INFO_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
export interface QUtilGetPollInfoOutput {
|
|
1180
|
+
found: bigint
|
|
1181
|
+
poll_info: QUtilPollStruct
|
|
1182
|
+
poll_link: number[]
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
const Q_UTIL_GET_POLL_INFO_OUTPUT_FIELDS: BinaryField[] = [
|
|
1186
|
+
{
|
|
1187
|
+
name: 'found',
|
|
1188
|
+
type: 'uint64',
|
|
1189
|
+
offset: 0,
|
|
1190
|
+
byteLength: 8,
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
name: 'poll_info',
|
|
1194
|
+
type: 'struct',
|
|
1195
|
+
offset: 8,
|
|
1196
|
+
byteLength: 736,
|
|
1197
|
+
structRef: 'Poll',
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
name: 'poll_link',
|
|
1201
|
+
type: 'array',
|
|
1202
|
+
offset: 744,
|
|
1203
|
+
byteLength: 256,
|
|
1204
|
+
arrayLength: 256,
|
|
1205
|
+
arrayItemType: 'uint8',
|
|
1206
|
+
arrayItemByteLength: 1,
|
|
1207
|
+
},
|
|
1208
|
+
]
|
|
1209
|
+
|
|
1210
|
+
export function decodeQUtilGetPollInfoOutput(
|
|
1211
|
+
data: Uint8Array,
|
|
1212
|
+
): QUtilGetPollInfoOutput {
|
|
1213
|
+
return decodePayload(data, Q_UTIL_GET_POLL_INFO_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetPollInfoOutput
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
export async function qUtilGetPollInfo(
|
|
1217
|
+
live: SmartContractCaller,
|
|
1218
|
+
input: QUtilGetPollInfoInput,
|
|
1219
|
+
options?: ContractCallOptions,
|
|
1220
|
+
): Promise<Result<QUtilGetPollInfoOutput, QubicRpcError>> {
|
|
1221
|
+
return callContractFunction({
|
|
1222
|
+
live,
|
|
1223
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1224
|
+
inputType: Q_UTIL_GET_POLL_INFO_INPUT_TYPE,
|
|
1225
|
+
inputSize: Q_UTIL_GET_POLL_INFO_INPUT_SIZE,
|
|
1226
|
+
inputFields: Q_UTIL_GET_POLL_INFO_INPUT_FIELDS,
|
|
1227
|
+
outputFields: Q_UTIL_GET_POLL_INFO_OUTPUT_FIELDS,
|
|
1228
|
+
structs: STRUCTS,
|
|
1229
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1230
|
+
...options,
|
|
1231
|
+
})
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
export const Q_UTIL_GET_FEES_INPUT_TYPE = 7
|
|
1235
|
+
export const Q_UTIL_GET_FEES_INPUT_SIZE = 0
|
|
1236
|
+
|
|
1237
|
+
export interface QUtilGetFeesOutput {
|
|
1238
|
+
smt1InvocationFee: bigint
|
|
1239
|
+
pollCreationFee: bigint
|
|
1240
|
+
pollVoteFee: bigint
|
|
1241
|
+
distributeQuToShareholderFeePerShareholder: bigint
|
|
1242
|
+
shareholderProposalFee: bigint
|
|
1243
|
+
_futureFeePlaceholder0: bigint
|
|
1244
|
+
_futureFeePlaceholder1: bigint
|
|
1245
|
+
_futureFeePlaceholder2: bigint
|
|
1246
|
+
_futureFeePlaceholder3: bigint
|
|
1247
|
+
_futureFeePlaceholder4: bigint
|
|
1248
|
+
_futureFeePlaceholder5: bigint
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
const Q_UTIL_GET_FEES_OUTPUT_FIELDS: BinaryField[] = [
|
|
1252
|
+
{
|
|
1253
|
+
name: 'smt1InvocationFee',
|
|
1254
|
+
type: 'sint64',
|
|
1255
|
+
offset: 0,
|
|
1256
|
+
byteLength: 8,
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
name: 'pollCreationFee',
|
|
1260
|
+
type: 'sint64',
|
|
1261
|
+
offset: 8,
|
|
1262
|
+
byteLength: 8,
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
name: 'pollVoteFee',
|
|
1266
|
+
type: 'sint64',
|
|
1267
|
+
offset: 16,
|
|
1268
|
+
byteLength: 8,
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
name: 'distributeQuToShareholderFeePerShareholder',
|
|
1272
|
+
type: 'sint64',
|
|
1273
|
+
offset: 24,
|
|
1274
|
+
byteLength: 8,
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
name: 'shareholderProposalFee',
|
|
1278
|
+
type: 'sint64',
|
|
1279
|
+
offset: 32,
|
|
1280
|
+
byteLength: 8,
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
name: '_futureFeePlaceholder0',
|
|
1284
|
+
type: 'sint64',
|
|
1285
|
+
offset: 40,
|
|
1286
|
+
byteLength: 8,
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
name: '_futureFeePlaceholder1',
|
|
1290
|
+
type: 'sint64',
|
|
1291
|
+
offset: 48,
|
|
1292
|
+
byteLength: 8,
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
name: '_futureFeePlaceholder2',
|
|
1296
|
+
type: 'sint64',
|
|
1297
|
+
offset: 56,
|
|
1298
|
+
byteLength: 8,
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
name: '_futureFeePlaceholder3',
|
|
1302
|
+
type: 'sint64',
|
|
1303
|
+
offset: 64,
|
|
1304
|
+
byteLength: 8,
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
name: '_futureFeePlaceholder4',
|
|
1308
|
+
type: 'sint64',
|
|
1309
|
+
offset: 72,
|
|
1310
|
+
byteLength: 8,
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
name: '_futureFeePlaceholder5',
|
|
1314
|
+
type: 'sint64',
|
|
1315
|
+
offset: 80,
|
|
1316
|
+
byteLength: 8,
|
|
1317
|
+
},
|
|
1318
|
+
]
|
|
1319
|
+
|
|
1320
|
+
export function decodeQUtilGetFeesOutput(
|
|
1321
|
+
data: Uint8Array,
|
|
1322
|
+
): QUtilGetFeesOutput {
|
|
1323
|
+
return decodePayload(data, Q_UTIL_GET_FEES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetFeesOutput
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
export async function qUtilGetFees(
|
|
1327
|
+
live: SmartContractCaller,
|
|
1328
|
+
options?: ContractCallOptions,
|
|
1329
|
+
): Promise<Result<QUtilGetFeesOutput, QubicRpcError>> {
|
|
1330
|
+
return callContractFunction({
|
|
1331
|
+
live,
|
|
1332
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1333
|
+
inputType: Q_UTIL_GET_FEES_INPUT_TYPE,
|
|
1334
|
+
inputSize: Q_UTIL_GET_FEES_INPUT_SIZE,
|
|
1335
|
+
inputFields: [],
|
|
1336
|
+
outputFields: Q_UTIL_GET_FEES_OUTPUT_FIELDS,
|
|
1337
|
+
structs: STRUCTS,
|
|
1338
|
+
input: {},
|
|
1339
|
+
...options,
|
|
1340
|
+
})
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export const Q_UTIL_QUERY_FEE_RESERVE_INPUT_TYPE = 8
|
|
1344
|
+
export const Q_UTIL_QUERY_FEE_RESERVE_INPUT_SIZE = 4
|
|
1345
|
+
|
|
1346
|
+
export interface QUtilQueryFeeReserveInput {
|
|
1347
|
+
contractIndex: number
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
const Q_UTIL_QUERY_FEE_RESERVE_INPUT_FIELDS: BinaryField[] = [
|
|
1351
|
+
{
|
|
1352
|
+
name: 'contractIndex',
|
|
1353
|
+
type: 'uint32',
|
|
1354
|
+
offset: 0,
|
|
1355
|
+
byteLength: 4,
|
|
1356
|
+
},
|
|
1357
|
+
]
|
|
1358
|
+
|
|
1359
|
+
export function buildQUtilQueryFeeReserveInput(
|
|
1360
|
+
input: QUtilQueryFeeReserveInput,
|
|
1361
|
+
): Uint8Array {
|
|
1362
|
+
return buildPayload(Q_UTIL_QUERY_FEE_RESERVE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
export interface QUtilQueryFeeReserveOutput {
|
|
1366
|
+
reserveAmount: bigint
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
const Q_UTIL_QUERY_FEE_RESERVE_OUTPUT_FIELDS: BinaryField[] = [
|
|
1370
|
+
{
|
|
1371
|
+
name: 'reserveAmount',
|
|
1372
|
+
type: 'sint64',
|
|
1373
|
+
offset: 0,
|
|
1374
|
+
byteLength: 8,
|
|
1375
|
+
},
|
|
1376
|
+
]
|
|
1377
|
+
|
|
1378
|
+
export function decodeQUtilQueryFeeReserveOutput(
|
|
1379
|
+
data: Uint8Array,
|
|
1380
|
+
): QUtilQueryFeeReserveOutput {
|
|
1381
|
+
return decodePayload(data, Q_UTIL_QUERY_FEE_RESERVE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilQueryFeeReserveOutput
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
export async function qUtilQueryFeeReserve(
|
|
1385
|
+
live: SmartContractCaller,
|
|
1386
|
+
input: QUtilQueryFeeReserveInput,
|
|
1387
|
+
options?: ContractCallOptions,
|
|
1388
|
+
): Promise<Result<QUtilQueryFeeReserveOutput, QubicRpcError>> {
|
|
1389
|
+
return callContractFunction({
|
|
1390
|
+
live,
|
|
1391
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1392
|
+
inputType: Q_UTIL_QUERY_FEE_RESERVE_INPUT_TYPE,
|
|
1393
|
+
inputSize: Q_UTIL_QUERY_FEE_RESERVE_INPUT_SIZE,
|
|
1394
|
+
inputFields: Q_UTIL_QUERY_FEE_RESERVE_INPUT_FIELDS,
|
|
1395
|
+
outputFields: Q_UTIL_QUERY_FEE_RESERVE_OUTPUT_FIELDS,
|
|
1396
|
+
structs: STRUCTS,
|
|
1397
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1398
|
+
...options,
|
|
1399
|
+
})
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
export const Q_UTIL_GET_BALANCES16_INPUT_TYPE = 9
|
|
1403
|
+
export const Q_UTIL_GET_BALANCES16_INPUT_SIZE = 512
|
|
1404
|
+
|
|
1405
|
+
export interface QUtilGetBalances16Input {
|
|
1406
|
+
publicKeys: string[]
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
const Q_UTIL_GET_BALANCES16_INPUT_FIELDS: BinaryField[] = [
|
|
1410
|
+
{
|
|
1411
|
+
name: 'publicKeys',
|
|
1412
|
+
type: 'array',
|
|
1413
|
+
offset: 0,
|
|
1414
|
+
byteLength: 512,
|
|
1415
|
+
arrayLength: 16,
|
|
1416
|
+
arrayItemType: 'id',
|
|
1417
|
+
arrayItemByteLength: 32,
|
|
1418
|
+
},
|
|
1419
|
+
]
|
|
1420
|
+
|
|
1421
|
+
export function buildQUtilGetBalances16Input(
|
|
1422
|
+
input: QUtilGetBalances16Input,
|
|
1423
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
1424
|
+
): Uint8Array {
|
|
1425
|
+
return buildPayload(Q_UTIL_GET_BALANCES16_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
export interface QUtilGetBalances16Output {
|
|
1429
|
+
balances: bigint[]
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
const Q_UTIL_GET_BALANCES16_OUTPUT_FIELDS: BinaryField[] = [
|
|
1433
|
+
{
|
|
1434
|
+
name: 'balances',
|
|
1435
|
+
type: 'array',
|
|
1436
|
+
offset: 0,
|
|
1437
|
+
byteLength: 128,
|
|
1438
|
+
arrayLength: 16,
|
|
1439
|
+
arrayItemType: 'sint64',
|
|
1440
|
+
arrayItemByteLength: 8,
|
|
1441
|
+
},
|
|
1442
|
+
]
|
|
1443
|
+
|
|
1444
|
+
export function decodeQUtilGetBalances16Output(
|
|
1445
|
+
data: Uint8Array,
|
|
1446
|
+
): QUtilGetBalances16Output {
|
|
1447
|
+
return decodePayload(data, Q_UTIL_GET_BALANCES16_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QUtilGetBalances16Output
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
export async function qUtilGetBalances16(
|
|
1451
|
+
live: SmartContractCaller,
|
|
1452
|
+
input: QUtilGetBalances16Input,
|
|
1453
|
+
options?: ContractCallOptions,
|
|
1454
|
+
): Promise<Result<QUtilGetBalances16Output, QubicRpcError>> {
|
|
1455
|
+
return callContractFunction({
|
|
1456
|
+
live,
|
|
1457
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1458
|
+
inputType: Q_UTIL_GET_BALANCES16_INPUT_TYPE,
|
|
1459
|
+
inputSize: Q_UTIL_GET_BALANCES16_INPUT_SIZE,
|
|
1460
|
+
inputFields: Q_UTIL_GET_BALANCES16_INPUT_FIELDS,
|
|
1461
|
+
outputFields: Q_UTIL_GET_BALANCES16_OUTPUT_FIELDS,
|
|
1462
|
+
structs: STRUCTS,
|
|
1463
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1464
|
+
...options,
|
|
1465
|
+
})
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
export const qUtil = {
|
|
1469
|
+
contractIndex: Q_UTIL_CONTRACT_INDEX,
|
|
1470
|
+
GetSendToManyV1Fee: qUtilGetSendToManyV1Fee,
|
|
1471
|
+
GetTotalNumberOfAssetShares: qUtilGetTotalNumberOfAssetShares,
|
|
1472
|
+
GetCurrentResult: qUtilGetCurrentResult,
|
|
1473
|
+
GetPollsByCreator: qUtilGetPollsByCreator,
|
|
1474
|
+
GetCurrentPollId: qUtilGetCurrentPollId,
|
|
1475
|
+
GetPollInfo: qUtilGetPollInfo,
|
|
1476
|
+
GetFees: qUtilGetFees,
|
|
1477
|
+
QueryFeeReserve: qUtilQueryFeeReserve,
|
|
1478
|
+
GetBalances16: qUtilGetBalances16,
|
|
1479
|
+
buildSendToManyV1Input: buildQUtilSendToManyV1Input,
|
|
1480
|
+
decodeSendToManyV1Output: decodeQUtilSendToManyV1Output,
|
|
1481
|
+
buildBurnQubicInput: buildQUtilBurnQubicInput,
|
|
1482
|
+
decodeBurnQubicOutput: decodeQUtilBurnQubicOutput,
|
|
1483
|
+
buildSendToManyBenchmarkInput: buildQUtilSendToManyBenchmarkInput,
|
|
1484
|
+
decodeSendToManyBenchmarkOutput: decodeQUtilSendToManyBenchmarkOutput,
|
|
1485
|
+
buildCreatePollInput: buildQUtilCreatePollInput,
|
|
1486
|
+
decodeCreatePollOutput: decodeQUtilCreatePollOutput,
|
|
1487
|
+
buildVoteInput: buildQUtilVoteInput,
|
|
1488
|
+
decodeVoteOutput: decodeQUtilVoteOutput,
|
|
1489
|
+
buildCancelPollInput: buildQUtilCancelPollInput,
|
|
1490
|
+
decodeCancelPollOutput: decodeQUtilCancelPollOutput,
|
|
1491
|
+
buildDistributeQuToShareholdersInput: buildQUtilDistributeQuToShareholdersInput,
|
|
1492
|
+
decodeDistributeQuToShareholdersOutput: decodeQUtilDistributeQuToShareholdersOutput,
|
|
1493
|
+
buildBurnQubicForContractInput: buildQUtilBurnQubicForContractInput,
|
|
1494
|
+
decodeBurnQubicForContractOutput: decodeQUtilBurnQubicForContractOutput,
|
|
1495
|
+
buildTransferSharesToManyV1Input: buildQUtilTransferSharesToManyV1Input,
|
|
1496
|
+
decodeTransferSharesToManyV1Output: decodeQUtilTransferSharesToManyV1Output,
|
|
1497
|
+
buildTransferSharesManagementRightsInput: buildQUtilTransferSharesManagementRightsInput,
|
|
1498
|
+
decodeTransferSharesManagementRightsOutput: decodeQUtilTransferSharesManagementRightsOutput,
|
|
1499
|
+
buildQueryPriceOracleInput: buildQUtilQueryPriceOracleInput,
|
|
1500
|
+
decodeQueryPriceOracleOutput: decodeQUtilQueryPriceOracleOutput,
|
|
1501
|
+
buildSubscribePriceOracleInput: buildQUtilSubscribePriceOracleInput,
|
|
1502
|
+
decodeSubscribePriceOracleOutput: decodeQUtilSubscribePriceOracleOutput,
|
|
1503
|
+
buildUnsubscribeOracleInput: buildQUtilUnsubscribeOracleInput,
|
|
1504
|
+
decodeUnsubscribeOracleOutput: decodeQUtilUnsubscribeOracleOutput,
|
|
1505
|
+
}
|
|
1506
|
+
|