@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,1491 @@
|
|
|
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_RWA_CONTRACT_INDEX = 20
|
|
9
|
+
|
|
10
|
+
export interface QRWAQRWAGovParamsStruct {
|
|
11
|
+
mAdminAddress: string
|
|
12
|
+
electricityAddress: string
|
|
13
|
+
maintenanceAddress: string
|
|
14
|
+
reinvestmentAddress: string
|
|
15
|
+
qmineDevAddress: string
|
|
16
|
+
electricityPercent: bigint
|
|
17
|
+
maintenancePercent: bigint
|
|
18
|
+
reinvestmentPercent: bigint
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface QRWAAssetStruct {
|
|
22
|
+
issuer: string
|
|
23
|
+
assetName: bigint
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface QRWAQRWAGovProposalStruct {
|
|
27
|
+
proposalId: bigint
|
|
28
|
+
status: bigint
|
|
29
|
+
score: bigint
|
|
30
|
+
params: QRWAQRWAGovParamsStruct
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface QRWAQRWAPayoutEntryStruct {
|
|
34
|
+
recipient: string
|
|
35
|
+
amount: bigint
|
|
36
|
+
qmineHolding: bigint
|
|
37
|
+
qrwaHolding: bigint
|
|
38
|
+
tick: number
|
|
39
|
+
epoch: number
|
|
40
|
+
payoutType: number
|
|
41
|
+
_pad0: number
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const STRUCTS: Record<string, NamedStruct> = {
|
|
45
|
+
'QRWAGovParams': {
|
|
46
|
+
name: 'QRWAGovParams',
|
|
47
|
+
byteLength: 184,
|
|
48
|
+
fields: [
|
|
49
|
+
{
|
|
50
|
+
name: 'mAdminAddress',
|
|
51
|
+
type: 'id',
|
|
52
|
+
offset: 0,
|
|
53
|
+
byteLength: 32,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'electricityAddress',
|
|
57
|
+
type: 'id',
|
|
58
|
+
offset: 32,
|
|
59
|
+
byteLength: 32,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'maintenanceAddress',
|
|
63
|
+
type: 'id',
|
|
64
|
+
offset: 64,
|
|
65
|
+
byteLength: 32,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'reinvestmentAddress',
|
|
69
|
+
type: 'id',
|
|
70
|
+
offset: 96,
|
|
71
|
+
byteLength: 32,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'qmineDevAddress',
|
|
75
|
+
type: 'id',
|
|
76
|
+
offset: 128,
|
|
77
|
+
byteLength: 32,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'electricityPercent',
|
|
81
|
+
type: 'uint64',
|
|
82
|
+
offset: 160,
|
|
83
|
+
byteLength: 8,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'maintenancePercent',
|
|
87
|
+
type: 'uint64',
|
|
88
|
+
offset: 168,
|
|
89
|
+
byteLength: 8,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'reinvestmentPercent',
|
|
93
|
+
type: 'uint64',
|
|
94
|
+
offset: 176,
|
|
95
|
+
byteLength: 8,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
'Asset': {
|
|
100
|
+
name: 'Asset',
|
|
101
|
+
byteLength: 40,
|
|
102
|
+
fields: [
|
|
103
|
+
{
|
|
104
|
+
name: 'issuer',
|
|
105
|
+
type: 'id',
|
|
106
|
+
offset: 0,
|
|
107
|
+
byteLength: 32,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'assetName',
|
|
111
|
+
type: 'uint64',
|
|
112
|
+
offset: 32,
|
|
113
|
+
byteLength: 8,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
'QRWAGovProposal': {
|
|
118
|
+
name: 'QRWAGovProposal',
|
|
119
|
+
byteLength: 208,
|
|
120
|
+
fields: [
|
|
121
|
+
{
|
|
122
|
+
name: 'proposalId',
|
|
123
|
+
type: 'uint64',
|
|
124
|
+
offset: 0,
|
|
125
|
+
byteLength: 8,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'status',
|
|
129
|
+
type: 'uint64',
|
|
130
|
+
offset: 8,
|
|
131
|
+
byteLength: 8,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'score',
|
|
135
|
+
type: 'uint64',
|
|
136
|
+
offset: 16,
|
|
137
|
+
byteLength: 8,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'params',
|
|
141
|
+
type: 'struct',
|
|
142
|
+
offset: 24,
|
|
143
|
+
byteLength: 184,
|
|
144
|
+
structRef: 'QRWAGovParams',
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
'QRWAPayoutEntry': {
|
|
149
|
+
name: 'QRWAPayoutEntry',
|
|
150
|
+
byteLength: 64,
|
|
151
|
+
fields: [
|
|
152
|
+
{
|
|
153
|
+
name: 'recipient',
|
|
154
|
+
type: 'id',
|
|
155
|
+
offset: 0,
|
|
156
|
+
byteLength: 32,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'amount',
|
|
160
|
+
type: 'uint64',
|
|
161
|
+
offset: 32,
|
|
162
|
+
byteLength: 8,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'qmineHolding',
|
|
166
|
+
type: 'uint64',
|
|
167
|
+
offset: 40,
|
|
168
|
+
byteLength: 8,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'qrwaHolding',
|
|
172
|
+
type: 'uint64',
|
|
173
|
+
offset: 48,
|
|
174
|
+
byteLength: 8,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'tick',
|
|
178
|
+
type: 'uint32',
|
|
179
|
+
offset: 56,
|
|
180
|
+
byteLength: 4,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'epoch',
|
|
184
|
+
type: 'uint16',
|
|
185
|
+
offset: 60,
|
|
186
|
+
byteLength: 2,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'payoutType',
|
|
190
|
+
type: 'uint8',
|
|
191
|
+
offset: 62,
|
|
192
|
+
byteLength: 1,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: '_pad0',
|
|
196
|
+
type: 'uint8',
|
|
197
|
+
offset: 63,
|
|
198
|
+
byteLength: 1,
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export const Q_RWA_DONATE_TO_TREASURY_INPUT_TYPE = 3
|
|
205
|
+
|
|
206
|
+
export interface QRWADonateToTreasuryInput {
|
|
207
|
+
amount: bigint
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const Q_RWA_DONATE_TO_TREASURY_INPUT_FIELDS: BinaryField[] = [
|
|
211
|
+
{
|
|
212
|
+
name: 'amount',
|
|
213
|
+
type: 'uint64',
|
|
214
|
+
offset: 0,
|
|
215
|
+
byteLength: 8,
|
|
216
|
+
},
|
|
217
|
+
]
|
|
218
|
+
|
|
219
|
+
export function buildQRWADonateToTreasuryInput(
|
|
220
|
+
input: QRWADonateToTreasuryInput,
|
|
221
|
+
): ContractCall {
|
|
222
|
+
return { contractIndex: Q_RWA_CONTRACT_INDEX, inputType: Q_RWA_DONATE_TO_TREASURY_INPUT_TYPE, payload: buildPayload(Q_RWA_DONATE_TO_TREASURY_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface QRWADonateToTreasuryOutput {
|
|
226
|
+
status: bigint
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const Q_RWA_DONATE_TO_TREASURY_OUTPUT_FIELDS: BinaryField[] = [
|
|
230
|
+
{
|
|
231
|
+
name: 'status',
|
|
232
|
+
type: 'uint64',
|
|
233
|
+
offset: 0,
|
|
234
|
+
byteLength: 8,
|
|
235
|
+
},
|
|
236
|
+
]
|
|
237
|
+
|
|
238
|
+
export function decodeQRWADonateToTreasuryOutput(
|
|
239
|
+
data: Uint8Array,
|
|
240
|
+
): QRWADonateToTreasuryOutput {
|
|
241
|
+
return decodePayload(data, Q_RWA_DONATE_TO_TREASURY_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWADonateToTreasuryOutput
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const Q_RWA_VOTE_GOV_PARAMS_INPUT_TYPE = 4
|
|
245
|
+
|
|
246
|
+
export interface QRWAVoteGovParamsInput {
|
|
247
|
+
proposal: QRWAQRWAGovParamsStruct
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const Q_RWA_VOTE_GOV_PARAMS_INPUT_FIELDS: BinaryField[] = [
|
|
251
|
+
{
|
|
252
|
+
name: 'proposal',
|
|
253
|
+
type: 'struct',
|
|
254
|
+
offset: 0,
|
|
255
|
+
byteLength: 184,
|
|
256
|
+
structRef: 'QRWAGovParams',
|
|
257
|
+
},
|
|
258
|
+
]
|
|
259
|
+
|
|
260
|
+
export function buildQRWAVoteGovParamsInput(
|
|
261
|
+
input: QRWAVoteGovParamsInput,
|
|
262
|
+
): ContractCall {
|
|
263
|
+
return { contractIndex: Q_RWA_CONTRACT_INDEX, inputType: Q_RWA_VOTE_GOV_PARAMS_INPUT_TYPE, payload: buildPayload(Q_RWA_VOTE_GOV_PARAMS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface QRWAVoteGovParamsOutput {
|
|
267
|
+
status: bigint
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const Q_RWA_VOTE_GOV_PARAMS_OUTPUT_FIELDS: BinaryField[] = [
|
|
271
|
+
{
|
|
272
|
+
name: 'status',
|
|
273
|
+
type: 'uint64',
|
|
274
|
+
offset: 0,
|
|
275
|
+
byteLength: 8,
|
|
276
|
+
},
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
export function decodeQRWAVoteGovParamsOutput(
|
|
280
|
+
data: Uint8Array,
|
|
281
|
+
): QRWAVoteGovParamsOutput {
|
|
282
|
+
return decodePayload(data, Q_RWA_VOTE_GOV_PARAMS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAVoteGovParamsOutput
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export const Q_RWA_DEPOSIT_GENERAL_ASSET_INPUT_TYPE = 7
|
|
286
|
+
|
|
287
|
+
export interface QRWADepositGeneralAssetInput {
|
|
288
|
+
asset: QRWAAssetStruct
|
|
289
|
+
amount: bigint
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const Q_RWA_DEPOSIT_GENERAL_ASSET_INPUT_FIELDS: BinaryField[] = [
|
|
293
|
+
{
|
|
294
|
+
name: 'asset',
|
|
295
|
+
type: 'struct',
|
|
296
|
+
offset: 0,
|
|
297
|
+
byteLength: 40,
|
|
298
|
+
structRef: 'Asset',
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: 'amount',
|
|
302
|
+
type: 'uint64',
|
|
303
|
+
offset: 40,
|
|
304
|
+
byteLength: 8,
|
|
305
|
+
},
|
|
306
|
+
]
|
|
307
|
+
|
|
308
|
+
export function buildQRWADepositGeneralAssetInput(
|
|
309
|
+
input: QRWADepositGeneralAssetInput,
|
|
310
|
+
): ContractCall {
|
|
311
|
+
return { contractIndex: Q_RWA_CONTRACT_INDEX, inputType: Q_RWA_DEPOSIT_GENERAL_ASSET_INPUT_TYPE, payload: buildPayload(Q_RWA_DEPOSIT_GENERAL_ASSET_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface QRWADepositGeneralAssetOutput {
|
|
315
|
+
status: bigint
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const Q_RWA_DEPOSIT_GENERAL_ASSET_OUTPUT_FIELDS: BinaryField[] = [
|
|
319
|
+
{
|
|
320
|
+
name: 'status',
|
|
321
|
+
type: 'uint64',
|
|
322
|
+
offset: 0,
|
|
323
|
+
byteLength: 8,
|
|
324
|
+
},
|
|
325
|
+
]
|
|
326
|
+
|
|
327
|
+
export function decodeQRWADepositGeneralAssetOutput(
|
|
328
|
+
data: Uint8Array,
|
|
329
|
+
): QRWADepositGeneralAssetOutput {
|
|
330
|
+
return decodePayload(data, Q_RWA_DEPOSIT_GENERAL_ASSET_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWADepositGeneralAssetOutput
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export const Q_RWA_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_TYPE = 8
|
|
334
|
+
|
|
335
|
+
export interface QRWARevokeAssetManagementRightsInput {
|
|
336
|
+
asset: QRWAAssetStruct
|
|
337
|
+
numberOfShares: bigint
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const Q_RWA_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_FIELDS: BinaryField[] = [
|
|
341
|
+
{
|
|
342
|
+
name: 'asset',
|
|
343
|
+
type: 'struct',
|
|
344
|
+
offset: 0,
|
|
345
|
+
byteLength: 40,
|
|
346
|
+
structRef: 'Asset',
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'numberOfShares',
|
|
350
|
+
type: 'sint64',
|
|
351
|
+
offset: 40,
|
|
352
|
+
byteLength: 8,
|
|
353
|
+
},
|
|
354
|
+
]
|
|
355
|
+
|
|
356
|
+
export function buildQRWARevokeAssetManagementRightsInput(
|
|
357
|
+
input: QRWARevokeAssetManagementRightsInput,
|
|
358
|
+
): ContractCall {
|
|
359
|
+
return { contractIndex: Q_RWA_CONTRACT_INDEX, inputType: Q_RWA_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_TYPE, payload: buildPayload(Q_RWA_REVOKE_ASSET_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface QRWARevokeAssetManagementRightsOutput {
|
|
363
|
+
transferredNumberOfShares: bigint
|
|
364
|
+
status: bigint
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const Q_RWA_REVOKE_ASSET_MANAGEMENT_RIGHTS_OUTPUT_FIELDS: BinaryField[] = [
|
|
368
|
+
{
|
|
369
|
+
name: 'transferredNumberOfShares',
|
|
370
|
+
type: 'sint64',
|
|
371
|
+
offset: 0,
|
|
372
|
+
byteLength: 8,
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: 'status',
|
|
376
|
+
type: 'uint64',
|
|
377
|
+
offset: 8,
|
|
378
|
+
byteLength: 8,
|
|
379
|
+
},
|
|
380
|
+
]
|
|
381
|
+
|
|
382
|
+
export function decodeQRWARevokeAssetManagementRightsOutput(
|
|
383
|
+
data: Uint8Array,
|
|
384
|
+
): QRWARevokeAssetManagementRightsOutput {
|
|
385
|
+
return decodePayload(data, Q_RWA_REVOKE_ASSET_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWARevokeAssetManagementRightsOutput
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export const Q_RWA_SET_POOL_A_REVENUE_ADDRESS_INPUT_TYPE = 9
|
|
389
|
+
|
|
390
|
+
export interface QRWASetPoolARevenueAddressInput {
|
|
391
|
+
newAddress: string
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const Q_RWA_SET_POOL_A_REVENUE_ADDRESS_INPUT_FIELDS: BinaryField[] = [
|
|
395
|
+
{
|
|
396
|
+
name: 'newAddress',
|
|
397
|
+
type: 'id',
|
|
398
|
+
offset: 0,
|
|
399
|
+
byteLength: 32,
|
|
400
|
+
},
|
|
401
|
+
]
|
|
402
|
+
|
|
403
|
+
export function buildQRWASetPoolARevenueAddressInput(
|
|
404
|
+
input: QRWASetPoolARevenueAddressInput,
|
|
405
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
406
|
+
): ContractCall {
|
|
407
|
+
return { contractIndex: Q_RWA_CONTRACT_INDEX, inputType: Q_RWA_SET_POOL_A_REVENUE_ADDRESS_INPUT_TYPE, payload: buildPayload(Q_RWA_SET_POOL_A_REVENUE_ADDRESS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export interface QRWASetPoolARevenueAddressOutput {
|
|
411
|
+
status: bigint
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
const Q_RWA_SET_POOL_A_REVENUE_ADDRESS_OUTPUT_FIELDS: BinaryField[] = [
|
|
415
|
+
{
|
|
416
|
+
name: 'status',
|
|
417
|
+
type: 'uint64',
|
|
418
|
+
offset: 0,
|
|
419
|
+
byteLength: 8,
|
|
420
|
+
},
|
|
421
|
+
]
|
|
422
|
+
|
|
423
|
+
export function decodeQRWASetPoolARevenueAddressOutput(
|
|
424
|
+
data: Uint8Array,
|
|
425
|
+
): QRWASetPoolARevenueAddressOutput {
|
|
426
|
+
return decodePayload(data, Q_RWA_SET_POOL_A_REVENUE_ADDRESS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWASetPoolARevenueAddressOutput
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export const Q_RWA_SET_POOL_D_REVENUE_ADDRESS_INPUT_TYPE = 10
|
|
430
|
+
|
|
431
|
+
export interface QRWASetPoolDRevenueAddressInput {
|
|
432
|
+
newAddress: string
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const Q_RWA_SET_POOL_D_REVENUE_ADDRESS_INPUT_FIELDS: BinaryField[] = [
|
|
436
|
+
{
|
|
437
|
+
name: 'newAddress',
|
|
438
|
+
type: 'id',
|
|
439
|
+
offset: 0,
|
|
440
|
+
byteLength: 32,
|
|
441
|
+
},
|
|
442
|
+
]
|
|
443
|
+
|
|
444
|
+
export function buildQRWASetPoolDRevenueAddressInput(
|
|
445
|
+
input: QRWASetPoolDRevenueAddressInput,
|
|
446
|
+
identityToPublicKey: (identity: string) => Uint8Array,
|
|
447
|
+
): ContractCall {
|
|
448
|
+
return { contractIndex: Q_RWA_CONTRACT_INDEX, inputType: Q_RWA_SET_POOL_D_REVENUE_ADDRESS_INPUT_TYPE, payload: buildPayload(Q_RWA_SET_POOL_D_REVENUE_ADDRESS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export interface QRWASetPoolDRevenueAddressOutput {
|
|
452
|
+
status: bigint
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const Q_RWA_SET_POOL_D_REVENUE_ADDRESS_OUTPUT_FIELDS: BinaryField[] = [
|
|
456
|
+
{
|
|
457
|
+
name: 'status',
|
|
458
|
+
type: 'uint64',
|
|
459
|
+
offset: 0,
|
|
460
|
+
byteLength: 8,
|
|
461
|
+
},
|
|
462
|
+
]
|
|
463
|
+
|
|
464
|
+
export function decodeQRWASetPoolDRevenueAddressOutput(
|
|
465
|
+
data: Uint8Array,
|
|
466
|
+
): QRWASetPoolDRevenueAddressOutput {
|
|
467
|
+
return decodePayload(data, Q_RWA_SET_POOL_D_REVENUE_ADDRESS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWASetPoolDRevenueAddressOutput
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export const Q_RWA_GET_GOV_PARAMS_INPUT_TYPE = 1
|
|
471
|
+
export const Q_RWA_GET_GOV_PARAMS_INPUT_SIZE = 0
|
|
472
|
+
|
|
473
|
+
export interface QRWAGetGovParamsOutput {
|
|
474
|
+
params: QRWAQRWAGovParamsStruct
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const Q_RWA_GET_GOV_PARAMS_OUTPUT_FIELDS: BinaryField[] = [
|
|
478
|
+
{
|
|
479
|
+
name: 'params',
|
|
480
|
+
type: 'struct',
|
|
481
|
+
offset: 0,
|
|
482
|
+
byteLength: 184,
|
|
483
|
+
structRef: 'QRWAGovParams',
|
|
484
|
+
},
|
|
485
|
+
]
|
|
486
|
+
|
|
487
|
+
export function decodeQRWAGetGovParamsOutput(
|
|
488
|
+
data: Uint8Array,
|
|
489
|
+
): QRWAGetGovParamsOutput {
|
|
490
|
+
return decodePayload(data, Q_RWA_GET_GOV_PARAMS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetGovParamsOutput
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export async function qRWAGetGovParams(
|
|
494
|
+
live: SmartContractCaller,
|
|
495
|
+
options?: ContractCallOptions,
|
|
496
|
+
): Promise<Result<QRWAGetGovParamsOutput, QubicRpcError>> {
|
|
497
|
+
return callContractFunction({
|
|
498
|
+
live,
|
|
499
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
500
|
+
inputType: Q_RWA_GET_GOV_PARAMS_INPUT_TYPE,
|
|
501
|
+
inputSize: Q_RWA_GET_GOV_PARAMS_INPUT_SIZE,
|
|
502
|
+
inputFields: [],
|
|
503
|
+
outputFields: Q_RWA_GET_GOV_PARAMS_OUTPUT_FIELDS,
|
|
504
|
+
structs: STRUCTS,
|
|
505
|
+
input: {},
|
|
506
|
+
...options,
|
|
507
|
+
})
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export const Q_RWA_GET_GOV_POLL_INPUT_TYPE = 2
|
|
511
|
+
export const Q_RWA_GET_GOV_POLL_INPUT_SIZE = 8
|
|
512
|
+
|
|
513
|
+
export interface QRWAGetGovPollInput {
|
|
514
|
+
proposalId: bigint
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const Q_RWA_GET_GOV_POLL_INPUT_FIELDS: BinaryField[] = [
|
|
518
|
+
{
|
|
519
|
+
name: 'proposalId',
|
|
520
|
+
type: 'uint64',
|
|
521
|
+
offset: 0,
|
|
522
|
+
byteLength: 8,
|
|
523
|
+
},
|
|
524
|
+
]
|
|
525
|
+
|
|
526
|
+
export function buildQRWAGetGovPollInput(
|
|
527
|
+
input: QRWAGetGovPollInput,
|
|
528
|
+
): Uint8Array {
|
|
529
|
+
return buildPayload(Q_RWA_GET_GOV_POLL_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export interface QRWAGetGovPollOutput {
|
|
533
|
+
proposal: QRWAQRWAGovProposalStruct
|
|
534
|
+
status: bigint
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
const Q_RWA_GET_GOV_POLL_OUTPUT_FIELDS: BinaryField[] = [
|
|
538
|
+
{
|
|
539
|
+
name: 'proposal',
|
|
540
|
+
type: 'struct',
|
|
541
|
+
offset: 0,
|
|
542
|
+
byteLength: 208,
|
|
543
|
+
structRef: 'QRWAGovProposal',
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: 'status',
|
|
547
|
+
type: 'uint64',
|
|
548
|
+
offset: 208,
|
|
549
|
+
byteLength: 8,
|
|
550
|
+
},
|
|
551
|
+
]
|
|
552
|
+
|
|
553
|
+
export function decodeQRWAGetGovPollOutput(
|
|
554
|
+
data: Uint8Array,
|
|
555
|
+
): QRWAGetGovPollOutput {
|
|
556
|
+
return decodePayload(data, Q_RWA_GET_GOV_POLL_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetGovPollOutput
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export async function qRWAGetGovPoll(
|
|
560
|
+
live: SmartContractCaller,
|
|
561
|
+
input: QRWAGetGovPollInput,
|
|
562
|
+
options?: ContractCallOptions,
|
|
563
|
+
): Promise<Result<QRWAGetGovPollOutput, QubicRpcError>> {
|
|
564
|
+
return callContractFunction({
|
|
565
|
+
live,
|
|
566
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
567
|
+
inputType: Q_RWA_GET_GOV_POLL_INPUT_TYPE,
|
|
568
|
+
inputSize: Q_RWA_GET_GOV_POLL_INPUT_SIZE,
|
|
569
|
+
inputFields: Q_RWA_GET_GOV_POLL_INPUT_FIELDS,
|
|
570
|
+
outputFields: Q_RWA_GET_GOV_POLL_OUTPUT_FIELDS,
|
|
571
|
+
structs: STRUCTS,
|
|
572
|
+
input: (input as unknown as Record<string, unknown>),
|
|
573
|
+
...options,
|
|
574
|
+
})
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export const Q_RWA_GET_TREASURY_BALANCE_INPUT_TYPE = 4
|
|
578
|
+
export const Q_RWA_GET_TREASURY_BALANCE_INPUT_SIZE = 0
|
|
579
|
+
|
|
580
|
+
export interface QRWAGetTreasuryBalanceOutput {
|
|
581
|
+
balance: bigint
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const Q_RWA_GET_TREASURY_BALANCE_OUTPUT_FIELDS: BinaryField[] = [
|
|
585
|
+
{
|
|
586
|
+
name: 'balance',
|
|
587
|
+
type: 'uint64',
|
|
588
|
+
offset: 0,
|
|
589
|
+
byteLength: 8,
|
|
590
|
+
},
|
|
591
|
+
]
|
|
592
|
+
|
|
593
|
+
export function decodeQRWAGetTreasuryBalanceOutput(
|
|
594
|
+
data: Uint8Array,
|
|
595
|
+
): QRWAGetTreasuryBalanceOutput {
|
|
596
|
+
return decodePayload(data, Q_RWA_GET_TREASURY_BALANCE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetTreasuryBalanceOutput
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
export async function qRWAGetTreasuryBalance(
|
|
600
|
+
live: SmartContractCaller,
|
|
601
|
+
options?: ContractCallOptions,
|
|
602
|
+
): Promise<Result<QRWAGetTreasuryBalanceOutput, QubicRpcError>> {
|
|
603
|
+
return callContractFunction({
|
|
604
|
+
live,
|
|
605
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
606
|
+
inputType: Q_RWA_GET_TREASURY_BALANCE_INPUT_TYPE,
|
|
607
|
+
inputSize: Q_RWA_GET_TREASURY_BALANCE_INPUT_SIZE,
|
|
608
|
+
inputFields: [],
|
|
609
|
+
outputFields: Q_RWA_GET_TREASURY_BALANCE_OUTPUT_FIELDS,
|
|
610
|
+
structs: STRUCTS,
|
|
611
|
+
input: {},
|
|
612
|
+
...options,
|
|
613
|
+
})
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export const Q_RWA_GET_DIVIDEND_BALANCES_INPUT_TYPE = 5
|
|
617
|
+
export const Q_RWA_GET_DIVIDEND_BALANCES_INPUT_SIZE = 0
|
|
618
|
+
|
|
619
|
+
export interface QRWAGetDividendBalancesOutput {
|
|
620
|
+
revenuePoolA: bigint
|
|
621
|
+
revenuePoolB: bigint
|
|
622
|
+
dedicatedRevenuePool: bigint
|
|
623
|
+
poolAQmineDividend: bigint
|
|
624
|
+
poolAQrwaDividend: bigint
|
|
625
|
+
poolBQmineDividend: bigint
|
|
626
|
+
poolBQrwaDividend: bigint
|
|
627
|
+
poolCQmineDividend: bigint
|
|
628
|
+
poolCQrwaDividend: bigint
|
|
629
|
+
poolDRevenuePool: bigint
|
|
630
|
+
poolDQmineDividend: bigint
|
|
631
|
+
poolDQrwaDividend: bigint
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
const Q_RWA_GET_DIVIDEND_BALANCES_OUTPUT_FIELDS: BinaryField[] = [
|
|
635
|
+
{
|
|
636
|
+
name: 'revenuePoolA',
|
|
637
|
+
type: 'uint64',
|
|
638
|
+
offset: 0,
|
|
639
|
+
byteLength: 8,
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: 'revenuePoolB',
|
|
643
|
+
type: 'uint64',
|
|
644
|
+
offset: 8,
|
|
645
|
+
byteLength: 8,
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: 'dedicatedRevenuePool',
|
|
649
|
+
type: 'uint64',
|
|
650
|
+
offset: 16,
|
|
651
|
+
byteLength: 8,
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
name: 'poolAQmineDividend',
|
|
655
|
+
type: 'uint64',
|
|
656
|
+
offset: 24,
|
|
657
|
+
byteLength: 8,
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: 'poolAQrwaDividend',
|
|
661
|
+
type: 'uint64',
|
|
662
|
+
offset: 32,
|
|
663
|
+
byteLength: 8,
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
name: 'poolBQmineDividend',
|
|
667
|
+
type: 'uint64',
|
|
668
|
+
offset: 40,
|
|
669
|
+
byteLength: 8,
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
name: 'poolBQrwaDividend',
|
|
673
|
+
type: 'uint64',
|
|
674
|
+
offset: 48,
|
|
675
|
+
byteLength: 8,
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: 'poolCQmineDividend',
|
|
679
|
+
type: 'uint64',
|
|
680
|
+
offset: 56,
|
|
681
|
+
byteLength: 8,
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
name: 'poolCQrwaDividend',
|
|
685
|
+
type: 'uint64',
|
|
686
|
+
offset: 64,
|
|
687
|
+
byteLength: 8,
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
name: 'poolDRevenuePool',
|
|
691
|
+
type: 'uint64',
|
|
692
|
+
offset: 72,
|
|
693
|
+
byteLength: 8,
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: 'poolDQmineDividend',
|
|
697
|
+
type: 'uint64',
|
|
698
|
+
offset: 80,
|
|
699
|
+
byteLength: 8,
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: 'poolDQrwaDividend',
|
|
703
|
+
type: 'uint64',
|
|
704
|
+
offset: 88,
|
|
705
|
+
byteLength: 8,
|
|
706
|
+
},
|
|
707
|
+
]
|
|
708
|
+
|
|
709
|
+
export function decodeQRWAGetDividendBalancesOutput(
|
|
710
|
+
data: Uint8Array,
|
|
711
|
+
): QRWAGetDividendBalancesOutput {
|
|
712
|
+
return decodePayload(data, Q_RWA_GET_DIVIDEND_BALANCES_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetDividendBalancesOutput
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
export async function qRWAGetDividendBalances(
|
|
716
|
+
live: SmartContractCaller,
|
|
717
|
+
options?: ContractCallOptions,
|
|
718
|
+
): Promise<Result<QRWAGetDividendBalancesOutput, QubicRpcError>> {
|
|
719
|
+
return callContractFunction({
|
|
720
|
+
live,
|
|
721
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
722
|
+
inputType: Q_RWA_GET_DIVIDEND_BALANCES_INPUT_TYPE,
|
|
723
|
+
inputSize: Q_RWA_GET_DIVIDEND_BALANCES_INPUT_SIZE,
|
|
724
|
+
inputFields: [],
|
|
725
|
+
outputFields: Q_RWA_GET_DIVIDEND_BALANCES_OUTPUT_FIELDS,
|
|
726
|
+
structs: STRUCTS,
|
|
727
|
+
input: {},
|
|
728
|
+
...options,
|
|
729
|
+
})
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export const Q_RWA_GET_TOTAL_DISTRIBUTED_INPUT_TYPE = 6
|
|
733
|
+
export const Q_RWA_GET_TOTAL_DISTRIBUTED_INPUT_SIZE = 0
|
|
734
|
+
|
|
735
|
+
export interface QRWAGetTotalDistributedOutput {
|
|
736
|
+
totalPoolADistributed: bigint
|
|
737
|
+
totalPoolBDistributed: bigint
|
|
738
|
+
totalPoolCDistributed: bigint
|
|
739
|
+
totalPoolDDistributed: bigint
|
|
740
|
+
payoutTotalQmineBegin: bigint
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
const Q_RWA_GET_TOTAL_DISTRIBUTED_OUTPUT_FIELDS: BinaryField[] = [
|
|
744
|
+
{
|
|
745
|
+
name: 'totalPoolADistributed',
|
|
746
|
+
type: 'uint64',
|
|
747
|
+
offset: 0,
|
|
748
|
+
byteLength: 8,
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: 'totalPoolBDistributed',
|
|
752
|
+
type: 'uint64',
|
|
753
|
+
offset: 8,
|
|
754
|
+
byteLength: 8,
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: 'totalPoolCDistributed',
|
|
758
|
+
type: 'uint64',
|
|
759
|
+
offset: 16,
|
|
760
|
+
byteLength: 8,
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
name: 'totalPoolDDistributed',
|
|
764
|
+
type: 'uint64',
|
|
765
|
+
offset: 24,
|
|
766
|
+
byteLength: 8,
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
name: 'payoutTotalQmineBegin',
|
|
770
|
+
type: 'uint64',
|
|
771
|
+
offset: 32,
|
|
772
|
+
byteLength: 8,
|
|
773
|
+
},
|
|
774
|
+
]
|
|
775
|
+
|
|
776
|
+
export function decodeQRWAGetTotalDistributedOutput(
|
|
777
|
+
data: Uint8Array,
|
|
778
|
+
): QRWAGetTotalDistributedOutput {
|
|
779
|
+
return decodePayload(data, Q_RWA_GET_TOTAL_DISTRIBUTED_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetTotalDistributedOutput
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
export async function qRWAGetTotalDistributed(
|
|
783
|
+
live: SmartContractCaller,
|
|
784
|
+
options?: ContractCallOptions,
|
|
785
|
+
): Promise<Result<QRWAGetTotalDistributedOutput, QubicRpcError>> {
|
|
786
|
+
return callContractFunction({
|
|
787
|
+
live,
|
|
788
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
789
|
+
inputType: Q_RWA_GET_TOTAL_DISTRIBUTED_INPUT_TYPE,
|
|
790
|
+
inputSize: Q_RWA_GET_TOTAL_DISTRIBUTED_INPUT_SIZE,
|
|
791
|
+
inputFields: [],
|
|
792
|
+
outputFields: Q_RWA_GET_TOTAL_DISTRIBUTED_OUTPUT_FIELDS,
|
|
793
|
+
structs: STRUCTS,
|
|
794
|
+
input: {},
|
|
795
|
+
...options,
|
|
796
|
+
})
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export const Q_RWA_GET_ACTIVE_GOV_POLL_IDS_INPUT_TYPE = 8
|
|
800
|
+
export const Q_RWA_GET_ACTIVE_GOV_POLL_IDS_INPUT_SIZE = 0
|
|
801
|
+
|
|
802
|
+
export interface QRWAGetActiveGovPollIdsOutput {
|
|
803
|
+
count: bigint
|
|
804
|
+
ids: bigint[]
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const Q_RWA_GET_ACTIVE_GOV_POLL_IDS_OUTPUT_FIELDS: BinaryField[] = [
|
|
808
|
+
{
|
|
809
|
+
name: 'count',
|
|
810
|
+
type: 'uint64',
|
|
811
|
+
offset: 0,
|
|
812
|
+
byteLength: 8,
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
name: 'ids',
|
|
816
|
+
type: 'array',
|
|
817
|
+
offset: 8,
|
|
818
|
+
byteLength: 512,
|
|
819
|
+
arrayLength: 64,
|
|
820
|
+
arrayItemType: 'uint64',
|
|
821
|
+
arrayItemByteLength: 8,
|
|
822
|
+
},
|
|
823
|
+
]
|
|
824
|
+
|
|
825
|
+
export function decodeQRWAGetActiveGovPollIdsOutput(
|
|
826
|
+
data: Uint8Array,
|
|
827
|
+
): QRWAGetActiveGovPollIdsOutput {
|
|
828
|
+
return decodePayload(data, Q_RWA_GET_ACTIVE_GOV_POLL_IDS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetActiveGovPollIdsOutput
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export async function qRWAGetActiveGovPollIds(
|
|
832
|
+
live: SmartContractCaller,
|
|
833
|
+
options?: ContractCallOptions,
|
|
834
|
+
): Promise<Result<QRWAGetActiveGovPollIdsOutput, QubicRpcError>> {
|
|
835
|
+
return callContractFunction({
|
|
836
|
+
live,
|
|
837
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
838
|
+
inputType: Q_RWA_GET_ACTIVE_GOV_POLL_IDS_INPUT_TYPE,
|
|
839
|
+
inputSize: Q_RWA_GET_ACTIVE_GOV_POLL_IDS_INPUT_SIZE,
|
|
840
|
+
inputFields: [],
|
|
841
|
+
outputFields: Q_RWA_GET_ACTIVE_GOV_POLL_IDS_OUTPUT_FIELDS,
|
|
842
|
+
structs: STRUCTS,
|
|
843
|
+
input: {},
|
|
844
|
+
...options,
|
|
845
|
+
})
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export const Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_TYPE = 9
|
|
849
|
+
export const Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_SIZE = 40
|
|
850
|
+
|
|
851
|
+
export interface QRWAGetGeneralAssetBalanceInput {
|
|
852
|
+
asset: QRWAAssetStruct
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
const Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_FIELDS: BinaryField[] = [
|
|
856
|
+
{
|
|
857
|
+
name: 'asset',
|
|
858
|
+
type: 'struct',
|
|
859
|
+
offset: 0,
|
|
860
|
+
byteLength: 40,
|
|
861
|
+
structRef: 'Asset',
|
|
862
|
+
},
|
|
863
|
+
]
|
|
864
|
+
|
|
865
|
+
export function buildQRWAGetGeneralAssetBalanceInput(
|
|
866
|
+
input: QRWAGetGeneralAssetBalanceInput,
|
|
867
|
+
): Uint8Array {
|
|
868
|
+
return buildPayload(Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
export interface QRWAGetGeneralAssetBalanceOutput {
|
|
872
|
+
balance: bigint
|
|
873
|
+
status: bigint
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
const Q_RWA_GET_GENERAL_ASSET_BALANCE_OUTPUT_FIELDS: BinaryField[] = [
|
|
877
|
+
{
|
|
878
|
+
name: 'balance',
|
|
879
|
+
type: 'uint64',
|
|
880
|
+
offset: 0,
|
|
881
|
+
byteLength: 8,
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
name: 'status',
|
|
885
|
+
type: 'uint64',
|
|
886
|
+
offset: 8,
|
|
887
|
+
byteLength: 8,
|
|
888
|
+
},
|
|
889
|
+
]
|
|
890
|
+
|
|
891
|
+
export function decodeQRWAGetGeneralAssetBalanceOutput(
|
|
892
|
+
data: Uint8Array,
|
|
893
|
+
): QRWAGetGeneralAssetBalanceOutput {
|
|
894
|
+
return decodePayload(data, Q_RWA_GET_GENERAL_ASSET_BALANCE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetGeneralAssetBalanceOutput
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
export async function qRWAGetGeneralAssetBalance(
|
|
898
|
+
live: SmartContractCaller,
|
|
899
|
+
input: QRWAGetGeneralAssetBalanceInput,
|
|
900
|
+
options?: ContractCallOptions,
|
|
901
|
+
): Promise<Result<QRWAGetGeneralAssetBalanceOutput, QubicRpcError>> {
|
|
902
|
+
return callContractFunction({
|
|
903
|
+
live,
|
|
904
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
905
|
+
inputType: Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_TYPE,
|
|
906
|
+
inputSize: Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_SIZE,
|
|
907
|
+
inputFields: Q_RWA_GET_GENERAL_ASSET_BALANCE_INPUT_FIELDS,
|
|
908
|
+
outputFields: Q_RWA_GET_GENERAL_ASSET_BALANCE_OUTPUT_FIELDS,
|
|
909
|
+
structs: STRUCTS,
|
|
910
|
+
input: (input as unknown as Record<string, unknown>),
|
|
911
|
+
...options,
|
|
912
|
+
})
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export const Q_RWA_GET_GENERAL_ASSETS_INPUT_TYPE = 10
|
|
916
|
+
export const Q_RWA_GET_GENERAL_ASSETS_INPUT_SIZE = 0
|
|
917
|
+
|
|
918
|
+
export interface QRWAGetGeneralAssetsOutput {
|
|
919
|
+
count: bigint
|
|
920
|
+
assets: number[]
|
|
921
|
+
balances: bigint[]
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
const Q_RWA_GET_GENERAL_ASSETS_OUTPUT_FIELDS: BinaryField[] = [
|
|
925
|
+
{
|
|
926
|
+
name: 'count',
|
|
927
|
+
type: 'uint64',
|
|
928
|
+
offset: 0,
|
|
929
|
+
byteLength: 8,
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
name: 'assets',
|
|
933
|
+
type: 'array',
|
|
934
|
+
offset: 8,
|
|
935
|
+
byteLength: 40960,
|
|
936
|
+
arrayLength: 1024,
|
|
937
|
+
arrayItemByteLength: 40,
|
|
938
|
+
arrayItemStructRef: 'Asset',
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
name: 'balances',
|
|
942
|
+
type: 'array',
|
|
943
|
+
offset: 40968,
|
|
944
|
+
byteLength: 8192,
|
|
945
|
+
arrayLength: 1024,
|
|
946
|
+
arrayItemType: 'uint64',
|
|
947
|
+
arrayItemByteLength: 8,
|
|
948
|
+
},
|
|
949
|
+
]
|
|
950
|
+
|
|
951
|
+
export function decodeQRWAGetGeneralAssetsOutput(
|
|
952
|
+
data: Uint8Array,
|
|
953
|
+
): QRWAGetGeneralAssetsOutput {
|
|
954
|
+
return decodePayload(data, Q_RWA_GET_GENERAL_ASSETS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetGeneralAssetsOutput
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
export async function qRWAGetGeneralAssets(
|
|
958
|
+
live: SmartContractCaller,
|
|
959
|
+
options?: ContractCallOptions,
|
|
960
|
+
): Promise<Result<QRWAGetGeneralAssetsOutput, QubicRpcError>> {
|
|
961
|
+
return callContractFunction({
|
|
962
|
+
live,
|
|
963
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
964
|
+
inputType: Q_RWA_GET_GENERAL_ASSETS_INPUT_TYPE,
|
|
965
|
+
inputSize: Q_RWA_GET_GENERAL_ASSETS_INPUT_SIZE,
|
|
966
|
+
inputFields: [],
|
|
967
|
+
outputFields: Q_RWA_GET_GENERAL_ASSETS_OUTPUT_FIELDS,
|
|
968
|
+
structs: STRUCTS,
|
|
969
|
+
input: {},
|
|
970
|
+
...options,
|
|
971
|
+
})
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export const Q_RWA_GET_PAYOUTS_QMINE_INPUT_TYPE = 11
|
|
975
|
+
export const Q_RWA_GET_PAYOUTS_QMINE_INPUT_SIZE = 2
|
|
976
|
+
|
|
977
|
+
export interface QRWAGetPayoutsQmineInput {
|
|
978
|
+
page: number
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
const Q_RWA_GET_PAYOUTS_QMINE_INPUT_FIELDS: BinaryField[] = [
|
|
982
|
+
{
|
|
983
|
+
name: 'page',
|
|
984
|
+
type: 'uint16',
|
|
985
|
+
offset: 0,
|
|
986
|
+
byteLength: 2,
|
|
987
|
+
},
|
|
988
|
+
]
|
|
989
|
+
|
|
990
|
+
export function buildQRWAGetPayoutsQmineInput(
|
|
991
|
+
input: QRWAGetPayoutsQmineInput,
|
|
992
|
+
): Uint8Array {
|
|
993
|
+
return buildPayload(Q_RWA_GET_PAYOUTS_QMINE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export interface QRWAGetPayoutsQmineOutput {
|
|
997
|
+
payouts: number[]
|
|
998
|
+
nextIdx: number
|
|
999
|
+
returnedCount: number
|
|
1000
|
+
page: number
|
|
1001
|
+
totalPages: number
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
const Q_RWA_GET_PAYOUTS_QMINE_OUTPUT_FIELDS: BinaryField[] = [
|
|
1005
|
+
{
|
|
1006
|
+
name: 'payouts',
|
|
1007
|
+
type: 'array',
|
|
1008
|
+
offset: 0,
|
|
1009
|
+
byteLength: 32768,
|
|
1010
|
+
arrayLength: 512,
|
|
1011
|
+
arrayItemByteLength: 64,
|
|
1012
|
+
arrayItemStructRef: 'QRWAPayoutEntry',
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
name: 'nextIdx',
|
|
1016
|
+
type: 'uint16',
|
|
1017
|
+
offset: 32768,
|
|
1018
|
+
byteLength: 2,
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: 'returnedCount',
|
|
1022
|
+
type: 'uint16',
|
|
1023
|
+
offset: 32770,
|
|
1024
|
+
byteLength: 2,
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
name: 'page',
|
|
1028
|
+
type: 'uint16',
|
|
1029
|
+
offset: 32772,
|
|
1030
|
+
byteLength: 2,
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
name: 'totalPages',
|
|
1034
|
+
type: 'uint16',
|
|
1035
|
+
offset: 32774,
|
|
1036
|
+
byteLength: 2,
|
|
1037
|
+
},
|
|
1038
|
+
]
|
|
1039
|
+
|
|
1040
|
+
export function decodeQRWAGetPayoutsQmineOutput(
|
|
1041
|
+
data: Uint8Array,
|
|
1042
|
+
): QRWAGetPayoutsQmineOutput {
|
|
1043
|
+
return decodePayload(data, Q_RWA_GET_PAYOUTS_QMINE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetPayoutsQmineOutput
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
export async function qRWAGetPayoutsQmine(
|
|
1047
|
+
live: SmartContractCaller,
|
|
1048
|
+
input: QRWAGetPayoutsQmineInput,
|
|
1049
|
+
options?: ContractCallOptions,
|
|
1050
|
+
): Promise<Result<QRWAGetPayoutsQmineOutput, QubicRpcError>> {
|
|
1051
|
+
return callContractFunction({
|
|
1052
|
+
live,
|
|
1053
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1054
|
+
inputType: Q_RWA_GET_PAYOUTS_QMINE_INPUT_TYPE,
|
|
1055
|
+
inputSize: Q_RWA_GET_PAYOUTS_QMINE_INPUT_SIZE,
|
|
1056
|
+
inputFields: Q_RWA_GET_PAYOUTS_QMINE_INPUT_FIELDS,
|
|
1057
|
+
outputFields: Q_RWA_GET_PAYOUTS_QMINE_OUTPUT_FIELDS,
|
|
1058
|
+
structs: STRUCTS,
|
|
1059
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1060
|
+
...options,
|
|
1061
|
+
})
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
export const Q_RWA_GET_CONTRACT_ADDRESSES_INPUT_TYPE = 12
|
|
1065
|
+
export const Q_RWA_GET_CONTRACT_ADDRESSES_INPUT_SIZE = 0
|
|
1066
|
+
|
|
1067
|
+
export interface QRWAGetContractAddressesOutput {
|
|
1068
|
+
dedicatedRevenueAddress: string
|
|
1069
|
+
poolARevenueAddress: string
|
|
1070
|
+
poolDRevenueAddress: string
|
|
1071
|
+
fundraisingAddress: string
|
|
1072
|
+
exchangeAddress: string
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
const Q_RWA_GET_CONTRACT_ADDRESSES_OUTPUT_FIELDS: BinaryField[] = [
|
|
1076
|
+
{
|
|
1077
|
+
name: 'dedicatedRevenueAddress',
|
|
1078
|
+
type: 'id',
|
|
1079
|
+
offset: 0,
|
|
1080
|
+
byteLength: 32,
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
name: 'poolARevenueAddress',
|
|
1084
|
+
type: 'id',
|
|
1085
|
+
offset: 32,
|
|
1086
|
+
byteLength: 32,
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
name: 'poolDRevenueAddress',
|
|
1090
|
+
type: 'id',
|
|
1091
|
+
offset: 64,
|
|
1092
|
+
byteLength: 32,
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
name: 'fundraisingAddress',
|
|
1096
|
+
type: 'id',
|
|
1097
|
+
offset: 96,
|
|
1098
|
+
byteLength: 32,
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
name: 'exchangeAddress',
|
|
1102
|
+
type: 'id',
|
|
1103
|
+
offset: 128,
|
|
1104
|
+
byteLength: 32,
|
|
1105
|
+
},
|
|
1106
|
+
]
|
|
1107
|
+
|
|
1108
|
+
export function decodeQRWAGetContractAddressesOutput(
|
|
1109
|
+
data: Uint8Array,
|
|
1110
|
+
publicKeyToIdentity: (pk: Uint8Array) => string,
|
|
1111
|
+
): QRWAGetContractAddressesOutput {
|
|
1112
|
+
return decodePayload(data, Q_RWA_GET_CONTRACT_ADDRESSES_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QRWAGetContractAddressesOutput
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export async function qRWAGetContractAddresses(
|
|
1116
|
+
live: SmartContractCaller,
|
|
1117
|
+
options?: ContractCallOptions,
|
|
1118
|
+
): Promise<Result<QRWAGetContractAddressesOutput, QubicRpcError>> {
|
|
1119
|
+
return callContractFunction({
|
|
1120
|
+
live,
|
|
1121
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1122
|
+
inputType: Q_RWA_GET_CONTRACT_ADDRESSES_INPUT_TYPE,
|
|
1123
|
+
inputSize: Q_RWA_GET_CONTRACT_ADDRESSES_INPUT_SIZE,
|
|
1124
|
+
inputFields: [],
|
|
1125
|
+
outputFields: Q_RWA_GET_CONTRACT_ADDRESSES_OUTPUT_FIELDS,
|
|
1126
|
+
structs: STRUCTS,
|
|
1127
|
+
input: {},
|
|
1128
|
+
...options,
|
|
1129
|
+
})
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
export const Q_RWA_GET_PAYOUTS_QRWA_INPUT_TYPE = 13
|
|
1133
|
+
export const Q_RWA_GET_PAYOUTS_QRWA_INPUT_SIZE = 2
|
|
1134
|
+
|
|
1135
|
+
export interface QRWAGetPayoutsQrwaInput {
|
|
1136
|
+
page: number
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
const Q_RWA_GET_PAYOUTS_QRWA_INPUT_FIELDS: BinaryField[] = [
|
|
1140
|
+
{
|
|
1141
|
+
name: 'page',
|
|
1142
|
+
type: 'uint16',
|
|
1143
|
+
offset: 0,
|
|
1144
|
+
byteLength: 2,
|
|
1145
|
+
},
|
|
1146
|
+
]
|
|
1147
|
+
|
|
1148
|
+
export function buildQRWAGetPayoutsQrwaInput(
|
|
1149
|
+
input: QRWAGetPayoutsQrwaInput,
|
|
1150
|
+
): Uint8Array {
|
|
1151
|
+
return buildPayload(Q_RWA_GET_PAYOUTS_QRWA_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
export interface QRWAGetPayoutsQrwaOutput {
|
|
1155
|
+
payouts: number[]
|
|
1156
|
+
nextIdx: number
|
|
1157
|
+
returnedCount: number
|
|
1158
|
+
page: number
|
|
1159
|
+
totalPages: number
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
const Q_RWA_GET_PAYOUTS_QRWA_OUTPUT_FIELDS: BinaryField[] = [
|
|
1163
|
+
{
|
|
1164
|
+
name: 'payouts',
|
|
1165
|
+
type: 'array',
|
|
1166
|
+
offset: 0,
|
|
1167
|
+
byteLength: 32768,
|
|
1168
|
+
arrayLength: 512,
|
|
1169
|
+
arrayItemByteLength: 64,
|
|
1170
|
+
arrayItemStructRef: 'QRWAPayoutEntry',
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
name: 'nextIdx',
|
|
1174
|
+
type: 'uint16',
|
|
1175
|
+
offset: 32768,
|
|
1176
|
+
byteLength: 2,
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
name: 'returnedCount',
|
|
1180
|
+
type: 'uint16',
|
|
1181
|
+
offset: 32770,
|
|
1182
|
+
byteLength: 2,
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: 'page',
|
|
1186
|
+
type: 'uint16',
|
|
1187
|
+
offset: 32772,
|
|
1188
|
+
byteLength: 2,
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
name: 'totalPages',
|
|
1192
|
+
type: 'uint16',
|
|
1193
|
+
offset: 32774,
|
|
1194
|
+
byteLength: 2,
|
|
1195
|
+
},
|
|
1196
|
+
]
|
|
1197
|
+
|
|
1198
|
+
export function decodeQRWAGetPayoutsQrwaOutput(
|
|
1199
|
+
data: Uint8Array,
|
|
1200
|
+
): QRWAGetPayoutsQrwaOutput {
|
|
1201
|
+
return decodePayload(data, Q_RWA_GET_PAYOUTS_QRWA_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetPayoutsQrwaOutput
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
export async function qRWAGetPayoutsQrwa(
|
|
1205
|
+
live: SmartContractCaller,
|
|
1206
|
+
input: QRWAGetPayoutsQrwaInput,
|
|
1207
|
+
options?: ContractCallOptions,
|
|
1208
|
+
): Promise<Result<QRWAGetPayoutsQrwaOutput, QubicRpcError>> {
|
|
1209
|
+
return callContractFunction({
|
|
1210
|
+
live,
|
|
1211
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1212
|
+
inputType: Q_RWA_GET_PAYOUTS_QRWA_INPUT_TYPE,
|
|
1213
|
+
inputSize: Q_RWA_GET_PAYOUTS_QRWA_INPUT_SIZE,
|
|
1214
|
+
inputFields: Q_RWA_GET_PAYOUTS_QRWA_INPUT_FIELDS,
|
|
1215
|
+
outputFields: Q_RWA_GET_PAYOUTS_QRWA_OUTPUT_FIELDS,
|
|
1216
|
+
structs: STRUCTS,
|
|
1217
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1218
|
+
...options,
|
|
1219
|
+
})
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
export const Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_TYPE = 14
|
|
1223
|
+
export const Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_SIZE = 2
|
|
1224
|
+
|
|
1225
|
+
export interface QRWAGetPayoutsDedicatedInput {
|
|
1226
|
+
page: number
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
const Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_FIELDS: BinaryField[] = [
|
|
1230
|
+
{
|
|
1231
|
+
name: 'page',
|
|
1232
|
+
type: 'uint16',
|
|
1233
|
+
offset: 0,
|
|
1234
|
+
byteLength: 2,
|
|
1235
|
+
},
|
|
1236
|
+
]
|
|
1237
|
+
|
|
1238
|
+
export function buildQRWAGetPayoutsDedicatedInput(
|
|
1239
|
+
input: QRWAGetPayoutsDedicatedInput,
|
|
1240
|
+
): Uint8Array {
|
|
1241
|
+
return buildPayload(Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
export interface QRWAGetPayoutsDedicatedOutput {
|
|
1245
|
+
payouts: number[]
|
|
1246
|
+
nextIdx: number
|
|
1247
|
+
returnedCount: number
|
|
1248
|
+
page: number
|
|
1249
|
+
totalPages: number
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
const Q_RWA_GET_PAYOUTS_DEDICATED_OUTPUT_FIELDS: BinaryField[] = [
|
|
1253
|
+
{
|
|
1254
|
+
name: 'payouts',
|
|
1255
|
+
type: 'array',
|
|
1256
|
+
offset: 0,
|
|
1257
|
+
byteLength: 32768,
|
|
1258
|
+
arrayLength: 512,
|
|
1259
|
+
arrayItemByteLength: 64,
|
|
1260
|
+
arrayItemStructRef: 'QRWAPayoutEntry',
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
name: 'nextIdx',
|
|
1264
|
+
type: 'uint16',
|
|
1265
|
+
offset: 32768,
|
|
1266
|
+
byteLength: 2,
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
name: 'returnedCount',
|
|
1270
|
+
type: 'uint16',
|
|
1271
|
+
offset: 32770,
|
|
1272
|
+
byteLength: 2,
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
name: 'page',
|
|
1276
|
+
type: 'uint16',
|
|
1277
|
+
offset: 32772,
|
|
1278
|
+
byteLength: 2,
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
name: 'totalPages',
|
|
1282
|
+
type: 'uint16',
|
|
1283
|
+
offset: 32774,
|
|
1284
|
+
byteLength: 2,
|
|
1285
|
+
},
|
|
1286
|
+
]
|
|
1287
|
+
|
|
1288
|
+
export function decodeQRWAGetPayoutsDedicatedOutput(
|
|
1289
|
+
data: Uint8Array,
|
|
1290
|
+
): QRWAGetPayoutsDedicatedOutput {
|
|
1291
|
+
return decodePayload(data, Q_RWA_GET_PAYOUTS_DEDICATED_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetPayoutsDedicatedOutput
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
export async function qRWAGetPayoutsDedicated(
|
|
1295
|
+
live: SmartContractCaller,
|
|
1296
|
+
input: QRWAGetPayoutsDedicatedInput,
|
|
1297
|
+
options?: ContractCallOptions,
|
|
1298
|
+
): Promise<Result<QRWAGetPayoutsDedicatedOutput, QubicRpcError>> {
|
|
1299
|
+
return callContractFunction({
|
|
1300
|
+
live,
|
|
1301
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1302
|
+
inputType: Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_TYPE,
|
|
1303
|
+
inputSize: Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_SIZE,
|
|
1304
|
+
inputFields: Q_RWA_GET_PAYOUTS_DEDICATED_INPUT_FIELDS,
|
|
1305
|
+
outputFields: Q_RWA_GET_PAYOUTS_DEDICATED_OUTPUT_FIELDS,
|
|
1306
|
+
structs: STRUCTS,
|
|
1307
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1308
|
+
...options,
|
|
1309
|
+
})
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
export const Q_RWA_GET_SC_DIVIDEND_TRACKING_INPUT_TYPE = 15
|
|
1313
|
+
export const Q_RWA_GET_SC_DIVIDEND_TRACKING_INPUT_SIZE = 0
|
|
1314
|
+
|
|
1315
|
+
export interface QRWAGetScDividendTrackingOutput {
|
|
1316
|
+
count: bigint
|
|
1317
|
+
scContractIds: string[]
|
|
1318
|
+
cumulativeDividends: bigint[]
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
const Q_RWA_GET_SC_DIVIDEND_TRACKING_OUTPUT_FIELDS: BinaryField[] = [
|
|
1322
|
+
{
|
|
1323
|
+
name: 'count',
|
|
1324
|
+
type: 'uint64',
|
|
1325
|
+
offset: 0,
|
|
1326
|
+
byteLength: 8,
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
name: 'scContractIds',
|
|
1330
|
+
type: 'array',
|
|
1331
|
+
offset: 8,
|
|
1332
|
+
byteLength: 32768,
|
|
1333
|
+
arrayLength: 1024,
|
|
1334
|
+
arrayItemType: 'id',
|
|
1335
|
+
arrayItemByteLength: 32,
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
name: 'cumulativeDividends',
|
|
1339
|
+
type: 'array',
|
|
1340
|
+
offset: 32776,
|
|
1341
|
+
byteLength: 8192,
|
|
1342
|
+
arrayLength: 1024,
|
|
1343
|
+
arrayItemType: 'uint64',
|
|
1344
|
+
arrayItemByteLength: 8,
|
|
1345
|
+
},
|
|
1346
|
+
]
|
|
1347
|
+
|
|
1348
|
+
export function decodeQRWAGetScDividendTrackingOutput(
|
|
1349
|
+
data: Uint8Array,
|
|
1350
|
+
publicKeyToIdentity: (pk: Uint8Array) => string,
|
|
1351
|
+
): QRWAGetScDividendTrackingOutput {
|
|
1352
|
+
return decodePayload(data, Q_RWA_GET_SC_DIVIDEND_TRACKING_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QRWAGetScDividendTrackingOutput
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
export async function qRWAGetScDividendTracking(
|
|
1356
|
+
live: SmartContractCaller,
|
|
1357
|
+
options?: ContractCallOptions,
|
|
1358
|
+
): Promise<Result<QRWAGetScDividendTrackingOutput, QubicRpcError>> {
|
|
1359
|
+
return callContractFunction({
|
|
1360
|
+
live,
|
|
1361
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1362
|
+
inputType: Q_RWA_GET_SC_DIVIDEND_TRACKING_INPUT_TYPE,
|
|
1363
|
+
inputSize: Q_RWA_GET_SC_DIVIDEND_TRACKING_INPUT_SIZE,
|
|
1364
|
+
inputFields: [],
|
|
1365
|
+
outputFields: Q_RWA_GET_SC_DIVIDEND_TRACKING_OUTPUT_FIELDS,
|
|
1366
|
+
structs: STRUCTS,
|
|
1367
|
+
input: {},
|
|
1368
|
+
...options,
|
|
1369
|
+
})
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
export const Q_RWA_GET_PAYOUTS_POOL_D_INPUT_TYPE = 16
|
|
1373
|
+
export const Q_RWA_GET_PAYOUTS_POOL_D_INPUT_SIZE = 2
|
|
1374
|
+
|
|
1375
|
+
export interface QRWAGetPayoutsPoolDInput {
|
|
1376
|
+
page: number
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
const Q_RWA_GET_PAYOUTS_POOL_D_INPUT_FIELDS: BinaryField[] = [
|
|
1380
|
+
{
|
|
1381
|
+
name: 'page',
|
|
1382
|
+
type: 'uint16',
|
|
1383
|
+
offset: 0,
|
|
1384
|
+
byteLength: 2,
|
|
1385
|
+
},
|
|
1386
|
+
]
|
|
1387
|
+
|
|
1388
|
+
export function buildQRWAGetPayoutsPoolDInput(
|
|
1389
|
+
input: QRWAGetPayoutsPoolDInput,
|
|
1390
|
+
): Uint8Array {
|
|
1391
|
+
return buildPayload(Q_RWA_GET_PAYOUTS_POOL_D_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
export interface QRWAGetPayoutsPoolDOutput {
|
|
1395
|
+
payouts: number[]
|
|
1396
|
+
nextIdx: number
|
|
1397
|
+
returnedCount: number
|
|
1398
|
+
page: number
|
|
1399
|
+
totalPages: number
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
const Q_RWA_GET_PAYOUTS_POOL_D_OUTPUT_FIELDS: BinaryField[] = [
|
|
1403
|
+
{
|
|
1404
|
+
name: 'payouts',
|
|
1405
|
+
type: 'array',
|
|
1406
|
+
offset: 0,
|
|
1407
|
+
byteLength: 32768,
|
|
1408
|
+
arrayLength: 512,
|
|
1409
|
+
arrayItemByteLength: 64,
|
|
1410
|
+
arrayItemStructRef: 'QRWAPayoutEntry',
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
name: 'nextIdx',
|
|
1414
|
+
type: 'uint16',
|
|
1415
|
+
offset: 32768,
|
|
1416
|
+
byteLength: 2,
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
name: 'returnedCount',
|
|
1420
|
+
type: 'uint16',
|
|
1421
|
+
offset: 32770,
|
|
1422
|
+
byteLength: 2,
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: 'page',
|
|
1426
|
+
type: 'uint16',
|
|
1427
|
+
offset: 32772,
|
|
1428
|
+
byteLength: 2,
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
name: 'totalPages',
|
|
1432
|
+
type: 'uint16',
|
|
1433
|
+
offset: 32774,
|
|
1434
|
+
byteLength: 2,
|
|
1435
|
+
},
|
|
1436
|
+
]
|
|
1437
|
+
|
|
1438
|
+
export function decodeQRWAGetPayoutsPoolDOutput(
|
|
1439
|
+
data: Uint8Array,
|
|
1440
|
+
): QRWAGetPayoutsPoolDOutput {
|
|
1441
|
+
return decodePayload(data, Q_RWA_GET_PAYOUTS_POOL_D_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QRWAGetPayoutsPoolDOutput
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
export async function qRWAGetPayoutsPoolD(
|
|
1445
|
+
live: SmartContractCaller,
|
|
1446
|
+
input: QRWAGetPayoutsPoolDInput,
|
|
1447
|
+
options?: ContractCallOptions,
|
|
1448
|
+
): Promise<Result<QRWAGetPayoutsPoolDOutput, QubicRpcError>> {
|
|
1449
|
+
return callContractFunction({
|
|
1450
|
+
live,
|
|
1451
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1452
|
+
inputType: Q_RWA_GET_PAYOUTS_POOL_D_INPUT_TYPE,
|
|
1453
|
+
inputSize: Q_RWA_GET_PAYOUTS_POOL_D_INPUT_SIZE,
|
|
1454
|
+
inputFields: Q_RWA_GET_PAYOUTS_POOL_D_INPUT_FIELDS,
|
|
1455
|
+
outputFields: Q_RWA_GET_PAYOUTS_POOL_D_OUTPUT_FIELDS,
|
|
1456
|
+
structs: STRUCTS,
|
|
1457
|
+
input: (input as unknown as Record<string, unknown>),
|
|
1458
|
+
...options,
|
|
1459
|
+
})
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
export const qRWA = {
|
|
1463
|
+
contractIndex: Q_RWA_CONTRACT_INDEX,
|
|
1464
|
+
GetGovParams: qRWAGetGovParams,
|
|
1465
|
+
GetGovPoll: qRWAGetGovPoll,
|
|
1466
|
+
GetTreasuryBalance: qRWAGetTreasuryBalance,
|
|
1467
|
+
GetDividendBalances: qRWAGetDividendBalances,
|
|
1468
|
+
GetTotalDistributed: qRWAGetTotalDistributed,
|
|
1469
|
+
GetActiveGovPollIds: qRWAGetActiveGovPollIds,
|
|
1470
|
+
GetGeneralAssetBalance: qRWAGetGeneralAssetBalance,
|
|
1471
|
+
GetGeneralAssets: qRWAGetGeneralAssets,
|
|
1472
|
+
GetPayoutsQmine: qRWAGetPayoutsQmine,
|
|
1473
|
+
GetContractAddresses: qRWAGetContractAddresses,
|
|
1474
|
+
GetPayoutsQrwa: qRWAGetPayoutsQrwa,
|
|
1475
|
+
GetPayoutsDedicated: qRWAGetPayoutsDedicated,
|
|
1476
|
+
GetScDividendTracking: qRWAGetScDividendTracking,
|
|
1477
|
+
GetPayoutsPoolD: qRWAGetPayoutsPoolD,
|
|
1478
|
+
buildDonateToTreasuryInput: buildQRWADonateToTreasuryInput,
|
|
1479
|
+
decodeDonateToTreasuryOutput: decodeQRWADonateToTreasuryOutput,
|
|
1480
|
+
buildVoteGovParamsInput: buildQRWAVoteGovParamsInput,
|
|
1481
|
+
decodeVoteGovParamsOutput: decodeQRWAVoteGovParamsOutput,
|
|
1482
|
+
buildDepositGeneralAssetInput: buildQRWADepositGeneralAssetInput,
|
|
1483
|
+
decodeDepositGeneralAssetOutput: decodeQRWADepositGeneralAssetOutput,
|
|
1484
|
+
buildRevokeAssetManagementRightsInput: buildQRWARevokeAssetManagementRightsInput,
|
|
1485
|
+
decodeRevokeAssetManagementRightsOutput: decodeQRWARevokeAssetManagementRightsOutput,
|
|
1486
|
+
buildSetPoolARevenueAddressInput: buildQRWASetPoolARevenueAddressInput,
|
|
1487
|
+
decodeSetPoolARevenueAddressOutput: decodeQRWASetPoolARevenueAddressOutput,
|
|
1488
|
+
buildSetPoolDRevenueAddressInput: buildQRWASetPoolDRevenueAddressInput,
|
|
1489
|
+
decodeSetPoolDRevenueAddressOutput: decodeQRWASetPoolDRevenueAddressOutput,
|
|
1490
|
+
}
|
|
1491
|
+
|