import { Trigger } from "../../gen/triggers/v1/triggers_pb.js"; import { AuthApiTransports } from "../../shared/transports.js"; import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js"; import { SubaccountResolver } from "../subaccount-resolver.js"; import { PolyesterRealtime } from "../../realtime/types.js"; import "../../realtime/index.js"; import { BaseSubscribeInput } from "../../shared/types.js"; import { SdkScales } from "../../shared/decimal-surface.js"; import { CancelTriggerInput, CreateTriggerInput, GetTriggerInput, ListTriggerEventsInput, ListTriggersInput, ModifyTriggerInput, PauseTriggerInput, ResumeTriggerInput } from "./trigger-input.schemas.js"; import { CancelTriggerResult, CreateTriggerResult, ListTriggerEventsResult, ModifyTriggerResult, PauseTriggerResult, ResumeTriggerResult, Trigger as Trigger$1, TriggerEvent } from "./triggers-output.schemas.js"; import "./triggers.schemas.js"; //#region src/services/triggers/triggers.d.ts interface ListTriggersResult { triggers: Trigger$1[]; nextPageToken: string; } interface SubscribeTriggersInput extends BaseSubscribeInput { accountId: string; } interface SubscribeTriggerEventsInput extends BaseSubscribeInput { accountId: string; } /** * Manages standalone order triggers and their realtime lifecycle/event streams. */ declare class TriggersService { #private; constructor(transports: AuthApiTransports, realtime: PolyesterRealtime, resolver: SubaccountResolver | undefined, scales: SdkScales); /** * Creates a standalone trigger for a symbol ID, using that market's catalog quantity scale. */ create(input: CreateTriggerInput, options?: PolyesterMutationOptions): Promise; /** * Fetches one trigger by id in the resolved account scope and returns null when the backend response contains no trigger. */ get(input: GetTriggerInput, options?: PolyesterRequestOptions): Promise; /** * Converts a `triggers.v1.Trigger` message received from another API into the same `Trigger` * record that `get`, `list`, and `subscribe` return, scaled with this client's catalog. */ fromProto(trigger: Trigger): Promise; /** * Lists triggers for the resolved account scope with optional symbol ID, status, trigger type, parent order, limit, and page-token filters. Results are returned newest-first. */ list(input?: ListTriggersInput, options?: PolyesterRequestOptions): Promise; /** * Cancels an active trigger by id in the resolved account scope and returns the trigger id, resulting status, and server timestamp. */ cancel(input: CancelTriggerInput, options?: PolyesterMutationOptions): Promise; /** * Applies a limited patch to an existing trigger. Omit activationPrice or maxSlippage to leave it unchanged, or pass `{ kind: "none" }` to clear it. An optional symbol ID must name the trigger's own market; an API key limited to specific markets must pass it. */ modify(input: ModifyTriggerInput, options?: PolyesterMutationOptions): Promise; /** * Pauses an active trigger without discarding its immutable strategy configuration. */ pause(input: PauseTriggerInput, options?: PolyesterMutationOptions): Promise; /** * Resumes a paused trigger. An optional symbol ID must name the trigger's own market; an API key limited to specific markets must pass it. */ resume(input: ResumeTriggerInput, options?: PolyesterMutationOptions): Promise; /** * Returns newest-first historical lifecycle events for one trigger, optionally filtered by event type. Fired events enumerate child-order actions. The SDK defaults limit to 50. */ listEvents(input: ListTriggerEventsInput, options?: PolyesterRequestOptions): Promise; /** * Subscribes to private trigger state updates on private:spot:triggers:{accountId}:proto and emits parsed trigger records. * Keep the copy of each trigger with the highest `version`, across list reads and updates, and ignore any copy whose * version is not higher than the one you hold: a reconnect can repeat an earlier state, and list results can lag. */ subscribe(input: SubscribeTriggersInput): () => void; /** * Subscribes to private trigger lifecycle events on private:spot:triggers:events:{accountId}:proto and emits parsed trigger event records. * Each publication batches events, emitted one at a time; `(triggerId, eventType, childSeq, * tsNs)` identifies an event, and a repeated identity replaces the earlier copy. */ subscribeEvents(input: SubscribeTriggerEventsInput): () => void; } //#endregion export { type CancelTriggerResult, type CreateTriggerResult, type ListTriggerEventsResult, ListTriggersResult, type ModifyTriggerResult, type PauseTriggerResult, type ResumeTriggerResult, TriggersService }; //# sourceMappingURL=triggers.d.ts.map