feat: cockpit

This commit is contained in:
OpenSquared
2026-07-24 11:46:37 +02:00
parent ae732c5822
commit 35a00f43c3
6 changed files with 201 additions and 13 deletions

View File

@@ -219,6 +219,16 @@ export const useSetInstrumentSaxoLink = () =>
api.put(`/instruments/${encodeURIComponent(instrumentId)}/saxo-link`, { saxo_symbol: saxoSymbol }).then(r => r.data),
})
// Brings a Cockpit Watchlist ticker into Instrument Analysis without hand-authoring an
// instruments.json entry — its saxo_quote_symbol (already linked in Config -> Instruments
// Watchlist) is copied over automatically. Idempotent: a ticker that already resolves
// (real catalog entry or an earlier quick add) is returned unchanged.
export const useQuickAddInstrument = () =>
useMutation({
mutationFn: (ticker: string) =>
api.post('/instruments/quick-add', { ticker }).then(r => r.data as { id: string; created: boolean }),
})
// Free-form display name — no longer tied to yfinance's long_name lookup, since an
// instrument can now be entirely Saxo-sourced.
export const useRenameWatchlistInstrument = () => {