@compass-labs/widgets 0.1.0 → 0.1.2
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 +56 -35
- package/dist/index.d.ts +56 -35
- package/dist/index.js +1386 -333
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1387 -335
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.js +439 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +439 -0
- package/dist/server/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -297,6 +297,11 @@ interface TypedDataToSign {
|
|
|
297
297
|
interface WalletAdapter {
|
|
298
298
|
/** Connected wallet address, or null if not connected */
|
|
299
299
|
address: Address | null;
|
|
300
|
+
/**
|
|
301
|
+
* Current chain ID the wallet is connected to (optional)
|
|
302
|
+
* If provided, widgets will verify the wallet is on the correct chain before signing
|
|
303
|
+
*/
|
|
304
|
+
chainId?: number;
|
|
300
305
|
/**
|
|
301
306
|
* Sign EIP-712 typed data
|
|
302
307
|
* Called when user initiates a deposit/withdraw transaction
|
|
@@ -357,7 +362,6 @@ declare function CompassProvider({ children, apiKey, defaultChain, theme, wallet
|
|
|
357
362
|
|
|
358
363
|
type ApyPeriod = '7d' | '30d' | '90d';
|
|
359
364
|
type SortOption$2 = 'apy_7d' | 'apy_30d' | 'apy_90d' | 'tvl';
|
|
360
|
-
type ActionMode$2 = 'modal' | 'inline';
|
|
361
365
|
interface VaultData {
|
|
362
366
|
vaultAddress: string;
|
|
363
367
|
name: string;
|
|
@@ -404,14 +408,16 @@ interface VaultsListProps {
|
|
|
404
408
|
showSearch?: boolean;
|
|
405
409
|
/** Enable sorting options */
|
|
406
410
|
showSort?: boolean;
|
|
407
|
-
/** How to show deposit/withdraw form */
|
|
408
|
-
actionMode?: ActionMode$2;
|
|
409
411
|
/** Default sort option */
|
|
410
412
|
defaultSort?: SortOption$2;
|
|
411
413
|
/** Filter by asset symbols */
|
|
412
414
|
assetFilter?: string[];
|
|
413
415
|
/** Minimum APY filter */
|
|
414
416
|
minApy?: number;
|
|
417
|
+
/** Minimum TVL filter (in USD) */
|
|
418
|
+
minTvl?: number;
|
|
419
|
+
/** Show TVL filter input */
|
|
420
|
+
showTvlFilter?: boolean;
|
|
415
421
|
/** Callback when vault is clicked */
|
|
416
422
|
onVaultSelect?: (vault: VaultData) => void;
|
|
417
423
|
/** Callback after successful deposit */
|
|
@@ -433,12 +439,13 @@ interface VaultsListProps {
|
|
|
433
439
|
* />
|
|
434
440
|
* ```
|
|
435
441
|
*/
|
|
436
|
-
declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort,
|
|
442
|
+
declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, minApy, minTvl: initialMinTvl, showTvlFilter, onVaultSelect, onDeposit, onWithdraw, }: VaultsListProps): react_jsx_runtime.JSX.Element;
|
|
437
443
|
|
|
438
444
|
interface UseVaultsDataOptions {
|
|
439
445
|
sortBy?: SortOption$2;
|
|
440
446
|
assetFilter?: string[];
|
|
441
447
|
minApy?: number;
|
|
448
|
+
minTvl?: number;
|
|
442
449
|
}
|
|
443
450
|
declare function useVaultsData(options?: UseVaultsDataOptions): {
|
|
444
451
|
vaults: {
|
|
@@ -458,7 +465,6 @@ declare function useVaultsData(options?: UseVaultsDataOptions): {
|
|
|
458
465
|
};
|
|
459
466
|
|
|
460
467
|
type SortOption$1 = 'supply_apy';
|
|
461
|
-
type ActionMode$1 = 'modal' | 'inline';
|
|
462
468
|
interface AaveMarketData {
|
|
463
469
|
marketAddress: string;
|
|
464
470
|
reserveSymbol: string;
|
|
@@ -500,8 +506,6 @@ interface AaveMarketsListProps {
|
|
|
500
506
|
showSearch?: boolean;
|
|
501
507
|
/** Enable sorting options */
|
|
502
508
|
showSort?: boolean;
|
|
503
|
-
/** How to show deposit/withdraw form */
|
|
504
|
-
actionMode?: ActionMode$1;
|
|
505
509
|
/** Default sort option */
|
|
506
510
|
defaultSort?: SortOption$1;
|
|
507
511
|
/** Filter by asset symbols */
|
|
@@ -528,7 +532,7 @@ interface AaveMarketsListProps {
|
|
|
528
532
|
*/
|
|
529
533
|
declare function AaveMarketsList({ showApy, showTvl, // Aave API doesn't provide TVL data
|
|
530
534
|
showUserPosition, showPnL, showHistory, showSearch, showSort, // Only one sort option (APY), so hide by default
|
|
531
|
-
|
|
535
|
+
defaultSort, assetFilter, onMarketSelect, onSupply, onWithdraw, }: AaveMarketsListProps): react_jsx_runtime.JSX.Element;
|
|
532
536
|
|
|
533
537
|
interface UseAaveDataOptions {
|
|
534
538
|
sortBy?: SortOption$1;
|
|
@@ -551,7 +555,6 @@ declare function useAaveData(options?: UseAaveDataOptions): {
|
|
|
551
555
|
};
|
|
552
556
|
|
|
553
557
|
type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
|
|
554
|
-
type ActionMode = 'modal' | 'inline';
|
|
555
558
|
interface PendleMarketData {
|
|
556
559
|
marketAddress: string;
|
|
557
560
|
ptAddress: string;
|
|
@@ -596,12 +599,14 @@ interface PendleMarketsListProps {
|
|
|
596
599
|
showSearch?: boolean;
|
|
597
600
|
/** Enable sorting options */
|
|
598
601
|
showSort?: boolean;
|
|
599
|
-
/** How to show deposit/withdraw form */
|
|
600
|
-
actionMode?: ActionMode;
|
|
601
602
|
/** Default sort option */
|
|
602
603
|
defaultSort?: SortOption;
|
|
603
604
|
/** Filter by asset symbols */
|
|
604
605
|
assetFilter?: string[];
|
|
606
|
+
/** Minimum TVL filter (in USD) */
|
|
607
|
+
minTvl?: number;
|
|
608
|
+
/** Show TVL filter input */
|
|
609
|
+
showTvlFilter?: boolean;
|
|
605
610
|
/** Callback when market is clicked */
|
|
606
611
|
onMarketSelect?: (market: PendleMarketData) => void;
|
|
607
612
|
/** Callback after successful deposit */
|
|
@@ -623,11 +628,12 @@ interface PendleMarketsListProps {
|
|
|
623
628
|
* />
|
|
624
629
|
* ```
|
|
625
630
|
*/
|
|
626
|
-
declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort,
|
|
631
|
+
declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, minTvl: initialMinTvl, showTvlFilter, onMarketSelect, onDeposit, onWithdraw, }: PendleMarketsListProps): react_jsx_runtime.JSX.Element;
|
|
627
632
|
|
|
628
633
|
interface UsePendleDataOptions {
|
|
629
634
|
sortBy?: SortOption;
|
|
630
635
|
assetFilter?: string[];
|
|
636
|
+
minTvl?: number;
|
|
631
637
|
}
|
|
632
638
|
declare function usePendleData(options?: UsePendleDataOptions): {
|
|
633
639
|
markets: {
|
|
@@ -652,8 +658,6 @@ interface SwapQuote {
|
|
|
652
658
|
inputAmount: string;
|
|
653
659
|
outputAmount: string;
|
|
654
660
|
rate: string;
|
|
655
|
-
priceImpact: string;
|
|
656
|
-
fee: string;
|
|
657
661
|
}
|
|
658
662
|
interface SwapWidgetProps {
|
|
659
663
|
layout?: SwapLayout;
|
|
@@ -662,12 +666,11 @@ interface SwapWidgetProps {
|
|
|
662
666
|
allowedTokens?: string[];
|
|
663
667
|
showReverseButton?: boolean;
|
|
664
668
|
showSettings?: boolean;
|
|
665
|
-
showPriceImpact?: boolean;
|
|
666
669
|
onSwapSuccess?: (fromToken: string, toToken: string, fromAmount: string, toAmount: string, txHash: string) => void;
|
|
667
670
|
onSwapError?: (error: Error) => void;
|
|
668
671
|
}
|
|
669
672
|
|
|
670
|
-
declare function SwapWidget({ layout, defaultFromToken, defaultToToken, allowedTokens, showReverseButton, showSettings,
|
|
673
|
+
declare function SwapWidget({ layout, defaultFromToken, defaultToToken, allowedTokens, showReverseButton, showSettings, onSwapSuccess, onSwapError, }: SwapWidgetProps): react_jsx_runtime.JSX.Element;
|
|
671
674
|
|
|
672
675
|
interface UseSwapQuoteOptions {
|
|
673
676
|
fromToken: string;
|
|
@@ -679,28 +682,19 @@ declare function useSwapQuote({ fromToken, toToken, amount, enabled }: UseSwapQu
|
|
|
679
682
|
quote: SwapQuote | null | undefined;
|
|
680
683
|
isLoading: boolean;
|
|
681
684
|
isError: boolean;
|
|
685
|
+
error: Error | null;
|
|
682
686
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<SwapQuote | null, Error>>;
|
|
683
687
|
};
|
|
684
688
|
|
|
685
|
-
type TabId = 'vaults' | 'aave' | 'pendle' | 'swap';
|
|
686
|
-
type FeaturePreset = 'full' | 'earn-only' | 'swap-only' | 'vaults-only';
|
|
687
|
-
interface TabConfig {
|
|
688
|
-
id: TabId;
|
|
689
|
-
label: string;
|
|
690
|
-
enabled: boolean;
|
|
691
|
-
}
|
|
689
|
+
type TabId = 'vaults' | 'aave' | 'pendle' | 'swap' | 'positions';
|
|
692
690
|
interface CompassEarnWidgetProps {
|
|
693
|
-
|
|
694
|
-
enableVaults?: boolean;
|
|
695
|
-
enableAave?: boolean;
|
|
696
|
-
enablePendle?: boolean;
|
|
697
|
-
enableSwap?: boolean;
|
|
691
|
+
/** Starting tab (defaults to 'vaults') */
|
|
698
692
|
defaultTab?: TabId;
|
|
699
|
-
|
|
693
|
+
/** Called when user switches tabs */
|
|
700
694
|
onTabChange?: (tab: TabId) => void;
|
|
701
695
|
}
|
|
702
696
|
|
|
703
|
-
declare function CompassEarnWidget({
|
|
697
|
+
declare function CompassEarnWidget({ defaultTab, onTabChange, }: CompassEarnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
704
698
|
|
|
705
699
|
/**
|
|
706
700
|
* Theme Presets for Compass Embeddable Widgets
|
|
@@ -777,6 +771,8 @@ interface WalletContextValue {
|
|
|
777
771
|
address: Address | null;
|
|
778
772
|
/** Whether a wallet is connected */
|
|
779
773
|
isConnected: boolean;
|
|
774
|
+
/** Current chain ID the wallet is connected to */
|
|
775
|
+
walletChainId: number | undefined;
|
|
780
776
|
/** Sign EIP-712 typed data - throws if wallet not connected */
|
|
781
777
|
signTypedData: (data: TypedDataToSign) => Promise<string>;
|
|
782
778
|
/** Switch chain - may not be available depending on wallet adapter */
|
|
@@ -862,13 +858,15 @@ type VenueType = 'VAULT' | 'AAVE' | 'PENDLE_PT';
|
|
|
862
858
|
interface DepositWithdrawFormProps {
|
|
863
859
|
venueType: VenueType;
|
|
864
860
|
venueAddress: string;
|
|
865
|
-
|
|
866
|
-
|
|
861
|
+
/** The token the venue accepts */
|
|
862
|
+
venueToken: string;
|
|
863
|
+
/** Available tokens for deposits (enables swap if different from venueToken) */
|
|
864
|
+
depositTokens?: string[];
|
|
867
865
|
positionBalance?: string;
|
|
868
866
|
onSuccess?: (action: ActionType, amount: string, txHash: string) => void;
|
|
869
867
|
onError?: (error: Error) => void;
|
|
870
868
|
}
|
|
871
|
-
declare function DepositWithdrawForm({ venueType, venueAddress,
|
|
869
|
+
declare function DepositWithdrawForm({ venueType, venueAddress, venueToken, depositTokens, positionBalance, onSuccess, onError, }: DepositWithdrawFormProps): react_jsx_runtime.JSX.Element;
|
|
872
870
|
|
|
873
871
|
interface DepositEvent {
|
|
874
872
|
amount: string;
|
|
@@ -896,6 +894,30 @@ interface EarnAccountGuardProps {
|
|
|
896
894
|
}
|
|
897
895
|
declare function EarnAccountGuard({ children, loadingComponent, createAccountComponent, }: EarnAccountGuardProps): react_jsx_runtime.JSX.Element;
|
|
898
896
|
|
|
897
|
+
type TransferAction = 'deposit' | 'withdraw';
|
|
898
|
+
interface EarnAccountBalanceProps {
|
|
899
|
+
/** Compact mode - just show total USD value */
|
|
900
|
+
compact?: boolean;
|
|
901
|
+
/** Callback when transfer completes */
|
|
902
|
+
onTransferComplete?: (action: TransferAction, token: string, amount: string, txHash: string) => void;
|
|
903
|
+
}
|
|
904
|
+
declare function EarnAccountBalance({ compact, onTransferComplete, }: EarnAccountBalanceProps): react_jsx_runtime.JSX.Element | null;
|
|
905
|
+
|
|
906
|
+
interface TokenBalance {
|
|
907
|
+
symbol: string;
|
|
908
|
+
balance: string;
|
|
909
|
+
usdValue: string;
|
|
910
|
+
}
|
|
911
|
+
interface AccountBalancesModalProps {
|
|
912
|
+
isOpen: boolean;
|
|
913
|
+
onClose: () => void;
|
|
914
|
+
balances: TokenBalance[];
|
|
915
|
+
totalUsdValue: string;
|
|
916
|
+
isLoading?: boolean;
|
|
917
|
+
earnAccountAddress?: string;
|
|
918
|
+
}
|
|
919
|
+
declare function AccountBalancesModal({ isOpen, onClose, balances, totalUsdValue, isLoading, earnAccountAddress, }: AccountBalancesModalProps): react_jsx_runtime.JSX.Element | null;
|
|
920
|
+
|
|
899
921
|
type SupportedChainId = 'ethereum' | 'base' | 'arbitrum';
|
|
900
922
|
interface ChainConfig {
|
|
901
923
|
id: SupportedChainId;
|
|
@@ -905,6 +927,5 @@ interface ChainConfig {
|
|
|
905
927
|
rpcUrl?: string;
|
|
906
928
|
}
|
|
907
929
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
908
|
-
declare const TOKEN_DECIMALS: Record<string, number>;
|
|
909
930
|
|
|
910
|
-
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption,
|
|
931
|
+
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption, 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$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
|
@@ -297,6 +297,11 @@ interface TypedDataToSign {
|
|
|
297
297
|
interface WalletAdapter {
|
|
298
298
|
/** Connected wallet address, or null if not connected */
|
|
299
299
|
address: Address | null;
|
|
300
|
+
/**
|
|
301
|
+
* Current chain ID the wallet is connected to (optional)
|
|
302
|
+
* If provided, widgets will verify the wallet is on the correct chain before signing
|
|
303
|
+
*/
|
|
304
|
+
chainId?: number;
|
|
300
305
|
/**
|
|
301
306
|
* Sign EIP-712 typed data
|
|
302
307
|
* Called when user initiates a deposit/withdraw transaction
|
|
@@ -357,7 +362,6 @@ declare function CompassProvider({ children, apiKey, defaultChain, theme, wallet
|
|
|
357
362
|
|
|
358
363
|
type ApyPeriod = '7d' | '30d' | '90d';
|
|
359
364
|
type SortOption$2 = 'apy_7d' | 'apy_30d' | 'apy_90d' | 'tvl';
|
|
360
|
-
type ActionMode$2 = 'modal' | 'inline';
|
|
361
365
|
interface VaultData {
|
|
362
366
|
vaultAddress: string;
|
|
363
367
|
name: string;
|
|
@@ -404,14 +408,16 @@ interface VaultsListProps {
|
|
|
404
408
|
showSearch?: boolean;
|
|
405
409
|
/** Enable sorting options */
|
|
406
410
|
showSort?: boolean;
|
|
407
|
-
/** How to show deposit/withdraw form */
|
|
408
|
-
actionMode?: ActionMode$2;
|
|
409
411
|
/** Default sort option */
|
|
410
412
|
defaultSort?: SortOption$2;
|
|
411
413
|
/** Filter by asset symbols */
|
|
412
414
|
assetFilter?: string[];
|
|
413
415
|
/** Minimum APY filter */
|
|
414
416
|
minApy?: number;
|
|
417
|
+
/** Minimum TVL filter (in USD) */
|
|
418
|
+
minTvl?: number;
|
|
419
|
+
/** Show TVL filter input */
|
|
420
|
+
showTvlFilter?: boolean;
|
|
415
421
|
/** Callback when vault is clicked */
|
|
416
422
|
onVaultSelect?: (vault: VaultData) => void;
|
|
417
423
|
/** Callback after successful deposit */
|
|
@@ -433,12 +439,13 @@ interface VaultsListProps {
|
|
|
433
439
|
* />
|
|
434
440
|
* ```
|
|
435
441
|
*/
|
|
436
|
-
declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort,
|
|
442
|
+
declare function VaultsList({ showApy, apyPeriods, showTvl, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, minApy, minTvl: initialMinTvl, showTvlFilter, onVaultSelect, onDeposit, onWithdraw, }: VaultsListProps): react_jsx_runtime.JSX.Element;
|
|
437
443
|
|
|
438
444
|
interface UseVaultsDataOptions {
|
|
439
445
|
sortBy?: SortOption$2;
|
|
440
446
|
assetFilter?: string[];
|
|
441
447
|
minApy?: number;
|
|
448
|
+
minTvl?: number;
|
|
442
449
|
}
|
|
443
450
|
declare function useVaultsData(options?: UseVaultsDataOptions): {
|
|
444
451
|
vaults: {
|
|
@@ -458,7 +465,6 @@ declare function useVaultsData(options?: UseVaultsDataOptions): {
|
|
|
458
465
|
};
|
|
459
466
|
|
|
460
467
|
type SortOption$1 = 'supply_apy';
|
|
461
|
-
type ActionMode$1 = 'modal' | 'inline';
|
|
462
468
|
interface AaveMarketData {
|
|
463
469
|
marketAddress: string;
|
|
464
470
|
reserveSymbol: string;
|
|
@@ -500,8 +506,6 @@ interface AaveMarketsListProps {
|
|
|
500
506
|
showSearch?: boolean;
|
|
501
507
|
/** Enable sorting options */
|
|
502
508
|
showSort?: boolean;
|
|
503
|
-
/** How to show deposit/withdraw form */
|
|
504
|
-
actionMode?: ActionMode$1;
|
|
505
509
|
/** Default sort option */
|
|
506
510
|
defaultSort?: SortOption$1;
|
|
507
511
|
/** Filter by asset symbols */
|
|
@@ -528,7 +532,7 @@ interface AaveMarketsListProps {
|
|
|
528
532
|
*/
|
|
529
533
|
declare function AaveMarketsList({ showApy, showTvl, // Aave API doesn't provide TVL data
|
|
530
534
|
showUserPosition, showPnL, showHistory, showSearch, showSort, // Only one sort option (APY), so hide by default
|
|
531
|
-
|
|
535
|
+
defaultSort, assetFilter, onMarketSelect, onSupply, onWithdraw, }: AaveMarketsListProps): react_jsx_runtime.JSX.Element;
|
|
532
536
|
|
|
533
537
|
interface UseAaveDataOptions {
|
|
534
538
|
sortBy?: SortOption$1;
|
|
@@ -551,7 +555,6 @@ declare function useAaveData(options?: UseAaveDataOptions): {
|
|
|
551
555
|
};
|
|
552
556
|
|
|
553
557
|
type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
|
|
554
|
-
type ActionMode = 'modal' | 'inline';
|
|
555
558
|
interface PendleMarketData {
|
|
556
559
|
marketAddress: string;
|
|
557
560
|
ptAddress: string;
|
|
@@ -596,12 +599,14 @@ interface PendleMarketsListProps {
|
|
|
596
599
|
showSearch?: boolean;
|
|
597
600
|
/** Enable sorting options */
|
|
598
601
|
showSort?: boolean;
|
|
599
|
-
/** How to show deposit/withdraw form */
|
|
600
|
-
actionMode?: ActionMode;
|
|
601
602
|
/** Default sort option */
|
|
602
603
|
defaultSort?: SortOption;
|
|
603
604
|
/** Filter by asset symbols */
|
|
604
605
|
assetFilter?: string[];
|
|
606
|
+
/** Minimum TVL filter (in USD) */
|
|
607
|
+
minTvl?: number;
|
|
608
|
+
/** Show TVL filter input */
|
|
609
|
+
showTvlFilter?: boolean;
|
|
605
610
|
/** Callback when market is clicked */
|
|
606
611
|
onMarketSelect?: (market: PendleMarketData) => void;
|
|
607
612
|
/** Callback after successful deposit */
|
|
@@ -623,11 +628,12 @@ interface PendleMarketsListProps {
|
|
|
623
628
|
* />
|
|
624
629
|
* ```
|
|
625
630
|
*/
|
|
626
|
-
declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort,
|
|
631
|
+
declare function PendleMarketsList({ showApy, showTvl, showExpiry, showUserPosition, showPnL, showHistory, showSearch, showSort, defaultSort, assetFilter, minTvl: initialMinTvl, showTvlFilter, onMarketSelect, onDeposit, onWithdraw, }: PendleMarketsListProps): react_jsx_runtime.JSX.Element;
|
|
627
632
|
|
|
628
633
|
interface UsePendleDataOptions {
|
|
629
634
|
sortBy?: SortOption;
|
|
630
635
|
assetFilter?: string[];
|
|
636
|
+
minTvl?: number;
|
|
631
637
|
}
|
|
632
638
|
declare function usePendleData(options?: UsePendleDataOptions): {
|
|
633
639
|
markets: {
|
|
@@ -652,8 +658,6 @@ interface SwapQuote {
|
|
|
652
658
|
inputAmount: string;
|
|
653
659
|
outputAmount: string;
|
|
654
660
|
rate: string;
|
|
655
|
-
priceImpact: string;
|
|
656
|
-
fee: string;
|
|
657
661
|
}
|
|
658
662
|
interface SwapWidgetProps {
|
|
659
663
|
layout?: SwapLayout;
|
|
@@ -662,12 +666,11 @@ interface SwapWidgetProps {
|
|
|
662
666
|
allowedTokens?: string[];
|
|
663
667
|
showReverseButton?: boolean;
|
|
664
668
|
showSettings?: boolean;
|
|
665
|
-
showPriceImpact?: boolean;
|
|
666
669
|
onSwapSuccess?: (fromToken: string, toToken: string, fromAmount: string, toAmount: string, txHash: string) => void;
|
|
667
670
|
onSwapError?: (error: Error) => void;
|
|
668
671
|
}
|
|
669
672
|
|
|
670
|
-
declare function SwapWidget({ layout, defaultFromToken, defaultToToken, allowedTokens, showReverseButton, showSettings,
|
|
673
|
+
declare function SwapWidget({ layout, defaultFromToken, defaultToToken, allowedTokens, showReverseButton, showSettings, onSwapSuccess, onSwapError, }: SwapWidgetProps): react_jsx_runtime.JSX.Element;
|
|
671
674
|
|
|
672
675
|
interface UseSwapQuoteOptions {
|
|
673
676
|
fromToken: string;
|
|
@@ -679,28 +682,19 @@ declare function useSwapQuote({ fromToken, toToken, amount, enabled }: UseSwapQu
|
|
|
679
682
|
quote: SwapQuote | null | undefined;
|
|
680
683
|
isLoading: boolean;
|
|
681
684
|
isError: boolean;
|
|
685
|
+
error: Error | null;
|
|
682
686
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<SwapQuote | null, Error>>;
|
|
683
687
|
};
|
|
684
688
|
|
|
685
|
-
type TabId = 'vaults' | 'aave' | 'pendle' | 'swap';
|
|
686
|
-
type FeaturePreset = 'full' | 'earn-only' | 'swap-only' | 'vaults-only';
|
|
687
|
-
interface TabConfig {
|
|
688
|
-
id: TabId;
|
|
689
|
-
label: string;
|
|
690
|
-
enabled: boolean;
|
|
691
|
-
}
|
|
689
|
+
type TabId = 'vaults' | 'aave' | 'pendle' | 'swap' | 'positions';
|
|
692
690
|
interface CompassEarnWidgetProps {
|
|
693
|
-
|
|
694
|
-
enableVaults?: boolean;
|
|
695
|
-
enableAave?: boolean;
|
|
696
|
-
enablePendle?: boolean;
|
|
697
|
-
enableSwap?: boolean;
|
|
691
|
+
/** Starting tab (defaults to 'vaults') */
|
|
698
692
|
defaultTab?: TabId;
|
|
699
|
-
|
|
693
|
+
/** Called when user switches tabs */
|
|
700
694
|
onTabChange?: (tab: TabId) => void;
|
|
701
695
|
}
|
|
702
696
|
|
|
703
|
-
declare function CompassEarnWidget({
|
|
697
|
+
declare function CompassEarnWidget({ defaultTab, onTabChange, }: CompassEarnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
704
698
|
|
|
705
699
|
/**
|
|
706
700
|
* Theme Presets for Compass Embeddable Widgets
|
|
@@ -777,6 +771,8 @@ interface WalletContextValue {
|
|
|
777
771
|
address: Address | null;
|
|
778
772
|
/** Whether a wallet is connected */
|
|
779
773
|
isConnected: boolean;
|
|
774
|
+
/** Current chain ID the wallet is connected to */
|
|
775
|
+
walletChainId: number | undefined;
|
|
780
776
|
/** Sign EIP-712 typed data - throws if wallet not connected */
|
|
781
777
|
signTypedData: (data: TypedDataToSign) => Promise<string>;
|
|
782
778
|
/** Switch chain - may not be available depending on wallet adapter */
|
|
@@ -862,13 +858,15 @@ type VenueType = 'VAULT' | 'AAVE' | 'PENDLE_PT';
|
|
|
862
858
|
interface DepositWithdrawFormProps {
|
|
863
859
|
venueType: VenueType;
|
|
864
860
|
venueAddress: string;
|
|
865
|
-
|
|
866
|
-
|
|
861
|
+
/** The token the venue accepts */
|
|
862
|
+
venueToken: string;
|
|
863
|
+
/** Available tokens for deposits (enables swap if different from venueToken) */
|
|
864
|
+
depositTokens?: string[];
|
|
867
865
|
positionBalance?: string;
|
|
868
866
|
onSuccess?: (action: ActionType, amount: string, txHash: string) => void;
|
|
869
867
|
onError?: (error: Error) => void;
|
|
870
868
|
}
|
|
871
|
-
declare function DepositWithdrawForm({ venueType, venueAddress,
|
|
869
|
+
declare function DepositWithdrawForm({ venueType, venueAddress, venueToken, depositTokens, positionBalance, onSuccess, onError, }: DepositWithdrawFormProps): react_jsx_runtime.JSX.Element;
|
|
872
870
|
|
|
873
871
|
interface DepositEvent {
|
|
874
872
|
amount: string;
|
|
@@ -896,6 +894,30 @@ interface EarnAccountGuardProps {
|
|
|
896
894
|
}
|
|
897
895
|
declare function EarnAccountGuard({ children, loadingComponent, createAccountComponent, }: EarnAccountGuardProps): react_jsx_runtime.JSX.Element;
|
|
898
896
|
|
|
897
|
+
type TransferAction = 'deposit' | 'withdraw';
|
|
898
|
+
interface EarnAccountBalanceProps {
|
|
899
|
+
/** Compact mode - just show total USD value */
|
|
900
|
+
compact?: boolean;
|
|
901
|
+
/** Callback when transfer completes */
|
|
902
|
+
onTransferComplete?: (action: TransferAction, token: string, amount: string, txHash: string) => void;
|
|
903
|
+
}
|
|
904
|
+
declare function EarnAccountBalance({ compact, onTransferComplete, }: EarnAccountBalanceProps): react_jsx_runtime.JSX.Element | null;
|
|
905
|
+
|
|
906
|
+
interface TokenBalance {
|
|
907
|
+
symbol: string;
|
|
908
|
+
balance: string;
|
|
909
|
+
usdValue: string;
|
|
910
|
+
}
|
|
911
|
+
interface AccountBalancesModalProps {
|
|
912
|
+
isOpen: boolean;
|
|
913
|
+
onClose: () => void;
|
|
914
|
+
balances: TokenBalance[];
|
|
915
|
+
totalUsdValue: string;
|
|
916
|
+
isLoading?: boolean;
|
|
917
|
+
earnAccountAddress?: string;
|
|
918
|
+
}
|
|
919
|
+
declare function AccountBalancesModal({ isOpen, onClose, balances, totalUsdValue, isLoading, earnAccountAddress, }: AccountBalancesModalProps): react_jsx_runtime.JSX.Element | null;
|
|
920
|
+
|
|
899
921
|
type SupportedChainId = 'ethereum' | 'base' | 'arbitrum';
|
|
900
922
|
interface ChainConfig {
|
|
901
923
|
id: SupportedChainId;
|
|
@@ -905,6 +927,5 @@ interface ChainConfig {
|
|
|
905
927
|
rpcUrl?: string;
|
|
906
928
|
}
|
|
907
929
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
908
|
-
declare const TOKEN_DECIMALS: Record<string, number>;
|
|
909
930
|
|
|
910
|
-
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption,
|
|
931
|
+
export { type AaveMarketData, AaveMarketsList, type AaveMarketsListProps, type SortOption$1 as AaveSortOption, 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$2 as VaultsSortOption, type WalletAdapter, WalletStatus, themePresets, useAaveData, useChain, useCompassApi, useCompassChain, useCompassWallet, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, usePendleData, useSwapQuote, useTheme, useVaultsData };
|