import { PublicKey, Connection, TransactionInstruction } from "@solana/web3.js"; import { OrderType, PrimedTransaction, Side } from "./types"; import BN from "bn.js"; import { SelfTradeBehavior } from "./state"; import { Market } from "./market"; /** * * @param connection The Solana RPC connection * @param baseMint The mint of the base token * @param quoteMint The mint of the quote token * @param minBaseOrderSize The minimum base order size * @param feePayer The fee payer of the transaction * @param marketAdmin The market admin * @param tickSize The tick size of the market (FP32) * @param crankerReward The cranker rewards (raw amount SOL) * @returns */ export declare const createMarket: (connection: Connection, baseMint: PublicKey, quoteMint: PublicKey, minBaseOrderSize: BN, feePayer: PublicKey, marketAdmin: PublicKey, tickSize: BN, crankerReward: BN, baseCurrencyMultiplier?: BN, quoteCurrencyMultiplier?: BN) => Promise; /** * * @param market Market object on which the order is placed * @param side The side of the order (Bid or Ask) * @param limitPrice The limit price (UI limit price not FP32) * @param size The size of the order (raw ammount i.e with decimals) * @param type The order type * @param selfTradeBehaviour The self trade behavior * @param ownerTokenAccount The token account from which token will be debited * @param owner The user placing the address * @param clientOrderId Optional client order ID * @param discountTokenAccount Optional SRM token account * @returns */ export declare const placeOrder: (market: Market, side: Side, limitPrice: number, size: number, type: OrderType, selfTradeBehaviour: SelfTradeBehavior, ownerTokenAccount: PublicKey, owner: PublicKey, clientOrderId?: BN, discountTokenAccount?: PublicKey, maxBaseQty?: BN, maxQuoteQty?: BN) => Promise; /** * * @param market Market object on which the order is canceled * @param owner The owner of the order being cancelled * @param orderId The order ID * @param orderIndex The index of the order in the user account orders list * @param clientOrderId Optional client order ID * @returns */ export declare const cancelOrder: (market: Market, owner: PublicKey, orderId: BN, orderIndex?: BN, clientOrderId?: BN) => Promise; /** * * @param market Market object on which the user account is created * @param owner The owner of the user account * @param maxOrders The max capacity of orders * @param feePayer The fee payer of the transaction * @returns */ export declare const initializeAccount: (market: PublicKey, owner: PublicKey, maxOrders?: number, feePayer?: PublicKey) => Promise; /** * * @param market Market object on which funds are settled * @param owner The user settling their funds * @param destinationBaseAccount The user base token account * @param destinationQuoteAccount The user quote token account * @returns */ export declare const settle: (market: Market, owner: PublicKey, destinationBaseAccount: PublicKey, destinationQuoteAccount: PublicKey) => Promise; /** * * @param market Market object on which events are consumed * @param rewardTarget The cranker rewards target * @param userAccounts The user accounts * @param maxIterations * @param noOpErr * @returns */ export declare const consumeEvents: (market: Market, rewardTarget: PublicKey, userAccounts: PublicKey[], maxIterations: BN, noOpErr: BN) => Promise; export declare const closeAccount: (market: PublicKey, owner: PublicKey) => Promise; export declare const swap: (market: Market, side: Side, minOutputQuantity: number, inputQuantity: number, selfTradeBehaviour: SelfTradeBehavior, ownerBaseTokenAccount: PublicKey, ownerQuoteTokenAccount: PublicKey, owner: PublicKey, discountTokenAccount?: PublicKey, referralFeeAccount?: PublicKey) => Promise; export declare const closeMarket: (market: Market, target: PublicKey) => Promise; export declare const sweepFees: (connection: Connection, market: Market, destination: PublicKey, feePayer: PublicKey) => Promise;