@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.
Files changed (163) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +15 -18
  3. package/dist/__generated__/computorcontrolledfund.d.ts +1 -1
  4. package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -1
  5. package/dist/__generated__/computorcontrolledfund.js +8 -8
  6. package/dist/__generated__/computorcontrolledfund.js.map +1 -1
  7. package/dist/__generated__/escrow.d.ts +1 -1
  8. package/dist/__generated__/escrow.d.ts.map +1 -1
  9. package/dist/__generated__/escrow.js +3 -3
  10. package/dist/__generated__/escrow.js.map +1 -1
  11. package/dist/__generated__/generalquorumproposal.d.ts +1 -1
  12. package/dist/__generated__/generalquorumproposal.d.ts.map +1 -1
  13. package/dist/__generated__/generalquorumproposal.js +6 -6
  14. package/dist/__generated__/generalquorumproposal.js.map +1 -1
  15. package/dist/__generated__/ggwp.d.ts +265 -0
  16. package/dist/__generated__/ggwp.d.ts.map +1 -0
  17. package/dist/__generated__/ggwp.js +825 -0
  18. package/dist/__generated__/ggwp.js.map +1 -0
  19. package/dist/__generated__/index.d.ts +1 -0
  20. package/dist/__generated__/index.d.ts.map +1 -1
  21. package/dist/__generated__/index.js +1 -0
  22. package/dist/__generated__/index.js.map +1 -1
  23. package/dist/__generated__/msvault.d.ts +1 -1
  24. package/dist/__generated__/msvault.d.ts.map +1 -1
  25. package/dist/__generated__/msvault.js +19 -19
  26. package/dist/__generated__/msvault.js.map +1 -1
  27. package/dist/__generated__/multisignvault.d.ts +25 -25
  28. package/dist/__generated__/multisignvault.d.ts.map +1 -1
  29. package/dist/__generated__/multisignvault.js +25 -25
  30. package/dist/__generated__/multisignvault.js.map +1 -1
  31. package/dist/__generated__/nostromo.d.ts +1 -1
  32. package/dist/__generated__/nostromo.d.ts.map +1 -1
  33. package/dist/__generated__/nostromo.js +15 -15
  34. package/dist/__generated__/nostromo.js.map +1 -1
  35. package/dist/__generated__/pulse.d.ts +1 -1
  36. package/dist/__generated__/pulse.d.ts.map +1 -1
  37. package/dist/__generated__/pulse.js +26 -26
  38. package/dist/__generated__/pulse.js.map +1 -1
  39. package/dist/__generated__/qbay.d.ts +1 -1
  40. package/dist/__generated__/qbay.d.ts.map +1 -1
  41. package/dist/__generated__/qbay.js +23 -23
  42. package/dist/__generated__/qbay.js.map +1 -1
  43. package/dist/__generated__/qbond.d.ts +1 -1
  44. package/dist/__generated__/qbond.d.ts.map +1 -1
  45. package/dist/__generated__/qbond.js +14 -14
  46. package/dist/__generated__/qbond.js.map +1 -1
  47. package/dist/__generated__/qdraw.d.ts +1 -1
  48. package/dist/__generated__/qdraw.d.ts.map +1 -1
  49. package/dist/__generated__/qdraw.js.map +1 -1
  50. package/dist/__generated__/qduel.d.ts +1 -1
  51. package/dist/__generated__/qduel.d.ts.map +1 -1
  52. package/dist/__generated__/qduel.js +11 -11
  53. package/dist/__generated__/qduel.js.map +1 -1
  54. package/dist/__generated__/qearn.d.ts +1 -1
  55. package/dist/__generated__/qearn.d.ts.map +1 -1
  56. package/dist/__generated__/qearn.js +10 -10
  57. package/dist/__generated__/qearn.js.map +1 -1
  58. package/dist/__generated__/qip.d.ts +18 -1
  59. package/dist/__generated__/qip.d.ts.map +1 -1
  60. package/dist/__generated__/qip.js +64 -3
  61. package/dist/__generated__/qip.js.map +1 -1
  62. package/dist/__generated__/qraffle.d.ts +1 -1
  63. package/dist/__generated__/qraffle.d.ts.map +1 -1
  64. package/dist/__generated__/qraffle.js +12 -12
  65. package/dist/__generated__/qraffle.js.map +1 -1
  66. package/dist/__generated__/qreservepool.d.ts +1 -1
  67. package/dist/__generated__/qreservepool.d.ts.map +1 -1
  68. package/dist/__generated__/qreservepool.js +5 -5
  69. package/dist/__generated__/qreservepool.js.map +1 -1
  70. package/dist/__generated__/qrwa.d.ts +1 -1
  71. package/dist/__generated__/qrwa.d.ts.map +1 -1
  72. package/dist/__generated__/qrwa.js +18 -18
  73. package/dist/__generated__/qrwa.js.map +1 -1
  74. package/dist/__generated__/qswap.d.ts +3 -1
  75. package/dist/__generated__/qswap.d.ts.map +1 -1
  76. package/dist/__generated__/qswap.js +30 -18
  77. package/dist/__generated__/qswap.js.map +1 -1
  78. package/dist/__generated__/qthirtyfour.d.ts +1 -1
  79. package/dist/__generated__/qthirtyfour.d.ts.map +1 -1
  80. package/dist/__generated__/qthirtyfour.js +19 -19
  81. package/dist/__generated__/qthirtyfour.js.map +1 -1
  82. package/dist/__generated__/qubicicoportal.d.ts +4 -4
  83. package/dist/__generated__/qubicicoportal.d.ts.map +1 -1
  84. package/dist/__generated__/qubicicoportal.js +4 -4
  85. package/dist/__generated__/qubicicoportal.js.map +1 -1
  86. package/dist/__generated__/quottery.d.ts +1 -1
  87. package/dist/__generated__/quottery.d.ts.map +1 -1
  88. package/dist/__generated__/quottery.js +14 -14
  89. package/dist/__generated__/quottery.js.map +1 -1
  90. package/dist/__generated__/qusino.d.ts +1 -1
  91. package/dist/__generated__/qusino.d.ts.map +1 -1
  92. package/dist/__generated__/qusino.js +13 -13
  93. package/dist/__generated__/qusino.js.map +1 -1
  94. package/dist/__generated__/qutil.d.ts +1 -1
  95. package/dist/__generated__/qutil.d.ts.map +1 -1
  96. package/dist/__generated__/qutil.js +22 -22
  97. package/dist/__generated__/qutil.js.map +1 -1
  98. package/dist/__generated__/qvault.d.ts +14 -2
  99. package/dist/__generated__/qvault.d.ts.map +1 -1
  100. package/dist/__generated__/qvault.js +70 -32
  101. package/dist/__generated__/qvault.js.map +1 -1
  102. package/dist/__generated__/qx.d.ts +1 -1
  103. package/dist/__generated__/qx.d.ts.map +1 -1
  104. package/dist/__generated__/qx.js +12 -12
  105. package/dist/__generated__/qx.js.map +1 -1
  106. package/dist/__generated__/random.d.ts +24 -1
  107. package/dist/__generated__/random.d.ts.map +1 -1
  108. package/dist/__generated__/random.js +68 -0
  109. package/dist/__generated__/random.js.map +1 -1
  110. package/dist/__generated__/randomlottery.d.ts +1 -1
  111. package/dist/__generated__/randomlottery.d.ts.map +1 -1
  112. package/dist/__generated__/randomlottery.js +12 -12
  113. package/dist/__generated__/randomlottery.js.map +1 -1
  114. package/dist/__generated__/vottunbridge.d.ts +1 -1
  115. package/dist/__generated__/vottunbridge.d.ts.map +1 -1
  116. package/dist/__generated__/vottunbridge.js +13 -13
  117. package/dist/__generated__/vottunbridge.js.map +1 -1
  118. package/dist/call-contract.d.ts.map +1 -1
  119. package/dist/call-contract.js +6 -1
  120. package/dist/call-contract.js.map +1 -1
  121. package/dist/index.d.ts +2 -2
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +1 -1
  124. package/dist/index.js.map +1 -1
  125. package/package.json +8 -7
  126. package/src/__generated__/computorcontrolledfund.ts +1066 -0
  127. package/src/__generated__/escrow.ts +529 -0
  128. package/src/__generated__/generalquorumproposal.ts +691 -0
  129. package/src/__generated__/ggwp.ts +1241 -0
  130. package/src/__generated__/index.ts +28 -0
  131. package/src/__generated__/msvault.ts +1716 -0
  132. package/src/__generated__/multisignvault.ts +1511 -0
  133. package/src/__generated__/mylastmatch.ts +12 -0
  134. package/src/__generated__/nostromo.ts +1551 -0
  135. package/src/__generated__/pulse.ts +1512 -0
  136. package/src/__generated__/qbay.ts +2097 -0
  137. package/src/__generated__/qbond.ts +1016 -0
  138. package/src/__generated__/qdraw.ts +188 -0
  139. package/src/__generated__/qduel.ts +827 -0
  140. package/src/__generated__/qearn.ts +696 -0
  141. package/src/__generated__/qip.ts +501 -0
  142. package/src/__generated__/qraffle.ts +1162 -0
  143. package/src/__generated__/qreservepool.ts +281 -0
  144. package/src/__generated__/qrwa.ts +1491 -0
  145. package/src/__generated__/qswap.ts +1336 -0
  146. package/src/__generated__/qthirtyfour.ts +1131 -0
  147. package/src/__generated__/qubicicoportal.ts +386 -0
  148. package/src/__generated__/quottery.ts +1519 -0
  149. package/src/__generated__/qusino.ts +799 -0
  150. package/src/__generated__/qutil.ts +1506 -0
  151. package/src/__generated__/qvault.ts +2911 -0
  152. package/src/__generated__/qx.ts +861 -0
  153. package/src/__generated__/random.ts +145 -0
  154. package/src/__generated__/randomlottery.ts +653 -0
  155. package/src/__generated__/supplywatcher.ts +12 -0
  156. package/src/__generated__/vottunbridge.ts +1162 -0
  157. package/src/__tests__/contracts.test.ts +933 -0
  158. package/src/call-contract.ts +87 -0
  159. package/src/index.ts +9 -0
  160. package/dist/result.d.ts +0 -12
  161. package/dist/result.d.ts.map +0 -1
  162. package/dist/result.js +0 -7
  163. package/dist/result.js.map +0 -1
