deriveAccount
Usage
import { deriveAccount, DerivationType } from '@stacks/wallet-sdk';
import { HDKey } from '@scure/bip32';
import { mnemonicToSeed } from '@scure/bip39';
const seed = await mnemonicToSeed('your 24-word seed phrase ...');
const rootNode = HDKey.fromMasterSeed(seed);
const account = deriveAccount({
rootNode,
index: 0,
salt: 'wallet-salt-hex-string',
stxDerivationType: DerivationType.Wallet,
});
console.log(account.stxPrivateKey); // hex private key for STX transactions
console.log(account.dataPrivateKey); // hex private key for Gaia/profiles
console.log(account.appsKey); // extended private key for app-specific keys
console.log(account.index); // 0Notes
Signature
Returns
Parameters
opts (required)
Property
Type
Description
Last updated
Was this helpful?