@gloom-sh/terminal 0.20.12 → 0.20.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/billing.ts +3 -2
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/request.ts +12 -2
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -34
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +146 -55
- package/src/cli/commands/overview.ts +21 -7
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +11 -2
- package/src/cli/listing-arg.ts +183 -28
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/catalog.ts +81 -12
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +13 -10
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +61 -15
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +24 -5
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +103 -16
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +23 -11
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/layout/pane/title.ts +10 -4
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +102 -33
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +3 -3
- package/src/i18n/es.ts +6 -2
- package/src/i18n/ja.ts +6 -2
- package/src/i18n/ko.ts +6 -2
- package/src/i18n/zh-cn.ts +6 -2
- package/src/i18n/zh-tw.ts +6 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +48 -14
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +26 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +8 -7
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -4
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +10 -4
- package/src/plugins/builtin/cpi/model.ts +25 -7
- package/src/plugins/builtin/cpi/pane.tsx +3 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +93 -14
- package/src/plugins/builtin/crypto-board/pane.tsx +28 -13
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +31 -5
- package/src/plugins/builtin/dividend-yield/headless.ts +20 -13
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +21 -12
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +8 -4
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +22 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +19 -3
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +25 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +27 -15
- package/src/plugins/builtin/macro-day/model.ts +42 -4
- package/src/plugins/builtin/macro-day/pane.tsx +30 -12
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +17 -5
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +11 -5
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +26 -7
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +8 -5
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +25 -15
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +33 -6
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -9
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -14
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +43 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +61 -45
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +7 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +6 -5
- package/src/tickers/company-name.ts +36 -2
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +22 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/time-series/types.ts +5 -2
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +28 -0
- package/src/types/headless.ts +2 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +98 -17
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/futures-generic.ts +14 -0
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/trailing-dividend.ts +13 -3
- package/src/utils/zoned-date-time.ts +47 -22
package/src/i18n/ko.ts
CHANGED
|
@@ -494,7 +494,6 @@ export const ko: Record<string, string> = {
|
|
|
494
494
|
"Portfolios Only": "포트폴리오만",
|
|
495
495
|
"Watchlists Only": "관심 목록만",
|
|
496
496
|
"Custom Selection": "맞춤 선택",
|
|
497
|
-
"Collection Pane": "컬렉션 패널",
|
|
498
497
|
"Hide Cash Positions": "현금 포지션 숨기기",
|
|
499
498
|
"Hide Header Bar": "헤더 표시줄 숨기기",
|
|
500
499
|
"Hide Header": "헤더 숨기기",
|
|
@@ -519,7 +518,8 @@ export const ko: Record<string, string> = {
|
|
|
519
518
|
"Functions": "기능",
|
|
520
519
|
"Shortcuts": "단축키",
|
|
521
520
|
"Issues": "이슈",
|
|
522
|
-
"Portfolio
|
|
521
|
+
"Portfolio Settings": "포트폴리오 설정",
|
|
522
|
+
"Watchlist Settings": "관심 목록 설정",
|
|
523
523
|
"Quote Monitor Settings": "시세 모니터 설정",
|
|
524
524
|
"Chart Pane Settings": "차트 패널 설정",
|
|
525
525
|
"Graph Pane Settings": "그래프 패널 설정",
|
|
@@ -695,6 +695,7 @@ export const ko: Record<string, string> = {
|
|
|
695
695
|
"Pro trial · {days}d left": "Pro 체험 · {days}일 남음",
|
|
696
696
|
"{delay} delayed": "{delay} 지연",
|
|
697
697
|
"{delay} delayed · try Pro live": "{delay} 지연 · Pro 실시간 사용해 보기",
|
|
698
|
+
"Stock quotes are {minutes} min delayed without Pro.": "Pro가 없으면 주식 시세는 {minutes}분 지연됩니다.",
|
|
698
699
|
"Pro trial {days}d": "Pro 체험 {days}일",
|
|
699
700
|
"Pro trial — ends {date}": "Pro 체험 — {date} 종료",
|
|
700
701
|
"delayed": "지연",
|
|
@@ -1568,6 +1569,9 @@ export const ko: Record<string, string> = {
|
|
|
1568
1569
|
"Pick up to 3; each adds a ready-made tab.": "최대 3개까지 고르세요. 각각 준비된 탭을 추가합니다.",
|
|
1569
1570
|
"Everything else is one search away.": "나머지는 검색 한 번이면 됩니다.",
|
|
1570
1571
|
"DESKS": "데스크",
|
|
1572
|
+
"TICKERS": "종목",
|
|
1573
|
+
"Which tickers do you follow?": "어떤 종목을 팔로우하시나요?",
|
|
1574
|
+
"Pick up to 3 for your watchlist.": "관심 목록에 넣을 종목을 최대 3개까지 고르세요.",
|
|
1571
1575
|
"Skip": "건너뛰기",
|
|
1572
1576
|
"Equities": "주식",
|
|
1573
1577
|
"Futures & commodities": "선물 및 원자재",
|
package/src/i18n/zh-cn.ts
CHANGED
|
@@ -496,7 +496,6 @@ export const zhCN: Record<string, string> = {
|
|
|
496
496
|
"Portfolios Only": "仅投资组合",
|
|
497
497
|
"Watchlists Only": "仅自选列表",
|
|
498
498
|
"Custom Selection": "自定义选择",
|
|
499
|
-
"Collection Pane": "集合面板",
|
|
500
499
|
"Hide Cash Positions": "隐藏现金持仓",
|
|
501
500
|
"Hide Header Bar": "隐藏标题栏",
|
|
502
501
|
"Hide Header": "隐藏标题",
|
|
@@ -521,7 +520,8 @@ export const zhCN: Record<string, string> = {
|
|
|
521
520
|
"Functions": "功能",
|
|
522
521
|
"Shortcuts": "快捷键",
|
|
523
522
|
"Issues": "问题反馈",
|
|
524
|
-
"Portfolio
|
|
523
|
+
"Portfolio Settings": "投资组合设置",
|
|
524
|
+
"Watchlist Settings": "自选列表设置",
|
|
525
525
|
"Quote Monitor Settings": "行情监控设置",
|
|
526
526
|
"Chart Pane Settings": "图表面板设置",
|
|
527
527
|
"Graph Pane Settings": "图形面板设置",
|
|
@@ -697,6 +697,7 @@ export const zhCN: Record<string, string> = {
|
|
|
697
697
|
"Pro trial · {days}d left": "Pro 试用 · 剩余 {days} 天",
|
|
698
698
|
"{delay} delayed": "延迟 {delay}",
|
|
699
699
|
"{delay} delayed · try Pro live": "延迟 {delay} · 试用 Pro 实时数据",
|
|
700
|
+
"Stock quotes are {minutes} min delayed without Pro.": "未开通 Pro 时,股票行情延迟 {minutes} 分钟。",
|
|
700
701
|
"Pro trial {days}d": "Pro 试用 {days} 天",
|
|
701
702
|
"Pro trial — ends {date}": "Pro 试用 — {date} 结束",
|
|
702
703
|
"delayed": "延迟",
|
|
@@ -1570,6 +1571,9 @@ export const zhCN: Record<string, string> = {
|
|
|
1570
1571
|
"Pick up to 3; each adds a ready-made tab.": "最多选 3 项,每项添加一个现成的标签页。",
|
|
1571
1572
|
"Everything else is one search away.": "其他内容一搜即得。",
|
|
1572
1573
|
"DESKS": "交易台",
|
|
1574
|
+
"TICKERS": "标的",
|
|
1575
|
+
"Which tickers do you follow?": "你关注哪些标的?",
|
|
1576
|
+
"Pick up to 3 for your watchlist.": "最多选 3 个加入自选列表。",
|
|
1573
1577
|
"Skip": "跳过",
|
|
1574
1578
|
"Equities": "股票",
|
|
1575
1579
|
"Futures & commodities": "期货与大宗商品",
|
package/src/i18n/zh-tw.ts
CHANGED
|
@@ -496,7 +496,6 @@ export const zhTW: Record<string, string> = {
|
|
|
496
496
|
"Portfolios Only": "僅投資組合",
|
|
497
497
|
"Watchlists Only": "僅自選清單",
|
|
498
498
|
"Custom Selection": "自訂選擇",
|
|
499
|
-
"Collection Pane": "清單面板",
|
|
500
499
|
"Hide Cash Positions": "隱藏現金持倉",
|
|
501
500
|
"Hide Header Bar": "隱藏標題欄",
|
|
502
501
|
"Hide Header": "隱藏標題",
|
|
@@ -521,7 +520,8 @@ export const zhTW: Record<string, string> = {
|
|
|
521
520
|
"Functions": "功能",
|
|
522
521
|
"Shortcuts": "快速鍵",
|
|
523
522
|
"Issues": "問題回報",
|
|
524
|
-
"Portfolio
|
|
523
|
+
"Portfolio Settings": "投資組合設定",
|
|
524
|
+
"Watchlist Settings": "自選清單設定",
|
|
525
525
|
"Quote Monitor Settings": "行情監控設定",
|
|
526
526
|
"Chart Pane Settings": "圖表面板設定",
|
|
527
527
|
"Graph Pane Settings": "圖形面板設定",
|
|
@@ -697,6 +697,7 @@ export const zhTW: Record<string, string> = {
|
|
|
697
697
|
"Pro trial · {days}d left": "Pro 試用 · 剩餘 {days} 天",
|
|
698
698
|
"{delay} delayed": "延遲 {delay}",
|
|
699
699
|
"{delay} delayed · try Pro live": "延遲 {delay} · 試用 Pro 即時資料",
|
|
700
|
+
"Stock quotes are {minutes} min delayed without Pro.": "未開通 Pro 時,股票報價延遲 {minutes} 分鐘。",
|
|
700
701
|
"Pro trial {days}d": "Pro 試用 {days} 天",
|
|
701
702
|
"Pro trial — ends {date}": "Pro 試用 — {date} 結束",
|
|
702
703
|
"delayed": "延遲",
|
|
@@ -1570,6 +1571,9 @@ export const zhTW: Record<string, string> = {
|
|
|
1570
1571
|
"Pick up to 3; each adds a ready-made tab.": "最多選 3 項,每項新增一個現成的分頁。",
|
|
1571
1572
|
"Everything else is one search away.": "其他內容一搜即得。",
|
|
1572
1573
|
"DESKS": "交易台",
|
|
1574
|
+
"TICKERS": "標的",
|
|
1575
|
+
"Which tickers do you follow?": "你關注哪些標的?",
|
|
1576
|
+
"Pick up to 3 for your watchlist.": "最多選 3 個加入自選清單。",
|
|
1573
1577
|
"Skip": "略過",
|
|
1574
1578
|
"Equities": "股票",
|
|
1575
1579
|
"Futures & commodities": "期貨與大宗商品",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatShortDate } from "../utils/datetime-format";
|
|
1
2
|
import {
|
|
2
3
|
findPaneInstance,
|
|
3
4
|
type LayoutConfig,
|
|
@@ -169,7 +170,7 @@ function marketplaceAuthorLabel(author: LayoutMarketplaceEntry["author"]): strin
|
|
|
169
170
|
export function formatPublishedAt(iso: string): string {
|
|
170
171
|
const date = new Date(iso);
|
|
171
172
|
if (Number.isNaN(date.getTime())) return "";
|
|
172
|
-
return date
|
|
173
|
+
return formatShortDate(date);
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
export function buildOwnedEntries(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../utils/format";
|
|
1
2
|
import { apiClient } from "../api-client";
|
|
2
3
|
import type { FuturesContractSpec, FuturesContractTermsPayload } from "../api-client/futures-curve";
|
|
3
4
|
import { classifyInstrumentType } from "../tickers/instrument-kind";
|
|
@@ -20,7 +21,7 @@ import { deliveryMonthLabel } from "../utils/contract-month";
|
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
/** A settlement the exchange has not confirmed reads as CTM writes a missing price. */
|
|
23
|
-
const FUTURES_MISSING =
|
|
24
|
+
const FUTURES_MISSING = MISSING_VALUE;
|
|
24
25
|
|
|
25
26
|
type FuturesContractLineKey = "contract" | "unit" | "size" | "tick" | "pointValue" | "settlement" | "firstNotice" | "lastTrade"
|
|
26
27
|
| "roll" | "front" | "nearest" | "mostActive";
|
|
@@ -660,7 +660,7 @@ export function useFxRateObservations(currencies: Array<string | null | undefine
|
|
|
660
660
|
if (!coordinator) return;
|
|
661
661
|
for (const currency of normalizedCurrencies) {
|
|
662
662
|
if (currency === "USD") continue;
|
|
663
|
-
void coordinator.loadFxRate(currency);
|
|
663
|
+
void coordinator.loadFxRate(currency).catch(logFailure("market-data.hooks", "Loading an exchange rate failed"));
|
|
664
664
|
}
|
|
665
665
|
}, [normalizedCurrencyKey]);
|
|
666
666
|
|
|
@@ -140,21 +140,43 @@ function isCboeYieldIndex(quote: Quote): boolean {
|
|
|
140
140
|
* its published calendar has a session that day and the print came after it
|
|
141
141
|
* opened. The S&P 500's closing print at 16:37 New York on Fri 6 Nov 2026 is
|
|
142
142
|
* Friday's, so its move is from Thursday's close. A print before the day's
|
|
143
|
-
* open, on a day the calendar has no session for,
|
|
144
|
-
* published calendar,
|
|
145
|
-
*
|
|
143
|
+
* open, or on a day the calendar has no session for, names none. An index
|
|
144
|
+
* on a venue with no published calendar, or on Cboe's, whose days are Cboe's
|
|
145
|
+
* own, is dated by its own sessions (`ownIndexSession`); a Cboe yield index,
|
|
146
|
+
* which skips the bond market's holidays, by none.
|
|
146
147
|
*/
|
|
147
148
|
function indexPrintSession(quote: Quote): string | null {
|
|
148
149
|
const venue = calendarVenue(quote);
|
|
149
|
-
|
|
150
|
+
// A Cboe index's days are Cboe's own: one with its own sessions (the Russell 2000, quoted under CHICAGO OPTIONS) is
|
|
151
|
+
// dated by them; a yield index, which skips the bond market's holidays, is not dated here.
|
|
152
|
+
if (venue === "CBOE") {
|
|
153
|
+
const zone = isCboeYieldIndex(quote) ? null : quote.indexSession?.timeZone;
|
|
154
|
+
const date = zone ? zonedDateKey(quote.lastUpdated, zone) : null;
|
|
155
|
+
return date ? ownIndexSession(quote, date) : null;
|
|
156
|
+
}
|
|
150
157
|
const zone = sessionCalendarTimeZone(venue) ?? quote.indexSession?.timeZone;
|
|
151
158
|
if (!zone) return null;
|
|
152
159
|
const date = zonedDateKey(quote.lastUpdated, zone);
|
|
153
|
-
if (!date
|
|
160
|
+
if (!date) return null;
|
|
161
|
+
if (!hasPublishedSessionCalendar(venue, date)) return ownIndexSession(quote, date);
|
|
162
|
+
if (!isVenueTradingDay(venue, date)) return null;
|
|
154
163
|
const open = latestRegularSessionOpen(venue, quote.lastUpdated);
|
|
155
164
|
return open != null && zonedDateKey(open, zone) === date ? date : null;
|
|
156
165
|
}
|
|
157
166
|
|
|
167
|
+
/**
|
|
168
|
+
* For an index whose venue publishes no calendar (the Euro Stoxx 50 and the
|
|
169
|
+
* FTSE 100, quoted under their publishers' ZURICH and FTSE INDEX), the
|
|
170
|
+
* session of the index's own calendar (indexSession) its print sits in: one
|
|
171
|
+
* that opened on `date`, at or before the print. Null when none did.
|
|
172
|
+
*/
|
|
173
|
+
function ownIndexSession(quote: Quote, date: string): string | null {
|
|
174
|
+
const session = quote.indexSession;
|
|
175
|
+
if (!session?.timeZone) return null;
|
|
176
|
+
const windows = [...session.regular, ...(session.current ? [session.current] : [])];
|
|
177
|
+
return windows.some((window) => window.start <= quote.lastUpdated && zonedDateKey(window.start, session.timeZone) === date) ? date : null;
|
|
178
|
+
}
|
|
179
|
+
|
|
158
180
|
/** A coin on the spot crypto venue: its day is the UTC day. */
|
|
159
181
|
function isSpotCoin(quote: Quote): boolean {
|
|
160
182
|
return quoteVenue(quote) === "CCC";
|
|
@@ -2,7 +2,7 @@ import type { PriceBasis } from "../../types/instrument";
|
|
|
2
2
|
import type { Quote } from "../../types/financials";
|
|
3
3
|
import { resolvePriceBasis } from "./price-basis";
|
|
4
4
|
import { isIndexLevel } from "./index-level";
|
|
5
|
-
import { currencyPriceDigits, formatCompact, formatCurrency, formatCurrencyCode } from "../../utils/format";
|
|
5
|
+
import { MISSING_VALUE, currencyPriceDigits, formatCompact, formatCurrency, formatCurrencyCode } from "../../utils/format";
|
|
6
6
|
import { BIDI_MARKS, isDrawableCurrencySign, minorUnitSign } from "../../utils/currency-units";
|
|
7
7
|
import { fxRateDigits } from "../../utils/currency-pair";
|
|
8
8
|
|
|
@@ -283,7 +283,7 @@ export function formatPriceObservation(
|
|
|
283
283
|
value: number,
|
|
284
284
|
options: Pick<MarketFormatOptions, "maxWidth" | "minimumFractionDigits"> = {},
|
|
285
285
|
): string {
|
|
286
|
-
if (!Number.isFinite(value)) return
|
|
286
|
+
if (!Number.isFinite(value)) return MISSING_VALUE;
|
|
287
287
|
return formatPriceNumber(value, 8, options.maxWidth, Math.max(0, Math.min(8, options.minimumFractionDigits ?? 0)));
|
|
288
288
|
}
|
|
289
289
|
|
|
@@ -362,7 +362,7 @@ export function resolveAssetDisplayKind({
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
export function formatMarketQuantity(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
365
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
365
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
366
366
|
if (options.priceBasis === "percent-of-par") {
|
|
367
367
|
const suffix = `${options.quantityCurrency ? ` ${options.quantityCurrency}` : ""} face`;
|
|
368
368
|
const maxWidth = options.maxWidth == null ? undefined : Math.max(1, options.maxWidth - suffix.length);
|
|
@@ -403,9 +403,9 @@ function tickFractionDigits(tick: number | undefined): number | undefined {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
export function formatMarketPrice(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
406
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
406
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
407
407
|
const basis = resolvePriceBasis(options.priceBasis, options.assetCategory);
|
|
408
|
-
if (basis === null) return
|
|
408
|
+
if (basis === null) return MISSING_VALUE;
|
|
409
409
|
if (basis === "thirty-seconds") return formatThirtySeconds(value);
|
|
410
410
|
if (basis === "points") return formatMarketPrice(value, { ...options, priceBasis: "per-unit" });
|
|
411
411
|
if (basis === "percent-of-par") {
|
|
@@ -453,9 +453,9 @@ export function formatMarketPrice(value: number | undefined, options: MarketForm
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
export function formatMarketCost(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
456
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
456
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
457
457
|
const basis = resolvePriceBasis(options.priceBasis, options.assetCategory);
|
|
458
|
-
if (basis === null) return
|
|
458
|
+
if (basis === null) return MISSING_VALUE;
|
|
459
459
|
if (basis === "thirty-seconds") return formatThirtySeconds(value);
|
|
460
460
|
if (basis === "points") return formatMarketCost(value, { ...options, priceBasis: "per-unit" });
|
|
461
461
|
if (basis === "percent-of-par") {
|
|
@@ -469,8 +469,8 @@ export function formatMarketCost(value: number | undefined, options: MarketForma
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
export function formatSignedMarketPrice(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
472
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
473
|
-
if (resolvePriceBasis(options.priceBasis, options.assetCategory) === null) return
|
|
472
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
473
|
+
if (resolvePriceBasis(options.priceBasis, options.assetCategory) === null) return MISSING_VALUE;
|
|
474
474
|
if (options.fixedFractionDigits !== undefined) {
|
|
475
475
|
// A move at the instrument's fixed decimals: the sign always has its column,
|
|
476
476
|
// and a move that rounds to zero is unsigned (0.00, never +0.00 or -0.00).
|
|
@@ -495,7 +495,7 @@ export function formatMarketChangeWithCurrency(
|
|
|
495
495
|
options: MarketFormatOptions = {},
|
|
496
496
|
referencePrice?: number,
|
|
497
497
|
): string {
|
|
498
|
-
if (value == null || !Number.isFinite(value)) return
|
|
498
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
499
499
|
if (isIndexLevel(options.assetCategory) || resolvePriceBasis(options.priceBasis, options.assetCategory) !== "per-unit") return formatSignedMarketPrice(value, options);
|
|
500
500
|
if (options.fixedFractionDigits !== undefined) {
|
|
501
501
|
const maxWidth = options.maxWidth == null ? undefined : Math.max(1, options.maxWidth - 1);
|
|
@@ -644,9 +644,14 @@ export function stablePriceFractionDigits(context: StablePriceContext): number {
|
|
|
644
644
|
digits = 2;
|
|
645
645
|
}
|
|
646
646
|
if (kind !== "crypto" && reference !== undefined) digits = Math.max(digits, tinyPriceFractionDigits(reference));
|
|
647
|
+
// A coin's session prices raise its decimals only to six significant figures: a composite's close is computed,
|
|
648
|
+
// and one written to eight decimals (0.99880666) would pad every price, bid and range to eight as well.
|
|
649
|
+
const sessionCeiling = kind === "crypto" && reference !== undefined
|
|
650
|
+
? Math.min(ceiling, Math.max(digits, 5 - Math.floor(Math.log10(reference))))
|
|
651
|
+
: ceiling;
|
|
647
652
|
for (const price of context.sessionPrices ?? []) {
|
|
648
653
|
const magnitude = positiveMagnitude(price);
|
|
649
|
-
if (magnitude !== undefined) digits = Math.max(digits, writtenFractionDigits(magnitude,
|
|
654
|
+
if (magnitude !== undefined) digits = Math.max(digits, writtenFractionDigits(magnitude, sessionCeiling));
|
|
650
655
|
}
|
|
651
656
|
return digits;
|
|
652
657
|
}
|
|
@@ -739,7 +744,7 @@ export function formatMarketPriceWithCurrency(
|
|
|
739
744
|
currency = "USD",
|
|
740
745
|
options: MarketFormatOptions = {},
|
|
741
746
|
): string {
|
|
742
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
747
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
743
748
|
if (isIndexLevel(options.assetCategory) || resolvePriceBasis(options.priceBasis, options.assetCategory) !== "per-unit") return formatMarketPrice(value, options);
|
|
744
749
|
const normalizedCurrency = currency.trim().toUpperCase() || "USD";
|
|
745
750
|
const sign = value < 0 ? "-" : "";
|
|
@@ -751,12 +756,41 @@ export function formatMarketPriceWithCurrency(
|
|
|
751
756
|
return `${hasNonZeroDigit(body) ? sign : ""}${prefix}${body}${suffix}`;
|
|
752
757
|
}
|
|
753
758
|
|
|
759
|
+
const writtenDecimals = (text: string) => /\.(\d+)\D*$/.exec(text)?.[1]!.length ?? 0;
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* A range's low and high, both to one number of decimals, with `currency`'s
|
|
763
|
+
* sign when given. A coin's ends are rounded to its price's decimals first
|
|
764
|
+
* (stablePriceFractionDigits' six significant figures): a composite's low of
|
|
765
|
+
* 0.9989128 beside a high of 0.998990 is a float's tail, not a finer trade the
|
|
766
|
+
* price's decimals must keep.
|
|
767
|
+
*/
|
|
768
|
+
export function formatMarketPriceRange(
|
|
769
|
+
low: number,
|
|
770
|
+
high: number,
|
|
771
|
+
options: MarketFormatOptions = {},
|
|
772
|
+
currency?: string,
|
|
773
|
+
): [string, string] {
|
|
774
|
+
const format = (value: number, digits?: number) => {
|
|
775
|
+
const shown = digits === undefined ? options : { ...options, fixedFractionDigits: digits };
|
|
776
|
+
return currency === undefined ? formatMarketPrice(value, shown) : formatMarketPriceWithCurrency(value, currency, shown);
|
|
777
|
+
};
|
|
778
|
+
const coinDigits = resolveAssetDisplayKind(options) === "crypto" ? options.fixedFractionDigits : undefined;
|
|
779
|
+
const round = (value: number) => coinDigits === undefined || !Number.isFinite(value) ? value : Number(value.toFixed(coinDigits));
|
|
780
|
+
const ends = [round(low), round(high)] as const;
|
|
781
|
+
const texts: [string, string] = [format(ends[0]), format(ends[1])];
|
|
782
|
+
const digits = texts.map(writtenDecimals);
|
|
783
|
+
if (digits[0] === digits[1]) return texts;
|
|
784
|
+
const shared = Math.max(digits[0]!, digits[1]!);
|
|
785
|
+
return [format(ends[0], shared), format(ends[1], shared)];
|
|
786
|
+
}
|
|
787
|
+
|
|
754
788
|
export function formatMarketCostWithCurrency(
|
|
755
789
|
value: number | undefined,
|
|
756
790
|
currency = "USD",
|
|
757
791
|
options: MarketFormatOptions = {},
|
|
758
792
|
): string {
|
|
759
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
793
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
760
794
|
if (resolvePriceBasis(options.priceBasis, options.assetCategory) !== "per-unit") return formatMarketCost(value, options);
|
|
761
795
|
const normalizedCurrency = currency.trim().toUpperCase() || "USD";
|
|
762
796
|
const sign = value < 0 ? "-" : "";
|
|
@@ -780,7 +814,7 @@ export function formatCompactMarketPriceWithCurrency(
|
|
|
780
814
|
currency = "USD",
|
|
781
815
|
options: MarketFormatOptions = {},
|
|
782
816
|
): string {
|
|
783
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
817
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
784
818
|
const abs = Math.abs(value);
|
|
785
819
|
|
|
786
820
|
if (abs >= 1e6) {
|
|
@@ -240,6 +240,17 @@ export function mergeQuoteContribution(
|
|
|
240
240
|
else delete merged.yearRangeBasis;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
// What a coin's day range and volume measure goes with the range the merge keeps, as the 52-week range's does:
|
|
244
|
+
// a tick relaying the same range keeps the word, one with another range says its own or none.
|
|
245
|
+
if (next.high !== undefined || next.low !== undefined) {
|
|
246
|
+
const relayed = next.statsBasis === undefined && next.high === current.high && next.low === current.low;
|
|
247
|
+
const basis = relayed ? current.statsBasis : next.statsBasis;
|
|
248
|
+
if (basis) merged.statsBasis = basis;
|
|
249
|
+
else delete merged.statsBasis;
|
|
250
|
+
if (relayed ? current.rangeWidened : next.rangeWidened) merged.rangeWidened = true;
|
|
251
|
+
else delete merged.rangeWidened;
|
|
252
|
+
}
|
|
253
|
+
|
|
243
254
|
// What this observation's move is from, when not its previous close (a coin's
|
|
244
255
|
// 24 hours), is said with each one: a quote back on its
|
|
245
256
|
// previous close drops an earlier "24h", and one on 24 hours drops the
|
|
@@ -263,6 +274,8 @@ export function mergeQuoteContribution(
|
|
|
263
274
|
}
|
|
264
275
|
// So is a close its daily closes could not date: the next reading says it again.
|
|
265
276
|
if (next.previousCloseUndated === undefined) delete merged.previousCloseUndated;
|
|
277
|
+
// And the exchange whose own trade the price is: a composite or streamed tick after it names none.
|
|
278
|
+
if (next.priceVenue === undefined) delete merged.priceVenue;
|
|
266
279
|
|
|
267
280
|
if (isOtherTradingDay(current, next)) {
|
|
268
281
|
const record = merged as unknown as Record<string, unknown>;
|
|
@@ -3,6 +3,7 @@ import { isYieldIndexSymbol } from "../../tickers/index-roots";
|
|
|
3
3
|
import { currencyPairCode } from "../../utils/currency-pair";
|
|
4
4
|
import { parsePublicTickerKey } from "../../utils/exchanges";
|
|
5
5
|
import { INDEX_POINTS_EXPORT_UNIT, isIndexLevel, YIELD_INDEX_EXPORT_UNIT } from "../market/index-level";
|
|
6
|
+
import { delayedFeedLagMs } from "../market/freshness";
|
|
6
7
|
import { quoteHeadlineTime, quoteSessionStateLabel } from "../market/status";
|
|
7
8
|
import { isQuoteStaleForCurrentSession } from "./freshness";
|
|
8
9
|
|
|
@@ -43,12 +44,46 @@ export type BrokerNameOf = (providerId: string) => string | null | undefined;
|
|
|
43
44
|
* the broker whose feed it is, by its name. Blank for a source with no name
|
|
44
45
|
* to give, never its internal id.
|
|
45
46
|
*/
|
|
46
|
-
export function quoteSourceName(quote: Pick<Quote, "providerId"> | null | undefined, brokerName?: BrokerNameOf): string {
|
|
47
|
+
export function quoteSourceName(quote: Pick<Quote, "providerId" | "priceVenue"> | null | undefined, brokerName?: BrokerNameOf): string {
|
|
47
48
|
if (!quote) return "";
|
|
49
|
+
// A coin priced by one exchange's own trade is that exchange's price, not the composite's.
|
|
50
|
+
if (quote.priceVenue && (!quote.providerId || quote.providerId === CLOUD_PROVIDER_ID)) return quote.priceVenue;
|
|
48
51
|
if (!quote.providerId || quote.providerId === CLOUD_PROVIDER_ID) return CLOUD_SOURCE;
|
|
49
52
|
return brokerName?.(quote.providerId)?.trim() || "";
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
/**
|
|
56
|
+
* What a coin's day range and volume measure, as said beside them: `composite` (across exchanges), `composite +
|
|
57
|
+
* Coinbase` when the range was widened to take in the exchange's price, or `1 exchange` (one exchange's own day).
|
|
58
|
+
* Empty when the service does not say, as for anything but a coin.
|
|
59
|
+
*/
|
|
60
|
+
export function quoteStatsBasisText(quote: Pick<Quote, "statsBasis" | "rangeWidened" | "priceVenue"> | null | undefined, range = true): string {
|
|
61
|
+
if (quote?.statsBasis === "exchange") return "1 exchange";
|
|
62
|
+
if (quote?.statsBasis !== "composite") return "";
|
|
63
|
+
return range && quote.rangeWidened && quote.priceVenue ? `composite + ${quote.priceVenue}` : "composite";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const UTC_WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Where a coin's price is from and when, as its header says it: the exchange whose own trade it is and that trade's
|
|
70
|
+
* time (`Coinbase · 21:53:40 UTC`), the composite of several exchanges and its time, or `composite · 15m delayed`
|
|
71
|
+
* when it is held back. A time from another UTC day leads with its weekday. Empty for a quote Gloom Cloud does not
|
|
72
|
+
* price, such as a broker's.
|
|
73
|
+
*/
|
|
74
|
+
export function coinPriceVenueText(
|
|
75
|
+
quote: Pick<Quote, "providerId" | "priceVenue" | "dataSource" | "lastUpdated"> | null | undefined,
|
|
76
|
+
now = Date.now(),
|
|
77
|
+
): string {
|
|
78
|
+
if (!quote || (quote.providerId && quote.providerId !== CLOUD_PROVIDER_ID)) return "";
|
|
79
|
+
const venue = quote.priceVenue ?? "composite";
|
|
80
|
+
if (!quote.priceVenue && quote.dataSource === "delayed") return `${venue} · ${delayedFeedLagMs("CCC") / 60_000}m delayed`;
|
|
81
|
+
if (!Number.isFinite(quote.lastUpdated) || quote.lastUpdated <= 0) return venue;
|
|
82
|
+
const at = new Date(quote.lastUpdated);
|
|
83
|
+
const day = Math.floor(quote.lastUpdated / 86_400_000) === Math.floor(now / 86_400_000) ? "" : `${UTC_WEEKDAYS[at.getUTCDay()]} `;
|
|
84
|
+
return `${venue} · ${day}${at.toISOString().slice(11, 19)} UTC`;
|
|
85
|
+
}
|
|
86
|
+
|
|
52
87
|
/** Whether a quote's feed is live, delayed or stale, as the Feed cell of `quote` says it. */
|
|
53
88
|
export function quoteExportFeed(quote: Quote | null | undefined, now = Date.now()): string {
|
|
54
89
|
if (!quote) return "";
|
|
@@ -3,7 +3,7 @@ import { cashAndShortTermInvestments } from "../../utils/cash-runway";
|
|
|
3
3
|
import { formatShortDate } from "../../utils/datetime-format";
|
|
4
4
|
import { formatCompact } from "../../utils/format";
|
|
5
5
|
import {
|
|
6
|
-
checkCashBasis, enterpriseValueCheck, enterpriseValueNotMeaningful, enterpriseValueWithdrawn, reportedEnterpriseValue,
|
|
6
|
+
checkCashBasis, enterpriseValueCheck, enterpriseValueNotMeaningful, enterpriseValueWithdrawn, reportedEnterpriseValue, withFinancialEnterpriseValue,
|
|
7
7
|
} from "../../utils/fundamentals";
|
|
8
8
|
import { debtAndLeases, leaseBasis } from "../../utils/lease-liabilities";
|
|
9
9
|
import { viewMarketCapitalization } from "../../utils/market-capitalization";
|
|
@@ -91,7 +91,7 @@ export const balanceSheetDay = (date: string) => formatShortDate(`${date.slice(0
|
|
|
91
91
|
* meaningful at or below zero and for a bank.
|
|
92
92
|
*/
|
|
93
93
|
export function listingEnterpriseValue(financials: EnterpriseValueInputs, now = Date.now()): ListingEnterpriseValue {
|
|
94
|
-
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals:
|
|
94
|
+
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals: withFinancialEnterpriseValue(financials.fundamentals, financials.profile) });
|
|
95
95
|
const fundamentals = priced.fundamentals;
|
|
96
96
|
const notMeaningful = enterpriseValueNotMeaningful(fundamentals);
|
|
97
97
|
if (notMeaningful) return { kind: "not-meaningful", reason: notMeaningful };
|
|
@@ -230,7 +230,7 @@ function statementBridge(
|
|
|
230
230
|
export function balanceSheetRateWanted(financials: EnterpriseValueInputs, now = Date.now()): Omit<BalanceSheetRate, "rate" | "closeDate"> | null {
|
|
231
231
|
const { annualStatements, quarterlyStatements } = financials;
|
|
232
232
|
if (!annualStatements || !quarterlyStatements) return null;
|
|
233
|
-
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals:
|
|
233
|
+
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals: withFinancialEnterpriseValue(financials.fundamentals, financials.profile) });
|
|
234
234
|
const fundamentals = priced.fundamentals;
|
|
235
235
|
if (enterpriseValueNotMeaningful(fundamentals) || reportedEnterpriseValue(fundamentals) != null || !enterpriseValueWithdrawn(fundamentals)) return null;
|
|
236
236
|
const check = enterpriseValueCheck(fundamentals);
|
|
@@ -146,6 +146,19 @@ function sessionConfidenceRank(confidence?: SessionConfidence): number {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* What a coin's day range measures, said of the range, so it comes with the
|
|
151
|
+
* provider whose range it is; and whether the service widened it to take in
|
|
152
|
+
* its exchange's price.
|
|
153
|
+
*/
|
|
154
|
+
function dayRangeBasis(contributions: readonly QuoteContribution[], resolved: Partial<Quote>): Pick<Quote, "statsBasis" | "rangeWidened"> {
|
|
155
|
+
const source = contributions.find((quote) => quote.high === resolved.high && quote.low === resolved.low);
|
|
156
|
+
return {
|
|
157
|
+
...(source?.statsBasis ? { statsBasis: source.statsBasis } : {}),
|
|
158
|
+
...(source?.rangeWidened ? { rangeWidened: true } : {}),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
149
162
|
function toProvenance(quote: QuoteContribution | undefined): QuoteFieldProvenance | undefined {
|
|
150
163
|
if (!quote?.providerId) return undefined;
|
|
151
164
|
return {
|
|
@@ -512,6 +525,7 @@ export function resolveCanonicalQuote(
|
|
|
512
525
|
low52w: resolved.low52w as Quote["low52w"],
|
|
513
526
|
// Said of the range, so it comes with the provider whose range it is.
|
|
514
527
|
yearRangeBasis: contributions.find((quote) => quote.high52w === resolved.high52w && quote.low52w === resolved.low52w)?.yearRangeBasis,
|
|
528
|
+
...dayRangeBasis(contributions, resolved),
|
|
515
529
|
// Said of the price, so it comes with it.
|
|
516
530
|
dailyClose: priceProvider?.dailyClose,
|
|
517
531
|
marketCap: resolved.marketCap as Quote["marketCap"],
|
|
@@ -547,6 +561,8 @@ export function resolveCanonicalQuote(
|
|
|
547
561
|
indexSession: priceProvider?.indexSession,
|
|
548
562
|
// A listing that no longer trades: the price is its last trade.
|
|
549
563
|
delisting: priceProvider?.delisting,
|
|
564
|
+
// The one exchange whose own trade or book the price is, when it is one's.
|
|
565
|
+
...(priceProvider?.priceVenue ? { priceVenue: priceProvider.priceVenue } : {}),
|
|
550
566
|
// A perpetual's funding, open interest and premium are of the reading that gave its price.
|
|
551
567
|
...(priceProvider?.perpetual ? { perpetual: priceProvider.perpetual } : {}),
|
|
552
568
|
bid: resolved.bid as Quote["bid"],
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../utils/format";
|
|
1
2
|
import type { Quote } from "../../types/financials";
|
|
2
3
|
import { getLanguage, tf } from "../../i18n";
|
|
3
4
|
import { isPerpetualExchange } from "../../tickers/perpetual-listing";
|
|
4
5
|
import { formatUtcDayTime, formatUtcWeekdayTime } from "../../utils/utc-time";
|
|
6
|
+
import { formatShortDate } from "../../utils/datetime-format";
|
|
5
7
|
import { delayedFeedLagMs } from "../market/freshness";
|
|
6
8
|
import { quoteHeadlineTime, quoteSessionStateLabel } from "../market/status";
|
|
7
9
|
import { dailyNavDate, isQuoteStaleForCurrentSession } from "./freshness";
|
|
@@ -11,12 +13,17 @@ export function formatQuoteNavAsOf(quote: Quote | null | undefined, now = Date.n
|
|
|
11
13
|
const date = quote && dailyNavDate(quote, now);
|
|
12
14
|
if (!date) return null;
|
|
13
15
|
const sourceDate = new Date(`${date}T00:00:00Z`);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const otherYear = sourceDate.getUTCFullYear() !== new Date(now).getUTCFullYear();
|
|
17
|
+
// English reads the day first, as every other date does; another language writes the day its own way.
|
|
18
|
+
const language = getLanguage();
|
|
19
|
+
const dateText = language === "en"
|
|
20
|
+
? formatShortDate(sourceDate, { utc: true, year: otherYear ? "numeric" : false })
|
|
21
|
+
: new Intl.DateTimeFormat(language, {
|
|
22
|
+
timeZone: "UTC",
|
|
23
|
+
month: "short",
|
|
24
|
+
day: "numeric",
|
|
25
|
+
...(otherYear ? { year: "numeric" as const } : {}),
|
|
26
|
+
}).format(sourceDate);
|
|
20
27
|
return tf("NAV · as of {date}", { date: dateText });
|
|
21
28
|
}
|
|
22
29
|
|
|
@@ -72,7 +79,7 @@ export interface QuoteAgeFormatOptions {
|
|
|
72
79
|
|
|
73
80
|
export function formatQuoteAge(lastUpdated: number | undefined, now = Date.now(), options: QuoteAgeFormatOptions = {}): string {
|
|
74
81
|
const clamped = clampQuoteTimestamp(lastUpdated, now);
|
|
75
|
-
if (clamped == null) return
|
|
82
|
+
if (clamped == null) return MISSING_VALUE;
|
|
76
83
|
|
|
77
84
|
// A receipt or source time ahead of the clock is fresh, never negative.
|
|
78
85
|
const ageMs = Math.max(0, now - clamped);
|
|
@@ -99,11 +106,11 @@ export function formatQuoteAgeWithSource(
|
|
|
99
106
|
now = Date.now(),
|
|
100
107
|
options: QuoteAgeFormatOptions = {},
|
|
101
108
|
): string {
|
|
102
|
-
if (!quote) return
|
|
109
|
+
if (!quote) return MISSING_VALUE;
|
|
103
110
|
|
|
104
111
|
const timestamp = resolveQuoteAgeTimestamp(quote, now);
|
|
105
|
-
const age = timestamp == null ?
|
|
106
|
-
if (age ===
|
|
112
|
+
const age = timestamp == null ? MISSING_VALUE : formatQuoteAge(timestamp, now, options);
|
|
113
|
+
if (age === MISSING_VALUE) return age;
|
|
107
114
|
|
|
108
115
|
const prefix = quote.dataSource === "delayed" ? "◷" : "";
|
|
109
116
|
return prefix ? `${prefix}${age}` : age;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../utils/format";
|
|
1
2
|
import { apiClient } from "../api-client";
|
|
2
3
|
import type { FundBondFacts } from "../api-client/fund-facts";
|
|
3
4
|
import type { HeadlessPaneEntry, HeadlessPaneOptionDef } from "../types/headless";
|
|
@@ -368,7 +369,7 @@ export function taxEquivalentLines(analysis: TaxEquivalentAnalysis): TaxEquivale
|
|
|
368
369
|
{ key: "taxRate", label: "Tax rate", text: `${formatRate(combined)} (${stateText})`, value: combined, unit: "%", export: exportPercent(formatRate(combined), null) },
|
|
369
370
|
];
|
|
370
371
|
if (analysis.notApplicable || !analysis.basis || analysis.taxEquivalentYield == null) {
|
|
371
|
-
const reason = analysis.notApplicable ??
|
|
372
|
+
const reason = analysis.notApplicable ?? MISSING_VALUE;
|
|
372
373
|
lines.push({ key: "taxEquivalentYield", label: "Tax-equivalent yield", text: reason, value: null, export: { formatted: reason, asOf: null } });
|
|
373
374
|
return lines;
|
|
374
375
|
}
|
|
@@ -394,7 +395,7 @@ export function taxEquivalentLines(analysis: TaxEquivalentAnalysis): TaxEquivale
|
|
|
394
395
|
value: Math.round(ratio.value * 10_000) / 10_000,
|
|
395
396
|
export: exportPercent(ratioText, ratioAsOf),
|
|
396
397
|
}
|
|
397
|
-
: { key: "muniTreasuryRatio", label: "Muni/Treasury ratio", text: analysis.ratioNote ??
|
|
398
|
+
: { key: "muniTreasuryRatio", label: "Muni/Treasury ratio", text: analysis.ratioNote ?? MISSING_VALUE, value: null, export: { formatted: analysis.ratioNote ?? "—", asOf: null } });
|
|
398
399
|
return lines;
|
|
399
400
|
}
|
|
400
401
|
|