@glacislabs/stablegenie-zerodelta 4.11.0 → 4.12.0

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.
@@ -1724,7 +1724,7 @@ var CHANNEL_HEADER = "x-zd-channel";
1724
1724
  var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
1725
1725
  var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
1726
1726
  var WIDGET_CHANNEL = "widget";
1727
- var WIDGET_VERSION = "4.11.0" ;
1727
+ var WIDGET_VERSION = "4.12.0" ;
1728
1728
  var MAX_CHANNEL_VERSION_LEN = 32;
1729
1729
  function sanitizeVersion(raw) {
1730
1730
  const v = String(raw).trim();
@@ -1995,6 +1995,7 @@ function createApiClient(cfg) {
1995
1995
  const missing = wanted.filter((s) => !nowFresh(priceCache.get(s) ?? null));
1996
1996
  if (missing.length) {
1997
1997
  let prices = {};
1998
+ let answered = true;
1998
1999
  try {
1999
2000
  const snapshot = await apiRequest(`/prices?symbols=${encodeURIComponent(missing.join(","))}`, {
2000
2001
  timeoutMs: 8e3
@@ -2002,9 +2003,10 @@ function createApiClient(cfg) {
2002
2003
  prices = snapshot && typeof snapshot === "object" && !snapshot.stale && snapshot.prices && typeof snapshot.prices === "object" ? snapshot.prices : {};
2003
2004
  } catch {
2004
2005
  prices = {};
2006
+ answered = false;
2005
2007
  }
2006
2008
  const at = Date.now();
2007
- for (const s of missing) {
2009
+ for (const s of answered ? missing : []) {
2008
2010
  const n = Number(prices[s]);
2009
2011
  priceCache.set(s, { at, value: Number.isFinite(n) && n > 0 ? n : null });
2010
2012
  }