@theliem/xmarket-sdk 4.1.0 → 4.1.1
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -95,6 +95,7 @@ interface QuestionMarketConfig {
|
|
|
95
95
|
owner: PublicKey;
|
|
96
96
|
admin: PublicKey;
|
|
97
97
|
oracle: PublicKey;
|
|
98
|
+
oracleProgram: PublicKey;
|
|
98
99
|
conditionalTokensProgram: PublicKey;
|
|
99
100
|
questionCount: number;
|
|
100
101
|
approvedCount: number;
|
|
@@ -388,7 +389,7 @@ declare class MarketClient {
|
|
|
388
389
|
feeConfigOwner?: PublicKey;
|
|
389
390
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, ownerPubkey: PublicKey);
|
|
390
391
|
get walletPubkey(): PublicKey;
|
|
391
|
-
initialize(admin: PublicKey, oracle: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
392
|
+
initialize(admin: PublicKey, oracle: PublicKey, oracleProgram: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
392
393
|
/**
|
|
393
394
|
* Build createQuestionAdmin transaction (whitelist/admin path — status = Approved immediately).
|
|
394
395
|
* @param creator - Whitelisted creator (must be in whitelist or be admin/owner)
|
|
@@ -406,6 +407,7 @@ declare class MarketClient {
|
|
|
406
407
|
newOracle?: PublicKey;
|
|
407
408
|
isPaused?: boolean;
|
|
408
409
|
newConditionalTokensProgram?: PublicKey;
|
|
410
|
+
newOracleProgram?: PublicKey;
|
|
409
411
|
}, authority?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
410
412
|
/** Set the admin (owner only). Replaces any existing admin. */
|
|
411
413
|
addAdmin(newAdmin: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
package/dist/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ interface QuestionMarketConfig {
|
|
|
95
95
|
owner: PublicKey;
|
|
96
96
|
admin: PublicKey;
|
|
97
97
|
oracle: PublicKey;
|
|
98
|
+
oracleProgram: PublicKey;
|
|
98
99
|
conditionalTokensProgram: PublicKey;
|
|
99
100
|
questionCount: number;
|
|
100
101
|
approvedCount: number;
|
|
@@ -388,7 +389,7 @@ declare class MarketClient {
|
|
|
388
389
|
feeConfigOwner?: PublicKey;
|
|
389
390
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, ownerPubkey: PublicKey);
|
|
390
391
|
get walletPubkey(): PublicKey;
|
|
391
|
-
initialize(admin: PublicKey, oracle: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
392
|
+
initialize(admin: PublicKey, oracle: PublicKey, oracleProgram: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
392
393
|
/**
|
|
393
394
|
* Build createQuestionAdmin transaction (whitelist/admin path — status = Approved immediately).
|
|
394
395
|
* @param creator - Whitelisted creator (must be in whitelist or be admin/owner)
|
|
@@ -406,6 +407,7 @@ declare class MarketClient {
|
|
|
406
407
|
newOracle?: PublicKey;
|
|
407
408
|
isPaused?: boolean;
|
|
408
409
|
newConditionalTokensProgram?: PublicKey;
|
|
410
|
+
newOracleProgram?: PublicKey;
|
|
409
411
|
}, authority?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
410
412
|
/** Set the admin (owner only). Replaces any existing admin. */
|
|
411
413
|
addAdmin(newAdmin: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
package/dist/index.js
CHANGED
|
@@ -505,11 +505,12 @@ var MarketClient = class {
|
|
|
505
505
|
return this.provider.wallet.publicKey;
|
|
506
506
|
}
|
|
507
507
|
// ─── Instructions (return Transaction — caller signs + sends) ───────────────
|
|
508
|
-
async initialize(admin, oracle, owner = this.walletPubkey) {
|
|
508
|
+
async initialize(admin, oracle, oracleProgram, owner = this.walletPubkey) {
|
|
509
509
|
return this.program.methods.initialize({
|
|
510
510
|
admin,
|
|
511
511
|
conditionalTokensProgram: this.programIds.conditionalTokens,
|
|
512
|
-
oracle
|
|
512
|
+
oracle,
|
|
513
|
+
oracleProgram
|
|
513
514
|
}).accounts({
|
|
514
515
|
owner,
|
|
515
516
|
config: this.configPda,
|
|
@@ -576,7 +577,8 @@ var MarketClient = class {
|
|
|
576
577
|
newAdmin: params.newAdmin ?? null,
|
|
577
578
|
newOracle: params.newOracle ?? null,
|
|
578
579
|
isPaused: params.isPaused ?? null,
|
|
579
|
-
newConditionalTokensProgram: params.newConditionalTokensProgram ?? null
|
|
580
|
+
newConditionalTokensProgram: params.newConditionalTokensProgram ?? null,
|
|
581
|
+
newOracleProgram: params.newOracleProgram ?? null
|
|
580
582
|
}).accounts({
|
|
581
583
|
authority,
|
|
582
584
|
payer,
|
|
@@ -638,6 +640,7 @@ var MarketClient = class {
|
|
|
638
640
|
owner: acc.owner,
|
|
639
641
|
admin: acc.admin,
|
|
640
642
|
oracle: acc.oracle,
|
|
643
|
+
oracleProgram: acc.oracleProgram,
|
|
641
644
|
conditionalTokensProgram: acc.conditionalTokensProgram,
|
|
642
645
|
questionCount: acc.questionCount.toNumber(),
|
|
643
646
|
approvedCount: acc.approvedCount.toNumber(),
|
|
@@ -6101,7 +6104,7 @@ var question_market_default = {
|
|
|
6101
6104
|
{
|
|
6102
6105
|
name: "oracle_program",
|
|
6103
6106
|
docs: [
|
|
6104
|
-
"Oracle program (for reading QuestionResult)"
|
|
6107
|
+
"Oracle program (for reading QuestionResult) \u2014 must match config.oracle_program"
|
|
6105
6108
|
]
|
|
6106
6109
|
},
|
|
6107
6110
|
{
|
|
@@ -6724,7 +6727,14 @@ var question_market_default = {
|
|
|
6724
6727
|
{
|
|
6725
6728
|
name: "oracle",
|
|
6726
6729
|
docs: [
|
|
6727
|
-
"Oracle
|
|
6730
|
+
"Oracle config PDA that will resolve conditions"
|
|
6731
|
+
],
|
|
6732
|
+
type: "pubkey"
|
|
6733
|
+
},
|
|
6734
|
+
{
|
|
6735
|
+
name: "oracle_program",
|
|
6736
|
+
docs: [
|
|
6737
|
+
"Oracle program ID \u2014 used to validate oracle proofs in resolve_question"
|
|
6728
6738
|
],
|
|
6729
6739
|
type: "pubkey"
|
|
6730
6740
|
}
|
|
@@ -7196,7 +7206,14 @@ var question_market_default = {
|
|
|
7196
7206
|
{
|
|
7197
7207
|
name: "oracle",
|
|
7198
7208
|
docs: [
|
|
7199
|
-
"Oracle
|
|
7209
|
+
"Oracle config PDA that will resolve conditions"
|
|
7210
|
+
],
|
|
7211
|
+
type: "pubkey"
|
|
7212
|
+
},
|
|
7213
|
+
{
|
|
7214
|
+
name: "oracle_program",
|
|
7215
|
+
docs: [
|
|
7216
|
+
"Oracle program ID \u2014 pinned for CPI validation in resolve_question"
|
|
7200
7217
|
],
|
|
7201
7218
|
type: "pubkey"
|
|
7202
7219
|
},
|
|
@@ -7269,7 +7286,7 @@ var question_market_default = {
|
|
|
7269
7286
|
type: {
|
|
7270
7287
|
array: [
|
|
7271
7288
|
"u8",
|
|
7272
|
-
|
|
7289
|
+
408
|
|
7273
7290
|
]
|
|
7274
7291
|
}
|
|
7275
7292
|
}
|
|
@@ -7467,6 +7484,15 @@ var question_market_default = {
|
|
|
7467
7484
|
type: {
|
|
7468
7485
|
option: "pubkey"
|
|
7469
7486
|
}
|
|
7487
|
+
},
|
|
7488
|
+
{
|
|
7489
|
+
name: "new_oracle_program",
|
|
7490
|
+
docs: [
|
|
7491
|
+
"New oracle program ID (optional) \u2014 used to validate oracle proofs in resolve_question"
|
|
7492
|
+
],
|
|
7493
|
+
type: {
|
|
7494
|
+
option: "pubkey"
|
|
7495
|
+
}
|
|
7470
7496
|
}
|
|
7471
7497
|
]
|
|
7472
7498
|
}
|