tsjs-xpx-hd-wallets
The author of this package cannot be held responsible for any loss of money or any malintentioned usage forms of this package. Please use this package with caution.
XPX HD Wallets generator to generate hyper-deterministic wallets for the Sirius platform based on the proposed NIP6 Multi-Account Hierarchy for Deterministic Wallets.
Installation
npm install tsjs-xpx-hd-wallets
Examples
Generating a mnemonic pass phrase
// examples/GeneratingAMnemonicPassPhrase.ts ; // random 24-words mnemonicMnemonicPassPhrase.createRandom; // random 12-words mnemonicMnemonicPassPhrase.createRandom'english', 128; // random 24-words mnemonic with french wordlistMnemonicPassPhrase.createRandom'french'; // random 24-words mnemonic with japanese wordlistMnemonicPassPhrase.createRandom'japanese';
Generating a password-protected mnemonic pass phrase seed (for storage)
// examples/GeneratePasswordProtectedSeedForRandomPassPhrase.ts ; ;;
// examples/GeneratePasswordProtectedSeedForRandomPassPhraseEmptyPassword.ts // Example 2: empty password for password-protected seed; ;; // omit password means empty password: ''
Generating a root (master) extended key
// examples/GeneratingARootMasterExtendedKeyForKnownPassPhrase.ts ; // Example 2: generate BIP32 master seed for known pass phrase + 'correct program depend valid focus basket whisper firm ' + 'tray fit rally day dance demise engine mango';; // the following seed can be used with `ExtendedKey.createFromSeed()`; // using empty password
// examples/GeneratingARootMasterExtendedKeyForRandomPassPhrase.ts ; // Example 1: generate BIP32 master seed for random pass phrase;;
Generating a hyper-deterministic wallet (CATAPULT mijin and mijinTest compatible)
// examples/GeneratingAHDWalletPrivateNetworkCompatible.ts ;; ;; // get master account; // get DEFAULT ACCOUNT; // derive specific child path; // get read-only wallet;; // get read-only DEFAULT ACCOUNT;
Generating a hyper-deterministic wallet (CATAPULT public and publicTest compatible)
// examples/GeneratingAHDWalletPublicNetworkCompatible.ts ;; ;; // get master account; // get DEFAULT ACCOUNT; // derive specific child path; // get read-only wallet;; // get read-only DEFAULT ACCOUNT;
Signing with a hyper-deterministic wallet (CATAPULT compatible)
// examples/SigningWithAHDWalletPrivateNetworkCompatible.ts ;; ;; // derive specific child path; // create a transfer object; // sign the transaction with derived account; // replace with network generation hash;
License
Licensed under the BSD-2 License.