Events
Device events
Once the user opens the popup page and grants permission for the hosting page to communicate with his Trezor device. TrezorConnect API will emit events related to this device.
ES6
import TrezorConnect, { DEVICE_EVENT, DEVICE } from '@trezor/connect';
TrezorConnect.on(DEVICE_EVENT, event => {
if (event.type === DEVICE.CONNECT) {
} else if (event.type === DEVICE.DISCONNECT) {
}
});
List of published events
There are more types of events. Apart from device events you may also decide to consume blockchain data available through BLOCKCHAIN_EVENT events.