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.

ParameterDescription

networks: string[]

A list of all networks which this wallet provider allows access to

chainId: number

chainId the wallet is currently set 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);
});

最后更新于