import { ethers } from "ethers"; import { PreMarket } from "../types/contracts/PreMarket"; import { BasePreMarket, OfferData, OrderData, MarketConfig, CreateOfferParams, TransactionStatus, MatchOfferParams } from "../base/BasePreMarket"; /** * Class for interacting with the PreMarket contract */ export declare class PreMarketContract extends BasePreMarket { private contract; private readonly ETH_ADDRESS; /** * Create a new instance of the PreMarket contract * @param provider Ethers provider * @param contractAddress Address of the PreMarket contract * @param signerOrProvider Signer or provider to use for transactions */ constructor(contractAddress: string, signerOrProvider: ethers.Signer | ethers.providers.Provider); /** * Initialize the PreMarket instance * @param config Configuration parameters (not needed for EVM implementation) */ initialize(_config: Record): Promise; /** * Get the contract instance * @returns The PreMarket contract instance */ getContract(): PreMarket; /** * Get the last offer ID * @returns The last offer ID */ getLastOfferId(): Promise; /** * Get the last order ID * @returns The last order ID */ getLastOrderId(): Promise; /** * Get an offer by ID * @param offerId The ID of the offer to retrieve * @returns The offer data */ getOffer(offerId: number): Promise; /** * Get an order by ID * @param orderId The ID of the order to retrieve * @returns The order data */ getOrder(orderId: number): Promise; /** * Create a new offer * @param params Parameters for creating the offer * @returns Transaction of type T */ createOffer(params: CreateOfferParams): Promise; /** * Match multiple offers and create a new offer with the remaining amount * @param params Parameters for matching offers * @returns Populated transaction */ 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 */ fillOffer(offerId: number, amount: number): Promise; /** * Cancel an offer * @param offerId The ID of the offer to cancel * @returns Transaction of type T */ cancelOffer(offerId: number): Promise; /** * Settle a filled order * @param orderId The ID of the order to settle * @returns Transaction of type T */ settleOrder(orderId: number): Promise; /** * Check if a token is accepted for trading * @param token The token address * @returns Whether the token is accepted */ isAcceptedToken(token: string): Promise; /** * Get configuration data for the PreMarket * @returns The configuration data */ getConfig(): Promise; /** * Builds a raw transaction to create a new offer with tokens * @param offerType The type of offer (0 for sell, 1 for buy) * @param tokenId The token ID * @param amount The amount of tokens * @param value The value of the offer * @param exToken The exchange token address * @param fullMatch Whether the offer requires a full match * @returns Populated transaction */ buildNewOfferRawTx(offerType: number, tokenId: string, amount: ethers.BigNumberish, value: ethers.BigNumberish, exToken: string, fullMatch: boolean): Promise; /** * Builds a transaction to create a new offer with tokens * @param offerType The type of offer (0 for sell, 1 for buy) * @param tokenId The token ID * @param amount The amount of tokens * @param value The value of the offer * @param exToken The exchange token address * @param fullMatch Whether the offer requires a full match * @returns Populated transaction */ buildNewOfferTx(offerType: number, tokenId: string, amount: number, value: number, exToken: string, fullMatch: boolean): Promise; /** * Builds a raw transaction to create a new offer with ETH * @param offerType The type of offer (0 for sell, 1 for buy) * @param tokenId The token ID * @param amount The amount of tokens * @param value The value of the offer * @param fullMatch Whether the offer requires a full match * @returns Populated transaction */ buildNewOfferETHRawTx(offerType: number, tokenId: string, amount: ethers.BigNumberish, value: ethers.BigNumberish, fullMatch: boolean): Promise; /** * Builds a transaction to create a new offer with ETH * @param offerType The type of offer (0 for sell, 1 for buy) * @param tokenId The token ID * @param amount The amount of tokens * @param value The value of the offer * @param fullMatch Whether the offer requires a full match * @returns Populated transaction */ buildNewOfferETHTx(offerType: number, tokenId: string, amount: number, value: number, fullMatch: boolean): Promise; /** * Builds a raw transaction to fill an offer with tokens * @param offerId The offer ID to fill * @param amount The amount to fill * @returns Populated transaction */ buildFillOfferRawTx(offerId: ethers.BigNumberish, amount: ethers.BigNumberish): Promise; /** * Builds a transaction to fill an offer with tokens * @param offerId The offer ID to fill * @param amount The amount to fill * @returns Populated transaction */ buildFillOfferTx(offerId: number, amount: number): Promise; /** * Builds a raw transaction to fill an offer with ETH * @param offerId The offer ID to fill * @param amount The amount to fill * @returns Populated transaction */ buildFillOfferETHRawTx(offerId: ethers.BigNumberish, amount: ethers.BigNumberish): Promise; /** * Builds a transaction to fill an offer with ETH * @param offerId The offer ID to fill * @param amount The amount to fill * @returns Populated transaction */ buildFillOfferETHTx(offerId: number, amount: number): Promise; /** * Builds a raw transaction to cancel an offer * @param offerId The offer ID to cancel * @returns Populated transaction */ buildCancelOfferRawTx(offerId: ethers.BigNumberish): Promise; /** * Builds a transaction to cancel an offer * @param offerId The offer ID to cancel * @returns Populated transaction */ buildCancelOfferTx(offerId: number): Promise; /** * Builds a raw transaction to cancel multiple offers * @param offerIds Array of offer IDs to cancel * @returns Populated transaction */ buildCancelOffersRawTx(offerIds: ethers.BigNumberish[]): Promise; /** * Builds a transaction to cancel multiple offers * @param offerIds Array of offer IDs to cancel * @returns Populated transaction */ buildCancelOffersTx(offerIds: number[]): Promise; /** * Builds a raw transaction to settle a filled order * @param orderId The order ID to settle * @returns Populated transaction */ buildSettleFilledRawTx(orderId: ethers.BigNumberish): Promise; /** * Builds a transaction to settle a filled order * @param orderId The order ID to settle * @returns Populated transaction */ buildSettleFilledTx(orderId: number): Promise; /** * Builds a raw transaction to settle multiple filled orders * @param orderIds Array of order IDs to settle * @returns Populated transaction */ buildSettleFilledsRawTx(orderIds: ethers.BigNumberish[]): Promise; /** * Builds a transaction to settle multiple filled orders * @param orderIds Array of order IDs to settle * @returns Populated transaction */ buildSettleFilledsTx(orderIds: number[]): Promise; /** * Builds a raw transaction to settle a cancelled order * @param orderId The order ID to settle * @returns Populated transaction */ buildSettleCancelledRawTx(orderId: ethers.BigNumberish): Promise; /** * Builds a transaction to settle a cancelled order * @param orderId The order ID to settle * @returns Populated transaction */ buildSettleCancelledTx(orderId: number): Promise; /** * Builds a raw transaction to settle multiple cancelled orders * @param orderIds Array of order IDs to settle * @returns Populated transaction */ buildSettleCancelledsRawTx(orderIds: ethers.BigNumberish[]): Promise; /** * Builds a transaction to settle multiple cancelled orders * @param orderIds Array of order IDs to settle * @returns Populated transaction */ buildSettleCancelledsTx(orderIds: number[]): Promise; /** * Builds a raw transaction to create a new token * @param tokenId The token ID * @param settleDuration The settlement duration * @returns Populated transaction */ buildCreateTokenRawTx(tokenId: string, settleDuration: number): Promise; /** * Builds a transaction to create a new token * @param tokenId The token ID * @param settleDuration The settlement duration * @returns Populated transaction */ buildCreateTokenTx(tokenId: string, settleDuration: number): Promise; /** * Builds a raw transaction to update the settlement duration for a token * @param tokenId The token ID * @param newDuration The new settlement duration * @returns Populated transaction */ buildUpdateSettleDurationRawTx(tokenId: string, newDuration: number): Promise; /** * Builds a transaction to update the settlement duration for a token * @param tokenId The token ID * @param newDuration The new settlement duration * @returns Populated transaction */ buildUpdateSettleDurationTx(tokenId: string, newDuration: number): Promise; /** * Builds a raw transaction to withdraw liquid ETH from the contract * @param amount The amount of ETH to withdraw * @returns Populated transaction */ buildWithdrawLiquidETHRawTx(amount: ethers.BigNumberish): Promise; /** * Builds a transaction to withdraw liquid ETH from the contract * @param amount The amount of ETH to withdraw * @returns Populated transaction */ buildWithdrawLiquidETHTx(amount: number): Promise; /** * Builds a raw transaction to withdraw liquid tokens from the contract * @param tokenAddress The token address * @param amount The amount of tokens to withdraw * @returns Populated transaction */ buildWithdrawLiquidTokenRawTx(tokenAddress: string, amount: ethers.BigNumberish): Promise; /** * Builds a transaction to withdraw liquid tokens from the contract * @param tokenAddress The token address * @param amount The amount of tokens to withdraw * @returns Populated transaction */ buildWithdrawLiquidTokenTx(tokenAddress: string, amount: number): Promise; /** * Builds a raw transaction to set accepted tokens * @param tokenAddresses Array of token addresses * @param isAccepted Whether the tokens are accepted * @returns Populated transaction */ buildSetAcceptedTokensRawTx(tokenAddresses: string[], isAccepted: boolean): Promise; /** * Builds a transaction to set accepted tokens * @param tokenAddresses Array of token addresses * @param isAccepted Whether the tokens are accepted * @returns Populated transaction */ buildSetAcceptedTokensTx(tokenAddresses: string[], isAccepted: boolean): Promise; /** * Builds a raw transaction to update the contract configuration * @param feeWallet The fee wallet address * @param feeSettle The settlement fee * @param feeRefund The refund fee * @param pledgeRate The pledge rate * @returns Populated transaction */ buildUpdateConfigRawTx(feeWallet: string, feeSettle: ethers.BigNumberish, feeRefund: ethers.BigNumberish, pledgeRate: ethers.BigNumberish): Promise; /** * Builds a transaction to update the contract configuration * @param feeWallet The fee wallet address * @param feeSettle The settlement fee * @param feeRefund The refund fee * @param pledgeRate The pledge rate * @returns Populated transaction */ buildUpdateConfigTx(feeWallet: string, feeSettle: number, feeRefund: number, pledgeRate: number): Promise; /** * Get the status of a transaction * @param txHash The transaction hash * @param maxRetries Maximum number of retries * @returns Transaction status */ getTransactionStatus(txHash: string, maxRetries?: number): Promise; /** * Check if an offer is a buy offer * @param offerId The offer ID * @returns True if the offer is a buy offer */ isBuyOffer(offerId: ethers.BigNumberish): Promise; /** * Check if an offer is a sell offer * @param offerId The offer ID * @returns True if the offer is a sell offer */ isSellOffer(offerId: ethers.BigNumberish): Promise; /** * Get the status of an offer * @param offerId The offer ID * @returns The offer status */ getOfferStatus(offerId: ethers.BigNumberish): Promise; /** * Get the status of an order * @param orderId The order ID * @returns The order status */ getOrderStatus(orderId: ethers.BigNumberish): Promise; /** * Get the amount available for an offer * @param offerId The offer ID * @returns The available amount */ getOfferAmountAvailable(offerId: ethers.BigNumberish): Promise; /** * Get the contract owner * @returns The contract owner address */ getOwner(): Promise; /** * Check if a token is locked * @param tokenId The token ID * @returns True if the token is locked */ isTokenLocked(tokenId: string): Promise; /** * Get token details * @param tokenId The token ID * @returns The token details */ getToken(tokenId: string): Promise; } //# sourceMappingURL=PreMarketEVM.d.ts.map