@compass-labs/widgets 0.1.6 → 0.1.8
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 +42 -4
- package/dist/index.d.ts +42 -4
- package/dist/index.js +2584 -680
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2585 -682
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -546,6 +546,26 @@ declare function useAaveData(options?: UseAaveDataOptions): {
|
|
|
546
546
|
refetch: () => void;
|
|
547
547
|
};
|
|
548
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Props for EarnAccount - same as AaveMarketsListProps but without assetFilter
|
|
551
|
+
* since this widget is pre-configured to only show USDC markets.
|
|
552
|
+
*/
|
|
553
|
+
interface EarnAccountProps {
|
|
554
|
+
/** Show profit/loss summary */
|
|
555
|
+
showPnL?: boolean;
|
|
556
|
+
/** Show transaction history */
|
|
557
|
+
showHistory?: boolean;
|
|
558
|
+
/** Callback after successful supply */
|
|
559
|
+
onSupply?: (market: AaveMarketData, amount: string, txHash: string) => void;
|
|
560
|
+
/** Callback after successful withdraw */
|
|
561
|
+
onWithdraw?: (market: AaveMarketData, amount: string, txHash: string) => void;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* EarnAccount widget - A beautiful banking-style USDC savings account.
|
|
566
|
+
*/
|
|
567
|
+
declare function EarnAccount({ showPnL, showHistory, onSupply, onWithdraw, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
568
|
+
|
|
549
569
|
type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
|
|
550
570
|
interface PendleMarketData {
|
|
551
571
|
marketAddress: string;
|
|
@@ -679,14 +699,32 @@ declare function useSwapQuote({ fromToken, toToken, amount, enabled }: UseSwapQu
|
|
|
679
699
|
};
|
|
680
700
|
|
|
681
701
|
type TabId = 'vaults' | 'aave' | 'pendle' | 'swap' | 'positions';
|
|
702
|
+
type FeaturePreset = 'full' | 'earn-only' | 'swap-only' | 'vaults-only';
|
|
703
|
+
interface TabConfig {
|
|
704
|
+
id: TabId;
|
|
705
|
+
label: string;
|
|
706
|
+
enabled: boolean;
|
|
707
|
+
}
|
|
682
708
|
interface CompassEarnWidgetProps {
|
|
683
|
-
|
|
709
|
+
preset?: FeaturePreset;
|
|
710
|
+
enableVaults?: boolean;
|
|
711
|
+
enableAave?: boolean;
|
|
712
|
+
enablePendle?: boolean;
|
|
713
|
+
enableSwap?: boolean;
|
|
714
|
+
enablePositions?: boolean;
|
|
684
715
|
defaultTab?: TabId;
|
|
685
|
-
|
|
716
|
+
showHeader?: boolean;
|
|
717
|
+
showApy?: boolean;
|
|
718
|
+
showTvl?: boolean;
|
|
719
|
+
showExpiry?: boolean;
|
|
720
|
+
showUserPosition?: boolean;
|
|
721
|
+
showPnL?: boolean;
|
|
722
|
+
showSearch?: boolean;
|
|
723
|
+
showSort?: boolean;
|
|
686
724
|
onTabChange?: (tab: TabId) => void;
|
|
687
725
|
}
|
|
688
726
|
|
|
689
|
-
declare function CompassEarnWidget({ defaultTab, onTabChange, }: CompassEarnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
727
|
+
declare function CompassEarnWidget({ preset, enableVaults, enableAave, enablePendle, enableSwap, enablePositions, defaultTab, showHeader, showApy, showTvl, showExpiry, showUserPosition, showPnL, showSearch, showSort, onTabChange, }: CompassEarnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
690
728
|
|
|
691
729
|
/**
|
|
692
730
|
* Theme Presets for Compass Embeddable Widgets
|
|
@@ -924,4 +962,4 @@ interface ChainConfig {
|
|
|
924
962
|
}
|
|
925
963
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
926
964
|
|
|
927
|
-
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, AccountBalancesModal, type AccountBalancesModalProps, ActionModal, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type PendleMarketData, PendleMarketsList, type PendleMarketsListProps, type SortOption as PendleSortOption, PnLSummary, type SupportedChain, type SupportedChainId, type SwapLayout, type SwapQuote, SwapWidget, type SwapWidgetProps, type TabId, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$1 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
|
|
965
|
+
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, AccountBalancesModal, type AccountBalancesModalProps, ActionModal, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, EarnAccount, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type EarnAccountProps, type FeaturePreset, type PendleMarketData, PendleMarketsList, type PendleMarketsListProps, type SortOption as PendleSortOption, PnLSummary, type SupportedChain, type SupportedChainId, type SwapLayout, type SwapQuote, SwapWidget, type SwapWidgetProps, type TabConfig, type TabId, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$1 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
|
package/dist/index.d.ts
CHANGED
|
@@ -546,6 +546,26 @@ declare function useAaveData(options?: UseAaveDataOptions): {
|
|
|
546
546
|
refetch: () => void;
|
|
547
547
|
};
|
|
548
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Props for EarnAccount - same as AaveMarketsListProps but without assetFilter
|
|
551
|
+
* since this widget is pre-configured to only show USDC markets.
|
|
552
|
+
*/
|
|
553
|
+
interface EarnAccountProps {
|
|
554
|
+
/** Show profit/loss summary */
|
|
555
|
+
showPnL?: boolean;
|
|
556
|
+
/** Show transaction history */
|
|
557
|
+
showHistory?: boolean;
|
|
558
|
+
/** Callback after successful supply */
|
|
559
|
+
onSupply?: (market: AaveMarketData, amount: string, txHash: string) => void;
|
|
560
|
+
/** Callback after successful withdraw */
|
|
561
|
+
onWithdraw?: (market: AaveMarketData, amount: string, txHash: string) => void;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* EarnAccount widget - A beautiful banking-style USDC savings account.
|
|
566
|
+
*/
|
|
567
|
+
declare function EarnAccount({ showPnL, showHistory, onSupply, onWithdraw, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
568
|
+
|
|
549
569
|
type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
|
|
550
570
|
interface PendleMarketData {
|
|
551
571
|
marketAddress: string;
|
|
@@ -679,14 +699,32 @@ declare function useSwapQuote({ fromToken, toToken, amount, enabled }: UseSwapQu
|
|
|
679
699
|
};
|
|
680
700
|
|
|
681
701
|
type TabId = 'vaults' | 'aave' | 'pendle' | 'swap' | 'positions';
|
|
702
|
+
type FeaturePreset = 'full' | 'earn-only' | 'swap-only' | 'vaults-only';
|
|
703
|
+
interface TabConfig {
|
|
704
|
+
id: TabId;
|
|
705
|
+
label: string;
|
|
706
|
+
enabled: boolean;
|
|
707
|
+
}
|
|
682
708
|
interface CompassEarnWidgetProps {
|
|
683
|
-
|
|
709
|
+
preset?: FeaturePreset;
|
|
710
|
+
enableVaults?: boolean;
|
|
711
|
+
enableAave?: boolean;
|
|
712
|
+
enablePendle?: boolean;
|
|
713
|
+
enableSwap?: boolean;
|
|
714
|
+
enablePositions?: boolean;
|
|
684
715
|
defaultTab?: TabId;
|
|
685
|
-
|
|
716
|
+
showHeader?: boolean;
|
|
717
|
+
showApy?: boolean;
|
|
718
|
+
showTvl?: boolean;
|
|
719
|
+
showExpiry?: boolean;
|
|
720
|
+
showUserPosition?: boolean;
|
|
721
|
+
showPnL?: boolean;
|
|
722
|
+
showSearch?: boolean;
|
|
723
|
+
showSort?: boolean;
|
|
686
724
|
onTabChange?: (tab: TabId) => void;
|
|
687
725
|
}
|
|
688
726
|
|
|
689
|
-
declare function CompassEarnWidget({ defaultTab, onTabChange, }: CompassEarnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
727
|
+
declare function CompassEarnWidget({ preset, enableVaults, enableAave, enablePendle, enableSwap, enablePositions, defaultTab, showHeader, showApy, showTvl, showExpiry, showUserPosition, showPnL, showSearch, showSort, onTabChange, }: CompassEarnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
690
728
|
|
|
691
729
|
/**
|
|
692
730
|
* Theme Presets for Compass Embeddable Widgets
|
|
@@ -924,4 +962,4 @@ interface ChainConfig {
|
|
|
924
962
|
}
|
|
925
963
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
926
964
|
|
|
927
|
-
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, AccountBalancesModal, type AccountBalancesModalProps, ActionModal, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type PendleMarketData, PendleMarketsList, type PendleMarketsListProps, type SortOption as PendleSortOption, PnLSummary, type SupportedChain, type SupportedChainId, type SwapLayout, type SwapQuote, SwapWidget, type SwapWidgetProps, type TabId, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$1 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
|
|
965
|
+
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, AccountBalancesModal, type AccountBalancesModalProps, ActionModal, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, EarnAccount, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type EarnAccountProps, type FeaturePreset, type PendleMarketData, PendleMarketsList, type PendleMarketsListProps, type SortOption as PendleSortOption, PnLSummary, type SupportedChain, type SupportedChainId, type SwapLayout, type SwapQuote, SwapWidget, type SwapWidgetProps, type TabConfig, type TabId, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$1 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
|