@forgecharts/sdk 1.5.71 → 1.5.72

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.
@@ -18367,7 +18367,7 @@ var DEMONSTRATION_STROKE = "rgba(255, 200, 50, 0.7)";
18367
18367
  var DEMONSTRATION_COLOR = "var(--crosshair-overlay, rgba(255,255,255,0.75))";
18368
18368
 
18369
18369
  // src/version.ts
18370
- var FORGECHARTS_VERSION = "1.5.71" ;
18370
+ var FORGECHARTS_VERSION = "1.5.72" ;
18371
18371
  function applyRuntimeConfig(caps, config) {
18372
18372
  if (!config) return caps;
18373
18373
  const orderEntry = config.enableOrderEntry === false ? false : caps.orderEntry;
@@ -18594,11 +18594,19 @@ var _listeners = /* @__PURE__ */ new Set();
18594
18594
  var _subscribed = /* @__PURE__ */ new Set();
18595
18595
  var _reconnectTimer = null;
18596
18596
  var _authToken = null;
18597
+ var _baseUrl = null;
18597
18598
  function setWsAuthToken(token) {
18598
18599
  _authToken = token;
18599
18600
  }
18601
+ function setWsBaseUrl(url) {
18602
+ if (!url) {
18603
+ _baseUrl = null;
18604
+ return;
18605
+ }
18606
+ _baseUrl = url.replace(/\/$/, "").replace(/^http/, "ws");
18607
+ }
18600
18608
  function _wsUrl() {
18601
- const base = typeof window === "undefined" ? "ws://localhost:4001/ws" : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws`;
18609
+ const base = _baseUrl ?? (typeof window === "undefined" ? "ws://localhost:4001/ws" : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws`);
18602
18610
  return _authToken ? `${base}?token=${encodeURIComponent(_authToken)}` : base;
18603
18611
  }
18604
18612
  function _send(msg) {
@@ -31518,6 +31526,8 @@ function ChartWorkspace({
31518
31526
  symbolResolver,
31519
31527
  rollRule,
31520
31528
  onRollRuleChange,
31529
+ quotesWsUrl,
31530
+ getQuotesAuthToken,
31521
31531
  extraTfGroups,
31522
31532
  // RightToolbar
31523
31533
  watchlistOpen,
@@ -31574,6 +31584,27 @@ function ChartWorkspace({
31574
31584
  tradingBridge,
31575
31585
  tradingOverlayStore
31576
31586
  }) {
31587
+ const [quotesReady, setQuotesReady] = React11.useState(false);
31588
+ React11.useEffect(() => {
31589
+ let cancelled = false;
31590
+ if (!quotesWsUrl || !getQuotesAuthToken) {
31591
+ setQuotesReady(false);
31592
+ return void 0;
31593
+ }
31594
+ void (async () => {
31595
+ try {
31596
+ const token = await getQuotesAuthToken();
31597
+ if (cancelled) return;
31598
+ setWsAuthToken(token || null);
31599
+ setWsBaseUrl(quotesWsUrl);
31600
+ setQuotesReady(true);
31601
+ } catch {
31602
+ }
31603
+ })();
31604
+ return () => {
31605
+ cancelled = true;
31606
+ };
31607
+ }, [quotesWsUrl, getQuotesAuthToken]);
31577
31608
  const capabilities = useChartCapabilities();
31578
31609
  const dataBlocked = useLicenseDataBlocked();
31579
31610
  useHostLicense(hostApiUrl, getAuthToken);
@@ -31754,7 +31785,7 @@ function ChartWorkspace({
31754
31785
  onClose: closeWatchlist,
31755
31786
  onSelectSymbol: onSymbolChange,
31756
31787
  symbolResolver,
31757
- liveQuotes: false,
31788
+ liveQuotes: quotesReady,
31758
31789
  ...hostApiUrl !== void 0 ? { apiUrl: hostApiUrl } : {},
31759
31790
  ...getAuthToken !== void 0 ? { getAuthToken } : {}
31760
31791
  }