[bug] disconnect function is documented but missing in AppKit actions
Link to minimal reproducible example
n/a
Summary
In the AppKit docs for vanilla JS installs, the disconnect function is documented among the modal Actions here: https://docs.reown.com/appkit/javascript/core/actions#disconnect
However, there is no such API in the code for the latest AppKit release (1.0.2). How do we disconnect connected wallets?
List of related npm package versions
"dependencies": {
"@coinbase/wallet-sdk": "^4.0.4",
"@reown/appkit": "^1.0.2",
"@reown/appkit-adapter-ethers": "^1.0.2",
"ethers": "^6.13.2"
}
same issue here
Found hook in their repo:
You can paste this hook to your project and then you can use this hook as it supposed to by docs.
// contexts/web3modal.tsx
import { EthersAdapter } from "@reown/appkit-adapter-ethers";
export const ethersAdapter = new EthersAdapter();
// rest of your code...
// useDisconnect.tsx
import { ethersAdapter } from "@/contexts/web3Modal";
export function useDisconnect() {
async function disconnect() {
await ethersAdapter.disconnect();
}
return {
disconnect,
};
}
ps: probably this requires additional tests but works fine for me so far
Gtk, but Vue and .tsx are not vanilla JS ๐ . I am using SvelteKit more precisely
Gtk, but Vue and .tsx are not vanilla JS ๐ . I am using SvelteKit more precisely
Oops, maybe I commented in the wrong thread๐ฌ๐
Found hook in their repo:
### You can paste this hook to your project and then you can use this hook as it supposed to by docs. ``` // contexts/web3modal.tsx import { EthersAdapter } from "@reown/appkit-adapter-ethers";
export const ethersAdapter = new EthersAdapter(); // rest of your code...
// useDisconnect.tsx import { ethersAdapter } from "@/contexts/web3Modal";
export function useDisconnect() { async function disconnect() { await ethersAdapter.disconnect(); }
return { disconnect, }; }
ps: probably this requires additional tests but works fine for me so far
Thanks mate, this works!
any update for this issue?
web3Modal.adapter?.connectionControllerClient?.disconnect() is not working in vanilla js.
web3Modal.adpater is still undefined after walletconnect connected.
now is exposed :)
### You can paste this hook to your project and then you can use this hook as it supposed to by docs.
```
// contexts/web3modal.tsx
import { EthersAdapter } from "@reown/appkit-adapter-ethers";