NETWORK_CHANGED
On a NETWORK_CHANGED event, the user has changed the network their provider wallet is connected to. The event will return the updated network details.
Parameter
Description
networks: string[]
A list of all networks which this wallet provider allows access to
defaultNetwork: string
Network the wallet is currently set to
Example
neoline.addEventListener(neoline.EVENT.NETWORK_CHANGED, (result) => {
console.log('network:', result);
});
/* Another */
window.addEventListener('NEOLine.NEO.EVENT.NETWORK_CHANGED', (result) => {
console.log('network:', result.detail);
});
最后更新于
这有帮助吗?