@compass-labs/widgets 0.1.46 → 0.1.48
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/{compass-service-D0Xf69NR.d.ts → compass-service-BzYob9QR.d.ts} +1 -2
- package/dist/{compass-service-B0UscWqQ.d.mts → compass-service-Dz4PTtzj.d.mts} +1 -2
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -1
- package/dist/index.mjs.map +1 -1
- package/dist/server/core/index.d.mts +1 -1
- package/dist/server/core/index.d.ts +1 -1
- package/dist/server/core/index.js +7 -8
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/core/index.mjs +7 -8
- package/dist/server/core/index.mjs.map +1 -1
- package/dist/server/index.js +7 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +7 -8
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/nestjs/index.d.mts +1 -1
- package/dist/server/nestjs/index.d.ts +1 -1
- package/dist/server/nestjs/index.js +7 -8
- package/dist/server/nestjs/index.js.map +1 -1
- package/dist/server/nestjs/index.mjs +7 -8
- package/dist/server/nestjs/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -52,7 +52,6 @@ declare class CompassCoreService {
|
|
|
52
52
|
vaultAddress?: string;
|
|
53
53
|
marketAddress?: string;
|
|
54
54
|
maxSlippagePercent?: number;
|
|
55
|
-
recipient?: string;
|
|
56
55
|
}, action: 'DEPOSIT' | 'WITHDRAW'): Promise<{
|
|
57
56
|
eip712: any;
|
|
58
57
|
normalizedTypes: {
|
|
@@ -110,6 +109,7 @@ declare class CompassCoreService {
|
|
|
110
109
|
amount: string;
|
|
111
110
|
action: 'DEPOSIT' | 'WITHDRAW';
|
|
112
111
|
product?: 'earn' | 'credit';
|
|
112
|
+
recipient?: string;
|
|
113
113
|
}): Promise<{
|
|
114
114
|
eip712: any;
|
|
115
115
|
normalizedTypes: Record<string, any>;
|
|
@@ -193,7 +193,6 @@ declare class CompassCoreService {
|
|
|
193
193
|
actionType: string;
|
|
194
194
|
[key: string]: any;
|
|
195
195
|
}>;
|
|
196
|
-
recipient?: string;
|
|
197
196
|
}): Promise<{
|
|
198
197
|
eip712: any;
|
|
199
198
|
normalizedTypes: {
|
|
@@ -52,7 +52,6 @@ declare class CompassCoreService {
|
|
|
52
52
|
vaultAddress?: string;
|
|
53
53
|
marketAddress?: string;
|
|
54
54
|
maxSlippagePercent?: number;
|
|
55
|
-
recipient?: string;
|
|
56
55
|
}, action: 'DEPOSIT' | 'WITHDRAW'): Promise<{
|
|
57
56
|
eip712: any;
|
|
58
57
|
normalizedTypes: {
|
|
@@ -110,6 +109,7 @@ declare class CompassCoreService {
|
|
|
110
109
|
amount: string;
|
|
111
110
|
action: 'DEPOSIT' | 'WITHDRAW';
|
|
112
111
|
product?: 'earn' | 'credit';
|
|
112
|
+
recipient?: string;
|
|
113
113
|
}): Promise<{
|
|
114
114
|
eip712: any;
|
|
115
115
|
normalizedTypes: Record<string, any>;
|
|
@@ -193,7 +193,6 @@ declare class CompassCoreService {
|
|
|
193
193
|
actionType: string;
|
|
194
194
|
[key: string]: any;
|
|
195
195
|
}>;
|
|
196
|
-
recipient?: string;
|
|
197
196
|
}): Promise<{
|
|
198
197
|
eip712: any;
|
|
199
198
|
normalizedTypes: {
|
package/dist/index.d.mts
CHANGED
|
@@ -658,6 +658,12 @@ declare function useSwapQuote({ fromToken, toToken, amount, enabled }: UseSwapQu
|
|
|
658
658
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<SwapQuote | null, Error>>;
|
|
659
659
|
};
|
|
660
660
|
|
|
661
|
+
declare function useRefreshBalances(): {
|
|
662
|
+
refreshBalances: () => void;
|
|
663
|
+
refreshPositions: () => void;
|
|
664
|
+
refreshAll: () => void;
|
|
665
|
+
};
|
|
666
|
+
|
|
661
667
|
/**
|
|
662
668
|
* Theme Presets for Compass Embeddable Widgets
|
|
663
669
|
*
|
|
@@ -1014,4 +1020,4 @@ interface ChainConfig {
|
|
|
1014
1020
|
}
|
|
1015
1021
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
1016
1022
|
|
|
1017
|
-
export { AccountBalancesModal, type AccountBalancesModalProps, type AccountSummary, ActionModal, ApiProvider, CHAINS, type ChainConfig, ChainSwitcher, type CollateralPosition, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, CopyableAddress, type CopyableAddressProps, CreditAccount, type CreditAccountContextValue, CreditAccountGuard, type CreditAccountProps, type CreditPositionsResponse, type TokenBalance as CreditTokenBalance, type DebtPosition, DepositWithdrawForm, EarnAccount, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type EarnAccountProps, type FeaturePreset, type FundWalletParams, type IdleBalance, PnLSummary, type PortfolioPosition, type PortfolioState, type RebalanceAction, type RebalanceActionType, type RebalancePlan, RebalancingWidget, type RebalancingWidgetProps, type SendTransactionParams, type SupportedChain, type SupportedChainId, SwapForm, type SwapFormProps, type SwapQuote, type TabConfig, type TabId, type TargetAllocation, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance$1 as TokenBalance, TransactionHistory, type TypedDataToSign, type VenueType$1 as VenueType, type WalletAdapter, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useSwapQuote, useTheme };
|
|
1023
|
+
export { AccountBalancesModal, type AccountBalancesModalProps, type AccountSummary, ActionModal, ApiProvider, CHAINS, type ChainConfig, ChainSwitcher, type CollateralPosition, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, CopyableAddress, type CopyableAddressProps, CreditAccount, type CreditAccountContextValue, CreditAccountGuard, type CreditAccountProps, type CreditPositionsResponse, type TokenBalance as CreditTokenBalance, type DebtPosition, DepositWithdrawForm, EarnAccount, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type EarnAccountProps, type FeaturePreset, type FundWalletParams, type IdleBalance, PnLSummary, type PortfolioPosition, type PortfolioState, type RebalanceAction, type RebalanceActionType, type RebalancePlan, RebalancingWidget, type RebalancingWidgetProps, type SendTransactionParams, type SupportedChain, type SupportedChainId, SwapForm, type SwapFormProps, type SwapQuote, type TabConfig, type TabId, type TargetAllocation, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance$1 as TokenBalance, TransactionHistory, type TypedDataToSign, type VenueType$1 as VenueType, type WalletAdapter, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useRefreshBalances, useSwapQuote, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -658,6 +658,12 @@ declare function useSwapQuote({ fromToken, toToken, amount, enabled }: UseSwapQu
|
|
|
658
658
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<SwapQuote | null, Error>>;
|
|
659
659
|
};
|
|
660
660
|
|
|
661
|
+
declare function useRefreshBalances(): {
|
|
662
|
+
refreshBalances: () => void;
|
|
663
|
+
refreshPositions: () => void;
|
|
664
|
+
refreshAll: () => void;
|
|
665
|
+
};
|
|
666
|
+
|
|
661
667
|
/**
|
|
662
668
|
* Theme Presets for Compass Embeddable Widgets
|
|
663
669
|
*
|
|
@@ -1014,4 +1020,4 @@ interface ChainConfig {
|
|
|
1014
1020
|
}
|
|
1015
1021
|
declare const CHAINS: Record<SupportedChainId, ChainConfig>;
|
|
1016
1022
|
|
|
1017
|
-
export { AccountBalancesModal, type AccountBalancesModalProps, type AccountSummary, ActionModal, ApiProvider, CHAINS, type ChainConfig, ChainSwitcher, type CollateralPosition, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, CopyableAddress, type CopyableAddressProps, CreditAccount, type CreditAccountContextValue, CreditAccountGuard, type CreditAccountProps, type CreditPositionsResponse, type TokenBalance as CreditTokenBalance, type DebtPosition, DepositWithdrawForm, EarnAccount, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type EarnAccountProps, type FeaturePreset, type FundWalletParams, type IdleBalance, PnLSummary, type PortfolioPosition, type PortfolioState, type RebalanceAction, type RebalanceActionType, type RebalancePlan, RebalancingWidget, type RebalancingWidgetProps, type SendTransactionParams, type SupportedChain, type SupportedChainId, SwapForm, type SwapFormProps, type SwapQuote, type TabConfig, type TabId, type TargetAllocation, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance$1 as TokenBalance, TransactionHistory, type TypedDataToSign, type VenueType$1 as VenueType, type WalletAdapter, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useSwapQuote, useTheme };
|
|
1023
|
+
export { AccountBalancesModal, type AccountBalancesModalProps, type AccountSummary, ActionModal, ApiProvider, CHAINS, type ChainConfig, ChainSwitcher, type CollateralPosition, CompassEarnWidget, type CompassEarnWidgetProps, CompassProvider, type CompassProviderProps, type CompassTheme, CopyableAddress, type CopyableAddressProps, CreditAccount, type CreditAccountContextValue, CreditAccountGuard, type CreditAccountProps, type CreditPositionsResponse, type TokenBalance as CreditTokenBalance, type DebtPosition, DepositWithdrawForm, EarnAccount, EarnAccountBalance, type EarnAccountBalanceProps, type EarnAccountContextValue, EarnAccountGuard, type EarnAccountProps, type FeaturePreset, type FundWalletParams, type IdleBalance, PnLSummary, type PortfolioPosition, type PortfolioState, type RebalanceAction, type RebalanceActionType, type RebalancePlan, RebalancingWidget, type RebalancingWidgetProps, type SendTransactionParams, type SupportedChain, type SupportedChainId, SwapForm, type SwapFormProps, type SwapQuote, type TabConfig, type TabId, type TargetAllocation, type ThemeInput, type ThemeMode, type ThemePresetName, ThemeProvider, type TokenBalance$1 as TokenBalance, TransactionHistory, type TypedDataToSign, type VenueType$1 as VenueType, type WalletAdapter, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useRefreshBalances, useSwapQuote, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -12588,6 +12588,41 @@ function CompassEarnWidget({
|
|
|
12588
12588
|
] })
|
|
12589
12589
|
] });
|
|
12590
12590
|
}
|
|
12591
|
+
var BALANCE_QUERY_KEYS = [
|
|
12592
|
+
["earnAccountBalances"],
|
|
12593
|
+
["eoaBalances"],
|
|
12594
|
+
["walletBalance"],
|
|
12595
|
+
["walletTokenBalance"],
|
|
12596
|
+
["creditBalances"],
|
|
12597
|
+
["earnAccountTokenBalance"],
|
|
12598
|
+
["embeddedWalletBalance"]
|
|
12599
|
+
];
|
|
12600
|
+
var POSITION_QUERY_KEYS = [
|
|
12601
|
+
["allEarnPositions"],
|
|
12602
|
+
["earnAccountAllPositions"],
|
|
12603
|
+
["creditPositions"],
|
|
12604
|
+
["rebalancing"]
|
|
12605
|
+
];
|
|
12606
|
+
var ALL_QUERY_KEYS = [...BALANCE_QUERY_KEYS, ...POSITION_QUERY_KEYS];
|
|
12607
|
+
function useRefreshBalances() {
|
|
12608
|
+
const queryClient = reactQuery.useQueryClient();
|
|
12609
|
+
const refreshBalances = react.useCallback(() => {
|
|
12610
|
+
for (const key of BALANCE_QUERY_KEYS) {
|
|
12611
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
12612
|
+
}
|
|
12613
|
+
}, [queryClient]);
|
|
12614
|
+
const refreshPositions = react.useCallback(() => {
|
|
12615
|
+
for (const key of POSITION_QUERY_KEYS) {
|
|
12616
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
12617
|
+
}
|
|
12618
|
+
}, [queryClient]);
|
|
12619
|
+
const refreshAll = react.useCallback(() => {
|
|
12620
|
+
for (const key of ALL_QUERY_KEYS) {
|
|
12621
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
12622
|
+
}
|
|
12623
|
+
}, [queryClient]);
|
|
12624
|
+
return { refreshBalances, refreshPositions, refreshAll };
|
|
12625
|
+
}
|
|
12591
12626
|
var CHAINS = {
|
|
12592
12627
|
ethereum: {
|
|
12593
12628
|
id: "ethereum",
|
|
@@ -12639,6 +12674,7 @@ exports.useEarnAccount = useEarnAccount;
|
|
|
12639
12674
|
exports.useEmbeddableApi = useEmbeddableApi;
|
|
12640
12675
|
exports.useEmbeddableWallet = useEmbeddableWallet;
|
|
12641
12676
|
exports.useRebalancingData = useRebalancingData;
|
|
12677
|
+
exports.useRefreshBalances = useRefreshBalances;
|
|
12642
12678
|
exports.useSwapQuote = useSwapQuote;
|
|
12643
12679
|
exports.useTheme = useTheme;
|
|
12644
12680
|
//# sourceMappingURL=index.js.map
|