disconnectWalletClient / disconnectSigner
The disconnectWalletClient / disconnectSigner
method disconnects the currently connected wallet client from the Symphony instance.
Signature
disconnectWalletClient(): void
disconnectSigner(): void
Example
Viem
const symphony = new Symphony();
// First connect a wallet client
symphony.connectWalletClient(walletClient);
// Later, disconnect it
symphony.disconnectWalletClient();
// After disconnecting, operations requiring signing will fail
const route = await symphony.getRoute(tokenIn, tokenOut, "1.0");
await route.swap(); // This will fail - no wallet client connected
Notes
- After disconnecting, any operation that requires signing (swaps, approvals) will fail
- You can reconnect a wallet client at any time using
connectWalletClient
or you can connect when initializing Symphony. - This method is useful for implementing "disconnect wallet" functionality in your dApp