ChartnautDocs

Changelog

What changed in each version of the two packages. While a version starts with 0., a minor version may rename or remove something; from 1.0, names only grow. The same notes ship in each package as CHANGELOG.md.

When your SDK is out of date

The terminal says which SDK versions it supports in its first event, hello, as sdk: { min, latest }. An SDK older than min logs a warning in the browser console: update it now, because some calls may fail. An SDK older than latest logs a note once, with a link to this page. Your users never see either.

npm install @chartnaut/charts@latest @chartnaut/node@latest

SDK_VERSION from @chartnaut/charts is the version your page runs.

@chartnaut/charts

0.1.6 (2026-11-22)

Fixed

  • useLayout().focusedChart is always one of the layout's charts. Going from 6 charts to 1 could leave it naming a chart that was gone (No chart "c6"); it now falls back to the first chart.

  • The terminal's iframe no longer logs "Allow attribute will take precedence over 'allowfullscreen'" on every load. Fullscreen still works.

0.1.5 (2026-11-21)

Changed

  • The error event for a frame refused because the user already has your app open in 3 places (reason: "frame_sockets", with details.cap) now says so: "The user has your app open in 3 other places. Close one, then open the terminal again." Before, it read "The terminal stopped".

0.1.4 (2026-11-20)

Changed

  • One terminal per page. While a terminal is on the page, createTerminal and embed throw not_allowed with reason: "one_terminal_per_page", and a second <Terminal> or <ChartnautFrame> renders nothing, calls onError and logs once. Unmounting or destroy() frees the page at once, so page changes and React's strict mode work as before. Use the layout for more charts. A Connect card (a link's sign-in frame) doesn't count and can sit beside the terminal; a second Connect card is refused with reason: "one_connect_card_per_page". See not_allowed.

0.1.3 (2026-11-20)

Added

  • SDK_VERSION, this package's version.

  • A console warning when this SDK is older than the oldest version the terminal supports, and a one-time note when a newer version is out. The terminal's hello event carries sdk: { min, latest }.

0.1.2 (2026-11-20)

Added

  • symbols.get(symbol).order_size: the sizes a market takes in a backtest, { unit, min, max, step } (unit is "lots", "contracts" or "units"). A size refusal carries the same object in error.details.order_size. New types SizeUnit and OrderSizeRules.

  • terminal.openPanel("trades" | "none") opens or closes the Trades panel.

  • useLayout returns { layout, charts, panels, focusedChart, handle }. The layout is read once when the terminal is ready and then kept by its events; an unchanged layout keeps the same objects. New type LayoutState.

  • useAccount and usePositions take { onError }, and the account carries error when a read failed after retrying.

  • COMMAND_TIMEOUTS_MS: reads wait 5 seconds for a reply, orders and closes 20, close_all and cancel_all 30, bars, trades, screenshots and layout and workspace changes 15.

  • share(), the structural sharing helper the hooks use.

Changed

  • createTerminal and <Terminal> send a command again when the terminal refuses it with rate_limited (after retry_after), and a read again when it is refused with not_ready, for up to 15 seconds. send(name, args, { retry: false }) answers the first refusal. embed() still sends once.

  • terminal.account keeps the balance and the open positions live: read when the terminal is ready, read again on order and position events, with each position's P&L merged in as it moves.

  • The layout handle follows events instead of reading the layout after every change.

Fixed

  • useLayout, useAccount and usePositions no longer read again on every render when given an inline callback.

0.1.1 (2026-11-19)

  • The README leads with React, with eleven examples. No code changes.

0.1.0 (2026-11-19)

The first release under this name. It was published briefly as @chartnaut/embed 0.1.0, which is deprecated.

  • <Terminal> and createTerminal(): the terminal in an iframe, with calls before it is ready queued until it is, a status on everything, typed events and typed errors (code, message, reason, details, docs, is()).

  • Hooks: useTerminal, useChart, useLayout, useScript, useQuote, useReplay, useAccount, usePositions, useFills, useWorkspace, and <Ready>.

  • Charts and layout: terminal.chart(id), layout presets and split trees, panels, link groups, pickSymbol and pickScript, chart rects.

  • Scripts, drawings and overlays: chart.scripts.add, script handles with values() and { hold: true } events, chart.draw.*, the user's drawings and their events, chart.overlays.

  • Data: symbols.search and symbols.get, bars, live quotes, screenshots.

  • Replay, orders and the account in backtests: orders.buy and sell by size or risk, position handles, orders.lock, replay.until.

  • interface switches (onlyCharts), appearance and theme presets, persist, the workspace.

  • @chartnaut/charts/testing: createMockTerminal() for tests without a terminal.

  • ChartnautFrame, useChartnautFrame and embed() from the earlier frame SDK still work.

@chartnaut/node

0.1.3 (2026-11-22)

Fixed

  • Cleaner type definitions: comments only, nothing your code uses changed.

0.1.2 (2026-11-21)

Fixed

  • frameRoute with whenNotLinked: { link } reuses the open Connect link for the same user and permissions until a minute before it expires, and requests at the same moment share one. Before, every request from an unlinked user made a new link, and a user can have 5 open: a few screen switches ran into partner_limit.

Added

  • The user's own broker accounts (accounts:read): cn.accounts.getUserAccount(id) and cn.accounts.positions(id); cn.accounts.trades(id) reads their closed trades too. See Their own broker accounts.

0.1.1 (2026-11-20)

Added

  • account_label on cn.links.create: your name for the person (a username or email, up to 200 characters). The consent screen shows it masked beside their Chartnaut account, so nobody connects someone else's account by mistake.

0.1.0 (2026-11-20)

The first release.

  • new Chartnaut({ key }): a typed client for every partner API route (users, managed users, links, frames, sessions, demo accounts, scripts, webhooks). It reads CHARTNAUT_SECRET_KEY by default.

  • cn.frames.url() caches each frame URL until an hour before it expires, with a pluggable FrameCache for several server instances.

  • Retries: 429 after Retry-After (up to 30 seconds), 5xx and no answer with backoff, one Idempotency-Key per POST across its retries.

  • ChartnautApiError with code, reason, details, retryAfter, docs and is().

  • frameRoute (Next.js), frameRouteExpress and frameRouteNode: the route <Terminal> asks for its frame URL, with whenNotLinked and backtests by key (backtest: { key, start }).

  • verifyRequest and verifyWebhook: webhook signature checks for Fetch requests, Express raw() bodies and Node streams.