/** * Where `senpi validate` gets the exchange's live instrument list. * * The universe check is injected with a source rather than building one, so that the check stays * testable and a programmatic caller can supply its own. This is the CLI's implementation of that * source — the counterpart of `deploy/register.ts`'s `listLiveInstruments: () => * client.listInstrumentNames(callDeadline())`, which does the same thing on the money path. * * ## It is LAZY, and that is what keeps the offline depths offline * * Nothing is constructed and nothing is dialled until `listLiveInstruments()` is actually called, * and the only caller is the live depth. So `--stage static` and `--stage import` reach no network * even though the command always hands the source over — the property holds by construction rather * than by a flag someone has to remember to set. * * ## It THROWS rather than returning nothing * * When credentials are absent, or the client cannot be reached, this raises with the reason. * `checkPackageUniverse` turns a raising source into `{ status: "unavailable" }`, which validate * renders as `W_VALIDATE_UNIVERSE_UNAVAILABLE` — "the check did not run, and here is why". The * alternative — the command quietly declining to supply a source when the environment looks * unpromising — is the dormancy this wiring exists to remove: a run that passes having never made * the check it appears to make. Returning `[]` would be worse still: an empty list is defined * upstream as "could not read", but nothing here should rely on a caller remembering that. */ import { SenpiClient } from "../senpi/client.js"; import type { ValidateDeps } from "./universe-stage.js"; export interface LiveInstrumentSource { deps: ValidateDeps; /** Releases the connection, if one was ever opened. Never throws; safe to call unconditionally. */ close(): Promise; } /** * The CLI's live-instrument source. Opens nothing until asked. * * `env` and `connect` are injected for the tests — the credential rule and the laziness are the * behaviour worth pinning, and neither should need a reachable MCP server to check. */ export declare function createLiveInstrumentSource(options?: { env?: NodeJS.ProcessEnv; /** Builds the client. Defaults to a real self-managed `SenpiClient`. */ createClient?: () => Pick; }): LiveInstrumentSource; //# sourceMappingURL=live-instruments.d.ts.map