@theliem/xmarket-sdk 3.0.1 → 3.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/fee_management-VGF77YXG.json +1337 -0
- package/dist/index.d.mts +262 -17
- package/dist/index.d.ts +262 -17
- package/dist/index.js +859 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +855 -78
- package/dist/index.mjs.map +1 -1
- package/dist/market_oracle-E6UUARGR.json +699 -0
- package/dist/{oracle-FZJJIJGI.json → oracle-O53KMXDK.json} +124 -155
- package/dist/presale-Q4NDVQFN.json +1961 -0
- package/dist/{question_market-CB6ZUZ5E.json → question_market-RP3J3N2M.json} +1485 -429
- package/package.json +1 -1
- package/src/idls/fee_management.json +1337 -0
- package/src/idls/market_oracle.json +699 -0
- package/src/idls/oracle.json +124 -155
- package/src/idls/presale.json +1961 -0
- package/src/idls/question_market.json +1485 -429
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ interface ProgramIds {
|
|
|
9
9
|
questionMarket: PublicKey;
|
|
10
10
|
hook: PublicKey;
|
|
11
11
|
clobExchange: PublicKey;
|
|
12
|
+
feeManagement?: PublicKey;
|
|
13
|
+
presale?: PublicKey;
|
|
14
|
+
marketOracle?: PublicKey;
|
|
12
15
|
}
|
|
13
16
|
interface CollateralConfig {
|
|
14
17
|
mint: PublicKey;
|
|
@@ -20,6 +23,8 @@ interface NetworkConfig {
|
|
|
20
23
|
rpcUrl: string;
|
|
21
24
|
programIds: ProgramIds;
|
|
22
25
|
defaultCollateral: CollateralConfig;
|
|
26
|
+
/** Owner of the fee_config PDA — used to auto-derive fee distribution accounts */
|
|
27
|
+
feeConfigOwner?: PublicKey;
|
|
23
28
|
}
|
|
24
29
|
type NetworkName = string;
|
|
25
30
|
|
|
@@ -93,6 +98,7 @@ interface QuestionMarketConfig {
|
|
|
93
98
|
questionCount: number;
|
|
94
99
|
approvedCount: number;
|
|
95
100
|
rejectedCount: number;
|
|
101
|
+
presaleCount: number;
|
|
96
102
|
whitelist: PublicKey[];
|
|
97
103
|
whitelistLen: number;
|
|
98
104
|
isPaused: boolean;
|
|
@@ -160,6 +166,15 @@ interface OrderStatus {
|
|
|
160
166
|
isCancelled: boolean;
|
|
161
167
|
bump: number;
|
|
162
168
|
}
|
|
169
|
+
/** Per-question fee rates, all out of FEE_DENOMINATOR (1_000_000). E.g. 2_000 = 0.2% */
|
|
170
|
+
interface QuestionFee {
|
|
171
|
+
conditionId: Uint8Array;
|
|
172
|
+
mergeFee: BN;
|
|
173
|
+
redeemFee: BN;
|
|
174
|
+
swapFee: BN;
|
|
175
|
+
bump: number;
|
|
176
|
+
}
|
|
177
|
+
declare const FEE_DENOMINATOR = 1000000;
|
|
163
178
|
/**
|
|
164
179
|
* Off-chain order struct passed as instruction data.
|
|
165
180
|
* Operator validates + submits matched order pairs on-chain.
|
|
@@ -226,9 +241,9 @@ declare class OracleClient {
|
|
|
226
241
|
configPda(owner?: PublicKey): PublicKey;
|
|
227
242
|
/** One-time setup. Caller becomes owner. */
|
|
228
243
|
initialize(admin: PublicKey): Promise<TxResult>;
|
|
229
|
-
/** Admin or owner adds an address to the oracle whitelist. */
|
|
244
|
+
/** Admin or owner adds an address to the oracle resolver whitelist. */
|
|
230
245
|
addToWhitelist(address: PublicKey, ownerPubkey?: PublicKey): Promise<TxResult>;
|
|
231
|
-
/** Admin or owner removes an address from the oracle whitelist. */
|
|
246
|
+
/** Admin or owner removes an address from the oracle resolver whitelist. */
|
|
232
247
|
removeFromWhitelist(address: PublicKey, ownerPubkey?: PublicKey): Promise<TxResult>;
|
|
233
248
|
/**
|
|
234
249
|
* Whitelisted reporter resolves a question.
|
|
@@ -400,17 +415,6 @@ declare class MarketClient {
|
|
|
400
415
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, ownerPubkey: PublicKey);
|
|
401
416
|
get walletPubkey(): PublicKey;
|
|
402
417
|
initialize(admin: PublicKey, oracle: PublicKey, owner?: PublicKey): Promise<Transaction>;
|
|
403
|
-
/**
|
|
404
|
-
* Build createQuestion transaction.
|
|
405
|
-
* @param payer - Pays rent for all new accounts (can differ from creator)
|
|
406
|
-
* @param creator - Identity of the question creator (signs but does not pay)
|
|
407
|
-
*/
|
|
408
|
-
createQuestion(params: CreateQuestionParams, oracle: PublicKey, creator?: PublicKey, payer?: PublicKey): Promise<{
|
|
409
|
-
tx: Transaction;
|
|
410
|
-
questionPda: PublicKey;
|
|
411
|
-
conditionPda: PublicKey;
|
|
412
|
-
questionId: Uint8Array;
|
|
413
|
-
}>;
|
|
414
418
|
/**
|
|
415
419
|
* Build createQuestionAdmin transaction (whitelist/admin path — status = Approved immediately).
|
|
416
420
|
* @param creator - Whitelisted creator (must be in whitelist or be admin/owner)
|
|
@@ -448,14 +452,114 @@ declare class MarketClient {
|
|
|
448
452
|
yes: Position | null;
|
|
449
453
|
no: Position | null;
|
|
450
454
|
}>;
|
|
455
|
+
/**
|
|
456
|
+
* Any user creates a presale + initial buy (question-market::create_presale).
|
|
457
|
+
* Reads agents_rev / company_rev from fee_config.
|
|
458
|
+
*
|
|
459
|
+
* @param feeConfig fee_management fee_config PDA (owner = feeConfigOwner)
|
|
460
|
+
* @param currencyMint collateral token (e.g. USDC)
|
|
461
|
+
* @param presaleIndex config.presale_count — fetch config first or pass 0 for first presale
|
|
462
|
+
*/
|
|
463
|
+
createPresale(params: {
|
|
464
|
+
price: anchor.BN;
|
|
465
|
+
startTime: anchor.BN;
|
|
466
|
+
endTime: anchor.BN;
|
|
467
|
+
initialBuyAmount: anchor.BN;
|
|
468
|
+
}, feeConfig: PublicKey, currencyMint: PublicKey, presaleIndex: anchor.BN, creator?: PublicKey, payer?: PublicKey): Promise<{
|
|
469
|
+
tx: Transaction;
|
|
470
|
+
presalePda: PublicKey;
|
|
471
|
+
qtMint: PublicKey;
|
|
472
|
+
}>;
|
|
473
|
+
/**
|
|
474
|
+
* Whitelist-only: approve presale → creates question + CTF condition + market_oracle in one tx.
|
|
475
|
+
*
|
|
476
|
+
* @param presalePda the presale account
|
|
477
|
+
* @param contentHash 32-byte hash for question content
|
|
478
|
+
* @param hookProgram token-2022 transfer hook program
|
|
479
|
+
* @param authorizedClob clob program allowed to do CTF transfers
|
|
480
|
+
* @param expirationTime Unix seconds
|
|
481
|
+
* @param creator presale creator pubkey (stored in question)
|
|
482
|
+
* @param currencyMint collateral mint
|
|
483
|
+
*/
|
|
484
|
+
approvePresale(presalePda: PublicKey, contentHash: Uint8Array, hookProgram: PublicKey, authorizedClob: PublicKey, expirationTime: anchor.BN, creator: PublicKey, currencyMint: PublicKey, caller?: PublicKey, payer?: PublicKey): Promise<{
|
|
485
|
+
tx: Transaction;
|
|
486
|
+
questionPda: PublicKey;
|
|
487
|
+
conditionPda: PublicKey;
|
|
488
|
+
marketOraclePda: PublicKey;
|
|
489
|
+
marketOracleVault: PublicKey;
|
|
490
|
+
}>;
|
|
491
|
+
/**
|
|
492
|
+
* Whitelist-only: reject presale so users can refund.
|
|
493
|
+
*/
|
|
494
|
+
rejectPresale(presalePda: PublicKey, caller?: PublicKey): Promise<Transaction>;
|
|
495
|
+
/**
|
|
496
|
+
* Whitelist-only: distribute presale vault funds → agents_rev% + company_rev% + rest to creator.
|
|
497
|
+
* Must be called after approvePresale.
|
|
498
|
+
*/
|
|
499
|
+
collectPresaleRevenue(presalePda: PublicKey, currencyMint: PublicKey, referralAddress: PublicKey, companyAddress: PublicKey, caller?: PublicKey): Promise<Transaction>;
|
|
500
|
+
/**
|
|
501
|
+
* Whitelist-only: snapshot MST supply so holders can claim trading fees.
|
|
502
|
+
* Call after oracle resolves the question.
|
|
503
|
+
*/
|
|
504
|
+
collectTradingFee(marketOraclePda: PublicKey, qtMint: PublicKey, caller?: PublicKey): Promise<Transaction>;
|
|
451
505
|
}
|
|
452
506
|
|
|
453
|
-
declare class
|
|
507
|
+
declare class FeeManagementClient {
|
|
454
508
|
private readonly program;
|
|
455
509
|
private readonly provider;
|
|
456
510
|
private readonly programIds;
|
|
457
511
|
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds);
|
|
512
|
+
initFeeConfig(admin: PublicKey, companyAddress: PublicKey, referralAddress: PublicKey, presaleRevenueAddress: PublicKey, investorsMarketRev: number, companyMarketRev: number, agentsPresaleRev: number, companyPresaleRev: number, authority: PublicKey, payer: PublicKey): Promise<TxResult>;
|
|
513
|
+
fetchFeeConfig(owner: PublicKey): Promise<any | null>;
|
|
514
|
+
/**
|
|
515
|
+
* Fetch per-question fees for a condition.
|
|
516
|
+
* Returns null if no fees have been set yet.
|
|
517
|
+
*/
|
|
518
|
+
fetchQuestionFee(conditionPda: PublicKey): Promise<QuestionFee | null>;
|
|
519
|
+
/**
|
|
520
|
+
* Set per-question fees for a condition.
|
|
521
|
+
* @param conditionPda - condition PDA from the question
|
|
522
|
+
* @param mergeFee - fee out of FEE_DENOMINATOR (1_000_000), e.g. 2_000 = 0.2%
|
|
523
|
+
* @param redeemFee - fee out of FEE_DENOMINATOR
|
|
524
|
+
* @param swapFee - trading fee out of FEE_DENOMINATOR
|
|
525
|
+
* @param feeConfigOwner - pubkey that owns the fee_config PDA (usually market deployer)
|
|
526
|
+
* @param authority - signer authorized in fee_config whitelist / admin / owner
|
|
527
|
+
* @param payer - rent + tx fee payer
|
|
528
|
+
*/
|
|
529
|
+
updateFeeConfig(companyAddress: PublicKey, referralAddress: PublicKey, presaleRevenueAddress: PublicKey, investorsMarketRev: number, companyMarketRev: number, agentsPresaleRev: number, companyPresaleRev: number, authority: PublicKey, payer: PublicKey): Promise<TxResult>;
|
|
530
|
+
setMarketFeeOverride(conditionPda: PublicKey, investors: number, company: number, isAdmin: boolean, feeConfigOwner: PublicKey, authority: PublicKey, payer: PublicKey): Promise<TxResult>;
|
|
531
|
+
buildDistributeFeeIx(conditionPda: PublicKey, amount: BN, feeConfigOwner: PublicKey, sourceAta: PublicKey, companyAta: PublicKey, marketOracleVault: PublicKey, authority: PublicKey): Promise<TransactionInstruction>;
|
|
532
|
+
distributeFee(conditionPda: PublicKey, amount: BN, feeConfigOwner: PublicKey, sourceAta: PublicKey, companyAta: PublicKey, marketOracleVault: PublicKey, authority: PublicKey): Promise<TxResult>;
|
|
533
|
+
setQuestionFee(conditionPda: PublicKey, mergeFee: BN, redeemFee: BN, swapFee: BN, feeConfigOwner: PublicKey, authority: PublicKey, payer: PublicKey): Promise<TxResult>;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
declare class ClobClient {
|
|
537
|
+
private readonly program;
|
|
538
|
+
private readonly provider;
|
|
539
|
+
private readonly programIds;
|
|
540
|
+
private readonly networkConfig;
|
|
541
|
+
/** Injected by XMarketSDK after construction — enables auto fee distribution */
|
|
542
|
+
feeClient?: FeeManagementClient;
|
|
543
|
+
feeConfigOwner?: PublicKey;
|
|
544
|
+
/** Cached company_address from fee_config to avoid repeated RPC calls */
|
|
545
|
+
private _companyAddress?;
|
|
546
|
+
/** ALT cache: condition.toBase58() → loaded ALT account */
|
|
547
|
+
private _altCache;
|
|
548
|
+
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds, networkConfig: {
|
|
549
|
+
defaultCollateral: {
|
|
550
|
+
mint: PublicKey;
|
|
551
|
+
};
|
|
552
|
+
});
|
|
553
|
+
private companyAddress;
|
|
458
554
|
get walletPubkey(): PublicKey;
|
|
555
|
+
/**
|
|
556
|
+
* Get or create an ALT for a condition.
|
|
557
|
+
* First call: creates + extends ALT on-chain, waits for activation (~2s).
|
|
558
|
+
* Subsequent calls for same condition: returns cached ALT instantly.
|
|
559
|
+
* BE devs never interact with this — called automatically by matchOrders.
|
|
560
|
+
*/
|
|
561
|
+
ensureAlt(condition: PublicKey, collateralMint: PublicKey, buyerPubkey: PublicKey, buyerNonce: anchor.BN, makers: SignedOrder[]): Promise<AddressLookupTableAccount>;
|
|
562
|
+
private _sendLegacyTx;
|
|
459
563
|
/**
|
|
460
564
|
* Send a match transaction as versioned (v0).
|
|
461
565
|
* Pass a pre-built AddressLookupTableAccount to compress account keys and
|
|
@@ -465,7 +569,7 @@ declare class ClobClient {
|
|
|
465
569
|
* If `whitelistedWallet` is provided and differs from `this.provider.wallet`,
|
|
466
570
|
* both wallets sign the transaction (whitelisted operator + payer).
|
|
467
571
|
*/
|
|
468
|
-
|
|
572
|
+
sendMatchTx(instructions: TransactionInstruction[], lookupTable?: AddressLookupTableAccount, whitelistedWallet?: anchor.Wallet): Promise<string>;
|
|
469
573
|
/** PDA for a CLOB whitelist entry. */
|
|
470
574
|
whitelistEntryPda(address: PublicKey): PublicKey;
|
|
471
575
|
configPda(): PublicKey;
|
|
@@ -496,6 +600,15 @@ declare class ClobClient {
|
|
|
496
600
|
*
|
|
497
601
|
* remaining_accounts: [hook×3] [seller×5 × N]
|
|
498
602
|
*/
|
|
603
|
+
/** Build Ed25519 + matchComplementary instructions without sending.
|
|
604
|
+
*
|
|
605
|
+
* If `buySigned.order.fee > 0` and `feeClient` + `feeConfigOwner` are wired in,
|
|
606
|
+
* automatically appends 5 fee_management remaining_accounts so the program CPIs
|
|
607
|
+
* to distribute_fee internally. No manual `feeDistribute` param needed.
|
|
608
|
+
*/
|
|
609
|
+
buildMatchComplementaryIxs(buySigned: SignedOrder, makersSigned: SignedOrder[], collateralMint: PublicKey, feeRecipient: PublicKey, whitelisted: PublicKey, opts?: {
|
|
610
|
+
marketOracleVault?: PublicKey;
|
|
611
|
+
}): Promise<TransactionInstruction[]>;
|
|
499
612
|
private matchComplementary;
|
|
500
613
|
/**
|
|
501
614
|
* MINT match: 1 YES buyer (taker) + N NO buyers (makers).
|
|
@@ -530,7 +643,19 @@ declare class ClobClient {
|
|
|
530
643
|
*
|
|
531
644
|
* All makers must have the same tokenId and side as makers[0].
|
|
532
645
|
*/
|
|
533
|
-
|
|
646
|
+
/**
|
|
647
|
+
* Auto-detect match type and execute in a single transaction.
|
|
648
|
+
* ALT is managed automatically (created on first call per condition, cached thereafter).
|
|
649
|
+
* feeRecipient and collateralMint are derived from on-chain config.
|
|
650
|
+
* Fee distribution (distribute_fee CPI) fires automatically when order.fee > 0.
|
|
651
|
+
*
|
|
652
|
+
* @param opts.marketOracleVault Required for presale markets (is_admin=false).
|
|
653
|
+
* Pass the ATA of the market_oracle PDA so 50% of fee goes there.
|
|
654
|
+
* For admin markets (is_admin=true) omit — payer is used as placeholder (no transfer).
|
|
655
|
+
*/
|
|
656
|
+
matchOrders(taker: SignedOrder, makers: SignedOrder[], opts?: {
|
|
657
|
+
marketOracleVault?: PublicKey;
|
|
658
|
+
}): Promise<TxResult>;
|
|
534
659
|
/** Add an address to the CLOB whitelist (owner only). */
|
|
535
660
|
addToWhitelist(address: PublicKey): Promise<TxResult>;
|
|
536
661
|
/** Batch-add addresses to the CLOB whitelist (owner only). All PDAs created in one tx. */
|
|
@@ -548,6 +673,102 @@ declare class ClobClient {
|
|
|
548
673
|
isOrderCancelled(maker: PublicKey, nonce: anchor.BN): Promise<boolean>;
|
|
549
674
|
}
|
|
550
675
|
|
|
676
|
+
interface PresaleInfo {
|
|
677
|
+
version: number;
|
|
678
|
+
questionMarketConfig: PublicKey;
|
|
679
|
+
presaleIndex: anchor.BN;
|
|
680
|
+
creator: PublicKey;
|
|
681
|
+
currencyMint: PublicKey;
|
|
682
|
+
qtMint: PublicKey;
|
|
683
|
+
price: anchor.BN;
|
|
684
|
+
startTime: anchor.BN;
|
|
685
|
+
endTime: anchor.BN;
|
|
686
|
+
status: "pending" | "approved" | "rejected";
|
|
687
|
+
soldTokenAmount: anchor.BN;
|
|
688
|
+
initialTokenAmountCreator: anchor.BN;
|
|
689
|
+
agentsRev: number;
|
|
690
|
+
companyRev: number;
|
|
691
|
+
referralAddress: PublicKey;
|
|
692
|
+
companyAddress: PublicKey;
|
|
693
|
+
isDistributeRevenue: boolean;
|
|
694
|
+
creatorClaimableRevenue: anchor.BN;
|
|
695
|
+
bump: number;
|
|
696
|
+
}
|
|
697
|
+
interface UserBuyRecord {
|
|
698
|
+
user: PublicKey;
|
|
699
|
+
presale: PublicKey;
|
|
700
|
+
currencyAmount: anchor.BN;
|
|
701
|
+
bump: number;
|
|
702
|
+
}
|
|
703
|
+
declare class PresaleClient {
|
|
704
|
+
private readonly program;
|
|
705
|
+
private readonly provider;
|
|
706
|
+
private readonly programIds;
|
|
707
|
+
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds);
|
|
708
|
+
get walletPubkey(): PublicKey;
|
|
709
|
+
presalePda(questionMarketConfig: PublicKey, presaleIndex: anchor.BN): PublicKey;
|
|
710
|
+
qtMintPda(presalePda: PublicKey): PublicKey;
|
|
711
|
+
qtAuthorityPda(presalePda: PublicKey): PublicKey;
|
|
712
|
+
userBuyRecordPda(presalePda: PublicKey, user: PublicKey): PublicKey;
|
|
713
|
+
/**
|
|
714
|
+
* Buy MST tokens during presale.
|
|
715
|
+
* qtAmount: amount of MST to receive (9 decimals).
|
|
716
|
+
* USDC cost = qtAmount * price / 1e9.
|
|
717
|
+
*/
|
|
718
|
+
buy(presalePda: PublicKey, qtAmount: anchor.BN, buyer?: PublicKey, payer?: PublicKey, signers?: Keypair[]): Promise<TxResult>;
|
|
719
|
+
/**
|
|
720
|
+
* Refund: burn user's MST and return USDC.
|
|
721
|
+
* Only callable when presale status = Rejected.
|
|
722
|
+
*/
|
|
723
|
+
refund(presalePda: PublicKey, user?: PublicKey, signers?: Keypair[]): Promise<TxResult>;
|
|
724
|
+
/**
|
|
725
|
+
* Creator claims their share of presale revenue after distribute_presale_revenue.
|
|
726
|
+
*/
|
|
727
|
+
claimRevenue(presalePda: PublicKey, creator?: PublicKey, signers?: Keypair[]): Promise<TxResult>;
|
|
728
|
+
/**
|
|
729
|
+
* Transfer creator_claimable_revenue (80%) to BOTMM wallet.
|
|
730
|
+
* Call after collectPresaleRevenue (distribute_presale_revenue).
|
|
731
|
+
*/
|
|
732
|
+
distributeBotmmRevenue(presalePda: PublicKey, botmmAddress: PublicKey, currencyMint?: PublicKey): Promise<Transaction>;
|
|
733
|
+
fetchPresale(presalePda: PublicKey): Promise<PresaleInfo | null>;
|
|
734
|
+
fetchUserBuyRecord(presalePda: PublicKey, user: PublicKey): Promise<UserBuyRecord | null>;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
interface MarketOracleInfo {
|
|
738
|
+
version: number;
|
|
739
|
+
question: PublicKey;
|
|
740
|
+
questionMarketConfig: PublicKey;
|
|
741
|
+
currencyMint: PublicKey;
|
|
742
|
+
creator: PublicKey;
|
|
743
|
+
qtMint: PublicKey;
|
|
744
|
+
feesDistributed: boolean;
|
|
745
|
+
qtTotalSupply: anchor.BN;
|
|
746
|
+
totalClaimed: anchor.BN;
|
|
747
|
+
bump: number;
|
|
748
|
+
}
|
|
749
|
+
interface UserClaimRecord {
|
|
750
|
+
user: PublicKey;
|
|
751
|
+
marketOracle: PublicKey;
|
|
752
|
+
hasClaimed: boolean;
|
|
753
|
+
bump: number;
|
|
754
|
+
}
|
|
755
|
+
declare class MarketOracleClient {
|
|
756
|
+
private readonly program;
|
|
757
|
+
private readonly provider;
|
|
758
|
+
private readonly programIds;
|
|
759
|
+
constructor(program: anchor.Program, provider: anchor.AnchorProvider, programIds: ProgramIds);
|
|
760
|
+
get walletPubkey(): PublicKey;
|
|
761
|
+
marketOraclePda(questionPda: PublicKey): PublicKey;
|
|
762
|
+
userClaimRecordPda(marketOraclePda: PublicKey, user: PublicKey): PublicKey;
|
|
763
|
+
/**
|
|
764
|
+
* User burns their MST and claims proportional share of oracle vault USDC.
|
|
765
|
+
* Call after market.collectTradingFee snapshotted qt supply.
|
|
766
|
+
*/
|
|
767
|
+
claimFeesShare(marketOraclePda: PublicKey, user?: PublicKey, payer?: PublicKey, signers?: Keypair[]): Promise<TxResult>;
|
|
768
|
+
fetchMarketOracle(marketOraclePda: PublicKey): Promise<MarketOracleInfo | null>;
|
|
769
|
+
fetchUserClaimRecord(marketOraclePda: PublicKey, user: PublicKey): Promise<UserClaimRecord | null>;
|
|
770
|
+
}
|
|
771
|
+
|
|
551
772
|
declare class XMarketSDK {
|
|
552
773
|
readonly provider: anchor.AnchorProvider;
|
|
553
774
|
readonly networkConfig: NetworkConfig;
|
|
@@ -558,6 +779,9 @@ declare class XMarketSDK {
|
|
|
558
779
|
private _market?;
|
|
559
780
|
private _ctf?;
|
|
560
781
|
private _clob?;
|
|
782
|
+
private _fee?;
|
|
783
|
+
private _presale?;
|
|
784
|
+
private _marketOracle?;
|
|
561
785
|
constructor(config: NetworkConfig, wallet: anchor.Wallet, marketOwner?: PublicKey);
|
|
562
786
|
private _withAddress;
|
|
563
787
|
get oracle(): OracleClient;
|
|
@@ -565,6 +789,9 @@ declare class XMarketSDK {
|
|
|
565
789
|
get market(): MarketClient;
|
|
566
790
|
get ctf(): CtfClient;
|
|
567
791
|
get clob(): ClobClient;
|
|
792
|
+
get fee(): FeeManagementClient;
|
|
793
|
+
get presale(): PresaleClient;
|
|
794
|
+
get marketOracle(): MarketOracleClient;
|
|
568
795
|
}
|
|
569
796
|
|
|
570
797
|
declare const SEEDS: {
|
|
@@ -584,6 +811,15 @@ declare const SEEDS: {
|
|
|
584
811
|
readonly extraAccountMetas: Buffer<ArrayBuffer>;
|
|
585
812
|
readonly clobConfig: Buffer<ArrayBuffer>;
|
|
586
813
|
readonly order: Buffer<ArrayBuffer>;
|
|
814
|
+
readonly feeConfig: Buffer<ArrayBuffer>;
|
|
815
|
+
readonly questionFee: Buffer<ArrayBuffer>;
|
|
816
|
+
readonly marketFee: Buffer<ArrayBuffer>;
|
|
817
|
+
readonly presale: Buffer<ArrayBuffer>;
|
|
818
|
+
readonly qtMint: Buffer<ArrayBuffer>;
|
|
819
|
+
readonly qtAuthority: Buffer<ArrayBuffer>;
|
|
820
|
+
readonly userBuy: Buffer<ArrayBuffer>;
|
|
821
|
+
readonly marketOracle: Buffer<ArrayBuffer>;
|
|
822
|
+
readonly userClaim: Buffer<ArrayBuffer>;
|
|
587
823
|
};
|
|
588
824
|
declare class PDA {
|
|
589
825
|
static questionMarketConfig(owner: PublicKey, programIds: Pick<ProgramIds, "questionMarket">): [PublicKey, number];
|
|
@@ -603,6 +839,15 @@ declare class PDA {
|
|
|
603
839
|
static extraAccountMetaList(mint: PublicKey, programIds: Pick<ProgramIds, "hook">): [PublicKey, number];
|
|
604
840
|
static clobConfig(programIds: Pick<ProgramIds, "clobExchange">): [PublicKey, number];
|
|
605
841
|
static orderStatus(maker: PublicKey, nonce: BN, programIds: Pick<ProgramIds, "clobExchange">): [PublicKey, number];
|
|
842
|
+
static feeConfig(owner: PublicKey, programIds: Pick<ProgramIds, "feeManagement">): [PublicKey, number];
|
|
843
|
+
static questionFee(conditionPda: PublicKey, programIds: Pick<ProgramIds, "feeManagement">): [PublicKey, number];
|
|
844
|
+
static marketFeeOverride(conditionPda: PublicKey, programIds: Pick<ProgramIds, "feeManagement">): [PublicKey, number];
|
|
845
|
+
static presale(questionMarketConfig: PublicKey, presaleIndex: BN, programIds: Pick<ProgramIds, "presale">): [PublicKey, number];
|
|
846
|
+
static qtMint(presalePda: PublicKey, programIds: Pick<ProgramIds, "presale">): [PublicKey, number];
|
|
847
|
+
static qtAuthority(presalePda: PublicKey, programIds: Pick<ProgramIds, "presale">): [PublicKey, number];
|
|
848
|
+
static userBuyRecord(presalePda: PublicKey, user: PublicKey, programIds: Pick<ProgramIds, "presale">): [PublicKey, number];
|
|
849
|
+
static marketOraclePda(questionPda: PublicKey, programIds: Pick<ProgramIds, "marketOracle">): [PublicKey, number];
|
|
850
|
+
static userClaimRecord(marketOraclePda: PublicKey, user: PublicKey, programIds: Pick<ProgramIds, "marketOracle">): [PublicKey, number];
|
|
606
851
|
}
|
|
607
852
|
/** Unique 32-byte question ID: SHA-256(content + timestamp). Different each call. */
|
|
608
853
|
declare function generateQuestionId(content: string, salt?: number): Uint8Array;
|
|
@@ -736,4 +981,4 @@ declare function buildApproveCollateralTx(collateralMint: PublicKey, signer: Pub
|
|
|
736
981
|
*/
|
|
737
982
|
declare function buildApproveAllOutcomeTokensTx(condition: PublicKey, signer: PublicKey, payer: PublicKey, delegate: PublicKey, programIds: ProgramIds, amount?: BN): Transaction;
|
|
738
983
|
|
|
739
|
-
export { AccountNotFoundError, ClobClient, type ClobConfig, type ClobWhitelistEntry, type CollateralConfig, type CollateralVault, type Condition, type CreateQuestionParams, CtfClient, type CtfConfig, HookClient, type HookConfig, IX_SYSVAR, InvalidParamError, MAX_APPROVE_AMOUNT, MarketClient, type MatchType, type NetworkConfig, type NetworkName, OracleClient, type OracleConfig, type Order, type OrderStatus, PDA, type Position, type ProgramIds, type Question, type QuestionMarketConfig, type QuestionResult, QuestionStatus, SEEDS, type SignedOrder, type TxResult, UnauthorizedError, XMarketError, XMarketSDK, buildApproveAllOutcomeTokensTx, buildApproveCollateralTx, buildBatchedEd25519Instruction, buildOrder, deserializeSignedOrder, detectMatchType, generateContentHash, generateQuestionId, getOrderSignBytes, serializeOrderToBytes, serializeSignedOrder, signOrder, signOrderWithKeypair, verifySignedOrder };
|
|
984
|
+
export { AccountNotFoundError, ClobClient, type ClobConfig, type ClobWhitelistEntry, type CollateralConfig, type CollateralVault, type Condition, type CreateQuestionParams, CtfClient, type CtfConfig, FEE_DENOMINATOR, FeeManagementClient, HookClient, type HookConfig, IX_SYSVAR, InvalidParamError, MAX_APPROVE_AMOUNT, MarketClient, MarketOracleClient, type MarketOracleInfo, type MatchType, type NetworkConfig, type NetworkName, OracleClient, type OracleConfig, type Order, type OrderStatus, PDA, type Position, PresaleClient, type PresaleInfo, type ProgramIds, type Question, type QuestionFee, type QuestionMarketConfig, type QuestionResult, QuestionStatus, SEEDS, type SignedOrder, type TxResult, UnauthorizedError, type UserBuyRecord, type UserClaimRecord, XMarketError, XMarketSDK, buildApproveAllOutcomeTokensTx, buildApproveCollateralTx, buildBatchedEd25519Instruction, buildOrder, deserializeSignedOrder, detectMatchType, generateContentHash, generateQuestionId, getOrderSignBytes, serializeOrderToBytes, serializeSignedOrder, signOrder, signOrderWithKeypair, verifySignedOrder };
|