├── create.js ├── node_modules ├── .bin │ └── sha.js ├── .package-lock.json ├── @noble │ └── hashes │ │ ├── LICENSE │ │ ├── README.md │ │ ├── _assert.d.ts │ │ ├── _assert.js │ │ ├── _assert.js.map │ │ ├── _blake2.d.ts │ │ ├── _blake2.js │ │ ├── _blake2.js.map │ │ ├── _sha2.d.ts │ │ ├── _sha2.js │ │ ├── _sha2.js.map │ │ ├── _u64.d.ts │ │ ├── _u64.js │ │ ├── _u64.js.map │ │ ├── argon2.d.ts │ │ ├── argon2.js │ │ ├── argon2.js.map │ │ ├── blake2b.d.ts │ │ ├── blake2b.js │ │ ├── blake2b.js.map │ │ ├── blake2s.d.ts │ │ ├── blake2s.js │ │ ├── blake2s.js.map │ │ ├── blake3.d.ts │ │ ├── blake3.js │ │ ├── blake3.js.map │ │ ├── crypto.d.ts │ │ ├── crypto.js │ │ ├── crypto.js.map │ │ ├── cryptoNode.d.ts │ │ ├── cryptoNode.js │ │ ├── cryptoNode.js.map │ │ ├── eskdf.d.ts │ │ ├── eskdf.js │ │ ├── eskdf.js.map │ │ ├── esm │ │ ├── _assert.js │ │ ├── _assert.js.map │ │ ├── _blake2.js │ │ ├── _blake2.js.map │ │ ├── _sha2.js │ │ ├── _sha2.js.map │ │ ├── _u64.js │ │ ├── _u64.js.map │ │ ├── argon2.js │ │ ├── argon2.js.map │ │ ├── blake2b.js │ │ ├── blake2b.js.map │ │ ├── blake2s.js │ │ ├── blake2s.js.map │ │ ├── blake3.js │ │ ├── blake3.js.map │ │ ├── crypto.js │ │ ├── crypto.js.map │ │ ├── cryptoNode.js │ │ ├── cryptoNode.js.map │ │ ├── eskdf.js │ │ ├── eskdf.js.map │ │ ├── hkdf.js │ │ ├── hkdf.js.map │ │ ├── hmac.js │ │ ├── hmac.js.map │ │ ├── index.js │ │ ├── index.js.map │ │ ├── package.json │ │ ├── pbkdf2.js │ │ ├── pbkdf2.js.map │ │ ├── ripemd160.js │ │ ├── ripemd160.js.map │ │ ├── scrypt.js │ │ ├── scrypt.js.map │ │ ├── sha1.js │ │ ├── sha1.js.map │ │ ├── sha2.js │ │ ├── sha2.js.map │ │ ├── sha256.js │ │ ├── sha256.js.map │ │ ├── sha3-addons.js │ │ ├── sha3-addons.js.map │ │ ├── sha3.js │ │ ├── sha3.js.map │ │ ├── sha512.js │ │ ├── sha512.js.map │ │ ├── utils.js │ │ └── utils.js.map │ │ ├── hkdf.d.ts │ │ ├── hkdf.js │ │ ├── hkdf.js.map │ │ ├── hmac.d.ts │ │ ├── hmac.js │ │ ├── hmac.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── package.json │ │ ├── pbkdf2.d.ts │ │ ├── pbkdf2.js │ │ ├── pbkdf2.js.map │ │ ├── ripemd160.d.ts │ │ ├── ripemd160.js │ │ ├── ripemd160.js.map │ │ ├── scrypt.d.ts │ │ ├── scrypt.js │ │ ├── scrypt.js.map │ │ ├── sha1.d.ts │ │ ├── sha1.js │ │ ├── sha1.js.map │ │ ├── sha2.d.ts │ │ ├── sha2.js │ │ ├── sha2.js.map │ │ ├── sha256.d.ts │ │ ├── sha256.js │ │ ├── sha256.js.map │ │ ├── sha3-addons.d.ts │ │ ├── sha3-addons.js │ │ ├── sha3-addons.js.map │ │ ├── sha3.d.ts │ │ ├── sha3.js │ │ ├── sha3.js.map │ │ ├── sha512.d.ts │ │ ├── sha512.js │ │ ├── sha512.js.map │ │ ├── src │ │ ├── _assert.ts │ │ ├── _blake2.ts │ │ ├── _sha2.ts │ │ ├── _u64.ts │ │ ├── argon2.ts │ │ ├── blake2b.ts │ │ ├── blake2s.ts │ │ ├── blake3.ts │ │ ├── crypto.ts │ │ ├── cryptoNode.ts │ │ ├── eskdf.ts │ │ ├── hkdf.ts │ │ ├── hmac.ts │ │ ├── index.ts │ │ ├── pbkdf2.ts │ │ ├── ripemd160.ts │ │ ├── scrypt.ts │ │ ├── sha1.ts │ │ ├── sha2.ts │ │ ├── sha256.ts │ │ ├── sha3-addons.ts │ │ ├── sha3.ts │ │ ├── sha512.ts │ │ └── utils.ts │ │ ├── utils.d.ts │ │ ├── utils.js │ │ └── utils.js.map ├── @scure │ └── base │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.ts │ │ ├── lib │ │ ├── esm │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── index.d.ts │ │ ├── index.d.ts.map │ │ └── index.js │ │ └── package.json ├── base-x │ ├── LICENSE.md │ ├── README.md │ ├── package.json │ └── src │ │ ├── index.d.ts │ │ └── index.js ├── bech32 │ ├── LICENSE │ ├── README.md │ ├── dist │ │ ├── index.d.ts │ │ └── index.js │ └── package.json ├── bip174 │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── src │ │ └── lib │ │ ├── combiner │ │ ├── index.d.ts │ │ └── index.js │ │ ├── converter │ │ ├── global │ │ │ ├── globalXpub.d.ts │ │ │ ├── globalXpub.js │ │ │ ├── unsignedTx.d.ts │ │ │ └── unsignedTx.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── input │ │ │ ├── finalScriptSig.d.ts │ │ │ ├── finalScriptSig.js │ │ │ ├── finalScriptWitness.d.ts │ │ │ ├── finalScriptWitness.js │ │ │ ├── nonWitnessUtxo.d.ts │ │ │ ├── nonWitnessUtxo.js │ │ │ ├── partialSig.d.ts │ │ │ ├── partialSig.js │ │ │ ├── porCommitment.d.ts │ │ │ ├── porCommitment.js │ │ │ ├── sighashType.d.ts │ │ │ ├── sighashType.js │ │ │ ├── tapKeySig.d.ts │ │ │ ├── tapKeySig.js │ │ │ ├── tapLeafScript.d.ts │ │ │ ├── tapLeafScript.js │ │ │ ├── tapMerkleRoot.d.ts │ │ │ ├── tapMerkleRoot.js │ │ │ ├── tapScriptSig.d.ts │ │ │ ├── tapScriptSig.js │ │ │ ├── witnessUtxo.d.ts │ │ │ └── witnessUtxo.js │ │ ├── output │ │ │ ├── tapTree.d.ts │ │ │ └── tapTree.js │ │ ├── shared │ │ │ ├── bip32Derivation.d.ts │ │ │ ├── bip32Derivation.js │ │ │ ├── checkPubkey.d.ts │ │ │ ├── checkPubkey.js │ │ │ ├── redeemScript.d.ts │ │ │ ├── redeemScript.js │ │ │ ├── tapBip32Derivation.d.ts │ │ │ ├── tapBip32Derivation.js │ │ │ ├── tapInternalKey.d.ts │ │ │ ├── tapInternalKey.js │ │ │ ├── witnessScript.d.ts │ │ │ └── witnessScript.js │ │ ├── tools.d.ts │ │ ├── tools.js │ │ ├── varint.d.ts │ │ └── varint.js │ │ ├── interfaces.d.ts │ │ ├── interfaces.js │ │ ├── parser │ │ ├── fromBuffer.d.ts │ │ ├── fromBuffer.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── toBuffer.d.ts │ │ └── toBuffer.js │ │ ├── psbt.d.ts │ │ ├── psbt.js │ │ ├── typeFields.d.ts │ │ ├── typeFields.js │ │ ├── utils.d.ts │ │ └── utils.js ├── bip32 │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── bip32.js │ │ ├── crypto.js │ │ ├── index.js │ │ └── testecc.js │ └── types │ │ ├── bip32.d.ts │ │ ├── crypto.d.ts │ │ ├── index.d.ts │ │ └── testecc.d.ts ├── bip39 │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── _wordlists.js │ │ ├── index.js │ │ └── wordlists │ │ │ ├── chinese_simplified.json │ │ │ ├── chinese_traditional.json │ │ │ ├── czech.json │ │ │ ├── english.json │ │ │ ├── french.json │ │ │ ├── italian.json │ │ │ ├── japanese.json │ │ │ ├── korean.json │ │ │ ├── portuguese.json │ │ │ └── spanish.json │ └── types │ │ ├── _wordlists.d.ts │ │ ├── index.d.ts │ │ └── wordlists.d.ts ├── bitcoinjs-lib │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── src │ │ ├── address.d.ts │ │ ├── address.js │ │ ├── bip66.d.ts │ │ ├── bip66.js │ │ ├── block.d.ts │ │ ├── block.js │ │ ├── bufferutils.d.ts │ │ ├── bufferutils.js │ │ ├── crypto.d.ts │ │ ├── crypto.js │ │ ├── ecc_lib.d.ts │ │ ├── ecc_lib.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── merkle.d.ts │ │ ├── merkle.js │ │ ├── networks.d.ts │ │ ├── networks.js │ │ ├── ops.d.ts │ │ ├── ops.js │ │ ├── payments │ │ ├── bip341.d.ts │ │ ├── bip341.js │ │ ├── embed.d.ts │ │ ├── embed.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── lazy.d.ts │ │ ├── lazy.js │ │ ├── p2ms.d.ts │ │ ├── p2ms.js │ │ ├── p2pk.d.ts │ │ ├── p2pk.js │ │ ├── p2pkh.d.ts │ │ ├── p2pkh.js │ │ ├── p2sh.d.ts │ │ ├── p2sh.js │ │ ├── p2tr.d.ts │ │ ├── p2tr.js │ │ ├── p2wpkh.d.ts │ │ ├── p2wpkh.js │ │ ├── p2wsh.d.ts │ │ └── p2wsh.js │ │ ├── psbt.d.ts │ │ ├── psbt.js │ │ ├── psbt │ │ ├── bip371.d.ts │ │ ├── bip371.js │ │ ├── psbtutils.d.ts │ │ └── psbtutils.js │ │ ├── push_data.d.ts │ │ ├── push_data.js │ │ ├── script.d.ts │ │ ├── script.js │ │ ├── script_number.d.ts │ │ ├── script_number.js │ │ ├── script_signature.d.ts │ │ ├── script_signature.js │ │ ├── transaction.d.ts │ │ ├── transaction.js │ │ ├── types.d.ts │ │ └── types.js ├── bs58 │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── index.d.ts │ ├── index.js │ └── package.json ├── bs58check │ ├── LICENSE │ ├── README.md │ ├── base.js │ ├── index.d.ts │ ├── index.js │ └── package.json ├── cipher-base │ ├── .eslintrc │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── package.json │ └── test.js ├── create-hash │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── browser.js │ ├── index.js │ ├── md5.js │ ├── package.json │ └── test.js ├── hash-base │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── inherits │ ├── LICENSE │ ├── README.md │ ├── inherits.js │ ├── inherits_browser.js │ └── package.json ├── md5.js │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── readable-stream │ ├── CONTRIBUTING.md │ ├── GOVERNANCE.md │ ├── LICENSE │ ├── README.md │ ├── errors-browser.js │ ├── errors.js │ ├── experimentalWarning.js │ ├── lib │ │ ├── _stream_duplex.js │ │ ├── _stream_passthrough.js │ │ ├── _stream_readable.js │ │ ├── _stream_transform.js │ │ ├── _stream_writable.js │ │ └── internal │ │ │ └── streams │ │ │ ├── async_iterator.js │ │ │ ├── buffer_list.js │ │ │ ├── destroy.js │ │ │ ├── end-of-stream.js │ │ │ ├── from-browser.js │ │ │ ├── from.js │ │ │ ├── pipeline.js │ │ │ ├── state.js │ │ │ ├── stream-browser.js │ │ │ └── stream.js │ ├── package.json │ ├── readable-browser.js │ └── readable.js ├── ripemd160 │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── safe-buffer │ ├── LICENSE │ ├── README.md │ ├── index.d.ts │ ├── index.js │ └── package.json ├── sha.js │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bin.js │ ├── hash.js │ ├── index.js │ ├── package.json │ ├── sha.js │ ├── sha1.js │ ├── sha224.js │ ├── sha256.js │ ├── sha384.js │ ├── sha512.js │ └── test │ │ ├── hash.js │ │ ├── test.js │ │ └── vectors.js ├── string_decoder │ ├── LICENSE │ ├── README.md │ ├── lib │ │ └── string_decoder.js │ └── package.json ├── tiny-secp256k1 │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── cjs │ │ │ ├── index.cjs │ │ │ ├── rand.browser.cjs │ │ │ ├── rand.cjs │ │ │ ├── validate.cjs │ │ │ ├── validate_error.cjs │ │ │ ├── wasm_loader.browser.cjs │ │ │ ├── wasm_loader.cjs │ │ │ └── wasm_path_cjs.cjs │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── rand.browser.d.ts │ │ ├── rand.browser.js │ │ ├── rand.d.ts │ │ ├── rand.js │ │ ├── secp256k1.wasm │ │ ├── validate.d.ts │ │ ├── validate.js │ │ ├── validate_error.d.ts │ │ ├── validate_error.js │ │ ├── wasm_loader.browser.d.ts │ │ ├── wasm_loader.browser.js │ │ ├── wasm_loader.d.ts │ │ ├── wasm_loader.js │ │ ├── wasm_path.d.ts │ │ └── wasm_path.js │ └── package.json ├── typeforce │ ├── LICENSE │ ├── README.md │ ├── async.js │ ├── errors.js │ ├── extra.js │ ├── index.js │ ├── native.js │ ├── nothrow.js │ └── package.json ├── uint8array-tools │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── src │ │ ├── cjs │ │ ├── browser.cjs │ │ ├── index.cjs │ │ └── index.d.ts │ │ └── mjs │ │ ├── browser.js │ │ └── index.js ├── util-deprecate │ ├── History.md │ ├── LICENSE │ ├── README.md │ ├── browser.js │ ├── node.js │ └── package.json ├── varuint-bitcoin │ ├── LICENSE │ ├── README.md │ ├── index.d.ts │ ├── index.js │ └── package.json └── wif │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── node_modules │ ├── base-x │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── package.json │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── index.js │ ├── bs58 │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── index.js │ │ └── package.json │ └── bs58check │ │ ├── LICENSE │ │ ├── README.md │ │ ├── base.js │ │ ├── index.js │ │ └── package.json │ ├── package.json │ └── test │ ├── fixtures.json │ └── index.js ├── package-lock.json └── package.json /create.js: -------------------------------------------------------------------------------- 1 | const { BIP32Factory } = require("bip32"); 2 | const sep = require("tiny-secp256k1"); 3 | const bip39 = require("bip39"); 4 | const bitcoin = require("bitcoinjs-lib"); 5 | 6 | const network = bitcoin.networks.testnet; 7 | 8 | const path = `m/44'/1'/0'/0`; 9 | let mnemonic = bip39.generateMnemonic(); 10 | let seed = bip39.mnemonicToSeedSync(mnemonic); 11 | let root = BIP32Factory(sep).fromSeed(seed, network); 12 | 13 | let account = root.derivePath(path); 14 | let node = account.derive(0).derive(0); 15 | 16 | let btcAdd = bitcoin.payments.p2pkh({ 17 | pubkey: node.publicKey, 18 | network: network, 19 | }).address; 20 | 21 | console.log(` 22 | Bitcoin Wallet Generated: 23 | - Address: ${btcAdd}, 24 | - Key: ${node.toWIF()}, 25 | - Mnemonic: ${mnemonic} 26 | `); 27 | -------------------------------------------------------------------------------- /node_modules/.bin/sha.js: -------------------------------------------------------------------------------- 1 | ../sha.js/bin.js -------------------------------------------------------------------------------- /node_modules/@noble/hashes/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Paul Miller (https://paulmillr.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the “Software”), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/@noble/hashes/_assert.d.ts: -------------------------------------------------------------------------------- 1 | declare function number(n: number): void; 2 | declare function bool(b: boolean): void; 3 | declare function bytes(b: Uint8Array | undefined, ...lengths: number[]): void; 4 | type Hash = { 5 | (data: Uint8Array): Uint8Array; 6 | blockLen: number; 7 | outputLen: number; 8 | create: any; 9 | }; 10 | declare function hash(hash: Hash): void; 11 | declare function exists(instance: any, checkFinished?: boolean): void; 12 | declare function output(out: any, instance: any): void; 13 | export { number, bool, bytes, hash, exists, output }; 14 | declare const assert: { 15 | number: typeof number; 16 | bool: typeof bool; 17 | bytes: typeof bytes; 18 | hash: typeof hash; 19 | exists: typeof exists; 20 | output: typeof output; 21 | }; 22 | export default assert; 23 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/_assert.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"_assert.js","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":";;;AAAA,SAAS,MAAM,CAAC,CAAS;IACvB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;AACzF,CAAC;AA6CQ,wBAAM;AA3Cf,SAAS,IAAI,CAAC,CAAU;IACtB,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAyCgB,oBAAI;AAvCrB,oBAAoB;AACpB,SAAS,OAAO,CAAC,CAAU;IACzB,OAAO,CACL,CAAC,YAAY,UAAU;QACvB,CAAC,CAAC,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,CAAyB,EAAE,GAAG,OAAiB;IAC5D,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,iCAAiC,OAAO,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3F,CAAC;AA2BsB,sBAAK;AAnB5B,SAAS,IAAI,CAAC,IAAU;IACtB,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU;QACjE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAc6B,oBAAI;AAZlC,SAAS,MAAM,CAAC,QAAa,EAAE,aAAa,GAAG,IAAI;IACjD,IAAI,QAAQ,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5E,IAAI,aAAa,IAAI,QAAQ,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACnG,CAAC;AASmC,wBAAM;AAR1C,SAAS,MAAM,CAAC,GAAQ,EAAE,QAAa;IACrC,KAAK,CAAC,GAAG,CAAC,CAAC;IACX,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC/B,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,yDAAyD,GAAG,EAAE,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAE2C,wBAAM;AAElD,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7D,kBAAe,MAAM,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/_blake2.d.ts: -------------------------------------------------------------------------------- 1 | import { Hash, Input } from './utils.js'; 2 | export declare const SIGMA: Uint8Array; 3 | export type BlakeOpts = { 4 | dkLen?: number; 5 | key?: Input; 6 | salt?: Input; 7 | personalization?: Input; 8 | }; 9 | export declare abstract class BLAKE2> extends Hash { 10 | readonly blockLen: number; 11 | outputLen: number; 12 | protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; 13 | protected abstract get(): number[]; 14 | protected abstract set(...args: number[]): void; 15 | abstract destroy(): void; 16 | protected buffer: Uint8Array; 17 | protected buffer32: Uint32Array; 18 | protected length: number; 19 | protected pos: number; 20 | protected finished: boolean; 21 | protected destroyed: boolean; 22 | constructor(blockLen: number, outputLen: number, opts: BlakeOpts | undefined, keyLen: number, saltLen: number, persLen: number); 23 | update(data: Input): this; 24 | digestInto(out: Uint8Array): void; 25 | digest(): Uint8Array; 26 | _cloneInto(to?: T): T; 27 | } 28 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/_sha2.d.ts: -------------------------------------------------------------------------------- 1 | import { Hash, Input } from './utils.js'; 2 | export declare abstract class SHA2> extends Hash { 3 | readonly blockLen: number; 4 | outputLen: number; 5 | readonly padOffset: number; 6 | readonly isLE: boolean; 7 | protected abstract process(buf: DataView, offset: number): void; 8 | protected abstract get(): number[]; 9 | protected abstract set(...args: number[]): void; 10 | abstract destroy(): void; 11 | protected abstract roundClean(): void; 12 | protected buffer: Uint8Array; 13 | protected view: DataView; 14 | protected finished: boolean; 15 | protected length: number; 16 | protected pos: number; 17 | protected destroyed: boolean; 18 | constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); 19 | update(data: Input): this; 20 | digestInto(out: Uint8Array): void; 21 | digest(): Uint8Array; 22 | _cloneInto(to?: T): T; 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/argon2.d.ts: -------------------------------------------------------------------------------- 1 | import { Input } from './utils.js'; 2 | export type ArgonOpts = { 3 | t: number; 4 | m: number; 5 | p: number; 6 | version?: number; 7 | key?: Input; 8 | personalization?: Input; 9 | dkLen?: number; 10 | asyncTick?: number; 11 | maxmem?: number; 12 | onProgress?: (progress: number) => void; 13 | }; 14 | export declare const argon2d: (password: Input, salt: Input, opts: ArgonOpts) => Uint8Array; 15 | export declare const argon2i: (password: Input, salt: Input, opts: ArgonOpts) => Uint8Array; 16 | export declare const argon2id: (password: Input, salt: Input, opts: ArgonOpts) => Uint8Array; 17 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/blake2b.d.ts: -------------------------------------------------------------------------------- 1 | import { BLAKE2, BlakeOpts } from './_blake2.js'; 2 | declare class BLAKE2b extends BLAKE2 { 3 | private v0l; 4 | private v0h; 5 | private v1l; 6 | private v1h; 7 | private v2l; 8 | private v2h; 9 | private v3l; 10 | private v3h; 11 | private v4l; 12 | private v4h; 13 | private v5l; 14 | private v5h; 15 | private v6l; 16 | private v6h; 17 | private v7l; 18 | private v7h; 19 | constructor(opts?: BlakeOpts); 20 | protected get(): [ 21 | number, 22 | number, 23 | number, 24 | number, 25 | number, 26 | number, 27 | number, 28 | number, 29 | number, 30 | number, 31 | number, 32 | number, 33 | number, 34 | number, 35 | number, 36 | number 37 | ]; 38 | protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; 39 | protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; 40 | destroy(): void; 41 | } 42 | /** 43 | * BLAKE2b - optimized for 64-bit platforms. JS doesn't have uint64, so it's slower than BLAKE2s. 44 | * @param msg - message that would be hashed 45 | * @param opts - dkLen, key, salt, personalization 46 | */ 47 | export declare const blake2b: { 48 | (msg: import("./utils.js").Input, opts?: BlakeOpts | undefined): Uint8Array; 49 | outputLen: number; 50 | blockLen: number; 51 | create(opts: BlakeOpts): import("./utils.js").Hash; 52 | }; 53 | export {}; 54 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/blake2s.d.ts: -------------------------------------------------------------------------------- 1 | import { BLAKE2, BlakeOpts } from './_blake2.js'; 2 | export declare const IV: Uint32Array; 3 | export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): { 4 | v0: number; 5 | v1: number; 6 | v2: number; 7 | v3: number; 8 | v4: number; 9 | v5: number; 10 | v6: number; 11 | v7: number; 12 | v8: number; 13 | v9: number; 14 | v10: number; 15 | v11: number; 16 | v12: number; 17 | v13: number; 18 | v14: number; 19 | v15: number; 20 | }; 21 | declare class BLAKE2s extends BLAKE2 { 22 | private v0; 23 | private v1; 24 | private v2; 25 | private v3; 26 | private v4; 27 | private v5; 28 | private v6; 29 | private v7; 30 | constructor(opts?: BlakeOpts); 31 | protected get(): [number, number, number, number, number, number, number, number]; 32 | protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; 33 | protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; 34 | destroy(): void; 35 | } 36 | /** 37 | * BLAKE2s - optimized for 32-bit platforms. JS doesn't have uint64, so it's faster than BLAKE2b. 38 | * @param msg - message that would be hashed 39 | * @param opts - dkLen, key, salt, personalization 40 | */ 41 | export declare const blake2s: { 42 | (msg: import("./utils.js").Input, opts?: BlakeOpts | undefined): Uint8Array; 43 | outputLen: number; 44 | blockLen: number; 45 | create(opts: BlakeOpts): import("./utils.js").Hash; 46 | }; 47 | export {}; 48 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/blake3.d.ts: -------------------------------------------------------------------------------- 1 | import { BLAKE2 } from './_blake2.js'; 2 | import { Input, HashXOF } from './utils.js'; 3 | export type Blake3Opts = { 4 | dkLen?: number; 5 | key?: Input; 6 | context?: Input; 7 | }; 8 | declare class BLAKE3 extends BLAKE2 implements HashXOF { 9 | private IV; 10 | private flags; 11 | private state; 12 | private chunkPos; 13 | private chunksDone; 14 | private stack; 15 | private posOut; 16 | private bufferOut32; 17 | private bufferOut; 18 | private chunkOut; 19 | private enableXOF; 20 | constructor(opts?: Blake3Opts, flags?: number); 21 | protected get(): never[]; 22 | protected set(): void; 23 | private b2Compress; 24 | protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; 25 | _cloneInto(to?: BLAKE3): BLAKE3; 26 | destroy(): void; 27 | private b2CompressOut; 28 | protected finish(): void; 29 | private writeInto; 30 | xofInto(out: Uint8Array): Uint8Array; 31 | xof(bytes: number): Uint8Array; 32 | digestInto(out: Uint8Array): Uint8Array; 33 | digest(): Uint8Array; 34 | } 35 | /** 36 | * BLAKE3 hash function. 37 | * @param msg - message that would be hashed 38 | * @param opts - dkLen, key, context 39 | */ 40 | export declare const blake3: { 41 | (msg: Input, opts?: Blake3Opts | undefined): Uint8Array; 42 | outputLen: number; 43 | blockLen: number; 44 | create(opts: Blake3Opts): HashXOF; 45 | }; 46 | export {}; 47 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/crypto.d.ts: -------------------------------------------------------------------------------- 1 | export declare const crypto: any; 2 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/crypto.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.crypto = void 0; 4 | exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; 5 | //# sourceMappingURL=crypto.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/crypto.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"crypto.js","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":";;;AAGa,QAAA,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/cryptoNode.d.ts: -------------------------------------------------------------------------------- 1 | export declare const crypto: any; 2 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/cryptoNode.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.crypto = void 0; 4 | // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. 5 | // See utils.ts for details. 6 | // The file will throw on node.js 14 and earlier. 7 | // @ts-ignore 8 | const nc = require("node:crypto"); 9 | exports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc ? nc.webcrypto : undefined; 10 | //# sourceMappingURL=cryptoNode.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/cryptoNode.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,4BAA4B;AAC5B,iDAAiD;AACjD,aAAa;AACb,kCAAkC;AACrB,QAAA,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE,CAAC,CAAC,CAAE,EAAE,CAAC,SAAiB,CAAC,CAAC,CAAC,SAAS,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/eskdf.d.ts: -------------------------------------------------------------------------------- 1 | export declare function scrypt(password: string, salt: string): Uint8Array; 2 | export declare function pbkdf2(password: string, salt: string): Uint8Array; 3 | /** 4 | * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. 5 | */ 6 | export declare function deriveMainSeed(username: string, password: string): Uint8Array; 7 | type AccountID = number | string; 8 | type OptsLength = { 9 | keyLength: number; 10 | }; 11 | type OptsMod = { 12 | modulus: bigint; 13 | }; 14 | type KeyOpts = undefined | OptsLength | OptsMod; 15 | type ESKDF = Promise Uint8Array; 26 | /** 27 | * Deletes the main seed from eskdf instance 28 | */ 29 | expire: () => void; 30 | /** 31 | * Account fingerprint 32 | */ 33 | fingerprint: string; 34 | }>>; 35 | /** 36 | * ESKDF 37 | * @param username - username, email, or identifier, min: 8 characters, should have enough entropy 38 | * @param password - password, min: 8 characters, should have enough entropy 39 | * @example 40 | * const kdf = await eskdf('example-university', 'beginning-new-example'); 41 | * const key = kdf.deriveChildKey('aes', 0); 42 | * console.log(kdf.fingerprint); 43 | * kdf.expire(); 44 | */ 45 | export declare function eskdf(username: string, password: string): ESKDF; 46 | export {}; 47 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/_assert.js: -------------------------------------------------------------------------------- 1 | function number(n) { 2 | if (!Number.isSafeInteger(n) || n < 0) 3 | throw new Error(`Wrong positive integer: ${n}`); 4 | } 5 | function bool(b) { 6 | if (typeof b !== 'boolean') 7 | throw new Error(`Expected boolean, not ${b}`); 8 | } 9 | // copied from utils 10 | function isBytes(a) { 11 | return (a instanceof Uint8Array || 12 | (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')); 13 | } 14 | function bytes(b, ...lengths) { 15 | if (!isBytes(b)) 16 | throw new Error('Expected Uint8Array'); 17 | if (lengths.length > 0 && !lengths.includes(b.length)) 18 | throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); 19 | } 20 | function hash(hash) { 21 | if (typeof hash !== 'function' || typeof hash.create !== 'function') 22 | throw new Error('Hash should be wrapped by utils.wrapConstructor'); 23 | number(hash.outputLen); 24 | number(hash.blockLen); 25 | } 26 | function exists(instance, checkFinished = true) { 27 | if (instance.destroyed) 28 | throw new Error('Hash instance has been destroyed'); 29 | if (checkFinished && instance.finished) 30 | throw new Error('Hash#digest() has already been called'); 31 | } 32 | function output(out, instance) { 33 | bytes(out); 34 | const min = instance.outputLen; 35 | if (out.length < min) { 36 | throw new Error(`digestInto() expects output buffer of length at least ${min}`); 37 | } 38 | } 39 | export { number, bool, bytes, hash, exists, output }; 40 | const assert = { number, bool, bytes, hash, exists, output }; 41 | export default assert; 42 | //# sourceMappingURL=_assert.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/_assert.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"_assert.js","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM,CAAC,CAAS;IACvB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,IAAI,CAAC,CAAU;IACtB,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,oBAAoB;AACpB,SAAS,OAAO,CAAC,CAAU;IACzB,OAAO,CACL,CAAC,YAAY,UAAU;QACvB,CAAC,CAAC,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,CAAyB,EAAE,GAAG,OAAiB;IAC5D,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,iCAAiC,OAAO,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3F,CAAC;AAQD,SAAS,IAAI,CAAC,IAAU;IACtB,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU;QACjE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,MAAM,CAAC,QAAa,EAAE,aAAa,GAAG,IAAI;IACjD,IAAI,QAAQ,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5E,IAAI,aAAa,IAAI,QAAQ,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACnG,CAAC;AACD,SAAS,MAAM,CAAC,GAAQ,EAAE,QAAa;IACrC,KAAK,CAAC,GAAG,CAAC,CAAC;IACX,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC/B,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,yDAAyD,GAAG,EAAE,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAErD,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7D,eAAe,MAAM,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/crypto.js: -------------------------------------------------------------------------------- 1 | export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; 2 | //# sourceMappingURL=crypto.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/crypto.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/cryptoNode.js: -------------------------------------------------------------------------------- 1 | // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. 2 | // See utils.ts for details. 3 | // The file will throw on node.js 14 and earlier. 4 | // @ts-ignore 5 | import * as nc from 'node:crypto'; 6 | export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc ? nc.webcrypto : undefined; 7 | //# sourceMappingURL=cryptoNode.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/cryptoNode.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,4BAA4B;AAC5B,iDAAiD;AACjD,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,MAAM,CAAC,MAAM,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE,CAAC,CAAC,CAAE,EAAE,CAAC,SAAiB,CAAC,CAAC,CAAC,SAAS,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | throw new Error('noble-hashes have no entry-point: consult README for usage'); 3 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "sideEffects": false, 4 | "browser": { 5 | "node:crypto": false 6 | }, 7 | "node": { 8 | "./crypto": "./esm/cryptoNode.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/sha2.js: -------------------------------------------------------------------------------- 1 | // Usually you either use sha256, or sha512. We re-export them as sha2 for naming consistency. 2 | export { sha256, sha224 } from './sha256.js'; 3 | export { sha512, sha512_224, sha512_256, sha384 } from './sha512.js'; 4 | //# sourceMappingURL=sha2.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/esm/sha2.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sha2.js","sourceRoot":"","sources":["../src/sha2.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/hkdf.d.ts: -------------------------------------------------------------------------------- 1 | import { CHash, Input } from './utils.js'; 2 | /** 3 | * HKDF-Extract(IKM, salt) -> PRK 4 | * Arguments position differs from spec (IKM is first one, since it is not optional) 5 | * @param hash 6 | * @param ikm 7 | * @param salt 8 | * @returns 9 | */ 10 | export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array; 11 | /** 12 | * HKDF-expand from the spec. 13 | * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) 14 | * @param info - optional context and application specific information (can be a zero-length string) 15 | * @param length - length of output keying material in octets 16 | */ 17 | export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array; 18 | /** 19 | * HKDF (RFC 5869): extract + expand in one step. 20 | * @param hash - hash function that would be used (e.g. sha256) 21 | * @param ikm - input keying material, the initial key 22 | * @param salt - optional salt value (a non-secret random value) 23 | * @param info - optional context and application specific information 24 | * @param length - length of output keying material in octets 25 | */ 26 | export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array; 27 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/hmac.d.ts: -------------------------------------------------------------------------------- 1 | import { Hash, CHash, Input } from './utils.js'; 2 | export declare class HMAC> extends Hash> { 3 | oHash: T; 4 | iHash: T; 5 | blockLen: number; 6 | outputLen: number; 7 | private finished; 8 | private destroyed; 9 | constructor(hash: CHash, _key: Input); 10 | update(buf: Input): this; 11 | digestInto(out: Uint8Array): void; 12 | digest(): Uint8Array; 13 | _cloneInto(to?: HMAC): HMAC; 14 | destroy(): void; 15 | } 16 | /** 17 | * HMAC: RFC2104 message authentication code. 18 | * @param hash - function that would be used e.g. sha256 19 | * @param key - message key 20 | * @param message - message data 21 | */ 22 | export declare const hmac: { 23 | (hash: CHash, key: Input, message: Input): Uint8Array; 24 | create(hash: CHash, key: Input): HMAC; 25 | }; 26 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/index.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faytey/bit-wallet/29daa025c7c44661b92557038a70e8ba11571c83/node_modules/@noble/hashes/index.d.ts -------------------------------------------------------------------------------- /node_modules/@noble/hashes/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | throw new Error('noble-hashes have no entry-point: consult README for usage'); 3 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/pbkdf2.d.ts: -------------------------------------------------------------------------------- 1 | import { CHash, Input } from './utils.js'; 2 | export type Pbkdf2Opt = { 3 | c: number; 4 | dkLen?: number; 5 | asyncTick?: number; 6 | }; 7 | /** 8 | * PBKDF2-HMAC: RFC 2898 key derivation function 9 | * @param hash - hash function that would be used e.g. sha256 10 | * @param password - password from which a derived key is generated 11 | * @param salt - cryptographic salt 12 | * @param opts - {c, dkLen} where c is work factor and dkLen is output message size 13 | */ 14 | export declare function pbkdf2(hash: CHash, password: Input, salt: Input, opts: Pbkdf2Opt): Uint8Array; 15 | export declare function pbkdf2Async(hash: CHash, password: Input, salt: Input, opts: Pbkdf2Opt): Promise; 16 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/ripemd160.d.ts: -------------------------------------------------------------------------------- 1 | import { SHA2 } from './_sha2.js'; 2 | export declare class RIPEMD160 extends SHA2 { 3 | private h0; 4 | private h1; 5 | private h2; 6 | private h3; 7 | private h4; 8 | constructor(); 9 | protected get(): [number, number, number, number, number]; 10 | protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; 11 | protected process(view: DataView, offset: number): void; 12 | protected roundClean(): void; 13 | destroy(): void; 14 | } 15 | /** 16 | * RIPEMD-160 - a hash function from 1990s. 17 | * @param message - msg that would be hashed 18 | */ 19 | export declare const ripemd160: { 20 | (msg: import("./utils.js").Input): Uint8Array; 21 | outputLen: number; 22 | blockLen: number; 23 | create(): import("./utils.js").Hash; 24 | }; 25 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/scrypt.d.ts: -------------------------------------------------------------------------------- 1 | import { Input } from './utils.js'; 2 | export type ScryptOpts = { 3 | N: number; 4 | r: number; 5 | p: number; 6 | dkLen?: number; 7 | asyncTick?: number; 8 | maxmem?: number; 9 | onProgress?: (progress: number) => void; 10 | }; 11 | /** 12 | * Scrypt KDF from RFC 7914. 13 | * @param password - pass 14 | * @param salt - salt 15 | * @param opts - parameters 16 | * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) 17 | * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance 18 | * - `p` is parallelization factor (1 is common) 19 | * - `dkLen` is output key length in bytes e.g. 32. 20 | * - `asyncTick` - (default: 10) max time in ms for which async function can block execution 21 | * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt 22 | * - `onProgress` - callback function that would be executed for progress report 23 | * @returns Derived key 24 | */ 25 | export declare function scrypt(password: Input, salt: Input, opts: ScryptOpts): Uint8Array; 26 | /** 27 | * Scrypt KDF from RFC 7914. 28 | */ 29 | export declare function scryptAsync(password: Input, salt: Input, opts: ScryptOpts): Promise; 30 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/sha1.d.ts: -------------------------------------------------------------------------------- 1 | import { SHA2 } from './_sha2.js'; 2 | declare class SHA1 extends SHA2 { 3 | private A; 4 | private B; 5 | private C; 6 | private D; 7 | private E; 8 | constructor(); 9 | protected get(): [number, number, number, number, number]; 10 | protected set(A: number, B: number, C: number, D: number, E: number): void; 11 | protected process(view: DataView, offset: number): void; 12 | protected roundClean(): void; 13 | destroy(): void; 14 | } 15 | export declare const sha1: { 16 | (msg: import("./utils.js").Input): Uint8Array; 17 | outputLen: number; 18 | blockLen: number; 19 | create(): import("./utils.js").Hash; 20 | }; 21 | export {}; 22 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/sha2.d.ts: -------------------------------------------------------------------------------- 1 | export { sha256, sha224 } from './sha256.js'; 2 | export { sha512, sha512_224, sha512_256, sha384 } from './sha512.js'; 3 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/sha2.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.sha224 = exports.sha256 = void 0; 4 | // Usually you either use sha256, or sha512. We re-export them as sha2 for naming consistency. 5 | var sha256_js_1 = require("./sha256.js"); 6 | Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha256_js_1.sha256; } }); 7 | Object.defineProperty(exports, "sha224", { enumerable: true, get: function () { return sha256_js_1.sha224; } }); 8 | var sha512_js_1 = require("./sha512.js"); 9 | Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return sha512_js_1.sha512; } }); 10 | Object.defineProperty(exports, "sha512_224", { enumerable: true, get: function () { return sha512_js_1.sha512_224; } }); 11 | Object.defineProperty(exports, "sha512_256", { enumerable: true, get: function () { return sha512_js_1.sha512_256; } }); 12 | Object.defineProperty(exports, "sha384", { enumerable: true, get: function () { return sha512_js_1.sha384; } }); 13 | //# sourceMappingURL=sha2.js.map -------------------------------------------------------------------------------- /node_modules/@noble/hashes/sha2.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sha2.js","sourceRoot":"","sources":["src/sha2.ts"],"names":[],"mappings":";;;AAAA,8FAA8F;AAC9F,yCAA6C;AAApC,mGAAA,MAAM,OAAA;AAAE,mGAAA,MAAM,OAAA;AACvB,yCAAqE;AAA5D,mGAAA,MAAM,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,mGAAA,MAAM,OAAA"} -------------------------------------------------------------------------------- /node_modules/@noble/hashes/sha256.d.ts: -------------------------------------------------------------------------------- 1 | import { SHA2 } from './_sha2.js'; 2 | declare class SHA256 extends SHA2 { 3 | A: number; 4 | B: number; 5 | C: number; 6 | D: number; 7 | E: number; 8 | F: number; 9 | G: number; 10 | H: number; 11 | constructor(); 12 | protected get(): [number, number, number, number, number, number, number, number]; 13 | protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; 14 | protected process(view: DataView, offset: number): void; 15 | protected roundClean(): void; 16 | destroy(): void; 17 | } 18 | /** 19 | * SHA2-256 hash function 20 | * @param message - data that would be hashed 21 | */ 22 | export declare const sha256: { 23 | (msg: import("./utils.js").Input): Uint8Array; 24 | outputLen: number; 25 | blockLen: number; 26 | create(): import("./utils.js").Hash; 27 | }; 28 | export declare const sha224: { 29 | (msg: import("./utils.js").Input): Uint8Array; 30 | outputLen: number; 31 | blockLen: number; 32 | create(): import("./utils.js").Hash; 33 | }; 34 | export {}; 35 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/src/_assert.ts: -------------------------------------------------------------------------------- 1 | function number(n: number) { 2 | if (!Number.isSafeInteger(n) || n < 0) throw new Error(`Wrong positive integer: ${n}`); 3 | } 4 | 5 | function bool(b: boolean) { 6 | if (typeof b !== 'boolean') throw new Error(`Expected boolean, not ${b}`); 7 | } 8 | 9 | // copied from utils 10 | function isBytes(a: unknown): a is Uint8Array { 11 | return ( 12 | a instanceof Uint8Array || 13 | (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array') 14 | ); 15 | } 16 | 17 | function bytes(b: Uint8Array | undefined, ...lengths: number[]) { 18 | if (!isBytes(b)) throw new Error('Expected Uint8Array'); 19 | if (lengths.length > 0 && !lengths.includes(b.length)) 20 | throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); 21 | } 22 | 23 | type Hash = { 24 | (data: Uint8Array): Uint8Array; 25 | blockLen: number; 26 | outputLen: number; 27 | create: any; 28 | }; 29 | function hash(hash: Hash) { 30 | if (typeof hash !== 'function' || typeof hash.create !== 'function') 31 | throw new Error('Hash should be wrapped by utils.wrapConstructor'); 32 | number(hash.outputLen); 33 | number(hash.blockLen); 34 | } 35 | 36 | function exists(instance: any, checkFinished = true) { 37 | if (instance.destroyed) throw new Error('Hash instance has been destroyed'); 38 | if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); 39 | } 40 | function output(out: any, instance: any) { 41 | bytes(out); 42 | const min = instance.outputLen; 43 | if (out.length < min) { 44 | throw new Error(`digestInto() expects output buffer of length at least ${min}`); 45 | } 46 | } 47 | 48 | export { number, bool, bytes, hash, exists, output }; 49 | 50 | const assert = { number, bool, bytes, hash, exists, output }; 51 | export default assert; 52 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/src/crypto.ts: -------------------------------------------------------------------------------- 1 | // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. 2 | // See utils.ts for details. 3 | declare const globalThis: Record | undefined; 4 | export const crypto = 5 | typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; 6 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/src/cryptoNode.ts: -------------------------------------------------------------------------------- 1 | // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. 2 | // See utils.ts for details. 3 | // The file will throw on node.js 14 and earlier. 4 | // @ts-ignore 5 | import * as nc from 'node:crypto'; 6 | export const crypto = 7 | nc && typeof nc === 'object' && 'webcrypto' in nc ? (nc.webcrypto as any) : undefined; 8 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/src/index.ts: -------------------------------------------------------------------------------- 1 | throw new Error('noble-hashes have no entry-point: consult README for usage'); 2 | -------------------------------------------------------------------------------- /node_modules/@noble/hashes/src/sha2.ts: -------------------------------------------------------------------------------- 1 | // Usually you either use sha256, or sha512. We re-export them as sha2 for naming consistency. 2 | export { sha256, sha224 } from './sha256.js'; 3 | export { sha512, sha512_224, sha512_256, sha384 } from './sha512.js'; 4 | -------------------------------------------------------------------------------- /node_modules/@scure/base/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Paul Miller (https://paulmillr.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the “Software”), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/@scure/base/lib/esm/package.json: -------------------------------------------------------------------------------- 1 | { "type": "module", "sideEffects": false } 2 | -------------------------------------------------------------------------------- /node_modules/@scure/base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scure/base", 3 | "version": "1.1.5", 4 | "description": "Secure, audited & 0-dep implementation of base64, bech32, base58, base32 & base16", 5 | "files": [ 6 | "lib/index.js", 7 | "lib/esm/index.js", 8 | "lib/esm/package.json", 9 | "lib/index.d.ts", 10 | "lib/index.d.ts.map", 11 | "index.ts" 12 | ], 13 | "main": "lib/index.js", 14 | "module": "lib/esm/index.js", 15 | "types": "lib/index.d.ts", 16 | "exports": { 17 | ".": { 18 | "types": "./lib/index.d.ts", 19 | "import": "./lib/esm/index.js", 20 | "default": "./lib/index.js" 21 | } 22 | }, 23 | "scripts": { 24 | "bench": "node test/benchmark/index.js", 25 | "build": "tsc && tsc -p tsconfig.esm.json", 26 | "lint": "prettier --check index.ts", 27 | "format": "prettier --write index.ts", 28 | "test": "node test/index.js", 29 | "test:deno": "deno test test/deno.ts" 30 | }, 31 | "sideEffects": false, 32 | "author": "Paul Miller (https://paulmillr.com)", 33 | "license": "MIT", 34 | "homepage": "https://paulmillr.com/noble/#scure", 35 | "repository": { 36 | "type": "git", 37 | "url": "git+https://github.com/paulmillr/scure-base.git" 38 | }, 39 | "devDependencies": { 40 | "micro-should": "0.4.0", 41 | "prettier": "3.1.1", 42 | "typescript": "5.3.2" 43 | }, 44 | "keywords": [ 45 | "bech32", 46 | "bech32m", 47 | "base64", 48 | "base58", 49 | "base32", 50 | "base16", 51 | "rfc4648", 52 | "rfc3548", 53 | "crockford", 54 | "encode", 55 | "encoder", 56 | "base-x", 57 | "base" 58 | ], 59 | "funding": "https://paulmillr.com/funding/" 60 | } 61 | -------------------------------------------------------------------------------- /node_modules/base-x/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 base-x contributors 4 | Copyright (c) 2014-2018 The Bitcoin Core developers 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/base-x/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "base-x", 3 | "version": "4.0.0", 4 | "description": "Fast base encoding / decoding of any given alphabet", 5 | "keywords": [ 6 | "base-x", 7 | "base58", 8 | "base62", 9 | "base64", 10 | "crypto", 11 | "crytography", 12 | "decode", 13 | "decoding", 14 | "encode", 15 | "encoding" 16 | ], 17 | "homepage": "https://github.com/cryptocoinjs/base-x", 18 | "bugs": { 19 | "url": "https://github.com/cryptocoinjs/base-x/issues" 20 | }, 21 | "license": "MIT", 22 | "author": "Daniel Cousens", 23 | "files": [ 24 | "src" 25 | ], 26 | "main": "src/index.js", 27 | "types": "src/index.d.ts", 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/cryptocoinjs/base-x.git" 31 | }, 32 | "scripts": { 33 | "build": "tsc -p ./tsconfig.json ; standard --fix", 34 | "gitdiff": "npm run build && git diff --exit-code", 35 | "prepublish": "npm run gitdiff", 36 | "standard": "standard", 37 | "test": "npm run unit && npm run standard", 38 | "unit": "tape test/*.js" 39 | }, 40 | "devDependencies": { 41 | "@types/node": "12.0.10", 42 | "standard": "^10.0.3", 43 | "tape": "^4.5.1", 44 | "typescript": "3.5.2" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/base-x/src/index.d.ts: -------------------------------------------------------------------------------- 1 | declare function base(ALPHABET: string): base.BaseConverter; 2 | export = base; 3 | declare namespace base { 4 | interface BaseConverter { 5 | encode(buffer: Uint8Array | number[]): string; 6 | decodeUnsafe(string: string): Uint8Array | undefined; 7 | decode(string: string): Uint8Array; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/bech32/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Pieter Wuille 4 | Copyright (c) 2018 bitcoinjs contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/bech32/dist/index.d.ts: -------------------------------------------------------------------------------- 1 | declare function toWords(bytes: ArrayLike): number[]; 2 | declare function fromWordsUnsafe(words: ArrayLike): number[] | undefined; 3 | declare function fromWords(words: ArrayLike): number[]; 4 | export declare const bech32: BechLib; 5 | export declare const bech32m: BechLib; 6 | export interface Decoded { 7 | prefix: string; 8 | words: number[]; 9 | } 10 | export interface BechLib { 11 | decodeUnsafe: (str: string, LIMIT?: number | undefined) => Decoded | undefined; 12 | decode: (str: string, LIMIT?: number | undefined) => Decoded; 13 | encode: (prefix: string, words: ArrayLike, LIMIT?: number | undefined) => string; 14 | toWords: typeof toWords; 15 | fromWordsUnsafe: typeof fromWordsUnsafe; 16 | fromWords: typeof fromWords; 17 | } 18 | export {}; 19 | -------------------------------------------------------------------------------- /node_modules/bech32/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bech32", 3 | "version": "2.0.0", 4 | "description": "Bech32 encoding / decoding", 5 | "keywords": [ 6 | "base32", 7 | "bech32", 8 | "bech32m", 9 | "bitcoin", 10 | "crypto", 11 | "crytography", 12 | "decode", 13 | "decoding", 14 | "encode", 15 | "encoding" 16 | ], 17 | "main": "dist/index.js", 18 | "types": "dist/index.d.ts", 19 | "files": [ 20 | "dist/index.js", 21 | "dist/index.d.ts" 22 | ], 23 | "license": "MIT", 24 | "devDependencies": { 25 | "@types/node": "^14.0.14", 26 | "@types/tape": "^4.13.0", 27 | "nyc": "^15.0.0", 28 | "prettier": "^2.0.5", 29 | "rimraf": "^3.0.2", 30 | "tap-dot": "*", 31 | "tape": "^4.13.2", 32 | "tslint": "^6.1.3", 33 | "typescript": "^3.9.5" 34 | }, 35 | "repository": { 36 | "url": "http://github.com/bitcoinjs/bech32", 37 | "type": "git" 38 | }, 39 | "scripts": { 40 | "build": "npm run clean && tsc -d", 41 | "clean": "rimraf dist", 42 | "coverage": "nyc -x dist/test/*.js --check-coverage --branches 90 --functions 90 tape dist/test/*.js", 43 | "format": "npm run prettier -- --write", 44 | "format:ci": "npm run prettier -- --check", 45 | "gitdiff:ci": "npm run build && git diff --exit-code", 46 | "lint": "tslint -p tsconfig.json -c tslint.json", 47 | "prettier": "prettier --print-width 100 --single-quote --trailing-comma=all \"**/!(*.d).ts\"", 48 | "test": "tape dist/test/*.js | tap-dot" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/bip174/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jonathan Underwood and BitcoinJS team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/combiner/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PsbtAttributes } from '../parser'; 2 | export declare function combine(psbts: PsbtAttributes[]): PsbtAttributes; 3 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/global/globalXpub.d.ts: -------------------------------------------------------------------------------- 1 | import { GlobalXpub, KeyValue } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): GlobalXpub; 3 | export declare function encode(data: GlobalXpub): KeyValue; 4 | export declare const expected = "{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }"; 5 | export declare function check(data: any): data is GlobalXpub; 6 | export declare function canAddToArray(array: GlobalXpub[], item: GlobalXpub, dupeSet: Set): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/global/unsignedTx.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, Transaction } from '../../interfaces'; 2 | export declare function encode(data: Transaction): KeyValue; 3 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/global/unsignedTx.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function encode(data) { 5 | return { 6 | key: Buffer.from([typeFields_1.GlobalTypes.UNSIGNED_TX]), 7 | value: data.toBuffer(), 8 | }; 9 | } 10 | exports.encode = encode; 11 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/finalScriptSig.d.ts: -------------------------------------------------------------------------------- 1 | import { FinalScriptSig, KeyValue } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): FinalScriptSig; 3 | export declare function encode(data: FinalScriptSig): KeyValue; 4 | export declare const expected = "Buffer"; 5 | export declare function check(data: any): data is FinalScriptSig; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/finalScriptSig.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== typeFields_1.InputTypes.FINAL_SCRIPTSIG) { 6 | throw new Error( 7 | 'Decode Error: could not decode finalScriptSig with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value; 12 | } 13 | exports.decode = decode; 14 | function encode(data) { 15 | const key = Buffer.from([typeFields_1.InputTypes.FINAL_SCRIPTSIG]); 16 | return { 17 | key, 18 | value: data, 19 | }; 20 | } 21 | exports.encode = encode; 22 | exports.expected = 'Buffer'; 23 | function check(data) { 24 | return Buffer.isBuffer(data); 25 | } 26 | exports.check = check; 27 | function canAdd(currentData, newData) { 28 | return !!currentData && !!newData && currentData.finalScriptSig === undefined; 29 | } 30 | exports.canAdd = canAdd; 31 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/finalScriptWitness.d.ts: -------------------------------------------------------------------------------- 1 | import { FinalScriptWitness, KeyValue } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): FinalScriptWitness; 3 | export declare function encode(data: FinalScriptWitness): KeyValue; 4 | export declare const expected = "Buffer"; 5 | export declare function check(data: any): data is FinalScriptWitness; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/finalScriptWitness.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== typeFields_1.InputTypes.FINAL_SCRIPTWITNESS) { 6 | throw new Error( 7 | 'Decode Error: could not decode finalScriptWitness with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value; 12 | } 13 | exports.decode = decode; 14 | function encode(data) { 15 | const key = Buffer.from([typeFields_1.InputTypes.FINAL_SCRIPTWITNESS]); 16 | return { 17 | key, 18 | value: data, 19 | }; 20 | } 21 | exports.encode = encode; 22 | exports.expected = 'Buffer'; 23 | function check(data) { 24 | return Buffer.isBuffer(data); 25 | } 26 | exports.check = check; 27 | function canAdd(currentData, newData) { 28 | return ( 29 | !!currentData && !!newData && currentData.finalScriptWitness === undefined 30 | ); 31 | } 32 | exports.canAdd = canAdd; 33 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, NonWitnessUtxo } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): NonWitnessUtxo; 3 | export declare function encode(data: NonWitnessUtxo): KeyValue; 4 | export declare const expected = "Buffer"; 5 | export declare function check(data: any): data is NonWitnessUtxo; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== typeFields_1.InputTypes.NON_WITNESS_UTXO) { 6 | throw new Error( 7 | 'Decode Error: could not decode nonWitnessUtxo with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value; 12 | } 13 | exports.decode = decode; 14 | function encode(data) { 15 | return { 16 | key: Buffer.from([typeFields_1.InputTypes.NON_WITNESS_UTXO]), 17 | value: data, 18 | }; 19 | } 20 | exports.encode = encode; 21 | exports.expected = 'Buffer'; 22 | function check(data) { 23 | return Buffer.isBuffer(data); 24 | } 25 | exports.check = check; 26 | function canAdd(currentData, newData) { 27 | return !!currentData && !!newData && currentData.nonWitnessUtxo === undefined; 28 | } 29 | exports.canAdd = canAdd; 30 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/partialSig.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, PartialSig } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): PartialSig; 3 | export declare function encode(pSig: PartialSig): KeyValue; 4 | export declare const expected = "{ pubkey: Buffer; signature: Buffer; }"; 5 | export declare function check(data: any): data is PartialSig; 6 | export declare function canAddToArray(array: PartialSig[], item: PartialSig, dupeSet: Set): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/porCommitment.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, PorCommitment } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): PorCommitment; 3 | export declare function encode(data: PorCommitment): KeyValue; 4 | export declare const expected = "string"; 5 | export declare function check(data: any): data is PorCommitment; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/porCommitment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== typeFields_1.InputTypes.POR_COMMITMENT) { 6 | throw new Error( 7 | 'Decode Error: could not decode porCommitment with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value.toString('utf8'); 12 | } 13 | exports.decode = decode; 14 | function encode(data) { 15 | const key = Buffer.from([typeFields_1.InputTypes.POR_COMMITMENT]); 16 | return { 17 | key, 18 | value: Buffer.from(data, 'utf8'), 19 | }; 20 | } 21 | exports.encode = encode; 22 | exports.expected = 'string'; 23 | function check(data) { 24 | return typeof data === 'string'; 25 | } 26 | exports.check = check; 27 | function canAdd(currentData, newData) { 28 | return !!currentData && !!newData && currentData.porCommitment === undefined; 29 | } 30 | exports.canAdd = canAdd; 31 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/sighashType.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, SighashType } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): SighashType; 3 | export declare function encode(data: SighashType): KeyValue; 4 | export declare const expected = "number"; 5 | export declare function check(data: any): data is SighashType; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/sighashType.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== typeFields_1.InputTypes.SIGHASH_TYPE) { 6 | throw new Error( 7 | 'Decode Error: could not decode sighashType with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value.readUInt32LE(0); 12 | } 13 | exports.decode = decode; 14 | function encode(data) { 15 | const key = Buffer.from([typeFields_1.InputTypes.SIGHASH_TYPE]); 16 | const value = Buffer.allocUnsafe(4); 17 | value.writeUInt32LE(data, 0); 18 | return { 19 | key, 20 | value, 21 | }; 22 | } 23 | exports.encode = encode; 24 | exports.expected = 'number'; 25 | function check(data) { 26 | return typeof data === 'number'; 27 | } 28 | exports.check = check; 29 | function canAdd(currentData, newData) { 30 | return !!currentData && !!newData && currentData.sighashType === undefined; 31 | } 32 | exports.canAdd = canAdd; 33 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/tapKeySig.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapKeySig } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): TapKeySig; 3 | export declare function encode(value: TapKeySig): KeyValue; 4 | export declare const expected = "Buffer"; 5 | export declare function check(data: any): data is TapKeySig; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/tapKeySig.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if ( 6 | keyVal.key[0] !== typeFields_1.InputTypes.TAP_KEY_SIG || 7 | keyVal.key.length !== 1 8 | ) { 9 | throw new Error( 10 | 'Decode Error: could not decode tapKeySig with key 0x' + 11 | keyVal.key.toString('hex'), 12 | ); 13 | } 14 | if (!check(keyVal.value)) { 15 | throw new Error( 16 | 'Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature', 17 | ); 18 | } 19 | return keyVal.value; 20 | } 21 | exports.decode = decode; 22 | function encode(value) { 23 | const key = Buffer.from([typeFields_1.InputTypes.TAP_KEY_SIG]); 24 | return { key, value }; 25 | } 26 | exports.encode = encode; 27 | exports.expected = 'Buffer'; 28 | function check(data) { 29 | return Buffer.isBuffer(data) && (data.length === 64 || data.length === 65); 30 | } 31 | exports.check = check; 32 | function canAdd(currentData, newData) { 33 | return !!currentData && !!newData && currentData.tapKeySig === undefined; 34 | } 35 | exports.canAdd = canAdd; 36 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/tapLeafScript.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapLeafScript } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): TapLeafScript; 3 | export declare function encode(tScript: TapLeafScript): KeyValue; 4 | export declare const expected = "{ controlBlock: Buffer; leafVersion: number, script: Buffer; }"; 5 | export declare function check(data: any): data is TapLeafScript; 6 | export declare function canAddToArray(array: TapLeafScript[], item: TapLeafScript, dupeSet: Set): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/tapMerkleRoot.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapMerkleRoot } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): TapMerkleRoot; 3 | export declare function encode(value: TapMerkleRoot): KeyValue; 4 | export declare const expected = "Buffer"; 5 | export declare function check(data: any): data is TapMerkleRoot; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/tapMerkleRoot.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | function decode(keyVal) { 5 | if ( 6 | keyVal.key[0] !== typeFields_1.InputTypes.TAP_MERKLE_ROOT || 7 | keyVal.key.length !== 1 8 | ) { 9 | throw new Error( 10 | 'Decode Error: could not decode tapMerkleRoot with key 0x' + 11 | keyVal.key.toString('hex'), 12 | ); 13 | } 14 | if (!check(keyVal.value)) { 15 | throw new Error('Decode Error: tapMerkleRoot not a 32-byte hash'); 16 | } 17 | return keyVal.value; 18 | } 19 | exports.decode = decode; 20 | function encode(value) { 21 | const key = Buffer.from([typeFields_1.InputTypes.TAP_MERKLE_ROOT]); 22 | return { key, value }; 23 | } 24 | exports.encode = encode; 25 | exports.expected = 'Buffer'; 26 | function check(data) { 27 | return Buffer.isBuffer(data) && data.length === 32; 28 | } 29 | exports.check = check; 30 | function canAdd(currentData, newData) { 31 | return !!currentData && !!newData && currentData.tapMerkleRoot === undefined; 32 | } 33 | exports.canAdd = canAdd; 34 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/tapScriptSig.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapScriptSig } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): TapScriptSig; 3 | export declare function encode(tSig: TapScriptSig): KeyValue; 4 | export declare const expected = "{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }"; 5 | export declare function check(data: any): data is TapScriptSig; 6 | export declare function canAddToArray(array: TapScriptSig[], item: TapScriptSig, dupeSet: Set): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/witnessUtxo.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, WitnessUtxo } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): WitnessUtxo; 3 | export declare function encode(data: WitnessUtxo): KeyValue; 4 | export declare const expected = "{ script: Buffer; value: number; }"; 5 | export declare function check(data: any): data is WitnessUtxo; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/input/witnessUtxo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const typeFields_1 = require('../../typeFields'); 4 | const tools_1 = require('../tools'); 5 | const varuint = require('../varint'); 6 | function decode(keyVal) { 7 | if (keyVal.key[0] !== typeFields_1.InputTypes.WITNESS_UTXO) { 8 | throw new Error( 9 | 'Decode Error: could not decode witnessUtxo with key 0x' + 10 | keyVal.key.toString('hex'), 11 | ); 12 | } 13 | const value = tools_1.readUInt64LE(keyVal.value, 0); 14 | let _offset = 8; 15 | const scriptLen = varuint.decode(keyVal.value, _offset); 16 | _offset += varuint.encodingLength(scriptLen); 17 | const script = keyVal.value.slice(_offset); 18 | if (script.length !== scriptLen) { 19 | throw new Error('Decode Error: WITNESS_UTXO script is not proper length'); 20 | } 21 | return { 22 | script, 23 | value, 24 | }; 25 | } 26 | exports.decode = decode; 27 | function encode(data) { 28 | const { script, value } = data; 29 | const varintLen = varuint.encodingLength(script.length); 30 | const result = Buffer.allocUnsafe(8 + varintLen + script.length); 31 | tools_1.writeUInt64LE(result, value, 0); 32 | varuint.encode(script.length, result, 8); 33 | script.copy(result, 8 + varintLen); 34 | return { 35 | key: Buffer.from([typeFields_1.InputTypes.WITNESS_UTXO]), 36 | value: result, 37 | }; 38 | } 39 | exports.encode = encode; 40 | exports.expected = '{ script: Buffer; value: number; }'; 41 | function check(data) { 42 | return Buffer.isBuffer(data.script) && typeof data.value === 'number'; 43 | } 44 | exports.check = check; 45 | function canAdd(currentData, newData) { 46 | return !!currentData && !!newData && currentData.witnessUtxo === undefined; 47 | } 48 | exports.canAdd = canAdd; 49 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/output/tapTree.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapTree } from '../../interfaces'; 2 | export declare function decode(keyVal: KeyValue): TapTree; 3 | export declare function encode(tree: TapTree): KeyValue; 4 | export declare const expected = "{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }"; 5 | export declare function check(data: any): data is TapTree; 6 | export declare function canAdd(currentData: any, newData: any): boolean; 7 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/bip32Derivation.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { Bip32Derivation, KeyValue } from '../../interfaces'; 3 | export declare function makeConverter(TYPE_BYTE: number, isValidPubkey?: (pubkey: Buffer) => boolean): { 4 | decode: (keyVal: KeyValue) => Bip32Derivation; 5 | encode: (data: Bip32Derivation) => KeyValue; 6 | check: (data: any) => data is Bip32Derivation; 7 | expected: string; 8 | canAddToArray: (array: Bip32Derivation[], item: Bip32Derivation, dupeSet: Set) => boolean; 9 | }; 10 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/checkPubkey.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { KeyValue } from '../../interfaces'; 3 | export declare function makeChecker(pubkeyTypes: number[]): (keyVal: KeyValue) => Buffer | undefined; 4 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/checkPubkey.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | function makeChecker(pubkeyTypes) { 4 | return checkPubkey; 5 | function checkPubkey(keyVal) { 6 | let pubkey; 7 | if (pubkeyTypes.includes(keyVal.key[0])) { 8 | pubkey = keyVal.key.slice(1); 9 | if ( 10 | !(pubkey.length === 33 || pubkey.length === 65) || 11 | ![2, 3, 4].includes(pubkey[0]) 12 | ) { 13 | throw new Error( 14 | 'Format Error: invalid pubkey in key 0x' + keyVal.key.toString('hex'), 15 | ); 16 | } 17 | } 18 | return pubkey; 19 | } 20 | } 21 | exports.makeChecker = makeChecker; 22 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/redeemScript.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, RedeemScript } from '../../interfaces'; 2 | export declare function makeConverter(TYPE_BYTE: number): { 3 | decode: (keyVal: KeyValue) => RedeemScript; 4 | encode: (data: RedeemScript) => KeyValue; 5 | check: (data: any) => data is RedeemScript; 6 | expected: string; 7 | canAdd: (currentData: any, newData: any) => boolean; 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/redeemScript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | function makeConverter(TYPE_BYTE) { 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== TYPE_BYTE) { 6 | throw new Error( 7 | 'Decode Error: could not decode redeemScript with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value; 12 | } 13 | function encode(data) { 14 | const key = Buffer.from([TYPE_BYTE]); 15 | return { 16 | key, 17 | value: data, 18 | }; 19 | } 20 | const expected = 'Buffer'; 21 | function check(data) { 22 | return Buffer.isBuffer(data); 23 | } 24 | function canAdd(currentData, newData) { 25 | return !!currentData && !!newData && currentData.redeemScript === undefined; 26 | } 27 | return { 28 | decode, 29 | encode, 30 | check, 31 | expected, 32 | canAdd, 33 | }; 34 | } 35 | exports.makeConverter = makeConverter; 36 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/tapBip32Derivation.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapBip32Derivation } from '../../interfaces'; 2 | export declare function makeConverter(TYPE_BYTE: number): { 3 | decode: (keyVal: KeyValue) => TapBip32Derivation; 4 | encode: (data: TapBip32Derivation) => KeyValue; 5 | check: (data: any) => data is TapBip32Derivation; 6 | expected: string; 7 | canAddToArray: (array: TapBip32Derivation[], item: TapBip32Derivation, dupeSet: Set) => boolean; 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/tapInternalKey.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, TapInternalKey } from '../../interfaces'; 2 | export declare function makeConverter(TYPE_BYTE: number): { 3 | decode: (keyVal: KeyValue) => TapInternalKey; 4 | encode: (data: TapInternalKey) => KeyValue; 5 | check: (data: any) => data is TapInternalKey; 6 | expected: string; 7 | canAdd: (currentData: any, newData: any) => boolean; 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/tapInternalKey.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | function makeConverter(TYPE_BYTE) { 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== TYPE_BYTE || keyVal.key.length !== 1) { 6 | throw new Error( 7 | 'Decode Error: could not decode tapInternalKey with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | if (keyVal.value.length !== 32) { 12 | throw new Error( 13 | 'Decode Error: tapInternalKey not a 32-byte x-only pubkey', 14 | ); 15 | } 16 | return keyVal.value; 17 | } 18 | function encode(value) { 19 | const key = Buffer.from([TYPE_BYTE]); 20 | return { key, value }; 21 | } 22 | const expected = 'Buffer'; 23 | function check(data) { 24 | return Buffer.isBuffer(data) && data.length === 32; 25 | } 26 | function canAdd(currentData, newData) { 27 | return ( 28 | !!currentData && !!newData && currentData.tapInternalKey === undefined 29 | ); 30 | } 31 | return { 32 | decode, 33 | encode, 34 | check, 35 | expected, 36 | canAdd, 37 | }; 38 | } 39 | exports.makeConverter = makeConverter; 40 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/witnessScript.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyValue, WitnessScript } from '../../interfaces'; 2 | export declare function makeConverter(TYPE_BYTE: number): { 3 | decode: (keyVal: KeyValue) => WitnessScript; 4 | encode: (data: WitnessScript) => KeyValue; 5 | check: (data: any) => data is WitnessScript; 6 | expected: string; 7 | canAdd: (currentData: any, newData: any) => boolean; 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/shared/witnessScript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | function makeConverter(TYPE_BYTE) { 4 | function decode(keyVal) { 5 | if (keyVal.key[0] !== TYPE_BYTE) { 6 | throw new Error( 7 | 'Decode Error: could not decode witnessScript with key 0x' + 8 | keyVal.key.toString('hex'), 9 | ); 10 | } 11 | return keyVal.value; 12 | } 13 | function encode(data) { 14 | const key = Buffer.from([TYPE_BYTE]); 15 | return { 16 | key, 17 | value: data, 18 | }; 19 | } 20 | const expected = 'Buffer'; 21 | function check(data) { 22 | return Buffer.isBuffer(data); 23 | } 24 | function canAdd(currentData, newData) { 25 | return ( 26 | !!currentData && !!newData && currentData.witnessScript === undefined 27 | ); 28 | } 29 | return { 30 | decode, 31 | encode, 32 | check, 33 | expected, 34 | canAdd, 35 | }; 36 | } 37 | exports.makeConverter = makeConverter; 38 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/tools.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { KeyValue } from '../interfaces'; 3 | export declare const range: (n: number) => number[]; 4 | export declare function reverseBuffer(buffer: Buffer): Buffer; 5 | export declare function keyValsToBuffer(keyVals: KeyValue[]): Buffer; 6 | export declare function keyValToBuffer(keyVal: KeyValue): Buffer; 7 | export declare function readUInt64LE(buffer: Buffer, offset: number): number; 8 | export declare function writeUInt64LE(buffer: Buffer, value: number, offset: number): number; 9 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/converter/varint.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function encode(_number: number, buffer?: Buffer, offset?: number): Buffer; 3 | export declare function decode(buffer: Buffer, offset?: number): number; 4 | export declare function encodingLength(_number: number): number; 5 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/interfaces.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/parser/fromBuffer.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { KeyValue, Transaction, TransactionFromBuffer } from '../interfaces'; 3 | import { PsbtAttributes } from './index'; 4 | export declare function psbtFromBuffer(buffer: Buffer, txGetter: TransactionFromBuffer): PsbtAttributes; 5 | interface PsbtFromKeyValsArg { 6 | globalMapKeyVals: KeyValue[]; 7 | inputKeyVals: KeyValue[][]; 8 | outputKeyVals: KeyValue[][]; 9 | } 10 | export declare function checkKeyBuffer(type: string, keyBuf: Buffer, keyNum: number): void; 11 | export declare function psbtFromKeyVals(unsignedTx: Transaction, { globalMapKeyVals, inputKeyVals, outputKeyVals }: PsbtFromKeyValsArg): PsbtAttributes; 12 | export {}; 13 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/parser/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PsbtGlobal, PsbtInput, PsbtOutput } from '../interfaces'; 2 | export * from './fromBuffer'; 3 | export * from './toBuffer'; 4 | export interface PsbtAttributes { 5 | globalMap: PsbtGlobal; 6 | inputs: PsbtInput[]; 7 | outputs: PsbtOutput[]; 8 | } 9 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/parser/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, '__esModule', { value: true }); 6 | __export(require('./fromBuffer')); 7 | __export(require('./toBuffer')); 8 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/parser/toBuffer.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { KeyValue } from '../interfaces'; 3 | import { PsbtAttributes } from './index'; 4 | export declare function psbtToBuffer({ globalMap, inputs, outputs, }: PsbtAttributes): Buffer; 5 | export declare function psbtToKeyVals({ globalMap, inputs, outputs, }: PsbtAttributes): { 6 | globalKeyVals: KeyValue[]; 7 | inputKeyVals: KeyValue[][]; 8 | outputKeyVals: KeyValue[][]; 9 | }; 10 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/psbt.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { KeyValue, PsbtGlobal, PsbtGlobalUpdate, PsbtInput, PsbtInputExtended, PsbtInputUpdate, PsbtOutput, PsbtOutputExtended, PsbtOutputUpdate, Transaction, TransactionFromBuffer } from './interfaces'; 3 | export declare class Psbt { 4 | static fromBase64(this: T, data: string, txFromBuffer: TransactionFromBuffer): InstanceType; 5 | static fromHex(this: T, data: string, txFromBuffer: TransactionFromBuffer): InstanceType; 6 | static fromBuffer(this: T, buffer: Buffer, txFromBuffer: TransactionFromBuffer): InstanceType; 7 | readonly inputs: PsbtInput[]; 8 | readonly outputs: PsbtOutput[]; 9 | readonly globalMap: PsbtGlobal; 10 | constructor(tx: Transaction); 11 | toBase64(): string; 12 | toHex(): string; 13 | toBuffer(): Buffer; 14 | updateGlobal(updateData: PsbtGlobalUpdate): this; 15 | updateInput(inputIndex: number, updateData: PsbtInputUpdate): this; 16 | updateOutput(outputIndex: number, updateData: PsbtOutputUpdate): this; 17 | addUnknownKeyValToGlobal(keyVal: KeyValue): this; 18 | addUnknownKeyValToInput(inputIndex: number, keyVal: KeyValue): this; 19 | addUnknownKeyValToOutput(outputIndex: number, keyVal: KeyValue): this; 20 | addInput(inputData: PsbtInputExtended): this; 21 | addOutput(outputData: PsbtOutputExtended): this; 22 | clearFinalizedInput(inputIndex: number): this; 23 | combine(...those: this[]): this; 24 | getTransaction(): Buffer; 25 | } 26 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/typeFields.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum GlobalTypes { 2 | UNSIGNED_TX = 0, 3 | GLOBAL_XPUB = 1 4 | } 5 | export declare const GLOBAL_TYPE_NAMES: string[]; 6 | export declare enum InputTypes { 7 | NON_WITNESS_UTXO = 0, 8 | WITNESS_UTXO = 1, 9 | PARTIAL_SIG = 2, 10 | SIGHASH_TYPE = 3, 11 | REDEEM_SCRIPT = 4, 12 | WITNESS_SCRIPT = 5, 13 | BIP32_DERIVATION = 6, 14 | FINAL_SCRIPTSIG = 7, 15 | FINAL_SCRIPTWITNESS = 8, 16 | POR_COMMITMENT = 9, 17 | TAP_KEY_SIG = 19, 18 | TAP_SCRIPT_SIG = 20, 19 | TAP_LEAF_SCRIPT = 21, 20 | TAP_BIP32_DERIVATION = 22, 21 | TAP_INTERNAL_KEY = 23, 22 | TAP_MERKLE_ROOT = 24 23 | } 24 | export declare const INPUT_TYPE_NAMES: string[]; 25 | export declare enum OutputTypes { 26 | REDEEM_SCRIPT = 0, 27 | WITNESS_SCRIPT = 1, 28 | BIP32_DERIVATION = 2, 29 | TAP_INTERNAL_KEY = 5, 30 | TAP_TREE = 6, 31 | TAP_BIP32_DERIVATION = 7 32 | } 33 | export declare const OUTPUT_TYPE_NAMES: string[]; 34 | -------------------------------------------------------------------------------- /node_modules/bip174/src/lib/utils.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { KeyValue, PsbtGlobal, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate } from './interfaces'; 3 | export declare function checkForInput(inputs: PsbtInput[], inputIndex: number): PsbtInput; 4 | export declare function checkForOutput(outputs: PsbtOutput[], outputIndex: number): PsbtOutput; 5 | export declare function checkHasKey(checkKeyVal: KeyValue, keyVals: KeyValue[] | undefined, enumLength: number): void; 6 | export declare function getEnumLength(myenum: any): number; 7 | export declare function inputCheckUncleanFinalized(inputIndex: number, input: PsbtInput): void; 8 | export declare const updateGlobal: (updateData: PsbtGlobalUpdate, mainData: PsbtGlobal) => void; 9 | export declare const updateInput: (updateData: PsbtInputUpdate, mainData: PsbtInput) => void; 10 | export declare const updateOutput: (updateData: PsbtOutputUpdate, mainData: PsbtOutput) => void; 11 | export declare function addInputAttributes(inputs: PsbtInput[], data: any): void; 12 | export declare function addOutputAttributes(outputs: PsbtOutput[], data: any): void; 13 | export declare function defaultVersionSetter(version: number, txBuf: Buffer): Buffer; 14 | export declare function defaultLocktimeSetter(locktime: number, txBuf: Buffer): Buffer; 15 | -------------------------------------------------------------------------------- /node_modules/bip32/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 bitcoinjs-lib contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/bip32/README.md: -------------------------------------------------------------------------------- 1 | # bip32 2 | [![Github CI](https://github.com/bitcoinjs/bip32/actions/workflows/main_ci.yml/badge.svg)](https://github.com/bitcoinjs/bip32/actions/workflows/main_ci.yml) [![NPM](https://img.shields.io/npm/v/bip32.svg)](https://www.npmjs.org/package/bip32) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) 3 | 4 | A [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) compatible library written in TypeScript with transpiled JavaScript committed to git. 5 | 6 | 7 | ## Example 8 | 9 | TypeScript 10 | 11 | ``` typescript 12 | import BIP32Factory from 'bip32'; 13 | import * as ecc from 'tiny-secp256k1'; 14 | import { BIP32Interface } from 'bip32'; 15 | // You must wrap a tiny-secp256k1 compatible implementation 16 | const bip32 = BIP32Factory(ecc); 17 | 18 | const node: BIP32Interface = bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'); 19 | 20 | const child: BIP32Interface = node.derivePath('m/0/0'); 21 | // ... 22 | ``` 23 | 24 | NodeJS 25 | 26 | ``` javascript 27 | const ecc = require('tiny-secp256k1') 28 | const { BIP32Factory } = require('bip32') 29 | // You must wrap a tiny-secp256k1 compatible implementation 30 | const bip32 = BIP32Factory(ecc) 31 | 32 | const node = bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi') 33 | 34 | const child = node.derivePath('m/0/0') 35 | ``` 36 | 37 | ## LICENSE [MIT](LICENSE) 38 | A derivation (and extraction for modularity) of the `HDWallet`/`HDNode` written and tested by [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) contributors since 2014. 39 | -------------------------------------------------------------------------------- /node_modules/bip32/src/crypto.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.hmacSHA512 = exports.hash160 = void 0; 4 | const hmac_1 = require("@noble/hashes/hmac"); 5 | const ripemd160_1 = require("@noble/hashes/ripemd160"); 6 | const sha256_1 = require("@noble/hashes/sha256"); 7 | const sha512_1 = require("@noble/hashes/sha512"); 8 | function hash160(buffer) { 9 | const sha256Hash = (0, sha256_1.sha256)(Uint8Array.from(buffer)); 10 | return Buffer.from((0, ripemd160_1.ripemd160)(sha256Hash)); 11 | } 12 | exports.hash160 = hash160; 13 | function hmacSHA512(key, data) { 14 | return Buffer.from((0, hmac_1.hmac)(sha512_1.sha512, key, data)); 15 | } 16 | exports.hmacSHA512 = hmacSHA512; 17 | -------------------------------------------------------------------------------- /node_modules/bip32/src/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.BIP32Factory = exports.default = void 0; 4 | var bip32_1 = require("./bip32"); 5 | Object.defineProperty(exports, "default", { enumerable: true, get: function () { return bip32_1.BIP32Factory; } }); 6 | Object.defineProperty(exports, "BIP32Factory", { enumerable: true, get: function () { return bip32_1.BIP32Factory; } }); 7 | -------------------------------------------------------------------------------- /node_modules/bip32/types/crypto.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function hash160(buffer: Buffer): Buffer; 3 | export declare function hmacSHA512(key: Buffer, data: Buffer): Buffer; 4 | -------------------------------------------------------------------------------- /node_modules/bip32/types/index.d.ts: -------------------------------------------------------------------------------- 1 | export { BIP32Factory as default, BIP32Factory, BIP32Interface, BIP32API, TinySecp256k1Interface, } from './bip32'; 2 | -------------------------------------------------------------------------------- /node_modules/bip32/types/testecc.d.ts: -------------------------------------------------------------------------------- 1 | import { TinySecp256k1Interface } from './bip32'; 2 | export declare function testEcc(ecc: TinySecp256k1Interface): void; 3 | -------------------------------------------------------------------------------- /node_modules/bip39/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Wei Lu and Daniel Cousens 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /node_modules/bip39/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bip39", 3 | "version": "3.1.0", 4 | "description": "Bitcoin BIP39: Mnemonic code for generating deterministic keys", 5 | "main": "src/index.js", 6 | "types": "./types/index.d.ts", 7 | "scripts": { 8 | "build": "npm run clean && tsc -p tsconfig.json", 9 | "clean": "rm -rf src", 10 | "coverage": "nyc --branches 85 --functions 100 --check-coverage npm run unit", 11 | "format": "npm run prettier -- --write", 12 | "format:ci": "npm run prettier -- --check", 13 | "gitdiff:ci": "npm run build && git diff --exit-code", 14 | "lint": "tslint -p tsconfig.json -c tslint.json", 15 | "prettier": "prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore", 16 | "test": "npm run build && npm run format:ci && npm run lint && npm run unit", 17 | "unit": "tape test/*.js", 18 | "update": "node -e \"require('./util/wordlists').update()\"" 19 | }, 20 | "author": "Wei Lu", 21 | "contributors": [ 22 | { 23 | "name": "Daniel Cousens", 24 | "email": "email@dcousens.com", 25 | "url": "http://dcousens.com" 26 | } 27 | ], 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/bitcoinjs/bip39.git" 31 | }, 32 | "license": "ISC", 33 | "files": [ 34 | "src", 35 | "types" 36 | ], 37 | "dependencies": { 38 | "@noble/hashes": "^1.2.0" 39 | }, 40 | "devDependencies": { 41 | "@types/node": "11.11.6", 42 | "node-fetch": "2.6.9", 43 | "nyc": "^15.0.0", 44 | "prettier": "1.16.4", 45 | "proxyquire": "^1.7.10", 46 | "tape": "^4.13.2", 47 | "tslint": "^6.1.0", 48 | "typescript": "3.3.4000" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/bip39/types/_wordlists.d.ts: -------------------------------------------------------------------------------- 1 | declare const wordlists: { 2 | [index: string]: string[]; 3 | }; 4 | declare let _default: string[] | undefined; 5 | export { wordlists, _default }; 6 | -------------------------------------------------------------------------------- /node_modules/bip39/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function mnemonicToSeedSync(mnemonic: string, password?: string): Buffer; 3 | export declare function mnemonicToSeed(mnemonic: string, password?: string): Promise; 4 | export declare function mnemonicToEntropy(mnemonic: string, wordlist?: string[]): string; 5 | export declare function entropyToMnemonic(entropy: Buffer | string, wordlist?: string[]): string; 6 | export declare function generateMnemonic(strength?: number, rng?: (size: number) => Buffer, wordlist?: string[]): string; 7 | export declare function validateMnemonic(mnemonic: string, wordlist?: string[]): boolean; 8 | export declare function setDefaultWordlist(language: string): void; 9 | export declare function getDefaultWordlist(): string; 10 | export { wordlists } from './_wordlists'; 11 | -------------------------------------------------------------------------------- /node_modules/bip39/types/wordlists.d.ts: -------------------------------------------------------------------------------- 1 | declare const wordlists: { 2 | [index: string]: string[]; 3 | }; 4 | declare let _default: string[] | undefined; 5 | export { wordlists, _default }; 6 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2020 bitcoinjs-lib contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/address.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { Network } from './networks'; 3 | export interface Base58CheckResult { 4 | hash: Buffer; 5 | version: number; 6 | } 7 | export interface Bech32Result { 8 | version: number; 9 | prefix: string; 10 | data: Buffer; 11 | } 12 | export declare function fromBase58Check(address: string): Base58CheckResult; 13 | export declare function fromBech32(address: string): Bech32Result; 14 | export declare function toBase58Check(hash: Buffer, version: number): string; 15 | export declare function toBech32(data: Buffer, version: number, prefix: string): string; 16 | export declare function fromOutputScript(output: Buffer, network?: Network): string; 17 | export declare function toOutputScript(address: string, network?: Network): Buffer; 18 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/bip66.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function check(buffer: Buffer): boolean; 3 | export declare function decode(buffer: Buffer): { 4 | r: Buffer; 5 | s: Buffer; 6 | }; 7 | export declare function encode(r: Buffer, s: Buffer): Buffer; 8 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/block.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { Transaction } from './transaction'; 3 | export declare class Block { 4 | static fromBuffer(buffer: Buffer): Block; 5 | static fromHex(hex: string): Block; 6 | static calculateTarget(bits: number): Buffer; 7 | static calculateMerkleRoot(transactions: Transaction[], forWitness?: boolean): Buffer; 8 | version: number; 9 | prevHash?: Buffer; 10 | merkleRoot?: Buffer; 11 | timestamp: number; 12 | witnessCommit?: Buffer; 13 | bits: number; 14 | nonce: number; 15 | transactions?: Transaction[]; 16 | getWitnessCommit(): Buffer | null; 17 | hasWitnessCommit(): boolean; 18 | hasWitness(): boolean; 19 | weight(): number; 20 | byteLength(headersOnly?: boolean, allowWitness?: boolean): number; 21 | getHash(): Buffer; 22 | getId(): string; 23 | getUTCDate(): Date; 24 | toBuffer(headersOnly?: boolean): Buffer; 25 | toHex(headersOnly?: boolean): string; 26 | checkTxRoots(): boolean; 27 | checkProofOfWork(): boolean; 28 | private __checkMerkleRoot; 29 | private __checkWitnessCommit; 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/bufferutils.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as varuint from 'varuint-bitcoin'; 3 | export { varuint }; 4 | export declare function readUInt64LE(buffer: Buffer, offset: number): number; 5 | export declare function writeUInt64LE(buffer: Buffer, value: number, offset: number): number; 6 | export declare function reverseBuffer(buffer: Buffer): Buffer; 7 | export declare function cloneBuffer(buffer: Buffer): Buffer; 8 | /** 9 | * Helper class for serialization of bitcoin data types into a pre-allocated buffer. 10 | */ 11 | export declare class BufferWriter { 12 | buffer: Buffer; 13 | offset: number; 14 | static withCapacity(size: number): BufferWriter; 15 | constructor(buffer: Buffer, offset?: number); 16 | writeUInt8(i: number): void; 17 | writeInt32(i: number): void; 18 | writeUInt32(i: number): void; 19 | writeUInt64(i: number): void; 20 | writeVarInt(i: number): void; 21 | writeSlice(slice: Buffer): void; 22 | writeVarSlice(slice: Buffer): void; 23 | writeVector(vector: Buffer[]): void; 24 | end(): Buffer; 25 | } 26 | /** 27 | * Helper class for reading of bitcoin data types from a buffer. 28 | */ 29 | export declare class BufferReader { 30 | buffer: Buffer; 31 | offset: number; 32 | constructor(buffer: Buffer, offset?: number); 33 | readUInt8(): number; 34 | readInt32(): number; 35 | readUInt32(): number; 36 | readUInt64(): number; 37 | readVarInt(): number; 38 | readSlice(n: number): Buffer; 39 | readVarSlice(): Buffer; 40 | readVector(): Buffer[]; 41 | } 42 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/crypto.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function ripemd160(buffer: Buffer): Buffer; 3 | export declare function sha1(buffer: Buffer): Buffer; 4 | export declare function sha256(buffer: Buffer): Buffer; 5 | export declare function hash160(buffer: Buffer): Buffer; 6 | export declare function hash256(buffer: Buffer): Buffer; 7 | export declare const TAGS: readonly ["BIP0340/challenge", "BIP0340/aux", "BIP0340/nonce", "TapLeaf", "TapBranch", "TapSighash", "TapTweak", "KeyAgg list", "KeyAgg coefficient"]; 8 | export type TaggedHashPrefix = typeof TAGS[number]; 9 | type TaggedHashPrefixes = { 10 | [key in TaggedHashPrefix]: Buffer; 11 | }; 12 | /** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ 13 | export declare const TAGGED_HASH_PREFIXES: TaggedHashPrefixes; 14 | export declare function taggedHash(prefix: TaggedHashPrefix, data: Buffer): Buffer; 15 | export {}; 16 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/ecc_lib.d.ts: -------------------------------------------------------------------------------- 1 | import { TinySecp256k1Interface } from './types'; 2 | export declare function initEccLib(eccLib: TinySecp256k1Interface | undefined): void; 3 | export declare function getEccLib(): TinySecp256k1Interface; 4 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import * as address from './address'; 2 | import * as crypto from './crypto'; 3 | import * as networks from './networks'; 4 | import * as payments from './payments'; 5 | import * as script from './script'; 6 | export { address, crypto, networks, payments, script }; 7 | export { Block } from './block'; 8 | export { TaggedHashPrefix } from './crypto'; 9 | export { Psbt, PsbtTxInput, PsbtTxOutput, Signer, SignerAsync, HDSigner, HDSignerAsync, } from './psbt'; 10 | export { OPS as opcodes } from './ops'; 11 | export { Transaction } from './transaction'; 12 | export { Network } from './networks'; 13 | export { Payment, PaymentCreator, PaymentOpts, Stack, StackElement, } from './payments'; 14 | export { Input as TxInput, Output as TxOutput } from './transaction'; 15 | export { initEccLib } from './ecc_lib'; 16 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | exports.initEccLib = 4 | exports.Transaction = 5 | exports.opcodes = 6 | exports.Psbt = 7 | exports.Block = 8 | exports.script = 9 | exports.payments = 10 | exports.networks = 11 | exports.crypto = 12 | exports.address = 13 | void 0; 14 | const address = require('./address'); 15 | exports.address = address; 16 | const crypto = require('./crypto'); 17 | exports.crypto = crypto; 18 | const networks = require('./networks'); 19 | exports.networks = networks; 20 | const payments = require('./payments'); 21 | exports.payments = payments; 22 | const script = require('./script'); 23 | exports.script = script; 24 | var block_1 = require('./block'); 25 | Object.defineProperty(exports, 'Block', { 26 | enumerable: true, 27 | get: function () { 28 | return block_1.Block; 29 | }, 30 | }); 31 | var psbt_1 = require('./psbt'); 32 | Object.defineProperty(exports, 'Psbt', { 33 | enumerable: true, 34 | get: function () { 35 | return psbt_1.Psbt; 36 | }, 37 | }); 38 | var ops_1 = require('./ops'); 39 | Object.defineProperty(exports, 'opcodes', { 40 | enumerable: true, 41 | get: function () { 42 | return ops_1.OPS; 43 | }, 44 | }); 45 | var transaction_1 = require('./transaction'); 46 | Object.defineProperty(exports, 'Transaction', { 47 | enumerable: true, 48 | get: function () { 49 | return transaction_1.Transaction; 50 | }, 51 | }); 52 | var ecc_lib_1 = require('./ecc_lib'); 53 | Object.defineProperty(exports, 'initEccLib', { 54 | enumerable: true, 55 | get: function () { 56 | return ecc_lib_1.initEccLib; 57 | }, 58 | }); 59 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/merkle.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function fastMerkleRoot(values: Buffer[], digestFn: (b: Buffer) => Buffer): Buffer; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/merkle.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | exports.fastMerkleRoot = void 0; 4 | function fastMerkleRoot(values, digestFn) { 5 | if (!Array.isArray(values)) throw TypeError('Expected values Array'); 6 | if (typeof digestFn !== 'function') 7 | throw TypeError('Expected digest Function'); 8 | let length = values.length; 9 | const results = values.concat(); 10 | while (length > 1) { 11 | let j = 0; 12 | for (let i = 0; i < length; i += 2, ++j) { 13 | const left = results[i]; 14 | const right = i + 1 === length ? left : results[i + 1]; 15 | const data = Buffer.concat([left, right]); 16 | results[j] = digestFn(data); 17 | } 18 | length = j; 19 | } 20 | return results[0]; 21 | } 22 | exports.fastMerkleRoot = fastMerkleRoot; 23 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/networks.d.ts: -------------------------------------------------------------------------------- 1 | export interface Network { 2 | messagePrefix: string; 3 | bech32: string; 4 | bip32: Bip32; 5 | pubKeyHash: number; 6 | scriptHash: number; 7 | wif: number; 8 | } 9 | interface Bip32 { 10 | public: number; 11 | private: number; 12 | } 13 | export declare const bitcoin: Network; 14 | export declare const regtest: Network; 15 | export declare const testnet: Network; 16 | export {}; 17 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/networks.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | exports.testnet = exports.regtest = exports.bitcoin = void 0; 4 | exports.bitcoin = { 5 | messagePrefix: '\x18Bitcoin Signed Message:\n', 6 | bech32: 'bc', 7 | bip32: { 8 | public: 0x0488b21e, 9 | private: 0x0488ade4, 10 | }, 11 | pubKeyHash: 0x00, 12 | scriptHash: 0x05, 13 | wif: 0x80, 14 | }; 15 | exports.regtest = { 16 | messagePrefix: '\x18Bitcoin Signed Message:\n', 17 | bech32: 'bcrt', 18 | bip32: { 19 | public: 0x043587cf, 20 | private: 0x04358394, 21 | }, 22 | pubKeyHash: 0x6f, 23 | scriptHash: 0xc4, 24 | wif: 0xef, 25 | }; 26 | exports.testnet = { 27 | messagePrefix: '\x18Bitcoin Signed Message:\n', 28 | bech32: 'tb', 29 | bip32: { 30 | public: 0x043587cf, 31 | private: 0x04358394, 32 | }, 33 | pubKeyHash: 0x6f, 34 | scriptHash: 0xc4, 35 | wif: 0xef, 36 | }; 37 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/ops.d.ts: -------------------------------------------------------------------------------- 1 | declare const OPS: { 2 | [key: string]: number; 3 | }; 4 | declare const REVERSE_OPS: { 5 | [key: number]: string; 6 | }; 7 | export { OPS, REVERSE_OPS }; 8 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/bip341.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { Tapleaf, Taptree } from '../types'; 3 | export declare const LEAF_VERSION_TAPSCRIPT = 192; 4 | export declare const MAX_TAPTREE_DEPTH = 128; 5 | interface HashLeaf { 6 | hash: Buffer; 7 | } 8 | interface HashBranch { 9 | hash: Buffer; 10 | left: HashTree; 11 | right: HashTree; 12 | } 13 | interface TweakedPublicKey { 14 | parity: number; 15 | x: Buffer; 16 | } 17 | /** 18 | * Binary tree representing leaf, branch, and root node hashes of a Taptree. 19 | * Each node contains a hash, and potentially left and right branch hashes. 20 | * This tree is used for 2 purposes: Providing the root hash for tweaking, 21 | * and calculating merkle inclusion proofs when constructing a control block. 22 | */ 23 | export type HashTree = HashLeaf | HashBranch; 24 | export declare function rootHashFromPath(controlBlock: Buffer, leafHash: Buffer): Buffer; 25 | /** 26 | * Build a hash tree of merkle nodes from the scripts binary tree. 27 | * @param scriptTree - the tree of scripts to pairwise hash. 28 | */ 29 | export declare function toHashTree(scriptTree: Taptree): HashTree; 30 | /** 31 | * Given a HashTree, finds the path from a particular hash to the root. 32 | * @param node - the root of the tree 33 | * @param hash - the hash to search for 34 | * @returns - array of sibling hashes, from leaf (inclusive) to root 35 | * (exclusive) needed to prove inclusion of the specified hash. undefined if no 36 | * path is found 37 | */ 38 | export declare function findScriptPath(node: HashTree, hash: Buffer): Buffer[] | undefined; 39 | export declare function tapleafHash(leaf: Tapleaf): Buffer; 40 | export declare function tapTweakHash(pubKey: Buffer, h: Buffer | undefined): Buffer; 41 | export declare function tweakKey(pubKey: Buffer, h: Buffer | undefined): TweakedPublicKey | null; 42 | export {}; 43 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/embed.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2data(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { Network } from '../networks'; 3 | import { Taptree } from '../types'; 4 | import { p2data as embed } from './embed'; 5 | import { p2ms } from './p2ms'; 6 | import { p2pk } from './p2pk'; 7 | import { p2pkh } from './p2pkh'; 8 | import { p2sh } from './p2sh'; 9 | import { p2wpkh } from './p2wpkh'; 10 | import { p2wsh } from './p2wsh'; 11 | import { p2tr } from './p2tr'; 12 | export interface Payment { 13 | name?: string; 14 | network?: Network; 15 | output?: Buffer; 16 | data?: Buffer[]; 17 | m?: number; 18 | n?: number; 19 | pubkeys?: Buffer[]; 20 | input?: Buffer; 21 | signatures?: Buffer[]; 22 | internalPubkey?: Buffer; 23 | pubkey?: Buffer; 24 | signature?: Buffer; 25 | address?: string; 26 | hash?: Buffer; 27 | redeem?: Payment; 28 | redeemVersion?: number; 29 | scriptTree?: Taptree; 30 | witness?: Buffer[]; 31 | } 32 | export type PaymentCreator = (a: Payment, opts?: PaymentOpts) => Payment; 33 | export type PaymentFunction = () => Payment; 34 | export interface PaymentOpts { 35 | validate?: boolean; 36 | allowIncomplete?: boolean; 37 | } 38 | export type StackElement = Buffer | number; 39 | export type Stack = StackElement[]; 40 | export type StackFunction = () => Stack; 41 | export { embed, p2ms, p2pk, p2pkh, p2sh, p2wpkh, p2wsh, p2tr }; 42 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | exports.p2tr = 4 | exports.p2wsh = 5 | exports.p2wpkh = 6 | exports.p2sh = 7 | exports.p2pkh = 8 | exports.p2pk = 9 | exports.p2ms = 10 | exports.embed = 11 | void 0; 12 | const embed_1 = require('./embed'); 13 | Object.defineProperty(exports, 'embed', { 14 | enumerable: true, 15 | get: function () { 16 | return embed_1.p2data; 17 | }, 18 | }); 19 | const p2ms_1 = require('./p2ms'); 20 | Object.defineProperty(exports, 'p2ms', { 21 | enumerable: true, 22 | get: function () { 23 | return p2ms_1.p2ms; 24 | }, 25 | }); 26 | const p2pk_1 = require('./p2pk'); 27 | Object.defineProperty(exports, 'p2pk', { 28 | enumerable: true, 29 | get: function () { 30 | return p2pk_1.p2pk; 31 | }, 32 | }); 33 | const p2pkh_1 = require('./p2pkh'); 34 | Object.defineProperty(exports, 'p2pkh', { 35 | enumerable: true, 36 | get: function () { 37 | return p2pkh_1.p2pkh; 38 | }, 39 | }); 40 | const p2sh_1 = require('./p2sh'); 41 | Object.defineProperty(exports, 'p2sh', { 42 | enumerable: true, 43 | get: function () { 44 | return p2sh_1.p2sh; 45 | }, 46 | }); 47 | const p2wpkh_1 = require('./p2wpkh'); 48 | Object.defineProperty(exports, 'p2wpkh', { 49 | enumerable: true, 50 | get: function () { 51 | return p2wpkh_1.p2wpkh; 52 | }, 53 | }); 54 | const p2wsh_1 = require('./p2wsh'); 55 | Object.defineProperty(exports, 'p2wsh', { 56 | enumerable: true, 57 | get: function () { 58 | return p2wsh_1.p2wsh; 59 | }, 60 | }); 61 | const p2tr_1 = require('./p2tr'); 62 | Object.defineProperty(exports, 'p2tr', { 63 | enumerable: true, 64 | get: function () { 65 | return p2tr_1.p2tr; 66 | }, 67 | }); 68 | // TODO 69 | // witness commitment 70 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/lazy.d.ts: -------------------------------------------------------------------------------- 1 | export declare function prop(object: {}, name: string, f: () => any): void; 2 | export declare function value(f: () => T): () => T; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/lazy.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | exports.value = exports.prop = void 0; 4 | function prop(object, name, f) { 5 | Object.defineProperty(object, name, { 6 | configurable: true, 7 | enumerable: true, 8 | get() { 9 | const _value = f.call(this); 10 | this[name] = _value; 11 | return _value; 12 | }, 13 | set(_value) { 14 | Object.defineProperty(this, name, { 15 | configurable: true, 16 | enumerable: true, 17 | value: _value, 18 | writable: true, 19 | }); 20 | }, 21 | }); 22 | } 23 | exports.prop = prop; 24 | function value(f) { 25 | let _value; 26 | return () => { 27 | if (_value !== undefined) return _value; 28 | _value = f(); 29 | return _value; 30 | }; 31 | } 32 | exports.value = value; 33 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2ms.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2ms(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2pk.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2pk(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2pkh.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2pkh(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2sh.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2sh(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2tr.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2tr(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2wpkh.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2wpkh(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/payments/p2wsh.d.ts: -------------------------------------------------------------------------------- 1 | import { Payment, PaymentOpts } from './index'; 2 | export declare function p2wsh(a: Payment, opts?: PaymentOpts): Payment; 3 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/psbt/psbtutils.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { PsbtInput } from 'bip174/src/lib/interfaces'; 3 | export declare const isP2MS: (script: Buffer) => boolean; 4 | export declare const isP2PK: (script: Buffer) => boolean; 5 | export declare const isP2PKH: (script: Buffer) => boolean; 6 | export declare const isP2WPKH: (script: Buffer) => boolean; 7 | export declare const isP2WSHScript: (script: Buffer) => boolean; 8 | export declare const isP2SHScript: (script: Buffer) => boolean; 9 | export declare const isP2TR: (script: Buffer) => boolean; 10 | export declare function witnessStackToScriptWitness(witness: Buffer[]): Buffer; 11 | export declare function pubkeyPositionInScript(pubkey: Buffer, script: Buffer): number; 12 | export declare function pubkeyInScript(pubkey: Buffer, script: Buffer): boolean; 13 | export declare function checkInputForSig(input: PsbtInput, action: string): boolean; 14 | type SignatureDecodeFunc = (buffer: Buffer) => { 15 | signature: Buffer; 16 | hashType: number; 17 | }; 18 | export declare function signatureBlocksAction(signature: Buffer, signatureDecodeFn: SignatureDecodeFunc, action: string): boolean; 19 | export {}; 20 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/push_data.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function encodingLength(i: number): number; 3 | export declare function encode(buffer: Buffer, num: number, offset: number): number; 4 | export declare function decode(buffer: Buffer, offset: number): { 5 | opcode: number; 6 | number: number; 7 | size: number; 8 | } | null; 9 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/script.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { OPS } from './ops'; 3 | import { Stack } from './payments'; 4 | import * as scriptNumber from './script_number'; 5 | import * as scriptSignature from './script_signature'; 6 | export { OPS }; 7 | export declare function isPushOnly(value: Stack): boolean; 8 | export declare function countNonPushOnlyOPs(value: Stack): number; 9 | export declare function compile(chunks: Buffer | Stack): Buffer; 10 | export declare function decompile(buffer: Buffer | Array): Array | null; 11 | export declare function toASM(chunks: Buffer | Array): string; 12 | export declare function fromASM(asm: string): Buffer; 13 | export declare function toStack(chunks: Buffer | Array): Buffer[]; 14 | export declare function isCanonicalPubKey(buffer: Buffer): boolean; 15 | export declare function isDefinedHashType(hashType: number): boolean; 16 | export declare function isCanonicalScriptSignature(buffer: Buffer): boolean; 17 | export declare const number: typeof scriptNumber; 18 | export declare const signature: typeof scriptSignature; 19 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/script_number.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function decode(buffer: Buffer, maxLength?: number, minimal?: boolean): number; 3 | export declare function encode(_number: number): Buffer; 4 | -------------------------------------------------------------------------------- /node_modules/bitcoinjs-lib/src/script_signature.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | interface ScriptSignature { 3 | signature: Buffer; 4 | hashType: number; 5 | } 6 | export declare function decode(buffer: Buffer): ScriptSignature; 7 | export declare function encode(signature: Buffer, hashType: number): Buffer; 8 | export {}; 9 | -------------------------------------------------------------------------------- /node_modules/bs58/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 cryptocoinjs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/bs58/index.d.ts: -------------------------------------------------------------------------------- 1 | import { BaseConverter } from 'base-x'; 2 | 3 | declare const base58: BaseConverter; 4 | 5 | export = base58; 6 | -------------------------------------------------------------------------------- /node_modules/bs58/index.js: -------------------------------------------------------------------------------- 1 | const basex = require('base-x') 2 | const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' 3 | 4 | module.exports = basex(ALPHABET) 5 | -------------------------------------------------------------------------------- /node_modules/bs58/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bs58", 3 | "version": "5.0.0", 4 | "description": "Base 58 encoding / decoding", 5 | "keywords": [ 6 | "base58", 7 | "bitcoin", 8 | "crypto", 9 | "crytography", 10 | "decode", 11 | "decoding", 12 | "encode", 13 | "encoding", 14 | "litecoin" 15 | ], 16 | "license": "MIT", 17 | "devDependencies": { 18 | "standard": "^16.0.4", 19 | "tape": "^4.6.3" 20 | }, 21 | "repository": { 22 | "url": "https://github.com/cryptocoinjs/bs58", 23 | "type": "git" 24 | }, 25 | "files": [ 26 | "index.js", 27 | "index.d.ts" 28 | ], 29 | "main": "index.js", 30 | "types": "index.d.ts", 31 | "scripts": { 32 | "standard": "standard", 33 | "test": "npm run standard && npm run unit", 34 | "unit": "tape test/index.js" 35 | }, 36 | "dependencies": { 37 | "base-x": "^4.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /node_modules/bs58check/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Daniel Cousens 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/bs58check/README.md: -------------------------------------------------------------------------------- 1 | # bs58check 2 | 3 | [![NPM Package](https://img.shields.io/npm/v/bs58check.svg?style=flat-square)](https://www.npmjs.org/package/bs58check) 4 | [![Build Status](https://img.shields.io/travis/bitcoinjs/bs58check.svg?branch=master&style=flat-square)](https://travis-ci.org/bitcoinjs/bs58check) 5 | [![Dependency status](https://img.shields.io/david/bitcoinjs/bs58check.svg?style=flat-square)](https://david-dm.org/bitcoinjs/bs58check#info=dependencies) 6 | 7 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) 8 | 9 | A straight forward implementation of base58check extending upon bs58. 10 | 11 | 12 | ## Example 13 | 14 | ```javascript 15 | var bs58check = require('bs58check') 16 | 17 | var decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr') 18 | 19 | console.log(decoded) 20 | // => 21 | 22 | console.log(bs58check.encode(decoded)) 23 | // => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr 24 | ``` 25 | 26 | 27 | ## LICENSE [MIT](LICENSE) 28 | -------------------------------------------------------------------------------- /node_modules/bs58check/base.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var base58 = require('bs58') 4 | 5 | module.exports = function (checksumFn) { 6 | // Encode a buffer as a base58-check encoded string 7 | function encode (payload) { 8 | var payloadU8 = Uint8Array.from(payload) 9 | var checksum = checksumFn(payloadU8) 10 | var length = payloadU8.length + 4 11 | var both = new Uint8Array(length) 12 | both.set(payloadU8, 0) 13 | both.set(checksum.subarray(0, 4), payloadU8.length) 14 | return base58.encode(both, length) 15 | } 16 | 17 | function decodeRaw (buffer) { 18 | var payload = buffer.slice(0, -4) 19 | var checksum = buffer.slice(-4) 20 | var newChecksum = checksumFn(payload) 21 | 22 | if (checksum[0] ^ newChecksum[0] | 23 | checksum[1] ^ newChecksum[1] | 24 | checksum[2] ^ newChecksum[2] | 25 | checksum[3] ^ newChecksum[3]) return 26 | 27 | return payload 28 | } 29 | 30 | // Decode a base58-check encoded string to a buffer, no result if checksum is wrong 31 | function decodeUnsafe (string) { 32 | var buffer = base58.decodeUnsafe(string) 33 | if (!buffer) return 34 | 35 | return decodeRaw(buffer) 36 | } 37 | 38 | function decode (string) { 39 | var buffer = base58.decode(string) 40 | var payload = decodeRaw(buffer, checksumFn) 41 | if (!payload) throw new Error('Invalid checksum') 42 | return payload 43 | } 44 | 45 | return { 46 | encode: encode, 47 | decode: decode, 48 | decodeUnsafe: decodeUnsafe 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/bs58check/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare const bs58check: { 4 | encode(buffer: Buffer | number[] | Uint8Array): string; 5 | decodeUnsafe(string: string): Uint8Array | undefined; 6 | decode(string: string): Uint8Array; 7 | }; 8 | 9 | export = bs58check; 10 | -------------------------------------------------------------------------------- /node_modules/bs58check/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var { sha256 } = require('@noble/hashes/sha256') 4 | var bs58checkBase = require('./base') 5 | 6 | // SHA256(SHA256(buffer)) 7 | function sha256x2 (buffer) { 8 | return sha256(sha256(buffer)) 9 | } 10 | 11 | module.exports = bs58checkBase(sha256x2) 12 | -------------------------------------------------------------------------------- /node_modules/bs58check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bs58check", 3 | "version": "3.0.1", 4 | "description": "A straightforward implementation of base58-check encoding", 5 | "keywords": [ 6 | "base", 7 | "base58", 8 | "base58check", 9 | "bitcoin", 10 | "bs58", 11 | "check", 12 | "checksum", 13 | "decode", 14 | "decoding", 15 | "encode", 16 | "encoding", 17 | "litecoin" 18 | ], 19 | "homepage": "https://github.com/bitcoinjs/bs58check", 20 | "bugs": { 21 | "url": "https://github.com/bitcoinjs/bs58check/issues" 22 | }, 23 | "license": "MIT", 24 | "author": "Daniel Cousens", 25 | "files": [ 26 | "index.js", 27 | "index.d.ts", 28 | "base.js" 29 | ], 30 | "main": "index.js", 31 | "types": "index.d.ts", 32 | "repository": { 33 | "type": "git", 34 | "url": "https://github.com/bitcoinjs/bs58check.git" 35 | }, 36 | "scripts": { 37 | "coverage-report": "nyc report --reporter=lcov", 38 | "coverage": "nyc --check-coverage --branches 90 --functions 90 npm run unit", 39 | "standard": "standard", 40 | "test": "npm run standard && npm run coverage", 41 | "unit": "tape test/*.js" 42 | }, 43 | "dependencies": { 44 | "@noble/hashes": "^1.2.0", 45 | "bs58": "^5.0.0" 46 | }, 47 | "devDependencies": { 48 | "blake-hash": "^1.0.0", 49 | "nyc": "^15.0.0", 50 | "safe-buffer": "^5.1.2", 51 | "standard": "^14.3.3", 52 | "tape": "^4.13.2" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /node_modules/cipher-base/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["standard"] 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/cipher-base/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/cipher-base/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.11" 4 | - "0.10" 5 | - "0.12" 6 | - "iojs" 7 | -------------------------------------------------------------------------------- /node_modules/cipher-base/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 crypto-browserify contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/cipher-base/README.md: -------------------------------------------------------------------------------- 1 | cipher-base 2 | === 3 | 4 | [![Build Status](https://travis-ci.org/crypto-browserify/cipher-base.svg)](https://travis-ci.org/crypto-browserify/cipher-base) 5 | 6 | Abstract base class to inherit from if you want to create streams implementing 7 | the same api as node crypto streams. 8 | 9 | Requires you to implement 2 methods `_final` and `_update`. `_update` takes a 10 | buffer and should return a buffer, `_final` takes no arguments and should return 11 | a buffer. 12 | 13 | 14 | The constructor takes one argument and that is a string which if present switches 15 | it into hash mode, i.e. the object you get from crypto.createHash or 16 | crypto.createSign, this switches the name of the final method to be the string 17 | you passed instead of `final` and returns `this` from update. 18 | -------------------------------------------------------------------------------- /node_modules/cipher-base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cipher-base", 3 | "version": "1.0.4", 4 | "description": "abstract base class for crypto-streams", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "node test.js | tspec" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/crypto-browserify/cipher-base.git" 12 | }, 13 | "keywords": [ 14 | "cipher", 15 | "stream" 16 | ], 17 | "author": "Calvin Metcalf ", 18 | "license": "MIT", 19 | "bugs": { 20 | "url": "https://github.com/crypto-browserify/cipher-base/issues" 21 | }, 22 | "homepage": "https://github.com/crypto-browserify/cipher-base#readme", 23 | "dependencies": { 24 | "inherits": "^2.0.1", 25 | "safe-buffer": "^5.0.1" 26 | }, 27 | "devDependencies": { 28 | "standard": "^10.0.2", 29 | "tap-spec": "^4.1.0", 30 | "tape": "^4.2.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /node_modules/create-hash/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | before_install: 4 | - "npm install npm -g" 5 | node_js: 6 | - "4" 7 | - "5" 8 | - "6" 9 | - "7" 10 | env: 11 | matrix: 12 | - TEST_SUITE=unit 13 | matrix: 14 | include: 15 | - node_js: "7" 16 | env: TEST_SUITE=standard 17 | script: npm run $TEST_SUITE 18 | -------------------------------------------------------------------------------- /node_modules/create-hash/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 crypto-browserify contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/create-hash/README.md: -------------------------------------------------------------------------------- 1 | # create-hash 2 | 3 | [![Build Status](https://travis-ci.org/crypto-browserify/createHash.svg)](https://travis-ci.org/crypto-browserify/createHash) 4 | 5 | Node style hashes for use in the browser, with native hash functions in node. 6 | 7 | API is the same as hashes in node: 8 | ```js 9 | var createHash = require('create-hash') 10 | var hash = createHash('sha224') 11 | hash.update('synchronous write') // optional encoding parameter 12 | hash.digest() // synchronously get result with optional encoding parameter 13 | 14 | hash.write('write to it as a stream') 15 | hash.end() // remember it's a stream 16 | hash.read() // only if you ended it as a stream though 17 | ``` 18 | 19 | To get the JavaScript version even in node do `require('create-hash/browser')` 20 | -------------------------------------------------------------------------------- /node_modules/create-hash/browser.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | var inherits = require('inherits') 3 | var MD5 = require('md5.js') 4 | var RIPEMD160 = require('ripemd160') 5 | var sha = require('sha.js') 6 | var Base = require('cipher-base') 7 | 8 | function Hash (hash) { 9 | Base.call(this, 'digest') 10 | 11 | this._hash = hash 12 | } 13 | 14 | inherits(Hash, Base) 15 | 16 | Hash.prototype._update = function (data) { 17 | this._hash.update(data) 18 | } 19 | 20 | Hash.prototype._final = function () { 21 | return this._hash.digest() 22 | } 23 | 24 | module.exports = function createHash (alg) { 25 | alg = alg.toLowerCase() 26 | if (alg === 'md5') return new MD5() 27 | if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160() 28 | 29 | return new Hash(sha(alg)) 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/create-hash/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('crypto').createHash 2 | -------------------------------------------------------------------------------- /node_modules/create-hash/md5.js: -------------------------------------------------------------------------------- 1 | var MD5 = require('md5.js') 2 | 3 | module.exports = function (buffer) { 4 | return new MD5().update(buffer).digest() 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/create-hash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-hash", 3 | "version": "1.2.0", 4 | "description": "create hashes for browserify", 5 | "browser": "browser.js", 6 | "main": "index.js", 7 | "scripts": { 8 | "standard": "standard", 9 | "test": "npm run-script standard && npm run-script unit", 10 | "unit": "node test.js | tspec" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git@github.com:crypto-browserify/createHash.git" 15 | }, 16 | "keywords": [ 17 | "crypto" 18 | ], 19 | "author": "", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/crypto-browserify/createHash/issues" 23 | }, 24 | "homepage": "https://github.com/crypto-browserify/createHash", 25 | "devDependencies": { 26 | "hash-test-vectors": "^1.3.2", 27 | "safe-buffer": "^5.0.1", 28 | "standard": "^10.0.2", 29 | "tap-spec": "^2.1.2", 30 | "tape": "^4.6.3" 31 | }, 32 | "dependencies": { 33 | "cipher-base": "^1.0.1", 34 | "inherits": "^2.0.1", 35 | "md5.js": "^1.3.4", 36 | "ripemd160": "^2.0.1", 37 | "sha.js": "^2.4.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /node_modules/create-hash/test.js: -------------------------------------------------------------------------------- 1 | var test = require('tape') 2 | 3 | var Buffer = require('safe-buffer').Buffer 4 | var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160', 'ripemd160'] 5 | var encodings = ['hex', 'base64'] // ignore binary 6 | var vectors = require('hash-test-vectors') 7 | vectors.forEach(function (vector) { 8 | vector.ripemd160 = vector.rmd160 9 | }) 10 | var createHash = require('./browser') 11 | 12 | algorithms.forEach(function (algorithm) { 13 | test('test ' + algorithm + ' against test vectors', function (t) { 14 | vectors.forEach(function (obj, i) { 15 | var input = Buffer.from(obj.input, 'base64') 16 | var node = obj[algorithm] 17 | var js = createHash(algorithm).update(input).digest('hex') 18 | t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) 19 | }) 20 | 21 | encodings.forEach(function (encoding) { 22 | vectors.forEach(function (obj, i) { 23 | var input = Buffer.from(obj.input, 'base64').toString(encoding) 24 | var node = obj[algorithm] 25 | var js = createHash(algorithm).update(input, encoding).digest('hex') 26 | t.equal(js, node, algorithm + '(testVector[' + i + '], ' + encoding + ') == ' + node) 27 | }) 28 | }) 29 | 30 | vectors.forEach(function (obj, i) { 31 | var input = Buffer.from(obj.input, 'base64') 32 | var node = obj[algorithm] 33 | var hash = createHash(algorithm) 34 | hash.end(input) 35 | var js = hash.read().toString('hex') 36 | t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) 37 | }) 38 | 39 | t.end() 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /node_modules/hash-base/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Kirill Fomichev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/hash-base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hash-base", 3 | "version": "3.1.0", 4 | "description": "abstract base class for hash-streams", 5 | "keywords": [ 6 | "hash", 7 | "stream" 8 | ], 9 | "homepage": "https://github.com/crypto-browserify/hash-base", 10 | "bugs": { 11 | "url": "https://github.com/crypto-browserify/hash-base/issues" 12 | }, 13 | "license": "MIT", 14 | "author": "Kirill Fomichev (https://github.com/fanatid)", 15 | "files": [ 16 | "index.js" 17 | ], 18 | "main": "index.js", 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/crypto-browserify/hash-base.git" 22 | }, 23 | "scripts": { 24 | "coverage": "nyc node test/*.js", 25 | "lint": "standard", 26 | "test": "npm run lint && npm run unit", 27 | "unit": "node test/*.js" 28 | }, 29 | "dependencies": { 30 | "inherits": "^2.0.4", 31 | "readable-stream": "^3.6.0", 32 | "safe-buffer": "^5.2.0" 33 | }, 34 | "devDependencies": { 35 | "nyc": "^15.0.1", 36 | "standard": "^14.3.3", 37 | "tape": "^5.0.0" 38 | }, 39 | "engines": { 40 | "node": ">=4" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | Browser-friendly inheritance fully compatible with standard node.js 2 | [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). 3 | 4 | This package exports standard `inherits` from node.js `util` module in 5 | node environment, but also provides alternative browser-friendly 6 | implementation through [browser 7 | field](https://gist.github.com/shtylman/4339901). Alternative 8 | implementation is a literal copy of standard one located in standalone 9 | module to avoid requiring of `util`. It also has a shim for old 10 | browsers with no `Object.create` support. 11 | 12 | While keeping you sure you are using standard `inherits` 13 | implementation in node.js environment, it allows bundlers such as 14 | [browserify](https://github.com/substack/node-browserify) to not 15 | include full `util` package to your client code if all you need is 16 | just `inherits` function. It worth, because browser shim for `util` 17 | package is large and `inherits` is often the single function you need 18 | from it. 19 | 20 | It's recommended to use this package instead of 21 | `require('util').inherits` for any code that has chances to be used 22 | not only in node.js but in browser too. 23 | 24 | ## usage 25 | 26 | ```js 27 | var inherits = require('inherits'); 28 | // then use exactly as the standard one 29 | ``` 30 | 31 | ## note on version ~1.0 32 | 33 | Version ~1.0 had completely different motivation and is not compatible 34 | neither with 2.0 nor with standard node.js `inherits`. 35 | 36 | If you are using version ~1.0 and planning to switch to ~2.0, be 37 | careful: 38 | 39 | * new version uses `super_` instead of `super` for referencing 40 | superclass 41 | * new version overwrites current prototype while old one preserves any 42 | existing fields on it 43 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | try { 2 | var util = require('util'); 3 | /* istanbul ignore next */ 4 | if (typeof util.inherits !== 'function') throw ''; 5 | module.exports = util.inherits; 6 | } catch (e) { 7 | /* istanbul ignore next */ 8 | module.exports = require('./inherits_browser.js'); 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | if (superCtor) { 5 | ctor.super_ = superCtor 6 | ctor.prototype = Object.create(superCtor.prototype, { 7 | constructor: { 8 | value: ctor, 9 | enumerable: false, 10 | writable: true, 11 | configurable: true 12 | } 13 | }) 14 | } 15 | }; 16 | } else { 17 | // old school shim for old browsers 18 | module.exports = function inherits(ctor, superCtor) { 19 | if (superCtor) { 20 | ctor.super_ = superCtor 21 | var TempCtor = function () {} 22 | TempCtor.prototype = superCtor.prototype 23 | ctor.prototype = new TempCtor() 24 | ctor.prototype.constructor = ctor 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 4 | "version": "2.0.4", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented", 11 | "inherits", 12 | "browser", 13 | "browserify" 14 | ], 15 | "main": "./inherits.js", 16 | "browser": "./inherits_browser.js", 17 | "repository": "git://github.com/isaacs/inherits", 18 | "license": "ISC", 19 | "scripts": { 20 | "test": "tap" 21 | }, 22 | "devDependencies": { 23 | "tap": "^14.2.4" 24 | }, 25 | "files": [ 26 | "inherits.js", 27 | "inherits_browser.js" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /node_modules/md5.js/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Kirill Fomichev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/md5.js/README.md: -------------------------------------------------------------------------------- 1 | # md5.js 2 | 3 | [![NPM Package](https://img.shields.io/npm/v/md5.js.svg?style=flat-square)](https://www.npmjs.org/package/md5.js) 4 | [![Build Status](https://img.shields.io/travis/crypto-browserify/md5.js.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/md5.js) 5 | [![Dependency status](https://img.shields.io/david/crypto-browserify/md5.js.svg?style=flat-square)](https://david-dm.org/crypto-browserify/md5.js#info=dependencies) 6 | 7 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) 8 | 9 | Node style `md5` on pure JavaScript. 10 | 11 | From [NIST SP 800-131A][1]: *md5 is no longer acceptable where collision resistance is required such as digital signatures.* 12 | 13 | ## Example 14 | 15 | ```js 16 | var MD5 = require('md5.js') 17 | 18 | console.log(new MD5().update('42').digest('hex')) 19 | // => a1d0c6e83f027327d8461063f4ac58a6 20 | 21 | var md5stream = new MD5() 22 | md5stream.end('42') 23 | console.log(md5stream.read().toString('hex')) 24 | // => a1d0c6e83f027327d8461063f4ac58a6 25 | ``` 26 | 27 | ## LICENSE [MIT](LICENSE) 28 | 29 | [1]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf 30 | -------------------------------------------------------------------------------- /node_modules/md5.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "md5.js", 3 | "version": "1.3.5", 4 | "description": "node style md5 on pure JavaScript", 5 | "keywords": [ 6 | "crypto", 7 | "md5" 8 | ], 9 | "homepage": "https://github.com/crypto-browserify/md5.js", 10 | "bugs": { 11 | "url": "https://github.com/crypto-browserify/md5.js/issues" 12 | }, 13 | "license": "MIT", 14 | "author": "Kirill Fomichev (https://github.com/fanatid)", 15 | "files": [ 16 | "index.js" 17 | ], 18 | "main": "index.js", 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/crypto-browserify/md5.js.git" 22 | }, 23 | "scripts": { 24 | "lint": "standard", 25 | "test": "npm run lint && npm run unit", 26 | "unit": "node test/*.js" 27 | }, 28 | "dependencies": { 29 | "hash-base": "^3.0.0", 30 | "inherits": "^2.0.1", 31 | "safe-buffer": "^5.1.2" 32 | }, 33 | "devDependencies": { 34 | "hash-test-vectors": "^1.3.2", 35 | "standard": "^7.0.0", 36 | "tape": "^4.2.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /node_modules/readable-stream/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Developer's Certificate of Origin 1.1 2 | 3 | By making a contribution to this project, I certify that: 4 | 5 | * (a) The contribution was created in whole or in part by me and I 6 | have the right to submit it under the open source license 7 | indicated in the file; or 8 | 9 | * (b) The contribution is based upon previous work that, to the best 10 | of my knowledge, is covered under an appropriate open source 11 | license and I have the right under that license to submit that 12 | work with modifications, whether created in whole or in part 13 | by me, under the same open source license (unless I am 14 | permitted to submit under a different license), as indicated 15 | in the file; or 16 | 17 | * (c) The contribution was provided directly to me by some other 18 | person who certified (a), (b) or (c) and I have not modified 19 | it. 20 | 21 | * (d) I understand and agree that this project and the contribution 22 | are public and that a record of the contribution (including all 23 | personal information I submit with it, including my sign-off) is 24 | maintained indefinitely and may be redistributed consistent with 25 | this project or the open source license(s) involved. 26 | 27 | ## Moderation Policy 28 | 29 | The [Node.js Moderation Policy] applies to this WG. 30 | 31 | ## Code of Conduct 32 | 33 | The [Node.js Code of Conduct][] applies to this WG. 34 | 35 | [Node.js Code of Conduct]: 36 | https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md 37 | [Node.js Moderation Policy]: 38 | https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md 39 | -------------------------------------------------------------------------------- /node_modules/readable-stream/experimentalWarning.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var experimentalWarnings = new Set(); 4 | 5 | function emitExperimentalWarning(feature) { 6 | if (experimentalWarnings.has(feature)) return; 7 | var msg = feature + ' is an experimental feature. This feature could ' + 8 | 'change at any time'; 9 | experimentalWarnings.add(feature); 10 | process.emitWarning(msg, 'ExperimentalWarning'); 11 | } 12 | 13 | function noop() {} 14 | 15 | module.exports.emitExperimentalWarning = process.emitWarning 16 | ? emitExperimentalWarning 17 | : noop; 18 | -------------------------------------------------------------------------------- /node_modules/readable-stream/lib/_stream_passthrough.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | // a passthrough stream. 23 | // basically just the most minimal sort of Transform stream. 24 | // Every written chunk gets output as-is. 25 | 26 | 'use strict'; 27 | 28 | module.exports = PassThrough; 29 | var Transform = require('./_stream_transform'); 30 | require('inherits')(PassThrough, Transform); 31 | function PassThrough(options) { 32 | if (!(this instanceof PassThrough)) return new PassThrough(options); 33 | Transform.call(this, options); 34 | } 35 | PassThrough.prototype._transform = function (chunk, encoding, cb) { 36 | cb(null, chunk); 37 | }; -------------------------------------------------------------------------------- /node_modules/readable-stream/lib/internal/streams/from-browser.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { 2 | throw new Error('Readable.from is not available in the browser') 3 | }; 4 | -------------------------------------------------------------------------------- /node_modules/readable-stream/lib/internal/streams/state.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; 4 | function highWaterMarkFrom(options, isDuplex, duplexKey) { 5 | return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; 6 | } 7 | function getHighWaterMark(state, options, duplexKey, isDuplex) { 8 | var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); 9 | if (hwm != null) { 10 | if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { 11 | var name = isDuplex ? duplexKey : 'highWaterMark'; 12 | throw new ERR_INVALID_OPT_VALUE(name, hwm); 13 | } 14 | return Math.floor(hwm); 15 | } 16 | 17 | // Default value 18 | return state.objectMode ? 16 : 16 * 1024; 19 | } 20 | module.exports = { 21 | getHighWaterMark: getHighWaterMark 22 | }; -------------------------------------------------------------------------------- /node_modules/readable-stream/lib/internal/streams/stream-browser.js: -------------------------------------------------------------------------------- 1 | module.exports = require('events').EventEmitter; 2 | -------------------------------------------------------------------------------- /node_modules/readable-stream/lib/internal/streams/stream.js: -------------------------------------------------------------------------------- 1 | module.exports = require('stream'); 2 | -------------------------------------------------------------------------------- /node_modules/readable-stream/readable-browser.js: -------------------------------------------------------------------------------- 1 | exports = module.exports = require('./lib/_stream_readable.js'); 2 | exports.Stream = exports; 3 | exports.Readable = exports; 4 | exports.Writable = require('./lib/_stream_writable.js'); 5 | exports.Duplex = require('./lib/_stream_duplex.js'); 6 | exports.Transform = require('./lib/_stream_transform.js'); 7 | exports.PassThrough = require('./lib/_stream_passthrough.js'); 8 | exports.finished = require('./lib/internal/streams/end-of-stream.js'); 9 | exports.pipeline = require('./lib/internal/streams/pipeline.js'); 10 | -------------------------------------------------------------------------------- /node_modules/readable-stream/readable.js: -------------------------------------------------------------------------------- 1 | var Stream = require('stream'); 2 | if (process.env.READABLE_STREAM === 'disable' && Stream) { 3 | module.exports = Stream.Readable; 4 | Object.assign(module.exports, Stream); 5 | module.exports.Stream = Stream; 6 | } else { 7 | exports = module.exports = require('./lib/_stream_readable.js'); 8 | exports.Stream = Stream || exports; 9 | exports.Readable = exports; 10 | exports.Writable = require('./lib/_stream_writable.js'); 11 | exports.Duplex = require('./lib/_stream_duplex.js'); 12 | exports.Transform = require('./lib/_stream_transform.js'); 13 | exports.PassThrough = require('./lib/_stream_passthrough.js'); 14 | exports.finished = require('./lib/internal/streams/end-of-stream.js'); 15 | exports.pipeline = require('./lib/internal/streams/pipeline.js'); 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/ripemd160/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 crypto-browserify 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/ripemd160/README.md: -------------------------------------------------------------------------------- 1 | # ripemd160 2 | 3 | [![NPM Package](https://img.shields.io/npm/v/ripemd160.svg?style=flat-square)](https://www.npmjs.org/package/ripemd160) 4 | [![Build Status](https://img.shields.io/travis/crypto-browserify/ripemd160.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/ripemd160) 5 | [![Dependency status](https://img.shields.io/david/crypto-browserify/ripemd160.svg?style=flat-square)](https://david-dm.org/crypto-browserify/ripemd160#info=dependencies) 6 | 7 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) 8 | 9 | Node style `ripemd160` on pure JavaScript. 10 | 11 | ## Example 12 | 13 | ```js 14 | var RIPEMD160 = require('ripemd160') 15 | 16 | console.log(new RIPEMD160().update('42').digest('hex')) 17 | // => 0df020ba32aa9b8b904471ff582ce6b579bf8bc8 18 | 19 | var ripemd160stream = new RIPEMD160() 20 | ripemd160stream.end('42') 21 | console.log(ripemd160stream.read().toString('hex')) 22 | // => 0df020ba32aa9b8b904471ff582ce6b579bf8bc8 23 | ``` 24 | 25 | ## LICENSE 26 | 27 | MIT 28 | -------------------------------------------------------------------------------- /node_modules/ripemd160/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ripemd160", 3 | "version": "2.0.2", 4 | "description": "Compute ripemd160 of bytes or strings.", 5 | "keywords": [ 6 | "string", 7 | "strings", 8 | "ripemd160", 9 | "ripe160", 10 | "bitcoin", 11 | "bytes", 12 | "cryptography" 13 | ], 14 | "license": "MIT", 15 | "files": [ 16 | "index.js" 17 | ], 18 | "main": "./index", 19 | "repository": { 20 | "url": "https://github.com/crypto-browserify/ripemd160", 21 | "type": "git" 22 | }, 23 | "scripts": { 24 | "lint": "standard", 25 | "test": "npm run lint && npm run unit", 26 | "unit": "node test/*.js" 27 | }, 28 | "dependencies": { 29 | "hash-base": "^3.0.0", 30 | "inherits": "^2.0.1" 31 | }, 32 | "devDependencies": { 33 | "hash-test-vectors": "^1.3.2", 34 | "standard": "^6.0.7", 35 | "tape": "^4.5.1" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/safe-buffer/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Feross Aboukhadijeh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/safe-buffer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "safe-buffer", 3 | "description": "Safer Node.js Buffer API", 4 | "version": "5.2.1", 5 | "author": { 6 | "name": "Feross Aboukhadijeh", 7 | "email": "feross@feross.org", 8 | "url": "https://feross.org" 9 | }, 10 | "bugs": { 11 | "url": "https://github.com/feross/safe-buffer/issues" 12 | }, 13 | "devDependencies": { 14 | "standard": "*", 15 | "tape": "^5.0.0" 16 | }, 17 | "homepage": "https://github.com/feross/safe-buffer", 18 | "keywords": [ 19 | "buffer", 20 | "buffer allocate", 21 | "node security", 22 | "safe", 23 | "safe-buffer", 24 | "security", 25 | "uninitialized" 26 | ], 27 | "license": "MIT", 28 | "main": "index.js", 29 | "types": "index.d.ts", 30 | "repository": { 31 | "type": "git", 32 | "url": "git://github.com/feross/safe-buffer.git" 33 | }, 34 | "scripts": { 35 | "test": "standard && tape test/*.js" 36 | }, 37 | "funding": [ 38 | { 39 | "type": "github", 40 | "url": "https://github.com/sponsors/feross" 41 | }, 42 | { 43 | "type": "patreon", 44 | "url": "https://www.patreon.com/feross" 45 | }, 46 | { 47 | "type": "consulting", 48 | "url": "https://feross.org/support" 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /node_modules/sha.js/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | os: 3 | - linux 4 | language: node_js 5 | node_js: 6 | - "4" 7 | - "5" 8 | - "6" 9 | - "7" 10 | env: 11 | matrix: 12 | - TEST_SUITE=unit 13 | matrix: 14 | include: 15 | - node_js: "7" 16 | env: TEST_SUITE=lint 17 | script: npm run $TEST_SUITE 18 | -------------------------------------------------------------------------------- /node_modules/sha.js/bin.js: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | 3 | var createHash = require('./browserify') 4 | var argv = process.argv.slice(2) 5 | 6 | function pipe (algorithm, s) { 7 | var start = Date.now() 8 | var hash = createHash(algorithm || 'sha1') 9 | 10 | s.on('data', function (data) { 11 | hash.update(data) 12 | }) 13 | 14 | s.on('end', function () { 15 | if (process.env.DEBUG) { 16 | return console.log(hash.digest('hex'), Date.now() - start) 17 | } 18 | 19 | console.log(hash.digest('hex')) 20 | }) 21 | } 22 | 23 | function usage () { 24 | console.error('sha.js [algorithm=sha1] [filename] # hash filename with algorithm') 25 | console.error('input | sha.js [algorithm=sha1] # hash stdin with algorithm') 26 | console.error('sha.js --help # display this message') 27 | } 28 | 29 | if (!process.stdin.isTTY) { 30 | pipe(argv[0], process.stdin) 31 | } else if (argv.length) { 32 | if (/--help|-h/.test(argv[0])) { 33 | usage() 34 | } else { 35 | var filename = argv.pop() 36 | var algorithm = argv.pop() 37 | pipe(algorithm, require('fs').createReadStream(filename)) 38 | } 39 | } else { 40 | usage() 41 | } 42 | -------------------------------------------------------------------------------- /node_modules/sha.js/index.js: -------------------------------------------------------------------------------- 1 | var exports = module.exports = function SHA (algorithm) { 2 | algorithm = algorithm.toLowerCase() 3 | 4 | var Algorithm = exports[algorithm] 5 | if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)') 6 | 7 | return new Algorithm() 8 | } 9 | 10 | exports.sha = require('./sha') 11 | exports.sha1 = require('./sha1') 12 | exports.sha224 = require('./sha224') 13 | exports.sha256 = require('./sha256') 14 | exports.sha384 = require('./sha384') 15 | exports.sha512 = require('./sha512') 16 | -------------------------------------------------------------------------------- /node_modules/sha.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sha.js", 3 | "description": "Streamable SHA hashes in pure javascript", 4 | "version": "2.4.11", 5 | "homepage": "https://github.com/crypto-browserify/sha.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/crypto-browserify/sha.js.git" 9 | }, 10 | "dependencies": { 11 | "inherits": "^2.0.1", 12 | "safe-buffer": "^5.0.1" 13 | }, 14 | "devDependencies": { 15 | "buffer": "~2.3.2", 16 | "hash-test-vectors": "^1.3.1", 17 | "standard": "^10.0.2", 18 | "tape": "~2.3.2", 19 | "typedarray": "0.0.6" 20 | }, 21 | "bin": "./bin.js", 22 | "scripts": { 23 | "prepublish": "npm ls && npm run unit", 24 | "lint": "standard", 25 | "test": "npm run lint && npm run unit", 26 | "unit": "set -e; for t in test/*.js; do node $t; done;" 27 | }, 28 | "author": "Dominic Tarr (dominictarr.com)", 29 | "license": "(MIT AND BSD-3-Clause)" 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/sha.js/sha224.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined 3 | * in FIPS 180-2 4 | * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. 5 | * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet 6 | * 7 | */ 8 | 9 | var inherits = require('inherits') 10 | var Sha256 = require('./sha256') 11 | var Hash = require('./hash') 12 | var Buffer = require('safe-buffer').Buffer 13 | 14 | var W = new Array(64) 15 | 16 | function Sha224 () { 17 | this.init() 18 | 19 | this._w = W // new Array(64) 20 | 21 | Hash.call(this, 64, 56) 22 | } 23 | 24 | inherits(Sha224, Sha256) 25 | 26 | Sha224.prototype.init = function () { 27 | this._a = 0xc1059ed8 28 | this._b = 0x367cd507 29 | this._c = 0x3070dd17 30 | this._d = 0xf70e5939 31 | this._e = 0xffc00b31 32 | this._f = 0x68581511 33 | this._g = 0x64f98fa7 34 | this._h = 0xbefa4fa4 35 | 36 | return this 37 | } 38 | 39 | Sha224.prototype._hash = function () { 40 | var H = Buffer.allocUnsafe(28) 41 | 42 | H.writeInt32BE(this._a, 0) 43 | H.writeInt32BE(this._b, 4) 44 | H.writeInt32BE(this._c, 8) 45 | H.writeInt32BE(this._d, 12) 46 | H.writeInt32BE(this._e, 16) 47 | H.writeInt32BE(this._f, 20) 48 | H.writeInt32BE(this._g, 24) 49 | 50 | return H 51 | } 52 | 53 | module.exports = Sha224 54 | -------------------------------------------------------------------------------- /node_modules/sha.js/sha384.js: -------------------------------------------------------------------------------- 1 | var inherits = require('inherits') 2 | var SHA512 = require('./sha512') 3 | var Hash = require('./hash') 4 | var Buffer = require('safe-buffer').Buffer 5 | 6 | var W = new Array(160) 7 | 8 | function Sha384 () { 9 | this.init() 10 | this._w = W 11 | 12 | Hash.call(this, 128, 112) 13 | } 14 | 15 | inherits(Sha384, SHA512) 16 | 17 | Sha384.prototype.init = function () { 18 | this._ah = 0xcbbb9d5d 19 | this._bh = 0x629a292a 20 | this._ch = 0x9159015a 21 | this._dh = 0x152fecd8 22 | this._eh = 0x67332667 23 | this._fh = 0x8eb44a87 24 | this._gh = 0xdb0c2e0d 25 | this._hh = 0x47b5481d 26 | 27 | this._al = 0xc1059ed8 28 | this._bl = 0x367cd507 29 | this._cl = 0x3070dd17 30 | this._dl = 0xf70e5939 31 | this._el = 0xffc00b31 32 | this._fl = 0x68581511 33 | this._gl = 0x64f98fa7 34 | this._hl = 0xbefa4fa4 35 | 36 | return this 37 | } 38 | 39 | Sha384.prototype._hash = function () { 40 | var H = Buffer.allocUnsafe(48) 41 | 42 | function writeInt64BE (h, l, offset) { 43 | H.writeInt32BE(h, offset) 44 | H.writeInt32BE(l, offset + 4) 45 | } 46 | 47 | writeInt64BE(this._ah, this._al, 0) 48 | writeInt64BE(this._bh, this._bl, 8) 49 | writeInt64BE(this._ch, this._cl, 16) 50 | writeInt64BE(this._dh, this._dl, 24) 51 | writeInt64BE(this._eh, this._el, 32) 52 | writeInt64BE(this._fh, this._fl, 40) 53 | 54 | return H 55 | } 56 | 57 | module.exports = Sha384 58 | -------------------------------------------------------------------------------- /node_modules/sha.js/test/hash.js: -------------------------------------------------------------------------------- 1 | var tape = require('tape') 2 | var Hash = require('../hash') 3 | var hex = '0A1B2C3D4E5F6G7H' 4 | 5 | function equal (t, a, b) { 6 | t.equal(a.length, b.length) 7 | t.equal(a.toString('hex'), b.toString('hex')) 8 | } 9 | 10 | var hexBuf = Buffer.from('0A1B2C3D4E5F6G7H', 'utf8') 11 | var count16 = { 12 | strings: ['0A1B2C3D4E5F6G7H'], 13 | buffers: [ 14 | hexBuf, 15 | Buffer.from('80000000000000000000000000000080', 'hex') 16 | ] 17 | } 18 | 19 | var empty = { 20 | strings: [''], 21 | buffers: [ 22 | Buffer.from('80000000000000000000000000000000', 'hex') 23 | ] 24 | } 25 | 26 | var multi = { 27 | strings: ['abcd', 'efhijk', 'lmnopq'], 28 | buffers: [ 29 | Buffer.from('abcdefhijklmnopq', 'ascii'), 30 | Buffer.from('80000000000000000000000000000080', 'hex') 31 | ] 32 | } 33 | 34 | var long = { 35 | strings: [hex + hex], 36 | buffers: [ 37 | hexBuf, 38 | hexBuf, 39 | Buffer.from('80000000000000000000000000000100', 'hex') 40 | ] 41 | } 42 | 43 | function makeTest (name, data) { 44 | tape(name, function (t) { 45 | var h = new Hash(16, 8) 46 | var hash = Buffer.alloc(20) 47 | var n = 2 48 | var expected = data.buffers.slice() 49 | // t.plan(expected.length + 1) 50 | 51 | h._update = function (block) { 52 | var e = expected.shift() 53 | equal(t, block, e) 54 | 55 | if (n < 0) { 56 | throw new Error('expecting only 2 calls to _update') 57 | } 58 | } 59 | h._hash = function () { 60 | return hash 61 | } 62 | 63 | data.strings.forEach(function (string) { 64 | h.update(string, 'ascii') 65 | }) 66 | 67 | equal(t, h.digest(), hash) 68 | t.end() 69 | }) 70 | } 71 | 72 | makeTest('Hash#update 1 in 1', count16) 73 | makeTest('empty Hash#update', empty) 74 | makeTest('Hash#update 1 in 3', multi) 75 | makeTest('Hash#update 2 in 1', long) 76 | -------------------------------------------------------------------------------- /node_modules/string_decoder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "string_decoder", 3 | "version": "1.3.0", 4 | "description": "The string_decoder module from Node core", 5 | "main": "lib/string_decoder.js", 6 | "files": [ 7 | "lib" 8 | ], 9 | "dependencies": { 10 | "safe-buffer": "~5.2.0" 11 | }, 12 | "devDependencies": { 13 | "babel-polyfill": "^6.23.0", 14 | "core-util-is": "^1.0.2", 15 | "inherits": "^2.0.3", 16 | "tap": "~0.4.8" 17 | }, 18 | "scripts": { 19 | "test": "tap test/parallel/*.js && node test/verify-dependencies", 20 | "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" 21 | }, 22 | "repository": { 23 | "type": "git", 24 | "url": "git://github.com/nodejs/string_decoder.git" 25 | }, 26 | "homepage": "https://github.com/nodejs/string_decoder", 27 | "keywords": [ 28 | "string", 29 | "decoder", 30 | "browser", 31 | "browserify" 32 | ], 33 | "license": "MIT" 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 bitcoinjs contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/cjs/rand.browser.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.generateInt32 = void 0; 4 | function get4RandomBytes() { 5 | const bytes = new Uint8Array(4); 6 | if (typeof crypto === "undefined") { 7 | throw new Error("The crypto object is unavailable. This may occur if your environment does not support the Web Cryptography API."); 8 | } 9 | crypto.getRandomValues(bytes); 10 | return bytes; 11 | } 12 | // Only to be used to initialize the context for rust-secp256k1 13 | function generateInt32() { 14 | const array = get4RandomBytes(); 15 | return ((array[0] << (3 * 8)) + 16 | (array[1] << (2 * 8)) + 17 | (array[2] << (1 * 8)) + 18 | array[3]); 19 | } 20 | exports.generateInt32 = generateInt32; 21 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/cjs/rand.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.generateInt32 = void 0; 4 | const crypto_1 = require("crypto"); 5 | function generateInt32() { 6 | return (0, crypto_1.randomBytes)(4).readInt32BE(0); 7 | } 8 | exports.generateInt32 = generateInt32; 9 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/cjs/validate_error.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.throwError = exports.ERROR_BAD_RECOVERY_ID = exports.ERROR_BAD_PARITY = exports.ERROR_BAD_EXTRA_DATA = exports.ERROR_BAD_SIGNATURE = exports.ERROR_BAD_HASH = exports.ERROR_BAD_TWEAK = exports.ERROR_BAD_POINT = exports.ERROR_BAD_PRIVATE = void 0; 4 | exports.ERROR_BAD_PRIVATE = 0; 5 | exports.ERROR_BAD_POINT = 1; 6 | exports.ERROR_BAD_TWEAK = 2; 7 | exports.ERROR_BAD_HASH = 3; 8 | exports.ERROR_BAD_SIGNATURE = 4; 9 | exports.ERROR_BAD_EXTRA_DATA = 5; 10 | exports.ERROR_BAD_PARITY = 6; 11 | exports.ERROR_BAD_RECOVERY_ID = 7; 12 | const ERRORS_MESSAGES = { 13 | [exports.ERROR_BAD_PRIVATE.toString()]: "Expected Private", 14 | [exports.ERROR_BAD_POINT.toString()]: "Expected Point", 15 | [exports.ERROR_BAD_TWEAK.toString()]: "Expected Tweak", 16 | [exports.ERROR_BAD_HASH.toString()]: "Expected Hash", 17 | [exports.ERROR_BAD_SIGNATURE.toString()]: "Expected Signature", 18 | [exports.ERROR_BAD_EXTRA_DATA.toString()]: "Expected Extra Data (32 bytes)", 19 | [exports.ERROR_BAD_PARITY.toString()]: "Expected Parity (1 | 0)", 20 | [exports.ERROR_BAD_RECOVERY_ID.toString()]: "Bad Recovery Id", 21 | }; 22 | function throwError(errcode) { 23 | const message = ERRORS_MESSAGES[errcode.toString()] || `Unknow error code: ${errcode}`; 24 | throw new TypeError(message); 25 | } 26 | exports.throwError = throwError; 27 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/cjs/wasm_loader.browser.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // Suppress TS2792: Cannot find module './secp256k1.wasm'. 4 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 5 | // @ts-ignore 6 | const wasm = require("./secp256k1.wasm"); 7 | exports.default = wasm; 8 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/cjs/wasm_loader.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const fs_1 = require("fs"); 4 | const wasm_path_cjs_js_1 = require("./wasm_path_cjs.cjs"); 5 | const rand = require("./rand.cjs"); 6 | const validate_error = require("./validate_error.cjs"); 7 | const binary = (0, fs_1.readFileSync)((0, wasm_path_cjs_js_1.path)("secp256k1.wasm")); 8 | const imports = { 9 | "./rand.js": rand, 10 | "./validate_error.js": validate_error, 11 | }; 12 | const mod = new WebAssembly.Module(binary); 13 | const instance = new WebAssembly.Instance(mod, imports); 14 | exports.default = instance.exports; 15 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/cjs/wasm_path_cjs.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.path = void 0; 4 | const nodePath = require("path"); 5 | function path(wasmFilename) { 6 | // Since we know this file will only be used by cjs 7 | // and we know that wasm file will always be in the parent dir 8 | // We can translate to the parent directory without problem 9 | const pathname = nodePath.join(__dirname, "..", wasmFilename); 10 | return pathname; 11 | } 12 | exports.path = path; 13 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/rand.browser.d.ts: -------------------------------------------------------------------------------- 1 | export declare function generateInt32(): number; 2 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/rand.browser.js: -------------------------------------------------------------------------------- 1 | function get4RandomBytes() { 2 | const bytes = new Uint8Array(4); 3 | if (typeof crypto === "undefined") { 4 | throw new Error("The crypto object is unavailable. This may occur if your environment does not support the Web Cryptography API."); 5 | } 6 | crypto.getRandomValues(bytes); 7 | return bytes; 8 | } 9 | // Only to be used to initialize the context for rust-secp256k1 10 | export function generateInt32() { 11 | const array = get4RandomBytes(); 12 | return ((array[0] << (3 * 8)) + 13 | (array[1] << (2 * 8)) + 14 | (array[2] << (1 * 8)) + 15 | array[3]); 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/rand.d.ts: -------------------------------------------------------------------------------- 1 | export declare function generateInt32(): number; 2 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/rand.js: -------------------------------------------------------------------------------- 1 | import { randomBytes } from "crypto"; 2 | export function generateInt32() { 3 | return randomBytes(4).readInt32BE(0); 4 | } 5 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/secp256k1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faytey/bit-wallet/29daa025c7c44661b92557038a70e8ba11571c83/node_modules/tiny-secp256k1/lib/secp256k1.wasm -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/validate.d.ts: -------------------------------------------------------------------------------- 1 | export declare const PRIVATE_KEY_SIZE = 32; 2 | export declare const PUBLIC_KEY_COMPRESSED_SIZE = 33; 3 | export declare const PUBLIC_KEY_UNCOMPRESSED_SIZE = 65; 4 | export declare const X_ONLY_PUBLIC_KEY_SIZE = 32; 5 | export declare const TWEAK_SIZE = 32; 6 | export declare const HASH_SIZE = 32; 7 | export declare const EXTRA_DATA_SIZE = 32; 8 | export declare const SIGNATURE_SIZE = 64; 9 | export declare function isZero(x: Uint8Array): boolean; 10 | export declare function isPrivate(x: Uint8Array): boolean; 11 | export declare function isPoint(p: Uint8Array): boolean; 12 | export declare function isXOnlyPoint(p: Uint8Array): boolean; 13 | export declare function isDERPoint(p: Uint8Array): boolean; 14 | export declare function isPointCompressed(p: Uint8Array): boolean; 15 | export declare function validateParity(p: 1 | 0): void; 16 | export declare function validatePrivate(d: Uint8Array): void; 17 | export declare function validatePoint(p: Uint8Array): void; 18 | export declare function validateXOnlyPoint(p: Uint8Array): void; 19 | export declare function validateTweak(tweak: Uint8Array): void; 20 | export declare function validateHash(h: Uint8Array): void; 21 | export declare function validateExtraData(e?: Uint8Array): void; 22 | export declare function validateSignature(signature: Uint8Array): void; 23 | export declare function validateSignatureCustom(validatorFn: () => boolean): void; 24 | export declare function validateSignatureNonzeroRS(signature: Uint8Array): void; 25 | export declare function validateSigrPMinusN(signature: Uint8Array): void; 26 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/validate_error.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ERROR_BAD_PRIVATE = 0; 2 | export declare const ERROR_BAD_POINT = 1; 3 | export declare const ERROR_BAD_TWEAK = 2; 4 | export declare const ERROR_BAD_HASH = 3; 5 | export declare const ERROR_BAD_SIGNATURE = 4; 6 | export declare const ERROR_BAD_EXTRA_DATA = 5; 7 | export declare const ERROR_BAD_PARITY = 6; 8 | export declare const ERROR_BAD_RECOVERY_ID = 7; 9 | export declare function throwError(errcode: number): never; 10 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/validate_error.js: -------------------------------------------------------------------------------- 1 | export const ERROR_BAD_PRIVATE = 0; 2 | export const ERROR_BAD_POINT = 1; 3 | export const ERROR_BAD_TWEAK = 2; 4 | export const ERROR_BAD_HASH = 3; 5 | export const ERROR_BAD_SIGNATURE = 4; 6 | export const ERROR_BAD_EXTRA_DATA = 5; 7 | export const ERROR_BAD_PARITY = 6; 8 | export const ERROR_BAD_RECOVERY_ID = 7; 9 | const ERRORS_MESSAGES = { 10 | [ERROR_BAD_PRIVATE.toString()]: "Expected Private", 11 | [ERROR_BAD_POINT.toString()]: "Expected Point", 12 | [ERROR_BAD_TWEAK.toString()]: "Expected Tweak", 13 | [ERROR_BAD_HASH.toString()]: "Expected Hash", 14 | [ERROR_BAD_SIGNATURE.toString()]: "Expected Signature", 15 | [ERROR_BAD_EXTRA_DATA.toString()]: "Expected Extra Data (32 bytes)", 16 | [ERROR_BAD_PARITY.toString()]: "Expected Parity (1 | 0)", 17 | [ERROR_BAD_RECOVERY_ID.toString()]: "Bad Recovery Id", 18 | }; 19 | export function throwError(errcode) { 20 | const message = ERRORS_MESSAGES[errcode.toString()] || `Unknow error code: ${errcode}`; 21 | throw new TypeError(message); 22 | } 23 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/wasm_loader.browser.d.ts: -------------------------------------------------------------------------------- 1 | import * as wasm from "./secp256k1.wasm"; 2 | export default wasm; 3 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/wasm_loader.browser.js: -------------------------------------------------------------------------------- 1 | // Suppress TS2792: Cannot find module './secp256k1.wasm'. 2 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 3 | // @ts-ignore 4 | import * as wasm from "./secp256k1.wasm"; 5 | export default wasm; 6 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/wasm_loader.d.ts: -------------------------------------------------------------------------------- 1 | interface WebAssemblyMemory { 2 | buffer: Uint8Array; 3 | } 4 | interface WebAssemblyGlobal { 5 | value: number; 6 | } 7 | declare type RecoveryIdType = 0 | 1 | 2 | 3; 8 | interface Secp256k1WASM { 9 | memory: WebAssemblyMemory; 10 | PRIVATE_INPUT: WebAssemblyGlobal; 11 | PUBLIC_KEY_INPUT: WebAssemblyGlobal; 12 | PUBLIC_KEY_INPUT2: WebAssemblyGlobal; 13 | X_ONLY_PUBLIC_KEY_INPUT: WebAssemblyGlobal; 14 | X_ONLY_PUBLIC_KEY_INPUT2: WebAssemblyGlobal; 15 | TWEAK_INPUT: WebAssemblyGlobal; 16 | HASH_INPUT: WebAssemblyGlobal; 17 | EXTRA_DATA_INPUT: WebAssemblyGlobal; 18 | SIGNATURE_INPUT: WebAssemblyGlobal; 19 | initializeContext: () => void; 20 | isPoint: (p: number) => number; 21 | pointAdd: (pA: number, pB: number, outputlen: number) => number; 22 | pointAddScalar: (p: number, outputlen: number) => number; 23 | pointCompress: (p: number, outputlen: number) => number; 24 | pointFromScalar: (outputlen: number) => number; 25 | xOnlyPointFromScalar: () => number; 26 | xOnlyPointFromPoint: (inputLen: number) => number; 27 | xOnlyPointAddTweak: () => 1 | 0 | -1; 28 | xOnlyPointAddTweakCheck: (parity: number) => number; 29 | pointMultiply: (p: number, outputlen: number) => number; 30 | privateAdd: () => number; 31 | privateSub: () => number; 32 | privateNegate: () => void; 33 | sign: (e: number) => void; 34 | signRecoverable: (e: number) => 0 | 1 | 2 | 3; 35 | signSchnorr: (e: number) => void; 36 | verify: (Q: number, strict: number) => number; 37 | verifySchnorr: () => number; 38 | recover: (outputlen: number, recoveryId: RecoveryIdType) => number; 39 | } 40 | declare const _default: Secp256k1WASM; 41 | export default _default; 42 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/wasm_loader.js: -------------------------------------------------------------------------------- 1 | import { readFileSync } from "fs"; 2 | import { path } from "./wasm_path.js"; 3 | import * as rand from "./rand.js"; 4 | import * as validate_error from "./validate_error.js"; 5 | const binary = readFileSync(path("secp256k1.wasm")); 6 | const imports = { 7 | "./rand.js": rand, 8 | "./validate_error.js": validate_error, 9 | }; 10 | const mod = new WebAssembly.Module(binary); 11 | const instance = new WebAssembly.Instance(mod, imports); 12 | export default instance.exports; 13 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/wasm_path.d.ts: -------------------------------------------------------------------------------- 1 | export declare function path(wasmFilename: string): string; 2 | -------------------------------------------------------------------------------- /node_modules/tiny-secp256k1/lib/wasm_path.js: -------------------------------------------------------------------------------- 1 | import { URL, fileURLToPath } from "url"; 2 | export function path(wasmFilename) { 3 | const url = new URL(wasmFilename, import.meta.url); 4 | return fileURLToPath(url); 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/typeforce/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Daniel Cousens 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/typeforce/async.js: -------------------------------------------------------------------------------- 1 | var typeforce = require('./') 2 | 3 | // async wrapper 4 | function tfAsync (type, value, strict, callback) { 5 | // default to falsy strict if using shorthand overload 6 | if (typeof strict === 'function') return tfAsync(type, value, false, strict) 7 | 8 | try { 9 | typeforce(type, value, strict) 10 | } catch (e) { 11 | return callback(e) 12 | } 13 | 14 | callback() 15 | } 16 | 17 | module.exports = Object.assign(tfAsync, typeforce) 18 | -------------------------------------------------------------------------------- /node_modules/typeforce/native.js: -------------------------------------------------------------------------------- 1 | var types = { 2 | Array: function (value) { return value !== null && value !== undefined && value.constructor === Array }, 3 | Boolean: function (value) { return typeof value === 'boolean' }, 4 | Function: function (value) { return typeof value === 'function' }, 5 | Nil: function (value) { return value === undefined || value === null }, 6 | Number: function (value) { return typeof value === 'number' }, 7 | Object: function (value) { return typeof value === 'object' }, 8 | String: function (value) { return typeof value === 'string' }, 9 | '': function () { return true } 10 | } 11 | 12 | // TODO: deprecate 13 | types.Null = types.Nil 14 | 15 | for (var typeName in types) { 16 | types[typeName].toJSON = function (t) { 17 | return t 18 | }.bind(null, typeName) 19 | } 20 | 21 | module.exports = types 22 | -------------------------------------------------------------------------------- /node_modules/typeforce/nothrow.js: -------------------------------------------------------------------------------- 1 | var typeforce = require('./') 2 | 3 | function tfNoThrow (type, value, strict) { 4 | try { 5 | return typeforce(type, value, strict) 6 | } catch (e) { 7 | tfNoThrow.error = e 8 | return false 9 | } 10 | } 11 | 12 | module.exports = Object.assign(tfNoThrow, typeforce) 13 | -------------------------------------------------------------------------------- /node_modules/typeforce/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typeforce", 3 | "version": "1.18.0", 4 | "description": "Another biased type checking solution for Javascript", 5 | "keywords": [ 6 | "typeforce", 7 | "types", 8 | "typechecking", 9 | "type", 10 | "exceptions", 11 | "force" 12 | ], 13 | "homepage": "https://github.com/dcousens/typeforce", 14 | "bugs": { 15 | "url": "https://github.com/dcousens/typeforce/issues" 16 | }, 17 | "license": "MIT", 18 | "author": "Daniel Cousens", 19 | "main": "index.js", 20 | "files": [ 21 | "async.js", 22 | "errors.js", 23 | "extra.js", 24 | "index.js", 25 | "native.js", 26 | "nothrow.js" 27 | ], 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/dcousens/typeforce.git" 31 | }, 32 | "scripts": { 33 | "coverage": "nyc --check-coverage --branches 100 --functions 100 node test/*.js", 34 | "test": "npm run standard && npm run unit", 35 | "standard": "standard", 36 | "unit": "node test/*.js" 37 | }, 38 | "dependencies": {}, 39 | "devDependencies": { 40 | "nyc": "^13.1.0", 41 | "standard": "*", 42 | "tape": "^4.6.1" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /node_modules/uint8array-tools/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021 Jonathan Underwood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/uint8array-tools/README.md: -------------------------------------------------------------------------------- 1 | # Uint8Array Tools 2 | 3 | This library is licensed under MIT. 4 | 5 | ## Usage 6 | 7 | Note: `fromHex` and `compare` mimic the `Buffer.from('ff', 'hex')` and 8 | `buf1.compare(buf2)` API. Their behavior should be the same in the browser 9 | as well as in Node. 10 | 11 | ```js 12 | import * as uint8arraytools from 'uint8array-tools'; 13 | uint8arraytools.fromHex('ff'); 14 | // Uint8Array(1) [ 255 ] 15 | uint8arraytools.toHex(Uint8Array.from([0xff])); 16 | // 'ff' 17 | uint8arraytools.compare(Uint8Array.from([0xff]), Uint8Array.from([0x01])); 18 | // 1 19 | uint8arraytools.compare(Uint8Array.from([0xff]), Uint8Array.from([0xff])); 20 | // 0 21 | uint8arraytools.compare(Uint8Array.from([0x01]), Uint8Array.from([0xff])); 22 | // -1 23 | ``` -------------------------------------------------------------------------------- /node_modules/uint8array-tools/src/cjs/index.cjs: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.compare = exports.fromHex = exports.toHex = void 0; 4 | function toHex(bytes) { 5 | return Buffer.from(bytes || []).toString("hex"); 6 | } 7 | exports.toHex = toHex; 8 | function fromHex(hexString) { 9 | return Uint8Array.from(Buffer.from(hexString || "", "hex")); 10 | } 11 | exports.fromHex = fromHex; 12 | function compare(v1, v2) { 13 | return Buffer.from(v1).compare(Buffer.from(v2)); 14 | } 15 | exports.compare = compare; 16 | -------------------------------------------------------------------------------- /node_modules/uint8array-tools/src/cjs/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare function toHex(bytes: Uint8Array): string; 2 | export declare function fromHex(hexString: string): Uint8Array; 3 | export declare type CompareResult = -1 | 0 | 1; 4 | export declare function compare(v1: Uint8Array, v2: Uint8Array): CompareResult; 5 | -------------------------------------------------------------------------------- /node_modules/uint8array-tools/src/mjs/index.js: -------------------------------------------------------------------------------- 1 | export function toHex(bytes) { 2 | return Buffer.from(bytes || []).toString("hex"); 3 | } 4 | export function fromHex(hexString) { 5 | return Uint8Array.from(Buffer.from(hexString || "", "hex")); 6 | } 7 | export function compare(v1, v2) { 8 | return Buffer.from(v1).compare(Buffer.from(v2)); 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/util-deprecate/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.2 / 2015-10-07 3 | ================== 4 | 5 | * use try/catch when checking `localStorage` (#3, @kumavis) 6 | 7 | 1.0.1 / 2014-11-25 8 | ================== 9 | 10 | * browser: use `console.warn()` for deprecation calls 11 | * browser: more jsdocs 12 | 13 | 1.0.0 / 2014-04-30 14 | ================== 15 | 16 | * initial commit 17 | -------------------------------------------------------------------------------- /node_modules/util-deprecate/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Nathan Rajlich 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /node_modules/util-deprecate/node.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * For Node.js, simply re-export the core `util.deprecate` function. 4 | */ 5 | 6 | module.exports = require('util').deprecate; 7 | -------------------------------------------------------------------------------- /node_modules/util-deprecate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "util-deprecate", 3 | "version": "1.0.2", 4 | "description": "The Node.js `util.deprecate()` function with browser support", 5 | "main": "node.js", 6 | "browser": "browser.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/TooTallNate/util-deprecate.git" 13 | }, 14 | "keywords": [ 15 | "util", 16 | "deprecate", 17 | "browserify", 18 | "browser", 19 | "node" 20 | ], 21 | "author": "Nathan Rajlich (http://n8.io/)", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/TooTallNate/util-deprecate/issues" 25 | }, 26 | "homepage": "https://github.com/TooTallNate/util-deprecate" 27 | } 28 | -------------------------------------------------------------------------------- /node_modules/varuint-bitcoin/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Kirill Fomichev 4 | 5 | Parts of this software are based on https://github.com/mappum/bitcoin-protocol 6 | Copyright (c) 2016 Matt Bell 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /node_modules/varuint-bitcoin/README.md: -------------------------------------------------------------------------------- 1 | # varuint-bitcoin 2 | 3 | [![NPM Package](https://img.shields.io/npm/v/varuint-bitcoin.svg?style=flat-square)](https://www.npmjs.org/package/varuint-bitcoin) 4 | [![Build Status](https://img.shields.io/travis/bitcoinjs/varuint-bitcoin.svg?branch=master&style=flat-square)](https://travis-ci.org/bitcoinjs/varuint-bitcoin) 5 | 6 | [![abstract-encoding](https://img.shields.io/badge/abstract--encoding-compliant-brightgreen.svg?style=flat-square)](https://github.com/mafintosh/abstract-encoding) 7 | 8 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) 9 | 10 | encode/decode number as [bitcoin variable length integer](https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer) 11 | 12 | | value | storage length (bytes) | 13 | |:------:|:--------------:| 14 | | [0, 0xfd) | 1 | 15 | | [0xfd, 0xffff] | 3 | 16 | | [0x010000, 0xffffffff] | 5 | 17 | | [0x0100000000, 0x1fffffffffffff] | 9 | 18 | 19 | ## License 20 | 21 | MIT 22 | -------------------------------------------------------------------------------- /node_modules/varuint-bitcoin/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | interface Encode { 3 | (num: number, buffer?: Buffer, offset?: number): Buffer; 4 | bytes: number; 5 | } 6 | declare const encode: Encode; 7 | interface Decode { 8 | (buffer: Buffer, offset?: number): number; 9 | bytes: number; 10 | } 11 | declare const decode: Decode; 12 | declare function encodingLength(num: number): number; 13 | export { encode, decode, encodingLength }; 14 | -------------------------------------------------------------------------------- /node_modules/varuint-bitcoin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "varuint-bitcoin", 3 | "version": "1.1.2", 4 | "description": "encode/decode number as bitcoin variable length integer", 5 | "homepage": "https://github.com/bitcoinjs/varuint-bitcoin", 6 | "bugs": { 7 | "url": "https://github.com/bitcoinjs/varuint-bitcoin/issues" 8 | }, 9 | "license": "MIT", 10 | "author": "Kirill Fomichev (http://github.com/fanatid)", 11 | "files": [ 12 | "index.js", 13 | "index.d.ts" 14 | ], 15 | "main": "./index.js", 16 | "types": "./index.d.ts", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/bitcoinjs/varuint-bitcoin.git" 20 | }, 21 | "scripts": { 22 | "coverage": "nyc --check-coverage --branches 100 --functions 100 tape test/*.js", 23 | "lint": "standard", 24 | "test": "npm run lint && npm run unit", 25 | "unit": "tape test/*.js" 26 | }, 27 | "dependencies": { 28 | "safe-buffer": "^5.1.1" 29 | }, 30 | "devDependencies": { 31 | "nyc": "^14.1.1", 32 | "standard": "*", 33 | "tape": "^4.5.1" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /node_modules/wif/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .nyc_output 3 | -------------------------------------------------------------------------------- /node_modules/wif/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "4" 5 | - "5" 6 | - "7" 7 | matrix: 8 | include: 9 | - node_js: "7" 10 | env: TEST_SUITE=standard 11 | - node_js: "7" 12 | env: TEST_SUITE=coverage 13 | env: 14 | - TEST_SUITE=unit 15 | script: npm run-script $TEST_SUITE 16 | -------------------------------------------------------------------------------- /node_modules/wif/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Daniel Cousens 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wif/README.md: -------------------------------------------------------------------------------- 1 | # WIF 2 | 3 | [![TRAVIS](https://secure.travis-ci.org/bitcoinjs/wif.png)](http://travis-ci.org/bitcoinjs/wif) 4 | [![NPM](http://img.shields.io/npm/v/wif.svg)](https://www.npmjs.org/package/wif) 5 | 6 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) 7 | 8 | Bitcoin Wallet Import Format encoding/decoding module. 9 | 10 | 11 | ## Example 12 | 13 | ``` javascript 14 | var wif = require('wif') 15 | 16 | var privateKey = new Buffer('0000000000000000000000000000000000000000000000000000000000000001', 'hex') 17 | 18 | var key = wif.encode(128, privateKey, true) 19 | // => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn 20 | 21 | var obj = wif.decode(key) 22 | // => { 23 | // version: 128, 24 | // privateKey: , 25 | // compressed: true 26 | //} 27 | 28 | wif.encode(obj) 29 | // => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn 30 | ``` 31 | 32 | ## LICENSE [MIT](LICENSE) 33 | -------------------------------------------------------------------------------- /node_modules/wif/index.js: -------------------------------------------------------------------------------- 1 | var bs58check = require('bs58check') 2 | 3 | function decodeRaw (buffer, version) { 4 | // check version only if defined 5 | if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version') 6 | 7 | // uncompressed 8 | if (buffer.length === 33) { 9 | return { 10 | version: buffer[0], 11 | privateKey: buffer.slice(1, 33), 12 | compressed: false 13 | } 14 | } 15 | 16 | // invalid length 17 | if (buffer.length !== 34) throw new Error('Invalid WIF length') 18 | 19 | // invalid compression flag 20 | if (buffer[33] !== 0x01) throw new Error('Invalid compression flag') 21 | 22 | return { 23 | version: buffer[0], 24 | privateKey: buffer.slice(1, 33), 25 | compressed: true 26 | } 27 | } 28 | 29 | function encodeRaw (version, privateKey, compressed) { 30 | var result = new Buffer(compressed ? 34 : 33) 31 | 32 | result.writeUInt8(version, 0) 33 | privateKey.copy(result, 1) 34 | 35 | if (compressed) { 36 | result[33] = 0x01 37 | } 38 | 39 | return result 40 | } 41 | 42 | function decode (string, version) { 43 | return decodeRaw(bs58check.decode(string), version) 44 | } 45 | 46 | function encode (version, privateKey, compressed) { 47 | if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed)) 48 | 49 | return bs58check.encode( 50 | encodeRaw( 51 | version.version, 52 | version.privateKey, 53 | version.compressed 54 | ) 55 | ) 56 | } 57 | 58 | module.exports = { 59 | decode: decode, 60 | decodeRaw: decodeRaw, 61 | encode: encode, 62 | encodeRaw: encodeRaw 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/base-x/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 base-x contributors 4 | Copyright (c) 2014-2018 The Bitcoin Core developers 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/base-x/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "base-x", 3 | "version": "3.0.9", 4 | "description": "Fast base encoding / decoding of any given alphabet", 5 | "keywords": [ 6 | "base-x", 7 | "base58", 8 | "base62", 9 | "base64", 10 | "crypto", 11 | "crytography", 12 | "decode", 13 | "decoding", 14 | "encode", 15 | "encoding" 16 | ], 17 | "homepage": "https://github.com/cryptocoinjs/base-x", 18 | "bugs": { 19 | "url": "https://github.com/cryptocoinjs/base-x/issues" 20 | }, 21 | "license": "MIT", 22 | "author": "Daniel Cousens", 23 | "files": [ 24 | "src" 25 | ], 26 | "main": "src/index.js", 27 | "types": "src/index.d.ts", 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/cryptocoinjs/base-x.git" 31 | }, 32 | "scripts": { 33 | "build": "tsc -p ./tsconfig.json ; standard --fix", 34 | "gitdiff": "npm run build && git diff --exit-code", 35 | "prepublish": "npm run gitdiff", 36 | "standard": "standard", 37 | "test": "npm run unit && npm run standard", 38 | "unit": "tape test/*.js" 39 | }, 40 | "devDependencies": { 41 | "@types/node": "12.0.10", 42 | "standard": "^10.0.3", 43 | "tape": "^4.5.1", 44 | "typescript": "3.5.2" 45 | }, 46 | "dependencies": { 47 | "safe-buffer": "^5.0.1" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/base-x/src/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare function base(ALPHABET: string): base.BaseConverter; 3 | export = base; 4 | declare namespace base { 5 | interface BaseConverter { 6 | encode(buffer: Buffer | number[] | Uint8Array): string; 7 | decodeUnsafe(string: string): Buffer | undefined; 8 | decode(string: string): Buffer; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58/index.js: -------------------------------------------------------------------------------- 1 | var basex = require('base-x') 2 | var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' 3 | 4 | module.exports = basex(ALPHABET) 5 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bs58", 3 | "version": "4.0.1", 4 | "description": "Base 58 encoding / decoding", 5 | "keywords": [ 6 | "base58", 7 | "bitcoin", 8 | "crypto", 9 | "crytography", 10 | "decode", 11 | "decoding", 12 | "encode", 13 | "encoding", 14 | "litecoin" 15 | ], 16 | "license": "MIT", 17 | "devDependencies": { 18 | "standard": "*", 19 | "tape": "^4.6.3" 20 | }, 21 | "repository": { 22 | "url": "https://github.com/cryptocoinjs/bs58", 23 | "type": "git" 24 | }, 25 | "files": [ 26 | "./index.js" 27 | ], 28 | "main": "./index.js", 29 | "scripts": { 30 | "standard": "standard", 31 | "test": "npm run standard && npm run unit", 32 | "unit": "tape test/index.js" 33 | }, 34 | "dependencies": { 35 | "base-x": "^3.0.2" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58check/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Daniel Cousens 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58check/README.md: -------------------------------------------------------------------------------- 1 | # bs58check 2 | 3 | [![NPM Package](https://img.shields.io/npm/v/bs58check.svg?style=flat-square)](https://www.npmjs.org/package/bs58check) 4 | [![Build Status](https://img.shields.io/travis/bitcoinjs/bs58check.svg?branch=master&style=flat-square)](https://travis-ci.org/bitcoinjs/bs58check) 5 | [![Dependency status](https://img.shields.io/david/bitcoinjs/bs58check.svg?style=flat-square)](https://david-dm.org/bitcoinjs/bs58check#info=dependencies) 6 | 7 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) 8 | 9 | A straight forward implementation of base58check extending upon bs58. 10 | 11 | 12 | ## Example 13 | 14 | ```javascript 15 | var bs58check = require('bs58check') 16 | 17 | var decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr') 18 | 19 | console.log(decoded) 20 | // => 21 | 22 | console.log(bs58check.encode(decoded)) 23 | // => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr 24 | ``` 25 | 26 | 27 | ## LICENSE [MIT](LICENSE) 28 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58check/base.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var base58 = require('bs58') 4 | var Buffer = require('safe-buffer').Buffer 5 | 6 | module.exports = function (checksumFn) { 7 | // Encode a buffer as a base58-check encoded string 8 | function encode (payload) { 9 | var checksum = checksumFn(payload) 10 | 11 | return base58.encode(Buffer.concat([ 12 | payload, 13 | checksum 14 | ], payload.length + 4)) 15 | } 16 | 17 | function decodeRaw (buffer) { 18 | var payload = buffer.slice(0, -4) 19 | var checksum = buffer.slice(-4) 20 | var newChecksum = checksumFn(payload) 21 | 22 | if (checksum[0] ^ newChecksum[0] | 23 | checksum[1] ^ newChecksum[1] | 24 | checksum[2] ^ newChecksum[2] | 25 | checksum[3] ^ newChecksum[3]) return 26 | 27 | return payload 28 | } 29 | 30 | // Decode a base58-check encoded string to a buffer, no result if checksum is wrong 31 | function decodeUnsafe (string) { 32 | var buffer = base58.decodeUnsafe(string) 33 | if (!buffer) return 34 | 35 | return decodeRaw(buffer) 36 | } 37 | 38 | function decode (string) { 39 | var buffer = base58.decode(string) 40 | var payload = decodeRaw(buffer, checksumFn) 41 | if (!payload) throw new Error('Invalid checksum') 42 | return payload 43 | } 44 | 45 | return { 46 | encode: encode, 47 | decode: decode, 48 | decodeUnsafe: decodeUnsafe 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58check/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var createHash = require('create-hash') 4 | var bs58checkBase = require('./base') 5 | 6 | // SHA256(SHA256(buffer)) 7 | function sha256x2 (buffer) { 8 | var tmp = createHash('sha256').update(buffer).digest() 9 | return createHash('sha256').update(tmp).digest() 10 | } 11 | 12 | module.exports = bs58checkBase(sha256x2) 13 | -------------------------------------------------------------------------------- /node_modules/wif/node_modules/bs58check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bs58check", 3 | "version": "2.1.2", 4 | "description": "A straightforward implementation of base58-check encoding", 5 | "keywords": [ 6 | "base", 7 | "base58", 8 | "base58check", 9 | "bitcoin", 10 | "bs58", 11 | "check", 12 | "checksum", 13 | "decode", 14 | "decoding", 15 | "encode", 16 | "encoding", 17 | "litecoin" 18 | ], 19 | "homepage": "https://github.com/bitcoinjs/bs58check", 20 | "bugs": { 21 | "url": "https://github.com/bitcoinjs/bs58check/issues" 22 | }, 23 | "license": "MIT", 24 | "author": "Daniel Cousens", 25 | "files": [ 26 | "index.js", 27 | "base.js" 28 | ], 29 | "main": "index.js", 30 | "repository": { 31 | "type": "git", 32 | "url": "https://github.com/bitcoinjs/bs58check.git" 33 | }, 34 | "scripts": { 35 | "coverage-report": "nyc report --reporter=lcov", 36 | "coverage": "nyc --check-coverage --branches 90 --functions 90 npm run unit", 37 | "standard": "standard", 38 | "test": "npm run standard && npm run coverage", 39 | "unit": "tape test/*.js" 40 | }, 41 | "dependencies": { 42 | "bs58": "^4.0.0", 43 | "create-hash": "^1.1.0", 44 | "safe-buffer": "^5.1.2" 45 | }, 46 | "devDependencies": { 47 | "blake-hash": "^1.0.0", 48 | "nyc": "^11.3.0", 49 | "standard": "^10.0.3", 50 | "tape": "^4.6.2" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /node_modules/wif/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wif", 3 | "version": "2.0.6", 4 | "description": "Bitcoin Wallet Import Format (WIF) decoding/encoding module", 5 | "author": "Daniel Cousens", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/bitcoinjs/wif.git" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/bitcoinjs/wif/issues" 13 | }, 14 | "homepage": "https://github.com/bitcoinjs/wif", 15 | "keywords": [ 16 | "bitcoin", 17 | "base58", 18 | "base58check", 19 | "decode", 20 | "decoding", 21 | "encoding", 22 | "encode", 23 | "key", 24 | "private", 25 | "wif" 26 | ], 27 | "main": "index.js", 28 | "scripts": { 29 | "coverage-report": "nyc report --reporter=lcov", 30 | "coverage": "nyc --check-coverage --branches 90 --functions 90 npm run unit", 31 | "standard": "standard", 32 | "test": "npm run standard && npm run coverage", 33 | "unit": "tape test/*.js" 34 | }, 35 | "dependencies": { 36 | "bs58check": "<3.0.0" 37 | }, 38 | "devDependencies": { 39 | "nyc": "^6.4.0", 40 | "standard": "*", 41 | "tape": "^4.6.2" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /node_modules/wif/test/index.js: -------------------------------------------------------------------------------- 1 | var wif = require('../') 2 | var fixtures = require('./fixtures') 3 | var tape = require('tape') 4 | 5 | fixtures.valid.forEach(function (f) { 6 | tape('encode/encodeRaw returns ' + f.WIF + ' for ' + f.privateKeyHex.slice(0, 20) + '... (' + f.version + ')', function (t) { 7 | t.plan(1) 8 | 9 | var privateKey = new Buffer(f.privateKeyHex, 'hex') 10 | var actual = wif.encode(f.version, privateKey, f.compressed) 11 | t.equal(actual, f.WIF) 12 | }) 13 | }) 14 | 15 | fixtures.valid.forEach(function (f) { 16 | tape('decode/decodeRaw returns ' + f.privateKeyHex.slice(0, 20) + '... (' + f.version + ')' + ' for ' + f.WIF, function (t) { 17 | t.plan(3) 18 | 19 | var actual = wif.decode(f.WIF, f.version) 20 | t.equal(actual.version, f.version) 21 | t.equal(actual.privateKey.toString('hex'), f.privateKeyHex) 22 | t.equal(actual.compressed, f.compressed) 23 | }) 24 | }) 25 | 26 | fixtures.invalid.decode.forEach(function (f) { 27 | tape('throws ' + f.exception + ' for ' + f.WIF, function (t) { 28 | t.plan(1) 29 | t.throws(function () { 30 | wif.decode(f.WIF, f.version) 31 | }, new RegExp(f.exception)) 32 | }) 33 | }) 34 | 35 | fixtures.valid.forEach(function (f) { 36 | tape('decode/encode for ' + f.WIF, function (t) { 37 | t.plan(1) 38 | 39 | var actual = wif.encode(wif.decode(f.WIF, f.version)) 40 | t.equal(actual, f.WIF) 41 | }) 42 | }) 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bit-wallet", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "bip32": "^4.0.0", 14 | "bip39": "^3.1.0", 15 | "bitcoinjs-lib": "^6.1.5", 16 | "tiny-secp256k1": "^2.2.3" 17 | } 18 | } 19 | --------------------------------------------------------------------------------