Select and Manage Wallet Identities

Different wallet types are, in essence, objects of the Wallet class backed by a proper implementation of WalletStore. Therefore, all wallet types can be managed using the same set of APIs. It means that applications can be made independent of the underlying wallet storage mechanism.

Therefore, applications can take advantage of the simple life-cycle API provided by the Wallet class when interacting with different specific wallet implementations. Wallets can be opened or created, and subsequently identities can be added, read, updated, and deleted. The Wallet class provides a set of functions to cover this lifecycle.

  1. put(label, identity) puts an identity to the wallet. The identity can be accessed further using the associated label. If the label exists already, the put function updates the identity.

  2. get(label) returns an identity object associated with the label if it exists and undefined otherwise.

  3. remove(label) removes an identity associated with the label from the wallet.

  4. list() returns a list of all the identities stored in the wallet.

Last updated

Was this helpful?