├── .editorconfig ├── .eslintfiles ├── .eslintrc.json ├── .github └── workflows │ └── test.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── SECURITY.md ├── bench ├── bech32.js ├── bench.js ├── blockstore.js ├── buffer.js ├── coins.js ├── hexstring.js ├── merkle.js ├── mnemonic.js ├── script.js ├── tx.js ├── txdb.js └── walletdb.js ├── bin ├── bcoin ├── bcoin-cli ├── bwallet ├── bwallet-cli ├── cli ├── node ├── spvnode └── wallet ├── browser ├── debug.html ├── index.html ├── server.js ├── src │ ├── app.js │ └── proxysocket.js └── wsproxy.js ├── docs ├── README.md ├── cli.md ├── configuration.md ├── design.md ├── examples │ ├── client-api.js │ ├── connect-to-peer.js │ ├── connect-to-the-p2p-network.js │ ├── create-a-blockchain-and-mempool.js │ ├── create-sign-tx.js │ ├── fullnode.js │ ├── get-tx-from-chain.js │ ├── peers-plugin.js │ ├── spv-sync-wallet.js │ ├── wallet.js │ └── watch-only-wallet.js ├── getting-started.md └── wallet-system.md ├── etc ├── sample.conf └── sample.wallet.conf ├── jsdoc.json ├── lib ├── bcoin-browser.js ├── bcoin.js ├── blockchain │ ├── chain.js │ ├── chaindb.js │ ├── chainentry.js │ ├── common.js │ ├── index.js │ └── layout.js ├── blockstore │ ├── README.md │ ├── abstract.js │ ├── common.js │ ├── file.js │ ├── index.js │ ├── layout.js │ ├── level.js │ └── records.js ├── btc │ ├── amount.js │ ├── index.js │ └── uri.js ├── client │ ├── index.js │ ├── node.js │ └── wallet.js ├── coins │ ├── coinentry.js │ ├── coins.js │ ├── coinview.js │ ├── compress.js │ ├── index.js │ └── undocoins.js ├── descriptor │ ├── abstractdescriptor.js │ ├── common.js │ ├── index.js │ ├── keyprovider.js │ ├── parser.js │ └── type │ │ ├── addr.js │ │ ├── combo.js │ │ ├── multisig.js │ │ ├── pk.js │ │ ├── pkh.js │ │ ├── raw.js │ │ ├── sh.js │ │ ├── wpkh.js │ │ └── wsh.js ├── golomb │ ├── README.md │ ├── basicFilter.js │ ├── golomb.js │ ├── reader.js │ └── writer.js ├── hd │ ├── README.md │ ├── common.js │ ├── hd.js │ ├── index.js │ ├── keyorigininfo.js │ ├── mnemonic.js │ ├── nfkd-compat.js │ ├── nfkd.js │ ├── private.js │ ├── public.js │ ├── udata.json │ ├── unorm.js │ ├── wordlist-browser.js │ ├── wordlist.js │ └── words │ │ ├── chinese-simplified.js │ │ ├── chinese-traditional.js │ │ ├── english.js │ │ ├── french.js │ │ ├── index.js │ │ ├── italian.js │ │ ├── japanese.js │ │ ├── korean.js │ │ └── spanish.js ├── indexer │ ├── addrindexer.js │ ├── filterindexer.js │ ├── index.js │ ├── indexer.js │ ├── layout.js │ └── txindexer.js ├── mempool │ ├── addrindexer.js │ ├── fees.js │ ├── index.js │ ├── layout.js │ ├── mempool.js │ └── mempoolentry.js ├── mining │ ├── common.js │ ├── cpuminer.js │ ├── index.js │ ├── mine.js │ ├── miner.js │ └── template.js ├── net │ ├── bip152.js │ ├── common.js │ ├── framer.js │ ├── hostlist.js │ ├── index.js │ ├── netaddress.js │ ├── packets.js │ ├── parser.js │ ├── peer.js │ ├── pool.js │ └── seeds │ │ ├── index.js │ │ ├── main.js │ │ └── testnet.js ├── node │ ├── fullnode.js │ ├── http.js │ ├── index.js │ ├── node.js │ ├── rpc.js │ └── spvnode.js ├── pkg.js ├── primitives │ ├── abstractblock.js │ ├── address.js │ ├── block.js │ ├── coin.js │ ├── filter.js │ ├── headers.js │ ├── index.js │ ├── input.js │ ├── invitem.js │ ├── keyring.js │ ├── memblock.js │ ├── merkleblock.js │ ├── mtx.js │ ├── outpoint.js │ ├── output.js │ ├── tx.js │ └── txmeta.js ├── protocol │ ├── consensus.js │ ├── errors.js │ ├── index.js │ ├── network.js │ ├── networks.js │ ├── policy.js │ └── timedata.js ├── script │ ├── common.js │ ├── index.js │ ├── opcode.js │ ├── program.js │ ├── script.js │ ├── scripterror.js │ ├── scriptnum.js │ ├── sigcache.js │ ├── stack.js │ └── witness.js ├── types.js ├── utils │ ├── binary.js │ ├── fixed.js │ ├── index.js │ ├── message.js │ └── util.js ├── wallet │ ├── account.js │ ├── client.js │ ├── coinselector.js │ ├── common.js │ ├── http.js │ ├── index.js │ ├── layout.js │ ├── masterkey.js │ ├── node.js │ ├── nodeclient.js │ ├── nullclient.js │ ├── path.js │ ├── plugin.js │ ├── records.js │ ├── rpc.js │ ├── txdb.js │ ├── wallet.js │ ├── walletdb.js │ └── walletkey.js └── workers │ ├── child-browser.js │ ├── child.js │ ├── framer.js │ ├── index.js │ ├── jobs.js │ ├── master.js │ ├── packets.js │ ├── parent-browser.js │ ├── parent.js │ ├── parser.js │ ├── worker.js │ └── workerpool.js ├── migrate ├── chaindb2to3.js ├── chaindb3to4.js ├── chaindb4to6.js ├── coins │ ├── coins.js │ ├── coinview.js │ ├── compress.js │ ├── index.js │ └── undocoins.js ├── indexerdb0to1.js ├── latest ├── walletdb5to6.js ├── walletdb6to7.js └── walletdb7to8.js ├── node_modules ├── .bin │ ├── _bmocha │ ├── bmocha │ └── bweb ├── bcfg │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bcfg.js │ │ ├── config.js │ │ ├── fs-browser.js │ │ └── fs.js │ └── package.json ├── bcrypto │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── binding.gyp │ ├── cmake │ │ ├── AppendCCompilerFlag.cmake │ │ └── CheckCThreadLocalStorage.cmake │ ├── deps │ │ ├── secp256k1 │ │ │ ├── CMakeLists.txt │ │ │ ├── COPYING │ │ │ ├── contrib │ │ │ │ ├── lax_der_parsing.c │ │ │ │ ├── lax_der_parsing.h │ │ │ │ ├── lax_der_privatekey_parsing.c │ │ │ │ └── lax_der_privatekey_parsing.h │ │ │ ├── include │ │ │ │ ├── secp256k1.h │ │ │ │ ├── secp256k1_ecdh.h │ │ │ │ ├── secp256k1_elligator.h │ │ │ │ ├── secp256k1_extra.h │ │ │ │ ├── secp256k1_extrakeys.h │ │ │ │ ├── secp256k1_preallocated.h │ │ │ │ ├── secp256k1_recovery.h │ │ │ │ ├── secp256k1_schnorrleg.h │ │ │ │ └── secp256k1_schnorrsig.h │ │ │ └── src │ │ │ │ ├── asm │ │ │ │ └── field_10x26_arm.s │ │ │ │ ├── assumptions.h │ │ │ │ ├── ecdsa.h │ │ │ │ ├── ecdsa_impl.h │ │ │ │ ├── eckey.h │ │ │ │ ├── eckey_impl.h │ │ │ │ ├── ecmult.h │ │ │ │ ├── ecmult_const.h │ │ │ │ ├── ecmult_const_impl.h │ │ │ │ ├── ecmult_gen.h │ │ │ │ ├── ecmult_gen_impl.h │ │ │ │ ├── ecmult_impl.h │ │ │ │ ├── field.h │ │ │ │ ├── field_10x26.h │ │ │ │ ├── field_10x26_impl.h │ │ │ │ ├── field_5x52.h │ │ │ │ ├── field_5x52_asm_impl.h │ │ │ │ ├── field_5x52_impl.h │ │ │ │ ├── field_5x52_int128_impl.h │ │ │ │ ├── field_impl.h │ │ │ │ ├── group.h │ │ │ │ ├── group_impl.h │ │ │ │ ├── hash.h │ │ │ │ ├── hash_impl.h │ │ │ │ ├── modules │ │ │ │ ├── ecdh │ │ │ │ │ └── main_impl.h │ │ │ │ ├── elligator │ │ │ │ │ └── main_impl.h │ │ │ │ ├── extra │ │ │ │ │ └── main_impl.h │ │ │ │ ├── extrakeys │ │ │ │ │ └── main_impl.h │ │ │ │ ├── recovery │ │ │ │ │ └── main_impl.h │ │ │ │ ├── schnorrleg │ │ │ │ │ └── main_impl.h │ │ │ │ └── schnorrsig │ │ │ │ │ └── main_impl.h │ │ │ │ ├── num.h │ │ │ │ ├── num_gmp.h │ │ │ │ ├── num_gmp_impl.h │ │ │ │ ├── num_impl.h │ │ │ │ ├── scalar.h │ │ │ │ ├── scalar_4x64.h │ │ │ │ ├── scalar_4x64_impl.h │ │ │ │ ├── scalar_8x32.h │ │ │ │ ├── scalar_8x32_impl.h │ │ │ │ ├── scalar_impl.h │ │ │ │ ├── scalar_low.h │ │ │ │ ├── scalar_low_impl.h │ │ │ │ ├── scratch.h │ │ │ │ ├── scratch_impl.h │ │ │ │ ├── secp256k1.c │ │ │ │ ├── selftest.h │ │ │ │ └── util.h │ │ └── torsion │ │ │ ├── CMakeLists.txt │ │ │ ├── LICENSE │ │ │ ├── include │ │ │ └── torsion │ │ │ │ ├── aead.h │ │ │ │ ├── cipher.h │ │ │ │ ├── common.h │ │ │ │ ├── drbg.h │ │ │ │ ├── dsa.h │ │ │ │ ├── ecc.h │ │ │ │ ├── encoding.h │ │ │ │ ├── hash.h │ │ │ │ ├── ies.h │ │ │ │ ├── kdf.h │ │ │ │ ├── mac.h │ │ │ │ ├── rand.h │ │ │ │ ├── rsa.h │ │ │ │ ├── stream.h │ │ │ │ └── util.h │ │ │ └── src │ │ │ ├── aead.c │ │ │ ├── asn1.c │ │ │ ├── asn1.h │ │ │ ├── bf.h │ │ │ ├── bio.h │ │ │ ├── cipher.c │ │ │ ├── drbg.c │ │ │ ├── dsa.c │ │ │ ├── ecc.c │ │ │ ├── encoding.c │ │ │ ├── entropy │ │ │ ├── entropy.h │ │ │ ├── env.c │ │ │ ├── hw.c │ │ │ └── sys.c │ │ │ ├── fields │ │ │ ├── .fiat-head │ │ │ ├── libsecp256k1_32.h │ │ │ ├── libsecp256k1_64.h │ │ │ ├── p192.h │ │ │ ├── p192_32.h │ │ │ ├── p192_64.h │ │ │ ├── p224.h │ │ │ ├── p224_32.h │ │ │ ├── p224_64.h │ │ │ ├── p251.h │ │ │ ├── p251_32.h │ │ │ ├── p251_64.h │ │ │ ├── p25519.h │ │ │ ├── p25519_32.h │ │ │ ├── p25519_64.h │ │ │ ├── p256.h │ │ │ ├── p256_32.h │ │ │ ├── p256_64.h │ │ │ ├── p384.h │ │ │ ├── p384_32.h │ │ │ ├── p384_64.h │ │ │ ├── p448.h │ │ │ ├── p448_32.h │ │ │ ├── p448_64.h │ │ │ ├── p521.h │ │ │ ├── p521_32.h │ │ │ ├── p521_64.h │ │ │ ├── scalar.h │ │ │ ├── secp256k1.h │ │ │ ├── secp256k1_32.h │ │ │ └── secp256k1_64.h │ │ │ ├── hash.c │ │ │ ├── ies.c │ │ │ ├── internal.c │ │ │ ├── internal.h │ │ │ ├── kdf.c │ │ │ ├── mac.c │ │ │ ├── mpi.c │ │ │ ├── mpi.h │ │ │ ├── rand.c │ │ │ ├── rsa.c │ │ │ ├── stream.c │ │ │ ├── subgroups.h │ │ │ ├── tls.h │ │ │ └── util.c │ ├── lib │ │ ├── aead-browser.js │ │ ├── aead.js │ │ ├── aes-browser.js │ │ ├── aes.js │ │ ├── arc4-browser.js │ │ ├── arc4.js │ │ ├── bcrypt-browser.js │ │ ├── bcrypt.js │ │ ├── bcrypto.js │ │ ├── blake2b-browser.js │ │ ├── blake2b.js │ │ ├── blake2b160.js │ │ ├── blake2b256.js │ │ ├── blake2b384.js │ │ ├── blake2b512.js │ │ ├── blake2s-browser.js │ │ ├── blake2s.js │ │ ├── blake2s128.js │ │ ├── blake2s160.js │ │ ├── blake2s224.js │ │ ├── blake2s256.js │ │ ├── bn-browser.js │ │ ├── bn.js │ │ ├── box.js │ │ ├── chacha20-browser.js │ │ ├── chacha20.js │ │ ├── cipher-browser.js │ │ ├── cipher.js │ │ ├── cleanse-browser.js │ │ ├── cleanse.js │ │ ├── cshake.js │ │ ├── cshake128.js │ │ ├── cshake256.js │ │ ├── ctr-drbg-browser.js │ │ ├── ctr-drbg.js │ │ ├── dsa-browser.js │ │ ├── dsa.js │ │ ├── dsaies.js │ │ ├── eb2k-browser.js │ │ ├── eb2k.js │ │ ├── ecies.js │ │ ├── ed25519-browser.js │ │ ├── ed25519.js │ │ ├── ed448-browser.js │ │ ├── ed448.js │ │ ├── encoding │ │ │ ├── asn1.js │ │ │ ├── base16-browser.js │ │ │ ├── base16.js │ │ │ ├── base32-browser.js │ │ │ ├── base32.js │ │ │ ├── base58-browser.js │ │ │ ├── base58.js │ │ │ ├── base64-browser.js │ │ │ ├── base64.js │ │ │ ├── bech32-browser.js │ │ │ ├── bech32.js │ │ │ ├── bech32m-browser.js │ │ │ ├── bech32m.js │ │ │ ├── cash32-browser.js │ │ │ ├── cash32.js │ │ │ ├── index.js │ │ │ ├── lines.js │ │ │ ├── openssl.js │ │ │ ├── pem.js │ │ │ ├── pemcrypt.js │ │ │ ├── pkcs1.js │ │ │ ├── pkcs3.js │ │ │ ├── pkcs5.js │ │ │ ├── pkcs8.js │ │ │ ├── rfc3279.js │ │ │ ├── sec1.js │ │ │ ├── util.js │ │ │ └── x509.js │ │ ├── gost94-browser.js │ │ ├── gost94.js │ │ ├── hash-drbg-browser.js │ │ ├── hash-drbg.js │ │ ├── hash160-browser.js │ │ ├── hash160.js │ │ ├── hash256-browser.js │ │ ├── hash256.js │ │ ├── hkdf-browser.js │ │ ├── hkdf.js │ │ ├── hmac-drbg-browser.js │ │ ├── hmac-drbg.js │ │ ├── internal │ │ │ ├── asn1.js │ │ │ ├── assert.js │ │ │ ├── custom-browser.js │ │ │ ├── custom.js │ │ │ ├── hmac.js │ │ │ ├── objects.js │ │ │ ├── pgpdf-browser.js │ │ │ ├── pgpdf.js │ │ │ └── primes.js │ │ ├── js │ │ │ ├── aead.js │ │ │ ├── aes.js │ │ │ ├── arc4.js │ │ │ ├── base16.js │ │ │ ├── base32.js │ │ │ ├── base58.js │ │ │ ├── base64.js │ │ │ ├── batch-rng.js │ │ │ ├── bcrypt.js │ │ │ ├── bech32.js │ │ │ ├── blake2b.js │ │ │ ├── blake2s.js │ │ │ ├── bn.js │ │ │ ├── cash32.js │ │ │ ├── chacha20.js │ │ │ ├── cipher.js │ │ │ ├── ciphers │ │ │ │ ├── aes.js │ │ │ │ ├── arc2.js │ │ │ │ ├── blowfish.js │ │ │ │ ├── camellia.js │ │ │ │ ├── cast5.js │ │ │ │ ├── des.js │ │ │ │ ├── ghash.js │ │ │ │ ├── idea.js │ │ │ │ ├── modes.js │ │ │ │ ├── serpent.js │ │ │ │ └── twofish.js │ │ │ ├── cleanse.js │ │ │ ├── ctr-drbg.js │ │ │ ├── dsa.js │ │ │ ├── eb2k.js │ │ │ ├── ecdh.js │ │ │ ├── ecdsa.js │ │ │ ├── ed25519.js │ │ │ ├── ed448.js │ │ │ ├── eddsa.js │ │ │ ├── elliptic.js │ │ │ ├── gost94.js │ │ │ ├── hash-drbg.js │ │ │ ├── hash160.js │ │ │ ├── hash256.js │ │ │ ├── hkdf.js │ │ │ ├── hmac-drbg.js │ │ │ ├── keccak.js │ │ │ ├── md2.js │ │ │ ├── md4.js │ │ │ ├── md5.js │ │ │ ├── md5sha1.js │ │ │ ├── murmur3.js │ │ │ ├── p192.js │ │ │ ├── p224.js │ │ │ ├── p256.js │ │ │ ├── p384.js │ │ │ ├── p521.js │ │ │ ├── pbkdf2.js │ │ │ ├── pgpdf.js │ │ │ ├── poly1305.js │ │ │ ├── precomputed │ │ │ │ ├── ed25519.json │ │ │ │ └── secp256k1.json │ │ │ ├── random.js │ │ │ ├── ripemd160.js │ │ │ ├── ristretto.js │ │ │ ├── rsa.js │ │ │ ├── salsa20.js │ │ │ ├── schnorr-legacy.js │ │ │ ├── schnorr.js │ │ │ ├── scrypt.js │ │ │ ├── secp256k1.js │ │ │ ├── secretbox.js │ │ │ ├── sha1.js │ │ │ ├── sha224.js │ │ │ ├── sha256.js │ │ │ ├── sha3.js │ │ │ ├── sha384.js │ │ │ ├── sha512.js │ │ │ ├── siphash.js │ │ │ ├── whirlpool.js │ │ │ ├── x25519.js │ │ │ └── x448.js │ │ ├── keccak-browser.js │ │ ├── keccak.js │ │ ├── keccak224.js │ │ ├── keccak256.js │ │ ├── keccak384.js │ │ ├── keccak512.js │ │ ├── kmac.js │ │ ├── kmac128.js │ │ ├── kmac256.js │ │ ├── md2-browser.js │ │ ├── md2.js │ │ ├── md4-browser.js │ │ ├── md4.js │ │ ├── md5-browser.js │ │ ├── md5.js │ │ ├── md5sha1-browser.js │ │ ├── md5sha1.js │ │ ├── merkle.js │ │ ├── mrkl.js │ │ ├── murmur3-browser.js │ │ ├── murmur3.js │ │ ├── native │ │ │ ├── aead.js │ │ │ ├── aes.js │ │ │ ├── arc4.js │ │ │ ├── base16.js │ │ │ ├── base32.js │ │ │ ├── base58.js │ │ │ ├── base64.js │ │ │ ├── bcrypt.js │ │ │ ├── bech32.js │ │ │ ├── binding.js │ │ │ ├── blake2b.js │ │ │ ├── blake2s.js │ │ │ ├── bn.js │ │ │ ├── cash32.js │ │ │ ├── chacha20.js │ │ │ ├── cipher.js │ │ │ ├── cleanse.js │ │ │ ├── ctr-drbg.js │ │ │ ├── dsa.js │ │ │ ├── eb2k.js │ │ │ ├── ecdh.js │ │ │ ├── ecdsa.js │ │ │ ├── ed25519.js │ │ │ ├── ed448.js │ │ │ ├── eddsa.js │ │ │ ├── gost94.js │ │ │ ├── hash-drbg.js │ │ │ ├── hash.js │ │ │ ├── hash160.js │ │ │ ├── hash256.js │ │ │ ├── hkdf.js │ │ │ ├── hmac-drbg.js │ │ │ ├── keccak.js │ │ │ ├── md2.js │ │ │ ├── md4.js │ │ │ ├── md5.js │ │ │ ├── md5sha1.js │ │ │ ├── murmur3.js │ │ │ ├── p192.js │ │ │ ├── p224.js │ │ │ ├── p256.js │ │ │ ├── p384.js │ │ │ ├── p521.js │ │ │ ├── pbkdf2.js │ │ │ ├── pgpdf.js │ │ │ ├── poly1305.js │ │ │ ├── random-openssl.js │ │ │ ├── random-torsion.js │ │ │ ├── random.js │ │ │ ├── ripemd160.js │ │ │ ├── rsa.js │ │ │ ├── salsa20.js │ │ │ ├── schnorr-libsecp256k1.js │ │ │ ├── schnorr-torsion.js │ │ │ ├── schnorr.js │ │ │ ├── scrypt.js │ │ │ ├── secp256k1-libsecp256k1.js │ │ │ ├── secp256k1-torsion.js │ │ │ ├── secp256k1.js │ │ │ ├── secretbox.js │ │ │ ├── sha1.js │ │ │ ├── sha224.js │ │ │ ├── sha256.js │ │ │ ├── sha3.js │ │ │ ├── sha384.js │ │ │ ├── sha512.js │ │ │ ├── siphash.js │ │ │ ├── whirlpool.js │ │ │ ├── x25519.js │ │ │ └── x448.js │ │ ├── p192-browser.js │ │ ├── p192.js │ │ ├── p224-browser.js │ │ ├── p224.js │ │ ├── p256-browser.js │ │ ├── p256.js │ │ ├── p384-browser.js │ │ ├── p384.js │ │ ├── p521-browser.js │ │ ├── p521.js │ │ ├── pbkdf2-browser.js │ │ ├── pbkdf2.js │ │ ├── pgp.js │ │ ├── poly1305-browser.js │ │ ├── poly1305.js │ │ ├── random-browser.js │ │ ├── random.js │ │ ├── ripemd160-browser.js │ │ ├── ripemd160.js │ │ ├── rsa-browser.js │ │ ├── rsa.js │ │ ├── rsaies.js │ │ ├── safe.js │ │ ├── salsa20-browser.js │ │ ├── salsa20.js │ │ ├── schnorr-browser.js │ │ ├── schnorr.js │ │ ├── scrypt-browser.js │ │ ├── scrypt.js │ │ ├── secp256k1-browser.js │ │ ├── secp256k1.js │ │ ├── secretbox-browser.js │ │ ├── secretbox.js │ │ ├── sha1-browser.js │ │ ├── sha1.js │ │ ├── sha224-browser.js │ │ ├── sha224.js │ │ ├── sha256-browser.js │ │ ├── sha256.js │ │ ├── sha3-224.js │ │ ├── sha3-256.js │ │ ├── sha3-384.js │ │ ├── sha3-512.js │ │ ├── sha3-browser.js │ │ ├── sha3.js │ │ ├── sha384-browser.js │ │ ├── sha384.js │ │ ├── sha512-browser.js │ │ ├── sha512.js │ │ ├── shake.js │ │ ├── shake128.js │ │ ├── shake256.js │ │ ├── siphash-browser.js │ │ ├── siphash.js │ │ ├── ssh.js │ │ ├── whirlpool-browser.js │ │ ├── whirlpool.js │ │ ├── x25519-browser.js │ │ ├── x25519.js │ │ ├── x448-browser.js │ │ └── x448.js │ ├── package.json │ └── src │ │ └── bcrypto.c ├── bcurl │ ├── .circleci │ │ └── config.yml │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bcurl.js │ │ └── client.js │ └── package.json ├── bdb │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── binding.gyp │ ├── deps │ │ ├── config │ │ │ └── snappy-stubs-public.h │ │ └── leveldb │ │ │ ├── CMakeLists.txt │ │ │ ├── LICENSE │ │ │ ├── db │ │ │ ├── builder.cc │ │ │ ├── builder.h │ │ │ ├── c.cc │ │ │ ├── db_impl.cc │ │ │ ├── db_impl.h │ │ │ ├── db_iter.cc │ │ │ ├── db_iter.h │ │ │ ├── dbformat.cc │ │ │ ├── dbformat.h │ │ │ ├── dumpfile.cc │ │ │ ├── filename.cc │ │ │ ├── filename.h │ │ │ ├── leveldbutil.cc │ │ │ ├── log_format.h │ │ │ ├── log_reader.cc │ │ │ ├── log_reader.h │ │ │ ├── log_writer.cc │ │ │ ├── log_writer.h │ │ │ ├── memtable.cc │ │ │ ├── memtable.h │ │ │ ├── repair.cc │ │ │ ├── skiplist.h │ │ │ ├── snapshot.h │ │ │ ├── table_cache.cc │ │ │ ├── table_cache.h │ │ │ ├── version_edit.cc │ │ │ ├── version_edit.h │ │ │ ├── version_set.cc │ │ │ ├── version_set.h │ │ │ ├── write_batch.cc │ │ │ └── write_batch_internal.h │ │ │ ├── deps │ │ │ └── snappy │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── COPYING │ │ │ │ ├── cmake │ │ │ │ └── config.h.in │ │ │ │ ├── snappy-c.cc │ │ │ │ ├── snappy-c.h │ │ │ │ ├── snappy-internal.h │ │ │ │ ├── snappy-sinksource.cc │ │ │ │ ├── snappy-sinksource.h │ │ │ │ ├── snappy-stubs-internal.cc │ │ │ │ ├── snappy-stubs-internal.h │ │ │ │ ├── snappy-stubs-public.h.in │ │ │ │ ├── snappy.cc │ │ │ │ └── snappy.h │ │ │ ├── helpers │ │ │ └── memenv │ │ │ │ ├── memenv.cc │ │ │ │ └── memenv.h │ │ │ ├── include │ │ │ └── leveldb │ │ │ │ ├── c.h │ │ │ │ ├── cache.h │ │ │ │ ├── comparator.h │ │ │ │ ├── db.h │ │ │ │ ├── dumpfile.h │ │ │ │ ├── env.h │ │ │ │ ├── export.h │ │ │ │ ├── filter_policy.h │ │ │ │ ├── iterator.h │ │ │ │ ├── options.h │ │ │ │ ├── slice.h │ │ │ │ ├── status.h │ │ │ │ ├── table.h │ │ │ │ ├── table_builder.h │ │ │ │ └── write_batch.h │ │ │ ├── port │ │ │ ├── port.h │ │ │ ├── port_config.h.in │ │ │ ├── port_stdcxx.h │ │ │ └── thread_annotations.h │ │ │ ├── table │ │ │ ├── block.cc │ │ │ ├── block.h │ │ │ ├── block_builder.cc │ │ │ ├── block_builder.h │ │ │ ├── filter_block.cc │ │ │ ├── filter_block.h │ │ │ ├── format.cc │ │ │ ├── format.h │ │ │ ├── iterator.cc │ │ │ ├── iterator_wrapper.h │ │ │ ├── merger.cc │ │ │ ├── merger.h │ │ │ ├── table.cc │ │ │ ├── table_builder.cc │ │ │ ├── two_level_iterator.cc │ │ │ └── two_level_iterator.h │ │ │ └── util │ │ │ ├── arena.cc │ │ │ ├── arena.h │ │ │ ├── bloom.cc │ │ │ ├── cache.cc │ │ │ ├── coding.cc │ │ │ ├── coding.h │ │ │ ├── comparator.cc │ │ │ ├── crc32c.cc │ │ │ ├── crc32c.h │ │ │ ├── env.cc │ │ │ ├── env_posix.cc │ │ │ ├── env_posix_test_helper.h │ │ │ ├── env_windows.cc │ │ │ ├── env_windows_test_helper.h │ │ │ ├── filter_policy.cc │ │ │ ├── hash.cc │ │ │ ├── hash.h │ │ │ ├── histogram.cc │ │ │ ├── histogram.h │ │ │ ├── logging.cc │ │ │ ├── logging.h │ │ │ ├── mutexlock.h │ │ │ ├── no_destructor.h │ │ │ ├── options.cc │ │ │ ├── posix_logger.h │ │ │ ├── random.h │ │ │ ├── status.cc │ │ │ └── windows_logger.h │ ├── lib │ │ ├── bdb.js │ │ ├── db.js │ │ ├── key.js │ │ ├── level-browser.js │ │ ├── level.js │ │ ├── memdb.js │ │ └── rbt.js │ ├── package.json │ └── src │ │ ├── binding.cc │ │ └── napi-macros.h ├── bdns │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bdns.js │ │ ├── dns-browser.js │ │ └── dns.js │ └── package.json ├── bevent │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── asyncemitter.js │ │ └── bevent.js │ └── package.json ├── bfile │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── backend.js │ │ ├── bfile.js │ │ ├── compat.js │ │ ├── error.js │ │ ├── extra.js │ │ ├── features.js │ │ ├── fs-browser.js │ │ ├── fs.js │ │ ├── legacy.js │ │ ├── modern.js │ │ └── util.js │ └── package.json ├── bfilter │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bfilter.js │ │ ├── bloom.js │ │ └── rolling.js │ └── package.json ├── bheep │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bheep.js │ │ └── heap.js │ └── package.json ├── binet │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── binet.js │ │ ├── inet.js │ │ ├── ip.js │ │ └── onion.js │ └── package.json ├── blgr │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── blgr.js │ │ ├── format.js │ │ ├── fs-browser.js │ │ ├── fs.js │ │ ├── inspect-browser.js │ │ ├── inspect.js │ │ └── logger.js │ └── package.json ├── blru │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── blru.js │ │ └── lru.js │ └── package.json ├── blst │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── blst.js │ │ └── list.js │ └── package.json ├── bmocha │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── _bmocha │ │ └── bmocha │ ├── etc │ │ ├── error.png │ │ ├── favicon.ico │ │ └── ok.png │ ├── lib │ │ ├── bmocha.js │ │ ├── error-browser.js │ │ ├── error.js │ │ ├── import.js │ │ ├── imports.js │ │ ├── inspect.js │ │ ├── notify.js │ │ ├── require.js │ │ ├── server │ │ │ ├── browserify.js │ │ │ ├── highlight.js │ │ │ ├── index.js │ │ │ └── templates │ │ │ │ ├── bmocha.html │ │ │ │ ├── bmocha.js │ │ │ │ ├── code.html │ │ │ │ ├── common.js │ │ │ │ ├── error.html │ │ │ │ ├── index.html │ │ │ │ ├── index.js │ │ │ │ └── stack.js │ │ └── util.js │ ├── package.json │ └── vendor │ │ ├── glob.js │ │ └── growl.js ├── bmutex │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bmutex.js │ │ ├── lock.js │ │ └── maplock.js │ └── package.json ├── brq │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── brq.js │ │ ├── mime.js │ │ ├── request-browser.js │ │ └── request.js │ └── package.json ├── bs32 │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── base32.js │ │ └── bs32.js │ └── package.json ├── bsert │ ├── LICENSE │ ├── README.md │ ├── lib │ │ └── assert.js │ └── package.json ├── bsock │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── backend-browser.js │ │ ├── backend.js │ │ ├── blacklist.js │ │ ├── bsock.js │ │ ├── codes.js │ │ ├── frame.js │ │ ├── packet.js │ │ ├── parser.js │ │ ├── server-browser.js │ │ ├── server.js │ │ ├── socket.js │ │ ├── util.js │ │ └── uws.js │ ├── package.json │ └── vendor │ │ └── faye-websocket.js ├── bsocks │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bsocks.js │ │ ├── socks-browser.js │ │ └── socks.js │ └── package.json ├── btcp │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── btcp.js │ │ ├── tcp-browser.js │ │ └── tcp.js │ └── package.json ├── buffer-map │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── buffer-map.js │ │ ├── custom-browser.js │ │ └── custom.js │ └── package.json ├── bufio │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bufio.js │ │ ├── custom-browser.js │ │ ├── custom.js │ │ ├── encoding.js │ │ ├── enforce.js │ │ ├── error.js │ │ ├── reader.js │ │ ├── staticwriter.js │ │ ├── struct.js │ │ └── writer.js │ └── package.json ├── bupnp │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bupnp.js │ │ ├── upnp-browser.js │ │ └── upnp.js │ └── package.json ├── bval │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── bval.js │ │ ├── util.js │ │ └── validator.js │ └── package.json ├── bweb │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── bweb │ ├── lib │ │ ├── bweb.js │ │ ├── hook.js │ │ ├── middleware │ │ │ ├── basicauth.js │ │ │ ├── bodyparser.js │ │ │ ├── cookie.js │ │ │ ├── cors.js │ │ │ ├── file.js │ │ │ ├── index-browser.js │ │ │ ├── index.js │ │ │ ├── jsonrpc.js │ │ │ └── router.js │ │ ├── mime.js │ │ ├── request.js │ │ ├── response.js │ │ ├── route.js │ │ ├── router.js │ │ ├── rpc.js │ │ ├── server-browser.js │ │ ├── server.js │ │ └── util.js │ └── package.json ├── loady │ ├── LICENSE │ ├── README.md │ ├── lib │ │ └── loady.js │ └── package.json ├── n64 │ ├── LICENSE │ ├── README.md │ ├── lib │ │ └── n64.js │ └── package.json └── nan │ ├── CHANGELOG.md │ ├── LICENSE.md │ ├── README.md │ ├── doc │ ├── asyncworker.md │ ├── buffers.md │ ├── callback.md │ ├── converters.md │ ├── errors.md │ ├── json.md │ ├── maybe_types.md │ ├── methods.md │ ├── new.md │ ├── node_misc.md │ ├── object_wrappers.md │ ├── persistent.md │ ├── scopes.md │ ├── script.md │ ├── string_bytes.md │ ├── v8_internals.md │ └── v8_misc.md │ ├── include_dirs.js │ ├── nan.h │ ├── nan_callbacks.h │ ├── nan_callbacks_12_inl.h │ ├── nan_callbacks_pre_12_inl.h │ ├── nan_converters.h │ ├── nan_converters_43_inl.h │ ├── nan_converters_pre_43_inl.h │ ├── nan_define_own_property_helper.h │ ├── nan_implementation_12_inl.h │ ├── nan_implementation_pre_12_inl.h │ ├── nan_json.h │ ├── nan_maybe_43_inl.h │ ├── nan_maybe_pre_43_inl.h │ ├── nan_new.h │ ├── nan_object_wrap.h │ ├── nan_persistent_12_inl.h │ ├── nan_persistent_pre_12_inl.h │ ├── nan_private.h │ ├── nan_string_bytes.h │ ├── nan_typedarray_contents.h │ ├── nan_weak.h │ ├── package.json │ └── tools │ ├── 1to2.js │ ├── README.md │ └── package.json ├── package.json ├── scripts ├── certs.sh ├── dump.js ├── fuzz.js ├── gen.js └── seeds.sh ├── snap └── snapcraft.yaml └── test ├── address-test.js ├── bech32-test.js ├── bech32m-test.js ├── block-test.js ├── blockstore-test.js ├── chain-progress-test.js ├── chain-test.js ├── coin-test.js ├── coins-test.js ├── coinselector-test.js ├── consensus-test.js ├── data ├── README.md ├── bip69 │ ├── COPYING │ └── bip69.json ├── block1.raw ├── block1087400-undo.raw ├── block1087400.raw ├── block300025-undo.raw ├── block300025.raw ├── block426884.raw ├── block482683.raw ├── block898352.raw ├── block928816-undo.raw ├── block928816.raw ├── block928828-undo.raw ├── block928828.raw ├── block928831-undo.raw ├── block928831.raw ├── block928848-undo.raw ├── block928848.raw ├── block928849-undo.raw ├── block928849.raw ├── block928927-undo.raw ├── block928927.raw ├── bustabit-2019-2020-tiny-hot-wallet.json ├── coin1.raw ├── compact426884.raw ├── compact898352.raw ├── core-data │ ├── COPYING │ ├── script-tests.json │ ├── sighash-tests.json │ ├── tx-invalid.json │ └── tx-valid.json ├── descriptors │ ├── COPYING │ ├── desc-addresses.json │ ├── desc-invalid.json │ ├── desc-privatekeys.json │ └── desc-valid.json ├── filter-valid.json ├── hd.json ├── headers1.raw ├── merkle300025-extended.raw ├── merkle300025.raw ├── mnemonic-english.json ├── mnemonic-japanese.json ├── mnemonic-korean.json ├── tx1-undo.raw ├── tx1.raw ├── tx10-undo.raw ├── tx10.raw ├── tx2-undo.raw ├── tx2.raw ├── tx3-undo.raw ├── tx3.raw ├── tx4-undo.raw ├── tx4.raw ├── tx5.raw ├── tx6-undo.raw ├── tx6.raw ├── tx7-undo.raw ├── tx7.raw ├── tx8.raw └── tx9.raw ├── descriptor-test.js ├── filter-test.js ├── gcs-test.js ├── hd-test.js ├── headers-test.js ├── indexer-test.js ├── input-test.js ├── keyorigininfo-test.js ├── keyprovider-test.js ├── keyring-test.js ├── mempool-test.js ├── mnemonic-test.js ├── mtx-test.js ├── net-test.js ├── node-http-test.js ├── node-rpc-test.js ├── node-test.js ├── outpoint-test.js ├── p2p-test.js ├── pow-test.js ├── protocol-test.js ├── script-test.js ├── tx-test.js ├── txmeta-test.js ├── util ├── common.js ├── memwallet.js ├── node-context.js └── reorg.js ├── utils-test.js ├── wallet-http-test.js ├── wallet-rpc-test.js └── wallet-test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 -------------------------------------------------------------------------------- /.eslintfiles: -------------------------------------------------------------------------------- 1 | bench/ 2 | bin/cli 3 | bin/node 4 | bin/spvnode 5 | bin/wallet 6 | browser/server.js 7 | browser/wsproxy.js 8 | browser/src/app.js 9 | lib/ 10 | migrate/ 11 | scripts/ 12 | test/ 13 | docs/examples 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/build 2 | node_modules/.yarn-integrity 3 | .nyc_output 4 | docs/reference/ 5 | docker_data/ 6 | browser/bcoin* 7 | npm-debug.log 8 | coverage/ 9 | yarn.lock 10 | package-lock.json 11 | webpack.*.js 12 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .babel* 2 | .bmocharc* 3 | .bpkgignore 4 | .editorconfig 5 | .eslint* 6 | .git* 7 | .mocharc* 8 | .yarnignore 9 | yarn.lock 10 | node_modules/ 11 | package-lock.json 12 | npm-debug.log 13 | webpack.*.js 14 | browser/bcoin* 15 | bench/ 16 | build/ 17 | docs/ 18 | test/ 19 | -------------------------------------------------------------------------------- /bench/bech32.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Address = require('../lib/primitives/address'); 4 | const random = require('bcrypto/lib/random'); 5 | const bench = require('./bench'); 6 | const addrs = []; 7 | 8 | { 9 | const end = bench('serialize'); 10 | for (let i = 0; i < 100000; i++) { 11 | const addr = Address.fromProgram(0, random.randomBytes(20)); 12 | addrs.push(addr.toBech32()); 13 | } 14 | end(100000); 15 | } 16 | 17 | { 18 | const end = bench('parse'); 19 | for (let i = 0; i < 100000; i++) { 20 | const b32 = addrs[i]; 21 | const addr = Address.fromBech32(b32); 22 | addrs[i] = addr; 23 | } 24 | end(100000); 25 | } 26 | 27 | console.error(addrs[0][0]); 28 | -------------------------------------------------------------------------------- /bench/bench.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function bench(name) { 4 | const start = process.hrtime(); 5 | return function end(ops) { 6 | const elapsed = process.hrtime(start); 7 | const time = elapsed[0] + elapsed[1] / 1e9; 8 | const rate = ops / time; 9 | 10 | console.log('%s: ops=%d, time=%d, rate=%s', 11 | name, ops, time, rate.toFixed(5)); 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /bench/buffer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BufferWriter = require('bufio').BufferWriter; 4 | const StaticWriter = require('bufio').StaticWriter; 5 | const common = require('../test/util/common'); 6 | const bench = require('./bench'); 7 | 8 | const tx5 = common.readTX('tx5'); 9 | 10 | { 11 | const [tx] = tx5.getTX(); 12 | const end = bench('serialize (static-writer)'); 13 | for (let i = 0; i < 10000; i++) { 14 | tx.refresh(); 15 | const {size} = tx.getWitnessSizes(); 16 | const bw = new StaticWriter(size); 17 | tx.toWriter(bw); 18 | bw.render(); 19 | } 20 | end(10000); 21 | } 22 | 23 | { 24 | const [tx] = tx5.getTX(); 25 | const end = bench('serialize (buffer-writer)'); 26 | for (let i = 0; i < 10000; i++) { 27 | tx.refresh(); 28 | const bw = new BufferWriter(); 29 | tx.toWriter(bw); 30 | bw.render(); 31 | } 32 | end(10000); 33 | } 34 | -------------------------------------------------------------------------------- /bench/coins.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const CoinView = require('../lib/coins/coinview'); 4 | const BufferReader = require('bufio').BufferReader; 5 | const StaticWriter = require('bufio').StaticWriter; 6 | const common = require('../test/util/common'); 7 | const bench = require('./bench'); 8 | 9 | const [tx, view] = common.readTX('tx3').getTX(); 10 | 11 | { 12 | const end = bench('serialize'); 13 | 14 | for (let i = 0; i < 10000000; i++) { 15 | const bw = new StaticWriter(view.getSize(tx)); 16 | view.toWriter(bw, tx).render(); 17 | } 18 | 19 | end(10000000); 20 | } 21 | 22 | { 23 | const bw = new StaticWriter(view.getSize(tx)); 24 | const raw = view.toWriter(bw, tx).render(); 25 | 26 | const end = bench('parse'); 27 | 28 | for (let i = 0; i < 10000000; i++) { 29 | const br = new BufferReader(raw); 30 | CoinView.fromReader(br, tx); 31 | } 32 | 33 | end(10000000); 34 | } 35 | -------------------------------------------------------------------------------- /bench/hexstring.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const random = require('bcrypto/lib/random'); 4 | const util = require('../lib/utils/util'); 5 | const bench = require('./bench'); 6 | 7 | const hashes = []; 8 | 9 | for (let i = 0; i < 100000; i++) 10 | hashes.push(random.randomBytes(32)); 11 | 12 | { 13 | const end = bench('hexstring'); 14 | for (let i = 0; i < hashes.length; i++) 15 | util.fromRev(util.revHex(hashes[i])); 16 | end(100000); 17 | } 18 | -------------------------------------------------------------------------------- /bench/merkle.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const assert = require('assert'); 4 | const merkle = require('bcrypto/lib/merkle'); 5 | const random = require('bcrypto/lib/random'); 6 | const SHA256 = require('bcrypto/lib/sha256'); 7 | const bench = require('./bench'); 8 | 9 | const leaves = []; 10 | 11 | for (let i = 0; i < 3000; i++) 12 | leaves.push(random.randomBytes(32)); 13 | 14 | { 15 | const end = bench('tree'); 16 | for (let i = 0; i < 1000; i++) { 17 | const [n, m] = merkle.createTree(SHA256, leaves.slice()); 18 | assert(n); 19 | assert(!m); 20 | } 21 | end(1000); 22 | } 23 | -------------------------------------------------------------------------------- /bench/mnemonic.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const assert = require('assert'); 4 | const bench = require('./bench'); 5 | const HD = require('../lib/hd'); 6 | const Mnemonic = require('../lib/hd/mnemonic'); 7 | 8 | const mnemonic = new Mnemonic(); 9 | HD.fromMnemonic(mnemonic); 10 | 11 | const phrase = mnemonic.getPhrase(); 12 | 13 | assert.strictEqual(Mnemonic.fromPhrase(phrase).getPhrase(), phrase); 14 | 15 | { 16 | const end = bench('fromPhrase'); 17 | for (let i = 0; i < 10000; i++) 18 | Mnemonic.fromPhrase(phrase); 19 | end(10000); 20 | } 21 | -------------------------------------------------------------------------------- /bench/script.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const random = require('bcrypto/lib/random'); 4 | const Script = require('../lib/script/script'); 5 | const bench = require('./bench'); 6 | 7 | const hashes = []; 8 | 9 | for (let i = 0; i < 100000; i++) 10 | hashes.push(random.randomBytes(20)); 11 | 12 | { 13 | const end = bench('hash'); 14 | for (let i = 0; i < hashes.length; i++) 15 | Script.fromPubkeyhash(hashes[i]); 16 | end(100000); 17 | } 18 | -------------------------------------------------------------------------------- /bin/bwallet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rl=0 4 | daemon=0 5 | 6 | if ! type perl > /dev/null 2>& 1; then 7 | if uname | grep -i 'darwin' > /dev/null; then 8 | echo 'Bcoin requires perl to start on OSX.' >& 2 9 | exit 1 10 | fi 11 | rl=1 12 | fi 13 | 14 | if test $rl -eq 1; then 15 | file=$(readlink -f "$0") 16 | else 17 | # Have to do it this way 18 | # because OSX isn't a real OS 19 | file=$(perl -MCwd -e "print Cwd::realpath('$0')") 20 | fi 21 | 22 | dir=$(dirname "$file") 23 | 24 | if test x"$1" = x'cli'; then 25 | shift 26 | exec "${dir}/cli" "wallet" "$@" 27 | exit 1 28 | fi 29 | 30 | for arg in "$@"; do 31 | case "$arg" in 32 | --daemon) 33 | daemon=1 34 | ;; 35 | esac 36 | done 37 | 38 | if test $daemon -eq 1; then 39 | # And yet again, OSX doesn't support something. 40 | if ! type setsid > /dev/null 2>& 1; then 41 | ( 42 | "${dir}/wallet" "$@" > /dev/null 2>& 1 & 43 | echo "$!" 44 | ) 45 | exit 0 46 | fi 47 | ( 48 | setsid "${dir}/wallet" "$@" > /dev/null 2>& 1 & 49 | echo "$!" 50 | ) 51 | exit 0 52 | else 53 | exec "${dir}/wallet" "$@" 54 | exit 1 55 | fi 56 | -------------------------------------------------------------------------------- /bin/cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | console.error('%s%s', 6 | 'Warning: The `bcoin cli` interface is deprecated.\n', 7 | 'Please use `bcoin-cli` and `bwallet-cli` instead.'); 8 | -------------------------------------------------------------------------------- /browser/debug.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bcoin 5 | 6 | 7 | 8 |

Bcoin

9 |

Use the console to access `global.bcoin`.

10 | 11 | 12 | -------------------------------------------------------------------------------- /browser/server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const bweb = require('bweb'); 4 | const fs = require('bfile'); 5 | const WSProxy = require('./wsproxy'); 6 | 7 | const index = fs.readFileSync(`${__dirname}/index.html`); 8 | const app = fs.readFileSync(`${__dirname}/app.js`); 9 | const worker = fs.readFileSync(`${__dirname}/worker.js`); 10 | 11 | const proxy = new WSProxy({ 12 | ports: [8333, 18333, 18444, 28333, 28901] 13 | }); 14 | 15 | const server = bweb.server({ 16 | port: Number(process.argv[2]) || 8080, 17 | sockets: false 18 | }); 19 | 20 | server.use(server.router()); 21 | 22 | proxy.on('error', (err) => { 23 | console.error(err.stack); 24 | }); 25 | 26 | server.on('error', (err) => { 27 | console.error(err.stack); 28 | }); 29 | 30 | server.get('/', (req, res) => { 31 | res.send(200, index, 'html'); 32 | }); 33 | 34 | server.get('/app.js', (req, res) => { 35 | res.send(200, app, 'js'); 36 | }); 37 | 38 | server.get('/worker.js', (req, res) => { 39 | res.send(200, worker, 'js'); 40 | }); 41 | 42 | proxy.attach(server.http); 43 | 44 | server.open(); 45 | -------------------------------------------------------------------------------- /docs/examples/fullnode.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const bcoin = require('../..'); 4 | 5 | const node = new bcoin.FullNode({ 6 | memory: true, 7 | network: 'testnet', 8 | workers: true 9 | }); 10 | 11 | (async () => { 12 | await node.open(); 13 | await node.connect(); 14 | 15 | node.on('connect', (entry, block) => { 16 | console.log('%s (%d) added to chain.', entry.rhash(), entry.height); 17 | }); 18 | 19 | node.on('tx', (tx) => { 20 | console.log('%s added to mempool.', tx.txid()); 21 | }); 22 | 23 | node.startSync(); 24 | })().catch((err) => { 25 | console.error(err.stack); 26 | process.exit(1); 27 | }); 28 | -------------------------------------------------------------------------------- /docs/examples/peers-plugin.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const bcoin = require('../..'); 4 | 5 | function MyPlugin(node) { 6 | this.node = node; 7 | } 8 | 9 | MyPlugin.id = 'my-plugin'; 10 | 11 | MyPlugin.init = function init(node) { 12 | return new MyPlugin(node); 13 | }; 14 | 15 | MyPlugin.prototype.open = function open() { 16 | console.log('Opened my plugin.'); 17 | return Promise.resolve(); 18 | }; 19 | 20 | MyPlugin.prototype.close = function close() { 21 | console.log('Closed my plugin.'); 22 | return Promise.resolve(); 23 | }; 24 | 25 | MyPlugin.prototype.sayPeers = function sayPeers() { 26 | console.log('Number of peers: %d', this.node.pool.peers.size()); 27 | }; 28 | 29 | const node = new bcoin.FullNode({ 30 | memory: true, 31 | network: 'testnet', 32 | workers: true 33 | }); 34 | 35 | node.use(MyPlugin); 36 | 37 | (async () => { 38 | const plugin = node.require('my-plugin'); 39 | 40 | await node.open(); 41 | 42 | await node.connect(); 43 | 44 | plugin.sayPeers(); 45 | 46 | await node.close(); 47 | })().catch((err) => { 48 | console.error(err.stack); 49 | process.exit(1); 50 | }); 51 | -------------------------------------------------------------------------------- /docs/examples/wallet.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const bcoin = require('../..'); 4 | const random = require('bcrypto/lib/random'); 5 | 6 | function dummy() { 7 | const hash = random.randomBytes(32); 8 | return new bcoin.Outpoint(hash, 0); 9 | } 10 | 11 | const walletdb = new bcoin.wallet.WalletDB({ 12 | network: 'testnet', 13 | memory: true 14 | }); 15 | 16 | (async () => { 17 | await walletdb.open(); 18 | 19 | const wallet = await walletdb.create(); 20 | 21 | console.log('Created wallet'); 22 | console.log(wallet); 23 | 24 | const acct = await wallet.createAccount({ 25 | name: 'foo' 26 | }); 27 | 28 | console.log('Created account'); 29 | console.log(acct); 30 | 31 | const mtx = new bcoin.MTX(); 32 | mtx.addOutpoint(dummy()); 33 | mtx.addOutput(acct.receiveAddress(), 50460); 34 | 35 | const tx = mtx.toTX(); 36 | 37 | wallet.on('tx', (tx) => { 38 | console.log('Received transaciton:\n', tx); 39 | }); 40 | 41 | await walletdb.addTX(tx); 42 | })().catch((err) => { 43 | console.error(err.stack); 44 | process.exit(1); 45 | }); 46 | -------------------------------------------------------------------------------- /etc/sample.wallet.conf: -------------------------------------------------------------------------------- 1 | # Sample bcoin wallet config file (~/.bcoin/wallet.conf) 2 | 3 | # 4 | # Options 5 | # 6 | 7 | # network: main 8 | 9 | # 10 | # HTTP 11 | # 12 | 13 | http-host: :: 14 | # http-port: 8334 15 | # ssl: true 16 | # ssl-cert: @/ssl/cert.crt 17 | # ssl-key: @/ssl/priv.key 18 | api-key: bikeshed 19 | # no-auth: false 20 | # cors: false 21 | 22 | # 23 | # Wallet 24 | # 25 | 26 | witness: false 27 | wallet-auth: false 28 | -------------------------------------------------------------------------------- /jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tags": { 3 | "allowUnknownTags": true 4 | }, 5 | "source": { 6 | "include": ["README.md", "lib/"], 7 | "exclude": [], 8 | "includePattern": ".+\\.js(doc)?$", 9 | "excludePattern": "(^|\\/|\\\\)_" 10 | }, 11 | "plugins": ["plugins/markdown"], 12 | "templates": { 13 | "cleverLinks": false, 14 | "monospaceLinks": false 15 | }, 16 | "opts": { 17 | "template": "templates/default", 18 | "encoding": "utf8", 19 | "destination": "./docs/reference", 20 | "recurse": true, 21 | "private": true, 22 | "pedantic": true 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/blockchain/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blockchain/index.js - blockchain for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module blockchain 11 | */ 12 | 13 | exports.ChainDB = require('./chaindb'); 14 | exports.ChainEntry = require('./chainentry'); 15 | exports.Chain = require('./chain'); 16 | exports.common = require('./common'); 17 | exports.layout = require('./layout'); 18 | -------------------------------------------------------------------------------- /lib/blockstore/common.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * common.js - blockstore constants for bcoin 3 | * Copyright (c) 2019, Braydon Fuller (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module blockstore/common 11 | */ 12 | 13 | /** 14 | * Block data types. 15 | * @enum {Number} 16 | */ 17 | 18 | exports.types = { 19 | BLOCK: 1, 20 | UNDO: 2, 21 | FILTER_BASIC: 3, 22 | MERKLE: 4 23 | }; 24 | 25 | /** 26 | * Filter types 27 | * @enum {Number} 28 | */ 29 | 30 | exports.filters = { 31 | BASIC: exports.types.FILTER_BASIC 32 | }; 33 | 34 | /** 35 | * File prefixes for block data types. 36 | * @enum {String} 37 | */ 38 | 39 | exports.prefixes = { 40 | 1: 'blk', 41 | 2: 'blu', 42 | 3: 'blf', 43 | 4: 'blm' 44 | }; 45 | -------------------------------------------------------------------------------- /lib/blockstore/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blockstore/index.js - bitcoin blockstore for bcoin 3 | * Copyright (c) 2019, Braydon Fuller (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const {join} = require('path'); 10 | 11 | const AbstractBlockStore = require('./abstract'); 12 | const LevelBlockStore = require('./level'); 13 | const FileBlockStore = require('./file'); 14 | 15 | /** 16 | * @module blockstore 17 | */ 18 | 19 | exports.create = (options) => { 20 | if (options.memory) { 21 | return new LevelBlockStore({ 22 | network: options.network, 23 | logger: options.logger, 24 | cacheSize: options.cacheSize, 25 | memory: options.memory 26 | }); 27 | } 28 | 29 | const location = join(options.prefix, 'blocks'); 30 | 31 | return new FileBlockStore({ 32 | network: options.network, 33 | logger: options.logger, 34 | location: location, 35 | cacheSize: options.cacheSize 36 | }); 37 | }; 38 | 39 | exports.AbstractBlockStore = AbstractBlockStore; 40 | exports.FileBlockStore = FileBlockStore; 41 | exports.LevelBlockStore = LevelBlockStore; 42 | -------------------------------------------------------------------------------- /lib/blockstore/layout.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blockstore/layout.js - file blockstore data layout for bcoin 3 | * Copyright (c) 2019, Braydon Fuller (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const bdb = require('bdb'); 10 | 11 | /* 12 | * Database Layout: 13 | * V -> db version 14 | * F[type] -> last file record by type 15 | * f[type][fileno] -> file record by type and file number 16 | * b[type][hash] -> block record by type and block hash 17 | */ 18 | 19 | const layout = { 20 | V: bdb.key('V'), 21 | F: bdb.key('F', ['uint32']), 22 | f: bdb.key('f', ['uint32', 'uint32']), 23 | b: bdb.key('b', ['uint32', 'hash256']) 24 | }; 25 | 26 | /* 27 | * Expose 28 | */ 29 | 30 | module.exports = layout; 31 | -------------------------------------------------------------------------------- /lib/btc/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * btc/index.js - high-level btc objects for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module btc 11 | */ 12 | 13 | exports.Amount = require('./amount'); 14 | exports.URI = require('./uri'); 15 | -------------------------------------------------------------------------------- /lib/client/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * client/index.js - client for bcoin 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module client 11 | */ 12 | 13 | exports.NodeClient = require('./node'); 14 | exports.WalletClient = require('./wallet'); 15 | -------------------------------------------------------------------------------- /lib/coins/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * coins/index.js - utxo management for bcoin 3 | * Copyright (c) 2016-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module coins 11 | */ 12 | 13 | exports.Coins = require('./coins'); 14 | exports.CoinView = require('./coinview'); 15 | exports.compress = require('./compress'); 16 | exports.UndoCoins = require('./undocoins'); 17 | -------------------------------------------------------------------------------- /lib/descriptor/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * descriptor/index.js - Output script descriptor for bcoin. 3 | * Copyright (c) 2023, the bcoin developers (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module descriptor 11 | */ 12 | 13 | const {parse} = require('./parser'); 14 | 15 | exports.AbstractDescriptor = require('./abstractdescriptor'); 16 | exports.parse = parse; 17 | exports.PKDescriptor = require('./type/pk'); 18 | exports.PKHDescriptor = require('./type/pkh'); 19 | exports.WPKHDescriptor = require('./type/wpkh'); 20 | exports.SHDescriptor = require('./type/sh'); 21 | exports.WSHDescriptor = require('./type/wsh'); 22 | exports.ComboDescriptor = require('./type/combo'); 23 | exports.MultisigDescriptor = require('./type/multisig'); 24 | exports.RawDescriptor = require('./type/raw'); 25 | exports.AddressDescriptor = require('./type/addr'); 26 | exports.KeyProvider = require('./keyprovider'); 27 | exports.common = require('./common'); 28 | -------------------------------------------------------------------------------- /lib/golomb/README.md: -------------------------------------------------------------------------------- 1 | # Golomb 2 | 3 | Golomb `lib/golomb` is a bcoin module intended to be used as a Golomb Coded Set 4 | for creating Compact Block Filters as specified in [BIP 158][0]. It is used to 5 | create block filters which can be used to quickly scan blocks for a given set 6 | of transaction outputs. 7 | 8 | Block filters are stored as an index using the blockstore. To enable indexing 9 | filters, the config option `index-filter` should be enabled. For mainnet, the 10 | indexing requires several hours on average and occupies ~4GB of disk space as 11 | of block #595225. 12 | 13 | Block filters can be accessed using the RPC: 14 | 15 | `getblockfilter ` 16 | 17 | or the HTTP API: 18 | 19 | `GET /filter/` 20 | 21 | `Golomb` implements the Golomb Code Set used to create the block filter. It 22 | takes the parameters N - size of the items to add to the filter and the 23 | parameters M and P. The probability of a false positive is 1/M and M is 24 | customarily set to 2^P. [BIP 158][0] defines the value of P as 19, based on 25 | results from real world block data. 26 | 27 | [0]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki 28 | -------------------------------------------------------------------------------- /lib/golomb/basicFilter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Golomb = require('./golomb'); 4 | const {U64} = require('n64'); 5 | 6 | class BasicFilter extends Golomb { 7 | constructor() { 8 | super(19, new U64(784931)); 9 | } 10 | } 11 | 12 | module.exports = BasicFilter; 13 | -------------------------------------------------------------------------------- /lib/hd/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hd/index.js - hd keys for bcoin 3 | * Copyright (c) 2014-2016, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./hd'); 10 | -------------------------------------------------------------------------------- /lib/hd/nfkd-compat.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * nfkd-compat.js - unicode normalization for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const unorm = require('./unorm'); 10 | 11 | function nfkd(str) { 12 | if (str.normalize) 13 | return str.normalize('NFKD'); 14 | 15 | return unorm.nfkd(str); 16 | } 17 | 18 | /* 19 | * Expose 20 | */ 21 | 22 | module.exports = nfkd; 23 | -------------------------------------------------------------------------------- /lib/hd/nfkd.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * nfkd.js - unicode normalization for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * Normalize unicode string. 11 | * @alias module:utils.nfkd 12 | * @param {String} str 13 | * @returns {String} 14 | */ 15 | 16 | function nfkd(str) { 17 | return str.normalize('NFKD'); 18 | } 19 | 20 | /* 21 | * Expose 22 | */ 23 | 24 | module.exports = nfkd; 25 | -------------------------------------------------------------------------------- /lib/hd/wordlist-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * wordlist.js - wordlists for bcoin 3 | * Copyright (c) 2015-2016, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const words = require('./words'); 10 | 11 | exports.get = function get(name) { 12 | switch (name) { 13 | case 'simplified chinese': 14 | return words.chinese.simplified; 15 | case 'traditional chinese': 16 | return words.chinese.traditional; 17 | case 'english': 18 | return words.english; 19 | case 'french': 20 | return words.french; 21 | case 'italian': 22 | return words.italian; 23 | case 'japanese': 24 | return words.japanese; 25 | case 'spanish': 26 | return words.spanish; 27 | case 'korean': 28 | return words.korean; 29 | default: 30 | throw new Error(`Unknown language: ${name}.`); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /lib/hd/wordlist.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * wordlist.js - wordlists for bcoin 3 | * Copyright (c) 2015-2016, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.get = function get(name) { 10 | switch (name) { 11 | case 'simplified chinese': 12 | return require('./words/chinese-simplified.js'); 13 | case 'traditional chinese': 14 | return require('./words/chinese-traditional.js'); 15 | case 'english': 16 | return require('./words/english.js'); 17 | case 'french': 18 | return require('./words/french.js'); 19 | case 'italian': 20 | return require('./words/italian.js'); 21 | case 'japanese': 22 | return require('./words/japanese.js'); 23 | case 'spanish': 24 | return require('./words/spanish.js'); 25 | case 'korean': 26 | return require('./words/korean.js'); 27 | default: 28 | throw new Error(`Unknown language: ${name}.`); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /lib/hd/words/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * index.js - wordlists for bcoin 3 | * Copyright (c) 2015-2016, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.chinese = { 10 | simplified: require('./chinese-simplified.js'), 11 | traditional: require('./chinese-traditional.js') 12 | }; 13 | 14 | exports.english = require('./english.js'); 15 | exports.french = require('./french.js'); 16 | exports.italian = require('./italian.js'); 17 | exports.japanese = require('./japanese.js'); 18 | exports.spanish = require('./spanish.js'); 19 | exports.korean = require('./korean.js'); 20 | -------------------------------------------------------------------------------- /lib/indexer/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * index.js - indexer for bcoin 3 | * Copyright (c) 2018, the bcoin developers (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module indexer 11 | */ 12 | 13 | exports.Indexer = require('./indexer'); 14 | exports.TXIndexer = require('./txindexer'); 15 | exports.AddrIndexer = require('./addrindexer'); 16 | exports.FilterIndexer = require('./filterindexer'); 17 | -------------------------------------------------------------------------------- /lib/indexer/layout.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * layout.js - indexer layout for bcoin 3 | * Copyright (c) 2018, the bcoin developers (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const bdb = require('bdb'); 10 | 11 | /* 12 | * Index database layout: 13 | * To be extended by indexer implementations. 14 | * 15 | * V -> db version 16 | * O -> flags 17 | * h[height] -> block hash 18 | * R -> index sync height 19 | */ 20 | 21 | const layout = { 22 | V: bdb.key('V'), 23 | O: bdb.key('O'), 24 | h: bdb.key('h', ['uint32']), 25 | R: bdb.key('R') 26 | }; 27 | 28 | /* 29 | * Expose 30 | */ 31 | 32 | module.exports = layout; 33 | -------------------------------------------------------------------------------- /lib/mempool/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mempool/index.js - mempool for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module mempool 11 | */ 12 | 13 | exports.Fees = require('./fees'); 14 | exports.layout = require('./layout'); 15 | exports.MempoolEntry = require('./mempoolentry'); 16 | exports.Mempool = require('./mempool'); 17 | -------------------------------------------------------------------------------- /lib/mempool/layout.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * layout.js - mempool data layout for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const bdb = require('bdb'); 10 | 11 | /* 12 | * Database Layout: 13 | * V -> db version 14 | * v -> serialization version 15 | * R -> tip hash 16 | * e[hash] -> entry 17 | */ 18 | 19 | const layout = { 20 | V: bdb.key('V'), 21 | v: bdb.key('v'), 22 | R: bdb.key('R'), 23 | F: bdb.key('F'), 24 | e: bdb.key('e', ['hash256']) 25 | }; 26 | 27 | /* 28 | * Expose 29 | */ 30 | 31 | module.exports = layout; 32 | -------------------------------------------------------------------------------- /lib/mining/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mining/index.js - mining infrastructure for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module mining 11 | */ 12 | 13 | exports.common = require('./common'); 14 | exports.CPUMiner = require('./cpuminer'); 15 | exports.mine = require('./mine'); 16 | exports.Miner = require('./miner'); 17 | exports.BlockTemplate = require('./template'); 18 | -------------------------------------------------------------------------------- /lib/net/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * net/index.js - p2p for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module net 11 | */ 12 | 13 | exports.bip152 = require('./bip152'); 14 | exports.common = require('./common'); 15 | exports.Framer = require('./framer'); 16 | exports.HostList = require('./hostlist'); 17 | exports.NetAddress = require('./netaddress'); 18 | exports.packets = require('./packets'); 19 | exports.Parser = require('./parser'); 20 | exports.Peer = require('./peer'); 21 | exports.Pool = require('./pool'); 22 | -------------------------------------------------------------------------------- /lib/net/seeds/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * seeds.js - seeds for bcoin 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const main = require('./main'); 10 | const testnet = require('./testnet'); 11 | 12 | exports.get = function get(type) { 13 | switch (type) { 14 | case 'main': 15 | return main; 16 | case 'testnet': 17 | return testnet; 18 | default: 19 | return []; 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /lib/node/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * node/index.js - node for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module node 11 | */ 12 | 13 | exports.FullNode = require('./fullnode'); 14 | exports.HTTP = require('./http'); 15 | exports.Node = require('./node'); 16 | exports.RPC = require('./rpc'); 17 | exports.SPVNode = require('./spvnode'); 18 | -------------------------------------------------------------------------------- /lib/primitives/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * primitives/index.js - bitcoin primitives for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module primitives 11 | */ 12 | 13 | exports.AbstractBlock = require('./abstractblock'); 14 | exports.Address = require('./address'); 15 | exports.Block = require('./block'); 16 | exports.Coin = require('./coin'); 17 | exports.Headers = require('./headers'); 18 | exports.Input = require('./input'); 19 | exports.InvItem = require('./invitem'); 20 | exports.KeyRing = require('./keyring'); 21 | exports.MemBlock = require('./memblock'); 22 | exports.MerkleBlock = require('./merkleblock'); 23 | exports.MTX = require('./mtx'); 24 | exports.Outpoint = require('./outpoint'); 25 | exports.Output = require('./output'); 26 | exports.TX = require('./tx'); 27 | exports.TXMeta = require('./txmeta'); 28 | -------------------------------------------------------------------------------- /lib/protocol/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * protocol/index.js - protocol constants for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module protocol 11 | */ 12 | 13 | exports.consensus = require('./consensus'); 14 | exports.errors = require('./errors'); 15 | exports.Network = require('./network'); 16 | exports.networks = require('./networks'); 17 | exports.policy = require('./policy'); 18 | exports.timedata = require('./timedata'); 19 | -------------------------------------------------------------------------------- /lib/script/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * script/index.js - bitcoin scripting for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module script 11 | */ 12 | 13 | exports.common = require('./common'); 14 | exports.Opcode = require('./opcode'); 15 | exports.Program = require('./program'); 16 | exports.Script = require('./script'); 17 | exports.ScriptError = require('./scripterror'); 18 | exports.ScriptNum = require('./scriptnum'); 19 | exports.sigcache = require('./sigcache'); 20 | exports.Stack = require('./stack'); 21 | exports.Witness = require('./witness'); 22 | -------------------------------------------------------------------------------- /lib/utils/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * utils/index.js - utils for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module utils 11 | */ 12 | 13 | exports.binary = require('./binary'); 14 | exports.fixed = require('./fixed'); 15 | exports.util = require('./util'); 16 | exports.message = require('./message'); 17 | 18 | const {inspect: {custom}} = require('util'); 19 | exports.inspectSymbol = custom || 'inspect'; 20 | -------------------------------------------------------------------------------- /lib/wallet/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * wallet/index.js - wallet for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module wallet 11 | */ 12 | 13 | exports.Account = require('./account'); 14 | exports.Client = require('./client'); 15 | exports.common = require('./common'); 16 | exports.HTTP = require('./http'); 17 | exports.layout = require('./layout'); 18 | exports.MasterKey = require('./masterkey'); 19 | exports.NodeClient = require('./nodeclient'); 20 | exports.Path = require('./path'); 21 | exports.plugin = require('./plugin'); 22 | exports.records = require('./records'); 23 | exports.RPC = require('./rpc'); 24 | exports.Node = require('./node'); 25 | exports.TXDB = require('./txdb'); 26 | exports.WalletDB = require('./walletdb'); 27 | exports.Wallet = require('./wallet'); 28 | exports.WalletKey = require('./walletkey'); 29 | -------------------------------------------------------------------------------- /lib/workers/framer.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * workers.js - worker processes for bcoin 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcoin 6 | */ 7 | 8 | 'use strict'; 9 | 10 | const bio = require('bufio'); 11 | 12 | /** 13 | * Framer 14 | * @alias module:workers.Framer 15 | */ 16 | 17 | class Framer { 18 | /** 19 | * Create a framer. 20 | * @constructor 21 | */ 22 | 23 | constructor() {} 24 | 25 | packet(payload) { 26 | const size = 10 + payload.getSize(); 27 | const bw = bio.write(size); 28 | 29 | bw.writeU32(payload.id); 30 | bw.writeU8(payload.cmd); 31 | bw.seek(4); 32 | 33 | payload.toWriter(bw); 34 | 35 | bw.writeU8(0x0a); 36 | 37 | const msg = bw.render(); 38 | msg.writeUInt32LE(msg.length - 10, 5, true); 39 | 40 | return msg; 41 | } 42 | } 43 | 44 | /* 45 | * Expose 46 | */ 47 | 48 | module.exports = Framer; 49 | -------------------------------------------------------------------------------- /lib/workers/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * workers/index.js - workers for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module workers 11 | */ 12 | 13 | exports.Framer = require('./framer'); 14 | exports.jobs = require('./jobs'); 15 | exports.packets = require('./packets'); 16 | exports.Parser = require('./parser'); 17 | exports.WorkerPool = require('./workerpool'); 18 | -------------------------------------------------------------------------------- /lib/workers/worker.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * worker.js - worker thread/process for bcoin 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcoin 6 | */ 7 | 8 | 'use strict'; 9 | 10 | const Master = require('./master'); 11 | const server = new Master(); 12 | 13 | process.title = 'bcoin-worker'; 14 | 15 | server.listen(); 16 | -------------------------------------------------------------------------------- /migrate/coins/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * coins/index.js - utxo management for bcoin 3 | * Copyright (c) 2016-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * @module coins 11 | */ 12 | 13 | exports.Coins = require('../../lib/coins/coins'); 14 | exports.CoinView = require('../../lib/coins/coinview'); 15 | exports.compress = require('../../lib/coins/compress'); 16 | exports.UndoCoins = require('../../lib/coins/undocoins'); 17 | -------------------------------------------------------------------------------- /node_modules/.bin/_bmocha: -------------------------------------------------------------------------------- 1 | ../bmocha/bin/_bmocha -------------------------------------------------------------------------------- /node_modules/.bin/bmocha: -------------------------------------------------------------------------------- 1 | ../bmocha/bin/bmocha -------------------------------------------------------------------------------- /node_modules/.bin/bweb: -------------------------------------------------------------------------------- 1 | ../bweb/bin/bweb -------------------------------------------------------------------------------- /node_modules/bcfg/lib/bcfg.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bcfg.js - configuration parsing for bcoin 3 | * Copyright (c) 2016-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./config'); 10 | -------------------------------------------------------------------------------- /node_modules/bcfg/lib/fs-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.unsupported = true; 4 | -------------------------------------------------------------------------------- /node_modules/bcfg/lib/fs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('fs'); 4 | -------------------------------------------------------------------------------- /node_modules/bcfg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bcfg", 3 | "version": "0.1.7", 4 | "description": "Config parser for bcoin", 5 | "keywords": [ 6 | "conf", 7 | "config" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/bcfg.git", 11 | "homepage": "https://github.com/bcoin-org/bcfg", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/bcfg/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/bcfg.js", 17 | "scripts": { 18 | "lint": "eslint lib/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "dependencies": { 22 | "bsert": "~0.0.10" 23 | }, 24 | "devDependencies": { 25 | "bmocha": "^2.1.0" 26 | }, 27 | "engines": { 28 | "node": ">=8.0.0" 29 | }, 30 | "browser": { 31 | "./lib/fs": "./lib/fs-browser.js" 32 | }, 33 | "_from": "git+https://github.com/bcoin-org/bcfg.git#semver:~0.1.7", 34 | "_resolved": "git+https://github.com/bcoin-org/bcfg.git#05122154b35baa82cd01dc9478ebee7346386ba1", 35 | "_commit": "05122154b35baa82cd01dc9478ebee7346386ba1" 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/bcrypto/cmake/AppendCCompilerFlag.cmake: -------------------------------------------------------------------------------- 1 | # AppendCCompilerFlag.cmake - checked c flags appending 2 | # Copyright (c) 2020, Christopher Jeffrey (MIT License). 3 | # https://github.com/chjj 4 | 5 | if(COMMAND append_c_compiler_flag) 6 | return() 7 | endif() 8 | 9 | include(CheckCCompilerFlag) 10 | 11 | function(append_c_compiler_flag list) 12 | foreach(flag IN LISTS ARGN) 13 | string(TOUPPER "CMAKE_HAVE_C_FLAG${flag}" name) 14 | string(REGEX REPLACE "[^A-Z0-9]" "_" name "${name}") 15 | 16 | check_c_compiler_flag(${flag} ${name}) 17 | 18 | if(${name}) 19 | list(APPEND ${list} ${flag}) 20 | endif() 21 | endforeach() 22 | 23 | set(${list} ${${list}} PARENT_SCOPE) 24 | endfunction() 25 | -------------------------------------------------------------------------------- /node_modules/bcrypto/cmake/CheckCThreadLocalStorage.cmake: -------------------------------------------------------------------------------- 1 | # CheckCThreadLocalStorage.cmake - tls check for c 2 | # Copyright (c) 2020, Christopher Jeffrey (MIT License). 3 | # https://github.com/chjj 4 | 5 | if(COMMAND check_c_thread_local_storage) 6 | return() 7 | endif() 8 | 9 | function(check_c_thread_local_storage name) 10 | set(${name} "" PARENT_SCOPE) 11 | 12 | foreach(keyword IN ITEMS "__declspec(thread)" __thread _Thread_local) 13 | string(TOUPPER "CMAKE_HAVE_C_TLS_${keyword}" varname) 14 | string(REGEX REPLACE "[^A-Z0-9]" "_" varname "${varname}") 15 | 16 | check_c_source_compiles(" 17 | static ${keyword} int value; 18 | int main(void) { 19 | value = 1; 20 | return 0; 21 | } 22 | " ${varname}) 23 | 24 | if(${varname}) 25 | set(${name} ${keyword} PARENT_SCOPE) 26 | break() 27 | endif() 28 | endforeach() 29 | endfunction() 30 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/src/ecmult_const.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_CONST_H 8 | #define SECP256K1_ECMULT_CONST_H 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | /** 14 | * Multiply: R = q*A (in constant-time) 15 | * Here `bits` should be set to the maximum bitlength of the _absolute value_ of `q`, plus 16 | * one because we internally sometimes add 2 to the number during the WNAF conversion. 17 | */ 18 | static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q, int bits); 19 | 20 | #endif /* SECP256K1_ECMULT_CONST_H */ 21 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/src/num_gmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef SECP256K1_NUM_REPR_H 8 | #define SECP256K1_NUM_REPR_H 9 | 10 | #include 11 | 12 | #define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) 13 | 14 | typedef struct { 15 | mp_limb_t data[2*NUM_LIMBS]; 16 | int neg; 17 | int limbs; 18 | } secp256k1_num; 19 | 20 | #endif /* SECP256K1_NUM_REPR_H */ 21 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/src/num_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef SECP256K1_NUM_IMPL_H 8 | #define SECP256K1_NUM_IMPL_H 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | #include "num.h" 15 | 16 | #if defined(USE_NUM_GMP) 17 | #include "num_gmp_impl.h" 18 | #elif defined(USE_NUM_NONE) 19 | /* Nothing. */ 20 | #else 21 | #error "Please select num implementation" 22 | #endif 23 | 24 | #endif /* SECP256K1_NUM_IMPL_H */ 25 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif /* SECP256K1_SCALAR_REPR_H */ 20 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif /* SECP256K1_SCALAR_REPR_H */ 20 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/secp256k1/src/scalar_low.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef uint32_t secp256k1_scalar; 14 | 15 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) (d0) 16 | 17 | #endif /* SECP256K1_SCALAR_REPR_H */ 18 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/torsion/include/torsion/common.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * common.h - common definitions for libtorsion 3 | * Copyright (c) 2020, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/libtorsion 5 | */ 6 | 7 | #ifndef TORSION_COMMON_H 8 | #define TORSION_COMMON_H 9 | 10 | #ifdef TORSION_BUILD 11 | # if defined(__EMSCRIPTEN__) 12 | # include 13 | # define TORSION_EXTERN EMSCRIPTEN_KEEPALIVE 14 | # elif defined(__wasm__) 15 | # define TORSION_EXTERN __attribute__((visibility("default"))) 16 | # elif defined(_WIN32) 17 | # define TORSION_EXTERN __declspec(dllexport) 18 | # elif defined(__GNUC__) && __GNUC__ >= 4 19 | # define TORSION_EXTERN __attribute__((visibility("default"))) 20 | # elif (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) \ 21 | || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) 22 | # define TORSION_EXTERN __global 23 | # endif 24 | #endif 25 | 26 | #ifndef TORSION_EXTERN 27 | # define TORSION_EXTERN 28 | #endif 29 | 30 | #endif /* TORSION_COMMON_H */ 31 | -------------------------------------------------------------------------------- /node_modules/bcrypto/deps/torsion/src/fields/.fiat-head: -------------------------------------------------------------------------------- 1 | 902c79a2ddb3ff0904c043046b533d0ef09ce80f 2 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/aead-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * aead.js - aead for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/aead'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/aead.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * aead.js - aead for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/aead'); 11 | else 12 | module.exports = require('./native/aead'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/aes-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * aes.js - aes for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/aes'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/aes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * aes.js - aes for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/aes'); 11 | else 12 | module.exports = require('./native/aes'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/arc4-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * arc4.js - arc4 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/arc4'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/arc4.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * arc4.js - arc4 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/arc4'); 11 | else 12 | module.exports = require('./native/arc4'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/bcrypt-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bcrypt.js - bcrypt for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/bcrypt'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/bcrypt.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bcrypt.js - bcrypt for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/bcrypt'); 11 | else 12 | module.exports = require('./native/bcrypt'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/blake2b-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blake2b.js - blake2b for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/blake2b'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/blake2b.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blake2b.js - blake2b for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/blake2b'); 11 | else 12 | module.exports = require('./native/blake2b'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/blake2s-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blake2s.js - blake2s for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/blake2s'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/blake2s.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blake2s.js - blake2s for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/blake2s'); 11 | else 12 | module.exports = require('./native/blake2s'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/bn-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bn.js - big numbers for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/bn'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/bn.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bn.js - big numbers for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.BCRYPTO_FORCE_BIGINT || process.env.NODE_BACKEND !== 'js') { 10 | try { 11 | module.exports = require('./native/bn'); 12 | // See: https://github.com/bcoin-org/bcrypto/issues/27 13 | // https://github.com/bcoin-org/bcrypto/issues/35 14 | if (!module.exports.native) 15 | throw new Error(); 16 | } catch (e) { 17 | module.exports = require('./js/bn'); 18 | } 19 | } else { 20 | module.exports = require('./js/bn'); 21 | } 22 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/chacha20-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chacha20.js - chacha20 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/chacha20'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/chacha20.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chacha20.js - chacha20 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/chacha20'); 11 | else 12 | module.exports = require('./native/chacha20'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/cipher-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cipher.js - cipher for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/cipher'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/cipher.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cipher.js - cipher for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/cipher'); 11 | else 12 | module.exports = require('./native/cipher'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/cleanse-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cleanse.js - cleanse for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/cleanse'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/cleanse.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cleanse.js - cleanse for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/cleanse'); 11 | else 12 | module.exports = require('./native/cleanse'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ctr-drbg-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ctr-drbg.js - ctr-drbg for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/ctr-drbg'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ctr-drbg.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ctr-drbg.js - ctr-drbg for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/ctr-drbg'); 11 | else 12 | module.exports = require('./native/ctr-drbg'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/dsa-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * dsa.js - DSA for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/dsa'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/dsa.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * dsa.js - DSA for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/dsa'); 11 | else 12 | module.exports = require('./native/dsa'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/eb2k-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * eb2k.js - eb2k for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/eb2k'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/eb2k.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * eb2k.js - eb2k for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/eb2k'); 11 | else 12 | module.exports = require('./native/eb2k'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ed25519-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed25519.js - ed25519 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/ed25519'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ed25519.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed25519.js - ed25519 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/ed25519'); 11 | else 12 | module.exports = require('./native/ed25519'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ed448-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed448.js - ed448 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/ed448'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ed448.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed448.js - ed448 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/ed448'); 11 | else 12 | module.exports = require('./native/ed448'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base16-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base16.js - base16 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('../js/base16'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base16.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base16.js - base16 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('../js/base16'); 11 | else 12 | module.exports = require('../native/base16'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base32-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base32.js - base32 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('../js/base32'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base32.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base32.js - base32 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('../js/base32'); 11 | else 12 | module.exports = require('../native/base32'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base58-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base58.js - base58 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('../js/base58'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base58.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base58.js - base58 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('../js/base58'); 11 | else 12 | module.exports = require('../native/base58'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base64-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base64.js - base64 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('../js/base64'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/base64.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base64.js - base64 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('../js/base64'); 11 | else 12 | module.exports = require('../native/base64'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/bech32-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bech32.js - bech32 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const BECH32 = require('../js/bech32'); 10 | module.exports = new BECH32(1); 11 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/bech32.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bech32.js - bech32 for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | let BECH32; 10 | if (process.env.NODE_BACKEND === 'js') 11 | BECH32 = require('../js/bech32'); 12 | else 13 | BECH32 = require('../native/bech32'); 14 | 15 | module.exports = new BECH32(1); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/bech32m-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bech32m.js - bech32m for bcrypto 3 | * Copyright (c) 2021, the bcoin developers (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const BECH32 = require('../js/bech32'); 10 | module.exports = new BECH32(0x2bc830a3); 11 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/bech32m.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bech32m.js - bech32m for bcrypto 3 | * Copyright (c) 2021, the bcoin developers (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | let BECH32; 10 | if (process.env.NODE_BACKEND === 'js') 11 | BECH32 = require('../js/bech32'); 12 | else 13 | BECH32 = require('../native/bech32'); 14 | 15 | module.exports = new BECH32(0x2bc830a3); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/cash32-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cash32.js - cashaddr for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('../js/cash32'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/cash32.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cash32.js - cashaddr for bcrypto 3 | * Copyright (c) 2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('../js/cash32'); 11 | else 12 | module.exports = require('../native/cash32'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/encoding/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * index.js - encoding for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.asn1 = require('./asn1'); 10 | exports.base16 = require('./base16'); 11 | exports.base32 = require('./base32'); 12 | exports.base58 = require('./base58'); 13 | exports.base64 = require('./base64'); 14 | exports.bech32 = require('./bech32'); 15 | exports.cash32 = require('./cash32'); 16 | exports.lines = require('./lines'); 17 | exports.openssl = require('./openssl'); 18 | exports.pem = require('./pem'); 19 | exports.pemcrypt = require('./pemcrypt'); 20 | exports.pkcs1 = require('./pkcs1'); 21 | exports.pkcs3 = require('./pkcs3'); 22 | exports.pkcs5 = require('./pkcs5'); 23 | exports.pkcs8 = require('./pkcs8'); 24 | exports.rfc3279 = require('./rfc3279'); 25 | exports.sec1 = require('./sec1'); 26 | exports.util = require('./util'); 27 | exports.x509 = require('./x509'); 28 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/gost94-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * gost94.js - gost94 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/gost94'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/gost94.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * gost94.js - gost94 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/gost94'); 11 | else 12 | module.exports = require('./native/gost94'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hash-drbg-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hash-drbg.js - hash-drbg for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/hash-drbg'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hash-drbg.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hash-drbg.js - hash-drbg for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/hash-drbg'); 11 | else 12 | module.exports = require('./native/hash-drbg'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hash160-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hash160.js - hash160 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/hash160'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hash160.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hash160.js - hash160 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/hash160'); 11 | else 12 | module.exports = require('./native/hash160'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hash256-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hash256.js - hash256 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/hash256'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hash256.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hash256.js - hash256 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/hash256'); 11 | else 12 | module.exports = require('./native/hash256'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hkdf-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hkdf.js - hkdf for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/hkdf'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hkdf.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hkdf.js - hkdf for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/hkdf'); 11 | else 12 | module.exports = require('./native/hkdf'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hmac-drbg-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hmac-drbg.js - hmac-drbg for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/hmac-drbg'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/hmac-drbg.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hmac-drbg.js - hmac-drbg for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/hmac-drbg'); 11 | else 12 | module.exports = require('./native/hmac-drbg'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/internal/assert.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * assert.js - assert for bcrypto 3 | * Copyright (c) 2020, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /* 10 | * Assert 11 | */ 12 | 13 | function assert(val, msg) { 14 | if (!val) { 15 | const err = new Error(msg || 'Assertion failed'); 16 | 17 | if (Error.captureStackTrace) 18 | Error.captureStackTrace(err, assert); 19 | 20 | throw err; 21 | } 22 | } 23 | 24 | /* 25 | * Expose 26 | */ 27 | 28 | module.exports = assert; 29 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/internal/custom-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * custom.js - custom inspect symbol for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.custom = 'inspect'; 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/internal/custom.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * custom.js - custom inspect symbol for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const {inspect} = require('util'); 10 | 11 | exports.custom = inspect.custom || 'inspect'; 12 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/internal/pgpdf-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * pgpdf.js - pgpdf for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('../js/pgpdf'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/internal/pgpdf.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * pgpdf.js - pgpdf for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('../js/pgpdf'); 11 | else 12 | module.exports = require('../native/pgpdf'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/cleanse.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cleanse.js - memzero for bcrypto 3 | * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('../internal/assert'); 10 | const random = require('../random'); 11 | 12 | /** 13 | * A maybe-secure memzero. 14 | * @param {Buffer} data 15 | */ 16 | 17 | function cleanse(data) { 18 | assert(Buffer.isBuffer(data)); 19 | random.randomFill(data, 0, data.length); 20 | } 21 | 22 | /* 23 | * Static 24 | */ 25 | 26 | cleanse.native = 0; 27 | 28 | /* 29 | * Expose 30 | */ 31 | 32 | module.exports = cleanse; 33 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/ed25519.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed25519.js - ed25519 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | * 6 | * Resources: 7 | * https://en.wikipedia.org/wiki/EdDSA#Ed25519 8 | * https://ed25519.cr.yp.to/ed25519-20110926.pdf 9 | * https://tools.ietf.org/html/rfc8032#section-5.1 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const EDDSA = require('./eddsa'); 15 | const SHA512 = require('../sha512'); 16 | const pre = require('./precomputed/ed25519.json'); 17 | 18 | /* 19 | * Expose 20 | */ 21 | 22 | module.exports = new EDDSA('ED25519', 'X25519', null, SHA512, pre); 23 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/ed448.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed448.js - ed448 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | * 6 | * Resources: 7 | * https://eprint.iacr.org/2015/625.pdf 8 | * https://tools.ietf.org/html/rfc8032#section-5.2 9 | */ 10 | 11 | 'use strict'; 12 | 13 | const EDDSA = require('./eddsa'); 14 | const SHAKE256 = require('../shake256'); 15 | 16 | /* 17 | * Expose 18 | */ 19 | 20 | module.exports = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256); 21 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/p192.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p192.js - ECDSA-P192 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | const SHA256 = require('../sha256'); 11 | 12 | /* 13 | * Expose 14 | */ 15 | 16 | module.exports = new ECDSA('P192', SHA256, SHA256); 17 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/p224.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p224.js - ECDSA-P224 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | const SHA256 = require('../sha256'); 11 | 12 | /* 13 | * Expose 14 | */ 15 | 16 | module.exports = new ECDSA('P224', SHA256, SHA256); 17 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/p256.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p256.js - ECDSA-P256 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | const SHA256 = require('../sha256'); 11 | 12 | /* 13 | * Expose 14 | */ 15 | 16 | module.exports = new ECDSA('P256', SHA256, SHA256); 17 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/p384.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p384.js - ECDSA-P384 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | const SHA384 = require('../sha384'); 11 | 12 | /* 13 | * Expose 14 | */ 15 | 16 | module.exports = new ECDSA('P384', SHA384, SHA384); 17 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/p521.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p521.js - ECDSA-P521 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | const SHA512 = require('../sha512'); 11 | const SHAKE256 = require('../shake256'); 12 | 13 | /* 14 | * Expose 15 | */ 16 | 17 | module.exports = new ECDSA('P521', SHA512, SHAKE256); 18 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/secp256k1.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secp256k1.js - secp256k1 for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | const ECDSA = require('./ecdsa'); 11 | const SHA256 = require('../sha256'); 12 | const pre = require('./precomputed/secp256k1.json'); 13 | 14 | /* 15 | * Expose 16 | */ 17 | 18 | module.exports = new ECDSA('SECP256K1', SHA256, SHA256, pre); 19 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/x25519.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x25519.js - x25519 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | * 6 | * Resources: 7 | * https://en.wikipedia.org/wiki/Curve25519 8 | * https://cr.yp.to/ecdh/curve25519-20060209.pdf 9 | * https://tools.ietf.org/html/rfc7748#section-5 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const ECDH = require('./ecdh'); 15 | const pre = require('./precomputed/ed25519.json'); 16 | 17 | /* 18 | * Expose 19 | */ 20 | 21 | module.exports = new ECDH('X25519', 'ED25519', pre); 22 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/js/x448.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x448.js - x448 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | * 6 | * Resources: 7 | * https://en.wikipedia.org/wiki/Curve448 8 | * https://eprint.iacr.org/2015/625.pdf 9 | * https://tools.ietf.org/html/rfc7748#section-5 10 | */ 11 | 12 | 'use strict'; 13 | 14 | const ECDH = require('./ecdh'); 15 | 16 | /* 17 | * Expose 18 | */ 19 | 20 | module.exports = new ECDH('X448', 'ED448'); 21 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/keccak-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * keccak.js - keccak for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/keccak'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/keccak.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * keccak.js - keccak for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/keccak'); 11 | else 12 | module.exports = require('./native/keccak'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md2-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md2.js - md2 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/md2'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md2.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md2.js - md2 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/md2'); 11 | else 12 | module.exports = require('./native/md2'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md4-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md4.js - md4 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/md4'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md4.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md4.js - md4 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/md4'); 11 | else 12 | module.exports = require('./native/md4'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md5-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md5.js - MD5 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/md5'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md5.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md5.js - MD5 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/md5'); 11 | else 12 | module.exports = require('./native/md5'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md5sha1-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md5sha1.js - md5sha1 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/md5sha1'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/md5sha1.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * md5sha1.js - md5sha1 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/md5sha1'); 11 | else 12 | module.exports = require('./native/md5sha1'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/murmur3-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * murmur3.js - murmur3 hash for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | module.exports = require('./js/murmur3'); 11 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/murmur3.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * murmur3.js - murmur3 hash for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | if (process.env.NODE_BACKEND === 'js') 11 | module.exports = require('./js/murmur3'); 12 | else 13 | module.exports = require('./native/murmur3'); 14 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/arc4.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * arc4.js - ARC4 for javascript 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('../internal/assert'); 10 | const binding = require('./binding'); 11 | 12 | /** 13 | * ARC4 14 | */ 15 | 16 | class ARC4 { 17 | constructor() { 18 | this._handle = binding.arc4_create(); 19 | } 20 | 21 | init(key) { 22 | assert(this instanceof ARC4); 23 | assert(Buffer.isBuffer(key)); 24 | 25 | binding.arc4_init(this._handle, key); 26 | 27 | return this; 28 | } 29 | 30 | encrypt(data) { 31 | assert(this instanceof ARC4); 32 | assert(Buffer.isBuffer(data)); 33 | 34 | binding.arc4_crypt(this._handle, data); 35 | 36 | return data; 37 | } 38 | 39 | destroy() { 40 | assert(this instanceof ARC4); 41 | 42 | binding.arc4_destroy(this._handle); 43 | 44 | return this; 45 | } 46 | } 47 | 48 | /* 49 | * Static 50 | */ 51 | 52 | ARC4.native = 2; 53 | 54 | /* 55 | * Expose 56 | */ 57 | 58 | module.exports = ARC4; 59 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/base58.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * base58.js - base58 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('../internal/assert'); 10 | const binding = require('./binding'); 11 | 12 | /* 13 | * Base58 14 | */ 15 | 16 | function encode(data) { 17 | assert(Buffer.isBuffer(data)); 18 | return binding.base58_encode(data); 19 | } 20 | 21 | function decode(str) { 22 | assert(typeof str === 'string'); 23 | 24 | const {buffer, length} = binding.base58_decode(str); 25 | 26 | return Buffer.from(buffer, 0, length); 27 | } 28 | 29 | function test(str) { 30 | assert(typeof str === 'string'); 31 | return binding.base58_test(str); 32 | } 33 | 34 | /* 35 | * Expose 36 | */ 37 | 38 | exports.native = 2; 39 | exports.encode = encode; 40 | exports.decode = decode; 41 | exports.test = test; 42 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/cleanse.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cleanse.js - memzero for bcrypto 3 | * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('../internal/assert'); 10 | const binding = require('./binding'); 11 | 12 | /* 13 | * Cleanse 14 | */ 15 | 16 | function cleanse(data) { 17 | assert(Buffer.isBuffer(data)); 18 | binding.cleanse(data); 19 | } 20 | 21 | /* 22 | * Static 23 | */ 24 | 25 | cleanse.native = 2; 26 | 27 | /* 28 | * Expose 29 | */ 30 | 31 | module.exports = cleanse; 32 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/eb2k.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * eb2k.js - EVP_BytesToKey for javascript 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('../internal/assert'); 10 | const binding = require('./binding'); 11 | 12 | /* 13 | * EB2K 14 | */ 15 | 16 | function derive(hash, pass, salt, keyLen, ivLen) { 17 | if (typeof pass === 'string') 18 | pass = Buffer.from(pass, 'utf8'); 19 | 20 | if (typeof salt === 'string') 21 | salt = Buffer.from(salt, 'utf8'); 22 | 23 | if (salt == null) 24 | salt = binding.NULL; 25 | 26 | if (ivLen == null) 27 | ivLen = 0; 28 | 29 | assert(Buffer.isBuffer(pass)); 30 | assert(Buffer.isBuffer(salt)); 31 | assert((keyLen >>> 0) === keyLen); 32 | assert((ivLen >>> 0) === ivLen); 33 | 34 | return binding.eb2k_derive(binding.hash(hash), pass, salt, keyLen, ivLen); 35 | } 36 | 37 | /* 38 | * Expose 39 | */ 40 | 41 | exports.native = 2; 42 | exports.derive = derive; 43 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/ed25519.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed25519.js - ed25519 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const EDDSA = require('./eddsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new EDDSA('ED25519'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/ed448.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ed448.js - ed448 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const EDDSA = require('./eddsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new EDDSA('ED448'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/murmur3.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * murmur3.js - murmur3 hash for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | const assert = require('../internal/assert'); 11 | const binding = require('./binding'); 12 | 13 | /* 14 | * Murmur3 15 | */ 16 | 17 | function sum(data, seed) { 18 | assert(Buffer.isBuffer(data)); 19 | return binding.murmur3_sum(data, seed >>> 0); 20 | } 21 | 22 | function tweak(data, n, tweak) { 23 | assert(Buffer.isBuffer(data)); 24 | return binding.murmur3_tweak(data, n >>> 0, tweak >>> 0); 25 | } 26 | 27 | /** 28 | * Expose 29 | */ 30 | 31 | exports.native = 2; 32 | exports.sum = sum; 33 | exports.tweak = tweak; 34 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/p192.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p192.js - ECDSA-P192 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDSA('P192'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/p224.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p224.js - ECDSA-P224 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDSA('P224'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/p256.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p256.js - ECDSA-P256 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDSA('P256'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/p384.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p384.js - ECDSA-P384 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDSA('P384'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/p521.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p521.js - ECDSA-P521 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDSA = require('./ecdsa'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDSA('P521'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/random.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * random.js - random number generator for bcrypto 3 | * Copyright (c) 2014-2020, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.BCRYPTO_FORCE_TORSION !== '1') 10 | module.exports = require('./random-openssl'); 11 | else 12 | module.exports = require('./random-torsion'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/schnorr.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * schnorr.js - schnorr for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const binding = require('./binding'); 10 | 11 | if (binding.USE_SECP256K1 && process.env.BCRYPTO_FORCE_TORSION !== '1') 12 | module.exports = require('./schnorr-libsecp256k1'); 13 | else 14 | module.exports = require('./schnorr-torsion'); 15 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/secp256k1-torsion.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secp256k1-torsion.js - secp256k1 for bcrypto (libtorsion) 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | const ECDSA = require('./ecdsa'); 11 | 12 | /* 13 | * Expose 14 | */ 15 | 16 | module.exports = new ECDSA('SECP256K1'); 17 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/secp256k1.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secp256k1.js - secp256k1 for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | const binding = require('./binding'); 11 | 12 | if (binding.USE_SECP256K1 && process.env.BCRYPTO_FORCE_TORSION !== '1') 13 | module.exports = require('./secp256k1-libsecp256k1'); 14 | else 15 | module.exports = require('./secp256k1-torsion'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/x25519.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x25519.js - x25519 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDH = require('./ecdh'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDH('X25519'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/native/x448.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x448.js - x448 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const ECDH = require('./ecdh'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | module.exports = new ECDH('X448'); 16 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p192-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p192.js - p192 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/p192'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p192.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p192.js - ECDSA-P192 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/p192'); 11 | else 12 | module.exports = require('./native/p192'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p224-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p224.js - p224 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/p224'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p224.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p224.js - ECDSA-P224 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/p224'); 11 | else 12 | module.exports = require('./native/p224'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p256-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p256.js - p256 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/p256'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p256.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p256.js - ECDSA-P256 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/p256'); 11 | else 12 | module.exports = require('./native/p256'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p384-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p384.js - p384 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/p384'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p384.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p384.js - ECDSA-P384 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/p384'); 11 | else 12 | module.exports = require('./native/p384'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p521-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p521.js - p521 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/p521'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/p521.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * p521.js - ECDSA-P521 for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/p521'); 11 | else 12 | module.exports = require('./native/p521'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/pbkdf2-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * pbkdf2.js - pbkdf2 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/pbkdf2'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/pbkdf2.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * pbkdf2.js - pbkdf2 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/pbkdf2'); 11 | else 12 | module.exports = require('./native/pbkdf2'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/poly1305-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * poly1305.js - poly1305 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/poly1305'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/poly1305.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * poly1305.js - poly1305 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/poly1305'); 11 | else 12 | module.exports = require('./native/poly1305'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/random-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * random.js - random for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/random'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/random.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * random.js - random for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./native/random'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ripemd160-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ripemd160.js - ripemd160 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/ripemd160'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/ripemd160.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ripemd160.js - ripemd160 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/ripemd160'); 11 | else 12 | module.exports = require('./native/ripemd160'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/rsa-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * rsa.js - RSA for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/rsa'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/rsa.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * rsa.js - RSA for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/rsa'); 11 | else 12 | module.exports = require('./native/rsa'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/salsa20-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * salsa20.js - salsa20 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/salsa20'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/salsa20.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * salsa20.js - salsa20 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/salsa20'); 11 | else 12 | module.exports = require('./native/salsa20'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/schnorr-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * schnorr.js - schnorr for bcrypto 3 | * Copyright (c) 2020, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/schnorr'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/schnorr.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * schnorr.js - schnorr for bcrypto 3 | * Copyright (c) 2020, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/schnorr'); 11 | else 12 | module.exports = require('./native/schnorr'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/scrypt-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * scrypt.js - scrypt for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/scrypt'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/scrypt.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * scrypt.js - scrypt for bcrypto 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/scrypt'); 11 | else 12 | module.exports = require('./native/scrypt'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/secp256k1-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secp256k1.js - secp256k1 for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | module.exports = require('./js/secp256k1'); 11 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/secp256k1.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secp256k1.js - secp256k1 for bcrypto 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcrypto 6 | */ 7 | 8 | 'use strict'; 9 | 10 | if (process.env.NODE_BACKEND === 'js') 11 | module.exports = require('./js/secp256k1'); 12 | else 13 | module.exports = require('./native/secp256k1'); 14 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/secretbox-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secretbox.js - secretbox for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/secretbox'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/secretbox.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * secretbox.js - secretbox for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/secretbox'); 11 | else 12 | module.exports = require('./native/secretbox'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha1-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha1.js - sha1 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/sha1'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha1.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha1.js - sha1 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/sha1'); 11 | else 12 | module.exports = require('./native/sha1'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha224-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha224.js - SHA224 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/sha224'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha224.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha224.js - SHA224 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/sha224'); 11 | else 12 | module.exports = require('./native/sha224'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha256-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha256.js - sha256 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/sha256'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha256.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha256.js - sha256 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/sha256'); 11 | else 12 | module.exports = require('./native/sha256'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha3-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha3.js - sha3 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/sha3'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha3.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha3.js - sha3 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/sha3'); 11 | else 12 | module.exports = require('./native/sha3'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha384-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha384.js - SHA384 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/sha384'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha384.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha384.js - SHA384 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/sha384'); 11 | else 12 | module.exports = require('./native/sha384'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha512-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha512.js - sha512 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/sha512'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/sha512.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * sha512.js - sha512 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/sha512'); 11 | else 12 | module.exports = require('./native/sha512'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/siphash-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * siphash.js - siphash for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/siphash'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/siphash.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * siphash.js - siphash for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/siphash'); 11 | else 12 | module.exports = require('./native/siphash'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/whirlpool-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * whirlpool.js - whirlpool for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/whirlpool'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/whirlpool.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * whirlpool.js - whirlpool for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/whirlpool'); 11 | else 12 | module.exports = require('./native/whirlpool'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/x25519-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x25519.js - x25519 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/x25519'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/x25519.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x25519.js - x25519 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/x25519'); 11 | else 12 | module.exports = require('./native/x25519'); 13 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/x448-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x448.js - x448 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./js/x448'); 10 | -------------------------------------------------------------------------------- /node_modules/bcrypto/lib/x448.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * x448.js - x448 for bcrypto 3 | * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcrypto 5 | */ 6 | 7 | 'use strict'; 8 | 9 | if (process.env.NODE_BACKEND === 'js') 10 | module.exports = require('./js/x448'); 11 | else 12 | module.exports = require('./native/x448'); 13 | -------------------------------------------------------------------------------- /node_modules/bcurl/README.md: -------------------------------------------------------------------------------- 1 | # bcurl 2 | 3 | A minimal web client. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const bcurl = require('bcurl'); 9 | 10 | const client = bcurl.client('http://localhost:8080'); 11 | const socket = await client.connect(); 12 | 13 | socket.send('hello', 'world'); 14 | 15 | // Rest 16 | const json = await client.get('/foobar'); 17 | console.log(json); 18 | 19 | // JSON-RPC 20 | const json = await client.execute('/', 'method', {}); 21 | 22 | ``` 23 | 24 | ## Contribution and License Agreement 25 | 26 | If you contribute code to this project, you are implicitly allowing your code 27 | to be distributed under the MIT license. You are also implicitly verifying that 28 | all code is your original work. `` 29 | 30 | ## License 31 | 32 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 33 | 34 | See LICENSE for more info. 35 | -------------------------------------------------------------------------------- /node_modules/bcurl/lib/bcurl.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bcurl.js - simple http client 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcurl 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const Client = require('./client'); 10 | 11 | exports.Client = Client; 12 | exports.client = options => new Client(options); 13 | -------------------------------------------------------------------------------- /node_modules/bdb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CMakeLists.txt - cmake build for leveldown 2 | # Copyright (c) 2020, Christopher Jeffrey (MIT License). 3 | # https://github.com/bcoin-org/bdb 4 | 5 | cmake_minimum_required(VERSION 3.4) 6 | project(leveldown LANGUAGES CXX) 7 | 8 | include(NodeJS) 9 | 10 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 11 | set(CMAKE_CXX_EXTENSIONS ON) 12 | set(CMAKE_CXX_STANDARD 11) 13 | 14 | if(MSVC) 15 | add_compile_options(/wd4018 16 | /wd4244 17 | /wd4267 18 | /wd4355 19 | /wd4506 20 | /wd4530 21 | /wd4722 22 | /wd4996) 23 | endif() 24 | 25 | add_subdirectory(deps/leveldb) 26 | 27 | add_node_module(leveldown src/binding.cc) 28 | target_include_directories(leveldown PRIVATE ${PROJECT_SOURCE_DIR}/src) 29 | target_link_libraries(leveldown PRIVATE leveldb) 30 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/db/builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_BUILDER_H_ 6 | #define STORAGE_LEVELDB_DB_BUILDER_H_ 7 | 8 | #include "leveldb/status.h" 9 | 10 | namespace leveldb { 11 | 12 | struct Options; 13 | struct FileMetaData; 14 | 15 | class Env; 16 | class Iterator; 17 | class TableCache; 18 | class VersionEdit; 19 | 20 | // Build a Table file from the contents of *iter. The generated file 21 | // will be named according to meta->number. On success, the rest of 22 | // *meta will be filled with metadata about the generated table. 23 | // If no data is present in *iter, meta->file_size will be set to 24 | // zero, and no Table file will be produced. 25 | Status BuildTable(const std::string& dbname, Env* env, const Options& options, 26 | TableCache* table_cache, Iterator* iter, FileMetaData* meta); 27 | 28 | } // namespace leveldb 29 | 30 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 31 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | 10 | #include "db/dbformat.h" 11 | #include "leveldb/db.h" 12 | 13 | namespace leveldb { 14 | 15 | class DBImpl; 16 | 17 | // Return a new iterator that converts internal keys (yielded by 18 | // "*internal_iter") that were live at the specified "sequence" number 19 | // into appropriate user keys. 20 | Iterator* NewDBIterator(DBImpl* db, const Comparator* user_key_comparator, 21 | Iterator* internal_iter, SequenceNumber sequence, 22 | uint32_t seed); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 27 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/db/log_format.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Log format information shared by reader and writer. 6 | // See ../doc/log_format.md for more detail. 7 | 8 | #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 9 | #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 10 | 11 | namespace leveldb { 12 | namespace log { 13 | 14 | enum RecordType { 15 | // Zero is reserved for preallocated files 16 | kZeroType = 0, 17 | 18 | kFullType = 1, 19 | 20 | // For fragments 21 | kFirstType = 2, 22 | kMiddleType = 3, 23 | kLastType = 4 24 | }; 25 | static const int kMaxRecordType = kLastType; 26 | 27 | static const int kBlockSize = 32768; 28 | 29 | // Header is checksum (4 bytes), length (2 bytes), type (1 byte). 30 | static const int kHeaderSize = 4 + 2 + 1; 31 | 32 | } // namespace log 33 | } // namespace leveldb 34 | 35 | #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 36 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | #include "leveldb/export.h" 9 | 10 | namespace leveldb { 11 | 12 | class Env; 13 | 14 | // Returns a new environment that stores its data in memory and delegates 15 | // all non-file-storage tasks to base_env. The caller must delete the result 16 | // when it is no longer needed. 17 | // *base_env must remain live while the result is in use. 18 | LEVELDB_EXPORT Env* NewMemEnv(Env* base_env); 19 | 20 | } // namespace leveldb 21 | 22 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 23 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/include/leveldb/dumpfile.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 6 | #define STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 7 | 8 | #include 9 | 10 | #include "leveldb/env.h" 11 | #include "leveldb/export.h" 12 | #include "leveldb/status.h" 13 | 14 | namespace leveldb { 15 | 16 | // Dump the contents of the file named by fname in text format to 17 | // *dst. Makes a sequence of dst->Append() calls; each call is passed 18 | // the newline-terminated text corresponding to a single item found 19 | // in the file. 20 | // 21 | // Returns a non-OK result if fname does not name a leveldb storage 22 | // file, or if the file cannot be read. 23 | LEVELDB_EXPORT Status DumpFile(Env* env, const std::string& fname, 24 | WritableFile* dst); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 29 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/include/leveldb/export.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_INCLUDE_EXPORT_H_ 6 | #define STORAGE_LEVELDB_INCLUDE_EXPORT_H_ 7 | 8 | #if !defined(LEVELDB_EXPORT) 9 | 10 | #if defined(LEVELDB_SHARED_LIBRARY) 11 | #if defined(_WIN32) 12 | 13 | #if defined(LEVELDB_COMPILE_LIBRARY) 14 | #define LEVELDB_EXPORT __declspec(dllexport) 15 | #else 16 | #define LEVELDB_EXPORT __declspec(dllimport) 17 | #endif // defined(LEVELDB_COMPILE_LIBRARY) 18 | 19 | #else // defined(_WIN32) 20 | #if defined(LEVELDB_COMPILE_LIBRARY) 21 | #define LEVELDB_EXPORT __attribute__((visibility("default"))) 22 | #else 23 | #define LEVELDB_EXPORT 24 | #endif 25 | #endif // defined(_WIN32) 26 | 27 | #else // defined(LEVELDB_SHARED_LIBRARY) 28 | #define LEVELDB_EXPORT 29 | #endif 30 | 31 | #endif // !defined(LEVELDB_EXPORT) 32 | 33 | #endif // STORAGE_LEVELDB_INCLUDE_EXPORT_H_ 34 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) || defined(LEVELDB_PLATFORM_WINDOWS) 14 | #include "port/port_stdcxx.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | #include "port/port_chromium.h" 17 | #endif 18 | 19 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 20 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | Iterator* NewMergingIterator(const Comparator* comparator, Iterator** children, 22 | int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/util/env_posix_test_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 6 | #define STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class EnvPosixTest; 11 | 12 | // A helper for the POSIX Env to facilitate testing. 13 | class EnvPosixTestHelper { 14 | private: 15 | friend class EnvPosixTest; 16 | 17 | // Set the maximum number of read-only files that will be opened. 18 | // Must be called before creating an Env. 19 | static void SetReadOnlyFDLimit(int limit); 20 | 21 | // Set the maximum number of read-only files that will be mapped via mmap. 22 | // Must be called before creating an Env. 23 | static void SetReadOnlyMMapLimit(int limit); 24 | }; 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 29 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/util/env_windows_test_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 (c) The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_ENV_WINDOWS_TEST_HELPER_H_ 6 | #define STORAGE_LEVELDB_UTIL_ENV_WINDOWS_TEST_HELPER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class EnvWindowsTest; 11 | 12 | // A helper for the Windows Env to facilitate testing. 13 | class EnvWindowsTestHelper { 14 | private: 15 | friend class CorruptionTest; 16 | friend class EnvWindowsTest; 17 | 18 | // Set the maximum number of read-only files that will be mapped via mmap. 19 | // Must be called before creating an Env. 20 | static void SetReadOnlyMMapLimit(int limit); 21 | }; 22 | 23 | } // namespace leveldb 24 | 25 | #endif // STORAGE_LEVELDB_UTIL_ENV_WINDOWS_TEST_HELPER_H_ 26 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() {} 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } // namespace leveldb 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/util/histogram.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 6 | #define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 7 | 8 | #include 9 | 10 | namespace leveldb { 11 | 12 | class Histogram { 13 | public: 14 | Histogram() {} 15 | ~Histogram() {} 16 | 17 | void Clear(); 18 | void Add(double value); 19 | void Merge(const Histogram& other); 20 | 21 | std::string ToString() const; 22 | 23 | private: 24 | enum { kNumBuckets = 154 }; 25 | 26 | double Median() const; 27 | double Percentile(double p) const; 28 | double Average() const; 29 | double StandardDeviation() const; 30 | 31 | static const double kBucketLimit[kNumBuckets]; 32 | 33 | double min_; 34 | double max_; 35 | double num_; 36 | double sum_; 37 | double sum_squares_; 38 | 39 | double buckets_[kNumBuckets]; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 45 | -------------------------------------------------------------------------------- /node_modules/bdb/deps/leveldb/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() : comparator(BytewiseComparator()), env(Env::Default()) {} 13 | 14 | } // namespace leveldb 15 | -------------------------------------------------------------------------------- /node_modules/bdb/lib/bdb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bdb.js - database backend for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('bsert'); 10 | const DB = require('./db'); 11 | const Key = require('./key'); 12 | const MemDB = require('./memdb'); 13 | const Level = require('./level'); 14 | 15 | exports.DB = DB; 16 | exports.Key = Key; 17 | 18 | exports.create = (options) => { 19 | if (options == null) 20 | options = {}; 21 | 22 | if (typeof options === 'string') 23 | options = { location: options }; 24 | 25 | assert(options && typeof options === 'object'); 26 | 27 | const {memory, location} = options; 28 | 29 | if (memory) 30 | return new DB(MemDB, 'memory', options); 31 | 32 | return new DB(Level, location, options); 33 | }; 34 | 35 | exports.key = (id, args) => new Key(id, args); 36 | -------------------------------------------------------------------------------- /node_modules/bdns/README.md: -------------------------------------------------------------------------------- 1 | # bdns 2 | 3 | DNS wrapper for node.js. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const dns = require('bdns'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bdns/lib/bdns.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bdns.js - dns backend for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./dns'); 10 | -------------------------------------------------------------------------------- /node_modules/bevent/README.md: -------------------------------------------------------------------------------- 1 | # bevent 2 | 3 | Async event emitter for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const AsyncEmitter = require('bevent'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bevent/lib/bevent.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bevent.js - event emitter which resolves promises. 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./asyncemitter'); 10 | -------------------------------------------------------------------------------- /node_modules/bevent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bevent", 3 | "version": "0.1.5", 4 | "description": "Async event emitter for javascript", 5 | "keywords": [ 6 | "emitter", 7 | "event", 8 | "events" 9 | ], 10 | "license": "MIT", 11 | "repository": "git://github.com/bcoin-org/bevent.git", 12 | "homepage": "https://github.com/bcoin-org/bevent", 13 | "bugs": { 14 | "url": "https://github.com/bcoin-org/bevent/issues" 15 | }, 16 | "author": "Christopher Jeffrey ", 17 | "main": "./lib/bevent.js", 18 | "scripts": { 19 | "lint": "eslint lib/ test/ || exit 0", 20 | "test": "bmocha --reporter spec test/*-test.js" 21 | }, 22 | "dependencies": { 23 | "bsert": "~0.0.10" 24 | }, 25 | "devDependencies": { 26 | "bmocha": "^2.1.0" 27 | }, 28 | "engines": { 29 | "node": ">=8.0.0" 30 | }, 31 | "_from": "git+https://github.com/bcoin-org/bevent.git#semver:~0.1.5", 32 | "_resolved": "git+https://github.com/bcoin-org/bevent.git#60fb503de3ea1292d29ce438bfba80f0bc5ccb60", 33 | "_commit": "60fb503de3ea1292d29ce438bfba80f0bc5ccb60" 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/bfile/lib/backend.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * backend.js - backend selection for bfile 3 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const features = require('./features'); 10 | 11 | /* 12 | * Expose 13 | */ 14 | 15 | if (features.HAS_ALL) 16 | module.exports = require('./modern'); 17 | else 18 | module.exports = require('./legacy'); 19 | -------------------------------------------------------------------------------- /node_modules/bfile/lib/bfile.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bfile.js - promisified fs module 3 | * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bfile 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /* 10 | * Expose 11 | */ 12 | 13 | module.exports = require('./fs'); 14 | -------------------------------------------------------------------------------- /node_modules/bfile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bfile", 3 | "version": "0.2.2", 4 | "description": "Filesystem wrapper for node.js", 5 | "keywords": [ 6 | "file", 7 | "fs" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/bfile.git", 11 | "homepage": "https://github.com/bcoin-org/bfile", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/bfile/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/bfile.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha -e BFILE_FORCE_COMPAT=1 && bmocha && bmocha -e BFILE_FORCE_STABLE=1" 20 | }, 21 | "devDependencies": { 22 | "bmocha": "^2.1.0" 23 | }, 24 | "engines": { 25 | "node": ">=8.0.0" 26 | }, 27 | "browser": { 28 | "./lib/fs": "./lib/fs-browser.js" 29 | }, 30 | "_from": "git+https://github.com/bcoin-org/bfile.git#semver:~0.2.1", 31 | "_resolved": "git+https://github.com/bcoin-org/bfile.git#c3075133a02830dc384f8353d8275d4499b8bff9", 32 | "_commit": "c3075133a02830dc384f8353d8275d4499b8bff9" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/bfilter/README.md: -------------------------------------------------------------------------------- 1 | # bfilter 2 | 3 | Bloom filters for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const bfilter = require('bfilter'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bfilter/lib/bfilter.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bfilter.js - bloom filters for javascript 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const BloomFilter = require('./bloom'); 10 | const RollingFilter = require('./rolling'); 11 | 12 | exports.BloomFilter = BloomFilter; 13 | exports.RollingFilter = RollingFilter; 14 | -------------------------------------------------------------------------------- /node_modules/bheep/README.md: -------------------------------------------------------------------------------- 1 | # bheep 2 | 3 | Binary heap for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const Heap = require('bheep'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bheep/lib/bheep.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./heap'); 4 | -------------------------------------------------------------------------------- /node_modules/bheep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bheep", 3 | "version": "0.1.5", 4 | "description": "Binary heap for javascript", 5 | "keywords": [ 6 | "binary", 7 | "heap" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/bheep.git", 11 | "homepage": "https://github.com/bcoin-org/bheep", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/bheep/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/bheep.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "dependencies": { 22 | "bsert": "~0.0.10" 23 | }, 24 | "devDependencies": { 25 | "bmocha": "^2.1.0" 26 | }, 27 | "engines": { 28 | "node": ">=8.0.0" 29 | }, 30 | "_from": "git+https://github.com/bcoin-org/bheep.git#semver:~0.1.5", 31 | "_resolved": "git+https://github.com/bcoin-org/bheep.git#e59329d0a776ae71b2fb7a2876ee5b9fd3030fa2", 32 | "_commit": "e59329d0a776ae71b2fb7a2876ee5b9fd3030fa2" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/binet/README.md: -------------------------------------------------------------------------------- 1 | # binet 2 | 3 | [![Build Status][ci-status-img]][ci-status-url] 4 | [![Coverage Status][coverage-status-img]][coverage-status-url] 5 | 6 | IP address tools for javascript. 7 | 8 | ## Usage 9 | 10 | ``` js 11 | const binet = require('binet'); 12 | ``` 13 | 14 | ## Contribution and License Agreement 15 | 16 | If you contribute code to this project, you are implicitly allowing your code 17 | to be distributed under the MIT license. You are also implicitly verifying that 18 | all code is your original work. `` 19 | 20 | ## License 21 | 22 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 23 | 24 | See LICENSE for more info. 25 | 26 | [ci-status-img]: https://github.com/bcoin-org/binet/workflows/Build/badge.svg 27 | [ci-status-url]: https://github.com/bcoin-org/binet/tree/master 28 | [coverage-status-img]: https://coveralls.io/repos/github/bcoin-org/binet/badge.svg?branch=master 29 | [coverage-status-url]: https://coveralls.io/github/bcoin-org/binet?branch=master 30 | -------------------------------------------------------------------------------- /node_modules/binet/lib/binet.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./ip'); 4 | -------------------------------------------------------------------------------- /node_modules/blgr/lib/blgr.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * blgr.js - basic logger for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./logger'); 10 | -------------------------------------------------------------------------------- /node_modules/blgr/lib/fs-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.unsupported = true; 4 | -------------------------------------------------------------------------------- /node_modules/blgr/lib/fs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const fs = require('fs'); 4 | 5 | function promisify(func) { 6 | return function(...args) { 7 | return new Promise((resolve, reject) => { 8 | args.push(wrap(resolve, reject)); 9 | func.call(this, ...args); 10 | }); 11 | }; 12 | } 13 | 14 | function wrap(resolve, reject) { 15 | return function(err, result) { 16 | if (err) { 17 | reject(err); 18 | return; 19 | } 20 | resolve(result); 21 | }; 22 | } 23 | 24 | exports.stat = promisify(fs.stat); 25 | exports.open = promisify(fs.open); 26 | exports.close = promisify(fs.close); 27 | exports.read = promisify(fs.read); 28 | exports.write = promisify(fs.write); 29 | exports.ftruncate = promisify(fs.ftruncate); 30 | exports.createWriteStream = fs.createWriteStream; 31 | exports.mkdir = promisify(fs.mkdir); 32 | exports.rename = promisify(fs.rename); 33 | exports.readdir = promisify(fs.readdir); 34 | exports.stat = promisify(fs.stat); 35 | exports.unlink = promisify(fs.unlink); 36 | -------------------------------------------------------------------------------- /node_modules/blgr/lib/inspect-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function inspect(obj) { 4 | if (obj === undefined) 5 | return 'undefined'; 6 | 7 | if (obj !== obj) 8 | return 'NaN'; 9 | 10 | try { 11 | return JSON.stringify(obj, null, 2); 12 | } catch (e) { 13 | return '{}'; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /node_modules/blgr/lib/inspect.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('util').inspect; 4 | -------------------------------------------------------------------------------- /node_modules/blru/README.md: -------------------------------------------------------------------------------- 1 | # blru 2 | 3 | LRU cache for node.js. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const blru = require('blru'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/blru/lib/blru.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./lru'); 4 | -------------------------------------------------------------------------------- /node_modules/blru/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blru", 3 | "version": "0.1.6", 4 | "description": "LRU cache for node.js", 5 | "keywords": [ 6 | "cache", 7 | "lru" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/blru.git", 11 | "homepage": "https://github.com/bcoin-org/blru", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/blru/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/blru.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "dependencies": { 22 | "bsert": "~0.0.10" 23 | }, 24 | "devDependencies": { 25 | "bmocha": "^2.1.0" 26 | }, 27 | "engines": { 28 | "node": ">=8.0.0" 29 | }, 30 | "_from": "git+https://github.com/bcoin-org/blru.git#semver:~0.1.6", 31 | "_resolved": "git+https://github.com/bcoin-org/blru.git#c2c093e9475439333dfb87bfb2fdc3be6c98b080", 32 | "_commit": "c2c093e9475439333dfb87bfb2fdc3be6c98b080" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/blst/README.md: -------------------------------------------------------------------------------- 1 | # blst 2 | 3 | Double linked list for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const List = require('blst'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/blst/lib/blst.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./list'); 4 | -------------------------------------------------------------------------------- /node_modules/blst/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blst", 3 | "version": "0.1.5", 4 | "description": "Double linked list for javascript", 5 | "keywords": [ 6 | "list" 7 | ], 8 | "license": "MIT", 9 | "repository": "git://github.com/bcoin-org/blst.git", 10 | "homepage": "https://github.com/bcoin-org/blst", 11 | "bugs": { 12 | "url": "https://github.com/bcoin-org/blst/issues" 13 | }, 14 | "author": "Christopher Jeffrey ", 15 | "main": "./lib/blst.js", 16 | "scripts": { 17 | "lint": "eslint lib/ test/ || exit 0", 18 | "test": "bmocha --reporter spec test/*-test.js" 19 | }, 20 | "dependencies": { 21 | "bsert": "~0.0.10" 22 | }, 23 | "devDependencies": { 24 | "bmocha": "^2.1.0" 25 | }, 26 | "engines": { 27 | "node": ">=8.0.0" 28 | }, 29 | "_from": "git+https://github.com/bcoin-org/blst.git#semver:~0.1.5", 30 | "_resolved": "git+https://github.com/bcoin-org/blst.git#d588403edb18e628899e05aeba8c3a98a5cdedff", 31 | "_commit": "d588403edb18e628899e05aeba8c3a98a5cdedff" 32 | } 33 | -------------------------------------------------------------------------------- /node_modules/bmocha/etc/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/node_modules/bmocha/etc/error.png -------------------------------------------------------------------------------- /node_modules/bmocha/etc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/node_modules/bmocha/etc/favicon.ico -------------------------------------------------------------------------------- /node_modules/bmocha/etc/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/node_modules/bmocha/etc/ok.png -------------------------------------------------------------------------------- /node_modules/bmocha/lib/import.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * import.js - import for bmocha 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bmocha 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /* 10 | * Imports 11 | */ 12 | 13 | async function imports(url) { 14 | return import(url); 15 | } 16 | 17 | /* 18 | * Static 19 | */ 20 | 21 | imports.supported = process.execArgv.includes('--experimental-modules'); 22 | 23 | /* 24 | * Expose 25 | */ 26 | 27 | module.exports = imports; 28 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/imports.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * imports.js - import shim for bmocha 3 | * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bmocha 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /* 10 | * Imports 11 | */ 12 | 13 | let imports = null; 14 | 15 | try { 16 | imports = require('./import'); 17 | } catch (e) { 18 | ; 19 | } 20 | 21 | /* 22 | * Fallback 23 | */ 24 | 25 | if (!imports) { 26 | imports = async function imports(url) { 27 | throw new Error('Not supported'); 28 | }; 29 | 30 | imports.supported = false; 31 | } 32 | 33 | /* 34 | * Helpers 35 | */ 36 | 37 | imports.pathToFileURL = function pathToFileURL(path) { 38 | const url = require('url'); 39 | 40 | if (url.pathToFileURL) 41 | return url.pathToFileURL(path).href; 42 | 43 | return path; 44 | }; 45 | 46 | /* 47 | * Expose 48 | */ 49 | 50 | module.exports = imports; 51 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/server/templates/bmocha.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | __TITLE__ 5 | 15 | 16 | 17 |
Loading...
18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/server/templates/bmocha.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global __REQUIRES__ */ 4 | /* global __FUNCTIONS__ */ 5 | /* global __OPTIONS__ */ 6 | /* global document */ 7 | 8 | const bmocha = require('../../bmocha'); 9 | const common = require('./common'); 10 | const {Mocha, DOMStream} = bmocha; 11 | 12 | /* 13 | * Constants 14 | */ 15 | 16 | const options = __OPTIONS__; 17 | 18 | const body = document.getElementById('bmocha'); 19 | const stream = new DOMStream(body); 20 | 21 | /* 22 | * Mocha 23 | */ 24 | 25 | options.stream = stream; 26 | options.delay = true; 27 | 28 | const mocha = new Mocha(options); 29 | 30 | if (options.growl) 31 | mocha.notify = common.notify; 32 | 33 | if (!options.allowUncaught) 34 | mocha.catcher = common.catcher; 35 | 36 | /* 37 | * Execute 38 | */ 39 | 40 | __REQUIRES__; 41 | 42 | const funcs = [ 43 | __FUNCTIONS__ 44 | ]; 45 | 46 | mocha.run(funcs).catch((err) => { 47 | stream.write(err.stack + '\n'); 48 | }); 49 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/server/templates/code.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | __TITLE__ 5 | 20 | 21 | __MSG__ 22 | 23 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/server/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | __TITLE__ 5 | 12 | 13 | 14 |

__MSG__

15 | 16 | 17 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/server/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | __TITLE__ 5 | 15 | 16 | 17 |
Loading...
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /node_modules/bmocha/lib/server/templates/stack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* global __MSG__ */ 4 | /* global document */ 5 | 6 | document.body.innerHTML += __MSG__; 7 | -------------------------------------------------------------------------------- /node_modules/bmutex/README.md: -------------------------------------------------------------------------------- 1 | # bmutex 2 | 3 | Mutex locks for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const {Lock} = require('bmutex'); 9 | const lock = Lock.create(); 10 | 11 | async function doSomething() { 12 | const unlock = await lock(); 13 | try { 14 | await _doSomething(); 15 | } finally { 16 | unlock(); 17 | } 18 | } 19 | 20 | async function _doSomething() { 21 | // actually do something async 22 | } 23 | ``` 24 | 25 | ## Contribution and License Agreement 26 | 27 | If you contribute code to this project, you are implicitly allowing your code 28 | to be distributed under the MIT license. You are also implicitly verifying that 29 | all code is your original work. `` 30 | 31 | ## License 32 | 33 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 34 | 35 | See LICENSE for more info. 36 | -------------------------------------------------------------------------------- /node_modules/bmutex/lib/bmutex.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bmutex.js - lock and queue for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.Lock = require('./lock'); 10 | exports.MapLock = require('./maplock'); 11 | -------------------------------------------------------------------------------- /node_modules/bmutex/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bmutex", 3 | "version": "0.1.6", 4 | "description": "Mutex locks for javascript", 5 | "keywords": [ 6 | "lock", 7 | "mutex" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/bmutex.git", 11 | "homepage": "https://github.com/bcoin-org/bmutex", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/bmutex/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/bmutex.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "dependencies": { 22 | "bsert": "~0.0.10" 23 | }, 24 | "devDependencies": { 25 | "bmocha": "^2.1.0" 26 | }, 27 | "engines": { 28 | "node": ">=8.0.0" 29 | }, 30 | "_from": "git+https://github.com/bcoin-org/bmutex.git#semver:~0.1.6", 31 | "_resolved": "git+https://github.com/bcoin-org/bmutex.git#e50782323932a4946ecc05a74c6d45861adc2c25", 32 | "_commit": "e50782323932a4946ecc05a74c6d45861adc2c25" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/brq/README.md: -------------------------------------------------------------------------------- 1 | # brq 2 | 3 | A minimal request module. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const brq = require('brq'); 9 | const res = await brq('google.com'); 10 | console.log(res.text()); 11 | ``` 12 | 13 | ## Contribution and License Agreement 14 | 15 | If you contribute code to this project, you are implicitly allowing your code 16 | to be distributed under the MIT license. You are also implicitly verifying that 17 | all code is your original work. `` 18 | 19 | ## License 20 | 21 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 22 | 23 | See LICENSE for more info. 24 | -------------------------------------------------------------------------------- /node_modules/brq/lib/brq.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * brq.js - simple request module 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/brq 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./request'); 10 | -------------------------------------------------------------------------------- /node_modules/brq/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "brq", 3 | "version": "0.1.8", 4 | "description": "Request bike-shed", 5 | "keywords": [ 6 | "http", 7 | "request" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/brq.git", 11 | "homepage": "https://github.com/bcoin-org/brq", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/brq/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/brq.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "dependencies": { 22 | "bsert": "~0.0.10" 23 | }, 24 | "devDependencies": { 25 | "bmocha": "^2.1.0" 26 | }, 27 | "engines": { 28 | "node": ">=8.0.0" 29 | }, 30 | "browser": { 31 | "./lib/request": "./lib/request-browser.js" 32 | }, 33 | "_from": "git+https://github.com/bcoin-org/brq.git#semver:~0.1.8", 34 | "_resolved": "git+https://github.com/bcoin-org/brq.git#534bb2c83fb366ba40ad80bc3de796a174503294", 35 | "_commit": "534bb2c83fb366ba40ad80bc3de796a174503294" 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/bs32/README.md: -------------------------------------------------------------------------------- 1 | # bs32 2 | 3 | Base32 for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const base32 = require('bs32'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bs32/lib/bs32.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./base32'); 4 | -------------------------------------------------------------------------------- /node_modules/bs32/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bs32", 3 | "version": "0.1.6", 4 | "description": "Base32 for javascript", 5 | "keywords": [ 6 | "base32" 7 | ], 8 | "license": "MIT", 9 | "repository": "git://github.com/bcoin-org/bs32.git", 10 | "homepage": "https://github.com/bcoin-org/bs32", 11 | "bugs": { 12 | "url": "https://github.com/bcoin-org/bs32/issues" 13 | }, 14 | "author": "Christopher Jeffrey ", 15 | "main": "./lib/bs32.js", 16 | "scripts": { 17 | "lint": "eslint lib/ test/ || exit 0", 18 | "test": "bmocha --reporter spec test/*-test.js" 19 | }, 20 | "dependencies": { 21 | "bsert": "~0.0.10" 22 | }, 23 | "devDependencies": { 24 | "bmocha": "^2.1.0" 25 | }, 26 | "engines": { 27 | "node": ">=8.0.0" 28 | }, 29 | "_from": "git+https://github.com/bcoin-org/bs32.git#semver:=0.1.6", 30 | "_resolved": "git+https://github.com/bcoin-org/bs32.git#21cf9c724659dc15df722d2410548828c142f265", 31 | "_commit": "21cf9c724659dc15df722d2410548828c142f265" 32 | } 33 | -------------------------------------------------------------------------------- /node_modules/bsert/README.md: -------------------------------------------------------------------------------- 1 | # bsert 2 | 3 | Minimal assert with type checking. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const assert = require('bsert'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2018, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bsert/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bsert", 3 | "version": "0.0.10", 4 | "description": "Minimal assert with type checking", 5 | "keywords": [ 6 | "assert" 7 | ], 8 | "license": "MIT", 9 | "repository": "git://github.com/chjj/bsert.git", 10 | "homepage": "https://github.com/chjj/bsert", 11 | "bugs": { 12 | "url": "https://github.com/chjj/bsert/issues" 13 | }, 14 | "author": "Christopher Jeffrey ", 15 | "main": "./lib/assert.js", 16 | "scripts": { 17 | "lint": "eslint lib/ test/ || exit 0", 18 | "test": "bmocha --reporter spec test/*-test.js" 19 | }, 20 | "engines": { 21 | "node": ">=8.0.0" 22 | }, 23 | "_from": "git+https://github.com/chjj/bsert.git#semver:~0.0.10", 24 | "_resolved": "git+https://github.com/chjj/bsert.git#bd09d49eab8644bca08ae8259a3d8756e7d453fc", 25 | "_commit": "bd09d49eab8644bca08ae8259a3d8756e7d453fc" 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/backend-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | Client: global.WebSocket || global.MozWebSocket, 5 | EventSource: global.EventSource 6 | }; 7 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/backend.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('../vendor/faye-websocket'); 4 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/blacklist.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | connect: true, 5 | connect_error: true, 6 | connect_timeout: true, 7 | connecting: true, 8 | disconnect: true, 9 | error: true, 10 | reconnect: true, 11 | reconnect_attempt: true, 12 | reconnect_failed: true, 13 | reconnect_error: true, 14 | reconnecting: true, 15 | ping: true, 16 | pong: true 17 | }; 18 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/bsock.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const WebSocket = require('./backend'); 4 | const Server = require('./server'); 5 | const Socket = require('./socket'); 6 | 7 | exports.WebSocket = WebSocket; 8 | exports.Server = Server; 9 | exports.server = () => new Server(); 10 | exports.createServer = Server.createServer.bind(Server); 11 | exports.attach = Server.attach.bind(Server); 12 | exports.Socket = Socket; 13 | exports.socket = () => new Socket(); 14 | exports.connect = Socket.connect.bind(Socket); 15 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/codes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent 4 | module.exports = { 5 | 1000: 'NORMAL_CLOSURE', 6 | 1001: 'GOING_AWAY', 7 | 1002: 'PROTOCOL_ERROR', 8 | 1003: 'UNSUPPORTED_DATA', 9 | 1004: 'RESERVED', 10 | 1005: 'NO_STATUS_RECVD', 11 | 1006: 'ABNORMAL_CLOSURE', 12 | 1007: 'INVALID_FRAME_PAYLOAD_DATA', 13 | 1008: 'POLICY_VIOLATION', 14 | 1009: 'MESSAGE_TOO_BIG', 15 | 1010: 'MISSING_EXTENSION', 16 | 1011: 'INTERNAL_ERROR', 17 | 1012: 'SERVICE_RESTART', 18 | 1013: 'TRY_AGAIN_LATER', 19 | 1014: 'BAD_GATEWAY', 20 | 1015: 'TLS_HANDSHAKE' 21 | }; 22 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/server-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const EventEmitter = require('events'); 4 | 5 | class Server extends EventEmitter { 6 | constructor(options) { 7 | super(); 8 | 9 | this.sockets = new Set(); 10 | this.channels = new Map(); 11 | this.mounts = []; 12 | } 13 | 14 | attach() { 15 | return this; 16 | } 17 | 18 | mount() {} 19 | 20 | async open() {} 21 | 22 | async close() {} 23 | 24 | join() { 25 | return true; 26 | } 27 | 28 | leave() { 29 | return true; 30 | } 31 | 32 | channel() { 33 | return null; 34 | } 35 | 36 | to() {} 37 | 38 | all() {} 39 | 40 | static attach(parent, options) { 41 | const server = new this(options); 42 | return server.attach(parent); 43 | } 44 | 45 | static createServer(options) { 46 | return new this(options); 47 | } 48 | } 49 | 50 | module.exports = Server; 51 | -------------------------------------------------------------------------------- /node_modules/bsock/lib/util.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const assert = require('bsert'); 4 | const URL = require('url'); 5 | 6 | exports.parseURL = function parseURL(url) { 7 | if (url.indexOf('://') === -1) 8 | url = `ws://${url}`; 9 | 10 | const data = URL.parse(url); 11 | 12 | if (data.protocol !== 'http:' 13 | && data.protocol !== 'https:' 14 | && data.protocol !== 'ws:' 15 | && data.protocol !== 'wss:') { 16 | throw new Error('Invalid protocol for websocket URL.'); 17 | } 18 | 19 | if (!data.hostname) 20 | throw new Error('Malformed URL.'); 21 | 22 | const host = data.hostname; 23 | 24 | let port = 80; 25 | let ssl = false; 26 | 27 | if (data.protocol === 'https:' || data.protocol === 'wss:') { 28 | port = 443; 29 | ssl = true; 30 | } 31 | 32 | if (data.port) { 33 | port = parseInt(data.port, 10); 34 | assert((port & 0xffff) === port); 35 | assert(port !== 0); 36 | } 37 | 38 | return [port, host, ssl]; 39 | }; 40 | -------------------------------------------------------------------------------- /node_modules/bsocks/README.md: -------------------------------------------------------------------------------- 1 | # bsocks 2 | 3 | SOCKS client for node.js. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const socks = require('bsocks'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/bsocks/lib/bsocks.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bsocks.js - SOCKS client for bcoin 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./socks'); 10 | -------------------------------------------------------------------------------- /node_modules/bsocks/lib/socks-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * socks.js - socks proxy for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.unsupported = true; 10 | 11 | exports.connect = function connect(proxy, destPort, destHost) { 12 | throw new Error('SOCKS unsupported.'); 13 | }; 14 | 15 | exports.resolve = async function resolve(proxy, name) { 16 | throw new Error('SOCKS unsupported.'); 17 | }; 18 | -------------------------------------------------------------------------------- /node_modules/btcp/README.md: -------------------------------------------------------------------------------- 1 | # btcp 2 | 3 | TCP wrapper for node.js. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const net = require('btcp'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | -------------------------------------------------------------------------------- /node_modules/btcp/lib/btcp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./tcp'); 4 | -------------------------------------------------------------------------------- /node_modules/btcp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "btcp", 3 | "version": "0.1.5", 4 | "description": "TCP wrapper for node.js", 5 | "keywords": [ 6 | "net", 7 | "tcp" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/btcp.git", 11 | "homepage": "https://github.com/bcoin-org/btcp", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/btcp/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/btcp.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "devDependencies": { 22 | "bmocha": "^2.1.0" 23 | }, 24 | "engines": { 25 | "node": ">=8.0.0" 26 | }, 27 | "browser": { 28 | "./lib/tcp": "./lib/tcp-browser.js" 29 | }, 30 | "_from": "git+https://github.com/bcoin-org/btcp.git#semver:~0.1.5", 31 | "_resolved": "git+https://github.com/bcoin-org/btcp.git#4ea7e1ce5a43cd5348152c007aff76a419190a3a", 32 | "_commit": "4ea7e1ce5a43cd5348152c007aff76a419190a3a" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/buffer-map/README.md: -------------------------------------------------------------------------------- 1 | # buffer-map 2 | 3 | Buffer-keyed map for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const assert = require('assert'); 9 | const {BufferMap} = require('buffer-map'); 10 | const key1 = Buffer.alloc(32, 0xab); 11 | const key2 = Buffer.alloc(32, 0xab); 12 | 13 | const map = new BufferMap(); 14 | map.set(key1, 'foo'); 15 | assert(map.get(key2) === 'foo'); 16 | ``` 17 | 18 | ## Contribution and License Agreement 19 | 20 | If you contribute code to this project, you are implicitly allowing your code 21 | to be distributed under the MIT license. You are also implicitly verifying that 22 | all code is your original work. `` 23 | 24 | ## License 25 | 26 | - Copyright (c) 2018, Christopher Jeffrey (MIT License). 27 | 28 | See LICENSE for more info. 29 | -------------------------------------------------------------------------------- /node_modules/buffer-map/lib/custom-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.custom = 'inspect'; 4 | -------------------------------------------------------------------------------- /node_modules/buffer-map/lib/custom.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const {inspect} = require('util'); 4 | 5 | exports.custom = inspect.custom || 'inspect'; 6 | -------------------------------------------------------------------------------- /node_modules/buffer-map/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "buffer-map", 3 | "version": "0.0.7", 4 | "description": "Buffer-keyed map for javascript", 5 | "keywords": [ 6 | "buffer", 7 | "map" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/chjj/buffer-map.git", 11 | "homepage": "https://github.com/chjj/buffer-map", 12 | "bugs": { 13 | "url": "https://github.com/chjj/buffer-map/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/buffer-map.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "devDependencies": { 22 | "bmocha": "^2.1.0" 23 | }, 24 | "engines": { 25 | "node": ">=8.0.0" 26 | }, 27 | "browser": { 28 | "./lib/custom": "./lib/custom-browser.js" 29 | }, 30 | "_from": "git+https://github.com/chjj/buffer-map.git#semver:~0.0.7", 31 | "_resolved": "git+https://github.com/chjj/buffer-map.git#bad5863af9a520701937a17fc8fa2bd8ca8e73f3", 32 | "_commit": "bad5863af9a520701937a17fc8fa2bd8ca8e73f3" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/bufio/lib/custom-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.custom = 'inspect'; 4 | -------------------------------------------------------------------------------- /node_modules/bufio/lib/custom.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const {inspect} = require('util'); 4 | 5 | exports.custom = inspect.custom || 'inspect'; 6 | -------------------------------------------------------------------------------- /node_modules/bufio/lib/enforce.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * enforce.js - type enforcement for bcoin 3 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /* 10 | * Enforce 11 | */ 12 | 13 | function enforce(value, name, type) { 14 | if (!value) { 15 | const err = new TypeError(`'${name}' must be a(n) ${type}.`); 16 | 17 | if (Error.captureStackTrace) 18 | Error.captureStackTrace(err, enforce); 19 | 20 | throw err; 21 | } 22 | } 23 | 24 | /* 25 | * Expose 26 | */ 27 | 28 | module.exports = enforce; 29 | -------------------------------------------------------------------------------- /node_modules/bufio/lib/error.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * error.js - encoding error for bcoin 3 | * Copyright (c) 2014-2015, Fedor Indutny (MIT License) 4 | * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). 5 | * https://github.com/bcoin-org/bcoin 6 | */ 7 | 8 | 'use strict'; 9 | 10 | /** 11 | * Encoding Error 12 | * @extends {Error} 13 | */ 14 | 15 | class EncodingError extends Error { 16 | /** 17 | * Create an encoding error. 18 | * @constructor 19 | * @param {Number} offset 20 | * @param {String} reason 21 | */ 22 | 23 | constructor(offset, reason, start) { 24 | super(); 25 | 26 | this.type = 'EncodingError'; 27 | this.name = 'EncodingError'; 28 | this.code = 'ERR_ENCODING'; 29 | this.message = `${reason} (offset=${offset}).`; 30 | 31 | if (Error.captureStackTrace) 32 | Error.captureStackTrace(this, start || EncodingError); 33 | } 34 | } 35 | 36 | /* 37 | * Expose 38 | */ 39 | 40 | module.exports = EncodingError; 41 | -------------------------------------------------------------------------------- /node_modules/bufio/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bufio", 3 | "version": "1.0.7", 4 | "description": "Buffer and serialization utilities for javascript", 5 | "keywords": [ 6 | "buffer", 7 | "serialization" 8 | ], 9 | "license": "MIT", 10 | "repository": "git://github.com/bcoin-org/bufio.git", 11 | "homepage": "https://github.com/bcoin-org/bufio", 12 | "bugs": { 13 | "url": "https://github.com/bcoin-org/bufio/issues" 14 | }, 15 | "author": "Christopher Jeffrey ", 16 | "main": "./lib/bufio.js", 17 | "scripts": { 18 | "lint": "eslint lib/ test/ || exit 0", 19 | "test": "bmocha --reporter spec test/*-test.js" 20 | }, 21 | "devDependencies": { 22 | "bmocha": "^2.1.0" 23 | }, 24 | "engines": { 25 | "node": ">=8.0.0" 26 | }, 27 | "browser": { 28 | "./lib/custom": "./lib/custom-browser.js" 29 | }, 30 | "_from": "git+https://github.com/bcoin-org/bufio.git#semver:~1.0.7", 31 | "_resolved": "git+https://github.com/bcoin-org/bufio.git#91ae6c93899ff9fad7d7cee9afd2a1c4933ca984", 32 | "_commit": "91ae6c93899ff9fad7d7cee9afd2a1c4933ca984" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/bupnp/README.md: -------------------------------------------------------------------------------- 1 | # bupnp 2 | 3 | UPNP for node.js. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const UPNP = require('bupnp'); 9 | ``` 10 | 11 | ## API 12 | 13 | ```javascript 14 | // Set a timeout 15 | UPNP.RESPONSE_TIMEOUT = 1000 16 | 17 | // Discovering internet gateway (upnp) 18 | let wan = await UPNP.discover() 19 | 20 | // Find external IP (upnp) 21 | let host = await wan.getExternalIP() 22 | 23 | // Add port mapping (remoteHost, externalPort, internalPort) 24 | await wan.addPortMapping(host, src, dest) 25 | 26 | // Remove port mapping 27 | await wan.removePortMapping(host, port) 28 | ``` 29 | 30 | 31 | ## Contribution and License Agreement 32 | 33 | If you contribute code to this project, you are implicitly allowing your code 34 | to be distributed under the MIT license. You are also implicitly verifying that 35 | all code is your original work. `` 36 | 37 | ## License 38 | 39 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 40 | 41 | See LICENSE for more info. 42 | -------------------------------------------------------------------------------- /node_modules/bupnp/lib/bupnp.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bupnp.js - bupnp for bcoin 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = require('./upnp'); 10 | -------------------------------------------------------------------------------- /node_modules/bupnp/lib/upnp-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * upnp-browser.js - upnp for bcoin 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bcoin 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * UPNP 11 | */ 12 | 13 | class UPNP { 14 | /** 15 | * Create a UPNP context. 16 | * @constructor 17 | * @param {String?} host - Multicast IP. 18 | * @param {Number?} port - Multicast port. 19 | * @param {String?} gateway - Gateway name. 20 | */ 21 | 22 | constructor(host, port, gateway) { 23 | throw new Error('UPNP not supported.'); 24 | } 25 | 26 | /** 27 | * Discover gateway and resolve service. 28 | * @param {String?} host - Multicast IP. 29 | * @param {Number?} port - Multicast port. 30 | * @param {String?} gateway - Gateway type. 31 | * @param {String[]?} targets - Target service types. 32 | * @returns {Promise} Service. 33 | */ 34 | 35 | static async discover(host, port, gateway, targets) { 36 | throw new Error('UPNP not supported.'); 37 | } 38 | } 39 | 40 | UPNP.unsupported = true; 41 | 42 | /* 43 | * Expose 44 | */ 45 | 46 | module.exports = UPNP; 47 | -------------------------------------------------------------------------------- /node_modules/bval/README.md: -------------------------------------------------------------------------------- 1 | # bval 2 | 3 | Validator for javascript. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const bval = require('bval'); 9 | ``` 10 | 11 | ## Contribution and License Agreement 12 | 13 | If you contribute code to this project, you are implicitly allowing your code 14 | to be distributed under the MIT license. You are also implicitly verifying that 15 | all code is your original work. `` 16 | 17 | ## License 18 | 19 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 20 | 21 | See LICENSE for more info. 22 | 23 | [gc]: https://en.wikipedia.org/wiki/Golomb_coding 24 | -------------------------------------------------------------------------------- /node_modules/bval/lib/bval.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./validator'); 4 | -------------------------------------------------------------------------------- /node_modules/bval/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bval", 3 | "version": "0.1.6", 4 | "description": "Validator for javascript", 5 | "keywords": [ 6 | "valid", 7 | "validation", 8 | "validator" 9 | ], 10 | "license": "MIT", 11 | "repository": "git://github.com/bcoin-org/bval.git", 12 | "homepage": "https://github.com/bcoin-org/bval", 13 | "bugs": { 14 | "url": "https://github.com/bcoin-org/bval/issues" 15 | }, 16 | "author": "Christopher Jeffrey ", 17 | "main": "./lib/bval.js", 18 | "scripts": { 19 | "lint": "eslint lib/ test/ || exit 0", 20 | "test": "bmocha --reporter spec test/*-test.js" 21 | }, 22 | "dependencies": { 23 | "bsert": "~0.0.10" 24 | }, 25 | "devDependencies": { 26 | "bmocha": "^2.1.0" 27 | }, 28 | "engines": { 29 | "node": ">=8.0.0" 30 | }, 31 | "_from": "git+https://github.com/bcoin-org/bval.git#semver:~0.1.6", 32 | "_resolved": "git+https://github.com/bcoin-org/bval.git#c8cd14419ca46f63610dc48b797b076835e86f48", 33 | "_commit": "c8cd14419ca46f63610dc48b797b076835e86f48" 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/bweb/README.md: -------------------------------------------------------------------------------- 1 | # bweb 2 | 3 | A web server. 4 | 5 | ## Usage 6 | 7 | ``` js 8 | const bweb = require('bweb'); 9 | const server = bweb.server({ 10 | port: 8080, 11 | sockets: true 12 | }); 13 | 14 | server.on('socket', (socket) => { 15 | // A bsock socket 16 | socket.fire('hello', 'world'); 17 | }); 18 | 19 | server.use(server.bodyParser()); 20 | server.use(server.cookieParser()); 21 | server.use(server.jsonRPC()); 22 | server.use(server.router()); 23 | server.use('/static', server.fileServer(__dirname)); 24 | 25 | server.get('/', async (req, res) => { 26 | res.html(200, 'static'); 27 | }); 28 | 29 | server.open(); 30 | ``` 31 | 32 | ## Contribution and License Agreement 33 | 34 | If you contribute code to this project, you are implicitly allowing your code 35 | to be distributed under the MIT license. You are also implicitly verifying that 36 | all code is your original work. `` 37 | 38 | ## License 39 | 40 | - Copyright (c) 2017, Christopher Jeffrey (MIT License). 41 | 42 | See LICENSE for more info. 43 | -------------------------------------------------------------------------------- /node_modules/bweb/lib/bweb.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * bweb.js - a web server 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bweb 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const Server = require('./server'); 10 | const Router = require('./router'); 11 | const {RPC, RPCError, errors} = require('./rpc'); 12 | const middleware = require('./middleware/index'); 13 | 14 | exports.Server = Server; 15 | exports.createServer = options => new Server(options); 16 | exports.server = options => new Server(options); 17 | 18 | exports.Router = Router; 19 | exports.router = () => new Router(); 20 | 21 | exports.RPC = RPC; 22 | exports.rpc = () => new RPC(); 23 | 24 | exports.RPCError = RPCError; 25 | exports.errors = errors; 26 | 27 | exports.middleware = middleware; 28 | -------------------------------------------------------------------------------- /node_modules/bweb/lib/hook.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * hook.js - hook object for bweb 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bweb 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('bsert'); 10 | 11 | /** 12 | * Hook 13 | */ 14 | 15 | class Hook { 16 | /** 17 | * Create a hook. 18 | * @constructor 19 | * @ignore 20 | */ 21 | 22 | constructor(path, handler) { 23 | assert(typeof path === 'string'); 24 | assert(typeof handler === 'function' || typeof handler === 'object'); 25 | assert(handler !== null); 26 | 27 | this.path = path; 28 | this.handler = handler; 29 | this.arity = 0; 30 | 31 | if (typeof handler === 'function') 32 | this.arity = handler.length; 33 | } 34 | 35 | isPrefix(pathname) { 36 | if (this.path === '/') 37 | return true; 38 | 39 | if (pathname.startsWith) 40 | return pathname.startsWith(this.path); 41 | 42 | return pathname.indexOf(this.path) === 0; 43 | } 44 | } 45 | 46 | /* 47 | * Expose 48 | */ 49 | 50 | module.exports = Hook; 51 | -------------------------------------------------------------------------------- /node_modules/bweb/lib/middleware/cors.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * cors.js - cors middleware for bweb 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bweb 5 | */ 6 | 7 | 'use strict'; 8 | 9 | /** 10 | * CORS middleware. 11 | * @returns {Function} 12 | */ 13 | 14 | function cors() { 15 | return async (req, res) => { 16 | const origin = req.headers.origin != null 17 | ? req.headers.origin 18 | : '*'; 19 | 20 | res.setHeader('Access-Control-Allow-Origin', origin); 21 | res.setHeader('Access-Control-Allow-Credentials', 'true'); 22 | res.setHeader( 23 | 'Access-Control-Allow-Methods', 24 | 'GET,HEAD,PUT,PATCH,POST,DELETE'); 25 | res.setHeader('Access-Control-Allow-Headers', 'Authorization'); 26 | 27 | if (req.method === 'OPTIONS') { 28 | res.setStatus(200); 29 | res.end(); 30 | return; 31 | } 32 | }; 33 | } 34 | 35 | /* 36 | * Expose 37 | */ 38 | 39 | module.exports = cors; 40 | -------------------------------------------------------------------------------- /node_modules/bweb/lib/middleware/index-browser.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * middleware.js - middleware for bweb 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bweb 5 | */ 6 | 7 | 'use strict'; 8 | 9 | function middleware() { 10 | return async (req, res) => {}; 11 | } 12 | 13 | exports.basicAuth = middleware; 14 | exports.bodyParser = middleware; 15 | exports.cookieParser = middleware; 16 | exports.cors = middleware; 17 | exports.fileServer = middleware; 18 | exports.jsonRPC = middleware; 19 | exports.router = middleware; 20 | -------------------------------------------------------------------------------- /node_modules/bweb/lib/middleware/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * middleware.js - middleware for bweb 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bweb 5 | */ 6 | 7 | 'use strict'; 8 | 9 | exports.basicAuth = require('./basicauth'); 10 | exports.bodyParser = require('./bodyparser'); 11 | exports.cookieParser = require('./cookie'); 12 | exports.cors = require('./cors'); 13 | exports.fileServer = require('./file'); 14 | exports.jsonRPC = require('./jsonrpc'); 15 | exports.router = require('./router'); 16 | -------------------------------------------------------------------------------- /node_modules/bweb/lib/middleware/router.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * router.js - router middleware for bweb 3 | * Copyright (c) 2017, Christopher Jeffrey (MIT License). 4 | * https://github.com/bcoin-org/bweb 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const assert = require('bsert'); 10 | 11 | /** 12 | * Router middleware. 13 | * @returns {Function} 14 | */ 15 | 16 | function router(routes) { 17 | assert(routes && typeof routes === 'object'); 18 | assert(typeof routes.handle === 'function'); 19 | return async (req, res) => { 20 | return routes.handle(req, res); 21 | }; 22 | } 23 | 24 | /* 25 | * Expose 26 | */ 27 | 28 | module.exports = router; 29 | -------------------------------------------------------------------------------- /node_modules/loady/README.md: -------------------------------------------------------------------------------- 1 | # loady 2 | 3 | Dynamic loader for node.js. Similar to [node-bindings]. 4 | 5 | ## Usage 6 | 7 | Scripts: 8 | 9 | ``` js 10 | const addon = require('loady')('addon.node', __dirname); 11 | ``` 12 | 13 | Modules: 14 | 15 | ``` js 16 | import loady from 'loady'; 17 | 18 | const addon = loady('addon.node', import.meta.url); 19 | ``` 20 | 21 | ## Contribution and License Agreement 22 | 23 | If you contribute code to this project, you are implicitly allowing your code 24 | to be distributed under the MIT license. You are also implicitly verifying that 25 | all code is your original work. `` 26 | 27 | ## License 28 | 29 | - Copyright (c) 2019-2020, Christopher Jeffrey (MIT License). 30 | 31 | See LICENSE for more info. 32 | 33 | [node-bindings]: https://github.com/TooTallNate/node-bindings 34 | -------------------------------------------------------------------------------- /node_modules/loady/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "loady", 3 | "version": "0.0.5", 4 | "description": "dynamic loader for node.js", 5 | "keywords": [ 6 | "addon", 7 | "bindings", 8 | "c", 9 | "c++", 10 | "gyp", 11 | "native", 12 | "waf" 13 | ], 14 | "license": "MIT", 15 | "repository": "git://github.com/chjj/loady.git", 16 | "homepage": "https://github.com/chjj/loady", 17 | "bugs": { 18 | "url": "https://github.com/chjj/loady/issues" 19 | }, 20 | "author": "Christopher Jeffrey ", 21 | "main": "./lib/loady.js", 22 | "scripts": { 23 | "lint": "eslint lib/ || exit 0" 24 | }, 25 | "engines": { 26 | "node": ">=8.0.0" 27 | }, 28 | "_from": "git+https://github.com/chjj/loady.git#semver:~0.0.1", 29 | "_resolved": "git+https://github.com/chjj/loady.git#b94958b7ee061518f4b85ea6da380e7ee93222d5", 30 | "_commit": "b94958b7ee061518f4b85ea6da380e7ee93222d5" 31 | } 32 | -------------------------------------------------------------------------------- /node_modules/n64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "n64", 3 | "version": "0.2.10", 4 | "description": "Int64 object for javascript", 5 | "keywords": [ 6 | "i64", 7 | "int64", 8 | "n64", 9 | "u64", 10 | "uint64" 11 | ], 12 | "bugs": { 13 | "url": "https://github.com/chjj/n64/issues" 14 | }, 15 | "homepage": "https://github.com/chjj/n64", 16 | "license": "MIT", 17 | "author": "Christopher Jeffrey ", 18 | "main": "./lib/n64.js", 19 | "repository": "git://github.com/chjj/n64.git", 20 | "scripts": { 21 | "lint": "eslint bench/ lib/ test/ || exit 0", 22 | "test": "bmocha --reporter spec test/*-test.js" 23 | }, 24 | "devDependencies": { 25 | "bmocha": "^2.1.0", 26 | "loady": "~0.0.1", 27 | "nan": "^2.13.1" 28 | }, 29 | "engines": { 30 | "node": ">=2.0.0" 31 | }, 32 | "_from": "git+https://github.com/chjj/n64.git#semver:~0.2.10", 33 | "_resolved": "git+https://github.com/chjj/n64.git#34f981f1441f569821d97a31f8cf21a3fc11b8f6", 34 | "_commit": "34f981f1441f569821d97a31f8cf21a3fc11b8f6" 35 | } 36 | -------------------------------------------------------------------------------- /node_modules/nan/include_dirs.js: -------------------------------------------------------------------------------- 1 | console.log(require('path').relative('.', __dirname)); 2 | -------------------------------------------------------------------------------- /node_modules/nan/tools/README.md: -------------------------------------------------------------------------------- 1 | 1to2 naively converts source code files from NAN 1 to NAN 2. There will be erroneous conversions, 2 | false positives and missed opportunities. The input files are rewritten in place. Make sure that 3 | you have backups. You will have to manually review the changes afterwards and do some touchups. 4 | 5 | ```sh 6 | $ tools/1to2.js 7 | 8 | Usage: 1to2 [options] 9 | 10 | Options: 11 | 12 | -h, --help output usage information 13 | -V, --version output the version number 14 | ``` 15 | -------------------------------------------------------------------------------- /node_modules/nan/tools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1to2", 3 | "version": "1.0.0", 4 | "description": "NAN 1 -> 2 Migration Script", 5 | "main": "1to2.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/nodejs/nan.git" 9 | }, 10 | "contributors": [ 11 | "Benjamin Byholm (https://github.com/kkoopa/)", 12 | "Mathias Küsel (https://github.com/mathiask88/)" 13 | ], 14 | "dependencies": { 15 | "glob": "~5.0.10", 16 | "commander": "~2.8.1" 17 | }, 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /scripts/dump.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const heapdump = require('heapdump'); 4 | const MempoolEntry = require('../lib/mempool/mempoolentry'); 5 | const Coins = require('../lib/coins/coins'); 6 | const common = require('../test/util/common'); 7 | 8 | const [tx, view] = common.readTX('tx4').getTX(); 9 | const coins = Coins.fromTX(tx, 0); 10 | const entry = MempoolEntry.fromTX(tx, view, 1000000); 11 | 12 | setInterval(() => { 13 | console.log(tx.hash('hex')); 14 | console.log(coins.outputs.length); 15 | console.log(entry.tx); 16 | }, 60 * 1000); 17 | 18 | setImmediate(() => { 19 | heapdump.writeSnapshot(`${__dirname}/../dump.heapsnapshot`, (err) => { 20 | if (err) 21 | throw err; 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /scripts/seeds.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dir=$(dirname "$(which "$0")") 4 | url_main='https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/seeds/nodes_main.txt' 5 | url_testnet='https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/seeds/nodes_test.txt' 6 | 7 | getseeds() { 8 | echo "$(curl -s "$1")" 9 | } 10 | 11 | tojs() { 12 | local data=$(cat) 13 | local body=$(echo "$data" | head -n -1) 14 | local last=$(echo "$data" | tail -n 1) 15 | echo "'use strict';" 16 | echo '' 17 | echo 'module.exports = [' 18 | echo "$body" | while read line; do 19 | if echo "$line" | grep '^#' > /dev/null; then 20 | continue 21 | fi 22 | if echo "$line" | grep '^ *$' > /dev/null; then 23 | continue 24 | fi 25 | echo " '${line}'," 26 | done 27 | echo " '${last}'" 28 | echo '];' 29 | } 30 | 31 | getseeds "$url_main" | tojs > "${dir}/../lib/net/seeds/main.js" 32 | getseeds "$url_testnet" | tojs > "${dir}/../lib/net/seeds/testnet.js" 33 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: bcoin 2 | version: git 3 | summary: A fullnode Bitcoin implementation for miners, wallets, and exchanges 4 | description: | 5 | Bcoin is an alternative implementation of the bitcoin protocol, written in 6 | node.js. 7 | 8 | grade: devel # must be 'stable' to release into candidate/stable channels 9 | confinement: strict 10 | 11 | apps: 12 | bcoin: 13 | command: bcoin 14 | plugs: [network, network-bind] 15 | 16 | parts: 17 | bcoin: 18 | source: . 19 | plugin: nodejs 20 | build-packages: [python, gcc] 21 | node-engine: 10.0.0 22 | -------------------------------------------------------------------------------- /test/data/block1.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block1.raw -------------------------------------------------------------------------------- /test/data/block1087400-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block1087400-undo.raw -------------------------------------------------------------------------------- /test/data/block1087400.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block1087400.raw -------------------------------------------------------------------------------- /test/data/block300025-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block300025-undo.raw -------------------------------------------------------------------------------- /test/data/block300025.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block300025.raw -------------------------------------------------------------------------------- /test/data/block426884.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block426884.raw -------------------------------------------------------------------------------- /test/data/block482683.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block482683.raw -------------------------------------------------------------------------------- /test/data/block898352.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block898352.raw -------------------------------------------------------------------------------- /test/data/block928816-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928816-undo.raw -------------------------------------------------------------------------------- /test/data/block928816.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928816.raw -------------------------------------------------------------------------------- /test/data/block928828-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928828-undo.raw -------------------------------------------------------------------------------- /test/data/block928828.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928828.raw -------------------------------------------------------------------------------- /test/data/block928831-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928831-undo.raw -------------------------------------------------------------------------------- /test/data/block928831.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928831.raw -------------------------------------------------------------------------------- /test/data/block928848-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928848-undo.raw -------------------------------------------------------------------------------- /test/data/block928848.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928848.raw -------------------------------------------------------------------------------- /test/data/block928849-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928849-undo.raw -------------------------------------------------------------------------------- /test/data/block928849.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928849.raw -------------------------------------------------------------------------------- /test/data/block928927-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928927-undo.raw -------------------------------------------------------------------------------- /test/data/block928927.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/block928927.raw -------------------------------------------------------------------------------- /test/data/coin1.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/coin1.raw -------------------------------------------------------------------------------- /test/data/compact426884.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/compact426884.raw -------------------------------------------------------------------------------- /test/data/compact898352.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/compact898352.raw -------------------------------------------------------------------------------- /test/data/headers1.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/headers1.raw -------------------------------------------------------------------------------- /test/data/merkle300025-extended.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/merkle300025-extended.raw -------------------------------------------------------------------------------- /test/data/merkle300025.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/merkle300025.raw -------------------------------------------------------------------------------- /test/data/tx1-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx1-undo.raw -------------------------------------------------------------------------------- /test/data/tx1.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx1.raw -------------------------------------------------------------------------------- /test/data/tx10-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx10-undo.raw -------------------------------------------------------------------------------- /test/data/tx10.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx10.raw -------------------------------------------------------------------------------- /test/data/tx2-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx2-undo.raw -------------------------------------------------------------------------------- /test/data/tx2.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx2.raw -------------------------------------------------------------------------------- /test/data/tx3-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx3-undo.raw -------------------------------------------------------------------------------- /test/data/tx3.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx3.raw -------------------------------------------------------------------------------- /test/data/tx4-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx4-undo.raw -------------------------------------------------------------------------------- /test/data/tx4.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx4.raw -------------------------------------------------------------------------------- /test/data/tx5.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx5.raw -------------------------------------------------------------------------------- /test/data/tx6-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx6-undo.raw -------------------------------------------------------------------------------- /test/data/tx6.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx6.raw -------------------------------------------------------------------------------- /test/data/tx7-undo.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx7-undo.raw -------------------------------------------------------------------------------- /test/data/tx7.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx7.raw -------------------------------------------------------------------------------- /test/data/tx8.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx8.raw -------------------------------------------------------------------------------- /test/data/tx9.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcoin-org/bcoin/0c18028cd333bef8b0939ada8b56ae3911fd0c26/test/data/tx9.raw -------------------------------------------------------------------------------- /test/txmeta-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | /* eslint prefer-arrow-callback: "off" */ 3 | 4 | 'use strict'; 5 | 6 | const assert = require('bsert'); 7 | const Network = require('../lib/protocol/network'); 8 | const TXMeta = require('../lib/primitives/txmeta'); 9 | 10 | const network = Network.get('regtest'); 11 | 12 | describe('TXMeta', function() { 13 | it('should return JSON for txmeta', async () => { 14 | // unconfirmed at height 100 15 | const txmeta1 = new TXMeta(); 16 | const txJSON1 = txmeta1.getJSON(network, null, 100); 17 | assert.strictEqual(txJSON1.confirmations, 0); 18 | 19 | // confirmed once at height 100 20 | const txmeta2 = TXMeta.fromOptions( {height: 100} ); 21 | txmeta2.height = 100; 22 | const txJSON2 = txmeta2.getJSON(network, null, 100); 23 | assert.strictEqual(txJSON2.confirmations, 1); 24 | }); 25 | }); 26 | --------------------------------------------------------------------------------