Constructor
new DockWallet()
Creates a new unlocked wallet instance with empty contents
- Source:
Members
(static) Locked
Locked wallet status constant
- Source:
(static) Unlocked
Unlocked wallet status constant
- Source:
Methods
add(content) → {DockWallet}
Adds a content item to the wallet
The wallet must be unlocked to make this call
Parameters:
Name | Type | Description |
---|---|---|
content |
any | Content item |
- Source:
Returns:
Returns itself
- Type
- DockWallet
(async) export(password, issuanceDateopt) → {Promise.<DockWallet>}
Exports the wallet to an encrypted wallet credential JSON-LD object
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
password |
string | Wallet password | |
issuanceDate |
Date |
<optional> |
Optional credential issuance date |
- Source:
Returns:
Returns itself
- Type
- Promise.<DockWallet>
has(contentId) → {Boolean}
Checks if a wallet has content with specific ID
The wallet must be unlocked to make this call
Parameters:
Name | Type | Description |
---|---|---|
contentId |
string | Content item ID |
- Source:
Returns:
Whether the wallet has this content
- Type
- Boolean
(async) import(encryptedWalletCredential, password) → {Promise.<DockWallet>}
Imports an encrypted wallet with a given password
Parameters:
Name | Type | Description |
---|---|---|
encryptedWalletCredential |
object | A encrypted wallet credential JSON-LD object |
password |
string | Wallet password |
- Source:
Returns:
Returns itself
- Type
- Promise.<DockWallet>
(async) lock(password) → {Promise.<DockWallet>}
Locks the wallet with a given password
Parameters:
Name | Type | Description |
---|---|---|
password |
string | Wallet password |
- Source:
Returns:
Returns itself
- Type
- Promise.<DockWallet>
(async) query(search) → {array.<any>}
Takes a Query and Type as input, and returns a collection of results based on current wallet contents.
A custom wallet implementation could override this method to support more querying types
Parameters:
Name | Type | Description |
---|---|---|
search |
object | Search query object |
- Source:
Returns:
List of contents results
- Type
- array.<any>
remove(contentId) → {DockWallet}
Removes a content item from the wallet
The wallet must be unlocked to make this call
Parameters:
Name | Type | Description |
---|---|---|
contentId |
string | Content item ID |
- Source:
Returns:
Returns itself
- Type
- DockWallet
toJSON() → {object}
Returns this wallet instance formatted as an unlocked universal wallet
The wallet must be unlocked to make this call
- Source:
Returns:
An unlocked wallet JSON-LD representation
- Type
- object
(async) unlock(password) → {Promise.<DockWallet>}
Unlocks the wallet with a given password
Parameters:
Name | Type | Description |
---|---|---|
password |
string | Wallet password |
- Source:
Returns:
Returns itself
- Type
- Promise.<DockWallet>