├── .circleci └── config.yml ├── .cz-config.js ├── .docker ├── parity-password ├── rippled.Dockerfile └── rippled.cfg ├── .dockerignore ├── .editorconfig ├── .env.example ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .nvmrc ├── CHANGELOG.md ├── Contributing.md ├── Dockerfile ├── LICENSE ├── README.md ├── _config.yml ├── bitcore-test.config.json ├── ci.sh ├── docker-compose.test.yml ├── docker-compose.yml ├── lerna.json ├── package-lock.json ├── package.json ├── packages ├── bitcore-build │ ├── .gitignore │ ├── .jshintrc │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── karma.conf.js │ ├── package-lock.json │ └── package.json ├── bitcore-client │ ├── .gitignore │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ ├── multi-sig │ │ │ └── wallet-derive-address │ │ ├── wallet │ │ ├── wallet-balance │ │ ├── wallet-balance-all │ │ ├── wallet-broadcast │ │ ├── wallet-check │ │ ├── wallet-create │ │ ├── wallet-decrypt │ │ ├── wallet-delete │ │ ├── wallet-derive │ │ ├── wallet-import │ │ ├── wallet-list │ │ ├── wallet-paypro │ │ ├── wallet-register │ │ ├── wallet-send │ │ ├── wallet-sign │ │ ├── wallet-sign-message │ │ ├── wallet-storage │ │ ├── wallet-token │ │ ├── wallet-transaction-list │ │ ├── wallet-tx │ │ └── wallet-utxos │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.ts │ │ ├── encryption.ts │ │ ├── index.ts │ │ ├── program.ts │ │ ├── storage.ts │ │ ├── storage │ │ │ ├── level.ts │ │ │ └── mongo.ts │ │ ├── stream-util.ts │ │ └── wallet.ts │ └── tsconfig.json ├── bitcore-lib-btg │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── .zuul.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── benchmark │ │ ├── block-357238.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── script.js │ │ └── serialization.js │ ├── docs │ │ ├── address.md │ │ ├── block.md │ │ ├── browser.md │ │ ├── crypto.md │ │ ├── encoding.md │ │ ├── examples.md │ │ ├── hierarchical.md │ │ ├── index.md │ │ ├── networks.md │ │ ├── privatekey.md │ │ ├── publickey.md │ │ ├── script.md │ │ ├── transaction.md │ │ ├── unit.md │ │ ├── unspentoutput.md │ │ └── uri.md │ ├── gulpfile.js │ ├── index.js │ ├── karma.conf.js │ ├── lib │ │ ├── address.js │ │ ├── block │ │ │ ├── block.js │ │ │ ├── blockheader.js │ │ │ ├── index.js │ │ │ └── merkleblock.js │ │ ├── crypto │ │ │ ├── bn.js │ │ │ ├── ecdsa.js │ │ │ ├── hash.js │ │ │ ├── point.js │ │ │ ├── random.js │ │ │ └── signature.js │ │ ├── encoding │ │ │ ├── base58.js │ │ │ ├── base58check.js │ │ │ ├── bech32.js │ │ │ ├── bufferreader.js │ │ │ ├── bufferwriter.js │ │ │ └── varint.js │ │ ├── errors │ │ │ ├── index.js │ │ │ └── spec.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── message.js │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ │ ├── index.js │ │ │ ├── interpreter.js │ │ │ └── script.js │ │ ├── transaction │ │ │ ├── index.js │ │ │ ├── input │ │ │ │ ├── index.js │ │ │ │ ├── input.js │ │ │ │ ├── multisig.js │ │ │ │ ├── multisigscripthash.js │ │ │ │ ├── publickey.js │ │ │ │ └── publickeyhash.js │ │ │ ├── output.js │ │ │ ├── sighash.js │ │ │ ├── sighashwitness.js │ │ │ ├── signature.js │ │ │ ├── transaction.js │ │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ │ ├── buffer.js │ │ │ ├── js.js │ │ │ └── preconditions.js │ ├── package-lock.json │ ├── package.json │ ├── package.json.orig │ ├── package.json.rej │ └── test │ │ ├── address.js │ │ ├── address_witness.js │ │ ├── block │ │ ├── block.js │ │ ├── blockheader.js │ │ └── merkleblock.js │ │ ├── crypto │ │ ├── bn.js │ │ ├── ecdsa.js │ │ ├── hash.js │ │ ├── point.js │ │ ├── random.js │ │ └── signature.js │ │ ├── data │ │ ├── bip69.json │ │ ├── bitcoind │ │ │ ├── base58_keys_invalid.json │ │ │ ├── base58_keys_valid.json │ │ │ ├── blocks.json │ │ │ ├── script_tests.json │ │ │ ├── sig_canonical.json │ │ │ ├── sig_noncanonical.json │ │ │ ├── tx_invalid.json │ │ │ └── tx_valid.json │ │ ├── blk86756-testnet.dat │ │ ├── blk86756-testnet.js │ │ ├── blk86756-testnet.json │ │ ├── ecdsa.json │ │ ├── merkleblocks.js │ │ ├── messages.json │ │ ├── sighash.json │ │ └── tx_creation.json │ │ ├── docs.js │ │ ├── encoding │ │ ├── base58.js │ │ ├── base58check.js │ │ ├── bufferreader.js │ │ ├── bufferwriter.js │ │ └── varint.js │ │ ├── hdkeys.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── index.html │ │ ├── index.js │ │ ├── message.js │ │ ├── mocha.opts │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ ├── interpreter.js │ │ └── script.js │ │ ├── transaction │ │ ├── deserialize.js │ │ ├── input │ │ │ ├── input.js │ │ │ ├── multisig.js │ │ │ ├── multisigscripthash.js │ │ │ ├── publickey.js │ │ │ └── publickeyhash.js │ │ ├── output.js │ │ ├── sighash.js │ │ ├── sighashwitness.js │ │ ├── signature.js │ │ ├── transaction.js │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ ├── buffer.js │ │ ├── js.js │ │ └── preconditions.js ├── bitcore-lib-cash │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── .zuul.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── benchmark │ │ ├── block-357238.json │ │ ├── package.json │ │ ├── script.js │ │ └── serialization.js │ ├── bower.json │ ├── docs │ │ ├── address.md │ │ ├── block.md │ │ ├── browser.md │ │ ├── crypto.md │ │ ├── encoding.md │ │ ├── examples.md │ │ ├── hierarchical.md │ │ ├── index.md │ │ ├── networks.md │ │ ├── privatekey.md │ │ ├── publickey.md │ │ ├── script.md │ │ ├── transaction.md │ │ ├── unit.md │ │ ├── unspentoutput.md │ │ └── uri.md │ ├── gulpfile.js │ ├── index.js │ ├── karma.conf.js │ ├── lib │ │ ├── address.js │ │ ├── block │ │ │ ├── block.js │ │ │ ├── blockheader.js │ │ │ ├── index.js │ │ │ └── merkleblock.js │ │ ├── crypto │ │ │ ├── bn.js │ │ │ ├── ecdsa.js │ │ │ ├── hash.js │ │ │ ├── point.js │ │ │ ├── random.js │ │ │ ├── schnorr.js │ │ │ └── signature.js │ │ ├── encoding │ │ │ ├── base58.js │ │ │ ├── base58check.js │ │ │ ├── bufferreader.js │ │ │ ├── bufferwriter.js │ │ │ └── varint.js │ │ ├── errors │ │ │ ├── index.js │ │ │ └── spec.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ │ ├── index.js │ │ │ ├── interpreter.js │ │ │ └── script.js │ │ ├── transaction │ │ │ ├── index.js │ │ │ ├── input │ │ │ │ ├── index.js │ │ │ │ ├── input.js │ │ │ │ ├── multisig.js │ │ │ │ ├── multisigscripthash.js │ │ │ │ ├── publickey.js │ │ │ │ └── publickeyhash.js │ │ │ ├── output.js │ │ │ ├── sighash.js │ │ │ ├── signature.js │ │ │ ├── transaction.js │ │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ │ ├── base32.js │ │ │ ├── buffer.js │ │ │ ├── convertBits.js │ │ │ ├── js.js │ │ │ └── preconditions.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── address.js │ │ ├── base32.js │ │ ├── block │ │ ├── block.js │ │ ├── blockheader.js │ │ └── merkleblock.js │ │ ├── convertBits.js │ │ ├── crypto │ │ ├── bn.js │ │ ├── ecdsa.js │ │ ├── hash.js │ │ ├── point.js │ │ ├── random.js │ │ ├── schnorr.js │ │ └── signature.js │ │ ├── data │ │ ├── bip69.json │ │ ├── bitcoind │ │ │ ├── base58_keys_invalid.json │ │ │ ├── base58_keys_valid.json │ │ │ ├── blocks.json │ │ │ ├── script_tests.json │ │ │ ├── sig_canonical.json │ │ │ ├── sig_noncanonical.json │ │ │ ├── tx_invalid.json │ │ │ └── tx_valid.json │ │ ├── blk86756-testnet.dat │ │ ├── blk86756-testnet.js │ │ ├── blk86756-testnet.json │ │ ├── cashaddr.json │ │ ├── ecdsa.json │ │ ├── merkleblocks.js │ │ ├── messages.json │ │ ├── sighash.json │ │ └── tx_creation.json │ │ ├── docs.js │ │ ├── encoding │ │ ├── base58.js │ │ ├── base58check.js │ │ ├── bufferreader.js │ │ ├── bufferwriter.js │ │ └── varint.js │ │ ├── hdkeys.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── index.html │ │ ├── index.js │ │ ├── mocha.opts │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ ├── interpreter.js │ │ └── script.js │ │ ├── transaction │ │ ├── deserialize.js │ │ ├── input │ │ │ ├── input.js │ │ │ ├── multisig.js │ │ │ ├── multisigscripthash.js │ │ │ ├── publickey.js │ │ │ └── publickeyhash.js │ │ ├── output.js │ │ ├── sighash.js │ │ ├── signature.js │ │ ├── transaction.js │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ ├── buffer.js │ │ ├── js.js │ │ └── preconditions.js ├── bitcore-lib-ltc │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── .zuul.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── benchmark │ │ ├── block-357238.json │ │ ├── package.json │ │ ├── script.js │ │ └── serialization.js │ ├── bower.json │ ├── docs │ │ ├── address.md │ │ ├── block.md │ │ ├── browser.md │ │ ├── crypto.md │ │ ├── encoding.md │ │ ├── examples.md │ │ ├── hierarchical.md │ │ ├── index.md │ │ ├── networks.md │ │ ├── privatekey.md │ │ ├── publickey.md │ │ ├── script.md │ │ ├── transaction.md │ │ ├── unit.md │ │ ├── unspentoutput.md │ │ └── uri.md │ ├── gulpfile.js │ ├── index.js │ ├── karma.conf.js │ ├── lib │ │ ├── address.js │ │ ├── block │ │ │ ├── block.js │ │ │ ├── blockheader.js │ │ │ ├── index.js │ │ │ └── merkleblock.js │ │ ├── crypto │ │ │ ├── bn.js │ │ │ ├── ecdsa.js │ │ │ ├── hash.js │ │ │ ├── point.js │ │ │ ├── random.js │ │ │ └── signature.js │ │ ├── encoding │ │ │ ├── base58.js │ │ │ ├── base58check.js │ │ │ ├── bufferreader.js │ │ │ ├── bufferwriter.js │ │ │ └── varint.js │ │ ├── errors │ │ │ ├── index.js │ │ │ └── spec.js │ │ ├── hdkeycache.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ │ ├── index.js │ │ │ ├── interpreter.js │ │ │ └── script.js │ │ ├── transaction │ │ │ ├── index.js │ │ │ ├── input │ │ │ │ ├── index.js │ │ │ │ ├── input.js │ │ │ │ ├── multisig.js │ │ │ │ ├── multisigscripthash.js │ │ │ │ ├── publickey.js │ │ │ │ └── publickeyhash.js │ │ │ ├── output.js │ │ │ ├── sighash.js │ │ │ ├── signature.js │ │ │ ├── transaction.js │ │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ │ ├── buffer.js │ │ │ ├── js.js │ │ │ └── preconditions.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── address.js │ │ ├── block │ │ ├── block.js │ │ ├── blockheader.js │ │ └── merkleblock.js │ │ ├── crypto │ │ ├── bn.js │ │ ├── ecdsa.js │ │ ├── hash.js │ │ ├── point.js │ │ ├── random.js │ │ └── signature.js │ │ ├── data │ │ ├── bip69.json │ │ ├── bitcoind │ │ │ ├── base58_keys_invalid.json │ │ │ ├── base58_keys_valid.json │ │ │ ├── blocks.json │ │ │ ├── script_invalid.json │ │ │ ├── script_valid.json │ │ │ ├── sig_canonical.json │ │ │ ├── sig_noncanonical.json │ │ │ ├── tx_invalid.json │ │ │ └── tx_valid.json │ │ ├── blk86756-testnet.dat │ │ ├── blk86756-testnet.js │ │ ├── blk86756-testnet.json │ │ ├── ecdsa.json │ │ ├── merkleblocks.js │ │ ├── messages.json │ │ ├── sighash.json │ │ └── tx_creation.json │ │ ├── docs.js │ │ ├── encoding │ │ ├── base58.js │ │ ├── base58check.js │ │ ├── bufferreader.js │ │ ├── bufferwriter.js │ │ └── varint.js │ │ ├── hdkeycache.js │ │ ├── hdkeys.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── index.html │ │ ├── index.js │ │ ├── mocha.opts │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ ├── interpreter.js │ │ └── script.js │ │ ├── transaction │ │ ├── deserialize.js │ │ ├── input │ │ │ ├── input.js │ │ │ ├── multisig.js │ │ │ ├── multisigscripthash.js │ │ │ ├── publickey.js │ │ │ └── publickeyhash.js │ │ ├── output.js │ │ ├── sighash.js │ │ ├── signature.js │ │ ├── transaction.js │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ ├── buffer.js │ │ ├── js.js │ │ └── preconditions.js ├── bitcore-lib │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── .zuul.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── benchmark │ │ ├── block-357238.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── script.js │ │ └── serialization.js │ ├── docs │ │ ├── address.md │ │ ├── block.md │ │ ├── browser.md │ │ ├── crypto.md │ │ ├── encoding.md │ │ ├── examples.md │ │ ├── hierarchical.md │ │ ├── index.md │ │ ├── networks.md │ │ ├── privatekey.md │ │ ├── publickey.md │ │ ├── script.md │ │ ├── transaction.md │ │ ├── unit.md │ │ ├── unspentoutput.md │ │ └── uri.md │ ├── gulpfile.js │ ├── index.js │ ├── karma.conf.js │ ├── lib │ │ ├── address.js │ │ ├── block │ │ │ ├── block.js │ │ │ ├── blockheader.js │ │ │ ├── index.js │ │ │ └── merkleblock.js │ │ ├── crypto │ │ │ ├── bn.js │ │ │ ├── ecdsa.js │ │ │ ├── hash.js │ │ │ ├── point.js │ │ │ ├── random.js │ │ │ └── signature.js │ │ ├── encoding │ │ │ ├── base58.js │ │ │ ├── base58check.js │ │ │ ├── bech32.js │ │ │ ├── bufferreader.js │ │ │ ├── bufferwriter.js │ │ │ └── varint.js │ │ ├── errors │ │ │ ├── index.js │ │ │ └── spec.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── message.js │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ │ ├── index.js │ │ │ ├── interpreter.js │ │ │ └── script.js │ │ ├── transaction │ │ │ ├── index.js │ │ │ ├── input │ │ │ │ ├── index.js │ │ │ │ ├── input.js │ │ │ │ ├── multisig.js │ │ │ │ ├── multisigscripthash.js │ │ │ │ ├── publickey.js │ │ │ │ └── publickeyhash.js │ │ │ ├── output.js │ │ │ ├── sighash.js │ │ │ ├── sighashwitness.js │ │ │ ├── signature.js │ │ │ ├── transaction.js │ │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ │ ├── buffer.js │ │ │ ├── js.js │ │ │ └── preconditions.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── address.js │ │ ├── address_witness.js │ │ ├── block │ │ ├── block.js │ │ ├── blockheader.js │ │ └── merkleblock.js │ │ ├── crypto │ │ ├── bn.js │ │ ├── ecdsa.js │ │ ├── hash.js │ │ ├── point.js │ │ ├── random.js │ │ └── signature.js │ │ ├── data │ │ ├── bip69.json │ │ ├── bitcoind │ │ │ ├── base58_keys_invalid.json │ │ │ ├── base58_keys_valid.json │ │ │ ├── blocks.json │ │ │ ├── script_tests.json │ │ │ ├── sig_canonical.json │ │ │ ├── sig_noncanonical.json │ │ │ ├── tx_invalid.json │ │ │ └── tx_valid.json │ │ ├── blk86756-testnet.dat │ │ ├── blk86756-testnet.js │ │ ├── blk86756-testnet.json │ │ ├── ecdsa.json │ │ ├── merkleblocks.js │ │ ├── messages.json │ │ ├── sighash.json │ │ └── tx_creation.json │ │ ├── docs.js │ │ ├── encoding │ │ ├── base58.js │ │ ├── base58check.js │ │ ├── bufferreader.js │ │ ├── bufferwriter.js │ │ └── varint.js │ │ ├── hdkeys.js │ │ ├── hdprivatekey.js │ │ ├── hdpublickey.js │ │ ├── index.html │ │ ├── index.js │ │ ├── message.js │ │ ├── mocha.opts │ │ ├── networks.js │ │ ├── opcode.js │ │ ├── privatekey.js │ │ ├── publickey.js │ │ ├── script │ │ ├── interpreter.js │ │ └── script.js │ │ ├── transaction │ │ ├── deserialize.js │ │ ├── input │ │ │ ├── input.js │ │ │ ├── multisig.js │ │ │ ├── multisigscripthash.js │ │ │ ├── publickey.js │ │ │ └── publickeyhash.js │ │ ├── output.js │ │ ├── sighash.js │ │ ├── sighashwitness.js │ │ ├── signature.js │ │ ├── transaction.js │ │ └── unspentoutput.js │ │ ├── unit.js │ │ ├── uri.js │ │ └── util │ │ ├── buffer.js │ │ ├── js.js │ │ └── preconditions.js ├── bitcore-mnemonic │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jshintrc │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── bitcore-mnemonic.js │ ├── docs │ │ └── index.md │ ├── gulpfile.js │ ├── index.js │ ├── lib │ │ ├── errors.js │ │ ├── mnemonic.js │ │ ├── pbkdf2.js │ │ └── words │ │ │ ├── chinese.js │ │ │ ├── english.js │ │ │ ├── french.js │ │ │ ├── index.js │ │ │ ├── italian.js │ │ │ ├── japanese.js │ │ │ ├── korean.js │ │ │ └── spanish.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── data │ │ └── fixtures.json │ │ ├── index.html │ │ ├── mnemonic.unit.js │ │ ├── mocha.opts │ │ └── pbkdf2.test.js ├── bitcore-node │ ├── .dockerignore │ ├── .eslintignore │ ├── .eslintrc.json │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── start │ ├── bitcore-node.service │ ├── docs │ │ ├── api-documentation.md │ │ ├── sockets-api.md │ │ ├── test-guide.md │ │ └── wallet-guide.md │ ├── package-lock.json │ ├── package.json │ ├── repair-sample.json │ ├── src │ │ ├── chain.ts │ │ ├── config.ts │ │ ├── decorators │ │ │ └── Loggify.ts │ │ ├── logger.ts │ │ ├── models │ │ │ ├── base.ts │ │ │ ├── baseBlock.ts │ │ │ ├── baseTransaction.ts │ │ │ ├── block.ts │ │ │ ├── cache.ts │ │ │ ├── coin.ts │ │ │ ├── events.ts │ │ │ ├── index.ts │ │ │ ├── rateLimit.ts │ │ │ ├── state.ts │ │ │ ├── transaction.ts │ │ │ ├── wallet.ts │ │ │ └── walletAddress.ts │ │ ├── modules │ │ │ ├── bitcoin-cash │ │ │ │ └── index.ts │ │ │ ├── bitcoin-gold │ │ │ │ └── index.ts │ │ │ ├── bitcoin │ │ │ │ ├── VerificationPeer.ts │ │ │ │ ├── index.ts │ │ │ │ └── p2p.ts │ │ │ ├── ethereum │ │ │ │ ├── abi │ │ │ │ │ ├── erc20.ts │ │ │ │ │ ├── erc721.ts │ │ │ │ │ ├── invoice.ts │ │ │ │ │ └── multisig.ts │ │ │ │ ├── api │ │ │ │ │ ├── csp.ts │ │ │ │ │ ├── erc20Transform.ts │ │ │ │ │ ├── eth-routes.ts │ │ │ │ │ ├── ethMultisigTransform.ts │ │ │ │ │ ├── gnosis.ts │ │ │ │ │ ├── internalTxTransform.ts │ │ │ │ │ ├── populateReceiptTransform.ts │ │ │ │ │ └── transform.ts │ │ │ │ ├── index.ts │ │ │ │ ├── models │ │ │ │ │ ├── block.ts │ │ │ │ │ └── transaction.ts │ │ │ │ ├── p2p │ │ │ │ │ ├── EthVerificationPeer.ts │ │ │ │ │ ├── p2p.ts │ │ │ │ │ └── parityRpc.ts │ │ │ │ └── types.ts │ │ │ ├── index.ts │ │ │ ├── modules.md │ │ │ └── ripple │ │ │ │ ├── api │ │ │ │ ├── csp.ts │ │ │ │ ├── event-adapter.ts │ │ │ │ ├── transform.ts │ │ │ │ ├── types.ts │ │ │ │ ├── wallet-tx-transform.ts │ │ │ │ └── xrp-routes.ts │ │ │ │ ├── index.ts │ │ │ │ ├── models │ │ │ │ ├── block.ts │ │ │ │ └── transaction.ts │ │ │ │ ├── p2p │ │ │ │ ├── index.ts │ │ │ │ └── verification.ts │ │ │ │ └── types.ts │ │ ├── providers │ │ │ ├── chain-state │ │ │ │ ├── bch │ │ │ │ │ └── bch.ts │ │ │ │ ├── btc │ │ │ │ │ └── btc.ts │ │ │ │ ├── btg │ │ │ │ │ └── btg.ts │ │ │ │ ├── index.ts │ │ │ │ └── internal │ │ │ │ │ ├── internal.ts │ │ │ │ │ └── transforms.ts │ │ │ └── libs │ │ │ │ └── index.ts │ │ ├── routes │ │ │ ├── api │ │ │ │ ├── address.ts │ │ │ │ ├── block.ts │ │ │ │ ├── fee.ts │ │ │ │ ├── stats.ts │ │ │ │ ├── tx.ts │ │ │ │ ├── valid.ts │ │ │ │ └── wallet.ts │ │ │ ├── index.ts │ │ │ ├── middleware.ts │ │ │ ├── status.ts │ │ │ └── web3 │ │ │ │ └── index.ts │ │ ├── rpc.ts │ │ ├── server.ts │ │ ├── services │ │ │ ├── api.ts │ │ │ ├── config.ts │ │ │ ├── event.ts │ │ │ ├── p2p.ts │ │ │ ├── pruning.ts │ │ │ ├── socket.ts │ │ │ ├── storage.ts │ │ │ ├── verification.ts │ │ │ └── worker.ts │ │ ├── types │ │ │ ├── Authhead.ts │ │ │ ├── BitcoinConfig.ts │ │ │ ├── Bitcore-P2P-Pool.ts │ │ │ ├── Block.ts │ │ │ ├── Callback.ts │ │ │ ├── ChainNetwork.ts │ │ │ ├── Class.ts │ │ │ ├── Coin.ts │ │ │ ├── Config.ts │ │ │ ├── HostPort.ts │ │ │ ├── Mapping.ts │ │ │ ├── Query.ts │ │ │ ├── SupportedChain.ts │ │ │ ├── Transaction.ts │ │ │ ├── TransformOptions.ts │ │ │ ├── TransformableModel.ts │ │ │ ├── UserPassword.ts │ │ │ ├── Worker.ts │ │ │ ├── namespaces │ │ │ │ ├── Bitcoin │ │ │ │ │ ├── Block.ts │ │ │ │ │ ├── Transaction.ts │ │ │ │ │ └── index.ts │ │ │ │ └── ChainStateProvider.ts │ │ │ └── stats.ts │ │ ├── utils │ │ │ ├── auth.ts │ │ │ ├── check.ts │ │ │ ├── parseArgv.ts │ │ │ ├── partition.ts │ │ │ ├── polyfills.ts │ │ │ ├── stats.ts │ │ │ ├── stringifyJsonStream.ts │ │ │ └── wait.ts │ │ └── workers │ │ │ ├── all.ts │ │ │ ├── api.ts │ │ │ ├── p2p.ts │ │ │ └── pruning.ts │ ├── test │ │ ├── benchmark │ │ │ ├── benchmark.ts │ │ │ └── wallet-benchmark.ts │ │ ├── data │ │ │ ├── test-block.ts │ │ │ └── test-tx.ts │ │ ├── fixtures │ │ │ ├── rippletxs.fixture.ts │ │ │ └── transaction.fixture.ts │ │ ├── generate-fixtures │ │ │ └── transaction.fixture.ts │ │ ├── helpers │ │ │ ├── index.ts │ │ │ ├── integration.ts │ │ │ └── unit.ts │ │ ├── integration │ │ │ ├── bitcoin │ │ │ │ └── csp.spec.ts │ │ │ ├── ethereum │ │ │ │ ├── csp.spec.ts │ │ │ │ └── p2p.spec.ts │ │ │ ├── logger.spec.ts │ │ │ ├── models │ │ │ │ ├── block.spec.ts │ │ │ │ ├── cache.spec.ts │ │ │ │ ├── coin.spec.ts │ │ │ │ ├── transaction.spec.ts │ │ │ │ ├── wallet.spec.ts │ │ │ │ └── walletAddress.spec.ts │ │ │ ├── ripple │ │ │ │ └── csp.spec.ts │ │ │ ├── rpc.spec.ts │ │ │ ├── server.spec.ts │ │ │ ├── services │ │ │ │ ├── event.integration.ts │ │ │ │ ├── pruning.integration.ts │ │ │ │ ├── storage.integration.ts │ │ │ │ └── worker.integration.ts │ │ │ ├── verification.spec.ts │ │ │ ├── wallet-benchmark.spec.ts │ │ │ └── websocket.spec.ts │ │ ├── mocha.opts │ │ ├── unit │ │ │ ├── logger.spec.ts │ │ │ ├── models │ │ │ │ ├── block.spec.ts │ │ │ │ ├── coin.spec.ts │ │ │ │ ├── transaction.spec.ts │ │ │ │ ├── wallet.spec.ts │ │ │ │ └── walletAddress.spec.ts │ │ │ ├── modules.spec.ts │ │ │ ├── modules │ │ │ │ └── ethereum │ │ │ │ │ └── csp.spec.ts │ │ │ ├── rpc.spec.ts │ │ │ ├── server.spec.ts │ │ │ ├── services │ │ │ │ ├── config.spec.ts │ │ │ │ ├── p2p.spec.ts │ │ │ │ ├── storage.spec.ts │ │ │ │ └── worker.spec.ts │ │ │ └── utils │ │ │ │ ├── partition.unit.ts │ │ │ │ └── stats.unit.ts │ │ └── verification │ │ │ ├── db-repair.ts │ │ │ ├── db-verify-headers.ts │ │ │ ├── db-verify.ts │ │ │ ├── prune-fork.ts │ │ │ ├── resync.ts │ │ │ └── rpc-verify.ts │ └── tsconfig.json ├── bitcore-p2p-btg │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── docs │ │ ├── index.md │ │ ├── messages.md │ │ ├── peer.md │ │ └── pool.md │ ├── gulpfile.js │ ├── index.js │ ├── integration │ │ └── bitcoind.js │ ├── karma.conf.js │ ├── lib │ │ ├── bloomfilter.js │ │ ├── buffers.js │ │ ├── errors.js │ │ ├── index.js │ │ ├── inventory.js │ │ ├── messages │ │ │ ├── builder.js │ │ │ ├── commands │ │ │ │ ├── addr.js │ │ │ │ ├── alert.js │ │ │ │ ├── block.js │ │ │ │ ├── cmpctblock.js │ │ │ │ ├── feefilter.js │ │ │ │ ├── filteradd.js │ │ │ │ ├── filterclear.js │ │ │ │ ├── filterload.js │ │ │ │ ├── getaddr.js │ │ │ │ ├── getblocks.js │ │ │ │ ├── getdata.js │ │ │ │ ├── getheaders.js │ │ │ │ ├── headers.js │ │ │ │ ├── inv.js │ │ │ │ ├── mempool.js │ │ │ │ ├── merkleblock.js │ │ │ │ ├── notfound.js │ │ │ │ ├── ping.js │ │ │ │ ├── pong.js │ │ │ │ ├── reject.js │ │ │ │ ├── sendcmpct.js │ │ │ │ ├── sendheaders.js │ │ │ │ ├── tx.js │ │ │ │ ├── verack.js │ │ │ │ └── version.js │ │ │ ├── index.js │ │ │ ├── message.js │ │ │ └── utils.js │ │ ├── p2pheaderandshortids.js │ │ ├── peer.js │ │ └── pool.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── bloomfilter.js │ │ ├── buffers.js │ │ ├── data │ │ ├── connection.log │ │ └── messages.json │ │ ├── inventory.js │ │ ├── messages │ │ ├── builder.js │ │ ├── commands │ │ │ └── index.js │ │ ├── index.js │ │ ├── message.js │ │ └── util.js │ │ ├── mocha.opts │ │ ├── peer.js │ │ └── pool.js ├── bitcore-p2p-cash │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── docs │ │ ├── index.md │ │ ├── messages.md │ │ ├── peer.md │ │ └── pool.md │ ├── gulpfile.js │ ├── index.js │ ├── integration │ │ └── bitcoind.js │ ├── karma.conf.js │ ├── lib │ │ ├── bloomfilter.js │ │ ├── buffers.js │ │ ├── errors.js │ │ ├── index.js │ │ ├── inventory.js │ │ ├── messages │ │ │ ├── builder.js │ │ │ ├── commands │ │ │ │ ├── addr.js │ │ │ │ ├── alert.js │ │ │ │ ├── block.js │ │ │ │ ├── filteradd.js │ │ │ │ ├── filterclear.js │ │ │ │ ├── filterload.js │ │ │ │ ├── getaddr.js │ │ │ │ ├── getblocks.js │ │ │ │ ├── getdata.js │ │ │ │ ├── getheaders.js │ │ │ │ ├── headers.js │ │ │ │ ├── inv.js │ │ │ │ ├── mempool.js │ │ │ │ ├── merkleblock.js │ │ │ │ ├── notfound.js │ │ │ │ ├── ping.js │ │ │ │ ├── pong.js │ │ │ │ ├── reject.js │ │ │ │ ├── sendheaders.js │ │ │ │ ├── tx.js │ │ │ │ ├── verack.js │ │ │ │ ├── version.js │ │ │ │ └── xversion.js │ │ │ ├── index.js │ │ │ ├── message.js │ │ │ └── utils.js │ │ ├── peer.js │ │ └── pool.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── bloomfilter.js │ │ ├── buffers.js │ │ ├── data │ │ ├── connection.log │ │ └── messages.json │ │ ├── inventory.js │ │ ├── messages │ │ ├── builder.js │ │ ├── commands │ │ │ └── index.js │ │ ├── index.js │ │ ├── message.js │ │ └── util.js │ │ ├── mocha.opts │ │ ├── peer.js │ │ └── pool.js ├── bitcore-p2p │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jsdoc.conf │ ├── .jshintrc │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── docs │ │ ├── index.md │ │ ├── messages.md │ │ ├── peer.md │ │ └── pool.md │ ├── gulpfile.js │ ├── index.js │ ├── integration │ │ └── bitcoind.js │ ├── karma.conf.js │ ├── lib │ │ ├── bloomfilter.js │ │ ├── buffers.js │ │ ├── errors.js │ │ ├── index.js │ │ ├── inventory.js │ │ ├── messages │ │ │ ├── builder.js │ │ │ ├── commands │ │ │ │ ├── addr.js │ │ │ │ ├── alert.js │ │ │ │ ├── block.js │ │ │ │ ├── filteradd.js │ │ │ │ ├── filterclear.js │ │ │ │ ├── filterload.js │ │ │ │ ├── getaddr.js │ │ │ │ ├── getblocks.js │ │ │ │ ├── getdata.js │ │ │ │ ├── getheaders.js │ │ │ │ ├── headers.js │ │ │ │ ├── inv.js │ │ │ │ ├── mempool.js │ │ │ │ ├── merkleblock.js │ │ │ │ ├── notfound.js │ │ │ │ ├── ping.js │ │ │ │ ├── pong.js │ │ │ │ ├── reject.js │ │ │ │ ├── tx.js │ │ │ │ ├── verack.js │ │ │ │ └── version.js │ │ │ ├── index.js │ │ │ ├── message.js │ │ │ └── utils.js │ │ ├── peer.js │ │ └── pool.js │ ├── package-lock.json │ ├── package.json │ └── test │ │ ├── bloomfilter.js │ │ ├── buffers.js │ │ ├── data │ │ ├── connection.log │ │ └── messages.json │ │ ├── inventory.js │ │ ├── messages │ │ ├── builder.js │ │ ├── commands │ │ │ └── index.js │ │ ├── index.js │ │ ├── message.js │ │ └── util.js │ │ ├── mocha.opts │ │ ├── peer.js │ │ └── pool.js ├── bitcore-wallet-client │ ├── .circleci │ │ └── config.yml │ ├── .coveralls.yml │ ├── .editorconfig │ ├── .gitignore │ ├── CHANGELOG.md │ ├── Gruntfile.js │ ├── LICENSE │ ├── Makefile │ ├── README.header.md │ ├── README.md │ ├── bitcore-wallet-client.min.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── api.ts │ │ │ ├── common │ │ │ │ ├── constants.ts │ │ │ │ ├── defaults.ts │ │ │ │ ├── index.ts │ │ │ │ └── utils.ts │ │ │ ├── credentials.ts │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ └── spec.ts │ │ │ ├── key.ts │ │ │ ├── log.ts │ │ │ ├── paypro.ts │ │ │ ├── payproV2.ts │ │ │ ├── request.ts │ │ │ └── verifier.ts │ │ └── util │ │ │ ├── .gitignore │ │ │ ├── JsonPaymentProtocolKeys.ts │ │ │ └── fetchBitpayKeysAndVerify.ts │ ├── test │ │ ├── api.test.js │ │ ├── key.test.js │ │ ├── legacyCredentialsExports.js │ │ ├── log.js │ │ ├── paypro.test.js │ │ ├── payproV2.test.js │ │ ├── test-config.js │ │ ├── testdata.js │ │ ├── utils.test.js │ │ └── verifier.test.js │ ├── tsconfig.json │ └── tslint.json ├── bitcore-wallet-service │ ├── .circleci │ │ └── config.yml │ ├── .coveralls.yml │ ├── .gitignore │ ├── .jshintrc │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENCE │ ├── Makefile │ ├── README.md │ ├── installation.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app.ts │ │ ├── bcmonitor │ │ │ └── bcmonitor.ts │ │ ├── bws.ts │ │ ├── cleanfiatrates │ │ │ └── cleanfiatrates.ts │ │ ├── config.ts │ │ ├── db │ │ │ └── .empty │ │ ├── deprecated-serverMessages.ts │ │ ├── emailservice │ │ │ └── emailservice.ts │ │ ├── fiatrateservice │ │ │ └── fiatrateservice.ts │ │ ├── index.ts │ │ ├── lib │ │ │ ├── bchaddresstranslator.ts │ │ │ ├── blockchainexplorer.ts │ │ │ ├── blockchainexplorers │ │ │ │ ├── v8.ts │ │ │ │ └── v8 │ │ │ │ │ └── client.ts │ │ │ ├── blockchainmonitor.ts │ │ │ ├── chain │ │ │ │ ├── bch │ │ │ │ │ └── index.ts │ │ │ │ ├── btc │ │ │ │ │ └── index.ts │ │ │ │ ├── eth │ │ │ │ │ ├── abi-erc20.ts │ │ │ │ │ ├── abi-invoice.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ └── xrp │ │ │ │ │ └── index.ts │ │ │ ├── cleanfiatrates.ts │ │ │ ├── common │ │ │ │ ├── constants.ts │ │ │ │ ├── defaults.ts │ │ │ │ ├── index.ts │ │ │ │ └── utils.ts │ │ │ ├── emailservice.ts │ │ │ ├── errors │ │ │ │ ├── clienterror.ts │ │ │ │ └── errordefinitions.ts │ │ │ ├── expressapp.ts │ │ │ ├── fiatrateproviders │ │ │ │ ├── bitpay.ts │ │ │ │ ├── bitstamp.ts │ │ │ │ └── index.ts │ │ │ ├── fiatrateservice.ts │ │ │ ├── index.ts │ │ │ ├── lock.ts │ │ │ ├── logger.ts │ │ │ ├── messagebroker.ts │ │ │ ├── middleware.ts │ │ │ ├── model │ │ │ │ ├── address.ts │ │ │ │ ├── addressmanager.ts │ │ │ │ ├── advertisement.ts │ │ │ │ ├── copayer.ts │ │ │ │ ├── email.ts │ │ │ │ ├── index.ts │ │ │ │ ├── notification.ts │ │ │ │ ├── preferences.ts │ │ │ │ ├── pushnotificationsub.ts │ │ │ │ ├── session.ts │ │ │ │ ├── txconfirmationsub.ts │ │ │ │ ├── txnote.ts │ │ │ │ ├── txproposal.ts │ │ │ │ ├── txproposal_legacy.ts │ │ │ │ ├── txproposalaction.ts │ │ │ │ └── wallet.ts │ │ │ ├── notificationbroadcaster.ts │ │ │ ├── pushnotificationsservice.ts │ │ │ ├── server.ts │ │ │ ├── stats.ts │ │ │ ├── storage.ts │ │ │ └── updatestats.ts │ │ ├── messagebroker │ │ │ └── messagebroker.ts │ │ ├── pushnotificationsservice │ │ │ └── pushnotificationsservice.ts │ │ ├── scripts │ │ │ ├── clean_db.mongodb │ │ │ ├── deleteDupAddresses.mongo │ │ │ ├── deleteWallet.mongo │ │ │ ├── level2mongo.js │ │ │ ├── resetV8registration.mongo │ │ │ ├── v8tool-list.ts │ │ │ └── v8tool.ts │ │ ├── serverMessages.ts │ │ └── updatestats │ │ │ └── updatestats.ts │ ├── start.sh │ ├── stop.sh │ ├── templates │ │ ├── en │ │ │ ├── new_copayer.plain │ │ │ ├── new_incoming_tx.plain │ │ │ ├── new_outgoing_tx.plain │ │ │ ├── new_tx_proposal.plain │ │ │ ├── tx_confirmation.plain │ │ │ ├── txp_finally_rejected.plain │ │ │ └── wallet_complete.plain │ │ ├── es │ │ │ ├── new_copayer.plain │ │ │ ├── new_incoming_tx.plain │ │ │ ├── new_outgoing_tx.plain │ │ │ ├── new_tx_proposal.plain │ │ │ ├── tx_confirmation.plain │ │ │ ├── txp_finally_rejected.plain │ │ │ └── wallet_complete.plain │ │ ├── fr │ │ │ ├── new_copayer.plain │ │ │ ├── new_incoming_tx.plain │ │ │ ├── new_outgoing_tx.plain │ │ │ ├── new_tx_proposal.plain │ │ │ ├── tx_confirmation.plain │ │ │ ├── txp_finally_rejected.plain │ │ │ └── wallet_complete.plain │ │ └── ja │ │ │ ├── new_copayer.plain │ │ │ ├── new_incoming_tx.plain │ │ │ ├── new_outgoing_tx.plain │ │ │ ├── new_tx_proposal.plain │ │ │ ├── tx_confirmation.plain │ │ │ ├── txp_finally_rejected.plain │ │ │ └── wallet_complete.plain │ ├── test │ │ ├── bchaddresstranslator.js │ │ ├── blockchainexplorer.js │ │ ├── chain │ │ │ ├── bch.js │ │ │ ├── btc.js │ │ │ └── eth.js │ │ ├── expressapp.js │ │ ├── integration │ │ │ ├── bcmonitor.js │ │ │ ├── cashAddrMigration.js │ │ │ ├── changelly.js │ │ │ ├── emailnotifications.js │ │ │ ├── fiatrateservice.js │ │ │ ├── helpers.js │ │ │ ├── history.js │ │ │ ├── hugetx.js │ │ │ ├── pushNotifications.js │ │ │ └── server.js │ │ ├── lock.js │ │ ├── mocha.opts │ │ ├── model │ │ │ ├── address.js │ │ │ ├── addressmanager.js │ │ │ ├── advertisement.js │ │ │ ├── copayer.js │ │ │ ├── txproposal.js │ │ │ └── wallet.js │ │ ├── storage.js │ │ ├── test-config.js │ │ ├── testdata.js │ │ ├── utils.js │ │ └── v8.js │ ├── tsconfig.json │ └── tslint.json ├── bitcore-wallet │ ├── .coveralls.yml │ ├── .editorconfig │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENCE │ ├── README.md │ ├── bin │ │ ├── cli-utils.js │ │ ├── filestorage.js │ │ ├── wallet │ │ ├── wallet-address │ │ ├── wallet-addresses │ │ ├── wallet-ads │ │ ├── wallet-ads-delete │ │ ├── wallet-ads-get │ │ ├── wallet-ads-update │ │ ├── wallet-airsign │ │ ├── wallet-balance │ │ ├── wallet-broadcast │ │ ├── wallet-confirm │ │ ├── wallet-create │ │ ├── wallet-derive │ │ ├── wallet-export │ │ ├── wallet-genkey │ │ ├── wallet-get-ad │ │ ├── wallet-history │ │ ├── wallet-import │ │ ├── wallet-join │ │ ├── wallet-mnemonic │ │ ├── wallet-recreate │ │ ├── wallet-reject │ │ ├── wallet-rm │ │ ├── wallet-scan │ │ ├── wallet-send │ │ ├── wallet-sign │ │ ├── wallet-status │ │ ├── wallet-txproposals │ │ └── wallet-utxos │ ├── package-lock.json │ ├── package.json │ ├── test │ │ └── cliUtils.js │ └── util │ │ └── gen-bin ├── build ├── crypto-wallet-core │ ├── CHANGELOG.md │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── constants │ │ │ ├── index.ts │ │ │ ├── tokens.ts │ │ │ └── units.ts │ │ ├── derivation │ │ │ ├── bch │ │ │ │ └── index.ts │ │ │ ├── btc │ │ │ │ └── index.ts │ │ │ ├── btg │ │ │ │ └── index.ts │ │ │ ├── eth │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── paths.ts │ │ │ └── xrp │ │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── transactions │ │ │ ├── bch │ │ │ │ └── index.ts │ │ │ ├── btc │ │ │ │ └── index.ts │ │ │ ├── btg │ │ │ │ └── index.ts │ │ │ ├── erc20 │ │ │ │ ├── abi.ts │ │ │ │ └── index.ts │ │ │ ├── eth-multisig │ │ │ │ ├── abi.ts │ │ │ │ └── index.ts │ │ │ ├── eth │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── xrp │ │ │ │ └── index.ts │ │ └── validation │ │ │ ├── bch │ │ │ └── index.ts │ │ │ ├── btc │ │ │ └── index.ts │ │ │ ├── btg │ │ │ └── index.ts │ │ │ ├── eth │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── xrp │ │ │ └── index.ts │ ├── test │ │ ├── address.ts │ │ ├── transactions.ts │ │ └── validation.ts │ ├── tsconfig.json │ └── tslint.json ├── insight │ ├── .angular-cli.json │ ├── .circleci │ │ └── config.yml │ ├── .gitignore │ ├── .prettierignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── ionic.config.json │ ├── karma.conf.js │ ├── package-lock.json │ ├── package.json │ ├── purifyCSS │ ├── sass.js │ ├── src │ │ ├── app │ │ │ ├── app.component.ts │ │ │ ├── app.html │ │ │ ├── app.module.ts │ │ │ ├── app.scss │ │ │ ├── app.spec.ts │ │ │ ├── fonts.scss │ │ │ └── main.ts │ │ ├── assets │ │ │ ├── fonts │ │ │ │ ├── Heebo-Black.ttf │ │ │ │ ├── Heebo-Bold.ttf │ │ │ │ ├── Heebo-ExtraBold.ttf │ │ │ │ ├── Heebo-Light.ttf │ │ │ │ ├── Heebo-Medium.ttf │ │ │ │ ├── Heebo-Regular.ttf │ │ │ │ ├── Heebo-Thin.ttf │ │ │ │ ├── SourceSansPro-Light.ttf │ │ │ │ ├── SourceSansPro-Regular.ttf │ │ │ │ └── ubuntu.woff2 │ │ │ ├── icon │ │ │ │ └── favicon.ico │ │ │ └── img │ │ │ │ ├── bchicon-testnet.svg │ │ │ │ ├── bitpay.svg │ │ │ │ ├── btcicon-testnet.svg │ │ │ │ ├── btg-white.svg │ │ │ │ ├── currency_logos │ │ │ │ ├── bch.svg │ │ │ │ ├── btc.svg │ │ │ │ ├── btg.svg │ │ │ │ ├── eth.svg │ │ │ │ └── ltc.svg │ │ │ │ ├── ethicon.svg │ │ │ │ ├── github.svg │ │ │ │ ├── logo.png │ │ │ │ ├── search-icon.svg │ │ │ │ └── search.png │ │ ├── components │ │ │ ├── block-summary-eth │ │ │ │ ├── block-summary-eth.html │ │ │ │ ├── block-summary-eth.module.ts │ │ │ │ ├── block-summary-eth.scss │ │ │ │ └── block-summary-eth.ts │ │ │ ├── block-summary │ │ │ │ ├── block-summary.html │ │ │ │ ├── block-summary.module.ts │ │ │ │ ├── block-summary.scss │ │ │ │ └── block-summary.ts │ │ │ ├── coin-list │ │ │ │ ├── coin-list.html │ │ │ │ ├── coin-list.module.ts │ │ │ │ ├── coin-list.scss │ │ │ │ └── coin-list.ts │ │ │ ├── coin │ │ │ │ ├── coin.html │ │ │ │ ├── coin.module.ts │ │ │ │ ├── coin.scss │ │ │ │ └── coin.ts │ │ │ ├── components.module.ts │ │ │ ├── denomination │ │ │ │ ├── denomination.html │ │ │ │ ├── denomination.module.ts │ │ │ │ ├── denomination.scss │ │ │ │ └── denomination.ts │ │ │ ├── error │ │ │ │ ├── error.html │ │ │ │ ├── error.module.ts │ │ │ │ ├── error.scss │ │ │ │ └── error.ts │ │ │ ├── footer │ │ │ │ ├── footer.html │ │ │ │ ├── footer.module.ts │ │ │ │ ├── footer.scss │ │ │ │ └── footer.ts │ │ │ ├── head-nav │ │ │ │ ├── head-nav.html │ │ │ │ ├── head-nav.module.ts │ │ │ │ ├── head-nav.scss │ │ │ │ └── head-nav.ts │ │ │ ├── index.ts │ │ │ ├── latest-blocks │ │ │ │ ├── latest-blocks.html │ │ │ │ ├── latest-blocks.module.ts │ │ │ │ ├── latest-blocks.scss │ │ │ │ └── latest-blocks.ts │ │ │ ├── loader │ │ │ │ ├── loader.html │ │ │ │ ├── loader.module.ts │ │ │ │ ├── loader.scss │ │ │ │ └── loader.ts │ │ │ ├── transaction-details-eth │ │ │ │ ├── transaction-details-eth.html │ │ │ │ ├── transaction-details-eth.module.ts │ │ │ │ ├── transaction-details-eth.scss │ │ │ │ └── transaction-details-eth.ts │ │ │ ├── transaction-details │ │ │ │ ├── transaction-details.html │ │ │ │ ├── transaction-details.module.ts │ │ │ │ ├── transaction-details.scss │ │ │ │ └── transaction-details.ts │ │ │ ├── transaction-list │ │ │ │ ├── transaction-list.html │ │ │ │ ├── transaction-list.module.ts │ │ │ │ ├── transaction-list.scss │ │ │ │ └── transaction-list.ts │ │ │ ├── transaction-summary-eth │ │ │ │ ├── transaction-summary-eth.html │ │ │ │ ├── transaction-summary-eth.module.ts │ │ │ │ ├── transaction-summary-eth.scss │ │ │ │ └── transaction-summary-eth.ts │ │ │ └── transaction-summary │ │ │ │ ├── transaction-summary.html │ │ │ │ ├── transaction-summary.module.ts │ │ │ │ ├── transaction-summary.scss │ │ │ │ └── transaction-summary.ts │ │ ├── declarations.d.ts │ │ ├── directives │ │ │ └── copy-to-clipboard │ │ │ │ ├── copy-to-clipboard.directive.ts │ │ │ │ └── copy-to-clipboard.module.ts │ │ ├── index.html │ │ ├── manifest.json │ │ ├── mocks.ts │ │ ├── models │ │ │ ├── block.spec.ts │ │ │ ├── block.ts │ │ │ ├── index.ts │ │ │ └── mocks.ts │ │ ├── pages │ │ │ ├── address │ │ │ │ ├── address.html │ │ │ │ ├── address.module.ts │ │ │ │ ├── address.scss │ │ │ │ └── address.ts │ │ │ ├── block-detail │ │ │ │ ├── block-detail.html │ │ │ │ ├── block-detail.module.ts │ │ │ │ ├── block-detail.scss │ │ │ │ └── block-detail.ts │ │ │ ├── blocks │ │ │ │ ├── blocks.html │ │ │ │ ├── blocks.module.ts │ │ │ │ ├── blocks.scss │ │ │ │ └── blocks.ts │ │ │ ├── broadcast-tx │ │ │ │ ├── broadcast-tx.html │ │ │ │ ├── broadcast-tx.module.ts │ │ │ │ ├── broadcast-tx.scss │ │ │ │ └── broadcast-tx.ts │ │ │ ├── home │ │ │ │ ├── home.html │ │ │ │ ├── home.module.ts │ │ │ │ ├── home.scss │ │ │ │ └── home.ts │ │ │ ├── index.ts │ │ │ ├── pages.module.ts │ │ │ ├── pages.scss │ │ │ ├── search │ │ │ │ ├── search.html │ │ │ │ ├── search.module.ts │ │ │ │ ├── search.scss │ │ │ │ └── search.ts │ │ │ └── transaction │ │ │ │ ├── transaction.html │ │ │ │ ├── transaction.module.ts │ │ │ │ ├── transaction.scss │ │ │ │ └── transaction.ts │ │ ├── pipes │ │ │ └── split │ │ │ │ └── split.ts │ │ ├── polyfills.ts │ │ ├── providers │ │ │ ├── address │ │ │ │ └── address.ts │ │ │ ├── api │ │ │ │ ├── api.spec.ts │ │ │ │ └── api.ts │ │ │ ├── blocks │ │ │ │ ├── blocks.spec.ts │ │ │ │ └── blocks.ts │ │ │ ├── currency │ │ │ │ ├── currency.spec.ts │ │ │ │ └── currency.ts │ │ │ ├── default │ │ │ │ ├── default.spec.ts │ │ │ │ └── default.ts │ │ │ ├── error-handler │ │ │ │ └── error-handler.ts │ │ │ ├── logger │ │ │ │ └── logger.ts │ │ │ ├── price │ │ │ │ └── price.ts │ │ │ ├── redir │ │ │ │ └── redir.ts │ │ │ ├── search │ │ │ │ └── search.ts │ │ │ └── transactions │ │ │ │ └── transactions.ts │ │ ├── test.ts │ │ ├── theme │ │ │ └── variables.scss │ │ └── tsconfig.spec.json │ ├── tsconfig.json │ └── tslint.json └── pub ├── pipenv ├── scripts ├── cfPriceWorker.js └── publish_insight_to_branch.sh ├── start.sh └── tslint.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Javascript Node CircleCI 2.0 configuration file 2 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details 3 | version: 2 4 | jobs: 5 | build: 6 | machine: 7 | image: circleci/classic:latest 8 | docker_layer_caching: true 9 | working_directory: ~/bitcore 10 | steps: 11 | - checkout 12 | 13 | - run: 14 | name: Build service 15 | command: npm run test:ci 16 | -------------------------------------------------------------------------------- /.docker/parity-password: -------------------------------------------------------------------------------- 1 | '' 2 | 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | # EditorConfig helps developers define and maintain consistent 3 | # coding styles between different editors and IDEs 4 | # http://editorconfig.org 5 | 6 | root = true 7 | 8 | [*] 9 | indent_style = space 10 | indent_size = 2 11 | end_of_line = lf 12 | charset = utf-8 13 | trim_trailing_whitespace = true 14 | insert_final_newline = true 15 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Rename this file to .env 2 | TRUSTED_BTC_REGTEST_PEER=host.docker.internal 3 | TRUSTED_BTC_REGTEST_PEER_PORT=8333 4 | BITCORE_CONFIG_PATH=~/bitcore.config 5 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "typescript-eslint-parser", 3 | "parserOptions": { 4 | "ecmaVersion": 2017 5 | }, 6 | "env": { 7 | "es6": true, 8 | "node": true 9 | }, 10 | "extends": "eslint:recommended", 11 | "rules": { 12 | "linebreak-style": [ 13 | "error", 14 | "unix" 15 | ], 16 | "quotes": [ 17 | "error", 18 | "single" 19 | ], 20 | "semi": [ 21 | "error", 22 | "always" 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *debug.log 2 | node_modules/ 3 | .env 4 | *bitcore.config.* 5 | .vscode 6 | .DS_Store 7 | *.swp 8 | 9 | # VIM ignore 10 | [._]*.s[a-w][a-z] 11 | [._]s[a-w][a-z] 12 | *.un~ 13 | Session.vim 14 | .netrwhist 15 | *~ 16 | ts_build 17 | bitcore-lib.js 18 | tbtg.json -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 11.15.0 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker-compose -f docker-compose.test.yml run --entrypoint "$1" test_runner 3 | 4 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | database: 4 | image: mongo:3.4-jessie 5 | ports: 6 | - 27017:27017 7 | volumes: 8 | - /data/db:/data/db 9 | 10 | bitcore-node: 11 | build: . 12 | image: bitcore-node 13 | links: 14 | - database 15 | ports: 16 | - 8100:8100 17 | - 3000:3000 18 | environment: 19 | - DB_HOST=database 20 | env_file: .env 21 | 22 | #insight: 23 | #image: insight 24 | #links: 25 | #- bitcore-node 26 | #environment: 27 | #- API_URL=bitcore-node 28 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "2.9.1", 3 | "version": "8.24.0", 4 | "packages": [ 5 | "packages/*" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/bitcore-build/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /packages/bitcore-build/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-build/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-build 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-build/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-build 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-build/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-client/.gitignore: -------------------------------------------------------------------------------- 1 | wallet.config.json 2 | ts_build 3 | -------------------------------------------------------------------------------- /packages/bitcore-client/.npmignore: -------------------------------------------------------------------------------- 1 | wallet.config.json 2 | -------------------------------------------------------------------------------- /packages/bitcore-client/bin/wallet-check: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const program = require('../ts_build/program'); 4 | const { Wallet } = require('../ts_build/wallet'); 5 | 6 | program 7 | .version(require('../package.json').version) 8 | .option('--name ', 'REQUIRED - Wallet name') 9 | .option('--path [path]', 'optional - Custom wallet storage path') 10 | .option('--storageType [storageType]', 'optional - name of the database to use (default Level)') 11 | .parse(process.argv); 12 | 13 | const main = async () => { 14 | const { name, path, storageType } = program; 15 | try { 16 | const wallet = await Wallet.loadWallet({ name, path, storageType }); 17 | await wallet.syncAddresses(); 18 | const registered = await wallet.checkWallet(); 19 | // TODO compare with local addresses 20 | console.log(registered); 21 | } catch (e) { 22 | console.error(e); 23 | } 24 | }; 25 | 26 | main(); 27 | -------------------------------------------------------------------------------- /packages/bitcore-client/bin/wallet-delete: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const program = require('../ts_build/program'); 4 | const { Wallet } = require('../ts_build/wallet'); 5 | 6 | try { 7 | program 8 | .version(require('../package.json').version) 9 | .option('--name ', 'REQUIRED - Wallet name') 10 | .option('--path [path]', 'optional - Custom wallet storage path') 11 | .option('--storageType [storageType]', 'optional - name of the database to use (default level)') 12 | .parse(process.argv); 13 | } catch (e) { 14 | console.log(e.message); 15 | return program.help(); 16 | } 17 | 18 | async function main() { 19 | const { name, path, time, storageType, token } = program; 20 | const wallet = await Wallet.deleteWallet({ name, path, storageType }); 21 | return "Deleted"; 22 | } 23 | 24 | main() 25 | .then(res => console.log(res)) 26 | .catch(err => console.error(err)); 27 | -------------------------------------------------------------------------------- /packages/bitcore-client/bin/wallet-register: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const program = require('../ts_build/program'); 4 | const { Wallet } = require('../ts_build/wallet'); 5 | 6 | program 7 | .version(require('../package.json').version) 8 | .option('--name ', 'REQUIRED - Wallet Name') 9 | .option('--path [path]', 'optional - Custom wallet storage path') 10 | .option('--baseUrl ', 'optional - Change configured wallet baseUrl') 11 | .option('--storageType [storageType]', 'optional - name of the database to use') 12 | .parse(process.argv); 13 | 14 | const main = async () => { 15 | const { name, path, baseUrl, storageType } = program; 16 | let wallet; 17 | try { 18 | wallet = await Wallet.loadWallet({ name, path, storageType }); 19 | await wallet.register({ baseUrl }); 20 | console.log('Wallet registered!'); 21 | } catch (e) { 22 | console.error(e); 23 | } 24 | }; 25 | 26 | main(); 27 | -------------------------------------------------------------------------------- /packages/bitcore-client/bin/wallet-utxos: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const program = require('../ts_build/program'); 4 | const { Wallet } = require('../ts_build/wallet'); 5 | 6 | program 7 | .version(require('../package.json').version) 8 | .option('--name ', 'REQUIRED - Wallet name') 9 | .option('--path [path]', 'optional - Custom wallet storage path') 10 | .option('--includeSpent', 'optional - Include spent transaction outputs') 11 | .option('--storageType [storageType]', 'optional - name of database (default Level)') 12 | .parse(process.argv); 13 | 14 | const main = async () => { 15 | const { name, path, includeSpent, storageType } = program; 16 | try { 17 | const wallet = await Wallet.loadWallet({ name, path, storageType }); 18 | wallet.getUtxos({ includeSpent }).pipe(process.stdout); 19 | } catch (e) { 20 | console.error(e); 21 | } 22 | }; 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /packages/bitcore-client/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as CryptoWalletCore from 'crypto-wallet-core'; 2 | import 'source-map-support/register'; 3 | import { Client } from './client'; 4 | import { Encryption } from './encryption'; 5 | import { Storage } from './storage'; 6 | import { ParseApiStream, StreamUtil } from './stream-util'; 7 | import { Wallet } from './wallet'; 8 | export { Wallet, Client, Storage, ParseApiStream, Encryption, StreamUtil, CryptoWalletCore }; 9 | -------------------------------------------------------------------------------- /packages/bitcore-client/src/program.ts: -------------------------------------------------------------------------------- 1 | const program = require('commander'); 2 | 3 | const _parse = program.parse.bind(program); 4 | 5 | program.parse = args => { 6 | _parse(args); 7 | 8 | const requiredOptions = program.options.filter(opt => opt.required && opt.required !== 0); 9 | 10 | const programProps = Object.getOwnPropertyNames(program); 11 | for (let option of program.options) { 12 | const optionName = option.long.replace('--', ''); 13 | const required = option.required && option.required !== 0; 14 | const missing = !programProps.includes(optionName); 15 | if (required && missing) { 16 | throw new Error(`Missing required flag: --${optionName}`); 17 | } 18 | } 19 | }; 20 | 21 | module.exports = program; 22 | -------------------------------------------------------------------------------- /packages/bitcore-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["es5", "es6", "es2017"], 4 | "noImplicitAny": false, 5 | "removeComments": true, 6 | "declaration": true, 7 | "declarationMap": true, 8 | "module": "commonjs", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "esModuleInterop": true, 13 | "target": "es5", 14 | "typeRoots": ["./node_modules/@types"], 15 | "baseUrl": ".", 16 | "paths": { 17 | "*": ["*", "./src/*"] 18 | }, 19 | "outDir": "ts_build", 20 | "sourceMap": true 21 | }, 22 | "include": [ 23 | "./src/**/*.ts", 24 | "./tests/**/*.ts" 25 | ], 26 | "exclude": [ 27 | "node_modules" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: 5ki6iPbGaiwHzIwcfNDzTXoiqAcffqUQs 2 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | coverage 3 | node_modules 4 | browser/tests.js 5 | docs/api 6 | 7 | CONTRIBUTING.html 8 | LICENSE.html 9 | README.html 10 | examples.html 11 | npm-debug.log 12 | 13 | apiref 14 | bower_components 15 | report 16 | .DS_Store 17 | 18 | 19 | bitcore.js 20 | bitcore.min.js 21 | bitcore.js.sig 22 | bitcore.min.js.sig 23 | tests.js 24 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - '8' 5 | install: 6 | - npm ci 7 | after_script: 8 | - gulp coveralls 9 | 10 | cache: 11 | directories: 12 | - "$HOME/.npm" 13 | 14 | dist: trusty # needs Ubuntu Trusty 15 | # Note: if you switch to sudo: false, you'll need to launch Chrome with --no-sandbox. 16 | # See https://github.com/travis-ci/travis-ci/issues/8836 17 | sudo: required 18 | addons: 19 | chrome: stable # have Travis install Chrome stable. 20 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/.zuul.yml: -------------------------------------------------------------------------------- 1 | ui: mocha-bdd 2 | browsers: 3 | - name: chrome 4 | version: 30..latest 5 | - name: firefox 6 | version: 30..latest 7 | - name: ie 8 | version: latest 9 | - name: safari 10 | version: latest 11 | browserify: 12 | - transform: brfs 13 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-lib/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-lib 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-lib/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-lib 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-lib/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/benchmark/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "bcoin": "0.15.0", 4 | "bitcoinjs-lib": "^1.5.7", 5 | "fullnode": "^0.9.0", 6 | "benchmark": "^1.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/docs/encoding.md: -------------------------------------------------------------------------------- 1 | # Encoding 2 | 3 | The `bitcore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem. 4 | 5 | ## Base58 & Base58Check 6 | 7 | Two classes are provided: `Base58` and `Base58Check`. The first one merely encodes/decodes a set of bytes in base58 format. The second one will also take the double `sha256` hash of the information and append the last 4 bytes of the hash as a checksum when encoding, and check this checksum when decoding. 8 | 9 | ## BufferReader & BufferWriter 10 | 11 | These classes are used internally to write information in buffers. 12 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var startGulp = require('bitcore-build'); 4 | module.exports = startGulp('lib'); 5 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/lib/block/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./block'); 2 | 3 | module.exports.BlockHeader = require('./blockheader'); 4 | module.exports.MerkleBlock = require('./merkleblock'); 5 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/lib/encoding/bech32.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var bech32 = require('bech32'); 4 | 5 | var decode = function(str) { 6 | if (typeof str !== 'string') { 7 | throw new Error('Input should be a string'); 8 | } 9 | var decoded = bech32.decode(str); 10 | return { 11 | prefix: decoded.prefix, 12 | data: Buffer.from(bech32.fromWords(decoded.words.slice(1))), 13 | version: decoded.words[0] 14 | }; 15 | }; 16 | 17 | var encode = function(prefix, version, data) { 18 | if (typeof prefix !== 'string') { 19 | throw new Error('Prefix should be a string'); 20 | } 21 | if (typeof version !== 'number') { 22 | throw new Error('version should be a number'); 23 | } 24 | var words = bech32.toWords(data); 25 | words.unshift(version); 26 | return bech32.encode(prefix, words); 27 | } 28 | 29 | module.exports = { decode: decode, encode: encode }; 30 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/lib/script/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./script'); 2 | 3 | module.exports.Interpreter = require('./interpreter'); 4 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/lib/transaction/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./transaction'); 2 | 3 | module.exports.Input = require('./input'); 4 | module.exports.Output = require('./output'); 5 | module.exports.UnspentOutput = require('./unspentoutput'); 6 | module.exports.Signature = require('./signature'); 7 | module.exports.Sighash = require('./sighash'); 8 | module.exports.SighashWitness = require('./sighashwitness'); 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/lib/transaction/input/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./input'); 2 | 3 | module.exports.PublicKey = require('./publickey'); 4 | module.exports.PublicKeyHash = require('./publickeyhash'); 5 | module.exports.MultiSig = require('./multisig.js'); 6 | module.exports.MultiSigScriptHash = require('./multisigscripthash.js'); 7 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/package.json.rej: -------------------------------------------------------------------------------- 1 | --- package.json 2019-10-17 01:44:00.750747824 +0000 2 | +++ package.json 2019-10-17 01:44:00.710748658 +0000 3 | @@ -1,5 +1,5 @@ 4 | { 5 | - "name": "bitcore-lib", 6 | + "name": "bitcore-lib-btg", 7 | "version": "8.6.0", 8 | "description": "A pure and powerful JavaScript Bitcoin library.", 9 | "author": "BitPay ", 10 | @@ -43,13 +43,6 @@ 11 | "inherits": "=2.0.1", 12 | "lodash": "=4.17.15" 13 | }, 14 | - "devDependencies": { 15 | - "bitcore-build": "^8.6.0", 16 | - "brfs": "^2.0.1", 17 | - "chai": "^4.2.0", 18 | - "gulp": "^4.0.0", 19 | - "sinon": "^7.1.1" 20 | - }, 21 | "license": "MIT", 22 | "gitHead": "012cc0216a9bc6b195035855bd17149bad41acd1" 23 | } 24 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/test/data/bitcoind/sig_canonical.json: -------------------------------------------------------------------------------- 1 | [ 2 | "300602010002010001", 3 | "3008020200ff020200ff01", 4 | "304402203932c892e2e550f3af8ee4ce9c215a87f9bb831dcac87b2838e2c2eaa891df0c022030b61dd36543125d56b9f9f3a1f9353189e5af33cdda8d77a5209aec03978fa001", 5 | "30450220076045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01", 6 | "3046022100876045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01" 7 | ] 8 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/test/data/blk86756-testnet.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-lib-btg/test/data/blk86756-testnet.dat -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/test/docs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var chai = require('chai'); 4 | var should = chai.should(); 5 | 6 | var bitcore = require('..'); 7 | var fs = require('fs'); 8 | 9 | describe('Documentation', function() { 10 | 11 | it.skip('major and minor versions should match', function() { 12 | var versionRE = /v[0-9]+\.[0-9]+/; 13 | var docIndex = fs.readFileSync('./docs/index.md', 'ascii'); 14 | var docVersion = docIndex.match(versionRE)[0]; 15 | bitcore.version.indexOf(docVersion).should.equal(0); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var should = require("chai").should(); 4 | var bitcore = require("../"); 5 | 6 | describe('#versionGuard', function() { 7 | it('global._bitcore should be defined', function() { 8 | should.equal(global._bitcore, bitcore.version); 9 | }); 10 | 11 | it('throw an error if version is already defined', function() { 12 | (function() { 13 | bitcore.versionGuard('version'); 14 | }).should.throw('More than one instance of bitcore'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/bitcore-lib-btg/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | --timeout 5000 3 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/.coveralls.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | coverage 3 | node_modules 4 | browser/tests.js 5 | docs/api 6 | 7 | CONTRIBUTING.html 8 | LICENSE.html 9 | README.html 10 | examples.html 11 | npm-debug.log 12 | 13 | apiref 14 | bower_components 15 | report 16 | .DS_Store 17 | 18 | 19 | bitcore.js 20 | bitcore.min.js 21 | bitcore.js.sig 22 | bitcore.min.js.sig 23 | tests.js 24 | bitcore-lib.js 25 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - '8' 5 | install: 6 | - npm ci 7 | after_script: 8 | - gulp coveralls 9 | 10 | cache: 11 | directories: 12 | - "$HOME/.npm" 13 | 14 | dist: trusty # needs Ubuntu Trusty 15 | # Note: if you switch to sudo: false, you'll need to launch Chrome with --no-sandbox. 16 | # See https://github.com/travis-ci/travis-ci/issues/8836 17 | sudo: required 18 | addons: 19 | chrome: stable # have Travis install Chrome stable. 20 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/.zuul.yml: -------------------------------------------------------------------------------- 1 | ui: mocha-bdd 2 | browsers: 3 | - name: chrome 4 | version: 30..latest 5 | - name: firefox 6 | version: 30..latest 7 | - name: ie 8 | version: latest 9 | - name: safari 10 | version: latest 11 | browserify: 12 | - transform: brfs 13 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-lib/tree/cash/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-lib-cash 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-lib/tree/cash/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | ### Bug Fixes 13 | 14 | * **lib-cash:** match bitcore-lib estimateFee fix ([8650345](https://github.com/bitpay/bitcore-lib/tree/cash/commit/8650345)) 15 | 16 | ## [8.0.0](https://github.com/bitpay/bitcore-lib/tree/cash/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 17 | 18 | ### Bug Fixes 19 | 20 | * **lib-cash:** match bitcore-lib estimateFee fix ([8650345](https://github.com/bitpay/bitcore-lib/tree/cash/commit/8650345)) 21 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/benchmark/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "bcoin": "0.15.0", 4 | "bitcoinjs-lib": "^1.5.7", 5 | "fullnode": "^0.9.0", 6 | "benchmark": "^1.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bitcore-lib", 3 | "main": "./bitcore-lib.min.js", 4 | "version": "0.16.3", 5 | "homepage": "http://bitcore.io", 6 | "authors": ["BitPay, Inc."], 7 | "description": "A pure, powerful core for your bitcoin project.", 8 | "moduleType": ["globals"], 9 | "keywords": ["bitcoin", "bitcore", "btc", "satoshi"], 10 | "license": "MIT", 11 | "ignore": [ 12 | "**/.*", 13 | "CONTRIBUTING.md", 14 | "gulpfile.js", 15 | "lib", 16 | "index.js", 17 | "karma.conf.js", 18 | "npm-shrinkwrap.json", 19 | "test" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/docs/encoding.md: -------------------------------------------------------------------------------- 1 | # Encoding 2 | 3 | The `bitcore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem. 4 | 5 | ## Base58 & Base58Check 6 | 7 | Two classes are provided: `Base58` and `Base58Check`. The first one merely encodes/decodes a set of bytes in base58 format. The second one will also take the double `sha256` hash of the information and append the last 4 bytes of the hash as a checksum when encoding, and check this checksum when decoding. 8 | 9 | ## BufferReader & BufferWriter 10 | 11 | These classes are used internally to write information in buffers. 12 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/gulpfile.js: -------------------------------------------------------------------------------- 1 | 2 | var startGulp = require('bitcore-build'); 3 | Object.assign(exports, startGulp('lib')) 4 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/lib/block/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./block'); 2 | 3 | module.exports.BlockHeader = require('./blockheader'); 4 | module.exports.MerkleBlock = require('./merkleblock'); 5 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/lib/script/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./script'); 2 | 3 | module.exports.Interpreter = require('./interpreter'); 4 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/lib/transaction/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./transaction'); 2 | 3 | module.exports.Input = require('./input'); 4 | module.exports.Output = require('./output'); 5 | module.exports.UnspentOutput = require('./unspentoutput'); 6 | module.exports.Signature = require('./signature'); 7 | module.exports.Sighash = require('./sighash'); 8 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/lib/transaction/input/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./input'); 2 | 3 | module.exports.PublicKey = require('./publickey'); 4 | module.exports.PublicKeyHash = require('./publickeyhash'); 5 | module.exports.MultiSig = require('./multisig.js'); 6 | module.exports.MultiSigScriptHash = require('./multisigscripthash.js'); 7 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/convertBits.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var expect = require('chai').expect; 4 | var should = require('chai').should(); 5 | var bitcore = require('..'); 6 | var convertBits = bitcore.util.convertBits; 7 | 8 | describe('convertBits', function() { 9 | 10 | it('should convert 1', function() { 11 | var a = convertBits([1], 16, 10); 12 | a.should.deep.equal([0,16]); 13 | }); 14 | 15 | it('should convert 1,2', function() { 16 | var a = convertBits([1,2], 16, 10); 17 | a.should.deep.equal([0,16,0,512]); 18 | }); 19 | 20 | 21 | it('should fail to convert 16', function() { 22 | (function() { convertBits([16], 2, 10); }).should.throw('Invalid Argument: value 16'); 23 | }); 24 | 25 | 26 | 27 | }); 28 | 29 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/data/bitcoind/sig_canonical.json: -------------------------------------------------------------------------------- 1 | [ 2 | "300602010002010001", 3 | "3008020200ff020200ff01", 4 | "304402203932c892e2e550f3af8ee4ce9c215a87f9bb831dcac87b2838e2c2eaa891df0c022030b61dd36543125d56b9f9f3a1f9353189e5af33cdda8d77a5209aec03978fa001", 5 | "30450220076045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01", 6 | "3046022100876045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01" 7 | ] 8 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/data/blk86756-testnet.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-lib-cash/test/data/blk86756-testnet.dat -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/docs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var chai = require('chai'); 4 | var should = chai.should(); 5 | 6 | var bitcore = require('..'); 7 | var fs = require('fs'); 8 | 9 | describe('Documentation', function() { 10 | 11 | it.skip('major and minor versions should match', function() { 12 | var versionRE = /v[0-9]+\.[0-9]+/; 13 | var docIndex = fs.readFileSync('./docs/index.md', 'ascii'); 14 | var docVersion = docIndex.match(versionRE)[0]; 15 | bitcore.version.indexOf(docVersion).should.equal(0); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var should = require('chai').should(); 4 | var bitcore = require('../'); 5 | 6 | describe('#versionGuard', function() { 7 | it('global._bitcore should be defined', function() { 8 | should.equal(global._bitcoreCash, bitcore.version); 9 | }); 10 | 11 | it('throw an error if version is already defined', function() { 12 | (function() { 13 | bitcore.versionGuard('version'); 14 | }).should.throw('More than one instance of bitcore'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/bitcore-lib-cash/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | --timeout 5000 3 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | coverage 3 | node_modules 4 | browser/tests.js 5 | docs/api 6 | 7 | CONTRIBUTING.html 8 | LICENSE.html 9 | README.html 10 | examples.html 11 | npm-debug.log 12 | 13 | apiref 14 | bower_components 15 | report 16 | .DS_Store 17 | 18 | 19 | litecore.js 20 | litecore.min.js 21 | litecore.js.sig 22 | litecore.min.js.sig 23 | tests.js 24 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - '0.10' 5 | - '0.12' 6 | - '2.0.0' 7 | - '4' 8 | before_install: 9 | - npm install -g bower 10 | - export DISPLAY=:99.0 11 | - sh -e /etc/init.d/xvfb start 12 | install: 13 | - bower install 14 | - npm install 15 | after_script: 16 | - gulp coveralls 17 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/.zuul.yml: -------------------------------------------------------------------------------- 1 | ui: mocha-bdd 2 | browsers: 3 | - name: chrome 4 | version: 30..latest 5 | - name: firefox 6 | version: 30..latest 7 | - name: ie 8 | version: latest 9 | - name: safari 10 | version: latest 11 | browserify: 12 | - transform: brfs 13 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/benchmark/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "bcoin": "0.15.0", 4 | "bitcoinjs-lib": "^1.5.7", 5 | "fullnode": "^0.9.0", 6 | "benchmark": "^1.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "litecore-lib", 3 | "main": "./litecore-lib.min.js", 4 | "version": "0.13.19", 5 | "homepage": "http://litecore.io", 6 | "authors": [ 7 | "BitPay, Inc." 8 | ], 9 | "description": "A pure, powerful core for your litecoin project.", 10 | "moduleType": [ 11 | "globals" 12 | ], 13 | "keywords": [ 14 | "litecoin", 15 | "litecore", 16 | "btc", 17 | "satoshi" 18 | ], 19 | "license": "MIT", 20 | "ignore": [ 21 | "**/.*", 22 | "CONTRIBUTING.md", 23 | "gulpfile.js", 24 | "lib", 25 | "index.js", 26 | "karma.conf.js", 27 | "npm-shrinkwrap.json", 28 | "test" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/docs/encoding.md: -------------------------------------------------------------------------------- 1 | # Encoding 2 | The `litecore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem. 3 | 4 | ## Base58 & Base58Check 5 | Two classes are provided: `Base58` and `Base58Check`. The first one merely encodes/decodes a set of bytes in base58 format. The second one will also take the double `sha256` hash of the information and append the last 4 bytes of the hash as a checksum when encoding, and check this checksum when decoding. 6 | 7 | ## BufferReader & BufferWriter 8 | These classes are used internally to write information in buffers. 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/gulpfile.js: -------------------------------------------------------------------------------- 1 | var startGulp = require('bitcore-build'); 2 | Object.assign(exports, startGulp('lib')) 3 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/lib/block/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./block'); 2 | 3 | module.exports.BlockHeader = require('./blockheader'); 4 | module.exports.MerkleBlock = require('./merkleblock'); 5 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/lib/script/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./script'); 2 | 3 | module.exports.Interpreter = require('./interpreter'); 4 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/lib/transaction/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./transaction'); 2 | 3 | module.exports.Input = require('./input'); 4 | module.exports.Output = require('./output'); 5 | module.exports.UnspentOutput = require('./unspentoutput'); 6 | module.exports.Signature = require('./signature'); 7 | module.exports.Sighash = require('./sighash'); 8 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/lib/transaction/input/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./input'); 2 | 3 | module.exports.PublicKey = require('./publickey'); 4 | module.exports.PublicKeyHash = require('./publickeyhash'); 5 | module.exports.MultiSig = require('./multisig.js'); 6 | module.exports.MultiSigScriptHash = require('./multisigscripthash.js'); 7 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/test/data/bitcoind/sig_canonical.json: -------------------------------------------------------------------------------- 1 | [ 2 | "300602010002010001", 3 | "3008020200ff020200ff01", 4 | "304402203932c892e2e550f3af8ee4ce9c215a87f9bb831dcac87b2838e2c2eaa891df0c022030b61dd36543125d56b9f9f3a1f9353189e5af33cdda8d77a5209aec03978fa001", 5 | "30450220076045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01", 6 | "3046022100876045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01" 7 | ] 8 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/test/data/blk86756-testnet.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-lib-ltc/test/data/blk86756-testnet.dat -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/test/docs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var chai = require('chai'); 4 | var should = chai.should(); 5 | 6 | var bitcore = require('..'); 7 | var fs = require('fs'); 8 | 9 | describe('Documentation', function() { 10 | 11 | it.skip('major and minor versions should match', function() { 12 | var versionRE = /v[0-9]+\.[0-9]+/; 13 | var docIndex = fs.readFileSync('./docs/index.md', 'ascii'); 14 | var docVersion = docIndex.match(versionRE)[0]; 15 | bitcore.version.indexOf(docVersion).should.equal(0); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var should = require('chai').should(); 4 | var litecore = require('../'); 5 | 6 | describe('#versionGuard', function() { 7 | it('global._litecore should be defined', function() { 8 | should.equal(global._litecore, litecore.version); 9 | }); 10 | 11 | it('throw an error if version is already defined', function() { 12 | (function() { 13 | litecore.versionGuard('version'); 14 | }).should.throw('More than one instance of litecore'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/bitcore-lib-ltc/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | --timeout 5000 3 | -------------------------------------------------------------------------------- /packages/bitcore-lib/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: 5ki6iPbGaiwHzIwcfNDzTXoiqAcffqUQs 2 | -------------------------------------------------------------------------------- /packages/bitcore-lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | coverage 3 | node_modules 4 | browser/tests.js 5 | docs/api 6 | 7 | CONTRIBUTING.html 8 | LICENSE.html 9 | README.html 10 | examples.html 11 | npm-debug.log 12 | 13 | apiref 14 | bower_components 15 | report 16 | .DS_Store 17 | 18 | 19 | bitcore.js 20 | bitcore.min.js 21 | bitcore.js.sig 22 | bitcore.min.js.sig 23 | tests.js 24 | -------------------------------------------------------------------------------- /packages/bitcore-lib/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - '8' 5 | install: 6 | - npm ci 7 | after_script: 8 | - gulp coveralls 9 | 10 | cache: 11 | directories: 12 | - "$HOME/.npm" 13 | 14 | dist: trusty # needs Ubuntu Trusty 15 | # Note: if you switch to sudo: false, you'll need to launch Chrome with --no-sandbox. 16 | # See https://github.com/travis-ci/travis-ci/issues/8836 17 | sudo: required 18 | addons: 19 | chrome: stable # have Travis install Chrome stable. 20 | -------------------------------------------------------------------------------- /packages/bitcore-lib/.zuul.yml: -------------------------------------------------------------------------------- 1 | ui: mocha-bdd 2 | browsers: 3 | - name: chrome 4 | version: 30..latest 5 | - name: firefox 6 | version: 30..latest 7 | - name: ie 8 | version: latest 9 | - name: safari 10 | version: latest 11 | browserify: 12 | - transform: brfs 13 | -------------------------------------------------------------------------------- /packages/bitcore-lib/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-lib/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-lib 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-lib/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-lib 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-lib/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-lib/benchmark/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "bcoin": "0.15.0", 4 | "bitcoinjs-lib": "^1.5.7", 5 | "fullnode": "^0.9.0", 6 | "benchmark": "^1.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib/docs/encoding.md: -------------------------------------------------------------------------------- 1 | # Encoding 2 | 3 | The `bitcore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem. 4 | 5 | ## Base58 & Base58Check 6 | 7 | Two classes are provided: `Base58` and `Base58Check`. The first one merely encodes/decodes a set of bytes in base58 format. The second one will also take the double `sha256` hash of the information and append the last 4 bytes of the hash as a checksum when encoding, and check this checksum when decoding. 8 | 9 | ## BufferReader & BufferWriter 10 | 11 | These classes are used internally to write information in buffers. 12 | -------------------------------------------------------------------------------- /packages/bitcore-lib/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var startGulp = require('bitcore-build'); 4 | module.exports = startGulp('lib'); 5 | -------------------------------------------------------------------------------- /packages/bitcore-lib/lib/block/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./block'); 2 | 3 | module.exports.BlockHeader = require('./blockheader'); 4 | module.exports.MerkleBlock = require('./merkleblock'); 5 | -------------------------------------------------------------------------------- /packages/bitcore-lib/lib/encoding/bech32.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var bech32 = require('bech32'); 4 | 5 | var decode = function(str) { 6 | if (typeof str !== 'string') { 7 | throw new Error('Input should be a string'); 8 | } 9 | var decoded = bech32.decode(str); 10 | return { 11 | prefix: decoded.prefix, 12 | data: Buffer.from(bech32.fromWords(decoded.words.slice(1))), 13 | version: decoded.words[0] 14 | }; 15 | }; 16 | 17 | var encode = function(prefix, version, data) { 18 | if (typeof prefix !== 'string') { 19 | throw new Error('Prefix should be a string'); 20 | } 21 | if (typeof version !== 'number') { 22 | throw new Error('version should be a number'); 23 | } 24 | var words = bech32.toWords(data); 25 | words.unshift(version); 26 | return bech32.encode(prefix, words); 27 | } 28 | 29 | module.exports = { decode: decode, encode: encode }; 30 | -------------------------------------------------------------------------------- /packages/bitcore-lib/lib/script/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./script'); 2 | 3 | module.exports.Interpreter = require('./interpreter'); 4 | -------------------------------------------------------------------------------- /packages/bitcore-lib/lib/transaction/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./transaction'); 2 | 3 | module.exports.Input = require('./input'); 4 | module.exports.Output = require('./output'); 5 | module.exports.UnspentOutput = require('./unspentoutput'); 6 | module.exports.Signature = require('./signature'); 7 | module.exports.Sighash = require('./sighash'); 8 | module.exports.SighashWitness = require('./sighashwitness'); 9 | -------------------------------------------------------------------------------- /packages/bitcore-lib/lib/transaction/input/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./input'); 2 | 3 | module.exports.PublicKey = require('./publickey'); 4 | module.exports.PublicKeyHash = require('./publickeyhash'); 5 | module.exports.MultiSig = require('./multisig.js'); 6 | module.exports.MultiSigScriptHash = require('./multisigscripthash.js'); 7 | -------------------------------------------------------------------------------- /packages/bitcore-lib/test/data/bitcoind/sig_canonical.json: -------------------------------------------------------------------------------- 1 | [ 2 | "300602010002010001", 3 | "3008020200ff020200ff01", 4 | "304402203932c892e2e550f3af8ee4ce9c215a87f9bb831dcac87b2838e2c2eaa891df0c022030b61dd36543125d56b9f9f3a1f9353189e5af33cdda8d77a5209aec03978fa001", 5 | "30450220076045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01", 6 | "3046022100876045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01" 7 | ] 8 | -------------------------------------------------------------------------------- /packages/bitcore-lib/test/data/blk86756-testnet.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-lib/test/data/blk86756-testnet.dat -------------------------------------------------------------------------------- /packages/bitcore-lib/test/docs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var chai = require('chai'); 4 | var should = chai.should(); 5 | 6 | var bitcore = require('..'); 7 | var fs = require('fs'); 8 | 9 | describe('Documentation', function() { 10 | 11 | it.skip('major and minor versions should match', function() { 12 | var versionRE = /v[0-9]+\.[0-9]+/; 13 | var docIndex = fs.readFileSync('./docs/index.md', 'ascii'); 14 | var docVersion = docIndex.match(versionRE)[0]; 15 | bitcore.version.indexOf(docVersion).should.equal(0); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/bitcore-lib/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/bitcore-lib/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var should = require("chai").should(); 4 | var bitcore = require("../"); 5 | 6 | describe('#versionGuard', function() { 7 | it('global._bitcore should be defined', function() { 8 | should.equal(global._bitcore, bitcore.version); 9 | }); 10 | 11 | it('throw an error if version is already defined', function() { 12 | (function() { 13 | bitcore.versionGuard('version'); 14 | }).should.throw('More than one instance of bitcore'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/bitcore-lib/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | --timeout 5000 3 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: X6fpngtMTA3osNgvBFV7SAVO3Zes0ejZn -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[a-z] 2 | coverage 3 | node_modules 4 | bitcore-mnemonic.js 5 | bitcore-mnemonic.min.js 6 | tests.js 7 | 8 | lib/errors/index.js 9 | npm-debug.log 10 | 11 | bower_components 12 | report 13 | .DS_Store -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - '8' 5 | install: 6 | - npm install bitcore-lib 7 | - npm ci 8 | after_script: 9 | - gulp coveralls 10 | 11 | cache: 12 | directories: 13 | - "$HOME/.npm" 14 | 15 | dist: trusty # needs Ubuntu Trusty 16 | # Note: if you switch to sudo: false, you'll need to launch Chrome with --no-sandbox. 17 | # See https://github.com/travis-ci/travis-ci/issues/8836 18 | sudo: required 19 | addons: 20 | chrome: stable # have Travis install Chrome stable. 21 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-mnemonic/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-mnemonic 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-mnemonic/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-mnemonic 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-mnemonic/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please see [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo. 4 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/gulpfile.js: -------------------------------------------------------------------------------- 1 | 2 | var startGulp = require('bitcore-build'); 3 | Object.assign(exports, startGulp('mnemonic')) 4 | 5 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/mnemonic'); 2 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/lib/errors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var spec = { 4 | name: 'Mnemonic', 5 | message: 'Internal Error on bitcore-mnemonic module {0}', 6 | errors: [{ 7 | name: 'InvalidEntropy', 8 | message: 'Entropy length must be an even multiple of 11 bits: {0}' 9 | }, { 10 | name: 'UnknownWordlist', 11 | message: 'Could not detect the used word list: {0}' 12 | }, { 13 | name: 'InvalidMnemonic', 14 | message: 'Mnemonic string is invalid: {0}' 15 | }] 16 | }; 17 | 18 | module.exports = require('bitcore-lib').errors.extend(spec); 19 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/lib/words/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'CHINESE': require('./chinese'), 3 | 'ENGLISH': require('./english'), 4 | 'FRENCH': require('./french'), 5 | 'ITALIAN': require('./italian'), 6 | 'JAPANESE': require('./japanese'), 7 | 'KOREAN': require('./korean'), 8 | 'SPANISH': require('./spanish') 9 | }; 10 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/bitcore-mnemonic/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --timeout 7000 2 | -------------------------------------------------------------------------------- /packages/bitcore-node/.dockerignore: -------------------------------------------------------------------------------- 1 | *.csv 2 | *.dat 3 | *.iml 4 | *.log 5 | *.out 6 | *.pid 7 | *.seed 8 | *.sublime-* 9 | *.swo 10 | *.swp 11 | *.tgz 12 | *.xml 13 | .DS_Store 14 | .idea 15 | .project 16 | .strong-pm 17 | coverage 18 | node_modules 19 | npm-debug.log 20 | dist 21 | src/vendor 22 | src/dist 23 | build/ 24 | 25 | Dockerfile 26 | lib -------------------------------------------------------------------------------- /packages/bitcore-node/.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | build 3 | -------------------------------------------------------------------------------- /packages/bitcore-node/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "typescript-eslint-parser", 3 | "parserOptions": { 4 | "ecmaVersion": 2017 5 | }, 6 | "env": { 7 | "es6": true, 8 | "node": true, 9 | "mocha": true 10 | }, 11 | "extends": "eslint:recommended", 12 | "rules": { 13 | "linebreak-style": [ 14 | "error", 15 | "unix" 16 | ], 17 | "quotes": [ 18 | "error", 19 | "single" 20 | ], 21 | "semi": [ 22 | "error", 23 | "always" 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/bitcore-node/.gitignore: -------------------------------------------------------------------------------- 1 | *.csv 2 | *.dat 3 | *.iml 4 | *.log 5 | *.out 6 | *.pid 7 | *.seed 8 | *.sublime-* 9 | *.swo 10 | *.swp 11 | *.tgz 12 | *.xml 13 | .DS_Store 14 | .idea 15 | .project 16 | .strong-pm 17 | coverage 18 | node_modules 19 | npm-debug.log 20 | dist 21 | src/vendor 22 | src/dist 23 | build/ 24 | build-test/ 25 | config.json 26 | *bitcore.config.* 27 | .nyc_output 28 | coverage 29 | -------------------------------------------------------------------------------- /packages/bitcore-node/bin/start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../server.js'); 3 | -------------------------------------------------------------------------------- /packages/bitcore-node/bitcore-node.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Bitcore Node 3 | After=network.target 4 | 5 | [Service] 6 | User=bitcore 7 | Group=bitcore 8 | ExecStart=/usr/bin/node /home/bitcore/bitcore/packages/bitcore-node/server.js 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/docs/test-guide.md: -------------------------------------------------------------------------------- 1 | # Set up to run the tests. 2 | 3 | 1. copy ../../bitcore-test.config.json to ../../bitcore.config.json 4 | 2. run mongod 5 | 3. run bitcoin-code's bitcoind (tested with version v0.19) with: 6 | `./bitcoind -regtest -rpcpassword=bitcorenodetest -rpcuser=local321 --rpcport=18332 --addresstype=legacy` 7 | -------------------------------------------------------------------------------- /packages/bitcore-node/repair-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": "coin", 3 | "err": false, 4 | "type": "DUPE_COIN", 5 | "payload": { 6 | "_id": "5c48e2c2da7e008375b939a8", 7 | "chain": "BTC", 8 | "mintIndex": 0, 9 | "mintTxid": "0a7884c351f3bd2fa7cea7ca2dad00948b766c634799d915ff67a51d5406ed01", 10 | "network": "regtest", 11 | "address": "mhv4A44iaS21xeegHxdCaCYWmeeve3Ungb", 12 | "coinbase": true, 13 | "mintHeight": 6, 14 | "spentHeight": 4, 15 | "value": 5000000000, 16 | "wallets": [] 17 | } 18 | } -------------------------------------------------------------------------------- /packages/bitcore-node/src/chain.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | BTG: { 3 | lib: require('bitcore-lib-btg'), 4 | p2p: require('bitcore-p2p-btg'), 5 | p2pV: 70010 6 | } /* , 7 | BTC: { 8 | lib: require('bitcore-lib'), 9 | p2p: require('bitcore-p2p') 10 | }, 11 | BCH: { 12 | lib: require('bitcore-lib-cash'), 13 | p2p: require('bitcore-p2p-cash'), 14 | }, */ 15 | }; 16 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/models/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | *require('../models/coin'); 3 | *require('../models/walletAddress'); 4 | *require('../models/transaction'); 5 | *require('../models/wallet'); 6 | *require('../models/block'); 7 | * 8 | */ 9 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/bitcoin-cash/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseModule } from '..'; 2 | import { BCHStateProvider } from '../../providers/chain-state/bch/bch'; 3 | import { BitcoinP2PWorker } from '../bitcoin/p2p'; 4 | import { VerificationPeer } from '../bitcoin/VerificationPeer'; 5 | 6 | export default class BCHModule extends BaseModule { 7 | constructor(services) { 8 | super(services); 9 | services.Libs.register('BCH', 'bitcore-lib-cash', 'bitcore-p2p-cash'); 10 | services.P2P.register('BCH', BitcoinP2PWorker); 11 | services.CSP.registerService('BCH', new BCHStateProvider()); 12 | services.Verification.register('BCH', VerificationPeer); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/bitcoin-gold/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseModule } from '..'; 2 | import { BTGStateProvider } from '../../providers/chain-state/btg/btg'; 3 | import { BitcoinP2PWorker } from '../bitcoin/p2p'; 4 | 5 | export default class BTGModule extends BaseModule { 6 | constructor(services) { 7 | super(services); 8 | services.Libs.register('BTG', 'bitcore-lib-btg', 'bitcore-p2p-btg'); 9 | services.P2P.register('BTG', BitcoinP2PWorker); 10 | services.CSP.registerService('BTG', new BTGStateProvider()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/bitcoin/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseModule } from '..'; 2 | import { BTCStateProvider } from '../../providers/chain-state/btc/btc'; 3 | import { BitcoinP2PWorker } from './p2p'; 4 | import { VerificationPeer } from './VerificationPeer'; 5 | 6 | export default class BitcoinModule extends BaseModule { 7 | constructor(services: BaseModule['bitcoreServices']) { 8 | super(services); 9 | services.Libs.register('BTC', 'bitcore-lib', 'bitcore-p2p'); 10 | services.P2P.register('BTC', BitcoinP2PWorker); 11 | services.CSP.registerService('BTC', new BTCStateProvider()); 12 | services.Verification.register('BTC', VerificationPeer); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/ethereum/api/populateReceiptTransform.ts: -------------------------------------------------------------------------------- 1 | import { Transform } from 'stream'; 2 | import { MongoBound } from '../../../models/base'; 3 | import { IEthTransaction } from '../types'; 4 | import { ETH } from './csp'; 5 | 6 | export class PopulateReceiptTransform extends Transform { 7 | constructor() { 8 | super({ objectMode: true }); 9 | } 10 | 11 | async _transform(tx: MongoBound, _, done) { 12 | try { 13 | tx = await ETH.populateReceipt(tx); 14 | } catch (e) {} 15 | this.push(tx); 16 | return done(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/ethereum/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseModule } from '..'; 2 | import { ETHStateProvider } from './api/csp'; 3 | import { EthRoutes } from './api/eth-routes'; 4 | import { EthVerificationPeer } from './p2p/EthVerificationPeer'; 5 | import { EthP2pWorker } from './p2p/p2p'; 6 | 7 | export default class ETHModule extends BaseModule { 8 | constructor(services: BaseModule['bitcoreServices']) { 9 | super(services); 10 | services.P2P.register('ETH', EthP2pWorker); 11 | services.CSP.registerService('ETH', new ETHStateProvider()); 12 | services.Api.app.use(EthRoutes); 13 | services.Verification.register('ETH', EthVerificationPeer); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/ripple/api/xrp-routes.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | import { XRP } from './csp'; 3 | export const XrpRoutes = Router(); 4 | 5 | XrpRoutes.get('/api/XRP/:network/address/:address/txs/count', async (req, res) => { 6 | let { address, network } = req.params; 7 | try { 8 | const nonce = await XRP.getAccountNonce(network, address); 9 | res.json({ nonce }); 10 | } catch (err) { 11 | res.status(500).send(err); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/modules/ripple/types.ts: -------------------------------------------------------------------------------- 1 | import { IBlock } from '../../models/baseBlock'; 2 | import { ITransaction } from '../../models/baseTransaction'; 3 | import { ICoin } from '../../models/coin'; 4 | 5 | export type IXrpBlock = IBlock & {}; 6 | export type IXrpTransaction = ITransaction & { 7 | from: string; 8 | to?: string; 9 | nonce: number; 10 | currency?: string; 11 | invoiceID?: string; 12 | }; 13 | 14 | export interface XrpTransactionJSON { 15 | txid: string; 16 | chain: string; 17 | network: string; 18 | blockHeight: number; 19 | blockHash: string; 20 | blockTime: string; 21 | blockTimeNormalized: string; 22 | fee: number; 23 | value: number; 24 | from: string; 25 | to: string; 26 | nonce: number; 27 | currency?: string; 28 | invoiceID?: string; 29 | } 30 | 31 | export type IXrpCoin = ICoin & {}; 32 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/providers/chain-state/bch/bch.ts: -------------------------------------------------------------------------------- 1 | import { CacheStorage } from '../../../models/cache'; 2 | import { GetEstimateSmartFeeParams } from '../../../types/namespaces/ChainStateProvider'; 3 | import { BTCStateProvider } from '../btc/btc'; 4 | 5 | export class BCHStateProvider extends BTCStateProvider { 6 | constructor(chain: string = 'BCH') { 7 | super(chain); 8 | } 9 | 10 | async getFee(params: GetEstimateSmartFeeParams) { 11 | const { chain, network } = params; 12 | const cacheKey = `getFee-${chain}-${network}`; 13 | return CacheStorage.getGlobalOrRefresh( 14 | cacheKey, 15 | async () => { 16 | return { feerate: await this.getRPC(chain, network).getEstimateFee() }; 17 | }, 18 | 30 * CacheStorage.Times.Minute 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/providers/chain-state/btc/btc.ts: -------------------------------------------------------------------------------- 1 | import { InternalStateProvider } from '../internal/internal'; 2 | 3 | export class BTCStateProvider extends InternalStateProvider { 4 | constructor(chain: string = 'BTC') { 5 | super(chain); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/providers/chain-state/btg/btg.ts: -------------------------------------------------------------------------------- 1 | import { InternalStateProvider } from '../internal/internal'; 2 | 3 | export class BTGStateProvider extends InternalStateProvider { 4 | constructor(chain: string = 'BTG') { 5 | super(chain); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/providers/libs/index.ts: -------------------------------------------------------------------------------- 1 | class LibProvider { 2 | libs = { 3 | BTC: { 4 | lib: require('bitcore-lib'), 5 | p2p: require('bitcore-p2p') 6 | } 7 | }; 8 | 9 | register(chain: string, lib: string, p2p: string) { 10 | this.libs[chain] = { lib: require(lib), p2p: require(p2p) }; 11 | } 12 | 13 | get(chain) { 14 | return this.libs[chain]; 15 | } 16 | } 17 | 18 | export const Libs = new LibProvider(); 19 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/routes/api/valid.ts: -------------------------------------------------------------------------------- 1 | import express = require('express'); 2 | const router = express.Router({ mergeParams: true }); 3 | import { ChainStateProvider } from '../../providers/chain-state'; 4 | 5 | router.get('/:input', async function(req, res) { 6 | let { input, chain, network } = req.params; 7 | try { 8 | let isValid = await ChainStateProvider.isValid({ 9 | chain, 10 | network, 11 | input 12 | }); 13 | return res.send(isValid); 14 | } catch (err) { 15 | return res.status(500).send(err); 16 | } 17 | }); 18 | 19 | module.exports = { 20 | router, 21 | path: '/valid' 22 | }; 23 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/server.ts: -------------------------------------------------------------------------------- 1 | import './utils/polyfills'; 2 | import { FullClusteredWorker } from './workers/all'; 3 | require('heapdump'); 4 | FullClusteredWorker(); 5 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Authhead.ts: -------------------------------------------------------------------------------- 1 | import { CoinJSON } from './Coin'; 2 | 3 | export interface AuthheadJSON { 4 | chain: string; 5 | network: string; 6 | authbase: string; 7 | identityOutputs: CoinJSON[]; 8 | } 9 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/BitcoinConfig.ts: -------------------------------------------------------------------------------- 1 | import { HostPort } from './HostPort'; 2 | import { UserPassword } from './UserPassword'; 3 | 4 | export interface ConnectionConfig { 5 | chainSource: string; 6 | trustedPeers: Array; 7 | rpc: HostPort & UserPassword; 8 | parentChain: 'BTG'; 9 | forkHeight: number; 10 | } 11 | export interface NetworkConfig { 12 | [network: string]: ConnectionConfig; 13 | } 14 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Bitcore-P2P-Pool.ts: -------------------------------------------------------------------------------- 1 | import EventEmitter = require('events'); 2 | export interface Peer { 3 | bestHeight: number; 4 | } 5 | export type BitcoreP2pPool = EventEmitter & { 6 | connect: () => any; 7 | _connectedPeers: Peer[]; 8 | sendMessage: (message: string) => any; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Block.ts: -------------------------------------------------------------------------------- 1 | export interface IBlock { 2 | chain: string; 3 | confirmations?: number; 4 | network: string; 5 | height: number; 6 | hash: string; 7 | time: Date; 8 | timeNormalized: Date; 9 | previousBlockHash: string; 10 | nextBlockHash: string; 11 | transactionCount: number; 12 | size: number; 13 | reward: number; 14 | processed: boolean; 15 | } 16 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Callback.ts: -------------------------------------------------------------------------------- 1 | export type CallbackType = (err?: any, data?: D) => R; 2 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/ChainNetwork.ts: -------------------------------------------------------------------------------- 1 | export interface Chain { 2 | chain: string; 3 | } 4 | export interface Network { 5 | network: string; 6 | } 7 | export type ChainNetwork = Chain & Network; 8 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Class.ts: -------------------------------------------------------------------------------- 1 | type Class = new (...args: any[]) => T; 2 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/HostPort.ts: -------------------------------------------------------------------------------- 1 | export interface HostPort { 2 | host: string; 3 | port: number; 4 | } 5 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Mapping.ts: -------------------------------------------------------------------------------- 1 | interface Mapping { 2 | [key: string]: V; 3 | } 4 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Query.ts: -------------------------------------------------------------------------------- 1 | import { ObjectId } from 'bson'; 2 | export const enum Direction { 3 | ascending = 1, 4 | descending = -1 5 | } 6 | 7 | export type StreamingFindOptions = Partial<{ 8 | paging: keyof T | '_id'; 9 | since: T[keyof T] | ObjectId; 10 | sort: any; 11 | direction: Direction; 12 | limit: number; 13 | }>; 14 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/SupportedChain.ts: -------------------------------------------------------------------------------- 1 | export const SupportedChainSet = { 2 | BTG: true 3 | // BTC: true, 4 | // BCH: true 5 | }; 6 | 7 | export type SupportedChain = keyof typeof SupportedChainSet; 8 | 9 | export function isChainSupported(chain: string): chain is SupportedChain { 10 | return SupportedChainSet.hasOwnProperty(chain); 11 | } 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Transaction.ts: -------------------------------------------------------------------------------- 1 | export interface TransactionJSON { 2 | _id: string; 3 | txid: string; 4 | chain: string; 5 | network: string; 6 | blockHeight: number; 7 | blockHash: string; 8 | blockTime: string; 9 | blockTimeNormalized: string; 10 | coinbase: boolean; 11 | fee: number; 12 | size: number; 13 | locktime: number; 14 | inputCount: number; 15 | outputCount: number; 16 | value: number; 17 | } 18 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/TransformOptions.ts: -------------------------------------------------------------------------------- 1 | export interface TransformOptions { 2 | object: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/TransformableModel.ts: -------------------------------------------------------------------------------- 1 | import { BaseModel, MongoBound } from '../models/base'; 2 | import { TransformOptions } from './TransformOptions'; 3 | interface TransformProperty { 4 | _apiTransform: (model: T | MongoBound, options?: TransformOptions) => any; 5 | } 6 | export type TransformableModel = BaseModel & TransformProperty; 7 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/UserPassword.ts: -------------------------------------------------------------------------------- 1 | export interface UserPassword { 2 | username: string; 3 | password: string; 4 | } 5 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/Worker.ts: -------------------------------------------------------------------------------- 1 | interface Task { 2 | task: any; 3 | argument: any; 4 | id: string; 5 | } 6 | export interface WorkerType { 7 | process: NodeJS.Process; 8 | send(task: Task): any; 9 | } 10 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/namespaces/Bitcoin/Block.ts: -------------------------------------------------------------------------------- 1 | import { BitcoinTransactionType } from './Transaction'; 2 | export interface BlockHeaderObj { 3 | prevHash: string; 4 | hash: string; 5 | time: number; 6 | version: number; 7 | merkleRoot: string; 8 | bits: number; 9 | nonce: number; 10 | } 11 | export interface BlockHeader { 12 | toObject: () => BlockHeaderObj; 13 | } 14 | export interface BitcoinBlockType { 15 | hash: string; 16 | transactions: BitcoinTransactionType[]; 17 | header: BlockHeader; 18 | toBuffer: () => Buffer; 19 | } 20 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/namespaces/Bitcoin/index.ts: -------------------------------------------------------------------------------- 1 | import { BitcoinBlockType, BlockHeader, BlockHeaderObj } from './Block'; 2 | import { 3 | BitcoinAddress, 4 | BitcoinInput, 5 | BitcoinInputObj, 6 | BitcoinOutput, 7 | BitcoinScript, 8 | BitcoinTransactionType 9 | } from './Transaction'; 10 | 11 | export type BitcoinBlockType = BitcoinBlockType; 12 | export type BitcoinTransaction = BitcoinTransactionType; 13 | export type BitcoinScript = BitcoinScript; 14 | export type BitcoinAddress = BitcoinAddress; 15 | 16 | export type TransactionOutput = BitcoinOutput; 17 | export type TransactionInput = BitcoinInput; 18 | export type TransactionInputObj = BitcoinInputObj; 19 | 20 | export type BitcoinHeader = BlockHeader; 21 | export type BitcoinHeaderObj = BlockHeaderObj; 22 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/types/stats.ts: -------------------------------------------------------------------------------- 1 | export interface DailyTransactionsJSON { 2 | chain: string; 3 | network: string; 4 | results: Array<{ 5 | date: string; 6 | transactionCount: number; 7 | }>; 8 | } 9 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/utils/check.ts: -------------------------------------------------------------------------------- 1 | export function isUndefined(value: T) { 2 | return value === undefined; 3 | } 4 | 5 | export function valueOrDefault(value: T | undefined, defaultVal: T): T { 6 | return value != undefined ? value : defaultVal; 7 | } 8 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/utils/partition.ts: -------------------------------------------------------------------------------- 1 | export function partition(array: T[], n: number): T[][] { 2 | n = n > 0 ? Math.ceil(n) : 1; 3 | return array.length ? [array.slice(0, n)].concat(partition(array.slice(n), n)) : []; 4 | } 5 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/utils/polyfills.ts: -------------------------------------------------------------------------------- 1 | if (Symbol['asyncIterator'] === undefined) (Symbol as any)['asyncIterator'] = Symbol.for('asyncIterator'); 2 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/utils/stats.ts: -------------------------------------------------------------------------------- 1 | export class StatsUtil { 2 | /** 3 | * @param {Array} array - A sorted array of values to be used for quartiles 4 | * @param {number} n - which quartile do you want the median from 5 | * @returns {T} - The median of nth quartile 6 | */ 7 | static getNthQuartileMedian(array: Array, n: number): T { 8 | if (n < 1 || n > 4) { 9 | throw new Error('second parameter must be between 1 and 4'); 10 | } 11 | const quartileLength = Math.floor(array.length / 4); 12 | const quartileStartPoint = (n - 1) * quartileLength; 13 | const quartileMidpoint = quartileStartPoint + Math.floor(quartileLength / 2); 14 | const quartileMedian = array[quartileMidpoint]; 15 | return quartileMedian; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/utils/stringifyJsonStream.ts: -------------------------------------------------------------------------------- 1 | import { Transform } from 'stream'; 2 | 3 | export class StringifyJsonStream extends Transform { 4 | constructor() { 5 | super({ objectMode: true }); 6 | } 7 | _transform(item, _, done) { 8 | this.push(JSON.stringify(item) + '\n'); 9 | done(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/src/utils/wait.ts: -------------------------------------------------------------------------------- 1 | export async function wait(time: number) { 2 | return new Promise(resolve => setTimeout(resolve, time)); 3 | } 4 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/helpers/unit.ts: -------------------------------------------------------------------------------- 1 | import { Modules } from '../../src/modules'; 2 | 3 | let loaded = false; 4 | export async function unitBeforeHelper() { 5 | if (!loaded) { 6 | console.time('Loading Modules'); 7 | Modules.loadConfigured(); 8 | loaded = true; 9 | console.timeEnd('Loading Modules'); 10 | } 11 | } 12 | 13 | export async function unitAfterHelper() {} 14 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/bitcoin/csp.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { CacheStorage } from '../../../src/models/cache'; 3 | import { ChainStateProvider } from '../../../src/providers/chain-state'; 4 | import { intAfterHelper, intBeforeHelper } from '../../helpers/integration'; 5 | describe('Bitcoin API', function() { 6 | const suite = this; 7 | this.timeout(30000); 8 | before(intBeforeHelper); 9 | after(async () => intAfterHelper(suite)); 10 | 11 | it('should be able to get the fees', async () => { 12 | const chain = 'BTC'; 13 | const network = 'regtest'; 14 | const target = 1; 15 | const cacheKey = `getFee-${chain}-${network}-${target}`; 16 | const fee = await ChainStateProvider.getFee({ chain, network, target }); 17 | expect(fee).to.exist; 18 | const cached = await CacheStorage.getGlobal(cacheKey); 19 | expect(fee).to.deep.eq(cached); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/logger.spec.ts: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | 3 | describe('logger', function(){ 4 | it('should have a test which runs', function(){ 5 | expect(true).to.equal(true); 6 | }); 7 | }); -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/models/coin.spec.ts: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | 3 | describe('Coin Model', function(){ 4 | it('should have a test which runs', function(){ 5 | expect(true).to.equal(true); 6 | }); 7 | }); -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/models/walletAddress.spec.ts: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | 3 | describe('WalletAddress Model', function(){ 4 | it('should have a test which runs', function(){ 5 | expect(true).to.equal(true); 6 | }); 7 | }); -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/rpc.spec.ts: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | 3 | describe('rpc', function(){ 4 | it('should have a test which runs', function(){ 5 | expect(true).to.equal(true); 6 | }); 7 | }); -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/server.spec.ts: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | 3 | describe('server', function(){ 4 | it('should have a test which runs', function(){ 5 | expect(true).to.equal(true); 6 | }); 7 | }); -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/services/event.integration.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { Event } from '../../../src/services/event'; 3 | import { intAfterHelper, intBeforeHelper } from '../../helpers/integration'; 4 | 5 | describe('Event Service', function() { 6 | const suite = this; 7 | this.timeout(30000); 8 | before(intBeforeHelper); 9 | after(async () => intAfterHelper(suite)); 10 | 11 | it('should be able to start and stop', async () => { 12 | await Event.start(); 13 | await Event.stop(); 14 | expect(true).to.equal(true); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/services/storage.integration.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { intAfterHelper, intBeforeHelper } from '../../helpers/integration'; 3 | 4 | describe('Storage Service', function() { 5 | const suite = this; 6 | this.timeout(30000); 7 | before(intBeforeHelper); 8 | after(async () => intAfterHelper(suite)); 9 | 10 | it('should have a test which runs', function() { 11 | expect(true).to.equal(true); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/integration/services/worker.integration.ts: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | 3 | describe('Worker Service', function(){ 4 | it('should have a test which runs', function(){ 5 | expect(true).to.equal(true); 6 | }); 7 | }); -------------------------------------------------------------------------------- /packages/bitcore-node/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require source-map-support/register 2 | --recursive 3 | --exit 4 | --timeout 5000 5 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/unit/logger.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { unitAfterHelper, unitBeforeHelper } from '../helpers/unit'; 3 | 4 | describe('logger', function() { 5 | before(unitBeforeHelper); 6 | after(unitAfterHelper); 7 | 8 | it('should have a test which runs', function() { 9 | expect(true).to.equal(true); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/unit/rpc.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { unitAfterHelper, unitBeforeHelper } from '../helpers/unit'; 3 | 4 | describe('rpc', function() { 5 | before(unitBeforeHelper); 6 | after(unitAfterHelper); 7 | 8 | it('should have a test which runs', function() { 9 | expect(true).to.equal(true); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/unit/server.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { unitAfterHelper, unitBeforeHelper } from '../helpers/unit'; 3 | 4 | describe('server', function() { 5 | before(unitBeforeHelper); 6 | after(unitAfterHelper); 7 | 8 | it('should have a test which runs', function() { 9 | expect(true).to.equal(true); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/unit/services/storage.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { unitAfterHelper, unitBeforeHelper } from '../../helpers/unit'; 3 | 4 | describe('Storage Service', function() { 5 | before(unitBeforeHelper); 6 | after(unitAfterHelper); 7 | 8 | it('should have a test which runs', function() { 9 | expect(true).to.equal(true); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/unit/services/worker.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import { unitAfterHelper, unitBeforeHelper } from '../../helpers/unit'; 3 | 4 | describe('Worker Service', function() { 5 | before(unitBeforeHelper); 6 | after(unitAfterHelper); 7 | 8 | it('should have a test which runs', function() { 9 | expect(true).to.equal(true); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/bitcore-node/test/verification/resync.ts: -------------------------------------------------------------------------------- 1 | import { Config } from '../../src/services/config'; 2 | import { Storage } from '../../src/services/storage'; 3 | import { Modules } from '../../src/modules'; 4 | import { VerificationPeer } from '../../src/modules/bitcoin/VerificationPeer'; 5 | 6 | // Load modules 7 | Modules.loadConfigured(); 8 | 9 | (async () => { 10 | const { CHAIN: chain, NETWORK: network, START, END } = process.env; 11 | if (!chain || !network || !START || !END) { 12 | console.log('CHAIN, NETWORK, START, and END are required env variables'); 13 | process.exit(1); 14 | } else { 15 | await Storage.start(); 16 | const chainConfig = Config.chainConfig({ chain, network }); 17 | const worker = new VerificationPeer({ chain, network, chainConfig }); 18 | await worker.connect(); 19 | 20 | await worker.resync(Number(START), Number(END)); 21 | 22 | process.exit(0); 23 | } 24 | })(); 25 | -------------------------------------------------------------------------------- /packages/bitcore-node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "lib": ["es2017", "esnext", "esnext.asynciterable"], 6 | "downlevelIteration": true, 7 | "allowJs": true, 8 | "sourceMap": true, 9 | "outDir": "build", 10 | "strict": true, 11 | "noImplicitAny": false, 12 | "strictNullChecks": true, 13 | "strictFunctionTypes": true, 14 | "strictPropertyInitialization": true, 15 | "noImplicitThis": true, 16 | "noUnusedLocals": true, 17 | "noUnusedParameters": true, 18 | "noImplicitReturns": true, 19 | "noFallthroughCasesInSwitch": true, 20 | "types": ["mocha"], 21 | "esModuleInterop": true, 22 | "experimentalDecorators": true 23 | }, 24 | "include": ["./src/**/*", "./test/**/*"] 25 | } 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: OMJRNZCl018Yjy44nlG1hF6maKEyXcwPx 2 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[a-z] 2 | coverage 3 | node_modules 4 | 5 | npm-debug.log 6 | tests.js 7 | 8 | report 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '4' 4 | - '6' 5 | before_install: 6 | - export DISPLAY=:99.0 7 | - sh -e /etc/init.d/xvfb start 8 | install: 9 | - npm install 10 | after_script: 11 | - gulp coveralls 12 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-p2p/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-p2p 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-p2p/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-p2p 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-p2p/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please see [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo. 4 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var startGulp = require('bitcore-build'); 4 | module.exports = startGulp('p2p', {skipBrowser: true}) 5 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/index.js: -------------------------------------------------------------------------------- 1 | var bitcore = require('bitcore-lib-btg'); 2 | bitcore.P2P = require('./lib'); 3 | 4 | module.exports = bitcore.P2P; 5 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/buffers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Buffers = require('buffers'); 4 | 5 | Buffers.prototype.skip = function(i) { 6 | if (i === 0) { 7 | return; 8 | } 9 | 10 | if (i >= this.length) { 11 | this.buffers = []; 12 | this.length = 0; 13 | return; 14 | } 15 | 16 | var pos = this.pos(i); 17 | this.buffers = this.buffers.slice(pos.buf); 18 | this.buffers[0] = new Buffer(this.buffers[0].slice(pos.offset)); 19 | this.length -= i; 20 | }; 21 | 22 | module.exports = Buffers; 23 | 24 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/errors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var spec = { 4 | name: 'P2P', 5 | message: 'Internal Error on bitcore-p2p Module {0}' 6 | }; 7 | 8 | module.exports = require('bitcore-lib-btg').errors.extend(spec); 9 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace P2P 3 | */ 4 | 5 | module.exports = { 6 | Inventory: require('./inventory'), 7 | BloomFilter: require('./bloomfilter'), 8 | Messages: require('./messages'), 9 | Peer: require('./peer'), 10 | Pool: require('./pool') 11 | }; 12 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/messages/commands/filterclear.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-btg'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Request peer to clear data for a bloom filter 10 | * @extends Message 11 | * @constructor 12 | */ 13 | function FilterclearMessage(arg, options) { 14 | Message.call(this, options); 15 | this.command = 'filterclear'; 16 | } 17 | inherits(FilterclearMessage, Message); 18 | 19 | FilterclearMessage.prototype.setPayload = function() {}; 20 | 21 | FilterclearMessage.prototype.getPayload = function() { 22 | return BufferUtil.EMPTY_BUFFER; 23 | }; 24 | 25 | module.exports = FilterclearMessage; 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/messages/commands/getaddr.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-btg'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Request information about active peers 10 | * @extends Message 11 | * @param {Object} options 12 | * @constructor 13 | */ 14 | function GetaddrMessage(arg, options) { 15 | Message.call(this, options); 16 | this.command = 'getaddr'; 17 | } 18 | inherits(GetaddrMessage, Message); 19 | 20 | GetaddrMessage.prototype.setPayload = function() {}; 21 | 22 | GetaddrMessage.prototype.getPayload = function() { 23 | return BufferUtil.EMPTY_BUFFER; 24 | }; 25 | 26 | module.exports = GetaddrMessage; 27 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/messages/commands/sendheaders.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-btg'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | function SendHeadersMessage(arg, options) { 9 | Message.call(this, options); 10 | this.command = 'sendheaders'; 11 | } 12 | inherits(SendHeadersMessage, Message); 13 | 14 | SendHeadersMessage.prototype.setPayload = function() {}; 15 | 16 | SendHeadersMessage.prototype.getPayload = function() { 17 | return BufferUtil.EMPTY_BUFFER; 18 | }; 19 | 20 | module.exports = SendHeadersMessage; 21 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/lib/messages/commands/verack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-btg'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * A message in response to a version message. 10 | * @extends Message 11 | * @constructor 12 | */ 13 | function VerackMessage(arg, options) { 14 | Message.call(this, options); 15 | this.command = 'verack'; 16 | } 17 | inherits(VerackMessage, Message); 18 | 19 | VerackMessage.prototype.setPayload = function() {}; 20 | 21 | VerackMessage.prototype.getPayload = function() { 22 | return BufferUtil.EMPTY_BUFFER; 23 | }; 24 | 25 | module.exports = VerackMessage; 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/test/data/connection.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-p2p-btg/test/data/connection.log -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/test/messages/builder.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var should = require('chai').should(); 4 | var P2P = require('../../'); 5 | var builder = P2P.Messages.builder; 6 | var bitcore = require('bitcore-lib-btg'); 7 | 8 | describe('Messages Builder', function() { 9 | 10 | describe('@constructor', function() { 11 | 12 | it('should return commands based on default', function() { 13 | // instantiate 14 | var b = builder(); 15 | should.exist(b); 16 | }); 17 | 18 | it('should return commands with customizations', function() { 19 | // instantiate 20 | var b = builder({ 21 | network: bitcore.Networks.testnet, 22 | Block: bitcore.Block, 23 | Transaction: bitcore.Transaction 24 | }); 25 | should.exist(b); 26 | }); 27 | 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-btg/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: OMJRNZCl018Yjy44nlG1hF6maKEyXcwPx 2 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[a-z] 2 | coverage 3 | node_modules 4 | 5 | npm-debug.log 6 | tests.js 7 | 8 | report 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '4' 4 | - '6' 5 | before_install: 6 | - export DISPLAY=:99.0 7 | - sh -e /etc/init.d/xvfb start 8 | install: 9 | - npm install 10 | after_script: 11 | - gulp coveralls 12 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-p2p/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-p2p-cash 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-p2p/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-p2p-cash 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-p2p/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please see [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo. 4 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var startGulp = require('bitcore-build'); 4 | Object.assign(exports, startGulp('p2p', {skipBrowser: true})) 5 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/index.js: -------------------------------------------------------------------------------- 1 | var bitcore = require('bitcore-lib-cash'); 2 | bitcore.P2P = require('./lib'); 3 | 4 | module.exports = bitcore.P2P; 5 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/buffers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Buffers = require('buffers'); 4 | 5 | Buffers.prototype.skip = function(i) { 6 | if (i === 0) { 7 | return; 8 | } 9 | 10 | if (i >= this.length) { 11 | this.buffers = []; 12 | this.length = 0; 13 | return; 14 | } 15 | 16 | var pos = this.pos(i); 17 | this.buffers = this.buffers.slice(pos.buf); 18 | this.buffers[0] = Buffer.from(this.buffers[0].slice(pos.offset)); 19 | this.length -= i; 20 | }; 21 | 22 | module.exports = Buffers; 23 | 24 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/errors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var spec = { 4 | name: 'P2P', 5 | message: 'Internal Error on bitcore-p2p Module {0}' 6 | }; 7 | 8 | module.exports = require('bitcore-lib-cash').errors.extend(spec); 9 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace P2P 3 | */ 4 | 5 | module.exports = { 6 | Inventory: require('./inventory'), 7 | BloomFilter: require('./bloomfilter'), 8 | Messages: require('./messages'), 9 | Peer: require('./peer'), 10 | Pool: require('./pool') 11 | }; 12 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/messages/commands/filterclear.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-cash'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Request peer to clear data for a bloom filter 10 | * @extends Message 11 | * @constructor 12 | */ 13 | function FilterclearMessage(arg, options) { 14 | Message.call(this, options); 15 | this.command = 'filterclear'; 16 | } 17 | inherits(FilterclearMessage, Message); 18 | 19 | FilterclearMessage.prototype.setPayload = function() {}; 20 | 21 | FilterclearMessage.prototype.getPayload = function() { 22 | return BufferUtil.EMPTY_BUFFER; 23 | }; 24 | 25 | module.exports = FilterclearMessage; 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/messages/commands/getaddr.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-cash'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Request information about active peers 10 | * @extends Message 11 | * @param {Object} options 12 | * @constructor 13 | */ 14 | function GetaddrMessage(arg, options) { 15 | Message.call(this, options); 16 | this.command = 'getaddr'; 17 | } 18 | inherits(GetaddrMessage, Message); 19 | 20 | GetaddrMessage.prototype.setPayload = function() {}; 21 | 22 | GetaddrMessage.prototype.getPayload = function() { 23 | return BufferUtil.EMPTY_BUFFER; 24 | }; 25 | 26 | module.exports = GetaddrMessage; 27 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/messages/commands/sendheaders.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-cash'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * A message indicating that the node prefers to receive new block announcements 10 | * via a `headers` message rather than an `inv` (BIP130). 11 | * @extends Message 12 | * @constructor 13 | */ 14 | function SendHeadersMessage(arg, options) { 15 | Message.call(this, options); 16 | this.command = 'sendheaders'; 17 | } 18 | inherits(SendHeadersMessage, Message); 19 | 20 | SendHeadersMessage.prototype.setPayload = function() {}; 21 | 22 | SendHeadersMessage.prototype.getPayload = function() { 23 | return BufferUtil.EMPTY_BUFFER; 24 | }; 25 | 26 | module.exports = SendHeadersMessage; 27 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/messages/commands/verack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-cash'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * A message in response to a version message. 10 | * @extends Message 11 | * @constructor 12 | */ 13 | function VerackMessage(arg, options) { 14 | Message.call(this, options); 15 | this.command = 'verack'; 16 | } 17 | inherits(VerackMessage, Message); 18 | 19 | VerackMessage.prototype.setPayload = function() {}; 20 | 21 | VerackMessage.prototype.getPayload = function() { 22 | return BufferUtil.EMPTY_BUFFER; 23 | }; 24 | 25 | module.exports = VerackMessage; 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/lib/messages/commands/xversion.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib-cash'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Transports a generic key-value map that holds the configuration and version parameters. 10 | * https://github.com/BitcoinUnlimited/BitcoinUnlimited/blob/release/doc/xversionmessage.md 11 | * Placeholder until it's actually made use of 12 | * @extends Message 13 | * @constructor 14 | */ 15 | function XversionMessage(arg, options) { 16 | Message.call(this, options); 17 | this.command = 'Xversion'; 18 | } 19 | inherits(XversionMessage, Message); 20 | 21 | XversionMessage.prototype.setPayload = function() {}; 22 | 23 | XversionMessage.prototype.getPayload = function() { 24 | return BufferUtil.EMPTY_BUFFER; 25 | }; 26 | 27 | module.exports = XversionMessage; 28 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/test/data/connection.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-p2p-cash/test/data/connection.log -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/test/messages/builder.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var should = require('chai').should(); 4 | var P2P = require('../../'); 5 | var builder = P2P.Messages.builder; 6 | var bitcore = require('bitcore-lib-cash'); 7 | 8 | describe('Messages Builder', function() { 9 | 10 | describe('@constructor', function() { 11 | 12 | it('should return commands based on default', function() { 13 | // instantiate 14 | var b = builder(); 15 | should.exist(b); 16 | }); 17 | 18 | it('should return commands with customizations', function() { 19 | // instantiate 20 | var b = builder({ 21 | network: bitcore.Networks.testnet, 22 | Block: bitcore.Block, 23 | Transaction: bitcore.Transaction 24 | }); 25 | should.exist(b); 26 | }); 27 | 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /packages/bitcore-p2p-cash/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: OMJRNZCl018Yjy44nlG1hF6maKEyXcwPx 2 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[a-z] 2 | coverage 3 | node_modules 4 | 5 | npm-debug.log 6 | tests.js 7 | 8 | report 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '4' 4 | - '6' 5 | before_install: 6 | - export DISPLAY=:99.0 7 | - sh -e /etc/init.d/xvfb start 8 | install: 9 | - npm install 10 | after_script: 11 | - gulp coveralls 12 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-p2p/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-p2p 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-p2p/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-p2p 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-p2p/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please see [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo. 4 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var startGulp = require('bitcore-build'); 4 | module.exports = startGulp('p2p', {skipBrowser: true}) 5 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/index.js: -------------------------------------------------------------------------------- 1 | var bitcore = require('bitcore-lib'); 2 | bitcore.P2P = require('./lib'); 3 | 4 | module.exports = bitcore.P2P; 5 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/buffers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Buffers = require('buffers'); 4 | 5 | Buffers.prototype.skip = function(i) { 6 | if (i === 0) { 7 | return; 8 | } 9 | 10 | if (i >= this.length) { 11 | this.buffers = []; 12 | this.length = 0; 13 | return; 14 | } 15 | 16 | var pos = this.pos(i); 17 | this.buffers = this.buffers.slice(pos.buf); 18 | this.buffers[0] = new Buffer(this.buffers[0].slice(pos.offset)); 19 | this.length -= i; 20 | }; 21 | 22 | module.exports = Buffers; 23 | 24 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/errors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var spec = { 4 | name: 'P2P', 5 | message: 'Internal Error on bitcore-p2p Module {0}' 6 | }; 7 | 8 | module.exports = require('bitcore-lib').errors.extend(spec); 9 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace P2P 3 | */ 4 | 5 | module.exports = { 6 | Inventory: require('./inventory'), 7 | BloomFilter: require('./bloomfilter'), 8 | Messages: require('./messages'), 9 | Peer: require('./peer'), 10 | Pool: require('./pool') 11 | }; 12 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/messages/commands/filterclear.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Request peer to clear data for a bloom filter 10 | * @extends Message 11 | * @constructor 12 | */ 13 | function FilterclearMessage(arg, options) { 14 | Message.call(this, options); 15 | this.command = 'filterclear'; 16 | } 17 | inherits(FilterclearMessage, Message); 18 | 19 | FilterclearMessage.prototype.setPayload = function() {}; 20 | 21 | FilterclearMessage.prototype.getPayload = function() { 22 | return BufferUtil.EMPTY_BUFFER; 23 | }; 24 | 25 | module.exports = FilterclearMessage; 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/messages/commands/getaddr.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * Request information about active peers 10 | * @extends Message 11 | * @param {Object} options 12 | * @constructor 13 | */ 14 | function GetaddrMessage(arg, options) { 15 | Message.call(this, options); 16 | this.command = 'getaddr'; 17 | } 18 | inherits(GetaddrMessage, Message); 19 | 20 | GetaddrMessage.prototype.setPayload = function() {}; 21 | 22 | GetaddrMessage.prototype.getPayload = function() { 23 | return BufferUtil.EMPTY_BUFFER; 24 | }; 25 | 26 | module.exports = GetaddrMessage; 27 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/messages/commands/mempool.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * The mempool message sends a request to a node asking for information about 10 | * transactions it has verified but which have not yet confirmed. 11 | * @see https://en.bitcoin.it/wiki/Protocol_documentation#mempool 12 | * @param {Object} options 13 | * @extends Message 14 | * @constructor 15 | */ 16 | function MempoolMessage(arg, options) { 17 | Message.call(this, options); 18 | this.command = 'mempool'; 19 | } 20 | inherits(MempoolMessage, Message); 21 | 22 | MempoolMessage.prototype.setPayload = function() {}; 23 | 24 | MempoolMessage.prototype.getPayload = function() { 25 | return BufferUtil.EMPTY_BUFFER; 26 | }; 27 | 28 | module.exports = MempoolMessage; 29 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/lib/messages/commands/verack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Message = require('../message'); 4 | var inherits = require('util').inherits; 5 | var bitcore = require('bitcore-lib'); 6 | var BufferUtil = bitcore.util.buffer; 7 | 8 | /** 9 | * A message in response to a version message. 10 | * @extends Message 11 | * @constructor 12 | */ 13 | function VerackMessage(arg, options) { 14 | Message.call(this, options); 15 | this.command = 'verack'; 16 | } 17 | inherits(VerackMessage, Message); 18 | 19 | VerackMessage.prototype.setPayload = function() {}; 20 | 21 | VerackMessage.prototype.getPayload = function() { 22 | return BufferUtil.EMPTY_BUFFER; 23 | }; 24 | 25 | module.exports = VerackMessage; 26 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/test/data/connection.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-p2p/test/data/connection.log -------------------------------------------------------------------------------- /packages/bitcore-p2p/test/messages/builder.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var should = require('chai').should(); 4 | var P2P = require('../../'); 5 | var builder = P2P.Messages.builder; 6 | var bitcore = require('bitcore-lib'); 7 | 8 | describe('Messages Builder', function() { 9 | 10 | describe('@constructor', function() { 11 | 12 | it('should return commands based on default', function() { 13 | // instantiate 14 | var b = builder(); 15 | should.exist(b); 16 | }); 17 | 18 | it('should return commands with customizations', function() { 19 | // instantiate 20 | var b = builder({ 21 | network: bitcore.Networks.testnet, 22 | Block: bitcore.Block, 23 | Transaction: bitcore.Transaction 24 | }); 25 | should.exist(b); 26 | }); 27 | 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /packages/bitcore-p2p/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: JrJM1SMeS0mtVEmRlgijo9LiovuFjVlLX 2 | 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/.editorconfig: -------------------------------------------------------------------------------- 1 | ; .editorconfig 2 | 3 | root = true 4 | 5 | [**.js] 6 | indent_style = space 7 | indent_size = 2 8 | 9 | [**.css] 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [**.html] 14 | indent_style = space 15 | indent_size = 2 16 | max_char = 78 17 | brace_style = expand 18 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-wallet-client/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-wallet-client 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-wallet-client/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-wallet-client 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-wallet-client/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | // Project configuration. 4 | grunt.initConfig({ 5 | pkg: grunt.file.readJSON('package.json') 6 | }); 7 | 8 | // Default task(s). 9 | grunt.registerTask('default', []); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: cover 2 | 3 | BIN_PATH:=node_modules/.bin/ 4 | 5 | all: bitcore-wallet-client.js 6 | 7 | clean: 8 | rm bitcore-wallet-client.js 9 | 10 | bitcore-wallet-client.js: index.js lib/*.js 11 | ${BIN_PATH}browserify $< > $@ 12 | 13 | cover: 14 | ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter spec test 15 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/bitcore-wallet-client.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-wallet-client/bitcore-wallet-client.min.js -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/src/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The official client library for bitcore-wallet-service. 3 | * @module Client 4 | */ 5 | 6 | // /** 7 | // * Client API. 8 | // * @alias module:Client.API 9 | // */ 10 | import { API } from './lib/api'; 11 | export default API; 12 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/src/lib/common/defaults.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | export const Defaults = { 3 | DEFAULT_FEE_PER_KB: 10000, 4 | MIN_FEE_PER_KB: 0, 5 | MAX_FEE_PER_KB: 1000000, 6 | MAX_TX_FEE: 1 * 1e8 7 | }; 8 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/src/lib/common/index.ts: -------------------------------------------------------------------------------- 1 | export { Constants } from './constants'; 2 | export { Defaults } from './defaults'; 3 | export { Utils } from './utils'; 4 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/src/util/.gitignore: -------------------------------------------------------------------------------- 1 | ./node_modules 2 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-client/test/test-config.js: -------------------------------------------------------------------------------- 1 | const host = process.env.DB_HOST || 'localhost'; 2 | const port = process.env.DB_PORT || '27017'; 3 | var config = { 4 | mongoDb: { 5 | uri: `mongodb://${host}:${port}/bwc_test`, 6 | }, 7 | }; 8 | 9 | module.exports = config; 10 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: sPSI9ALVcN1NzwkXUxIMHVCfbWO1XNH9h 2 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | compiler: 4 | - gcc 5 | - clang 6 | addons: 7 | apt: 8 | sources: 9 | - ubuntu-toolchain-r-test 10 | packages: 11 | - gcc-4.8 12 | - g++-4.8 13 | - clang 14 | node_js: 15 | - '8' 16 | before_script: 17 | - sleep 30 # suggested in https://docs.travis-ci.com/user/database-setup/#mongodb 18 | # - mongo mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});' 19 | 20 | before_install: 21 | - export CXX="g++-4.8" CC="gcc-4.8" 22 | install: 23 | - npm install 24 | after_success: 25 | - npm run coveralls 26 | services: 27 | - mongodb 28 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-wallet-service/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-wallet-service 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-wallet-service/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | ### Features 13 | 14 | * **gitignore:** untracked vim/mac files ([8f5fb27](https://github.com/bitpay/bitcore-wallet-service/commit/8f5fb27)) 15 | 16 | ## [8.0.0](https://github.com/bitpay/bitcore-wallet-service/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 17 | 18 | ### Features 19 | 20 | * **gitignore:** untracked vim/mac files ([8f5fb27](https://github.com/bitpay/bitcore-wallet-service/commit/8f5fb27)) 21 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: test cover 2 | test: 3 | ./node_modules/.bin/mocha 4 | cover: 5 | ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter spec test 6 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/app.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var spawn = require('child_process').spawn; 4 | var async = require('async'); 5 | 6 | var scripts = [ 7 | 'locker/locker.js', 8 | 'messagebroker/messagebroker.js', 9 | 'bcmonitor/bcmonitor.js', 10 | 'emailservice/emailservice.js', 11 | 'pushnotificationsservice/pushnotificationsservice.js', 12 | 'fiatrateservice/fiatrateservice.js', 13 | 'bws.js' 14 | ]; 15 | 16 | async.eachSeries(scripts, function(script, callback) { 17 | console.log(`Spawning ${script}`); 18 | 19 | const node = spawn('node', [script]); 20 | node.stdout.on('data', data => { 21 | console.log(`${data}`); 22 | }); 23 | node.stderr.on('data', data => { 24 | console.error(`${data}`); 25 | }); 26 | 27 | callback(); 28 | }); 29 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/bcmonitor/bcmonitor.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import _ from 'lodash'; 3 | import { BlockchainMonitor } from '../lib/blockchainmonitor'; 4 | import logger from '../lib/logger'; 5 | 6 | const config = require('../config'); 7 | const bcm = new BlockchainMonitor(); 8 | bcm.start(config, err => { 9 | if (err) throw err; 10 | 11 | logger.info('Blockchain monitor started'); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/cleanfiatrates/cleanfiatrates.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { CleanFiatRates } from '../lib/cleanfiatrates'; 4 | 5 | const cleanFiatRatesScript = new CleanFiatRates(); 6 | cleanFiatRatesScript.run(err => { 7 | if (err) throw err; 8 | console.log('Clean fiat rates script finished'); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-wallet-service/src/db/.empty -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/deprecated-serverMessages.ts: -------------------------------------------------------------------------------- 1 | module.exports = (wallet, appName, appVersion) => { 2 | if (!appVersion || !appName) return; 3 | 4 | if (wallet.network == 'livenet' && appVersion.major == 5) { 5 | return { 6 | title: 'Deprecated Test message', 7 | body: 'Only for bitpay, old wallets', 8 | link: 'http://bitpay.com', 9 | id: 'bitpay1', 10 | dismissible: true, 11 | category: 'critical', 12 | app: 'bitpay' 13 | }; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/emailservice/emailservice.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import logger from '../lib/logger'; 3 | var config = require('../config'); 4 | const EmailService = require('../lib/emailservice'); 5 | 6 | const emailService = new EmailService(); 7 | emailService.start(config, err => { 8 | if (err) throw err; 9 | 10 | logger.info('Email service started'); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/fiatrateservice/fiatrateservice.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import logger from '../lib/logger'; 4 | const config = require('../config'); 5 | 6 | import { FiatRateService } from '../lib/fiatrateservice'; 7 | 8 | const service = new FiatRateService(); 9 | service.init(config, err => { 10 | if (err) throw err; 11 | service.startCron(config, err => { 12 | if (err) throw err; 13 | 14 | logger.info('Fiat rate service started'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/index.ts: -------------------------------------------------------------------------------- 1 | import { ExpressApp } from './lib/expressapp'; 2 | import { Storage } from './lib/storage'; 3 | 4 | const BWS = { 5 | ExpressApp, 6 | Storage 7 | }; 8 | 9 | module.exports = BWS; 10 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/common/index.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Constants: require('./constants'), 3 | Defaults: require('./defaults'), 4 | Utils: require('./utils') 5 | }; 6 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/errors/clienterror.ts: -------------------------------------------------------------------------------- 1 | export class ClientError { 2 | name: string; 3 | code: string; 4 | message: string; 5 | constructor(...args) { 6 | switch (args.length) { 7 | case 0: 8 | this.code = 'BADREQUEST'; 9 | this.message = 'Bad request'; 10 | break; 11 | case 1: 12 | this.code = 'BADREQUEST'; 13 | this.message = args[0]; 14 | break; 15 | default: 16 | case 2: 17 | this.code = args[0]; 18 | this.message = args[1]; 19 | break; 20 | } 21 | this.name = this.code; 22 | } 23 | 24 | toString() { 25 | return ''; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/fiatrateproviders/bitpay.ts: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | 3 | module.exports = { 4 | name: 'BitPay', 5 | url: 'https://bitpay.com/api/rates/', 6 | parseFn(raw) { 7 | const rates = _.compact( 8 | _.map(raw, d => { 9 | if (!d.code || !d.rate) return null; 10 | return { 11 | code: d.code, 12 | value: +d.rate 13 | }; 14 | }) 15 | ); 16 | return rates; 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/fiatrateproviders/bitstamp.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'Bitstamp', 3 | url: 'https://www.bitstamp.net/api/ticker/', 4 | parseFn(raw) { 5 | return [ 6 | { 7 | code: 'USD', 8 | value: parseFloat(raw.last) 9 | } 10 | ]; 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/fiatrateproviders/index.ts: -------------------------------------------------------------------------------- 1 | var Providers = { 2 | BitPay: require('./bitpay') 3 | // Bitstamp: require('./bitstamp'), // no longer used 4 | }; 5 | 6 | module.exports = Providers; 7 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/bitcore-wallet-service/src/lib/index.ts -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/model/index.ts: -------------------------------------------------------------------------------- 1 | export { Address } from './address'; 2 | export { Copayer } from './copayer'; 3 | export { Advertisement } from './advertisement'; 4 | export { Email } from './email'; 5 | export { INotification, Notification } from './notification'; 6 | export { IPreferences, Preferences } from './preferences'; 7 | export { PushNotificationSub } from './pushnotificationsub'; 8 | export { Session } from './session'; 9 | export { TxConfirmationSub } from './txconfirmationsub'; 10 | export { TxNote } from './txnote'; 11 | export { ITxProposal, TxProposal } from './txproposal'; 12 | export { IWallet, Wallet } from './wallet'; 13 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/lib/notificationbroadcaster.ts: -------------------------------------------------------------------------------- 1 | import { EventEmitter } from 'events'; 2 | let _instance; 3 | 4 | export class NotificationBroadcaster extends EventEmitter { 5 | broadcast(eventName, notification, walletService) { 6 | this.emit(eventName, notification, walletService); 7 | } 8 | static singleton() { 9 | if (!_instance) { 10 | _instance = new NotificationBroadcaster(); 11 | } 12 | return _instance; 13 | } 14 | } 15 | 16 | module.exports = NotificationBroadcaster.singleton(); 17 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/messagebroker/messagebroker.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import io from 'socket.io'; 3 | import logger from '../lib/logger'; 4 | 5 | const DEFAULT_PORT = 3380; 6 | 7 | const opts = { 8 | port: parseInt(process.argv[2]) || DEFAULT_PORT 9 | }; 10 | 11 | const server = io(opts.port.toString()); 12 | server.on('connection', socket => { 13 | socket.on('msg', data => { 14 | server.emit('msg', data); 15 | }); 16 | }); 17 | 18 | logger.info('Message broker server listening on port ' + opts.port); 19 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/pushnotificationsservice/pushnotificationsservice.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import logger from '../lib/logger'; 3 | import { PushNotificationsService } from '../lib/pushnotificationsservice'; 4 | 5 | const config = require('../config'); 6 | 7 | const pushNotificationsService = new PushNotificationsService(); 8 | pushNotificationsService.start(config, err => { 9 | if (err) throw err; 10 | 11 | logger.info('Push Notification Service started'); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/scripts/clean_db.mongodb: -------------------------------------------------------------------------------- 1 | db.email_queue.remove({createdOn: {$lt: Date.now()/1000-86400*10 }}); 2 | db.notifications.remove({createdOn: {$lt: Date.now()/1000-86400*10 }}); 3 | db.tx_confirmation_subs.remove({createdOn: {$lt: Date.now()/1000-86400*20 }}); 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/scripts/deleteDupAddresses.mongo: -------------------------------------------------------------------------------- 1 | 2 | duplicates=[]; 3 | 4 | db.addresses.aggregate([ {$group: { _id: {address: "$address"}, dups: {$addToSet: "$_id"}, count: {$sum: 1} } }, {$match: { count: {"$gt": 1} } } ], {allowDiskUse:true}).forEach(function(doc) { doc.dups.shift(); doc.dups.forEach( function(dupId){ duplicates.push(dupId); } ) }); 5 | 6 | db.addresses.remove({_id:{$in:duplicates}}); 7 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/scripts/deleteWallet.mongo: -------------------------------------------------------------------------------- 1 | 2 | // json support 3 | a='84dd0fce-7c08-4696-beb2-308745e18a22'; 4 | b= {'walletId':a}; 5 | 6 | db.addresses.remove(b); 7 | db.cache.remove(b); 8 | db.copayers_lookup.remove(b); 9 | db.notifications.remove(b); 10 | db.preferences.remove(b); 11 | db.sessions.remove(b); 12 | db.tx_confirmation_subs.remove(b); 13 | db.txs.remove(b); 14 | db.tx_notes.remove(b); 15 | db.wallets.remove({'id':a}); 16 | 17 | db.push_notification_subs.remove(b); 18 | db.email_queue.remove(b); 19 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/src/updatestats/updatestats.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { UpdateStats } from '../lib/updatestats'; 4 | var config = require('../config'); 5 | 6 | const updateStatsScript = new UpdateStats(); 7 | updateStatsScript.run(config, err => { 8 | if (err) throw err; 9 | console.log('Update stats script finished'); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | stop_program () 4 | { 5 | pidfile=$1 6 | 7 | echo "Stopping Process - $pidfile. PID=$(cat $pidfile)" 8 | kill -9 $(cat $pidfile) 9 | rm $pidfile 10 | 11 | } 12 | 13 | stop_program pids/bws.pid 14 | stop_program pids/fiatrateservice.pid 15 | stop_program pids/emailservice.pid 16 | stop_program pids/bcmonitor.pid 17 | stop_program pids/pushnotificationsservice.pid 18 | stop_program pids/messagebroker.pid 19 | 20 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/new_copayer.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}New copayer 2 | A new copayer just joined your wallet. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/new_incoming_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}New payment received 2 | A payment of {{amount}} has been received into your wallet. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/new_outgoing_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Payment sent 2 | A Payment of {{amount}} has been sent from your wallet. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/new_tx_proposal.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}New payment proposal 2 | A new payment proposal has been created in your wallet. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/tx_confirmation.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}} Transaction confirmed 2 | The transaction you were waiting for has been confirmed. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/txp_finally_rejected.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Payment proposal rejected 2 | A payment proposal in your wallet has been rejected. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/en/wallet_complete.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Wallet complete 2 | Your wallet is complete. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/new_copayer.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Nuevo copayer 2 | Un nuevo copayer ha ingresado a su billetera. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/new_incoming_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Nuevo pago recibido 2 | Un pago de {{amount}} fue recibido en su billetera. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/new_outgoing_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Pago enviado 2 | Un pago de {{amount}} ha sido enviado de su billetera. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/new_tx_proposal.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Nueva propuesta de pago 2 | Una nueva propuesta de pago ha sido creada en su billetera. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/tx_confirmation.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}} Transacción confirmada 2 | La transacción que estabas esperando se ha confirmado. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/txp_finally_rejected.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Propuesta de pago rechazada 2 | Una propuesta de pago en su billetera ha sido rechazada. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/es/wallet_complete.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Billetera completa 2 | Su billetera está completa. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/new_copayer.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Nouveau copayer 2 | Un nouveau copayer vient de rejoindre votre portefeuille. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/new_incoming_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Nouveau paiement reçu 2 | Un paiement de {{amount}} a été reçu dans votre portefeuille. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/new_outgoing_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Paiement envoyé 2 | Un paiement de {{amount}} a été envoyé de votre portefeuille. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/new_tx_proposal.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Nouvelle proposition de paiement 2 | Une nouvelle proposition de paiement a été créée dans votre portefeuille. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/tx_confirmation.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}} Transaction confirmée 2 | La transaction que vous attendiez a été confirmée. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/txp_finally_rejected.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Proposition de paiement rejetée 2 | Une proposition de paiement dans votre portefeuille a été rejetée. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/fr/wallet_complete.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}Portefeuille terminé 2 | Votre portefeuille est terminé. 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/new_copayer.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}ウォレットメンバー参加の知らせ 2 | 新しいメンバーがウォレットに追加されました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/new_incoming_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}着金確認の知らせ 2 | {{amount}} のビットコインがウォレットに送金しました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/new_outgoing_tx.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}送金のお知らせ 2 | {{amount}}のビットコインがウォレットから送金されました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/new_tx_proposal.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}送金の新規提案のお知らせ 2 | {{CopayerName}}はウォレットに送金を提案しました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/tx_confirmation.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}} 取引の確認 2 | あなたが待っていたトランザクションが確認されました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/txp_finally_rejected.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}送金提案の却下のお知らせ 2 | {{RejectorsNames}}はウォレットでの送金の提案を拒否しました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/templates/ja/wallet_complete.plain: -------------------------------------------------------------------------------- 1 | {{subjectPrefix}}ウォレット作成完了 2 | あなたの新しいウォレットが完成されました。 3 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/test/chain/eth.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _ = require('lodash'); 4 | var async = require('async'); 5 | var chai = require('chai'); 6 | var mongodb = require('mongodb'); 7 | var should = chai.should(); 8 | var { ChainService } = require('../../ts_build/lib/chain'); 9 | 10 | 11 | describe('Chain ETH', function() { 12 | 13 | it('should transform addresses to the db', function() { 14 | 15 | let x = {address: '0x01'}; 16 | ChainService.addressToStorageTransform('eth', 'abc', x); 17 | x.address.should.equal('0x01:abc'); 18 | }); 19 | 20 | it('should transform addresses from the db', function() { 21 | 22 | let x = {address: '0x01:dfg'}; 23 | ChainService.addressFromStorageTransform('eth', 'dfg', x); 24 | x.address.should.equal('0x01'); 25 | }); 26 | 27 | }); 28 | 29 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/test/test-config.js: -------------------------------------------------------------------------------- 1 | const host = process.env.DB_HOST || 'localhost'; 2 | const port = process.env.DB_PORT || '27017'; 3 | const dbname = 'bws_test'; 4 | var config = { 5 | mongoDb: { 6 | uri: `mongodb://${host}:${port}/${dbname}`, 7 | dbname, 8 | }, 9 | }; 10 | 11 | module.exports = config; 12 | -------------------------------------------------------------------------------- /packages/bitcore-wallet-service/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es5", 5 | "es6", 6 | "es2017" 7 | ], 8 | "noImplicitAny": false, 9 | "removeComments": true, 10 | "declaration": true, 11 | "declarationMap": true, 12 | "module": "commonjs", 13 | "emitDecoratorMetadata": true, 14 | "experimentalDecorators": true, 15 | "moduleResolution": "node", 16 | "esModuleInterop": true, 17 | "target": "es5", 18 | "typeRoots": [ 19 | "./node_modules/@types" 20 | ], 21 | "baseUrl": ".", 22 | "paths": { 23 | "*": [ 24 | "*", 25 | "./src/*" 26 | ] 27 | }, 28 | "outDir": "ts_build", 29 | "sourceMap": true 30 | }, 31 | "include": [ 32 | "./scripts/**/*.ts", 33 | "./src/**/*.ts", 34 | "./tests/**/*.ts" 35 | ], 36 | "exclude": [ 37 | "node_modules" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: sPSI9ALVcN1NzwkXUxIMHVCfbWO1XNH9h 2 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/.editorconfig: -------------------------------------------------------------------------------- 1 | ; .editorconfig 2 | 3 | root = true 4 | 5 | [**.js] 6 | indent_style = space 7 | indent_size = 2 8 | 9 | [**.css] 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [**.html] 14 | indent_style = space 15 | indent_size = 2 16 | max_char = 78 17 | brace_style = expand 18 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | *.sw* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # Compiled binary addons (http://nodejs.org/api/addons.html) 21 | build/Release 22 | 23 | # Dependency directory 24 | # Commenting this out is preferred by some people, see 25 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 26 | node_modules 27 | 28 | # Users Environment Variables 29 | .lock-wscript 30 | 31 | *.swp 32 | out/ 33 | db/* 34 | 35 | .bit 36 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.10' 4 | install: 5 | - npm install 6 | after_success: 7 | - npm run coveralls 8 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore-wallet/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package bitcore-wallet 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore-wallet/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package bitcore-wallet 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore-wallet/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/filestorage.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs') 2 | 3 | function FileStorage(opts) { 4 | if (!opts.filename) { 5 | throw new Error('Please set wallet filename'); 6 | } 7 | this.filename = opts.filename; 8 | this.fs = opts.fs || fs; 9 | }; 10 | 11 | FileStorage.prototype.getName = function() { 12 | return this.filename; 13 | }; 14 | 15 | FileStorage.prototype.save = function(data, cb) { 16 | this.fs.writeFile(this.filename, JSON.stringify(data), cb); 17 | }; 18 | 19 | FileStorage.prototype.load = function(cb) { 20 | this.fs.readFile(this.filename, 'utf8', function(err, data) { 21 | if (err) return cb(err); 22 | try { 23 | data = JSON.parse(data); 24 | } catch (e) {} 25 | return cb(null, data); 26 | }); 27 | }; 28 | 29 | FileStorage.prototype.exists = function(cb) { 30 | fs.exists(this.filename, cb); 31 | }; 32 | 33 | module.exports = FileStorage; 34 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-address: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var program = require('commander'); 4 | var utils = require('./cli-utils'); 5 | program = utils.configureCommander(program); 6 | 7 | program 8 | .parse(process.argv); 9 | 10 | var args = program.args; 11 | utils.getClient(program, { 12 | mustExist: true 13 | }, function(client) { 14 | client.createAddress({}, function(err, x) { 15 | utils.die(err); 16 | 17 | console.log('* New Address %s ', x.address); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-addresses: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .parse(process.argv); 10 | 11 | var args = program.args; 12 | 13 | utils.getClient(program, { mustExist: true }, function (client) { 14 | 15 | client.getMainAddresses({ 16 | doNotVerify: true 17 | }, function(err, x) { 18 | 19 | utils.die(err); 20 | 21 | if (x.length > 0) { 22 | console.log('* Addresses:'); 23 | _.each(x, function(a) { 24 | console.log(' ', a.address); 25 | }); 26 | } else { 27 | console.log('* No addresses.'); 28 | } 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-ads-delete: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options] ') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | var host = 'https://bws.bitpay.com'; 14 | 15 | var clientArgs = { 16 | host 17 | } 18 | 19 | var adId = args[0]; 20 | 21 | let adArgs = { 22 | adId 23 | }; 24 | 25 | // need to load credentials, like in ./wallet-ads 26 | utils.getClient(clientArgs, { 27 | mustExist: true 28 | }, function (client) { 29 | client.deleteAdvertisement(adArgs, (err, result) => { 30 | utils.die(err); 31 | if(!result) { 32 | console.log('Couldn\'t delete advertisement'); 33 | } 34 | else { 35 | console.log('Deleted advertisement ', result); 36 | } 37 | }); 38 | }); -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-ads-get: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options]') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | var host = 'https://bws.bitpay.com'; 14 | 15 | var clientArgs = { 16 | host 17 | } 18 | 19 | utils.getClient(clientArgs, { 20 | mustExist: true 21 | }, function (client) { 22 | client.getAdvertisements({}, (err, result) => { 23 | utils.die(err); 24 | if(!result) { 25 | console.log('Couldn\'t retrieve adverts'); 26 | } 27 | else { 28 | console.log('Retrieved adverts ', result); 29 | } 30 | }); 31 | }); -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-balance: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var program = require('commander'); 4 | var utils = require('./cli-utils'); 5 | program = utils.configureCommander(program); 6 | program 7 | .option('-c, --coin ', 'coin (btc/bch)') 8 | .parse(process.argv); 9 | 10 | 11 | program.option = function(){};; 12 | 13 | var args = program.args; 14 | 15 | 16 | var opts = {}; 17 | if (program.coin) { 18 | opts.coin = program.coin 19 | } 20 | 21 | utils.getClient(program, { 22 | mustExist: true 23 | }, function(client) { 24 | client.getBalance(opts, function(err, x) { 25 | const coin = client.credentials.coin; 26 | utils.die(err); 27 | console.log('* Wallet balance %s (Locked %s)', utils.renderAmount(x.totalAmount, coin), utils.renderAmount(x.lockedAmount, coin)); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-broadcast: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options] ') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | var txpid = args[0] || ''; 14 | 15 | utils.getClient(program, { mustExist: true }, function (client) { 16 | client.getTxProposals({}, function(err, txps) { 17 | utils.die(err); 18 | 19 | var txp = utils.findOneTxProposal(txps, txpid); 20 | client.broadcastTxProposal(txp, function(err, txp) { 21 | utils.die(err); 22 | console.log('Transaction Broadcasted: TXID: ' + txp.txid); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-get-ad: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options]') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | var host = 'https://bws.bitpay.com'; 14 | 15 | var clientArgs = { 16 | host 17 | } 18 | 19 | utils.getClient(clientArgs, { 20 | mustExist: true 21 | }, function (client) { 22 | client.getAdvertisements({}, (err, result) => { 23 | utils.die(err); 24 | if(!result) { 25 | console.log('Couldn\'t retrieve adverts'); 26 | } 27 | else { 28 | console.log('Retrieved adverts ', result); 29 | } 30 | }); 31 | }); -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-join: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var program = require('commander'); 4 | var utils = require('./cli-utils'); 5 | program = utils.configureCommander(program); 6 | 7 | program 8 | .usage('[options] [copayerName]') 9 | .option('-p, --password', 'Encrypt wallet. Will ask password interactively') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | if (!args[0]) 14 | program.help(); 15 | 16 | var secret = args[0]; 17 | var copayerName = args[1] || process.env.USER; 18 | 19 | utils.getClient(program, { doNotComplete: true }, function (client) { 20 | client.joinWallet(secret, copayerName, {}, function(err, wallet) { 21 | utils.die(err); 22 | console.log(' * Wallet Joined.', wallet.name); 23 | utils.saveClient(program, client, function () {}); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-mnemonic: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var program = require('commander'); 4 | var utils = require('./cli-utils'); 5 | program = utils.configureCommander(program); 6 | 7 | program 8 | .parse(process.argv); 9 | 10 | var args = program.args; 11 | 12 | utils.getClient(program, { 13 | mustExist: true 14 | }, function(client) { 15 | var mnemonic = client.getMnemonic(); 16 | console.log('* Wallet seed: %s', mnemonic); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-recreate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options]') 10 | .description('Creates a wallet on the remote server given the local information') 11 | .parse(process.argv); 12 | 13 | var args = program.args; 14 | utils.getClient(program, { mustExist: true }, function (client) { 15 | client.recreateWallet(function(err) { 16 | utils.die(err); 17 | console.log(' * Wallet created.'); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-reject: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options] [reason]') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | var txpid = args[0] || ''; 14 | var reason = args[1] || ''; 15 | 16 | utils.getClient(program, { mustExist: true }, function (client) { 17 | client.getTxProposals({}, function(err, txps) { 18 | utils.die(err); 19 | 20 | var txp = utils.findOneTxProposal(txps, txpid); 21 | client.rejectTxProposal(txp, reason, function(err, tx) { 22 | utils.die(err); 23 | if (tx.status == 'rejected') 24 | console.log('Transaction finally rejected.'); 25 | else 26 | console.log('Transaction rejected by you.'); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-rm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options] ') 10 | .parse(process.argv); 11 | 12 | var args = program.args; 13 | var txpid = args[0] || ''; 14 | 15 | utils.getClient(program, { mustExist: true }, function (client) { 16 | client.getTxProposals({doNotVerify: true}, function(err, txps) { 17 | utils.die(err); 18 | 19 | if (program.verbose) 20 | console.log('* Raw Server Response:\n', txps); //TODO 21 | 22 | var txp = utils.findOneTxProposal(txps, txpid); 23 | client.removeTxProposal(txp, function(err) { 24 | utils.die(err); 25 | 26 | console.log('Transaction removed.'); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-scan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var program = require('commander'); 5 | var utils = require('./cli-utils'); 6 | program = utils.configureCommander(program); 7 | 8 | program 9 | .usage('[options]') 10 | .description('Scan wallets addresses for funds') 11 | .parse(process.argv); 12 | 13 | var args = program.args; 14 | utils.getClient(program, { mustExist: true }, function (client) { 15 | client.startScan({}, function(err) { 16 | utils.die(err); 17 | console.log(' * Scan started. Check with `wallet-status`.'); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/bin/wallet-txproposals: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var _ = require('lodash'); 4 | var fs = require('fs'); 5 | var program = require('commander'); 6 | var utils = require('./cli-utils'); 7 | program = utils.configureCommander(program); 8 | 9 | program 10 | .option('-o, --output [filename]', 'write tx to output file for air-gapped signing') 11 | .parse(process.argv); 12 | 13 | var args = program.args; 14 | 15 | utils.getClient(program, { mustExist: true }, function (client) { 16 | client.getTxProposals({forAirGapped: !!program.output}, function (err, res) { 17 | utils.die(err); 18 | 19 | if (program.output) { 20 | fs.writeFileSync(program.output, JSON.stringify(res)); 21 | console.log(' * Tx proposals saved to: %s\n', program.output); 22 | } else { 23 | utils.renderTxProposals(res); 24 | } 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/bitcore-wallet/util/gen-bin: -------------------------------------------------------------------------------- 1 | for i in wallet*; do echo \"$i\": \"./bin/$i\",;done 2 | -------------------------------------------------------------------------------- /packages/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MODULES=' crypto-wallet-core bitcore-wallet-service bitcore-wallet-client bitcore-client' 4 | 5 | for i in $MODULES; 6 | do 7 | echo "## $i" 8 | cd $i && npm run compile || (echo "ERROR" && exit) && cd .. 9 | done 10 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/matiu/bitcore/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package crypto-wallet-core 9 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/README.md: -------------------------------------------------------------------------------- 1 | # Crypto Wallet Core 2 | 3 | **A coin-agnostic wallet library for creating transactions, signing, and address derivation.** 4 | 5 | ## Contributing 6 | 7 | See [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/Contributing.md) on the main bitcore repo for information about how to contribute. 8 | 9 | ## License 10 | 11 | Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE). 12 | 13 | Copyright 2013-2019 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc. -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | import { TOKEN_OPTS } from './tokens'; 2 | import { UNITS } from './units'; 3 | export let Constants = { 4 | TOKEN_OPTS, 5 | UNITS 6 | }; 7 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/derivation/btg/index.ts: -------------------------------------------------------------------------------- 1 | const BitcoreLibBtg = require('bitcore-lib-btg'); 2 | import { AbstractBitcoreLibDeriver } from '../btc'; 3 | export class BtgDeriver extends AbstractBitcoreLibDeriver { 4 | bitcoreLib = BitcoreLibBtg; 5 | } 6 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/derivation/paths.ts: -------------------------------------------------------------------------------- 1 | export const Paths = { 2 | BTC: { 3 | mainnet: "m/44'/0'/", 4 | livenet: "m/44'/0'/" 5 | }, 6 | BTG: { 7 | mainnet: "m/156'/0'/", 8 | livenet: "m/156'/0'/" 9 | }, 10 | BCH: { 11 | mainnet: "m/44'/145'/", 12 | livenet: "m/44'/145'/" 13 | }, 14 | ETH: { 15 | mainnet: "m/44'/60'/", 16 | livenet: "m/44'/60'/", 17 | testnet: "m/44'/60'/" 18 | }, 19 | XRP: { 20 | mainnet: "m/44'/144'/", 21 | livenet: "m/44'/144'/", 22 | testnet: "m/44'/144'/" 23 | }, 24 | default: { 25 | testnet: "m/44'/1'/" 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as BitcoreLib from 'bitcore-lib'; 2 | import * as BitcoreLibCash from 'bitcore-lib-cash'; 3 | import Web3 from 'web3'; 4 | import { Constants } from './constants'; 5 | import Deriver from './derivation'; 6 | import Transactions from './transactions'; 7 | import Validation from './validation'; 8 | export { BitcoreLib, BitcoreLibCash, Deriver, Transactions, Validation, Web3, Constants }; 9 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/validation/bch/index.ts: -------------------------------------------------------------------------------- 1 | import { IValidation } from '..'; 2 | const BitcoreCash = require('bitcore-lib-cash'); 3 | 4 | export class BchValidation implements IValidation { 5 | validateAddress(network: string, address: string): boolean { 6 | const AddressCash = BitcoreCash.Address; 7 | // Regular Address: try Bitcoin Cash 8 | return AddressCash.isValid(address, network); 9 | } 10 | 11 | validateUri(addressUri: string): boolean { 12 | // Check if the input is a valid uri or address 13 | const URICash = BitcoreCash.URI; 14 | // Bip21 uri 15 | return URICash.isValid(addressUri); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/validation/btc/index.ts: -------------------------------------------------------------------------------- 1 | import { IValidation } from '..'; 2 | const Bitcore = require('bitcore-lib'); 3 | 4 | export class BtcValidation implements IValidation { 5 | validateAddress(network: string, address: string): boolean { 6 | const Address = Bitcore.Address; 7 | // Regular Address: try Bitcoin 8 | return Address.isValid(address, network); 9 | } 10 | 11 | validateUri(addressUri: string): boolean { 12 | // Check if the input is a valid uri or address 13 | const URI = Bitcore.URI; 14 | // Bip21 uri 15 | return URI.isValid(addressUri); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/validation/btg/index.ts: -------------------------------------------------------------------------------- 1 | import { IValidation } from '..'; 2 | const BitcoreBTG = require('bitcore-lib-btg'); 3 | 4 | export class BtgValidation implements IValidation { 5 | validateAddress(network: string, address: string): boolean { 6 | const AddressBTG = BitcoreBTG.Address; 7 | // Regular Address: try Bitcoin Cash 8 | return AddressBTG.isValid(address, network); 9 | } 10 | 11 | validateUri(addressUri: string): boolean { 12 | // Check if the input is a valid uri or address 13 | const URIBTG = BitcoreBTG.URI; 14 | // Bip21 uri 15 | return URIBTG.isValid(addressUri); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/src/validation/eth/index.ts: -------------------------------------------------------------------------------- 1 | import { IValidation } from '..'; 2 | const utils = require('web3-utils'); 3 | 4 | export class EthValidation implements IValidation { 5 | validateAddress(_network: string, address: string): boolean { 6 | return utils.isAddress(address); 7 | } 8 | 9 | validateUri(addressUri: string): boolean { 10 | if (!addressUri) { 11 | return false; 12 | } 13 | const address = this.extractAddress(addressUri); 14 | const ethereumPrefix = /ethereum/i.exec(addressUri); 15 | return !!ethereumPrefix && utils.isAddress(address); 16 | } 17 | 18 | private extractAddress(data) { 19 | const prefix = /^[a-z]+:/i; 20 | const params = /([\?\&](value|gas|gasPrice|gasLimit)=(\d+([\,\.]\d+)?))+/i; 21 | return data.replace(prefix, '').replace(params, ''); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/crypto-wallet-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["es5", "es6", "es2017"], 4 | "noImplicitAny": false, 5 | "removeComments": true, 6 | "declaration": true, 7 | "declarationMap": true, 8 | "module": "commonjs", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "esModuleInterop": true, 13 | "target": "es5", 14 | "typeRoots": ["./node_modules/@types"], 15 | "baseUrl": ".", 16 | "paths": { 17 | "*": ["*", "./src/*"] 18 | }, 19 | "outDir": "ts_build", 20 | "sourceMap": true 21 | }, 22 | "include": [ 23 | "./src/**/*.ts", 24 | "./test/**/*.ts" 25 | ], 26 | "exclude": [ 27 | "node_modules" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/insight/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Javascript Node CircleCI 2.0 configuration file 2 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details 3 | version: 2 4 | jobs: 5 | build-and-test: 6 | docker: 7 | - image: circleci/node:8.10-browsers 8 | working_directory: ~/insight 9 | steps: 10 | - checkout 11 | 12 | # Download and cache dependencies 13 | - restore_cache: 14 | keys: 15 | - dependency-cache-{{ checksum "package.json" }} 16 | - run: npm install 17 | - save_cache: 18 | paths: 19 | - node_modules 20 | key: dependency-cache-{{ checksum "package.json" }} 21 | 22 | # run tests 23 | - run: npm run test:ci 24 | 25 | workflows: 26 | version: 2 27 | build_and_test: 28 | jobs: 29 | - build-and-test 30 | -------------------------------------------------------------------------------- /packages/insight/.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | *.log 7 | *.tmp 8 | *.tmp.* 9 | log.txt 10 | *.sublime-project 11 | *.sublime-workspace 12 | .vscode/ 13 | npm-debug.log* 14 | 15 | .sourcemaps/ 16 | 17 | .idea/ 18 | .sass-cache/ 19 | .tmp/ 20 | .versions/ 21 | coverage/ 22 | dist/ 23 | node_modules/ 24 | tmp/ 25 | temp/ 26 | hooks/ 27 | platforms/ 28 | plugins/ 29 | plugins/android.json 30 | plugins/ios.json 31 | www/ 32 | $RECYCLE.BIN/ 33 | 34 | # e2e 35 | /e2e/*.js 36 | /e2e/*.map 37 | 38 | .DS_Store 39 | Thumbs.db 40 | UserInterfaceState.xcuserstate 41 | 42 | # .docker env 43 | .docker/env/*.env 44 | -------------------------------------------------------------------------------- /packages/insight/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | package-template.json 4 | .sourcemaps/ 5 | coverage/ 6 | platforms/ 7 | plugins/ 8 | www/ 9 | src/assets/*.json -------------------------------------------------------------------------------- /packages/insight/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - 8 5 | after_success: 6 | - yarn send-coverage 7 | -------------------------------------------------------------------------------- /packages/insight/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [8.1.1](https://github.com/bitpay/bitcore/compare/v8.1.0...v8.1.1) (2019-03-21) 7 | 8 | **Note:** Version bump only for package @bitpay/insight-previous 9 | 10 | ## [8.1.0](https://github.com/bitpay/bitcore/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27) 11 | 12 | **Note:** Version bump only for package @bitpay/insight-previous 13 | 14 | ## [8.0.0](https://github.com/bitpay/bitcore/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27) 15 | -------------------------------------------------------------------------------- /packages/insight/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bitcore-node 2 | CMD ["npm", "--prefix=./packages/insight", "start"] 3 | -------------------------------------------------------------------------------- /packages/insight/README.md: -------------------------------------------------------------------------------- 1 | # Insight 2 | 3 | **A blockchain explorer for Bitcore.** 4 | 5 | ## Quick Start 6 | 7 | To get started, first [start a `bitcore` node](../bitcore-node/readme.md), then run insight: 8 | 9 | ```sh 10 | cd bitcore 11 | npm run insight 12 | ``` 13 | 14 | ## Network / Chain setting 15 | 16 | To use a specific network / chain set the `NETWORK` and `CHAIN` environment variable, e.g.: 17 | 18 | ```sh 19 | NETWORK=testnet CHAIN=BCH npm start 20 | ``` 21 | -------------------------------------------------------------------------------- /packages/insight/ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "insight", 3 | "integrations": { 4 | "cordova": {} 5 | }, 6 | "type": "ionic-angular", 7 | "proxies": [ 8 | { 9 | "path": "/api", 10 | "proxyUrl": "http://127.0.0.1:3000/api" 11 | } 12 | ], 13 | "hooks": {} 14 | } 15 | -------------------------------------------------------------------------------- /packages/insight/purifyCSS: -------------------------------------------------------------------------------- 1 | !/bin/bash 2 | PATH=$PATH:$(npm bin) 3 | set -x 4 | 5 | BUILDFOLDER=www/ 6 | 7 | # clean up previous build 8 | rm -fr $BUILDFOLDER 9 | 10 | # Prod build 11 | ENV=prod CHAIN=BTC NETWORK=mainnet API_PREFIX=https://api.bitcore.io/api npm run ionic:build --prod \ 12 | --wwwDir $BUILDFOLDER 13 | 14 | # remove unused css 15 | purifycss $BUILDFOLDER"build/main.css" \ 16 | $BUILDFOLDER"build/*.js" \ 17 | --info \ 18 | --min \ 19 | --out $BUILDFOLDER"build/main.css" \ 20 | -------------------------------------------------------------------------------- /packages/insight/src/app/app.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/insight/src/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | import { enableProdMode } from '@angular/core'; 6 | 7 | if (process.env.ENV === 'prod') { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-Black.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-Bold.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-ExtraBold.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-Light.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-Medium.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-Regular.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/Heebo-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/Heebo-Thin.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/SourceSansPro-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/SourceSansPro-Light.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/SourceSansPro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/SourceSansPro-Regular.ttf -------------------------------------------------------------------------------- /packages/insight/src/assets/fonts/ubuntu.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/fonts/ubuntu.woff2 -------------------------------------------------------------------------------- /packages/insight/src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /packages/insight/src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/img/logo.png -------------------------------------------------------------------------------- /packages/insight/src/assets/img/search-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/insight/src/assets/img/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCGPU/bitcore/0474a3ab63aa0a039d73469652fe899af2b264e6/packages/insight/src/assets/img/search.png -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary-eth/block-summary-eth.html: -------------------------------------------------------------------------------- 1 | 2 | Total Difficulty 3 | 4 | {{ block.totalDifficulty }} 5 | 6 | 7 | 8 | Gas Limit 9 | 10 | {{ block.gasLimit }} 11 | 12 | 13 | 14 | Gas Used 15 | 16 | {{ block.gasUsed }} 17 | 18 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary-eth/block-summary-eth.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { BlockSummaryEthComponent } from './block-summary-eth'; 4 | 5 | @NgModule({ 6 | declarations: [BlockSummaryEthComponent], 7 | imports: [IonicModule], 8 | exports: [BlockSummaryEthComponent] 9 | }) 10 | export class BlockSummaryEthComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary-eth/block-summary-eth.scss: -------------------------------------------------------------------------------- 1 | block-summary-eth { 2 | } 3 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary-eth/block-summary-eth.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ChainNetwork } from '../../providers/api/api'; 3 | import { CurrencyProvider } from '../../providers/currency/currency'; 4 | 5 | /** 6 | * Generated class for the BlockSummaryEthComponent component. 7 | * 8 | * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html 9 | * for more info on Angular Components. 10 | */ 11 | @Component({ 12 | selector: 'block-summary-eth', 13 | templateUrl: 'block-summary-eth.html' 14 | }) 15 | export class BlockSummaryEthComponent { 16 | @Input() 17 | public block: any = {}; 18 | @Input() 19 | public chainNetwork: ChainNetwork; 20 | 21 | constructor(public currencyProvider: CurrencyProvider) {} 22 | } 23 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary/block-summary.html: -------------------------------------------------------------------------------- 1 | 2 | Merkle Root 3 | 4 | {{ block.merkleroot }} 5 | 6 | 7 | 8 | Bits 9 | 10 | {{ block.bits }} 11 | 12 | 13 | 14 | Version 15 | 16 | {{ block.version }} 17 | 18 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary/block-summary.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { BlockSummaryComponent } from './block-summary'; 4 | 5 | @NgModule({ 6 | declarations: [BlockSummaryComponent], 7 | imports: [IonicModule], 8 | exports: [BlockSummaryComponent] 9 | }) 10 | export class BlockSummaryComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary/block-summary.scss: -------------------------------------------------------------------------------- 1 | block-summary { 2 | } 3 | -------------------------------------------------------------------------------- /packages/insight/src/components/block-summary/block-summary.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ChainNetwork } from '../../providers/api/api'; 3 | import { CurrencyProvider } from '../../providers/currency/currency'; 4 | 5 | /** 6 | * Generated class for the BlockSummaryComponent component. 7 | * 8 | * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html 9 | * for more info on Angular Components. 10 | */ 11 | @Component({ 12 | selector: 'block-summary', 13 | templateUrl: 'block-summary.html' 14 | }) 15 | export class BlockSummaryComponent { 16 | @Input() 17 | public block: any = {}; 18 | @Input() 19 | public chainNetwork: ChainNetwork; 20 | 21 | constructor(public currencyProvider: CurrencyProvider) {} 22 | } 23 | -------------------------------------------------------------------------------- /packages/insight/src/components/coin-list/coin-list.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { TransactionDetailsEthComponentModule } from '../../components/transaction-details-eth/transaction-details-eth.module'; 4 | import { CoinComponentModule } from '../coin/coin.module'; 5 | import { LoaderComponentModule } from '../loader/loader.module'; 6 | import { CoinListComponent } from './coin-list'; 7 | 8 | @NgModule({ 9 | declarations: [CoinListComponent], 10 | imports: [ 11 | IonicModule, 12 | CoinComponentModule, 13 | TransactionDetailsEthComponentModule, 14 | LoaderComponentModule 15 | ], 16 | exports: [CoinListComponent] 17 | }) 18 | export class CoinListComponentModule {} 19 | -------------------------------------------------------------------------------- /packages/insight/src/components/coin-list/coin-list.scss: -------------------------------------------------------------------------------- 1 | coin-list { 2 | 3 | .orderUnselected { 4 | color: black; 5 | cursor: pointer; 6 | opacity: 1.0; 7 | } 8 | 9 | .orderUnselected:hover { 10 | opacity: 0.5; 11 | } 12 | 13 | .orderSelected { 14 | opacity: 1.0; 15 | color: color($colors, light-blue);; 16 | cursor: pointer; 17 | } 18 | 19 | .orderSelected:hover { 20 | opacity: 0.5; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /packages/insight/src/components/coin/coin.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { CoinComponent } from './coin'; 4 | 5 | @NgModule({ 6 | declarations: [CoinComponent], 7 | imports: [IonicModule], 8 | exports: [CoinComponent] 9 | }) 10 | export class CoinComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/coin/coin.scss: -------------------------------------------------------------------------------- 1 | coin { 2 | .grid{ 3 | padding: 0; 4 | } 5 | ion-grid { 6 | background-color: #f7f7f7; 7 | border: 1px solid #f3f3f3; 8 | border-radius: 3px; 9 | 10 | ion-row { 11 | align-items: center; 12 | 13 | &.small { 14 | font-size: 1.1rem; 15 | } 16 | 17 | ion-icon { 18 | color: rgba(0, 0, 0, 0.25); 19 | } 20 | 21 | } 22 | } 23 | 24 | .time { 25 | color: #888; 26 | } 27 | 28 | .chip { 29 | padding-left: 1em; 30 | padding-right: 1em; 31 | border-radius: 3px; 32 | -webkit-font-smoothing: subpixel-antialiased; 33 | &.size-fixed{ 34 | width: 150px; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/insight/src/components/components.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 3 | import { IonicModule } from 'ionic-angular'; 4 | import { SplitPipe } from '../pipes/split/split'; 5 | 6 | @NgModule({ 7 | declarations: [SplitPipe], 8 | imports: [FormsModule, IonicModule, ReactiveFormsModule], 9 | exports: [], 10 | entryComponents: [], 11 | providers: [] 12 | }) 13 | export class ComponentsModule {} 14 | -------------------------------------------------------------------------------- /packages/insight/src/components/denomination/denomination.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { DenominationComponent } from './denomination'; 4 | 5 | @NgModule({ 6 | declarations: [DenominationComponent], 7 | imports: [IonicModule], 8 | exports: [DenominationComponent], 9 | entryComponents: [DenominationComponent] 10 | }) 11 | export class DenominationComponentModule {} 12 | -------------------------------------------------------------------------------- /packages/insight/src/components/denomination/denomination.scss: -------------------------------------------------------------------------------- 1 | ion-item.item-md { 2 | &:hover { 3 | cursor: pointer; 4 | background-color: #f6f7fa; 5 | box-shadow: 0 5px 20px -5px rgba(0, 0, 0, 0.09); 6 | } 7 | ion-avatar { 8 | cursor: pointer; 9 | min-width: 0; 10 | min-height: 0; 11 | 12 | .logo { 13 | width: 25px; 14 | height: 25px; 15 | } 16 | } 17 | } 18 | 19 | .secondary { 20 | filter: grayscale(100%); 21 | } 22 | 23 | ion-item { 24 | ion-label { 25 | cursor: pointer; 26 | } 27 | } 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /packages/insight/src/components/error/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ message }} 4 | 5 | -------------------------------------------------------------------------------- /packages/insight/src/components/error/error.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { ErrorComponent } from './error'; 4 | 5 | @NgModule({ 6 | declarations: [ErrorComponent], 7 | imports: [IonicModule], 8 | exports: [ErrorComponent] 9 | }) 10 | export class ErrorComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/error/error.scss: -------------------------------------------------------------------------------- 1 | error { 2 | .error-message { 3 | background-color: #f2dede; 4 | border: 1px solid #ebccd1; 5 | color: #a94442; 6 | border-radius: 3px; 7 | margin: 5px; 8 | padding: 5px; 9 | } 10 | } -------------------------------------------------------------------------------- /packages/insight/src/components/error/error.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'error', 5 | templateUrl: 'error.html' 6 | }) 7 | export class ErrorComponent { 8 | @Input() 9 | public message: string; 10 | } 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/footer/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/insight/src/components/footer/footer.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { DenominationComponentModule } from '../denomination/denomination.module'; 4 | import { FooterComponent } from './footer'; 5 | 6 | @NgModule({ 7 | declarations: [FooterComponent], 8 | imports: [IonicModule, DenominationComponentModule], 9 | exports: [FooterComponent] 10 | }) 11 | export class FooterComponentModule {} 12 | -------------------------------------------------------------------------------- /packages/insight/src/components/footer/footer.scss: -------------------------------------------------------------------------------- 1 | footer { 2 | .pages { 3 | padding-top: 5px; 4 | color: #dde; 5 | float: left; 6 | a { 7 | color: white; 8 | font-size: 0.8em; 9 | } 10 | } 11 | .about { 12 | float: right; 13 | a { 14 | text-decoration: none; 15 | } 16 | .version { 17 | color: grey; 18 | font-style: italic; 19 | } 20 | .logo { 21 | color: white; 22 | font-weight: 700; 23 | font-style: italic; 24 | font-size: 1.5em; 25 | font-family: 'Ubuntu'; 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /packages/insight/src/components/footer/footer.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injectable, Input } from '@angular/core'; 2 | import { Nav } from 'ionic-angular'; 3 | import { ChainNetwork } from '../../providers/api/api'; 4 | 5 | @Injectable() 6 | @Component({ 7 | selector: 'footer', 8 | templateUrl: 'footer.html' 9 | }) 10 | export class FooterComponent { 11 | @Input() 12 | public chainNetwork: ChainNetwork; 13 | 14 | constructor(public nav: Nav) {} 15 | 16 | public openPage(page: string): void { 17 | this.nav.push(page, { 18 | chain: this.chainNetwork.chain, 19 | network: this.chainNetwork.network 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/insight/src/components/head-nav/head-nav.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { DenominationComponentModule } from '../denomination/denomination.module'; 4 | import { HeadNavComponent } from './head-nav'; 5 | 6 | @NgModule({ 7 | declarations: [HeadNavComponent], 8 | imports: [IonicModule, DenominationComponentModule], 9 | exports: [HeadNavComponent] 10 | }) 11 | export class HeadNavComponentModule {} 12 | -------------------------------------------------------------------------------- /packages/insight/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components.module'; 2 | -------------------------------------------------------------------------------- /packages/insight/src/components/latest-blocks/latest-blocks.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { MomentModule } from 'angular2-moment'; 3 | import { IonicModule } from 'ionic-angular'; 4 | import { LoaderComponentModule } from '../../components/loader/loader.module'; 5 | import { ErrorComponentModule } from '../error/error.module'; 6 | import { LatestBlocksComponent } from './latest-blocks'; 7 | 8 | @NgModule({ 9 | declarations: [LatestBlocksComponent], 10 | imports: [ 11 | IonicModule, 12 | MomentModule, 13 | LoaderComponentModule, 14 | ErrorComponentModule 15 | ], 16 | exports: [LatestBlocksComponent] 17 | }) 18 | export class LatestBlocksComponentModule {} 19 | -------------------------------------------------------------------------------- /packages/insight/src/components/loader/loader.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { LoaderComponent } from './loader'; 4 | 5 | @NgModule({ 6 | declarations: [LoaderComponent], 7 | imports: [IonicModule], 8 | exports: [LoaderComponent] 9 | }) 10 | export class LoaderComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/loader/loader.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'loader', 5 | templateUrl: 'loader.html' 6 | }) 7 | export class LoaderComponent { 8 | @Input() 9 | public type?: string; 10 | } 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-details-eth/transaction-details-eth.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { TransactionDetailsEthComponent } from './transaction-details-eth'; 4 | 5 | @NgModule({ 6 | declarations: [TransactionDetailsEthComponent], 7 | imports: [IonicModule], 8 | exports: [TransactionDetailsEthComponent] 9 | }) 10 | export class TransactionDetailsEthComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-details/transaction-details.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { TransactionDetailsComponent } from './transaction-details'; 4 | 5 | @NgModule({ 6 | declarations: [TransactionDetailsComponent], 7 | imports: [IonicModule], 8 | exports: [TransactionDetailsComponent] 9 | }) 10 | export class TransactionDetailsComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-list/transaction-list.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { LoaderComponentModule } from '../loader/loader.module'; 4 | import { TransactionDetailsEthComponentModule } from '../transaction-details-eth/transaction-details-eth.module'; 5 | import { TransactionDetailsComponentModule } from '../transaction-details/transaction-details.module'; 6 | import { TransactionListComponent } from './transaction-list'; 7 | 8 | @NgModule({ 9 | declarations: [TransactionListComponent], 10 | imports: [ 11 | IonicModule, 12 | TransactionDetailsEthComponentModule, 13 | TransactionDetailsComponentModule, 14 | LoaderComponentModule 15 | ], 16 | exports: [TransactionListComponent] 17 | }) 18 | export class TransactionListComponentModule {} 19 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-list/transaction-list.scss: -------------------------------------------------------------------------------- 1 | transaction-list { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.html: -------------------------------------------------------------------------------- 1 | 2 | Gas Limit 3 | 4 | {{ tx.gasLimit }} 5 | 6 | 7 | 8 | Gas Price 9 | 10 | {{ currencyProvider.getConvertedNumber(tx.gasPrice, chainNetwork.chain) | number:'1.0-8' }} 11 | {{ currencyProvider.currencySymbol }} 12 | 13 | 14 | 15 | From 16 | 17 | {{ tx.from }} 18 | 19 | 20 | 21 | To 22 | 23 | {{ tx.to }} 24 | 25 | 26 | 27 | Mined Time 28 | 29 | {{ tx.blocktime * 1000 | date:'long' }} 30 | 31 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { TransactionSummaryEthComponent } from './transaction-summary-eth'; 4 | 5 | @NgModule({ 6 | declarations: [TransactionSummaryEthComponent], 7 | imports: [IonicModule], 8 | exports: [TransactionSummaryEthComponent] 9 | }) 10 | export class TransactionSummaryEthComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.scss: -------------------------------------------------------------------------------- 1 | transaction-summary-eth { 2 | } 3 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ChainNetwork } from '../../providers/api/api'; 3 | import { CurrencyProvider } from '../../providers/currency/currency'; 4 | 5 | /** 6 | * Generated class for the TransactionSummaryEthComponent component. 7 | * 8 | * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html 9 | * for more info on Angular Components. 10 | */ 11 | @Component({ 12 | selector: 'transaction-summary-eth', 13 | templateUrl: 'transaction-summary-eth.html' 14 | }) 15 | export class TransactionSummaryEthComponent { 16 | @Input() 17 | public tx: any = {}; 18 | @Input() 19 | public chainNetwork: ChainNetwork; 20 | 21 | constructor(public currencyProvider: CurrencyProvider) {} 22 | } 23 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary/transaction-summary.html: -------------------------------------------------------------------------------- 1 | 2 | Size 3 | 4 | {{ tx.size }} (bytes) 5 | 6 | 7 | 8 | Fee Rate 9 | 10 | {{ (tx.fee / tx.size) | number:'1.0-2' }} sats/byte 11 | 12 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary/transaction-summary.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicModule } from 'ionic-angular'; 3 | import { TransactionSummaryComponent } from './transaction-summary'; 4 | 5 | @NgModule({ 6 | declarations: [TransactionSummaryComponent], 7 | imports: [IonicModule], 8 | exports: [TransactionSummaryComponent] 9 | }) 10 | export class TransactionSummaryComponentModule {} 11 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary/transaction-summary.scss: -------------------------------------------------------------------------------- 1 | transaction-summary { 2 | } 3 | -------------------------------------------------------------------------------- /packages/insight/src/components/transaction-summary/transaction-summary.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { ChainNetwork } from '../../providers/api/api'; 3 | import { CurrencyProvider } from '../../providers/currency/currency'; 4 | 5 | /** 6 | * Generated class for the TransactionSummaryComponent component. 7 | * 8 | * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html 9 | * for more info on Angular Components. 10 | */ 11 | @Component({ 12 | selector: 'transaction-summary', 13 | templateUrl: 'transaction-summary.html' 14 | }) 15 | export class TransactionSummaryComponent { 16 | @Input() 17 | public tx: any = {}; 18 | @Input() 19 | public chainNetwork: ChainNetwork; 20 | 21 | constructor(public currencyProvider: CurrencyProvider) {} 22 | } 23 | -------------------------------------------------------------------------------- /packages/insight/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Declaration files are how the Typescript compiler knows about the type information(or shape) of an object. 3 | They're what make intellisense work and make Typescript know all about your code. 4 | 5 | A wildcard module is declared below to allow third party libraries to be used in an app even if they don't 6 | provide their own type declarations. 7 | 8 | To learn more about using third party libraries in an Ionic app, check out the docs here: 9 | http://ionicframework.com/docs/v2/resources/third-party-libs/ 10 | 11 | For more info on type definition files, check out the Typescript docs here: 12 | https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html 13 | */ 14 | declare module '*'; 15 | -------------------------------------------------------------------------------- /packages/insight/src/directives/copy-to-clipboard/copy-to-clipboard.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CopyToClipboardDirective } from './copy-to-clipboard.directive'; 3 | 4 | @NgModule({ 5 | declarations: [CopyToClipboardDirective], 6 | exports: [CopyToClipboardDirective] 7 | }) 8 | export class CopyToClipboardModule {} 9 | -------------------------------------------------------------------------------- /packages/insight/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Insight", 3 | "short_name": "Insight", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [ 7 | { 8 | "src": "assets/img/logo.png", 9 | "sizes": "250x250", 10 | "type": "image/png" 11 | } 12 | ], 13 | "background_color": "#393eab", 14 | "theme_color": "#393eab" 15 | } 16 | -------------------------------------------------------------------------------- /packages/insight/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from './block'; 2 | -------------------------------------------------------------------------------- /packages/insight/src/models/mocks.ts: -------------------------------------------------------------------------------- 1 | // export * from './X.mock'; 2 | -------------------------------------------------------------------------------- /packages/insight/src/pages/address/address.scss: -------------------------------------------------------------------------------- 1 | page-address { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /packages/insight/src/pages/block-detail/block-detail.scss: -------------------------------------------------------------------------------- 1 | page-block-detail { 2 | // https://css-tricks.com/flexbox-truncated-text/ 3 | .allow-truncated-text { 4 | overflow: hidden; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/insight/src/pages/blocks/blocks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |

