@theliem/xmarket-sdk 4.0.3 → 4.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.
package/dist/index.d.mts CHANGED
@@ -65,6 +65,7 @@ interface Condition {
65
65
  yesMint: PublicKey;
66
66
  noMint: PublicKey;
67
67
  authorizedClob: PublicKey;
68
+ authorizedResolver: PublicKey;
68
69
  isResolved: boolean;
69
70
  resolvedAt: number;
70
71
  bump: number;
@@ -300,7 +301,7 @@ declare class CtfClient {
300
301
  * so that wallet can later sign reportPayouts.
301
302
  * payer covers rent for condition + mints.
302
303
  */
303
- prepareCondition(questionId: Uint8Array, oracle: PublicKey, collateralMint: PublicKey, authorizedClob: PublicKey, payer?: PublicKey, signers?: Keypair[]): Promise<{
304
+ prepareCondition(questionId: Uint8Array, oracle: PublicKey, collateralMint: PublicKey, authorizedClob: PublicKey, authorizedResolver?: PublicKey, payer?: PublicKey, signers?: Keypair[]): Promise<{
304
305
  signature: string;
305
306
  conditionPda: PublicKey;
306
307
  yesMint: PublicKey;
package/dist/index.d.ts CHANGED
@@ -65,6 +65,7 @@ interface Condition {
65
65
  yesMint: PublicKey;
66
66
  noMint: PublicKey;
67
67
  authorizedClob: PublicKey;
68
+ authorizedResolver: PublicKey;
68
69
  isResolved: boolean;
69
70
  resolvedAt: number;
70
71
  bump: number;
@@ -300,7 +301,7 @@ declare class CtfClient {
300
301
  * so that wallet can later sign reportPayouts.
301
302
  * payer covers rent for condition + mints.
302
303
  */
303
- prepareCondition(questionId: Uint8Array, oracle: PublicKey, collateralMint: PublicKey, authorizedClob: PublicKey, payer?: PublicKey, signers?: Keypair[]): Promise<{
304
+ prepareCondition(questionId: Uint8Array, oracle: PublicKey, collateralMint: PublicKey, authorizedClob: PublicKey, authorizedResolver?: PublicKey, payer?: PublicKey, signers?: Keypair[]): Promise<{
304
305
  signature: string;
305
306
  conditionPda: PublicKey;
306
307
  yesMint: PublicKey;
package/dist/index.js CHANGED
@@ -964,7 +964,7 @@ var CtfClient = class {
964
964
  * so that wallet can later sign reportPayouts.
965
965
  * payer covers rent for condition + mints.
966
966
  */
967
- async prepareCondition(questionId, oracle, collateralMint, authorizedClob, payer = this.walletPubkey, signers = []) {
967
+ async prepareCondition(questionId, oracle, collateralMint, authorizedClob, authorizedResolver = oracle, payer = this.walletPubkey, signers = []) {
968
968
  const [conditionPda] = PDA.condition(oracle, questionId, this.programIds);
969
969
  const [yesMint] = PDA.yesMint(conditionPda, this.programIds);
970
970
  const [noMint] = PDA.noMint(conditionPda, this.programIds);
@@ -972,7 +972,8 @@ var CtfClient = class {
972
972
  const [collateralVault] = PDA.collateralVault(collateralMint, this.programIds);
973
973
  const sig = await this.program.methods.prepareCondition(
974
974
  Array.from(questionId),
975
- authorizedClob
975
+ authorizedClob,
976
+ authorizedResolver
976
977
  ).accounts({
977
978
  oracle,
978
979
  condition: conditionPda,
@@ -1224,6 +1225,7 @@ var CtfClient = class {
1224
1225
  yesMint: acc.yesMint,
1225
1226
  noMint: acc.noMint,
1226
1227
  authorizedClob: acc.authorizedClob,
1228
+ authorizedResolver: acc.authorizedResolver,
1227
1229
  isResolved: acc.isResolved,
1228
1230
  resolvedAt: acc.resolvedAt?.toNumber() ?? 0,
1229
1231
  bump: acc.bump
@@ -3889,7 +3891,7 @@ var DisputeClient = class {
3889
3891
 
3890
3892
  // src/idls/oracle.json
3891
3893
  var oracle_default = {
3892
- address: "JE3iUvfv2DjhHnEqf2cFtzMtqn1AYQ5s32e1fzkL6KTo",
3894
+ address: "8uNiLDZnarxyFyoCi1bE1qkBMsLs2Tpyohtdzdvjkg8j",
3893
3895
  metadata: {
3894
3896
  name: "oracle_v2",
3895
3897
  version: "0.1.0",
@@ -4614,7 +4616,7 @@ var oracle_default = {
4614
4616
 
4615
4617
  // src/idls/question_market.json
4616
4618
  var question_market_default = {
4617
- address: "6aYGVgSPNgFxNB9f25UvKrzMs91cGh7urNZKdtnMUm6k",
4619
+ address: "FkpHo3zb5h2nNS5n6tWAvDwXPTXR2qqVLjDmEkMayott",
4618
4620
  metadata: {
4619
4621
  name: "question_market_v2",
4620
4622
  version: "0.1.0",
@@ -4948,19 +4950,19 @@ var question_market_default = {
4948
4950
  },
4949
4951
  {
4950
4952
  name: "fee_management_program",
4951
- address: "HZ5ec3NbwceUfyzZkwGEzDxQHpr4p4L9JV1gmcPDyXYw"
4953
+ address: "8S6hxqbDc8kgHf4uUzq2t15PeY36QSCYEpBVvM4Fhrkm"
4952
4954
  },
4953
4955
  {
4954
4956
  name: "presale_program",
4955
- address: "H9GzTEu5giM1k9HJm126Pp6C6b3iKWahbF7RJj8Jr3zJ"
4957
+ address: "CKd94vPibAMAr8R5eLv21r8PYXkgLRithipBe8GV7J6C"
4956
4958
  },
4957
4959
  {
4958
4960
  name: "market_oracle_program",
4959
- address: "4o7VyLGV79AynuTjTxDvsUfZKS11bX5SkSsk5zHKVovG"
4961
+ address: "Agt6beCbghi4jV9A8v9geRP5dnt2wDkJBVgy9oM33zit"
4960
4962
  },
4961
4963
  {
4962
4964
  name: "admin_program",
4963
- address: "3E2b2H3ZDMXjqQ1VKDz8zsVXWdRaH5Mjdd7qFB13Uejn"
4965
+ address: "2HsyCdr59W5ndeboaE9JAmhEQ46m5Gm2ZWBfYEs1tC1i"
4964
4966
  },
4965
4967
  {
4966
4968
  name: "token_program",
@@ -5222,11 +5224,11 @@ var question_market_default = {
5222
5224
  },
5223
5225
  {
5224
5226
  name: "presale_program",
5225
- address: "H9GzTEu5giM1k9HJm126Pp6C6b3iKWahbF7RJj8Jr3zJ"
5227
+ address: "CKd94vPibAMAr8R5eLv21r8PYXkgLRithipBe8GV7J6C"
5226
5228
  },
5227
5229
  {
5228
5230
  name: "admin_program",
5229
- address: "3E2b2H3ZDMXjqQ1VKDz8zsVXWdRaH5Mjdd7qFB13Uejn"
5231
+ address: "2HsyCdr59W5ndeboaE9JAmhEQ46m5Gm2ZWBfYEs1tC1i"
5230
5232
  },
5231
5233
  {
5232
5234
  name: "token_program",
@@ -5308,7 +5310,7 @@ var question_market_default = {
5308
5310
  },
5309
5311
  {
5310
5312
  name: "market_oracle_program",
5311
- address: "4o7VyLGV79AynuTjTxDvsUfZKS11bX5SkSsk5zHKVovG"
5313
+ address: "Agt6beCbghi4jV9A8v9geRP5dnt2wDkJBVgy9oM33zit"
5312
5314
  }
5313
5315
  ],
5314
5316
  args: []
@@ -5536,7 +5538,7 @@ var question_market_default = {
5536
5538
  },
5537
5539
  {
5538
5540
  name: "presale_program",
5539
- address: "H9GzTEu5giM1k9HJm126Pp6C6b3iKWahbF7RJj8Jr3zJ"
5541
+ address: "CKd94vPibAMAr8R5eLv21r8PYXkgLRithipBe8GV7J6C"
5540
5542
  },
5541
5543
  {
5542
5544
  name: "token_program",
@@ -5672,7 +5674,7 @@ var question_market_default = {
5672
5674
  },
5673
5675
  {
5674
5676
  name: "fee_management_program",
5675
- address: "HZ5ec3NbwceUfyzZkwGEzDxQHpr4p4L9JV1gmcPDyXYw"
5677
+ address: "8S6hxqbDc8kgHf4uUzq2t15PeY36QSCYEpBVvM4Fhrkm"
5676
5678
  },
5677
5679
  {
5678
5680
  name: "token_program",
@@ -5865,7 +5867,7 @@ var question_market_default = {
5865
5867
  },
5866
5868
  {
5867
5869
  name: "presale_program",
5868
- address: "H9GzTEu5giM1k9HJm126Pp6C6b3iKWahbF7RJj8Jr3zJ"
5870
+ address: "CKd94vPibAMAr8R5eLv21r8PYXkgLRithipBe8GV7J6C"
5869
5871
  }
5870
5872
  ],
5871
5873
  args: []
@@ -6085,7 +6087,8 @@ var question_market_default = {
6085
6087
  {
6086
6088
  name: "condition",
6087
6089
  docs: [
6088
- "The Condition account in CTF (will be updated via CPI)"
6090
+ "The Condition account in CTF (will be updated via CPI).",
6091
+ "Must match question.condition \u2014 prevents cross-market resolution."
6089
6092
  ],
6090
6093
  writable: true
6091
6094
  },
@@ -7473,7 +7476,7 @@ var question_market_default = {
7473
7476
 
7474
7477
  // src/idls/conditional_tokens.json
7475
7478
  var conditional_tokens_default = {
7476
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB",
7479
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT",
7477
7480
  metadata: {
7478
7481
  name: "conditional_tokens_v2",
7479
7482
  version: "0.1.0",
@@ -7894,6 +7897,10 @@ var conditional_tokens_default = {
7894
7897
  {
7895
7898
  name: "authorized_clob",
7896
7899
  type: "pubkey"
7900
+ },
7901
+ {
7902
+ name: "authorized_resolver",
7903
+ type: "pubkey"
7897
7904
  }
7898
7905
  ]
7899
7906
  },
@@ -8023,9 +8030,6 @@ var conditional_tokens_default = {
8023
8030
  },
8024
8031
  {
8025
8032
  name: "collateral_vault",
8026
- docs: [
8027
- "Use canonical bump derivation (no bump = vault.bump) so corrupt bump doesn't block us"
8028
- ],
8029
8033
  writable: true,
8030
8034
  pda: {
8031
8035
  seeds: [
@@ -8059,9 +8063,6 @@ var conditional_tokens_default = {
8059
8063
  },
8060
8064
  {
8061
8065
  name: "vault_token_account",
8062
- docs: [
8063
- "Existing vault token account \u2014 just update the reference"
8064
- ],
8065
8066
  writable: true,
8066
8067
  pda: {
8067
8068
  seeds: [
@@ -8739,6 +8740,14 @@ var conditional_tokens_default = {
8739
8740
  ],
8740
8741
  type: "u8"
8741
8742
  },
8743
+ {
8744
+ name: "admin",
8745
+ docs: [
8746
+ "Admin pubkey \u2014 only this address can call reinitialize_vault.",
8747
+ "Set at initialize_vault time. If Pubkey::default(), first caller sets it (bootstrap)."
8748
+ ],
8749
+ type: "pubkey"
8750
+ },
8742
8751
  {
8743
8752
  name: "_reserved",
8744
8753
  docs: [
@@ -8747,7 +8756,7 @@ var conditional_tokens_default = {
8747
8756
  type: {
8748
8757
  array: [
8749
8758
  "u8",
8750
- 64
8759
+ 32
8751
8760
  ]
8752
8761
  }
8753
8762
  }
@@ -8825,12 +8834,20 @@ var conditional_tokens_default = {
8825
8834
  name: "bump",
8826
8835
  type: "u8"
8827
8836
  },
8837
+ {
8838
+ name: "authorized_resolver",
8839
+ docs: [
8840
+ "QuestionMarket config PDA authorized to call set_payout.",
8841
+ "Uses first 32 bytes of old _reserved \u2014 existing accounts read as Pubkey::default()."
8842
+ ],
8843
+ type: "pubkey"
8844
+ },
8828
8845
  {
8829
8846
  name: "_reserved",
8830
8847
  type: {
8831
8848
  array: [
8832
8849
  "u8",
8833
- 64
8850
+ 32
8834
8851
  ]
8835
8852
  }
8836
8853
  }
@@ -9176,7 +9193,7 @@ var conditional_tokens_default = {
9176
9193
 
9177
9194
  // src/idls/clob_exchange.json
9178
9195
  var clob_exchange_default = {
9179
- address: "43ubx86ZnGJ4bzD8uZY91uoUzJdK2jULwSSVk8zHjzEY",
9196
+ address: "AFT8SM1Vv8g8AQTf81LoE5oLteUTyhWzWTLj7SKZjkY1",
9180
9197
  metadata: {
9181
9198
  name: "clob_exchange_v2",
9182
9199
  version: "0.1.0",
@@ -9369,7 +9386,7 @@ var clob_exchange_default = {
9369
9386
  },
9370
9387
  {
9371
9388
  name: "conditional_tokens_program",
9372
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB"
9389
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT"
9373
9390
  },
9374
9391
  {
9375
9392
  name: "token_program",
@@ -9520,7 +9537,7 @@ var clob_exchange_default = {
9520
9537
  },
9521
9538
  {
9522
9539
  name: "conditional_tokens_program",
9523
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB"
9540
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT"
9524
9541
  },
9525
9542
  {
9526
9543
  name: "token_program",
@@ -9667,7 +9684,7 @@ var clob_exchange_default = {
9667
9684
  },
9668
9685
  {
9669
9686
  name: "conditional_tokens_program",
9670
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB"
9687
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT"
9671
9688
  },
9672
9689
  {
9673
9690
  name: "token_program",
@@ -10030,7 +10047,7 @@ var clob_exchange_default = {
10030
10047
  },
10031
10048
  {
10032
10049
  name: "conditional_tokens_program",
10033
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB"
10050
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT"
10034
10051
  },
10035
10052
  {
10036
10053
  name: "token_program",
@@ -10302,7 +10319,7 @@ var clob_exchange_default = {
10302
10319
  },
10303
10320
  {
10304
10321
  name: "conditional_tokens_program",
10305
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB"
10322
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT"
10306
10323
  },
10307
10324
  {
10308
10325
  name: "collateral_token_program",
@@ -10578,7 +10595,7 @@ var clob_exchange_default = {
10578
10595
  },
10579
10596
  {
10580
10597
  name: "conditional_tokens_program",
10581
- address: "3f4vBEgXo9y4Ndrn8KWnNpLLtt4VAGkmKWqXpGS1BLDB"
10598
+ address: "xpn3htSptTZECudoRA8WJmAEtiijxDseTqtawYysVNT"
10582
10599
  },
10583
10600
  {
10584
10601
  name: "collateral_token_program",
@@ -11318,6 +11335,14 @@ var clob_exchange_default = {
11318
11335
  ],
11319
11336
  type: "u8"
11320
11337
  },
11338
+ {
11339
+ name: "admin",
11340
+ docs: [
11341
+ "Admin pubkey \u2014 only this address can call reinitialize_vault.",
11342
+ "Set at initialize_vault time. If Pubkey::default(), first caller sets it (bootstrap)."
11343
+ ],
11344
+ type: "pubkey"
11345
+ },
11321
11346
  {
11322
11347
  name: "_reserved",
11323
11348
  docs: [
@@ -11326,7 +11351,7 @@ var clob_exchange_default = {
11326
11351
  type: {
11327
11352
  array: [
11328
11353
  "u8",
11329
- 64
11354
+ 32
11330
11355
  ]
11331
11356
  }
11332
11357
  }
@@ -11475,12 +11500,20 @@ var clob_exchange_default = {
11475
11500
  name: "bump",
11476
11501
  type: "u8"
11477
11502
  },
11503
+ {
11504
+ name: "authorized_resolver",
11505
+ docs: [
11506
+ "QuestionMarket config PDA authorized to call set_payout.",
11507
+ "Uses first 32 bytes of old _reserved \u2014 existing accounts read as Pubkey::default()."
11508
+ ],
11509
+ type: "pubkey"
11510
+ },
11478
11511
  {
11479
11512
  name: "_reserved",
11480
11513
  type: {
11481
11514
  array: [
11482
11515
  "u8",
11483
- 64
11516
+ 32
11484
11517
  ]
11485
11518
  }
11486
11519
  }
@@ -11686,7 +11719,7 @@ var clob_exchange_default = {
11686
11719
 
11687
11720
  // src/idls/fee_management.json
11688
11721
  var fee_management_default = {
11689
- address: "DuYyXguB5PVSKg6E2p4XPrrXZSCJnuBhoGpkGCBN5bBb",
11722
+ address: "8S6hxqbDc8kgHf4uUzq2t15PeY36QSCYEpBVvM4Fhrkm",
11690
11723
  metadata: {
11691
11724
  name: "fee_management",
11692
11725
  version: "0.1.0",
@@ -13156,7 +13189,7 @@ var fee_management_default = {
13156
13189
 
13157
13190
  // src/idls/presale.json
13158
13191
  var presale_default = {
13159
- address: "2Rnw1VoEtsUMQ7wkvYZjDehqSqRob6uNkeymDfvKrquB",
13192
+ address: "CKd94vPibAMAr8R5eLv21r8PYXkgLRithipBe8GV7J6C",
13160
13193
  metadata: {
13161
13194
  name: "presale",
13162
13195
  version: "0.1.0",
@@ -14823,7 +14856,7 @@ var presale_default = {
14823
14856
 
14824
14857
  // src/idls/market_oracle.json
14825
14858
  var market_oracle_default = {
14826
- address: "ADWF4J3nCJ2kWnCtycuem2jhu7amUqJWQG3oa5xF67QJ",
14859
+ address: "Agt6beCbghi4jV9A8v9geRP5dnt2wDkJBVgy9oM33zit",
14827
14860
  metadata: {
14828
14861
  name: "market_oracle",
14829
14862
  version: "0.1.0",
@@ -15524,7 +15557,7 @@ var market_oracle_default = {
15524
15557
 
15525
15558
  // src/idls/admin_contract.json
15526
15559
  var admin_contract_default = {
15527
- address: "4NdD5962SfGqofmeyjfifJpdGnwTAiKaUKB5Z42UDc9T",
15560
+ address: "2HsyCdr59W5ndeboaE9JAmhEQ46m5Gm2ZWBfYEs1tC1i",
15528
15561
  metadata: {
15529
15562
  name: "admin_contract",
15530
15563
  version: "0.1.0",
@@ -16375,11 +16408,29 @@ var admin_contract_default = {
16375
16408
  accounts: [
16376
16409
  {
16377
16410
  name: "AdminConfig",
16378
- discriminator: [156, 10, 79, 161, 71, 9, 62, 77]
16411
+ discriminator: [
16412
+ 156,
16413
+ 10,
16414
+ 79,
16415
+ 161,
16416
+ 71,
16417
+ 9,
16418
+ 62,
16419
+ 77
16420
+ ]
16379
16421
  },
16380
16422
  {
16381
16423
  name: "ClaimRecord",
16382
- discriminator: [57, 229, 0, 9, 65, 62, 96, 7]
16424
+ discriminator: [
16425
+ 57,
16426
+ 229,
16427
+ 0,
16428
+ 9,
16429
+ 65,
16430
+ 62,
16431
+ 96,
16432
+ 7
16433
+ ]
16383
16434
  }
16384
16435
  ],
16385
16436
  types: [
@@ -16470,9 +16521,9 @@ var admin_contract_default = {
16470
16521
 
16471
16522
  // src/idls/referral.json
16472
16523
  var referral_default = {
16473
- address: "7b5ohWDqrQ2KRcDJMWwj1dwgRkt5ZJdMavSmrXn9oBgL",
16524
+ address: "9kyNMtUEFR6hDeZHUTbRKH3t1EJisfSvWQKKUev7ujoC",
16474
16525
  metadata: {
16475
- name: "referral",
16526
+ name: "referral_v2",
16476
16527
  version: "0.1.0",
16477
16528
  spec: "0.1.0",
16478
16529
  description: "Referral program for XMarket \u2014 whitelist-gated batch USDS distribution"
@@ -16961,9 +17012,9 @@ var referral_default = {
16961
17012
 
16962
17013
  // src/idls/dispute.json
16963
17014
  var dispute_default = {
16964
- address: "4toSDWDCcx37R6HZ78P71nDp3NNoJvcmQpzP4sfivVvL",
17015
+ address: "8gqHPY1WtGFGmYNbrGrPVoct1kqPL6cCaUtJ17EHSsFp",
16965
17016
  metadata: {
16966
- name: "dispute",
17017
+ name: "dispute_v2",
16967
17018
  version: "0.1.0",
16968
17019
  spec: "0.1.0",
16969
17020
  description: "Dispute program for XMarket \u2014 raise/resolve/claim disputes on prediction markets"