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