Events

All providers implements the EventEmitter API. This sections details the events emitted via that API. All the common Event which may take place in the zkID Login are listed as follow.

These events are triggered when the internal state of the zkID Wallet changes.

zkID_Wallet_didLoggedChanged(did_changed)

Usage

  • When the DID selected in the zkID Wallet is changed, this event will be emitted.

You can use provider.on to catch this event. Here is an example of using our Provider to listen to this event.

Example

provider.on('did_changed', (did) => {
  // Handle the new did when wallet selected did changed
  // `did` is an Object of `DidInfo`
})

zkID_Wallet_lock(lock)

Usage

  • When the zkID Wallet is locked, this event will be emitted.

You can use provider.on to catch this event. Here is an example of using our Provider to listen to this event.

Example

provider.on('lock', (did) => {
  // Handle the wallet locked
})

zkID_Wallet_unlock(unlock)

Usage

  • When the zkID Wallet is unlocked, this event will be emitted.

You can use provider.on to catch this event. Here is an example of using our Provider to listen to this event.

Example

provider.on('unlock', (did) => {
  // Handle the wallet unlock
})

Last updated