@compass-labs/widgets 0.1.48 → 0.1.50

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,29 @@ 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;
4371
+ var DEFAULT_MIN_LIQUIDITY_USD = 1e5;
4372
+ var DEFAULT_MIN_DEPOSIT_CAP_USD = 1e5;
4350
4373
  function getTypeLabel(type) {
4351
4374
  switch (type) {
4352
4375
  case "aave":
@@ -4374,7 +4397,7 @@ function MarketSelector({
4374
4397
  }) {
4375
4398
  const [isExpanded, setIsExpanded] = useState(false);
4376
4399
  const filteredMarkets = useMemo(() => {
4377
- return markets.filter((m) => m.type === "aave" || m.type === "pendle" || m.tvl >= 1e3).sort((a, b) => b.apy - a.apy);
4400
+ return [...markets].sort((a, b) => b.apy - a.apy);
4378
4401
  }, [markets]);
4379
4402
  const otherMarkets = selectedMarket ? filteredMarkets.filter((m) => m.id !== selectedMarket.id) : filteredMarkets;
4380
4403
  if (isLoading) {
@@ -4962,7 +4985,10 @@ function EarnAccount({
4962
4985
  allowedFixedMarkets,
4963
4986
  tokenSymbols,
4964
4987
  chain: chainProp,
4965
- height = "600px"
4988
+ height = "600px",
4989
+ minTvlUsd = DEFAULT_MIN_TVL_USD,
4990
+ minLiquidityUsd = DEFAULT_MIN_LIQUIDITY_USD,
4991
+ minDepositCapUsd = DEFAULT_MIN_DEPOSIT_CAP_USD
4966
4992
  }) {
4967
4993
  const { address, isConnected, login, logout, signTypedData, switchChain, walletChainId, fundWallet, hasExternalWallet, sendTransaction } = useEmbeddableWallet();
4968
4994
  const { isDeployed, earnAccountAddress } = useEarnAccount();
@@ -5163,9 +5189,18 @@ function EarnAccount({
5163
5189
  staleTime: 60 * 1e3
5164
5190
  });
5165
5191
  const vaultsQuery = useQuery({
5166
- queryKey: ["morphoVaults", CHAIN_ID],
5192
+ queryKey: ["morphoVaults", CHAIN_ID, minTvlUsd, minLiquidityUsd, minDepositCapUsd],
5167
5193
  queryFn: async () => {
5168
- const response = await fetch(`/api/compass/vaults?chain=${CHAIN_ID}&limit=200&orderBy=apy_7d&direction=desc`);
5194
+ const vaultParams = new URLSearchParams({
5195
+ chain: CHAIN_ID,
5196
+ limit: "200",
5197
+ orderBy: "apy_7d",
5198
+ direction: "desc",
5199
+ minTvlUsd: String(minTvlUsd),
5200
+ minLiquidityUsd: String(minLiquidityUsd),
5201
+ minDepositCapUsd: String(minDepositCapUsd)
5202
+ });
5203
+ const response = await fetch(`/api/compass/vaults?${vaultParams}`);
5169
5204
  if (!response.ok) {
5170
5205
  console.warn("[EarnAccount] Morpho vaults fetch failed:", response.status, response.statusText);
5171
5206
  return [];
@@ -10773,7 +10808,7 @@ function useRebalancingData(chainOverride) {
10773
10808
  queryKey: ["rebalancing", "venues", chainId],
10774
10809
  queryFn: async () => {
10775
10810
  const [vaultsRes, aaveRes, pendleRes] = await Promise.all([
10776
- fetch(`/api/compass/vaults?chain=${chainId}&orderBy=apy_7d&direction=desc&limit=200`),
10811
+ fetch(`/api/compass/vaults?chain=${chainId}&orderBy=apy_7d&direction=desc&limit=200&minTvlUsd=${DEFAULT_MIN_TVL_USD}&minLiquidityUsd=${DEFAULT_MIN_LIQUIDITY_USD}&minDepositCapUsd=${DEFAULT_MIN_DEPOSIT_CAP_USD}`),
10777
10812
  fetch(`/api/compass/aave/markets?chain=${chainId}`),
10778
10813
  fetch(`/api/compass/pendle/markets?chain=${chainId}&orderBy=implied_apy&direction=desc&limit=200`)
10779
10814
  ]);
@@ -12621,26 +12656,6 @@ function useRefreshBalances() {
12621
12656
  }, [queryClient]);
12622
12657
  return { refreshBalances, refreshPositions, refreshAll };
12623
12658
  }
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
12659
 
12645
12660
  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
12661
  //# sourceMappingURL=index.mjs.map