import { v } from "@dicedhq/core/validation"; import { type Hex } from "viem"; import type { BaseClient } from "../client/base.js"; import { type SignatureType } from "../core/eip712.js"; import type { MarketApi } from "./market.js"; export declare class OrderApi { private readonly client; private readonly market; constructor(client: BaseClient, market: MarketApi); /** * Get an order by ID */ getOrder(id: string): Promise; /** * List active orders for a given market */ listOrders(params: ListOrderParams): Promise; /** * Check if an order is eligible or scoring for Rewards purposes */ checkOrderRewardScoring(id: string): Promise; /** * Create an order */ createOrder(params: CreateOrderParams): Promise; /** * Post an order to the order book */ postOrder({ order, kind }: { order: SignedOrder; kind: OrderKind; }): Promise; /** * Create and post an order in one step */ createAndPostOrder(params: CreateOrderAndPostParams): Promise; /** * Cancel an order */ cancelOrder(id: string): Promise; /** * Cancel multiple orders */ cancelOrders(orderIds: string[]): Promise; /** * Cancel all orders */ cancelAllOrders(): Promise; private getNonce; /** * Generate a cryptographically secure random salt for order uniqueness */ private generateSalt; private calculateOrderAmounts; } declare const ListOrderSchema: v.SchemaWithPipe, undefined>; readonly marketId: v.SchemaWithPipe, v.TrimAction, v.NonEmptyAction]>; readonly assetId: v.OptionalSchema, undefined>; }, undefined>, v.MetadataAction<{ orderId?: string | undefined; marketId: string; assetId?: string | undefined; }, { readonly title: "ListOrderParams"; }>]>; declare const CreateOrderSchema: v.SchemaWithPipe, v.TrimAction, v.NonEmptyAction]>; readonly price: v.SchemaWithPipe, v.MinValueAction, v.CheckAction]>; readonly size: v.SchemaWithPipe, v.MinValueAction, v.CheckAction]>; readonly side: v.PicklistSchema<["BUY", "SELL"], undefined>; readonly expiration: v.SchemaWithPipe, v.MinValueAction]>; readonly taker: v.UnionSchema<[v.SchemaWithPipe, v.StartsWithAction]>, v.LiteralSchema<"anyone", undefined>], undefined>; /** Optional funder address (e.g., a Safe contract). If provided, this becomes the maker address. */ readonly funderAddress: v.OptionalSchema, v.StartsWithAction]>, undefined>; /** Signature type. Defaults to "eoa". Use "poly-gnosis-safe" for Safe wallet signing. */ readonly signatureType: v.OptionalSchema, undefined>; }, undefined>, v.MetadataAction<{ tokenId: string; price: number; size: number; side: "BUY" | "SELL"; expiration: number; taker: string; funderAddress?: string | undefined; signatureType?: "eoa" | "poly-gnosis-safe" | "poly-proxy" | undefined; }, { readonly title: "CreateOrderParams"; }>]>; export type ListOrderParams = v.InferInput; export type CreateOrderParams = v.InferInput; export type Order = { salt: string; maker: Hex; signer: Hex; taker: Hex; tokenId: string; makerAmount: string; takerAmount: string; expiration: string; nonce: string; feeRateBps: string; side: OrderSide; signatureType: SignatureType; }; export type SignedOrder = Order & { signature: string; }; export type OpenOrder = { id: string; market: string; asset_id: string; owner: string; side: OrderSide; size: string; original_size: string; price: string; type: OrderKind; fee_rate_bps: string; status: string; created_at?: string; last_update?: string; outcome?: string; expiration?: string; maker_address?: string; associate_trades?: AssociateTrade[]; }; export type OrderSide = "BUY" | "SELL"; export type OrderKind = "GTC" | "FOK" | "GTD" | "FAK"; export type OrderResponse = { success: boolean; errorMsg?: string; orderID?: string; transactionsHashes?: string[]; }; export type CreateOrderAndPostParams = { kind: OrderKind; order: CreateOrderParams; }; export type CancelResponse = { success: boolean; errorMsg?: string; }; export type AssociateTrade = { id: string; order_id: string; market: string; asset_id: string; side: OrderSide; size: string; fee_rate_bps: string; price: string; status: string; match_time?: string; last_update?: string; outcome?: string; owner?: string; maker_address?: string; transaction_hash?: string; }; export {}; //# sourceMappingURL=order.d.ts.map