@theliem/xmarket-sdk 1.0.12

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,1465 @@
1
+ {
2
+ "address": "FCvCbWoLpzNYKzQnXYXCo1yz9DTpgUs11QqHVqnqtWhA",
3
+ "metadata": {
4
+ "name": "question_market",
5
+ "version": "0.1.0",
6
+ "spec": "0.1.0",
7
+ "description": "Question Market program for XMarket prediction platform"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "add_admin",
12
+ "docs": [
13
+ "Set the admin (owner only). Replaces any existing admin."
14
+ ],
15
+ "discriminator": [
16
+ 177,
17
+ 236,
18
+ 33,
19
+ 205,
20
+ 124,
21
+ 152,
22
+ 55,
23
+ 186
24
+ ],
25
+ "accounts": [
26
+ {
27
+ "name": "owner",
28
+ "docs": [
29
+ "Must be the current owner"
30
+ ],
31
+ "signer": true
32
+ },
33
+ {
34
+ "name": "config",
35
+ "writable": true,
36
+ "pda": {
37
+ "seeds": [
38
+ {
39
+ "kind": "const",
40
+ "value": [
41
+ 99,
42
+ 111,
43
+ 110,
44
+ 102,
45
+ 105,
46
+ 103
47
+ ]
48
+ },
49
+ {
50
+ "kind": "account",
51
+ "path": "config.owner",
52
+ "account": "QuestionMarketConfig"
53
+ }
54
+ ]
55
+ }
56
+ }
57
+ ],
58
+ "args": [
59
+ {
60
+ "name": "new_admin",
61
+ "type": "pubkey"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "name": "add_to_whitelist",
67
+ "docs": [
68
+ "Add an address to the question market whitelist (admin only)."
69
+ ],
70
+ "discriminator": [
71
+ 157,
72
+ 211,
73
+ 52,
74
+ 54,
75
+ 144,
76
+ 81,
77
+ 5,
78
+ 55
79
+ ],
80
+ "accounts": [
81
+ {
82
+ "name": "authority",
83
+ "signer": true
84
+ },
85
+ {
86
+ "name": "payer",
87
+ "writable": true,
88
+ "signer": true
89
+ },
90
+ {
91
+ "name": "config",
92
+ "writable": true,
93
+ "pda": {
94
+ "seeds": [
95
+ {
96
+ "kind": "const",
97
+ "value": [
98
+ 99,
99
+ 111,
100
+ 110,
101
+ 102,
102
+ 105,
103
+ 103
104
+ ]
105
+ },
106
+ {
107
+ "kind": "account",
108
+ "path": "config.owner",
109
+ "account": "QuestionMarketConfig"
110
+ }
111
+ ]
112
+ }
113
+ }
114
+ ],
115
+ "args": [
116
+ {
117
+ "name": "address",
118
+ "type": "pubkey"
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ "name": "approve_question",
124
+ "docs": [
125
+ "Approve a pending question submitted via create_question_with_condition."
126
+ ],
127
+ "discriminator": [
128
+ 54,
129
+ 149,
130
+ 87,
131
+ 172,
132
+ 67,
133
+ 162,
134
+ 36,
135
+ 108
136
+ ],
137
+ "accounts": [
138
+ {
139
+ "name": "admin",
140
+ "docs": [
141
+ "Admin approving the market"
142
+ ],
143
+ "signer": true
144
+ },
145
+ {
146
+ "name": "payer",
147
+ "writable": true,
148
+ "signer": true
149
+ },
150
+ {
151
+ "name": "config",
152
+ "docs": [
153
+ "Question Market config"
154
+ ],
155
+ "writable": true,
156
+ "pda": {
157
+ "seeds": [
158
+ {
159
+ "kind": "const",
160
+ "value": [
161
+ 99,
162
+ 111,
163
+ 110,
164
+ 102,
165
+ 105,
166
+ 103
167
+ ]
168
+ },
169
+ {
170
+ "kind": "account",
171
+ "path": "config.owner",
172
+ "account": "QuestionMarketConfig"
173
+ }
174
+ ]
175
+ }
176
+ },
177
+ {
178
+ "name": "question",
179
+ "docs": [
180
+ "Question to approve (must have condition already set)"
181
+ ],
182
+ "writable": true
183
+ }
184
+ ],
185
+ "args": []
186
+ },
187
+ {
188
+ "name": "create_question_admin",
189
+ "docs": [
190
+ "Whitelist-only — matches EVM createQuestionAdmin.",
191
+ "Atomically creates Question + CTF condition + YES/NO mints. Status = Approved immediately."
192
+ ],
193
+ "discriminator": [
194
+ 166,
195
+ 168,
196
+ 104,
197
+ 144,
198
+ 72,
199
+ 150,
200
+ 213,
201
+ 4
202
+ ],
203
+ "accounts": [
204
+ {
205
+ "name": "creator",
206
+ "docs": [
207
+ "Whitelisted creator (must be in config.whitelist or be admin/owner)"
208
+ ],
209
+ "signer": true
210
+ },
211
+ {
212
+ "name": "payer",
213
+ "docs": [
214
+ "Fee payer — can differ from creator (e.g. BE wallet pays rent)"
215
+ ],
216
+ "writable": true,
217
+ "signer": true
218
+ },
219
+ {
220
+ "name": "config",
221
+ "docs": [
222
+ "QuestionMarket config"
223
+ ],
224
+ "writable": true,
225
+ "pda": {
226
+ "seeds": [
227
+ {
228
+ "kind": "const",
229
+ "value": [
230
+ 99,
231
+ 111,
232
+ 110,
233
+ 102,
234
+ 105,
235
+ 103
236
+ ]
237
+ },
238
+ {
239
+ "kind": "account",
240
+ "path": "config.owner",
241
+ "account": "QuestionMarketConfig"
242
+ }
243
+ ]
244
+ }
245
+ },
246
+ {
247
+ "name": "question",
248
+ "docs": [
249
+ "Question PDA"
250
+ ],
251
+ "writable": true
252
+ },
253
+ {
254
+ "name": "currency_mint",
255
+ "docs": [
256
+ "Collateral mint (USDC)"
257
+ ]
258
+ },
259
+ {
260
+ "name": "oracle",
261
+ "docs": [
262
+ "Oracle config pubkey"
263
+ ]
264
+ },
265
+ {
266
+ "name": "condition",
267
+ "writable": true
268
+ },
269
+ {
270
+ "name": "yes_mint",
271
+ "writable": true
272
+ },
273
+ {
274
+ "name": "no_mint",
275
+ "writable": true
276
+ },
277
+ {
278
+ "name": "mint_authority",
279
+ "writable": true
280
+ },
281
+ {
282
+ "name": "collateral_vault",
283
+ "writable": true
284
+ },
285
+ {
286
+ "name": "conditional_tokens_program"
287
+ },
288
+ {
289
+ "name": "token_program",
290
+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
291
+ },
292
+ {
293
+ "name": "system_program",
294
+ "address": "11111111111111111111111111111111"
295
+ },
296
+ {
297
+ "name": "rent",
298
+ "address": "SysvarRent111111111111111111111111111111111"
299
+ }
300
+ ],
301
+ "args": [
302
+ {
303
+ "name": "params",
304
+ "type": {
305
+ "defined": {
306
+ "name": "CreateQuestionAdminParams"
307
+ }
308
+ }
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ "name": "create_question_with_condition",
314
+ "docs": [
315
+ "User proposal path (future use) — creates Question in Pending state.",
316
+ "Requires admin approval via approve_question before trading."
317
+ ],
318
+ "discriminator": [
319
+ 155,
320
+ 70,
321
+ 42,
322
+ 101,
323
+ 35,
324
+ 123,
325
+ 180,
326
+ 92
327
+ ],
328
+ "accounts": [
329
+ {
330
+ "name": "payer",
331
+ "docs": [
332
+ "Fee payer — pays rent for all new accounts (can differ from creator)"
333
+ ],
334
+ "writable": true,
335
+ "signer": true
336
+ },
337
+ {
338
+ "name": "creator",
339
+ "docs": [
340
+ "Creator of the question (identity only, does not pay)"
341
+ ],
342
+ "signer": true
343
+ },
344
+ {
345
+ "name": "config",
346
+ "docs": [
347
+ "QuestionMarket config"
348
+ ],
349
+ "writable": true,
350
+ "pda": {
351
+ "seeds": [
352
+ {
353
+ "kind": "const",
354
+ "value": [
355
+ 99,
356
+ 111,
357
+ 110,
358
+ 102,
359
+ 105,
360
+ 103
361
+ ]
362
+ },
363
+ {
364
+ "kind": "account",
365
+ "path": "config.owner",
366
+ "account": "QuestionMarketConfig"
367
+ }
368
+ ]
369
+ }
370
+ },
371
+ {
372
+ "name": "question",
373
+ "docs": [
374
+ "Question PDA"
375
+ ],
376
+ "writable": true
377
+ },
378
+ {
379
+ "name": "currency_mint",
380
+ "docs": [
381
+ "Collateral mint (USDC)"
382
+ ]
383
+ },
384
+ {
385
+ "name": "oracle",
386
+ "docs": [
387
+ "Oracle config pubkey (used as oracle identifier in the condition)"
388
+ ]
389
+ },
390
+ {
391
+ "name": "condition",
392
+ "docs": [
393
+ "The Condition PDA that CTF will create"
394
+ ],
395
+ "writable": true
396
+ },
397
+ {
398
+ "name": "yes_mint",
399
+ "docs": [
400
+ "YES Token-2022 mint (created by CTF)"
401
+ ],
402
+ "writable": true
403
+ },
404
+ {
405
+ "name": "no_mint",
406
+ "docs": [
407
+ "NO Token-2022 mint (created by CTF)"
408
+ ],
409
+ "writable": true
410
+ },
411
+ {
412
+ "name": "mint_authority",
413
+ "docs": [
414
+ "Mint authority PDA in CTF"
415
+ ],
416
+ "writable": true
417
+ },
418
+ {
419
+ "name": "collateral_vault",
420
+ "docs": [
421
+ "Shared collateral vault (must exist)"
422
+ ],
423
+ "writable": true
424
+ },
425
+ {
426
+ "name": "conditional_tokens_program",
427
+ "docs": [
428
+ "ConditionalTokens program"
429
+ ]
430
+ },
431
+ {
432
+ "name": "token_program",
433
+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
434
+ },
435
+ {
436
+ "name": "system_program",
437
+ "address": "11111111111111111111111111111111"
438
+ },
439
+ {
440
+ "name": "rent",
441
+ "address": "SysvarRent111111111111111111111111111111111"
442
+ }
443
+ ],
444
+ "args": [
445
+ {
446
+ "name": "params",
447
+ "type": {
448
+ "defined": {
449
+ "name": "CreateQuestionWithConditionParams"
450
+ }
451
+ }
452
+ }
453
+ ]
454
+ },
455
+ {
456
+ "name": "initialize",
457
+ "docs": [
458
+ "Initialize the Question Market config. Caller becomes owner and is auto-whitelisted."
459
+ ],
460
+ "discriminator": [
461
+ 175,
462
+ 175,
463
+ 109,
464
+ 31,
465
+ 13,
466
+ 152,
467
+ 155,
468
+ 237
469
+ ],
470
+ "accounts": [
471
+ {
472
+ "name": "owner",
473
+ "docs": [
474
+ "Owner initializing the config"
475
+ ],
476
+ "writable": true,
477
+ "signer": true
478
+ },
479
+ {
480
+ "name": "config",
481
+ "docs": [
482
+ "The config account (PDA)"
483
+ ],
484
+ "writable": true,
485
+ "pda": {
486
+ "seeds": [
487
+ {
488
+ "kind": "const",
489
+ "value": [
490
+ 99,
491
+ 111,
492
+ 110,
493
+ 102,
494
+ 105,
495
+ 103
496
+ ]
497
+ },
498
+ {
499
+ "kind": "account",
500
+ "path": "owner"
501
+ }
502
+ ]
503
+ }
504
+ },
505
+ {
506
+ "name": "system_program",
507
+ "address": "11111111111111111111111111111111"
508
+ }
509
+ ],
510
+ "args": [
511
+ {
512
+ "name": "params",
513
+ "type": {
514
+ "defined": {
515
+ "name": "InitializeParams"
516
+ }
517
+ }
518
+ }
519
+ ]
520
+ },
521
+ {
522
+ "name": "remove_admin",
523
+ "docs": [
524
+ "Clear the admin (owner only). Sets admin to default pubkey."
525
+ ],
526
+ "discriminator": [
527
+ 74,
528
+ 202,
529
+ 71,
530
+ 106,
531
+ 252,
532
+ 31,
533
+ 72,
534
+ 183
535
+ ],
536
+ "accounts": [
537
+ {
538
+ "name": "owner",
539
+ "docs": [
540
+ "Must be the current owner"
541
+ ],
542
+ "signer": true
543
+ },
544
+ {
545
+ "name": "config",
546
+ "writable": true,
547
+ "pda": {
548
+ "seeds": [
549
+ {
550
+ "kind": "const",
551
+ "value": [
552
+ 99,
553
+ 111,
554
+ 110,
555
+ 102,
556
+ 105,
557
+ 103
558
+ ]
559
+ },
560
+ {
561
+ "kind": "account",
562
+ "path": "config.owner",
563
+ "account": "QuestionMarketConfig"
564
+ }
565
+ ]
566
+ }
567
+ }
568
+ ],
569
+ "args": []
570
+ },
571
+ {
572
+ "name": "remove_from_whitelist",
573
+ "docs": [
574
+ "Remove an address from the question market whitelist (admin only)."
575
+ ],
576
+ "discriminator": [
577
+ 7,
578
+ 144,
579
+ 216,
580
+ 239,
581
+ 243,
582
+ 236,
583
+ 193,
584
+ 235
585
+ ],
586
+ "accounts": [
587
+ {
588
+ "name": "authority",
589
+ "signer": true
590
+ },
591
+ {
592
+ "name": "payer",
593
+ "writable": true,
594
+ "signer": true
595
+ },
596
+ {
597
+ "name": "config",
598
+ "writable": true,
599
+ "pda": {
600
+ "seeds": [
601
+ {
602
+ "kind": "const",
603
+ "value": [
604
+ 99,
605
+ 111,
606
+ 110,
607
+ 102,
608
+ 105,
609
+ 103
610
+ ]
611
+ },
612
+ {
613
+ "kind": "account",
614
+ "path": "config.owner",
615
+ "account": "QuestionMarketConfig"
616
+ }
617
+ ]
618
+ }
619
+ }
620
+ ],
621
+ "args": [
622
+ {
623
+ "name": "address",
624
+ "type": "pubkey"
625
+ }
626
+ ]
627
+ },
628
+ {
629
+ "name": "update_config",
630
+ "docs": [
631
+ "Update config settings (admin/owner)."
632
+ ],
633
+ "discriminator": [
634
+ 29,
635
+ 158,
636
+ 252,
637
+ 191,
638
+ 10,
639
+ 83,
640
+ 219,
641
+ 99
642
+ ],
643
+ "accounts": [
644
+ {
645
+ "name": "authority",
646
+ "docs": [
647
+ "Authority making the update (owner for ownership transfer, admin/owner for other updates)"
648
+ ],
649
+ "signer": true
650
+ },
651
+ {
652
+ "name": "payer",
653
+ "writable": true,
654
+ "signer": true
655
+ },
656
+ {
657
+ "name": "config",
658
+ "docs": [
659
+ "Question Market config"
660
+ ],
661
+ "writable": true,
662
+ "pda": {
663
+ "seeds": [
664
+ {
665
+ "kind": "const",
666
+ "value": [
667
+ 99,
668
+ 111,
669
+ 110,
670
+ 102,
671
+ 105,
672
+ 103
673
+ ]
674
+ },
675
+ {
676
+ "kind": "account",
677
+ "path": "config.owner",
678
+ "account": "QuestionMarketConfig"
679
+ }
680
+ ]
681
+ }
682
+ }
683
+ ],
684
+ "args": [
685
+ {
686
+ "name": "params",
687
+ "type": {
688
+ "defined": {
689
+ "name": "UpdateConfigParams"
690
+ }
691
+ }
692
+ }
693
+ ]
694
+ }
695
+ ],
696
+ "accounts": [
697
+ {
698
+ "name": "Question",
699
+ "discriminator": [
700
+ 111,
701
+ 22,
702
+ 150,
703
+ 220,
704
+ 181,
705
+ 122,
706
+ 118,
707
+ 127
708
+ ]
709
+ },
710
+ {
711
+ "name": "QuestionMarketConfig",
712
+ "discriminator": [
713
+ 45,
714
+ 242,
715
+ 195,
716
+ 220,
717
+ 120,
718
+ 252,
719
+ 74,
720
+ 213
721
+ ]
722
+ }
723
+ ],
724
+ "events": [
725
+ {
726
+ "name": "ConfigUpdated",
727
+ "discriminator": [
728
+ 40,
729
+ 241,
730
+ 230,
731
+ 122,
732
+ 11,
733
+ 19,
734
+ 198,
735
+ 194
736
+ ]
737
+ },
738
+ {
739
+ "name": "QuestionAdminCreated",
740
+ "discriminator": [
741
+ 55,
742
+ 250,
743
+ 212,
744
+ 57,
745
+ 174,
746
+ 201,
747
+ 226,
748
+ 158
749
+ ]
750
+ },
751
+ {
752
+ "name": "QuestionApproved",
753
+ "discriminator": [
754
+ 252,
755
+ 132,
756
+ 245,
757
+ 66,
758
+ 7,
759
+ 1,
760
+ 41,
761
+ 211
762
+ ]
763
+ },
764
+ {
765
+ "name": "QuestionCreatedWithCondition",
766
+ "discriminator": [
767
+ 70,
768
+ 243,
769
+ 29,
770
+ 212,
771
+ 242,
772
+ 162,
773
+ 132,
774
+ 234
775
+ ]
776
+ },
777
+ {
778
+ "name": "QuestionMarketInitialized",
779
+ "discriminator": [
780
+ 149,
781
+ 192,
782
+ 87,
783
+ 33,
784
+ 81,
785
+ 246,
786
+ 25,
787
+ 59
788
+ ]
789
+ },
790
+ {
791
+ "name": "QuestionMarketWhitelistUpdated",
792
+ "discriminator": [
793
+ 188,
794
+ 209,
795
+ 117,
796
+ 146,
797
+ 229,
798
+ 12,
799
+ 227,
800
+ 42
801
+ ]
802
+ }
803
+ ],
804
+ "types": [
805
+ {
806
+ "name": "ConfigUpdated",
807
+ "type": {
808
+ "kind": "struct",
809
+ "fields": [
810
+ {
811
+ "name": "config",
812
+ "type": "pubkey"
813
+ },
814
+ {
815
+ "name": "updated_by",
816
+ "type": "pubkey"
817
+ },
818
+ {
819
+ "name": "new_admin",
820
+ "type": {
821
+ "option": "pubkey"
822
+ }
823
+ },
824
+ {
825
+ "name": "new_oracle",
826
+ "type": {
827
+ "option": "pubkey"
828
+ }
829
+ },
830
+ {
831
+ "name": "is_paused",
832
+ "type": {
833
+ "option": "bool"
834
+ }
835
+ },
836
+ {
837
+ "name": "new_conditional_tokens_program",
838
+ "type": {
839
+ "option": "pubkey"
840
+ }
841
+ }
842
+ ]
843
+ }
844
+ },
845
+ {
846
+ "name": "CreateQuestionAdminParams",
847
+ "type": {
848
+ "kind": "struct",
849
+ "fields": [
850
+ {
851
+ "name": "question_id",
852
+ "type": {
853
+ "array": [
854
+ "u8",
855
+ 32
856
+ ]
857
+ }
858
+ },
859
+ {
860
+ "name": "content_hash",
861
+ "type": {
862
+ "array": [
863
+ "u8",
864
+ 32
865
+ ]
866
+ }
867
+ },
868
+ {
869
+ "name": "hook_program",
870
+ "type": "pubkey"
871
+ },
872
+ {
873
+ "name": "authorized_clob",
874
+ "type": "pubkey"
875
+ },
876
+ {
877
+ "name": "expiration_time",
878
+ "type": "i64"
879
+ }
880
+ ]
881
+ }
882
+ },
883
+ {
884
+ "name": "CreateQuestionWithConditionParams",
885
+ "docs": [
886
+ "Parameters for creating a question with condition"
887
+ ],
888
+ "type": {
889
+ "kind": "struct",
890
+ "fields": [
891
+ {
892
+ "name": "question_id",
893
+ "docs": [
894
+ "Unique question identifier (32-byte hash)"
895
+ ],
896
+ "type": {
897
+ "array": [
898
+ "u8",
899
+ 32
900
+ ]
901
+ }
902
+ },
903
+ {
904
+ "name": "content_hash",
905
+ "docs": [
906
+ "Hash of question content (for on-chain reference)"
907
+ ],
908
+ "type": {
909
+ "array": [
910
+ "u8",
911
+ 32
912
+ ]
913
+ }
914
+ },
915
+ {
916
+ "name": "hook_program",
917
+ "docs": [
918
+ "Transfer Hook program (guards YES/NO token transfers)"
919
+ ],
920
+ "type": "pubkey"
921
+ },
922
+ {
923
+ "name": "authorized_clob",
924
+ "docs": [
925
+ "The CLOB program authorized to call CTF.transfer_position"
926
+ ],
927
+ "type": "pubkey"
928
+ },
929
+ {
930
+ "name": "expiration_time",
931
+ "docs": [
932
+ "Question expiration timestamp (unix)"
933
+ ],
934
+ "type": "i64"
935
+ }
936
+ ]
937
+ }
938
+ },
939
+ {
940
+ "name": "InitializeParams",
941
+ "docs": [
942
+ "Parameters for initializing the Question Market config"
943
+ ],
944
+ "type": {
945
+ "kind": "struct",
946
+ "fields": [
947
+ {
948
+ "name": "admin",
949
+ "docs": [
950
+ "Admin who can approve/reject questions"
951
+ ],
952
+ "type": "pubkey"
953
+ },
954
+ {
955
+ "name": "conditional_tokens_program",
956
+ "docs": [
957
+ "ConditionalTokens program ID for CPI"
958
+ ],
959
+ "type": "pubkey"
960
+ },
961
+ {
962
+ "name": "oracle",
963
+ "docs": [
964
+ "Oracle pubkey that will resolve conditions"
965
+ ],
966
+ "type": "pubkey"
967
+ }
968
+ ]
969
+ }
970
+ },
971
+ {
972
+ "name": "Question",
973
+ "type": {
974
+ "kind": "struct",
975
+ "fields": [
976
+ {
977
+ "name": "version",
978
+ "type": "u8"
979
+ },
980
+ {
981
+ "name": "config",
982
+ "type": "pubkey"
983
+ },
984
+ {
985
+ "name": "question_id",
986
+ "docs": [
987
+ "Unique question identifier (32-byte hash)"
988
+ ],
989
+ "type": {
990
+ "array": [
991
+ "u8",
992
+ 32
993
+ ]
994
+ }
995
+ },
996
+ {
997
+ "name": "content_hash",
998
+ "docs": [
999
+ "Hash of question content (title, description, etc.)"
1000
+ ],
1001
+ "type": {
1002
+ "array": [
1003
+ "u8",
1004
+ 32
1005
+ ]
1006
+ }
1007
+ },
1008
+ {
1009
+ "name": "outcome_slot_count",
1010
+ "docs": [
1011
+ "Number of possible outcomes (2 for binary, up to 255)"
1012
+ ],
1013
+ "type": "u8"
1014
+ },
1015
+ {
1016
+ "name": "condition_id",
1017
+ "docs": [
1018
+ "Derived condition ID for ConditionalTokens (hash of oracle + question_id)"
1019
+ ],
1020
+ "type": {
1021
+ "array": [
1022
+ "u8",
1023
+ 32
1024
+ ]
1025
+ }
1026
+ },
1027
+ {
1028
+ "name": "expiration_time",
1029
+ "docs": [
1030
+ "Question expiration timestamp (when market closes)"
1031
+ ],
1032
+ "type": "i64"
1033
+ },
1034
+ {
1035
+ "name": "currency_mint",
1036
+ "docs": [
1037
+ "Currency mint for this question's market (e.g., USDC)"
1038
+ ],
1039
+ "type": "pubkey"
1040
+ },
1041
+ {
1042
+ "name": "creator",
1043
+ "docs": [
1044
+ "Creator of the question"
1045
+ ],
1046
+ "type": "pubkey"
1047
+ },
1048
+ {
1049
+ "name": "condition",
1050
+ "docs": [
1051
+ "Linked ConditionalTokens condition (None until approved)"
1052
+ ],
1053
+ "type": {
1054
+ "option": "pubkey"
1055
+ }
1056
+ },
1057
+ {
1058
+ "name": "status",
1059
+ "docs": [
1060
+ "Current status"
1061
+ ],
1062
+ "type": {
1063
+ "defined": {
1064
+ "name": "QuestionStatus"
1065
+ }
1066
+ }
1067
+ },
1068
+ {
1069
+ "name": "created_at",
1070
+ "docs": [
1071
+ "Timestamp when question was created"
1072
+ ],
1073
+ "type": "i64"
1074
+ },
1075
+ {
1076
+ "name": "approved_at",
1077
+ "docs": [
1078
+ "Timestamp when question was approved (0 if not approved)"
1079
+ ],
1080
+ "type": "i64"
1081
+ },
1082
+ {
1083
+ "name": "resolved_at",
1084
+ "docs": [
1085
+ "Timestamp when question was resolved (0 if not resolved)"
1086
+ ],
1087
+ "type": "i64"
1088
+ },
1089
+ {
1090
+ "name": "bump",
1091
+ "docs": [
1092
+ "Bump seed for PDA derivation"
1093
+ ],
1094
+ "type": "u8"
1095
+ },
1096
+ {
1097
+ "name": "_reserved",
1098
+ "docs": [
1099
+ "Reserved space for future upgrades"
1100
+ ],
1101
+ "type": {
1102
+ "array": [
1103
+ "u8",
1104
+ 64
1105
+ ]
1106
+ }
1107
+ }
1108
+ ]
1109
+ }
1110
+ },
1111
+ {
1112
+ "name": "QuestionAdminCreated",
1113
+ "type": {
1114
+ "kind": "struct",
1115
+ "fields": [
1116
+ {
1117
+ "name": "config",
1118
+ "type": "pubkey"
1119
+ },
1120
+ {
1121
+ "name": "question",
1122
+ "type": "pubkey"
1123
+ },
1124
+ {
1125
+ "name": "question_id",
1126
+ "type": {
1127
+ "array": [
1128
+ "u8",
1129
+ 32
1130
+ ]
1131
+ }
1132
+ },
1133
+ {
1134
+ "name": "condition_id",
1135
+ "type": {
1136
+ "array": [
1137
+ "u8",
1138
+ 32
1139
+ ]
1140
+ }
1141
+ },
1142
+ {
1143
+ "name": "condition",
1144
+ "type": "pubkey"
1145
+ },
1146
+ {
1147
+ "name": "yes_mint",
1148
+ "type": "pubkey"
1149
+ },
1150
+ {
1151
+ "name": "no_mint",
1152
+ "type": "pubkey"
1153
+ },
1154
+ {
1155
+ "name": "creator",
1156
+ "type": "pubkey"
1157
+ },
1158
+ {
1159
+ "name": "expiration_time",
1160
+ "type": "i64"
1161
+ },
1162
+ {
1163
+ "name": "currency_mint",
1164
+ "type": "pubkey"
1165
+ },
1166
+ {
1167
+ "name": "created_at",
1168
+ "type": "i64"
1169
+ }
1170
+ ]
1171
+ }
1172
+ },
1173
+ {
1174
+ "name": "QuestionApproved",
1175
+ "type": {
1176
+ "kind": "struct",
1177
+ "fields": [
1178
+ {
1179
+ "name": "config",
1180
+ "type": "pubkey"
1181
+ },
1182
+ {
1183
+ "name": "question",
1184
+ "type": "pubkey"
1185
+ },
1186
+ {
1187
+ "name": "question_id",
1188
+ "type": {
1189
+ "array": [
1190
+ "u8",
1191
+ 32
1192
+ ]
1193
+ }
1194
+ },
1195
+ {
1196
+ "name": "condition",
1197
+ "type": "pubkey"
1198
+ },
1199
+ {
1200
+ "name": "approved_by",
1201
+ "type": "pubkey"
1202
+ },
1203
+ {
1204
+ "name": "approved_at",
1205
+ "type": "i64"
1206
+ }
1207
+ ]
1208
+ }
1209
+ },
1210
+ {
1211
+ "name": "QuestionCreatedWithCondition",
1212
+ "type": {
1213
+ "kind": "struct",
1214
+ "fields": [
1215
+ {
1216
+ "name": "config",
1217
+ "type": "pubkey"
1218
+ },
1219
+ {
1220
+ "name": "question",
1221
+ "type": "pubkey"
1222
+ },
1223
+ {
1224
+ "name": "question_id",
1225
+ "type": {
1226
+ "array": [
1227
+ "u8",
1228
+ 32
1229
+ ]
1230
+ }
1231
+ },
1232
+ {
1233
+ "name": "condition_id",
1234
+ "type": {
1235
+ "array": [
1236
+ "u8",
1237
+ 32
1238
+ ]
1239
+ }
1240
+ },
1241
+ {
1242
+ "name": "condition",
1243
+ "type": "pubkey"
1244
+ },
1245
+ {
1246
+ "name": "yes_mint",
1247
+ "type": "pubkey"
1248
+ },
1249
+ {
1250
+ "name": "no_mint",
1251
+ "type": "pubkey"
1252
+ },
1253
+ {
1254
+ "name": "creator",
1255
+ "type": "pubkey"
1256
+ },
1257
+ {
1258
+ "name": "expiration_time",
1259
+ "type": "i64"
1260
+ },
1261
+ {
1262
+ "name": "currency_mint",
1263
+ "type": "pubkey"
1264
+ },
1265
+ {
1266
+ "name": "created_at",
1267
+ "type": "i64"
1268
+ }
1269
+ ]
1270
+ }
1271
+ },
1272
+ {
1273
+ "name": "QuestionMarketConfig",
1274
+ "type": {
1275
+ "kind": "struct",
1276
+ "fields": [
1277
+ {
1278
+ "name": "version",
1279
+ "type": "u8"
1280
+ },
1281
+ {
1282
+ "name": "owner",
1283
+ "type": "pubkey"
1284
+ },
1285
+ {
1286
+ "name": "admin",
1287
+ "type": "pubkey"
1288
+ },
1289
+ {
1290
+ "name": "conditional_tokens_program",
1291
+ "type": "pubkey"
1292
+ },
1293
+ {
1294
+ "name": "oracle",
1295
+ "type": "pubkey"
1296
+ },
1297
+ {
1298
+ "name": "question_count",
1299
+ "type": "u64"
1300
+ },
1301
+ {
1302
+ "name": "approved_count",
1303
+ "type": "u64"
1304
+ },
1305
+ {
1306
+ "name": "rejected_count",
1307
+ "type": "u64"
1308
+ },
1309
+ {
1310
+ "name": "whitelist",
1311
+ "type": {
1312
+ "array": [
1313
+ "pubkey",
1314
+ 10
1315
+ ]
1316
+ }
1317
+ },
1318
+ {
1319
+ "name": "whitelist_len",
1320
+ "type": "u8"
1321
+ },
1322
+ {
1323
+ "name": "is_paused",
1324
+ "type": "bool"
1325
+ },
1326
+ {
1327
+ "name": "bump",
1328
+ "type": "u8"
1329
+ },
1330
+ {
1331
+ "name": "_reserved",
1332
+ "type": {
1333
+ "array": [
1334
+ "u8",
1335
+ 128
1336
+ ]
1337
+ }
1338
+ }
1339
+ ]
1340
+ }
1341
+ },
1342
+ {
1343
+ "name": "QuestionMarketInitialized",
1344
+ "type": {
1345
+ "kind": "struct",
1346
+ "fields": [
1347
+ {
1348
+ "name": "config",
1349
+ "type": "pubkey"
1350
+ },
1351
+ {
1352
+ "name": "owner",
1353
+ "type": "pubkey"
1354
+ },
1355
+ {
1356
+ "name": "admin",
1357
+ "type": "pubkey"
1358
+ },
1359
+ {
1360
+ "name": "conditional_tokens_program",
1361
+ "type": "pubkey"
1362
+ },
1363
+ {
1364
+ "name": "oracle",
1365
+ "type": "pubkey"
1366
+ }
1367
+ ]
1368
+ }
1369
+ },
1370
+ {
1371
+ "name": "QuestionMarketWhitelistUpdated",
1372
+ "type": {
1373
+ "kind": "struct",
1374
+ "fields": [
1375
+ {
1376
+ "name": "config",
1377
+ "type": "pubkey"
1378
+ },
1379
+ {
1380
+ "name": "address",
1381
+ "type": "pubkey"
1382
+ },
1383
+ {
1384
+ "name": "added",
1385
+ "type": "bool"
1386
+ },
1387
+ {
1388
+ "name": "updated_by",
1389
+ "type": "pubkey"
1390
+ }
1391
+ ]
1392
+ }
1393
+ },
1394
+ {
1395
+ "name": "QuestionStatus",
1396
+ "docs": [
1397
+ "Status of a question in its lifecycle"
1398
+ ],
1399
+ "type": {
1400
+ "kind": "enum",
1401
+ "variants": [
1402
+ {
1403
+ "name": "Pending"
1404
+ },
1405
+ {
1406
+ "name": "Approved"
1407
+ },
1408
+ {
1409
+ "name": "Rejected"
1410
+ },
1411
+ {
1412
+ "name": "Resolved"
1413
+ }
1414
+ ]
1415
+ }
1416
+ },
1417
+ {
1418
+ "name": "UpdateConfigParams",
1419
+ "docs": [
1420
+ "Parameters for updating config"
1421
+ ],
1422
+ "type": {
1423
+ "kind": "struct",
1424
+ "fields": [
1425
+ {
1426
+ "name": "new_admin",
1427
+ "docs": [
1428
+ "New admin (optional)"
1429
+ ],
1430
+ "type": {
1431
+ "option": "pubkey"
1432
+ }
1433
+ },
1434
+ {
1435
+ "name": "new_oracle",
1436
+ "docs": [
1437
+ "New oracle (optional)"
1438
+ ],
1439
+ "type": {
1440
+ "option": "pubkey"
1441
+ }
1442
+ },
1443
+ {
1444
+ "name": "is_paused",
1445
+ "docs": [
1446
+ "Pause/unpause (optional)"
1447
+ ],
1448
+ "type": {
1449
+ "option": "bool"
1450
+ }
1451
+ },
1452
+ {
1453
+ "name": "new_conditional_tokens_program",
1454
+ "docs": [
1455
+ "New conditional tokens program ID (optional — update when CTF program is redeployed)"
1456
+ ],
1457
+ "type": {
1458
+ "option": "pubkey"
1459
+ }
1460
+ }
1461
+ ]
1462
+ }
1463
+ }
1464
+ ]
1465
+ }