Detect a Network Change
The web application must keep track of which network Adena is connected to at all times, as Adena submits all requests to the current network. Adena provides a function to detect a change when a user tweaks the network settings in Adena.
Code
adena.On("changedNetwork", (network: string) => void);
Params
Key
Type
Description
key
'changedNetwork'
The event key of 'changedNetwork'
function
(network: string) => void
The function that gets triggered by the event
Sample Request
//this will emit a network change when the user changes the network settings on Adena
adena.On("changedNetwork", (network) => {
console.log("changed network is " + network)
});
Networks (chainID)
ID
Network
test3
Gnoland Network (Testnet 3)
test2
Gnoland Network (Testnet 2)
dev
Gnoland Network (Local)
Last updated