@compass-labs/widgets 0.1.0 → 0.1.1

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
@@ -357,7 +357,6 @@ declare function CompassProvider({ children, apiKey, defaultChain, theme, wallet
357
357
 
358
358
  type ApyPeriod = '7d' | '30d' | '90d';
359
359
  type SortOption$2 = 'apy_7d' | 'apy_30d' | 'apy_90d' | 'tvl';
360
- type ActionMode$2 = 'modal' | 'inline';
361
360
  interface VaultData {
362
361
  vaultAddress: string;
363
362
  name: string;
@@ -404,8 +403,6 @@ interface VaultsListProps {
404
403
  showSearch?: boolean;
405
404
  /** Enable sorting options */
406
405
  showSort?: boolean;
407
- /** How to show deposit/withdraw form */
408
- actionMode?: ActionMode$2;
409
406
  /** Default sort option */
410
407
  defaultSort?: SortOption$2;
411
408
  /** Filter by asset symbols */
@@ -433,7 +430,7 @@ interface VaultsListProps {
433
430
  * />
434
431
  * ```
435
432
  */
436
- declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort, actionMode, defaultSort, assetFilter, minApy, onVaultSelect, onDeposit, onWithdraw, }: VaultsListProps): react_jsx_runtime.JSX.Element;
433
+ declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, minApy, onVaultSelect, onDeposit, onWithdraw, }: VaultsListProps): react_jsx_runtime.JSX.Element;
437
434
 
438
435
  interface UseVaultsDataOptions {
439
436
  sortBy?: SortOption$2;
@@ -458,7 +455,6 @@ declare function useVaultsData(options?: UseVaultsDataOptions): {
458
455
  };
459
456
 
460
457
  type SortOption$1 = 'supply_apy';
461
- type ActionMode$1 = 'modal' | 'inline';
462
458
  interface AaveMarketData {
463
459
  marketAddress: string;
464
460
  reserveSymbol: string;
@@ -500,8 +496,6 @@ interface AaveMarketsListProps {
500
496
  showSearch?: boolean;
501
497
  /** Enable sorting options */
502
498
  showSort?: boolean;
503
- /** How to show deposit/withdraw form */
504
- actionMode?: ActionMode$1;
505
499
  /** Default sort option */
506
500
  defaultSort?: SortOption$1;
507
501
  /** Filter by asset symbols */
@@ -528,7 +522,7 @@ interface AaveMarketsListProps {
528
522
  */
529
523
  declare function AaveMarketsList({ showApy, showTvl, // Aave API doesn't provide TVL data
530
524
  showUserPosition, showPnL, showHistory, showSearch, showSort, // Only one sort option (APY), so hide by default
531
- actionMode, defaultSort, assetFilter, onMarketSelect, onSupply, onWithdraw, }: AaveMarketsListProps): react_jsx_runtime.JSX.Element;
525
+ defaultSort, assetFilter, onMarketSelect, onSupply, onWithdraw, }: AaveMarketsListProps): react_jsx_runtime.JSX.Element;
532
526
 
533
527
  interface UseAaveDataOptions {
534
528
  sortBy?: SortOption$1;
@@ -551,7 +545,6 @@ declare function useAaveData(options?: UseAaveDataOptions): {
551
545
  };
552
546
 
553
547
  type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
554
- type ActionMode = 'modal' | 'inline';
555
548
  interface PendleMarketData {
556
549
  marketAddress: string;
557
550
  ptAddress: string;
@@ -596,8 +589,6 @@ interface PendleMarketsListProps {
596
589
  showSearch?: boolean;
597
590
  /** Enable sorting options */
598
591
  showSort?: boolean;
599
- /** How to show deposit/withdraw form */
600
- actionMode?: ActionMode;
601
592
  /** Default sort option */
602
593
  defaultSort?: SortOption;
603
594
  /** Filter by asset symbols */
@@ -623,7 +614,7 @@ interface PendleMarketsListProps {
623
614
  * />
624
615
  * ```
625
616
  */
626
- declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort, actionMode, defaultSort, assetFilter, onMarketSelect, onDeposit, onWithdraw, }: PendleMarketsListProps): react_jsx_runtime.JSX.Element;
617
+ declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, onMarketSelect, onDeposit, onWithdraw, }: PendleMarketsListProps): react_jsx_runtime.JSX.Element;
627
618
 
628
619
  interface UsePendleDataOptions {
629
620
  sortBy?: SortOption;
@@ -862,13 +853,15 @@ type VenueType = 'VAULT' | 'AAVE' | 'PENDLE_PT';
862
853
  interface DepositWithdrawFormProps {
863
854
  venueType: VenueType;
864
855
  venueAddress: string;
865
- tokenSymbol: string;
866
- tokenDecimals: number;
856
+ /** The token the venue accepts */
857
+ venueToken: string;
858
+ /** Available tokens for deposits (enables swap if different from venueToken) */
859
+ depositTokens?: string[];
867
860
  positionBalance?: string;
868
861
  onSuccess?: (action: ActionType, amount: string, txHash: string) => void;
869
862
  onError?: (error: Error) => void;
870
863
  }
871
- declare function DepositWithdrawForm({ venueType, venueAddress, tokenSymbol, tokenDecimals, positionBalance, onSuccess, onError, }: DepositWithdrawFormProps): react_jsx_runtime.JSX.Element;
864
+ declare function DepositWithdrawForm({ venueType, venueAddress, venueToken, depositTokens, positionBalance, onSuccess, onError, }: DepositWithdrawFormProps): react_jsx_runtime.JSX.Element;
872
865
 
873
866
  interface DepositEvent {
874
867
  amount: string;
@@ -896,6 +889,17 @@ interface EarnAccountGuardProps {
896
889
  }
897
890
  declare function EarnAccountGuard({ children, loadingComponent, createAccountComponent, }: EarnAccountGuardProps): react_jsx_runtime.JSX.Element;
898
891
 
892
+ type TransferAction = 'deposit' | 'withdraw';
893
+ interface EarnAccountBalanceProps {
894
+ /** Tokens to show/allow transfers for */
895
+ tokens?: string[];
896
+ /** Compact mode - just show total USD value */
897
+ compact?: boolean;
898
+ /** Callback when transfer completes */
899
+ onTransferComplete?: (action: TransferAction, token: string, amount: string, txHash: string) => void;
900
+ }
901
+ declare function EarnAccountBalance({ tokens, compact, onTransferComplete, }: EarnAccountBalanceProps): react_jsx_runtime.JSX.Element | null;
902
+
899
903
  type SupportedChainId = 'ethereum' | 'base' | 'arbitrum';
900
904
  interface ChainConfig {
901
905
  id: SupportedChainId;
@@ -905,6 +909,5 @@ interface ChainConfig {
905
909
  rpcUrl?: string;
906
910
  }
907
911
  declare const CHAINS: Record<SupportedChainId, ChainConfig>;
908
- declare const TOKEN_DECIMALS: Record<string, number>;
909
912
 
910
- export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption, ActionModal, type ActionMode$2 as ActionMode, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, type EarnAccountContextValue, EarnAccountGuard, type FeaturePreset, type PendleMarketData, PendleMarketsList, type PendleMarketsListProps, type SortOption as PendleSortOption, PnLSummary, type SupportedChain, type SupportedChainId, type SwapLayout, type SwapQuote, SwapWidget, type SwapWidgetProps, TOKEN_DECIMALS, type TabConfig, type TabId, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$2 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
913
+ export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption, ActionModal, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, 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, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$2 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
package/dist/index.d.ts CHANGED
@@ -357,7 +357,6 @@ declare function CompassProvider({ children, apiKey, defaultChain, theme, wallet
357
357
 
358
358
  type ApyPeriod = '7d' | '30d' | '90d';
359
359
  type SortOption$2 = 'apy_7d' | 'apy_30d' | 'apy_90d' | 'tvl';
360
- type ActionMode$2 = 'modal' | 'inline';
361
360
  interface VaultData {
362
361
  vaultAddress: string;
363
362
  name: string;
@@ -404,8 +403,6 @@ interface VaultsListProps {
404
403
  showSearch?: boolean;
405
404
  /** Enable sorting options */
406
405
  showSort?: boolean;
407
- /** How to show deposit/withdraw form */
408
- actionMode?: ActionMode$2;
409
406
  /** Default sort option */
410
407
  defaultSort?: SortOption$2;
411
408
  /** Filter by asset symbols */
@@ -433,7 +430,7 @@ interface VaultsListProps {
433
430
  * />
434
431
  * ```
435
432
  */
436
- declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort, actionMode, defaultSort, assetFilter, minApy, onVaultSelect, onDeposit, onWithdraw, }: VaultsListProps): react_jsx_runtime.JSX.Element;
433
+ declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, minApy, onVaultSelect, onDeposit, onWithdraw, }: VaultsListProps): react_jsx_runtime.JSX.Element;
437
434
 
438
435
  interface UseVaultsDataOptions {
439
436
  sortBy?: SortOption$2;
@@ -458,7 +455,6 @@ declare function useVaultsData(options?: UseVaultsDataOptions): {
458
455
  };
459
456
 
460
457
  type SortOption$1 = 'supply_apy';
461
- type ActionMode$1 = 'modal' | 'inline';
462
458
  interface AaveMarketData {
463
459
  marketAddress: string;
464
460
  reserveSymbol: string;
@@ -500,8 +496,6 @@ interface AaveMarketsListProps {
500
496
  showSearch?: boolean;
501
497
  /** Enable sorting options */
502
498
  showSort?: boolean;
503
- /** How to show deposit/withdraw form */
504
- actionMode?: ActionMode$1;
505
499
  /** Default sort option */
506
500
  defaultSort?: SortOption$1;
507
501
  /** Filter by asset symbols */
@@ -528,7 +522,7 @@ interface AaveMarketsListProps {
528
522
  */
529
523
  declare function AaveMarketsList({ showApy, showTvl, // Aave API doesn't provide TVL data
530
524
  showUserPosition, showPnL, showHistory, showSearch, showSort, // Only one sort option (APY), so hide by default
531
- actionMode, defaultSort, assetFilter, onMarketSelect, onSupply, onWithdraw, }: AaveMarketsListProps): react_jsx_runtime.JSX.Element;
525
+ defaultSort, assetFilter, onMarketSelect, onSupply, onWithdraw, }: AaveMarketsListProps): react_jsx_runtime.JSX.Element;
532
526
 
533
527
  interface UseAaveDataOptions {
534
528
  sortBy?: SortOption$1;
@@ -551,7 +545,6 @@ declare function useAaveData(options?: UseAaveDataOptions): {
551
545
  };
552
546
 
553
547
  type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
554
- type ActionMode = 'modal' | 'inline';
555
548
  interface PendleMarketData {
556
549
  marketAddress: string;
557
550
  ptAddress: string;
@@ -596,8 +589,6 @@ interface PendleMarketsListProps {
596
589
  showSearch?: boolean;
597
590
  /** Enable sorting options */
598
591
  showSort?: boolean;
599
- /** How to show deposit/withdraw form */
600
- actionMode?: ActionMode;
601
592
  /** Default sort option */
602
593
  defaultSort?: SortOption;
603
594
  /** Filter by asset symbols */
@@ -623,7 +614,7 @@ interface PendleMarketsListProps {
623
614
  * />
624
615
  * ```
625
616
  */
626
- declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort, actionMode, defaultSort, assetFilter, onMarketSelect, onDeposit, onWithdraw, }: PendleMarketsListProps): react_jsx_runtime.JSX.Element;
617
+ declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, onMarketSelect, onDeposit, onWithdraw, }: PendleMarketsListProps): react_jsx_runtime.JSX.Element;
627
618
 
628
619
  interface UsePendleDataOptions {
629
620
  sortBy?: SortOption;
@@ -862,13 +853,15 @@ type VenueType = 'VAULT' | 'AAVE' | 'PENDLE_PT';
862
853
  interface DepositWithdrawFormProps {
863
854
  venueType: VenueType;
864
855
  venueAddress: string;
865
- tokenSymbol: string;
866
- tokenDecimals: number;
856
+ /** The token the venue accepts */
857
+ venueToken: string;
858
+ /** Available tokens for deposits (enables swap if different from venueToken) */
859
+ depositTokens?: string[];
867
860
  positionBalance?: string;
868
861
  onSuccess?: (action: ActionType, amount: string, txHash: string) => void;
869
862
  onError?: (error: Error) => void;
870
863
  }
871
- declare function DepositWithdrawForm({ venueType, venueAddress, tokenSymbol, tokenDecimals, positionBalance, onSuccess, onError, }: DepositWithdrawFormProps): react_jsx_runtime.JSX.Element;
864
+ declare function DepositWithdrawForm({ venueType, venueAddress, venueToken, depositTokens, positionBalance, onSuccess, onError, }: DepositWithdrawFormProps): react_jsx_runtime.JSX.Element;
872
865
 
873
866
  interface DepositEvent {
874
867
  amount: string;
@@ -896,6 +889,17 @@ interface EarnAccountGuardProps {
896
889
  }
897
890
  declare function EarnAccountGuard({ children, loadingComponent, createAccountComponent, }: EarnAccountGuardProps): react_jsx_runtime.JSX.Element;
898
891
 
892
+ type TransferAction = 'deposit' | 'withdraw';
893
+ interface EarnAccountBalanceProps {
894
+ /** Tokens to show/allow transfers for */
895
+ tokens?: string[];
896
+ /** Compact mode - just show total USD value */
897
+ compact?: boolean;
898
+ /** Callback when transfer completes */
899
+ onTransferComplete?: (action: TransferAction, token: string, amount: string, txHash: string) => void;
900
+ }
901
+ declare function EarnAccountBalance({ tokens, compact, onTransferComplete, }: EarnAccountBalanceProps): react_jsx_runtime.JSX.Element | null;
902
+
899
903
  type SupportedChainId = 'ethereum' | 'base' | 'arbitrum';
900
904
  interface ChainConfig {
901
905
  id: SupportedChainId;
@@ -905,6 +909,5 @@ interface ChainConfig {
905
909
  rpcUrl?: string;
906
910
  }
907
911
  declare const CHAINS: Record<SupportedChainId, ChainConfig>;
908
- declare const TOKEN_DECIMALS: Record<string, number>;
909
912
 
910
- export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption, ActionModal, type ActionMode$2 as ActionMode, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, type EarnAccountContextValue, EarnAccountGuard, type FeaturePreset, type PendleMarketData, PendleMarketsList, type PendleMarketsListProps, type SortOption as PendleSortOption, PnLSummary, type SupportedChain, type SupportedChainId, type SwapLayout, type SwapQuote, SwapWidget, type SwapWidgetProps, TOKEN_DECIMALS, type TabConfig, type TabId, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$2 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
913
+ export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption, ActionModal, ApiProvider, type ApyPeriod, CHAINS, type ChainConfig, ChainSwitcher, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, DepositWithdrawForm, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, 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, TransactionHistory, type TypedDataToSign, type UserAavePosition, type UserPendlePosition, type UserVaultPosition, type VaultData, VaultsList, type VaultsListProps, type SortOption$2 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };