@compass-labs/widgets 0.1.7 → 0.1.9
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 +109 -39
- package/dist/index.d.ts +109 -39
- package/dist/index.js +763 -428
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +763 -429
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.js +0 -42
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +0 -42
- package/dist/server/index.mjs.map +1 -1
- package/dist/styles.css +24 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -47,6 +47,8 @@ interface ThemeBrandColors {
|
|
|
47
47
|
primary: string;
|
|
48
48
|
/** Primary hover state */
|
|
49
49
|
primaryHover: string;
|
|
50
|
+
/** Primary muted/background variant */
|
|
51
|
+
primaryMuted: string;
|
|
50
52
|
/** Text on primary color background */
|
|
51
53
|
primaryText: string;
|
|
52
54
|
/** Secondary brand color */
|
|
@@ -395,32 +397,41 @@ interface UserVaultPosition {
|
|
|
395
397
|
txHash: string;
|
|
396
398
|
}>;
|
|
397
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* Props for the VaultsList widget.
|
|
402
|
+
*
|
|
403
|
+
* Sensible defaults are applied automatically:
|
|
404
|
+
* - All display options enabled (APY, TVL, positions, P&L, history)
|
|
405
|
+
* - Search and sorting enabled
|
|
406
|
+
* - Sorted by 7-day APY (best recent performers first)
|
|
407
|
+
* - TVL filter available but no minimum set
|
|
408
|
+
*/
|
|
398
409
|
interface VaultsListProps {
|
|
399
|
-
/** Show APY metrics */
|
|
410
|
+
/** Show APY metrics @default true */
|
|
400
411
|
showApy?: boolean;
|
|
401
|
-
/** Which APY periods to display */
|
|
412
|
+
/** Which APY periods to display @default ['7d', '30d', '90d'] */
|
|
402
413
|
apyPeriods?: ApyPeriod[];
|
|
403
|
-
/** Show total value locked */
|
|
414
|
+
/** Show total value locked @default true */
|
|
404
415
|
showTvl?: boolean;
|
|
405
|
-
/** Show user's current position */
|
|
416
|
+
/** Show user's current position @default true */
|
|
406
417
|
showUserPosition?: boolean;
|
|
407
|
-
/** Show profit/loss summary */
|
|
418
|
+
/** Show profit/loss summary @default true */
|
|
408
419
|
showPnL?: boolean;
|
|
409
|
-
/** Show transaction history */
|
|
420
|
+
/** Show transaction history @default true */
|
|
410
421
|
showHistory?: boolean;
|
|
411
|
-
/** Enable search functionality */
|
|
422
|
+
/** Enable search functionality @default true */
|
|
412
423
|
showSearch?: boolean;
|
|
413
|
-
/** Enable sorting options */
|
|
424
|
+
/** Enable sorting options @default true */
|
|
414
425
|
showSort?: boolean;
|
|
415
|
-
/** Default sort option */
|
|
426
|
+
/** Default sort option @default 'apy_7d' */
|
|
416
427
|
defaultSort?: SortOption$1;
|
|
417
|
-
/** Filter by asset symbols */
|
|
428
|
+
/** Filter by asset symbols (e.g., ['USDC', 'ETH']) @default undefined (show all) */
|
|
418
429
|
assetFilter?: string[];
|
|
419
|
-
/** Minimum APY filter */
|
|
430
|
+
/** Minimum APY filter @default undefined (no minimum) */
|
|
420
431
|
minApy?: number;
|
|
421
|
-
/** Minimum TVL filter
|
|
432
|
+
/** Minimum TVL filter in USD @default undefined (no minimum) */
|
|
422
433
|
minTvl?: number;
|
|
423
|
-
/** Show TVL filter input */
|
|
434
|
+
/** Show TVL filter input @default true */
|
|
424
435
|
showTvlFilter?: boolean;
|
|
425
436
|
/** Callback when vault is clicked */
|
|
426
437
|
onVaultSelect?: (vault: VaultData) => void;
|
|
@@ -493,18 +504,26 @@ interface UserAavePosition {
|
|
|
493
504
|
deposits?: TransactionEvent$1[];
|
|
494
505
|
withdrawals?: TransactionEvent$1[];
|
|
495
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* Props for the AaveMarketsList widget.
|
|
509
|
+
*
|
|
510
|
+
* Sensible defaults are applied automatically:
|
|
511
|
+
* - All display options enabled (APY, positions, P&L, history)
|
|
512
|
+
* - Search enabled for quick market discovery
|
|
513
|
+
* - Shows supply APY (lending rates)
|
|
514
|
+
*/
|
|
496
515
|
interface AaveMarketsListProps {
|
|
497
|
-
/** Show APY metrics */
|
|
516
|
+
/** Show APY metrics @default true */
|
|
498
517
|
showApy?: boolean;
|
|
499
|
-
/** Show user's current position */
|
|
518
|
+
/** Show user's current position @default true */
|
|
500
519
|
showUserPosition?: boolean;
|
|
501
|
-
/** Show profit/loss summary */
|
|
520
|
+
/** Show profit/loss summary @default true */
|
|
502
521
|
showPnL?: boolean;
|
|
503
|
-
/** Show transaction history */
|
|
522
|
+
/** Show transaction history @default true */
|
|
504
523
|
showHistory?: boolean;
|
|
505
|
-
/** Enable search functionality */
|
|
524
|
+
/** Enable search functionality @default true */
|
|
506
525
|
showSearch?: boolean;
|
|
507
|
-
/** Filter by asset symbols */
|
|
526
|
+
/** Filter by asset symbols (e.g., ['USDC', 'ETH']) @default undefined (show all) */
|
|
508
527
|
assetFilter?: string[];
|
|
509
528
|
/** Callback when market is clicked */
|
|
510
529
|
onMarketSelect?: (market: AaveMarketData) => void;
|
|
@@ -547,14 +566,29 @@ declare function useAaveData(options?: UseAaveDataOptions): {
|
|
|
547
566
|
};
|
|
548
567
|
|
|
549
568
|
/**
|
|
550
|
-
* Props for EarnAccount -
|
|
551
|
-
*
|
|
569
|
+
* Props for EarnAccount - A banking-style USDC savings account widget.
|
|
570
|
+
*
|
|
571
|
+
* Sensible defaults are applied automatically:
|
|
572
|
+
* - Header with title and wallet status shown
|
|
573
|
+
* - Interest rate and earnings displayed
|
|
574
|
+
* - Fund from wallet button enabled
|
|
575
|
+
* - Full layout (not compact)
|
|
552
576
|
*/
|
|
553
577
|
interface EarnAccountProps {
|
|
554
|
-
/** Show
|
|
578
|
+
/** Show the header with title and wallet status @default true */
|
|
579
|
+
showHeader?: boolean;
|
|
580
|
+
/** Show the interest rate badge @default true */
|
|
581
|
+
showInterestRate?: boolean;
|
|
582
|
+
/** Show earnings/PnL display when available @default true */
|
|
555
583
|
showPnL?: boolean;
|
|
556
|
-
/** Show
|
|
557
|
-
|
|
584
|
+
/** Show the "Transfer from Wallet" button @default true */
|
|
585
|
+
showFundButton?: boolean;
|
|
586
|
+
/** Show the trust badge ("Secured & Insured") @default true */
|
|
587
|
+
showTrustBadge?: boolean;
|
|
588
|
+
/** Compact layout with reduced spacing @default false */
|
|
589
|
+
compact?: boolean;
|
|
590
|
+
/** Custom title for the header @default "Savings Account" */
|
|
591
|
+
title?: string;
|
|
558
592
|
/** Callback after successful supply */
|
|
559
593
|
onSupply?: (market: AaveMarketData, amount: string, txHash: string) => void;
|
|
560
594
|
/** Callback after successful withdraw */
|
|
@@ -564,7 +598,7 @@ interface EarnAccountProps {
|
|
|
564
598
|
/**
|
|
565
599
|
* EarnAccount widget - A beautiful banking-style USDC savings account.
|
|
566
600
|
*/
|
|
567
|
-
declare function EarnAccount({ showPnL,
|
|
601
|
+
declare function EarnAccount({ showHeader, showInterestRate, showPnL, showFundButton, showTrustBadge, compact, title, onSupply, onWithdraw, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
568
602
|
|
|
569
603
|
type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
|
|
570
604
|
interface PendleMarketData {
|
|
@@ -594,30 +628,39 @@ interface UserPendlePosition {
|
|
|
594
628
|
deposits?: TransactionEvent[];
|
|
595
629
|
withdrawals?: TransactionEvent[];
|
|
596
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Props for the PendleMarketsList widget.
|
|
633
|
+
*
|
|
634
|
+
* Sensible defaults are applied automatically:
|
|
635
|
+
* - All display options enabled (APY, TVL, expiry, positions, P&L, history)
|
|
636
|
+
* - Search and sorting enabled
|
|
637
|
+
* - Sorted by fixed APY (best yields first)
|
|
638
|
+
* - Shows only non-expired markets
|
|
639
|
+
*/
|
|
597
640
|
interface PendleMarketsListProps {
|
|
598
|
-
/** Show APY metrics */
|
|
641
|
+
/** Show APY metrics @default true */
|
|
599
642
|
showApy?: boolean;
|
|
600
|
-
/** Show total value locked */
|
|
643
|
+
/** Show total value locked @default true */
|
|
601
644
|
showTvl?: boolean;
|
|
602
|
-
/** Show expiry dates */
|
|
645
|
+
/** Show expiry dates @default true */
|
|
603
646
|
showExpiry?: boolean;
|
|
604
|
-
/** Show user's current position */
|
|
647
|
+
/** Show user's current position @default true */
|
|
605
648
|
showUserPosition?: boolean;
|
|
606
|
-
/** Show profit/loss summary */
|
|
649
|
+
/** Show profit/loss summary @default true */
|
|
607
650
|
showPnL?: boolean;
|
|
608
|
-
/** Show transaction history */
|
|
651
|
+
/** Show transaction history @default true */
|
|
609
652
|
showHistory?: boolean;
|
|
610
|
-
/** Enable search functionality */
|
|
653
|
+
/** Enable search functionality @default true */
|
|
611
654
|
showSearch?: boolean;
|
|
612
|
-
/** Enable sorting options */
|
|
655
|
+
/** Enable sorting options @default true */
|
|
613
656
|
showSort?: boolean;
|
|
614
|
-
/** Default sort option */
|
|
657
|
+
/** Default sort option @default 'fixed_apy' */
|
|
615
658
|
defaultSort?: SortOption;
|
|
616
|
-
/** Filter by asset symbols */
|
|
659
|
+
/** Filter by asset symbols (e.g., ['USDC', 'ETH']) @default undefined (show all) */
|
|
617
660
|
assetFilter?: string[];
|
|
618
|
-
/** Minimum TVL filter
|
|
661
|
+
/** Minimum TVL filter in USD @default undefined (no minimum) */
|
|
619
662
|
minTvl?: number;
|
|
620
|
-
/** Show TVL filter input */
|
|
663
|
+
/** Show TVL filter input @default true */
|
|
621
664
|
showTvlFilter?: boolean;
|
|
622
665
|
/** Callback when market is clicked */
|
|
623
666
|
onMarketSelect?: (market: PendleMarketData) => void;
|
|
@@ -671,14 +714,33 @@ interface SwapQuote {
|
|
|
671
714
|
outputAmount: string;
|
|
672
715
|
rate: string;
|
|
673
716
|
}
|
|
717
|
+
/** Default tokens available for swapping */
|
|
718
|
+
declare const DEFAULT_SWAP_TOKENS: readonly ["USDC", "ETH", "WETH", "WBTC", "DAI", "USDT", "AUSD", "SBC"];
|
|
719
|
+
/**
|
|
720
|
+
* Props for the SwapWidget.
|
|
721
|
+
*
|
|
722
|
+
* Sensible defaults are applied automatically:
|
|
723
|
+
* - Full layout for maximum usability
|
|
724
|
+
* - ETH → USDC as default pair (most common swap)
|
|
725
|
+
* - Reverse button enabled for easy direction switching
|
|
726
|
+
* - Popular DeFi tokens pre-configured
|
|
727
|
+
*/
|
|
674
728
|
interface SwapWidgetProps {
|
|
729
|
+
/** Widget layout size @default 'full' */
|
|
675
730
|
layout?: SwapLayout;
|
|
731
|
+
/** Initial "from" token @default 'ETH' */
|
|
676
732
|
defaultFromToken?: string;
|
|
733
|
+
/** Initial "to" token @default 'USDC' */
|
|
677
734
|
defaultToToken?: string;
|
|
735
|
+
/** Tokens available for selection @default ['USDC', 'ETH', 'WETH', 'WBTC', 'DAI', 'USDT', 'AUSD', 'SBC'] */
|
|
678
736
|
allowedTokens?: string[];
|
|
737
|
+
/** Show swap direction button @default true */
|
|
679
738
|
showReverseButton?: boolean;
|
|
739
|
+
/** Show settings panel @default false */
|
|
680
740
|
showSettings?: boolean;
|
|
741
|
+
/** Callback after successful swap */
|
|
681
742
|
onSwapSuccess?: (fromToken: string, toToken: string, fromAmount: string, toAmount: string, txHash: string) => void;
|
|
743
|
+
/** Callback on swap error */
|
|
682
744
|
onSwapError?: (error: Error) => void;
|
|
683
745
|
}
|
|
684
746
|
|
|
@@ -705,6 +767,14 @@ interface TabConfig {
|
|
|
705
767
|
label: string;
|
|
706
768
|
enabled: boolean;
|
|
707
769
|
}
|
|
770
|
+
/**
|
|
771
|
+
* Props for the CompassEarnWidget (unified tabbed experience).
|
|
772
|
+
*
|
|
773
|
+
* Sensible defaults are applied automatically:
|
|
774
|
+
* - Starts on Vaults tab (highest yield opportunities)
|
|
775
|
+
* - All tabs enabled (Vaults, Aave, Pendle, Swap)
|
|
776
|
+
* - Full-featured experience out of the box
|
|
777
|
+
*/
|
|
708
778
|
interface CompassEarnWidgetProps {
|
|
709
779
|
preset?: FeaturePreset;
|
|
710
780
|
enableVaults?: boolean;
|
|
@@ -751,7 +821,7 @@ interface ThemeProviderProps {
|
|
|
751
821
|
children: ReactNode;
|
|
752
822
|
theme?: ThemeInput;
|
|
753
823
|
}
|
|
754
|
-
declare function ThemeProvider({ children, theme:
|
|
824
|
+
declare function ThemeProvider({ children, theme: themeProp }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
755
825
|
declare function useTheme(): ThemeContextValue;
|
|
756
826
|
|
|
757
827
|
/**
|
|
@@ -962,4 +1032,4 @@ interface ChainConfig {
|
|
|
962
1032
|
}
|
|
963
1033
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
964
1034
|
|
|
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 };
|
|
1035
|
+
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, DEFAULT_SWAP_TOKENS, 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
|
@@ -47,6 +47,8 @@ interface ThemeBrandColors {
|
|
|
47
47
|
primary: string;
|
|
48
48
|
/** Primary hover state */
|
|
49
49
|
primaryHover: string;
|
|
50
|
+
/** Primary muted/background variant */
|
|
51
|
+
primaryMuted: string;
|
|
50
52
|
/** Text on primary color background */
|
|
51
53
|
primaryText: string;
|
|
52
54
|
/** Secondary brand color */
|
|
@@ -395,32 +397,41 @@ interface UserVaultPosition {
|
|
|
395
397
|
txHash: string;
|
|
396
398
|
}>;
|
|
397
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* Props for the VaultsList widget.
|
|
402
|
+
*
|
|
403
|
+
* Sensible defaults are applied automatically:
|
|
404
|
+
* - All display options enabled (APY, TVL, positions, P&L, history)
|
|
405
|
+
* - Search and sorting enabled
|
|
406
|
+
* - Sorted by 7-day APY (best recent performers first)
|
|
407
|
+
* - TVL filter available but no minimum set
|
|
408
|
+
*/
|
|
398
409
|
interface VaultsListProps {
|
|
399
|
-
/** Show APY metrics */
|
|
410
|
+
/** Show APY metrics @default true */
|
|
400
411
|
showApy?: boolean;
|
|
401
|
-
/** Which APY periods to display */
|
|
412
|
+
/** Which APY periods to display @default ['7d', '30d', '90d'] */
|
|
402
413
|
apyPeriods?: ApyPeriod[];
|
|
403
|
-
/** Show total value locked */
|
|
414
|
+
/** Show total value locked @default true */
|
|
404
415
|
showTvl?: boolean;
|
|
405
|
-
/** Show user's current position */
|
|
416
|
+
/** Show user's current position @default true */
|
|
406
417
|
showUserPosition?: boolean;
|
|
407
|
-
/** Show profit/loss summary */
|
|
418
|
+
/** Show profit/loss summary @default true */
|
|
408
419
|
showPnL?: boolean;
|
|
409
|
-
/** Show transaction history */
|
|
420
|
+
/** Show transaction history @default true */
|
|
410
421
|
showHistory?: boolean;
|
|
411
|
-
/** Enable search functionality */
|
|
422
|
+
/** Enable search functionality @default true */
|
|
412
423
|
showSearch?: boolean;
|
|
413
|
-
/** Enable sorting options */
|
|
424
|
+
/** Enable sorting options @default true */
|
|
414
425
|
showSort?: boolean;
|
|
415
|
-
/** Default sort option */
|
|
426
|
+
/** Default sort option @default 'apy_7d' */
|
|
416
427
|
defaultSort?: SortOption$1;
|
|
417
|
-
/** Filter by asset symbols */
|
|
428
|
+
/** Filter by asset symbols (e.g., ['USDC', 'ETH']) @default undefined (show all) */
|
|
418
429
|
assetFilter?: string[];
|
|
419
|
-
/** Minimum APY filter */
|
|
430
|
+
/** Minimum APY filter @default undefined (no minimum) */
|
|
420
431
|
minApy?: number;
|
|
421
|
-
/** Minimum TVL filter
|
|
432
|
+
/** Minimum TVL filter in USD @default undefined (no minimum) */
|
|
422
433
|
minTvl?: number;
|
|
423
|
-
/** Show TVL filter input */
|
|
434
|
+
/** Show TVL filter input @default true */
|
|
424
435
|
showTvlFilter?: boolean;
|
|
425
436
|
/** Callback when vault is clicked */
|
|
426
437
|
onVaultSelect?: (vault: VaultData) => void;
|
|
@@ -493,18 +504,26 @@ interface UserAavePosition {
|
|
|
493
504
|
deposits?: TransactionEvent$1[];
|
|
494
505
|
withdrawals?: TransactionEvent$1[];
|
|
495
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* Props for the AaveMarketsList widget.
|
|
509
|
+
*
|
|
510
|
+
* Sensible defaults are applied automatically:
|
|
511
|
+
* - All display options enabled (APY, positions, P&L, history)
|
|
512
|
+
* - Search enabled for quick market discovery
|
|
513
|
+
* - Shows supply APY (lending rates)
|
|
514
|
+
*/
|
|
496
515
|
interface AaveMarketsListProps {
|
|
497
|
-
/** Show APY metrics */
|
|
516
|
+
/** Show APY metrics @default true */
|
|
498
517
|
showApy?: boolean;
|
|
499
|
-
/** Show user's current position */
|
|
518
|
+
/** Show user's current position @default true */
|
|
500
519
|
showUserPosition?: boolean;
|
|
501
|
-
/** Show profit/loss summary */
|
|
520
|
+
/** Show profit/loss summary @default true */
|
|
502
521
|
showPnL?: boolean;
|
|
503
|
-
/** Show transaction history */
|
|
522
|
+
/** Show transaction history @default true */
|
|
504
523
|
showHistory?: boolean;
|
|
505
|
-
/** Enable search functionality */
|
|
524
|
+
/** Enable search functionality @default true */
|
|
506
525
|
showSearch?: boolean;
|
|
507
|
-
/** Filter by asset symbols */
|
|
526
|
+
/** Filter by asset symbols (e.g., ['USDC', 'ETH']) @default undefined (show all) */
|
|
508
527
|
assetFilter?: string[];
|
|
509
528
|
/** Callback when market is clicked */
|
|
510
529
|
onMarketSelect?: (market: AaveMarketData) => void;
|
|
@@ -547,14 +566,29 @@ declare function useAaveData(options?: UseAaveDataOptions): {
|
|
|
547
566
|
};
|
|
548
567
|
|
|
549
568
|
/**
|
|
550
|
-
* Props for EarnAccount -
|
|
551
|
-
*
|
|
569
|
+
* Props for EarnAccount - A banking-style USDC savings account widget.
|
|
570
|
+
*
|
|
571
|
+
* Sensible defaults are applied automatically:
|
|
572
|
+
* - Header with title and wallet status shown
|
|
573
|
+
* - Interest rate and earnings displayed
|
|
574
|
+
* - Fund from wallet button enabled
|
|
575
|
+
* - Full layout (not compact)
|
|
552
576
|
*/
|
|
553
577
|
interface EarnAccountProps {
|
|
554
|
-
/** Show
|
|
578
|
+
/** Show the header with title and wallet status @default true */
|
|
579
|
+
showHeader?: boolean;
|
|
580
|
+
/** Show the interest rate badge @default true */
|
|
581
|
+
showInterestRate?: boolean;
|
|
582
|
+
/** Show earnings/PnL display when available @default true */
|
|
555
583
|
showPnL?: boolean;
|
|
556
|
-
/** Show
|
|
557
|
-
|
|
584
|
+
/** Show the "Transfer from Wallet" button @default true */
|
|
585
|
+
showFundButton?: boolean;
|
|
586
|
+
/** Show the trust badge ("Secured & Insured") @default true */
|
|
587
|
+
showTrustBadge?: boolean;
|
|
588
|
+
/** Compact layout with reduced spacing @default false */
|
|
589
|
+
compact?: boolean;
|
|
590
|
+
/** Custom title for the header @default "Savings Account" */
|
|
591
|
+
title?: string;
|
|
558
592
|
/** Callback after successful supply */
|
|
559
593
|
onSupply?: (market: AaveMarketData, amount: string, txHash: string) => void;
|
|
560
594
|
/** Callback after successful withdraw */
|
|
@@ -564,7 +598,7 @@ interface EarnAccountProps {
|
|
|
564
598
|
/**
|
|
565
599
|
* EarnAccount widget - A beautiful banking-style USDC savings account.
|
|
566
600
|
*/
|
|
567
|
-
declare function EarnAccount({ showPnL,
|
|
601
|
+
declare function EarnAccount({ showHeader, showInterestRate, showPnL, showFundButton, showTrustBadge, compact, title, onSupply, onWithdraw, }: EarnAccountProps): react_jsx_runtime.JSX.Element;
|
|
568
602
|
|
|
569
603
|
type SortOption = 'fixed_apy' | 'tvl' | 'expiry';
|
|
570
604
|
interface PendleMarketData {
|
|
@@ -594,30 +628,39 @@ interface UserPendlePosition {
|
|
|
594
628
|
deposits?: TransactionEvent[];
|
|
595
629
|
withdrawals?: TransactionEvent[];
|
|
596
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Props for the PendleMarketsList widget.
|
|
633
|
+
*
|
|
634
|
+
* Sensible defaults are applied automatically:
|
|
635
|
+
* - All display options enabled (APY, TVL, expiry, positions, P&L, history)
|
|
636
|
+
* - Search and sorting enabled
|
|
637
|
+
* - Sorted by fixed APY (best yields first)
|
|
638
|
+
* - Shows only non-expired markets
|
|
639
|
+
*/
|
|
597
640
|
interface PendleMarketsListProps {
|
|
598
|
-
/** Show APY metrics */
|
|
641
|
+
/** Show APY metrics @default true */
|
|
599
642
|
showApy?: boolean;
|
|
600
|
-
/** Show total value locked */
|
|
643
|
+
/** Show total value locked @default true */
|
|
601
644
|
showTvl?: boolean;
|
|
602
|
-
/** Show expiry dates */
|
|
645
|
+
/** Show expiry dates @default true */
|
|
603
646
|
showExpiry?: boolean;
|
|
604
|
-
/** Show user's current position */
|
|
647
|
+
/** Show user's current position @default true */
|
|
605
648
|
showUserPosition?: boolean;
|
|
606
|
-
/** Show profit/loss summary */
|
|
649
|
+
/** Show profit/loss summary @default true */
|
|
607
650
|
showPnL?: boolean;
|
|
608
|
-
/** Show transaction history */
|
|
651
|
+
/** Show transaction history @default true */
|
|
609
652
|
showHistory?: boolean;
|
|
610
|
-
/** Enable search functionality */
|
|
653
|
+
/** Enable search functionality @default true */
|
|
611
654
|
showSearch?: boolean;
|
|
612
|
-
/** Enable sorting options */
|
|
655
|
+
/** Enable sorting options @default true */
|
|
613
656
|
showSort?: boolean;
|
|
614
|
-
/** Default sort option */
|
|
657
|
+
/** Default sort option @default 'fixed_apy' */
|
|
615
658
|
defaultSort?: SortOption;
|
|
616
|
-
/** Filter by asset symbols */
|
|
659
|
+
/** Filter by asset symbols (e.g., ['USDC', 'ETH']) @default undefined (show all) */
|
|
617
660
|
assetFilter?: string[];
|
|
618
|
-
/** Minimum TVL filter
|
|
661
|
+
/** Minimum TVL filter in USD @default undefined (no minimum) */
|
|
619
662
|
minTvl?: number;
|
|
620
|
-
/** Show TVL filter input */
|
|
663
|
+
/** Show TVL filter input @default true */
|
|
621
664
|
showTvlFilter?: boolean;
|
|
622
665
|
/** Callback when market is clicked */
|
|
623
666
|
onMarketSelect?: (market: PendleMarketData) => void;
|
|
@@ -671,14 +714,33 @@ interface SwapQuote {
|
|
|
671
714
|
outputAmount: string;
|
|
672
715
|
rate: string;
|
|
673
716
|
}
|
|
717
|
+
/** Default tokens available for swapping */
|
|
718
|
+
declare const DEFAULT_SWAP_TOKENS: readonly ["USDC", "ETH", "WETH", "WBTC", "DAI", "USDT", "AUSD", "SBC"];
|
|
719
|
+
/**
|
|
720
|
+
* Props for the SwapWidget.
|
|
721
|
+
*
|
|
722
|
+
* Sensible defaults are applied automatically:
|
|
723
|
+
* - Full layout for maximum usability
|
|
724
|
+
* - ETH → USDC as default pair (most common swap)
|
|
725
|
+
* - Reverse button enabled for easy direction switching
|
|
726
|
+
* - Popular DeFi tokens pre-configured
|
|
727
|
+
*/
|
|
674
728
|
interface SwapWidgetProps {
|
|
729
|
+
/** Widget layout size @default 'full' */
|
|
675
730
|
layout?: SwapLayout;
|
|
731
|
+
/** Initial "from" token @default 'ETH' */
|
|
676
732
|
defaultFromToken?: string;
|
|
733
|
+
/** Initial "to" token @default 'USDC' */
|
|
677
734
|
defaultToToken?: string;
|
|
735
|
+
/** Tokens available for selection @default ['USDC', 'ETH', 'WETH', 'WBTC', 'DAI', 'USDT', 'AUSD', 'SBC'] */
|
|
678
736
|
allowedTokens?: string[];
|
|
737
|
+
/** Show swap direction button @default true */
|
|
679
738
|
showReverseButton?: boolean;
|
|
739
|
+
/** Show settings panel @default false */
|
|
680
740
|
showSettings?: boolean;
|
|
741
|
+
/** Callback after successful swap */
|
|
681
742
|
onSwapSuccess?: (fromToken: string, toToken: string, fromAmount: string, toAmount: string, txHash: string) => void;
|
|
743
|
+
/** Callback on swap error */
|
|
682
744
|
onSwapError?: (error: Error) => void;
|
|
683
745
|
}
|
|
684
746
|
|
|
@@ -705,6 +767,14 @@ interface TabConfig {
|
|
|
705
767
|
label: string;
|
|
706
768
|
enabled: boolean;
|
|
707
769
|
}
|
|
770
|
+
/**
|
|
771
|
+
* Props for the CompassEarnWidget (unified tabbed experience).
|
|
772
|
+
*
|
|
773
|
+
* Sensible defaults are applied automatically:
|
|
774
|
+
* - Starts on Vaults tab (highest yield opportunities)
|
|
775
|
+
* - All tabs enabled (Vaults, Aave, Pendle, Swap)
|
|
776
|
+
* - Full-featured experience out of the box
|
|
777
|
+
*/
|
|
708
778
|
interface CompassEarnWidgetProps {
|
|
709
779
|
preset?: FeaturePreset;
|
|
710
780
|
enableVaults?: boolean;
|
|
@@ -751,7 +821,7 @@ interface ThemeProviderProps {
|
|
|
751
821
|
children: ReactNode;
|
|
752
822
|
theme?: ThemeInput;
|
|
753
823
|
}
|
|
754
|
-
declare function ThemeProvider({ children, theme:
|
|
824
|
+
declare function ThemeProvider({ children, theme: themeProp }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
755
825
|
declare function useTheme(): ThemeContextValue;
|
|
756
826
|
|
|
757
827
|
/**
|
|
@@ -962,4 +1032,4 @@ interface ChainConfig {
|
|
|
962
1032
|
}
|
|
963
1033
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
964
1034
|
|
|
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 };
|
|
1035
|
+
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, DEFAULT_SWAP_TOKENS, 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 };
|