diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..d3b3721 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,44 @@ +{ + "env": { + "browser": true, + "commonjs": true, + "es2021": true + }, + "extends": ["airbnb-base", "prettier", "plugin:mocha/recommended"], + "overrides": [], + "parserOptions": { + "ecmaVersion": "latest" + }, + "rules": { + "prettier/prettier": "error", + "no-mocha-arrows": 0, + "no-console": 0, + "spellcheck/spell-checker": [ + 1, + { + "comments": true, + "strings": true, + "identifiers": false, + "templates": false, + "lang": "en_US", + "skipWords": [ + "dict", + "aff", + "hunspellchecker", + "hunspell", + "utils", + "priv", + "xpub", + "txid", + "tx", + "bitcoind", + "bool" + ], + "skipIfMatch": ["http://[^s]*", "^[-\\w]+/[-\\w\\.]+$"], + "skipWordIfMatch": ["^foobar.*$"], + "minLength": 4 + } + ] + }, + "plugins": ["prettier", "mocha", "spellcheck"] +} diff --git a/examples.js b/examples.js index 94822a0..4a524ce 100644 --- a/examples.js +++ b/examples.js @@ -1,229 +1,212 @@ -const HdAddGen = require('./hdAddressGenerator') -const mnemonic = "brand improve symbol strike say focus ginger imitate ginger appear wheel brand swear relief zero" -const seed = "09a0a3b58d10bbc456254f1915c2627d8f0e9968922505b39dbb08f6a5dc9dafdee40cff16aa488add7ee4e2ec6eaf40425d3f2aea81c18c2c314d58885e923a" -const xpub = "xpub6CfhGffKu2dhKxhxVS7gmTwtfK6NKA6pVAjgTgManuJoTVqLjiN6RTydgE13GPGCShaEQk1BjbHZ7Lps7eE5ECTk48vJuYjcf2FsPN1n9av" - -;(async()=>{ - -/** - * Generate cryptographically random Mnemonic and seed buffer. - * This is a pass through for the Bip39 libraries generateMnemomic function. - * Please review the bip39 implementation to make sure you are comfortable with - * the implementation before using this for anything critical. - */ -let sampleMnemonic = await HdAddGen.generateMnemonic('english',128 /* 128=12words, 256=24words */ ) - -console.log( `\nSample Mnemonic and Seed Generation` ) -console.log(`Mnemonic: ${sampleMnemonic.mnemonic}`) -console.log(`Seed: ${sampleMnemonic.seed.toString('hex')}`) - -/** - * Generate BIP 44 ( Legacy '1' ) addresses for bitcoin. - */ -let bip44 = HdAddGen.withMnemonic(mnemonic,false,"BTC") - -console.log( `\nBIP 44 ( Legacy '1' ) Key Generation` ) - -/** - * HD information and keys are available directly from the object. - */ -console.log( `BIP 44 ( Legacy '1' ) Key Generation` ) -console.log( `BIP 32 Algo: ${bip44.hashAlgo}` ) -console.log( `BIP 32 Path: ${bip44.bip32Path}` ) -console.log( `BIP 32 Seed: ${bip44.bip32Seed}` ) -console.log( `BIP 32 Root Key: ${bip44.bip32RootKey}` ) -console.log( `Account X Priv Key: ${bip44.accountXprivKey}` ) -console.log( `Account X Pub Key: ${bip44.accountXpubKey}` ) -console.log( `BIP 32 X Priv Key: ${bip44.bip32XprivKey}` ) -console.log( `BIP 32 X Pub Key: ${bip44.bip32XpubKey}\n` ) - -// Generate 3 address pairs starting from index 0, -let bip44Addresses = await bip44.generate(3,0) - -bip44Addresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - -/** - * Generate BIP 44 ( Legacy '1' ) addresses for bitcoin with seed instead of mnemonic. - */ -let bip44withSeed = HdAddGen.withSeed(seed,"BTC") - -console.log( `\nBIP 44 ( Legacy '1' ) Key Generation with seed` ) - -// Generate 3 address pairs starting from index 0, -let bip44withSeedAddresses = await bip44withSeed.generate(3,0) - -bip44withSeedAddresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - -/** - * Generate BIP 44 ( Legacy '1' ) encrypted addresses. - */ -let bip44withEnc = HdAddGen.withSeed(seed,"BTC",false,44,0,0,"password") -bip44withEnc.showEncryptProgress = true // You can enable encryption progress to have the status logged to console. +const HdAddGen = require("./hdAddressGenerator"); + +const mnemonic = + "brand improve symbol strike say focus ginger imitate ginger appear wheel brand swear relief zero"; +const seed = + "09a0a3b58d10bbc456254f1915c2627d8f0e9968922505b39dbb08f6a5dc9dafdee40cff16aa488add7ee4e2ec6eaf40425d3f2aea81c18c2c314d58885e923a"; +const xpub = + "xpub6CfhGffKu2dhKxhxVS7gmTwtfK6NKA6pVAjgTgManuJoTVqLjiN6RTydgE13GPGCShaEQk1BjbHZ7Lps7eE5ECTk48vJuYjcf2FsPN1n9av"; + +(async () => { + /** + * Generate cryptographically random Mnemonic and seed buffer. + * This is a pass through for the Bip39 libraries generateMnemomic function. + * Please review the bip39 implementation to make sure you are comfortable with + * the implementation before using this for anything critical. + */ + const sampleMnemonic = await HdAddGen.generateMnemonic( + "english", + 128 /* 128=12words, 256=24words */ + ); + + console.log(`\nSample Mnemonic and Seed Generation`); + console.log(`Mnemonic: ${sampleMnemonic.mnemonic}`); + console.log(`Seed: ${sampleMnemonic.seed.toString("hex")}`); + + /** + * Generate BIP 44 ( Legacy '1' ) addresses for bitcoin. + */ + const bip44 = HdAddGen.withMnemonic(mnemonic, false, "BTC"); + + console.log(`\nBIP 44 ( Legacy '1' ) Key Generation`); + + /** + * HD information and keys are available directly from the object. + */ + console.log(`BIP 44 ( Legacy '1' ) Key Generation`); + console.log(`BIP 32 Algo: ${bip44.hashAlgo}`); + console.log(`BIP 32 Path: ${bip44.bip32Path}`); + console.log(`BIP 32 Seed: ${bip44.bip32Seed}`); + console.log(`BIP 32 Root Key: ${bip44.bip32RootKey}`); + console.log(`Account X Priv Key: ${bip44.accountXprivKey}`); + console.log(`Account X Pub Key: ${bip44.accountXpubKey}`); + console.log(`BIP 32 X Priv Key: ${bip44.bip32XprivKey}`); + console.log(`BIP 32 X Pub Key: ${bip44.bip32XpubKey}\n`); + + // Generate 3 address pairs starting from index 0, + const bip44Addresses = await bip44.generate(3, 0); + + bip44Addresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate BIP 44 ( Legacy '1' ) addresses for bitcoin with seed instead of mnemonic. + */ + const bip44withSeed = HdAddGen.withSeed(seed, "BTC"); + + console.log(`\nBIP 44 ( Legacy '1' ) Key Generation with seed`); + + // Generate 3 address pairs starting from index 0, + const bip44withSeedAddresses = await bip44withSeed.generate(3, 0); + + bip44withSeedAddresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate BIP 44 ( Legacy '1' ) encrypted addresses. + */ + const bip44withEnc = HdAddGen.withSeed( + seed, + "BTC", + false, + 44, + 0, + 0, + "password" + ); + bip44withEnc.showEncryptProgress = true; // You can enable encryption progress to have the status logged to console. + + console.log( + `\nBIP 44 ( Legacy '1' ) encrypted addresses. This can be quite slow...` + ); + + // Generate 3 address pairs starting from index 0, + const bip44withEncAddresses = await bip44withEnc.generate(2, 0); + + bip44withEncAddresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate BIP 49 ( Segwit Compatible '3' ) addresses for bitcoin with mnemonic passphrase. + */ + const bip49 = HdAddGen.withMnemonic(mnemonic, "test", "BTC", false, 49); + + console.log(`\nBIP 49 ( Segwit Compatible '3' ) Key Generation`); + + // Generate 3 address pairs starting from index 0, + const bip49Addresses = await bip49.generate(3, 0); + + bip49Addresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate hardened BIP 84 ( Segwit bech32 'bc1' ) addresses for bitcoin. + */ + const bip84 = HdAddGen.withMnemonic(mnemonic, false, "BTC", true, 49); + + console.log(`\nBIP 84 ( Segwit bech32 'bc1' ) hardened Key Generation`); + + // Generate 3 address pairs starting from index 0, + const bip84Addresses = await bip84.generate(3, 0); + + bip84Addresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate BIP 32 addresses with custom path. + */ + const bip32 = HdAddGen.withMnemonicBIP32( + mnemonic, + false, + "BTC", + "m/44'/0'/0'", + false + ); + + console.log(`\nBIP 32 Key Generation`); + + // Generate 3 address pairs starting from index 0, + const bip32Addresses = await bip32.generate(3, 0); + + bip32Addresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate BIP 144 addresses with custom path and algo. + */ + const bip141 = HdAddGen.withMnemonicBIP141( + mnemonic, + false, + "BTC", + "m/44'/0'/0'", + "p2wpkh" + ); + + console.log(`\nBIP 141 Key Generation`); + + // Generate 3 address pairs starting from index 0, + const bip141Addresses = await bip141.generate(3, 0, "m/0'/0", "p2wpkh"); + + bip141Addresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * Generate Neutered BIP 44 ( Legacy '1' ) addresses for bitcoin with XPUB. + */ + + let bip44xpub = {}; + + bip44xpub = HdAddGen.withExtPub(xpub, "BTC", 44); + + // Generate 3 address pairs starting from index 0, + const bip44xpubAddresses = await bip44xpub.generate(3); + bip44xpubAddresses.forEach((address) => { + console.log(address.path, address.address, address.pubKey, address.privKey); + }); + + /** + * BCH addresses conversion. + */ + const bip44BCH = HdAddGen.withSeed(seed, "BCH"); -console.log( `\nBIP 44 ( Legacy '1' ) encrypted addresses. This can be quite slow...` ) + console.log(`\nBCH Address Conversion`); + // Generate 3 address pairs starting from index 0, + const bip44BCHAddresses = await bip44BCH.generate(3, 0); -// Generate 3 address pairs starting from index 0, -let bip44withEncAddresses = await bip44withEnc.generate(2,0) - -bip44withEncAddresses.forEach(address => { + bip44BCHAddresses.forEach((address) => { console.log( + address.path, + bip44BCH.convertAddress(address.address, "cashAddress"), + address.pubKey, + address.privKey + ); + }); + + /** + * Using promises + */ + const bip44promise = HdAddGen.withSeed(seed, "BTC"); + + // Generate 3 address pairs starting from index 0, + // eslint-disable-next-line no-shadow + bip44promise.generate(3, 0).then((bip44withSeedAddresses) => { + console.log(`\nBIP 44 ( Legacy '1' ) Key Using Promises`); + + bip44withSeedAddresses.forEach((address) => { + console.log( address.path, address.address, address.pubKey, address.privKey - ) -}) - -/** - * Generate BIP 49 ( Segwit Compatible '3' ) addresses for bitcoin with mnemonic passphrase. - */ -let bip49 = HdAddGen.withMnemonic(mnemonic,"test","BTC",false,49) - -console.log( `\nBIP 49 ( Segwit Compatible '3' ) Key Generation` ) - -// Generate 3 address pairs starting from index 0, -let bip49Addresses = await bip49.generate(3,0) - -bip49Addresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - - -/** - * Generate hardened BIP 84 ( Segwit bech32 'bc1' ) addresses for bitcoin. - */ -let bip84 = HdAddGen.withMnemonic(mnemonic,false,"BTC",true,49) - -console.log( `\nBIP 84 ( Segwit bech32 'bc1' ) hardened Key Generation` ) - -// Generate 3 address pairs starting from index 0, -let bip84Addresses = await bip84.generate(3,0) - -bip84Addresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - -/** - * Generate BIP 32 addresses with custom path. - */ -let bip32 = HdAddGen.withMnemonicBIP32(mnemonic,false,"BTC","m/44'/0'/0'",false) - -console.log( `\nBIP 32 Key Generation` ) - -// Generate 3 address pairs starting from index 0, -let bip32Addresses = await bip32.generate(3,0) - -bip32Addresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - -/** - * Generate BIP 144 addresses with custom path and algo. - */ -let bip141 = HdAddGen.withMnemonicBIP141(mnemonic,false,"BTC","m/44'/0'/0'","p2wpkh") - -console.log( `\nBIP 141 Key Generation` ) - -// Generate 3 address pairs starting from index 0, -let bip141Addresses = await bip141.generate(3,0,"m/0'/0","p2wpkh") - -bip141Addresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - -/** - * Generate Neutered BIP 44 ( Legacy '1' ) addresses for bitcoin with XPUB. - */ - -let bip44xpub = {} - -bip44xpub = HdAddGen.withExtPub(xpub,"BTC",44) - -// Generate 3 address pairs starting from index 0, -let bip44xpubAddresses = await bip44xpub.generate(3) -bip44xpubAddresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) -}) - -/** - * BCH addresses conversion. - */ -let bip44BCH= HdAddGen.withSeed(seed,"BCH") - -console.log( `\nBCH Address Conversion` ) - -// Generate 3 address pairs starting from index 0, -let bip44BCHAddresses = await bip44BCH.generate(3,0) - -bip44BCHAddresses.forEach(address => { - console.log( - address.path, - bip44BCH.convertAddress(address.address,'cashAddress'), - address.pubKey, - address.privKey - ) -}) - -/** - * Using promises - */ -let bip44promise = HdAddGen.withSeed(seed,"BTC") - -// Generate 3 address pairs starting from index 0, -bip44promise.generate(3,0).then(function(bip44withSeedAddresses){ - - console.log( `\nBIP 44 ( Legacy '1' ) Key Using Promises` ) - - bip44withSeedAddresses.forEach(address => { - console.log( - address.path, - address.address, - address.pubKey, - address.privKey - ) - }) - -}) - - -})(); \ No newline at end of file + ); + }); + }); +})(); diff --git a/hdAddressGenerator.js b/hdAddressGenerator.js index 3e69b3a..05a1a2f 100644 --- a/hdAddressGenerator.js +++ b/hdAddressGenerator.js @@ -17,7 +17,7 @@ const createHash = require("create-hash"); const bitcoin = require("bitcoinjs-lib"); const ethreumUtil = require("ethereumjs-util"); const stellarUtil = require("stellar-base"); -//const nebulasUtil = require('nebulas') // This library has some security issues. Disabled until resolved. +// const nebulasUtil = require('nebulas') // This library has some security issues. Disabled until resolved. const nanoUtil = require("nanocurrency-web"); const bchSlpUtil = require("bchaddrjs-slp"); const bchaddr = require("bchaddrjs"); @@ -26,33 +26,56 @@ const coinList = require("coinnetworklist"); class AddressGenerator { coin = {}; + coinName = ""; + index = 0; + hardened = false; + bip = 0; + account = 0; + change = 0; + bip32Seed = ""; + bip32RootKeyRaw = ""; + bip32RootKey = ""; + bip32Path = ""; + accountPath = ""; + accountXprivKey = ""; + accountXpubKey = ""; + bip32XprivKey = ""; + bip32XpubKey = ""; + hashAlgo = ""; + hashAlgos = { 32: "p2pkh", 44: "p2pkh", 49: "p2wpkhInP2sh", 84: "p2wpkh", }; + bip38Password = false; + unsupported = ["GRS", "ELA", "NAS"]; // Coins there is network info for but that are currently not supported. + showEncryptProgress = false; + xpub = false; + extPub = ""; + unsupportedXpub = ["stellar", "nebulas", "nano"]; /** @@ -70,10 +93,10 @@ class AddressGenerator { * @param {string} bip38Password Additional password used to encrypt private keys. */ constructor( - mnemonic = false, - passphrase = false, - seed = false, - extPub = false, + mnemonic, + passphrase, + seed, + extPub, coin, hardened = false, bip = 44, @@ -83,7 +106,7 @@ class AddressGenerator { hashAlgo = false, bip38Password = false ) { - if (coinList[coin] == undefined) { + if (coinList[coin] === undefined) { throw new Error(`Coin ${coin} does not exist.`); } else { this.coin = coinList[coin]; @@ -91,11 +114,11 @@ class AddressGenerator { this.coinNumber = this.coin.coinNumber; } - if (this.coin.network == undefined) { + if (this.coin.network === undefined) { throw new Error(`Coin ${coin} exists but has no network details.`); } - if (!this.coinHasTest(coin)) { + if (!AddressGenerator.coinHasTest(coin)) { console.warn( `${coin} has no test and results may not be accurate. Please see ReadMe.md about how to add a test for this coin.` ); @@ -103,7 +126,7 @@ class AddressGenerator { // If a BIP 49 'y' or BIP 141 'z' xpub is submitted it is converted to an 'x' pub it can be processed. this.extPub = extPub; - this.xpub = extPub === false ? false : this.pubToXpub(extPub); + this.xpub = extPub === false ? false : AddressGenerator.pubToXpub(extPub); if (seed !== false) { this.seed = Buffer.from(seed, "hex"); @@ -125,13 +148,13 @@ class AddressGenerator { this.account = account; this.change = change; this.hardened = hardened; - this.bip32Path = customPath != false ? customPath : ""; + this.bip32Path = customPath !== false ? customPath : ""; this.bip38Password = bip38Password; this.hashAlgo = hashAlgo === false ? this.hashAlgos[bip] : hashAlgo; if ( [49, 84, 141].includes(bip) && - this.coin.network[this.hashAlgo] == undefined + this.coin.network[this.hashAlgo] === undefined ) { throw new Error(`${this.coinName} does not support ${this.hashAlgo}.`); } @@ -140,7 +163,7 @@ class AddressGenerator { throw new Error(`${this.coinName} is not supported at this time.`); } - if (this.coin.addressType != undefined && bip38Password != false) { + if (this.coin.addressType !== undefined && bip38Password !== false) { throw new Error( `BIP 38 private key encryption only supported for bitcoin like address generation.` ); @@ -389,7 +412,7 @@ class AddressGenerator { } initKeys() { - if (this.bip == 32) { + if (this.bip === 32) { this.bip32RootKeyRaw = bip32.fromSeed(this.seed); } else if (this.xpub === false) { this.bip32RootKeyRaw = bip32.fromSeed( @@ -403,7 +426,7 @@ class AddressGenerator { this.bip32RootKey = this.xpub === false ? this.bip32RootKeyRaw.toBase58() : ""; - if (this.bip != 32 && this.bip != 141) { + if (this.bip !== 32 && this.bip !== 141) { this.accountPath = `m/${this.bip}'/${this.coinNumber}'/${this.account}'`; this.accountXprivKey = this.xpub === false @@ -438,25 +461,21 @@ class AddressGenerator { * @returns */ static async generateMnemonic(wordlist = "english", strength = 128) { - let result = {}; + const result = {}; - if (bip39.wordlists[wordlist] == undefined) { + if (bip39.wordlists[wordlist] === undefined) { throw new Error( - `Worldlist Not Supported. Supported Worlists: ${this.getSupportedWordLists().join( + `Worldlist Not Supported. Supported Worlists: ${AddressGenerator.getSupportedWordLists().join( ", " )} Default: english` ); } - try { - result.mnemonic = bip39.generateMnemonic( - strength, - undefined, - bip39.wordlists[wordlist] - ); - } catch (e) { - throw e; - } + result.mnemonic = bip39.generateMnemonic( + strength, + undefined, + bip39.wordlists[wordlist] + ); result.seed = await bip39.mnemonicToSeed(result.mnemonic); @@ -469,44 +488,44 @@ class AddressGenerator { * @param {int} startIndex Index to start generating addresses from. */ async generate(totalToGenerate, startIndex = 0) { - let addresses = []; + const addresses = []; let index = startIndex; while (addresses.length < totalToGenerate) { let keyPair = {}; - if (this.coin.addressType == undefined) + if (this.coin.addressType === undefined) keyPair = this.generateBitcoinAddress(index); - if (this.coin.addressType == "ethereum") + if (this.coin.addressType === "ethereum") keyPair = this.generateEthereumAddress(index); - if (this.coin.addressType == "tron") + if (this.coin.addressType === "tron") keyPair = this.generateTronAddress(index); - if (this.coin.addressType == "RSK") + if (this.coin.addressType === "RSK") keyPair = this.generateRSKAddress(index); - if (this.coin.addressType == "stellar") + if (this.coin.addressType === "stellar") keyPair = this.generateStellarAddress(index); - if (this.coin.addressType == "nebulas") + if (this.coin.addressType === "nebulas") keyPair = this.generateNebulasAddress(index); - if (this.coin.addressType == "ripple") + if (this.coin.addressType === "ripple") keyPair = this.generateRippleAddress(index); - if (this.coin.addressType == "nano") + if (this.coin.addressType === "nano") keyPair = this.generateNanoAddress(index); - if (this.coin.addressType == "jingtum") + if (this.coin.addressType === "jingtum") keyPair = this.generateJingtumAddress(index); - if (this.coin.addressType == "casinoCoin") + if (this.coin.addressType === "casinoCoin") keyPair = this.generateCasinoCoinAddress(index); - if (this.coin.addressType == "crown") + if (this.coin.addressType === "crown") keyPair = this.generateCrownAddress(index); - if (this.coin.addressType == "eosio") + if (this.coin.addressType === "eosio") keyPair = this.generateEOSAddress(index); - if (this.coin.addressType == "fio") + if (this.coin.addressType === "fio") keyPair = this.generateFIOAddress(index); keyPair.index = index; addresses.push(keyPair); - index++; + index += 1; } return addresses; @@ -517,18 +536,18 @@ class AddressGenerator { * @param {string} address Coin specific address. * @param {string} format Address format you would like to convert the address to. */ - convertAddress(address, format) { - if (format == "cashAddress") return bchaddr.toCashAddress(address); - if (format == "bitpayAddress") return bchaddr.toBitpayAddress(address); - if (format == "bchSlp") return bchSlpUtil.toSlpAddress(address); + static convertAddress(address, format) { + if (format === "cashAddress") return bchaddr.toCashAddress(address); + if (format === "bitpayAddress") return bchaddr.toBitpayAddress(address); + if (format === "bchSlp") return bchSlpUtil.toSlpAddress(address); throw new Error(`Address format ${format} does not exist.`); } generateBitcoinAddress(index) { - let keyPair = {}; - let compressedKeys = this.bip38Password != false ? false : true; - let showEncryptProgress = this.showEncryptProgress; + const keyPair = {}; + const compressedKeys = this.bip38Password === false; + const { showEncryptProgress } = this; keyPair.network = this.coin.network[this.hashAlgo]; keyPair.path = this.path(index); @@ -548,13 +567,12 @@ class AddressGenerator { keyPair.pairBuffers.privateKey, false, this.bip38Password, - function (p) { + (p) => { if (showEncryptProgress) console.log( - "Priv key encryption progress " + - p.percent.toFixed(1) + - "% for index " + - index + `Priv key encryption progress ${p.percent.toFixed( + 1 + )}% for index ${index}` ); } ); @@ -575,7 +593,7 @@ class AddressGenerator { keyPair.pubKey = keyPair.rawAddress.publicKey.toString("hex"); - if (this.bip == 49 || this.hashAlgo == "p2wpkhInP2sh") { + if (this.bip === 49 || this.hashAlgo === "p2wpkhInP2sh") { keyPair.address = bitcoin.payments.p2sh({ redeem: bitcoin.payments.p2wpkh({ pubkey: keyPair.pairBuffers.publicKey, @@ -594,10 +612,10 @@ class AddressGenerator { } generateEthereumAddress(index) { - let addressPrefix = - this.coin.addressPrefix == undefined ? "0x" : this.coin.addressPrefix; + const addressPrefix = + this.coin.addressPrefix === undefined ? "0x" : this.coin.addressPrefix; - let keyPair = {}; + const keyPair = {}; keyPair.path = this.path(index); if (this.xpub === false) { @@ -610,10 +628,10 @@ class AddressGenerator { .derive(index).publicKey; } - let ethPubkey = ethreumUtil.importPublic(keyPair.rawPair.publicKey); - let addressBuffer = ethreumUtil.publicToAddress(ethPubkey); - let hexAddress = addressBuffer.toString("hex"); - let checksumAddress = ethreumUtil.toChecksumAddress( + const ethPubkey = ethreumUtil.importPublic(keyPair.rawPair.publicKey); + const addressBuffer = ethreumUtil.publicToAddress(ethPubkey); + const hexAddress = addressBuffer.toString("hex"); + const checksumAddress = ethreumUtil.toChecksumAddress( addressPrefix + hexAddress ); @@ -628,9 +646,9 @@ class AddressGenerator { } generateTronAddress(index) { - let addressPrefix = this.coin.addressPrefix; + const { addressPrefix } = this.coin; - let keyPair = {}; + const keyPair = {}; keyPair.path = this.path(index); if (this.xpub === false) { @@ -647,8 +665,8 @@ class AddressGenerator { .derive(index).publicKey; } - let ethPubkey = ethreumUtil.importPublic(keyPair.rawPair.publicKey); - let addressBuffer = ethreumUtil.publicToAddress(ethPubkey); + const ethPubkey = ethreumUtil.importPublic(keyPair.rawPair.publicKey); + const addressBuffer = ethreumUtil.publicToAddress(ethPubkey); keyPair.address = bitcoin.address.toBase58Check( addressBuffer, @@ -662,10 +680,10 @@ class AddressGenerator { } generateRSKAddress(index) { - let addressPrefix = this.coin.addressPrefix; - let chainId = this.coin.chainId != undefined ? this.coin.chainId : null; + const { addressPrefix } = this.coin; + const chainId = this.coin.chainId !== undefined ? this.coin.chainId : null; - let keyPair = {}; + const keyPair = {}; keyPair.path = this.path(index); if (this.xpub === false) { @@ -678,10 +696,10 @@ class AddressGenerator { .derive(index).publicKey; } - let ethPubkey = ethreumUtil.importPublic(keyPair.rawPair.publicKey); - let addressBuffer = ethreumUtil.publicToAddress(ethPubkey); - let hexAddress = addressBuffer.toString("hex"); - let checksumAddress = ethreumUtil.toChecksumAddress( + const ethPubkey = ethreumUtil.importPublic(keyPair.rawPair.publicKey); + const addressBuffer = ethreumUtil.publicToAddress(ethPubkey); + const hexAddress = addressBuffer.toString("hex"); + const checksumAddress = ethreumUtil.toChecksumAddress( addressPrefix + hexAddress, chainId ); @@ -697,11 +715,10 @@ class AddressGenerator { } generateStellarAddress(index) { - let keyPair = {}; - keyPair.path = - "m/" + this.bip + "'/" + this.coin.coinNumber + "'/" + index + "'"; + const keyPair = {}; + keyPair.path = `m/${this.bip}'/${this.coin.coinNumber}'/${index}'`; - let Ed25519Seed = edHd.derivePath(keyPair.path, this.seed); + const Ed25519Seed = edHd.derivePath(keyPair.path, this.seed); keyPair.rawPair = stellarUtil.Keypair.fromRawEd25519Seed(Ed25519Seed.key); keyPair.address = keyPair.rawPair.publicKey(); @@ -711,24 +728,25 @@ class AddressGenerator { return keyPair; } - generateNebulasAddress(index) { - let keyPair = {}; - keyPair.path = this.path(index); - keyPair.rawPair = this.root.derivePath(keyPair.path); - - let privKeyBuffer = keyPair.rawPair.privateKey; - let nebulasAccount = nebulasUtil.Account.NewAccount(); - - nebulasAccount.setPrivateKey(privKeyBuffer); - keyPair.address = nebulasAccount.getAddressString(); - keyPair.privKey = nebulasAccount.getPrivateKeyString(); - keyPair.pubKey = nebulasAccount.getPublicKeyString(); - - return keyPair; - } + // Disabled due to insecure supporting library + // generateNebulasAddress(index) { + // const keyPair = {}; + // keyPair.path = this.path(index); + // keyPair.rawPair = this.root.derivePath(keyPair.path); + // + // const privKeyBuffer = keyPair.rawPair.privateKey; + // const nebulasAccount = nebulasUtil.Account.NewAccount(); + // + // nebulasAccount.setPrivateKey(privKeyBuffer); + // keyPair.address = nebulasAccount.getAddressString(); + // keyPair.privKey = nebulasAccount.getPrivateKeyString(); + // keyPair.pubKey = nebulasAccount.getPublicKeyString(); + // + // return keyPair; + // } generateRippleAddress(index) { - let keyPair = this.generateBitcoinAddress(index); + const keyPair = this.generateBitcoinAddress(index); keyPair.address = basex( "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz" @@ -749,7 +767,7 @@ class AddressGenerator { } generateNanoAddress(index) { - let keyPair = {}; + const keyPair = {}; keyPair.path = this.path(index); keyPair.rawPair = nanoUtil.wallet.accounts( @@ -766,7 +784,7 @@ class AddressGenerator { } generateJingtumAddress(index) { - let keyPair = this.generateBitcoinAddress(index); + const keyPair = this.generateBitcoinAddress(index); keyPair.address = basex( "jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz" @@ -787,7 +805,7 @@ class AddressGenerator { } generateCasinoCoinAddress(index) { - let keyPair = this.generateBitcoinAddress(index); + const keyPair = this.generateBitcoinAddress(index); keyPair.address = basex( "cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz" @@ -808,20 +826,20 @@ class AddressGenerator { } generateCrownAddress(index) { - let keyPair = this.generateBitcoinAddress(index); - keyPair.address = this.crownAddressConvert(keyPair.address); + const keyPair = this.generateBitcoinAddress(index); + keyPair.address = AddressGenerator.crownAddressConvert(keyPair.address); return keyPair; } generateEOSAddress(index) { - let keyPair = this.generateBitcoinAddress(index); + const keyPair = this.generateBitcoinAddress(index); keyPair.address = ""; keyPair.privKey = this.xpub === false - ? this.EOSbufferToPrivate(keyPair.pairBuffers.privateKey) + ? AddressGenerator.EOSbufferToPrivate(keyPair.pairBuffers.privateKey) : ""; - keyPair.pubKey = this.EOSbufferToPublic( + keyPair.pubKey = AddressGenerator.EOSbufferToPublic( keyPair.pairBuffers.publicKey, "EOS" ); @@ -830,13 +848,13 @@ class AddressGenerator { } generateFIOAddress(index) { - let keyPair = this.generateBitcoinAddress(index); + const keyPair = this.generateBitcoinAddress(index); keyPair.address = ""; keyPair.privKey = this.xpub === false - ? this.EOSbufferToPrivate(keyPair.pairBuffers.privateKey) + ? AddressGenerator.EOSbufferToPrivate(keyPair.pairBuffers.privateKey) : ""; - keyPair.pubKey = this.EOSbufferToPublic( + keyPair.pubKey = AddressGenerator.EOSbufferToPublic( keyPair.pairBuffers.publicKey, "FIO" ); @@ -844,56 +862,60 @@ class AddressGenerator { return keyPair; } - crownAddressConvert(oldAddress) { - let ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - let b58 = basex(ALPHABET); + static crownAddressConvert(oldAddress) { + const ALPHABET = + "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + const b58 = basex(ALPHABET); - let addrBytes = b58.decode(oldAddress); + const addrBytes = b58.decode(oldAddress); - let hash160 = Buffer.from(new Uint16Array(23)); - hash160[0] = 0x01; //C - hash160[1] = 0x75; //R - hash160[2] = 0x07; //W + const hash160 = Buffer.from(new Uint16Array(23)); + hash160[0] = 0x01; // C + hash160[1] = 0x75; // R + hash160[2] = 0x07; // W addrBytes.copy(hash160, 3, 1, 21); - let checksum = bitcoin.crypto.hash256(hash160).subarray(0, 4); - let binaryAddr = Buffer.from(new Uint16Array(27)); + const checksum = bitcoin.crypto.hash256(hash160).subarray(0, 4); + const binaryAddr = Buffer.from(new Uint16Array(27)); binaryAddr.set(hash160, 0); checksum.copy(binaryAddr, 23, 0, 4); - let newAddress = b58.encode(binaryAddr); + const newAddress = b58.encode(binaryAddr); return newAddress; } - EOSbufferToPublic(pubBuf, prefix) { + static EOSbufferToPublic(buffer, prefix) { const EOS_PUBLIC_PREFIX = prefix; - let checksum = createHash("rmd160") - .update(pubBuf) + const checksum = createHash("rmd160") + .update(buffer) .digest("hex") .slice(0, 8); - pubBuf = Buffer.concat([pubBuf, Buffer.from(checksum, "hex")]); + const pubBuf = Buffer.concat([buffer, Buffer.from(checksum, "hex")]); return EOS_PUBLIC_PREFIX.concat(bs58.encode(pubBuf)); } - EOSbufferToPrivate(privBuf) { + static EOSbufferToPrivate(buffer) { const EOS_PRIVATE_PREFIX = "80"; - privBuf = Buffer.concat([Buffer.from(EOS_PRIVATE_PREFIX, "hex"), privBuf]); - let tmp = createHash("sha256").update(privBuf).digest(); - let checksum = createHash("sha256").update(tmp).digest("hex").slice(0, 8); + let privBuf = Buffer.concat([ + Buffer.from(EOS_PRIVATE_PREFIX, "hex"), + buffer, + ]); + const tmp = createHash("sha256").update(privBuf).digest(); + const checksum = createHash("sha256").update(tmp).digest("hex").slice(0, 8); privBuf = Buffer.concat([privBuf, Buffer.from(checksum, "hex")]); return bs58.encode(privBuf); } path(index) { - if (this.bip == 32 || this.bip == 141) + if (this.bip === 32 || this.bip === 141) return `${this.bip32Path}/${index}${this.hardened ? "'" : ""}`; return `m/${this.bip}'/${this.coin.coinNumber}'/${this.account}'/${ this.change }/${index}${this.hardened ? "'" : ""}`; } - pubToXpub(pub) { + static pubToXpub(pub) { let data = bs58check.decode(pub); data = data.slice(4); data = Buffer.concat([Buffer.from("0488b21e", "hex"), data]); @@ -904,14 +926,14 @@ class AddressGenerator { * Checks if a coin has a test in the 'coins' folder. * @param {string} coinName Short name of the coin. */ - coinHasTest(coinName) { - let coinList = []; - const coins = fs.readdirSync(__dirname + "/tests/coins/"); + static coinHasTest(coinName) { + const coinTestList = []; + const coins = fs.readdirSync(`${__dirname}/tests/coins/`); coins.forEach((coin) => { - coinList.push(coin.split(".")[0]); + coinTestList.push(coin.split(".")[0]); }); - return coinList.includes(coinName); + return coinTestList.includes(coinName); } /** @@ -919,11 +941,11 @@ class AddressGenerator { * @returns */ static getSupportedWordLists() { - let supportedLists = []; + const supportedLists = []; - for (const list in bip39.wordlists) { + Object.keys(bip39.wordlists).forEach((list) => { supportedLists.push(list); - } + }); return supportedLists; } diff --git a/package-lock.json b/package-lock.json index e138a4d..ecf0032 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,150 @@ "mocha": "^10.0.0", "nanocurrency-web": "^1.2.2", "stellar-base": "^4.0.3" + }, + "devDependencies": { + "eslint": "^8.32.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-mocha": "^10.1.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-spellcheck": "^0.0.20" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" } }, "node_modules/@types/bn.js": { @@ -37,6 +181,12 @@ "@types/node": "*" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "node_modules/@types/node": { "version": "10.12.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", @@ -58,6 +208,43 @@ "@types/node": "*" } }, + "node_modules/acorn": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -66,6 +253,14 @@ "node": ">=6" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -97,6 +292,61 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, + "node_modules/array-includes": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -105,6 +355,18 @@ "node": "*" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -420,6 +682,28 @@ "resolved": "https://registry.npmjs.org/byte-base64/-/byte-base64-1.1.0.tgz", "integrity": "sha512-56cXelkJrVMdCY9V/3RfDxTh4VfMFCQ5km7B7GkIGfo4bcPL9aACyJLB0Ms3Ezu5rsHmLB2suis96z4fLM03DA==" }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -543,25 +827,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/coinnetworklist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/coinnetworklist/-/coinnetworklist-1.0.1.tgz", @@ -588,6 +853,12 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true + }, "node_modules/crc": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", @@ -644,6 +915,20 @@ "sha.js": "^2.4.8" } }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/crypto-js": { "version": "3.1.9-1", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", @@ -692,6 +977,28 @@ "node": ">=6" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/define-properties": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -700,6 +1007,18 @@ "node": ">=0.3.1" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/ecurve": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/ecurve/-/ecurve-1.0.6.tgz", @@ -742,6 +1061,93 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/es-abstract": { + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz", + "integrity": "sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.3", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.4", + "is-array-buffer": "^3.0.1", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -761,66 +1167,509 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" + "node_modules/eslint": { + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" }, "engines": { - "node": ">=10.0.0" + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" } }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "node_modules/eslint-config-prettier": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", + "dev": true, "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "debug": "^3.2.7", + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" } }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/eslint-module-utils": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", + "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "debug": "^3.2.7" }, "engines": { - "node": ">=8" + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", + "has": "^1.0.3", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-spellcheck": { + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/eslint-plugin-spellcheck/-/eslint-plugin-spellcheck-0.0.20.tgz", + "integrity": "sha512-GJa6vgzWAYqe0elKADAsiBRrhvqBnKyt7tpFSqlCZJsK2W9+K80oMyHhKolA7vJ13H5RCGs5/KCN+mKUyKoAiA==", + "dev": true, + "dependencies": { + "globals": "^13.0.0", + "hunspell-spellchecker": "^1.0.2", + "lodash": "^4.17.15" + }, + "peerDependencies": { + "eslint": ">=0.8.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dependencies": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/find-up": { @@ -846,6 +1695,34 @@ "flat": "cli.js" } }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -864,6 +1741,39 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -880,6 +1790,36 @@ "node": "*" } }, + "node_modules/get-intrinsic": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", + "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -930,6 +1870,75 @@ "node": "*" } }, + "node_modules/globals": { + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -938,6 +1947,57 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -978,6 +2038,15 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/hunspell-spellchecker": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hunspell-spellchecker/-/hunspell-spellchecker-1.0.2.tgz", + "integrity": "sha512-4DwmFAvlz+ChsqLDsZT2cwBsYNXh+oWboemxXtafwKIyItq52xfR4e4kr017sLAoPaSYVofSOvPUfmOAhXyYvw==", + "dev": true, + "bin": { + "hunspell-tojson": "bin/hunspell-tojson.js" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -997,6 +2066,40 @@ } ] }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1017,6 +2120,46 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "optional": true }, + "node_modules/internal-slot": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", + "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz", + "integrity": "sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1028,6 +2171,61 @@ "node": ">=8" } }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1055,6 +2253,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1063,6 +2273,30 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -1071,6 +2305,83 @@ "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1082,6 +2393,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-sdsl": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", + "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-xdr": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/js-xdr/-/js-xdr-1.3.0.tgz", @@ -1102,6 +2441,30 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/keccak": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", @@ -1116,6 +2479,19 @@ "node": ">=10.0.0" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1135,6 +2511,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -1202,6 +2584,15 @@ "node": ">=10" } }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -1273,6 +2664,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", @@ -1288,12 +2685,79 @@ "node-gyp-build-test": "build-test.js" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", + "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/once": { @@ -1304,6 +2768,23 @@ "wrappy": "1" } }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1332,6 +2813,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1348,6 +2841,21 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -1382,6 +2890,52 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", + "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "dev": true, + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/punycode": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", + "integrity": "sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pushdata-bitcoin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz", @@ -1390,6 +2944,32 @@ "bitcoin-ops": "^1.3.0" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/rambda": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/rambda/-/rambda-7.4.0.tgz", + "integrity": "sha512-A9hihu7dUTLOUCM+I8E61V4kRXnN4DwYeK0DwCBydC1MqNI1PidyAtbtpsJlBBzK4icSctEcCQ1bGcLpBuETUQ==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1422,6 +3002,35 @@ "node": ">=8.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1430,6 +3039,57 @@ "node": ">=0.10.0" } }, + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -1450,6 +3110,29 @@ "rlp": "bin/rlp" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1469,6 +3152,20 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -1493,6 +3190,15 @@ "node": ">=10.0.0" } }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -1518,6 +3224,41 @@ "sha.js": "bin.js" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/sodium-native": { "version": "2.4.9", "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-2.4.9.tgz", @@ -1585,15 +3326,35 @@ "node": ">=8" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" + "node_modules/string.prototype.trimend": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string-width/node_modules/strip-ansi": { + "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -1604,6 +3365,15 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -1629,6 +3399,24 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/tiny-secp256k1": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz", @@ -1661,11 +3449,35 @@ "node": ">=8.0" } }, + "node_modules/tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -1674,11 +3486,61 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typeforce": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1692,6 +3554,57 @@ "safe-buffer": "^5.1.1" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wif": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", @@ -1700,6 +3613,15 @@ "bs58check": "<3.0.0" } }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -1721,25 +3643,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 23d8853..ed0e965 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,14 @@ "mocha": "^10.0.0", "nanocurrency-web": "^1.2.2", "stellar-base": "^4.0.3" + }, + "devDependencies": { + "eslint": "^8.32.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-mocha": "^10.1.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-spellcheck": "^0.0.20" } } diff --git a/tests/addressConversion.js b/tests/addressConversion.js index a17691a..6dc94cd 100644 --- a/tests/addressConversion.js +++ b/tests/addressConversion.js @@ -1,27 +1,35 @@ -const assert = require('assert'); -const settings = require("./settings") +const assert = require("assert"); +const settings = require("./settings"); -const Gen = require("../hdAddressGenerator.js") -const genBCH = Gen.withMnemonic(settings.mnemonic,false,"BCH") -const genSLP = Gen.withMnemonic(settings.mnemonic,false,"SLP") +const Gen = require("../hdAddressGenerator.js"); +const genBCH = Gen.withMnemonic(settings.mnemonic, false, "BCH"); +const genSLP = Gen.withMnemonic(settings.mnemonic, false, "SLP"); -const cashAddress = "bitcoincash:qpp88hghht87tvnu5gwf2qnrdcw580hf6cyl07g4z8" -const bitPayAddress = "CNXFy3oa8eUjW3AwMwmpJX4PsEcogf953Z" -const slpAddress = "simpleledger:qqrdkgy7cevz3tgj7w5nlwakhs24twkexsrxvulr5x" +const cashAddress = "bitcoincash:qpp88hghht87tvnu5gwf2qnrdcw580hf6cyl07g4z8"; +const bitPayAddress = "CNXFy3oa8eUjW3AwMwmpJX4PsEcogf953Z"; +const slpAddress = "simpleledger:qqrdkgy7cevz3tgj7w5nlwakhs24twkexsrxvulr5x"; -describe('Address Conversion', async () => { +describe("Address Conversion", async () => { + const bchAddresses = await genBCH.generate(1); + const slpAddresses = await genSLP.generate(1); - const bchAddresses = await genBCH.generate(1) - const slpAddresses = await genSLP.generate(1) - - it('Expect legacy address conversion to CashAddr to match reference', () => { - assert.strictEqual(genBCH.convertAddress(bchAddresses[0].address,"cashAddress"),cashAddress) - }) - it('Expect legacy address conversion to BitPay to match reference', () => { - assert.strictEqual(genBCH.convertAddress(bchAddresses[0].address,"bitpayAddress"),bitPayAddress) - }) - it('Expect legacy address conversion to BCH SLP to match reference', () => { - assert.strictEqual(genBCH.convertAddress(slpAddresses[0].address,"bchSlp"),slpAddress) - }) -}) \ No newline at end of file + it("Expect legacy address conversion to CashAddr to match reference", () => { + assert.strictEqual( + Gen.convertAddress(bchAddresses[0].address, "cashAddress"), + cashAddress + ); + }); + it("Expect legacy address conversion to BitPay to match reference", () => { + assert.strictEqual( + Gen.convertAddress(bchAddresses[0].address, "bitpayAddress"), + bitPayAddress + ); + }); + it("Expect legacy address conversion to BCH SLP to match reference", () => { + assert.strictEqual( + Gen.convertAddress(slpAddresses[0].address, "bchSlp"), + slpAddress + ); + }); +}); diff --git a/tests/bip32Seed.js b/tests/bip32Seed.js index e34f06b..287b555 100644 --- a/tests/bip32Seed.js +++ b/tests/bip32Seed.js @@ -1,11 +1,12 @@ -const assert = require('assert'); -const settings = require("./settings") +const assert = require("assert"); +const settings = require("./settings"); -const Gen = require("../hdAddressGenerator.js") -const gen = Gen.withMnemonic(settings.mnemonic,false,"BTC") +const Gen = require("../hdAddressGenerator.js"); -describe('bip39seed', () => { - it('Expect bip32Seed to match reference in settings.', () => { - assert.strictEqual(gen.bip32Seed,settings.bip32Seed) - }) -}) \ No newline at end of file +const gen = Gen.withMnemonic(settings.mnemonic, false, "BTC"); + +describe("bip39seed", () => { + it("Expect bip32Seed to match reference in settings.", () => { + assert.strictEqual(gen.bip32Seed, settings.bip32Seed); + }); +}); diff --git a/tests/coinTests.js b/tests/coinTests.js index be6e9e7..b4f94e8 100644 --- a/tests/coinTests.js +++ b/tests/coinTests.js @@ -1,328 +1,469 @@ -const assert = require('assert'); -const fs = require("fs") -const settings = require("./settings") -const coins = fs.readdirSync('tests/coins') -const Gen = require("../hdAddressGenerator.js"); +const assert = require("assert"); +const fs = require("fs"); +const settings = require("./settings"); -let coinData = {} +const coins = fs.readdirSync("tests/coins"); +const Gen = require("../hdAddressGenerator"); -if( settings.testCoin == "ALL") { +const coinData = {}; - coins.forEach(coin => { - - coinName = coin.split(".")[0] - coinData[coinName] = {} - coinData[coinName] = require("./coins/"+coin) +if (settings.testCoin === "ALL") { + coins.forEach((coin) => { + const coinName = coin.split(".")[0]; + coinData[coinName] = {}; + coinData[coinName] = require(`./coins/${coin}`); + }); +} else { + coinName = settings.testCoin; + coinData[coinName] = {}; + coinData[coinName] = require(`./coins/${coinName}`); +} - }) +for (const coin in coinData) { + const ref = coinData[coin]; -} else { + describe(`${ref.longName} (${ref.shortName})`, () => { + let bip44 = false; + let bip44WithPassPhrase = false; + let bip44Hardened = false; + let bip44Encrypted = false; + let bip44seed = false; + let bip49 = false; + let bip49Encrypted = false; + let bip84 = false; + let bip32 = false; + let bip32seed = false; + let bip141 = false; + let bip141seed = false; + let withExtPub44 = false; + let withExtPub49 = false; + let withExtPub84 = false; + let withExtPub44Internal = false; - coinName = settings.testCoin - coinData[coinName] = {} - coinData[coinName] = require("./coins/"+coinName+".js") + try { + bip44 = Gen.withMnemonic(settings.mnemonic, false, ref.shortName); + } catch (e) {} + try { + bip44WithPassPhrase = Gen.withMnemonic( + settings.mnemonic, + settings.passphrase, + ref.shortName, + false + ); + } catch (e) {} + try { + bip44Hardened = Gen.withMnemonic( + settings.mnemonic, + false, + ref.shortName, + true + ); + } catch (e) {} + try { + bip44Encrypted = Gen.withMnemonic( + settings.mnemonic, + false, + ref.shortName, + false, + 44, + 0, + 0, + settings.bip38Password + ); + } catch (e) {} + try { + bip44seed = Gen.withSeed(settings.bip32Seed, ref.shortName); + } catch (e) {} + try { + bip49 = Gen.withMnemonic( + settings.mnemonic, + false, + ref.shortName, + false, + 49 + ); + } catch (e) {} + try { + bip49Encrypted = Gen.withMnemonic( + settings.mnemonic, + false, + ref.shortName, + false, + 49, + 0, + 0, + settings.bip38Password + ); + } catch (e) {} + try { + bip84 = Gen.withMnemonic( + settings.mnemonic, + false, + ref.shortName, + false, + 84 + ); + } catch (e) {} + try { + bip32 = Gen.withMnemonicBIP32( + settings.mnemonic, + false, + ref.shortName, + "m/0'/0'", + false + ); + } catch (e) {} + try { + bip32seed = Gen.withSeedBIP32( + settings.bip32Seed, + ref.shortName, + "m/0'/0'", + false + ); + } catch (e) {} + try { + bip141 = Gen.withMnemonicBIP141( + settings.mnemonic, + false, + ref.shortName, + "m/0'/0'", + "p2wpkhInP2sh" + ); + } catch (e) {} + try { + bip141seed = Gen.withSeedBIP141( + settings.bip32Seed, + ref.shortName, + "m/0'/0'", + "p2wpkhInP2sh" + ); + } catch (e) {} + try { + withExtPub44 = Gen.withExtPub(ref.bip44AccountExtPubKey, ref.shortName); + } catch (e) {} + try { + withExtPub44Internal = Gen.withExtPub( + ref.bip44AccountExtPubKey, + ref.shortName, + 44, + 0, + 1 + ); + } catch (e) {} + try { + withExtPub49 = Gen.withExtPub( + ref.bip49AccountExtPubKey, + ref.shortName, + 49 + ); + } catch (e) {} + try { + withExtPub84 = Gen.withExtPub( + ref.bip84AccountExtPubKey, + ref.shortName, + 84 + ); + } catch (e) {} -} + // Test root Keys + if (ref.bip32RootKeyBip44 != undefined) { + it("Expect bip32RootKeyBip44 to match reference.", function () { + assert.strictEqual(bip44.bip32RootKey, ref.bip32RootKeyBip44); + }); + } + if (ref.bip32RootKeyBip49 != undefined) { + it("Expect bip32RootKeyBip49 to match reference.", function () { + assert.strictEqual(bip49.bip32RootKey, ref.bip32RootKeyBip49); + }); + } + if (ref.bip32RootKeyBip84 != undefined) { + it("Expect bip32RootKeyBip84 to match reference.", function () { + assert.strictEqual(bip84.bip32RootKey, ref.bip32RootKeyBip84); + }); + } + if (ref.bip32RootKeyBip84 != undefined) { + it("Expect bip32RootKeyBip84 to match reference.", function () { + assert.strictEqual(bip84.bip32RootKey, ref.bip32RootKeyBip84); + }); + } + if (ref.bip32RootKeyBip44WithPassphrase != undefined) { + it("Expect bip32RootKeyBip44 to match reference when passphrase used.", function () { + assert.strictEqual( + bip44WithPassPhrase.bip32RootKey, + ref.bip32RootKeyBip44WithPassphrase + ); + }); + } + if (ref.bip32RootKeyBip49 != undefined) { + it("Expect bip32RootKeyBip141 to match reference.", function () { + assert.strictEqual(bip141.bip32RootKey, ref.bip32RootKeyBip49); + }); + } + // Test extended pub key as this generally requires all previous keys to be accurate. + if (ref.bip32ExtPubKeyBip44 != undefined) { + it("Expect bip32ExtPubKeyBip44 to match reference.", function () { + assert.strictEqual(bip44.bip32XpubKey, ref.bip32ExtPubKeyBip44); + }); + } + if (ref.bip32ExtPubKeyBip49 != undefined) { + it("Expect bip32ExtPubKeyBip49 to match reference.", function () { + assert.strictEqual(bip49.bip32XpubKey, ref.bip32ExtPubKeyBip49); + }); + } + if (ref.bip32ExtPubKeyBip84 != undefined) { + it("Expect bip32ExtPubKeyBip84 to match reference.", function () { + assert.strictEqual(bip84.bip32XpubKey, ref.bip32ExtPubKeyBip84); + }); + } -for (const coin in coinData) { + // Test address generation. + if ( + ref.addressBip44index0 != undefined && + ref.addressBip44index1 != undefined + ) { + it("Expect addressBip44index0 and addressBip44index1 address, pub, and priv keys to match reference.", async function () { + const addresses = await bip44.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip44index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip44index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip44index0); + assert.strictEqual(addresses[1].address, ref.addressBip44index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip44index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip44index1); + }); + } + + if ( + ref.addressBip44index0 != undefined && + ref.addressBip44index1 != undefined && + bip44seed != false + ) { + it("Expect addressBip44index0 and addressBip44index1 address when generated with seed, pub, and priv keys to match reference.", async function () { + const addresses = await bip44seed.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip44index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip44index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip44index0); + assert.strictEqual(addresses[1].address, ref.addressBip44index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip44index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip44index1); + }); + } + + if (ref.addressBip44HardIndex0 != undefined) { + it("Expect addressBip44HardIndex0 hardened address, pub, and priv keys to match reference.", async function () { + const addresses = await bip44Hardened.generate(1); + + assert.strictEqual(addresses[0].address, ref.addressBip44HardIndex0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip44HardIndex0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip44HardIndex0); + }); + } + + if (ref.addressBip44EncryptedIndex0 != undefined) { + it("Expect bip44Encrypted encrypted address, pub, and priv keys to match reference.", async function () { + const addresses = await bip44Encrypted.generate(1); + + assert.strictEqual( + addresses[0].address, + ref.addressBip44EncryptedIndex0 + ); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip44EncryptedIndex0); + assert.strictEqual( + addresses[0].privKey, + ref.privKeyBip44EncryptedIndex0 + ); + }).timeout(10000); + } + + if ( + ref.addressBip49index0 != undefined && + ref.addressBip49index1 != undefined + ) { + it("Expect addressBip49index0 and addressBip49index1 address, pub, and priv keys to match reference.", async function () { + const addresses = await bip49.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip49index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip49index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip49index0); + assert.strictEqual(addresses[1].address, ref.addressBip49index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip49index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip49index1); + }); + } + + if (ref.addressBip49EncryptedIndex0 != undefined) { + it("Expect bip49Encrypted encrypted address, pub, and priv keys to match reference.", async function () { + const addresses = await bip49Encrypted.generate(1); + + assert.strictEqual( + addresses[0].address, + ref.addressBip49EncryptedIndex0 + ); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip49EncryptedIndex0); + assert.strictEqual( + addresses[0].privKey, + ref.privKeyBip49EncryptedIndex0 + ); + }).timeout(10000); + } + + if ( + ref.addressBip84index0 != undefined && + ref.addressBip84index1 != undefined + ) { + it("Expect addressBip84index0 and addressBip84index1 address, pub, and priv keys to match reference.", async function () { + const addresses = await bip84.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip84index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip84index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip84index0); + assert.strictEqual(addresses[1].address, ref.addressBip84index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip84index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip84index1); + }); + } + + if ( + ref.addressBip32index0 != undefined && + ref.addressBip32index1 != undefined + ) { + it("Expect addressBip32index0 and addressBip32index1 address, pub, and priv keys to match reference.", async function () { + const addresses = await bip32.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip32index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip32index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip32index0); + assert.strictEqual(addresses[1].address, ref.addressBip32index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip32index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip32index1); + }); + } + + if ( + ref.addressBip32index0 != undefined && + ref.addressBip32index1 != undefined && + bip32seed != false + ) { + it("Expect addressBip32index0 and addressBip32index1 address with seed instead of mnemonic, pub, and priv keys to match reference.", async function () { + const addresses = await bip32seed.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip32index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip32index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip32index0); + assert.strictEqual(addresses[1].address, ref.addressBip32index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip32index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip32index1); + }); + } + + if ( + ref.addressBip141index0 != undefined && + ref.addressBip141index1 != undefined + ) { + it("Expect addressBip32index0 and addressBip32index1 address, pub, and priv keys to match reference.", async function () { + const addresses = await bip141.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip141index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip141index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip141index0); + assert.strictEqual(addresses[1].address, ref.addressBip141index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip141index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip141index1); + }); + } + + if ( + ref.addressBip141index0 != undefined && + ref.addressBip141index1 != undefined && + bip141seed != false + ) { + it("Expect addressBip32index0 and addressBip32index1 address with seed instead of mnemonic, pub, and priv keys to match reference.", async function () { + const addresses = await bip141seed.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip141index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip141index0); + assert.strictEqual(addresses[0].privKey, ref.privKeyBip141index0); + assert.strictEqual(addresses[1].address, ref.addressBip141index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip141index1); + assert.strictEqual(addresses[1].privKey, ref.privKeyBip141index1); + }); + } + + if ( + ref.bip44AccountExtPubKey !== undefined && + ref.addressBip44index0 != undefined && + ref.addressBip44index1 != undefined + ) { + it("Expect extPub generated address addressBip44index0 and addressBip44index1 address and pub keys to match reference.", async function () { + const addresses = await withExtPub44.generate(2); + + assert.strictEqual(addresses[0].address, ref.addressBip44index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip44index0); + assert.strictEqual(addresses[0].privKey, ""); + assert.strictEqual(addresses[1].address, ref.addressBip44index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip44index1); + assert.strictEqual(addresses[1].privKey, ""); + }); + } + + if ( + ref.bip44AccountExtPubKey !== undefined && + ref.addressBip44index0 != undefined && + ref.addressBip44index1 != undefined && + ref.shortName == "BTC" + ) { + it("Expect extPub generated address using internal option ( i.e. m/44'/0'/0'/1/0 ) with addressBip44index0 and addressBip44index1 address and pub keys to match reference.", async function () { + const addresses = await withExtPub44Internal.generate(2); + + assert.strictEqual( + addresses[0].address, + ref.addressBip44index0Internal + ); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip44index0Internal); + assert.strictEqual(addresses[0].privKey, ""); + assert.strictEqual( + addresses[1].address, + ref.addressBip44index1Internal + ); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip44index1Internal); + assert.strictEqual(addresses[1].privKey, ""); + }); + } + + if ( + ref.bip49AccountExtPubKey !== undefined && + ref.addressBip49index0 != undefined && + ref.addressBip49index1 != undefined + ) { + it("Expect extPub generated address addressBip49index0 and addressBip49index1 address and pub keys to match reference.", async function () { + const addresses = await withExtPub49.generate(2); - const ref = coinData[coin] - - describe(`${ref.longName} (${ref.shortName})`, async () => { - - let bip44 = false - let bip44WithPassPhrase = false - let bip44Hardened = false - let bip44Encrypted = false - let bip44seed = false - let bip49 = false - let bip49Encrypted = false - let bip84 = false - let bip32 = false - let bip32seed = false - let bip141 = false - let bip141seed = false - let withExtPub44 = false - let withExtPub49 = false - let withExtPub84 = false - let withExtPub44Internal = false - - try{ bip44 = Gen.withMnemonic(settings.mnemonic,false,ref.shortName) } catch(e){} - try{ bip44WithPassPhrase = Gen.withMnemonic(settings.mnemonic,settings.passphrase,ref.shortName,false) } catch(e){} - try{ bip44Hardened = Gen.withMnemonic(settings.mnemonic,false,ref.shortName,true) } catch(e){} - try{ bip44Encrypted = Gen.withMnemonic(settings.mnemonic,false,ref.shortName,false,44,0,0,settings.bip38Password) } catch(e){} - try{ bip44seed = Gen.withSeed(settings.bip32Seed,ref.shortName) } catch(e){} - try{ bip49 = Gen.withMnemonic(settings.mnemonic,false,ref.shortName,false,49) } catch(e){} - try{ bip49Encrypted = Gen.withMnemonic(settings.mnemonic,false,ref.shortName,false,49,0,0,settings.bip38Password) } catch(e){} - try{ bip84 = Gen.withMnemonic(settings.mnemonic,false,ref.shortName,false,84) } catch(e){} - try{ bip32 = Gen.withMnemonicBIP32(settings.mnemonic,false,ref.shortName,"m/0'/0'",false) } catch(e){} - try{ bip32seed = Gen.withSeedBIP32(settings.bip32Seed,ref.shortName,"m/0'/0'",false) } catch(e){} - try{ bip141 = Gen.withMnemonicBIP141(settings.mnemonic,false,ref.shortName,"m/0'/0'","p2wpkhInP2sh") } catch(e){} - try{ bip141seed = Gen.withSeedBIP141(settings.bip32Seed,ref.shortName,"m/0'/0'","p2wpkhInP2sh") } catch(e){} - try{ withExtPub44 = Gen.withExtPub(ref.bip44AccountExtPubKey,ref.shortName ) } catch(e){} - try{ withExtPub44Internal = Gen.withExtPub(ref.bip44AccountExtPubKey,ref.shortName,44,0,1) } catch(e){} - try{ withExtPub49 = Gen.withExtPub(ref.bip49AccountExtPubKey,ref.shortName,49 ) } catch(e){} - try{ withExtPub84 = Gen.withExtPub(ref.bip84AccountExtPubKey,ref.shortName,84 ) } catch(e){} - - - // Test root Keys - if ( ref.bip32RootKeyBip44 != undefined ){ - it('Expect bip32RootKeyBip44 to match reference.', () => { - assert.strictEqual(bip44.bip32RootKey,ref.bip32RootKeyBip44) - }) - } - if ( ref.bip32RootKeyBip49 != undefined ){ - it('Expect bip32RootKeyBip49 to match reference.', () => { - assert.strictEqual(bip49.bip32RootKey,ref.bip32RootKeyBip49) - }) - } - if ( ref.bip32RootKeyBip84 != undefined ){ - it('Expect bip32RootKeyBip84 to match reference.', () => { - assert.strictEqual(bip84.bip32RootKey,ref.bip32RootKeyBip84) - }) - } - if ( ref.bip32RootKeyBip84 != undefined ){ - it('Expect bip32RootKeyBip84 to match reference.', () => { - assert.strictEqual(bip84.bip32RootKey,ref.bip32RootKeyBip84) - }) - } - if ( ref.bip32RootKeyBip44WithPassphrase != undefined ){ - it('Expect bip32RootKeyBip44 to match reference when passphrase used.', () => { - assert.strictEqual(bip44WithPassPhrase.bip32RootKey,ref.bip32RootKeyBip44WithPassphrase) - }) - } - if ( ref.bip32RootKeyBip49 != undefined ){ - it('Expect bip32RootKeyBip141 to match reference.', () => { - assert.strictEqual(bip141.bip32RootKey,ref.bip32RootKeyBip49) - }) - } - - - // Test extended pub key as this generally requires all previous keys to be accurate. - if ( ref.bip32ExtPubKeyBip44 != undefined ){ - it('Expect bip32ExtPubKeyBip44 to match reference.', () => { - assert.strictEqual(bip44.bip32XpubKey,ref.bip32ExtPubKeyBip44) - }) - } - if ( ref.bip32ExtPubKeyBip49 != undefined ){ - it('Expect bip32ExtPubKeyBip49 to match reference.', () => { - assert.strictEqual(bip49.bip32XpubKey,ref.bip32ExtPubKeyBip49) - }) - } - if ( ref.bip32ExtPubKeyBip84 != undefined ){ - it('Expect bip32ExtPubKeyBip84 to match reference.', () => { - assert.strictEqual(bip84.bip32XpubKey,ref.bip32ExtPubKeyBip84) - }) - } - - // Test address generation. - if ( ref.addressBip44index0 != undefined && ref.addressBip44index1 != undefined ){ - it('Expect addressBip44index0 and addressBip44index1 address, pub, and priv keys to match reference.', async () => { - let addresses = await bip44.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip44index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip44index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip44index0) - assert.strictEqual(addresses[1].address,ref.addressBip44index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip44index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip44index1) - - }) - } - - if ( ref.addressBip44index0 != undefined && ref.addressBip44index1 != undefined && bip44seed != false ){ - it('Expect addressBip44index0 and addressBip44index1 address when generated with seed, pub, and priv keys to match reference.', async () => { - let addresses = await bip44seed.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip44index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip44index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip44index0) - assert.strictEqual(addresses[1].address,ref.addressBip44index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip44index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip44index1) - - }) - } - - if ( ref.addressBip44HardIndex0 != undefined ){ - it('Expect addressBip44HardIndex0 hardened address, pub, and priv keys to match reference.', async () => { - let addresses = await bip44Hardened.generate(1) - - assert.strictEqual(addresses[0].address,ref.addressBip44HardIndex0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip44HardIndex0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip44HardIndex0) - - }) - } - - if ( ref.addressBip44EncryptedIndex0 != undefined ){ - it('Expect bip44Encrypted encrypted address, pub, and priv keys to match reference.', async () => { - let addresses = await bip44Encrypted.generate(1) - - assert.strictEqual(addresses[0].address,ref.addressBip44EncryptedIndex0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip44EncryptedIndex0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip44EncryptedIndex0) - - }).timeout(10000) - } - - if ( ref.addressBip49index0 != undefined && ref.addressBip49index1 != undefined ){ - it('Expect addressBip49index0 and addressBip49index1 address, pub, and priv keys to match reference.', async () => { - let addresses = await bip49.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip49index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip49index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip49index0) - assert.strictEqual(addresses[1].address,ref.addressBip49index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip49index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip49index1) - - }) - } - - if ( ref.addressBip49EncryptedIndex0 != undefined ){ - it('Expect bip49Encrypted encrypted address, pub, and priv keys to match reference.', async () => { - let addresses = await bip49Encrypted.generate(1) - - assert.strictEqual(addresses[0].address,ref.addressBip49EncryptedIndex0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip49EncryptedIndex0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip49EncryptedIndex0) - - }).timeout(10000) - } - - if ( ref.addressBip84index0 != undefined && ref.addressBip84index1 != undefined ){ - it('Expect addressBip84index0 and addressBip84index1 address, pub, and priv keys to match reference.', async () => { - let addresses = await bip84.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip84index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip84index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip84index0) - assert.strictEqual(addresses[1].address,ref.addressBip84index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip84index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip84index1) - - }) - } - - if ( ref.addressBip32index0 != undefined && ref.addressBip32index1 != undefined ){ - it('Expect addressBip32index0 and addressBip32index1 address, pub, and priv keys to match reference.', async () => { - let addresses = await bip32.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip32index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip32index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip32index0) - assert.strictEqual(addresses[1].address,ref.addressBip32index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip32index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip32index1) - - }) - } - - if ( ref.addressBip32index0 != undefined && ref.addressBip32index1 != undefined && bip32seed != false ){ - it('Expect addressBip32index0 and addressBip32index1 address with seed instead of mnemonic, pub, and priv keys to match reference.', async () => { - let addresses = await bip32seed.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip32index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip32index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip32index0) - assert.strictEqual(addresses[1].address,ref.addressBip32index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip32index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip32index1) - - }) - } - - if ( ref.addressBip141index0 != undefined && ref.addressBip141index1 != undefined ){ - it('Expect addressBip32index0 and addressBip32index1 address, pub, and priv keys to match reference.', async () => { - let addresses = await bip141.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip141index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip141index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip141index0) - assert.strictEqual(addresses[1].address,ref.addressBip141index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip141index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip141index1) - - }) - } - - if ( ref.addressBip141index0 != undefined && ref.addressBip141index1 != undefined && bip141seed != false ){ - it('Expect addressBip32index0 and addressBip32index1 address with seed instead of mnemonic, pub, and priv keys to match reference.', async () => { - let addresses = await bip141seed.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip141index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip141index0) - assert.strictEqual(addresses[0].privKey,ref.privKeyBip141index0) - assert.strictEqual(addresses[1].address,ref.addressBip141index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip141index1) - assert.strictEqual(addresses[1].privKey,ref.privKeyBip141index1) - - }) - } - - if ( ref.bip44AccountExtPubKey !== undefined && ref.addressBip44index0 != undefined && ref.addressBip44index1 != undefined ){ - it('Expect extPub generated address addressBip44index0 and addressBip44index1 address and pub keys to match reference.', async () => { - - let addresses = await withExtPub44.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip44index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip44index0) - assert.strictEqual(addresses[0].privKey,'') - assert.strictEqual(addresses[1].address,ref.addressBip44index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip44index1) - assert.strictEqual(addresses[1].privKey,'') - - }) - } - - if ( ref.bip44AccountExtPubKey !== undefined && ref.addressBip44index0 != undefined && ref.addressBip44index1 != undefined && ref.shortName == "BTC" ){ - it('Expect extPub generated address using internal option ( i.e. m/44\'/0\'/0\'/1/0 ) with addressBip44index0 and addressBip44index1 address and pub keys to match reference.', async () => { - - let addresses = await withExtPub44Internal.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip44index0Internal) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip44index0Internal) - assert.strictEqual(addresses[0].privKey,'') - assert.strictEqual(addresses[1].address,ref.addressBip44index1Internal) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip44index1Internal) - assert.strictEqual(addresses[1].privKey,'') - - }) - } - - if ( ref.bip49AccountExtPubKey !== undefined && ref.addressBip49index0 != undefined && ref.addressBip49index1 != undefined ){ - it('Expect extPub generated address addressBip49index0 and addressBip49index1 address and pub keys to match reference.', async () => { - - let addresses = await withExtPub49.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip49index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip49index0) - assert.strictEqual(addresses[0].privKey,'') - assert.strictEqual(addresses[1].address,ref.addressBip49index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip49index1) - assert.strictEqual(addresses[1].privKey,'') - - }) - } - - if ( ref.bip84AccountExtPubKey !== undefined && ref.addressBip84index0 != undefined && ref.addressBip84index1 != undefined ){ - it('Expect extPub generated address addressBip84index0 and addressBip84index1 address and pub keys to match reference.', async () => { - - let addresses = await withExtPub84.generate(2) - - assert.strictEqual(addresses[0].address,ref.addressBip84index0) - assert.strictEqual(addresses[0].pubKey,ref.pubKeyBip84index0) - assert.strictEqual(addresses[0].privKey,'') - assert.strictEqual(addresses[1].address,ref.addressBip84index1) - assert.strictEqual(addresses[1].pubKey,ref.pubKeyBip84index1) - assert.strictEqual(addresses[1].privKey,'') - - }) - } - - }) + assert.strictEqual(addresses[0].address, ref.addressBip49index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip49index0); + assert.strictEqual(addresses[0].privKey, ""); + assert.strictEqual(addresses[1].address, ref.addressBip49index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip49index1); + assert.strictEqual(addresses[1].privKey, ""); + }); + } + if ( + ref.bip84AccountExtPubKey !== undefined && + ref.addressBip84index0 != undefined && + ref.addressBip84index1 != undefined + ) { + it("Expect extPub generated address addressBip84index0 and addressBip84index1 address and pub keys to match reference.", async function () { + const addresses = await withExtPub84.generate(2); + assert.strictEqual(addresses[0].address, ref.addressBip84index0); + assert.strictEqual(addresses[0].pubKey, ref.pubKeyBip84index0); + assert.strictEqual(addresses[0].privKey, ""); + assert.strictEqual(addresses[1].address, ref.addressBip84index1); + assert.strictEqual(addresses[1].pubKey, ref.pubKeyBip84index1); + assert.strictEqual(addresses[1].privKey, ""); + }); + } + }); } diff --git a/tests/settings.js b/tests/settings.js index 119b089..86af22f 100644 --- a/tests/settings.js +++ b/tests/settings.js @@ -1,7 +1,9 @@ module.exports = { - mnemonic:"brand improve symbol strike say focus ginger imitate ginger appear wheel brand swear relief zero", - bip32Seed:"09a0a3b58d10bbc456254f1915c2627d8f0e9968922505b39dbb08f6a5dc9dafdee40cff16aa488add7ee4e2ec6eaf40425d3f2aea81c18c2c314d58885e923a", - passphrase:"testPhrase", - bip38Password:"test", - testCoin:"ALL", // Should be 'ALL' to test all or the short name for the coin i.e. 'BTC' -} + mnemonic: + "brand improve symbol strike say focus ginger imitate ginger appear wheel brand swear relief zero", + bip32Seed: + "09a0a3b58d10bbc456254f1915c2627d8f0e9968922505b39dbb08f6a5dc9dafdee40cff16aa488add7ee4e2ec6eaf40425d3f2aea81c18c2c314d58885e923a", + passphrase: "testPhrase", + bip38Password: "test", + testCoin: "ALL", // Should be 'ALL' to test all or the short name for the coin i.e. 'BTC' +};