Blocks

9 | 10 |
11 | 12 |
13 |
14 | -------------------------------------------------------------------------------- /packages/insight/src/pages/blocks/blocks.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { FooterComponentModule } from '../../components/footer/footer.module'; 4 | import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; 5 | import { LatestBlocksComponentModule } from '../../components/latest-blocks/latest-blocks.module'; 6 | import { LoaderComponentModule } from '../../components/loader/loader.module'; 7 | import { BlocksPage } from './blocks'; 8 | 9 | @NgModule({ 10 | declarations: [BlocksPage], 11 | imports: [ 12 | IonicPageModule.forChild(BlocksPage), 13 | FooterComponentModule, 14 | HeadNavComponentModule, 15 | LatestBlocksComponentModule, 16 | LoaderComponentModule 17 | ], 18 | exports: [BlocksPage] 19 | }) 20 | export class BlocksPageModule {} 21 | -------------------------------------------------------------------------------- /packages/insight/src/pages/blocks/blocks.scss: -------------------------------------------------------------------------------- 1 | page-blocks { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /packages/insight/src/pages/broadcast-tx/broadcast-tx.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { FooterComponentModule } from '../../components/footer/footer.module'; 4 | import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; 5 | import { BroadcastTxPage } from './broadcast-tx'; 6 | 7 | @NgModule({ 8 | declarations: [BroadcastTxPage], 9 | imports: [ 10 | IonicPageModule.forChild(BroadcastTxPage), 11 | FooterComponentModule, 12 | HeadNavComponentModule 13 | ], 14 | exports: [BroadcastTxPage] 15 | }) 16 | export class BroadcastTxPageModule {} 17 | -------------------------------------------------------------------------------- /packages/insight/src/pages/broadcast-tx/broadcast-tx.scss: -------------------------------------------------------------------------------- 1 | page-broadcast-tx { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /packages/insight/src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | .chain { 3 | margin-bottom: -18px; 4 | border-bottom: 1px solid rgb(246, 246, 246) !important; 5 | color: rgb(0, 0, 0); 6 | padding-top: 1rem; 7 | padding-bottom: 1rem; 8 | border-radius: 9px 9px 0 0; 9 | 10 | :hover { 11 | cursor: default !important; 12 | } 13 | 14 | ion-label { 15 | font-weight: 600; 16 | font-size: 18px; 17 | } 18 | } 19 | 20 | ion-item.item-md:hover { 21 | cursor: default; 22 | transform: none; 23 | background-color: #fff; 24 | box-shadow: none; 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/insight/src/pages/index.ts: -------------------------------------------------------------------------------- 1 | export * from './home/home'; 2 | export * from './address/address'; 3 | export * from './block-detail/block-detail'; 4 | export * from './blocks/blocks'; 5 | export * from './broadcast-tx/broadcast-tx'; 6 | export * from './transaction/transaction'; 7 | export * from './pages.module'; 8 | -------------------------------------------------------------------------------- /packages/insight/src/pages/pages.scss: -------------------------------------------------------------------------------- 1 | .page-content { 2 | margin-bottom: 36px; 3 | } 4 | 5 | .page-content-menu { 6 | margin-top: 56px; 7 | margin-bottom: 36px; 8 | } 9 | 10 | @media (min-width: map-get($grid-breakpoints, lg)) { 11 | .page-content-grid { 12 | padding-right: calc((100% - #{map-get($grid-max-widths, lg)}) / 4); 13 | padding-left: calc((100% - #{map-get($grid-max-widths, lg)}) / 4); 14 | } 15 | } 16 | 17 | @media (max-width: map-get($grid-breakpoints, md)) { 18 | .page-content-grid-desktop { 19 | padding-right: calc((100% - #{map-get($grid-max-widths, lg)}) / 4); 20 | padding-left: calc((100% - #{map-get($grid-max-widths, lg)}) / 4); 21 | } 22 | } -------------------------------------------------------------------------------- /packages/insight/src/pages/search/search.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { ErrorComponentModule } from '../../components/error/error.module'; 4 | import { FooterComponentModule } from '../../components/footer/footer.module'; 5 | import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; 6 | import { LoaderComponentModule } from '../../components/loader/loader.module'; 7 | import { SearchPage } from './search'; 8 | 9 | @NgModule({ 10 | declarations: [SearchPage], 11 | imports: [ 12 | IonicPageModule.forChild(SearchPage), 13 | FooterComponentModule, 14 | HeadNavComponentModule, 15 | LoaderComponentModule, 16 | ErrorComponentModule 17 | ], 18 | exports: [SearchPage] 19 | }) 20 | export class SearchPageModule {} 21 | -------------------------------------------------------------------------------- /packages/insight/src/pages/search/search.scss: -------------------------------------------------------------------------------- 1 | page-search { 2 | .page-content { transition: all .2s ease-in-out; } 3 | .page-content:hover{ 4 | cursor: pointer; 5 | transform: scale(1.02); 6 | } 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/insight/src/pages/transaction/transaction.scss: -------------------------------------------------------------------------------- 1 | page-transaction { 2 | ion-note > .tx-note{ 3 | font-size: 2.2rem; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/insight/src/pipes/split/split.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'split' 5 | }) 6 | export class SplitPipe implements PipeTransform { 7 | /** 8 | * Takes a value and makes it lowercase. 9 | */ 10 | public transform(value: string, delimiter: string): string[] { 11 | const array: string[] = value.split(delimiter); 12 | return array; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/insight/src/providers/api/api.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { inject, TestBed } from '@angular/core/testing'; 3 | import { HttpModule } from '@angular/http'; 4 | import { ApiProvider } from '../api/api'; 5 | import { DefaultProvider } from '../default/default'; 6 | 7 | describe('ApiProvider', () => { 8 | let api: ApiProvider; 9 | 10 | beforeEach(() => { 11 | TestBed.configureTestingModule({ 12 | imports: [HttpModule], 13 | providers: [ApiProvider, DefaultProvider] 14 | }); 15 | }); 16 | 17 | beforeEach(inject([ApiProvider], provider => { 18 | api = provider; 19 | })); 20 | 21 | it('initializes', () => { 22 | expect(api).not.toBeNull(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/insight/src/providers/default/default.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class DefaultProvider { 5 | private defaults: { 6 | '%CHAIN%': string; 7 | '%API_PREFIX%': string; 8 | '%NETWORK%': string; 9 | '%NUM_BLOCKS%': string; 10 | } = { 11 | '%CHAIN%': process.env.CHAIN || 'BTG', 12 | '%API_PREFIX%': process.env.API_PREFIX || '/api', 13 | '%NETWORK%': process.env.NETWORK || 'mainnet', 14 | '%NUM_BLOCKS%': process.env.NUM_BLOCKS || '15' 15 | }; 16 | 17 | constructor() {} 18 | 19 | public getDefault(str: string): string { 20 | return this.defaults[str] !== undefined ? this.defaults[str] : str; 21 | } 22 | 23 | public setDefault(str: string, value: any): void { 24 | this.defaults[str] = value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/insight/src/providers/redir/redir.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Events } from 'ionic-angular'; 3 | 4 | @Injectable() 5 | export class RedirProvider { 6 | constructor(private events: Events) {} 7 | 8 | public redir(redirTo, params) { 9 | this.events.publish('redirToEvent', { redirTo, params }); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/insight/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "typeRoots": ["node_modules/@types"], 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["test.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/insight/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": ["dom", "es2015"], 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "sourceMap": true, 11 | "target": "es5" 12 | }, 13 | "include": ["src/**/*.ts"], 14 | "exclude": ["node_modules", "src/test.ts", "src/mocks.ts", "**/*.spec.ts"], 15 | "compileOnSave": false 16 | } 17 | -------------------------------------------------------------------------------- /packages/insight/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["tslint:latest", "tslint-angular", "tslint-config-prettier"], 3 | "rules": { 4 | "no-submodule-imports": false, 5 | "interface-name": [true, "never-prefix"], 6 | "component-class-suffix": [true, "Component", "Page", "App"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/pub: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MODULES='bitcore-build bitcore-lib bitcore-lib-cash bitcore-mnemonic crypto-wallet-core bitcore-wallet-service bitcore-wallet-client bitcore-client bitcore-lib-ltc' 4 | 5 | 6 | for i in $MODULES; 7 | do 8 | cd $i && npm run pub ; cd .. 9 | done 10 | -------------------------------------------------------------------------------- /pipenv: -------------------------------------------------------------------------------- 1 | 2019-11-25T18:43:29,667 ERROR: You must give at least one requirement to uninstall (see "pip help uninstall") 2 | 2019-11-25T18:43:29,667 Exception information: 3 | 2019-11-25T18:43:29,667 Traceback (most recent call last): 4 | 2019-11-25T18:43:29,667 File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 153, in _main 5 | 2019-11-25T18:43:29,667 status = self.run(options, args) 6 | 2019-11-25T18:43:29,667 File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/uninstall.py", line 70, in run 7 | 2019-11-25T18:43:29,667 '"pip help %(name)s")' % dict(name=self.name) 8 | 2019-11-25T18:43:29,667 pip._internal.exceptions.InstallationError: You must give at least one requirement to uninstall (see "pip help uninstall") 9 | -------------------------------------------------------------------------------- /scripts/publish_insight_to_branch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | REV=$(git rev-parse --short HEAD) 4 | NODE_VER=$(node --version) 5 | 6 | if [ $NODE_VER != "v11.15.0" ]; then 7 | echo "Node version must be v11.15.0, but you have ${NODE_VER}" 8 | exit -1 9 | fi 10 | 11 | pushd packages/insight 12 | npm run build:prod 13 | popd 14 | 15 | 16 | DIR=$(mktemp -d -t insight-prod-XXXXXX) 17 | 18 | cp -r ./packages/insight/www/* "$DIR/" 19 | git checkout insight-prod 20 | cp -r $DIR/* ./ 21 | echo "$REV" > REV 22 | 23 | git add . 24 | git commit -m "Publish ${REV}" 25 | 26 | rm -rf "$DIR" 27 | 28 | # push to github: 29 | # git push origin insight-prod:insight-prod 30 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | export DB_HOST=127.0.0.1 2 | export DB_NAME=bitcore-tbtg 3 | export BITCORE_CONFIG_PATH=$HOME/bitcore/tbtg.json 4 | export NETWORK=mainnet 5 | export CHAIN=BTG 6 | 7 | case $1 in 8 | node) 9 | exec &> >(tee -a debug.node) 10 | npm run node 11 | ;; 12 | insight) 13 | exec &> >(tee -a debug.insight) 14 | npm run insight 15 | ;; 16 | *) 17 | echo 'Unknown command; qed' 18 | esac --------------------------------------------------------------------------------