disconnectWalletClient / disconnectSigner
The disconnectWalletClient / disconnectSigner method disconnects the currently connected wallet client from the Symphony instance.
Signature
disconnectWalletClient(): void // For viem
disconnectSigner(): void // For ethers/ethersV5TypeScript Types
// Import for viem
import { Symphony } from 'symphony-sdk/viem';
// Import for ethersV5
import { Symphony } from 'symphony-sdk/ethersV5';
// Import for ethers v6
import { Symphony } from 'symphony-sdk/ethers';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
connectWalletClientor you can connect when initializing Symphony. - This method is useful for implementing "disconnect wallet" functionality in your dApp