@@ -0,0 +1,2097 @@
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 QBAY_CONTRACT_INDEX = 12
9
+
10
+ export interface QbayAssetStruct {
11
+ issuer: string
12
+ assetName: bigint
13
+ }
14
+
15
+ const STRUCTS: Record<string, NamedStruct> = {
16
+ 'Asset': {
17
+ name: 'Asset',
18
+ byteLength: 40,
19
+ fields: [
20
+ {
21
+ name: 'issuer',
22
+ type: 'id',
23
+ offset: 0,
24
+ byteLength: 32,
25
+ },
26
+ {
27
+ name: 'assetName',
28
+ type: 'uint64',
29
+ offset: 32,
30
+ byteLength: 8,
31
+ },
32
+ ],
33
+ },
34
+ }
35
+
36
+ export const QBAY_SETTING_CFB_AND_QUBIC_PRICE_INPUT_TYPE = 1
37
+
38
+ export interface QbaySettingCFBAndQubicPriceInput {
39
+ CFBPrice: bigint
40
+ QubicPrice: bigint
41
+ }
42
+
43
+ const QBAY_SETTING_CFB_AND_QUBIC_PRICE_INPUT_FIELDS: BinaryField[] = [
44
+ {
45
+ name: 'CFBPrice',
46
+ type: 'uint64',
47
+ offset: 0,
48
+ byteLength: 8,
49
+ },
50
+ {
51
+ name: 'QubicPrice',
52
+ type: 'uint64',
53
+ offset: 8,
54
+ byteLength: 8,
55
+ },
56
+ ]
57
+
58
+ export function buildQbaySettingCFBAndQubicPriceInput(
59
+ input: QbaySettingCFBAndQubicPriceInput,
60
+ ): ContractCall {
61
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_SETTING_CFB_AND_QUBIC_PRICE_INPUT_TYPE, payload: buildPayload(QBAY_SETTING_CFB_AND_QUBIC_PRICE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
62
+ }
63
+
64
+ export interface QbaySettingCFBAndQubicPriceOutput {
65
+ returnCode: number
66
+ }
67
+
68
+ const QBAY_SETTING_CFB_AND_QUBIC_PRICE_OUTPUT_FIELDS: BinaryField[] = [
69
+ {
70
+ name: 'returnCode',
71
+ type: 'uint32',
72
+ offset: 0,
73
+ byteLength: 4,
74
+ },
75
+ ]
76
+
77
+ export function decodeQbaySettingCFBAndQubicPriceOutput(
78
+ data: Uint8Array,
79
+ ): QbaySettingCFBAndQubicPriceOutput {
80
+ return decodePayload(data, QBAY_SETTING_CFB_AND_QUBIC_PRICE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbaySettingCFBAndQubicPriceOutput
81
+ }
82
+
83
+ export const QBAY_CREATE_COLLECTION_INPUT_TYPE = 2
84
+
85
+ export interface QbayCreateCollectionInput {
86
+ priceForDropMint: bigint
87
+ volume: number
88
+ royalty: number
89
+ maxSizePerOneId: number
90
+ URI: number[]
91
+ typeOfCollection: number
92
+ }
93
+
94
+ const QBAY_CREATE_COLLECTION_INPUT_FIELDS: BinaryField[] = [
95
+ {
96
+ name: 'priceForDropMint',
97
+ type: 'uint64',
98
+ offset: 0,
99
+ byteLength: 8,
100
+ },
101
+ {
102
+ name: 'volume',
103
+ type: 'uint32',
104
+ offset: 8,
105
+ byteLength: 4,
106
+ },
107
+ {
108
+ name: 'royalty',
109
+ type: 'uint32',
110
+ offset: 12,
111
+ byteLength: 4,
112
+ },
113
+ {
114
+ name: 'maxSizePerOneId',
115
+ type: 'uint32',
116
+ offset: 16,
117
+ byteLength: 4,
118
+ },
119
+ {
120
+ name: 'URI',
121
+ type: 'array',
122
+ offset: 20,
123
+ byteLength: 64,
124
+ arrayLength: 64,
125
+ arrayItemType: 'uint8',
126
+ arrayItemByteLength: 1,
127
+ },
128
+ {
129
+ name: 'typeOfCollection',
130
+ type: 'uint8',
131
+ offset: 84,
132
+ byteLength: 1,
133
+ },
134
+ ]
135
+
136
+ export function buildQbayCreateCollectionInput(
137
+ input: QbayCreateCollectionInput,
138
+ ): ContractCall {
139
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_CREATE_COLLECTION_INPUT_TYPE, payload: buildPayload(QBAY_CREATE_COLLECTION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
140
+ }
141
+
142
+ export interface QbayCreateCollectionOutput {
143
+ returnCode: number
144
+ }
145
+
146
+ const QBAY_CREATE_COLLECTION_OUTPUT_FIELDS: BinaryField[] = [
147
+ {
148
+ name: 'returnCode',
149
+ type: 'uint32',
150
+ offset: 0,
151
+ byteLength: 4,
152
+ },
153
+ ]
154
+
155
+ export function decodeQbayCreateCollectionOutput(
156
+ data: Uint8Array,
157
+ ): QbayCreateCollectionOutput {
158
+ return decodePayload(data, QBAY_CREATE_COLLECTION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayCreateCollectionOutput
159
+ }
160
+
161
+ export const QBAY_MINT_INPUT_TYPE = 3
162
+
163
+ export interface QbayMintInput {
164
+ royalty: number
165
+ collectionId: number
166
+ URI: number[]
167
+ typeOfMint: number
168
+ }
169
+
170
+ const QBAY_MINT_INPUT_FIELDS: BinaryField[] = [
171
+ {
172
+ name: 'royalty',
173
+ type: 'uint32',
174
+ offset: 0,
175
+ byteLength: 4,
176
+ },
177
+ {
178
+ name: 'collectionId',
179
+ type: 'uint32',
180
+ offset: 4,
181
+ byteLength: 4,
182
+ },
183
+ {
184
+ name: 'URI',
185
+ type: 'array',
186
+ offset: 8,
187
+ byteLength: 64,
188
+ arrayLength: 64,
189
+ arrayItemType: 'uint8',
190
+ arrayItemByteLength: 1,
191
+ },
192
+ {
193
+ name: 'typeOfMint',
194
+ type: 'uint8',
195
+ offset: 72,
196
+ byteLength: 1,
197
+ },
198
+ ]
199
+
200
+ export function buildQbayMintInput(
201
+ input: QbayMintInput,
202
+ ): ContractCall {
203
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_MINT_INPUT_TYPE, payload: buildPayload(QBAY_MINT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
204
+ }
205
+
206
+ export interface QbayMintOutput {
207
+ returnCode: number
208
+ }
209
+
210
+ const QBAY_MINT_OUTPUT_FIELDS: BinaryField[] = [
211
+ {
212
+ name: 'returnCode',
213
+ type: 'uint32',
214
+ offset: 0,
215
+ byteLength: 4,
216
+ },
217
+ ]
218
+
219
+ export function decodeQbayMintOutput(
220
+ data: Uint8Array,
221
+ ): QbayMintOutput {
222
+ return decodePayload(data, QBAY_MINT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayMintOutput
223
+ }
224
+
225
+ export const QBAY_MINT_OF_DROP_INPUT_TYPE = 4
226
+
227
+ export interface QbayMintOfDropInput {
228
+ collectionId: number
229
+ URI: number[]
230
+ }
231
+
232
+ const QBAY_MINT_OF_DROP_INPUT_FIELDS: BinaryField[] = [
233
+ {
234
+ name: 'collectionId',
235
+ type: 'uint32',
236
+ offset: 0,
237
+ byteLength: 4,
238
+ },
239
+ {
240
+ name: 'URI',
241
+ type: 'array',
242
+ offset: 4,
243
+ byteLength: 64,
244
+ arrayLength: 64,
245
+ arrayItemType: 'uint8',
246
+ arrayItemByteLength: 1,
247
+ },
248
+ ]
249
+
250
+ export function buildQbayMintOfDropInput(
251
+ input: QbayMintOfDropInput,
252
+ ): ContractCall {
253
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_MINT_OF_DROP_INPUT_TYPE, payload: buildPayload(QBAY_MINT_OF_DROP_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
254
+ }
255
+
256
+ export interface QbayMintOfDropOutput {
257
+ returnCode: number
258
+ }
259
+
260
+ const QBAY_MINT_OF_DROP_OUTPUT_FIELDS: BinaryField[] = [
261
+ {
262
+ name: 'returnCode',
263
+ type: 'uint32',
264
+ offset: 0,
265
+ byteLength: 4,
266
+ },
267
+ ]
268
+
269
+ export function decodeQbayMintOfDropOutput(
270
+ data: Uint8Array,
271
+ ): QbayMintOfDropOutput {
272
+ return decodePayload(data, QBAY_MINT_OF_DROP_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayMintOfDropOutput
273
+ }
274
+
275
+ export const QBAY_TRANSFER_INPUT_TYPE = 5
276
+
277
+ export interface QbayTransferInput {
278
+ receiver: string
279
+ NFTid: number
280
+ }
281
+
282
+ const QBAY_TRANSFER_INPUT_FIELDS: BinaryField[] = [
283
+ {
284
+ name: 'receiver',
285
+ type: 'id',
286
+ offset: 0,
287
+ byteLength: 32,
288
+ },
289
+ {
290
+ name: 'NFTid',
291
+ type: 'uint32',
292
+ offset: 32,
293
+ byteLength: 4,
294
+ },
295
+ ]
296
+
297
+ export function buildQbayTransferInput(
298
+ input: QbayTransferInput,
299
+ identityToPublicKey: (identity: string) => Uint8Array,
300
+ ): ContractCall {
301
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_TRANSFER_INPUT_TYPE, payload: buildPayload(QBAY_TRANSFER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey) }
302
+ }
303
+
304
+ export interface QbayTransferOutput {
305
+ returnCode: number
306
+ }
307
+
308
+ const QBAY_TRANSFER_OUTPUT_FIELDS: BinaryField[] = [
309
+ {
310
+ name: 'returnCode',
311
+ type: 'uint32',
312
+ offset: 0,
313
+ byteLength: 4,
314
+ },
315
+ ]
316
+
317
+ export function decodeQbayTransferOutput(
318
+ data: Uint8Array,
319
+ ): QbayTransferOutput {
320
+ return decodePayload(data, QBAY_TRANSFER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayTransferOutput
321
+ }
322
+
323
+ export const QBAY_LIST_IN_MARKET_INPUT_TYPE = 6
324
+
325
+ export interface QbayListInMarketInput {
326
+ price: bigint
327
+ NFTid: number
328
+ }
329
+
330
+ const QBAY_LIST_IN_MARKET_INPUT_FIELDS: BinaryField[] = [
331
+ {
332
+ name: 'price',
333
+ type: 'uint64',
334
+ offset: 0,
335
+ byteLength: 8,
336
+ },
337
+ {
338
+ name: 'NFTid',
339
+ type: 'uint32',
340
+ offset: 8,
341
+ byteLength: 4,
342
+ },
343
+ ]
344
+
345
+ export function buildQbayListInMarketInput(
346
+ input: QbayListInMarketInput,
347
+ ): ContractCall {
348
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_LIST_IN_MARKET_INPUT_TYPE, payload: buildPayload(QBAY_LIST_IN_MARKET_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
349
+ }
350
+
351
+ export interface QbayListInMarketOutput {
352
+ returnCode: number
353
+ }
354
+
355
+ const QBAY_LIST_IN_MARKET_OUTPUT_FIELDS: BinaryField[] = [
356
+ {
357
+ name: 'returnCode',
358
+ type: 'uint32',
359
+ offset: 0,
360
+ byteLength: 4,
361
+ },
362
+ ]
363
+
364
+ export function decodeQbayListInMarketOutput(
365
+ data: Uint8Array,
366
+ ): QbayListInMarketOutput {
367
+ return decodePayload(data, QBAY_LIST_IN_MARKET_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayListInMarketOutput
368
+ }
369
+
370
+ export const QBAY_BUY_INPUT_TYPE = 7
371
+
372
+ export interface QbayBuyInput {
373
+ NFTid: number
374
+ methodOfPayment: number
375
+ }
376
+
377
+ const QBAY_BUY_INPUT_FIELDS: BinaryField[] = [
378
+ {
379
+ name: 'NFTid',
380
+ type: 'uint32',
381
+ offset: 0,
382
+ byteLength: 4,
383
+ },
384
+ {
385
+ name: 'methodOfPayment',
386
+ type: 'uint8',
387
+ offset: 4,
388
+ byteLength: 1,
389
+ },
390
+ ]
391
+
392
+ export function buildQbayBuyInput(
393
+ input: QbayBuyInput,
394
+ ): ContractCall {
395
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_BUY_INPUT_TYPE, payload: buildPayload(QBAY_BUY_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
396
+ }
397
+
398
+ export interface QbayBuyOutput {
399
+ returnCode: number
400
+ }
401
+
402
+ const QBAY_BUY_OUTPUT_FIELDS: BinaryField[] = [
403
+ {
404
+ name: 'returnCode',
405
+ type: 'uint32',
406
+ offset: 0,
407
+ byteLength: 4,
408
+ },
409
+ ]
410
+
411
+ export function decodeQbayBuyOutput(
412
+ data: Uint8Array,
413
+ ): QbayBuyOutput {
414
+ return decodePayload(data, QBAY_BUY_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayBuyOutput
415
+ }
416
+
417
+ export const QBAY_CANCEL_SALE_INPUT_TYPE = 8
418
+
419
+ export interface QbayCancelSaleInput {
420
+ NFTid: number
421
+ }
422
+
423
+ const QBAY_CANCEL_SALE_INPUT_FIELDS: BinaryField[] = [
424
+ {
425
+ name: 'NFTid',
426
+ type: 'uint32',
427
+ offset: 0,
428
+ byteLength: 4,
429
+ },
430
+ ]
431
+
432
+ export function buildQbayCancelSaleInput(
433
+ input: QbayCancelSaleInput,
434
+ ): ContractCall {
435
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_CANCEL_SALE_INPUT_TYPE, payload: buildPayload(QBAY_CANCEL_SALE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
436
+ }
437
+
438
+ export interface QbayCancelSaleOutput {
439
+ returnCode: number
440
+ }
441
+
442
+ const QBAY_CANCEL_SALE_OUTPUT_FIELDS: BinaryField[] = [
443
+ {
444
+ name: 'returnCode',
445
+ type: 'uint32',
446
+ offset: 0,
447
+ byteLength: 4,
448
+ },
449
+ ]
450
+
451
+ export function decodeQbayCancelSaleOutput(
452
+ data: Uint8Array,
453
+ ): QbayCancelSaleOutput {
454
+ return decodePayload(data, QBAY_CANCEL_SALE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayCancelSaleOutput
455
+ }
456
+
457
+ export const QBAY_LIST_IN_EXCHANGE_INPUT_TYPE = 9
458
+
459
+ export interface QbayListInExchangeInput {
460
+ possessedNFT: number
461
+ anotherNFT: number
462
+ }
463
+
464
+ const QBAY_LIST_IN_EXCHANGE_INPUT_FIELDS: BinaryField[] = [
465
+ {
466
+ name: 'possessedNFT',
467
+ type: 'uint32',
468
+ offset: 0,
469
+ byteLength: 4,
470
+ },
471
+ {
472
+ name: 'anotherNFT',
473
+ type: 'uint32',
474
+ offset: 4,
475
+ byteLength: 4,
476
+ },
477
+ ]
478
+
479
+ export function buildQbayListInExchangeInput(
480
+ input: QbayListInExchangeInput,
481
+ ): ContractCall {
482
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_LIST_IN_EXCHANGE_INPUT_TYPE, payload: buildPayload(QBAY_LIST_IN_EXCHANGE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
483
+ }
484
+
485
+ export interface QbayListInExchangeOutput {
486
+ returnCode: number
487
+ }
488
+
489
+ const QBAY_LIST_IN_EXCHANGE_OUTPUT_FIELDS: BinaryField[] = [
490
+ {
491
+ name: 'returnCode',
492
+ type: 'uint32',
493
+ offset: 0,
494
+ byteLength: 4,
495
+ },
496
+ ]
497
+
498
+ export function decodeQbayListInExchangeOutput(
499
+ data: Uint8Array,
500
+ ): QbayListInExchangeOutput {
501
+ return decodePayload(data, QBAY_LIST_IN_EXCHANGE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayListInExchangeOutput
502
+ }
503
+
504
+ export const QBAY_CANCEL_EXCHANGE_INPUT_TYPE = 10
505
+
506
+ export interface QbayCancelExchangeInput {
507
+ possessedNFT: number
508
+ anotherNFT: number
509
+ }
510
+
511
+ const QBAY_CANCEL_EXCHANGE_INPUT_FIELDS: BinaryField[] = [
512
+ {
513
+ name: 'possessedNFT',
514
+ type: 'uint32',
515
+ offset: 0,
516
+ byteLength: 4,
517
+ },
518
+ {
519
+ name: 'anotherNFT',
520
+ type: 'uint32',
521
+ offset: 4,
522
+ byteLength: 4,
523
+ },
524
+ ]
525
+
526
+ export function buildQbayCancelExchangeInput(
527
+ input: QbayCancelExchangeInput,
528
+ ): ContractCall {
529
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_CANCEL_EXCHANGE_INPUT_TYPE, payload: buildPayload(QBAY_CANCEL_EXCHANGE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
530
+ }
531
+
532
+ export interface QbayCancelExchangeOutput {
533
+ returnCode: number
534
+ }
535
+
536
+ const QBAY_CANCEL_EXCHANGE_OUTPUT_FIELDS: BinaryField[] = [
537
+ {
538
+ name: 'returnCode',
539
+ type: 'uint32',
540
+ offset: 0,
541
+ byteLength: 4,
542
+ },
543
+ ]
544
+
545
+ export function decodeQbayCancelExchangeOutput(
546
+ data: Uint8Array,
547
+ ): QbayCancelExchangeOutput {
548
+ return decodePayload(data, QBAY_CANCEL_EXCHANGE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayCancelExchangeOutput
549
+ }
550
+
551
+ export const QBAY_MAKE_OFFER_INPUT_TYPE = 11
552
+
553
+ export interface QbayMakeOfferInput {
554
+ askPrice: bigint
555
+ NFTid: number
556
+ paymentMethod: number
557
+ }
558
+
559
+ const QBAY_MAKE_OFFER_INPUT_FIELDS: BinaryField[] = [
560
+ {
561
+ name: 'askPrice',
562
+ type: 'uint64',
563
+ offset: 0,
564
+ byteLength: 8,
565
+ },
566
+ {
567
+ name: 'NFTid',
568
+ type: 'uint32',
569
+ offset: 8,
570
+ byteLength: 4,
571
+ },
572
+ {
573
+ name: 'paymentMethod',
574
+ type: 'uint8',
575
+ offset: 12,
576
+ byteLength: 1,
577
+ },
578
+ ]
579
+
580
+ export function buildQbayMakeOfferInput(
581
+ input: QbayMakeOfferInput,
582
+ ): ContractCall {
583
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_MAKE_OFFER_INPUT_TYPE, payload: buildPayload(QBAY_MAKE_OFFER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
584
+ }
585
+
586
+ export interface QbayMakeOfferOutput {
587
+ returnCode: number
588
+ }
589
+
590
+ const QBAY_MAKE_OFFER_OUTPUT_FIELDS: BinaryField[] = [
591
+ {
592
+ name: 'returnCode',
593
+ type: 'uint32',
594
+ offset: 0,
595
+ byteLength: 4,
596
+ },
597
+ ]
598
+
599
+ export function decodeQbayMakeOfferOutput(
600
+ data: Uint8Array,
601
+ ): QbayMakeOfferOutput {
602
+ return decodePayload(data, QBAY_MAKE_OFFER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayMakeOfferOutput
603
+ }
604
+
605
+ export const QBAY_ACCEPT_OFFER_INPUT_TYPE = 12
606
+
607
+ export interface QbayAcceptOfferInput {
608
+ NFTid: number
609
+ }
610
+
611
+ const QBAY_ACCEPT_OFFER_INPUT_FIELDS: BinaryField[] = [
612
+ {
613
+ name: 'NFTid',
614
+ type: 'uint32',
615
+ offset: 0,
616
+ byteLength: 4,
617
+ },
618
+ ]
619
+
620
+ export function buildQbayAcceptOfferInput(
621
+ input: QbayAcceptOfferInput,
622
+ ): ContractCall {
623
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_ACCEPT_OFFER_INPUT_TYPE, payload: buildPayload(QBAY_ACCEPT_OFFER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
624
+ }
625
+
626
+ export interface QbayAcceptOfferOutput {
627
+ returnCode: number
628
+ }
629
+
630
+ const QBAY_ACCEPT_OFFER_OUTPUT_FIELDS: BinaryField[] = [
631
+ {
632
+ name: 'returnCode',
633
+ type: 'uint32',
634
+ offset: 0,
635
+ byteLength: 4,
636
+ },
637
+ ]
638
+
639
+ export function decodeQbayAcceptOfferOutput(
640
+ data: Uint8Array,
641
+ ): QbayAcceptOfferOutput {
642
+ return decodePayload(data, QBAY_ACCEPT_OFFER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayAcceptOfferOutput
643
+ }
644
+
645
+ export const QBAY_CANCEL_OFFER_INPUT_TYPE = 13
646
+
647
+ export interface QbayCancelOfferInput {
648
+ NFTid: number
649
+ }
650
+
651
+ const QBAY_CANCEL_OFFER_INPUT_FIELDS: BinaryField[] = [
652
+ {
653
+ name: 'NFTid',
654
+ type: 'uint32',
655
+ offset: 0,
656
+ byteLength: 4,
657
+ },
658
+ ]
659
+
660
+ export function buildQbayCancelOfferInput(
661
+ input: QbayCancelOfferInput,
662
+ ): ContractCall {
663
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_CANCEL_OFFER_INPUT_TYPE, payload: buildPayload(QBAY_CANCEL_OFFER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
664
+ }
665
+
666
+ export interface QbayCancelOfferOutput {
667
+ returnCode: number
668
+ }
669
+
670
+ const QBAY_CANCEL_OFFER_OUTPUT_FIELDS: BinaryField[] = [
671
+ {
672
+ name: 'returnCode',
673
+ type: 'uint32',
674
+ offset: 0,
675
+ byteLength: 4,
676
+ },
677
+ ]
678
+
679
+ export function decodeQbayCancelOfferOutput(
680
+ data: Uint8Array,
681
+ ): QbayCancelOfferOutput {
682
+ return decodePayload(data, QBAY_CANCEL_OFFER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayCancelOfferOutput
683
+ }
684
+
685
+ export const QBAY_CREATE_TRADITIONAL_AUCTION_INPUT_TYPE = 14
686
+
687
+ export interface QbayCreateTraditionalAuctionInput {
688
+ minPrice: bigint
689
+ NFTId: number
690
+ startYear: number
691
+ startMonth: number
692
+ startDay: number
693
+ startHour: number
694
+ endYear: number
695
+ endMonth: number
696
+ endDay: number
697
+ endHour: number
698
+ paymentMethodOfAuction: number
699
+ }
700
+
701
+ const QBAY_CREATE_TRADITIONAL_AUCTION_INPUT_FIELDS: BinaryField[] = [
702
+ {
703
+ name: 'minPrice',
704
+ type: 'uint64',
705
+ offset: 0,
706
+ byteLength: 8,
707
+ },
708
+ {
709
+ name: 'NFTId',
710
+ type: 'uint32',
711
+ offset: 8,
712
+ byteLength: 4,
713
+ },
714
+ {
715
+ name: 'startYear',
716
+ type: 'uint32',
717
+ offset: 12,
718
+ byteLength: 4,
719
+ },
720
+ {
721
+ name: 'startMonth',
722
+ type: 'uint32',
723
+ offset: 16,
724
+ byteLength: 4,
725
+ },
726
+ {
727
+ name: 'startDay',
728
+ type: 'uint32',
729
+ offset: 20,
730
+ byteLength: 4,
731
+ },
732
+ {
733
+ name: 'startHour',
734
+ type: 'uint32',
735
+ offset: 24,
736
+ byteLength: 4,
737
+ },
738
+ {
739
+ name: 'endYear',
740
+ type: 'uint32',
741
+ offset: 28,
742
+ byteLength: 4,
743
+ },
744
+ {
745
+ name: 'endMonth',
746
+ type: 'uint32',
747
+ offset: 32,
748
+ byteLength: 4,
749
+ },
750
+ {
751
+ name: 'endDay',
752
+ type: 'uint32',
753
+ offset: 36,
754
+ byteLength: 4,
755
+ },
756
+ {
757
+ name: 'endHour',
758
+ type: 'uint32',
759
+ offset: 40,
760
+ byteLength: 4,
761
+ },
762
+ {
763
+ name: 'paymentMethodOfAuction',
764
+ type: 'uint8',
765
+ offset: 44,
766
+ byteLength: 1,
767
+ },
768
+ ]
769
+
770
+ export function buildQbayCreateTraditionalAuctionInput(
771
+ input: QbayCreateTraditionalAuctionInput,
772
+ ): ContractCall {
773
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_CREATE_TRADITIONAL_AUCTION_INPUT_TYPE, payload: buildPayload(QBAY_CREATE_TRADITIONAL_AUCTION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
774
+ }
775
+
776
+ export interface QbayCreateTraditionalAuctionOutput {
777
+ returnCode: number
778
+ }
779
+
780
+ const QBAY_CREATE_TRADITIONAL_AUCTION_OUTPUT_FIELDS: BinaryField[] = [
781
+ {
782
+ name: 'returnCode',
783
+ type: 'uint32',
784
+ offset: 0,
785
+ byteLength: 4,
786
+ },
787
+ ]
788
+
789
+ export function decodeQbayCreateTraditionalAuctionOutput(
790
+ data: Uint8Array,
791
+ ): QbayCreateTraditionalAuctionOutput {
792
+ return decodePayload(data, QBAY_CREATE_TRADITIONAL_AUCTION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayCreateTraditionalAuctionOutput
793
+ }
794
+
795
+ export const QBAY_BID_ON_TRADITIONAL_AUCTION_INPUT_TYPE = 15
796
+
797
+ export interface QbayBidOnTraditionalAuctionInput {
798
+ price: bigint
799
+ NFTId: number
800
+ paymentMethod: number
801
+ }
802
+
803
+ const QBAY_BID_ON_TRADITIONAL_AUCTION_INPUT_FIELDS: BinaryField[] = [
804
+ {
805
+ name: 'price',
806
+ type: 'uint64',
807
+ offset: 0,
808
+ byteLength: 8,
809
+ },
810
+ {
811
+ name: 'NFTId',
812
+ type: 'uint32',
813
+ offset: 8,
814
+ byteLength: 4,
815
+ },
816
+ {
817
+ name: 'paymentMethod',
818
+ type: 'uint8',
819
+ offset: 12,
820
+ byteLength: 1,
821
+ },
822
+ ]
823
+
824
+ export function buildQbayBidOnTraditionalAuctionInput(
825
+ input: QbayBidOnTraditionalAuctionInput,
826
+ ): ContractCall {
827
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_BID_ON_TRADITIONAL_AUCTION_INPUT_TYPE, payload: buildPayload(QBAY_BID_ON_TRADITIONAL_AUCTION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
828
+ }
829
+
830
+ export interface QbayBidOnTraditionalAuctionOutput {
831
+ returnCode: number
832
+ }
833
+
834
+ const QBAY_BID_ON_TRADITIONAL_AUCTION_OUTPUT_FIELDS: BinaryField[] = [
835
+ {
836
+ name: 'returnCode',
837
+ type: 'uint32',
838
+ offset: 0,
839
+ byteLength: 4,
840
+ },
841
+ ]
842
+
843
+ export function decodeQbayBidOnTraditionalAuctionOutput(
844
+ data: Uint8Array,
845
+ ): QbayBidOnTraditionalAuctionOutput {
846
+ return decodePayload(data, QBAY_BID_ON_TRADITIONAL_AUCTION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayBidOnTraditionalAuctionOutput
847
+ }
848
+
849
+ export const QBAY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE = 16
850
+
851
+ export interface QbayTransferShareManagementRightsInput {
852
+ asset: QbayAssetStruct
853
+ numberOfShares: bigint
854
+ newManagingContractIndex: number
855
+ }
856
+
857
+ const QBAY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS: BinaryField[] = [
858
+ {
859
+ name: 'asset',
860
+ type: 'struct',
861
+ offset: 0,
862
+ byteLength: 40,
863
+ structRef: 'Asset',
864
+ },
865
+ {
866
+ name: 'numberOfShares',
867
+ type: 'sint64',
868
+ offset: 40,
869
+ byteLength: 8,
870
+ },
871
+ {
872
+ name: 'newManagingContractIndex',
873
+ type: 'uint32',
874
+ offset: 48,
875
+ byteLength: 4,
876
+ },
877
+ ]
878
+
879
+ export function buildQbayTransferShareManagementRightsInput(
880
+ input: QbayTransferShareManagementRightsInput,
881
+ ): ContractCall {
882
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_TYPE, payload: buildPayload(QBAY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
883
+ }
884
+
885
+ export interface QbayTransferShareManagementRightsOutput {
886
+ transferredNumberOfShares: bigint
887
+ returnCode: number
888
+ }
889
+
890
+ const QBAY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS: BinaryField[] = [
891
+ {
892
+ name: 'transferredNumberOfShares',
893
+ type: 'sint64',
894
+ offset: 0,
895
+ byteLength: 8,
896
+ },
897
+ {
898
+ name: 'returnCode',
899
+ type: 'uint32',
900
+ offset: 8,
901
+ byteLength: 4,
902
+ },
903
+ ]
904
+
905
+ export function decodeQbayTransferShareManagementRightsOutput(
906
+ data: Uint8Array,
907
+ ): QbayTransferShareManagementRightsOutput {
908
+ return decodePayload(data, QBAY_TRANSFER_SHARE_MANAGEMENT_RIGHTS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayTransferShareManagementRightsOutput
909
+ }
910
+
911
+ export const QBAY_CHANGE_STATUS_OF_MARKET_PLACE_INPUT_TYPE = 17
912
+
913
+ export interface QbayChangeStatusOfMarketPlaceInput {
914
+ status: number
915
+ }
916
+
917
+ const QBAY_CHANGE_STATUS_OF_MARKET_PLACE_INPUT_FIELDS: BinaryField[] = [
918
+ {
919
+ name: 'status',
920
+ type: 'uint8',
921
+ offset: 0,
922
+ byteLength: 1,
923
+ },
924
+ ]
925
+
926
+ export function buildQbayChangeStatusOfMarketPlaceInput(
927
+ input: QbayChangeStatusOfMarketPlaceInput,
928
+ ): ContractCall {
929
+ return { contractIndex: QBAY_CONTRACT_INDEX, inputType: QBAY_CHANGE_STATUS_OF_MARKET_PLACE_INPUT_TYPE, payload: buildPayload(QBAY_CHANGE_STATUS_OF_MARKET_PLACE_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32)) }
930
+ }
931
+
932
+ export interface QbayChangeStatusOfMarketPlaceOutput {
933
+ returnCode: number
934
+ }
935
+
936
+ const QBAY_CHANGE_STATUS_OF_MARKET_PLACE_OUTPUT_FIELDS: BinaryField[] = [
937
+ {
938
+ name: 'returnCode',
939
+ type: 'uint32',
940
+ offset: 0,
941
+ byteLength: 4,
942
+ },
943
+ ]
944
+
945
+ export function decodeQbayChangeStatusOfMarketPlaceOutput(
946
+ data: Uint8Array,
947
+ ): QbayChangeStatusOfMarketPlaceOutput {
948
+ return decodePayload(data, QBAY_CHANGE_STATUS_OF_MARKET_PLACE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayChangeStatusOfMarketPlaceOutput
949
+ }
950
+
951
+ export const QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_TYPE = 1
952
+ export const QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_SIZE = 32
953
+
954
+ export interface QbayGetNumberOfNFTForUserInput {
955
+ user: string
956
+ }
957
+
958
+ const QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_FIELDS: BinaryField[] = [
959
+ {
960
+ name: 'user',
961
+ type: 'id',
962
+ offset: 0,
963
+ byteLength: 32,
964
+ },
965
+ ]
966
+
967
+ export function buildQbayGetNumberOfNFTForUserInput(
968
+ input: QbayGetNumberOfNFTForUserInput,
969
+ identityToPublicKey: (identity: string) => Uint8Array,
970
+ ): Uint8Array {
971
+ return buildPayload(QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
972
+ }
973
+
974
+ export interface QbayGetNumberOfNFTForUserOutput {
975
+ numberOfNFT: number
976
+ }
977
+
978
+ const QBAY_GET_NUMBER_OF_NFT_FOR_USER_OUTPUT_FIELDS: BinaryField[] = [
979
+ {
980
+ name: 'numberOfNFT',
981
+ type: 'uint32',
982
+ offset: 0,
983
+ byteLength: 4,
984
+ },
985
+ ]
986
+
987
+ export function decodeQbayGetNumberOfNFTForUserOutput(
988
+ data: Uint8Array,
989
+ ): QbayGetNumberOfNFTForUserOutput {
990
+ return decodePayload(data, QBAY_GET_NUMBER_OF_NFT_FOR_USER_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayGetNumberOfNFTForUserOutput
991
+ }
992
+
993
+ export async function qbayGetNumberOfNFTForUser(
994
+ live: SmartContractCaller,
995
+ input: QbayGetNumberOfNFTForUserInput,
996
+ options?: ContractCallOptions,
997
+ ): Promise<Result<QbayGetNumberOfNFTForUserOutput, QubicRpcError>> {
998
+ return callContractFunction({
999
+ live,
1000
+ contractIndex: QBAY_CONTRACT_INDEX,
1001
+ inputType: QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_TYPE,
1002
+ inputSize: QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_SIZE,
1003
+ inputFields: QBAY_GET_NUMBER_OF_NFT_FOR_USER_INPUT_FIELDS,
1004
+ outputFields: QBAY_GET_NUMBER_OF_NFT_FOR_USER_OUTPUT_FIELDS,
1005
+ structs: STRUCTS,
1006
+ input: (input as unknown as Record<string, unknown>),
1007
+ ...options,
1008
+ })
1009
+ }
1010
+
1011
+ export const QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_TYPE = 2
1012
+ export const QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_SIZE = 36
1013
+
1014
+ export interface QbayGetInfoOfNFTUserPossessedInput {
1015
+ user: string
1016
+ NFTNumber: number
1017
+ }
1018
+
1019
+ const QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_FIELDS: BinaryField[] = [
1020
+ {
1021
+ name: 'user',
1022
+ type: 'id',
1023
+ offset: 0,
1024
+ byteLength: 32,
1025
+ },
1026
+ {
1027
+ name: 'NFTNumber',
1028
+ type: 'uint32',
1029
+ offset: 32,
1030
+ byteLength: 4,
1031
+ },
1032
+ ]
1033
+
1034
+ export function buildQbayGetInfoOfNFTUserPossessedInput(
1035
+ input: QbayGetInfoOfNFTUserPossessedInput,
1036
+ identityToPublicKey: (identity: string) => Uint8Array,
1037
+ ): Uint8Array {
1038
+ return buildPayload(QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
1039
+ }
1040
+
1041
+ export interface QbayGetInfoOfNFTUserPossessedOutput {
1042
+ creator: string
1043
+ possessor: string
1044
+ askUser: string
1045
+ creatorOfAuction: string
1046
+ salePrice: bigint
1047
+ askMaxPrice: bigint
1048
+ currentPriceOfAuction: bigint
1049
+ royalty: number
1050
+ NFTidForExchange: number
1051
+ URI: number[]
1052
+ statusOfAuction: number
1053
+ yearAuctionStarted: number
1054
+ monthAuctionStarted: number
1055
+ dayAuctionStarted: number
1056
+ hourAuctionStarted: number
1057
+ minuteAuctionStarted: number
1058
+ secondAuctionStarted: number
1059
+ yearAuctionEnded: number
1060
+ monthAuctionEnded: number
1061
+ dayAuctionEnded: number
1062
+ hourAuctionEnded: number
1063
+ minuteAuctionEnded: number
1064
+ secondAuctionEnded: number
1065
+ statusOfSale: number
1066
+ statusOfAsk: number
1067
+ paymentMethodOfAsk: number
1068
+ statusOfExchange: number
1069
+ paymentMethodOfAuction: number
1070
+ }
1071
+
1072
+ const QBAY_GET_INFO_OF_NFT_USER_POSSESSED_OUTPUT_FIELDS: BinaryField[] = [
1073
+ {
1074
+ name: 'creator',
1075
+ type: 'id',
1076
+ offset: 0,
1077
+ byteLength: 32,
1078
+ },
1079
+ {
1080
+ name: 'possessor',
1081
+ type: 'id',
1082
+ offset: 32,
1083
+ byteLength: 32,
1084
+ },
1085
+ {
1086
+ name: 'askUser',
1087
+ type: 'id',
1088
+ offset: 64,
1089
+ byteLength: 32,
1090
+ },
1091
+ {
1092
+ name: 'creatorOfAuction',
1093
+ type: 'id',
1094
+ offset: 96,
1095
+ byteLength: 32,
1096
+ },
1097
+ {
1098
+ name: 'salePrice',
1099
+ type: 'sint64',
1100
+ offset: 128,
1101
+ byteLength: 8,
1102
+ },
1103
+ {
1104
+ name: 'askMaxPrice',
1105
+ type: 'sint64',
1106
+ offset: 136,
1107
+ byteLength: 8,
1108
+ },
1109
+ {
1110
+ name: 'currentPriceOfAuction',
1111
+ type: 'uint64',
1112
+ offset: 144,
1113
+ byteLength: 8,
1114
+ },
1115
+ {
1116
+ name: 'royalty',
1117
+ type: 'uint32',
1118
+ offset: 152,
1119
+ byteLength: 4,
1120
+ },
1121
+ {
1122
+ name: 'NFTidForExchange',
1123
+ type: 'uint32',
1124
+ offset: 156,
1125
+ byteLength: 4,
1126
+ },
1127
+ {
1128
+ name: 'URI',
1129
+ type: 'array',
1130
+ offset: 160,
1131
+ byteLength: 64,
1132
+ arrayLength: 64,
1133
+ arrayItemType: 'uint8',
1134
+ arrayItemByteLength: 1,
1135
+ },
1136
+ {
1137
+ name: 'statusOfAuction',
1138
+ type: 'uint8',
1139
+ offset: 224,
1140
+ byteLength: 1,
1141
+ },
1142
+ {
1143
+ name: 'yearAuctionStarted',
1144
+ type: 'uint8',
1145
+ offset: 225,
1146
+ byteLength: 1,
1147
+ },
1148
+ {
1149
+ name: 'monthAuctionStarted',
1150
+ type: 'uint8',
1151
+ offset: 226,
1152
+ byteLength: 1,
1153
+ },
1154
+ {
1155
+ name: 'dayAuctionStarted',
1156
+ type: 'uint8',
1157
+ offset: 227,
1158
+ byteLength: 1,
1159
+ },
1160
+ {
1161
+ name: 'hourAuctionStarted',
1162
+ type: 'uint8',
1163
+ offset: 228,
1164
+ byteLength: 1,
1165
+ },
1166
+ {
1167
+ name: 'minuteAuctionStarted',
1168
+ type: 'uint8',
1169
+ offset: 229,
1170
+ byteLength: 1,
1171
+ },
1172
+ {
1173
+ name: 'secondAuctionStarted',
1174
+ type: 'uint8',
1175
+ offset: 230,
1176
+ byteLength: 1,
1177
+ },
1178
+ {
1179
+ name: 'yearAuctionEnded',
1180
+ type: 'uint8',
1181
+ offset: 231,
1182
+ byteLength: 1,
1183
+ },
1184
+ {
1185
+ name: 'monthAuctionEnded',
1186
+ type: 'uint8',
1187
+ offset: 232,
1188
+ byteLength: 1,
1189
+ },
1190
+ {
1191
+ name: 'dayAuctionEnded',
1192
+ type: 'uint8',
1193
+ offset: 233,
1194
+ byteLength: 1,
1195
+ },
1196
+ {
1197
+ name: 'hourAuctionEnded',
1198
+ type: 'uint8',
1199
+ offset: 234,
1200
+ byteLength: 1,
1201
+ },
1202
+ {
1203
+ name: 'minuteAuctionEnded',
1204
+ type: 'uint8',
1205
+ offset: 235,
1206
+ byteLength: 1,
1207
+ },
1208
+ {
1209
+ name: 'secondAuctionEnded',
1210
+ type: 'uint8',
1211
+ offset: 236,
1212
+ byteLength: 1,
1213
+ },
1214
+ {
1215
+ name: 'statusOfSale',
1216
+ type: 'uint8',
1217
+ offset: 237,
1218
+ byteLength: 1,
1219
+ },
1220
+ {
1221
+ name: 'statusOfAsk',
1222
+ type: 'uint8',
1223
+ offset: 238,
1224
+ byteLength: 1,
1225
+ },
1226
+ {
1227
+ name: 'paymentMethodOfAsk',
1228
+ type: 'uint8',
1229
+ offset: 239,
1230
+ byteLength: 1,
1231
+ },
1232
+ {
1233
+ name: 'statusOfExchange',
1234
+ type: 'uint8',
1235
+ offset: 240,
1236
+ byteLength: 1,
1237
+ },
1238
+ {
1239
+ name: 'paymentMethodOfAuction',
1240
+ type: 'uint8',
1241
+ offset: 241,
1242
+ byteLength: 1,
1243
+ },
1244
+ ]
1245
+
1246
+ export function decodeQbayGetInfoOfNFTUserPossessedOutput(
1247
+ data: Uint8Array,
1248
+ publicKeyToIdentity: (pk: Uint8Array) => string,
1249
+ ): QbayGetInfoOfNFTUserPossessedOutput {
1250
+ return decodePayload(data, QBAY_GET_INFO_OF_NFT_USER_POSSESSED_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QbayGetInfoOfNFTUserPossessedOutput
1251
+ }
1252
+
1253
+ export async function qbayGetInfoOfNFTUserPossessed(
1254
+ live: SmartContractCaller,
1255
+ input: QbayGetInfoOfNFTUserPossessedInput,
1256
+ options?: ContractCallOptions,
1257
+ ): Promise<Result<QbayGetInfoOfNFTUserPossessedOutput, QubicRpcError>> {
1258
+ return callContractFunction({
1259
+ live,
1260
+ contractIndex: QBAY_CONTRACT_INDEX,
1261
+ inputType: QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_TYPE,
1262
+ inputSize: QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_SIZE,
1263
+ inputFields: QBAY_GET_INFO_OF_NFT_USER_POSSESSED_INPUT_FIELDS,
1264
+ outputFields: QBAY_GET_INFO_OF_NFT_USER_POSSESSED_OUTPUT_FIELDS,
1265
+ structs: STRUCTS,
1266
+ input: (input as unknown as Record<string, unknown>),
1267
+ ...options,
1268
+ })
1269
+ }
1270
+
1271
+ export const QBAY_GET_INFO_OF_MARKETPLACE_INPUT_TYPE = 3
1272
+ export const QBAY_GET_INFO_OF_MARKETPLACE_INPUT_SIZE = 0
1273
+
1274
+ export interface QbayGetInfoOfMarketplaceOutput {
1275
+ priceOfCFB: bigint
1276
+ priceOfQubic: bigint
1277
+ numberOfNFTIncoming: bigint
1278
+ earnedQubic: bigint
1279
+ earnedCFB: bigint
1280
+ numberOfCollection: number
1281
+ numberOfNFT: number
1282
+ statusOfMarketPlace: number
1283
+ }
1284
+
1285
+ const QBAY_GET_INFO_OF_MARKETPLACE_OUTPUT_FIELDS: BinaryField[] = [
1286
+ {
1287
+ name: 'priceOfCFB',
1288
+ type: 'uint64',
1289
+ offset: 0,
1290
+ byteLength: 8,
1291
+ },
1292
+ {
1293
+ name: 'priceOfQubic',
1294
+ type: 'uint64',
1295
+ offset: 8,
1296
+ byteLength: 8,
1297
+ },
1298
+ {
1299
+ name: 'numberOfNFTIncoming',
1300
+ type: 'uint64',
1301
+ offset: 16,
1302
+ byteLength: 8,
1303
+ },
1304
+ {
1305
+ name: 'earnedQubic',
1306
+ type: 'uint64',
1307
+ offset: 24,
1308
+ byteLength: 8,
1309
+ },
1310
+ {
1311
+ name: 'earnedCFB',
1312
+ type: 'uint64',
1313
+ offset: 32,
1314
+ byteLength: 8,
1315
+ },
1316
+ {
1317
+ name: 'numberOfCollection',
1318
+ type: 'uint32',
1319
+ offset: 40,
1320
+ byteLength: 4,
1321
+ },
1322
+ {
1323
+ name: 'numberOfNFT',
1324
+ type: 'uint32',
1325
+ offset: 44,
1326
+ byteLength: 4,
1327
+ },
1328
+ {
1329
+ name: 'statusOfMarketPlace',
1330
+ type: 'uint8',
1331
+ offset: 48,
1332
+ byteLength: 1,
1333
+ },
1334
+ ]
1335
+
1336
+ export function decodeQbayGetInfoOfMarketplaceOutput(
1337
+ data: Uint8Array,
1338
+ ): QbayGetInfoOfMarketplaceOutput {
1339
+ return decodePayload(data, QBAY_GET_INFO_OF_MARKETPLACE_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayGetInfoOfMarketplaceOutput
1340
+ }
1341
+
1342
+ export async function qbayGetInfoOfMarketplace(
1343
+ live: SmartContractCaller,
1344
+ options?: ContractCallOptions,
1345
+ ): Promise<Result<QbayGetInfoOfMarketplaceOutput, QubicRpcError>> {
1346
+ return callContractFunction({
1347
+ live,
1348
+ contractIndex: QBAY_CONTRACT_INDEX,
1349
+ inputType: QBAY_GET_INFO_OF_MARKETPLACE_INPUT_TYPE,
1350
+ inputSize: QBAY_GET_INFO_OF_MARKETPLACE_INPUT_SIZE,
1351
+ inputFields: [],
1352
+ outputFields: QBAY_GET_INFO_OF_MARKETPLACE_OUTPUT_FIELDS,
1353
+ structs: STRUCTS,
1354
+ input: {},
1355
+ ...options,
1356
+ })
1357
+ }
1358
+
1359
+ export const QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_TYPE = 4
1360
+ export const QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_SIZE = 36
1361
+
1362
+ export interface QbayGetInfoOfCollectionByCreatorInput {
1363
+ creator: string
1364
+ orderOfCollection: number
1365
+ }
1366
+
1367
+ const QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_FIELDS: BinaryField[] = [
1368
+ {
1369
+ name: 'creator',
1370
+ type: 'id',
1371
+ offset: 0,
1372
+ byteLength: 32,
1373
+ },
1374
+ {
1375
+ name: 'orderOfCollection',
1376
+ type: 'uint32',
1377
+ offset: 32,
1378
+ byteLength: 4,
1379
+ },
1380
+ ]
1381
+
1382
+ export function buildQbayGetInfoOfCollectionByCreatorInput(
1383
+ input: QbayGetInfoOfCollectionByCreatorInput,
1384
+ identityToPublicKey: (identity: string) => Uint8Array,
1385
+ ): Uint8Array {
1386
+ return buildPayload(QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
1387
+ }
1388
+
1389
+ export interface QbayGetInfoOfCollectionByCreatorOutput {
1390
+ priceForDropMint: bigint
1391
+ idOfCollection: number
1392
+ royalty: number
1393
+ currentSize: number
1394
+ maxSizeHoldingPerOneId: number
1395
+ URI: number[]
1396
+ typeOfCollection: number
1397
+ }
1398
+
1399
+ const QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_OUTPUT_FIELDS: BinaryField[] = [
1400
+ {
1401
+ name: 'priceForDropMint',
1402
+ type: 'uint64',
1403
+ offset: 0,
1404
+ byteLength: 8,
1405
+ },
1406
+ {
1407
+ name: 'idOfCollection',
1408
+ type: 'uint32',
1409
+ offset: 8,
1410
+ byteLength: 4,
1411
+ },
1412
+ {
1413
+ name: 'royalty',
1414
+ type: 'uint32',
1415
+ offset: 12,
1416
+ byteLength: 4,
1417
+ },
1418
+ {
1419
+ name: 'currentSize',
1420
+ type: 'sint32',
1421
+ offset: 16,
1422
+ byteLength: 4,
1423
+ },
1424
+ {
1425
+ name: 'maxSizeHoldingPerOneId',
1426
+ type: 'uint32',
1427
+ offset: 20,
1428
+ byteLength: 4,
1429
+ },
1430
+ {
1431
+ name: 'URI',
1432
+ type: 'array',
1433
+ offset: 24,
1434
+ byteLength: 64,
1435
+ arrayLength: 64,
1436
+ arrayItemType: 'uint8',
1437
+ arrayItemByteLength: 1,
1438
+ },
1439
+ {
1440
+ name: 'typeOfCollection',
1441
+ type: 'uint8',
1442
+ offset: 88,
1443
+ byteLength: 1,
1444
+ },
1445
+ ]
1446
+
1447
+ export function decodeQbayGetInfoOfCollectionByCreatorOutput(
1448
+ data: Uint8Array,
1449
+ ): QbayGetInfoOfCollectionByCreatorOutput {
1450
+ return decodePayload(data, QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayGetInfoOfCollectionByCreatorOutput
1451
+ }
1452
+
1453
+ export async function qbayGetInfoOfCollectionByCreator(
1454
+ live: SmartContractCaller,
1455
+ input: QbayGetInfoOfCollectionByCreatorInput,
1456
+ options?: ContractCallOptions,
1457
+ ): Promise<Result<QbayGetInfoOfCollectionByCreatorOutput, QubicRpcError>> {
1458
+ return callContractFunction({
1459
+ live,
1460
+ contractIndex: QBAY_CONTRACT_INDEX,
1461
+ inputType: QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_TYPE,
1462
+ inputSize: QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_SIZE,
1463
+ inputFields: QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_INPUT_FIELDS,
1464
+ outputFields: QBAY_GET_INFO_OF_COLLECTION_BY_CREATOR_OUTPUT_FIELDS,
1465
+ structs: STRUCTS,
1466
+ input: (input as unknown as Record<string, unknown>),
1467
+ ...options,
1468
+ })
1469
+ }
1470
+
1471
+ export const QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_TYPE = 5
1472
+ export const QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_SIZE = 4
1473
+
1474
+ export interface QbayGetInfoOfCollectionByIdInput {
1475
+ idOfCollection: number
1476
+ }
1477
+
1478
+ const QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_FIELDS: BinaryField[] = [
1479
+ {
1480
+ name: 'idOfCollection',
1481
+ type: 'uint32',
1482
+ offset: 0,
1483
+ byteLength: 4,
1484
+ },
1485
+ ]
1486
+
1487
+ export function buildQbayGetInfoOfCollectionByIdInput(
1488
+ input: QbayGetInfoOfCollectionByIdInput,
1489
+ ): Uint8Array {
1490
+ return buildPayload(QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1491
+ }
1492
+
1493
+ export interface QbayGetInfoOfCollectionByIdOutput {
1494
+ creator: string
1495
+ priceForDropMint: bigint
1496
+ royalty: number
1497
+ currentSize: number
1498
+ maxSizeHoldingPerOneId: number
1499
+ URI: number[]
1500
+ typeOfCollection: number
1501
+ }
1502
+
1503
+ const QBAY_GET_INFO_OF_COLLECTION_BY_ID_OUTPUT_FIELDS: BinaryField[] = [
1504
+ {
1505
+ name: 'creator',
1506
+ type: 'id',
1507
+ offset: 0,
1508
+ byteLength: 32,
1509
+ },
1510
+ {
1511
+ name: 'priceForDropMint',
1512
+ type: 'uint64',
1513
+ offset: 32,
1514
+ byteLength: 8,
1515
+ },
1516
+ {
1517
+ name: 'royalty',
1518
+ type: 'uint32',
1519
+ offset: 40,
1520
+ byteLength: 4,
1521
+ },
1522
+ {
1523
+ name: 'currentSize',
1524
+ type: 'sint32',
1525
+ offset: 44,
1526
+ byteLength: 4,
1527
+ },
1528
+ {
1529
+ name: 'maxSizeHoldingPerOneId',
1530
+ type: 'uint32',
1531
+ offset: 48,
1532
+ byteLength: 4,
1533
+ },
1534
+ {
1535
+ name: 'URI',
1536
+ type: 'array',
1537
+ offset: 52,
1538
+ byteLength: 64,
1539
+ arrayLength: 64,
1540
+ arrayItemType: 'uint8',
1541
+ arrayItemByteLength: 1,
1542
+ },
1543
+ {
1544
+ name: 'typeOfCollection',
1545
+ type: 'uint8',
1546
+ offset: 116,
1547
+ byteLength: 1,
1548
+ },
1549
+ ]
1550
+
1551
+ export function decodeQbayGetInfoOfCollectionByIdOutput(
1552
+ data: Uint8Array,
1553
+ publicKeyToIdentity: (pk: Uint8Array) => string,
1554
+ ): QbayGetInfoOfCollectionByIdOutput {
1555
+ return decodePayload(data, QBAY_GET_INFO_OF_COLLECTION_BY_ID_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QbayGetInfoOfCollectionByIdOutput
1556
+ }
1557
+
1558
+ export async function qbayGetInfoOfCollectionById(
1559
+ live: SmartContractCaller,
1560
+ input: QbayGetInfoOfCollectionByIdInput,
1561
+ options?: ContractCallOptions,
1562
+ ): Promise<Result<QbayGetInfoOfCollectionByIdOutput, QubicRpcError>> {
1563
+ return callContractFunction({
1564
+ live,
1565
+ contractIndex: QBAY_CONTRACT_INDEX,
1566
+ inputType: QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_TYPE,
1567
+ inputSize: QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_SIZE,
1568
+ inputFields: QBAY_GET_INFO_OF_COLLECTION_BY_ID_INPUT_FIELDS,
1569
+ outputFields: QBAY_GET_INFO_OF_COLLECTION_BY_ID_OUTPUT_FIELDS,
1570
+ structs: STRUCTS,
1571
+ input: (input as unknown as Record<string, unknown>),
1572
+ ...options,
1573
+ })
1574
+ }
1575
+
1576
+ export const QBAY_GET_INCOMING_AUCTIONS_INPUT_TYPE = 6
1577
+ export const QBAY_GET_INCOMING_AUCTIONS_INPUT_SIZE = 8
1578
+
1579
+ export interface QbayGetIncomingAuctionsInput {
1580
+ offset: number
1581
+ count: number
1582
+ }
1583
+
1584
+ const QBAY_GET_INCOMING_AUCTIONS_INPUT_FIELDS: BinaryField[] = [
1585
+ {
1586
+ name: 'offset',
1587
+ type: 'uint32',
1588
+ offset: 0,
1589
+ byteLength: 4,
1590
+ },
1591
+ {
1592
+ name: 'count',
1593
+ type: 'uint32',
1594
+ offset: 4,
1595
+ byteLength: 4,
1596
+ },
1597
+ ]
1598
+
1599
+ export function buildQbayGetIncomingAuctionsInput(
1600
+ input: QbayGetIncomingAuctionsInput,
1601
+ ): Uint8Array {
1602
+ return buildPayload(QBAY_GET_INCOMING_AUCTIONS_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1603
+ }
1604
+
1605
+ export interface QbayGetIncomingAuctionsOutput {
1606
+ NFTId: number[]
1607
+ }
1608
+
1609
+ const QBAY_GET_INCOMING_AUCTIONS_OUTPUT_FIELDS: BinaryField[] = [
1610
+ {
1611
+ name: 'NFTId',
1612
+ type: 'array',
1613
+ offset: 0,
1614
+ byteLength: 4096,
1615
+ arrayLength: 1024,
1616
+ arrayItemType: 'uint32',
1617
+ arrayItemByteLength: 4,
1618
+ },
1619
+ ]
1620
+
1621
+ export function decodeQbayGetIncomingAuctionsOutput(
1622
+ data: Uint8Array,
1623
+ ): QbayGetIncomingAuctionsOutput {
1624
+ return decodePayload(data, QBAY_GET_INCOMING_AUCTIONS_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayGetIncomingAuctionsOutput
1625
+ }
1626
+
1627
+ export async function qbayGetIncomingAuctions(
1628
+ live: SmartContractCaller,
1629
+ input: QbayGetIncomingAuctionsInput,
1630
+ options?: ContractCallOptions,
1631
+ ): Promise<Result<QbayGetIncomingAuctionsOutput, QubicRpcError>> {
1632
+ return callContractFunction({
1633
+ live,
1634
+ contractIndex: QBAY_CONTRACT_INDEX,
1635
+ inputType: QBAY_GET_INCOMING_AUCTIONS_INPUT_TYPE,
1636
+ inputSize: QBAY_GET_INCOMING_AUCTIONS_INPUT_SIZE,
1637
+ inputFields: QBAY_GET_INCOMING_AUCTIONS_INPUT_FIELDS,
1638
+ outputFields: QBAY_GET_INCOMING_AUCTIONS_OUTPUT_FIELDS,
1639
+ structs: STRUCTS,
1640
+ input: (input as unknown as Record<string, unknown>),
1641
+ ...options,
1642
+ })
1643
+ }
1644
+
1645
+ export const QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_TYPE = 7
1646
+ export const QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_SIZE = 4
1647
+
1648
+ export interface QbayGetInfoOfNFTByIdInput {
1649
+ NFTId: number
1650
+ }
1651
+
1652
+ const QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_FIELDS: BinaryField[] = [
1653
+ {
1654
+ name: 'NFTId',
1655
+ type: 'uint32',
1656
+ offset: 0,
1657
+ byteLength: 4,
1658
+ },
1659
+ ]
1660
+
1661
+ export function buildQbayGetInfoOfNFTByIdInput(
1662
+ input: QbayGetInfoOfNFTByIdInput,
1663
+ ): Uint8Array {
1664
+ return buildPayload(QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, (_: string) => new Uint8Array(32))
1665
+ }
1666
+
1667
+ export interface QbayGetInfoOfNFTByIdOutput {
1668
+ creator: string
1669
+ possessor: string
1670
+ askUser: string
1671
+ creatorOfAuction: string
1672
+ salePrice: bigint
1673
+ askMaxPrice: bigint
1674
+ currentPriceOfAuction: bigint
1675
+ royalty: number
1676
+ NFTidForExchange: number
1677
+ URI: number[]
1678
+ statusOfAuction: number
1679
+ yearAuctionStarted: number
1680
+ monthAuctionStarted: number
1681
+ dayAuctionStarted: number
1682
+ hourAuctionStarted: number
1683
+ minuteAuctionStarted: number
1684
+ secondAuctionStarted: number
1685
+ yearAuctionEnded: number
1686
+ monthAuctionEnded: number
1687
+ dayAuctionEnded: number
1688
+ hourAuctionEnded: number
1689
+ minuteAuctionEnded: number
1690
+ secondAuctionEnded: number
1691
+ statusOfSale: number
1692
+ statusOfAsk: number
1693
+ paymentMethodOfAsk: number
1694
+ statusOfExchange: number
1695
+ paymentMethodOfAuction: number
1696
+ }
1697
+
1698
+ const QBAY_GET_INFO_OF_NFT_BY_ID_OUTPUT_FIELDS: BinaryField[] = [
1699
+ {
1700
+ name: 'creator',
1701
+ type: 'id',
1702
+ offset: 0,
1703
+ byteLength: 32,
1704
+ },
1705
+ {
1706
+ name: 'possessor',
1707
+ type: 'id',
1708
+ offset: 32,
1709
+ byteLength: 32,
1710
+ },
1711
+ {
1712
+ name: 'askUser',
1713
+ type: 'id',
1714
+ offset: 64,
1715
+ byteLength: 32,
1716
+ },
1717
+ {
1718
+ name: 'creatorOfAuction',
1719
+ type: 'id',
1720
+ offset: 96,
1721
+ byteLength: 32,
1722
+ },
1723
+ {
1724
+ name: 'salePrice',
1725
+ type: 'sint64',
1726
+ offset: 128,
1727
+ byteLength: 8,
1728
+ },
1729
+ {
1730
+ name: 'askMaxPrice',
1731
+ type: 'sint64',
1732
+ offset: 136,
1733
+ byteLength: 8,
1734
+ },
1735
+ {
1736
+ name: 'currentPriceOfAuction',
1737
+ type: 'uint64',
1738
+ offset: 144,
1739
+ byteLength: 8,
1740
+ },
1741
+ {
1742
+ name: 'royalty',
1743
+ type: 'uint32',
1744
+ offset: 152,
1745
+ byteLength: 4,
1746
+ },
1747
+ {
1748
+ name: 'NFTidForExchange',
1749
+ type: 'uint32',
1750
+ offset: 156,
1751
+ byteLength: 4,
1752
+ },
1753
+ {
1754
+ name: 'URI',
1755
+ type: 'array',
1756
+ offset: 160,
1757
+ byteLength: 64,
1758
+ arrayLength: 64,
1759
+ arrayItemType: 'uint8',
1760
+ arrayItemByteLength: 1,
1761
+ },
1762
+ {
1763
+ name: 'statusOfAuction',
1764
+ type: 'uint8',
1765
+ offset: 224,
1766
+ byteLength: 1,
1767
+ },
1768
+ {
1769
+ name: 'yearAuctionStarted',
1770
+ type: 'uint8',
1771
+ offset: 225,
1772
+ byteLength: 1,
1773
+ },
1774
+ {
1775
+ name: 'monthAuctionStarted',
1776
+ type: 'uint8',
1777
+ offset: 226,
1778
+ byteLength: 1,
1779
+ },
1780
+ {
1781
+ name: 'dayAuctionStarted',
1782
+ type: 'uint8',
1783
+ offset: 227,
1784
+ byteLength: 1,
1785
+ },
1786
+ {
1787
+ name: 'hourAuctionStarted',
1788
+ type: 'uint8',
1789
+ offset: 228,
1790
+ byteLength: 1,
1791
+ },
1792
+ {
1793
+ name: 'minuteAuctionStarted',
1794
+ type: 'uint8',
1795
+ offset: 229,
1796
+ byteLength: 1,
1797
+ },
1798
+ {
1799
+ name: 'secondAuctionStarted',
1800
+ type: 'uint8',
1801
+ offset: 230,
1802
+ byteLength: 1,
1803
+ },
1804
+ {
1805
+ name: 'yearAuctionEnded',
1806
+ type: 'uint8',
1807
+ offset: 231,
1808
+ byteLength: 1,
1809
+ },
1810
+ {
1811
+ name: 'monthAuctionEnded',
1812
+ type: 'uint8',
1813
+ offset: 232,
1814
+ byteLength: 1,
1815
+ },
1816
+ {
1817
+ name: 'dayAuctionEnded',
1818
+ type: 'uint8',
1819
+ offset: 233,
1820
+ byteLength: 1,
1821
+ },
1822
+ {
1823
+ name: 'hourAuctionEnded',
1824
+ type: 'uint8',
1825
+ offset: 234,
1826
+ byteLength: 1,
1827
+ },
1828
+ {
1829
+ name: 'minuteAuctionEnded',
1830
+ type: 'uint8',
1831
+ offset: 235,
1832
+ byteLength: 1,
1833
+ },
1834
+ {
1835
+ name: 'secondAuctionEnded',
1836
+ type: 'uint8',
1837
+ offset: 236,
1838
+ byteLength: 1,
1839
+ },
1840
+ {
1841
+ name: 'statusOfSale',
1842
+ type: 'uint8',
1843
+ offset: 237,
1844
+ byteLength: 1,
1845
+ },
1846
+ {
1847
+ name: 'statusOfAsk',
1848
+ type: 'uint8',
1849
+ offset: 238,
1850
+ byteLength: 1,
1851
+ },
1852
+ {
1853
+ name: 'paymentMethodOfAsk',
1854
+ type: 'uint8',
1855
+ offset: 239,
1856
+ byteLength: 1,
1857
+ },
1858
+ {
1859
+ name: 'statusOfExchange',
1860
+ type: 'uint8',
1861
+ offset: 240,
1862
+ byteLength: 1,
1863
+ },
1864
+ {
1865
+ name: 'paymentMethodOfAuction',
1866
+ type: 'uint8',
1867
+ offset: 241,
1868
+ byteLength: 1,
1869
+ },
1870
+ ]
1871
+
1872
+ export function decodeQbayGetInfoOfNFTByIdOutput(
1873
+ data: Uint8Array,
1874
+ publicKeyToIdentity: (pk: Uint8Array) => string,
1875
+ ): QbayGetInfoOfNFTByIdOutput {
1876
+ return decodePayload(data, QBAY_GET_INFO_OF_NFT_BY_ID_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity) as unknown as QbayGetInfoOfNFTByIdOutput
1877
+ }
1878
+
1879
+ export async function qbayGetInfoOfNFTById(
1880
+ live: SmartContractCaller,
1881
+ input: QbayGetInfoOfNFTByIdInput,
1882
+ options?: ContractCallOptions,
1883
+ ): Promise<Result<QbayGetInfoOfNFTByIdOutput, QubicRpcError>> {
1884
+ return callContractFunction({
1885
+ live,
1886
+ contractIndex: QBAY_CONTRACT_INDEX,
1887
+ inputType: QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_TYPE,
1888
+ inputSize: QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_SIZE,
1889
+ inputFields: QBAY_GET_INFO_OF_NFT_BY_ID_INPUT_FIELDS,
1890
+ outputFields: QBAY_GET_INFO_OF_NFT_BY_ID_OUTPUT_FIELDS,
1891
+ structs: STRUCTS,
1892
+ input: (input as unknown as Record<string, unknown>),
1893
+ ...options,
1894
+ })
1895
+ }
1896
+
1897
+ export const QBAY_GET_USER_CREATED_COLLECTION_INPUT_TYPE = 8
1898
+ export const QBAY_GET_USER_CREATED_COLLECTION_INPUT_SIZE = 40
1899
+
1900
+ export interface QbayGetUserCreatedCollectionInput {
1901
+ user: string
1902
+ offset: number
1903
+ count: number
1904
+ }
1905
+
1906
+ const QBAY_GET_USER_CREATED_COLLECTION_INPUT_FIELDS: BinaryField[] = [
1907
+ {
1908
+ name: 'user',
1909
+ type: 'id',
1910
+ offset: 0,
1911
+ byteLength: 32,
1912
+ },
1913
+ {
1914
+ name: 'offset',
1915
+ type: 'uint32',
1916
+ offset: 32,
1917
+ byteLength: 4,
1918
+ },
1919
+ {
1920
+ name: 'count',
1921
+ type: 'uint32',
1922
+ offset: 36,
1923
+ byteLength: 4,
1924
+ },
1925
+ ]
1926
+
1927
+ export function buildQbayGetUserCreatedCollectionInput(
1928
+ input: QbayGetUserCreatedCollectionInput,
1929
+ identityToPublicKey: (identity: string) => Uint8Array,
1930
+ ): Uint8Array {
1931
+ return buildPayload(QBAY_GET_USER_CREATED_COLLECTION_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
1932
+ }
1933
+
1934
+ export interface QbayGetUserCreatedCollectionOutput {
1935
+ collectionId: number[]
1936
+ }
1937
+
1938
+ const QBAY_GET_USER_CREATED_COLLECTION_OUTPUT_FIELDS: BinaryField[] = [
1939
+ {
1940
+ name: 'collectionId',
1941
+ type: 'array',
1942
+ offset: 0,
1943
+ byteLength: 4096,
1944
+ arrayLength: 1024,
1945
+ arrayItemType: 'uint32',
1946
+ arrayItemByteLength: 4,
1947
+ },
1948
+ ]
1949
+
1950
+ export function decodeQbayGetUserCreatedCollectionOutput(
1951
+ data: Uint8Array,
1952
+ ): QbayGetUserCreatedCollectionOutput {
1953
+ return decodePayload(data, QBAY_GET_USER_CREATED_COLLECTION_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayGetUserCreatedCollectionOutput
1954
+ }
1955
+
1956
+ export async function qbayGetUserCreatedCollection(
1957
+ live: SmartContractCaller,
1958
+ input: QbayGetUserCreatedCollectionInput,
1959
+ options?: ContractCallOptions,
1960
+ ): Promise<Result<QbayGetUserCreatedCollectionOutput, QubicRpcError>> {
1961
+ return callContractFunction({
1962
+ live,
1963
+ contractIndex: QBAY_CONTRACT_INDEX,
1964
+ inputType: QBAY_GET_USER_CREATED_COLLECTION_INPUT_TYPE,
1965
+ inputSize: QBAY_GET_USER_CREATED_COLLECTION_INPUT_SIZE,
1966
+ inputFields: QBAY_GET_USER_CREATED_COLLECTION_INPUT_FIELDS,
1967
+ outputFields: QBAY_GET_USER_CREATED_COLLECTION_OUTPUT_FIELDS,
1968
+ structs: STRUCTS,
1969
+ input: (input as unknown as Record<string, unknown>),
1970
+ ...options,
1971
+ })
1972
+ }
1973
+
1974
+ export const QBAY_GET_USER_CREATED_NFT_INPUT_TYPE = 9
1975
+ export const QBAY_GET_USER_CREATED_NFT_INPUT_SIZE = 40
1976
+
1977
+ export interface QbayGetUserCreatedNFTInput {
1978
+ user: string
1979
+ offset: number
1980
+ count: number
1981
+ }
1982
+
1983
+ const QBAY_GET_USER_CREATED_NFT_INPUT_FIELDS: BinaryField[] = [
1984
+ {
1985
+ name: 'user',
1986
+ type: 'id',
1987
+ offset: 0,
1988
+ byteLength: 32,
1989
+ },
1990
+ {
1991
+ name: 'offset',
1992
+ type: 'uint32',
1993
+ offset: 32,
1994
+ byteLength: 4,
1995
+ },
1996
+ {
1997
+ name: 'count',
1998
+ type: 'uint32',
1999
+ offset: 36,
2000
+ byteLength: 4,
2001
+ },
2002
+ ]
2003
+
2004
+ export function buildQbayGetUserCreatedNFTInput(
2005
+ input: QbayGetUserCreatedNFTInput,
2006
+ identityToPublicKey: (identity: string) => Uint8Array,
2007
+ ): Uint8Array {
2008
+ return buildPayload(QBAY_GET_USER_CREATED_NFT_INPUT_FIELDS, STRUCTS, input as unknown as Record<string, FieldValue | Uint8Array>, identityToPublicKey)
2009
+ }
2010
+
2011
+ export interface QbayGetUserCreatedNFTOutput {
2012
+ NFTId: number[]
2013
+ }
2014
+
2015
+ const QBAY_GET_USER_CREATED_NFT_OUTPUT_FIELDS: BinaryField[] = [
2016
+ {
2017
+ name: 'NFTId',
2018
+ type: 'array',
2019
+ offset: 0,
2020
+ byteLength: 4096,
2021
+ arrayLength: 1024,
2022
+ arrayItemType: 'uint32',
2023
+ arrayItemByteLength: 4,
2024
+ },
2025
+ ]
2026
+
2027
+ export function decodeQbayGetUserCreatedNFTOutput(
2028
+ data: Uint8Array,
2029
+ ): QbayGetUserCreatedNFTOutput {
2030
+ return decodePayload(data, QBAY_GET_USER_CREATED_NFT_OUTPUT_FIELDS, STRUCTS, (_: Uint8Array) => { throw new Error('unreachable') }) as unknown as QbayGetUserCreatedNFTOutput
2031
+ }
2032
+
2033
+ export async function qbayGetUserCreatedNFT(
2034
+ live: SmartContractCaller,
2035
+ input: QbayGetUserCreatedNFTInput,
2036
+ options?: ContractCallOptions,
2037
+ ): Promise<Result<QbayGetUserCreatedNFTOutput, QubicRpcError>> {
2038
+ return callContractFunction({
2039
+ live,
2040
+ contractIndex: QBAY_CONTRACT_INDEX,
2041
+ inputType: QBAY_GET_USER_CREATED_NFT_INPUT_TYPE,
2042
+ inputSize: QBAY_GET_USER_CREATED_NFT_INPUT_SIZE,
2043
+ inputFields: QBAY_GET_USER_CREATED_NFT_INPUT_FIELDS,
2044
+ outputFields: QBAY_GET_USER_CREATED_NFT_OUTPUT_FIELDS,
2045
+ structs: STRUCTS,
2046
+ input: (input as unknown as Record<string, unknown>),
2047
+ ...options,
2048
+ })
2049
+ }
2050
+
2051
+ export const qbay = {
2052
+ contractIndex: QBAY_CONTRACT_INDEX,
2053
+ getNumberOfNFTForUser: qbayGetNumberOfNFTForUser,
2054
+ getInfoOfNFTUserPossessed: qbayGetInfoOfNFTUserPossessed,
2055
+ getInfoOfMarketplace: qbayGetInfoOfMarketplace,
2056
+ getInfoOfCollectionByCreator: qbayGetInfoOfCollectionByCreator,
2057
+ getInfoOfCollectionById: qbayGetInfoOfCollectionById,
2058
+ getIncomingAuctions: qbayGetIncomingAuctions,
2059
+ getInfoOfNFTById: qbayGetInfoOfNFTById,
2060
+ getUserCreatedCollection: qbayGetUserCreatedCollection,
2061
+ getUserCreatedNFT: qbayGetUserCreatedNFT,
2062
+ buildSettingCFBAndQubicPriceInput: buildQbaySettingCFBAndQubicPriceInput,
2063
+ decodeSettingCFBAndQubicPriceOutput: decodeQbaySettingCFBAndQubicPriceOutput,
2064
+ buildCreateCollectionInput: buildQbayCreateCollectionInput,
2065
+ decodeCreateCollectionOutput: decodeQbayCreateCollectionOutput,
2066
+ buildMintInput: buildQbayMintInput,
2067
+ decodeMintOutput: decodeQbayMintOutput,
2068
+ buildMintOfDropInput: buildQbayMintOfDropInput,
2069
+ decodeMintOfDropOutput: decodeQbayMintOfDropOutput,
2070
+ buildTransferInput: buildQbayTransferInput,
2071
+ decodeTransferOutput: decodeQbayTransferOutput,
2072
+ buildListInMarketInput: buildQbayListInMarketInput,
2073
+ decodeListInMarketOutput: decodeQbayListInMarketOutput,
2074
+ buildBuyInput: buildQbayBuyInput,
2075
+ decodeBuyOutput: decodeQbayBuyOutput,
2076
+ buildCancelSaleInput: buildQbayCancelSaleInput,
2077
+ decodeCancelSaleOutput: decodeQbayCancelSaleOutput,
2078
+ buildListInExchangeInput: buildQbayListInExchangeInput,
2079
+ decodeListInExchangeOutput: decodeQbayListInExchangeOutput,
2080
+ buildCancelExchangeInput: buildQbayCancelExchangeInput,
2081
+ decodeCancelExchangeOutput: decodeQbayCancelExchangeOutput,
2082
+ buildMakeOfferInput: buildQbayMakeOfferInput,
2083
+ decodeMakeOfferOutput: decodeQbayMakeOfferOutput,
2084
+ buildAcceptOfferInput: buildQbayAcceptOfferInput,
2085
+ decodeAcceptOfferOutput: decodeQbayAcceptOfferOutput,
2086
+ buildCancelOfferInput: buildQbayCancelOfferInput,
2087
+ decodeCancelOfferOutput: decodeQbayCancelOfferOutput,
2088
+ buildCreateTraditionalAuctionInput: buildQbayCreateTraditionalAuctionInput,
2089
+ decodeCreateTraditionalAuctionOutput: decodeQbayCreateTraditionalAuctionOutput,
2090
+ buildBidOnTraditionalAuctionInput: buildQbayBidOnTraditionalAuctionInput,
2091
+ decodeBidOnTraditionalAuctionOutput: decodeQbayBidOnTraditionalAuctionOutput,
2092
+ buildTransferShareManagementRightsInput: buildQbayTransferShareManagementRightsInput,
2093
+ decodeTransferShareManagementRightsOutput: decodeQbayTransferShareManagementRightsOutput,
2094
+ buildChangeStatusOfMarketPlaceInput: buildQbayChangeStatusOfMarketPlaceInput,
2095
+ decodeChangeStatusOfMarketPlaceOutput: decodeQbayChangeStatusOfMarketPlaceOutput,
2096
+ }
2097
+