@kodiak-finance/orderly-trading-leaderboard 2.8.22-beta.2 → 2.8.22-beta.3

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/dist/index.d.mts CHANGED
@@ -574,8 +574,9 @@ declare const CampaignLeaderboardWidget: FC<CampaignLeaderboardWidgetProps>;
574
574
 
575
575
  interface KodiakStatsProps {
576
576
  dateRange?: DateRange;
577
+ foxifyOnly?: boolean;
577
578
  }
578
- declare const BrokerStatsWidget: ({ dateRange }: KodiakStatsProps) => react_jsx_runtime.JSX.Element;
579
+ declare const BrokerStatsWidget: ({ dateRange, foxifyOnly, }: KodiakStatsProps) => react_jsx_runtime.JSX.Element;
579
580
 
580
581
  type LeaderboardPageProps = GeneralLeaderboardWidgetProps & TradingLeaderboardProviderProps & {
581
582
  style?: React.CSSProperties;
package/dist/index.d.ts CHANGED
@@ -574,8 +574,9 @@ declare const CampaignLeaderboardWidget: FC<CampaignLeaderboardWidgetProps>;
574
574
 
575
575
  interface KodiakStatsProps {
576
576
  dateRange?: DateRange;
577
+ foxifyOnly?: boolean;
577
578
  }
578
- declare const BrokerStatsWidget: ({ dateRange }: KodiakStatsProps) => react_jsx_runtime.JSX.Element;
579
+ declare const BrokerStatsWidget: ({ dateRange, foxifyOnly, }: KodiakStatsProps) => react_jsx_runtime.JSX.Element;
579
580
 
580
581
  type LeaderboardPageProps = GeneralLeaderboardWidgetProps & TradingLeaderboardProviderProps & {
581
582
  style?: React.CSSProperties;
package/dist/index.js CHANGED
@@ -1133,16 +1133,16 @@ var formatDateLocal = (date) => {
1133
1133
  const day = String(date.getDate()).padStart(2, "0");
1134
1134
  return `${year}-${month}-${day}`;
1135
1135
  };
1136
- var getApiUrl = (dateRange) => {
1136
+ var getApiUrl = (dateRange, foxifyOnly) => {
1137
1137
  if (!dateRange?.from || !dateRange?.to) {
1138
1138
  const today = /* @__PURE__ */ new Date();
1139
1139
  const startDate2 = formatDateLocal(today);
1140
1140
  const endDate2 = formatDateLocal(today);
1141
- return `${API_BASE}?start_date=${startDate2}&end_date=${endDate2}`;
1141
+ return `${API_BASE}?start_date=${startDate2}&end_date=${endDate2}${foxifyOnly ? "&foxify_only=true" : ""}`;
1142
1142
  }
1143
1143
  const startDate = formatDateLocal(dateRange.from);
1144
1144
  const endDate = formatDateLocal(dateRange.to);
1145
- return `${API_BASE}?start_date=${startDate}&end_date=${endDate}`;
1145
+ return `${API_BASE}?start_date=${startDate}&end_date=${endDate}${foxifyOnly ? "&foxify_only=true" : ""}`;
1146
1146
  };
1147
1147
  var customFetcher = async (url) => {
1148
1148
  const response = await fetch(url);
@@ -1169,11 +1169,14 @@ var formatCurrency = (num, showSign = false) => {
1169
1169
  }
1170
1170
  return formatted;
1171
1171
  };
1172
- var BrokerStatsWidget = ({ dateRange }) => {
1172
+ var BrokerStatsWidget = ({
1173
+ dateRange,
1174
+ foxifyOnly
1175
+ }) => {
1173
1176
  const { isMobile } = orderlyUi.useScreen();
1174
1177
  const url = react.useMemo(
1175
- () => getApiUrl(dateRange),
1176
- [dateRange?.from, dateRange?.to]
1178
+ () => getApiUrl(dateRange, foxifyOnly),
1179
+ [dateRange?.from, dateRange?.to, foxifyOnly]
1177
1180
  );
1178
1181
  const {
1179
1182
  data: apiData,
@@ -3559,7 +3562,13 @@ var GeneralLeaderboard = (props) => {
3559
3562
  }, [isMobile, props.activeTab, props.leaderboardEndpoint]);
3560
3563
  if (isMobile) {
3561
3564
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3562
- /* @__PURE__ */ jsxRuntime.jsx(BrokerStatsWidget, { dateRange: props.dateRange }),
3565
+ /* @__PURE__ */ jsxRuntime.jsx(
3566
+ BrokerStatsWidget,
3567
+ {
3568
+ dateRange: props.dateRange,
3569
+ foxifyOnly: props.foxifyOnly
3570
+ }
3571
+ ),
3563
3572
  /* @__PURE__ */ jsxRuntime.jsxs(
3564
3573
  orderlyUi.Box,
3565
3574
  {
@@ -3602,7 +3611,13 @@ var GeneralLeaderboard = (props) => {
3602
3611
  ] });
3603
3612
  }
3604
3613
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3605
- /* @__PURE__ */ jsxRuntime.jsx(BrokerStatsWidget, { dateRange: props.dateRange }),
3614
+ /* @__PURE__ */ jsxRuntime.jsx(
3615
+ BrokerStatsWidget,
3616
+ {
3617
+ dateRange: props.dateRange,
3618
+ foxifyOnly: props.foxifyOnly
3619
+ }
3620
+ ),
3606
3621
  /* @__PURE__ */ jsxRuntime.jsxs(
3607
3622
  orderlyUi.Box,
3608
3623
  {
@@ -7673,7 +7688,13 @@ var LeaderboardSection = (props) => {
7673
7688
  if (currentCampaignId === "general") {
7674
7689
  return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Box, { px: 3, className: orderlyUi.cn("oui-mix-blend-screen"), children: [
7675
7690
  /* @__PURE__ */ jsxRuntime.jsx(LeaderboardBackground, { backgroundSrc }),
7676
- /* @__PURE__ */ jsxRuntime.jsx(BrokerStatsWidget, { dateRange: memoizedDateRange }),
7691
+ /* @__PURE__ */ jsxRuntime.jsx(
7692
+ BrokerStatsWidget,
7693
+ {
7694
+ dateRange: memoizedDateRange,
7695
+ foxifyOnly: leaderboardScript.foxifyOnly
7696
+ }
7697
+ ),
7677
7698
  /* @__PURE__ */ jsxRuntime.jsx(
7678
7699
  GeneralLeaderboard,
7679
7700
  {
@@ -7685,7 +7706,13 @@ var LeaderboardSection = (props) => {
7685
7706
  }
7686
7707
  if (currentCampaign?.leaderboard_config?.use_general_leaderboard) {
7687
7708
  return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Box, { px: 3, children: [
7688
- /* @__PURE__ */ jsxRuntime.jsx(BrokerStatsWidget, { dateRange: memoizedDateRange }),
7709
+ /* @__PURE__ */ jsxRuntime.jsx(
7710
+ BrokerStatsWidget,
7711
+ {
7712
+ dateRange: memoizedDateRange,
7713
+ foxifyOnly: leaderboardScript.foxifyOnly
7714
+ }
7715
+ ),
7689
7716
  /* @__PURE__ */ jsxRuntime.jsx(
7690
7717
  LeaderboardTitle,
7691
7718
  {
@@ -7706,7 +7733,13 @@ var LeaderboardSection = (props) => {
7706
7733
  }
7707
7734
  if (currentCampaign && !currentCampaign.hide_arena && currentCampaignId != "general") {
7708
7735
  return /* @__PURE__ */ jsxRuntime.jsxs(orderlyUi.Box, { px: 3, children: [
7709
- /* @__PURE__ */ jsxRuntime.jsx(BrokerStatsWidget, { dateRange: memoizedDateRange }),
7736
+ /* @__PURE__ */ jsxRuntime.jsx(
7737
+ BrokerStatsWidget,
7738
+ {
7739
+ dateRange: memoizedDateRange,
7740
+ foxifyOnly: leaderboardScript.foxifyOnly
7741
+ }
7742
+ ),
7710
7743
  /* @__PURE__ */ jsxRuntime.jsx(
7711
7744
  LeaderboardTitle,
7712
7745
  {