@compass-labs/widgets 0.1.47 → 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/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/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12586,6 +12586,41 @@ function CompassEarnWidget({
|
|
|
12586
12586
|
] })
|
|
12587
12587
|
] });
|
|
12588
12588
|
}
|
|
12589
|
+
var BALANCE_QUERY_KEYS = [
|
|
12590
|
+
["earnAccountBalances"],
|
|
12591
|
+
["eoaBalances"],
|
|
12592
|
+
["walletBalance"],
|
|
12593
|
+
["walletTokenBalance"],
|
|
12594
|
+
["creditBalances"],
|
|
12595
|
+
["earnAccountTokenBalance"],
|
|
12596
|
+
["embeddedWalletBalance"]
|
|
12597
|
+
];
|
|
12598
|
+
var POSITION_QUERY_KEYS = [
|
|
12599
|
+
["allEarnPositions"],
|
|
12600
|
+
["earnAccountAllPositions"],
|
|
12601
|
+
["creditPositions"],
|
|
12602
|
+
["rebalancing"]
|
|
12603
|
+
];
|
|
12604
|
+
var ALL_QUERY_KEYS = [...BALANCE_QUERY_KEYS, ...POSITION_QUERY_KEYS];
|
|
12605
|
+
function useRefreshBalances() {
|
|
12606
|
+
const queryClient = useQueryClient();
|
|
12607
|
+
const refreshBalances = useCallback(() => {
|
|
12608
|
+
for (const key of BALANCE_QUERY_KEYS) {
|
|
12609
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
12610
|
+
}
|
|
12611
|
+
}, [queryClient]);
|
|
12612
|
+
const refreshPositions = useCallback(() => {
|
|
12613
|
+
for (const key of POSITION_QUERY_KEYS) {
|
|
12614
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
12615
|
+
}
|
|
12616
|
+
}, [queryClient]);
|
|
12617
|
+
const refreshAll = useCallback(() => {
|
|
12618
|
+
for (const key of ALL_QUERY_KEYS) {
|
|
12619
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
12620
|
+
}
|
|
12621
|
+
}, [queryClient]);
|
|
12622
|
+
return { refreshBalances, refreshPositions, refreshAll };
|
|
12623
|
+
}
|
|
12589
12624
|
var CHAINS = {
|
|
12590
12625
|
ethereum: {
|
|
12591
12626
|
id: "ethereum",
|
|
@@ -12607,6 +12642,6 @@ var CHAINS = {
|
|
|
12607
12642
|
}
|
|
12608
12643
|
};
|
|
12609
12644
|
|
|
12610
|
-
export { AccountBalancesModal, ActionModal, ApiProvider, CHAINS, ChainSwitcher, CompassEarnWidget, CompassProvider, CopyableAddress, CreditAccount, CreditAccountGuard, DepositWithdrawForm, EarnAccount, EarnAccountBalance, EarnAccountGuard, PnLSummary, RebalancingWidget, SwapForm, ThemeProvider, TransactionHistory, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useSwapQuote, useTheme };
|
|
12645
|
+
export { AccountBalancesModal, ActionModal, ApiProvider, CHAINS, ChainSwitcher, CompassEarnWidget, CompassProvider, CopyableAddress, CreditAccount, CreditAccountGuard, DepositWithdrawForm, EarnAccount, EarnAccountBalance, EarnAccountGuard, PnLSummary, RebalancingWidget, SwapForm, ThemeProvider, TransactionHistory, WalletStatus, themePresets, useChain, useCompassApi, useCompassChain, useCompassWallet, useCreditAccount, useEarnAccount, useEmbeddableApi, useEmbeddableWallet, useRebalancingData, useRefreshBalances, useSwapQuote, useTheme };
|
|
12611
12646
|
//# sourceMappingURL=index.mjs.map
|
|
12612
12647
|
//# sourceMappingURL=index.mjs.map
|