@compass-labs/widgets 0.1.48 → 0.1.49

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
@@ -4347,6 +4347,27 @@ function WidgetFooter() {
4347
4347
  }
4348
4348
  );
4349
4349
  }
4350
+ var CHAINS = {
4351
+ ethereum: {
4352
+ id: "ethereum",
4353
+ name: "Ethereum",
4354
+ viemChain: mainnet,
4355
+ icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png"
4356
+ },
4357
+ base: {
4358
+ id: "base",
4359
+ name: "Base",
4360
+ viemChain: base,
4361
+ icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png"
4362
+ },
4363
+ arbitrum: {
4364
+ id: "arbitrum",
4365
+ name: "Arbitrum",
4366
+ viemChain: arbitrum,
4367
+ icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png"
4368
+ }
4369
+ };
4370
+ var DEFAULT_MIN_TVL_USD = 1e6;
4350
4371
  function getTypeLabel(type) {
4351
4372
  switch (type) {
4352
4373
  case "aave":
@@ -4374,7 +4395,7 @@ function MarketSelector({
4374
4395
  }) {
4375
4396
  const [isExpanded, setIsExpanded] = useState(false);
4376
4397
  const filteredMarkets = useMemo(() => {
4377
- return markets.filter((m) => m.type === "aave" || m.type === "pendle" || m.tvl >= 1e3).sort((a, b) => b.apy - a.apy);
4398
+ return [...markets].sort((a, b) => b.apy - a.apy);
4378
4399
  }, [markets]);
4379
4400
  const otherMarkets = selectedMarket ? filteredMarkets.filter((m) => m.id !== selectedMarket.id) : filteredMarkets;
4380
4401
  if (isLoading) {
@@ -4962,7 +4983,8 @@ function EarnAccount({
4962
4983
  allowedFixedMarkets,
4963
4984
  tokenSymbols,
4964
4985
  chain: chainProp,
4965
- height = "600px"
4986
+ height = "600px",
4987
+ minTvlUsd = DEFAULT_MIN_TVL_USD
4966
4988
  }) {
4967
4989
  const { address, isConnected, login, logout, signTypedData, switchChain, walletChainId, fundWallet, hasExternalWallet, sendTransaction } = useEmbeddableWallet();
4968
4990
  const { isDeployed, earnAccountAddress } = useEarnAccount();
@@ -5163,9 +5185,9 @@ function EarnAccount({
5163
5185
  staleTime: 60 * 1e3
5164
5186
  });
5165
5187
  const vaultsQuery = useQuery({
5166
- queryKey: ["morphoVaults", CHAIN_ID],
5188
+ queryKey: ["morphoVaults", CHAIN_ID, minTvlUsd],
5167
5189
  queryFn: async () => {
5168
- const response = await fetch(`/api/compass/vaults?chain=${CHAIN_ID}&limit=200&orderBy=apy_7d&direction=desc`);
5190
+ const response = await fetch(`/api/compass/vaults?chain=${CHAIN_ID}&limit=200&orderBy=apy_7d&direction=desc&minTvlUsd=${minTvlUsd}`);
5169
5191
  if (!response.ok) {
5170
5192
  console.warn("[EarnAccount] Morpho vaults fetch failed:", response.status, response.statusText);
5171
5193
  return [];
@@ -10773,7 +10795,7 @@ function useRebalancingData(chainOverride) {
10773
10795
  queryKey: ["rebalancing", "venues", chainId],
10774
10796
  queryFn: async () => {
10775
10797
  const [vaultsRes, aaveRes, pendleRes] = await Promise.all([
10776
- fetch(`/api/compass/vaults?chain=${chainId}&orderBy=apy_7d&direction=desc&limit=200`),
10798
+ fetch(`/api/compass/vaults?chain=${chainId}&orderBy=apy_7d&direction=desc&limit=200&minTvlUsd=${DEFAULT_MIN_TVL_USD}`),
10777
10799
  fetch(`/api/compass/aave/markets?chain=${chainId}`),
10778
10800
  fetch(`/api/compass/pendle/markets?chain=${chainId}&orderBy=implied_apy&direction=desc&limit=200`)
10779
10801
  ]);
@@ -12621,26 +12643,6 @@ function useRefreshBalances() {
12621
12643
  }, [queryClient]);
12622
12644
  return { refreshBalances, refreshPositions, refreshAll };
12623
12645
  }
12624
- var CHAINS = {
12625
- ethereum: {
12626
- id: "ethereum",
12627
- name: "Ethereum",
12628
- viemChain: mainnet,
12629
- icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png"
12630
- },
12631
- base: {
12632
- id: "base",
12633
- name: "Base",
12634
- viemChain: base,
12635
- icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png"
12636
- },
12637
- arbitrum: {
12638
- id: "arbitrum",
12639
- name: "Arbitrum",
12640
- viemChain: arbitrum,
12641
- icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png"
12642
- }
12643
- };
12644
12646
 
12645
12647
  export { AccountBalancesModal, ActionModal, ApiProvider, CHAINS, ChainSwitcher, CompassEarnWidget, CompassProvider, CopyableAddress, CreditAccount, CreditAccountGuard, DepositWithdrawForm, EarnAccount, EarnAccountBalance, EarnAccountGuard, PnLSummary, RebalancingWidget, SwapForm, ThemeProvider, TransactionHistory, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useRefreshBalances, useSwapQuote, useTheme };
12646
12648
  //# sourceMappingURL=index.mjs.map