Wallet
Usage
import { generateWallet, generateNewAccount, Wallet } from '@stacks/wallet-sdk';
const wallet: Wallet = await generateWallet({
secretKey: 'your 24-word seed phrase ...',
password: 'password',
});
console.log(wallet.encryptedSecretKey); // hex-encoded encrypted mnemonic
console.log(wallet.rootKey); // xprv... root extended private key
console.log(wallet.configPrivateKey); // hex key for encrypting config data
console.log(wallet.salt); // hex salt for app-specific key derivation
console.log(wallet.accounts.length); // 1
// Add more accounts
const updatedWallet = generateNewAccount(wallet);
console.log(updatedWallet.accounts.length); // 2Definition
Properties
Property
Type
Description
Property
Type
Description
Last updated
Was this helpful?