@qubic.org/contracts 0.2.7 → 1.0.1
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 +8 -7
- 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,1512 @@
|
|
|
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 PULSE_CONTRACT_INDEX = 24
|
|
9
|
+
|
|
10
|
+
export interface PulseTicketStruct {
|
|
11
|
+
player: string
|
|
12
|
+
digits: number[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PulseWinnerInfoStruct {
|
|
16
|
+
winnerAddress: string
|
|
17
|
+
revenue: bigint
|
|
18
|
+
epoch: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PulseAutoParticipantStruct {
|
|
22
|
+
player: string
|
|
23
|
+
deposit: bigint
|
|
24
|
+
desiredTickets: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const STRUCTS: Record<string, NamedStruct> = {
|
|
28
|
+
'Ticket': {
|
|
29
|
+
name: 'Ticket',
|
|
30
|
+
byteLength: 32,
|
|
31
|
+
fields: [
|
|
32
|
+
{
|
|
33
|
+
name: 'player',
|
|
34
|
+
type: 'id',
|
|
35
|
+
offset: 0,
|
|
36
|
+
byteLength: 32,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'digits',
|
|
40
|
+
type: 'array',
|
|
41
|
+
offset: 32,
|
|
42
|
+
byteLength: 0,
|
|
43
|
+
arrayLength: 0,
|
|
44
|
+
arrayItemType: 'uint8',
|
|
45
|
+
arrayItemByteLength: 1,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
'WinnerInfo': {
|
|
50
|
+
name: 'WinnerInfo',
|
|
51
|
+
byteLength: 42,
|
|
52
|
+
fields: [
|
|
53
|
+
{
|
|
54
|
+
name: 'winnerAddress',
|
|
55
|
+
type: 'id',
|
|
56
|
+
offset: 0,
|
|
57
|
+
byteLength: 32,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'revenue',
|
|
61
|
+
type: 'uint64',
|
|
62
|
+
offset: 32,
|
|
63
|
+
byteLength: 8,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'epoch',
|
|
67
|
+
type: 'uint16',
|
|
68
|
+
offset: 40,
|
|
69
|
+
byteLength: 2,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
'AutoParticipant': {
|
|
74
|
+
name: 'AutoParticipant',
|
|
75
|
+
byteLength: 42,
|
|
76
|
+
fields: [
|
|
77
|
+
{
|
|
78
|
+
name: 'player',
|
|
79
|
+
type: 'id',
|
|
80
|
+
offset: 0,
|
|
81
|
+
byteLength: 32,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'deposit',
|
|
85
|
+
type: 'sint64',
|
|
86
|
+
offset: 32,
|
|
87
|
+
byteLength: 8,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'desiredTickets',
|
|
91
|
+
type: 'uint16',
|
|
92
|
+
offset: 40,
|
|
93
|
+
byteLength: 2,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const PULSE_BUY_TICKET_INPUT_TYPE = 1
|
|
100
|
+
|
|
101
|
+
export interface PulseBuyTicketInput {
|
|
102
|
+
digits: number[]
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const PULSE_BUY_TICKET_INPUT_FIELDS: BinaryField[] = [
|
|
106
|
+
{
|
|
107
|
+
name: 'digits',
|
|
108
|
+
type: 'array',
|
|
109
|
+
offset: 0,
|
|
110
|
+
byteLength: 0,
|
|
111
|
+
arrayLength: 0,
|
|
112
|
+
arrayItemType: 'uint8',
|
|
113
|
+
arrayItemByteLength: 1,
|
|
114
|
+
},
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
export function buildPulseBuyTicketInput(
|
|
118
|
+
input: PulseBuyTicketInput,
|
|
119
|
+
): ContractCall {
|
|
120
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_BUY_TICKET_INPUT_TYPE, payload: buildPayload(PULSE_BUY_TICKET_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface PulseBuyTicketOutput {
|
|
124
|
+
returnCode: number
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const PULSE_BUY_TICKET_OUTPUT_FIELDS: BinaryField[] = [
|
|
128
|
+
{
|
|
129
|
+
name: 'returnCode',
|
|
130
|
+
type: 'uint8',
|
|
131
|
+
offset: 0,
|
|
132
|
+
byteLength: 1,
|
|
133
|
+
},
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
export function decodePulseBuyTicketOutput(
|
|
137
|
+
data: Uint8Array,
|
|
138
|
+
): PulseBuyTicketOutput {
|
|
139
|
+
return decodePayload(data, PULSE_BUY_TICKET_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseBuyTicketOutput
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const PULSE_SET_PRICE_INPUT_TYPE = 2
|
|
143
|
+
|
|
144
|
+
export interface PulseSetPriceInput {
|
|
145
|
+
newPrice: bigint
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const PULSE_SET_PRICE_INPUT_FIELDS: BinaryField[] = [
|
|
149
|
+
{
|
|
150
|
+
name: 'newPrice',
|
|
151
|
+
type: 'uint64',
|
|
152
|
+
offset: 0,
|
|
153
|
+
byteLength: 8,
|
|
154
|
+
},
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
export function buildPulseSetPriceInput(
|
|
158
|
+
input: PulseSetPriceInput,
|
|
159
|
+
): ContractCall {
|
|
160
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_PRICE_INPUT_TYPE, payload: buildPayload(PULSE_SET_PRICE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface PulseSetPriceOutput {
|
|
164
|
+
returnCode: number
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const PULSE_SET_PRICE_OUTPUT_FIELDS: BinaryField[] = [
|
|
168
|
+
{
|
|
169
|
+
name: 'returnCode',
|
|
170
|
+
type: 'uint8',
|
|
171
|
+
offset: 0,
|
|
172
|
+
byteLength: 1,
|
|
173
|
+
},
|
|
174
|
+
]
|
|
175
|
+
|
|
176
|
+
export function decodePulseSetPriceOutput(
|
|
177
|
+
data: Uint8Array,
|
|
178
|
+
): PulseSetPriceOutput {
|
|
179
|
+
return decodePayload(data, PULSE_SET_PRICE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetPriceOutput
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export const PULSE_SET_SCHEDULE_INPUT_TYPE = 3
|
|
183
|
+
|
|
184
|
+
export interface PulseSetScheduleInput {
|
|
185
|
+
newSchedule: number
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const PULSE_SET_SCHEDULE_INPUT_FIELDS: BinaryField[] = [
|
|
189
|
+
{
|
|
190
|
+
name: 'newSchedule',
|
|
191
|
+
type: 'uint8',
|
|
192
|
+
offset: 0,
|
|
193
|
+
byteLength: 1,
|
|
194
|
+
},
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
export function buildPulseSetScheduleInput(
|
|
198
|
+
input: PulseSetScheduleInput,
|
|
199
|
+
): ContractCall {
|
|
200
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_SCHEDULE_INPUT_TYPE, payload: buildPayload(PULSE_SET_SCHEDULE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface PulseSetScheduleOutput {
|
|
204
|
+
returnCode: number
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const PULSE_SET_SCHEDULE_OUTPUT_FIELDS: BinaryField[] = [
|
|
208
|
+
{
|
|
209
|
+
name: 'returnCode',
|
|
210
|
+
type: 'uint8',
|
|
211
|
+
offset: 0,
|
|
212
|
+
byteLength: 1,
|
|
213
|
+
},
|
|
214
|
+
]
|
|
215
|
+
|
|
216
|
+
export function decodePulseSetScheduleOutput(
|
|
217
|
+
data: Uint8Array,
|
|
218
|
+
): PulseSetScheduleOutput {
|
|
219
|
+
return decodePayload(data, PULSE_SET_SCHEDULE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetScheduleOutput
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export const PULSE_SET_DRAW_HOUR_INPUT_TYPE = 4
|
|
223
|
+
|
|
224
|
+
export interface PulseSetDrawHourInput {
|
|
225
|
+
newDrawHour: number
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const PULSE_SET_DRAW_HOUR_INPUT_FIELDS: BinaryField[] = [
|
|
229
|
+
{
|
|
230
|
+
name: 'newDrawHour',
|
|
231
|
+
type: 'uint8',
|
|
232
|
+
offset: 0,
|
|
233
|
+
byteLength: 1,
|
|
234
|
+
},
|
|
235
|
+
]
|
|
236
|
+
|
|
237
|
+
export function buildPulseSetDrawHourInput(
|
|
238
|
+
input: PulseSetDrawHourInput,
|
|
239
|
+
): ContractCall {
|
|
240
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_DRAW_HOUR_INPUT_TYPE, payload: buildPayload(PULSE_SET_DRAW_HOUR_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface PulseSetDrawHourOutput {
|
|
244
|
+
returnCode: number
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const PULSE_SET_DRAW_HOUR_OUTPUT_FIELDS: BinaryField[] = [
|
|
248
|
+
{
|
|
249
|
+
name: 'returnCode',
|
|
250
|
+
type: 'uint8',
|
|
251
|
+
offset: 0,
|
|
252
|
+
byteLength: 1,
|
|
253
|
+
},
|
|
254
|
+
]
|
|
255
|
+
|
|
256
|
+
export function decodePulseSetDrawHourOutput(
|
|
257
|
+
data: Uint8Array,
|
|
258
|
+
): PulseSetDrawHourOutput {
|
|
259
|
+
return decodePayload(data, PULSE_SET_DRAW_HOUR_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetDrawHourOutput
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export const PULSE_SET_FEES_INPUT_TYPE = 5
|
|
263
|
+
|
|
264
|
+
export interface PulseSetFeesInput {
|
|
265
|
+
devPercent: number
|
|
266
|
+
burnPercent: number
|
|
267
|
+
shareholdersPercent: number
|
|
268
|
+
rlShareholdersPercent: number
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const PULSE_SET_FEES_INPUT_FIELDS: BinaryField[] = [
|
|
272
|
+
{
|
|
273
|
+
name: 'devPercent',
|
|
274
|
+
type: 'uint8',
|
|
275
|
+
offset: 0,
|
|
276
|
+
byteLength: 1,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'burnPercent',
|
|
280
|
+
type: 'uint8',
|
|
281
|
+
offset: 1,
|
|
282
|
+
byteLength: 1,
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'shareholdersPercent',
|
|
286
|
+
type: 'uint8',
|
|
287
|
+
offset: 2,
|
|
288
|
+
byteLength: 1,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'rlShareholdersPercent',
|
|
292
|
+
type: 'uint8',
|
|
293
|
+
offset: 3,
|
|
294
|
+
byteLength: 1,
|
|
295
|
+
},
|
|
296
|
+
]
|
|
297
|
+
|
|
298
|
+
export function buildPulseSetFeesInput(
|
|
299
|
+
input: PulseSetFeesInput,
|
|
300
|
+
): ContractCall {
|
|
301
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_FEES_INPUT_TYPE, payload: buildPayload(PULSE_SET_FEES_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface PulseSetFeesOutput {
|
|
305
|
+
returnCode: number
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const PULSE_SET_FEES_OUTPUT_FIELDS: BinaryField[] = [
|
|
309
|
+
{
|
|
310
|
+
name: 'returnCode',
|
|
311
|
+
type: 'uint8',
|
|
312
|
+
offset: 0,
|
|
313
|
+
byteLength: 1,
|
|
314
|
+
},
|
|
315
|
+
]
|
|
316
|
+
|
|
317
|
+
export function decodePulseSetFeesOutput(
|
|
318
|
+
data: Uint8Array,
|
|
319
|
+
): PulseSetFeesOutput {
|
|
320
|
+
return decodePayload(data, PULSE_SET_FEES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetFeesOutput
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export const PULSE_SET_Q_HEART_HOLD_LIMIT_INPUT_TYPE = 6
|
|
324
|
+
|
|
325
|
+
export interface PulseSetQHeartHoldLimitInput {
|
|
326
|
+
newQHeartHoldLimit: bigint
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const PULSE_SET_Q_HEART_HOLD_LIMIT_INPUT_FIELDS: BinaryField[] = [
|
|
330
|
+
{
|
|
331
|
+
name: 'newQHeartHoldLimit',
|
|
332
|
+
type: 'uint64',
|
|
333
|
+
offset: 0,
|
|
334
|
+
byteLength: 8,
|
|
335
|
+
},
|
|
336
|
+
]
|
|
337
|
+
|
|
338
|
+
export function buildPulseSetQHeartHoldLimitInput(
|
|
339
|
+
input: PulseSetQHeartHoldLimitInput,
|
|
340
|
+
): ContractCall {
|
|
341
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_Q_HEART_HOLD_LIMIT_INPUT_TYPE, payload: buildPayload(PULSE_SET_Q_HEART_HOLD_LIMIT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface PulseSetQHeartHoldLimitOutput {
|
|
345
|
+
returnCode: number
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const PULSE_SET_Q_HEART_HOLD_LIMIT_OUTPUT_FIELDS: BinaryField[] = [
|
|
349
|
+
{
|
|
350
|
+
name: 'returnCode',
|
|
351
|
+
type: 'uint8',
|
|
352
|
+
offset: 0,
|
|
353
|
+
byteLength: 1,
|
|
354
|
+
},
|
|
355
|
+
]
|
|
356
|
+
|
|
357
|
+
export function decodePulseSetQHeartHoldLimitOutput(
|
|
358
|
+
data: Uint8Array,
|
|
359
|
+
): PulseSetQHeartHoldLimitOutput {
|
|
360
|
+
return decodePayload(data, PULSE_SET_Q_HEART_HOLD_LIMIT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetQHeartHoldLimitOutput
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export const PULSE_BUY_RANDOM_TICKETS_INPUT_TYPE = 7
|
|
364
|
+
|
|
365
|
+
export interface PulseBuyRandomTicketsInput {
|
|
366
|
+
count: number
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const PULSE_BUY_RANDOM_TICKETS_INPUT_FIELDS: BinaryField[] = [
|
|
370
|
+
{
|
|
371
|
+
name: 'count',
|
|
372
|
+
type: 'uint16',
|
|
373
|
+
offset: 0,
|
|
374
|
+
byteLength: 2,
|
|
375
|
+
},
|
|
376
|
+
]
|
|
377
|
+
|
|
378
|
+
export function buildPulseBuyRandomTicketsInput(
|
|
379
|
+
input: PulseBuyRandomTicketsInput,
|
|
380
|
+
): ContractCall {
|
|
381
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_BUY_RANDOM_TICKETS_INPUT_TYPE, payload: buildPayload(PULSE_BUY_RANDOM_TICKETS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface PulseBuyRandomTicketsOutput {
|
|
385
|
+
returnCode: number
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
const PULSE_BUY_RANDOM_TICKETS_OUTPUT_FIELDS: BinaryField[] = [
|
|
389
|
+
{
|
|
390
|
+
name: 'returnCode',
|
|
391
|
+
type: 'uint8',
|
|
392
|
+
offset: 0,
|
|
393
|
+
byteLength: 1,
|
|
394
|
+
},
|
|
395
|
+
]
|
|
396
|
+
|
|
397
|
+
export function decodePulseBuyRandomTicketsOutput(
|
|
398
|
+
data: Uint8Array,
|
|
399
|
+
): PulseBuyRandomTicketsOutput {
|
|
400
|
+
return decodePayload(data, PULSE_BUY_RANDOM_TICKETS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseBuyRandomTicketsOutput
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export const PULSE_DEPOSIT_AUTO_PARTICIPATION_INPUT_TYPE = 8
|
|
404
|
+
|
|
405
|
+
export interface PulseDepositAutoParticipationInput {
|
|
406
|
+
amount: bigint
|
|
407
|
+
desiredTickets: number
|
|
408
|
+
buyNow: number
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const PULSE_DEPOSIT_AUTO_PARTICIPATION_INPUT_FIELDS: BinaryField[] = [
|
|
412
|
+
{
|
|
413
|
+
name: 'amount',
|
|
414
|
+
type: 'sint64',
|
|
415
|
+
offset: 0,
|
|
416
|
+
byteLength: 8,
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'desiredTickets',
|
|
420
|
+
type: 'sint16',
|
|
421
|
+
offset: 8,
|
|
422
|
+
byteLength: 2,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: 'buyNow',
|
|
426
|
+
type: 'uint8',
|
|
427
|
+
offset: 10,
|
|
428
|
+
byteLength: 1,
|
|
429
|
+
},
|
|
430
|
+
]
|
|
431
|
+
|
|
432
|
+
export function buildPulseDepositAutoParticipationInput(
|
|
433
|
+
input: PulseDepositAutoParticipationInput,
|
|
434
|
+
): ContractCall {
|
|
435
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_DEPOSIT_AUTO_PARTICIPATION_INPUT_TYPE, payload: buildPayload(PULSE_DEPOSIT_AUTO_PARTICIPATION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export interface PulseDepositAutoParticipationOutput {
|
|
439
|
+
returnCode: number
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const PULSE_DEPOSIT_AUTO_PARTICIPATION_OUTPUT_FIELDS: BinaryField[] = [
|
|
443
|
+
{
|
|
444
|
+
name: 'returnCode',
|
|
445
|
+
type: 'uint8',
|
|
446
|
+
offset: 0,
|
|
447
|
+
byteLength: 1,
|
|
448
|
+
},
|
|
449
|
+
]
|
|
450
|
+
|
|
451
|
+
export function decodePulseDepositAutoParticipationOutput(
|
|
452
|
+
data: Uint8Array,
|
|
453
|
+
): PulseDepositAutoParticipationOutput {
|
|
454
|
+
return decodePayload(data, PULSE_DEPOSIT_AUTO_PARTICIPATION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseDepositAutoParticipationOutput
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export const PULSE_WITHDRAW_AUTO_PARTICIPATION_INPUT_TYPE = 9
|
|
458
|
+
|
|
459
|
+
export interface PulseWithdrawAutoParticipationInput {
|
|
460
|
+
amount: bigint
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const PULSE_WITHDRAW_AUTO_PARTICIPATION_INPUT_FIELDS: BinaryField[] = [
|
|
464
|
+
{
|
|
465
|
+
name: 'amount',
|
|
466
|
+
type: 'sint64',
|
|
467
|
+
offset: 0,
|
|
468
|
+
byteLength: 8,
|
|
469
|
+
},
|
|
470
|
+
]
|
|
471
|
+
|
|
472
|
+
export function buildPulseWithdrawAutoParticipationInput(
|
|
473
|
+
input: PulseWithdrawAutoParticipationInput,
|
|
474
|
+
): ContractCall {
|
|
475
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_WITHDRAW_AUTO_PARTICIPATION_INPUT_TYPE, payload: buildPayload(PULSE_WITHDRAW_AUTO_PARTICIPATION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export interface PulseWithdrawAutoParticipationOutput {
|
|
479
|
+
returnCode: number
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const PULSE_WITHDRAW_AUTO_PARTICIPATION_OUTPUT_FIELDS: BinaryField[] = [
|
|
483
|
+
{
|
|
484
|
+
name: 'returnCode',
|
|
485
|
+
type: 'uint8',
|
|
486
|
+
offset: 0,
|
|
487
|
+
byteLength: 1,
|
|
488
|
+
},
|
|
489
|
+
]
|
|
490
|
+
|
|
491
|
+
export function decodePulseWithdrawAutoParticipationOutput(
|
|
492
|
+
data: Uint8Array,
|
|
493
|
+
): PulseWithdrawAutoParticipationOutput {
|
|
494
|
+
return decodePayload(data, PULSE_WITHDRAW_AUTO_PARTICIPATION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseWithdrawAutoParticipationOutput
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export const PULSE_SET_AUTO_CONFIG_INPUT_TYPE = 10
|
|
498
|
+
|
|
499
|
+
export interface PulseSetAutoConfigInput {
|
|
500
|
+
desiredTickets: number
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
const PULSE_SET_AUTO_CONFIG_INPUT_FIELDS: BinaryField[] = [
|
|
504
|
+
{
|
|
505
|
+
name: 'desiredTickets',
|
|
506
|
+
type: 'sint16',
|
|
507
|
+
offset: 0,
|
|
508
|
+
byteLength: 2,
|
|
509
|
+
},
|
|
510
|
+
]
|
|
511
|
+
|
|
512
|
+
export function buildPulseSetAutoConfigInput(
|
|
513
|
+
input: PulseSetAutoConfigInput,
|
|
514
|
+
): ContractCall {
|
|
515
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_AUTO_CONFIG_INPUT_TYPE, payload: buildPayload(PULSE_SET_AUTO_CONFIG_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export interface PulseSetAutoConfigOutput {
|
|
519
|
+
returnCode: number
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const PULSE_SET_AUTO_CONFIG_OUTPUT_FIELDS: BinaryField[] = [
|
|
523
|
+
{
|
|
524
|
+
name: 'returnCode',
|
|
525
|
+
type: 'uint8',
|
|
526
|
+
offset: 0,
|
|
527
|
+
byteLength: 1,
|
|
528
|
+
},
|
|
529
|
+
]
|
|
530
|
+
|
|
531
|
+
export function decodePulseSetAutoConfigOutput(
|
|
532
|
+
data: Uint8Array,
|
|
533
|
+
): PulseSetAutoConfigOutput {
|
|
534
|
+
return decodePayload(data, PULSE_SET_AUTO_CONFIG_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetAutoConfigOutput
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export const PULSE_SET_AUTO_LIMITS_INPUT_TYPE = 11
|
|
538
|
+
|
|
539
|
+
export interface PulseSetAutoLimitsInput {
|
|
540
|
+
maxTicketsPerUser: number
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
const PULSE_SET_AUTO_LIMITS_INPUT_FIELDS: BinaryField[] = [
|
|
544
|
+
{
|
|
545
|
+
name: 'maxTicketsPerUser',
|
|
546
|
+
type: 'uint16',
|
|
547
|
+
offset: 0,
|
|
548
|
+
byteLength: 2,
|
|
549
|
+
},
|
|
550
|
+
]
|
|
551
|
+
|
|
552
|
+
export function buildPulseSetAutoLimitsInput(
|
|
553
|
+
input: PulseSetAutoLimitsInput,
|
|
554
|
+
): ContractCall {
|
|
555
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_SET_AUTO_LIMITS_INPUT_TYPE, payload: buildPayload(PULSE_SET_AUTO_LIMITS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export interface PulseSetAutoLimitsOutput {
|
|
559
|
+
returnCode: number
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const PULSE_SET_AUTO_LIMITS_OUTPUT_FIELDS: BinaryField[] = [
|
|
563
|
+
{
|
|
564
|
+
name: 'returnCode',
|
|
565
|
+
type: 'uint8',
|
|
566
|
+
offset: 0,
|
|
567
|
+
byteLength: 1,
|
|
568
|
+
},
|
|
569
|
+
]
|
|
570
|
+
|
|
571
|
+
export function decodePulseSetAutoLimitsOutput(
|
|
572
|
+
data: Uint8Array,
|
|
573
|
+
): PulseSetAutoLimitsOutput {
|
|
574
|
+
return decodePayload(data, PULSE_SET_AUTO_LIMITS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseSetAutoLimitsOutput
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export const PULSE_TRANSFER_TOKEN_TO_QX_INPUT_TYPE = 12
|
|
578
|
+
|
|
579
|
+
export interface PulseTransferTokenToQxInput {
|
|
580
|
+
numberOfShares: bigint
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
const PULSE_TRANSFER_TOKEN_TO_QX_INPUT_FIELDS: BinaryField[] = [
|
|
584
|
+
{
|
|
585
|
+
name: 'numberOfShares',
|
|
586
|
+
type: 'sint64',
|
|
587
|
+
offset: 0,
|
|
588
|
+
byteLength: 8,
|
|
589
|
+
},
|
|
590
|
+
]
|
|
591
|
+
|
|
592
|
+
export function buildPulseTransferTokenToQxInput(
|
|
593
|
+
input: PulseTransferTokenToQxInput,
|
|
594
|
+
): ContractCall {
|
|
595
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_TRANSFER_TOKEN_TO_QX_INPUT_TYPE, payload: buildPayload(PULSE_TRANSFER_TOKEN_TO_QX_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export interface PulseTransferTokenToQxOutput {
|
|
599
|
+
returnCode: number
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const PULSE_TRANSFER_TOKEN_TO_QX_OUTPUT_FIELDS: BinaryField[] = [
|
|
603
|
+
{
|
|
604
|
+
name: 'returnCode',
|
|
605
|
+
type: 'uint8',
|
|
606
|
+
offset: 0,
|
|
607
|
+
byteLength: 1,
|
|
608
|
+
},
|
|
609
|
+
]
|
|
610
|
+
|
|
611
|
+
export function decodePulseTransferTokenToQxOutput(
|
|
612
|
+
data: Uint8Array,
|
|
613
|
+
): PulseTransferTokenToQxOutput {
|
|
614
|
+
return decodePayload(data, PULSE_TRANSFER_TOKEN_TO_QX_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseTransferTokenToQxOutput
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
export const PULSE_DEPOSIT_MANAGED_Q_HEART_INPUT_TYPE = 13
|
|
618
|
+
|
|
619
|
+
export interface PulseDepositManagedQHeartInput {
|
|
620
|
+
amount: bigint
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const PULSE_DEPOSIT_MANAGED_Q_HEART_INPUT_FIELDS: BinaryField[] = [
|
|
624
|
+
{
|
|
625
|
+
name: 'amount',
|
|
626
|
+
type: 'sint64',
|
|
627
|
+
offset: 0,
|
|
628
|
+
byteLength: 8,
|
|
629
|
+
},
|
|
630
|
+
]
|
|
631
|
+
|
|
632
|
+
export function buildPulseDepositManagedQHeartInput(
|
|
633
|
+
input: PulseDepositManagedQHeartInput,
|
|
634
|
+
): ContractCall {
|
|
635
|
+
return { contractIndex: PULSE_CONTRACT_INDEX, inputType: PULSE_DEPOSIT_MANAGED_Q_HEART_INPUT_TYPE, payload: buildPayload(PULSE_DEPOSIT_MANAGED_Q_HEART_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export interface PulseDepositManagedQHeartOutput {
|
|
639
|
+
returnCode: number
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
const PULSE_DEPOSIT_MANAGED_Q_HEART_OUTPUT_FIELDS: BinaryField[] = [
|
|
643
|
+
{
|
|
644
|
+
name: 'returnCode',
|
|
645
|
+
type: 'uint8',
|
|
646
|
+
offset: 0,
|
|
647
|
+
byteLength: 1,
|
|
648
|
+
},
|
|
649
|
+
]
|
|
650
|
+
|
|
651
|
+
export function decodePulseDepositManagedQHeartOutput(
|
|
652
|
+
data: Uint8Array,
|
|
653
|
+
): PulseDepositManagedQHeartOutput {
|
|
654
|
+
return decodePayload(data, PULSE_DEPOSIT_MANAGED_Q_HEART_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseDepositManagedQHeartOutput
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export const PULSE_GET_TICKET_PRICE_INPUT_TYPE = 1
|
|
658
|
+
export const PULSE_GET_TICKET_PRICE_INPUT_SIZE = 0
|
|
659
|
+
|
|
660
|
+
export interface PulseGetTicketPriceOutput {
|
|
661
|
+
ticketPrice: bigint
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const PULSE_GET_TICKET_PRICE_OUTPUT_FIELDS: BinaryField[] = [
|
|
665
|
+
{
|
|
666
|
+
name: 'ticketPrice',
|
|
667
|
+
type: 'uint64',
|
|
668
|
+
offset: 0,
|
|
669
|
+
byteLength: 8,
|
|
670
|
+
},
|
|
671
|
+
]
|
|
672
|
+
|
|
673
|
+
export function decodePulseGetTicketPriceOutput(
|
|
674
|
+
data: Uint8Array,
|
|
675
|
+
): PulseGetTicketPriceOutput {
|
|
676
|
+
return decodePayload(data, PULSE_GET_TICKET_PRICE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetTicketPriceOutput
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export async function pulseGetTicketPrice(
|
|
680
|
+
live: SmartContractCaller,
|
|
681
|
+
options?: ContractCallOptions,
|
|
682
|
+
): Promise<Result<PulseGetTicketPriceOutput, QubicRpcError>> {
|
|
683
|
+
return callContractFunction({
|
|
684
|
+
live,
|
|
685
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
686
|
+
inputType: PULSE_GET_TICKET_PRICE_INPUT_TYPE,
|
|
687
|
+
inputSize: PULSE_GET_TICKET_PRICE_INPUT_SIZE,
|
|
688
|
+
inputFields: [],
|
|
689
|
+
outputFields: PULSE_GET_TICKET_PRICE_OUTPUT_FIELDS,
|
|
690
|
+
structs: STRUCTS,
|
|
691
|
+
input: {},
|
|
692
|
+
...options,
|
|
693
|
+
})
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export const PULSE_GET_PLAYER_BALANCE_INPUT_TYPE = 2
|
|
697
|
+
export const PULSE_GET_PLAYER_BALANCE_INPUT_SIZE = 32
|
|
698
|
+
|
|
699
|
+
export interface PulseGetPlayerBalanceInput {
|
|
700
|
+
player: string
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
const PULSE_GET_PLAYER_BALANCE_INPUT_FIELDS: BinaryField[] = [
|
|
704
|
+
{
|
|
705
|
+
name: 'player',
|
|
706
|
+
type: 'id',
|
|
707
|
+
offset: 0,
|
|
708
|
+
byteLength: 32,
|
|
709
|
+
},
|
|
710
|
+
]
|
|
711
|
+
|
|
712
|
+
export function buildPulseGetPlayerBalanceInput(
|
|
713
|
+
input: PulseGetPlayerBalanceInput,
|
|
714
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
715
|
+
): Uint8Array {
|
|
716
|
+
return buildPayload(PULSE_GET_PLAYER_BALANCE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export interface PulseGetPlayerBalanceOutput {
|
|
720
|
+
balance: bigint
|
|
721
|
+
returnCode: number
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
const PULSE_GET_PLAYER_BALANCE_OUTPUT_FIELDS: BinaryField[] = [
|
|
725
|
+
{
|
|
726
|
+
name: 'balance',
|
|
727
|
+
type: 'uint64',
|
|
728
|
+
offset: 0,
|
|
729
|
+
byteLength: 8,
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
name: 'returnCode',
|
|
733
|
+
type: 'uint8',
|
|
734
|
+
offset: 8,
|
|
735
|
+
byteLength: 1,
|
|
736
|
+
},
|
|
737
|
+
]
|
|
738
|
+
|
|
739
|
+
export function decodePulseGetPlayerBalanceOutput(
|
|
740
|
+
data: Uint8Array,
|
|
741
|
+
): PulseGetPlayerBalanceOutput {
|
|
742
|
+
return decodePayload(data, PULSE_GET_PLAYER_BALANCE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetPlayerBalanceOutput
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export async function pulseGetPlayerBalance(
|
|
746
|
+
live: SmartContractCaller,
|
|
747
|
+
input: PulseGetPlayerBalanceInput,
|
|
748
|
+
options?: ContractCallOptions,
|
|
749
|
+
): Promise<Result<PulseGetPlayerBalanceOutput, QubicRpcError>> {
|
|
750
|
+
return callContractFunction({
|
|
751
|
+
live,
|
|
752
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
753
|
+
inputType: PULSE_GET_PLAYER_BALANCE_INPUT_TYPE,
|
|
754
|
+
inputSize: PULSE_GET_PLAYER_BALANCE_INPUT_SIZE,
|
|
755
|
+
inputFields: PULSE_GET_PLAYER_BALANCE_INPUT_FIELDS,
|
|
756
|
+
outputFields: PULSE_GET_PLAYER_BALANCE_OUTPUT_FIELDS,
|
|
757
|
+
structs: STRUCTS,
|
|
758
|
+
input: (input as unknown as Record<string, unknown>),
|
|
759
|
+
...options,
|
|
760
|
+
})
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export const PULSE_GET_ROUND_STATE_INPUT_TYPE = 3
|
|
764
|
+
export const PULSE_GET_ROUND_STATE_INPUT_SIZE = 0
|
|
765
|
+
|
|
766
|
+
export interface PulseGetRoundStateOutput {
|
|
767
|
+
epoch: number
|
|
768
|
+
lastDrawDateStamp: number
|
|
769
|
+
ticketCounter: number
|
|
770
|
+
maxPlayers: number
|
|
771
|
+
slotsLeft: number
|
|
772
|
+
currentState: number
|
|
773
|
+
drawHour: number
|
|
774
|
+
schedule: number
|
|
775
|
+
sellingOpen: number
|
|
776
|
+
returnCode: number
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
const PULSE_GET_ROUND_STATE_OUTPUT_FIELDS: BinaryField[] = [
|
|
780
|
+
{
|
|
781
|
+
name: 'epoch',
|
|
782
|
+
type: 'uint32',
|
|
783
|
+
offset: 0,
|
|
784
|
+
byteLength: 4,
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
name: 'lastDrawDateStamp',
|
|
788
|
+
type: 'uint32',
|
|
789
|
+
offset: 4,
|
|
790
|
+
byteLength: 4,
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: 'ticketCounter',
|
|
794
|
+
type: 'uint16',
|
|
795
|
+
offset: 8,
|
|
796
|
+
byteLength: 2,
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: 'maxPlayers',
|
|
800
|
+
type: 'uint16',
|
|
801
|
+
offset: 10,
|
|
802
|
+
byteLength: 2,
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
name: 'slotsLeft',
|
|
806
|
+
type: 'uint16',
|
|
807
|
+
offset: 12,
|
|
808
|
+
byteLength: 2,
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
name: 'currentState',
|
|
812
|
+
type: 'uint8',
|
|
813
|
+
offset: 14,
|
|
814
|
+
byteLength: 1,
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
name: 'drawHour',
|
|
818
|
+
type: 'uint8',
|
|
819
|
+
offset: 15,
|
|
820
|
+
byteLength: 1,
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
name: 'schedule',
|
|
824
|
+
type: 'uint8',
|
|
825
|
+
offset: 16,
|
|
826
|
+
byteLength: 1,
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
name: 'sellingOpen',
|
|
830
|
+
type: 'uint8',
|
|
831
|
+
offset: 17,
|
|
832
|
+
byteLength: 1,
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
name: 'returnCode',
|
|
836
|
+
type: 'uint8',
|
|
837
|
+
offset: 18,
|
|
838
|
+
byteLength: 1,
|
|
839
|
+
},
|
|
840
|
+
]
|
|
841
|
+
|
|
842
|
+
export function decodePulseGetRoundStateOutput(
|
|
843
|
+
data: Uint8Array,
|
|
844
|
+
): PulseGetRoundStateOutput {
|
|
845
|
+
return decodePayload(data, PULSE_GET_ROUND_STATE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetRoundStateOutput
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export async function pulseGetRoundState(
|
|
849
|
+
live: SmartContractCaller,
|
|
850
|
+
options?: ContractCallOptions,
|
|
851
|
+
): Promise<Result<PulseGetRoundStateOutput, QubicRpcError>> {
|
|
852
|
+
return callContractFunction({
|
|
853
|
+
live,
|
|
854
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
855
|
+
inputType: PULSE_GET_ROUND_STATE_INPUT_TYPE,
|
|
856
|
+
inputSize: PULSE_GET_ROUND_STATE_INPUT_SIZE,
|
|
857
|
+
inputFields: [],
|
|
858
|
+
outputFields: PULSE_GET_ROUND_STATE_OUTPUT_FIELDS,
|
|
859
|
+
structs: STRUCTS,
|
|
860
|
+
input: {},
|
|
861
|
+
...options,
|
|
862
|
+
})
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export const PULSE_GET_FEES_INPUT_TYPE = 4
|
|
866
|
+
export const PULSE_GET_FEES_INPUT_SIZE = 0
|
|
867
|
+
|
|
868
|
+
export interface PulseGetFeesOutput {
|
|
869
|
+
devPercent: number
|
|
870
|
+
burnPercent: number
|
|
871
|
+
shareholdersPercent: number
|
|
872
|
+
rlShareholdersPercent: number
|
|
873
|
+
returnCode: number
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
const PULSE_GET_FEES_OUTPUT_FIELDS: BinaryField[] = [
|
|
877
|
+
{
|
|
878
|
+
name: 'devPercent',
|
|
879
|
+
type: 'uint8',
|
|
880
|
+
offset: 0,
|
|
881
|
+
byteLength: 1,
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
name: 'burnPercent',
|
|
885
|
+
type: 'uint8',
|
|
886
|
+
offset: 1,
|
|
887
|
+
byteLength: 1,
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
name: 'shareholdersPercent',
|
|
891
|
+
type: 'uint8',
|
|
892
|
+
offset: 2,
|
|
893
|
+
byteLength: 1,
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: 'rlShareholdersPercent',
|
|
897
|
+
type: 'uint8',
|
|
898
|
+
offset: 3,
|
|
899
|
+
byteLength: 1,
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: 'returnCode',
|
|
903
|
+
type: 'uint8',
|
|
904
|
+
offset: 4,
|
|
905
|
+
byteLength: 1,
|
|
906
|
+
},
|
|
907
|
+
]
|
|
908
|
+
|
|
909
|
+
export function decodePulseGetFeesOutput(
|
|
910
|
+
data: Uint8Array,
|
|
911
|
+
): PulseGetFeesOutput {
|
|
912
|
+
return decodePayload(data, PULSE_GET_FEES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetFeesOutput
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export async function pulseGetFees(
|
|
916
|
+
live: SmartContractCaller,
|
|
917
|
+
options?: ContractCallOptions,
|
|
918
|
+
): Promise<Result<PulseGetFeesOutput, QubicRpcError>> {
|
|
919
|
+
return callContractFunction({
|
|
920
|
+
live,
|
|
921
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
922
|
+
inputType: PULSE_GET_FEES_INPUT_TYPE,
|
|
923
|
+
inputSize: PULSE_GET_FEES_INPUT_SIZE,
|
|
924
|
+
inputFields: [],
|
|
925
|
+
outputFields: PULSE_GET_FEES_OUTPUT_FIELDS,
|
|
926
|
+
structs: STRUCTS,
|
|
927
|
+
input: {},
|
|
928
|
+
...options,
|
|
929
|
+
})
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export const PULSE_GET_Q_HEART_HOLD_LIMIT_INPUT_TYPE = 5
|
|
933
|
+
export const PULSE_GET_Q_HEART_HOLD_LIMIT_INPUT_SIZE = 0
|
|
934
|
+
|
|
935
|
+
export interface PulseGetQHeartHoldLimitOutput {
|
|
936
|
+
qheartHoldLimit: bigint
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
const PULSE_GET_Q_HEART_HOLD_LIMIT_OUTPUT_FIELDS: BinaryField[] = [
|
|
940
|
+
{
|
|
941
|
+
name: 'qheartHoldLimit',
|
|
942
|
+
type: 'uint64',
|
|
943
|
+
offset: 0,
|
|
944
|
+
byteLength: 8,
|
|
945
|
+
},
|
|
946
|
+
]
|
|
947
|
+
|
|
948
|
+
export function decodePulseGetQHeartHoldLimitOutput(
|
|
949
|
+
data: Uint8Array,
|
|
950
|
+
): PulseGetQHeartHoldLimitOutput {
|
|
951
|
+
return decodePayload(data, PULSE_GET_Q_HEART_HOLD_LIMIT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetQHeartHoldLimitOutput
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export async function pulseGetQHeartHoldLimit(
|
|
955
|
+
live: SmartContractCaller,
|
|
956
|
+
options?: ContractCallOptions,
|
|
957
|
+
): Promise<Result<PulseGetQHeartHoldLimitOutput, QubicRpcError>> {
|
|
958
|
+
return callContractFunction({
|
|
959
|
+
live,
|
|
960
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
961
|
+
inputType: PULSE_GET_Q_HEART_HOLD_LIMIT_INPUT_TYPE,
|
|
962
|
+
inputSize: PULSE_GET_Q_HEART_HOLD_LIMIT_INPUT_SIZE,
|
|
963
|
+
inputFields: [],
|
|
964
|
+
outputFields: PULSE_GET_Q_HEART_HOLD_LIMIT_OUTPUT_FIELDS,
|
|
965
|
+
structs: STRUCTS,
|
|
966
|
+
input: {},
|
|
967
|
+
...options,
|
|
968
|
+
})
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export const PULSE_GET_Q_HEART_WALLET_INPUT_TYPE = 6
|
|
972
|
+
export const PULSE_GET_Q_HEART_WALLET_INPUT_SIZE = 0
|
|
973
|
+
|
|
974
|
+
export interface PulseGetQHeartWalletOutput {
|
|
975
|
+
wallet: string
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
const PULSE_GET_Q_HEART_WALLET_OUTPUT_FIELDS: BinaryField[] = [
|
|
979
|
+
{
|
|
980
|
+
name: 'wallet',
|
|
981
|
+
type: 'id',
|
|
982
|
+
offset: 0,
|
|
983
|
+
byteLength: 32,
|
|
984
|
+
},
|
|
985
|
+
]
|
|
986
|
+
|
|
987
|
+
export function decodePulseGetQHeartWalletOutput(
|
|
988
|
+
data: Uint8Array,
|
|
989
|
+
publicKeyToIdentity: (pk: Uint8Array) => string,
|
|
990
|
+
): PulseGetQHeartWalletOutput {
|
|
991
|
+
return decodePayload(data, PULSE_GET_Q_HEART_WALLET_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as PulseGetQHeartWalletOutput
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export async function pulseGetQHeartWallet(
|
|
995
|
+
live: SmartContractCaller,
|
|
996
|
+
options?: ContractCallOptions,
|
|
997
|
+
): Promise<Result<PulseGetQHeartWalletOutput, QubicRpcError>> {
|
|
998
|
+
return callContractFunction({
|
|
999
|
+
live,
|
|
1000
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1001
|
+
inputType: PULSE_GET_Q_HEART_WALLET_INPUT_TYPE,
|
|
1002
|
+
inputSize: PULSE_GET_Q_HEART_WALLET_INPUT_SIZE,
|
|
1003
|
+
inputFields: [],
|
|
1004
|
+
outputFields: PULSE_GET_Q_HEART_WALLET_OUTPUT_FIELDS,
|
|
1005
|
+
structs: STRUCTS,
|
|
1006
|
+
input: {},
|
|
1007
|
+
...options,
|
|
1008
|
+
})
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
export const PULSE_GET_WINNING_DIGITS_INPUT_TYPE = 7
|
|
1012
|
+
export const PULSE_GET_WINNING_DIGITS_INPUT_SIZE = 0
|
|
1013
|
+
|
|
1014
|
+
export interface PulseGetWinningDigitsOutput {
|
|
1015
|
+
digits: number[]
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
const PULSE_GET_WINNING_DIGITS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1019
|
+
{
|
|
1020
|
+
name: 'digits',
|
|
1021
|
+
type: 'array',
|
|
1022
|
+
offset: 0,
|
|
1023
|
+
byteLength: 0,
|
|
1024
|
+
arrayLength: 0,
|
|
1025
|
+
arrayItemType: 'uint8',
|
|
1026
|
+
arrayItemByteLength: 1,
|
|
1027
|
+
},
|
|
1028
|
+
]
|
|
1029
|
+
|
|
1030
|
+
export function decodePulseGetWinningDigitsOutput(
|
|
1031
|
+
data: Uint8Array,
|
|
1032
|
+
): PulseGetWinningDigitsOutput {
|
|
1033
|
+
return decodePayload(data, PULSE_GET_WINNING_DIGITS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetWinningDigitsOutput
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export async function pulseGetWinningDigits(
|
|
1037
|
+
live: SmartContractCaller,
|
|
1038
|
+
options?: ContractCallOptions,
|
|
1039
|
+
): Promise<Result<PulseGetWinningDigitsOutput, QubicRpcError>> {
|
|
1040
|
+
return callContractFunction({
|
|
1041
|
+
live,
|
|
1042
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1043
|
+
inputType: PULSE_GET_WINNING_DIGITS_INPUT_TYPE,
|
|
1044
|
+
inputSize: PULSE_GET_WINNING_DIGITS_INPUT_SIZE,
|
|
1045
|
+
inputFields: [],
|
|
1046
|
+
outputFields: PULSE_GET_WINNING_DIGITS_OUTPUT_FIELDS,
|
|
1047
|
+
structs: STRUCTS,
|
|
1048
|
+
input: {},
|
|
1049
|
+
...options,
|
|
1050
|
+
})
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
export const PULSE_GET_BALANCE_INPUT_TYPE = 8
|
|
1054
|
+
export const PULSE_GET_BALANCE_INPUT_SIZE = 0
|
|
1055
|
+
|
|
1056
|
+
export interface PulseGetBalanceOutput {
|
|
1057
|
+
balance: bigint
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
const PULSE_GET_BALANCE_OUTPUT_FIELDS: BinaryField[] = [
|
|
1061
|
+
{
|
|
1062
|
+
name: 'balance',
|
|
1063
|
+
type: 'uint64',
|
|
1064
|
+
offset: 0,
|
|
1065
|
+
byteLength: 8,
|
|
1066
|
+
},
|
|
1067
|
+
]
|
|
1068
|
+
|
|
1069
|
+
export function decodePulseGetBalanceOutput(
|
|
1070
|
+
data: Uint8Array,
|
|
1071
|
+
): PulseGetBalanceOutput {
|
|
1072
|
+
return decodePayload(data, PULSE_GET_BALANCE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetBalanceOutput
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
export async function pulseGetBalance(
|
|
1076
|
+
live: SmartContractCaller,
|
|
1077
|
+
options?: ContractCallOptions,
|
|
1078
|
+
): Promise<Result<PulseGetBalanceOutput, QubicRpcError>> {
|
|
1079
|
+
return callContractFunction({
|
|
1080
|
+
live,
|
|
1081
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1082
|
+
inputType: PULSE_GET_BALANCE_INPUT_TYPE,
|
|
1083
|
+
inputSize: PULSE_GET_BALANCE_INPUT_SIZE,
|
|
1084
|
+
inputFields: [],
|
|
1085
|
+
outputFields: PULSE_GET_BALANCE_OUTPUT_FIELDS,
|
|
1086
|
+
structs: STRUCTS,
|
|
1087
|
+
input: {},
|
|
1088
|
+
...options,
|
|
1089
|
+
})
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
export const PULSE_GET_WINNERS_INPUT_TYPE = 9
|
|
1093
|
+
export const PULSE_GET_WINNERS_INPUT_SIZE = 0
|
|
1094
|
+
|
|
1095
|
+
export interface PulseGetWinnersOutput {
|
|
1096
|
+
winners: number[]
|
|
1097
|
+
winnersCounter: bigint
|
|
1098
|
+
returnCode: number
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
const PULSE_GET_WINNERS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1102
|
+
{
|
|
1103
|
+
name: 'winners',
|
|
1104
|
+
type: 'array',
|
|
1105
|
+
offset: 0,
|
|
1106
|
+
byteLength: 43008,
|
|
1107
|
+
arrayLength: 1024,
|
|
1108
|
+
arrayItemByteLength: 42,
|
|
1109
|
+
arrayItemStructRef: 'WinnerInfo',
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
name: 'winnersCounter',
|
|
1113
|
+
type: 'uint64',
|
|
1114
|
+
offset: 43008,
|
|
1115
|
+
byteLength: 8,
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
name: 'returnCode',
|
|
1119
|
+
type: 'uint8',
|
|
1120
|
+
offset: 43016,
|
|
1121
|
+
byteLength: 1,
|
|
1122
|
+
},
|
|
1123
|
+
]
|
|
1124
|
+
|
|
1125
|
+
export function decodePulseGetWinnersOutput(
|
|
1126
|
+
data: Uint8Array,
|
|
1127
|
+
): PulseGetWinnersOutput {
|
|
1128
|
+
return decodePayload(data, PULSE_GET_WINNERS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetWinnersOutput
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
export async function pulseGetWinners(
|
|
1132
|
+
live: SmartContractCaller,
|
|
1133
|
+
options?: ContractCallOptions,
|
|
1134
|
+
): Promise<Result<PulseGetWinnersOutput, QubicRpcError>> {
|
|
1135
|
+
return callContractFunction({
|
|
1136
|
+
live,
|
|
1137
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1138
|
+
inputType: PULSE_GET_WINNERS_INPUT_TYPE,
|
|
1139
|
+
inputSize: PULSE_GET_WINNERS_INPUT_SIZE,
|
|
1140
|
+
inputFields: [],
|
|
1141
|
+
outputFields: PULSE_GET_WINNERS_OUTPUT_FIELDS,
|
|
1142
|
+
structs: STRUCTS,
|
|
1143
|
+
input: {},
|
|
1144
|
+
...options,
|
|
1145
|
+
})
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
export const PULSE_GET_AUTO_PARTICIPATION_INPUT_TYPE = 10
|
|
1149
|
+
export const PULSE_GET_AUTO_PARTICIPATION_INPUT_SIZE = 32
|
|
1150
|
+
|
|
1151
|
+
export interface PulseGetAutoParticipationInput {
|
|
1152
|
+
player: string
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
const PULSE_GET_AUTO_PARTICIPATION_INPUT_FIELDS: BinaryField[] = [
|
|
1156
|
+
{
|
|
1157
|
+
name: 'player',
|
|
1158
|
+
type: 'id',
|
|
1159
|
+
offset: 0,
|
|
1160
|
+
byteLength: 32,
|
|
1161
|
+
},
|
|
1162
|
+
]
|
|
1163
|
+
|
|
1164
|
+
export function buildPulseGetAutoParticipationInput(
|
|
1165
|
+
input: PulseGetAutoParticipationInput,
|
|
1166
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
1167
|
+
): Uint8Array {
|
|
1168
|
+
return buildPayload(PULSE_GET_AUTO_PARTICIPATION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
export interface PulseGetAutoParticipationOutput {
|
|
1172
|
+
deposit: bigint
|
|
1173
|
+
desiredTickets: number
|
|
1174
|
+
returnCode: number
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
const PULSE_GET_AUTO_PARTICIPATION_OUTPUT_FIELDS: BinaryField[] = [
|
|
1178
|
+
{
|
|
1179
|
+
name: 'deposit',
|
|
1180
|
+
type: 'uint64',
|
|
1181
|
+
offset: 0,
|
|
1182
|
+
byteLength: 8,
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: 'desiredTickets',
|
|
1186
|
+
type: 'uint16',
|
|
1187
|
+
offset: 8,
|
|
1188
|
+
byteLength: 2,
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
name: 'returnCode',
|
|
1192
|
+
type: 'uint8',
|
|
1193
|
+
offset: 10,
|
|
1194
|
+
byteLength: 1,
|
|
1195
|
+
},
|
|
1196
|
+
]
|
|
1197
|
+
|
|
1198
|
+
export function decodePulseGetAutoParticipationOutput(
|
|
1199
|
+
data: Uint8Array,
|
|
1200
|
+
): PulseGetAutoParticipationOutput {
|
|
1201
|
+
return decodePayload(data, PULSE_GET_AUTO_PARTICIPATION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetAutoParticipationOutput
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
export async function pulseGetAutoParticipation(
|
|
1205
|
+
live: SmartContractCaller,
|
|
1206
|
+
input: PulseGetAutoParticipationInput,
|
|
1207
|
+
options?: ContractCallOptions,
|
|
1208
|
+
): Promise<Result<PulseGetAutoParticipationOutput, QubicRpcError>> {
|
|
1209
|
+
return callContractFunction({
|
|
1210
|
+
live,
|
|
1211
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1212
|
+
inputType: PULSE_GET_AUTO_PARTICIPATION_INPUT_TYPE,
|
|
1213
|
+
inputSize: PULSE_GET_AUTO_PARTICIPATION_INPUT_SIZE,
|
|
1214
|
+
inputFields: PULSE_GET_AUTO_PARTICIPATION_INPUT_FIELDS,
|
|
1215
|
+
outputFields: PULSE_GET_AUTO_PARTICIPATION_OUTPUT_FIELDS,
|
|
1216
|
+
structs: STRUCTS,
|
|
1217
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1218
|
+
...options,
|
|
1219
|
+
})
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
export const PULSE_GET_AUTO_STATS_INPUT_TYPE = 11
|
|
1223
|
+
export const PULSE_GET_AUTO_STATS_INPUT_SIZE = 0
|
|
1224
|
+
|
|
1225
|
+
export interface PulseGetAutoStatsOutput {
|
|
1226
|
+
participants: number[]
|
|
1227
|
+
maxAutoParticipants: number
|
|
1228
|
+
maxAutoTicketsPerUser: number
|
|
1229
|
+
roundSlotsLeft: number
|
|
1230
|
+
returnCode: number
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
const PULSE_GET_AUTO_STATS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1234
|
+
{
|
|
1235
|
+
name: 'participants',
|
|
1236
|
+
type: 'array',
|
|
1237
|
+
offset: 0,
|
|
1238
|
+
byteLength: 0,
|
|
1239
|
+
arrayLength: 0,
|
|
1240
|
+
arrayItemByteLength: 42,
|
|
1241
|
+
arrayItemStructRef: 'AutoParticipant',
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
name: 'maxAutoParticipants',
|
|
1245
|
+
type: 'uint16',
|
|
1246
|
+
offset: 0,
|
|
1247
|
+
byteLength: 2,
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
name: 'maxAutoTicketsPerUser',
|
|
1251
|
+
type: 'uint16',
|
|
1252
|
+
offset: 2,
|
|
1253
|
+
byteLength: 2,
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
name: 'roundSlotsLeft',
|
|
1257
|
+
type: 'uint16',
|
|
1258
|
+
offset: 4,
|
|
1259
|
+
byteLength: 2,
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
name: 'returnCode',
|
|
1263
|
+
type: 'uint8',
|
|
1264
|
+
offset: 6,
|
|
1265
|
+
byteLength: 1,
|
|
1266
|
+
},
|
|
1267
|
+
]
|
|
1268
|
+
|
|
1269
|
+
export function decodePulseGetAutoStatsOutput(
|
|
1270
|
+
data: Uint8Array,
|
|
1271
|
+
): PulseGetAutoStatsOutput {
|
|
1272
|
+
return decodePayload(data, PULSE_GET_AUTO_STATS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetAutoStatsOutput
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
export async function pulseGetAutoStats(
|
|
1276
|
+
live: SmartContractCaller,
|
|
1277
|
+
options?: ContractCallOptions,
|
|
1278
|
+
): Promise<Result<PulseGetAutoStatsOutput, QubicRpcError>> {
|
|
1279
|
+
return callContractFunction({
|
|
1280
|
+
live,
|
|
1281
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1282
|
+
inputType: PULSE_GET_AUTO_STATS_INPUT_TYPE,
|
|
1283
|
+
inputSize: PULSE_GET_AUTO_STATS_INPUT_SIZE,
|
|
1284
|
+
inputFields: [],
|
|
1285
|
+
outputFields: PULSE_GET_AUTO_STATS_OUTPUT_FIELDS,
|
|
1286
|
+
structs: STRUCTS,
|
|
1287
|
+
input: {},
|
|
1288
|
+
...options,
|
|
1289
|
+
})
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
export const PULSE_VALIDATE_DIGITS_INPUT_TYPE = 12
|
|
1293
|
+
export const PULSE_VALIDATE_DIGITS_INPUT_SIZE = 0
|
|
1294
|
+
|
|
1295
|
+
export interface PulseValidateDigitsInput {
|
|
1296
|
+
digits: number[]
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
const PULSE_VALIDATE_DIGITS_INPUT_FIELDS: BinaryField[] = [
|
|
1300
|
+
{
|
|
1301
|
+
name: 'digits',
|
|
1302
|
+
type: 'array',
|
|
1303
|
+
offset: 0,
|
|
1304
|
+
byteLength: 0,
|
|
1305
|
+
arrayLength: 0,
|
|
1306
|
+
arrayItemType: 'uint8',
|
|
1307
|
+
arrayItemByteLength: 1,
|
|
1308
|
+
},
|
|
1309
|
+
]
|
|
1310
|
+
|
|
1311
|
+
export function buildPulseValidateDigitsInput(
|
|
1312
|
+
input: PulseValidateDigitsInput,
|
|
1313
|
+
): Uint8Array {
|
|
1314
|
+
return buildPayload(PULSE_VALIDATE_DIGITS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
export interface PulseValidateDigitsOutput {
|
|
1318
|
+
isValid: number
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
const PULSE_VALIDATE_DIGITS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1322
|
+
{
|
|
1323
|
+
name: 'isValid',
|
|
1324
|
+
type: 'uint8',
|
|
1325
|
+
offset: 0,
|
|
1326
|
+
byteLength: 1,
|
|
1327
|
+
},
|
|
1328
|
+
]
|
|
1329
|
+
|
|
1330
|
+
export function decodePulseValidateDigitsOutput(
|
|
1331
|
+
data: Uint8Array,
|
|
1332
|
+
): PulseValidateDigitsOutput {
|
|
1333
|
+
return decodePayload(data, PULSE_VALIDATE_DIGITS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseValidateDigitsOutput
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
export async function pulseValidateDigits(
|
|
1337
|
+
live: SmartContractCaller,
|
|
1338
|
+
input: PulseValidateDigitsInput,
|
|
1339
|
+
options?: ContractCallOptions,
|
|
1340
|
+
): Promise<Result<PulseValidateDigitsOutput, QubicRpcError>> {
|
|
1341
|
+
return callContractFunction({
|
|
1342
|
+
live,
|
|
1343
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1344
|
+
inputType: PULSE_VALIDATE_DIGITS_INPUT_TYPE,
|
|
1345
|
+
inputSize: PULSE_VALIDATE_DIGITS_INPUT_SIZE,
|
|
1346
|
+
inputFields: PULSE_VALIDATE_DIGITS_INPUT_FIELDS,
|
|
1347
|
+
outputFields: PULSE_VALIDATE_DIGITS_OUTPUT_FIELDS,
|
|
1348
|
+
structs: STRUCTS,
|
|
1349
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1350
|
+
...options,
|
|
1351
|
+
})
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
export const PULSE_GET_PLAYERS_INPUT_TYPE = 13
|
|
1355
|
+
export const PULSE_GET_PLAYERS_INPUT_SIZE = 0
|
|
1356
|
+
|
|
1357
|
+
export interface PulseGetPlayersOutput {
|
|
1358
|
+
players: number[]
|
|
1359
|
+
returnCode: number
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
const PULSE_GET_PLAYERS_OUTPUT_FIELDS: BinaryField[] = [
|
|
1363
|
+
{
|
|
1364
|
+
name: 'players',
|
|
1365
|
+
type: 'array',
|
|
1366
|
+
offset: 0,
|
|
1367
|
+
byteLength: 32768,
|
|
1368
|
+
arrayLength: 1024,
|
|
1369
|
+
arrayItemByteLength: 32,
|
|
1370
|
+
arrayItemStructRef: 'Ticket',
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
name: 'returnCode',
|
|
1374
|
+
type: 'uint8',
|
|
1375
|
+
offset: 32768,
|
|
1376
|
+
byteLength: 1,
|
|
1377
|
+
},
|
|
1378
|
+
]
|
|
1379
|
+
|
|
1380
|
+
export function decodePulseGetPlayersOutput(
|
|
1381
|
+
data: Uint8Array,
|
|
1382
|
+
): PulseGetPlayersOutput {
|
|
1383
|
+
return decodePayload(data, PULSE_GET_PLAYERS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetPlayersOutput
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
export async function pulseGetPlayers(
|
|
1387
|
+
live: SmartContractCaller,
|
|
1388
|
+
options?: ContractCallOptions,
|
|
1389
|
+
): Promise<Result<PulseGetPlayersOutput, QubicRpcError>> {
|
|
1390
|
+
return callContractFunction({
|
|
1391
|
+
live,
|
|
1392
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1393
|
+
inputType: PULSE_GET_PLAYERS_INPUT_TYPE,
|
|
1394
|
+
inputSize: PULSE_GET_PLAYERS_INPUT_SIZE,
|
|
1395
|
+
inputFields: [],
|
|
1396
|
+
outputFields: PULSE_GET_PLAYERS_OUTPUT_FIELDS,
|
|
1397
|
+
structs: STRUCTS,
|
|
1398
|
+
input: {},
|
|
1399
|
+
...options,
|
|
1400
|
+
})
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export const PULSE_GET_PRIZE_TABLE_INPUT_TYPE = 14
|
|
1404
|
+
export const PULSE_GET_PRIZE_TABLE_INPUT_SIZE = 0
|
|
1405
|
+
|
|
1406
|
+
export interface PulseGetPrizeTableOutput {
|
|
1407
|
+
leftAlignedRewards: bigint[]
|
|
1408
|
+
anyPositionRewards: bigint[]
|
|
1409
|
+
ticketPrice: bigint
|
|
1410
|
+
returnCode: number
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
const PULSE_GET_PRIZE_TABLE_OUTPUT_FIELDS: BinaryField[] = [
|
|
1414
|
+
{
|
|
1415
|
+
name: 'leftAlignedRewards',
|
|
1416
|
+
type: 'array',
|
|
1417
|
+
offset: 0,
|
|
1418
|
+
byteLength: 0,
|
|
1419
|
+
arrayLength: 0,
|
|
1420
|
+
arrayItemType: 'uint64',
|
|
1421
|
+
arrayItemByteLength: 8,
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
name: 'anyPositionRewards',
|
|
1425
|
+
type: 'array',
|
|
1426
|
+
offset: 0,
|
|
1427
|
+
byteLength: 0,
|
|
1428
|
+
arrayLength: 0,
|
|
1429
|
+
arrayItemType: 'uint64',
|
|
1430
|
+
arrayItemByteLength: 8,
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
name: 'ticketPrice',
|
|
1434
|
+
type: 'uint64',
|
|
1435
|
+
offset: 0,
|
|
1436
|
+
byteLength: 8,
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
name: 'returnCode',
|
|
1440
|
+
type: 'uint8',
|
|
1441
|
+
offset: 8,
|
|
1442
|
+
byteLength: 1,
|
|
1443
|
+
},
|
|
1444
|
+
]
|
|
1445
|
+
|
|
1446
|
+
export function decodePulseGetPrizeTableOutput(
|
|
1447
|
+
data: Uint8Array,
|
|
1448
|
+
): PulseGetPrizeTableOutput {
|
|
1449
|
+
return decodePayload(data, PULSE_GET_PRIZE_TABLE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as PulseGetPrizeTableOutput
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export async function pulseGetPrizeTable(
|
|
1453
|
+
live: SmartContractCaller,
|
|
1454
|
+
options?: ContractCallOptions,
|
|
1455
|
+
): Promise<Result<PulseGetPrizeTableOutput, QubicRpcError>> {
|
|
1456
|
+
return callContractFunction({
|
|
1457
|
+
live,
|
|
1458
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1459
|
+
inputType: PULSE_GET_PRIZE_TABLE_INPUT_TYPE,
|
|
1460
|
+
inputSize: PULSE_GET_PRIZE_TABLE_INPUT_SIZE,
|
|
1461
|
+
inputFields: [],
|
|
1462
|
+
outputFields: PULSE_GET_PRIZE_TABLE_OUTPUT_FIELDS,
|
|
1463
|
+
structs: STRUCTS,
|
|
1464
|
+
input: {},
|
|
1465
|
+
...options,
|
|
1466
|
+
})
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export const pulse = {
|
|
1470
|
+
contractIndex: PULSE_CONTRACT_INDEX,
|
|
1471
|
+
GetTicketPrice: pulseGetTicketPrice,
|
|
1472
|
+
GetPlayerBalance: pulseGetPlayerBalance,
|
|
1473
|
+
GetRoundState: pulseGetRoundState,
|
|
1474
|
+
GetFees: pulseGetFees,
|
|
1475
|
+
GetQHeartHoldLimit: pulseGetQHeartHoldLimit,
|
|
1476
|
+
GetQHeartWallet: pulseGetQHeartWallet,
|
|
1477
|
+
GetWinningDigits: pulseGetWinningDigits,
|
|
1478
|
+
GetBalance: pulseGetBalance,
|
|
1479
|
+
GetWinners: pulseGetWinners,
|
|
1480
|
+
GetAutoParticipation: pulseGetAutoParticipation,
|
|
1481
|
+
GetAutoStats: pulseGetAutoStats,
|
|
1482
|
+
ValidateDigits: pulseValidateDigits,
|
|
1483
|
+
GetPlayers: pulseGetPlayers,
|
|
1484
|
+
GetPrizeTable: pulseGetPrizeTable,
|
|
1485
|
+
buildBuyTicketInput: buildPulseBuyTicketInput,
|
|
1486
|
+
decodeBuyTicketOutput: decodePulseBuyTicketOutput,
|
|
1487
|
+
buildSetPriceInput: buildPulseSetPriceInput,
|
|
1488
|
+
decodeSetPriceOutput: decodePulseSetPriceOutput,
|
|
1489
|
+
buildSetScheduleInput: buildPulseSetScheduleInput,
|
|
1490
|
+
decodeSetScheduleOutput: decodePulseSetScheduleOutput,
|
|
1491
|
+
buildSetDrawHourInput: buildPulseSetDrawHourInput,
|
|
1492
|
+
decodeSetDrawHourOutput: decodePulseSetDrawHourOutput,
|
|
1493
|
+
buildSetFeesInput: buildPulseSetFeesInput,
|
|
1494
|
+
decodeSetFeesOutput: decodePulseSetFeesOutput,
|
|
1495
|
+
buildSetQHeartHoldLimitInput: buildPulseSetQHeartHoldLimitInput,
|
|
1496
|
+
decodeSetQHeartHoldLimitOutput: decodePulseSetQHeartHoldLimitOutput,
|
|
1497
|
+
buildBuyRandomTicketsInput: buildPulseBuyRandomTicketsInput,
|
|
1498
|
+
decodeBuyRandomTicketsOutput: decodePulseBuyRandomTicketsOutput,
|
|
1499
|
+
buildDepositAutoParticipationInput: buildPulseDepositAutoParticipationInput,
|
|
1500
|
+
decodeDepositAutoParticipationOutput: decodePulseDepositAutoParticipationOutput,
|
|
1501
|
+
buildWithdrawAutoParticipationInput: buildPulseWithdrawAutoParticipationInput,
|
|
1502
|
+
decodeWithdrawAutoParticipationOutput: decodePulseWithdrawAutoParticipationOutput,
|
|
1503
|
+
buildSetAutoConfigInput: buildPulseSetAutoConfigInput,
|
|
1504
|
+
decodeSetAutoConfigOutput: decodePulseSetAutoConfigOutput,
|
|
1505
|
+
buildSetAutoLimitsInput: buildPulseSetAutoLimitsInput,
|
|
1506
|
+
decodeSetAutoLimitsOutput: decodePulseSetAutoLimitsOutput,
|
|
1507
|
+
buildTransferTokenToQxInput: buildPulseTransferTokenToQxInput,
|
|
1508
|
+
decodeTransferTokenToQxOutput: decodePulseTransferTokenToQxOutput,
|
|
1509
|
+
buildDepositManagedQHeartInput: buildPulseDepositManagedQHeartInput,
|
|
1510
|
+
decodeDepositManagedQHeartOutput: decodePulseDepositManagedQHeartOutput,
|
|
1511
|
+
}
|
|
1512
|
+
|