@theliem/xmarket-sdk 3.18.0 → 3.20.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 +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +166 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +166 -78
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -421,6 +421,8 @@ declare class MarketClient {
|
|
|
421
421
|
readonly configPda: PublicKey;
|
|
422
422
|
/** Injected by XMarketSDK after construction — enables fetchQuestionBalances. */
|
|
423
423
|
ctfClient?: CtfClient;
|
|
424
|
+
/** Injected by XMarketSDK — fee config owner (= market owner) for MarketFeeOverride PDA derivation */
|
|
425
|
+
feeConfigOwner?: PublicKey;
|
|
424
426
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, ownerPubkey: PublicKey);
|
|
425
427
|
get walletPubkey(): PublicKey;
|
|
426
428
|
initialize(admin: PublicKey, oracle: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
@@ -450,6 +452,7 @@ declare class MarketClient {
|
|
|
450
452
|
removeFromWhitelist(address: PublicKey, authority?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
451
453
|
growConfig(owner?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
452
454
|
restoreConfig(snapshot: Buffer, owner?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
455
|
+
bumpPresaleCount(count: number, authority: PublicKey): Promise<Transaction>;
|
|
453
456
|
fetchConfig(): Promise<QuestionMarketConfig | null>;
|
|
454
457
|
fetchQuestion(questionPda: PublicKey): Promise<Question | null>;
|
|
455
458
|
questionPda(questionId: Uint8Array): PublicKey;
|
|
@@ -626,10 +629,15 @@ declare class ClobClient {
|
|
|
626
629
|
/** Injected by XMarketSDK after construction — enables auto fee distribution */
|
|
627
630
|
feeClient?: FeeManagementClient;
|
|
628
631
|
feeConfigOwner?: PublicKey;
|
|
632
|
+
/** Injected by XMarketSDK — enables auto-derive of marketOracleVault for presale markets */
|
|
633
|
+
ctfClient?: CtfClient;
|
|
634
|
+
qmConfigPda?: PublicKey;
|
|
629
635
|
/** Cached company_address from fee_config to avoid repeated RPC calls */
|
|
630
636
|
private _companyAddress?;
|
|
631
637
|
/** Cached referral_vault from fee_config */
|
|
632
638
|
private _referralVault?;
|
|
639
|
+
/** Cache: conditionPda.toBase58() → marketOracleVault ATA */
|
|
640
|
+
private _marketOracleVaultCache;
|
|
633
641
|
/** ALT cache: condition.toBase58() → loaded ALT account */
|
|
634
642
|
private _altCache;
|
|
635
643
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, networkConfig: {
|
|
@@ -639,6 +647,12 @@ declare class ClobClient {
|
|
|
639
647
|
});
|
|
640
648
|
private companyAddress;
|
|
641
649
|
private referralVault;
|
|
650
|
+
/**
|
|
651
|
+
* Derive marketOracleVault ATA for a condition, cached per condition.
|
|
652
|
+
* Works for presale markets (market_oracle initialized by approvePresale).
|
|
653
|
+
* Returns undefined if ctfClient/qmConfigPda not injected or marketOracle not configured.
|
|
654
|
+
*/
|
|
655
|
+
private getMarketOracleVault;
|
|
642
656
|
get walletPubkey(): PublicKey;
|
|
643
657
|
/**
|
|
644
658
|
* Get or create an ALT for a condition.
|
package/dist/index.d.ts
CHANGED
|
@@ -421,6 +421,8 @@ declare class MarketClient {
|
|
|
421
421
|
readonly configPda: PublicKey;
|
|
422
422
|
/** Injected by XMarketSDK after construction — enables fetchQuestionBalances. */
|
|
423
423
|
ctfClient?: CtfClient;
|
|
424
|
+
/** Injected by XMarketSDK — fee config owner (= market owner) for MarketFeeOverride PDA derivation */
|
|
425
|
+
feeConfigOwner?: PublicKey;
|
|
424
426
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, ownerPubkey: PublicKey);
|
|
425
427
|
get walletPubkey(): PublicKey;
|
|
426
428
|
initialize(admin: PublicKey, oracle: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
@@ -450,6 +452,7 @@ declare class MarketClient {
|
|
|
450
452
|
removeFromWhitelist(address: PublicKey, authority?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
451
453
|
growConfig(owner?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
452
454
|
restoreConfig(snapshot: Buffer, owner?: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
455
|
+
bumpPresaleCount(count: number, authority: PublicKey): Promise<Transaction>;
|
|
453
456
|
fetchConfig(): Promise<QuestionMarketConfig | null>;
|
|
454
457
|
fetchQuestion(questionPda: PublicKey): Promise<Question | null>;
|
|
455
458
|
questionPda(questionId: Uint8Array): PublicKey;
|
|
@@ -626,10 +629,15 @@ declare class ClobClient {
|
|
|
626
629
|
/** Injected by XMarketSDK after construction — enables auto fee distribution */
|
|
627
630
|
feeClient?: FeeManagementClient;
|
|
628
631
|
feeConfigOwner?: PublicKey;
|
|
632
|
+
/** Injected by XMarketSDK — enables auto-derive of marketOracleVault for presale markets */
|
|
633
|
+
ctfClient?: CtfClient;
|
|
634
|
+
qmConfigPda?: PublicKey;
|
|
629
635
|
/** Cached company_address from fee_config to avoid repeated RPC calls */
|
|
630
636
|
private _companyAddress?;
|
|
631
637
|
/** Cached referral_vault from fee_config */
|
|
632
638
|
private _referralVault?;
|
|
639
|
+
/** Cache: conditionPda.toBase58() → marketOracleVault ATA */
|
|
640
|
+
private _marketOracleVaultCache;
|
|
633
641
|
/** ALT cache: condition.toBase58() → loaded ALT account */
|
|
634
642
|
private _altCache;
|
|
635
643
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, networkConfig: {
|
|
@@ -639,6 +647,12 @@ declare class ClobClient {
|
|
|
639
647
|
});
|
|
640
648
|
private companyAddress;
|
|
641
649
|
private referralVault;
|
|
650
|
+
/**
|
|
651
|
+
* Derive marketOracleVault ATA for a condition, cached per condition.
|
|
652
|
+
* Works for presale markets (market_oracle initialized by approvePresale).
|
|
653
|
+
* Returns undefined if ctfClient/qmConfigPda not injected or marketOracle not configured.
|
|
654
|
+
*/
|
|
655
|
+
private getMarketOracleVault;
|
|
642
656
|
get walletPubkey(): PublicKey;
|
|
643
657
|
/**
|
|
644
658
|
* Get or create an ALT for a condition.
|
package/dist/index.js
CHANGED
|
@@ -597,7 +597,10 @@ var MarketClient = class {
|
|
|
597
597
|
const [mintAuthority] = PDA.mintAuthority(conditionPda, this.programIds);
|
|
598
598
|
const [collateralVault] = PDA.collateralVault(params.collateralMint, this.programIds);
|
|
599
599
|
if (!this.programIds.feeManagement) throw new Error("feeManagement program ID not configured");
|
|
600
|
+
if (!this.feeConfigOwner) throw new Error("feeConfigOwner not configured");
|
|
600
601
|
const [questionFeePda] = PDA.questionFee(conditionPda, this.programIds);
|
|
602
|
+
const [feeConfigPda] = PDA.feeConfig(this.feeConfigOwner, this.programIds);
|
|
603
|
+
const [marketFeeOverride] = PDA.marketFeeOverride(conditionPda, this.programIds);
|
|
601
604
|
const tx = await this.program.methods.createQuestionAdmin({
|
|
602
605
|
questionId: Array.from(questionId),
|
|
603
606
|
contentHash: Array.from(contentHash),
|
|
@@ -618,6 +621,8 @@ var MarketClient = class {
|
|
|
618
621
|
collateralVault,
|
|
619
622
|
conditionalTokensProgram: this.programIds.conditionalTokens,
|
|
620
623
|
questionFee: questionFeePda,
|
|
624
|
+
feeConfig: feeConfigPda,
|
|
625
|
+
marketFeeOverride,
|
|
621
626
|
feeManagementProgram: this.programIds.feeManagement,
|
|
622
627
|
tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
|
|
623
628
|
systemProgram: web3_js.SystemProgram.programId,
|
|
@@ -689,6 +694,9 @@ var MarketClient = class {
|
|
|
689
694
|
systemProgram: web3_js.SystemProgram.programId
|
|
690
695
|
}).transaction();
|
|
691
696
|
}
|
|
697
|
+
async bumpPresaleCount(count, authority) {
|
|
698
|
+
return this.program.methods.bumpPresaleCount(new anchor5__namespace.BN(count)).accounts({ authority, config: this.configPda }).transaction();
|
|
699
|
+
}
|
|
692
700
|
// ─── Queries ─────────────────────────────────────────────────────────────────
|
|
693
701
|
async fetchConfig() {
|
|
694
702
|
try {
|
|
@@ -855,6 +863,9 @@ var MarketClient = class {
|
|
|
855
863
|
const [adminConfig] = PDA.adminConfig(adminOwner, this.programIds);
|
|
856
864
|
const adminVault = splToken.getAssociatedTokenAddressSync(currencyMint, adminConfig, true);
|
|
857
865
|
const [claimRecord] = PDA.claimRecord(conditionPda.toBytes(), this.programIds);
|
|
866
|
+
const feeConfigOwner = this.feeConfigOwner ?? adminOwner;
|
|
867
|
+
const [feeConfigPda] = PDA.feeConfig(feeConfigOwner, this.programIds);
|
|
868
|
+
const [marketFeeOverride] = PDA.marketFeeOverride(conditionPda, this.programIds);
|
|
858
869
|
const builder = this.program.methods.approvePresale({
|
|
859
870
|
contentHash: Array.from(contentHash),
|
|
860
871
|
hookProgram,
|
|
@@ -883,6 +894,8 @@ var MarketClient = class {
|
|
|
883
894
|
adminConfig,
|
|
884
895
|
claimRecord,
|
|
885
896
|
questionFee: questionFeePda,
|
|
897
|
+
feeConfig: feeConfigPda,
|
|
898
|
+
marketFeeOverride,
|
|
886
899
|
feeManagementProgram: this.programIds.feeManagement,
|
|
887
900
|
conditionalTokensProgram: this.programIds.conditionalTokens,
|
|
888
901
|
presaleProgram: this.programIds.presale,
|
|
@@ -1546,6 +1559,8 @@ function _detectMatchType(a, b) {
|
|
|
1546
1559
|
// src/programs/clob.ts
|
|
1547
1560
|
var ClobClient = class {
|
|
1548
1561
|
constructor(program, provider, programIds, networkConfig) {
|
|
1562
|
+
/** Cache: conditionPda.toBase58() → marketOracleVault ATA */
|
|
1563
|
+
this._marketOracleVaultCache = /* @__PURE__ */ new Map();
|
|
1549
1564
|
/** ALT cache: condition.toBase58() → loaded ALT account */
|
|
1550
1565
|
this._altCache = /* @__PURE__ */ new Map();
|
|
1551
1566
|
this.program = program;
|
|
@@ -1568,6 +1583,24 @@ var ClobClient = class {
|
|
|
1568
1583
|
await this.companyAddress();
|
|
1569
1584
|
return this._referralVault;
|
|
1570
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Derive marketOracleVault ATA for a condition, cached per condition.
|
|
1588
|
+
* Works for presale markets (market_oracle initialized by approvePresale).
|
|
1589
|
+
* Returns undefined if ctfClient/qmConfigPda not injected or marketOracle not configured.
|
|
1590
|
+
*/
|
|
1591
|
+
async getMarketOracleVault(condition, collateralMint) {
|
|
1592
|
+
if (!this.ctfClient || !this.qmConfigPda || !this.programIds.marketOracle) return void 0;
|
|
1593
|
+
const key = condition.toBase58();
|
|
1594
|
+
const cached = this._marketOracleVaultCache.get(key);
|
|
1595
|
+
if (cached) return cached;
|
|
1596
|
+
const cond = await this.ctfClient.fetchCondition(condition);
|
|
1597
|
+
if (!cond) return void 0;
|
|
1598
|
+
const [questionPda] = PDA.question(this.qmConfigPda, cond.questionId, this.programIds);
|
|
1599
|
+
const [marketOraclePda] = PDA.marketOraclePda(questionPda, this.programIds);
|
|
1600
|
+
const vault = splToken.getAssociatedTokenAddressSync(collateralMint, marketOraclePda, true);
|
|
1601
|
+
this._marketOracleVaultCache.set(key, vault);
|
|
1602
|
+
return vault;
|
|
1603
|
+
}
|
|
1571
1604
|
get walletPubkey() {
|
|
1572
1605
|
return this.provider.wallet.publicKey;
|
|
1573
1606
|
}
|
|
@@ -1667,11 +1700,11 @@ var ClobClient = class {
|
|
|
1667
1700
|
if (companyAddr) {
|
|
1668
1701
|
addresses.push(splToken.getAssociatedTokenAddressSync(collateralMint, companyAddr));
|
|
1669
1702
|
}
|
|
1670
|
-
|
|
1703
|
+
const oracleVaultForAlt = await this.getMarketOracleVault(condition, collateralMint) ?? payer;
|
|
1704
|
+
addresses.push(oracleVaultForAlt);
|
|
1671
1705
|
if (refVault) {
|
|
1672
1706
|
addresses.push(refVault);
|
|
1673
1707
|
}
|
|
1674
|
-
addresses.push(splToken.TOKEN_PROGRAM_ID);
|
|
1675
1708
|
}
|
|
1676
1709
|
const slot = await connection.getSlot("finalized");
|
|
1677
1710
|
const [createIx, altAddress] = web3_js.AddressLookupTableProgram.createLookupTable({
|
|
@@ -1934,7 +1967,7 @@ ${logs.join("\n")}`);
|
|
|
1934
1967
|
const feeOverridePda = PDA.marketFeeOverride(condition, this.programIds)[0];
|
|
1935
1968
|
const feeOverrideExists = await this.provider.connection.getAccountInfo(feeOverridePda);
|
|
1936
1969
|
if (feeOverrideExists) {
|
|
1937
|
-
const oracleVault = opts?.marketOracleVault ?? this.walletPubkey;
|
|
1970
|
+
const oracleVault = opts?.marketOracleVault ?? await this.getMarketOracleVault(condition, collateralMint) ?? this.walletPubkey;
|
|
1938
1971
|
feeAccounts = [
|
|
1939
1972
|
{ pubkey: this.programIds.feeManagement, isSigner: false, isWritable: false },
|
|
1940
1973
|
{ pubkey: PDA.feeConfig(this.feeConfigOwner, this.programIds)[0], isSigner: false, isWritable: false },
|
|
@@ -2190,15 +2223,14 @@ ${logs.join("\n")}`);
|
|
|
2190
2223
|
const feeOverridePda = PDA.marketFeeOverride(condition, this.programIds)[0];
|
|
2191
2224
|
const feeOverrideExists = await this.provider.connection.getAccountInfo(feeOverridePda);
|
|
2192
2225
|
if (feeOverrideExists) {
|
|
2193
|
-
const oracleVault = opts?.marketOracleVault ?? payer;
|
|
2226
|
+
const oracleVault = opts?.marketOracleVault ?? await this.getMarketOracleVault(condition, collateralMint) ?? payer;
|
|
2194
2227
|
remainingAccounts.push(
|
|
2195
2228
|
{ pubkey: this.programIds.feeManagement, isSigner: false, isWritable: false },
|
|
2196
2229
|
{ pubkey: PDA.feeConfig(this.feeConfigOwner, this.programIds)[0], isSigner: false, isWritable: false },
|
|
2197
2230
|
{ pubkey: feeOverridePda, isSigner: false, isWritable: false },
|
|
2198
2231
|
{ pubkey: splToken.getAssociatedTokenAddressSync(collateralMint, companyAddr), isSigner: false, isWritable: true },
|
|
2199
2232
|
{ pubkey: oracleVault, isSigner: false, isWritable: true },
|
|
2200
|
-
{ pubkey: refVault, isSigner: false, isWritable: true }
|
|
2201
|
-
{ pubkey: splToken.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false }
|
|
2233
|
+
{ pubkey: refVault, isSigner: false, isWritable: true }
|
|
2202
2234
|
);
|
|
2203
2235
|
}
|
|
2204
2236
|
}
|
|
@@ -2524,7 +2556,7 @@ ${logs.join("\n")}`);
|
|
|
2524
2556
|
const feeOverridePda = PDA.marketFeeOverride(condition, this.programIds)[0];
|
|
2525
2557
|
const feeOverrideExists = await this.provider.connection.getAccountInfo(feeOverridePda);
|
|
2526
2558
|
if (feeOverrideExists) {
|
|
2527
|
-
const oracleVault = opts?.marketOracleVault ?? payer;
|
|
2559
|
+
const oracleVault = opts?.marketOracleVault ?? await this.getMarketOracleVault(condition, collateralMint) ?? payer;
|
|
2528
2560
|
feeAccounts = [
|
|
2529
2561
|
{ pubkey: this.programIds.feeManagement, isSigner: false, isWritable: false },
|
|
2530
2562
|
{ pubkey: PDA.feeConfig(this.feeConfigOwner, this.programIds)[0], isSigner: false, isWritable: false },
|
|
@@ -3871,7 +3903,7 @@ var oracle_default = {
|
|
|
3871
3903
|
|
|
3872
3904
|
// src/idls/hook.json
|
|
3873
3905
|
var hook_default = {
|
|
3874
|
-
address: "
|
|
3906
|
+
address: "5DnFGrt8BGjybNA3EMFKwV1Yvw9iVzJXC7zqP94R7iEV",
|
|
3875
3907
|
metadata: {
|
|
3876
3908
|
name: "hook",
|
|
3877
3909
|
version: "0.1.0",
|
|
@@ -3896,12 +3928,7 @@ var hook_default = {
|
|
|
3896
3928
|
],
|
|
3897
3929
|
accounts: [
|
|
3898
3930
|
{
|
|
3899
|
-
name: "
|
|
3900
|
-
signer: true
|
|
3901
|
-
},
|
|
3902
|
-
{
|
|
3903
|
-
name: "payer",
|
|
3904
|
-
writable: true,
|
|
3931
|
+
name: "admin",
|
|
3905
3932
|
signer: true
|
|
3906
3933
|
},
|
|
3907
3934
|
{
|
|
@@ -4032,12 +4059,7 @@ var hook_default = {
|
|
|
4032
4059
|
],
|
|
4033
4060
|
accounts: [
|
|
4034
4061
|
{
|
|
4035
|
-
name: "
|
|
4036
|
-
signer: true
|
|
4037
|
-
},
|
|
4038
|
-
{
|
|
4039
|
-
name: "payer",
|
|
4040
|
-
writable: true,
|
|
4062
|
+
name: "admin",
|
|
4041
4063
|
signer: true
|
|
4042
4064
|
},
|
|
4043
4065
|
{
|
|
@@ -4186,7 +4208,7 @@ var hook_default = {
|
|
|
4186
4208
|
],
|
|
4187
4209
|
accounts: [
|
|
4188
4210
|
{
|
|
4189
|
-
name: "
|
|
4211
|
+
name: "admin",
|
|
4190
4212
|
writable: true,
|
|
4191
4213
|
signer: true
|
|
4192
4214
|
},
|
|
@@ -4245,12 +4267,7 @@ var hook_default = {
|
|
|
4245
4267
|
],
|
|
4246
4268
|
accounts: [
|
|
4247
4269
|
{
|
|
4248
|
-
name: "
|
|
4249
|
-
signer: true
|
|
4250
|
-
},
|
|
4251
|
-
{
|
|
4252
|
-
name: "payer",
|
|
4253
|
-
writable: true,
|
|
4270
|
+
name: "admin",
|
|
4254
4271
|
signer: true
|
|
4255
4272
|
},
|
|
4256
4273
|
{
|
|
@@ -4304,36 +4321,42 @@ var hook_default = {
|
|
|
4304
4321
|
types: [
|
|
4305
4322
|
{
|
|
4306
4323
|
name: "HookConfig",
|
|
4324
|
+
docs: [
|
|
4325
|
+
"Global config for the Hook program.",
|
|
4326
|
+
"Stores the whitelist of programs allowed to transfer YES/NO Token-2022 tokens."
|
|
4327
|
+
],
|
|
4307
4328
|
type: {
|
|
4308
4329
|
kind: "struct",
|
|
4309
4330
|
fields: [
|
|
4310
4331
|
{
|
|
4311
|
-
name: "
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
name: "owner",
|
|
4332
|
+
name: "admin",
|
|
4333
|
+
docs: [
|
|
4334
|
+
"Admin who can update the whitelist (should be a multisig)"
|
|
4335
|
+
],
|
|
4316
4336
|
type: "pubkey"
|
|
4317
4337
|
},
|
|
4318
4338
|
{
|
|
4319
4339
|
name: "whitelist",
|
|
4340
|
+
docs: [
|
|
4341
|
+
"Programs allowed to initiate or receive YES/NO token transfers.",
|
|
4342
|
+
"Typically: CTF program PDA, CLOB program PDA."
|
|
4343
|
+
],
|
|
4320
4344
|
type: {
|
|
4321
|
-
|
|
4322
|
-
"pubkey",
|
|
4323
|
-
10
|
|
4324
|
-
]
|
|
4345
|
+
vec: "pubkey"
|
|
4325
4346
|
}
|
|
4326
4347
|
},
|
|
4327
|
-
{
|
|
4328
|
-
name: "whitelist_len",
|
|
4329
|
-
type: "u8"
|
|
4330
|
-
},
|
|
4331
4348
|
{
|
|
4332
4349
|
name: "is_frozen",
|
|
4350
|
+
docs: [
|
|
4351
|
+
"If true, whitelist can no longer be modified (locked forever)"
|
|
4352
|
+
],
|
|
4333
4353
|
type: "bool"
|
|
4334
4354
|
},
|
|
4335
4355
|
{
|
|
4336
4356
|
name: "bump",
|
|
4357
|
+
docs: [
|
|
4358
|
+
"Bump for this PDA"
|
|
4359
|
+
],
|
|
4337
4360
|
type: "u8"
|
|
4338
4361
|
},
|
|
4339
4362
|
{
|
|
@@ -4341,7 +4364,7 @@ var hook_default = {
|
|
|
4341
4364
|
type: {
|
|
4342
4365
|
array: [
|
|
4343
4366
|
"u8",
|
|
4344
|
-
|
|
4367
|
+
32
|
|
4345
4368
|
]
|
|
4346
4369
|
}
|
|
4347
4370
|
}
|
|
@@ -4671,6 +4694,20 @@ var question_market_default = {
|
|
|
4671
4694
|
],
|
|
4672
4695
|
writable: true
|
|
4673
4696
|
},
|
|
4697
|
+
{
|
|
4698
|
+
name: "fee_config",
|
|
4699
|
+
docs: [
|
|
4700
|
+
"FeeConfig PDA \u2014 passed to set_market_fee_override CPI."
|
|
4701
|
+
],
|
|
4702
|
+
writable: true
|
|
4703
|
+
},
|
|
4704
|
+
{
|
|
4705
|
+
name: "market_fee_override",
|
|
4706
|
+
docs: [
|
|
4707
|
+
"MarketFeeOverride PDA \u2014 auto-init with is_admin=false and fee_config defaults."
|
|
4708
|
+
],
|
|
4709
|
+
writable: true
|
|
4710
|
+
},
|
|
4674
4711
|
{
|
|
4675
4712
|
name: "fee_management_program",
|
|
4676
4713
|
address: "DuYyXguB5PVSKg6E2p4XPrrXZSCJnuBhoGpkGCBN5bBb"
|
|
@@ -4776,6 +4813,55 @@ var question_market_default = {
|
|
|
4776
4813
|
],
|
|
4777
4814
|
args: []
|
|
4778
4815
|
},
|
|
4816
|
+
{
|
|
4817
|
+
name: "bump_presale_count",
|
|
4818
|
+
discriminator: [
|
|
4819
|
+
42,
|
|
4820
|
+
84,
|
|
4821
|
+
98,
|
|
4822
|
+
9,
|
|
4823
|
+
208,
|
|
4824
|
+
168,
|
|
4825
|
+
38,
|
|
4826
|
+
55
|
|
4827
|
+
],
|
|
4828
|
+
accounts: [
|
|
4829
|
+
{
|
|
4830
|
+
name: "authority",
|
|
4831
|
+
signer: true
|
|
4832
|
+
},
|
|
4833
|
+
{
|
|
4834
|
+
name: "config",
|
|
4835
|
+
writable: true,
|
|
4836
|
+
pda: {
|
|
4837
|
+
seeds: [
|
|
4838
|
+
{
|
|
4839
|
+
kind: "const",
|
|
4840
|
+
value: [
|
|
4841
|
+
99,
|
|
4842
|
+
111,
|
|
4843
|
+
110,
|
|
4844
|
+
102,
|
|
4845
|
+
105,
|
|
4846
|
+
103
|
|
4847
|
+
]
|
|
4848
|
+
},
|
|
4849
|
+
{
|
|
4850
|
+
kind: "account",
|
|
4851
|
+
path: "config.owner",
|
|
4852
|
+
account: "QuestionMarketConfig"
|
|
4853
|
+
}
|
|
4854
|
+
]
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
],
|
|
4858
|
+
args: [
|
|
4859
|
+
{
|
|
4860
|
+
name: "count",
|
|
4861
|
+
type: "u64"
|
|
4862
|
+
}
|
|
4863
|
+
]
|
|
4864
|
+
},
|
|
4779
4865
|
{
|
|
4780
4866
|
name: "collect_presale_revenue",
|
|
4781
4867
|
discriminator: [
|
|
@@ -5332,39 +5418,23 @@ var question_market_default = {
|
|
|
5332
5418
|
{
|
|
5333
5419
|
name: "question_fee",
|
|
5334
5420
|
docs: [
|
|
5335
|
-
"QuestionFee PDA \u2014 initialized with default fees via CPI to fee-management."
|
|
5336
|
-
"Seed uses condition.key() bytes (consistent with existing set_question_fee SDK convention)."
|
|
5421
|
+
"QuestionFee PDA \u2014 initialized with default fees via CPI to fee-management."
|
|
5337
5422
|
],
|
|
5338
|
-
writable: true
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
102,
|
|
5354
|
-
101,
|
|
5355
|
-
101
|
|
5356
|
-
]
|
|
5357
|
-
},
|
|
5358
|
-
{
|
|
5359
|
-
kind: "account",
|
|
5360
|
-
path: "condition"
|
|
5361
|
-
}
|
|
5362
|
-
],
|
|
5363
|
-
program: {
|
|
5364
|
-
kind: "account",
|
|
5365
|
-
path: "fee_management_program"
|
|
5366
|
-
}
|
|
5367
|
-
}
|
|
5423
|
+
writable: true
|
|
5424
|
+
},
|
|
5425
|
+
{
|
|
5426
|
+
name: "fee_config",
|
|
5427
|
+
docs: [
|
|
5428
|
+
"FeeConfig PDA \u2014 passed to set_market_fee_override CPI as authority validator."
|
|
5429
|
+
],
|
|
5430
|
+
writable: true
|
|
5431
|
+
},
|
|
5432
|
+
{
|
|
5433
|
+
name: "market_fee_override",
|
|
5434
|
+
docs: [
|
|
5435
|
+
"MarketFeeOverride PDA \u2014 init'd by set_market_fee_override CPI (is_admin=true)."
|
|
5436
|
+
],
|
|
5437
|
+
writable: true
|
|
5368
5438
|
},
|
|
5369
5439
|
{
|
|
5370
5440
|
name: "fee_management_program",
|
|
@@ -6337,7 +6407,8 @@ var question_market_default = {
|
|
|
6337
6407
|
{
|
|
6338
6408
|
name: "investors_market_rev",
|
|
6339
6409
|
docs: [
|
|
6340
|
-
"Market revenue split
|
|
6410
|
+
"Market revenue split \u2014 three parts must sum to FEE_DENOMINATOR (10_000).",
|
|
6411
|
+
"investors_market_rev + company_market_rev + referral_market_rev == 10_000"
|
|
6341
6412
|
],
|
|
6342
6413
|
type: "u32"
|
|
6343
6414
|
},
|
|
@@ -6348,7 +6419,7 @@ var question_market_default = {
|
|
|
6348
6419
|
{
|
|
6349
6420
|
name: "agents_presale_rev",
|
|
6350
6421
|
docs: [
|
|
6351
|
-
"Presale revenue split: agents + company (out of FEE_DENOMINATOR =
|
|
6422
|
+
"Presale revenue split: agents + company (out of FEE_DENOMINATOR = 10_000)"
|
|
6352
6423
|
],
|
|
6353
6424
|
type: "u32"
|
|
6354
6425
|
},
|
|
@@ -6373,12 +6444,26 @@ var question_market_default = {
|
|
|
6373
6444
|
name: "bump",
|
|
6374
6445
|
type: "u8"
|
|
6375
6446
|
},
|
|
6447
|
+
{
|
|
6448
|
+
name: "referral_market_rev",
|
|
6449
|
+
docs: [
|
|
6450
|
+
"Share of market trading fees routed to referral_vault (e.g. 2_000 = 20%)"
|
|
6451
|
+
],
|
|
6452
|
+
type: "u32"
|
|
6453
|
+
},
|
|
6454
|
+
{
|
|
6455
|
+
name: "referral_vault",
|
|
6456
|
+
docs: [
|
|
6457
|
+
"ATA of referral program config PDA \u2014 receives referral_market_rev% of trading fees"
|
|
6458
|
+
],
|
|
6459
|
+
type: "pubkey"
|
|
6460
|
+
},
|
|
6376
6461
|
{
|
|
6377
6462
|
name: "_reserved",
|
|
6378
6463
|
type: {
|
|
6379
6464
|
array: [
|
|
6380
6465
|
"u8",
|
|
6381
|
-
|
|
6466
|
+
28
|
|
6382
6467
|
]
|
|
6383
6468
|
}
|
|
6384
6469
|
}
|
|
@@ -6915,7 +7000,7 @@ var question_market_default = {
|
|
|
6915
7000
|
type: {
|
|
6916
7001
|
array: [
|
|
6917
7002
|
"pubkey",
|
|
6918
|
-
|
|
7003
|
+
20
|
|
6919
7004
|
]
|
|
6920
7005
|
}
|
|
6921
7006
|
},
|
|
@@ -6955,7 +7040,7 @@ var question_market_default = {
|
|
|
6955
7040
|
type: {
|
|
6956
7041
|
array: [
|
|
6957
7042
|
"u8",
|
|
6958
|
-
|
|
7043
|
+
440
|
|
6959
7044
|
]
|
|
6960
7045
|
}
|
|
6961
7046
|
}
|
|
@@ -16306,6 +16391,7 @@ var XMarketSDK = class {
|
|
|
16306
16391
|
const program = new anchor5__namespace.Program(this._withAddress(question_market_default, this._programIds.questionMarket), this.provider);
|
|
16307
16392
|
this._market = new MarketClient(program, this.provider, this._programIds, this._marketOwner);
|
|
16308
16393
|
this._market.ctfClient = this.ctf;
|
|
16394
|
+
this._market.feeConfigOwner = this.networkConfig.feeConfigOwner ?? this._marketOwner;
|
|
16309
16395
|
}
|
|
16310
16396
|
return this._market;
|
|
16311
16397
|
}
|
|
@@ -16324,6 +16410,8 @@ var XMarketSDK = class {
|
|
|
16324
16410
|
this._clob.feeConfigOwner = this.networkConfig.feeConfigOwner;
|
|
16325
16411
|
this._clob.feeClient = this.fee;
|
|
16326
16412
|
}
|
|
16413
|
+
this._clob.ctfClient = this.ctf;
|
|
16414
|
+
this._clob.qmConfigPda = this.market.configPda;
|
|
16327
16415
|
}
|
|
16328
16416
|
return this._clob;
|
|
16329
16417
|
}
|