import type { FulfillmentDataResponse, ProtocolData } from "../orders/types"; import { type Chain, OrderSide } from "../types"; import type { Camelize } from "../utils/case"; import type { Fetcher } from "./fetcher"; import type { CancelOrderResponse, GetOrderByHashResponse, Listing, Offer } from "./types"; /** * Order-related API operations */ export declare class OrdersAPI { private fetcher; private chain; constructor(fetcher: Fetcher, chain: Chain); /** * Gets a single order by its order hash. * Returns the raw API response which can be either an Offer or Listing. */ getOrderByHash(orderHash: string, protocolAddress: string, chain?: Chain): Promise; /** * Generate the data needed to fulfill a listing or an offer onchain. */ generateFulfillmentData(fulfillerAddress: string, orderHash: string, protocolAddress: string, side: OrderSide, assetContractAddress?: string, tokenId?: string, unitsToFill?: string, recipientAddress?: string, includeOptionalCreatorFees?: boolean): Promise>; /** * Post a listing to OpenSea. * * The body uses mixed casing per the OpenSea OpenAPI spec: the outer * envelope (`protocol_address`) is snake_case, but the inner Seaport * struct (`parameters.startTime`, `parameters.orderType`, `offer[].itemType`, * etc.) mirrors the on-chain struct names and must stay camelCase on the * wire. We pass `snakeizeBody: false` and emit the body in exact wire shape. */ postListing(order: ProtocolData, protocolAddress: string): Promise; /** * Post an offer to OpenSea. * * Same mixed-casing wire shape as {@link postListing}: outer * `protocol_address` is snake_case but the inner Seaport struct stays * camelCase. We opt out of automatic snakeize so `parameters` is sent * verbatim. */ postOffer(order: ProtocolData, protocolAddress: string): Promise; /** * Offchain cancel an order, offer or listing, by its order hash when protected by the SignedZone. * * The OpenSea OpenAPI `CancelRequest` schema uses camelCase * `offererSignature`, so we opt out of automatic snakeize. */ offchainCancelOrder(protocolAddress: string, orderHash: string, chain?: Chain, offererSignature?: string): Promise; }