@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.
@@ -220,6 +220,8 @@ declare class CompassCoreService {
220
220
  limit?: string;
221
221
  assetSymbol?: string;
222
222
  minTvlUsd?: string;
223
+ minLiquidityUsd?: string;
224
+ minDepositCapUsd?: string;
223
225
  }): Promise<_compass_labs_api_sdk_models_components.VaultsResponse>;
224
226
  aaveMarkets(params: {
225
227
  chain?: string;
@@ -220,6 +220,8 @@ declare class CompassCoreService {
220
220
  limit?: string;
221
221
  assetSymbol?: string;
222
222
  minTvlUsd?: string;
223
+ minLiquidityUsd?: string;
224
+ minDepositCapUsd?: string;
223
225
  }): Promise<_compass_labs_api_sdk_models_components.VaultsResponse>;
224
226
  aaveMarkets(params: {
225
227
  chain?: string;
package/dist/index.d.mts CHANGED
@@ -478,12 +478,18 @@ interface EarnAccountProps {
478
478
  chain?: string;
479
479
  /** Fixed height for the widget container @default '600px' */
480
480
  height?: string;
481
+ /** Minimum TVL in USD for vault filtering (server-side). @default 1_000_000 */
482
+ minTvlUsd?: number;
483
+ /** Minimum available liquidity in USD for vault filtering (server-side). @default 100_000 */
484
+ minLiquidityUsd?: number;
485
+ /** Minimum deposit capacity in USD for vault filtering (server-side). Set to 0 to exclude paused vaults. @default 0 */
486
+ minDepositCapUsd?: number;
481
487
  }
482
488
 
483
489
  /**
484
490
  * EarnAccount widget - A beautiful banking-style USDC savings account.
485
491
  */
486
- declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, tokenSymbols, chain: chainProp, height, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
492
+ declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, tokenSymbols, chain: chainProp, height, minTvlUsd, minLiquidityUsd, minDepositCapUsd, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
487
493
 
488
494
  interface CreditAccountProps {
489
495
  /** Custom title for the header @default "Credit Account" */
package/dist/index.d.ts CHANGED
@@ -478,12 +478,18 @@ interface EarnAccountProps {
478
478
  chain?: string;
479
479
  /** Fixed height for the widget container @default '600px' */
480
480
  height?: string;
481
+ /** Minimum TVL in USD for vault filtering (server-side). @default 1_000_000 */
482
+ minTvlUsd?: number;
483
+ /** Minimum available liquidity in USD for vault filtering (server-side). @default 100_000 */
484
+ minLiquidityUsd?: number;
485
+ /** Minimum deposit capacity in USD for vault filtering (server-side). Set to 0 to exclude paused vaults. @default 0 */
486
+ minDepositCapUsd?: number;
481
487
  }
482
488
 
483
489
  /**
484
490
  * EarnAccount widget - A beautiful banking-style USDC savings account.
485
491
  */
486
- declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, tokenSymbols, chain: chainProp, height, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
492
+ declare function EarnAccount({ showHeader, showInterestRate, showTopUpButton, compact, title, onDeposit, onWithdraw, defaultMarketTab, allowedVariableMarkets, allowedFixedMarkets, tokenSymbols, chain: chainProp, height, minTvlUsd, minLiquidityUsd, minDepositCapUsd, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
487
493
 
488
494
  interface CreditAccountProps {
489
495
  /** Custom title for the header @default "Credit Account" */
package/dist/index.js CHANGED
@@ -4349,6 +4349,29 @@ function WidgetFooter() {
4349
4349
  }
4350
4350
  );
4351
4351
  }
4352
+ var CHAINS = {
4353
+ ethereum: {
4354
+ id: "ethereum",
4355
+ name: "Ethereum",
4356
+ viemChain: chains.mainnet,
4357
+ icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png"
4358
+ },
4359
+ base: {
4360
+ id: "base",
4361
+ name: "Base",
4362
+ viemChain: chains.base,
4363
+ icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png"
4364
+ },
4365
+ arbitrum: {
4366
+ id: "arbitrum",
4367
+ name: "Arbitrum",
4368
+ viemChain: chains.arbitrum,
4369
+ icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png"
4370
+ }
4371
+ };
4372
+ var DEFAULT_MIN_TVL_USD = 1e6;
4373
+ var DEFAULT_MIN_LIQUIDITY_USD = 1e5;
4374
+ var DEFAULT_MIN_DEPOSIT_CAP_USD = 1e5;
4352
4375
  function getTypeLabel(type) {
4353
4376
  switch (type) {
4354
4377
  case "aave":
@@ -4376,7 +4399,7 @@ function MarketSelector({
4376
4399
  }) {
4377
4400
  const [isExpanded, setIsExpanded] = react.useState(false);
4378
4401
  const filteredMarkets = react.useMemo(() => {
4379
- return markets.filter((m) => m.type === "aave" || m.type === "pendle" || m.tvl >= 1e3).sort((a, b) => b.apy - a.apy);
4402
+ return [...markets].sort((a, b) => b.apy - a.apy);
4380
4403
  }, [markets]);
4381
4404
  const otherMarkets = selectedMarket ? filteredMarkets.filter((m) => m.id !== selectedMarket.id) : filteredMarkets;
4382
4405
  if (isLoading) {
@@ -4964,7 +4987,10 @@ function EarnAccount({
4964
4987
  allowedFixedMarkets,
4965
4988
  tokenSymbols,
4966
4989
  chain: chainProp,
4967
- height = "600px"
4990
+ height = "600px",
4991
+ minTvlUsd = DEFAULT_MIN_TVL_USD,
4992
+ minLiquidityUsd = DEFAULT_MIN_LIQUIDITY_USD,
4993
+ minDepositCapUsd = DEFAULT_MIN_DEPOSIT_CAP_USD
4968
4994
  }) {
4969
4995
  const { address, isConnected, login, logout, signTypedData, switchChain, walletChainId, fundWallet, hasExternalWallet, sendTransaction } = useEmbeddableWallet();
4970
4996
  const { isDeployed, earnAccountAddress } = useEarnAccount();
@@ -5165,9 +5191,18 @@ function EarnAccount({
5165
5191
  staleTime: 60 * 1e3
5166
5192
  });
5167
5193
  const vaultsQuery = reactQuery.useQuery({
5168
- queryKey: ["morphoVaults", CHAIN_ID],
5194
+ queryKey: ["morphoVaults", CHAIN_ID, minTvlUsd, minLiquidityUsd, minDepositCapUsd],
5169
5195
  queryFn: async () => {
5170
- const response = await fetch(`/api/compass/vaults?chain=${CHAIN_ID}&limit=200&orderBy=apy_7d&direction=desc`);
5196
+ const vaultParams = new URLSearchParams({
5197
+ chain: CHAIN_ID,
5198
+ limit: "200",
5199
+ orderBy: "apy_7d",
5200
+ direction: "desc",
5201
+ minTvlUsd: String(minTvlUsd),
5202
+ minLiquidityUsd: String(minLiquidityUsd),
5203
+ minDepositCapUsd: String(minDepositCapUsd)
5204
+ });
5205
+ const response = await fetch(`/api/compass/vaults?${vaultParams}`);
5171
5206
  if (!response.ok) {
5172
5207
  console.warn("[EarnAccount] Morpho vaults fetch failed:", response.status, response.statusText);
5173
5208
  return [];
@@ -10775,7 +10810,7 @@ function useRebalancingData(chainOverride) {
10775
10810
  queryKey: ["rebalancing", "venues", chainId],
10776
10811
  queryFn: async () => {
10777
10812
  const [vaultsRes, aaveRes, pendleRes] = await Promise.all([
10778
- fetch(`/api/compass/vaults?chain=${chainId}&orderBy=apy_7d&direction=desc&limit=200`),
10813
+ 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}`),
10779
10814
  fetch(`/api/compass/aave/markets?chain=${chainId}`),
10780
10815
  fetch(`/api/compass/pendle/markets?chain=${chainId}&orderBy=implied_apy&direction=desc&limit=200`)
10781
10816
  ]);
@@ -12623,26 +12658,6 @@ function useRefreshBalances() {
12623
12658
  }, [queryClient]);
12624
12659
  return { refreshBalances, refreshPositions, refreshAll };
12625
12660
  }
12626
- var CHAINS = {
12627
- ethereum: {
12628
- id: "ethereum",
12629
- name: "Ethereum",
12630
- viemChain: chains.mainnet,
12631
- icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png"
12632
- },
12633
- base: {
12634
- id: "base",
12635
- name: "Base",
12636
- viemChain: chains.base,
12637
- icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png"
12638
- },
12639
- arbitrum: {
12640
- id: "arbitrum",
12641
- name: "Arbitrum",
12642
- viemChain: chains.arbitrum,
12643
- icon: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png"
12644
- }
12645
- };
12646
12661
 
12647
12662
  exports.AccountBalancesModal = AccountBalancesModal;
12648
12663
  exports.ActionModal = ActionModal;