Constructor
new Wallet(keypair, accountId, walletIdopt)
Create a new instance from user's key pair.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
keypair |
Keypair
|
string
|
User's key pair or a secret seed. |
|
accountId |
string
|
User's account ID. |
|
walletId |
string
|
<optional> |
Wallet ID. |
Members
Methods
(static) deriveId(password, kdfParams, salt) → {string}
Derive the wallet ID.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
password |
string
|
|
kdfParams |
object
|
|
salt |
string
|
Returns:
- Type:
-
string
Wallet ID.
(static) fromEncrypted(keychainData, kdfParams, salt, password)
Decrypt a wallet obtained from a wallet server.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
keychainData |
object
|
Encrypted wallet seed. |
kdfParams |
object
|
Scrypt params used for encryption. |
salt |
string
|
Salt used for encryption. |
password |
string
|
User's password. |
(static) generate(accountIdopt) → {Wallet}
Generate a new wallet.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
accountId |
string
|
<optional> |
null |
User's account ID. |
encrypt(kdfParams, password) → {object}
Encrypt wallet to securely store it.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
kdfParams |
object
|
Scrypt params. |
password |
string
|
User's password. |
Returns:
- Type:
-
object
Encrypted keychain and metadata.