diff --git a/src/helpers/utils.js b/src/helpers/utils.js index ea739ca..69d97ae 100644 --- a/src/helpers/utils.js +++ b/src/helpers/utils.js @@ -59,7 +59,7 @@ export async function deriveWalletData( addressIndex = 0, use = DashHd.RECEIVE ) { - let recoveryPhrase, seed, wallet, wpub, id, account + let recoveryPhrase, seed, derivedWallet, wpub, id, account let xkey, xprv, xpub, xkeyId let addressKey, addressKeyId, address let targetBitEntropy = 128; @@ -82,10 +82,10 @@ export async function deriveWalletData( xkey = await DashHd.fromXKey(phraseOrXkey); } else { seed = await DashPhrase.toSeed(recoveryPhrase, secretSalt); - wallet = await DashHd.fromSeed(seed); - wpub = await DashHd.toXPub(wallet); - id = await DashHd.toId(wallet); - account = await wallet.deriveAccount(accountIndex); + derivedWallet = await DashHd.fromSeed(seed); + wpub = await DashHd.toXPub(derivedWallet); + id = await DashHd.toId(derivedWallet); + account = await derivedWallet.deriveAccount(accountIndex); xkey = await account.deriveXKey(use); xprv = await DashHd.toXPrv(xkey); } @@ -106,8 +106,8 @@ export async function deriveWalletData( xpub, seed, wpub, - wallet, account, + derivedWallet, recoveryPhrase, } } diff --git a/src/helpers/wallet.js b/src/helpers/wallet.js index 05d34dd..bfebae0 100644 --- a/src/helpers/wallet.js +++ b/src/helpers/wallet.js @@ -317,7 +317,7 @@ export async function batchAddressGenerate( let batchLimit = addressIndex + batchSize let addresses = [] - let account = await wallet.wallet.deriveAccount(accountIndex); + let account = await wallet.derivedWallet.deriveAccount(accountIndex); let xkey = await account.deriveXKey(use); for (;addressIndex < batchLimit; addressIndex++) { diff --git a/types.js b/types.js index d27c725..2db40f9 100644 --- a/types.js +++ b/types.js @@ -31,7 +31,7 @@ * xpub: string; * seed: Uint8Array; * wpub: string; - * wallet: HDWallet; + * derivedWallet: HDWallet; * account: HDAccount; * recoveryPhrase: string; * }} SeedWallet