Class: Wallet

fabric-network. Wallet

Stores identity information for use when connecting a Gateway. The wallet is backed by a store that handles persistence of identity information. Default implementations using various stores can be obtained using static factory functions on Wallets.

new Wallet(store)

Create a wallet instance backed by a given store. This can be used to create a wallet using your own custom store implementation.
Parameters:
Name Type Description
store module:fabric-network.WalletStore Backing store implementation.

Methods


<async> get(label)

Get an identity from the wallet. The actual properties of this identity object will vary depending on its type.
Parameters:
Name Type Description
label Label used to identify the identity within the wallet.
Returns:
An identity if it exists; otherwise undefined.
Type
Promise.<(module:fabric-network.Identity|undefined)>

getProviderRegistry()

Get the identity provider registry for this wallet. All identity types stored in the wallet must have a corresponding provider in the registry.
Returns:
An identity provider registry.
Type
module:fabric-network.IdentityProviderRegistry

<async> list()

Get the labels of all identities in the wallet.
Returns:
Identity labels.
Type
Promise.<Array.<string>>

<async> put(label, identity)

Put an identity in the wallet.
Parameters:
Name Type Description
label string Label used to identify the identity within the wallet.
identity module:fabric-network.Identity Identity to store in the wallet.
Returns:
Type
Promise.<void>

<async> remove(label)

Remove an identity from the wallet.
Parameters:
Name Type Description
label Label used to identify the identity within the wallet.
Returns:
Type
Promise.<void>