/// <amd-module name="file:///home/runner/work/hyperliquid/hyperliquid/src/api/subscription/_methods/bbo.ts" />
import * as v from "valibot";
/**
 * Subscription to best bid and offer events for a specific asset.
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
 */
export declare const BboRequest: v.ObjectSchema<{
    /** Type of subscription. */
    readonly type: v.LiteralSchema<"bbo", undefined>;
    /** Asset symbol (e.g., BTC). */
    readonly coin: v.StringSchema<undefined>;
}, undefined>;
export type BboRequest = v.InferOutput<typeof BboRequest>;
/**
 * Event of best bid and offer.
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
 */
export type BboEvent = {
    /** Asset symbol (e.g., BTC). */
    coin: string;
    /** Time of the BBO update (in ms since epoch). */
    time: number;
    /** Best bid and offer. */
    bbo: [
        /** Best bid. */
        bid: {
            /**
             * Price.
             * @pattern ^[0-9]+(\.[0-9]+)?$
             */
            px: string;
            /**
             * Total size.
             * @pattern ^[0-9]+(\.[0-9]+)?$
             */
            sz: string;
            /** Number of individual orders. */
            n: number;
        } | null,
        /** Best offer. */
        offer: {
            /**
             * Price.
             * @pattern ^[0-9]+(\.[0-9]+)?$
             */
            px: string;
            /**
             * Total size.
             * @pattern ^[0-9]+(\.[0-9]+)?$
             */
            sz: string;
            /** Number of individual orders. */
            n: number;
        } | null
    ];
};
import type { ISubscription } from "../../../transport/mod.js";
import type { SubscriptionConfig, SubscriptionOptions } from "./_base/mod.js";
/** Request parameters for the {@linkcode bbo} function. */
export type BboParameters = Omit<v.InferInput<typeof BboRequest>, "type">;
/**
 * Subscribe to best bid and offer updates for a specific asset.
 *
 * @param config General configuration for Subscription API subscriptions.
 * @param params Parameters specific to the API subscription.
 * @param listener A callback function to be called when the event is received.
 * @param options Options to control the subscription lifecycle.
 * @return A request-promise that resolves with a {@link ISubscription} object to manage the subscription lifecycle.
 *
 * @throws {ValidationError} When the request parameters fail validation (before sending).
 * @throws {TransportError} When the transport layer throws an error.
 *
 * @example
 * ```ts
 * import { WebSocketTransport } from "@nktkas/hyperliquid";
 * import { bbo } from "@nktkas/hyperliquid/api/subscription";
 *
 * const transport = new WebSocketTransport();
 *
 * const sub = await bbo(
 *   { transport },
 *   { coin: "ETH" },
 *   (data) => console.log(data),
 * );
 * ```
 *
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
 */
export declare function bbo(config: SubscriptionConfig, params: BboParameters, listener: (data: BboEvent) => void, options?: SubscriptionOptions): Promise<ISubscription>;
