/** * Abstract base class for PreMarket implementations * This class provides common functionality and interfaces for both Solana and EVM implementations * @template T The transaction type (Solana web3 Transaction or ethers.PopulatedTransaction) * @template S The signer type (Solana Keypair or ethers.Wallet) */ export declare abstract class BasePreMarket { /** * The current public key * @protected */ protected _pubkey?: S; /** * Set the public key for this PreMarket instance * @param pubkey The public key to use */ setPubkey(pubkey: S): void; /** * Remove the current public key from this PreMarket instance */ removePubkey(): void; /** * Get the current public key * @returns The current public key or undefined if not set */ getPubkey(): S | undefined; /** * Initialize the PreMarket instance * @param config Configuration parameters for the PreMarket */ abstract initialize(config: Record): Promise; /** * Get the last offer ID * @returns The last offer ID */ abstract getLastOfferId(): Promise; /** * Get the last order ID * @returns The last order ID */ abstract getLastOrderId(): Promise; /** * Get an offer by ID * @param offerId The ID of the offer to retrieve * @returns The offer data */ abstract getOffer(offerId: number): Promise; /** * Get an order by ID * @param orderId The ID of the order to retrieve * @returns The order data */ abstract getOrder(orderId: number): Promise; /** * Create a new offer * @param params Parameters for creating the offer * @returns Transaction of type T */ abstract createOffer(params: CreateOfferParams): Promise; /** * Match multiple offers and create a new offer with the remaining amount * @param params Parameters for matching offers * @returns Transaction of type T */ abstract matchOffer(params: MatchOfferParams): Promise; /** * Fill an existing offer * @param offerId The ID of the offer to fill * @param amount The amount to fill * @returns Transaction of type T */ abstract fillOffer(offerId: number, amount: number): Promise; /** * Cancel an offer * @param offerId The ID of the offer to cancel * @returns Transaction of type T */ abstract cancelOffer(offerId: number): Promise; /** * Settle a filled order * @param orderId The ID of the order to settle * @returns Transaction of type T */ abstract settleOrder(orderId: number): Promise; /** * Check if a token is accepted for trading * @param token The token address or identifier * @returns Whether the token is accepted */ abstract isAcceptedToken(token: string): Promise; /** * Get configuration data for the PreMarket * @returns The configuration data */ abstract getConfig(): Promise; /** * Get the status of a transaction * @param txHash The transaction hash * @param maxRetries Maximum number of retries * @returns Transaction status */ abstract getTransactionStatus(txHash: string, maxRetries?: number): Promise; } /** * Offer data structure */ export interface OfferData { offerType: number; tokenId: string; exToken: string; amount: number; value: number; collateral: number; filledAmount: number; status: number; offeredBy: string; fullMatch: boolean; } /** * Order data structure */ export interface OrderData { offerId: number; amount: number; seller: string; buyer: string; status: number; } /** * Parameters for creating an offer */ export interface CreateOfferParams { offerType: number; tokenId: string; amount: number; value: number; exToken?: string; fullMatch?: boolean; } /** * Parameters for matching offers */ export interface MatchOfferParams { offerIds: number[]; tokenId: string; totalAmount: number; totalValue: number; offerType: number; exToken: string; newOfferFullMatch: boolean; signer?: string; } /** * Market configuration */ export interface MarketConfig { pledgeRate: number; feeRefund: number; feeSettle: number; feeWallet: string; } /** * Transaction status */ export interface TransactionStatus { status: boolean | null; confirmations: number; isCompleted: boolean; attempts: number; } /** * Transaction result */ export interface TransactionResult { transaction: { hash: string; }; status: TransactionStatus; } /** * Transaction callbacks */ export interface TransactionCallbacks { onSubmit?: (txHash: string) => void | Promise; onFinally?: (status: TransactionStatus & { txHash: string; }) => void | Promise; onError?: (error: Error) => void | Promise; } /** * Generic signer type * This is a placeholder interface that should be extended by specific implementations */ export interface SignerType { publicKey?: string | any; connect?: (provider: any) => any; sendTransaction?: (...args: any[]) => Promise; signTransaction?: (transaction: any) => Promise; } //# sourceMappingURL=BasePreMarket.d.ts.map