@theliem/xmarket-sdk 3.2.0 → 3.3.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
@@ -155,15 +155,10 @@ interface ClobConfig {
155
155
  isPaused: boolean;
156
156
  bump: number;
157
157
  }
158
- interface ClobWhitelistEntry {
159
- address: PublicKey;
160
- bump: number;
161
- }
162
158
  interface OrderStatus {
163
159
  maker: PublicKey;
164
160
  nonce: BN;
165
161
  filledAmount: BN;
166
- isCancelled: boolean;
167
162
  bump: number;
168
163
  }
169
164
  /** Per-question fee rates, all out of FEE_DENOMINATOR (1_000_000). E.g. 2_000 = 0.2% */
@@ -567,8 +562,6 @@ declare class ClobClient {
567
562
  * both wallets sign the transaction (whitelisted operator + payer).
568
563
  */
569
564
  sendMatchTx(instructions: TransactionInstruction[], lookupTable?: AddressLookupTableAccount, whitelistedWallet?: anchor.Wallet): Promise<string>;
570
- /** PDA for a CLOB whitelist entry. */
571
- whitelistEntryPda(address: PublicKey): PublicKey;
572
565
  configPda(): PublicKey;
573
566
  /** One-time setup. Caller becomes admin. */
574
567
  initialize(operators: PublicKey[], feeRecipient: PublicKey, feeRateBps: number): Promise<TxResult>;
@@ -578,11 +571,6 @@ declare class ClobClient {
578
571
  removeOperator(operator: PublicKey): Promise<TxResult>;
579
572
  /** Admin pause/unpause the CLOB. */
580
573
  setPaused(paused: boolean): Promise<TxResult>;
581
- /**
582
- * Maker cancels their own order.
583
- * OrderStatus PDA is marked cancelled — any future fill rejected.
584
- */
585
- cancelOrder(nonce: anchor.BN): Promise<TxResult>;
586
574
  /**
587
575
  * Emergency reset of CLOB config (upgrade authority only).
588
576
  */
@@ -603,7 +591,7 @@ declare class ClobClient {
603
591
  * automatically appends 5 fee_management remaining_accounts so the program CPIs
604
592
  * to distribute_fee internally. No manual `feeDistribute` param needed.
605
593
  */
606
- buildMatchComplementaryIxs(buySigned: SignedOrder, makersSigned: SignedOrder[], collateralMint: PublicKey, feeRecipient: PublicKey, whitelisted: PublicKey, opts?: {
594
+ buildMatchComplementaryIxs(buySigned: SignedOrder, makersSigned: SignedOrder[], collateralMint: PublicKey, feeRecipient: PublicKey, operator: PublicKey, opts?: {
607
595
  marketOracleVault?: PublicKey;
608
596
  }): Promise<TransactionInstruction[]>;
609
597
  private matchComplementary;
@@ -653,21 +641,8 @@ declare class ClobClient {
653
641
  matchOrders(taker: SignedOrder, makers: SignedOrder[], opts?: {
654
642
  marketOracleVault?: PublicKey;
655
643
  }): Promise<TxResult>;
656
- /** Add an address to the CLOB whitelist (owner only). */
657
- addToWhitelist(address: PublicKey): Promise<TxResult>;
658
- /** Batch-add addresses to the CLOB whitelist (owner only). All PDAs created in one tx. */
659
- addToWhitelistBatch(addresses: PublicKey[]): Promise<TxResult>;
660
- /** Remove an address from the CLOB whitelist (owner only). */
661
- removeFromWhitelist(address: PublicKey, rentReceiver?: PublicKey): Promise<TxResult>;
662
- /** Fetch a whitelist entry PDA (returns null if address is not whitelisted). */
663
- fetchWhitelistEntry(address: PublicKey): Promise<ClobWhitelistEntry | null>;
664
- /** Check if an address is on the CLOB whitelist. */
665
- isWhitelisted(address: PublicKey): Promise<boolean>;
666
- /** Fetch all whitelisted addresses (scans all ClobWhitelistEntry accounts). */
667
- fetchWhitelist(): Promise<PublicKey[]>;
668
644
  fetchConfig(): Promise<ClobConfig | null>;
669
645
  fetchOrderStatus(maker: PublicKey, nonce: anchor.BN): Promise<OrderStatus | null>;
670
- isOrderCancelled(maker: PublicKey, nonce: anchor.BN): Promise<boolean>;
671
646
  }
672
647
 
673
648
  interface PresaleInfo {
@@ -717,7 +692,7 @@ declare class PresaleClient {
717
692
  * Refund: burn user's MST and return USDC.
718
693
  * Only callable when presale status = Rejected.
719
694
  */
720
- refund(presalePda: PublicKey, user?: PublicKey): Promise<Transaction>;
695
+ refund(presalePda: PublicKey, user?: PublicKey, payer?: PublicKey): Promise<Transaction>;
721
696
  fetchPresale(presalePda: PublicKey): Promise<PresaleInfo | null>;
722
697
  fetchUserBuyRecord(presalePda: PublicKey, user: PublicKey): Promise<UserBuyRecord | null>;
723
698
  }
@@ -969,4 +944,4 @@ declare function buildApproveCollateralTx(collateralMint: PublicKey, signer: Pub
969
944
  */
970
945
  declare function buildApproveAllOutcomeTokensTx(condition: PublicKey, signer: PublicKey, payer: PublicKey, delegate: PublicKey, programIds: ProgramIds, amount?: BN): Transaction;
971
946
 
972
- 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 };
947
+ export { AccountNotFoundError, ClobClient, type ClobConfig, 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 };
package/dist/index.d.ts CHANGED
@@ -155,15 +155,10 @@ interface ClobConfig {
155
155
  isPaused: boolean;
156
156
  bump: number;
157
157
  }
158
- interface ClobWhitelistEntry {
159
- address: PublicKey;
160
- bump: number;
161
- }
162
158
  interface OrderStatus {
163
159
  maker: PublicKey;
164
160
  nonce: BN;
165
161
  filledAmount: BN;
166
- isCancelled: boolean;
167
162
  bump: number;
168
163
  }
169
164
  /** Per-question fee rates, all out of FEE_DENOMINATOR (1_000_000). E.g. 2_000 = 0.2% */
@@ -567,8 +562,6 @@ declare class ClobClient {
567
562
  * both wallets sign the transaction (whitelisted operator + payer).
568
563
  */
569
564
  sendMatchTx(instructions: TransactionInstruction[], lookupTable?: AddressLookupTableAccount, whitelistedWallet?: anchor.Wallet): Promise<string>;
570
- /** PDA for a CLOB whitelist entry. */
571
- whitelistEntryPda(address: PublicKey): PublicKey;
572
565
  configPda(): PublicKey;
573
566
  /** One-time setup. Caller becomes admin. */
574
567
  initialize(operators: PublicKey[], feeRecipient: PublicKey, feeRateBps: number): Promise<TxResult>;
@@ -578,11 +571,6 @@ declare class ClobClient {
578
571
  removeOperator(operator: PublicKey): Promise<TxResult>;
579
572
  /** Admin pause/unpause the CLOB. */
580
573
  setPaused(paused: boolean): Promise<TxResult>;
581
- /**
582
- * Maker cancels their own order.
583
- * OrderStatus PDA is marked cancelled — any future fill rejected.
584
- */
585
- cancelOrder(nonce: anchor.BN): Promise<TxResult>;
586
574
  /**
587
575
  * Emergency reset of CLOB config (upgrade authority only).
588
576
  */
@@ -603,7 +591,7 @@ declare class ClobClient {
603
591
  * automatically appends 5 fee_management remaining_accounts so the program CPIs
604
592
  * to distribute_fee internally. No manual `feeDistribute` param needed.
605
593
  */
606
- buildMatchComplementaryIxs(buySigned: SignedOrder, makersSigned: SignedOrder[], collateralMint: PublicKey, feeRecipient: PublicKey, whitelisted: PublicKey, opts?: {
594
+ buildMatchComplementaryIxs(buySigned: SignedOrder, makersSigned: SignedOrder[], collateralMint: PublicKey, feeRecipient: PublicKey, operator: PublicKey, opts?: {
607
595
  marketOracleVault?: PublicKey;
608
596
  }): Promise<TransactionInstruction[]>;
609
597
  private matchComplementary;
@@ -653,21 +641,8 @@ declare class ClobClient {
653
641
  matchOrders(taker: SignedOrder, makers: SignedOrder[], opts?: {
654
642
  marketOracleVault?: PublicKey;
655
643
  }): Promise<TxResult>;
656
- /** Add an address to the CLOB whitelist (owner only). */
657
- addToWhitelist(address: PublicKey): Promise<TxResult>;
658
- /** Batch-add addresses to the CLOB whitelist (owner only). All PDAs created in one tx. */
659
- addToWhitelistBatch(addresses: PublicKey[]): Promise<TxResult>;
660
- /** Remove an address from the CLOB whitelist (owner only). */
661
- removeFromWhitelist(address: PublicKey, rentReceiver?: PublicKey): Promise<TxResult>;
662
- /** Fetch a whitelist entry PDA (returns null if address is not whitelisted). */
663
- fetchWhitelistEntry(address: PublicKey): Promise<ClobWhitelistEntry | null>;
664
- /** Check if an address is on the CLOB whitelist. */
665
- isWhitelisted(address: PublicKey): Promise<boolean>;
666
- /** Fetch all whitelisted addresses (scans all ClobWhitelistEntry accounts). */
667
- fetchWhitelist(): Promise<PublicKey[]>;
668
644
  fetchConfig(): Promise<ClobConfig | null>;
669
645
  fetchOrderStatus(maker: PublicKey, nonce: anchor.BN): Promise<OrderStatus | null>;
670
- isOrderCancelled(maker: PublicKey, nonce: anchor.BN): Promise<boolean>;
671
646
  }
672
647
 
673
648
  interface PresaleInfo {
@@ -717,7 +692,7 @@ declare class PresaleClient {
717
692
  * Refund: burn user's MST and return USDC.
718
693
  * Only callable when presale status = Rejected.
719
694
  */
720
- refund(presalePda: PublicKey, user?: PublicKey): Promise<Transaction>;
695
+ refund(presalePda: PublicKey, user?: PublicKey, payer?: PublicKey): Promise<Transaction>;
721
696
  fetchPresale(presalePda: PublicKey): Promise<PresaleInfo | null>;
722
697
  fetchUserBuyRecord(presalePda: PublicKey, user: PublicKey): Promise<UserBuyRecord | null>;
723
698
  }
@@ -969,4 +944,4 @@ declare function buildApproveCollateralTx(collateralMint: PublicKey, signer: Pub
969
944
  */
970
945
  declare function buildApproveAllOutcomeTokensTx(condition: PublicKey, signer: PublicKey, payer: PublicKey, delegate: PublicKey, programIds: ProgramIds, amount?: BN): Transaction;
971
946
 
972
- 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 };
947
+ export { AccountNotFoundError, ClobClient, type ClobConfig, 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 };