-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededinvalidThis doesn't seem rightThis doesn't seem rightquestionFurther information is requestedFurther information is requestedwontfixThis will not be worked onThis will not be worked on
Description
// Get current chain ID
async function getCurrentChain() {
try {
const chainId = await ethereum.request({
method: "eth_chainId"
});
console.log("Current chain ID:", chainId);
return chainId;
} catch (err) {
console.error("Error getting chain:", err);
}
}
// Listen for network changes
ethereum.on("chainChanged", (chainId) => {
console.log("Network changed to:", chainId);
// We recommend reloading the page
window.location.reload();
});
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededinvalidThis doesn't seem rightThis doesn't seem rightquestionFurther information is requestedFurther information is requestedwontfixThis will not be worked onThis will not be worked on