@liberfi.io/react-predict 0.1.10 → 0.1.12

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.mjs CHANGED
@@ -745,6 +745,11 @@ function resolveTagSlug(selection) {
745
745
  if (!selection) return void 0;
746
746
  return selection.tagSlug ?? selection.categorySlug ?? void 0;
747
747
  }
748
+ function resolveEndBefore(timeRemaining) {
749
+ if (!timeRemaining) return void 0;
750
+ const days = timeRemaining === "1d" ? 1 : timeRemaining === "7d" ? 7 : 30;
751
+ return new Date(Date.now() + days * 24 * 60 * 60 * 1e3).toISOString();
752
+ }
748
753
  function resolveEventsParams(input = {}) {
749
754
  const {
750
755
  tagSlugSelection,
@@ -753,9 +758,15 @@ function resolveEventsParams(input = {}) {
753
758
  with_markets = true,
754
759
  source,
755
760
  sort_by,
756
- sort_asc
761
+ sort_asc,
762
+ minVolume,
763
+ minLiquidity,
764
+ timeRemaining
757
765
  } = input;
758
766
  const tag_slug = resolveTagSlug(tagSlugSelection);
767
+ const min_volume = minVolume !== void 0 && minVolume !== "" ? Number(minVolume) : void 0;
768
+ const min_liquidity = minLiquidity !== void 0 && minLiquidity !== "" ? Number(minLiquidity) : void 0;
769
+ const end_before = resolveEndBefore(timeRemaining);
759
770
  return {
760
771
  limit,
761
772
  status,
@@ -763,7 +774,10 @@ function resolveEventsParams(input = {}) {
763
774
  ...source ? { source } : {},
764
775
  ...tag_slug ? { tag_slug } : {},
765
776
  ...sort_by ? { sort_by } : {},
766
- ...sort_asc !== void 0 ? { sort_asc } : {}
777
+ ...sort_asc !== void 0 ? { sort_asc } : {},
778
+ ...min_volume !== void 0 && !isNaN(min_volume) ? { min_volume } : {},
779
+ ...min_liquidity !== void 0 && !isNaN(min_liquidity) ? { min_liquidity } : {},
780
+ ...end_before ? { end_before } : {}
767
781
  };
768
782
  }
769
783
  function infiniteEventsQueryKey(params) {