naracli 0.1.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.
@@ -0,0 +1,540 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/nara_quest.json`.
6
+ */
7
+ export type NaraQuest = {
8
+ "address": "EXPLAHaMHLK9p7w5jVqEVY671NkkCKSHTNhhyUrPAboZ",
9
+ "metadata": {
10
+ "name": "naraQuest",
11
+ "version": "0.1.0",
12
+ "spec": "0.1.0",
13
+ "description": "Created with Anchor"
14
+ },
15
+ "instructions": [
16
+ {
17
+ "name": "createQuestion",
18
+ "discriminator": [
19
+ 222,
20
+ 74,
21
+ 49,
22
+ 30,
23
+ 160,
24
+ 220,
25
+ 179,
26
+ 27
27
+ ],
28
+ "accounts": [
29
+ {
30
+ "name": "gameConfig",
31
+ "writable": true,
32
+ "pda": {
33
+ "seeds": [
34
+ {
35
+ "kind": "const",
36
+ "value": [
37
+ 103,
38
+ 97,
39
+ 109,
40
+ 101,
41
+ 95,
42
+ 99,
43
+ 111,
44
+ 110,
45
+ 102,
46
+ 105,
47
+ 103
48
+ ]
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ {
54
+ "name": "pool",
55
+ "writable": true,
56
+ "pda": {
57
+ "seeds": [
58
+ {
59
+ "kind": "const",
60
+ "value": [
61
+ 112,
62
+ 111,
63
+ 111,
64
+ 108
65
+ ]
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "name": "vault",
72
+ "writable": true,
73
+ "pda": {
74
+ "seeds": [
75
+ {
76
+ "kind": "const",
77
+ "value": [
78
+ 118,
79
+ 97,
80
+ 117,
81
+ 108,
82
+ 116
83
+ ]
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "name": "authority",
90
+ "writable": true,
91
+ "signer": true
92
+ },
93
+ {
94
+ "name": "systemProgram",
95
+ "address": "11111111111111111111111111111111"
96
+ }
97
+ ],
98
+ "args": [
99
+ {
100
+ "name": "question",
101
+ "type": "string"
102
+ },
103
+ {
104
+ "name": "answerHash",
105
+ "type": {
106
+ "array": [
107
+ "u8",
108
+ 32
109
+ ]
110
+ }
111
+ },
112
+ {
113
+ "name": "deadline",
114
+ "type": "i64"
115
+ },
116
+ {
117
+ "name": "rewardAmount",
118
+ "type": "u64"
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ "name": "initialize",
124
+ "discriminator": [
125
+ 175,
126
+ 175,
127
+ 109,
128
+ 31,
129
+ 13,
130
+ 152,
131
+ 155,
132
+ 237
133
+ ],
134
+ "accounts": [
135
+ {
136
+ "name": "gameConfig",
137
+ "writable": true,
138
+ "pda": {
139
+ "seeds": [
140
+ {
141
+ "kind": "const",
142
+ "value": [
143
+ 103,
144
+ 97,
145
+ 109,
146
+ 101,
147
+ 95,
148
+ 99,
149
+ 111,
150
+ 110,
151
+ 102,
152
+ 105,
153
+ 103
154
+ ]
155
+ }
156
+ ]
157
+ }
158
+ },
159
+ {
160
+ "name": "pool",
161
+ "writable": true,
162
+ "pda": {
163
+ "seeds": [
164
+ {
165
+ "kind": "const",
166
+ "value": [
167
+ 112,
168
+ 111,
169
+ 111,
170
+ 108
171
+ ]
172
+ }
173
+ ]
174
+ }
175
+ },
176
+ {
177
+ "name": "authority",
178
+ "writable": true,
179
+ "signer": true
180
+ },
181
+ {
182
+ "name": "systemProgram",
183
+ "address": "11111111111111111111111111111111"
184
+ }
185
+ ],
186
+ "args": []
187
+ },
188
+ {
189
+ "name": "submitAnswer",
190
+ "discriminator": [
191
+ 221,
192
+ 73,
193
+ 184,
194
+ 157,
195
+ 1,
196
+ 150,
197
+ 231,
198
+ 48
199
+ ],
200
+ "accounts": [
201
+ {
202
+ "name": "pool",
203
+ "writable": true,
204
+ "pda": {
205
+ "seeds": [
206
+ {
207
+ "kind": "const",
208
+ "value": [
209
+ 112,
210
+ 111,
211
+ 111,
212
+ 108
213
+ ]
214
+ }
215
+ ]
216
+ }
217
+ },
218
+ {
219
+ "name": "winnerRecord",
220
+ "writable": true,
221
+ "pda": {
222
+ "seeds": [
223
+ {
224
+ "kind": "const",
225
+ "value": [
226
+ 119,
227
+ 105,
228
+ 110,
229
+ 110,
230
+ 101,
231
+ 114
232
+ ]
233
+ },
234
+ {
235
+ "kind": "account",
236
+ "path": "user"
237
+ }
238
+ ]
239
+ }
240
+ },
241
+ {
242
+ "name": "vault",
243
+ "writable": true,
244
+ "pda": {
245
+ "seeds": [
246
+ {
247
+ "kind": "const",
248
+ "value": [
249
+ 118,
250
+ 97,
251
+ 117,
252
+ 108,
253
+ 116
254
+ ]
255
+ }
256
+ ]
257
+ }
258
+ },
259
+ {
260
+ "name": "user",
261
+ "writable": true
262
+ },
263
+ {
264
+ "name": "payer",
265
+ "writable": true,
266
+ "signer": true
267
+ },
268
+ {
269
+ "name": "systemProgram",
270
+ "address": "11111111111111111111111111111111"
271
+ }
272
+ ],
273
+ "args": [
274
+ {
275
+ "name": "proofA",
276
+ "type": {
277
+ "array": [
278
+ "u8",
279
+ 64
280
+ ]
281
+ }
282
+ },
283
+ {
284
+ "name": "proofB",
285
+ "type": {
286
+ "array": [
287
+ "u8",
288
+ 128
289
+ ]
290
+ }
291
+ },
292
+ {
293
+ "name": "proofC",
294
+ "type": {
295
+ "array": [
296
+ "u8",
297
+ 64
298
+ ]
299
+ }
300
+ }
301
+ ]
302
+ },
303
+ {
304
+ "name": "transferAuthority",
305
+ "discriminator": [
306
+ 48,
307
+ 169,
308
+ 76,
309
+ 72,
310
+ 229,
311
+ 180,
312
+ 55,
313
+ 161
314
+ ],
315
+ "accounts": [
316
+ {
317
+ "name": "gameConfig",
318
+ "writable": true,
319
+ "pda": {
320
+ "seeds": [
321
+ {
322
+ "kind": "const",
323
+ "value": [
324
+ 103,
325
+ 97,
326
+ 109,
327
+ 101,
328
+ 95,
329
+ 99,
330
+ 111,
331
+ 110,
332
+ 102,
333
+ 105,
334
+ 103
335
+ ]
336
+ }
337
+ ]
338
+ }
339
+ },
340
+ {
341
+ "name": "authority",
342
+ "signer": true
343
+ }
344
+ ],
345
+ "args": [
346
+ {
347
+ "name": "newAuthority",
348
+ "type": "pubkey"
349
+ }
350
+ ]
351
+ }
352
+ ],
353
+ "accounts": [
354
+ {
355
+ "name": "gameConfig",
356
+ "discriminator": [
357
+ 45,
358
+ 146,
359
+ 146,
360
+ 33,
361
+ 170,
362
+ 69,
363
+ 96,
364
+ 133
365
+ ]
366
+ },
367
+ {
368
+ "name": "pool",
369
+ "discriminator": [
370
+ 241,
371
+ 154,
372
+ 109,
373
+ 4,
374
+ 17,
375
+ 177,
376
+ 109,
377
+ 188
378
+ ]
379
+ },
380
+ {
381
+ "name": "winnerRecord",
382
+ "discriminator": [
383
+ 248,
384
+ 27,
385
+ 49,
386
+ 33,
387
+ 45,
388
+ 88,
389
+ 210,
390
+ 100
391
+ ]
392
+ }
393
+ ],
394
+ "errors": [
395
+ {
396
+ "code": 6000,
397
+ "name": "unauthorized",
398
+ "msg": "Only the authority can perform this action"
399
+ },
400
+ {
401
+ "code": 6001,
402
+ "name": "poolNotActive",
403
+ "msg": "Pool has no active question"
404
+ },
405
+ {
406
+ "code": 6002,
407
+ "name": "deadlineExpired",
408
+ "msg": "The deadline for this question has passed"
409
+ },
410
+ {
411
+ "code": 6003,
412
+ "name": "invalidProof",
413
+ "msg": "ZK proof verification failed"
414
+ },
415
+ {
416
+ "code": 6004,
417
+ "name": "invalidDeadline",
418
+ "msg": "Deadline must be in the future"
419
+ },
420
+ {
421
+ "code": 6005,
422
+ "name": "insufficientReward",
423
+ "msg": "Reward amount must be greater than zero"
424
+ },
425
+ {
426
+ "code": 6006,
427
+ "name": "insufficientPoolBalance",
428
+ "msg": "Pool balance insufficient for reward transfer"
429
+ },
430
+ {
431
+ "code": 6007,
432
+ "name": "questionTooLong",
433
+ "msg": "Question exceeds maximum length"
434
+ },
435
+ {
436
+ "code": 6008,
437
+ "name": "alreadyAnswered",
438
+ "msg": "Already answered this round"
439
+ }
440
+ ],
441
+ "types": [
442
+ {
443
+ "name": "gameConfig",
444
+ "type": {
445
+ "kind": "struct",
446
+ "fields": [
447
+ {
448
+ "name": "authority",
449
+ "type": "pubkey"
450
+ },
451
+ {
452
+ "name": "nextQuestionId",
453
+ "type": "u64"
454
+ },
455
+ {
456
+ "name": "bump",
457
+ "type": "u8"
458
+ }
459
+ ]
460
+ }
461
+ },
462
+ {
463
+ "name": "pool",
464
+ "type": {
465
+ "kind": "struct",
466
+ "fields": [
467
+ {
468
+ "name": "round",
469
+ "type": "u64"
470
+ },
471
+ {
472
+ "name": "questionId",
473
+ "type": "u64"
474
+ },
475
+ {
476
+ "name": "question",
477
+ "type": "string"
478
+ },
479
+ {
480
+ "name": "answerHash",
481
+ "type": {
482
+ "array": [
483
+ "u8",
484
+ 32
485
+ ]
486
+ }
487
+ },
488
+ {
489
+ "name": "deadline",
490
+ "type": "i64"
491
+ },
492
+ {
493
+ "name": "rewardAmount",
494
+ "type": "u64"
495
+ },
496
+ {
497
+ "name": "rewardCount",
498
+ "type": "u32"
499
+ },
500
+ {
501
+ "name": "rewardPerWinner",
502
+ "type": "u64"
503
+ },
504
+ {
505
+ "name": "winnerCount",
506
+ "type": "u32"
507
+ },
508
+ {
509
+ "name": "isActive",
510
+ "type": "bool"
511
+ },
512
+ {
513
+ "name": "bump",
514
+ "type": "u8"
515
+ }
516
+ ]
517
+ }
518
+ },
519
+ {
520
+ "name": "winnerRecord",
521
+ "type": {
522
+ "kind": "struct",
523
+ "fields": [
524
+ {
525
+ "name": "bump",
526
+ "type": "u8"
527
+ },
528
+ {
529
+ "name": "round",
530
+ "type": "u64"
531
+ },
532
+ {
533
+ "name": "rewarded",
534
+ "type": "bool"
535
+ }
536
+ ]
537
+ }
538
+ }
539
+ ]
540
+ };