@theliem/xmarket-sdk 3.1.0 → 3.1.2

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.
@@ -8,88 +8,66 @@
8
8
  },
9
9
  "instructions": [
10
10
  {
11
- "name": "add_reporter",
11
+ "name": "add_to_whitelist",
12
12
  "docs": [
13
- "Add a new reporter to the oracle whitelist"
13
+ "Add an address to the oracle resolver whitelist (admin/owner only)"
14
14
  ],
15
15
  "discriminator": [
16
- 158,
17
- 153,
18
- 12,
19
- 6,
20
- 217,
21
- 41,
22
- 252,
23
- 157
16
+ 157,
17
+ 211,
18
+ 52,
19
+ 54,
20
+ 144,
21
+ 81,
22
+ 5,
23
+ 55
24
24
  ],
25
25
  "accounts": [
26
26
  {
27
27
  "name": "authority",
28
- "docs": [
29
- "Admin or owner who can add reporters"
30
- ],
31
- "writable": true,
32
28
  "signer": true
33
29
  },
34
30
  {
35
- "name": "oracle_config",
36
- "docs": [
37
- "The oracle configuration"
38
- ],
39
- "writable": true
40
- },
41
- {
42
- "name": "reporter_address",
43
- "docs": [
44
- "The address being whitelisted as a reporter"
45
- ]
31
+ "name": "payer",
32
+ "writable": true,
33
+ "signer": true
46
34
  },
47
35
  {
48
- "name": "reporter",
49
- "docs": [
50
- "The reporter account (PDA)"
51
- ],
36
+ "name": "oracle_config",
52
37
  "writable": true,
53
38
  "pda": {
54
39
  "seeds": [
55
40
  {
56
41
  "kind": "const",
57
42
  "value": [
58
- 114,
59
- 101,
60
- 112,
43
+ 99,
61
44
  111,
62
- 114,
63
- 116,
64
- 101,
65
- 114
45
+ 110,
46
+ 102,
47
+ 105,
48
+ 103
66
49
  ]
67
50
  },
68
51
  {
69
52
  "kind": "account",
70
- "path": "oracle_config"
71
- },
72
- {
73
- "kind": "account",
74
- "path": "reporter_address"
53
+ "path": "oracle_config.owner",
54
+ "account": "OracleConfig"
75
55
  }
76
56
  ]
77
57
  }
78
- },
79
- {
80
- "name": "system_program",
81
- "docs": [
82
- "System program for account creation"
83
- ],
84
- "address": "11111111111111111111111111111111"
85
58
  }
86
59
  ],
87
- "args": []
60
+ "args": [
61
+ {
62
+ "name": "address",
63
+ "type": "pubkey"
64
+ }
65
+ ]
88
66
  },
89
67
  {
90
68
  "name": "initialize",
91
69
  "docs": [
92
- "Initialize a new Oracle configuration"
70
+ "Initialize a new Oracle configuration. Caller becomes owner and is auto-whitelisted."
93
71
  ],
94
72
  "discriminator": [
95
73
  175,
@@ -145,7 +123,7 @@
145
123
  {
146
124
  "name": "pause",
147
125
  "docs": [
148
- "Pause or unpause the oracle"
126
+ "Pause or unpause the oracle (admin/owner only)"
149
127
  ],
150
128
  "discriminator": [
151
129
  211,
@@ -165,6 +143,11 @@
165
143
  ],
166
144
  "signer": true
167
145
  },
146
+ {
147
+ "name": "payer",
148
+ "writable": true,
149
+ "signer": true
150
+ },
168
151
  {
169
152
  "name": "oracle_config",
170
153
  "docs": [
@@ -181,82 +164,67 @@
181
164
  ]
182
165
  },
183
166
  {
184
- "name": "remove_reporter",
167
+ "name": "remove_from_whitelist",
185
168
  "docs": [
186
- "Remove (deactivate) a reporter from the oracle whitelist"
169
+ "Remove an address from the oracle resolver whitelist (admin/owner only)"
187
170
  ],
188
171
  "discriminator": [
189
- 165,
190
- 229,
191
- 140,
192
- 210,
193
- 40,
194
- 24,
195
- 27,
196
- 34
172
+ 7,
173
+ 144,
174
+ 216,
175
+ 239,
176
+ 243,
177
+ 236,
178
+ 193,
179
+ 235
197
180
  ],
198
181
  "accounts": [
199
182
  {
200
183
  "name": "authority",
201
- "docs": [
202
- "Admin or owner who can remove reporters"
203
- ],
204
184
  "signer": true
205
185
  },
206
186
  {
207
- "name": "oracle_config",
208
- "docs": [
209
- "The oracle configuration"
210
- ],
211
- "writable": true
212
- },
213
- {
214
- "name": "reporter_address",
215
- "docs": [
216
- "The address being removed as a reporter"
217
- ]
187
+ "name": "payer",
188
+ "writable": true,
189
+ "signer": true
218
190
  },
219
191
  {
220
- "name": "reporter",
221
- "docs": [
222
- "The reporter account (PDA)"
223
- ],
192
+ "name": "oracle_config",
224
193
  "writable": true,
225
194
  "pda": {
226
195
  "seeds": [
227
196
  {
228
197
  "kind": "const",
229
198
  "value": [
230
- 114,
231
- 101,
232
- 112,
199
+ 99,
233
200
  111,
234
- 114,
235
- 116,
236
- 101,
237
- 114
201
+ 110,
202
+ 102,
203
+ 105,
204
+ 103
238
205
  ]
239
206
  },
240
207
  {
241
208
  "kind": "account",
242
- "path": "oracle_config"
243
- },
244
- {
245
- "kind": "account",
246
- "path": "reporter_address"
209
+ "path": "oracle_config.owner",
210
+ "account": "OracleConfig"
247
211
  }
248
212
  ]
249
213
  }
250
214
  }
251
215
  ],
252
- "args": []
216
+ "args": [
217
+ {
218
+ "name": "address",
219
+ "type": "pubkey"
220
+ }
221
+ ]
253
222
  },
254
223
  {
255
224
  "name": "resolve_question",
256
225
  "docs": [
257
- "Resolve a question \u2014 called by whitelisted reporter",
258
- "Creates a QuestionResult PDA with the payout vector.",
259
- "QuestionMarket reads this to finalize the condition."
226
+ "Resolve a question whitelisted address only.",
227
+ "Stores QuestionResult PDA and CPIs to CTF.set_payout in one transaction."
260
228
  ],
261
229
  "discriminator": [
262
230
  52,
@@ -279,7 +247,7 @@
279
247
  {
280
248
  "name": "oracle_config",
281
249
  "docs": [
282
- "Oracle configuration \u2014 reporter must be whitelisted"
250
+ "Oracle configuration"
283
251
  ],
284
252
  "writable": true,
285
253
  "pda": {
@@ -306,7 +274,7 @@
306
274
  {
307
275
  "name": "question_result",
308
276
  "docs": [
309
- "QuestionResult PDA \u2014 stores the resolution"
277
+ "QuestionResult PDA seeds: [result, oracle_config, question_id]"
310
278
  ],
311
279
  "writable": true,
312
280
  "pda": {
@@ -336,14 +304,44 @@
336
304
  {
337
305
  "name": "condition",
338
306
  "docs": [
339
- "Condition PDA in CTF \u2014 updated via CPI"
307
+ "Condition PDA in CTF seeds: [condition, oracle_config, question_id] (CTF program)"
340
308
  ],
341
- "writable": true
309
+ "writable": true,
310
+ "pda": {
311
+ "seeds": [
312
+ {
313
+ "kind": "const",
314
+ "value": [
315
+ 99,
316
+ 111,
317
+ 110,
318
+ 100,
319
+ 105,
320
+ 116,
321
+ 105,
322
+ 111,
323
+ 110
324
+ ]
325
+ },
326
+ {
327
+ "kind": "account",
328
+ "path": "oracle_config"
329
+ },
330
+ {
331
+ "kind": "arg",
332
+ "path": "question_id"
333
+ }
334
+ ],
335
+ "program": {
336
+ "kind": "account",
337
+ "path": "conditional_tokens_program"
338
+ }
339
+ }
342
340
  },
343
341
  {
344
342
  "name": "conditional_tokens_program",
345
343
  "docs": [
346
- "CTF program \u2014 receives set_payout CPI"
344
+ "ConditionalTokens program"
347
345
  ]
348
346
  },
349
347
  {
@@ -422,7 +420,7 @@
422
420
  {
423
421
  "name": "update_admin",
424
422
  "docs": [
425
- "Update the admin of the oracle"
423
+ "Update the admin of the oracle (owner only)"
426
424
  ],
427
425
  "discriminator": [
428
426
  161,
@@ -489,27 +487,26 @@
489
487
  254,
490
488
  226
491
489
  ]
492
- },
490
+ }
491
+ ],
492
+ "events": [
493
493
  {
494
- "name": "Reporter",
494
+ "name": "WhitelistUpdated",
495
495
  "discriminator": [
496
- 233,
497
- 37,
498
- 148,
499
- 250,
500
- 155,
501
- 158,
502
- 118,
503
- 161
496
+ 205,
497
+ 110,
498
+ 205,
499
+ 193,
500
+ 238,
501
+ 237,
502
+ 220,
503
+ 22
504
504
  ]
505
505
  }
506
506
  ],
507
507
  "types": [
508
508
  {
509
509
  "name": "OracleConfig",
510
- "docs": [
511
- "Global configuration for the Oracle program"
512
- ],
513
510
  "type": {
514
511
  "kind": "struct",
515
512
  "fields": [
@@ -594,6 +591,9 @@
594
591
  },
595
592
  {
596
593
  "name": "payout_numerators",
594
+ "docs": [
595
+ "Fixed-size payout array. Only [0..outcome_count] slots are meaningful."
596
+ ],
597
597
  "type": {
598
598
  "array": [
599
599
  "u64",
@@ -636,61 +636,25 @@
636
636
  }
637
637
  },
638
638
  {
639
- "name": "Reporter",
640
- "docs": [
641
- "Represents a whitelisted reporter who can resolve questions"
642
- ],
639
+ "name": "WhitelistUpdated",
643
640
  "type": {
644
641
  "kind": "struct",
645
642
  "fields": [
646
643
  {
647
644
  "name": "oracle_config",
648
- "docs": [
649
- "The oracle config this reporter belongs to"
650
- ],
651
645
  "type": "pubkey"
652
646
  },
653
647
  {
654
- "name": "reporter",
655
- "docs": [
656
- "The reporter's public key"
657
- ],
648
+ "name": "address",
658
649
  "type": "pubkey"
659
650
  },
660
651
  {
661
- "name": "is_active",
662
- "docs": [
663
- "Whether the reporter is currently active"
664
- ],
652
+ "name": "added",
665
653
  "type": "bool"
666
654
  },
667
655
  {
668
- "name": "questions_reported",
669
- "docs": [
670
- "Number of questions this reporter has resolved"
671
- ],
672
- "type": "u64"
673
- },
674
- {
675
- "name": "added_at",
676
- "docs": [
677
- "Timestamp when the reporter was added"
678
- ],
679
- "type": "i64"
680
- },
681
- {
682
- "name": "last_updated",
683
- "docs": [
684
- "Timestamp when the reporter was last updated"
685
- ],
686
- "type": "i64"
687
- },
688
- {
689
- "name": "bump",
690
- "docs": [
691
- "Bump seed for PDA derivation"
692
- ],
693
- "type": "u8"
656
+ "name": "updated_by",
657
+ "type": "pubkey"
694
658
  }
695
659
  ]
696
660
  }
@@ -604,6 +604,123 @@
604
604
  ],
605
605
  "args": []
606
606
  },
607
+ {
608
+ "name": "distribute_botmm_revenue",
609
+ "discriminator": [
610
+ 153,
611
+ 117,
612
+ 201,
613
+ 183,
614
+ 159,
615
+ 38,
616
+ 86,
617
+ 167
618
+ ],
619
+ "accounts": [
620
+ {
621
+ "name": "presale",
622
+ "writable": true,
623
+ "pda": {
624
+ "seeds": [
625
+ {
626
+ "kind": "const",
627
+ "value": [
628
+ 112,
629
+ 114,
630
+ 101,
631
+ 115,
632
+ 97,
633
+ 108,
634
+ 101
635
+ ]
636
+ },
637
+ {
638
+ "kind": "account",
639
+ "path": "presale.question_market_config",
640
+ "account": "PresaleAccount"
641
+ },
642
+ {
643
+ "kind": "account",
644
+ "path": "presale.presale_index",
645
+ "account": "PresaleAccount"
646
+ }
647
+ ]
648
+ }
649
+ },
650
+ {
651
+ "name": "presale_vault",
652
+ "writable": true,
653
+ "pda": {
654
+ "seeds": [
655
+ {
656
+ "kind": "account",
657
+ "path": "presale"
658
+ },
659
+ {
660
+ "kind": "account",
661
+ "path": "token_program"
662
+ },
663
+ {
664
+ "kind": "account",
665
+ "path": "currency_mint"
666
+ }
667
+ ],
668
+ "program": {
669
+ "kind": "const",
670
+ "value": [
671
+ 140,
672
+ 151,
673
+ 37,
674
+ 143,
675
+ 78,
676
+ 36,
677
+ 137,
678
+ 241,
679
+ 187,
680
+ 61,
681
+ 16,
682
+ 41,
683
+ 20,
684
+ 142,
685
+ 13,
686
+ 131,
687
+ 11,
688
+ 90,
689
+ 19,
690
+ 153,
691
+ 218,
692
+ 255,
693
+ 16,
694
+ 132,
695
+ 4,
696
+ 142,
697
+ 123,
698
+ 216,
699
+ 219,
700
+ 233,
701
+ 248,
702
+ 89
703
+ ]
704
+ }
705
+ }
706
+ },
707
+ {
708
+ "name": "currency_mint"
709
+ },
710
+ {
711
+ "name": "botmm_token_account",
712
+ "docs": [
713
+ "BOTMM token account — receives 80% presale revenue"
714
+ ],
715
+ "writable": true
716
+ },
717
+ {
718
+ "name": "token_program",
719
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
720
+ }
721
+ ],
722
+ "args": []
723
+ },
607
724
  {
608
725
  "name": "distribute_presale_revenue",
609
726
  "discriminator": [
@@ -911,6 +1028,13 @@
911
1028
  }
912
1029
  }
913
1030
  },
1031
+ {
1032
+ "name": "qt_metadata",
1033
+ "writable": true
1034
+ },
1035
+ {
1036
+ "name": "token_metadata_program"
1037
+ },
914
1038
  {
915
1039
  "name": "token_program",
916
1040
  "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
@@ -1300,6 +1424,19 @@
1300
1424
  }
1301
1425
  ],
1302
1426
  "events": [
1427
+ {
1428
+ "name": "BotmmRevenueDistributed",
1429
+ "discriminator": [
1430
+ 210,
1431
+ 71,
1432
+ 206,
1433
+ 193,
1434
+ 64,
1435
+ 210,
1436
+ 63,
1437
+ 185
1438
+ ]
1439
+ },
1303
1440
  {
1304
1441
  "name": "Bought",
1305
1442
  "discriminator": [
@@ -1406,6 +1543,26 @@
1406
1543
  }
1407
1544
  ],
1408
1545
  "types": [
1546
+ {
1547
+ "name": "BotmmRevenueDistributed",
1548
+ "type": {
1549
+ "kind": "struct",
1550
+ "fields": [
1551
+ {
1552
+ "name": "presale",
1553
+ "type": "pubkey"
1554
+ },
1555
+ {
1556
+ "name": "botmm",
1557
+ "type": "pubkey"
1558
+ },
1559
+ {
1560
+ "name": "amount",
1561
+ "type": "u64"
1562
+ }
1563
+ ]
1564
+ }
1565
+ },
1409
1566
  {
1410
1567
  "name": "Bought",
1411
1568
  "type": {
@@ -1485,18 +1642,30 @@
1485
1642
  },
1486
1643
  {
1487
1644
  "name": "agents_rev",
1645
+ "docs": [
1646
+ "Ignored — fee % is now a program constant (PRESALE_AGENTS_FEE_BPS)"
1647
+ ],
1488
1648
  "type": "u32"
1489
1649
  },
1490
1650
  {
1491
1651
  "name": "company_rev",
1652
+ "docs": [
1653
+ "Ignored — fee % is now a program constant (PRESALE_COMPANY_FEE_BPS)"
1654
+ ],
1492
1655
  "type": "u32"
1493
1656
  },
1494
1657
  {
1495
1658
  "name": "referral_address",
1659
+ "docs": [
1660
+ "Wallet that receives agents/referral fee (AGENT in .env)"
1661
+ ],
1496
1662
  "type": "pubkey"
1497
1663
  },
1498
1664
  {
1499
1665
  "name": "company_address",
1666
+ "docs": [
1667
+ "Wallet that receives company fee (COMPANY in .env)"
1668
+ ],
1500
1669
  "type": "pubkey"
1501
1670
  }
1502
1671
  ]