@liberfi.io/ui-tokens 3.0.15 → 3.0.17

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
@@ -58,8 +58,6 @@ type UsePulseNewListScriptParams = {
58
58
  chain: Chain;
59
59
  /** whether to pause adding new items (existing items still update) */
60
60
  isPaused?: boolean;
61
- /** refetch interval in milliseconds */
62
- refetchInterval?: number;
63
61
  };
64
62
  type UsePulseNewListScriptResult = {
65
63
  /** whether tokens are loading */
@@ -67,7 +65,7 @@ type UsePulseNewListScriptResult = {
67
65
  /** token list */
68
66
  tokens: Token[];
69
67
  };
70
- declare function usePulseNewListScript({ chain, isPaused, refetchInterval, }: UsePulseNewListScriptParams): UsePulseNewListScriptResult;
68
+ declare function usePulseNewListScript({ chain, isPaused, }: UsePulseNewListScriptParams): UsePulseNewListScriptResult;
71
69
 
72
70
  interface PulseNewListWidgetProps {
73
71
  /** chain id */
@@ -1653,6 +1651,8 @@ interface TokenListProps {
1653
1651
  sortDirections?: TokenListSortDirections;
1654
1652
  /** callback function when sort direction changes */
1655
1653
  onSortChange?: (sortDirections: TokenListSortDirections) => void | Promise<void>;
1654
+ /** callback function when the virtualized list scroll state changes */
1655
+ onScrollingChange?: (isScrolling: boolean) => void;
1656
1656
  /**
1657
1657
  * list container height, required for virtualized list.
1658
1658
  * you can use useResizeObserver hook to get the container's height.
@@ -1669,7 +1669,7 @@ interface TokenListProps {
1669
1669
  /**
1670
1670
  * Token List UI Component
1671
1671
  */
1672
- declare function TokenList({ tokens, resolution, isLoading, ActionsComponent, onSelectToken, sortDirections, onSortChange, height, itemHeight, itemHeightMobile, className, }: TokenListProps): react_jsx_runtime.JSX.Element;
1672
+ declare function TokenList({ tokens, resolution, isLoading, ActionsComponent, onSelectToken, sortDirections, onSortChange, onScrollingChange, height, itemHeight, itemHeightMobile, className, }: TokenListProps): react_jsx_runtime.JSX.Element;
1673
1673
 
1674
1674
  interface TokenCellProps {
1675
1675
  token: Token;
@@ -1727,6 +1727,10 @@ type UseNewTokensScriptParams = {
1727
1727
  options?: GetTokenListOptions;
1728
1728
  /** refetch tokens interval */
1729
1729
  refetchInterval?: number;
1730
+ /** defer websocket updates while the list is actively scrolling */
1731
+ deferUpdates?: boolean;
1732
+ /** minimum interval for batched websocket updates */
1733
+ updateFlushInterval?: number;
1730
1734
  };
1731
1735
  type UseNewTokensScriptResult = {
1732
1736
  /** is fetching tokens, return true if initially fetching tokens or refetching tokens due to query params change */
@@ -1734,7 +1738,7 @@ type UseNewTokensScriptResult = {
1734
1738
  /** tokens */
1735
1739
  tokens: Array<Token>;
1736
1740
  };
1737
- declare function useNewTokensScript({ chain, resolution, options, refetchInterval, }: UseNewTokensScriptParams): UseNewTokensScriptResult;
1741
+ declare function useNewTokensScript({ chain, resolution, options, refetchInterval, deferUpdates, updateFlushInterval, }: UseNewTokensScriptParams): UseNewTokensScriptResult;
1738
1742
 
1739
1743
  type NewTokenListWidgetProps = {
1740
1744
  /** chain id */
@@ -1771,6 +1775,10 @@ type UseStockTokensScriptParams = {
1771
1775
  options?: GetTokenListOptions;
1772
1776
  /** refetch tokens interval */
1773
1777
  refetchInterval?: number;
1778
+ /** defer websocket updates while the list is actively scrolling */
1779
+ deferUpdates?: boolean;
1780
+ /** minimum interval for batched websocket updates */
1781
+ updateFlushInterval?: number;
1774
1782
  };
1775
1783
  type UseStockTokensScriptResult = {
1776
1784
  /** is fetching tokens, return true if initially fetching tokens or refetching tokens due to query params change */
@@ -1778,7 +1786,7 @@ type UseStockTokensScriptResult = {
1778
1786
  /** tokens */
1779
1787
  tokens: Array<Token>;
1780
1788
  };
1781
- declare function useStockTokensScript({ chain, resolution, options, refetchInterval, }: UseStockTokensScriptParams): UseStockTokensScriptResult;
1789
+ declare function useStockTokensScript({ chain, resolution, options, refetchInterval, deferUpdates, updateFlushInterval, }: UseStockTokensScriptParams): UseStockTokensScriptResult;
1782
1790
 
1783
1791
  type StockTokenListWidgetProps = {
1784
1792
  /** chain id */
@@ -1815,6 +1823,10 @@ type UseTrendingTokensScriptParams = {
1815
1823
  options?: GetTokenListOptions;
1816
1824
  /** refetch tokens interval */
1817
1825
  refetchInterval?: number;
1826
+ /** defer websocket updates while the list is actively scrolling */
1827
+ deferUpdates?: boolean;
1828
+ /** minimum interval for batched websocket updates */
1829
+ updateFlushInterval?: number;
1818
1830
  };
1819
1831
  type UseTrendingTokensScriptResult = {
1820
1832
  /** is fetching tokens, return true if initially fetching tokens or refetching tokens due to query params change */
@@ -1822,7 +1834,7 @@ type UseTrendingTokensScriptResult = {
1822
1834
  /** tokens */
1823
1835
  tokens: Array<Token>;
1824
1836
  };
1825
- declare function useTrendingTokensScript({ chain, resolution, options, refetchInterval, }: UseTrendingTokensScriptParams): UseTrendingTokensScriptResult;
1837
+ declare function useTrendingTokensScript({ chain, resolution, options, refetchInterval, deferUpdates, updateFlushInterval, }: UseTrendingTokensScriptParams): UseTrendingTokensScriptResult;
1826
1838
 
1827
1839
  type TrendingTokenListWidgetProps = {
1828
1840
  /** chain id */
package/dist/index.d.ts CHANGED
@@ -58,8 +58,6 @@ type UsePulseNewListScriptParams = {
58
58
  chain: Chain;
59
59
  /** whether to pause adding new items (existing items still update) */
60
60
  isPaused?: boolean;
61
- /** refetch interval in milliseconds */
62
- refetchInterval?: number;
63
61
  };
64
62
  type UsePulseNewListScriptResult = {
65
63
  /** whether tokens are loading */
@@ -67,7 +65,7 @@ type UsePulseNewListScriptResult = {
67
65
  /** token list */
68
66
  tokens: Token[];
69
67
  };
70
- declare function usePulseNewListScript({ chain, isPaused, refetchInterval, }: UsePulseNewListScriptParams): UsePulseNewListScriptResult;
68
+ declare function usePulseNewListScript({ chain, isPaused, }: UsePulseNewListScriptParams): UsePulseNewListScriptResult;
71
69
 
72
70
  interface PulseNewListWidgetProps {
73
71
  /** chain id */
@@ -1653,6 +1651,8 @@ interface TokenListProps {
1653
1651
  sortDirections?: TokenListSortDirections;
1654
1652
  /** callback function when sort direction changes */
1655
1653
  onSortChange?: (sortDirections: TokenListSortDirections) => void | Promise<void>;
1654
+ /** callback function when the virtualized list scroll state changes */
1655
+ onScrollingChange?: (isScrolling: boolean) => void;
1656
1656
  /**
1657
1657
  * list container height, required for virtualized list.
1658
1658
  * you can use useResizeObserver hook to get the container's height.
@@ -1669,7 +1669,7 @@ interface TokenListProps {
1669
1669
  /**
1670
1670
  * Token List UI Component
1671
1671
  */
1672
- declare function TokenList({ tokens, resolution, isLoading, ActionsComponent, onSelectToken, sortDirections, onSortChange, height, itemHeight, itemHeightMobile, className, }: TokenListProps): react_jsx_runtime.JSX.Element;
1672
+ declare function TokenList({ tokens, resolution, isLoading, ActionsComponent, onSelectToken, sortDirections, onSortChange, onScrollingChange, height, itemHeight, itemHeightMobile, className, }: TokenListProps): react_jsx_runtime.JSX.Element;
1673
1673
 
1674
1674
  interface TokenCellProps {
1675
1675
  token: Token;
@@ -1727,6 +1727,10 @@ type UseNewTokensScriptParams = {
1727
1727
  options?: GetTokenListOptions;
1728
1728
  /** refetch tokens interval */
1729
1729
  refetchInterval?: number;
1730
+ /** defer websocket updates while the list is actively scrolling */
1731
+ deferUpdates?: boolean;
1732
+ /** minimum interval for batched websocket updates */
1733
+ updateFlushInterval?: number;
1730
1734
  };
1731
1735
  type UseNewTokensScriptResult = {
1732
1736
  /** is fetching tokens, return true if initially fetching tokens or refetching tokens due to query params change */
@@ -1734,7 +1738,7 @@ type UseNewTokensScriptResult = {
1734
1738
  /** tokens */
1735
1739
  tokens: Array<Token>;
1736
1740
  };
1737
- declare function useNewTokensScript({ chain, resolution, options, refetchInterval, }: UseNewTokensScriptParams): UseNewTokensScriptResult;
1741
+ declare function useNewTokensScript({ chain, resolution, options, refetchInterval, deferUpdates, updateFlushInterval, }: UseNewTokensScriptParams): UseNewTokensScriptResult;
1738
1742
 
1739
1743
  type NewTokenListWidgetProps = {
1740
1744
  /** chain id */
@@ -1771,6 +1775,10 @@ type UseStockTokensScriptParams = {
1771
1775
  options?: GetTokenListOptions;
1772
1776
  /** refetch tokens interval */
1773
1777
  refetchInterval?: number;
1778
+ /** defer websocket updates while the list is actively scrolling */
1779
+ deferUpdates?: boolean;
1780
+ /** minimum interval for batched websocket updates */
1781
+ updateFlushInterval?: number;
1774
1782
  };
1775
1783
  type UseStockTokensScriptResult = {
1776
1784
  /** is fetching tokens, return true if initially fetching tokens or refetching tokens due to query params change */
@@ -1778,7 +1786,7 @@ type UseStockTokensScriptResult = {
1778
1786
  /** tokens */
1779
1787
  tokens: Array<Token>;
1780
1788
  };
1781
- declare function useStockTokensScript({ chain, resolution, options, refetchInterval, }: UseStockTokensScriptParams): UseStockTokensScriptResult;
1789
+ declare function useStockTokensScript({ chain, resolution, options, refetchInterval, deferUpdates, updateFlushInterval, }: UseStockTokensScriptParams): UseStockTokensScriptResult;
1782
1790
 
1783
1791
  type StockTokenListWidgetProps = {
1784
1792
  /** chain id */
@@ -1815,6 +1823,10 @@ type UseTrendingTokensScriptParams = {
1815
1823
  options?: GetTokenListOptions;
1816
1824
  /** refetch tokens interval */
1817
1825
  refetchInterval?: number;
1826
+ /** defer websocket updates while the list is actively scrolling */
1827
+ deferUpdates?: boolean;
1828
+ /** minimum interval for batched websocket updates */
1829
+ updateFlushInterval?: number;
1818
1830
  };
1819
1831
  type UseTrendingTokensScriptResult = {
1820
1832
  /** is fetching tokens, return true if initially fetching tokens or refetching tokens due to query params change */
@@ -1822,7 +1834,7 @@ type UseTrendingTokensScriptResult = {
1822
1834
  /** tokens */
1823
1835
  tokens: Array<Token>;
1824
1836
  };
1825
- declare function useTrendingTokensScript({ chain, resolution, options, refetchInterval, }: UseTrendingTokensScriptParams): UseTrendingTokensScriptResult;
1837
+ declare function useTrendingTokensScript({ chain, resolution, options, refetchInterval, deferUpdates, updateFlushInterval, }: UseTrendingTokensScriptParams): UseTrendingTokensScriptResult;
1826
1838
 
1827
1839
  type TrendingTokenListWidgetProps = {
1828
1840
  /** chain id */