@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,281 @@
|
|
|
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_RESERVE_POOL_CONTRACT_INDEX = 21
|
|
9
|
+
|
|
10
|
+
const STRUCTS: Record<string, NamedStruct> = {}
|
|
11
|
+
|
|
12
|
+
export const Q_RESERVE_POOL_WITHDRAW_RESERVE_INPUT_TYPE = 1
|
|
13
|
+
|
|
14
|
+
export interface QReservePoolWithdrawReserveInput {
|
|
15
|
+
revenue: bigint
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Q_RESERVE_POOL_WITHDRAW_RESERVE_INPUT_FIELDS: BinaryField[] = [
|
|
19
|
+
{
|
|
20
|
+
name: 'revenue',
|
|
21
|
+
type: 'uint64',
|
|
22
|
+
offset: 0,
|
|
23
|
+
byteLength: 8,
|
|
24
|
+
},
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
export function buildQReservePoolWithdrawReserveInput(
|
|
28
|
+
input: QReservePoolWithdrawReserveInput,
|
|
29
|
+
): ContractCall {
|
|
30
|
+
return { contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX, inputType: Q_RESERVE_POOL_WITHDRAW_RESERVE_INPUT_TYPE, payload: buildPayload(Q_RESERVE_POOL_WITHDRAW_RESERVE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface QReservePoolWithdrawReserveOutput {
|
|
34
|
+
allocatedRevenue: bigint
|
|
35
|
+
returnCode: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Q_RESERVE_POOL_WITHDRAW_RESERVE_OUTPUT_FIELDS: BinaryField[] = [
|
|
39
|
+
{
|
|
40
|
+
name: 'allocatedRevenue',
|
|
41
|
+
type: 'uint64',
|
|
42
|
+
offset: 0,
|
|
43
|
+
byteLength: 8,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'returnCode',
|
|
47
|
+
type: 'uint8',
|
|
48
|
+
offset: 8,
|
|
49
|
+
byteLength: 1,
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
export function decodeQReservePoolWithdrawReserveOutput(
|
|
54
|
+
data: Uint8Array,
|
|
55
|
+
): QReservePoolWithdrawReserveOutput {
|
|
56
|
+
return decodePayload(data, Q_RESERVE_POOL_WITHDRAW_RESERVE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QReservePoolWithdrawReserveOutput
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Q_RESERVE_POOL_ADD_ALLOWED_SC_INPUT_TYPE = 2
|
|
60
|
+
|
|
61
|
+
export interface QReservePoolAddAllowedSCInput {
|
|
62
|
+
scIndex: bigint
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const Q_RESERVE_POOL_ADD_ALLOWED_SC_INPUT_FIELDS: BinaryField[] = [
|
|
66
|
+
{
|
|
67
|
+
name: 'scIndex',
|
|
68
|
+
type: 'uint64',
|
|
69
|
+
offset: 0,
|
|
70
|
+
byteLength: 8,
|
|
71
|
+
},
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
export function buildQReservePoolAddAllowedSCInput(
|
|
75
|
+
input: QReservePoolAddAllowedSCInput,
|
|
76
|
+
): ContractCall {
|
|
77
|
+
return { contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX, inputType: Q_RESERVE_POOL_ADD_ALLOWED_SC_INPUT_TYPE, payload: buildPayload(Q_RESERVE_POOL_ADD_ALLOWED_SC_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface QReservePoolAddAllowedSCOutput {
|
|
81
|
+
returnCode: number
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const Q_RESERVE_POOL_ADD_ALLOWED_SC_OUTPUT_FIELDS: BinaryField[] = [
|
|
85
|
+
{
|
|
86
|
+
name: 'returnCode',
|
|
87
|
+
type: 'uint8',
|
|
88
|
+
offset: 0,
|
|
89
|
+
byteLength: 1,
|
|
90
|
+
},
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
export function decodeQReservePoolAddAllowedSCOutput(
|
|
94
|
+
data: Uint8Array,
|
|
95
|
+
): QReservePoolAddAllowedSCOutput {
|
|
96
|
+
return decodePayload(data, Q_RESERVE_POOL_ADD_ALLOWED_SC_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QReservePoolAddAllowedSCOutput
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const Q_RESERVE_POOL_REMOVE_ALLOWED_SC_INPUT_TYPE = 3
|
|
100
|
+
|
|
101
|
+
export interface QReservePoolRemoveAllowedSCInput {
|
|
102
|
+
scIndex: bigint
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const Q_RESERVE_POOL_REMOVE_ALLOWED_SC_INPUT_FIELDS: BinaryField[] = [
|
|
106
|
+
{
|
|
107
|
+
name: 'scIndex',
|
|
108
|
+
type: 'uint64',
|
|
109
|
+
offset: 0,
|
|
110
|
+
byteLength: 8,
|
|
111
|
+
},
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
export function buildQReservePoolRemoveAllowedSCInput(
|
|
115
|
+
input: QReservePoolRemoveAllowedSCInput,
|
|
116
|
+
): ContractCall {
|
|
117
|
+
return { contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX, inputType: Q_RESERVE_POOL_REMOVE_ALLOWED_SC_INPUT_TYPE, payload: buildPayload(Q_RESERVE_POOL_REMOVE_ALLOWED_SC_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface QReservePoolRemoveAllowedSCOutput {
|
|
121
|
+
returnCode: number
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const Q_RESERVE_POOL_REMOVE_ALLOWED_SC_OUTPUT_FIELDS: BinaryField[] = [
|
|
125
|
+
{
|
|
126
|
+
name: 'returnCode',
|
|
127
|
+
type: 'uint8',
|
|
128
|
+
offset: 0,
|
|
129
|
+
byteLength: 1,
|
|
130
|
+
},
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
export function decodeQReservePoolRemoveAllowedSCOutput(
|
|
134
|
+
data: Uint8Array,
|
|
135
|
+
): QReservePoolRemoveAllowedSCOutput {
|
|
136
|
+
return decodePayload(data, Q_RESERVE_POOL_REMOVE_ALLOWED_SC_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QReservePoolRemoveAllowedSCOutput
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const Q_RESERVE_POOL_SEND_RESERVE_INPUT_TYPE = 4
|
|
140
|
+
|
|
141
|
+
export interface QReservePoolSendReserveInput {
|
|
142
|
+
scIndex: bigint
|
|
143
|
+
amount: bigint
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const Q_RESERVE_POOL_SEND_RESERVE_INPUT_FIELDS: BinaryField[] = [
|
|
147
|
+
{
|
|
148
|
+
name: 'scIndex',
|
|
149
|
+
type: 'uint64',
|
|
150
|
+
offset: 0,
|
|
151
|
+
byteLength: 8,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'amount',
|
|
155
|
+
type: 'uint64',
|
|
156
|
+
offset: 8,
|
|
157
|
+
byteLength: 8,
|
|
158
|
+
},
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
export function buildQReservePoolSendReserveInput(
|
|
162
|
+
input: QReservePoolSendReserveInput,
|
|
163
|
+
): ContractCall {
|
|
164
|
+
return { contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX, inputType: Q_RESERVE_POOL_SEND_RESERVE_INPUT_TYPE, payload: buildPayload(Q_RESERVE_POOL_SEND_RESERVE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface QReservePoolSendReserveOutput {
|
|
168
|
+
returnCode: number
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const Q_RESERVE_POOL_SEND_RESERVE_OUTPUT_FIELDS: BinaryField[] = [
|
|
172
|
+
{
|
|
173
|
+
name: 'returnCode',
|
|
174
|
+
type: 'uint8',
|
|
175
|
+
offset: 0,
|
|
176
|
+
byteLength: 1,
|
|
177
|
+
},
|
|
178
|
+
]
|
|
179
|
+
|
|
180
|
+
export function decodeQReservePoolSendReserveOutput(
|
|
181
|
+
data: Uint8Array,
|
|
182
|
+
): QReservePoolSendReserveOutput {
|
|
183
|
+
return decodePayload(data, Q_RESERVE_POOL_SEND_RESERVE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QReservePoolSendReserveOutput
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export const Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_INPUT_TYPE = 1
|
|
187
|
+
export const Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_INPUT_SIZE = 0
|
|
188
|
+
|
|
189
|
+
export interface QReservePoolGetAvailableReserveOutput {
|
|
190
|
+
availableReserve: bigint
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_OUTPUT_FIELDS: BinaryField[] = [
|
|
194
|
+
{
|
|
195
|
+
name: 'availableReserve',
|
|
196
|
+
type: 'uint64',
|
|
197
|
+
offset: 0,
|
|
198
|
+
byteLength: 8,
|
|
199
|
+
},
|
|
200
|
+
]
|
|
201
|
+
|
|
202
|
+
export function decodeQReservePoolGetAvailableReserveOutput(
|
|
203
|
+
data: Uint8Array,
|
|
204
|
+
): QReservePoolGetAvailableReserveOutput {
|
|
205
|
+
return decodePayload(data, Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QReservePoolGetAvailableReserveOutput
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export async function qReservePoolGetAvailableReserve(
|
|
209
|
+
live: SmartContractCaller,
|
|
210
|
+
options?: ContractCallOptions,
|
|
211
|
+
): Promise<Result<QReservePoolGetAvailableReserveOutput, QubicRpcError>> {
|
|
212
|
+
return callContractFunction({
|
|
213
|
+
live,
|
|
214
|
+
contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX,
|
|
215
|
+
inputType: Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_INPUT_TYPE,
|
|
216
|
+
inputSize: Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_INPUT_SIZE,
|
|
217
|
+
inputFields: [],
|
|
218
|
+
outputFields: Q_RESERVE_POOL_GET_AVAILABLE_RESERVE_OUTPUT_FIELDS,
|
|
219
|
+
structs: STRUCTS,
|
|
220
|
+
input: {},
|
|
221
|
+
...options,
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const Q_RESERVE_POOL_GET_ALLOWED_SC_INPUT_TYPE = 2
|
|
226
|
+
export const Q_RESERVE_POOL_GET_ALLOWED_SC_INPUT_SIZE = 0
|
|
227
|
+
|
|
228
|
+
export interface QReservePoolGetAllowedSCOutput {
|
|
229
|
+
allowedSC: string[]
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const Q_RESERVE_POOL_GET_ALLOWED_SC_OUTPUT_FIELDS: BinaryField[] = [
|
|
233
|
+
{
|
|
234
|
+
name: 'allowedSC',
|
|
235
|
+
type: 'array',
|
|
236
|
+
offset: 0,
|
|
237
|
+
byteLength: 4096,
|
|
238
|
+
arrayLength: 128,
|
|
239
|
+
arrayItemType: 'id',
|
|
240
|
+
arrayItemByteLength: 32,
|
|
241
|
+
},
|
|
242
|
+
]
|
|
243
|
+
|
|
244
|
+
export function decodeQReservePoolGetAllowedSCOutput(
|
|
245
|
+
data: Uint8Array,
|
|
246
|
+
publicKeyToIdentity: (pk: Uint8Array) => string,
|
|
247
|
+
): QReservePoolGetAllowedSCOutput {
|
|
248
|
+
return decodePayload(data, Q_RESERVE_POOL_GET_ALLOWED_SC_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QReservePoolGetAllowedSCOutput
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export async function qReservePoolGetAllowedSC(
|
|
252
|
+
live: SmartContractCaller,
|
|
253
|
+
options?: ContractCallOptions,
|
|
254
|
+
): Promise<Result<QReservePoolGetAllowedSCOutput, QubicRpcError>> {
|
|
255
|
+
return callContractFunction({
|
|
256
|
+
live,
|
|
257
|
+
contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX,
|
|
258
|
+
inputType: Q_RESERVE_POOL_GET_ALLOWED_SC_INPUT_TYPE,
|
|
259
|
+
inputSize: Q_RESERVE_POOL_GET_ALLOWED_SC_INPUT_SIZE,
|
|
260
|
+
inputFields: [],
|
|
261
|
+
outputFields: Q_RESERVE_POOL_GET_ALLOWED_SC_OUTPUT_FIELDS,
|
|
262
|
+
structs: STRUCTS,
|
|
263
|
+
input: {},
|
|
264
|
+
...options,
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export const qReservePool = {
|
|
269
|
+
contractIndex: Q_RESERVE_POOL_CONTRACT_INDEX,
|
|
270
|
+
GetAvailableReserve: qReservePoolGetAvailableReserve,
|
|
271
|
+
GetAllowedSC: qReservePoolGetAllowedSC,
|
|
272
|
+
buildWithdrawReserveInput: buildQReservePoolWithdrawReserveInput,
|
|
273
|
+
decodeWithdrawReserveOutput: decodeQReservePoolWithdrawReserveOutput,
|
|
274
|
+
buildAddAllowedSCInput: buildQReservePoolAddAllowedSCInput,
|
|
275
|
+
decodeAddAllowedSCOutput: decodeQReservePoolAddAllowedSCOutput,
|
|
276
|
+
buildRemoveAllowedSCInput: buildQReservePoolRemoveAllowedSCInput,
|
|
277
|
+
decodeRemoveAllowedSCOutput: decodeQReservePoolRemoveAllowedSCOutput,
|
|
278
|
+
buildSendReserveInput: buildQReservePoolSendReserveInput,
|
|
279
|
+
decodeSendReserveOutput: decodeQReservePoolSendReserveOutput,
|
|
280
|
+
}
|
|
281
|
+
|