Skip to content

Commit

Permalink
fix: ♻️ Rename SeedWallet wallet to derivedWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobyte committed Oct 22, 2023
1 parent c264267 commit e1d7c78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand All @@ -106,8 +106,8 @@ export async function deriveWalletData(
xpub,
seed,
wpub,
wallet,
account,
derivedWallet,
recoveryPhrase,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion types.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* xpub: string;
* seed: Uint8Array;
* wpub: string;
* wallet: HDWallet;
* derivedWallet: HDWallet;
* account: HDAccount;
* recoveryPhrase: string;
* }} SeedWallet
Expand Down

0 comments on commit e1d7c78

Please sign in to comment.