Open majinbot opened 1 month ago
same issue here
// 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!
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