Skip to content

Commit

Permalink
chore: linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
r4mmer committed Dec 23, 2024
1 parent 8b36102 commit eecf51a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions scripts/generate_words.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import { walletUtils } from '@hathor/wallet-lib';

function main() {
const words = walletUtils.generateWalletWords();
const words = walletUtils.generateWalletWords();

console.log(words);
console.log(words);
}

try {
main()
process.exit(0);
} catch(err) {
console.error(err);
process.exit(1);
main();
process.exit(0);
} catch (err) {
console.error(err);
process.exit(1);
}
24 changes: 12 additions & 12 deletions scripts/get_xpub_from_seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
import hathorLib from '@hathor/wallet-lib';

function main() {
/**
/**
* argv contains the cli arguments that made this script run, including the interpreter
* and script filename so to get the actual seed passed via cli we need to remove the
* other arguments.
* argv = ["babel-node", "get_xpub_from_seed.js", "word0", ..., "wordLast"];
* We need to remove the first 2 and join the other arguments into a single string
* separated by spaces
*/
const seed = process.argv.slice(2).join(' ');
const hdprivkeyRoot = hathorLib.walletUtils.getXPrivKeyFromSeed(seed);
// `accountDerivationIndex` will make the util method derive to the change path
const hdprivkey = hathorLib.walletUtils.deriveXpriv(hdprivkeyRoot, '0\'/0');
const seed = process.argv.slice(2).join(' ');
const hdprivkeyRoot = hathorLib.walletUtils.getXPrivKeyFromSeed(seed);
// `accountDerivationIndex` will make the util method derive to the change path
const hdprivkey = hathorLib.walletUtils.deriveXpriv(hdprivkeyRoot, '0\'/0');

// Print the xpubkey
console.log(hdprivkey.xpubkey);
// Print the xpubkey
console.log(hdprivkey.xpubkey);
}

try {
main()
process.exit(0);
} catch(err) {
console.error(err);
process.exit(1);
main();
process.exit(0);
} catch (err) {
console.error(err);
process.exit(1);
}

0 comments on commit eecf51a

Please sign in to comment.