import { Keypair, PublicKey } from "@solana/web3.js"; import type { ClientContext } from "../context"; import { type OrderBookPair } from "../domain/orderbook"; import type { DepositSource, SubmitOrderRequest, TimeInForce, TriggerType } from "../shared"; import type { SubmitOrderResponse } from "../domain/order/client"; import type { TriggerOrderResponse } from "../domain/order/client"; import { type SubmitRequestOptions } from "./orders"; import { OrderSide, type SignedOrder } from "./types"; interface OrderFields { nonce?: number; salt?: bigint; maker?: PublicKey; market?: PublicKey; baseMint?: PublicKey; quoteMint?: PublicKey; side?: OrderSide; amountIn?: bigint; amountOut?: bigint; expiration: bigint; priceRaw?: string; sizeRaw?: string; depositSource?: DepositSource; } export interface OrderEnvelope { nonce(value: number): this; salt(value: bigint): this; maker(value: PublicKey): this; market(value: PublicKey): this; baseMint(value: PublicKey): this; quoteMint(value: PublicKey): this; bid(): this; ask(): this; side(value: OrderSide): this; amountIn(value: bigint): this; amountOut(value: bigint): this; expiration(value: bigint): this; price(value: string): this; size(value: string): this; depositSource(value: DepositSource): this; payload(): Omit; sign(keypair: Keypair, orderbook: OrderBookPair): SubmitOrderRequest; finalize(signatureBase58: string, orderbook: OrderBookPair): SubmitOrderRequest; } declare class BaseEnvelope { protected readonly fields: OrderFields; constructor(fields?: OrderFields); nonce(value: number): this; salt(value: bigint): this; maker(value: PublicKey): this; market(value: PublicKey): this; baseMint(value: PublicKey): this; quoteMint(value: PublicKey): this; bid(): this; ask(): this; side(value: OrderSide): this; amountIn(value: bigint): this; amountOut(value: bigint): this; expiration(value: bigint): this; price(value: string): this; size(value: string): this; depositSource(value: DepositSource): this; payload(): Omit; getNonce(): number | undefined; getSalt(): bigint | undefined; getMaker(): PublicKey | undefined; getMarket(): PublicKey | undefined; getBaseMint(): PublicKey | undefined; getQuoteMint(): PublicKey | undefined; getSide(): OrderSide | undefined; getAmountIn(): bigint | undefined; getAmountOut(): bigint | undefined; getExpiration(): bigint; getDepositSource(): DepositSource | undefined; /** * Auto-fill market, base_mint, quote_mint, and salt from the orderbook * if not explicitly set by the caller. */ protected autoFillFromOrderbook(orderbook: OrderBookPair): void; /** * Auto-scale price/size to raw amounts if the user provided human-readable * strings but not pre-computed amounts. Skips if amounts are already set. */ protected autoScale(orderbook: OrderBookPair): void; protected finalizeWithHexSignature(signatureHex: string, orderbookId: string, options?: SubmitRequestOptions): SubmitOrderRequest; } export declare class LimitOrderEnvelope extends BaseEnvelope implements OrderEnvelope { private timeInForceValue?; static new(): LimitOrderEnvelope; timeInForce(value: TimeInForce): this; getTimeInForce(): TimeInForce | undefined; sign(keypair: Keypair, orderbook: OrderBookPair): SubmitOrderRequest; finalize(signatureBase58: string, orderbook: OrderBookPair): SubmitOrderRequest; submit(client: ClientContext, orderbook: OrderBookPair): Promise; } export declare class TriggerOrderEnvelope extends BaseEnvelope implements OrderEnvelope { private timeInForceValue?; private triggerPriceValue?; private triggerTypeValue?; static new(): TriggerOrderEnvelope; timeInForce(value: TimeInForce): this; triggerPrice(value: number): this; triggerType(value: TriggerType): this; takeProfit(price: number): this; stopLoss(price: number): this; gtc(): this; ioc(): this; fok(): this; alo(): this; getTimeInForce(): TimeInForce | undefined; getTriggerPrice(): number | undefined; getTriggerType(): TriggerType | undefined; sign(keypair: Keypair, orderbook: OrderBookPair): SubmitOrderRequest; finalize(signatureBase58: string, orderbook: OrderBookPair): SubmitOrderRequest; submit(client: ClientContext, orderbook: OrderBookPair): Promise; private requireTriggerFields; } export declare function signPayload(payload: Omit, keypair: Keypair): string; export {}; //# sourceMappingURL=envelope.d.ts.map