@@ -17,6 +17,7 @@ import { type Network } from '@rango-dev/wallets-shared';
1717import { isEvmBlockchain } from 'rango-sdk' ;
1818
1919import { useAppStore } from '../../store/AppStore' ;
20+ import { useQuoteStore } from '../../store/quote' ;
2021import {
2122 prepareAccountsForWalletStore ,
2223 walletAndSupportedChainsNames ,
@@ -43,6 +44,7 @@ export function useUpdates(params: UseUpdatesParams): UseUpdates {
4344 removeBalancesForWallet,
4445 blockchains,
4546 } = useAppStore ( ) ;
47+ const quoteStore = useQuoteStore ( ) ( ) ;
4648
4749 const { onConnectWalletHandler, onDisconnectWalletHandler } = params ;
4850 const evmBasedChainNames = blockchains ( )
@@ -77,7 +79,12 @@ export function useUpdates(params: UseUpdatesParams): UseUpdates {
7779 ) ;
7880
7981 if ( data . length ) {
80- void newWalletConnected ( data , info . namespace , state . derivationPath ) ;
82+ void newWalletConnected (
83+ quoteStore ,
84+ data ,
85+ info . namespace ,
86+ state . derivationPath
87+ ) ;
8188 }
8289 } ;
8390
@@ -101,7 +108,7 @@ export function useUpdates(params: UseUpdatesParams): UseUpdates {
101108 }
102109
103110 if ( event === Events . PROVIDER_DISCONNECTED ) {
104- disconnectWallet ( type ) ;
111+ disconnectWallet ( type , quoteStore ) ;
105112 if ( ! ! onDisconnectWalletHandler . current ) {
106113 onDisconnectWalletHandler . current ( type ) ;
107114 } else {
@@ -112,7 +119,7 @@ export function useUpdates(params: UseUpdatesParams): UseUpdates {
112119 }
113120
114121 if ( event === Events . NAMESPACE_DISCONNECTED ) {
115- disconnectNamespaces ( type , value ) ;
122+ disconnectNamespaces ( type , value , quoteStore ) ;
116123 }
117124 } ;
118125
@@ -186,7 +193,7 @@ export function useUpdates(params: UseUpdatesParams): UseUpdates {
186193 supportedChainNames,
187194 } ) ;
188195 } else {
189- disconnectWallet ( type ) ;
196+ disconnectWallet ( type , quoteStore ) ;
190197 if ( ! ! onDisconnectWalletHandler . current ) {
191198 onDisconnectWalletHandler . current ( type ) ;
192199 } else {
0 commit comments