import Decimal from "decimal.js"; import type { OrderBookPair } from "../domain/orderbook"; import type { ConditionalToken } from "../domain/market/tokens"; import { OrderSide } from "../program/types"; export type Branded = T & { readonly __brand: Brand; }; export type OrderBookId = Branded; export type PubkeyStr = Branded; export declare function asOrderBookId(value: string): OrderBookId; export declare function asPubkeyStr(value: string): PubkeyStr; export declare enum Side { Bid = "bid", Ask = "ask" } export declare function parseSide(value: string): Side; export declare function sideLabel(side: Side): "Buy" | "Sell"; /** * The denomination of the asset this side spends (Bid spends quote, Ask spends * base). Also a trade form's default display denomination. */ export declare function spendDenominator(side: Side): Denominator; /** * The denomination of the asset this side receives (Bid receives base, Ask * receives quote). */ export declare function receiveDenominator(side: Side): Denominator; /** * The price to submit with a market (IOC) order: the worst book fill price * padded by the impact-protection percentage in the direction that lets the * order fill. * * Returns null unless the fill price and protection are finite and positive. * Protection has no policy maximum; Ask protection at or above 100% saturates * at zero. */ export declare function applyImpactProtection(side: Side, worstFillPrice: Decimal, protectionPercent: Decimal): Decimal | null; /** Map a wire/domain `Side` onto the on-chain `OrderSide`. */ export declare function toOrderSide(side: Side): OrderSide; export declare enum Denominator { Base = "Base", Quote = "Quote" } export declare function allDenominators(): Denominator[]; /** The conditional token this denomination refers to on `pair`. */ export declare function denominatorToken(denominator: Denominator, pair: OrderBookPair): ConditionalToken; export declare function denominatorSymbol(denominator: Denominator, pair: OrderBookPair): string; export declare function denominatorDepositSymbol(denominator: Denominator, pair: OrderBookPair): string; /** * Convert `amount` from one denomination into another at the given price * (quote per one base). * * Same-denomination conversion is the identity and never needs a price; * crossing denominations requires a positive price — null otherwise. */ export declare function convertDenomination(from: Denominator, to: Denominator, amount: Decimal, basePriceInQuote: Decimal): Decimal | null; export declare enum TimeInForce { Gtc = "GTC", Ioc = "IOC", Fok = "FOK", Alo = "ALO" } export declare enum TriggerType { TakeProfit = "TP", StopLoss = "SL" } export declare enum TriggerStatus { Created = "created", Triggered = "triggered", Failed = "failed", Expired = "expired", Invalidated = "invalidated" } export declare enum OrderUpdateType { Placement = "PLACEMENT", Update = "UPDATE", Cancellation = "CANCELLATION" } export declare enum TriggerUpdateType { Created = "CREATED", Triggered = "TRIGGERED", Failed = "FAILED", Expired = "EXPIRED", Invalidated = "INVALIDATED" } export declare enum TriggerResultStatus { Filled = "filled", Accepted = "accepted", Rejected = "rejected" } export declare enum DepositSource { Global = "global", Market = "market" } export declare enum Resolution { Minute1 = "1m", Minute5 = "5m", Minute15 = "15m", Hour1 = "1h", Hour4 = "4h", Day1 = "1d" } export declare function parseResolution(value: string): Resolution; export declare function resolutionSeconds(resolution: Resolution): number; export declare function deriveOrderbookId(baseToken: string, quoteToken: string): OrderBookId; export interface SubmitOrderRequest { maker: string; nonce: number; salt: bigint; market_pubkey: string; base_token: string; quote_token: string; side: number; /** Positive durable signed-64-bit amount. */ amount_in: bigint; /** Positive durable signed-64-bit amount. */ amount_out: bigint; expiration: bigint; signature: string; orderbook_id: string; tif?: TimeInForce; trigger_price?: number; trigger_type?: TriggerType; deposit_source?: DepositSource; } //# sourceMappingURL=types.d.ts.map