@@ -11,7 +11,9 @@ import {
1111 getChainConfigByChainId ,
1212} from './toolcalls/evmTools' ;
1313
14- const walletContextMessage = async ( walletInfo : WalletInfo ) : Promise < ChatMessage > => {
14+ const walletContextMessage = async (
15+ walletInfo : WalletInfo ,
16+ ) : Promise < ChatMessage > => {
1517 if ( ! walletInfo . isConnected ) {
1618 return {
1719 role : 'system' ,
@@ -64,7 +66,7 @@ const walletConnectionChangedMessage = async (
6466 return `**The connected network has changed.**` ;
6567 }
6668 } ) ( ) ;
67-
69+
6870 const contextMessage = await walletContextMessage ( walletInfo ) ;
6971 return `${ message } Keep previous connection information in context, but recognize that it is not current.
7072
@@ -144,15 +146,21 @@ export const useChatWithWallet = ({
144146 '**Wallet has been disconnected.** All previous wallet information is no longer valid.' ,
145147 ) ;
146148 setWalletInfo ( null ) ;
147- await deregisterEvmToolsFromRegistry ( toolCallRegistry , walletInfo . chainId ) ;
149+ await deregisterEvmToolsFromRegistry (
150+ toolCallRegistry ,
151+ walletInfo . chainId ,
152+ ) ;
148153 } ,
149154
150155 // on change of connected wallet:
151156 // * notify of connected wallet changed in context of existing/new chats
152157 // * deregister tool calls for the old chain
153158 // * register tool calls for the new connected chain
154159 onWalletChange : async ( prevInfo , walletInfo ) => {
155- const content = await walletConnectionChangedMessage ( prevInfo , walletInfo ) ;
160+ const content = await walletConnectionChangedMessage (
161+ prevInfo ,
162+ walletInfo ,
163+ ) ;
156164 addPendingSystemMessage ( content ) ;
157165 const contextMsg = await walletContextMessage ( walletInfo ) ;
158166 setCurrentInitialMessages ( [ contextMsg ] ) ;
0 commit comments