import { Connection, Transaction } from "@solana/web3.js"; import { ethers } from "ethers"; import { BasePreMarket, CreateOfferParams, MarketConfig, OfferData, OrderData, MatchOfferParams } from "../base/BasePreMarket"; import { PreMarketContract } from "../pre-markets/PreMarketEVM"; /** * Interface for market identification */ export interface MarketIdentifier { id: string; chain: "solana" | "evm"; } /** * Abstract class for managing multiple pre-markets across different chains * T is the type of Solana PreMarket implementation (PreMarketSolana or PreMarketSolanaMobile) */ export declare abstract class MultiPreMarketManager> { protected solanaMarkets: Map; protected evmMarkets: Map; /** * Create a new Solana PreMarket instance * This method should be implemented by concrete classes */ protected abstract createSolanaPreMarket(connection: Connection, programId: string, configAccountPubKey?: string): Promise; /** * Add a Solana pre-market to the manager * @param id Unique identifier for this market * @param connection Solana connection * @param programId Program ID for the pre-market * @param configAccountPubKey Optional config account public key * @returns The added PreMarket instance */ addSolanaMarket(id: string, connection: Connection, programId: string, configAccountPubKey?: string): Promise; /** * Add an existing Solana pre-market to the manager * @param id Unique identifier for this market * @param preMarket The PreMarket instance to add * @returns The added PreMarket instance */ addExistingSolanaMarket(id: string, preMarket: T): Promise; /** * Add an EVM pre-market to the manager * @param id Unique identifier for this market * @param contractAddress Contract address for the pre-market * @param signerOrProvider Signer or provider for the contract * @returns The added PreMarketContract instance */ addEVMMarket(id: string, contractAddress: string, signerOrProvider: ethers.Signer | ethers.providers.Provider): Promise; /** * Get a pre-market by ID * @param id The market ID * @returns The pre-market instance */ getMarket(id: string): BasePreMarket; /** * Get a Solana pre-market by ID * @param id The market ID * @returns The PreMarket instance */ getSolanaMarket(id: string): T; /** * Get an EVM pre-market by ID * @param id The market ID * @returns The PreMarketContract instance */ getEVMMarket(id: string): PreMarketContract; /** * Remove a market by ID * @param id The market ID * @returns True if the market was removed, false otherwise */ removeMarket(id: string): boolean; /** * Get all market identifiers * @returns Array of market identifiers */ getAllMarketIds(): MarketIdentifier[]; /** * Get the last offer ID from a specific market * @param marketId The market ID * @returns The last offer ID */ getLastOfferId(marketId: string): Promise; /** * Get the last order ID from a specific market * @param marketId The market ID * @returns The last order ID */ getLastOrderId(marketId: string): Promise; /** * Get an offer by ID from a specific market * @param marketId The market ID * @param offerId The offer ID * @returns The offer data */ getOffer(marketId: string, offerId: number): Promise; /** * Get an order by ID from a specific market * @param marketId The market ID * @param orderId The order ID * @returns The order data */ getOrder(marketId: string, orderId: number): Promise; /** * Create a new offer in a specific market * @param marketId The market ID * @param params Parameters for creating the offer * @returns Transaction (type depends on the chain) */ createOffer(marketId: string, params: CreateOfferParams): Promise; /** * Match offers in a specific market * @param marketId The market ID * @param params Parameters for matching offers * @returns Transaction (type depends on the chain) */ matchOffer(marketId: string, params: MatchOfferParams): Promise; /** * Fill an existing offer in a specific market * @param marketId The market ID * @param offerId The ID of the offer to fill * @param amount The amount to fill * @returns Transaction (type depends on the chain) */ fillOffer(marketId: string, offerId: number, amount: number): Promise; /** * Cancel an offer in a specific market * @param marketId The market ID * @param offerId The ID of the offer to cancel * @returns Transaction (type depends on the chain) */ cancelOffer(marketId: string, offerId: number): Promise; /** * Settle a filled order in a specific market * @param marketId The market ID * @param orderId The ID of the order to settle * @returns Transaction (type depends on the chain) */ settleOrder(marketId: string, orderId: number): Promise; /** * Check if a token is accepted for trading in a specific market * @param marketId The market ID * @param token The token address or identifier * @returns Whether the token is accepted */ isAcceptedToken(marketId: string, token: string): Promise; /** * Get configuration data for a specific market * @param marketId The market ID * @returns The configuration data */ getConfig(marketId: string): Promise; /** * Execute a batch of operations across multiple markets * @param operations Array of operations to execute * @returns Results of the operations */ executeBatch(operations: Array<{ marketId: string; operation: (market: BasePreMarket) => Promise; }>): Promise; } //# sourceMappingURL=MultiPreMarketManager.d.ts.map