import { PublicKey, Keypair } from "@solana/web3.js"; import { SignedOrder, OrderSide } from "./types"; import { OrderbookDecimals } from "../shared/scaling"; import type { DepositSource, SubmitOrderRequest } from "../shared"; /** * Fluent builder for creating orders. * Matches the Rust SDK's OrderBuilder pattern. * * @example * ```typescript * const order = new OrderBuilder() * .nonce(1) * .maker(makerPubkey) * .market(marketPubkey) * .baseMint(baseMintPubkey) * .quoteMint(quoteMintPubkey) * .bid() * .amountIn(1000000n) * .amountOut(500000n) * .expiration(0n) * .build(); * ``` */ export declare class OrderBuilder { private _nonce; private _salt; private _maker; private _market; private _baseMint; private _quoteMint; private _side; private _amountIn; private _amountOut; private _expiration; private _depositSource?; /** Set the order nonce (u32) */ nonce(value: number): this; /** Set the order salt (u64) for uniqueness. Auto-generated if not set. */ salt(value: bigint): this; /** Set the maker (signer) */ maker(value: PublicKey): this; /** Set the market */ market(value: PublicKey): this; /** Set the base mint (conditional token) */ baseMint(value: PublicKey): this; /** Set the quote mint (payment token) */ quoteMint(value: PublicKey): this; /** Set side to BID */ bid(): this; /** Set side to ASK */ ask(): this; /** Set the order side */ side(value: OrderSide): this; /** Set amount in (what maker gives) */ amountIn(value: bigint): this; /** Set amount out (what maker receives) */ amountOut(value: bigint): this; /** Set expiration timestamp (0 = no expiration) */ expiration(value: bigint): this; /** Set deposit source for order submission */ depositSource(value: DepositSource): this; /** * Set price and size, auto-computing amountIn and amountOut using decimal scaling. * * @param price - Price as a decimal string (e.g., "0.75") * @param size - Size as a decimal string (e.g., "100") * @param decimals - Orderbook decimal configuration */ price(priceStr: string, sizeStr: string, decimals: OrderbookDecimals): this; /** * Apply decimal scaling to convert price/size to amountIn/amountOut. * Equivalent to calling price() but with separate method name for clarity. */ applyScaling(priceStr: string, sizeStr: string, decimals: OrderbookDecimals): this; /** * Build the unsigned SignedOrder (signature will be all zeros). * All required fields must be set. */ build(): SignedOrder; /** * Build and sign the order with a Keypair. */ buildAndSign(keypair: Keypair): SignedOrder; /** * Build, sign, and convert to a SubmitOrderRequest. */ toSubmitRequest(keypair: Keypair, orderbookId: string): SubmitOrderRequest; } //# sourceMappingURL=builder.d.ts.map