Wallet

Wallet

Manages user's key pair.

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

accountId

Account ID.

Source:

email

Email used for login.

Source:

id

Wallet ID.

Source:

keypair

Get signing keypair.

Source:

secretSeed

Secret seed.

Source:

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.

Returns:
Type:
Wallet

The new wallet.

clone() → {Wallet}

Clone a wallet.

Source:
Returns:
Type:
Wallet

Cloned wallet.

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.