From 468ff9866ed079d29e81b45879be115310b6cf62 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 20:31:32 +0200 Subject: [PATCH 01/10] remove temp-test-module --- packages/kauri-wallet/package.json | 1 - packages/kauri-wallet/src/app/app.component.html | 1 - packages/kauri-wallet/src/app/app.component.ts | 2 -- packages/temp-test-module/index.js | 2 -- packages/temp-test-module/package-lock.json | 5 ----- packages/temp-test-module/package.json | 12 ------------ 6 files changed, 23 deletions(-) delete mode 100644 packages/temp-test-module/index.js delete mode 100644 packages/temp-test-module/package-lock.json delete mode 100644 packages/temp-test-module/package.json diff --git a/packages/kauri-wallet/package.json b/packages/kauri-wallet/package.json index ab5a72e..69984f5 100644 --- a/packages/kauri-wallet/package.json +++ b/packages/kauri-wallet/package.json @@ -56,7 +56,6 @@ "component": "^1.1.0", "core-js": "^2.5.4", "rxjs": "^6.0.0", - "temp-test-module": "^1.0.0", "zone.js": "^0.8.26" }, "devDependencies": { diff --git a/packages/kauri-wallet/src/app/app.component.html b/packages/kauri-wallet/src/app/app.component.html index 260a2e8..634a65b 100644 --- a/packages/kauri-wallet/src/app/app.component.html +++ b/packages/kauri-wallet/src/app/app.component.html @@ -2,7 +2,6 @@

{{ title }}

-

Test importing via lerna: {{ lernaTest }}

diff --git a/packages/kauri-wallet/src/app/app.component.ts b/packages/kauri-wallet/src/app/app.component.ts index ab4563c..d0159d8 100644 --- a/packages/kauri-wallet/src/app/app.component.ts +++ b/packages/kauri-wallet/src/app/app.component.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; -import lernaImportTest from 'temp-test-module'; import { SwLogService } from './features/service-workers/sw-log.service'; @@ -12,5 +11,4 @@ import { SwLogService } from './features/service-workers/sw-log.service'; export class AppComponent { constructor(private _SwLogService: SwLogService) {} title = 'Kauri Wallet'; - lernaTest = lernaImportTest; } diff --git a/packages/temp-test-module/index.js b/packages/temp-test-module/index.js deleted file mode 100644 index 1e3a5ac..0000000 --- a/packages/temp-test-module/index.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = 'This text exported from temp-test-module' - diff --git a/packages/temp-test-module/package-lock.json b/packages/temp-test-module/package-lock.json deleted file mode 100644 index 9eb8f11..0000000 --- a/packages/temp-test-module/package-lock.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "temp-test-module", - "version": "1.0.0", - "lockfileVersion": 1 -} diff --git a/packages/temp-test-module/package.json b/packages/temp-test-module/package.json deleted file mode 100644 index c0919bc..0000000 --- a/packages/temp-test-module/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "temp-test-module", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} From 485b71ab4a87a4537d962b2448ab995c9e47075e Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 20:37:45 +0200 Subject: [PATCH 02/10] Add kauri-bitcore-lib --- packages/kauri-bitcore-lib/.coveralls.yml | 1 + packages/kauri-bitcore-lib/.gitignore | 23 + packages/kauri-bitcore-lib/.jsdoc.conf | 36 + packages/kauri-bitcore-lib/.jshintrc | 45 + packages/kauri-bitcore-lib/.travis.yml | 14 + packages/kauri-bitcore-lib/.zuul.yml | 12 + packages/kauri-bitcore-lib/CONTRIBUTING.md | 268 + packages/kauri-bitcore-lib/LICENSE | 32 + packages/kauri-bitcore-lib/README.md | 96 + .../benchmark/block-357238.json | 1 + .../kauri-bitcore-lib/benchmark/package.json | 8 + .../kauri-bitcore-lib/benchmark/script.js | 85 + .../benchmark/serialization.js | 122 + packages/kauri-bitcore-lib/bitcore-lib.js | 54148 ++++++++++++++++ packages/kauri-bitcore-lib/bower.json | 21 + packages/kauri-bitcore-lib/docs/address.md | 65 + packages/kauri-bitcore-lib/docs/block.md | 46 + packages/kauri-bitcore-lib/docs/browser.md | 66 + packages/kauri-bitcore-lib/docs/crypto.md | 17 + packages/kauri-bitcore-lib/docs/encoding.md | 8 + packages/kauri-bitcore-lib/docs/examples.md | 113 + .../kauri-bitcore-lib/docs/hierarchical.md | 52 + packages/kauri-bitcore-lib/docs/index.md | 104 + packages/kauri-bitcore-lib/docs/networks.md | 55 + packages/kauri-bitcore-lib/docs/privatekey.md | 47 + packages/kauri-bitcore-lib/docs/publickey.md | 59 + packages/kauri-bitcore-lib/docs/script.md | 136 + .../kauri-bitcore-lib/docs/transaction.md | 177 + packages/kauri-bitcore-lib/docs/unit.md | 80 + .../kauri-bitcore-lib/docs/unspentoutput.md | 32 + packages/kauri-bitcore-lib/docs/uri.md | 41 + packages/kauri-bitcore-lib/gulpfile.js | 5 + packages/kauri-bitcore-lib/index.js | 69 + packages/kauri-bitcore-lib/karma.conf.js | 36 + packages/kauri-bitcore-lib/lib/address.js | 505 + packages/kauri-bitcore-lib/lib/block/block.js | 281 + .../lib/block/blockheader.js | 296 + packages/kauri-bitcore-lib/lib/block/index.js | 4 + .../lib/block/merkleblock.js | 313 + packages/kauri-bitcore-lib/lib/crypto/bn.js | 202 + .../kauri-bitcore-lib/lib/crypto/ecdsa.js | 296 + packages/kauri-bitcore-lib/lib/crypto/hash.js | 85 + .../kauri-bitcore-lib/lib/crypto/point.js | 150 + .../kauri-bitcore-lib/lib/crypto/random.js | 57 + .../kauri-bitcore-lib/lib/crypto/signature.js | 313 + .../kauri-bitcore-lib/lib/encoding/base58.js | 70 + .../lib/encoding/base58check.js | 95 + .../lib/encoding/bufferreader.js | 198 + .../lib/encoding/bufferwriter.js | 155 + .../kauri-bitcore-lib/lib/encoding/varint.js | 72 + .../kauri-bitcore-lib/lib/errors/index.js | 61 + packages/kauri-bitcore-lib/lib/errors/spec.js | 184 + .../kauri-bitcore-lib/lib/hdprivatekey.js | 646 + packages/kauri-bitcore-lib/lib/hdpublickey.js | 496 + packages/kauri-bitcore-lib/lib/networks.js | 269 + packages/kauri-bitcore-lib/lib/opcode.js | 248 + packages/kauri-bitcore-lib/lib/privatekey.js | 400 + packages/kauri-bitcore-lib/lib/publickey.js | 393 + .../kauri-bitcore-lib/lib/script/index.js | 3 + .../lib/script/interpreter.js | 1399 + .../kauri-bitcore-lib/lib/script/script.js | 1163 + .../lib/transaction/index.js | 8 + .../lib/transaction/input/index.js | 6 + .../lib/transaction/input/input.js | 219 + .../lib/transaction/input/multisig.js | 211 + .../transaction/input/multisigscripthash.js | 241 + .../lib/transaction/input/publickey.js | 89 + .../lib/transaction/input/publickeyhash.js | 95 + .../lib/transaction/output.js | 168 + .../lib/transaction/sighash.js | 136 + .../lib/transaction/sighashwitness.js | 149 + .../lib/transaction/signature.js | 89 + .../lib/transaction/transaction.js | 1333 + .../lib/transaction/unspentoutput.js | 100 + packages/kauri-bitcore-lib/lib/unit.js | 238 + packages/kauri-bitcore-lib/lib/uri.js | 223 + packages/kauri-bitcore-lib/lib/util/buffer.js | 177 + packages/kauri-bitcore-lib/lib/util/js.js | 84 + .../lib/util/preconditions.js | 34 + packages/kauri-bitcore-lib/package-lock.json | 10992 ++++ packages/kauri-bitcore-lib/package.json | 52 + packages/kauri-bitcore-lib/test/address.js | 572 + .../kauri-bitcore-lib/test/block/block.js | 268 + .../test/block/blockheader.js | 302 + .../test/block/merkleblock.js | 230 + packages/kauri-bitcore-lib/test/crypto/bn.js | 153 + .../kauri-bitcore-lib/test/crypto/ecdsa.js | 325 + .../kauri-bitcore-lib/test/crypto/hash.js | 139 + .../kauri-bitcore-lib/test/crypto/point.js | 173 + .../kauri-bitcore-lib/test/crypto/random.js | 36 + .../test/crypto/signature.js | 340 + .../kauri-bitcore-lib/test/data/bip69.json | 215 + .../data/bitcoind/base58_keys_invalid.json | 152 + .../test/data/bitcoind/base58_keys_valid.json | 452 + .../test/data/bitcoind/blocks.json | 27 + .../test/data/bitcoind/script_invalid.json | 672 + .../test/data/bitcoind/script_valid.json | 821 + .../test/data/bitcoind/sig_canonical.json | 7 + .../test/data/bitcoind/sig_noncanonical.json | 22 + .../test/data/bitcoind/tx_invalid.json | 174 + .../test/data/bitcoind/tx_valid.json | 224 + .../test/data/blk86756-testnet.dat | Bin 0 -> 9500 bytes .../test/data/blk86756-testnet.js | 12 + .../test/data/blk86756-testnet.json | 684 + .../kauri-bitcore-lib/test/data/ecdsa.json | 230 + .../test/data/merkleblocks.js | 486 + .../kauri-bitcore-lib/test/data/messages.json | 22 + .../kauri-bitcore-lib/test/data/sighash.json | 503 + .../test/data/tx_creation.json | 85 + packages/kauri-bitcore-lib/test/docs.js | 17 + .../kauri-bitcore-lib/test/encoding/base58.js | 123 + .../test/encoding/base58check.js | 124 + .../test/encoding/bufferreader.js | 360 + .../test/encoding/bufferwriter.js | 188 + .../kauri-bitcore-lib/test/encoding/varint.js | 126 + packages/kauri-bitcore-lib/test/hdkeys.js | 372 + .../kauri-bitcore-lib/test/hdprivatekey.js | 311 + .../kauri-bitcore-lib/test/hdpublickey.js | 275 + packages/kauri-bitcore-lib/test/index.html | 18 + packages/kauri-bitcore-lib/test/index.js | 16 + packages/kauri-bitcore-lib/test/mocha.opts | 2 + packages/kauri-bitcore-lib/test/networks.js | 128 + packages/kauri-bitcore-lib/test/opcode.js | 165 + packages/kauri-bitcore-lib/test/privatekey.js | 457 + packages/kauri-bitcore-lib/test/publickey.js | 430 + .../test/script/interpreter.js | 417 + .../kauri-bitcore-lib/test/script/script.js | 1079 + .../test/transaction/deserialize.js | 34 + .../test/transaction/input/input.js | 99 + .../test/transaction/input/multisig.js | 177 + .../transaction/input/multisigscripthash.js | 147 + .../test/transaction/input/publickey.js | 71 + .../test/transaction/input/publickeyhash.js | 64 + .../test/transaction/output.js | 191 + .../test/transaction/sighash.js | 37 + .../test/transaction/sighashwitness.js | 24 + .../test/transaction/signature.js | 133 + .../test/transaction/transaction.js | 1677 + .../test/transaction/unspentoutput.js | 94 + packages/kauri-bitcore-lib/test/unit.js | 197 + packages/kauri-bitcore-lib/test/uri.js | 257 + .../kauri-bitcore-lib/test/util/buffer.js | 156 + packages/kauri-bitcore-lib/test/util/js.js | 83 + .../test/util/preconditions.js | 80 + 144 files changed, 94573 insertions(+) create mode 100644 packages/kauri-bitcore-lib/.coveralls.yml create mode 100644 packages/kauri-bitcore-lib/.gitignore create mode 100644 packages/kauri-bitcore-lib/.jsdoc.conf create mode 100644 packages/kauri-bitcore-lib/.jshintrc create mode 100644 packages/kauri-bitcore-lib/.travis.yml create mode 100644 packages/kauri-bitcore-lib/.zuul.yml create mode 100644 packages/kauri-bitcore-lib/CONTRIBUTING.md create mode 100644 packages/kauri-bitcore-lib/LICENSE create mode 100644 packages/kauri-bitcore-lib/README.md create mode 100644 packages/kauri-bitcore-lib/benchmark/block-357238.json create mode 100644 packages/kauri-bitcore-lib/benchmark/package.json create mode 100644 packages/kauri-bitcore-lib/benchmark/script.js create mode 100644 packages/kauri-bitcore-lib/benchmark/serialization.js create mode 100644 packages/kauri-bitcore-lib/bitcore-lib.js create mode 100644 packages/kauri-bitcore-lib/bower.json create mode 100644 packages/kauri-bitcore-lib/docs/address.md create mode 100644 packages/kauri-bitcore-lib/docs/block.md create mode 100644 packages/kauri-bitcore-lib/docs/browser.md create mode 100644 packages/kauri-bitcore-lib/docs/crypto.md create mode 100644 packages/kauri-bitcore-lib/docs/encoding.md create mode 100644 packages/kauri-bitcore-lib/docs/examples.md create mode 100644 packages/kauri-bitcore-lib/docs/hierarchical.md create mode 100644 packages/kauri-bitcore-lib/docs/index.md create mode 100644 packages/kauri-bitcore-lib/docs/networks.md create mode 100644 packages/kauri-bitcore-lib/docs/privatekey.md create mode 100644 packages/kauri-bitcore-lib/docs/publickey.md create mode 100644 packages/kauri-bitcore-lib/docs/script.md create mode 100644 packages/kauri-bitcore-lib/docs/transaction.md create mode 100644 packages/kauri-bitcore-lib/docs/unit.md create mode 100644 packages/kauri-bitcore-lib/docs/unspentoutput.md create mode 100644 packages/kauri-bitcore-lib/docs/uri.md create mode 100644 packages/kauri-bitcore-lib/gulpfile.js create mode 100644 packages/kauri-bitcore-lib/index.js create mode 100644 packages/kauri-bitcore-lib/karma.conf.js create mode 100644 packages/kauri-bitcore-lib/lib/address.js create mode 100644 packages/kauri-bitcore-lib/lib/block/block.js create mode 100644 packages/kauri-bitcore-lib/lib/block/blockheader.js create mode 100644 packages/kauri-bitcore-lib/lib/block/index.js create mode 100644 packages/kauri-bitcore-lib/lib/block/merkleblock.js create mode 100644 packages/kauri-bitcore-lib/lib/crypto/bn.js create mode 100644 packages/kauri-bitcore-lib/lib/crypto/ecdsa.js create mode 100644 packages/kauri-bitcore-lib/lib/crypto/hash.js create mode 100644 packages/kauri-bitcore-lib/lib/crypto/point.js create mode 100644 packages/kauri-bitcore-lib/lib/crypto/random.js create mode 100644 packages/kauri-bitcore-lib/lib/crypto/signature.js create mode 100644 packages/kauri-bitcore-lib/lib/encoding/base58.js create mode 100644 packages/kauri-bitcore-lib/lib/encoding/base58check.js create mode 100644 packages/kauri-bitcore-lib/lib/encoding/bufferreader.js create mode 100644 packages/kauri-bitcore-lib/lib/encoding/bufferwriter.js create mode 100644 packages/kauri-bitcore-lib/lib/encoding/varint.js create mode 100644 packages/kauri-bitcore-lib/lib/errors/index.js create mode 100644 packages/kauri-bitcore-lib/lib/errors/spec.js create mode 100644 packages/kauri-bitcore-lib/lib/hdprivatekey.js create mode 100644 packages/kauri-bitcore-lib/lib/hdpublickey.js create mode 100644 packages/kauri-bitcore-lib/lib/networks.js create mode 100644 packages/kauri-bitcore-lib/lib/opcode.js create mode 100644 packages/kauri-bitcore-lib/lib/privatekey.js create mode 100644 packages/kauri-bitcore-lib/lib/publickey.js create mode 100644 packages/kauri-bitcore-lib/lib/script/index.js create mode 100644 packages/kauri-bitcore-lib/lib/script/interpreter.js create mode 100644 packages/kauri-bitcore-lib/lib/script/script.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/index.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/input/index.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/input/input.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/input/multisig.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/input/multisigscripthash.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/input/publickey.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/input/publickeyhash.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/output.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/sighash.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/sighashwitness.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/signature.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/transaction.js create mode 100644 packages/kauri-bitcore-lib/lib/transaction/unspentoutput.js create mode 100644 packages/kauri-bitcore-lib/lib/unit.js create mode 100644 packages/kauri-bitcore-lib/lib/uri.js create mode 100644 packages/kauri-bitcore-lib/lib/util/buffer.js create mode 100644 packages/kauri-bitcore-lib/lib/util/js.js create mode 100644 packages/kauri-bitcore-lib/lib/util/preconditions.js create mode 100644 packages/kauri-bitcore-lib/package-lock.json create mode 100644 packages/kauri-bitcore-lib/package.json create mode 100644 packages/kauri-bitcore-lib/test/address.js create mode 100644 packages/kauri-bitcore-lib/test/block/block.js create mode 100644 packages/kauri-bitcore-lib/test/block/blockheader.js create mode 100644 packages/kauri-bitcore-lib/test/block/merkleblock.js create mode 100644 packages/kauri-bitcore-lib/test/crypto/bn.js create mode 100644 packages/kauri-bitcore-lib/test/crypto/ecdsa.js create mode 100644 packages/kauri-bitcore-lib/test/crypto/hash.js create mode 100644 packages/kauri-bitcore-lib/test/crypto/point.js create mode 100644 packages/kauri-bitcore-lib/test/crypto/random.js create mode 100644 packages/kauri-bitcore-lib/test/crypto/signature.js create mode 100644 packages/kauri-bitcore-lib/test/data/bip69.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_invalid.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_valid.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/blocks.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/script_invalid.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/script_valid.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/sig_canonical.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/sig_noncanonical.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/tx_invalid.json create mode 100644 packages/kauri-bitcore-lib/test/data/bitcoind/tx_valid.json create mode 100644 packages/kauri-bitcore-lib/test/data/blk86756-testnet.dat create mode 100644 packages/kauri-bitcore-lib/test/data/blk86756-testnet.js create mode 100644 packages/kauri-bitcore-lib/test/data/blk86756-testnet.json create mode 100644 packages/kauri-bitcore-lib/test/data/ecdsa.json create mode 100644 packages/kauri-bitcore-lib/test/data/merkleblocks.js create mode 100644 packages/kauri-bitcore-lib/test/data/messages.json create mode 100644 packages/kauri-bitcore-lib/test/data/sighash.json create mode 100644 packages/kauri-bitcore-lib/test/data/tx_creation.json create mode 100644 packages/kauri-bitcore-lib/test/docs.js create mode 100644 packages/kauri-bitcore-lib/test/encoding/base58.js create mode 100644 packages/kauri-bitcore-lib/test/encoding/base58check.js create mode 100644 packages/kauri-bitcore-lib/test/encoding/bufferreader.js create mode 100644 packages/kauri-bitcore-lib/test/encoding/bufferwriter.js create mode 100644 packages/kauri-bitcore-lib/test/encoding/varint.js create mode 100644 packages/kauri-bitcore-lib/test/hdkeys.js create mode 100644 packages/kauri-bitcore-lib/test/hdprivatekey.js create mode 100644 packages/kauri-bitcore-lib/test/hdpublickey.js create mode 100644 packages/kauri-bitcore-lib/test/index.html create mode 100644 packages/kauri-bitcore-lib/test/index.js create mode 100644 packages/kauri-bitcore-lib/test/mocha.opts create mode 100644 packages/kauri-bitcore-lib/test/networks.js create mode 100644 packages/kauri-bitcore-lib/test/opcode.js create mode 100644 packages/kauri-bitcore-lib/test/privatekey.js create mode 100644 packages/kauri-bitcore-lib/test/publickey.js create mode 100644 packages/kauri-bitcore-lib/test/script/interpreter.js create mode 100644 packages/kauri-bitcore-lib/test/script/script.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/deserialize.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/input/input.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/input/multisig.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/input/multisigscripthash.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/input/publickey.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/input/publickeyhash.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/output.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/sighash.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/sighashwitness.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/signature.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/transaction.js create mode 100644 packages/kauri-bitcore-lib/test/transaction/unspentoutput.js create mode 100644 packages/kauri-bitcore-lib/test/unit.js create mode 100644 packages/kauri-bitcore-lib/test/uri.js create mode 100644 packages/kauri-bitcore-lib/test/util/buffer.js create mode 100644 packages/kauri-bitcore-lib/test/util/js.js create mode 100644 packages/kauri-bitcore-lib/test/util/preconditions.js diff --git a/packages/kauri-bitcore-lib/.coveralls.yml b/packages/kauri-bitcore-lib/.coveralls.yml new file mode 100644 index 0000000..042007d --- /dev/null +++ b/packages/kauri-bitcore-lib/.coveralls.yml @@ -0,0 +1 @@ +repo_token: 5ki6iPbGaiwHzIwcfNDzTXoiqAcffqUQs diff --git a/packages/kauri-bitcore-lib/.gitignore b/packages/kauri-bitcore-lib/.gitignore new file mode 100644 index 0000000..efe72ac --- /dev/null +++ b/packages/kauri-bitcore-lib/.gitignore @@ -0,0 +1,23 @@ +*.swp +coverage +node_modules +browser/tests.js +docs/api + +CONTRIBUTING.html +LICENSE.html +README.html +examples.html +npm-debug.log + +apiref +bower_components +report +.DS_Store + + +bitcore.js +bitcore.min.js +bitcore.js.sig +bitcore.min.js.sig +tests.js diff --git a/packages/kauri-bitcore-lib/.jsdoc.conf b/packages/kauri-bitcore-lib/.jsdoc.conf new file mode 100644 index 0000000..a6a59aa --- /dev/null +++ b/packages/kauri-bitcore-lib/.jsdoc.conf @@ -0,0 +1,36 @@ +{ +"tags": { + "allowUnknownTags": true +}, +"source": { + "include": ["docs/README.md"], + "exclude": [], + "includePattern": "lib/.+\\.js(doc)?$", + "excludePattern": "(^|\\/|\\\\)_" +}, +"plugins": ["plugins/markdown"], +"templates": { + "cleverLinks": false, + "monospaceLinks": false +}, +"opts": { + "template": "node_modules/ink-docstrap/template", + "encoding": "utf8", + "destination": "./apiref/", + "recurse": true, + "query": "value", + "private": true, + "lenient": true +}, +"templates": { + "systemName": "bitcore", + "copyright": "© 2013-2015, BitPay Inc.", + "navType": "vertical", + "theme": "journal", + "linenums": true, + "collapseSymbols": false, + "inverseNav": false, + "outputSourceFiles": true +} + +} diff --git a/packages/kauri-bitcore-lib/.jshintrc b/packages/kauri-bitcore-lib/.jshintrc new file mode 100644 index 0000000..a32b29c --- /dev/null +++ b/packages/kauri-bitcore-lib/.jshintrc @@ -0,0 +1,45 @@ +{ + "bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.). + "browser": true, // Standard browser globals e.g. `window`, `document`. + "camelcase": false, // Permit only camelcase for `var` and `object indexes`. + "curly": true, // Require {} for every new block or scope. + "devel": false, // Allow development statements e.g. `console.log();`. + "eqeqeq": true, // Require triple equals i.e. `===`. + "esnext": true, // Allow ES.next specific features such as `const` and `let`. + "freeze": true, // Forbid overwriting prototypes of native objects such as Array, Date and so on. + "immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` + "indent": 2, // Specify indentation spacing + "latedef": true, // Prohibit variable use before definition. + "newcap": false, // Require capitalization of all constructor functions e.g. `new F()`. + "noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. + "node": true, // Enable globals available when code is running inside of the NodeJS runtime environment. + "noempty": true, // Prohibit use of empty blocks. + "nonew": true, // Prohibits the use of constructor functions for side-effects + "quotmark": "single", // Define quotes to string values. + "regexp": true, // Prohibit `.` and `[^...]` in regular expressions. + "smarttabs": false, // Supress warnings about mixed tabs and spaces + "strict": true, // Require `use strict` pragma in every file. + "trailing": true, // Prohibit trailing whitespaces. + "undef": true, // Require all non-global variables be declared before they are used. + "unused": true, // Warn unused variables. + + "maxparams": 4, // Maximum number of parameters for a function + "maxstatements": 15, // Maximum number of statements in a function + "maxcomplexity": 10, // Cyclomatic complexity (http://en.wikipedia.org/wiki/Cyclomatic_complexity) + "maxdepth": 4, // Maximum depth of nested control structures + "maxlen": 120, // Maximum number of cols in a line + "multistr": true, // Allow use of multiline EOL escaping + + "predef": [ // Extra globals. + "after", + "afterEach", + "before", + "beforeEach", + "define", + "describe", + "exports", + "it", + "module", + "require" + ] +} diff --git a/packages/kauri-bitcore-lib/.travis.yml b/packages/kauri-bitcore-lib/.travis.yml new file mode 100644 index 0000000..c004a62 --- /dev/null +++ b/packages/kauri-bitcore-lib/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +sudo: false +node_js: +- '6' +- '8' +before_install: + - npm install -g bower + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start +install: + - bower install + - npm install +after_script: + - gulp coveralls diff --git a/packages/kauri-bitcore-lib/.zuul.yml b/packages/kauri-bitcore-lib/.zuul.yml new file mode 100644 index 0000000..c56d3e2 --- /dev/null +++ b/packages/kauri-bitcore-lib/.zuul.yml @@ -0,0 +1,12 @@ +ui: mocha-bdd +browsers: + - name: chrome + version: 30..latest + - name: firefox + version: 30..latest + - name: ie + version: latest + - name: safari + version: latest +browserify: + - transform: brfs diff --git a/packages/kauri-bitcore-lib/CONTRIBUTING.md b/packages/kauri-bitcore-lib/CONTRIBUTING.md new file mode 100644 index 0000000..b550cd9 --- /dev/null +++ b/packages/kauri-bitcore-lib/CONTRIBUTING.md @@ -0,0 +1,268 @@ +Contributing to Bitcore +======= + +We're working hard to make *bitcore* the most powerful JavaScript library for working with bitcoin. Our goal is to have *bitcore* be a library that can be used by anyone interested in bitcoin, and to level expertise differences with great design and documentation. + +## Community + +If there are any questions, etc., please feel to ask in one of the community channels: + +- https://labs.bitpay.com/c/bitcore (Support Forum) +- https://gitter.im/bitpay/bitcore (Development Chat) + +## Quick Checklist + +Ideally, please make sure to run: + +* `gulp test` passes all the tests (We run tests against Node.js v0.10, v0.12, io.js, and modern browsers) +* `gulp coverage` covers 100% of the branches of your code (See `coverage/lcov-report/index.html` for details) +* `gulp lint` doesn't complain about your changes + +## Design Guidelines + +These are some global design goals in bitcore that any change must adhere. + +### D1 - Naming Matters + +We take our time with picking names. Code is going to be written once, and read hundreds of times. + +We were inspired to name this rule first due to Uncle Bob's great work *Clean Code*, which has a whole chapter on this subject. + +In particular, you may notice that some names in this library are quite long for the average JavaScript user. That's because we prefer a long but comprehensible name than an abbreviation that might confuse new users. + +### D2 - Tests + +Write a test for all your code. We encourage Test Driven Development so we know when our code is right. We have increased test coverage from 80% to around 95% and are targeting 100% as we move towards our 1.0 release. + +### D3 - Robustness Principle + +*Be conservative in what you send, be liberal in what you accept.* + +Interfaces should accept as many types of arguments as possible, so there's no mental tax on using them: we want to avoid questions such as "should I use a string here or a buffer?", "what happens if I'm not sure if the type of this variable is an Address instance or a string with it encoded in base-58?" or "what kind of object will I receive after calling this function?". + +Accept a wide variety of use cases and arguments, always return an internal form of an object. For example, the class `PublicKey` can accept strings or buffers with a DER encoded public key (either compressed or uncompressed), another PublicKey, a PrivateKey, or a Point, an instance of the `elliptic.js` library with the point in bitcoin's elliptic curve that represents the public key. + +### D4 - Consistency Everywhere + +Consistency on the way classes are used is paramount to allow an easier understanding of the library. + +## Style Guidelines + +The design guidelines have quite a high abstraction level. These style guidelines are more concrete and easier to apply, and also more opinionated. The design guidelines mentioned above are the way we think about general software development and we believe they should be present in any software project. + +### General + +#### G0 - Default to Felixge's Style Guide + +Follow this Node.js Style Guide: https://github.com/felixge/node-style-guide#nodejs-style-guide + +#### G1 - No Magic Numbers + +Avoid constants in the code as much as possible. Magic strings are also magic numbers. + +#### G2 - Internal Objects Should be Instances + +If a class has a `publicKey` member, for instance, that should be a `PublicKey` instance. + +#### G3 - Internal Amounts Must be Integers Representing Satoshis + +Avoid representation errors by always dealing with satoshis. For conversion for frontends, use the `Unit` class. + +#### G4 - Internal Network References Must be Network Instances + +A special case for [G2](#g2---general-internal-objects-should-be-instances) all network references must be `Network` instances (see `lib/network.js`), but when returned to the user, its `.name` property should be used. + +#### G5 - Objects Should Display Nicely in the Console + +Write a `.inspect()` method so an instance can be easily debugged in the console. + +#### G6 - Naming Utility Namespaces + +Name them in UpperCamelCase, as they are namespaces. + +DO: +```javascript +var BufferUtil = require('./util/buffer'); +``` +DON'T: +```javascript +var bufferUtil = require('./util/buffer'); +``` + +#### G7 - Standard Methods + +When possible, bitcore objects should have standard methods on an instance prototype: +* `toObject/toJSON` - A plain JavaScript object that `JSON.stringify` can call +* `toString` - A string representation of the instance +* `toBuffer` - A hex Buffer + +These should have a matching static method that can be used for instantiation: +* `fromObject` - Should be able to instantiate with the output from `toObject/toJSON` +* `fromString` - Should be able to instantiate with output from `toString` +* `fromBuffer` - Should likewise be able to instantiate from output from `toBuffer` + +`JSON.stringify` and `JSON.parse` are expected to be handled outside of the scope of Bitcore methods. For example, calling `JSON.stringify` on an Bitcore object will behave as expected and call `transaction.toJSON()` and then stringify it: + +```javascript +var transactionString = JSON.stringify(transaction); +``` + +Likewise to instantiate a transaction from that string: + +```javascript +var data = JSON.parse(transactionString); +var tx = new Transaction(data); +``` + +### Errors + +#### E1 - Use bitcore.Errors + +We've designed a structure for Errors to follow and are slowly migrating to it. + +Usage: +* Errors are generated in the file `lib/errors/index.js` by invoking `gulp errors`. +* The specification for errors is written in the `lib/errors/spec.js` file. +* Whenever a new class is created, add a generic error for that class in `lib/errors/spec.js`. +* Specific errors for that class should subclass that error. Take a look at the structure in `lib/errors/spec.js`, it should be clear how subclasses are generated from that file. + +#### E2 - Provide a `getValidationError` Static Method for Classes + +### Interface + +#### I1 - Code that Fails Early + +In order to deal with JavaScript's weak typing and confusing errors, we ask our code to fail as soon as possible when an unexpected input was provided. + +There's a module called `util/preconditions`, loosely based on `preconditions.js`, based on `guava`, that we use for state and argument checking. It should be trivial to use. We recommend using it on all methods, in order to improve robustness and consistency. + +```javascript +$.checkState(something === anotherthing, 'Expected something to be anotherthing'); +$.checkArgument(something < 100, 'something', 'must be less than 100'); +$.checkArgumentType(something, PrivateKey, 'something'); // The third argument is a helper to mention the name of the argument +$.checkArgumentType(something, PrivateKey); // but it's optional (will show up as "(unknown argument)") +``` + +#### I2 - Permissive Constructors + +Most classes have static methods named `fromBuffer`, `fromString`, `fromJSON`. Whenever one of those methods is provided, the constructor for that class should also be able to detect the type of the arguments and call the appropriate method. + +#### I3 - Method Chaining + +For classes that have a mutable state, most of the methods that can be chained *SHOULD* be chained, allowing for interfaces that read well, like: + +```javascript +var transaction = new Transaction() + .from(utxo) + .to(address, amount) + .change(address) + .sign(privkey); +``` + +#### I4 - Copy Constructors + +Constructors, when provided an instance of the same class, should: +* Return the same object, if the instances of this class are immutable +* Return a deep copy of the object, if the instances are mutable + +Examples: +```javascript +function MyMutableClass(arg) { + if (arg instanceof MyMutableClass) { + return MyMutableClass._deepCopy(arg); + } + // ... +} +function ImmutableClass(arg) { + if (arg instanceof ImmutableClass) { + return arg; + } + // ... +} +``` + +#### I5 - No New Keyword for Constructors + +Constructors should not require to be called with `new`. This rule is not heavily enforced, but is a "nice to have". + +```javascript +function NoNewRequired(args) { + if (!(this instanceof NoNewRequired)) { + return new NoNewRequired(args); + } + // ... +} +``` + +### Testing + +#### T1 - Tests Must be Written Elegantly + +Style guidelines are not relaxed for tests. Tests are a good way to show how to use the library, and maintaining them is extremely necessary. + +Don't write long tests, write helper functions to make them be as short and concise as possible (they should take just a few lines each), and use good variable names. + +#### T2 - Tests Must not be Random + +Inputs for tests should not be generated randomly. Also, the type and structure of outputs should be checked. + +#### T3 - Require 'bitcore' and Look up Classes from There + +This helps to make tests more useful as examples, and more independent of where they are placed. This also helps prevent forgetting to include all submodules in the bitcore object. + +DO: +```javascript +var bitcore = require('../'); +var PublicKey = bitcore.PublicKey; +``` +DON'T: +```javascript +var PublicKey = require('../lib/publickey'); +``` + +#### T4 - Data for Tests Included in a JSON File + +If possible, data for tests should be included in a JSON file in the `test/data` directory. This improves interoperability with other libraries and keeps tests cleaner. + +### Documentation + +#### D1 - Guide and API Reference + +All modules should include a developer guide and API reference. The API reference documentation is generated using JSDOC. Each function that exposes a public API should include a description, @return and @param, as appropriate. The general documentation guide for the module should be located in the `docs/guide` directory and is written in GitHub Flavored Markdown. + +#### D2 - Proofread + +Please proofread documentation to avoid unintentional spelling and grammatical mistakes before submitting a pull request. + +## Pull Request Workflow + +Our workflow is based on GitHub's pull requests. We use feature branches, prepended with: `test`, `feature`, `fix`, `refactor`, or `remove` according to the change the branch introduces. Some examples for such branches are: +```sh +git checkout -b test/some-module +git checkout -b feature/some-new-stuff +git checkout -b fix/some-bug +git checkout -b remove/some-file +``` + +We expect pull requests to be rebased to the master branch before merging: +```sh +git remote add bitpay git@github.com:bitpay/bitcore.git +git pull --rebase bitpay master +``` + +Note that we require rebasing your branch instead of merging it, for commit readability reasons. + +After that, you can push the changes to your fork, by doing: +```sh +git push origin your_branch_name +git push origin feature/some-new-stuff +git push origin fix/some-bug +``` +Finally go to [github.com/bitpay/bitcore](https://github.com/bitpay/bitcore) in your web browser and issue a new pull request. + +Main contributors will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of bitcore. + +If you have any questions feel free to post them to +[github.com/bitpay/bitcore/issues](https://github.com/bitpay/bitcore/issues). + +Thanks for your time and code! diff --git a/packages/kauri-bitcore-lib/LICENSE b/packages/kauri-bitcore-lib/LICENSE new file mode 100644 index 0000000..96b54d3 --- /dev/null +++ b/packages/kauri-bitcore-lib/LICENSE @@ -0,0 +1,32 @@ +Copyright (c) 2013-2017 BitPay, Inc. + +Parts of this software are based on Bitcoin Core +Copyright (c) 2009-2015 The Bitcoin Core developers + +Parts of this software are based on fullnode +Copyright (c) 2014 Ryan X. Charles +Copyright (c) 2014 reddit, Inc. + +Parts of this software are based on BitcoinJS +Copyright (c) 2011 Stefan Thomas + +Parts of this software are based on BitcoinJ +Copyright (c) 2011 Google Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/kauri-bitcore-lib/README.md b/packages/kauri-bitcore-lib/README.md new file mode 100644 index 0000000..2a8e790 --- /dev/null +++ b/packages/kauri-bitcore-lib/README.md @@ -0,0 +1,96 @@ +Kauri Bitcore Library +======= + +[![NPM Package](https://img.shields.io/npm/v/bitcore-lib.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-lib) +[![Build Status](https://img.shields.io/travis/bitpay/bitcore-lib.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/bitcore-lib) +[![Coverage Status](https://img.shields.io/coveralls/bitpay/bitcore-lib.svg?style=flat-square)](https://coveralls.io/r/bitpay/bitcore-lib) + +A pure and powerful JavaScript Cryptocurrency library heavily based on [Bitcore](http://bitcore.io/) by BitPay. + +## Principles + +Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. + +## Get Started + +``` +npm install bitcore-lib +``` + +``` +bower install bitcore-lib +``` + +## Documentation + +The complete docs are hosted here: [bitcore documentation](http://bitcore.io/guide/). There's also a [bitcore API reference](http://bitcore.io/api/) available generated from the JSDocs of the project, where you'll find low-level details on each bitcore utility. + +- [Read the Developer Guide](http://bitcore.io/guide/) +- [Read the API Reference](http://bitcore.io/api/) + +To get community assistance and ask for help with implementation questions, please use our [community forums](https://forum.bitcore.io/). + +## Examples + +* [Generate a random address](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#generate-a-random-address) +* [Generate a address from a SHA256 hash](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#generate-a-address-from-a-sha256-hash) +* [Import an address via WIF](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#import-an-address-via-wif) +* [Create a Transaction](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#create-a-transaction) +* [Sign a Bitcoin message](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#sign-a-bitcoin-message) +* [Verify a Bitcoin message](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#verify-a-bitcoin-message) +* [Create an OP RETURN transaction](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#create-an-op-return-transaction) +* [Create a 2-of-3 multisig P2SH address](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#create-a-2-of-3-multisig-p2sh-address) +* [Spend from a 2-of-2 multisig P2SH address](https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md#spend-from-a-2-of-2-multisig-p2sh-address) + + +## Security + +We're using Bitcore in production, as are [many others](http://bitcore.io#projects), but please use common sense when doing anything related to finances! We take no responsibility for your implementation decisions. + +If you find a security issue, please email security@bitpay.com. + +## Contributing + +Please send pull requests for bug fixes, code optimization, and ideas for improvement. For more information on how to contribute, please refer to our [CONTRIBUTING](https://github.com/bitpay/bitcore-lib/blob/master/CONTRIBUTING.md) file. + +## Building the Browser Bundle + +To build a bitcore-lib full bundle for the browser: + +```sh +gulp browser +``` + +This will generate files named `bitcore-lib.js` and `bitcore-lib.min.js`. + +You can also use our pre-generated files, provided for each release along with a PGP signature by one of the project's maintainers. To get them, checkout a release commit (for example, https://github.com/bitpay/bitcore-lib/commit/e33b6e3ba6a1e5830a079e02d949fce69ea33546 for v0.12.6). + +To verify signatures, use the following PGP keys: +- @braydonf: https://pgp.mit.edu/pks/lookup?op=get&search=0x9BBF07CAC07A276D `D909 EFE6 70B5 F6CC 89A3 607A 9BBF 07CA C07A 276D` +- @gabegattis: https://pgp.mit.edu/pks/lookup?op=get&search=0x441430987182732C `F3EA 8E28 29B4 EC93 88CB B0AA 4414 3098 7182 732C` +- @kleetus: https://pgp.mit.edu/pks/lookup?op=get&search=0x33195D27EF6BDB7F `F8B0 891C C459 C197 65C2 5043 3319 5D27 EF6B DB7F` +- @matiu: https://pgp.mit.edu/pks/lookup?op=get&search=0x9EDE6DE4DE531FAC `25CE ED88 A1B1 0CD1 12CD 4121 9EDE 6DE4 DE53 1FAC` + + +## Development & Tests + +```sh +git clone https://github.com/bitpay/bitcore-lib +cd bitcore-lib +npm install +``` + +Run all the tests: + +```sh +gulp test +``` + +You can also run just the Node.js tests with `gulp test:node`, just the browser tests with `gulp test:browser` +or create a test coverage report (you can open `coverage/lcov-report/index.html` to visualize it) with `gulp coverage`. + +## License + +Code released under [the MIT license](https://github.com/bitpay/bitcore-lib/blob/master/LICENSE). + +Copyright 2013-2017 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc. diff --git a/packages/kauri-bitcore-lib/benchmark/block-357238.json b/packages/kauri-bitcore-lib/benchmark/block-357238.json new file mode 100644 index 0000000..03ef883 --- /dev/null +++ b/packages/kauri-bitcore-lib/benchmark/block-357238.json @@ -0,0 +1 @@ +"02000000dff776908b8cbfc363cd421dc8d233b8340c9c82aa295d07000000000000000094c8470331881af67ede892bfaec01a0dc238b1f49a8db49ec974151451dc9952a405c55f58616180b6ea042fd710101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5603767305e4b883e5bda9e7a59ee4bb99e9b1bcfabe6d6de8af9d3e87efcf95d1d9283083ad9494e78a00a6266fb905219cf46ba59d8de61000000000000000005d2e5331aa00004d696e656420627920646171696e67ffffffff015f1f5195000000001976a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac000000000100000001d73d5c90f4012a4692c16044e7218f1cd4ae88c5634e50b5a9e3edb77d2a6007010000006a473044022065fb9235816b88ca8b9935a209b19eb9920166a9be5ec3ec98f0cc4f1eb8e92602206221445c268ba8f25d7d0719baba48decbeefd7bed81c738e76a9f77bc444b4d012102181125824b6752a7a4b6a68f7eb2a0338196e26835b5026688fb27c440d140ebffffffff0228785a00000000001976a9141c14fd16948896b3d531c85d1f6b5cb5e9803f5788ac365d8fca060000001976a9142abc00cdaeb6816a644781b16dd3764859e8c79d88ac000000000100000003b61ddddc724c813d3524e0e938ee427486ffe33199cf3030fbcfd6f24f2e9d3f000000006a473044022075eabe38ca7e42312b8acfb3dec8c52ee6533e9699cae15ddec429a195cde4820220714c6540104eb7bb8584385cc627641801782553161f74c0841cfd0f87dcbd09012102388cf4f63763792c8bc31b7f9fb7810f3d76252924afa03fa5b8df2c4b7f23f5feffffff9aa1906b76dfcb4ac3915d2bbc4993df20a7173e4f4283db7d0199ca215965a0000000006a4730440220588c4b23155144874d2ed8c6e094fe273394b608869059d7a337384ab45b75550220444451f80495b5b2e3db450cd3a658c6f59b493e6b26a52080eef37c3f6846b50121032805bca89441dc0c0204deed677e5c70e5122ff46d7e689133b30ece1c402941feffffffb07c99d494e170a86dfed9c26d7c6978c3bf09c2e11ba0a2d111f6e84a2640a9010000006b483045022100933195eee1e8746eebb945ea587d950c5b4abb6aaeb5041788a9d36c3c6f2c87022062e971cff6354d0ef3ec4a2e42ada3937b239a6426fc13aae52c41084ad3fc89012102069711114026b14654b41a6a48a1d6f584c54140de4a7e5559ab46489e973cbffeffffff0229ef0f00000000001976a9141707adc467eaa4063e4cebebadb1ecd64455c94c88ac5a341400000000001976a9141717df2106312e23d0a0c81aacc02e93c5b59bd788ac6b7305000100000001b27f317f3ebd36213a96eb82b855ff984bdb29af1116eca61f5afdb6dec9b2aa080000008b483045022100a26df8e4f840886125f054563a0eae422317911f8a05aae6083ed4a897b1eb4a022045bd1756aa7a67d0b39590c2b77d045177860ce2a882770f87c261c5b078e0220141041749d8bc9b9f26c8bc5f04c53bc5250569743d5c795a948e52119669c30150167ce3bf2f68f92b3ee2208fbece7b7a9aa2daae0f79f20ecfdc2f96ef13cbfc38ffffffff022b14fc00000000001976a9141874412f8ca28449b9ab69b87692de600527425788ac55709301000000001976a914cceecc96ed84b1ffc64bdf9f9dd6f46a0f2f244e88ac0000000001000000059ea012fe00771c442c3aa7cebcec1d07c75803667fe12b26d8bbc22d8dd747e9080000008a473044022025597889ad3087e3c1e259a327e953544c0d7a60466cf847fe89eb1a23f6a5220220509c3e72e5ad746a6d9f4ac3d2c812cd05cfd9b7bef95bf85c5090aced05490201410485b97e1e968ca47d47bb8723fc36de98349c806b6ca794936117424ec4a1e174f6c8bc5114dd27a2847abfacd0d8f316153d466d5eb9ea98740b881b9d0d5967feffffff220486e4b6aa0e718e0391e04229dfc8dfc4b9cc1b11f81c9988d82ba6538c3d000000008a47304402203b7bae428655e1d0c4d2e7f90b6147d374eba0fc3c3bc002ceac8631f66a8a90022031fe25627248f705c22278e18e911482f2aed5432dc8f3d8b70d3a38410f947b014104bbd70f82b340784bd90d4c0ad4faedc05d764f6234cccd74801e5650a1079f21a9bca7327e5e82a344e8f4d36280adaef4f0fbf7912a17e917d30d725cf158affeffffff7e70a6981c26db7d0a6243fd2d4f106add6210944a9d912af9c4dd954acfc945000000008b4830450221009aeb94b4af07479057378173e4b125c2211c05eaaacc2693807eb3ceb2b69d7c0220072e0db6467d3c5dee524579472cf441f558d9fd4d8d4c7bf654a19789892e360141044e56e73f29b830a47958db52d734860bc413da97d421e6f1ff57e7b37d5343c8e306bc745046db45330a5261e64d632c3db94e5712a35a35a79262656cdce0a2feffffff6aeb7f37c2e6cc6d984955394476a593c928833c16602feed012480560249abe000000008a473044022072be600922a3a8cb88a35cc93892af506c1ac050a27491f52f58821ffc35b86e0220535d0f805e3f6f2b9f54064dd50ca93ed0f2129616fd2525b704fa7550f7cf7a014104fe16d056a085da2529a8ab7531e0fe9cc99750002a9fda24d9b3df24154958694d1b7ad0eb0c94e25f6d2a26f26e86525c2028953bab857fb4e73ff2aa4b5237feffffff49693c7ed8a00ff3d22fd0c04fa0c4f3033afbb3c825bcf7eec22f05e2ae071d000000008b483045022100fa82ee5db88e98ceeb91ab290cf38e467881f7c910fa5d0f618aaa8f2266c8d902203f06c66ee3c6d460e722893101c9cb491d6fcc40963a9bf0eb885b23f20c1886014104df183cd9f0ad9355730e3031a63d6077efc548984d971bb545f16bbe3b96e21839bc3356c187e67a493d357df82310d897c75bb0d118c2ed706eae446407d02cfeffffff02b9480f00000000001976a9144d187819caa754acd6a09791883326f4079be92d88ac80e7bd02000000001976a914b638d0a971d6fa5100690da506e998130264ed0d88ac6b7305000100000002066059d1f44d002dae496f2987b0e9e9a51c11cce9d03d5f110804cddf275c64010000004a00483045022100e71e1ff0cf80067f41cb4005b5228c7fa79d8a276883581ebbda463b4fc5f3e60220531d433eb6309117b82c6905e59c2f7db6b89367f7e51d3245ffae5aed78267001ffffffff066059d1f44d002dae496f2987b0e9e9a51c11cce9d03d5f110804cddf275c64020000006a473044022020d376d82b42597793509bb86a4c7c36861bc6d1c1560dd1b5f6475abbc2ffc3022059b50b86387b42bccb7362a5dad5e09e19e3b8e2f157c6f4d320e7d7463538e10121030a359f43e33acce58ba94cb68997f2ea32efb149998bb88f2426b5d6ec056726ffffffff031027000000000000695121025442303030310006a01f6291a39f2e81131821638dee132f0003000000000000210254423030303100070000000000000000637573742e75736400000000000061a82103c098d6eae67f30e46302e8bd1698a13edaaade40a2fb2c45b9ca1ac04a03962153ae10270000000000004751210254423030303100020000000000000000637573742e7573640000000002d6b32821030a359f43e33acce58ba94cb68997f2ea32efb149998bb88f2426b5d6ec05672652ae80a90300000000001976a914a9278558b535733ed21754b2fe90ed09de3ecbe988ac0000000001000000035550506d8843676f474773dd9ba50bf1757ea2af25bab9d041dd10286698fcb5010000006b483045022100c638fea092793fa904bb9465e765d01cbf35bb0c0d34b347440d94ea8c36a66f022006d27bf81a03e8cdf5a78c48f633e7a3a066b70844a92beb040c43c16efb5f00012103c7770fda634ec274372d37f03dda791043a25cfaf6b1108e92fe238ddd9f2a17ffffffffa4e9d670eb433c9c02c0e97e4d2992da6d9ed763fcd402fa35411c2f5b9bf2f0000000006a473044022043d79e0bbfd38e5164c3f4ce8de7e4184e60092ae3b723594c5e443f6588f43b02200660dc73584ce6d288cadb17b8f4c3b46449639cf0aef18e35df1876bbc192ec012102b93a5b43e830b9a533ae89a16c1bed754dd3b81210a7b1e6e1849acda3d87298ffffffff6862c6767d037a0c51d50e56e41ad93fcb32c79d0050418ba25bcef571e729c7000000006b483045022100bddd7ca5db2943f491aeb08cc01093ed8a47326729d6524c7dbe3c102c7250d302201cad58c85bdee56cde6cc007b3b009ac77ff011cd6f8e94d9f38455a1caf23d60121029b0fd27f90f65cb7806452c47be95b0d47473d4456d85a67d1394812b8444d0affffffff0278d1b302000000001976a91492369f23908d091f783d32d4ff6c1c8fa0e6124188ace0ed3700000000001976a914f00d8406e59a45ab7e97c0b04db7f9429ebb301d88ac0000000001000000010a8ffd8997b353519fe987cbaf280f25018293006c9336e98199ad2258543095010000008b483045022022a60231f49b02fca872298eb7077455c00d42f029dd85af9eafd64eeaf9f496022100e2f14a6c7dcf7c937350e10fac083cfa5b545e31d8a8632d1474269a2a12ecf80141049968d5053be466e3c398f5d6045fb88576d9dfc6a48a3f93caf63f5182d2ddce8dc394ad4abd419ce50a03842f35d824a24d0f9224ff9e424c27635afe821516ffffffff01d0667c01000000001976a914ddfc115356a8aee78c3dff41b67623b34c8ed71488ac000000000100000001aa39ce07f91292d5e50e6940aa4e847ff36b14ddd22e32bb818ba8313a1d441b010000006a473044022010a6400966914282d27e1c5319ed69ce661024f2e2a3657212d7cc06f36a7f0702203fcc022b9432a7786479903bd871e13373a8fdb9ca655a7d1ffd5f1015ca3a090121030bf390e50be47f35271f7ff784c8a31ee6d728a05f020ebd2956eff637e4d628ffffffff0250ffc70f000000001976a9142a13790951513e0eacfcf5c787e53c8ff6789b5088aca0f33f04000000001976a9148065a535e5f61d63a781ddfaa0b1f3ef481f928088ac000000000100000008dcf8dfdd94afee9459fc4066350d77d8893fe107c28fd805bdef42d7e2e91546010000006a47304402207e263870a5026d5532ca29b9f2df0d3f129ecd2c0e103bad7ebf9b5d78e4930902204a1f136297a6115269deca648879f81531872cd99ff0c5c608f1116762c02f950121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffff9a6b13557c83e7556651a9749cf2ca255b92f612508f302416552fc4bc0e5341010000006a47304402205a15be4b0ae1f4ed7b34d14d7e369e7c247fb11ff802f2fe9be7c50e8dfe498a02207e4e4fc474350634497da2e8e6a248d8808bd311daf698932a30ddca564071bf0121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffff2cd87672f92ae36bcba7ca9a5e5bd8c7cc667d4a966cd5021dc935c35801eef9020000006b483045022100e722da39a270ae8b81a8782ffad5f14532102d6409c3818b577a82c382a71211022011c6a1562dc522a7eab518dd27669e25ca450c7509a709618a9286a1bb3b81570121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffffaae392c7bb3f4bc25358b69d577cd91bdf8e3ace571cd9cd45bffe9c3c07d128010000006b483045022100de95f6337ce508cc9b89aaccf040c7ac3456226cf9063a39ef53c687c9847b8d02203fdaaab93e6845820dca867ba086cb86ec33954ee25c40792ea9294b52e979680121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffff268704b94df7e0ab522419ab4420eb56d80014a60adca1da14dfa393afefdd0c000000006b4830450221008e7909240bae3249436ef51f933fd845540823f2fe6abb23469ca79dda693d4502207b51aa110ba4ecfb05cf1ccbe877c666e946df19fe9343255885d10e672adb0a0121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7fffffffff5448c167bdf10e5c2bf7bd6c3cd8f0044b22220e8a3e7579db27630003e9c05020000006a4730440220126f27403eb28cd1a4582286b8b4674782744a70d6eb5f52f9c52b1a9161b1b402205089b41f8f59d9166c3ba462610da8b4c1c38258aa254fe662f768f29bd3cdc70121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffff946aab125b0812821ec07e95b019713bca11ebaa3c0ac99ec8b4d367b43d3775010000006b4830450221008f87cc69e2bc92cf9f5264599e324bfd26586d11383854e450e013645d7ccd5e0220079d5cfd2129bc5a317aa030d03cbc75aaf19309b3540eb4e1b6c178db6a0b0c0121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffffe9e8d2d09ad4a1be40fadba8f13ae05046d723675c583d83aacdcfa5fe18877e010000006b4830450221008617630a622685c89f3bd6ed0696001b103f568070b70de9cc49fdf9f13627e9022062a657b65ce16e3cd39fcaf41c5aad0907144b51b38424863f01c30539c4898c0121021e31286c929729c2aa14a2865f34c22346d307845fe38fe58b6ceb06e2b860e7ffffffff01fd04e375000000001976a91431184ddc851e36a6f39918b2960a191d91b6c76388ac00000000010000000176e5da424a4be62cc19ff3c5ff3a8d3271329277b92816b9b139b11dbd730a80000000008a473044022070441fb3ceb2aafede66a9934984fee9904f1aecb31297132a46553ac50fe59502203008dad3ce7b48aea41e7737a23f03585988498c12c9a07862a3c87384c9d9bc01410453c2594391811f5f77fca5187fe7284e0e5778dddc8448c67aa81cc9b0c8b010aedd726aa87d1737abd22dbd423f7325e271fcb6d6867f6e257d8bcf50000614ffffffff02ec822c00000000001976a914b3900a7d5dcf83b7fc8d7e3154b07b776f239ba788ac04e72300000000001976a91479b7d1d2b783f73ab61ec88fbae2e56c0eee7bee88ac0000000001000000010b1049a52126fa02eb3798bb4b43578b2d03513a7b40f78168a9378419ff5ed2000000008b48304502205bf4997ccaf0314628c05868717823f89979e41bee8f4a512bb3b728c256f649022100a590d50b0cca5ef5f82beb074b924554cde69edfa2624fd0e0b2de933959c92a014104584f01f019c00a70c69941696dab6515d15c8875038b259175061abe07ad4e4ec981c94d4a23ca1e70dc13adec0a10da2cd22aa2fa5b21a24155854ce66eaf99ffffffff02e4217428000000001976a91435a9b1485261ebc0ac0bf36708fa5c06175452dd88acfc157f00000000001976a914309778abfb8ed9bbe624994ea3ab6d9f911c788988ac0000000001000000018f4f289e2e6fb064c10bd35a699b5426d542e495f7ac8a1b876653c45db3c82c000000008b483045022100e6e9eb3fffd196f29300fd8f62c39564dbaa09fab37cd45cde98c49c300ae8c4022028fe6a183ba5124798139be76ef443cd8c863bb2dcb2ef9b2900ef52084a83c1014104eede7afbb8b7d2cf67155e6f872acfa3361aa5d4e73bf0d2598d298799315a6405bc3ea85712f43a8ea74353cde4b03e0b03b33f5f86602d4e4a79be5988a025ffffffff0214741800000000001976a91430695e87c91a00a3b9c203c076c970a2704476fa88ac84e28301000000001976a9143188ef666dccf271d14ee73cc7e7a849b65a146a88ac0000000001000000011f734d81d4d6d72c8885d87b70895442891ff91bbd7db304fa4d112c20387e86010000008b483045022100cf9e45ab28ce16fe46fc0ef7f6684891518b7026d4a89cdd6e0b46374033625d02204b47035352d30560493e09e8447780ad9229d077ea7a02eb4cb8110a0113cb1f014104eede7afbb8b7d2cf67155e6f872acfa3361aa5d4e73bf0d2598d298799315a6405bc3ea85712f43a8ea74353cde4b03e0b03b33f5f86602d4e4a79be5988a025ffffffff0164948301000000001976a914ec8d47c394ebc7edd23558d502799478b03511f588ac0000000001000000012d8705543251d4263493d3123b143f913cfa2b0d019249ecbc95d5f894348a9b000000008b483045022100ef90a7342fe63bcaf326648b927f0c7ade7ff00a92a18f1292783eb87456c8c502205ea535de93b38adaeac5d31c541ce83a674d5fa1381d20a88f6597c154194c080141047514c08fe46c28a8aeef978ab6c80f44412d4e45adb23ebf369410e1db24fc67fc5e0c3d19988cfa00fedb3104c4359c7a1070bb394f3fb0f989a60b1fe52711ffffffff02eaf70900000000001976a91430695e87c91a00a3b9c203c076c970a2704476fa88acf2f3a000000000001976a91475f42e19ab22f181ae659bb8b57654cdcb163bb588ac0000000001000000018a1fc3fd495edc6d8c5d08fc55376bdffe7576c7ce8d6cc7d3bc6b65743d05f8010000008b4830450221009757e45377fcd1b5d311f1c1c5b67d5613c9e9d7dd262d5337c693d2fd04803f022025a1e5e32c24610620fb54e0a7bb39d1bb7c74c8281a64ed2089bbc599b3627e0141047514c08fe46c28a8aeef978ab6c80f44412d4e45adb23ebf369410e1db24fc67fc5e0c3d19988cfa00fedb3104c4359c7a1070bb394f3fb0f989a60b1fe52711ffffffff01d2a5a000000000001976a914ec8d47c394ebc7edd23558d502799478b03511f588ac000000000100000001221799b04a17495c1bafb4f01a3bce188f4cb5b39cace85404ddd986e5957214000000008b483045022100da765331c7458305fe67ffd713de3804f1990b42a3c564e0abf31bf6d8104ef10220355e331b523d3cc62ed30d11bdcc8aea53fd95ab336b336a325cd8f14390847a014104e316955a7f6dbeea88e45b93e8712ff10ca6adf068cfee4210c32d01a52a91795c7d837955bcea694634138531c1cb66c23abdb02209f78bd064ca1f4c160f9effffffff02eaf70900000000001976a91430695e87c91a00a3b9c203c076c970a2704476fa88acf2f3a000000000001976a914d285ead84a0011c2f201d67c3ec9ab605825cf0f88ac000000000100000001aa84edba72c80ba383ae1593d29501b4b18c1e3e5477ea3eff06453d4f0bec02010000008a47304402203b81f67235807523b55a48a1d1de8ba8abab91e04ae4aecfdc11ec6ecd9b2a47022049ea8336c6d818788716b38209db872451837125b941057883b04d8d1b1b86dd014104e316955a7f6dbeea88e45b93e8712ff10ca6adf068cfee4210c32d01a52a91795c7d837955bcea694634138531c1cb66c23abdb02209f78bd064ca1f4c160f9effffffff01d2a5a000000000001976a914ec8d47c394ebc7edd23558d502799478b03511f588ac000000000100000003076b09cb06578ad8db6b4ab14d2845918dd93e52d56fb8dd9a7aefe687d32a6d010000006b483045022100f0e2a31a98e77e12437ff9262c80fa24c9bf4e5707d941f9ea436b08281aa92f022065df85db32cb5845318737342320ad83a406447545a2c144d667ca4c2b4bd3d10121035b82476987874fb36d6ec3c51900f2685eb32ea0af26dbcaf4e352936c658885fefffffff535a7ff4141bb5e19c89929921f4c369e301568a262faa4e52034ed44aa258c000000006a47304402207f87020f51c87f271cb5aaa401f4e300011840905099c17083a6faab462e020702204e83206144d58061c6d4a9404ed5fe93fc670f88b670742363bbff1f9491cdad01210374ffda4d0d05f42725faf60c40b207a5fa130b2733cc8788cebc4edf83df00a0feffffff9ff39c885d0b21400d64ae86c9738c098ca5ca0bcac26623fde6c02178fb7cd4000000006b483045022100d023e89bbb4146f9b19e655da83e99d67ed3a0b20ee83a9d1aa653542fadc14b02207c9b7ecbdaab342b9c2ae72e0db11e6c21f6400ad976da1e4233c61995ab58f6012103e3146c787eb374e6743d76647b18335f51fe1bda826a81053f8c4da609a2d403feffffff0220bf0200000000001976a9146139abbba94f0511f01bae46d03984bf3328eddc88ac33770f00000000001976a9142579a29c3d7beb7d727a8b7efbcd9ccc090f773188ac6b7305000100000003c760b315c2037109790e51cb1f139e6c84b8b12f039a2acde53ae9bc0544711e020000006b483045022100d521334b3b5983a3a7fa029324a9c841963ae3ede8cc8b7eec42944eb565f6f502203709644e9745d212d570ca311893f277313eb1a80bb98632dcaec35be647e8d4012103634e6959e745804a48abe16a2ddeb610602cd118a34755bcdc90560840435e34ffffffff78acca93811a4d6b153070c3c31ec0232546b3f810c7fa8f9b3e7790eb590877010000006b483045022100bc1660c7604bd06c165df612685ab230d3532dac54b7021f90db367a3b6f7e8602206d43599b28fad0ac19126588b5c516f90a03e3c2f738b8089751bc801fc591a6012103dacce46f47ad6a668eabce3e9d1b0d11ba8f04c8237f4e0b44dc23dcf0b29ea8ffffffffbfeef9e9c1c8bd197212dcddc177508b5e203b8f3540e6b2e73c4e8916b3954f000000006a473044022052245545f80fe9f8a65fa72998a241dba23ec296ad274a5547055fc418632402022013f5a6189281e133f48e326d11055e1ac88ce50f041db490320f626a220f951401210289dfc24b6ccdee409259a7d851cedddcfbcf3be172440b883988497253049307ffffffff0157e25d03000000001976a91447901cb32b5c682580450753bc56f5959cea56be88ac00000000010000000104a098b36afe0e2a9684bd74d0cce542fa46e88583b15a049b7d2422e202d297000000006a4730440220474f4b189cb566228922a9986730e3b65141b3e0dfff6104ea987f9e6a9c21ce02204df177c1f4834ee63bfb4658839c6ce4ae93c3f08e45bb86bf9b6bbde9cc09d2012103ec4215d376c572beaf1c48ad4ff69162bd4a1efe8948ca578bbeb99fd1ab80c2ffffffff0280880000000000001976a9141d3f3e7811def0f11c19edb862d4e0eda2d31b5a88ac204e00000000000017a914da1745e9b549bd0bfa1a569971c77eba30cd5a4b87000000000100000001551cbb8a6aeacbd2b969e1dc4b4cc5b5f252b9a10b14f80d87eccfeb1facb591000000006b48304502210081aa4fa55d12a533389978c908395e9461b87afd861c214bcc96fb603914059102204df77a93c685827e750e69b950c5542488c982cc354dfa4fe62511635cfc85ba012102f9b024cc53a145393bd7db45095cbe0867f1c46f608f78dc6a4219f97899711cffffffff06d75900000000000017a91440a755a63fbc5772cdf08dd13d09eb3f53c4314587979e4500000000001976a9148be16414db228a6e4d9ddef614816e2e9bc7cd9988ac845800000000000017a914177b27b818d55fac1fd75c429024b1b8bd473c3887b45500000000000017a914ebd2d9d3ab30583c9dce846538f85e3e92436d5787d45800000000000017a9146302519cf2a23afdb1c403245fb6447caf75fe8887286e00000000000017a91419b2df584562bd1bf9f05a6b91f219b912e8aae487000000000100000001b891f1aede1bfb556dead6da9679084feaab2a443ac0348262bd292e2e119b47000000006a4730440220798d20631fa10067cd789b78fb2e414d0a37201794fab59589433952a4a7a55e02201079016582b69b2ffc2a7979e06d2a4a04286b329fc8f9e47a16d203a8dce3d0012103753d2bc5dd476a428cdbf408f3a18cf64bff8d3e0c0d3e66412062092faa6daaffffffff02e5a87939000000001976a91452ec7c0f46079166be2913f2a56c484757b79f7388ac00c2eb0b000000001976a914542d1fa1fd285d2b8ecdae3052cf5b5e0dbc479e88ac00000000010000000149a27000a23b2c8372329a5d91d9d716c1b7bff5978b07f5c3fa2e917e0cfa6e010000006b483045022100fe0304b42ccaefa198c8c8fb79e5dc9ee90264c91f0660f3066014c3dd7f4a9c022072fb076b956763ddc5bce425537add720497fac9f4fbb116a16e767ea118d36f01210387bfc30f41630ba2369fca54448ffb65d2a2e1e2b6a29d3a1592967d6fc1f6e3feffffff02da61bf01000000001976a91433655fcb7c93ec46c9ffca277e9a921d177c5eba88acc8418600000000001976a914408446ef75571b162aad83464a370909d5ef30c088ac6b730500010000000121fd41243d2d8a41e82cb1688dd9a69b0bb44063add5bca960c3c77b1edbe55a010000006a47304402206e1c5625bd11694f1e9d24ba01753500d635d01524c3e17c2188f3499c71b642022044edfe0dc089c661a5d1e59117f60093a97bd481f5e0329e438b79b268730ddc012103b392197b7c8aa33e913d11abe47aacbaff0f82573d73b4017e3c469d6faf7e4cfeffffff0294702020000000001976a914370618eec9462bdb84041cd9efda5dd8678d413f88ac4accee00000000001976a9149f74449dc90fbceb3a01bd122f2d94053014e19988ac6b730500010000000130025f9c35a6fcdaa596b94a41a9c679e66b2c8d8059633f85f27496dd533346000000008a47304402205da0fc5e4a4d179bfd6a074e6250944b2d2967f2fab12e0951633cb45190900602203117dfa17feaffb3c9323b58ae488e233daadbf48fa83a1b1851b1b9dd72c3230141045df6979005f1c6aa18c3c584a6f2eb497dea8063666b501af64ff704796cd00c89a76fd880852fd7d4a39e7990225f63bfae738ec8260dedf3aab4b69e4ed8c9feffffff02e5a4c71a000000001976a9140a2744a882cff0ee83a607bc9543df6f59966d4e88ac005a6202000000001976a914f41e218ba91329c8589d528e8d5127f58629ce2988ac6b7305000100000001f948a63540ac888b7787904ceb2d18051bdf45d9b988481d4589271d9fcea686010000008a473044022075d631b4ced8dd0eb5e8ca55641b06ba720e3fcab383734c5e42103434b0051902206fb3a1ed0fc63021000ad911f6a37f128498579e75789a0d06fc37a4fdca8ab0014104cee97d83b2217a920617452d2ab704fc6f67c624378710d440c6aef7905346fab8cf7d2b22853012d32d4a2791e02e3727abb5cb2edfd1f89b57e9333e07f815feffffff0210d64b00000000001976a914e375e3edba517501576a696121748de6b0728d1d88ac27691f14000000001976a914df8783d628d4c9ba82499e6c2e6a770752249cf188ac6b73050001000000017de77a4c0886ce3525583c5ba530e1afac84e2c974fab78ea39ac2cb1847a422000000008a473044022001a93308ee78cc06f6c1f64e009946f08dcf8298fe4285bce7ac8d6acb398ab1022023bbe8892445cbd71bced8f3f6d78cf4687808ce9b0c5ea053e977e80f8840690141047057ea524f27f1be6a3fdf2175ae107e62e4d006c1714f0e767a204ae1224a0555bcdb46700249132633727be8333625bdb8e1ab11f223edac848a0d85c2fc42feffffff023d7b881c000000001976a9142d18177007b598bb5f5f88f2c7b25df41caac9ea88ace0de3001000000001976a9147c8c335356fcd6895a2296bae552480a4aa8352388ac6b730500010000000145abc36bb9687459ff4de1894b127d974630fb1a3d73ade474eaf7109ddb9659000000008a47304402200fc913fbdb56af117cfb97d2bd50b35094d9e44b7d802819edf2b74ac26c13b90220675082e79bb392a428ddda8683061afc260ec6bfeabda35d834790f0587d6c8e014104b367f3f19344c38fa5435d0d12c9146f8fd49119cee2d498f8a96797f5165ddf6cd2b6b66f5b21d5993d7f02e6de5e2d39b2eaa420e2393736ba862365fa758dfeffffff027dca1005000000001976a9145909af5dab4516664210f686958efc1fa8ee062b88acc0f35e01000000001976a914d409ae9abf2892e3b23b7e411cc4af5bbba4c03888ac6b7305000100000001d94c39526b098947b973163d9511da14926a1af4fbf2355c4446b2a59dde3137010000008a4730440220739c85353049baf5a8a498df6fca8b2631eefb28c67bac4495fce3c1530bdf4e022062ecc477af768ee743b82fcfd4b5664392c5d2f20475bec1bae567a3168eb5b4014104da7dde0a4f252f9987cc301e7c6560bdd8bb85a908ba1a6936bc96a2f871ce0385bd4558fa5b1d2939554a47394de736c41be002935c19e9022f0e0f91c20275feffffff025d2beb02000000001976a914ede1723bfcd10f72b1633c21d3299ad474ca01a788ac804cce00000000001976a9147ce7695c6069847d2e50b3ca0eb5382434fea9d088ac6b73050001000000040c23a4ea2254b76a21da06bd2229e91693f6d3e58cab4acc1a56020ee2ff1e1a000000008a473044022004afe613bbc70b82f276ed2e1fe9999df600491f8f99d6b716cd145c46c7d30202207c1e2909d890a0776d5f89386c12f80c8a52f2714991dc2737d722a1d5ca66090141043fabd43be8e1baad3318d58fd0835e207255208c2c310c32f378bb6f2ce5531eba206b5b576c4c450e4e7b2736c2a8c2be1dbe02b88079e770ed86fd12e7fdc9fefffffffee118e884774fe56f2048a42fc875cc5d53226142feb1b0f3b8ea1d424d8aa3010000008a4730440220385623b0f3b16d7c34770e45351c270c9749482527c1e5d6162f51bd844d721a022065da6b9f444cf3fab285eedec5e41d098a1a59b90144c2de51c4f8c31adeda7f014104860b649d2244e5862598372cf98f3111d1e039d1bdd0fa6658bcb35e90aa526c0059120c44ea4d53829e43949aa7c9f86ef3d1a37dc31e67616b8e5b00f6a719feffffffdff8238a2350a9ce5bc8a627e76be82a725d5f8705b249fe885126ee7db249a8000000008a473044022048c31419046b29f68e14c57078615fa79c682061cd435bf56fd916ef62e6948302201e1f0f736f3773062aeff6b20c481356706a947970feb305e319764eb61d8cf80141046c407066b6745238601c096c40838c3b63c7c38eb840490b64f0d3f63421aaa566f65269e94b26ff93ea2f8bef5cb12a1e491c2f0f1c529376ebc8186c5f6a49feffffffea002a1c875b4358518c6c6c00e6a679ade13e7fc98ec466e6b93ce4a6ef68f0030000008b483045022100fee134e87fd8a4070c32a410fb29eabdd9c95316688c9d4166131c96f683b11302206cb684a07e70e380d076458c0d8791bc174aab6f316a3e892aca48a24cb8c32e014104de2e5df0d8f8c4a3758996b407a33aaa9a7545d11403eeada17145c1f9c539c67a47b6369d3bcafbd3de483b4e9615a783696542803315a92407be89f3c08a50feffffff028014ef03000000001976a914da53c3330fb2a9510ed3f10d217ac675eaac812688ac691d1000000000001976a9141d25595e1e77e4074c5c215835568a09520942b488ac6b7305000100000002a4f921e8751b3e85f874b6517898fab5e67ab89d6425e99d7d30bd21f91a361c000000008a47304402207486b729088ff9da6cdbd14d2474622723ed5a7b4e596d6a7b8b00d2836e6e560220571640262fc47edc85f0862ad98da17888f9a655f2c08589062ce5b089660a5c014104534c91d1033679ebef054d26f83926c0d635b434a8252791246338fc6749a2b217720369d33c8c9162ef9311cede8e994aba718ccd5a0feef2e93ea47fd24c44feffffff4e274a32f9135cc711c71a5f9b468230055d0711d5c7d3c3211ae8fe2a1053f2010000008a47304402201c10e9c402aacea7ade976a5c79da7bf59af6a4e66c28492636d2e3dcca772c9022060c5b3061e48bea5ff2fec5baebc9efe88bfa6d23f51ac0d7490b7d3bf037752014104751fca4ddadb7e29d9290c4c7fe20232cbdae2cddb3f201e9999716a9007f7f6d063c0667d0122e12b0e5c2d69a9afc0862e95772722f949296d2374541e95c0feffffff02dca7d601000000001976a914679073654786942f18aa47ba13bccde8b27ef7f488ac90ecfe06000000001976a9148a078a671cb1e43fe6a9b3273eccfb806764c23b88ac6b7305000100000001e90cd5e374dc13316f0bef529ee06e98724fa7c313347b14c023df8a2f8009d3000000008a47304402205dc25bd364bad5b94c61f2543598846e2d19e57a473365412df342da47efc8f102201b369031cdfb44960c3648c35828e931236c7aa6ae2bf3c9728a7fb032bc93c0014104696bbf8b348769de91da3c154f7bf5d4541a217d278154dc65df2688c6e402e4983ea21a9dbace4c7b829dc29a901dbf0707975134c3174d2ee8b3e4ec88649cfeffffff02c0d8a700000000001976a914c1ec36cd5aac57fb267152c58374b4acf68eaac388ac599a2e01000000001976a9146cbbb26e733385908ab9a22d68fa5433b95e5e4788ac6b73050001000000026cbcfaa83de070785187262936e2e2648ae25c5e33f802dfc323b5e7ee2ae117010000008a47304402205aac00fccee79a44d03c1d8ac6646820d66efc424eca5b262b30183c865a4912022015cede804a0730aa93c085bdfd9cf0d62959cb272ca6cf09eff7a56c77891b010141042443eb65532c904cac2a2dd110c37e1f2394ba662f99f46e031a7d4de3822c2a60597f9b112caf44bb4a3e2b039c9734c0b3ce6d4d9cf69052158452aeaaf048feffffff033d639996f7201f09f117d4adb0af9b801d547c25df536f24eff47175f9a8de000000008a473044022010307b9a3e13d5e3930d518501d8c052c5063eb6959854acf0b19397f551b2ce022026acedec8fe4e626adb769443b329eaccc34eaf5a47224e7edb70fc85185db5001410493d25b6077915bbb772c179706bb03dcaa78ba11db625fbb8f30534a966552cad23620cb913092756568202bedf9ca61bec1bcb6c084840121de70c848dead7ffeffffff02a0d88803000000001976a914456edc10750cb6196e10d363f2b7354c1ad5c4b988acb7939000000000001976a914aeda8b4c43d5165d0771aa5e0c4606cc8771813288ac6b7305000100000001b3b3057c8edc25c22ff8dd196220082eb6f55621b3e4789b0b98d4a1bf12f9fb000000006a47304402203b167f7aa049e3aa2d48eaff085af956712474d64901085b999d7010a9fc4dac022034c575f3c086ce6846bbea39ffda73548ae18d5931985dda6c8d9fd5aab054d501210375921ce0dafde0ab7995f1c5aab9e8f28343e92d02bf9d58eac51e2600cc6405ffffffff01727eb404000000001976a91482d1d4412c2960cd904f65b406b14bca8e0faabb88ac000000000100000001aedd6713608438f0ee6073216310f920902e0cb6ff56e2318e5d62f180801c34010000006a473044022069db66dbeb9efcad4b948ffaa6decd2f580fbf451386f01f0e65e33c14555e4f0220470eb90605b3a36868e6ab4984007f06c61dd0704f5d9c8b32b14fe0e2639127012103731e2873fda2698091a86f570270524829f2a20a2c5f0e17757fc94a892d86a7ffffffff012aa20700000000001976a9143de2754334cbb32e7e2044f2c4229ed5924f9e8e88ac0000000001000000015493140afbc0836a488b29de5b6189e5448f79d8e3050c5ce0477f67e89fdb2e000000006a473044022076adee2de46059e5c125f803452836418087da88ef376e5f6d1ea7690203433f022073506f56beb64f4b4ae2aacdd7db300ea0e96aac477e34a4ac08d5a048e0de55012103b813445c8b7ae98e723b2c3b13312cc2c11bbe83ed3e2d6bec020bd38d5ad988ffffffff019dcd4100000000001976a914848b666af00163fe665f77f9b7e6ba86b2d94c0088ac00000000010000000145ed0168be77593d04e6db69c957b0105e371830cf675830d51d22bb3643d7b9000000006a47304402204203e188586200e71e869a73f84629cb748cb6669fdf2cab1abfda714d0e76de02202ad66d75c74f3e30493ba35b8684bb46e1a7df8d67c0e023a239b7279cba6f08012102166db204432130284ccde5074e74233207bd2f0ffbd745cd068976639802817affffffff0291dddb15000000001976a914c590f4636c2d7f5b45546be2da07afef841f99a088acdc025201000000001976a914117f63c79e3b58d356788d9584cbe80005d928b888ac000000000100000006610dfe252fdedb1920b61858a745c83ce5cf4db5283c9b102feff74922258f3e010000008b483045022100f92436c9c6420dc996bb2a5ce82b0c698607ce27fc3cd459cd043daf33a9ca8102204f29f1fe8edd4e686b1558a440d5dcc9573005da781aa3faf016d25467de59850141048a004149964fc211baae2ccfea29d7192c4eaf0a51068efc066a41eef141a40bdb995dd371c139533477775e92634bf395139de6e8caf7df2c6fa77a2205f841feffffffee61d526328eb371fc8c3c9a539eec7b97a6a5475cf62a359c12f046222bf986000000008b483045022100b122a8cad3a80789d3386210dd6ccac3814d4bdc0f127e4fef7d5d9554feac4c022012e0c063edf8115d6add1c5bd798d8d73d6022d7f596e74f6ae979586c8c39cf014104c91b6aabaea166cca6a275dc6932d1cd9d545131b7a15ce3e69b37220a4f47d5f6cd339880c8bf20828d8945144d3a658e38f727ab811f5c451f075aaf372cc4feffffff70d0879d60be54cafbfb7ab79a2e67360f89e8b20afdfc586630ac93d5d4f877010000008a4730440220526c3835a9290eedcc3829e6c91e18499eef468b208d489c01b347d7da6854630220682a7796f20ea84a1bd68e9e8ddd6a2cc72569e4f7f6575cd07113123214e4d1014104fda8f815f0d2f530d4b13f2e0460697604ab82e69e1ca84ff65769d63d986cdbbf4c6659b2e7c7b086d234ad555a5401d3a9f5f4a94b03e4c1e8137fbae85aa6feffffff05359e9ae9f441177b477464e6be92faf2744d34ec85391d2d75d5584cba8db5000000008a47304402201d23ccb337a9732380afebdc8bd1e57ef9cc5b672c946680d7faa3e7e1b9ea6d022058a589ded9c21f85dcc96d5997b593f57f501509ec3d4a6946acae844acbfc9001410411bc365a73dee2acfc89ebd0c4b98d0bf740626fa52f8d9534b2176424b4dab7daf9f7addb9a404dd36709f930c34a10f24764b472013c27ff457a3db4ad65e6fefffffff744ea1f97990b0d8cd54e77b4f8f9177ed7ea791e948249b9fec10073467291000000008b483045022100ef9eb6938f9689f4bed8cf9a83911164bbb2f08a72eeaf1aa124ff4b755da62102202e3ea13b3702a2e45a2a7a5790a92f237350ae6d06139fb5a5c26e5e78bc12080141048a2702d356d7d2bee2c3baf46c421d1d426f3f3c460bfc02009c483d342e6c76646590a64e3d87cf074853dabbb19e6dc207695dc03bb26d2da8ac65ad600e63feffffff59473f3dc1d6afe2e1023d1aa047a9338a981a914e12598e2a6cb31f5f573219000000008b483045022100c62e5c66109a1b2d0456b4f27ea71fc80df1434937da0899cfc14eca05062ac902207340b92d4d34b8029a931a27736c80528d5317f44a8cc6c151406803de1acf49014104bb47210b16ae138bb48ffce9f04e6032cb4869aaf54650fc6e3e7f504bd7567bb92a3437ac4d46cbd4f943325494b2a7339763bd30b5af7ac01bab8d527199f2feffffff02b1e60f00000000001976a9146d09b3fa268fc0cc66722d4ad5ce9047f618f50788ac00db8b02000000001976a914c89f4ee52654e96c2e49e1cd5518c76bfd8b1bf088ac6b730500010000000341bde9420f1947fe26a5321431933e02029cfb4655039aac619c777d9511c929000000008a47304402204717c65789985b004da6064e1b5758ae60fb37db6d21e951a8d5cf8e979776a3022024cac8ae919f1db1cda91c2ab6b9b00a3003d0fa787979ba8ab57504f8aeeca6014104165b26b96a1526054a44ea0b574938b58d3b3fdac9de2a9e52b267ffb0d3f29282ccd79a852803941e8cc6797f6b5b0d00cbe2d91c2af3e7787b84cbd378e132feffffffd42a867326a342cc49b0cc2509b850ebbae5ce9757462742ad292efc234bbd02000000008a47304402202050811786e74604f2eb6f8444a5b7e8f0891f0f4279838bb9520d369e3f23ef022006b867cff1eb9c1571c9886e2247c3a89f06c2ddc86a818933135fd1ff3d2426014104d5e1eefd037caade75730e666ac55f7a175dcb935191fbfdd67b7be017c4ba69c12e7e0f51c729bb65739d924c1559e84b3714f69996ac6059ff2d057dd006b9feffffffe70146022e637cef27928db264f92702dd9dd97326b8812f758f902817cc33c8000000008b483045022100da0a9a2ade7c8cd4e12293f13bd5e69b19a80d77bd55ae4b71c9bc5389786f3c0220759328ecc71e61ed39b94005d526014fab53f9544bc592253371e628cf665d8a014104c831c670a810276f0fb7c9074d2380bc57e563bc2eecbd478f0d7e8b15632548478f412a7e184bfff6a5021998e8aeadd23cba1cf95c573187d432fa247284a4feffffff020e361100000000001976a9143b6c0030bcd515f6dc1d3c4b90e4d101320895b188acc0912100000000001976a9141121fe40bf0c2ba887f017abc77aaa9636eb5f6d88ac6b73050001000000016b52db9467e7eccaca9910c1af55487b4213157be30567aef44fb17c93af2428000000008a47304402205b149a8cfb61f25cace003fcc5de8a399fb0ef088d6c839ac6c218a69219e0a0022050839b133ee1c8d6513f74edff189250b78eaa268c5a520fdfb9defd46b49d970141042d87142ad4b5ae0bd28dcce8d181b1200ac0616c103409006fdae7fe610e46cd2e7ca41dfee001aade71c5d3a8ddc273588efee76b87431a83fac2b1da4bc9f3feffffff0270347504000000001976a91432edf00751e493cebff40cab55b4f6715a59f36e88ac7e619b00000000001976a91419dbe37486144fca422f694e04cf02d644510c9f88ac6b7305000100000001b8657b7c750ab42ab8048879a2a497a523b83330b622e982e5625fb96ee2a675000000006b483045022100ace90903d97d6e2e7e1ca1baf76c93ce7adaf141a137875d9ae1e26bd3fd0dfa022005701048795d94c9a2fe9ee482fa18ee3eede0e42f11d10ffe42ab2dcbd78dc101210323060c72f72a1a3d02c793be6e2b5a4a8995cd80fe668ab4d2d58a09dbe9f389feffffff02a8290e00000000001976a91488608ac2495bfeb6681936e88ce7942e703930bb88ac60ea0000000000001976a914175e1bdefe0cb110e409c17ce2d6231d492ad1f488ac6b73050001000000015fc96fce2130f646d0ee5bacfa54d4b428aebc88f514116cf5c452db718535cd000000006a47304402204b06d0f802cd776ea8b5a8989bf8faba2926af803b61e3724074758a7a087f530220364f1c939524db16f3181d27a3074f76aee277ff33cb3801293ddd824575eddd012102eb1745b8425b7c5ed2b661066efc20de22c031b21dcddb2d4a21c05f365045cbfeffffff02a0860100000000001976a914183a6e66d6712399d05a30524fdf803ec46a292488acd0740c00000000001976a91480f963dac9713df08b073502334583c44f59678588ac6b73050001000000017acf3524e1174c8c5ad40944e16053c5722ad5900a81080323d74f4230b2dd8e010000006b483045022100e6ca75c970a2e3218af9218423928f1e5c6b54a8b3433833866b4b9e74243e2102201cbce06c5feba87dafb7335dd2f924eb1115c352c983687aabb0f5e1cca61085012102cc2f4b82847c2f28ebff5560707448cfbfe2f21ddf69b9eceae6d33e5ae006a5ffffffff030d3fd50b000000001976a9141b38c9937288abf8410f0c82972138e85e4610db88ac80c8b308000000001976a9148ac6f52a27b8fc9ac103ec037f27f6e01d27213388acf0ea7900000000001976a914298f787d25a8c918be3ac8d3dae97de97dbd069388ac000000000100000001de07de55556fd20dbe5375b0617fa01d240e328c2a119cceedb81d42c30f0fa6000000008b483045022100eee004b9b83a38cfcbe9086a0f10ee9eb01a6955e67842dfb725fd763c51aca202205d73fe1bac26da07bc0140d7ae92cd366fc52dfdd3ee29e951913df4dfd6376b0141047433d45fc5e77af3b9889ad48bb2bea24da92ca1f0a64b224574a74933353ebc53ef51bbbcf2d4b2ef5d94e4bdb8e17754356ced2d73b4c9188d0569d93cbf3ffeffffff022d13b83c000000001976a914a395bdcd72f987c4da56c18800adea46e7da1b1888ac90503c01000000001976a914e3c9b9f555dda8faf46f169b6302157edb9d6c2788ac6b7305000100000001c9023028bd3b3f8142803863148ae5e0919c49a43e15e04358eee99e907e9336010000008b483045022100a2f48a5b39e31122f343b9c34c0a195450f48137230b5cdc2e9cb5c0f8a7bbab022053073a152460cd42f531e3b9fd8be8627e5f68430e1eb3a100722bebd9f0348d01410421851578f99ed2fd7af9bc1681e5f1b6edd792048cde66f8c34ceb1340d41d0b1e26fee296aec7b0be574723fe2f8f585aeb4cc603a30b13e291387d37b6e0bbfeffffff0240660301000000001976a914eb375f88e164b33f783f4e6650705c327acc579b88acfdc9c91c000000001976a914861cb5c02ff83c3c5c563ce28f1ed545b23da2de88ac6b730500010000000157620c2a1e2a025f7c73578866322be0aaff625c7a2348cf6ee97580ff970f89010000008b4830450221009844b8eb6b80fca13cd040533c9786b977c35d09a3a98678438257a2bf1d119802205ac37a60f46827dd2615fce3801142706f91845f3ff0a298cf41047b5dbedb1f0141043218bbf6141c254d72790cdb8723c0fa04d7f019a76b0623731d2f464e8e715fcc0a96928db30651fb237fc24d59d10513267fd87cff6ad0f3460ac9a5b23e47feffffff02e21db331000000001976a91402d8d43546593a4d647d6c09a7713e30792f18c588ac30037e03000000001976a914cb190f1afdaece24ecbae350c156f4c249a5fb5388ac6b730500010000000133b33b7096c96de09dc439443a95398fe650f7e7c9c616a039ee587d5388af28000000008b4830450221009ecc310cfd0ad0fd5bce987567d3fc10d1728da6d4ea0e021583b278cf3b8cde022011bb565d522ef37cbafa28ae087d57bd6b481264ccc86505a86f9ef5d3679fa0014104467f1a98656db1a4792432c9d6051ea43a54d8c2778cb4a8c9459b91d39c75a2c66fa899de2edd9ba63f590646567573f5eba34fa1b535ad8916a3384a770083feffffff0220496900000000001976a914f706c28a02e4b701076052fb99a993f9a9fa374188ac3e6c400e000000001976a914cfca16725d1d20df7d60218916777b42f87e604d88ac6b73050001000000019c9cc5bf058fb24846f164138504a41f28a9576921558ec3d252e28b0f6d86d4010000008b483045022100a933f5b127b7c40a8afd56c820aa40c9d0f5175b0a76b052fdc971255aae6917022001679d0d7bfb21f353445af9cf3db6723aefd2388dacf5a3df17031fef429165014104f4401ae1622c3169496d4f1223a74ed2b5dcb50ce11813a03a57f1c41138c704b575abc06c2d12240389a6ce69427a8246ad92221c47132410353f7793c3f473feffffff0200c0d401000000001976a9148e68d87aac458c7256454137aa2dea428f72b1a588acfa79f100000000001976a9142c5bdd2bf3f8ea7b679e4d7fa28c37f9303452c388ac6b73050001000000025f89c72f52e4d08218cb6796ebb814d6facbbb0588ca3185291257830b343a09010000008b483045022100fdaaf572cc21d1d6adcb6717bfdde0f12ab65b2be8eb5a602721911762469091022024f7cf367df50f43f5ee257179a3eb43d09f80474170322b60bdd3544a65d5910141049f260ccaa1954846be9e2ef1f1a81aa9a30737ccbefca1ea6443a9cfbd54beb394eb2901d850d6bce273c874e79bae792c618c6ce8fd17ab245ad769300d0057feffffff30f5fe248019bebf7ccd132b27e4c6f876810b9c05ca58195afc358621a467d1010000008a47304402200ea388bae9083e12fe39dc2806f850b4653a4b32e2c7c087127d80a079ffbd5402206d7e76fc04ec7caad42ca69be9066030dc90825b008096da5ad09bd6ac346d550141044cd82067bac6a6f2206e2a108d396816ff682e387ab2c88d9ea8a1d8fe42558cf3bf764bc70acc726f6000d729f0c583dde0c81b2ca519cdd7b270bf65599bfcfeffffff02941f1d00000000001976a914c647c50f3310e9539916e8ba328eb18e5e8e760588ac701ee400000000001976a9140ad39e1ad57aa9a34c8d5bab5462680b2fc25ca188ac6b7305000100000001d36f1a82dbbcd2eef8efc72dee6e66a5594a321d19c3d2a116923244db68f468030000008b483045022100aa0b63cadafd41b8a3e75bdabbb6b15791afe957c7566ce28882840402e9dc230220674b9874299ec5d0932b35689f17dafcd246c4151f3862568087981c394e48fa014104fd8e0212b9791b849093e00a3a31e690668fcee5dc783e8f7cb7b6fd4e64b51be178fc405296ec84679242c92a12793ceefc7fcf7f426a9f8b448944ff97ed97feffffff021db36d01000000001976a914d0e03fbf6fd1e15a00a7d7f59e3a625eb2d7b70088aca0db5b00000000001976a9142e77e0441faa4c821cb3bf77743b977102c9d7a888ac6b7305000100000001dafafb4f9b45091f51f2f7cee2d8b320a2661ca3385df81fd6e83608d7d9d373010000008b4830450221009514f2fe8551684dc38ab56baf257abca51f36a6901ba0ddb08c0872d91ad873022061c9e52baad12fee89de0f34b49f6ea4d8f2ae44858b6d70fe5b2acaec9bfbdd014104cdefaec12941b5891a7a8202055815030a55f6ce6dc9702f530bf3db5b57fb75416a64ce61260869040b56916d13a5f0f0c571c6b37ef50863e7ac7d882dcda2feffffff020bb8bc03000000001976a914c333d3c2b76c7132479f06c647d20faa0403001688ac707f830a000000001976a914bbae59fb403f55a5918f70fa17ec6438067c9bc788ac6b7305000100000001ef695ae4b8c20736aa574effb0de418b5007f4dc1b8affb36b52f9e0b74563ff000000008b483045022100e7c02e1011d15ee0596fa9b686cc50f343c3151ab3bd83f477b01eb670615bb7022074656abea3417d3637d81dbd80e8dec82ad78bf5f1c70f01df19b7d94852320401410447c2079139a9050bb4809b136fb3d048e1fbe7b537ec158d5f35a4326e2b1bcaf623f6ef5083d88a68cd15309bcb28e3287aa4861b7660b08a98666a7a4617f0feffffff025a513c00000000001976a914c71633be4de58db9923af76b24f88b905c69104488ac002d3101000000001976a9141871c16fb15e1eb9f4367305bffc6a31c13ac10188ac6b7305000100000001f50e91d4768000b15f8204a2ae110b0508c630f1e602ec1f83a4f75764f03c92010000006a47304402205bd7bfd57af89afafca54c2e6eeed18ca349b5a47b2fae933d88afb9e5b620e20220781804fbeabbb7195eaddb911adce854821c0d78a3fbeeaa51e9a2074b449154012103cf543a431e6e171fcbcf7456d86e8e5c0aca24aa523503a56460aee346ce5255ffffffff0291b7bf0a000000001976a9147b3aff0a6ee9aa274cf07bb60ad9bc8c506b3de788ac87ed9400000000001976a914e1c4314ee223e0040ee91ef220aebe801fed329188ac000000000100000001d4bfe3e3f38c7f75d3007094722e705464c6dcd09349281704bb38ea88ef21f3000000006b483045022100c1d64929797ccdd2a8f530f0f4a660b5eee666852e28fa46dcc0eb792fd4e23302201922e32927d2468791ca45a09bcd28969d2448cc59daada5359bae23805a0977012102a6b1d256e9d3b3019ae0d522ae848486887f10bd07eacedc61b739d87f860f49ffffffff01600b2204000000001976a9146b06f7f3e67f8b9cba3781db44a063001be9e7c088ac0000000001000000015460642b3baa14d6d10b56660e02a9ace786bb3924790e009081ac4a5453d552000000006b483045022100c99623df8a153ed0ad016ded0ba1847fb67d3ff57021f45605f620548b518b2f02207bf879d144c65dd7a0106d8f57868e3c9e58ad46decf6b78d2faca9269f73569012103e47e7ff7db1ee7acf41031bc6fd58e41a4720e5f8a664bce4ef73f197c3a045effffffff0170811201000000001976a914c92a19ef9b1870d667118390a63f056206a7938a88ac000000000100000001f950333ebe505f50497016fd4cb80679ce0735ebaab59c1380f087ac6091bc7f000000006b483045022100f253ea00a6e27eef23f361715d5b81df7aade17cc0baa4b1d0f902ceddc93a60022017a9788dfd0f40a5e86e0bcc005b62bbeb8dd78aea49edf1b814a63d673188310121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0170811201000000001976a91438860090779c6df12ea41cbe472359b62957527188ac000000000100000001e58219f400c731b2794ca848366d2a05fc8706bb766f88c5e1a9987775181494010000006c493046022100d9bc2415b6cfb90fd7382cc0e1ba6873c01248d13e801e45b7b4b9c70da72e4a022100cc86d1d7fe3fc32161da40d86364d03025c35f1d12dd6d44672903c28a8196ea0121039297a3d6ae6c39a4e9d10d0914a614f7ff33c30359e3339e317eca435a0a5fb8ffffffff01f030d30b000000001976a914052512987b42c82119e245d2dd1ac13f25040a4d88ac00000000010000000298904d7aeea69c514e72e66549b1f97555378dd3339ab318e140db5fadc0de13000000006b4830450220265dc454e58151236c78a7d360a3257e82056fd83e1fe147c7343ad75ff464b4022100c6e345d212e1f74ec669fb2878c72ae75ce85088a044c436e8a2a4856130c29f0121025ccf220fe3c13ce73a9e36fa833d24c6dfa97147581b417c100919b351509babffffffff5ba80c2ba44030e650e70e208eae263d4737508dba8e9c7e811b55727e1fafe0010000006a4730440220607c2eb9f30ec6919e1f1381041c26619f25624d3f10704c04ab0c7df49c01d402207efc403c0dd8d4227adebadffe37ba49b6186eda788c928d2344200957217ba80121037a6c265394aabf6d0c57e054a9e92dbd292abfc2c4495fedeb461b5bababdfedffffffff0250218603000000001976a9146abd8fdc78dafb3a46b4e115f61d5ef70718303888ac012986d3000000001976a914c19197d5169d11ee09705dec0002ba6130bcc5c188ac000000000100000002cd3572a1d88b138aaaecef543fbc5a6af7940b35d482e7f7a143477035d5fbb80e0000006a473044022056cf51b44cee2229d52e6b0588e72f230a34bdfb84659614f35097248018db6f02207d78567138e5a5bbcdb45c45be5daefc859ccb02871d540439bbe51dc7691ba50121037f12513fccd7c0d368a04c89a472b3b22bf51dc7219d51f5c87ecc3ac090a767fffffffff82e3f69930615e41b427db43a0bf0a7ea3baea9cba77694e67c301744813717010000006a47304402202a898a464e428feaaaf0030cedbd3c3e0f5ec632b8cf74f4aabc958a8eaa338f02204fb47fce736a50515d817e758ac82f2e25f2efb764751b298de9649abf7954b9012102548bab906b6f8d5ac3b3c94cb9bbe79318565b249b2901d2b4e0d45d3a322825ffffffff02001c4e0e000000001976a9146ecbf14333b99e4042b38848b3b8adc36ecc7acf88ac98db3f1a000000001976a9141327420594ab0f81a890e8311f1f5eeb8f7e65a188ac000000000100000002bb3a28418ab13c835f602cc2a3ab6447c2858a927963aa9c1fe60fd5d0fa4e51000000006b48304502210091c01607215fbb5a212627fdbeb485e8b69166e4e33a46b772cf64caa338f8f402203e417ff27737309d805657e1625617c1c3639a5c38fa1003e4a641e936802932012102d005ee5b656ac952e27ce8f186faee480fa3fd507636867ce076c826c7699684ffffffffeb37be1c1c8652d7f8b5cdff8a37082516927a87feece972198e95de1668931b000000006a473044022021e8cf072339dc39a632f9b752b4ac17ca40bf3dfe679e85d8a27d2a444d4e0d0220029ef93c89e13ff59906a2d0ca02024d777fb976e121c14f098fb21fb727c25c012102d005ee5b656ac952e27ce8f186faee480fa3fd507636867ce076c826c7699684ffffffff0225020000000000001976a914442aaa24540db8d5a75a1fa0f3df1f849617a9aa88ac3dfe1901000000001976a91460c605067547b894ae69751e42f278e1a3b9978f88ac0000000001000000011c9b76e5f99fc2373386947ded583c9238138d9f9644d6977e5b7014aa69edae010000006a473044022045e9c42729550d006916fad78e27a27191ec0126605fe9ff040d1318ac388fd102200c8cff5632d7d11b9d5033824a1e0e8a90f92cfcdddb216f19c9bfdebec999dd012102b0020cee4ae5bbf61a3e01a1bb7be71a650e376abf06d046e03046af3e153e7bffffffff017030f400000000001976a914b463f3587148bf61adf493f88f9820fbcd9f546b88ac000000000100000001f035478b37c96960c7b200fc9c07396204b4147c36f4d7d34ccb14f4188fed21010000006a4730440220433c465abd410cae3857ce91c4dbc243596f7ea65c9c769e6fd244c6b4c971a50220090d5bd0454d11fcb84af75a5a20f60bf9ce38eca94913fdb58a78f28513e4690121036d02cf2a2326f8ee6a075d5bec1b6e76fd11a9046d4614fa308fd20f4434d44bffffffff021c081d05000000001976a914ed070abae54b9fe467b1d901f2c319a2fb7c5ec688acc08dce06000000001976a91417975a867a8a0286f9f03054281fdc6c7ecf75ff88ac000000000100000001daced51e62369b85a9ca05e0b0e2d02ec7bac174a38e59ad4f95be5367f747c1000000006a47304402206b39a550f3c1a474ff0271604a96ac1cc89daa6a99968f3b80e649f8ab63af9602201958d2abee567d8c71f1fa6a1f18f99aa707c8a46296691df11cd2c1593c7be90121034fa53fa85a67c202eb55dbf18d282eb48ac46c54de11edbd79c587dfd2e5a1b0ffffffff0266020700000000001976a91493c0009675bfbd7748d63ddfbed031353119715188ace0db561a000000001976a9149737060a06b1f7e67d57a2a9dbf63767f444c8b688ac000000000100000001686f4713594e23b45043cf2c851680fa972cab149379e00edd0f3a4fafce0ecf010000006b48304502206889193c966dba19ab9d37c0297da7dadf69d91569dfb345f14dee4ab6644618022100e9aa1b9eb6e594d5c631b7801b65b91daa8d356fb8349d99843f2c6ee28063b2012103ada9c5d634f80e9fa7095a6633b3cebb955e283c3d180efcc483ed48d27dc2b1ffffffff02b0d1b90a000000001976a91499e4249f2fa24ce8c0f6f9da1a5aae0bad8e1bb588ac971d5914000000001976a9149d52c32a7d2354a31992324e48ce26dbb53ce8fb88ac000000000100000005f035478b37c96960c7b200fc9c07396204b4147c36f4d7d34ccb14f4188fed21040000006b483045022100863d98bdc250d306034dde69e31b231a53fa09ee9dc991ee68aba7641baee76902205c7d2ed72a4a1c84c9963f367934f3460be07ccbf4ba927c4e425b066c6979a2012102a28bf1d0d112866a3c531a197a134c87e82f93dac4cf1232fff2de992ec6bf58fffffffff035478b37c96960c7b200fc9c07396204b4147c36f4d7d34ccb14f4188fed21060000006a47304402205f15d4b2a264d4e78c03b7262031d69b58f3579c6a28e255dfa6ad15fab78716022061122ec9557b4325a728b61bbfb19ab8b6add3bb0120d338068f69b13ac615d201210320b6d857052191ad758a998a0cd0f4d2b6e14ccc1c427b999b6c5115c9ccf46dffffffffb240b7f3208f85ec69d85b1a9449d68336af167493a0645dbf2c841968d3b8be010000006a473044022013b20d7f822f045fb7e584c0c162a9ac71d5ec9620f104fe9c0074ab89ac5dd7022022b5f7212e2c1e3cc2ed4e0adea5320c81e01fb00ce682ba47ca58b0e0dc0231012103877977df995439e715b8aed07f612cc9ef601856b45943e8f915f076e21e023bffffffffce034905869dd0145887f68c25c13561ff60b142110f63bc6b84241b0d62aa74010000006a47304402202b285a25c46e5bb8fcf8c9fa90a7405f3cc56a1095d6a0c2de4aff207113291502201e881504c541b3e6932a7e9b05a3eb0f72838d0d14ea10b256b3d995d96849ca012102c7a111393b8ad5c041c05097aa01f8aaf53c154ed608a3ff9fcb410ca6101fdcfffffffffd801ffda59fdf92d4663e57708596f271100e81b9bbb255e723c7222d66fd3a020000006a47304402207987cbf3d58f50cb712f5fec3c87c6e9a92ccc25a081c67b34207273c703c17a02207c4360bd96d0f3b3e1949890ccbcd5923437f6b88f2b7098e6f8811862a2fc070121032467db06b1d3465eb0075265ee062c60f0f8f7c0805b257356cf83b7fd9ae7d6ffffffff0e00dd6d000000000017a914206d262bda8ca8acaea3116d97ed3bc4330a695787e0673500000000001976a9140685a05466905721f6292fa5d173682da801c5c488aca0f01900000000001976a914b1969f7c94b88ce424593494cbd4bff08fedc98388ac80b92a00000000001976a914147b7bfe27567b9ba74145b949046924a426dc5788ac60f6f201000000001976a914b6857240f83fc4f3f264497419aabbc939da4caf88acb0f2ca00000000001976a9145e226c737a56cd3d23e40b7dfd375f40f51676ec88ac81801700000000001976a914ff130497dd1cb702517bde96efe5a96874efec8988aca0a1b800000000001976a91417931c824938b76b66de6794a9e8c4eb600465a988ace5d44900000000001976a914f7c5c870369fc85af88126d3d4d12f41bb3751da88acc0a4fd01000000001976a914a1d3109f5f68aad2b646d7d7c4641e7d6ad1622288ac00623d01000000001976a914d5ddc75a81b4b6a5996da2ce5eb05150ae99b0ec88ac20674605000000001976a914164a7664be790b361f169ac06df076519eaf166a88ac0055ad07000000001976a9148ada333317eb164d11345bc04f1b389a6df2129a88ac40ea7000000000001976a914ac1fa5ecc3762eacb28ad2c55447fd4234a8065788ac0000000001000000025436fac399a17e71ed1d10de0d6e6b3e491c726d7c308fe56379b2c8ba696086000000006c493046022100a5c0b9f4b35481def597be00f3866b11bfa9e3edfccccd996e99e656c007b9f4022100a8787fec943004001877b86b0bfb06de65874d91aa72cd8ae0e22dcb55ffdde5012103e1df4782705418bcc5e8960c4d1d858ccf6c7debb99b5b248f9938e1c758f259ffffffff20a38d8e1c9a5b059387c271afc44cab0a9872e3de9ed82d2bb358e6e29c893b000000006a473044022022df251ae2c8c7a91ac640b96bc858e4eedab6c6e9234e1ac72339a9bafc91e50220689a4a2dae3f1c8fdcbed1f464b337e1937384c6863781ba78cb7bb59878354a012102a84c452675a19866c291f00ab096266fdab5cb465ae5e9d6232b0782518c6574ffffffff02c3c9a900000000001976a914604861784894334f267439e3ace8e537a7786f8188ac408af701000000001976a91431f249f7394248e96d227319c1c18b8a2d92e47c88ac000000000100000001f6d3f6f1ab3121d60d0a4273d5b5b8cefa0c8eae30603573e48f1913d47c1960010000006b4830450221009749f213e3d199fdea8939b5e69a601d6ba5a98c7412fb2c5042492fbc635adc022039fdeda61422b518a468e3fcec4e589a0eb0897591c25bdab8b321591e29f7860121034a106051bb1c0a530bed24543f6848f233357aa1ec5dc5ca4eaed30240b01b57ffffffff02fc0d1504000000001976a9149f87f831cedbf181d64e1a9313e48b1f23cc0caf88ace0a6e001000000001976a914270c46e4a9fbacbabf19265eae0dc7d4868ea44688ac000000000100000001e881fbf0dc4797661bc8f46087a1cfb1430ba7be5ad31ef2e4dde325f5ebf668000000006b4830450221008ca2d41cc60a147467530d455498351c472e577ffda79e2aaf6770b63ef86132022074e93028dfdb359a550d006abb2fc9edcece8d48e616572043f43546d1ea661d01210361ccc6e695f4e09a8fbdd2c002618e4d7c9404de586f92016acd8e15bc904584ffffffff0200032604000000001976a914bf1edc00580977eae6c766e9b1a64808f1c2df9c88ac3ce6da00000000001976a9144ef0db89f4a9f0a1a757cd5bbd5367bf580e5c1e88ac00000000010000000113e2d56f92cf0d7499fa57ff4013b231adb6119b1d70f6f2e56367dc6d6beff6020000006a47304402200a134c15a0faf8bbb0e3b65ed5646f6ad942bfa36e86eb3505cde3542f771787022071e8a9bb03028372c84d5b2740ff7c530fcd7296782c013ea4ba69d9dc2dbe910121021a13cdbc83063aa3e2bb9721b101e12d46c2514ebc8d9a60881c22ed452f4664ffffffff0200b6a602000000001976a914e86d1ea9cf0ed6e5aa26b2157292ca0b938f96e488ac32f7ab00000000001976a914adaf165ab79032028c19773885cba02bc5308b6f88ac000000000100000001b0a00d8c8fcd8b44a7997b0b938037d287b5d6713588638a728ace51e6159456010000006b483045022100a2bcd9da822feff103de077453d055887e21a7af9d2d4e91972a4ca827f23283022077fae8ff2e8301a4f98abb3f0307afacc45687282f824659173b96151c472af70121025f7227076ed1cb30dfb74040dd5dc7d6bdc5d1cd9a979286b93b86eeb027ee82ffffffff0210dda602000000001976a914e86d1ea9cf0ed6e5aa26b2157292ca0b938f96e488acd958ac00000000001976a9142ad7bcff321748f1d4d7a04f9c400791f9818e1b88ac000000000100000007b6739977b899bf717218463d8f013e79fad7f4a17377cdd953f744563c164a01000000006a47304402204f3bfc5a7245e4363d9b03c7f72323b7808b09423b171868b00d75f275415cfa02207bbcd6177ad9469c276150e87dac25c26ad538de7311174c9f214b59339d5b2a012103bd2115990c8029a06d88a0660e87e34443f9c03dff67ed5ef30a13b348c3bb1cffffffffc4b6d472a8cdd9b6066932444013d72318709dfaef63c29dc1ea149225d9d103000000006b483045022100f5a1a55c2bd3f92ee8ca8e2f71b751a4f3be187fd4166253eeb863a2f50e23d702205a7a12b3230c27ce430519f1757d9b8ef2c1d0b4e3b4c6539990feee18a768e5012103ce6a4efcc536db89e2a2b9d7ef5e4be3ab5b9f57639f741330a3af340f84c157ffffffffc7facfe9d347a3c87a2576a7aa3d15ef9694640ecf0ebed18efccc3a5a481212000000006a47304402204413a7dcfae659c8d4de5740816d70c9e77278c65df6510c01d1ff89fc1a528602207009594ab6b68135ebe48cb5af4f011ae804b048886c24b8c605070686bec1b40121035da3723617cdb641c505ddc53f12659e1f5f89bc5dae221e5eb8085402043d77fffffffffae13171659fbdbebd0558bfdc0605ac772bba1ebce19209bbc63bc955ba2f3c000000006a47304402202d91a97a4d4153b0b0624839ceb38ae342b2e14ef6e38e7e7d23418a8db92d5a0220555f2dd270841313dc6f205e1e646f842bd258dba22238125f65251cf592e375012102d6cf9acc074949b4dae46b698b2da8cf54efda29d5bd24eb9fe48b1bce5b68baffffffffbfbd8945fbd6452b812b7d9add7f5246a276bf5ef910d4380dcb6506248c3061000000006a47304402200a9e72958f167eed09087a33cbf62f14ca5f0fae6a30ded5639daf0a1c6d8649022064d30b49eaeaef920346e412e556c4388d0e055fdc2e76295a1e234d23792f13012102469cffb446b2885dc9308089687b033bdc2ac0b401ecc3a7be8b5f6a211ecdb2ffffffff2b1664836242d7b6c75a8bb9235e5da18296f7bd522e2c039e81c8acff9d9a6c000000006a4730440220157076892744793141722f4339dd615c851ceb486db01e63afec78543845e23d0220361efbdf36a60a16f91b06b6bf5853d65758d18cc24880d9be6adabb32601f11012102bb57e1c76158de4ade57bf2cc89c6b5451cf1c9988900b666703eb73ababc5f9fffffffffdcbb349cd3f53801960eb0cd19dfcc55a6039e719b8ef1839081a2a7cbd956e700000006b4830450221008ce0ecb57e5e5e4c3471999d352c94c4594f1fbf124683f8fd9d33776b188ef302204c64edde37c44e6dda9f2bb228f66976cd7168877c7b413dd9b4a71dc7be2662012102cff65727866c72600b2837515684af4d1d21e8fb2a5a4d1f57f92805bb3aa16bffffffff0255104a1a000000001976a914c0d9681f12ab9c0d7823eddd5c31feebf67b7a1888ac23b8563d000000001976a9148f67b4acb6e5b5b6a3adbd95397e389cdabcc1a588ac000000000100000003533deb01f1635c1b6b97903dd2a8b4b252d716065dd525d418d57b10b32c1850010000006a4730440220646c5f95c64ad3c84c1e92b2e013efcc05585bd84d3b3f883e3a377a46cc8274022020480be5d2a536ed70bae2215cfe3626e3d9a56e47bd0a659ad4ac21936689e6012102eb8a333277a3b0989f90b46e3dde2d5ee8be661e7b000a5b015b055455efb8c0ffffffffb77bd9b048b9c22f25fd3593dca9e72b94a449421b947606b4ea89da70a7294e010000006a47304402201166807473c28696f313fd19bd369a4f4e7cd52652c472180f69e7b6c6135fdb022050a64cd511055d1e59e1bcab6eeaae4f42cad177e132bfe73628274cb9fb7cbf01210226b0f87dd45d32630338c668019f90d2006c305060b3ea846ea3f192a70a5bcfffffffffb590e512b02047e0887863072b720d8cf11ff709044ddf8e0afcbc4ab1fb5936000000006b4830450221009017920b62ab9d6103a4ee4a04616e23b9b1b92adc4d19ffa30de7a0a35f7fcc022010ebef675d7129e7e2c0cf1f08c06ea66345afdba1d9ba4ebe7991101144002b012102eb8a333277a3b0989f90b46e3dde2d5ee8be661e7b000a5b015b055455efb8c0ffffffff024e420100000000001976a9142a97aa43d00fc34ba42ee44613f0e7e64c45748388ac8f4a0f00000000001976a914d6035e17ed7a53366f0cdd77037331dcc23ff5d088ac0000000001000000012f927d00d1741ce17d7642648254832ee69d9fdb86f71500c35a88e1797259f2010000006a47304402201c657ed2f84e2cde028f1ced92aa1826ea3fd12462403d56794a91dc2ec8a01d022006fc1afe0c6ec81e43b7d203cd0f371cce183d497819d3517f613728e7ad7170012103296adeac3061ba2fa10f47240d3badf08a1c83d55e86d27489805b182526e738ffffffff0270cb67c9010000001976a9146c923862cb18f19ac30c8d24785cd3fcc3405da988ac805d6e130000000017a914428ba6f2fc0ed4c313d010303d19bfa179e3b8b987000000000100000001dd1037e1f607d45e4c8f8bca9f40958a86a8ba7b1b467fbc4b82d19d3692ea13010000006a473044022044e2a97c7060b1f6f7f3469cc35129af02db6d8ff7a94c3e24f5ede2d761287702202faeef6c09291342a664fce4c561f50b59f1b68c5c1f6268987a851c294cbeb5012103fdafd4b07cdedf69f07732f05e45a5bcd79eb08830a34519d798bf2ac9e10bceffffffff02365600000000000017a91479aa08475896a09a7fb124b6f73fc3c9dbaedf12879286fe00000000001976a9147e22cbdd42a94d6c9a558588b14de09b6df0292888ac000000000100000001f33161c044eb91072091031d90ea5789ea01f9403ee85b54f83d6e57c82186ff010000006a47304402207660901e581bf919559d55117bcdbeb0713c3af117eb18a6112a55dec6245a03022018f72c4a31f833fbdd3133c14cf2462020bf19b1871f66bc9163bdfba2c19be5012102a4cc9d15b730f4861c50400a4363c1d358708db4a042811488664cebf93953bbffffffff03408cf73d000000001976a914c4e81ca6a0ba38fe24b529c1e08231b3233b4e9688aca0816a00000000001976a9142b9b4b6f710e79079fe7576a52859d9be2526d5f88ac4027151f000000001976a914ae0c82ceb5e399509851fbf0724ce4194f9789e588ac000000000100000001ecc01846859532133d89ba619bb364321ba782d4e16c91ddc6965d96e802bc65020000006a47304402205e595626bf18345df99228920d18978abe955db7d2b93917b3e068755b9ff2f80220704f9f2eb7054c75ed6ce5678a55abd7297007dda79b595b865cc20fca11354401210363b17d5e1405d4460021e22239ee676d5881ecc8af35dd92891084d876009eb1ffffffff065072644c000000001976a91403f961740caab8ba0e4a2f871ad835b83bb07a7b88ac007a8b1d000000001976a914055291e21c7da5de004c41cb3334e2a40134eea188aca437ff00000000001976a914aa7dbbb6d9dbca6771aa9b11ea7f5493c12f1c7f88aca0816a00000000001976a9145051b8371ca176fefc114dfcf3c596a7b3cdc9a588ac0be55f00000000001976a914e648be52aac41926387e3c1497e81268f341825f88acc0cf6a00000000001976a914d089ccd5458d5e9488be3f6b8b886618bab71a4388ac000000000100000001600172346cb7116931c0f12d5c60dc7495a25c2e6b90f6ee018bc66f7b21940f000000006a47304402205bbdb0b1aa90758a6fbf4e65e896a865b3803917fd408c21d25ed20109bfce2a02205d36a3e3c5ca25daeef7452bee29da5cd7f733abf43a520d1433fe0db8ea0316012102f1f2e93521144418cfd3840fcb2c9680918151c3cbba47fa7441b6eca98a6b00ffffffff02ca862000000000001976a9141c14fe354a7fc559bc69dab05c67cde74e63eb9f88acda44fbc0010000001976a914337ce63eeee2d829265f491a30e2d0945a80274d88ac000000000100000001172a0fd3f5210c3a2f0e96c14e14a09cef8193ada464337c9a4719e0c5143e7c010000006a4730440220505c23e40804c4ea35b02216ce7526e343cafdefb4ec49719c8d6bb6d17ca2be02202d9094f266d469c3455bd75db07026cc8ba914cdfb90bbd0f698af07dd105d8f0121029b0907aa5b983785ef89d2deb4318042091bcd8bc97135eab444372debbca92dffffffff02ff97910b000000001976a914bb10be30d4dbdd497a5dbdc7775ac7f2f23d0c3e88acc6f05e01000000001976a9147ab62b816aa234edee820bd7fad92b94ef9a2b5a88ac00000000010000000173859d7ae919e5fb528fb1317506ed2e09d789c6b926d0ee5a35cae73963e7c6060000006a473044022050ecfb5a97a47962172e97f7cab9c4e0b73adc6a508b179d0c4b96bfd39a1dfd022041b8c847594f0d84734c9f42ed05f142a32cfc396e42b9e6d2df0e3df39ce66f0121020c2d3031307852ca879aca17f08550466ea1f594d8d1137c4e92a4ee7742a520ffffffff0212191100000000001976a914145f53d9f2ab804960ae6893d08d1393026bae9188acf0e29e01000000001976a9144623c7b4656bf2e3531c70eeac96937c884c750988ac0000000001000000011e9a8e27282be8ca6ca99231c848ef7b25373eff4a8301362e549b7d3a35112c020000006a4730440220710e75d5ada73ed0de64f216b7eec053c5dfaea9a9b477511ef22792ec152113022076b71c00963b5441f18a73e19101b5a45a266e854d961f5654473a4927c0da100121039a14a147c9209b4515236f957656d5ad3d9562acd4147b0c51f2acf0d8049ebaffffffff0254380703000000001976a9149bcc7a05b648f444daa6cea8ce613c9fb03f6dd188accc086903000000001976a91437817c8296734d1ca790d766537c8fc33149877788ac000000000100000001e7dbd20af0cc96a3b78f9593792674acf51576e2c83b344167cea14261690cf9000000006a47304402203ff0abd794b935bbfdc361cd1b77de5977c133416e5d7cba26894ff97ef9426202202eea3db1eda9cd90bb475da73e89216dffb99ad065f58471d5095256fb0f40ff012102d99155da2326b14dd62b99d4231b417331ead6fb41790cdc2ae4cb491b54dc16ffffffff0280c3c901000000001976a914a1defaad8caa4e2fa1b022ea586bebfa1f042e9d88ac402ead02000000001976a914e3c072ebac22762e5fe1d9059e1608c8656a46b588ac000000000100000001268cff48075bc3dd287337c6853b9f31da2751f65767069d0906ab4db1620021010000006a473044022034f602ac2f67f936f47c0d554b4d2a848950cfb2d7a83fa2c127ebcae0b2e20a0220272ad4d1b1f5121188b4bdb95f542c58bc27ce20076bbcdfb7349ab12c79adc0012102abca151efa734d6de039f7c92423049579ffc164da53ecb8dbe79f06f5330a92ffffffff0280c00d16000000001976a914ee78446417d60f2c63acab44dc171a1ade844ad888ac3079cd38000000001976a9141e1254b8c796ac7b29f832eea2dce57619f6e3bf88ac000000000100000001a8bcff39488c1d07debf6c345b2846db0b054b779566b8b204a10bd198eeabaf000000006a473044022025bc60bb44147d364dbcc5622d62fbb07acdde68456adf6c5c6897b3ceaea4da02203e61f11d0f149eb478dad4684517735e4bd7f618c354c9565cb5db708e62e2cb012103550ca9231cfc8ea7ac94f75ecfd45c1e20acb3424e3d4cc1561d1aff020d0ebcffffffff02406bed07000000001976a9146fcf36ebfbbb15407f0eb1e70f617d6cf8188e1b88acb0f9983f000000001976a914bf1560e2eb0800abf1825e9fadba7b44ac644be988ac0000000001000000014f0edd25a951e4fe2fb3c4bf3e0936c0076af967e0795b6a0f0e6e2245dc91a4000000006a473044022025dfe7f1880286ced455f9c51d2c0cac4659e16c5a3ac4be839c1d1258c689aa022077f3b550dd6e2632a41c9053b69edb76d84fd366bf12314d29ff19a1e94aad6601210363a7712f839be58c122ce47afe1979e9bdfa5ea36a59bcbd313faef8930caa7bffffffff021e052700000000001976a9143b49e53329acbd43011365b1b1ab83697574e08588ac1d5de4d3000000001976a9144d97037920024e0b4086c5a9f8343685a0aed8ab88ac000000000100000001bdd99be7cbe86d0fbd686b516329326a54a3421b669674fa7843e892e61974f7000000006a47304402203cf3ad7d19daa355156a0e771f6b6ea542144bc80e644b5162fdb7cb51bda730022018849d4ac21c28fa9dc253fafd5e01baa670e5ddf8682766772b9651a28c7a29012102a1dc260c319af08d5780a8d73760f989cea6d9fa7e50647461b58a69f195108cffffffff02a0860100000000001976a914346cfcfba55206fbb4898ae03348e36b1ff04a5c88acf2344119000000001976a914c1315156575d1e12c249043780c3df7d71eba64488ac000000000100000001c474e8c61aa9ee9c241173827df56d271dcc6e5fab8f19dcf322651a48bdce4d010000006a4730440220764ffdda26897c3010bc0ae2450ed1dd154f01b7713e2206fc0b7a8d4d4ec165022009ffeb5a8b104a7902e0a1bd12370c86a0ba178a60743a6e3ca0c17c25bb7bc601210341b9a1465688683a83d646393419664348d3f0464ac57fc7a5829f2be04fde5cffffffff022f381b00000000001976a914f12ef58f0c46989fa50d4a92e454e16e3ab9574188acb5af823a000000001976a9143203927fd4f2d34aebe400bd1957208cec9fa4e588ac000000000100000001d8a2dbd0b2609085422a8e4a05ebc33d43c2edc0079437d3f948e031a14d8d25010000006a47304402206e488d1fd407c0c382b76421cdb6380ba28710528cbd5958d27a972fc7d683820220636c1141662442de7c8cf865fb1f6113a98ce1c1cf9e91b1f3afd533fb7c5f2701210287b8b0cf019c487f28159351d89cdcafb26994a5f0de9b45afe8f6809147d257ffffffff0210c4a530000000001976a914f310b6a018336b9c0c7120b51c6af7335ea6c7fe88ac407ab206000000001976a91443fd228ba52205f992fec33fab72853e16b7e8f688ac000000000100000001f6f96c9c9e1bd3fca35514d0315a7d5b1c49cedd99b3489e575e4c7f6f126553010000006a4730440220085550e4f74661d6a867e3c594df89a852ef32edfc057f80b2773fd3f77aca0f02206d295379e96af9af15ce8e761dd31090c96adae5a95ca2cef37215711fdf96e001210222490b49851f66e6c4a62496e832ddb49bb3506e8a71f636523774723c829416ffffffff028140c301000000001976a914b1349556da0674c556575f4681ae6333b027c67b88ac28a8a39b000000001976a914e7bc21d19b61066ba8c0ebc88a47e01fa21430ea88ac000000000100000001bd2c1e9a8459f7cc7f97efab94dadcb6b2f940e56c23651c5b8455c1344f87b9010000006a47304402202f428ef438319b178d3ea23f1adce1865540c316506d6e31ff517237a6bfef350220575c71994be1e1293fe42bb8a6b5e0f3d127b264e2f138bf98939714ffea6d3601210307f62272d70e21ad691326b961c854e45dbbde084b41463c9024f7cd419267d6ffffffff02de727c0f000000001976a914776ae69e64e7c9841906c362a4c5581ebb25a0cb88ac408af701000000001976a9142bac77792cce38af44b6fc2044f054ee8a48766588ac000000000100000001c1474b48ce5362b74a05475263e200f7f14f57938caa7c81bce5fb1fbfcefefa020000006a473044022016a7f5c39dddcb26b68927842f62550185684220b693f3c913cbf125764abd7302200b97e55b12ba537c081693bafd4e0e45b39d5a36d90ac9d394f15b0a6ca7f9c301210369e68c095e7b0f1a3e5840152d941548c5182020ac3d7e94ab712eda51a9c53affffffff02a2861f03000000001976a914ade49952a30aa11abda207766d2605116fb0c84788ac26679500000000001976a91462e5daa3e792bcc5e2050ce859853f77cf38246b88ac0000000001000000019b7a429419b08d214d61862b87c7acc449c3c9d1551b5fad3a9eadf5adc8412b010000006a47304402206afcec4a46b06c7aefda5fcd0be016551342c3824f24fb2aa481323e78e7e6220220564599e20fe7a0df1c89047c3912eb2e18788e2fe60d07de78c3b19144147fb101210326e4afc2dd2be8d8fd497ee4dc29eea50d340691f236eee88a627713e94c33ebffffffff02689b264e000000001976a914ff168c1462780481767570a4bf7260f7a9f646c488ac60763d00000000001976a914ce632cf6a6791083bc7f0a3ec454ade18f52cbea88ac0000000001000000017d8eba89b990c452ebf342c7242a9faa5ab222a8880ee0f13f895ddf692cb3b6010000006a473044022048facbf0b846a98086847d99895afd0f5382c311828061c2ef97766de1d15f9302203bc9028e285353285665db27f6d5e80be791e88c6f1e49ec6be29b6bed79e2ef012103f41df08e73d97acabb7681b6b617b724461aca0c45c6ac80586e9ab5bb4d2beaffffffff02eb2deb03000000001976a914132a85db508b1b85235b35f8c50dd6d94d28785388acd0754100000000001976a914f351d4e82b77b86d4ba4a9a6d32a3631de4a74b388ac0000000001000000019bc5a9e9eca88aa8756388382a1b5c6bb507be7c219f212d13532dd24fe83e35000000006a47304402204b3bbb0943d41d79a73c5af14e38347599f2759c097d0716b13f46c457f9a8a9022067623d72d9d8d34b31e4d0e8da433cb39881ccfdab2316ff810ac9a3b187b4410121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02e007bc01000000001976a914c7969f71e653d9ac71e5618623862001edfda92788ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000012bf18cfc97b9eb520cd9282b83add722ab367fba775c23c8ac66a1537f775197010000006a47304402202642d8a26e3990cad6648965e34160409050a37f4baf3cf5f005ce6c890994a902204b3b1383c87c231bd5b97dfb7bb4f5a6198264998bf44df2fb76a847e4ac9d5f0121034b8be16a12ca3b7995eee693dba26f1b66b4682f045797b9644a930b0b2cd03affffffff02f2b71801000000001976a91460892e91b53df6927f026ff9118cecd6c3fb111f88ac2ed33f00000000001976a914508ce255d7dcce4b5316d3fa7917006045ca40da88ac0000000001000000010e629ad4d8b55ac1dfeda549aa9fc10fca2c20b74a25fdef2119ad1b78f4b9a9000000006a47304402206393fe3fec01c86015f21de5b519ab97f001051abbc90b51b9bb6a40b129e40b02205dbfaf6d7b82783f07dfeb989b2f5901125d577b65d22755523a8846e9e844c80121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02e007bc01000000001976a91418d14c15d19b4cd947536b6ff2c5b295b68b900288ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac00000000010000000159d649c73b4fdc4fdf75502f60207092873dba8135c1d664fdedfb1d0b07b2e5000000006a473044022006b542a18cd3e9443c0c3c0ac1e72433cb7ebb61de722adb1ce6882796e018ef0220193daa9d82962ba0a99e9167a33d17ada190fdec34795f6e1177167bccf3d26f0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0290940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ace007bc01000000001976a9142c75415ec4c990144ec683999d30f449c7ead26788ac000000000100000001bdd24cae38a46dc2cdcdb4caa60cd96b1f6d17152c277701ff8b54097d84b8b3010000006a47304402200623a026e414f5e7587f3a9657c2eac4ef25bafff77dfb757a646db2c266a8e402201a02388a94f6020209ac9f1772355024634725bb1d192dd7d5a8e75bf6b4023e012103ed3a071e9d29b17f9d1ca30f71759fcecafc06800107275aa42856da7305a4f6ffffffff02688a5f0a000000001976a914734c04d3938cdc702699fecd7b0cd02eaef34c6688ac7898d701000000001976a914a78fad23bc7dca26a52a1f6c3df19f44b1b6e4de88ac0000000001000000015483e6e5cc987968c691e299cf20ff9e169fb2d4eb2991d1b3fcf5f642840358000000006a473044022053b9bce93ce18742255e26af0bc35fdfb4dd34d783a9314aaa820c85054025a402202fdb1be78695260fb4abde315107dd2b5621f0ae56d0dbabb696750d4664ae900121032a2a46bb68b9ec89d3aa2ebeb303099ca5a7bdc3e8b6587f304c72c0f06cadc9ffffffff0248c54100000000001976a91409d271ebb449ec549c328d38a3ac25fb0d5cda5b88ac80d85100000000001976a914eb57d58d8ebb8f69d784cbaa6be5f777c89cc0c488ac0000000001000000016df5b6d7ffe94b95ac90046167b0f59c85aae44ecbd7bf4e391ba679a286ef69010000006a4730440220536dbb2013115ec451ff553fddf21de28ccf74dbacbcf890a89c65fb34afddc102206a1e7fab4fe41370fcd1f7afc601b176518c99c0c190735703408b60b2d860d1012102e528bbd538db3859864da7eac8fe342a4aeb40a5c0d8a46079f354f653bc6910ffffffff0278cd0019000000001976a9144fd2c7ef794523552e2395103e5bf34ef98b8ed188aca8721200000000001976a9144d4f41f12799bc0206df13e3a1a22b472ab97e3688ac000000000100000001ffb3896752b1ff6fb41f913711f7e2d5957feaedba0d9fb1d7ff7a4203f9dfbb010000006a47304402202610313b5cb6cb531d45c693b9207aa766d1d690e1c2771966517ee1ff7af4dc022068d4380ff8528654304b85dd7523c37d8cbe51b8a5b519e247dc779f108e381e0121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff026f060300000000001976a914120a5a881c997a6249a68639436d0182f3c6663f88ac4f988416000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac000000000100000001400591e679a2b9eef96eee67533dee3bf8edc1c26527f3cbafa02c1676f4e0bf000000006a473044022071764f8da2428518faccae6d169393854d986f8496006e8f011fd446ddb45f9d022056a2d4c51b720046726bbdedc9c8b2b09e95951ce864d9765d7ff9e1822e1ecd01210387c90a8faed32ed93d01e44a12e05d3bc15d529df77d3976ef305bbdb741a7c2ffffffff0286453901000000001976a91471873b8851687d8a5577ee0c473654dd93764ebb88ac499a4c01000000001976a914c1bc06eb3e5138529652d9d18b8412f5b6c6309c88ac000000000100000001ce939184b6d82e6b47c29eec0ada85d3450f235fe3824c1263eda0b9ed37d433010000006a47304402201297086229c9e90cd1e8770bdf51e94907c58cbef28fa225a1b2c35a1b79d03f02200c070389b12634f4057762423d68ee53a7dd48385c31109c5703f7d027de274e012102a21dda9f8d3937714ad760e3d20fad0bc0352efdf4f16e9985d5c82a01fc3b50ffffffff0288626613000000001976a914058df15fe881545c3bbf129f69e617faf759e27288ac60b31e00000000001976a914c8c4d8ca374f8e910a006b23e374ac0c5363376988ac0000000001000000012a432728bd16824f14967b49e37e87e662b5fb6413f6d90f51f11e11a1b93ba6010000006a47304402204d057825ea89037ba64fe4fcd0ce3b226681e0e122ba12e537496272d02a03b3022075eb1c3835940fbeca5cf584a33259fbaf467cdd0db9c091d14f25becfd7ddfc012102f6c8e6e4a8e169bb26f36cbf9c067ac0f1aedbc36a15d583a9c74872fce36dcbffffffff02db280000000000001976a91473ae6f70c95540738bed2e365719294f1582a06588ac62993101000000001976a9145d70813a21a27353b2d3db03a23987e7db23b2c988ac0000000001000000011b639963b1be1cab59fed358de5ee2a53d13044e474c7e2df71ae8399e80c452000000006a473044022007663db5627a975be28023e248e5b6bba9d32c41c4f671193061babd0cd2895002202a32b336ad7b7ed9c00b2bad21b3be306f7911db33247e94e8d99230b7d6b055012102fc059e7568b8f252823697c42754e37405633ed011a6945840d3df69e444cad4ffffffff0240420f00000000001976a914deedd99ceafa42f18a9efabe36b199741d6553ff88ac50bc1600000000001976a91439aac2d847449bb2886dff1801d105fa66aebe4e88ac0000000001000000018975ca60293156e174e184f5ea111e303e7f07e8c4e37564a60289d2471eaab5010000006a47304402207df7daa34ac7d4b350f31955998b66ef497cab7c7e6a82b44da8cc667cd9f299022044bbfc697c96d0773a93f85f1212e3581a281637ad46462253ce61f32ab40d68012102cfb36bbc29543de60f5904507705d73446ead91022c09e6f0c1f5aa44b5e31ccffffffff02002d3101000000001976a914c888e10324b193c191fed2bc5c25688bc44a168a88acf0601300000000001976a9141c4e344c2fe0f18ad8daa061254f7b9030e0393c88ac0000000001000000010ca82b63cc68cbe2f608b3c56b7d1c447b6a6f50ce6e4bb53d79fb6ced8059d2000000006a47304402200d182a7218d0059b5298446f34aedbfdaf6b7181f0065f2c269b29d14b9e4767022063d56c9c31cde707be4f6ff1e0cf2ccaed26cd06473d3c26c5a6472166a614ab01210323bec18eefbc5adeb1ae4c51720d1ab4fd3fa992ce69cca8905ba999f19ca0f0ffffffff0280969800000000001976a9146a9658b449893f34a8bc34f6794a11eb3d46a4e488acb1e92c00000000001976a914883b8c4f8db39d9a9ed0bdb9f331546a2193f5fb88ac000000000100000001b4d9712aa48cc284b40d8457bc68697d84133337dccaacce760e2213e634b87a000000006a473044022032696aa4cac783a9bc41457845b7c3a85107d3176f9820e4983e5dbe6e3072f3022056a58b2b5c2b60656477703429bfbec87ba724b20c2789f9b862becb6feb81820121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02a0aaf500000000001976a9144f98b9ea451a395a264ccba82468344645c8476088ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000013839bc9441a29efe7edf619dd8a97e412313bbd7aab568815e6b5da913762f94000000006a473044022001bdb0d0f44ffe961f8d9d97bf8579f14ed6f8e97eda6aa07ab4c95553ae82db02203d05135ed0acae03db89d3e2a57015d4d3f637c6c9e91d9d02dec7ca64715f700121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02b014d600000000001976a91438860090779c6df12ea41cbe472359b62957527188ac40e81d00000000001976a91464c84d28f1405de2b2287fd01154be54cabb2db288ac0000000001000000017de98d18f4c76ba8d889b9e5af999214fcfb828d2dc4d7a556d8934a0a4b5f45010000006a47304402206bb249232db0cd70373f18184d8a4c1ef5e426dea8bb33aba5f17d21001321b5022037deb19f8436b80d5e40aeaf5012bbc7c85dfe9337d8befa4839e3e9a6986ceb012103a84de722cf09dc208c9d4c6455125122ac8017d70f91642b24b2d0afddb404c5ffffffff02409c0000000000001976a9141b0cc0c376c49c75492a926f7c69a9103d17f24388acc8a81600000000001976a914da187fdb76af936933c75effddc08c5b9b8666ce88ac000000000100000001d6245ec41222161bdbc30a25b30ae84ec5c35e876e38c5ce0d9ab0aedbe30310010000006a473044022018357533e3983a84585fc82808c32ecb527512540dc9459ef74351d9211a45590220676f99e37ce755d8d4aee44c643dfe9613c206a023c59098fdca7f3498328285012103895bb384d5fa15aac61d77ca5c9c904e2778e73f798db89cbd7ae3d00a69324cffffffff0270010100000000001976a9148c129a277c19e5d934a48addb29f21897688960088ac7c506304000000001976a9143b31bd659ae233c28d55d7c2495132eed1fea69a88ac000000000100000001a9c29209863a5e1458f837b47ca4f7dc429e7d3d44239458ff36c464ed3e8a44000000006a47304402205d88bfc2ec466f24d80849ccc5be52daffbe70b0f21e3c97a174f539df4a290c02205429188f6b44dddc51b63bff1424c20333b38a49656c5e0be1dc57090337fd6f0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02a0987b00000000001976a9140147d2002454dd300ea73fdfed4d42176645411688ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000019c878725d330387c59cfee07d19a83adbbdec3c0ac557418046f7b083c32a24e000000006a47304402207c90d62431c5d075899594fb233f37b975cd122343c58c2229a665d4e960d03e02203ff2470126ba49114f65a2391548b8aa8bea9f51ba8006353932fa4f83886f5c0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02e0da8a00000000001976a914d0df323103ac934ebf7325487d7819e0536be9ab88ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac000000000100000001a3dfa355beb11b68807159070020dfdbe7c951239c37d1674bc0cf9d61d51b8e000000006a473044022001f43a46e6ed87ed912d7d95461f12cba02319f6836a30be2e2ce3a9bfe2e78502200417e8ed522a355698053ba02660b055ad9df67081a5fa87ab182861f498d15a0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0290940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac00127a00000000001976a91415225e873956bc71bf5bcbb758df50cf85f901c988ac000000000100000001362f60bfae5164401c0c75dd4fb42a95619c4ea6158af253daf8cb9617bc9730010000006a47304402204eb3023798ac6334ec59e807024a6286e93cd1e2317defa9c1b9bc913008365202202bff125a6a17124740c08eb8e3ccb4ccd9c3f17a8c10e698c1a8f12560129b6e01210226453444f4579d247f45701d28d344402d8493d960cbb8246d174de477dd6e2cffffffff0260160200000000001976a914c3a39075c2ef4847b676461e1807c606fc5072ba88acdc2e1000000000001976a9147ce6a0c88631d90e62873b07d5c9b35091eb09a388ac0000000001000000013ec41a0c5145806690113271c5d864c89f27c6bc96321545f5bfe72e0f9f798f010000006a4730440220508b9db7de0854c0557a3a7d9ad4371205195d07eab20add03a9418c014f706302205c0f3a80626edc3a7f3c7b976c7067bd7635d341fa23586019a111c7bf2a066401210347b44d162f2bdf68d9c5ebdcd905be8d6910758ba538d390bd05183bf33afbedffffffff02f0ef1000000000001976a9147a663e6eb9c7488d79898887281b77182e253a8d88ac95610f00000000001976a914169a70ed2484128636e107b10ef320cff9b9721788ac000000000100000001f47ac73f4d0e63d7189fd293e0949d5dd021f85b9c4d1ab0b844ada945ebd0b9010000006a4730440220040cd499e0a44d2d2df0335bb53a1f7e9e4061178bd905c2b30ff1926a45e86302204d542bb9ca988688f5970406aa32b90e467070dcd5ced8d495bc6fa745d1b6c701210348c1d88e355f243e8594a45f0b919f68858bcb7820684eca7497326c5eab216bffffffff0208970100000000001976a91473cbf98c252aff15695e4f9d42f9d9e4df2552e588ace5a12800000000001976a914f5d9ad5823925f82c103d0ba90417fe7451a235988ac0000000001000000015939d2c533142ee4b1dc8e5be6bf7b3e6bef078909701c4f69597dbb32b00448010000006a4730440220799c687e0a25d58aad1eae8949990ae778b830fdc35e27bfce7e22f41f3c04930220178029bf598a71184e60f2df8d1ee032da112d022bc9ea7eefa2143ccf69a525012103b9ab447400f3509c5b19d220416671591acd01d955beac7b68d8607abcdcd953ffffffff0230fc2800000000001976a9148361a238c19e141dacab43c755f73512f952df2688ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac000000000100000001b9b94b28b5fb79f09264a39c7a44cdfc36dbf66997fc1b5b9dc16a8b16f83f6a010000006a47304402207769e6f97c548f78ab11cd88b0a80235c660e56813c178896190f66c390c5197022070966fb3e84af80d917983bdf3251e539f9480a87e893a1b55c1aa1f8984a57b012103e88effbe55fb6ae6802367134ace6d88d9c9edf74277fea5c246e6b196a95059ffffffff0210757000000000001976a914c56a564bb34ae3b1b139116bd8ce6dde4dd0852a88acb4092100000000001976a91418e3c34da41da9833bd3d98756601d9719d4877c88ac000000000100000001e24ea0c000344039d5832a926a21f4f2c11cd0855f1f10f84345edcbc3a3be3c010000006a4730440220373ee04a6a4823a5a1310e01c8a677d477930540e582bdb20a4d7c60ce135d04022052d408278a5620b2eeb2af8950073e67d130fbc45014df30f7becdb75b7c32b4012103256a446e496bfd4b389685925049bab1987d285c94616b785eac65de38bf023bffffffff0254150000000000001976a914ed3e6bfade38f2743206a5cd8a10a5b6a9aab8b388ac849b0d00000000001976a9140737a6f9db3eaeee1ea900c783a9c8003a07751788ac0000000001000000018244d39664243eeb4d6e0e222e0e41011952a03b145e82a5a3243a7f2f3ab557010000006a47304402206bead8684510673fb8af96075c48bef4824405ad79f5670b524f64710d361e3a0220331692e74e98bf320602e04d7664d11d2e5583b40ff184f7b2267c1464e4fc2c01210314be789166ab5dfe23996cbae5afdb20a9641c630415686d4192a2c7855ad37dffffffff021fc70000000000001976a9144b479154b27fbb1ef2c2cd62d07725f62ef8bc1788ac42a21000000000001976a9141edf6e1e94346438616aac1a247a6bdf5f69f2fd88ac000000000100000001eec6b28b200b51f215fb1d64cadfe895c69238796d24e57c76f802db42053f5e010000006a473044022033594913ec763fb844e4e792957177fe31f0a5e64f87871e6e3810fdf2e3e97502203927013dfef64ee8dc773f3101c7de9587419a14bdf714a67f7f8cf42343d7d70121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff0263290000000000001976a914eb032b6fc0e86583f2165ff512c90601a8bce9e788acdc478416000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac0000000001000000044fe8bf1e8abf974e5cd797d674f11b69848e9be31eeb7be1a8990ae61748d7d7020000006b483045022100d5b385f31fbd97f9c365fddf691c652ba96315b25770daeb91a8fd33f4b9775802202225839d1838c8cca303bc680a702d33214ed8a0490f471b08758aea4a75dff2012103867e97da711bc1734a0e098e7ad607cf94c13627f36bdc999a9e66120cc9cb25ffffffffc543f1458ed2889e533b2aca47e4c1ad9152aa983101a7c6a4012bf29d20c065000000006a473044022060e67eec74744e2055216d3b0209d79416efd97fb3fe7145c9b3f2f779cf541f02205c0b8453e8e896a69e7d348ebbf9a07dd018451162fda398c2d6bf4817400dc7012103aacc2a727bd32959c735b7210af2fb12e4ba94fafc00f5b45a62ddc77e654043ffffffff259b894599246285c1e8cf5cd6af0bf1539e731b0032255795362bc5426ffb36000000006a47304402205c73640d083a736f58be23224891e4a120450b0e3e3ec64e297d05c45695e8440220396a489021d907e58be7ddc66deeddaf187d4c02a42ca1830198078ca7ff054b01210354f060757385d078664eff03a823eec88d786ef00c10b1ed2a87f1187093661bffffffff1cc772e46376125f106d2e57c018472e045b9c670f7f00987ccdc644b632da6e020000006b483045022100b22a66c0f290779c6eb0c3bbf93b5385a6e5995b8e5abb3077d700f907bc9e9e022002f7606d75782c5d5c2d72a761974681686128fc387bda5c9a05b3cb4d99ed66012103ba3e4d086d7a16c7384b68bbe6a5007973cf59314a4771e03a5c024aa8914156ffffffff088058840c000000001976a9148c17987ef8515a763b0fc5c8d18ab2a1fe240ea588aca0816a00000000001976a9147616896872b564c34fe7a615655474a719d5b00d88ac455a1a00000000001976a914eb3c2e6382ce0bf46bbfe9cee4853c032a8ac43388ac004e5205000000001976a91426f91fc06f0a97a94d87fa1769918d60ce2e060288ac10270000000000001976a91459d429605481ea5991bf64e665ede1894eedc65388ac802a9e02000000001976a914807ee6a16a9f9ffe7ec8f15a379989a2c26e16f088ac10270000000000001976a9144b892fa751fbf50feb8b65d568eab6868fe2a06188acff4e1e04000000001976a914912d1b4cf6938c6b663988762803fccd2256615488ac000000000100000001575c50e90197bec6e376cbfe74f95d9bc655ab861a46326c53eee10e38bb90df000000006a47304402206b62be2b9154747c463d06fdd01b1080be4b10e2f8dfef0c9c7d6b608c93f5c202205422b784b504b9c36613454503c08dc53c40411f7b35dee5b5f3f436e74a38f501210280add675bced763b91412fa73707f003528ec352ce8a0baceee49f0e8bfddd55ffffffff02006e4100000000001976a914e5b7f2a12bde034be7ee3a811863aa203979790388acdef59600000000001976a914a8dd9ece2be8a73f7b9ac8056e201c375add437788ac000000000100000001cd923dfe733f48fca05b7dc7d95a0edaf584a2124c3f6f9fc6325e6f52f5b519000000006b483045022100c28e9177d8bb4acab41def1318ce9d1f9a7370c15f428ccde9a40b9c26ec11f5022064148a6c05070be527d06ef598eb0cd7eeb2d8308d08dc9bc2dd5fa2df59aa0c01210301f8eb0b8fbf04e2042d1f9a67c217393ddd8e0a5786ab0799f69b85cd8e2ba3ffffffff02e8d4e002000000001976a914e5926a8340f621120187c5a120085f095af0fbbd88ac58bd6200000000001976a91412fa3c68f2114a946422dd60685a6eeff43301a788ac000000000100000001b809a5ec6b5635153b29abdf017856854e0579d8bbcf125fa7d1e3b2a1bcd40c010000006b483045022100a834c3e8b6367a16b423f7b0ddeaed033b8ac2b70075bbdb9505ba44b320eeda022059469dcaced2c69749f0e1c595d6ae7edef6394eacb9af7dfdd7c3ee78f8a860012102b1c6e7995cd1c951ed0715c45fa3bb2eff38818080e22818ec6797aa554f0542ffffffff02a0860100000000001976a9141f2bd67e8c7351d50b295ea0cbf2a93f4f7e312888ac60770805000000001976a914c00798e35a36828798f4936f269d34cb2fc538d488ac00000000010000000101031bd6a5c638968027f32485b49b16e164dba791b15b553bfb86e8c4022139010000006b48304502200d4ee27a2948015075964e9a2ac05c8f1696e306870a93d9accde31cac168b66022100c6c26358e4735fe64d69a94a919d01eb90582500550ef905a321b73bd8b9a809012103ed69e2a9d65f882c51ffacbc0b8b0c39c81f284e48ead9b9364f88c5378017d5ffffffff022c058a26000000001976a9149efb51d09cc05d61903bfaf672aef133b1eb502f88acd6398332000000001976a9149ecbba239023d289a75704c11d5e17cfc161c5c288ac0000000001000000017c591b324f18f0851e22081aa8af96f5f98e3cdbe740cb04b031c45367b5a49b000000006b483045022100d1bd33b4a02b17fb028b842106c35162d15eaaeed2b34e1ebad311231eae616102201fb9aa2ee23dd9c91a649479a054e19ea9c059ae9623a8d403607383923c3a1d01210245abccdb5ef077dc76f8662ff22c2068404c34b9c3dadaabd79eb886d0548303ffffffff02f03047f80d0000001976a914bd331e6e30a99525ef117b616ed49cfae24aff3388ac00902f50090000001976a91444d7af16f54b777e4f8215b6e2c15cd5a88b794e88ac0000000001000000015d72cb9ac0d2cfecb1c1d09f47aecf4e73ba9bfde1800ac89700cb3643e5a966010000006b483045022100ecada075f466137d7186ef68dae62baa4318e70fad19855b1beeb8468921bcab02201d6cd4aedc7372d8c364f2cea0479f681b4dcb7d669e32d77b3a6ebffceb48d20121037fffd97103ec85c3210e9f5616c7f271bdab30511f7cd0f789934406a1d96724ffffffff020a844500000000001976a91458f58831463e2831e462cc19fcd6006d5e9bcd7888ace6c58009000000001976a914ae0d4f86906d8b0301cf0f2d92c637437d07fbe488ac00000000010000000115d1c8c6bd8c4065c7b3522c7afd9970833f7a4ad2155cea7ee419735c2740ef010000006b483045022100a7e0db03ed3ea89ddfa62e22a3cd58c9709f8fb16f2f7c04c511cf0a2cffe2a202201e6aa49c8c0ccebb26e5471a0cb8fcc1dd6f8801b21ae31fc31f82d4b096a2fd012103c6eaf702e2e6d75d1d676ab3d6f2df2b150e35519d64769a7aa9530e633a8903ffffffff02b075570f000000001976a91482c2ccfe28d36fda7ffc36020147550fd87cf8ed88ac404bfff1000000001976a9149a7b8ef5eed97ce984ab24e41cc0cce19a815a2688ac0000000001000000012113593294a2f1617c3d13b364dc9cb315eb587d54b4ce89857634be280f0c59010000006b483045022100ec0446d7bc2fb778d9af8a8597565f605864dd8d8334f03b8a3bc0d59fe3b64502202cd77f88496713313b4980008317bd63425e3a0fa2414e791648eb1253853a200121020b2d562037611d73cf237e004391a5305d1e22d297d2d4a722cd40cf7f8bc7aaffffffff02c32d41d0070000001976a91426305778e2957a6b800e74d558d784b96632ef9288ac00e1f505000000001976a9144c9b0263d9daf901e3ee7266f915a162727f9bf488ac0000000001000000019bc0cef1556621342322257bcc2bafcef8bcd39d90f43f117fed7088363f0c3e000000006b483045022100e87c21d2fc85642df3d642edcff3c9a0c6998b0ef985d2eb3b5b7e10dcc67798022050f03c35fb34554e717bad389a5b34d6874913e14079d6b99f862dd57a684e500121020e8399ca26be2a407e62a69bbf0ff32024e3a50c9c636d8104f86b36d3a9fc48ffffffff020046c323000000001976a914f7cbb7d3d192b34daffe6cea712534b901efbe7e88acf093eea0000000001976a914f59902ae46f9447c3822af49a9171a2df185982988ac000000000100000001aee41558e3a87c47329a37987025961b205638ef711fd6a914ebe81a241e244f000000006b4830450221008ed0ec8ac6cad0feccf30caa49dd990d89b0a1f570df56dd8085f7048b3ccfd702200964997b99e83acc8d3c9a45a2666df964987177ae6099006e1d2fd116516bdf0121028a6afc749e14ba582650c93727d4fe611d7015413178fefb3a506b1e2cd8896fffffffff0280841e00000000001976a91410ca7e902937e42cb7ef6e95bbfcdea18048286d88ac7102dc96000000001976a91412bad820a3b1e87dae90d4e7b1128fd02beacbc788ac0000000001000000018ee61f2711348d857733082fbc396a8a8cb06669d0de985f8709162bae798ee7010000006b483045022100a2935121c07bd5a967e0ba188d553662c79ac64e1302e482a6232ca7d586b52802202c4af7cec1aae7362f214a9f5222d5193650191eea8cb7b5c0e6dd2201e9329301210229cc5cad1c5c362008962dff2ae1843d80f4f80d046f73fab00b19d0b2a24bc0ffffffff02625ba1c8010000001976a914d05e54da9bc1d4087335466051d7baa16e12a66588acf78d1f00000000001976a9148abc4f2a097717044df73f65f89b43793185788888ac000000000100000001c7a0655d3faac9d3d4baf72c4c3fb40f20271b5405a303955e79933a4a0a5d5f010000006b483045022100fc1435ab892792e0ef0deb7085722b3a7af71384e46d469da09090bb4904d59c02201312a97096741fd043f62bbf84be13b18383ba1972eb039e56596ee33ae04c36012102db976aa25a148ebee43a9b894cacd78bf6be9a916d9297f06adeb56fe2d2f115ffffffff0256296301000000001976a914f82eeca14644c53055d956bb00a1dbe8509f05e488ac8a6c8004000000001976a914ac8b57bab2e186dd81fef9b2b488ef8433d41e6188ac000000000100000001eb4ce207aa6fc891e2d5ba5c37ff47dd43829446eb29cc012ec4645263bd6b84010000006b4830450221008d796aa5d4d05a90948fb1dfc5e92d44d845e313f3bfc09f211f6bb969a804ba0220584c5a8917cba5f3e0bd12a7d9a394f8fc4b93ba79c45621c93ed938c58ab9090121038bb694bb23990394c01386ec22754308856275eae55078eb04347cec36a31f00ffffffff024d94f002000000001976a9148417f90bbe6ba0d5c30d52b3e164035a32c207db88ac0e16652c000000001976a914cf4193d4cd88947e75f87748e09e8c336e4fe6fb88ac0000000001000000011f391a5423820d78a12b159dfbc90f4f994852c4dfee9378b127ed4055e27173010000006b483045022100fee3bebc0d0725023cc42fb409ef7460d29c3deff52027848fb3726c1a2726d202204f3a9bae84ddd00a7c323ab81b490f6762914ac115f962b3d3e1b5bc19cd49510121030a8db54c488a62b3f3c0d9d69aa47267c3b9d002678dc334452df65828aae731ffffffff02749e0509000000001976a91471fd325d962517343bb871b4cf4478e8e2675b3d88ac2dd72115000000001976a914241517c84e278f88b0776ca2b6b7b849a506ce2288ac000000000100000001af05edfaf5b92d20d3559620c76f10499d8e8affa88ecfa4302924150f7662a4010000006b483045022100b8fd166f0eddee447e70dce6744f2839e5eb1c0d338c741bf48de559805465b20220273b0a0ba1941f0bfc1b421f7a53795a1f687d978603c265c0d8f1857b865c37012102e8663cb69e4570ab028182511e04444d175f3f2e3987e74fa8cdc3356ee69c9bffffffff0280b14f01000000001976a9146d6cd0ed8776c867aed1209a7b6d7515f7aa55a088ac60361e00000000001976a9140a0a386267ada33fa306c1ff068c6efc37355e8f88ac0000000001000000019a6779c9e474b79c2c34133d114eb061d05b14304e5105e1f414d808c5f880ee010000006b4830450221008b5a2aa0de2f3c2de37514e29299c577fbeb745acdb5b6228cf2a4ccbe40960f0220146cde08499995ae7d0918b43749e725af75d7b0d5ca6aa9a4da3518710c12b90121024a154aa3e9da28830f8977e3b8cdd16f105eac7d9ca5e1729e8072dad0db1b3affffffff02af6b0637000000001976a914607e63d78290810266f9f0d4aa5e8ca21491150888ac3ba4ce13000000001976a914ac3e63be0413dd2b7645fb95147666df6ec39d1288ac00000000010000000166468f20bfdfc74b6a41422cc2805556d17e9167170e2ded718044d6d6fd80d2000000006b483045022100d863c33c43f8a3a856305c21478ab1c3d5f109dbb11e2ff76c91f07080cb393f022014797e90bb0e0ad833239fd4bf95dcb06a6317b2e29006f9cea1e23da42ac48c0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02e007bc01000000001976a914972c4144930ae77bb164ce37ae7510353405c69388ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac000000000100000001d101b087484390ba48ee8b2d755f70eaed58e308b70fba155b5f38defd0a48ce010000006b483045022100c9aca125b1e83bf8299f6ab156c16bc8bb40716f6d7b20757c465e997367007a02200cefd62d68abcacf0be673d0a386befe69f7e094583e5fbe1152f7fac44de0b90121033f0e0230910892dc13665f6988785cab141579dfc9fea685bd2376e60d59ab1dffffffff02a0860100000000001976a9147d91e2a66f6a67b69847a1c819dadf79d1f520e388ac106a5d00000000001976a9145f7ae8efc124fcb5971b0cf3c1c13736c6411ac588ac000000000100000001999fb095b9ada6d16cfc5cebc2d846573472272535ce5df4d45a069a4f9ae52d010000006b483045022100f9a1956b9165a873b323b896f1664ef5a011e6c6cae6d362ba015298ac405df80220558d3d5c3603a32111beb8c09325a8740f76d848320ea24a06b34b7a69231d720121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff02f0d20000000000001976a9148af0f7b34c79191af3c1e3d403369af8379792e788ace6535229000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac000000000100000001b5987727f4f1faac50127c3cd6faa8ec5cef04802221a3df376c5497a5dcf97a010000006a473044022021f367a4af1ec7b20b4afd4f9bb568be1820b37f248438e38b4db9281ca0e34802205c8aa4be2d3b3c603633b37c9e7cd3b74698a1677557736dc27a1a9ca81a6c760121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff02e81601000000000017a914916a8b61fb7ea250a068c48c39b54025fc283d9187ee155129000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac000000000100000001c7d3f93e6064bb4e9730058a4ae9ac64d6f3cc700da0d9291a7e1e6c6f2ace4a000000006b483045022100fa0a36cd452bf8e4d081ad7caf99e3892ed01c77fe1b4ca12d6a464e00f806e5022007211515644ed8536a3072b60c613da64d671bc45af19270cd63d2921be12b8b0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02e007bc01000000001976a914401c3d5df57db5895b4e9f5d4909bdda3c19702688ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac00000000010000000149a6d1c09d28bbfdfa44f85dbb23a645d2ffa14f6e35f29568fc8e6bf31f754e000000006b483045022100a91fa6dbb0aad004d982abb7d18e015691cf6c2becbe048db0840648ba4f9f130220288b20b9d211912b58552c3ede7217b594decdedaf584dfbc1f043486517ccee012102600f5c7debb32fd61dc607fbfd2bb91438076f2f1e2371421656e7700fbf596bffffffff0250bc1600000000001976a9140bfbd90393953d94e2febe64be3346851fa03fc988ac7c321700000000001976a91465adfcf6df67bc04aeca17daf55abe22d963dd2488ac000000000100000001ad3463882aa18cda75cf581bdd9467dc4c0f8403e358e8e9f70d1740ae65e5cf010000006b483045022100ed0163bc41db8d569027aa198b16007ffc54ef590fbaaefc1213c805deda023e022044bdf2db968844b7809a9577fefe3239ba5a1dc29454d30282a802801c755bce012103d039e3add28083f402c3c643bf09d34af2c48ebba585c878a810860a53e8ee8affffffff0214700500000000001976a914bf33c5bbe3e714eb8b16bfa4604e77c2e19ba81888ac890a8b01000000001976a9145e7f4db40e540034f471b263613a76fe1eb59db788ac0000000001000000017bdb499287c0efa7c96fd17ac4736b2ad3dba4ff61b3f16c4461c70aac5e9290010000006b4830450221009c9c07067b82128a244d42fbd00b6dc5265897d5479f8fd53ffc32aaf154c117022076cd5d5eef590591711e4232b93c86e70d3bcafa4f1d3964fa682cca69da12a1012102b1b0169d96986fe9fed4cc7cea8ba0085d9cce8f22988f3db17b4b209dc38a30ffffffff0281030000000000001976a9148cd38391986e6109944bda6279909483c628cd8e88acd7635501000000001976a914d0de9b4bb9eba5e72e3655431657f3ae4d438bc188ac000000000100000001c88284648378a48a69954a1973952cb753efb7569f31ff221549a8c8d6fc5ee6010000006b483045022100b75fc3429a5e1ed1073b8a4e8132742b445e175d3de32dde8f17ab1311e9f17302202440cda157673a519b1e3596e203644774258ac4945aac266eb99890c890ebbf012103b739f933520ce207c4840b59614627de4eb493296e3ba5aeff33c3738dac33dcffffffff0280518800000000001976a914adc01a9efd60ebbf30c7e6bc2d2bdaf27b5fcd2a88ac80052500000000001976a914cd9f90fe5b4a0003d0c55b56a73a015647e15a5c88ac00000000010000000169a2c6acfcf811ad5d11fc77df1202c53309d09c6120979d90d3534249d46563010000006b483045022100b6679d434f227c1f05567e0cabede2c198bcec5ac780fdc366696585339fbdd102203701843468bfa9e6e5a1593e06c3d218cca9d7d9e95a29bcf14bc45bc4b87c270121029907af798eec9e9421b60634190a0c4e9e2259fd48c45852fefed5d3ed5f3558ffffffff029fd45f00000000001976a91497c5026d2a8f79d11b285e717743168b88f3c0eb88ac0d74cf00000000001976a914433dcec802a46aa475acd7156d960b105547261988ac00000000010000000145860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4030000006b483045022100e2dfe807849295fbcbdd637bc21d3ae6fb5c54e522dc0bd29926126d4fd3dc46022010ab51482b93e066ad7946bf4c9bef340600aa8b108c19c410554e3edc351278012103da29f6e2cc099bf603c50305613d27529d6e2a8a0c7757dc5b148fe8001c1f7effffffff02701df301000000001976a91467c87b8159f81cdc289edf19cab8f3b80a26ded188ac809c0204000000001976a914e09df74c9e44a71868d090ee25ad347c01de3ee388ac000000000100000001a937214679c8aa6b79e385a2f722e0b3b1046286ed28100660ab1bfc3f1a01db020000006b483045022100f2805fb32fce0304763b9a7394dd87c86a21862771665e356aaa3bfc658b203b02200b3a948f51bd115225b5cbd69fbeaa6635316d97a2103f78f1da6245a5968846012102e637ec08527bf402a7356e01b54880e7ee04caa3a683a40d98151c59be945541ffffffff02890b7d00000000001976a914bf7dfb385abf4af5ee8a2f998c04e4a8974f745088ac92f60500000000001976a914ae79e277ea067a9b2e14aac28489fbd5a6e39a5188ac0000000001000000010c9a471a31f6119cdea16b9191f781443f0b27842dd89515444b08033215c138010000006b483045022100d56655deb3e8bcf8cf208679372edfdf5f8d399dfcb2b3e4fcb7143f3abc9bd40220267821c57cbc752ef3844ff5a46c76ceb952024a15a240ceae61bc7c4dd297f0012103c123132d3d4c34c32bde4c26a2189639fbf7a1ba2e670cd1fe393a053c3f6528ffffffff0258bb0100000000001976a91410d74808df150bd217834ecc14b486c55834120788ac82baf600000000001976a914653621945c2fe1aabcaf0ff6a78cc815d877f9f488ac00000000010000000140ff2efd341fdc43c8c5e88a45e2a3f28234f2560c2497d8b0f87b5469df7ad6000000006b483045022100ce7e10fc5fdb0714659e2ed0ced29fde4e9a4a42ceb5257919d3a87665ecf39a0220624524f12539c5f4f4c97cff2df7d67b68d3ad3f0077e3db6602133fa14e4dee012102f808415e680de0148c07c4db4d2a2226968799cdfc4c9d2decb20c67aca351bbffffffff0240420f00000000001976a914d55ee9a20a19bbbf0f8697a51f40f19b869a036e88ac8bcc1800000000001976a914d0eb5c01dbfa363f9750774c5b4f10185e16283e88ac0000000001000000010a94d4de728b23dc9c2d996eb1f272c048125cffc5f70c13f76aec0203816c8f000000006b483045022100fdff65ff849b67e0906fad9246bf8432c0a82d947246241134a192e6256f6afc0220693e5bfcf2eeb1d0c95e5a89dc1c4ad0533404e14c50bc10e4af4d778998c44a0121024bb96b97b76402ca4eb828d41a5da5f25d6b60a70af62c87f52f0139a0247e46ffffffff02307ca20b000000001976a914f0119d3b5391517b8781066872a06aa3050801b788ac60b31e00000000001976a914dc7e4de11b932d81a4425c796da2e81149d252fd88ac00000000010000000170bb356bc6f582587960b82b5cca5a522a04763265fd823c5b28d0ac708ff091000000006b483045022100ba49cc3f1ade7351e1b53d3cda164c7eb671517aaad968feaee36531121d6f7e022014d021d2c34827623a8b963b6277d07e6459fc6f4b12fa983656647dc0d5485a0121029d9eba916f8c3d91587a7cbd42dc4fa3e0f04c9af02c733a64973c89b387534bffffffff028396a800000000001976a914dd5bed484d1b593e8e5340b3b066815b042f70af88acf24de002000000001976a9142aba685cf139e6cd00fbfd919e390a4e7df1ea6088ac0000000001000000018a2665aa6e0927a151efbda6d01c937ba54f09c26e6c319cdfe18770493dd48b000000006b483045022100f39120f6b631d770f8d95a19343700356bdf12524519fa8095ec188e3da95af5022057dcf5d7cda9a332f8b753bce89cb6e9eb30429676d090310ff8fd0a5ff112410121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02d0de6801000000001976a914f0a2f1c67ef4222ae52a14877e8503264d6b387588ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000019f8f6f46f26a924dffbfa7dd7aec6eceff93457610e2b1ed688c95d878ea7a77010000006b483045022100fe8dcd386a7d084022faa5be4c5b927eec4b88e9bdfb8c4d8532bba02bbf594b0220526bf62b738ab326a01a221ffd4a20be0cc88199f7b460188bde33fbf24608fc012103bca51dcc46680e44bd07fd5173d8a794b8af1d6487d504d33880c4a0ac19b48dffffffff024aef0600000000001976a91480cc9eac1269f098ef3cff22cefe9edfd768b01e88ace3c18400000000001976a914304b7a9d53cb13eca39e5f690b0cedad07bae9a688ac000000000100000001776771b211f636b2b11d64c885cbc8dd2f8a70d008f0d44591a9ce65877e132b000000006b483045022100afa3ca2977bbe453982832bad4d306231870f46d8739f7b754f358b63ea1808a02202b66c10a698dc1c659051bb94d30655f58088ef622afb5971dcdd76d6ec697700121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0290940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ace0da8a00000000001976a914204fb49a7fc7ebf05deb1b7f0d556c026f4e47a888ac0000000001000000010e255176480ec25a43687568a2c3649c5c66899e0087005cf57d187dc1eaecd1000000006b483045022100ba76236d62f2f67b84bcee6b8c7e14eb1599c47db0179ea0352504261ce339cb0220415985b1c41c794cea7b4045d6310dc7d5f26eab8c015bf534ad26aec2c922740121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0290657d00000000001976a9142ccf5d8ad65fe734d5d99a7cf308d2155caf7f2588ace0091b00000000001976a91438860090779c6df12ea41cbe472359b62957527188ac00000000010000000177f2464e93eb488326437572a0b56fc9d30324c537262d66fdec9cd9e290adc6000000006b483045022100888fcf82556583eb229f627deb78fbd639da3c2697fed0d00fdd3fe7256f2ce902205c2fcc1e91fdaa59a7eaf00215a8fd2c6a7f2fbd91e2ee98fa75cc2ae580f6000121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02201d9a00000000001976a91489def75a8fb788a679f22dfa5345c9f133ea574888ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000018151a8ff35ab872067c2eec721a82e5aabaed5945273d23d8a8a2d333b929eed000000006b4830450221009cd3a7b001a4d2855e4f36b16b4f868bb76bab7e6e1c59c8c15bd232c98ed2d002203b4196bc9f7ab29e7645f9cc1a07ff20f574c45f981ee42ba3eeffe1f64aa8a90121029a53ad741219c815f012e960f4405d18f3a1961f7d649ae81a063a2487c22d6effffffff0280841e00000000001976a914d5abb8ac00c6959c378feb148323b98bd49541e988ac18c34704000000001976a9145b549868035856dee5145b75d27beaedb3edf24f88ac000000000100000001cbbc4e573d773a6165be372ecff34dde39d9e2f7deb7715a2ab3faaa2f8df8d6010000006a47304402205c3a1bfebeef5bff09e9c63327faf69eee827fec5c77a1506f352e57d130dea90220354e4c761042fb2f8f36fa10ada2a7348ea05be39bdf7d99591d94c4e85fa6b4012102c57c3b0a8d3bbb77cc99e148fd32310f5528395126965fec8862679c8bd327efffffffff0280841e00000000001976a914ff74a935d6f5bf9c149f10efd201b7fb9983729b88ac88172904000000001976a914b07c5b35c954c7fd3b2b39daba0df3ef46c7c34188ac0000000001000000014861b3b6a2737b62efb2d5a572921fba6f065f27ec8b74c3b02582c6e5c8290c010000006a4730440220070a23849da7f0f58eb77c025e32ea5ebcfd5c33bf90bf97f479cd49aca3167e0220225d2211eb93914ca0e484dbc9f502e8eb4b93a4ad638d865a97d6308f8afaf6012103e86ddb6fe3df077d839e235730c3818c34125e22b4933ea0dee3561b96533c19ffffffff0280841e00000000001976a9141c41a87d9f581de62a1e7e0dba682bda0383a71d88acf86b0a04000000001976a9147e087cee0c1b74ec718e1418a4a5a5d18c1e08d188ac00000000010000000146da060e9d8586b8b46c684ac68e38a9e37bfcfda8867259b970a424719b2688010000006a473044022032290d6078896c1e58bfeca1f9eaac6cbadb6ef7f9237e21ed9509bb77c67b7e0220669429afe7508b927ed0d31b58740f5e7291ab9aaee5a36534eaf9fb0296af54012102dde2e50ad9e2c5b07fed6b356b76eaeadfd7dc8cde2d868d4c548bef8112aaa3ffffffff0268c0eb03000000001976a914f819c43121750389b394011167a2282a2796398288ac80841e00000000001976a914160f442aafc9e12afe54885c177def530b765e0e88ac000000000100000001cd24089021d9b6261c2052df521fb512adbeff83b7771d6c20176e6967a204d4000000006b483045022100ac02d3ca2301104437335700fc7cb32cdd3b859c9313e6b5ae33f8de89c5c8b402205e60660f2222b09f1727581031391c5dae59412bc46bcfea62459119db9e15ab0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0200127a00000000001976a914cf09ea4634b5bb96c82c06cb97365b5c5f84d22588ac301b0f00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000018ef0a3ebd97f4d897eb643b27e4cbc17233a441c1e0a649b54295438ca18e529000000006b483045022100ab29fd58ee92015b6f80419cc54b879084a32463092b6d6ba5c924e26b26914b0220479ccbe3cca1cef5b86b4cf0443f0a4fcf7b7e50965070991bc9d606efed928b0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0290940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ace0da8a00000000001976a914771a7d1ec15ab698ff58a98eb2fe173c926b22f188ac00000000010000000155eb18e2320fd5a1721b90ea70871bb5eb82a7359fc8acc56e6a73919648771a000000006b483045022100986fa3c5318f63d4a852826112b0bea467d882215e38ad30aff53abc8e40e10e02205bb2442f4f0f2b88b86b2ed181fe0c61ad1510f3df91e7305b594f2262485b6f0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0210df8800000000001976a91449bca11e088295c20333dea7c5e8a70b3063c11188ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac000000000100000001816a8822c544a2771ec30dc0425e82a7fb7bf4548f15be7a74ff6b0545836cc4010000006b483045022100cd04d829ff95186c10514ef6fe6723a2a758fbd9539de877814404920f4a810002205327fc7c8e9d07d2671255f985d99457ce9998e9724b9841d6d8a4605664d6b1012103eb20647ad0700e4a20da7674bb7170e4a8b5b3405ff0fcd7a413e42fd6206871ffffffff02b0bae400000000001976a91401f891811089303fb4e907cf55f5b73c49c6caf788ac60ae0a00000000001976a91447fe5849bc4370a754e94cbe4e926ba407b0ab3988ac000000000100000001e8a910fd3f05638d439d1f09338a1df10844a8c305d3de5b2518222c5227eb43010000006b48304502210088c7f1417ba7af6987323610b0c2e922383fc571c03c88e995931165183eff72022056f781eb850970adb80dccf36f3814157a5957738052ac543260f97107a7763801210287b7cf0dd2765905d7e5dc4b30474d21837e8a1ee462dd12b5e16cf75d319127ffffffff029bcefc00000000001976a9147c443d62b0cbbcd3969538dda04e56f9860d0dbe88aca51d5001000000001976a9146e85c2704efeb3ec5064285d9b2406f70fea90fa88ac000000000100000001fb913c3a335f8253c20c149947fbc3dda67cad293b91580b16005b7d164bc403000000006b48304502210082b5bab93f1a35d265c6c6cbaa620810e1cee2437e37a1afc2735aec9249b2bd0220790bc112a0b4d0e9da60ff7f5bc645f15aebe0edbd630ffbc393b8f762a9082c0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff02a08f3e00000000001976a914da81d3fa9fd322983ec7e43bb46eda0b0f1f5edd88ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac00000000010000000139da200b400ab66126d8dce55898b8c290c44c797e40597f2dc737a65456c3c3010000006b48304502204a48960591c0472787fafb0ede188ada633b3b70c08f60f25528f6ca915b0ada0221009c9b7cb24a7a0683816c0fb42bbfa4878320b628228573dcc7a58a3820528aa0012102ef66fc53d127bb10e6571c8881a18271c10d039b380fc99e16097353f9236630ffffffff0241b5f900000000001976a914dd20a8903341d9efabf7df4f7e8bfdca05c133c188acba808e00000000001976a91482dad6ae232c1b977ac6416e4acf758d29480be088ac000000000100000001a57af39bab4187ea4c528911c92115f4a297d42057a1c8e569481f8604c85567000000006b483045022100fe9987ed4c19b6e5db66bb1be8ebaead78e0624756b637433333043e985dfd2c02200366453469ddf0db4913b74925e2af60eb718b05cfbac34b303b4316e34294a40121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0290940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ace0c81000000000001976a91451c5d817051928f8ab1330918cc13eb3231fb40c88ac000000000100000001e6da3293d3d761d12f1df1d2efc66ec77be0b37a18a2f0f239104db5b9e1ede7010000006b483045022100fdcdc80ac4adf4f40e1a4bb5817678852a08cbb8c1518b02852ad742d94bd186022066f67b49e6c2ae974551022836c44066e16458231214ed87e6d7786bc23943d9012103895bb384d5fa15aac61d77ca5c9c904e2778e73f798db89cbd7ae3d00a69324cffffffff0239550000000000001976a91443c2498401e674923e0e82e5edcec99dc824077088ac33d46204000000001976a9143b31bd659ae233c28d55d7c2495132eed1fea69a88ac000000000100000001b68f38680e7ea29b7c1c52d032f2b91b99c7d77373019f9653431ec99bb58cd2010000006b483045022100e0d7ab075d1767e38745cb16d357bc3ef140f07e40297f0660b57b277909140a02205f8143a000f2c31ce47dcb2b36ab8490e2505243a1781d8a4bb40d44435cac350121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff02c0270900000000001976a914efa8e9a2e71650dd9816a775274908ba460502a688ac0cf97a16000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac000000000100000001aa2b9ff72f22db58e5c45b13c26846b0d864862b4e448c6fdc37e26235000d83010000006a473044022004aaaaba2b6f5b0d763656d8480f835169f28f3020ea52f728074f99d1fc7baa02205e310d11f338eef22f0d8965c5a1a6e3c3e48f8685d4d0330b169512d2da02710121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff02409c0000000000001976a914134b26e10583070eff5f3164bbf3bb570fb9dfd088acbc357a16000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac000000000100000001027664cf2072f891cd97627185786e5094b598261a2826846dab1e0d9d2f07a7010000006b483045022100b3c87e3dc58c8439dc8ac8c46da9da2802ec9b2810c281707e0306cd738d915602203a9e6746df994e9666208d98804f95d17c4a2ab1a402a903c4c1960b863049570121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff0220a10700000000001976a9143bb9cdc3ece1474b65eec2bc03397cf8fd987b7388acbe4d4929000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac0000000001000000012478e42e89096f434077404683aba5006ef39a6e7cacbea9e6edbd5b61d7eca3010000006b483045022100af1bd66374bf00976a040a0b0de28786759a3e5a12f8bd689e0fec6fcd032c4a02205903134193bda1b4db186ce3c8201dfea3ad07f8da0db3e79c2e8d44496b47d00121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff0267e50000000000001976a9142f303f7bf98a4dee67e27349122f4fb722282ed688ac47414829000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac0000000001000000015c192b5b837ed9030503bb869c8e277a706f93027d05dbe31794cbd24357081e010000006b483045022100d28312155f33af5157cb2ad7b045679a6b5c4d1e70e83e56ea4bee40681824a902203722d7f4b948c02bb5416cbecfb5d08a9e58e2456a83953363b8b8955e297b450121035f75b297af0306a021e623aa339fb1e07177b75573021757a789189bd4331b40ffffffff029e472200000000001976a914643e406ad6b41600d727d7763877a7de2a4d937188ac99d22529000000001976a91408ae76736aaff6f278745818a018bc0f9273b90088ac000000000100000002352e9e691b3c14e6a50eeb598eac65bd80b6a6ba41259e342af1d3a27217c1dc000000006b483045022100ab046930a42b7b1765feef18445a85a43a64236e55f9840308b3cc1cb96b142a022061a6e5982159b449069240c37bae804cc2a41e5d2c8057cabc0ca6384a25f79e012102e898373018aa6062bec933518f4f7bd6f71b1e21cd7aed6158b544a6af28fe3dffffffffd3395db02ac6e4f02ee89313a7e2da1a97afe48add0a4e234b8bb1723a4aa511000000006b483045022100b94395a3594e5653f7e84302ed01eb3e37ccced20415220f93481ef94453c98d02200c3974d68ab587a902c6794d2206374bd847f95b95be270adb2a07bbe8acc22d012103a9374fe2eb93dc73e63c29d46493341bb5b64ff89c44e196b95ba5ad599028ecffffffff029d9a0f00000000001976a914e71eff250b0630d79ca4e263630e2c61dcb6f48c88acfc4832010000000017a91471acd974894d1f213668016a59f73882392a16038700000000010000000190a7b1919973937bdeba4b3ded04ac1f4a586672cf13c41abca5b317f22f1e8900000000894630430220383461015d8a61997644125f8aa32f6a47b7f1883a26ccc87a5aefa60581c974021f3641c9be6ea61d349466e5581e95fb7687455f8fda3f54a3dbcf693d50ddf60141041bc774d6ec28fa00003f7994d75b16b4e0c3fd6a375ff316ea22f138ba965529fcebf727e6ab36a67c09e69e6c16508ca0c7dd056773f45df9d54c2a12f9b4cfffffffff0200dd6d00000000001976a914e89db39ab753c6d07da5d5992b1105941cbb038188acd2ca5300000000001976a914aecdf57a5136ff9b91e780b35aa36e683203ca5588ac00000000010000000163ba2dc09b3662d6920e6e44675d3623987b7de9a7674f6255ac95c86ee24131010000008946304302200a720d6f3238ffe04fae0de67406525fcc4da257299edf8f037ee912873d9197021f59fa66fa8769a8ff042177ecb8b7776dc5d415a997543901a91c2f6c3716d601410474235a4e0b3a44ad26e46885a8825b943d603f4d28f33abee31b7983245b97627848daacbdb979429921a1788a84d154c64dbe071fcdab4b28b355c04dc2519dffffffff0274be1300000000001976a914e2678d43a48793d5838e2664356d2529f3e5b53d88aca5684100000000001976a9147da1b8948e7c8ee47b5e8689f7ba3c55da0ed6f588ac0000000001000000017ea8f3cddc248338f29e4124c64c337108cea33cbc8503255df96b29339a59eb000000008a473044022069dff4843a106ef0f9349cccc5ac214ec78295b57ec315967c65a13532155a6c02207c06a3aeff15b4dbdaec2cb317080443f30d23acb0be112223e1efe2c7d5592e014104c3b032a654919bbadac9e22c3ac28c6fe5aa332e1f4611cc74614c3ef9eb766e358db4166687d57853ded01a7123cdf6bc17194ae6ff33b4d2034143ffdfaba7ffffffff02809dce1d000000001976a9149521b4960ce31e5f6010ac07a6e98778ceedf81488ac80d1f008000000001976a914e9e8b70f42f21748503da5163cef3bd20ed85dbc88ac0000000001000000019976607afeace5a527f482470379f258c7f2b3769ff202a6705aab381460dc16010000008a47304402201bec49ff689c3644e6260039ecc1f45911cea3d53a1da1a312688bcce97f1e8102206e04074ce7b747feaad9a2f8b2b4eaaf65400115afb73a333632bcc399a379c301410437f693a9a0b48248fe108dd4453a247657d58489e20efc07dd8e1175a3cf8e5dd7d62b61d4030a46c43b077d47629e6bbb0cef82a13fe64632752551885d9dcfffffffff0200b42d00000000001976a914a20c5773dd11c6138cdda12cab6339888aa8eda288acfbe45902000000001976a91489b36f026ab4672b2bb81811a8ed5b56d8bbbd7588ac000000000100000001175aab3689286f34a4bd0679ad47a3823ddedf4c3e24fb8ee670a1914bf38ede010000008a47304402207ffd0790c6979f3eaa3af0168f69af5c62206028093ce32373e460481e087cd002206c3e48c43766af4db76032ed71fac5370af4d894645ebf0540544b3c577e70060141041a1e02b6552ea8edc143580df651dc8c63c7bb5f712bc40c2b74a9cca8385bd7ddcd1d4f1bca9246837ae83e9e65351b1451c55298b5306382fc99f0785bcfebffffffff0260e47801000000001976a914a93411db6c196477f9874feef0ff040f2a396d7088ac30e76401000000001976a9144ce1bad2cd7a8f26576247f20e6470c7a449749588ac0000000001000000012ecee018ad8606d304b68093a93d6ce29f2ff72e7b0123148ba365e8f50de214010000008a47304402200c024e29325beeeb051afbfd8997822eea0e847e28f87aac7e87d4821c33f152022023801fb4b03256ffa58382390484b758599424df370beb1e0c06eefd6ef20ba20141043cced1a91f53030e27cc77bb5b4d09074046503eb6b0b421e8d0fe962d02d20f22a3af5a0021e58548306a2a14ad8bd8875154ae25dcfc3f05a894a0b312af95ffffffff0267b9ff03000000001976a91489f54e6f4834e6e9af1133e99e894b75ce92b8f888ac8e212f02000000001976a914e880d0c75ec4e0b1706d77c95a2861d8cd58941d88ac0000000001000000017cbc8ed7364ca984459cccef1064a1539a87f08077e68161fe3edcc83fdd334c010000008a4730440220184e1493750e12c0424b8a24cc5484861e2ecb5082e4d01f10100b15cb7bf4a102201a8f90350e74fc6b89fa09b990639b30c996810b3638cf4aa6d5cb387fcfcd80014104d7cca46db4d019050091efca2ddb22f84db422ddd3e5412f5047d5f164a03fe4a5f4921b117daeee43b579ad45599e7c9f6a0f3868ba3c14ac3425dc777aa446ffffffff0280c3c901000000001976a9140f435479fdd5915f30d0ec53956bd8f9df561f2588acda968e01000000001976a9144f4c3c6c608695d000ada658741b2c74657a992d88ac00000000010000000161f13dc990094509e7b42f6547bd85a5627e94cd25518dccaaffd04742719141010000008a4730440220190df8b356f2f818201efb0adce267a8983071307ec072e86a1b32b029b50f08022060696d8a18681b6b03ff32f7441f4c57464c7ea69396c41c6e7e1439d0807cf0014104a47a6d2cf0b0ea4378cf6bcb220e5a1e6540cc79d7aa8159944b951bb50de16b694e9fff7de2f82607498b6fdf49637b27897e75ed9fa9b37383853dc9fd2f6fffffffff025acb9c01000000001976a914c6e272e758974b3e62f255fe720d3433acf625e388acd0c5a30b000000001976a914c1181de3d914815f73488beb833ada384df9bde588ac000000000100000001915d175b7b4c984fff3fa34903f49269e70ccf53756469b770e8d089a2ae38fc010000008a473044022047ba8cf3423dccf745dc2d3ad232825d55142366c128a19eef05337d57f9a4670220588914eabdbd27390ea3efc2c1d3930a1c779f272a6ef5d741c71617181dc7be014104662d123f77c12b85cd810b293a8feedc85d0bae17fd7b2828116f83d74ee7949f874319ccf04d555f39b4eb39bcf06f0a9aa8e0c8f9d6a6d00e3f8de141fdb09ffffffff025e762700000000001976a914d95fdf3e2923a6e03d575d60874e141c2b095ab288ac99ee5b00000000001976a91418ad971c9a4b43a3d9b64f04d95857243b9200b888ac000000000100000001435fda4275f5eed149f1583d9b8fc8c241fc3901049f85323a909b47c7fa718a030000008a47304402202b98cabbd0390519633a6b98bcfa65d7e39a4fa667ad8f8ad41c65cf2b44ca1f02203fc590c6861273b7b6851a4c03c5ec6fdfc1b3667f4b1db3a3928fd9996871980141043bff7b473684842a592c4e3a525f4fa6adf4dc9283d6133ac1dfb9d5faa83605ae3a7fcc9ca4e18652b2fcf30ef8e6abad8dbe11433f3b0405bb8710583281aaffffffff026cda4801000000001976a914d86d62ad5f079e0b2df59f3d6a8a9791e401e7cb88ac044f2b00000000001976a914c75b5885ab89d1e965b212c18af6056681b96b1188ac000000000100000001b99b1f9130a9ec8654a4563a44861352356982be96e640c62d2f92659ace8258000000008a47304402200abe8bf1e5b8f2fc9dfcb567d1883bb31fed5ec039320f5eabac6edd4dfea5c302202ce1d344d5bcc038d833dd915004027aaa12180f7dfd90f733a2b89b63103b50014104ceb6a6735d2c1bbf8cb98ac86a913ee6b8c52f176c686032dc6e6cc4051561976962673e5749d123f10f10e0196e4088bf73c8bf6764ffba4920cc138ae3f75cffffffff0298bc0a00000000001976a914339b675e1964b342792e70dd90990fe3f161a15288ac58492601000000001976a9140925d3e6304ec2f4020b36915b0edf3928152a8e88ac000000000100000001c60743a3990c2b422bba35bac463bc362795ddb9e5e1aedf751932fe9e91732d000000008c493046022100c623b5e8b182433eb417e51c4c4c73ff693e59d4cb4cc5f9804abc7921119eb20221008b4bf3ee24a105537afcb4eab724af89632e1f8d7e90d8c2036b0dd69dbaf66d01410458aa045e796693592ad1c0f9787d384db12d01ac21f83eb2dbc01ac2867bad3d9c3079633919ac0929405d555c779945016f7326735590ee7c549f7484a55260ffffffff02905f01000000000017a91459c97c71e18d10dd6c8bece399fad89e51b429718780fc0a00000000001976a9141099aaf36b519918cb910590df0d3deb40a2a6a488ac0000000001000000017962982a879a0d77578c61961181ac576425d9275b281c70f272af6a50cf947d010000008a47304402201a548265fa9ec6d7b5315f2d2044075855a4687fc7daced6e4f3ddea102749720220489a6e9b47307e12d05ab21db9cf72e30f1723c1a197ff51afadf5332fc73b07014104f59e40aa5f1e7cff9a48652e5b956393cbb720ad6014798d852681779b021135df449dcb85f96630931abac99a2b0562c02cbb38403d804a8660a55adda93ef2ffffffff02528e0100000000001976a9145cd816f1abfa4340ed1dbfef0fee040eda04ab4f88ac1a3a0100000000001976a9147b0d09d785f0d04257fdd9079339fd8c3c51267a88ac0000000001000000014109001bfef7efd778d4ac0cf20907d810067984b496bcad2d2b4c4422a5254b010000008a47304402201e205fca551a11a846ecb95bb762165a52668938ff8c804b903a0e82535ead5902204e7cc481397ecf2e77c37ad9332a48b525f9b7f4b8d4927e1259b584e863aa5e014104a97b6a922622daeb24383bbe3b3262a7093a625c6097e9d1d8ac125878df8aa1e7ed8fa7b56436978d0cd8c31d5f04bc4500cfe588e7bfc091457f9683d434a1ffffffff02839c0100000000001976a9144a6d24d0657c150cdffa3e19f5b9ca3fab85581c88acb5c4b000000000001976a9148cbf5be921cb1ae293908ecd329f4f9024b7f2c488ac000000000100000001075ecf21d75905e38fa74492558092853922b95f138e7be73f694a82e6823e4a000000008a47304402204e7a831eb8431dd1c54d0f162138c467eaa10efa5b0af977f54796277aa1223b02202b77d26a497b080bb7e3d62eabe07e5faf8366d30313e1b4b688c0da0aaacc7a014104107c6cae014ad7d97003ad83e0f34c5f63fe6e1669086473e5d4395ad0fc041b39ba269fa2efd33c1014333c7aac3c2943a2aff044b226ee79f57d1f06debda1ffffffff02a0860100000000001976a914aa663ac6d9c21282193b9148192dadf7455e9a2688ac70fc4200000000001976a9141c2ab40b32a5d3094b922fbd8acff705bdf9e68b88ac000000000100000001c03b0a21bf7013368b0e93c4fe6beea937981fabc1a1a3d06c2a634e0a5924fe010000008b483045022100ff3acfc24961fe3dd9e5c462ea4ed7deb84a6a012fadf535e65860568099b079022042fc355b9f02271c053a7a84045927448d6d9c50fbdd4f87e009632b4dfda74501410414c4f2d625ec8b16ba51fea09976170055185de9315bf8ba3469b32e158559801462a08c3b39748084a8e6c87db67aa92115105b32e925f4cfea8e1fb86f482cffffffff02c6219202000000001976a914e5585e30519eb7f088b21c0dfb3a6fbd158f632b88acb96dee35000000001976a91422c5526fdbc3b8a9144703b785a72d5782c3367c88ac000000000100000001deb5fc9c75012001f61afb1ae7e5a9360a4f4b1fbe4f2002b8e2befc8d251c64010000008b483045022100f9557ff4c04207b5699d039d9cf249b2a82364cc3868cccf31eb54770304a6c302201d00fe262591cee5bff049ee86bde08e187913c4c00ade7bdec64815b45b9e61014104aab5e25e3e5bb152fcc112002e5fe132b8bccf215ae9da0316b4c592fb4db306e3db3806da59ace6e3a5475b42416a043123a271841f2b490a9cf2586ce6b853ffffffff02b07f5002000000001976a914db74dc5d8d5f06fd3c26f8bc0db2b47121205ba988acdf7d7507000000001976a9148360d0189eaf67f0b24ea7b289ec61475f7501a288ac000000000100000001ddc5f30f030e6b3e83780b2ba15fbd6f62f21522c1bf9c62492407036b3be487010000008b483045022100d218846dc5e0e9c9437ef012efd838adf342db2adc2e64185d5554b12e790e5a022024d308eb601e047faaa19ce35899d197e13ab2f8b12ac40c28bbeeb8b17957d20141044ea5ed048e7a56f3a4bb0c3dfd303617ef481369e9304e1c3c0ef5740d70da456c84032046b50b44e64f509f41b5db52c360fbaccceed86196710b9a1991ead6ffffffff025e762700000000001976a914cb926601139fd310f000165f492060abcf640cc988ac42a93601000000001976a91454e3685c8893b6d283fcc4b186c0d669c8ce112888ac000000000100000001afadaa57ff0b061f1da58d648ca7e02c63a7bc4df818512d17d053a45f8825f5000000008b483045022100dafe77e266223dd7a8b96940d0dd41a299823dbaded4488f2a1321730d4da8c7022065d1486566e9bd53c7c2a4c223d0c751e127624699858781b303b6f856bc3a7e01410461e6ce37992f76ea9312a79dd9e6694c950508f524abc56fc3bcacfdf8cea4da3837522b8bff5675a732ac04bec84905d09eb7e519f207fd20d72893f6299cdaffffffff02903c6f00000000001976a91448bf8f4b1d3fd7119827e12622fbdf38c55a6f3288ac6f801300000000001976a914da25a9fdae68aa9d8d0a8ebb44aa5892c306f3b888ac00000000010000000188f6595dd9f4c10e7081373170660a6b7eb92ffdbca19bd5b9044e6fdab903ac020000008b483045022100c82e72fdbef0c9bb00454500476141aed10aaa0aab3de4d5bb9896407d4f6db7022028a82c5ae5ae52216a0ec6d05f681b244552a2b5f3e890693799380bf184c91d014104d19d36a81409b86c777d2a2f4e709c7197fd738a5fc33d5c0ccde0eb8721d0597d28713711dca7c26d673180963e471d97a54795bc8e41dcdb17759d89a78ab8ffffffff029019dd00000000001976a9148f289a7eb1181236c68208765ed86ad2673cdee688acac624d21000000001976a914443f12eacc14df374acd393118503e7fc4c79a5688ac0000000001000000014526ac41de8ac46faf8fdb15e0b47d10c0f3279dbc77c392b2e7cd05ad00a456020000008b483045022100feba0ff52dcf44a53b653f5eac3fcf610e16753127f15d5949ca7ee501cbb86c022005a7615da7dc679e4f47937e60cd8da9d31ca199d14187f3e10c1a7c2aa5759f014104d27e2aa497c10a4b9c59cac083219fbd8e71c0b1eaaf77691b63f371d310ae6515069292ae84d3751f63f20c5a84e931fc82a3b21e10e7a04e80a54648da24f6ffffffff0274499b01000000001976a9141cc08e71e20b330a92a570fa6f2f35222e421a5288accd5c2101000000001976a914c818a6b3e990634aa93008edc9d0e86c199081b388ac000000000100000001fe5da73b657fc9c315ec7436c908129947c0bb377da4988d9992695f5fcec4fa010000008b483045022100db639d9166ed6565363e4c4c626817b2a8bec9cf9f391116eb395516c2ebbb3c02202ecc39553a61c63d24a0e285a972b0d85624883415cb50aa8cdbc47e8ee830340141045ecd59c94a3324ae6dca5d2f273429ace957fa5098480c0af23ccd2bb0009fa9e047a5e9e72e5d7fc8a7126850633c75807bb6ef9205b26ee55e77b8261f0e83ffffffff02b0692305000000001976a914231d1428aca537e7181fc5c48912ae661bfd9fe988aca1993400000000001976a9145597e8062c77ca2ac43896e2ac87396d6918287188ac00000000010000000161f13dc990094509e7b42f6547bd85a5627e94cd25518dccaaffd04742719141000000008b483045022100d8bf1a90527235e3d85447c08fdb8c6c1ce11e98f0f8509c2da68d1dfcc4092e022054de3b12a7b572628f23b019ce656f8ee28baf91e5f930906672f05d535d22ff014104401b445c1d3009dfddc7e4090418530f87ff99fa7ae34bae465b8342d2e08fcb2fda7a332ecb3403a362977e132e772bab5cb54da13c0cfcbb8744eea46eaeecffffffff0236155c00000000001976a914b7ccfe33ca650d3dca6d4d042715c3829b695ef688ac8a242700000000001976a914cf65d27fad09c4b45e75bac6dfe3509d04392f8c88ac0000000001000000015600d15ab7b25a10b4390a8bcfd1768bd7f588c71cff0713a3edc8626ebc6d9b010000008b483045022100a5f33d09ce93c6b464865e783d0461393ece97b682a83fd8edfd8e5425f4b1be02201866e91dcf85dcdb7b0562f9d08f31239b197236ddce35dc930d9c58c38d991f0141047aafcdf886aa17dbcb9387abba7d997de1c978130d4fccbdc51f89a84e8520ab2d7a1fed6506b9774fccae068390043181b43109f73502a6f2d05358e5407e40ffffffff02f0490200000000001976a91408a9c60df3b9a9058affd6d796eba2b580b7f9ea88ac6cb41100000000001976a914f8d5af3a7522f923652974bd34bfdec8fab01a5788ac000000000100000001c3fe3630216ea082103792d8783f391a9bad8ad5712d830f07e17e421258d67f010000008b483045022100b32a1074985ffb185409569e571f126c8194d0bd5fc3a964e362e4ee1d9702e60220451bd887ab0292a6dfb0e990bb037ba07e6ce504e1ea11f24b7ecd354ee62fde014104107c6cae014ad7d97003ad83e0f34c5f63fe6e1669086473e5d4395ad0fc041b39ba269fa2efd33c1014333c7aac3c2943a2aff044b226ee79f57d1f06debda1ffffffff02f0490200000000001976a914aa663ac6d9c21282193b9148192dadf7455e9a2688ac708b4000000000001976a9141c2ab40b32a5d3094b922fbd8acff705bdf9e68b88ac0000000001000000015b647a206ebf675a3d4ff2793786f5a1e6bf75f595ef58bc2211f0e7d8cd3225010000008b483045022100ad81f129f600edca3437208140c4b4ba388dae9a36ff75e00a4bf5b74513de5402206b88458d48551eb3ed8eaf652d7b5365aafd2475fbf79124a58e747d14f2ebe2014104aab5e25e3e5bb152fcc112002e5fe132b8bccf215ae9da0316b4c592fb4db306e3db3806da59ace6e3a5475b42416a043123a271841f2b490a9cf2586ce6b853ffffffff02b07f5002000000001976a914db74dc5d8d5f06fd3c26f8bc0db2b47121205ba988ac1fd72405000000001976a9148360d0189eaf67f0b24ea7b289ec61475f7501a288ac0000000001000000016941a70b4b3898d9ee26c15069a741b61d807978093af79eb809e9b4831d35e5000000006a47304402205aafe6ca6b3ea108456bea0f235c3128c293f76d280d749a16c23204b72f64e10220715bebaf7c9561146f9becfa9e7afeb203b13b1b1a44984328e3adfb784effa2012103dc76f390898c21bb9b8b7e53a6c861e03355d6ae56f790121d789bfa44440834ffffffff0310bf3a00000000001976a914d4a2681e7db09391f987d5a0c9c1958a6164571388ac90e00c05000000001976a914105d20612c4f3624386204598176cfb13a48fa4d88ace6b49a1b050000001976a914b28a53f439b972f2db9c9680a005d640e830359088ac000000000100000001e8bd6b9f7e08e9149c1a387c42ba8d19c8e989b3f5cb7ba0c7ae32124f8dfa42010000008a47304402201fc8942e2833e8b2566106eda56eae3d8a9d64338abab46d84b2a0c8af70716c022031ca1ad6c2f6608cfc6a156f80181597a18a47d98f10e67755c096631ff594ad014104551b1e0003bcef0db4819d8191b672392cef24a6d13ca5c8f5f6207693e587e913e287b3bb42c91b3e81a154e8eeda4fa21c410d18c90dae8d3062de82acf13cffffffff022fbb1300000000001976a9143f351045f778e91e337226aab7ab2b2f2135c3e488ac51fef804000000001976a914105d20612c4f3624386204598176cfb13a48fa4d88ac00000000010000000120bddaccb167d5061090abc1f59c8d179d5587f96ff9ef9689a186052a9409fa010000008b4830450221008e60a35ecf2f531c0d55187867fa499193780380ba5976fdc85ca08f3297d8db02201d9e4e25cf8cfa26a4ae760ffc3c3fbb20554e0cbbbd4b187e849f0a4e8fbd65014104551b1e0003bcef0db4819d8191b672392cef24a6d13ca5c8f5f6207693e587e913e287b3bb42c91b3e81a154e8eeda4fa21c410d18c90dae8d3062de82acf13cffffffff027c0b7700000000001976a91441a8dad1e784e4fa4c40a84755843b2586a543fd88acc5cb8104000000001976a914105d20612c4f3624386204598176cfb13a48fa4d88ac00000000010000000337ee96ba2dc1edbb65af690e7ab66ad2518ab2da5c6d5e571126ab32cbb2372e010000006b4830450221009de1d03ae4bfbaed4d5b171eb934525898d7cde7af7a665e7b46588d116573c402207bd3c04993ebc884e41d69798d4fa02db143573b15ab75d1bf9b5a4d6694613f012103a76be126c9d08432406d6e6fbfb5cc03324d9bde8eae7b72b4e71586d4489c21ffffffff31e35daab606346045b3cbdda2ffc435e84f8b8dbae6e34d971433b19febe920000000006a473044022045ace32620bc395d4187175e46f934905b491b178542d554727a33b23a1ae8c002203e1b769f070df327e4f26cb1d9374e1817493f82e7fcaf21c12edd009a433b6401210295db9944bd20a9d78d59f5199ae55b91742ba8ffd555425e97f8f17e98bf1187ffffffff66dc651f87a912b50b5d45110a1eb75bff64c6489584cb262674685092f0ea4d0100000069463043021f1f1418db2a9ab04a62ba8ae948ba94610ce3789e738536f9360f56e473d587022033468ed082ab76ce5fa55cfca0686b67622cdd05a5a994a64018563911c9724e012103a6eede2a81d823f67ee5610256e857182f49ed4444ef8773bb738203425eb89cffffffff0280841e00000000001976a914fac2ad0a0ccd563abd2d15a7a280b4a2f7e2495788ac5a5b0f00000000001976a914ab9b9df8a28ad1fbdb8575130909b9822dd31e4c88ac000000000100000003ed2029a0f24227cc8836c4c730a5924cbe728ccfa0a0e7fdac89385c56a7d510000000006a473044022054e48b01ada692ad9fb5a510c46afe65170ce9f4ed1709cdaa9b82dc625659ef022074ebaf1af4e56f36821dbc1739205b1db7eb2f53d9fac05339fa870160c24172012103d01ccbe0948b2a008db994a68428191812fd5016d78b09fc21d0becce89cb465ffffffffe569f3581f316d7db9106ecb97e39e36afef2c1cf6d235d6e86339296be2c02d000000006b483045022100a3acfc0475693884b34612caa53d04dbd7488db176d7236b490fdce2fc8c276f02205bb5e24576d312433a4f8cb286aebe9f44bc0bbaa348ecc1372994a2509502d6012103fffcc7f657d2a2368b8f58c143276928adcb949d00171befcc07a59f1de911a0ffffffff2cad593a889de9aa8bf6167d5aa0eb2a4da53a4a7d0f8038d7ad876ba5e8fd37000000006a47304402206ae0aaf1b341da94c60715e31abccd20e44d64583f6fafb0e4f6862c6b6ea86c0220745ef223262638626dcca5fb718fd680720889b9cff6c58ce21acd69a853ec990121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0250690f00000000001976a914ee3e38b648a77abfc4ce550042a6f5c3a7dc484888ac9055d300000000001976a91438860090779c6df12ea41cbe472359b62957527188ac0000000001000000024c4052a792a3f325d045eb3ea86b80be5ddd3247e8a7934d6e1db875669bc437010000008a47304402200dcaea399a77c0f2940063de262544ba0e639d4f5b64c06cf79c2c694279279f02204dbdcbb7499871b5c23648f6c12117f3674cec21d3a765a173f2f55f76e8436301410461e6ce37992f76ea9312a79dd9e6694c950508f524abc56fc3bcacfdf8cea4da3837522b8bff5675a732ac04bec84905d09eb7e519f207fd20d72893f6299cdaffffffff07ad7f5112dab5756d77a10500dbac92c24cb1e3dbbc7a4b21997833d18d6c0c010000008a473044022014b1054e1f7733dbba7185fccb58d48e6340692dd26b5fb83bc49043712101e8022044630fdd84e8bc10f109ece092a6c5336ce39497ae30ede2a7d6ecf4640022b701410461e6ce37992f76ea9312a79dd9e6694c950508f524abc56fc3bcacfdf8cea4da3837522b8bff5675a732ac04bec84905d09eb7e519f207fd20d72893f6299cdaffffffff0174be1300000000001976a9146af9d4719dbaed66a164325abe7a1b6db65617ea88ac0000000001000000025947b3b66be0c45300b39acf14af7025cd18340a6910e9586384c42ad7de0781010000006c493046022100b39b66139906089dc1a4fb49aaded039982f0c893c10d2a025a08db9ae37c0da022100eb4179eb57cb7b5fc7d39462d1fdc484262743514807ba9e1cd37dfc485b8493012102b789891a23a8de0661acad50624e6e3a5314b000577380f5d5ff5edd2522d539ffffffff6ade298009d733860c652b3840540a3ee8a2c205e4b0b1c993218902eb7895d3020000006b483045022032b236023b52a0fc261dc0767948df8353c12c2fa75fca5e43082436514d6e86022100a6caf7fe36e17c704adc839450c2f67a54272af36fdfd6232def1e751301eaad012102a50a033b80aa01b6c16ac800cf1b4e03dd3a46e3a959a012e448a39208060a8dffffffff02a0860100000000001976a914e114fb9450ebe9038a9cec050153658ee3e29cab88acc6620100000000001976a91434eae7ac67373d3905b8f1abd159296ef26e226a88ac0000000001000000021a3137d7d9054588e2d67d3edc4d600c5bc37c877a71467f4cd03a17dcc7188a010000006b48304502207bf7d38f7f53e9a256634fa9d938c0e0853b71d2431bd34c1c7eb45e6b31465d02210091855589296a8f2813bdaf58aa8a100c6d59a8b152fc59279b884f8e515aa3aa01210326068aa063bb790ca797aedc32f43ece8c5588a73a1305ff20a482cbee4e3a14ffffffff0d83615355af80421ad4c8162625f5fd381369f8458f610b37d856f92972581e020000006b48304502203d73b2bf889473891d727992dbc525ffadf57440d6a287b4af73ae3b39662df1022100bc8a062f9f551f8b5ac0b5a8d5025e6b3b60fd61a0c779ac5ade876d4116cef60121038655e8043898e5bbae44f1278b17b341feba7218adc38fac030fba60cdb6358cffffffff02a0860100000000001976a91403d8ef00d00bbfa82ff626c8e6af138c705427a988aca6140100000000001976a914708ba668f692ac73f15c0c1734fba66182e47be588ac0000000001000000018a3f9428030026477dfdadb750972ed82529db564302a96bcdc512ec6d5262e8020000006b483045022100b2cbc57df97e6475c459aabe40ea1c463dbe91434369b7582c7b87a7ce4c832b02204bea2c5b4eb7ecb9d1466c5c2b8e1cc72bc74973570e0d6d67d8ad9a465fde01012102850a43a38842d86dc50d4f39c9e7a7dffcf6b718b2bb6f750a0e39fd5c19a048ffffffff0442180000000000001976a914fbb6b2921838002eb814cc6c2e18523d92f1721388acd4170000000000001976a9148e957d54c8bae87d142300e8986f012591a23f1e88ac263b0000000000001976a9148bd11463c7ba02f6db23168eeff16c0a5338500d88ac1ab67d02000000001976a91499a41aa79409d33659cd5358b911d986eda1af7588ac000000000100000002f6dfb10cf8c9b69b32fab43baac1d7e424fd084c104794d01e5e87dadaa7a1f4f60000008b483045022100b798c4a046465ea9ad4c360021f83f5d3fd5630aa3aa1335c034208be1a3114d02201c54e1e30eab1e040708dfc14f890911211f0a3623b7cd22484143eaa0119c8501410420e4e2aef02306e37260cdac1325978a229aa465652a5231c8e906e97c73b2d5303980a7181129044b12d37f288ce5d3d22df314383674b1b78d3e0b4632e9fdffffffffc95e6aa046359353b03bde2e09b17b2b1632c8d52f1d94180a11836ed5b6b0f7020000006a473044022020fcb3dbcfebb2f493c23ad51bd5d49a3bc4671b9999aae7533479994e1f966b0220197860e87aa60bb5f54bbfbc226edf7ffa29d58f10d846e50d16b9b2cba748ad01210386c14ccc47de096a807a20a0df9b0f8c995957351c571f7c36a9a7cdad0c5aaaffffffff0210270000000000001976a914d93e05069aa9afa0a814a9565a1f8696e2d04b7e88ac86c60000000000001976a9140aa91889346e17d2c0d45851f1e0490608fcfe7388ac000000000100000001e47f6bfc50d96edaeb5acd6db4eb08b543a702f909f2e276584b629bdcbd358200000000db00483045022100bc18b609c8979390ba1f111ce54e537c375eb5c22e469e95f8f171c0d4ea59bb022040952b09ababa2bb5816a9e92f7a40bdaa68ecca07c800a81d010efeaa94898101483045022100cafcafdc258dc9a19116cc0106248e23f7904ab1f4197c30cc85a194a61a586f02203727c8bd1f4f5da5e58074cd197b34c112eefba1b37162334d95ae75a510c48c0147522102c65bbf3337d3efdb65bd9a85d848fa1a1b236643a3d18cda669f7f116983d7f92102661b085665768560effe2b1db80ad5084921c0ea2302b509676fb4e9a158afce52aeffffffff0180380100000000001976a914a6bc1a7327cc28126d5e466e10c840399ecb90f688ac000000000100000001a9a767bd57763eee57711b9c5e54bdd8c959ce62d2b6300ec8c2953173045fce000000006b483045022100a0a225429054416e5d19498588e3bafb34e221e3a1623e256e2fc273a7b735d60220759884ff416e165f7b675429054ce914d479b2abc1067c49f3772e88f2fd19a6012103e6a5de49eca7eeec9be818ada1c3c626e5545980bd50b9404ef330514eaaf9e2ffffffff056e055000000000001976a914b46d1b1e3af916966c0f45fe34ca590d6c14d3ed88ac705d1e00000000001976a914ffc9681e51871224ee19ea5874bd15d9095af34788ac56830300000000001976a914989ace22eb7388602a3604d92a367dd26991fb9088accbf22300000000001976a914ab5997673bb1be55088b1b987eb29a0625e3641c88ac71960200000000001976a91474fd1e583cdaa9dec2a60d8ced1d814af57d245088ac000000000100000002a5dd0be69757f1d9abea82a18e0eb45d8dcb441aba0138a17fa9cccf9a9e180fa30100006a47304402204b03c45e342f1bd7e61a0bcccf5ca2b6393e2a2c6b3c112853173c08265c86dc02206de8e374501cab42de1d44f97d8d10a1084c28b4d044d0e8ebfedad1a3958b4f01210320978cbfcccf1d33171b4d19a8c202a045291991e2222c4b52bcfcfddfba26f7ffffffffe34e5377be6c836291255ed6748a32310ee9618339d94a4d351fbe3d46a9b8a7240000006a47304402207869711ec81d0eefe323712a1476b1b4693c7d9a8b461e13a3aaf79103d9c863022070ec86da57388c58db58fac1232631a430c89874c2e6ac6002066dfe28d0497d01210320978cbfcccf1d33171b4d19a8c202a045291991e2222c4b52bcfcfddfba26f7ffffffff01ea460000000000001976a9145aac80abff85a2302e23b5e628462632610cc3d988ac000000000100000002bd08f232639c69327bd52e57157cf4d20dc79259f88a19436a849b930e673a34000000006a47304402206e66a604091a8f95fab67b90280b853f1713a1636cfe9c112c3b040749a75c1e02203a6d2f92f6b53143f2af3993dc27a0ddb1e2b19d97ea20a93f3f991bd616dcc70121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffffe5588461e1ba296ea74342d47439d85c59a4fa0592154b73d97fa5552d5cd337000000006b483045022100c0d835302ddffcaff990cd898a95236099a70297f7f462dab053f9a84169664c02205d88a50f8736af0262704db67c066352c26352663d79178530ff1a1144195c40012102e356f1652142ae4df9cc29b7d4016db02af34b93e455c334e103a904c63a8467ffffffff01f0292502000000001976a91438860090779c6df12ea41cbe472359b62957527188ac0000000001000000020afdc709516ff038a4447555b8af227c77fe44628470ace25cd16bdea0d60f50010000006a47304402202c1ecf1d4d11d8ea117e8f47801488dc5de01c05293b279f3ce3194ba9ce81ae022027de83f9d3b9c02525158bc4f1e65b013d0fa5c5f116392d4fa2b4f9870df8e3012102235535cb00b18c233f241d5a0a6cb4deeb087f02576e221c53a217d8010ea97fffffffff987ea93417c0ebf535d5e480ccd3cb3c0a6eca0d017d459b25ed07fee646e960010000006b4830450221009756cb3972dd8d6d33533cf827d502d673ba8f99cde70cfaf3610cfcbdf0005102203aef8baf2ff0a09e01c63ec489f2a9e539d80ad3b47c430c5c1263277383b03b012102235535cb00b18c233f241d5a0a6cb4deeb087f02576e221c53a217d8010ea97fffffffff01d0be8b03000000001976a9140ea72fefe95f5474aa6d43205933795a2f79af7f88ac00000000010000000289922ae032065dc92995e660d1f5dc1af6b8642ed6551f904593a019eb3d11e8010000006b483045022100f60330abcaf984d54a7d0c5940ee473c829d594eb04889fd52729a36060b57ad02202eea09a906b324e87ea8d4d50b157c5a44dbf5775f27b0014124e5fc0f4610fe0121031b96c5a33ae4c2290567acfbb469c2e38aa3a507e022b0ce131d741d09df22a5ffffffff57bbbe36e1d7f2a732fab127f301fe88e612bd2f43d97a331da8934044225400de0000006b483045022100f49947fdb502027befea1fb7991cd78962d11ff98d1449f75d3f0c50d90c4aa0022002008170bf0c4d7930f7427d72ef9ed4040dd93c6c216adf240f19bafca3d15e0121031b96c5a33ae4c2290567acfbb469c2e38aa3a507e022b0ce131d741d09df22a5ffffffff01c4d80000000000001976a914bbeed08fe2fe55824799e41e6e5a7ffa0d98426d88ac00000000010000000222505cadf7b0a12bcd84e95bdf3777d810a9b89fe38e46e347d664a515694e2e010000006b4830450220719fece6d4d3d4646ca03d3f63430892701c3d11e88d0ab0a27379ad4fae36de022100fa91f3237b10f1ab3eade0447cdbafeb4832b15db21499506f9d9f58d7741513012103a77939530e843c87bcceb6b608a4c7c0a558e937a2314495f96cb8455defc54affffffffd05b32e2dc3637e96da536a3486c2ceb83c7d363abec21c667b3faf19eec1847020000006c493046022100911f64abd7fd115e62123641ac9f3a2b2b925d341b43d9c5ec3dbcf87cdf9d5b02210085bbf80c569f5b999987dd9b25db756725a6e0f5ba921320bb9e6755e2613da5012102abf9fde715d4a2c83287493bd8d808729e1f77287839cdb40a305041fb2b61cdffffffff02a0860100000000001976a914829e03ccb7954c79587ba0434ace2e61323e889188ac96ed0000000000001976a91405d6ebc3a496d89057d0be98c3d11d97a8dd415188ac0000000001000000013d951d254ba757ab945f21db507b26e7a43a877e296c71dcbfc90214da1856f901000000fc0047304402202b41b4478fe1f38657468fe969c0b2aebb12c8fcf41f69ea5e3393c66266f3f8022065c3c2cd9b9a375fb386d1271a010f4d5cce424ce1879fb6b5800fbf43a20a9f01473044022041ab844b1e92ab2a041e5500e7db748edbfdb2603d9675ec70bc03676416529502200be7d9bfca6e7dc8d8aeda6aaa1c811444f61d77b36ddd3891df0e5b018eb2dd014c695221028c1bfe6b1779f9e043658dc3ef94b47ce10c9c43ae8ffc6dd292995b9f21e7f621035119cc8b661d8f13f24781790a6eec7aa7896067f94586b4fd5b072f1e702f7a2103b7f64fe1a246f77042a171a853981b17c1c22c6f25964cd6b9e8c8dcb4c40f9853aeffffffff0280b2e60e000000001976a914f12f309f1d1ab37279230b1db249f2a073666fe888acb0ef61030000000017a914f6283121c52db1bb66f6381be58d28e6100ef286870000000001000000024631f3efb79df631a513996adfffd0c34fb7666fa83f30b76b1740869bd48d79000000006b483045022100a66c749a6bea70574ab3db5b28d97842e0b91227b5be3986a682b1c83b46c0600220449a917b95568f6c831e307250f3833b74bf4d2ca3f32343448ed248b50912340121031b74bd84c16c86ced1b103f4ae1e1023b3709499c6bbbfb7acff3836a5665632fffffffffde7b880ed7d3f7fa952f2b5d48824892ee693374144b59fd0e02e700b9c6f13010000006a4730440220432507729a0b5e2af354fe240bca298b17cedb21cadb4044e6e5f0b59717a7fd02207954ad4d568b3f80599cb573518378c5f53ed33fac1bd90fb43b2e9ea16a61c90121025475829222b5cd426277b01198aee63f19ae0439e2bb303f752354d5d5652729ffffffff0210d830740100000017a91458d3420652b3720ae27303dce44706ebe3dd25b88798921716000000001976a914cce77bd089a3289860e9817c187a7ac9cd80005f88ac000000000100000002489a809f96724f9286b07f6b0b4ea9232eca8fa58b2283cd44f2807d623249ac010000006b4830450220743420fd9fb0e5ff0265a6dfe9e274bb690437cb4be2484c718465ed21bda34b022100afc04b82d5addd799a0cab232ab68955b04e5979678cac924ef7f65c792a4ce2012102666b6dacac68a56b273ec31c7c3fa857aea722fad37cb2ce0e5637ca141b3f7affffffffff1588af29301db29574d1d5f2bdb971c790b90ac435afc1f33f72d40e700984020000006c493046022100f2f8fb7c6baabd98129022443748033a45f7322c48facfa1f70e49fe0352e03c022100b51b50d684faaf8b504ef0fac95a7d1a9bae97a60e3325642c274984c4ea8a9d012103f5d02db24dbc4a2ce2c255c0fa3bebd32dcc7fbb5336a85d0522a692b1532e22ffffffff02e6e9a900000000001976a9149528c07a318ad273d20ffcf705eed7303c83923888ac769f0000000000001976a9144e2013d48eadfdbeb2a791904b828591c04258a588ac00000000010000000208a56e9be90b64b77621aa1c4e2bb0f271f3946cad545bc8a36830ceb8b98af8000000006a4730440220032219f59b9a8c78617acb123f2e239ed0f9b3271f97f33b661084aef32a082002203e2e4556ae18b2b4755396e2576028c252385388d2e3a371c21a4aaca1827feb0121034f26f542b29fa004d08cb1ea2f8ea98a0b582109890275ecb40d22c5b8a2d199ffffffffaa24cf56435160fc4e390cd6919b4490a8dd703db2dae6cbd56a9ba223ac113e010000006a4730440220490fba9edfad3ac78209f5429fda119eab9db939ae64bc078c74c80a0247453b022027444516a1a116f5b2394e20ff262df0076ee4353547d5523cdf0a525f6a9c7b012103f4fc9295bd72824a72d0f8d51a44a0e3cc04292b835c6457e408fd8511ce0864ffffffff0234800700000000001976a914d390a4f6393b4b176b89c02ebfe2ccb4805ab19588ac53291000000000001976a9141ba4320e2b1baa190b5761ab47a0b3d2fd1e0e2988ac000000000100000002f4a75777085a23edd592a10daf63d58b754400462354b191b558bda6019bb48e290000006a473044022048c238e0e59b70b8f960f0fc7ad76206022686c38f18165704dd4af537aac497022034e942bb06f5fa6d908d11a91f916371cc7995404b7e9dede1f5c42603f97227012102951cf786f0db0eceb979fc5789c7c54495d375c6e0e1d9c0bf8e6ae6cc47d231ffffffffee023bdae2d56662505af8b07d5ceae93dc83a34e0ec4589119da10930784e1b010000006a47304402202fca6154229fff0903f2aa2b48f2f798e4cf3c06cbfef76bf2cc7ebae571c488022055a457d245453a084c604ccf984e81d6ff6087692339bd6aece05a38f89d3bee012103edf00c2a29c28eb371ac6f8167534123fc6a86c3f4102ca71983b4584a1f65c3ffffffff02404b4c00000000001976a914a7158ae172d699b5371a94fb8e0abce2edb526e888ac8eeb0a00000000001976a914bc42e27fc16681080bf5af3740d28b7c654f8c8388ac00000000010000000290fbbbf11d7b4060e284f372c0466e5e864f88d94f0bcb32d472e876e65b89b0000000006a47304402206cd4db6a62644271f8640d3552f38c12719871973f699567ac61d08641d75ab1022024a305f5234436fe3adc13fedbe1520d9bbd1898f9189ea75c9e2a508f6dbf10012103639b8126560f13b8da35398ccbd55acdc24d1fb87117f93d42d7b85bfb2d563cffffffff2ec3bcb3ad3959732467d09484d539879c022c819579b82b352ed745eb1cc288010000006a473044022021549792134a8fff5a8c09ccade3438ac886448228842c926c477e55e243af25022050c4a696322ddf585b31035f57b6dbce4d1de7f71874df90445d07eb9963da340121031d6af92bbfc36faa0c952b1005096195b1d3a0c7b6397cd5c8c037c5d3d0cc40ffffffff020741ff03000000001976a914d0b58c0e87e788d353a552cd187094df10c3e63d88ac142a9c01000000001976a9140385408b7cb3adac53978a672acfa2072c0f8a9388ac00000000010000000200d408d2b11c3e1caf274292d694cd5b662bfdb13a7e6a0ac9e945ad935738a8030000006a47304402202a544dceb60a23a85d628227ebf5be3b19441c3c191c4595872774c911b9ac4202203de707d553536f9b1b7c319e797a4e7bce8ad11c8c9d6ada96d781929f9992660121025f7c9ec13572b539352461678c4991763bd5b4754ff8449fd5ce6e5f1dc2fb88ffffffffbf0e16744a314d1916be7a6befcf7024c020f7a8850e83478b611f4f6ff2c692010000006a4730440220104f2814bd61208be32edeedada23ca94740ac394b325892afd86407c4f978c702203b25efb7e95861e1edde129fa4406f72800c46027e690819255cb96dc9da2007012103088398729490255637f591f97b6b91f7b547bd45e63fda780f892a21b4cb3417ffffffff02a0816a00000000001976a91485de29739a33321d8ff0f6eec6c9b30757265a8888aca0430305000000001976a914a5dfca68bbd4fd74ed9924a7453b1d6ff911882c88ac0000000001000000027ebb43e0aa15227e479b0a5d54eea697abd121083c636f4cc962d61eb92c61b3010000006a47304402203ac8fc5b0d72d33e3d1e1714a7cba03ade031d3a098a6cabbf7ac6a8cac370a40220578f556b148ca3f057791f75616c64cee20bf54aeb1ccfdcff3908ccd85839e30121027d48000a57d26f4e621da01dbbe7ce5a6629d1cf0f96970529110ef910b1dac6ffffffff3989d117ebc2a322e7ab68973a879b4ea2510a59be6d10a85985b0832b2358bb000000006a47304402206308feca2d139b85cab359b7e2d5a4700de320dbcccb2d1b913a2b24113a26a002203a47c037a1339595efb03d401d538158107fd824c344a10477efcb0ac41e9ff5012103caf3f19af08da1a9d94c7b307b06c63c6aa275534800fa38c86d6136d1e242e3ffffffff02404a1600000000001976a9149a9eb69cb72d1c95f9cbbfd838d2b3f76e9a3ab288ac30269f00000000001976a91438860090779c6df12ea41cbe472359b62957527188ac0000000001000000026d31d5e7cbe5acda85cd701654d1d2a3aa30a2713dca6557d83c7950ae98c481010000006a47304402202f93e93bf3120c824131d35742c87b4677faae6450ee70da56871342c4ac763002200888fa3f30a9c59a92945acc6fdc511321c8c555f344f9bb58c389014539a491012103e4df69393ca79a2ceba9500445b4d9860db79da899dd3ae703700048a1a13ea8fffffffff0d4d4a17d352c6a493cdef378fb75f614bf5a51282a9964c4ffd0f7815affbd010000006a4730440220527aa56d31729b4aa1c466fcec333e59c71f3e401d33569120c18d9cf27bb644022070d9a0fba7f8159c9755e8fd87111c564d0aec92be08d578c82952ad94f9d5bc012103e4df69393ca79a2ceba9500445b4d9860db79da899dd3ae703700048a1a13ea8ffffffff025cc92000000000001976a9140f8aa8dce27556bfbd1a1e5572cf7bb0657a6f0688ac2a160c00000000001976a914bbd06bfd2978564e890411801b39b5de7186c7d988ac000000000100000002b24759369fb552e01e5076903ec8026b269fa57673157118d19ecf568ca774c1000000006a47304402203351ea83d1b236148987cb2292d6a3c416d58efcde81cf4835a26a1d8d28b6cc02201c4f1542fdca71e9d2cdbeca7ca86bd1721f27d4233a854dc733a7824473eb850121024181a8fa7c766d99736e3008e4aa470600ce4525226ebff294e16d908c73306bffffffff2d2bdb7eb198934401e6f318725fa29cb74fcdb9b0e5e0a7c495f177d3f026cc000000006a47304402206daac33e5a846b9a8498d1941722f49fc018c8c50dd595ffdab85f3cfbf41f2302204fce78c73f1236c11ef75925e2144786b195784b99832d2111c24bf8b7370569012102aff6c2e9136f2fc2791136f91585cb43fb2f96aa455860386fab889c0bb78972ffffffff02c0ca1000000000001976a9142f2060ea8db4d560130f62bf83402e27a3f7c9b688ac90940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac00000000010000000296698c9f06b619f94088b486d8f35942e029eceee6107d0f513dd7b3bd57d1bb000000006a47304402202b85df2d5b0ef50ab9129bde72be90cb315a4e8b0d1b5e6eb6f798a2cb7ed001022008966ab8afdee05611dd7be0bc402f7fbe14651fcad5f3b4cca7adebcd422aee0121039fa9957e14aedd82d02d21adf17ef522fc748dd11a45c4558e7df491b31a6bcdffffffffe08b59012caaba42a7087f6866bab135121185c97222c610b355a0c23bc06b6d000000006a4730440220048b2d68e78c543b3683cec1c87a20ee9073ff6a50c3d857111635b0744a8bf102205d41105f11c75fb892a251db34c04c1e4ba8f862ed579c7cbfc521f08cd2a9370121035950ed2e52d1085c1f6b9cf1cfd13371d74e901b5bb7b8560c18e511cac5bc09ffffffff0238981000000000001976a914d0544a6427f839bb4b42fd180afd28ea567ffb2f88ac0d180000000000001976a91420b171f0d7f967e9a72a6c32ebb51df2fc45f00788ac000000000100000002d13320947a66e316d81f15639bab21cc9d797972466796cd331230f5999e713b010000006a4730440220446645355022bc878e165b821ae0f01199351543bc496a5e6d2d27cbbcec3aac0220283e0bd177ac458b68a127191d2cb1af911edef5ceb5aa155af83055fceec5e4012102b9fca07337c837fdf3e900271977c381f185ae9aae62629795a3a7291280d42affffffff3e3e80e5da402e01c5d465befffa928cc58a1a70b712aa8ccf2dc9405b401d58010000006a47304402202a99bf5ecf91d31cef6f7dbea58043d5716b72a0c535a3a405b5f9ceeadecbf202203cc37fec809eedef5e97ebec5397dd55cb76c72142e99f2b9b8754abfb71c421012102b9fca07337c837fdf3e900271977c381f185ae9aae62629795a3a7291280d42affffffff0220a10700000000001976a914b4902236a624916556f8b8aceaa1caaddc998f4088acd0fb0100000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac0000000001000000021ab6e95e6a1658e51626cf2d4cbcb16f7df5a1dba50c5ac5c0b4065c9abee5b7010000006b48304502210085109ff73bae0ce8f3a2be6bc8992c9b6d559cbbc874a83a816a3a9ec562510502202a1899ade00dd6d7ab8b398e2de06966c4a323c6982705be05aa4c535ba6765b0121029022c68dde6664ac8f62a20dbe069d8aae3df03747f7d741ea707b48aec52ffcffffffff364091daa03ce94a4826d05aaad417daa23e4459c7b2f96d051b5d309fbc702c020000006a473044022011010d1d6f13f555e48bbccc20000c99cb2a524cf74d132c45deee0630509edc02201b2e88a2e97220548828fd20ae8560bbb20fdebf88041126df87f7bd9baa9c2d012103d12b1ac47406c8fed02142bbc917749cc9a07d6696f557dd84c1bc86e0922a11ffffffff02a0860100000000001976a914ffea4609d672600057d53c594e205f42c7bad3cb88ac769f0000000000001976a91456d3c8d2d631fca0ddc9a7632b8cb856d967459188ac000000000100000001eb28ae30c5d3f8e0820b7af855b0788a4c5e0d67578073e2293441b687fdb42601000000fdfe000047304402203732a3b0cf66f11ea45e6c9c782be3ed256e4ab5e9c412f6c6648824977e652a022061566450bf04075a33effb56b8090e7ca384e1680a67623a5dc3132a362241af01493046022100c5b057da5191b5e58209c7a03449dd2f10c38b4b13810bebc73055f79e0e19b0022100dc35efeeb294c0fe4778d6c4061b2609a6486372ec2a259238e184d2a25eb4fd014c69522102a6d927876e8e045054ff9d69014de5c350463ab5335299244a74814ec19f85cc21037d8ae2373cea0a4093c00b16d6788dea4616140bf6198402c1a1c21ea77537c52103348ef123f0ddc55db1416780fdf7653db685b24dad28cd9baaa5ad5ed70e2cd053aeffffffff029eb50100000000001976a9145241b4b88c21c3d1e0b2d11462ab5f6a2fce697688ac82078f260100000017a91453943fab41e0c272fc20dd5fc9ae05f08dd5e48787000000000100000002637cbe1e202b0635e450116264be9139b3f7077e2cbcd398413cb3ae746e9416010000006b4830450221009d02a4c8cc99e765a67a7ac9f075f00d1e7240c244138544c773195be12ae348022069a230786289fc89ba17c31cef8730b8f7263d005346e08ffc0907b85671d008012102a60b79d1af03076b056d8ff81f597b811890b24729eef9825615c9d087590a27ffffffff895acc69dc1c74e5d780397ecd233e7b7216955c2511214afbb40048158cf2f2000000006a473044022024a11bb637b4353b14a691767154e311a51dfa9e91b96f1626e198a03119e6c202207986bdb2624dc16eddfe8694e71f640e741c58e3f63f3c052c04b476f9f11a6d0121024181a8fa7c766d99736e3008e4aa470600ce4525226ebff294e16d908c73306bffffffff0290f73b00000000001976a9149c1a709ce2cb75befae335201e42fab6345c12da88ac607d8605000000001976a91438860090779c6df12ea41cbe472359b62957527188ac000000000100000002604f5211c6d9b73f9836e6f36b97f40d4e35c05866e4ff4eba0e43373b72dad9000000006b483045022100ee0a4adc8489e387fac04ed6d0b2c9dd4933f0714ec96913947c68563d34fd6c02203e8c37d835dacfbde9ec5b2be65d5fb2d981b1f8d65d49441bfb8c908aac56b40121025dcd75054f6fd7924430a1ac2aabf221680d84d2c9ed106bd256755b763742c2ffffffff43c255b5b256ca32b881cca5995568d9ee5f49b982533c01fa838b34c3f57970010000006a4730440220232746e1a57cdb50a3ad047464b1a8aa0dca3a1da74762fdc0e6cd1986fbd242022000896d77dac2c645832b84b219cb99f4b3812536fed6091b5b0e4db5e89688060121025dcd75054f6fd7924430a1ac2aabf221680d84d2c9ed106bd256755b763742c2ffffffff0270de4700000000001976a914d5a1708c5ac5aeecddbdf733629ae8051c1dd22588ac605e2904000000001976a9147aefb9b659e52564d4a1952b8c19cade45c11ef988ac00000000010000000207ad7f5112dab5756d77a10500dbac92c24cb1e3dbbc7a4b21997833d18d6c0c000000006a47304402201dacc46ce8be71ea9f05d2ae0750ac002cde84fd268bf1f44e545f84e7cde4a8022057ff9c6fcceadae2c06e1937791945946ca48401120bb0b85833b301f27b6fa401210268520284167fd9cbec6418bfeaa69a6b95263ab6caf50de90bf66233531d065fffffffff1479b5550e244ed919e744422523d5a9c0c22617eccbf098431e7083f4ee67df010000006b483045022100bfa5e22048082957c0047f8b5cb54cc2c7b4a7628b3b787c3b26fc518fc77d0e02205ab51b87dc05d94570bd25bf80642ecd38b79b9444e7d5c8f1a2284b90f818ff0121024e7bed30964a816cc009240f419b452f2fa607f7817b0348ebf7839985d08adcffffffff02903c6f00000000001976a9146cfe792c3a0a0c98efd61f7b434e376faccc364f88acc034e516000000001976a914865cc3bd72f03ffe627e9afe34975f930cedc64188ac000000000100000002d733ef83497065f78e9e4be34e35712af59b3abfc0ab4b02a930290e246d99cb000000006a4730440220573df34812e951f576d181404668f9e51484f8429911ce2e4dbb9b3e01deafc6022024ee33c19718047fad973a5fc7fea69f31df876a0968c7d7aad5f86abf45243b012103ae10b9d6b42375e41d2a46a96024a8fbb06426ba9eac74ad96a52d44b23fe030ffffffff118054709c07a6f1470f0a0dff5e9a3e5cd08bc52e3587c23d9b14d082e5f3c4010000006a47304402204c835b72f876a9f6da1e43edb9374eb8a3d35c61be57c8affa7d4be0bbeb683e02203580f6995722102615a6382bd54ae037b6687eb9414201c7475c7144b781e3510121021db1104763e993b67d631fd8a32972986c469de4bc93e79abbbd5f8385fb42fbffffffff02a0816a00000000001976a91488b3202b82ea6bb8a6ce4ab731044baa6106283a88acb00de516000000001976a9149040b2841c344df3ff623d0eaaf4e52e2ade4f1488ac0000000001000000020aa4255cc5eab10cf63f33448fc15df8d9255cbaacd3e6743ed9b2864eeefef4000000006a4730440220168f76f37c6064bea3632d2d8d9efaee37e8fa596625bddd5d21b45021d4ce5202202ac5b211ad435f7e57f3ed47f4cef0d469a6316608e6174c80bd4514915e667a012103b9d88c1ecb240d015a2ccfcda0d2014961bcdfe03c4baed97f8dd0cfb48d2c6dffffffff22b6ad6133eaef65e9a7ba1491103bd92d45536dfc6cbed40789ea081b05a813010000006a47304402204681205dbb4bbcec817e6de0592d924736c08a31f9fe129ef3c241cf8443a7a802200cc2bc386d5dd0456a21aa8ac5afbb232859f5f6f1ada92f8521b20e1fd4eb5d0121020b1e3c88e6f3d59bd1261b90a7ea4cc6f2a4d1745578ae5f4e89f438fa117365ffffffff02a0816a00000000001976a91417165c22935f0bada6eea263fc2947b65f455a1088aca0e6e416000000001976a914061ec210d7eba807380593791f612537cb04408c88ac0000000001000000020fdcef2f39ed39d6e504b3e76ab3ddf1cae5ef357fc953b34e447fae76ab3cde010000006b48304502210080b4c0833662ff57e079876972c44bf51fb48837b39f09ed558ddd6e1a239f910220792801ff71a42eb8f52e248ad4c5d122930fe2ab80b09ce420eaf09cfaba768e012103e9ed96cb0e760f741bb000694e0290ebecd0bc840c7f335d781661c7dcd2a531ffffffff0b8703942b0d3f00d5181916f975d7d6b5a7332b921178422aa8b80032926651000000006a4730440220350cffdbebf231ba8d782f588929fcea2cd29c5828a86120d8c285925114f87002207847c151ef0eb77de8de6f2883c15299723f02316eb1bc65a85968cd5d8117ab012103e9ed96cb0e760f741bb000694e0290ebecd0bc840c7f335d781661c7dcd2a531ffffffff02d9100e00000000001976a91447c91ffb08cd7b928d747bc562360d3896bd769e88ac89d61500000000001976a9142f27cce7583b5c71d868acb03ac73a4ed8d0499088ac00000000010000000275c5b1d893cb0966184544f8f78f4d049800ef3d51ba6fba4c9b5531b17d0d09010000006a4730440220194a8228db0005cbd9946a483be56773919ca3e68723e0f152c5872861fd0da502201a800ec1e3cb712fbf92c3954047070076a6326def11a012ce6cb3b4cd4fee3201210217b98fc6ca373b5044a68c67b14f403eae104d374615ae7164aca72b8f3d31ceffffffffc1adcfe198c4f7a3d5e2d27861c75cb03ea586f3e1014a2f091a3f80acad1528000000006b483045022100b029f35c727e428829dfbe03fb4048ca42ed32b20a10971a51459169e5f7f2af022038b04d249cbde59f980291e8ba525147cc6f388c77f6ff48209c8380be65d9aa01210217b98fc6ca373b5044a68c67b14f403eae104d374615ae7164aca72b8f3d31ceffffffff0240951600000000001976a914d603e99c11a792ccd42d1390a790860f244b8d4788acc4090000000000001976a9147f99d0aca72e6e6273bb0fb5c73a4fcce97e09b788ac0000000001000000025e6c78b8f667c245c64fb1d0474478e0ccc9248e058a49a065f07aeb1845f6cb000000006a47304402203b349a7cf8eacfd777028e24dcdf7f0532a3590450d6a7c6cc198fdd1f7479b502205a5dfc5a7b28b71f6bc3abd918f77b9b51dc06274b551c61ffcee5d97956d6d6012102f2d6427219459a7f3d80f0701327ed1d46cbac18b492c71191d2dc5a0c4852e3ffffffff968effa108251b148ecebe8cc04ee2ab4ca1bbd14eafb5167db64966aa79a7f8000000006b483045022100e08bcebc8593e2e18ee8c90a72d76ac87faefa240f76c012466186d4c0229115022042fadd9c42d9b47f6a570c91aec8f442edc1d71bca13fcb3f6d791f08909f2920121029b3b1928d93d6647910cede207862966d9cbf3e9202dd3be7f33193b96a62848ffffffff02fe523500000000001976a9148526c6ae31dad6a30a2baf08a719108edebda61288ac58b9b100000000001976a91481acdcaf941addbc6598e550510bac80f1595fa888ac00000000010000000200d408d2b11c3e1caf274292d694cd5b662bfdb13a7e6a0ac9e945ad935738a8020000006b483045022100a3a364dede88d9417eb8be28826837bba4f735c78cccf6c7bc07ca9f47ae48e40220011c08383ed535177c748b72220bb4bb87566292114b996740865c18b6a2a42d012102cd982182218cc8483e81a9b0b97c5b5536a14701933153c203f44385585e0864ffffffffef11c6489fde3c8f26e38f8f701a732b188e63f3c785bc4e94922228939784c8010000006a47304402201e743d809fdde4adfeea9bf58c60edc46477cfb897ffe4ce288a52af9ed8723d0220604b7ec70bb3638c7a5cee8e0364465e8ba82c0ec62b25b685942ecc29a8bb6f012103e61a738968e9bfdba1baa2f60df937f08bdd35648386176646a1b84e60cc27a8ffffffff02a437ff00000000001976a9141d056a8219412baef83f66761f7b5a731efb7db088ac3055f90a000000001976a914144087efc23b69e22f8567b68f97085407c5e65c88ac00000000010000000288f6595dd9f4c10e7081373170660a6b7eb92ffdbca19bd5b9044e6fdab903ac010000006a47304402202d4ef2154a92724b4d88d92ed00bfc80b8b3968a02823ae073205cb9656ec1b5022005682d3ba3617f0ffd618fbcaf88eb092341972c27f085d36fc95a984cb58e7d012103480afd63e1776625a34e6e3725374f2d02f907cefaeac49a99d1d52c0e88fadefffffffff5a3809c204b01f7e8d35c385c8e0fb6816eaac3a0c664b58678773c4bdf4ec0010000006b483045022100c6658f4be327f7063e36d27fb3abf1beda3ad29753cb1a1a985d24f0e7ecd4ab02203cb27100074d4204e215acaffe7fc57e200181e541ce4e65d3abfb269af980e1012103695cd4d4cda0ecffc1fb02d6ef30e938fc547fe6aaf03bb71498023deb189098ffffffff020fd73401000000001976a914815fc57b3d7c354ad62167184b4887e5b022ecff88ac207c0405000000001976a9144a85bbcc358084671e19235231f8613af17b5b5a88ac000000000100000002979a4650eee45fbf65378519f4818366e7bbf7b36708ec477005f0b1b1f4d84b000000006a47304402203721acc3a0f80429505a77f019b5de4cfa48c0ec759e12e84e1d82c8972572420220193f92fb6fb174274a626f9172a4afa09e8c747012d9c5c529936ec2c0f1c6ff012102ab2338236898ab69a5286e8fe5c3ca1a3cdc283fe7d584c38bdb4acd3ce6f807ffffffff5bab42c2d23a54011c2a5b176c928a9524f9d5cc2e928abd17f28b30a6ec41b4010000006b4830450221009998ebc0850bcb1a6f3bb1d1c0ef323bf65325725eb5c83986e0cba666e6c1560220055d005a99e2035682014153c2065ed2805419802589cb3b82256ef69aaa67230121033e3e6e1457fb491ef9caea05dc9a07186a18ff54cdba199cfa191263ab79fca7ffffffff02a0816a00000000001976a914386ef9c107bee1e89d0e65e64b43ce66d744a65988acd0b80305000000001976a914e7a044d4be95e77616cc886ff8421a1f1d72efd288ac0000000001000000027f508c366baf8d4f6659cef470a7d53d3935ebc37854e44f25ee13962943ae19010000006b48304502210086226e67d0fa4adbe7fff6d10abf8a2eca0441958987eb297a53bc95b9e2837202200ef802e4bfc760f9dac9a3fefb9f86ce91bec76e3c3c6dc768d3a97d02fb9e44012103e124716d7ae92d6fdce83c6a9e09fa856e4cf1031a7fbfc8dd8df944c04133d3ffffffff828079d5d035e89f34f21f34b24c91358bb0e5c9c6bf7992ee27e9c3e55ccf6e010000006a47304402204b3a1f66349edd45858b5b5492dfb994aee2c7f8da3b01247fea886af648e4a202204f8996089afbdc5a2627445ec9e523aba10d3bc8fdd1dbc55baf8ee3504b831e012102b36d4cc56a1b60ce6e83179a7d6ccf766a08905abae4b468552439d62c3b47efffffffff02a0816a00000000001976a914f010927111dc57c36e0bad15103ff902f201270888ac207c0405000000001976a91428b859d550b60f738f63cd7683e20e4fccbc238588ac0000000001000000024d8e075f01d385010fa29db044c4d076eb81cee9f3edfea95107f30733943b75000000006a47304402202dceccb2ca0b0c827beeb8ab9a8a6e11336bdc485f8285b0032267d176c5b06002206df2c6c513ff8bdc2f4c95560dbdc707af4bb3c0d4b12b968663b448a07428b201210272cf64a12745a5f667f0dc6b9683935d904b82a2b87ad30bba9d889af41e33b8ffffffff6c8d26dbc1df66c9e89bc2f1e693ef9357b1a2c1c8718ab3ed95b67e6fc8e487010000006b4830450221008c69fe277bde53d4c58454ce79988dda6ab84a5166e982293f82b01b82cb1aea0220613d28378cd0fca023273413bef399df6ba4494bf114e369f83d505932e58a20012102a355c0f9ca1c4bd85b311e7022ae3dec8778a996aa59cb84024c8676d1b27d9fffffffff024e420100000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88acb06a0305000000001976a914f837b82d64e980f2ee90aa4a396813f3f384701b88ac0000000001000000026e8856e41cb25a7f83d9f0e80e9647eafff5734271a6f33034ffe582e7e9d67b000000006a47304402202ce7ab548ed6fd311f97e077ca5040bafb76613dcae65a0e7b4eb20ae78fd39b022015f3e1f02e76e2705945f1eccc3bc786d8e7767dabbd7984003373acf1b409eb0121038f699ad28531a2f289a047109887e7ca54eaf2a1145807691d3865f19149afebffffffffff780999a6c037a53b11036014f11413e47a121311e6d1b708e41b25046d941d010000006a4730440220178edaffdece00939f2ef53770b22ada9a80b6a85c3db70a06fdd30375821ffa02202c588b53297652c2977947760a18fb093edfd30f839f67c0a40890da08bdfc7a012102bcbeb1bd8ecf16341c125dc8cef22ce279cb2f7aa3a6962d3317bcab0df415d3ffffffff02a0816a00000000001976a914f1b982d0edbf0fe2800984b4072dbfa7ba1e456688aca0430305000000001976a914cc2a6c4456efa8a406b31f8fb176767f5008010288ac0000000001000000021999caae7cff20a3999d239c2ac37b33c691fe388093b486cfe60cbcdf2c14bf010000006a47304402200228be2c367747e4d10542951ddff0107a63eb75a4bfdde11ff1cd4187f43a4002203702c888fcd43092133c4251bef8217070431a2000547d0b2c29697468bf6cfa012103a7b1cfc17047b784204cebdad75a74830afbb93d7c93fea710b570f7b7700d1affffffff504896177154a66d9b0f14953e9723eb5de6243af2b04c302b80f1c15fe71a64010000006b483045022100ece38b3847607489b46b130939ffff67316e1df0746ceb217be1d880fc96c43b022039bf5bb9c97e31c994e3415fcee405a1a7e2897c1c3dd10d00a42485b05e067f012102006401aee16b4deead58f198578bd4362400781aa1373410fc3ae2814e698a70ffffffff02e85b1b00000000001976a91439d5fb440dcadbd39a8067d9143b1869491f182988ac40e72e00000000001976a914477971fc8627c655129474bf6a92f0de6dedc0c388ac0000000001000000026b7b73021876fa16c092979df237c2ec45d2661e29d9e864a39df89127f99828000000006b483045022100f2d64cf66df56887c66d17ddcb8e7aacbc99254d51bb4450c5874d666bf628b4022009650c243a6d9ed5aba09ad4ca68b3a61e8b2d7cc3f12e7180c3d115c3d57ea30121024181a8fa7c766d99736e3008e4aa470600ce4525226ebff294e16d908c73306bffffffff7dc4f21e738303c1c6bbf25e6fc07d554ade3c6fbcfee00111168553636a7459010000006a47304402206f486f7208afd1709a459eb5126491bf278d61a673bcfeda8eb8a87fa33075ab02206d91ad84b46e7ba8c256681d16fcaab20e9b229973dc0df6b0c5a7df7e9790800121031f775a457c3c420076a89a5bd58cf366d5f3078fc644356a46556ed707c5506effffffff0290940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ace0c81000000000001976a914070ce73eb5b4238e7b3b75209e8903e2939973de88ac00000000010000000215988968ca5719bf744b642e8c524e0a3a4f128d2bf714a3ce69625b3d297e91000000006b483045022100c7d36e911e058977d4be5cf015194552b4ba0ce9b863d1bea755e250f760f2d402207ad8b1764fec18f4a0607904d565d6eff4743486768acad8eff31803d48d22df01210257f88cb0517870c1e55fcc3fa3e838867b1993b05c709b77813e856e3bb2181dfffffffff7613a242d4438cde80f0572337f058d89f9183df8bdc836081fc0e860b58e35010000006a4730440220428d125e9aac377530f332076c3505d548d8bad5cbb2d3300860002914c36e0402200de8b7172bb8dcbd64d896b706acdb75590d807b8a426c907ad45d447294d09b0121036ebc66d5aff1bfe99d9d03f1ca6ebc3e11189ba59033864172f7164041be7146ffffffff02a0816a00000000001976a91499c25bd194f0af99428fe390efd75a70dc38d7a588ac901c0305000000001976a914cb1219ed2c9f0c9a11b6709464a7ff32cac341e888ac000000000100000002b8509867370121d55ffd736c50ceaa4c19d12e95c007eed3db780ed06e1f75f7000000006a47304402204c5b48803b31edeeb5a2e89ffae3d49181ff5bc73da8f1ae315f98d00b4e259c02205e883051380c2185a6aa6f924f78bf271cf601a48e835a64b6036fcb7ea4f7d00121025b85c48f26ac5a19106c39d42e5979ecc66b31f102c48164ef3b84f7c3705d0dffffffff5080e1c8984e0208ca230a2c988b55512a899716178e34476b2e46774a9168d2010000006b483045022100dbc83beb38dac4d38b17abdb0080e741c160f0c6fd160840e4a887ac48a8f4d3022032200ee96c3538ec7343c16b098dcf24b622b0ce9838abb713d1b7d3967a11cc0121025ca57721b3498c782a8e10fe710d1bae2363cd4f802517eaae7316287335ba75ffffffff02a0816a00000000001976a914b41a83642bc3e0867722845009e045c0dad348a388ac202ef90a000000001976a91408bdfa92a6b7bcac61aaa43dbc49b76ef2be6e9f88ac000000000100000002b2f9560c47088f7174e0b94109a8646eb081886c1891ee4a5da1651029db759e000000006a47304402207d90047769423320a9a9595fedbc393f228aeb6147bdc12e8d0039fc96975ce502202af9bd606390b348afb757353cf3d293990b40e65f06f505c88e8d2e7f412490012102808f90269d17ecf4b9f44ab9306b1e594313abc75acc140725a32efba68ff979ffffffff7b5051cf1a7d59cd01e62e87a58c36b61319d2561565a68c211e18da2ad5a28c010000006b483045022100ee9bbc8372ee3f9e8576c455e447cd9564d2812e72595fba27300e388597d16e022032a779876485b2bf7a7d6ba149f80a8969bc6e4889c2425fdb8bedde844f1f3901210377c79f19e84e55475478f64bfe44fe849a16f71068d48536623281193f6501a7ffffffff02a0816a00000000001976a9140911f01392b31961af6dac6512a4a05447c547a888ac10550405000000001976a914148e47bf8fc40f7edf7a0f0a44f7e1a0b12e4f1888ac0000000001000000024271213ff55fd77d67f7ee0c7f9f975faa1d16c0b58df83dcd57a9db119a799b000000006a47304402200d8282ce1530b784f1260e859571a76828a6af7372f0b30ba7acc317d3b6564302202db4f4cfa4c47d0a013b8806c6663ee0375763f77dfe6e5c4d513c1cfc98520a012103866c2e2eddd89b9aeceb4cfce10b88b7a84799e1d65201e93383b4f3efdec5dcffffffff1f00ca1a8c6f2dc6510d63caac6bfffa661b165c1930b90ea5f998a7e493fa0f010000006b4830450220621d408c90b76618125924633dcfc4dc1668b7212fb43c6f2576f48f2e4a829b022100aa1872ad30f3aec0a8f0351f23ec4b07f6be8d92e44433f2c8d9ff54e8f97ddc0121027a577398f02f9f81cd79da218558570345fdaca3e0074eb5e1b6b45cb5188ea6ffffffff02a0860100000000001976a9145d652c3bbca3eddb6c023553ce0fc26036bd536088aca6140100000000001976a914e2c0a3998b12953bdf922f542ff4f43c7c9e0fb588ac000000000100000002c786075c5f31d7dd157defab97c577e5fcac791f2df79559d5dd13c9e851d3fe000000006a47304402200e1a652c53f1d8ab61f49efdeee94e2822e86dec02185afa5118397c99e09c50022070f21249760941cdc8e31ed48e5cd9a42b256f501bc6c410f74f0273e09da4e801210395b1e41d8fa1b78df22731b1f0f3fc471039584c0319c10cd5465f1d680bd4adffffffffe7dec6f027c5e60367b60c3dfc33dbc99ab31c0f08ba81db440b8f33f7ff5909020000006b48304502202fe70686fcee4e678d044b50ead1a58bc337551f6759bdd8ddba7744c621dd4702210099905778f2170084f6009a7324d016ec018b33a0db0c642464f03a8526b816ae012103e717b57f5fcd4a29dac75ce9d145e18da81b9b35794a554e4c4dcd8003d2cdb4ffffffff02a0860100000000001976a9145d652c3bbca3eddb6c023553ce0fc26036bd536088ac96ed0000000000001976a914344b23758ec64f844f02d3297d0514367d5a153888ac0000000001000000021a20714c27a7080858c0c5b5278a319235c42f4a383e95e363c2d902c7c4fbed000000006a4730440220611e4183e76dac7c4739e0a7cc68de7cb10bb4a3fb78f660886d4c3ba8c9b33802205efa15378cb3b9acd7ce2bc9dc7c1e90b2add78a3dde5b328346de9406c1116e012102ef3227458812b2bd2dd7f246f692be260ebd9ff2e5ad9f53cb79275aa5909910ffffffff05cd21215c05383cc01a3815b0988accb0b8d2cbcdb28561195c52fb98044aed020000006b483045022100f967f1758f3e4818d440467aa69cc37689c0579f9dc91b7f8b5ca01623edc8ac02204e727e700afd846258ca527f8f58898933c7caa9a81cfe98c8282fb18f5b976301210237e44cddcebe1a2eec07da0c4347bff5b0e418d172c1bb32f2a7f9d097da0209ffffffff02a0860100000000001976a9145d652c3bbca3eddb6c023553ce0fc26036bd536088ac83c60000000000001976a9149f4fbf3e3470e2fec2aa0ce6a1dee99440e3c41888ac000000000100000002d5cfa6db371dd89d41a07121d3abee951ebf6ed82800176cbf8d38d30d54f9bf000000006a4730440220413588ad17f2a1845d8ab29969f58015900edfdc087b556391ba84884e770da6022069f0a17cabad9ced0e0475085f95c8be78ff802a811387beab40fa3f0f0dd9d80121036964a9afc936bbd8d8ec62aa2f73ac111081e16e4c3aedcc124f814dbe5ba416ffffffffa9b0d8bc1234251f9289098566ee8c4b1f4bc0db80e606328e255ecb4f7c27fc010000006b483045022100d3cc6e4a31517497eab1e7d95d7a66869756e64c42d8648ee8de8d70ebf7fd0902205234226cd13824e40e8f7b58e4d9f6bc58ba638a548a57a5344c0b4a48b06597012103991b102b99ddf9c35ae1c15e9ef6f5764a616b544aafa8bd3d2f11f7e48449a2ffffffff02e0930400000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88ac10550405000000001976a9148137e8e362940fd5f0710a68018f96928ba8f6de88ac000000000100000002f46b732f4e448e6a19542ed0989d0772af8d72e8152e890b41a26ae1b0768a9e000000006a47304402203a2ab1246963313096df21d67564b9314d966ebdca7cf378b9f1c267c2254b65022023405fcf93530461af685e254783af5a9c47865c583616122085eb1c283cb8b8012102fea54ebe4aa11752f8ce702935bbeb94fc996624f9943b3bc97c99b5499fe5c1ffffffff03f6dafec083f45ae24c61d6b2b3349011a2b3ba7cd497fd408fcb29f44eafe0010000006b483045022100ec97d31ab3e71a785e0a424d2c91f7dc3415a8dce7b4b90cb78dff41884ee0910220329521b70398d1237a680c842c4db020dc4881c6b38ef9841eab4765abdd5cb301210322a797a52a8434dac1e0b400d3f29f21eec6bcbfe412baee2b39e3376d6c60f5ffffffff0280f0fa02000000001976a9145e973386efc0d41c2c14bae325f9e9b886ef465288ac002e0405000000001976a91406bd0618011c3ef1ec53fe3705579a134d4f717288ac000000000100000002c11b26274cd760b83f078755e1244b018edb4cdf07a484aec1ab07b2969ce39d000000006a47304402206c2ca65f6119ede86e24248e5d8198c4a74438affbcf9b7ad70c89333687ddce02203099f65e40684dad3a19576678b699afd0f87160c3a13b78fcc45f96ede38fcf0121029954ff4f448fad13b12b0ad579777849bdde42c2c9d1aa499f49da758b6b42d3ffffffff931e2dcc39c17027bd1dd8df5696df286f0845a01a1a7a74a98a34d73597c080010000006b4830450221008fbb32d4b16d18484ad20dde26ac310b0fb17d346463d58dfc4427b627d8eb3a02202b6ee992dc071bf9f335e6bdf736eefa25157a6d36d1834b8f883ffba7f67947012103d63a701ad1713a661966b434b17beca4f3c36f71744ce7bc2c585d39f60f506fffffffff024d94f002000000001976a9141a7be74c540d63af1cfa80ce51cf6793f00f625988ac1007f90a000000001976a91495303a5fbe53d9cc04c652fa05e62ac63707281388ac0000000001000000023085d1889da0651ff783e9e3ab4f85b72428c44ce599412d37d607707860bf41000000006b483045022100825e098d80742ef274047684f8b19fa6a41ef01d2c60635747060a34f90b0c7d02203bce2f02ddf6cf395b4cfc91ef27cfb4e5ccf80c8ba997543e5eccd9a925dd3e012103bad7d82b3b363dfa1f67d87b985bc6075698fe153e418265535acf7a7af28d22ffffffffe2138af8e35b213719076b01080dae538edd67e0171647f45aac25f8ec8591db010000006b483045022100a057c10d003d3e967fbda3094d008675a56882659c16d429d7fff649b947345a02206655261a08ee60f73fdaff9230028bedfcb07c0617e067fc4bde0ffe6829d9430121029c35ae2c0bb79c9da6261fd7548dbcc3d6144c10bea220cd14615adc868a0a2affffffff02a0816a00000000001976a914002ceeb17ee0df36623388087e681927fe70d9d188acc0910305000000001976a914c7547fa4574ef283c6d6f76298ae7f3e57e286cc88ac0000000001000000021e8357e879c792b2aaa13a45ac57415108cd81324c8c80e7b6f534775973eee2000000006a473044022053a162a420d30dc306b83e86b269f54f78a0439813ead2905c8eeeaf9600b2d2022050277e466d0bcca7e48f455cc1f23fb2722d108e67c47d4fdd6a2c1ec6a5aa5801210349a65d62102fb61e3a09e4d276e7f92144248a98eada25dd7bf3fa16bd05460cffffffff3a46056158443ee52b73ae3d84fecc3c1c8e64f9dfee5afeb3d42f9455afed83010000006a4730440220102900046fc27d1f57039674e6ed19d40c0ef6cc084cf699419bac07437cb6f7022073bed864c3a1e60b8acc8c1b4839d3e1f6d55a27ea9d01083058f45574b16680012103743e51e12e68bb309137ecee2a08506b7e404b42081ff0a4ba13a34a3f5cb6a0ffffffff0253957100000000001976a9143587d3d05411cd98d1786ce378331f58f97a7f7d88acb06a0305000000001976a914a7ba90f8826c8d6435773e42e0803e5820d046ea88ac000000000100000002c482a3f7e2d7f11d1c4aeb42ee682b174e68c94be6c39a19c8ab559f6a4a91d7010000006b483045022100ba3b33077db92a48f2fbfa90fde65eef5ac53dcfd741f6c5b3a2e37159e02d72022004edb88cc6a29e3a085a208aa26cfe2658d87ad0daa6b41f4d7a96aa8d38eda40121035847609306643963d2e2d844f5cfc0f9b76cb69fb9ffe5b4339d73bed2cedff1ffffffff2629c89243ed386ff1cf72db5f0338c6bafc9cd1d70b7c9d53ed46b227dc7cfb010000006b48304502210082abda1148da80864d5094c7dbdc35310765fba74f02b27b1887888411a9be59022077409db3cecf065570534e85e2d38f8dc7b35db27220c9f752175efd722cbe1c012103dbf00eaba88e27f17d9189a8e14052f3429b9761fc5d957330d202d97025057fffffffff0241fc1500000000001976a914f0d429e6d8d8d36c0165673d33b67e4e2f913f4c88ac749b8100000000001976a914df3fbd4149c7b6afeb53a67c7a90f162c6ca7c1888ac000000000100000002e3c3506f3e67cc88f93b58ea46c2fbb0edd096a8de6db87e44eb028c23036104010000006b483045022100ea6c8d0c8e3621b6b30395f81932e5af1542a3226491452e6f5f622cdacc60a60220728dd86f9e8516a97dc07cce71aa2f7acbe8d1f8a4b81b370c624b81138fcf390121024215b3589e7480ccd8629d5c713f283625b47e5aea4c6c841deea8d6e6df40ccffffffffd91d4ee8d48e1c30c31d83b0ab3cfd0f6e00548a225331eeb9092a359c996c08010000006b48304502210091d0e2339949706ecd24fc4b808349840456231463b5d5b13ad23891aa96ab4a02200d744f8de39e6428f729f1836c7b829f24eefa1634b9207ab3bd3a785a9f1be5012103681fc5f02e66cab042fb435cdfec50161bd8515face56daaefd17f2da2c11e71ffffffff02ba5e1400000000001976a91409aa254bb4657e3b21ec7d69f9fa247fa4cda6d788ac08305900000000001976a91419fa36dc4b0acbe1748b49f107a59381d3a978ca88ac0000000001000000027914a7327070ab80e4110e07f60e5d5e66956e720af978c93d1af3f9f82e591f010000006b483045022100bfc1a7e7691dcd7cce99629a5fab4545b74905f448208cfa0e5759f427ee8bc702207ffb0c5db35677a09a0e1017963a9d7494deee271f956fdbfdfed4540dcce54b01210385196dd616ca2f58f560a8bb45af8ce1e1bbecc208210d276ba4d7a8b52d6e8cffffffff6d3ad0129eb6b24cbf5da6a99096bdd8ebbe74b6f76869d80e571543430d405e010000006b483045022100c837d1c1ca9ffb8dfd0dd3fb0702d32049c9823a9ab4b16bc6da30036959f6d40220378ba55837e0c5dc61f21c904228696cdf00f8833faed12bc0a6e9f03c5de4ec01210385196dd616ca2f58f560a8bb45af8ce1e1bbecc208210d276ba4d7a8b52d6e8cffffffff02400d0300000000001976a914a8da469a68ea3583d96096477f64c39708faf98188ac916d1300000000001976a914f0c52aadbfa7f5762fa25cc52cfb51e85e93aa3788ac000000000100000002d1bd66fed81d7ab4cd76f7e78018e0a49858740a7de0082e3360b3bf8056527e010000006b483045022100c04d07e3a1fefbaf109b3d2623339c2ecabde6339343e417f2f2bc861e5bea8c022071f3a9bdec10f0d4198f3d55fa6ded000894f0eff5a880abb63cb731b0059df5012102e486b0256ecea008d8a08f12ca3bc4ec4405bbf094928996c06b23f8f6f22f7bffffffffb887239742339607f1545452bdfd77831dac89f28301578f63047ddfc2613118010000006b483045022100b0119f80160be6146de4248b5b8e84fff06a3f2ee2f0ffa7a342224938235a3d02207be2b03bc292fafa44b7a23a6635be7a32a63ce7c010d93df8652dd2bf88241c0121023eed42e6dcdc67c3fd705f550e52b46b3c3a28996070b32810d89b5ccdd2c825ffffffff02a0816a00000000001976a914d34efeae030a6205ca0ac732265135cb2e81276088ac80f50205000000001976a91464e1ac56c528361df4311a3a8b5a85435af76d8588ac000000000100000002bc56cccc848fb8d36da5137c0651dc76344524238105168203c4c77c451e348a000000006b48304502206fb16f4d7120b21b91fd5e764eeadb111dc38ec7679445b101190f231ea585ec022100f8f7708734757d7061420fe44fe817b00444047cb374e8841b9cbc3679362e330121023ebbee01e320256f627472e0ced6eb286c81b91d8d04c85946d7d94ef129c944ffffffff46c00e2c125416f55a3f80970e4c25ed1cacc38c962e7d47f30313917d3cf54b010000006c493046022100d80a9f80adde5743df3c434bf942c9398239618789afb4a441b0bae966fdb1dc02210081715bdc4e9281e745655792cd2c0df92b7fa3634ed7abfca60000e8527e6a040121031afefdb3aea29c87aea6715db312ec24e121c25869db8a63e73fc101f9618ae8ffffffff02a0860100000000001976a9145d652c3bbca3eddb6c023553ce0fc26036bd536088aca6140100000000001976a914d430b47b98608a0fd19b464141b3af901d2b12a388ac000000000100000001f8b80894ba7af99d6b17f16e34db171dcf84581da6b063376f9f6f54f0cdab24000000008b483045022100b93832b4c2d5e7d1262b21f850e76cef0866da3198d640d00a98334f671627e5022027fd034f97df2a81a61d80a9cf0853d11266ba3a4696604b482cd825919d98bf0141049e49d2bfecd21605de70bc503564344ca1ee45afc8adfb28656cd4e3325ae5b960a8241946734287de5215c62db9c3a4bbcffca3c7dae450a292142c119839c4ffffffff06ac840100000000001976a91412f4419859dcddb5d4d62d5f923ad6bda4c9db9f88ac6b040100000000001976a91415f3df88eaeba96ef97dd032645eafce0fefddf688acf0490200000000001976a9149c6bf207cd1ee30d1563b3b92d7523047c9ea32b88acc4fed403000000001976a91462686d5293c035838bb66dc0e04d380986e50c4d88ac15160500000000001976a9146fbc4ddbc9ae0d03465d9080785a029c74f93a2788acc0e1e400000000001976a914634b70f3c673e77a0febdf225ed1b0dfdfdc922188ac00000000010000000289a0948a1159e49be2991810a3181c0e76f104e991a2ba8c169cdce977410819010000006b4830450220152d2229317d63df460dd75a3b57962ae4448c48c1f912ca6833cc23a4df888a022100c1e4d403c743855b52d66f934ac6e0c096fafddb118d02f4dee160b07e8c91010121036fa2b565e6e89ae7be49c13a262c78090ce175e34c83137e5406acccd3fa55ddffffffff2685e93c245e6f9d01395241a09649da17edd20fc6c57895cefa03366db954df020000006a473044022059eeff76a500422300d4f72d9344f620fb9146f0d7929e166e60fadab849195602201fd1fbae2bd93b431f7b5b98c279a399f31f9d878427c1b32073e6d1ca5204960121035f936caf2cbd4621258c91648eb6670456039dcae2a63af9b6b074c0b259d301ffffffff0330ea8901000000001976a9145eae8b4267bb430c9ba061ff057c64ec041a707488aceebb2600000000001976a91494a0509f4e6d51c188e272acdeb792a5005f007788ac8bed0000000000001976a914ce8b25fae65ab92e27f2c4241e1d347398fabdcc88ac0000000001000000022d23d6a723e3265bd9d29237a2b3dd5614b4a047c298559f5b86603896cae947000000006b483045022100d7fbf5a9b6aa624a016e1ec3a97ab0f049d59128375a7255a6f65cc135608ce60220599bea73688398b6d8c19bcd28b7caa355fdad1d63c0ddb84d53c10c948446fc012103be40978a2d67087a9661fbddb819710e9eb9ed9fdf8755dcadbf96ec9c378d78ffffffff83c4107f884b5c6caeb2aa68d6e3ff77a664229ada5522908d9e14039a8959fc010000006a473044021f4d0c8a634d4d2002c372d00eb8752016a353aeed989da810a0fa0b75d04b01022100cc26aeee7821e7c61d4be101dd42731154e14abded80d34ce760675e4ab2c286012103b8c7ba97104cb235a36a128f6af372ab10b7ebab8dd9ee2c6286ef18275a2ea8ffffffff0230ea8901000000001976a914b74f3f01b5de6ac1f936191cc8d671dc0a8676c888ac8c3b0100000000001976a9142744ef1ac889dd840155b6eec2e3bf7974b1053288ac000000000100000002182c844d3f7aefa3f82e1d45971d707355b2c4e5f4c08939cc049bd792996cc6000000006a47304402206535935bd34578bc65ece5c3a73d0e345eae633b194f5c60dc0b3226e7309cae022045877a292a3f8ceb3152004cc5fd38df8646d011d8d8546c9b6a62c68d386198012102ce098a635247d8defff83a9e9979d33e142be12f16b3f3a582f76b0a67b6fe15ffffffff552478ed8a603ed609950e8a9ac513f153fb98b941732807e5583fcf1defe686020000006b483045022100af56fc68bea0514216f32507de5374f2ab1af386799b642044036007f295d3e602204a5ce213ee36499b62682282c20907f2b11d8dd0a5dcb328952e9aa34061258b012103a594e622dccdac09d20809d8d948c4110edbdd93ea640c3ff49a0bf5ad77c094ffffffff0390d4a900000000001976a914a04d2bd01bbb08b85b832ab10b6221e1b62eeb8388ac56150000000000001976a91495fa0f5cf5e377281a8e3909f0065abb33db77f988acc6620100000000001976a9143c8e7d9e535dfb641ae29f8647936b42ad03f2c688ac00000000010000000541312cb01869e8eee96368c1125b7d91535e17bb06798ad98f34a3e386e0f220950000006b483045022100c4c1b7c729500d73ab248632ca9b4819251d14386dd55ef1f61751103e158d5102206b09d5782e820aac90ee919fba9c17c2e9092581eb264d74b71d9a86ab274c090121028f652e4a54313088e7e7f4fb73d7728bb82a108d2e446cbf65283023b2055773ffffffff5d0232ab5d44235c6efb2d9ae6394f4a49ced3ab40cf097d4a372dacde0ac00c0d0000006a473044022079beea33f9b1fb4e64eca165942cc4c323ab0356813a70a61ff4228d7d3ec974022047cd16c6655fe09cf3bd2ef680aadef6a1ffa9a32e0a48fcbc4764382f8cf0a30121028f652e4a54313088e7e7f4fb73d7728bb82a108d2e446cbf65283023b2055773ffffffff6883c7480f7b8f160c362af655d21aa5c3b05da17db3ee50e2c45ead64b487586a0100006b483045022100a9cb3791411f06ef1db4dfff71575c4c67bbd4c896de608be61d731cf7289dd6022048a074e209192190e8343aa712457ef2cd7095888ed7a566b8e8a6e1d66ea9b60121028f652e4a54313088e7e7f4fb73d7728bb82a108d2e446cbf65283023b2055773ffffffff38aebb7fe315aafa5998c30ec4c87adc3cb7f5ed9914f28329a69f5868acf7fe140000006a4730440220209d45e2c5af58540ce3b3da6c78153009b305b045663a155fd57edc39d0553e022052f92b778f2f5b5effe156b6283ac2518fc1ec566a4035bc15a45f9294579a200121028f652e4a54313088e7e7f4fb73d7728bb82a108d2e446cbf65283023b2055773ffffffff78778be44551b3a9c75a7f34e09c2835e20b18b7482d1746eb192a1fc957205ddb0000006a47304402207fc9bc2725f54dbd085d88e61d5922576a4ac6c2095ef53178d5a0b4e2ce715e02202e6ac78aea942ed9c21e14046f44397c38e8e0c103531cd080fd481b6146006d0121028f652e4a54313088e7e7f4fb73d7728bb82a108d2e446cbf65283023b2055773ffffffff0250c30000000000001976a914e3e823e34f1abd9338dcc023f79fc830355b500388ac50470000000000001976a914b9f7064fc7bd10524f315e71956e0f99e5fa090588ac000000000100000002ed1dfdfc257a05eee55d7833522ff33b6afb3335f84ecda989ccf4e9e8cf10b7000000006a4730440220023f200081863df828758661b23750057954f8314f82315bf47e974412c3aa170220171df25777edfb4901ac766b2e8d7b249fa5ba7fea7d77ee5e87391ff6a57b940121037e90215017d835bbf982db3ec66e374b15524b5bc6bab254f36be25a9326fd3dffffffff0391cdb7a8718230ecdd8ada5b1138b65c29e0d64d1284a4eb1fe1c2a22f6a0b010000006c493046022100a354dc0132a6fbead889d9215c4c562791f6a733ea30c843b2c044506ab20ad8022100b51d8a757747be847f63baa551f0b3aa040dfddebf933f949faedf3efa23e32f0121022783ed97ace50a02111e2d687867c806bc723c22e5eb03b9c161b4fab3f9a863ffffffff0300c2eb0b000000001976a9143e6b6a70acd10259138599f7472f8fc97977899888ac95d43706000000001976a9143e54344264265a455002cbe159b0787cea39ac2188acb63b0100000000001976a914c6485a95e9f650fafa3111e412aa7f9a6ff76cb588ac0000000001000000022e25734283e4d31883f6568d4759ad8b59584869bcb84c755738a81e323a6667000000006b483045022100b33fb32e83d7e617d54ea2651ffc8b9009369daed5f09e676fc94dd4f55f77a80220141ed28bc68bcf41458dd166658137b6c9fa8b0cd8d1972b9d4bae124fcf5ff70121039f2a6031c9424202f7cef8b7b12988dc2c56b38f6daac9fcf780c97b619ea3e3ffffffffb13723bbf42ae5561cf3f466bcb4c0df37dccc32e672c7f86a8840017d009a1e010000006b483045022013e112f87bf5fc5445fe79b7f3bfdaf38a383bedd98f9bd56b4df984b71310e8022100b5133b073a783a9276cb3a896e4538bb38b1a82dfc6e141f4227d76c5039f48e012103ef5b44ef71910d7d33fa65e10a064190d79131d3a7526fa2fb18d370266e6c44ffffffff03f8b35d05000000001976a914e2950025e72cd9ff7a739daf8c63fa3c077e4eed88ac082d9800000000001976a914c905ed076ab36f9222d98f1293a9b5710554f0d388ac8bed0000000000001976a9141772488b619b5d385f559c160085f666da76d64288ac000000000100000002c93112ecb46b1b6edd7e7c21c1068a613027914337e434d3db9999dabd4eac16000000006a47304402203c6fe4d398bef623766173066a0dad9e32c43074c70d23f95974619c42789e0d0220355b4d9f94501f08827c6d34ebe1d7afadd55f7c12dc9112ed8eab395495898d0121027626b22d756246bc29cdecd6ec403b7bc05da3e428240e73101c1b1fd7f21056ffffffffbc518d87579634c9f199a6f3c9b052292e81cb9e2202b77938a518851f482c81020000006a47304402206e6d278d280580ce09e2c23c935d78fead2196bb5e5c3c0f4b2b7c22d00057c0022040c304d64bef92012bbd26c1981c03f5107d58c24e4b10a3bdb36501133efc460121026b177e551d34e63cbc7475f445ceb2734d3f608c9587e95862080c1931a98613ffffffff02f8b35d05000000001976a9142889eb319b1fbe0ec4827e4011a9bfecc89775eb88ac432a0000000000001976a914d8db6fc311acfdf22cb92a92a4b968f93d44571d88ac000000000100000002b732ab5d0ea01c1b58ed88fdb61b256ceeba317c073a74adfb58c21b91c06c02010000006b48304502203fd1b5563646d4a89241754a2ab181f982cf66019fbb5477d726424ea80a390a022100d9340ddc563e5882ea42d8816022afeb62caa59f3850a996d698d21de20e50b90121031a8eeff4fe549081d5381028ea9f2531e968932c730df9398527d9b8d1ddc26bffffffff13e16b0440de0e61f5b152f309a6f55b8639abc052020ef4fd9d3397b659d1b5020000006c493046022100e438f42104ff6d659c74de1a53e06eb63d6dc45bc0dad5ebcd8004f414c90e7e022100cca046e3de284a12f94431fb05c74b221043696627e1aaf8a16e087f3d03b29a012103b901443996926e27e51250587739796217b17b48cda392719a058c51e6dfde74ffffffff03ce9e5d01000000001976a91467a8ad6e235f23dedcf6cbaa465e817199e8d1ef88ac1aad0d00000000001976a9141ee89acb1fcf1a9f3363eab6d9624182da5b275c88ac1b4d0200000000001976a91473fb74c6e86395a5a4ad8cd1d257e36b7764e69788ac00000000010000000279d499e9fd2a66b61011031bd603897c8fae13ed3bfc65e86b53ced1e5f80ceb000000006b4830450220412846d13ac134ec893861c3eb454addefc5ed5e966544e47fb527d01ab3d34a022100c09bf4a7bfccb52b5b8551a4971b9b0774fac34523e590a5a70667942c539ae30121025f525f29817a6dd70a81994a34994a4d520cbf4007da8b14bb9a92a6f406a67bffffffff9a52481194ef1c2543ceb1d67cf490a29950b6663b110a5fcc8b0cdc7cf3cfad010000006b4830450220715b7fede9cf2c4d01cf5f3eae17a749200774706340df0fe8ffd169cd5566cd022100a2a8dff19c862d49f9a2626b8722b5fc10bcda792f64bd6e92db579af0fbabe701210340a6adb52fb0954c2bdebc47e3abbc857a83c7764c2b3faa557d9fcaa8957f1cffffffff03cc665801000000001976a914ff4b571a127127f8f544b7fda7caeec36aa78a4e88ac02380500000000001976a91499a32ce2a252df40f33914f3f7864b0aaa0814c688aca6140100000000001976a914ee922dd6e8b1d2d8a574dfbb489ca5b5b9982f1888ac000000000100000002c388b60d014270443e0a494c1877fdb61a75cb1e7376e03de8dd5418314640c4010000006c493046022100e6cc7e6298315f5cc86038c6c898bee65dab860d040b4dc7b2b0949781084f8f022100dace8e79689b2dc6965792f6a46a8cc91a7835e7ed438675e20a33cbfa7598f70121037fdeca29d7c527a18592af21ab5359290d4a808cc7e1ee31d7ec44949a4a2077ffffffffa68f29883331b94eb04cc601f7790e1fb4672333496cf750cd120494708b4459020000006a47304402200e6846a95544618e4d586efc9759589a7191ecaaeb66fc02d3178337bea6df9e022022a054431e43409698f9e1bf262cef80f59ec4c164d0b93e448f9fe91b3b4b520121032eb22df3cb89640b05afc6c480c6fabde5075fa7769ebf703258082d604afb7affffffff03886b0200000000001976a914ff4b571a127127f8f544b7fda7caeec36aa78a4e88ac7acc0200000000001976a91499ac65489e64a3f34e1057310be80856ad7d8ae588ac769f0000000000001976a914faca4ebcceaac4cfd42241d1858a2d80dce2b03a88ac000000000100000002c54d185ad1537b5f762acb43d0603b884aae69b99b884fa60c3da61f4f119343010000006c493046022100ddef0735487298b2976ef6b46b12fd658f61e378a45b7a2514610f9a026b93e10221009315e2b254cba47b4848d61d9cf34a4f623811bac6f637e73a8e1bb60cc21315012102e16b6bb2b9eaabc707918a5196e6a4fee5cc8ff71886c68e45de67e5ba2d062effffffff3c84944cca1481c0a2f707df70e402a12700f15baa6eff71b8dd757270e429b7010000006b483045022100ba90e20a78f9262587930e586eec1cfec6944d6754d1442645081feca5ed67e802204b942722f773d7bc6bfb552b03a6a709b3e0a469a2b32e4afa0acf40c6f8c9460121035eed887a2bd672f9c366e6f8b0b2f6193dc071f1a54d19b558da1bde2917073fffffffff0320a10700000000001976a9149c6a61169c66570f84bf1158ab25d1c3973d831b88ac74a81000000000001976a91469fa4c102148983da4c6e2edb95df8b5183b37dd88acb63b0100000000001976a91442fdcc754031590d4ee0d0641c5533af44fb07d788ac000000000100000002a47a706bc98ca88ca0028299e0fce33b7c81ac35b6dc7245be65e11cd004ae87000000008a473044022016db594c313dbeb1a0325fa8fe5093b9e6d23e1da227d6925c1e4661ed531935022063d7d7d738409da527c58e1c42461938a90ca8ce85c9f53c56fb249e84b2af2d014104f3e5ff8ede92ddfb66a0551624533d483617c54620eb3c34099d6cf34ca900d6e53b591adf84d3cd03491ed6102e960decb897fefb10e4f2dda3bcdd5ea8a3aaffffffff8d1cef0b8201973a09a4ac2af7080d804c2fbf45dbe05d64e655b116c96c6f7b010000008b483045022100e2b518a467153d3da730c34fafaa14322860cfa01f96a6d69cad6d61307285d902202f6400f04589aac6d031f30fb1c52fb62fe0ca50f2f14658c00479e5ad6aeffe014104104abb084087992bdea1607869e025713d3a6d0e3fb3df18a644cb65962f42a770ba3fd78103e1ae95daef4a316fca53ddbf32cd3fe25dbeda1746ab5219d7a7ffffffff02c0d8a700000000001976a914a081c3442ee3ea6308bc63e09a2e0035cf674a5e88ac8d259400000000001976a91412c83b0b7e8c4c0e29083c75051f17cace3e4dcc88ac0000000001000000024df7caa06951c89acf1eec8ba4d341db54317f332fc69bed968031d46edf9a80010000008b483045022100bb88f9a03e3773a1d77426cf034232a04a2c9585307a8a9ac6b9607a9e5c39f402202129924ea267e7a1835f04917fe24aea3045f2366cd65202247e6ddd32ca3e7501410403a90d2402ae72ca6054e35867909be4d819585d1643440b19f0244f3168513cdf3965397de743c4e5d522ffbdd83715f3741a8261f26a83c9574aadc36ead5bffffffffe00a39ef50d6d125850161a6c9e4da6f9a9a8bad8499ffea3da8e4a6da2972c0000000008a47304402200a9cab29dd338232390f1ccbb8ef4596f125bfc04cc3f6655c50e92608963ac0022072f167e796c76ab83df88de4ba42df4931b2f50d5bdd52e4383dbfa14593650d01410403a90d2402ae72ca6054e35867909be4d819585d1643440b19f0244f3168513cdf3965397de743c4e5d522ffbdd83715f3741a8261f26a83c9574aadc36ead5bffffffff0200a24a04000000001976a91450ef40a87ad99ea74722d88994dcac51f2ec26ed88acc4c80800000000001976a91436e71badefc6a8be535d4edbc452e884a431c3c688ac0000000001000000026af5b7e13e61c964a1a591ce415ae8e1b5456d9b8b8d1aab7ca70de94ea0be14010000008a47304402201e3bb5670f7cb52e783fe9fb3776353596ce875fef0a7df386477aba37bad0b80220129ae0a003375eb2995e3c1a155af199186017b0b0e858c0c6558914096bd3f90141042e173326aa9b7c4213256b6872a00bfb73de07691b7df66b368e52ed770168da2d02f6aff2ee18d9ff981308e207d45b40aa361d61328e2a074a78eedc734043ffffffff0915901c15946ce6a7feb1aa2bf733e768ab478c203cd93b8b0d7788122326ee010000008b483045022100f1f0b11f96a0e11f43cdc756bec353f3287e56c76a8ccc4c105224e6fc41a34e02204e8d20e5381f1f330e67f6a4e6b1e4595239bae32cb63dfb097885c795fedb200141042e173326aa9b7c4213256b6872a00bfb73de07691b7df66b368e52ed770168da2d02f6aff2ee18d9ff981308e207d45b40aa361d61328e2a074a78eedc734043ffffffff0230300b00000000001976a9148fef7e2d9c96c18533a3d2a86dbde87fed28272388ac88210700000000001976a914dfe4eb687a1c6e608faf810c76e63766640eb51188ac0000000001000000022c67382f2c18b7e34d504ba1af4e297a700b1f133f56251d0ace9900bcceecff010000008b483045022100dfcb00149cc1a5129ec85843df14b88754a40f0074a46344bafd6722cd33b68a022040f0d75c62d9c54fd95febc368b93b904bd123b3820c842b0804b780ccf67e2101410456f93e174a31f1057aba0d55dcc048a27379d4fbd340bc11e1f068f06dca0b515ae1816eeb1b5356ec865d6ff128eb1fc894ad9ef3e19ac7f6dc8bb0ac850800ffffffffcee4fbe04086954b39c47b10e859c586f6d56136bbd97bfb3b45d531ee0f5ba4010000008b48304502200d63d542e7f5678428ad6470a5c5d2a383edca12cd24c26cc0dc9d122cd5f9b20221009908750817c40d0483fb80548f51420849b0312a950a8b69ebe2772bccccd19c01410439bc6f1ce847b4372a9a542db9f9b750d1d98dcfd34bbfa8cb55370142d2c6433cf1742a66a1e3eee630a3f38a01e2acaf35e672acacf5dac147860becfc50e3ffffffff0200e1f505000000001976a91403dc89d6b8ba0d84bd68454367d0e6a71236141688ac04dde61e000000001976a914d8e14814f57c99df2a4b628164e88f67dbee8b4888ac00000000010000000277199154804960888e8d0745d43d50a937c82a1ae5e52ef70ec675fbdabe4856010000008b483045022100d709923a67c0ef12c61b70f02d3742367359d6ed1fdaaf9d134c4d6383a0793f02205b18fa9906e34b8a8f6374782b81b8614ef4e39d131551dba13c591702968363014104d2ba077618648729173247b68aaa2b6c7522eff5c7d012c1281a3405555d1cb7e0d15295c4b1c690e685ebe7a8bc4a1a1f0abe435a3e15f6136d241ff901ecb1ffffffff0e98d330867b214019556062ace520160707b8835e5b45620d2f447f6ebd78e8000000008b4830450221009571e578dc1e28217731a943e6becc3ed1c907f0cd21b3966978605c06127783022000d8835f8e8f1ed6750acf4d3fe5aee5e97ab915af9649ebf7bdb4cea0892679014104d2ba077618648729173247b68aaa2b6c7522eff5c7d012c1281a3405555d1cb7e0d15295c4b1c690e685ebe7a8bc4a1a1f0abe435a3e15f6136d241ff901ecb1ffffffff0248c54100000000001976a91405f3f88de8ec806b630f616744782b4a556ca30188acb32b0000000000001976a91438ce5195fc77c5f5eca8d8d7968c4d1da01c8b4288ac000000000100000002acaa643ce3062f048dfd839746485db87d32e1e7c804fd985692237a5d030170010000008b483045022100893c99955c92f890dcc8385db3679b9b0871e79530abc66c933b0efdf3a7737a02200da09a1163431589ae7d40c0c8a5250b6d57a6e233688242a6e47b116264c4200141044203a4ef6caa1d5aae410c11ca406a3a18acf331327ac6f3a606b64c77c7c8b8d406660da0bbd1265b1eda02deb55910df5d65f9f46bb28bbca8692e7f3e8192ffffffffd9035b8d84b5ceb2130066d4ebdeda0b280ce38e83069cbf5c04c2b248f4dc1d000000008c493046022100c40f81219ac0f9de2be602e0a3bd6892ae53d0696720765b0144d0056947af6202210083face63ed17861540dbf4030b56f4d900d604d24eb0015585e37e855b0f5f0a0141044203a4ef6caa1d5aae410c11ca406a3a18acf331327ac6f3a606b64c77c7c8b8d406660da0bbd1265b1eda02deb55910df5d65f9f46bb28bbca8692e7f3e8192ffffffff0219d82a05000000001976a914bf745065a9a0d079436846960b8cf63ae7fc8beb88ac327f0100000000001976a9143a08ee7ae37b004e305a60fad7b2125afca3568d88ac000000000100000002ac91491a902c0a1a0dee54f16cbc6a757c5bcf458a92d0f41ad7d3daa73671a2000000006a47304402203070471f2db07ac6013acf38a2227eeed5c360f1a5cc80b8aec5fc102e303c5202203586ef14b54d57fb4f4d823237382daba3ba7dc16cb807a082fbca85b1a74126012103aacbad6bba5541978ae6762f9f35bec99b7069252da2cb83e39ea869d1e7baf3ffffffff96b1bbb7818961ba558e102ae105ba242cc0685b53c7260808f5baefd21c42b6010000006a47304402207148afe56b6fe514e53a1e52f71b98df072b805b7589848f8e9058c90fd462fc0220750712d55b346370fedc740f012237506dca6af02e2b7e5d3fedc4c0a903e2cd01210217f2de125f68abf4c168633925bf4d599e080e944cc03fe905016911b39c5550ffffffff0219d82a05000000001976a91483505b3621e64bf2f68984c64ed2a263daf2455b88ac30a30405000000001976a9141b5ededc1e4da4a5ef8a9a1a9652680e4f77fca788ac000000000100000002bb70d71ca81c490dcebd3e2ba78f6ea60e0fca361785389550c1814cc9f91ee5010000006b483045022100d23f26b30eee4c6ebfcbf9cc1f73d85f799b2ec737bbbee3b6133284ec51f4e202206c2a7e0991a7af5d9d4b1fbb5f50501f0aeb7dbdc38a333a18d712e679ba65d501210316d8155b51902f2a243a23eaeafaca1f879ebfd965d80e720bf469b798a2cc51ffffffff7c51a9bcda17c518c84a037c2e2bbebf08ea27188b8208216acc89f9fb6ca1fe010000006b483045022100f5d77555277ce7edcf7135f2240c77e1797d3967899dc93d7fc4416aecf7bb7c02205e619acfae53f2c24b5d16bdbd3810df2ce04e4811e323426712d8f903ec0db50121027c4bfcfc08e84364f54b3233bd6f33a824b0e526e4dc06bec3d52636658d4909ffffffff02705d1e00000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88ac207c0405000000001976a914d54f583f742ae3f4665fbdcd343861ecc389ad4f88ac00000000010000000236eeee31d64e20665dcf7c1e5b8dc3dd009f93118eebfb61fd6d6cfe20084c94010000008b48304502210096cf1bc0e5900b9812eef425679ea848a89a2e86f0bd71fe7c34ada6b211b9e90220129288c4b262eec85d82dcc714c9222724eb76ddc07eb884fbec3b8b12c833910141044b000a8af1c4a99aecc87965e3ae299b55e036b012f1bbfc380f90d57d82d3a9d367ecf5357660f43dcd601617ffbf2fb8c313087c93a33900811ffdfc8bbb7bffffffff83b9e69214e8e0940c771f7eb1998f05d7bc51b7aee75e38c3453a9410c3f275010000008c493046022100cbd9478c0584c10dbb9246e8d81f1c3d5f05131f9707dbda5912457693d9dad3022100b996bb5ebdcd5654e7b1d9680e256bf62ed99afdae382ec5bb7f7ff7e387bbb60141044b000a8af1c4a99aecc87965e3ae299b55e036b012f1bbfc380f90d57d82d3a9d367ecf5357660f43dcd601617ffbf2fb8c313087c93a33900811ffdfc8bbb7bffffffff0210150701000000001976a914a73e3b8e8256278f2d8849663c82fb571effc6af88ac18b40200000000001976a9145103443c6b76d35b66504057b7ae71cebaa4bd7e88ac000000000100000002a81ba12bf435b8cbc67e5629269c894c0659cbb29f49aa7fd4027bef6e6b1202000000008b4830450221009992fe21779b49f357b3cac97d39fd530e296f131bc6cb93235f1f421ad4989c022045b3f00a979f846c7c8db129a979f0178a4086e167e2bfceb94b829814f4c809014104e4e089924d649c94b25c415b2a288bd9b5abeff856cf8462737a7226756479c78f790b28612567b1f9526079a8cb0a6ff1b6e4a6a205b48238c667ac7fa35405ffffffffd662930550d92a37b1264266c9cea93358a3170431817b47d9810834e61de7ec010000006c493046022100e1ab448ebae82e8b72f4cde8d1b5ff4a97c34df1d2e5c0dd7b4ea866f5a834ff022100e58a0a797456a0fb8ac5d7af5502a8b75af866ba1640460ebe143bc10737dcb90121038176eacd904c105210653546803131ae128921f9ba1a33f0b6756a630b0284dbffffffff038c3c0000000000001976a914ff1c46e1a76a389b44be4eb1d08c000579e728a288ac283c0000000000001976a914175cf0809e205420f2bc59cd682d94a0a1bc03e988ac56c20200000000001976a9141fd5f14f0f756d55ceb13be1a44085215e27aaf588ac000000000100000003b29dee04333b67229c0730193aa3f6986dda63f746c8279cb30acc089c843ca3010000006a473044022077225ce0ad0329759b64aa73685703d9c2c53aa3c54f9bfe9ab3283fd8848e8602200237202672a7ea33dfcf93bc706c4dbfa38532e89c1a2e4e2b8a84281f68225e012102d10cc4a5effd1aa9bf4cac4fa57497fbe93b1c64586074ee56e638eba392d4d6ffffffff4d5e6749ca3c442f9f6ecbbf7d1bef0136716635d5d150fb1828556c0de5d4b10a0000006a473044022069123f16f674d9a6f7d1757985ec74a1d8ac333e1c363d4eab5bd6d0d09cf511022019df6b5702c3e6f15a548dbcfaf3a8ca81f0bde3e1563a94aaee71fec31b62dc012103201dd5c598880b4b45b7c005c742ffa3ec57649c75b34c96d39de1d0c3233c58ffffffffb29dee04333b67229c0730193aa3f6986dda63f746c8279cb30acc089c843ca3000000006a473044022019ff9c54b810c609438be4c52dfe936a44b818cdb34cda41fed5b865e49190d70220527efe1f261c23ef43a00864c6e77fadd5124c4a9dc2a0f6854547e5e6ffe096012102d10cc4a5effd1aa9bf4cac4fa57497fbe93b1c64586074ee56e638eba392d4d6ffffffff0180969800000000001976a9149d1a13901e7d967b3f8c77a40ac2f6a1db595d3d88ac000000000100000006a99a07a35701952744a8583f663c0d55e96650aa2109a32f7bc573d62255b9a3010000006b483045022100a0c4a1a2d5104c91a6b674cb68bbe09fca0595186c7ca32af8d759cb2e75d029022005ae1c955fa981ebe0b465591166e37a1ccfa444dc34c613f73a4b5f4415366c0121036728a719f71f8940b2bb8399d1ff0f00a323b9eca50266b8d9ec581047581db3ffffffff5bf9ef1d5e584d69616277d4ea37e1fbe7b8f8f373a85ee00e75d9068a2454ca340000006a4730440220209398d7fb0b095fc54dcd774170ea34ed87957f4897ade5511c1fa1bea8e48c02202d50f6d113e18171f516fb400478078e3ec4325a6145149e6cd5ae8e1a0a66c90121036728a719f71f8940b2bb8399d1ff0f00a323b9eca50266b8d9ec581047581db3ffffffffa4524c5a1a27594262b0de5d44d13c34e3ad1c5c3a68e9f5fa18e29bf00818bc000000006b483045022100a95c50704d459acc37e28410b5536aa6da1bc82caf1c0f14105bafd82a649ad402200cc2c0dfcb4b24797084c4133fafbb60580f66ee3fb12e0ccfc74b14b024ea940121036728a719f71f8940b2bb8399d1ff0f00a323b9eca50266b8d9ec581047581db3ffffffffd4f85f26b98234a99c2242833269b5808eebe4ba1b237d15b1986a0d82396684c30000006b483045022100da4be6a3afa6de3f105247deb4249250001578e722e0fd46f05ddfd88b5bac3c022072683ef1f199c4f784caffaec29c1d13ea115a35de5c8706c32538bc9d2eed600121036728a719f71f8940b2bb8399d1ff0f00a323b9eca50266b8d9ec581047581db3ffffffff6785ef6efa54daa712defd19cd5d39a4e57af4fe7354ea0edf20a3e100faaad9000000006a4730440220629e9b29a3713e63ec2abaa9a2f350a75ab402865df60c4508dfee766ab956090220557ca5cb0bb4573a27b228ac2769ab141993e4aa20d0cb985ae7ec9bfa1df74b0121036728a719f71f8940b2bb8399d1ff0f00a323b9eca50266b8d9ec581047581db3ffffffff1d519546b9c39ca8f41b5d6f8f0b8f2a79bda7149563d082dd3be69153f39e0c000000006b483045022100cb0db43d5366fd0418a5f53604d70f7def70d062416d6bd3a0f8f54fb3ab045e02206a27d82e0ab0bfa885390a3ea8c54e0971888f517fce5439238dcde1da60462e0121036728a719f71f8940b2bb8399d1ff0f00a323b9eca50266b8d9ec581047581db3ffffffff01af170b00000000001976a9149587412cd6911f96a12865f1a4396b0b62cb37f288ac00000000010000000663b16748841f9ef7b86598199150d5ac79cda90226f6c2dfdaea5e1b37cc3b00000000006a47304402202939591bf677eeca1b0ae63322e77337446c6d0e02f054b6bdf4b26e320442a802204999f98aed007d1b01ca57bdfb9d5ceb174c16507fcb9d4465a94f8ee74e7edf0121023540aaa8026fa0f7db76ca1ac015b5fa97f2a933fe9d540ab46ac9036c54f5f8ffffffffb550c94e07aeae5646260a221bafe2fbd904260d0e193525bbd128d6a8d0d61d000000006b483045022100f117fdbe47c4a0f9e01a43f13971b57afcdc9735b46e3c2c0198ba760a05365502205872ec7682f8f108e75f212b21f79ceb01525b7abbfda0d40d56d1085e14f2b5012102bba8c28be56fad0b5fb7c9f3b66d3a8a3619d77b3896828a33a1175a479f1d2dffffffffdb598fc5c0a7b7301f186390670bc083a7efc5fa63ef738fe9386143bee41379010000006a47304402203dab5224d352de4a7afa0beb5299be6a9cfb77838743eded85f15cd9e02a23890220662e9e7d38a4d05c08a60552930425cc452cf7c3d5a61040b560948a532b37f801210396db7fc8829c256bd13aa646cddf3461bb79be25c52fbe67aa5d621cc1cb4326ffffffff5ee4346a40cc81387b37b3dab0e3ac7b73ed6f1be4d727451999681def9de5d3000000006a4730440220349f5fe9c032ab83ff17ec1cf198265411c948fd4b87f004d5b9185abe4cf9db02202babf60dc764aeb325aa04363bb5aee5d760693861a664338100433ddd09817001210281f473477d4b68e275166585aa74d201b84e398df5b2d2c5f169916a97cb771affffffff7413aaf36abbfc6ee9fe0e1073280d59f553af654320cb5ef61dbf24c0aa034b000000006b483045022100a50a03b753b72d2e1ddac9ce706465664120e6c49bdfe7d1eb21e365d371b8b2022067ce749580d51fc7987e40a09a20b1a83e2d10a258f092219ebf3b5e36ce0782012102365120c36c776b272b804fc44c70f2ccfca798109826d441d4ba2efe8da86ed4ffffffffcf7c43f22ed1de5d18d007c8f3a97a174c123f100616ebee1497517192c9a8ac010000006b483045022100833f808782de884c23134f4972f95d16c1c3359a58c241a5d5099badd4d87ff50220631f990cac53db8ed36e0b07bef80ed70685a104f9c50e7407ca1f47d497d35101210365660e62b048addb7aaddf3eaf487325f861ce1d51f793e46f7562bddf0d1635ffffffff02c8ebf000000000001976a91432d2725907fcf628c50868be1c911af2f7b0ca4488ac30322000000000001976a91472eacecd72014b53974227675ab6aecbdc821af388ac0000000001000000039c26d06d8ee95c66d59933a0d1eac8e0d98133ee37a07ca67247ae50097cd3ce010000006a473044022022eba58401cac10a4346321920a61e42ba53e980c282e5a9f460855e969fb71c022076cdeae244327ddb9d758879bf033ba9edc18afd60d611f5dc5a551c095d63690121020bd9e909f2f57062be729adab091e3f86699a84408e54a46f68b0008036f04b9ffffffff391c1955f30330c9ee0a7706d7c7a26f8ecca6d0c735caee17639eb0ff07c3d9000000006b483045022100d1bb384fa2c6d94a440b366c99fd3f9786fff40ef11bdec5b9be15884f78294a022064532a11a6eef165d7f1ca06f6a1d04c34934f5d103160d712b9986f81d94d4e0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffffbf2985938d3e69a41629107bc065d7929f70b7d0a073a66070f592fc75e5246d000000006a473044022060223dd5520b2bcf09373d64b919eb7c223761272502207c0ba1309d8a87f35d0220696de16125e07bc6fe234354df72237d7e24ea29126636dc0df80ed18cead5de0121024b4bac1049d3f0d887c08497ac6eb5bc17c3229b86b1381e2ad575b748a7a1b6ffffffff0170c73600000000001976a91438860090779c6df12ea41cbe472359b62957527188ac000000000100000005a22c8cb1f11503fd8799b800522f743523740b948e823cc6c789cbe962890903010000008a473044022013d9564b5a4a159f5898829128694e963fa402b204f598ca9e188b21dd8b99fd0220627935a445894b7d918087d7ba8ea154770cada4e6993f20ef3f51a8bba7a67101410415fb122fe2d91ea3f88672f29d9cc6a0ff812ecc0fe41a02fa10f9f5871c33297b71306b1c8fb19838e49e9ed834e37c09fec2fefc22ac0c6da31a8a684ab4affffffffff179ba6e1e2c43272ff0f47aa5d5d3714ef1362322a27d319ca56e8268145827010000008a47304402201d4e83e0072eac84a1e9749d52cbd6d0ac58249bba2e1d3a7bed43dc4daaa4fc02207516be9f58ff0b2834898aa43edd5700e0a66b22bf1a7ccfdf22d3433ba0b5b601410415fb122fe2d91ea3f88672f29d9cc6a0ff812ecc0fe41a02fa10f9f5871c33297b71306b1c8fb19838e49e9ed834e37c09fec2fefc22ac0c6da31a8a684ab4afffffffff4a11da012eaadaf2f5d65e04678add7f9e08093ad444d50eab674368a427b451000000008a4730440220572b06f069a56cab4429110a6437627df3f8ea6218cd2b2b5ca179843521007c02205dd2d04a02c92d478d56bc3d6eb1be4d4d99cad1e0e5eb4013b126b3ec45bc0601410415fb122fe2d91ea3f88672f29d9cc6a0ff812ecc0fe41a02fa10f9f5871c33297b71306b1c8fb19838e49e9ed834e37c09fec2fefc22ac0c6da31a8a684ab4afffffffff6622cd902f4779046dc4994ea0afaaf219e34e10f1a2e16b00421780288100c8010000008b4830450221009e60eb5388ce0ea8d20058bccbff7a158687d8cc5a9953f7b20d8026700d95ac022041db0edf480de6be92ec727fd954d9fb18cefddd9f0aeeea6618eec9373dd35c01410415fb122fe2d91ea3f88672f29d9cc6a0ff812ecc0fe41a02fa10f9f5871c33297b71306b1c8fb19838e49e9ed834e37c09fec2fefc22ac0c6da31a8a684ab4afffffffff235679db494fe7e8297838820c8e04ba9f12c5a9958860557752a52b72245573000000008a473044022024cb7a5660654bd422ce2b343bf085e501f4d2b51e8653d4ca1657dc883ef9eb0220117befde0ab3a20e2352accf99acde63204be51d1c70eac0aeb871b4f99fb0f101410415fb122fe2d91ea3f88672f29d9cc6a0ff812ecc0fe41a02fa10f9f5871c33297b71306b1c8fb19838e49e9ed834e37c09fec2fefc22ac0c6da31a8a684ab4afffffffff0280f0fa02000000001976a9144b0c84aa7192c91a247fb42aad33ed1e49651ede88ac14b71000000000001976a914a1691fe52de67c74b80b8844880311626fd9661f88ac0000000001000000036d4f3472421e15e7d4b7d5a115bd1bb8bc7824fd2052faa2e0f353c07fe2425b000000006b483045022100c628b1bd9bfce037e1602d491fe7daddda5d861bb36c20074069468f1cfe26fd022076a364b4ce5d1d342214e169477f3f5e992a31b37a29c3881c6a4c6d346141aa0121024181a8fa7c766d99736e3008e4aa470600ce4525226ebff294e16d908c73306bffffffffe5effde11753ef6985ee79fd39fecd350ed4d8ae3615b9c248624cf70c0bb8a6000000006b483045022100c62baeebe98330a4440f3cdde01fc671bc1d0593753023eb6e179ff306a1f79602205122bcc4772eac50cde34c9c113519ddce4795391e4546af8175ba8eef6c60dd0121024181a8fa7c766d99736e3008e4aa470600ce4525226ebff294e16d908c73306bffffffffb26f95c807c66aa3aa12a893ad9fdcc3bbc49a241c6b593a5a4db51130f180ca000000006a47304402204fcb3f31b3bd448fad68c2adde9387f7d64ae718ea3c730037371d26a78d618f02203f8a270f1c7732582270519057bed7c8762bb65e4d7b5af98b9f64ca2f0feb100121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff0190940d00000000001976a9141047de99fb080679cd3471f25255b3b6ab56cad388ac000000000100000003480f9580767106b10593c5c926a562b4b25d421c17c26fd0dd4a7ac0b00a2efb030000006a473044022004803c784d93137a1af11c471495773df13b4338b1de2831a0c0b088e2a0be2802206b0af739445eb8b67ef6c059fc89c4201fcc7d69372f75ff66f45f447c0bbaeb012102ee99ba735c181f6e89048c1e5e71827c9d0ad1c5fe4cd12dffc58040be4a3cdcffffffff2d7b4e4be44ffd952fe9b6c27ef75232cd0c183d42b80b963689f6f7a6d315d6000000006a4730440220422e528721789726034ff4804139460530782868df8ce686a965e0852dc4b72f0220429ee182cc59dba72198aa8ff8f5ad55f2cc910e43a89be1de37125f2c7cad74012102de3009e749c52ece318d6a42800bb256009cc85c779f4391c5b8c302b5289ec8ffffffff7f927998c5bac3f22dd9e9cf1ff60e4e9251d9ece0ed9615c9b5ee45bc724fa0010000006a47304402205f8c5b4f4db53d9f217dfcfdbb560f28581474dcf3ad81dd3ffe9bb3b33186d00220490135e47b5c2b94aaa038cf8efd37fbfed23a07c5bf102d80eee111a0a3f0b8012102dd0a67c2bcc4aa524c3d16c60a445165bb648de7f46a3b4fbbdacdb2b219a0faffffffff02906a0203000000001976a914dbd819f454012f9827139d5e6351a724c1e34e5388ac67362400000000001976a914ef85d20dd64d07ad3c9b40f8e7568c433ad37ae288ac0000000001000000031fed4f6f004b01aa4eeef2054d6632e86c3dfa0df05e409e80daccd0cdcc28fd000000006a473044022064ea02e9b6bb7489da4b6523910f5791eabb47701e34ca7dad20c61a0d93093c02207b54431c6c38dd5b7433f12779b942bbb553d31e43f0a10d4061a7f7f1550cf20121021fd10f89dc34565c18f2607b1565806092e483a829650960c9b69b00f2bd349dffffffff1ae4decc82ac597a2585bcb2ced28b2ea928bcfb6dbcd67739cb4ae7b633bc6f010000006a473044022029551e0856d72f28a8d2991361b935ba636f3466e0430e52215325d78f479b80022078f8704ef47b0c1e487def5d8b09a8914db39ac71fd384811e677f9319ebdf4e0121039390f8c35481e981ba3a35b55798632246a0bf140761f1a35d2c133a13ec1a34ffffffffb7fd2f52710f8f1d8e484ac0d72b7385730aef8a25365035fa5e61d29482a41d000000006a4730440220678c06f2170d3f18850270eabf6c410b318e3162494e39df9fabdecfcebd65a402200936bbc8649f0a6ab30e007eefdca143c5b37593dc7671161c7e0b12c40bf357012102af041cd4a6aafbe45282b620ada2a7a839a7344ee6d031f7845fc71facb61fbcffffffff02135bf300000000001976a91439787b312215d9ecc0cde51d60b81be51d372ef288ac577a1700000000001976a9147ea20ecec4742638782db565d48dcf7d55aa08aa88ac00000000010000000313b5efff1f4bf814094b6303870dce81bfd9468f03190cfa4ecd1219247f9c44010000006a47304402205b40da0b0e9cc61f0a1b1b48f660b2836d2962296222d60b87d97b4975af2c6202205ebaf2e77178fea6366669bccca73b79ba8acb8279c2d93e494dc44f6f1046c30121034f05cf7723cbcf3156eb297fa67a960322d4a2b3feda496c419c383b6df8206ffffffffff87aaf665d01c21633fb9d44902793bc84ec7434c3dfaa71fd438c139d766ffd000000006b483045022100cd16d6fa1039f56ccc547bbd3479bad948fb8e1664d865ef504da410f44bde9d02204cf17d312af69d62bac696595981ef2009ae011139bbce3f638002a77385989b012103507ae1bbbb5ec41ce9de7193419f296a01300237a41211eca23717cc02cc2779fffffffff87aaf665d01c21633fb9d44902793bc84ec7434c3dfaa71fd438c139d766ffd010000006a47304402203a3a357ad9007d2c1f1aa08d91900cf6b1154ba0d68e44a1731590b6278b8cd50220407c7c99cc5e5e39de1204c3d65d408936bde817e6f657fbcbcbb1b943290887012103502c85b05b25e0a79a689b65cde8aea35987b6e52a45c03619a1563a4909ee28ffffffff0210508b00000000001976a91470d71a3bf5bd2712ee5353cecf474dea5a7102f888ac6c07cf03000000001976a914619235f0cbc6dd6f770f5d76dc0f9a87bc5dcaf988ac0000000001000000037ea53eda6fc6f67399c1497da23f90e3f8c3998d576199a74c885e5367fef906000000006a473044022048746b724dcbd94308cf78dbdc520913af40741309f90fbf49620aa42a944ca202201b45c0589cf9ec320d0d54ccae85f1629422a7fd2c3d7ac5cbda6364979b6894012103f67aac6a5e05d86ff2f8818d170b19198d5755d14e7533bcdb6bc6955ef1a486ffffffff0167efc2fe2f4391b532b967be73d5a48f122a8a146c10ae582b64ddbb503ff6000000006a473044022031675371ade0681540e605e9cf6ec46f0dce12e94b2c10951ef3a28d0264e71b02205f427a75ee9b2303ec4d5b3edde305a28d3626f45b95280da68536b6e27277210121029e48abbc9546bbc1d121bdcf9b4584c3d762a2d7e46f1f462f1a437436648bddffffffff07eb618b4182ac91e7353205798488b22a2e4baab153c73973adbd207ebba5b9000000006b483045022100c2e9e62255830f521c44894f970276ae571eb3e441dcc194135b00a5c3a2153f022028001128702a347d51e3ef18b45f9d31922ad1e8ec35073134e2cca1b33f8b4a0121020d935423da23c95e8e790f821f5a6d55d77e6b1cf31a2f80465341dc2ef16a96ffffffff0298690f00000000001976a914d0bd0400bcdc79be736e058939fc6bcf733ec10b88acbe140300000000001976a914f4dd33b30c9019ef8453e107a176b08c370d187388ac000000000100000005c162b294758c73086eb0a8f28fd3cedb25f2bd6d8755a44b507353cd47e7893b00000000fd9d0447304402206e26153aeb854f53493b5103254cb8f5b51b14da752b65e57d670abed3d2791502206a8fdaafe4b4f58a0603895d750678ad3c525873426bdb04e0e4d780ddcb9009024dfa01002020202020202020202020202020202020202020002d2d2d2d2d424547494e20504750205349474e4544204d4553534147452d2d2d2d2d00486173683a2053484132353620202020202020200020202020202020202020202020202020202020200054686973206973206d79207374616e6461726420636f6e73756c74696e672061677265656d656e742c20647261667465642062792041646469736f6e2043616d65726f6e2d48756666003c61646469736f6e4063616d65726f6e687566662e636f6d3e204665656c206672656520746f207573652f64697374726962757465207468697320617320796f7520736565206669742e00202020202020202020202020202020202020202000202020202020202020202020202020202020202000436f6e73756c74696e672041677265656d656e74003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d002020202020202020202020202020202020202020005061727469657320202020202020202020202020003d3d3d3d3d3d3d2020202020202020202020202000202020202020202020202020202020202020202000546865207061727469657320746f20746869732061677265656d656e7420617265203c4649584d453e2028e2809c436c69656e74e2809d2920616e64203c4649584d453e0028e2809c436f6e74726163746f72e2809d292e20004dfd01002020202020202020202020202020202020202020002020202020202020202020202020202020202020005365727669636573202020202020202020202020003d3d3d3d3d3d3d3d20202020202020202020202000202020202020202020202020202020202020202000436f6e74726163746f722077696c6c2070726f76696465207468652073657276696365732064657363726962656420696e205363686564756c65203120287469746c656420e2809c536572766963657300746f2062652050726f7669646564e2809d292e20002020202020202020202020202020202020202020002020202020202020202020202020202020202020005061796d656e7420202020202020202020202020003d3d3d3d3d3d3d2020202020202020202020202000202020202020202020202020202020202020202000436f6e74726163746f722077696c6c2062652070616964206163636f7264696e6720746f205363686564756c65203220287469746c656420e2809c436f6d70656e736174696f6ee2809d292e002020202020202020202020202020202020202020002020202020202020202020202020202020202020004c6963656e73652026204f776e657273686970206f6620576f726b003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d002020202020202020202020202020202020202020004c56a914718a00c73b3a1f6c268a337970005a053c68880688a9147c42474686e1dda1f88fdf59b30fd6faab1c9e018821034c59815a38f4ac081b64532336475bef9606c772718979d816f0a4158d1493e9ad0075740087ffffffffc162b294758c73086eb0a8f28fd3cedb25f2bd6d8755a44b507353cd47e7893b04000000fd9004473044022072de0b15a31fb1f48288e5b96e6f3ddd088f564a09cce34a8347cabcee835d2202201193def75abcee8098a070132f8727d272069d658db5493865ba20d15c9e71f3024de60100436c69656e7420697320686572656279206772616e7465642061206e6f6e2d6578636c75736976652c20776f726c6477696465206c6963656e736520746f207573652c20646973747269627574652c00726570726f6475636520616e64206d6f646966792074686520636f70797269676874656420776f726b732070726f6475636564207075727375616e7420746f207468697320636f6e74726163742e0054686973206c6963656e7365206d61792062652061737369676e6564206f72207375622d6c6963656e73656420627920436c69656e742e00202020202020202020202020202020202020202000436c69656e7420616772656573207468617420436f6e74726163746f722077696c6c206f776e20616c6c206f662074686520696e74656c6c65637475616c2070726f7065727479202876697a2e00636f7079726967687429206372656174656420696e207468652070726f63657373206f66206361727279696e67206f757420746869732061677265656d656e742e002020202020202020202020202020202020202020002020202020202020202020202020202020202020004e6f20436f6e666964656e7469616c6974792020003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d2020002020202020202020202020202020202020202020004d040200436c69656e7420616772656573207468617420436f6e74726163746f722028616e642069747320656d706c6f796565732c206f6666696365727320616e64206469726563746f7273292068617665006e6f206f626c69676174696f6e7320726567617264696e672074686520636f6e666964656e7469616c697479206f6620696e666f726d6174696f6e20646973636c6f7365642062792c206f7200776f726b20646f6e6520666f722c20436c69656e742e002020202020202020202020202020202020202020002020202020202020202020202020202020202020004e6f20506174656e7420436f76656e616e742020003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d202000202020202020202020202020202020202020202000436f6e74726163746f72207374726f6e676c792062656c6965766573207468617420736f6674776172652073686f756c64206e6f7420746f20626520706174656e7465642e20436c69656e7400616772656573206e6f7420746f20706174656e7420616e7920696e76656e74696f6e207468617420696e636c7564657320776f726b206f7220696465617320737570706c69656420627900436f6e74726163746f722e20436c69656e7420667572746865722061677265657320746f20706179202432352c303030206966206974206272656163686573207468697320636f76656e616e742e004c56a91431f24aff099ddcc9a66d4f3569e69d7b544284c488a9148c047e59f93890e9be3945ce2652453bcbdbc38a8821034c59815a38f4ac081b64532336475bef9606c772718979d816f0a4158d1493e9ad5175740087ffffffffc162b294758c73086eb0a8f28fd3cedb25f2bd6d8755a44b507353cd47e7893b03000000fd69044830450221008ed4fce6cc5ffe978433b88328f01842f62bf20df59c7f816c35847549df5e9e02207425d2c00c76eaa8258540161a196cc3b7b0fd52a24637c0541c2ce52a0db8cc024d00020053696d696c61726c792c20436f6e74726163746f7220616772656573206e6f7420746f207365656b20706174656e742070726f74656374696f6e20666f7220616e7920696e76656e74696f6e73007468617420656d616e6174652066726f6d207468697320636f6e74726163742e002020202020202020202020202020202020202020002020202020202020202020202020202020202020004c696d69746174696f6e206f66204c696162696c697479003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d00202020202020202020202020202020202020202000436f6e74726163746f72e2809973206c696162696c69747920666f7220616e7920616374206f72206f6d697373696f6e2072656c6174656420746f20746869732061677265656d656e74207368616c6c006265206c696d6974656420746f20746865206c6573736572206f66202435303030206f722074686520616d6f756e742062696c6c656420627920436f6e74726163746f7220696e2074686520736978006d6f6e746820706572696f6420707265636564696e6720746865206e6f74696365206f6620636c61696d2e00202020202020202020202020202020202020202000202020202020202020202020202020202020202000496e64656d6e6974792020202020202020202020003d3d3d3d3d3d3d3d3d2020202020202020202020004dc20100202020202020202020202020202020202020202000436c69656e742061677265657320746f20696e64656d6e69667920436f6e74726163746f722028616e642069747320656d706c6f796565732c206469726563746f727320616e64006f666669636572732920616761696e737420616e7920746869726420706172747920616374696f6e7320746861742072656c61746520746f20746869732061677265656d656e742028616e6400776f726b20706572666f726d6564207075727375616e7420746f2069742920616e6420636f76657220616e79206c6567616c206665657320696e63757272656420646566656e64696e6700616761696e7374207375636820616374696f6e732e002020202020202020202020202020202020202020002020202020202020202020202020202020202020005465726d696e6174696f6e202620537572766976616c003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d002020202020202020202020202020202020202020005468697320636f6e7472616374206d6179206265207465726d696e61746564206279206569746865722070617274792075706f6e2031352064617973206e6f746963652e20546865004c56a914522ae24fc4f0c34fb602e354a976fe1f6de98c0988a914fc8cf080f742a8bfede168005c55195520be50108821034c59815a38f4ac081b64532336475bef9606c772718979d816f0a4158d1493e9ad5275740087ffffffffc162b294758c73086eb0a8f28fd3cedb25f2bd6d8755a44b507353cd47e7893b02000000fd8d04483045022100991c46c63c05d74a7231dbdb7232e8ceb47a3fdeba8bbbda6ec7f7acfc53e5b50220400a43b0094272e01d5976c4ef08e735a5c3f903ef7c05eda22dc3342e55e487024deb0100636c6175736573207469746c656420e2809c4e6f20436f6e666964656e7469616c697479e2809d2c20e2809c4e6f20506174656e7420436f76656e616e74e2809d2c20e2809c4c696d69746174696f6e206f66004c696162696c697479e2809d20616e6420e2809c496e64656d6e697479e2809d2061726520696e74656e64656420746f20737572766976652073756368207465726d696e6174696f6e2e002020202020202020202020202020202020202020002020202020202020202020202020202020202020005761697665722020202020202020202020202020003d3d3d3d3d3d202020202020202020202020202000202020202020202020202020202020202020202000416e7920707572706f7274656420776169766572207368616c6c206f6e6c792062652065666665637469766520696620696e2077726974696e6720616e64207369676e656420627920626f746800706172746965732e2020202020202020202020200020202020202020202020202020202020202020200020202020202020202020202020202020202020200043686f696365206f6620466f72756d202620476f7665726e696e67204c6177003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d002020202020202020202020202020202020202020004dfb0100436c69656e742061677265657320746861742074686520666f72756d20666f7220616e792064697370757465207368616c6c20626520656974686572204d69737369737361756761206f7200546f726f6e746f20284f6e746172696f2c2043616e616461292e205468652070617274696573206167726565207468617420746865206c617773206f66204f6e746172696f2c2043616e616461007368616c6c206265207573656420746f207265736f6c766520616e7920646973707574652e00202020202020202020202020202020202020202000202020202020202020202020202020202020202000456e746972652041677265656d656e7420202020003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d2020202000202020202020202020202020202020202020202000546869732061677265656d656e742069732074686520656e746972652061677265656d656e74206265747765656e2074686520706172746965732077697468207265737065637420746f2074686500736572766963657320746f2062652072656e64657265642062792074686520436f6e74726163746f7220616e64207375706572736564657320616e79206f7468657200756e6465727374616e64696e67732e2020202020002020202020202020202020202020202020202020002020202020202020202020202020202020202020004c56a9148bcf4b78d0400c6367c82122b9ab3714695195ae88a91429fd392f74766b0079e4bc94153473c53e80124d8821034c59815a38f4ac081b64532336475bef9606c772718979d816f0a4158d1493e9ad5375740087ffffffffc162b294758c73086eb0a8f28fd3cedb25f2bd6d8755a44b507353cd47e7893b05000000fda10547304402204c73c5fd27e000141df68e07a638d7787595581db61880aa1055bd65b261d40802202ecdc75f67947b34e9e20e366231bfb9dc8b0aad1287d32f6da234a94a77dd10024de901005369676e61747572657320202020202020202020003d3d3d3d3d3d3d3d3d3d2020202020202020202000202020202020202020202020202020202020202000546869732061677265656d656e74206d6179206265207369676e656420656c656374726f6e6963616c6c792e002020202020202020202020202020202020202020002020202020202020202020202020202020202020005363686564756c6520313a20536572766963657320746f2062652050726f7669646564003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d00202020202020202020202020202020202020202000436f6e74726163746f72207368616c6c2070726f7669646520636f6d70757465722070726f6772616d6d696e6720616e6420616e616c797369732073657276696365732e002020202020202020202020202020202020202020002020202020202020202020202020202020202020005363686564756c6520323a20436f6d70656e736174696f6e003d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d00202020202020202020202020202020202020202000436f6e74726163746f72207368616c6c206265207061696420244649584d452070657220686f75722e002020202020202020202020202020202020202020004dee01005061796d656e74206973206475652075706f6e20696e766f6963696e672e002020202020202020202020202020202020202020002d2d2d2d2d424547494e20504750205349474e41545552452d2d2d2d2d0020202020202020202020202020202020202020200069514772424145424341435642514a565271385858685341414141414142554151474a7362324e726147467a614542696158526a62326c754c6d39795a7a4177004d4441774d4441774d4441774d4441774d4441775a5463354f44426859574935597a41354e6d4d304e6d55335a6a4d30597a517a595459324d574d3159324979005a5745334d5455794e575669596a68685a6a6376464941414141414146514152634774684c57466b5a484a6c63334e415a3235316347637562334a6e63475630005a5542775a58526c636e52765a433576636d634143676b5177495879484f6630756479716851662f566b50586241715163386f4b42416e69683636374f61467100555a485662665456687a517a67766f46704c522b3377732f4d492b562f4f376c6b53324272754a75387138472b75644c546c324a324579583979324d2b59457000332f6b71616c66545579497356545a4c75474650536150524e52574d4159435534794e637363784739377875694a634e4c47344130554e496e322f696c474441004d0a0100793648335632502f34332b65446c79537a4d6d6247695078765a622b3073566561384c7563754b316c64764539385232646e64747331776467464d474e4f332f006f573471502f333477633631476673786f4672774138576437563942666d4f6f63684b796c4f62305178494b4b4d53624741764e682f417a776b66396852557a0047586e32374b397556377558626e32724d394f774a507557637172487243752f30567144392f2f70352f614d77332b7237685966534a2f30524f795967513d3d003d79566a66202020202020202020202020202020002d2d2d2d2d454e4420504750205349474e41545552452d2d2d2d2d002020202020202020202020202020202020202020004c6da914eedc07cdb32f755b5e696becaa148dbe2ca6620488a914e54ab11c7ae71772cbb72562871415147173c10f88a9143e8b1fae20e81def8b2c9261f20e01c6c765ed8d8821034c59815a38f4ac081b64532336475bef9606c772718979d816f0a4158d1493e9ad5475740087ffffffff01580200000000000017a91492a04bc86e23f169691bd6926d11853cc61e185287000000000100000007b5b1cbf32900be294db355096411105d0e1aaf6efb971a5b76e88c25f605518b050000006a47304402200ce58e5322b5c648c43a9138a66b4635a2ff11d6ee1ac14be502eaa2b4121a2c02202da6979c0920d2e1708e59efe85736e9054d68d68161e13ee2f012556afa8e9c0121024efc0404fa65339ef61c3a00701d02533f6b7256ce2897fae9c6ee16b74abc55ffffffffdd7139e8604d13a5b09787feef3e91bba6898c685c2f0e9b5ae949cabeb6b9e8120000006b483045022100de75e20caf5c16a46f75ca4e9f2c5635a10948097fcf0259f1147076307acd2e0220486742a379f40a45a6afdb30de3066d1cd991f92525998fc44e2a625d80aeb0301210251d7934af2658d0fcb89127ca187e1689a88d042c2690052b9490e0816e41046ffffffffa458174a9364e52b1774c8807ec89d269532abf935d81c684cd75c0dd11cd4f0070000006a4730440220727d65aee66d0471b66cb7c8247346942742f8a0cf573974c8a1a635c6c63fde02202b1320a0d65606044bf9592d8f9ca4dba9875201d68d2840e2536e283498d6b80121021eaccb8e2b73b9157f0e5eb63ebb02a514b1ba92a9d78d6cfeab171a1200f14affffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca2080d0000006a4730440220039774b92b0cd4e619e5fd486322baeee5db0a038e61cc0a348b5d1acf6288f102201776789db07000556f3fc466db36b49e9d6f9627d3ab14a3cade3d5d59c0d7700121020f6d08c3f950736cc861bc1c69e2002114055af3d915a15ab81bb738381bbde9ffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208100000006b483045022100b817c339af5bf24599ad2ff80cc169d97281cf64d21a7a85cde1693859cae7fd02205eb534104411ab3d3607535dde1aa037ae93f832e0cd5564a843bac50d7c0161012102a0b69be867857efa76e9397d6bfd27e8e02c2292fbede9e68c0ae47d8f35dc29ffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208110000006b483045022100d74923de574e4ae945357572b4ee68dfa81faffc5cbe4ab9701ae1bfdde5f1400220599584f41cbfcb80bce42ed683aae21dc1d3a8c2750875f837e3c4cff7c30c01012103fc32046a7c1f15d9ea1e382124780ee87bb6e4d3168a3ac2f5a92ad56c572dc4ffffffff3954c64d9e1984231962fb009faa6ef2eb70eee67c1e58579d904eb2415209de010000006b48304502210090b2474ed32792c5ee2061259237a4d910e21c3468e8d0668215ebc3d77071540220487538464fe334052a95bfdfebd7d3943601f06b533feabfdf5472f558f55bbd012103648a769f6830e65d76a251491e9ad5e069d81680c8b00b84b939d26a535c2b5fffffffff0200199222000000001976a914c0d16bd11bfb9494330102680a8b2c91ac8327c188ac00b5e60d000000001976a914078b3a6fec6f9ef9fce8351d55c5236b7d3885a488ac000000000100000003d9529bf62c1dc819a5cda32fec38692ee55ffd5e82a9377803198818298ec0c2010000006a47304402206a95f121058b1d20e16ae32f63a5780cacc8f129e87b14c1333c90171cced50802205d4b27c541580c6f8b5bc886a00738cb11643d8547805c0595e7d7396661268e012103cc8e6abdab3a6977115ff2aa9274632c29d58554f34f9959662cd3e0198d4731ffffffff66b2840ff7ea26d398ccbc852bc5423e5dde868603a86ad0268a1d0762ea90f8000000006b483045022100afef8abdf6c3b1a4b68d5c3e2fbd4bf58902752c7a4339374565dd194cd7e17d02206bda9723c738301abd0692bcfec7dcd15c4de855646372f0dcf2cbe9c3ae4da901210258681365e701d0d8a6f58cfc40d1adb7dca89e928708134631728850032161aaffffffff271adf8900251fb0c8d87c763ca5aa947053da90390311a755d3ae7449910fa8020000006c493046022100831f6cbcd74073725580911208fd7114b9153e156cb60e34f86844da7e6f991c022100ac09948def2e923c0b67660dccbb0d7890390b838218ab629a207e8a65b206b4012102a3b1052e6dae6c683240e13d47f8f9949192c0cf4e8df90f3487c8961b347a2cffffffff0300c2eb0b000000001976a914571f2391d85d2b7b7e5933b9f72359413c92c7a188acc42b0b00000000001976a914c17c7208c4a1672163959f47eb409149c6f343b488ac66780000000000001976a9144c6bd90537bddb79545f3a6657b7e0086349db5e88ac000000000100000006a60b72c5ba619dc04c46564050179c898df80137e696e0760e1dc482fe8f24832f0300008b4830450221009212620754803048486f486a84061ea6b1fcddbc2e1800136f780278f91b2f0c022028cbd928b226d1610d5db835613dc61980a08b954963122c344e5a7838a8d1cb014104fc1cc9ad78243f47dcbb731f4f7140fe8f2995c5ed5e910159cb67f0f8cf98923833b5a7215839790b8ba74220d4cdb9c12fbe1cb3454c14a1fbc593bb83f0c9ffffffffffec031f2dce18945a4099eca56db0bba4ea1bb35f0f13c8aa05ea8eac759c70000000008b483045022100869ce088fd35341a39109ff10f1c14853b2cda68cffac898889d985fdf0b5594022074955afb9757aaf2205e4837036c573f52dcc5647c6fffe6791a9f5d9b8f34c4014104fc1cc9ad78243f47dcbb731f4f7140fe8f2995c5ed5e910159cb67f0f8cf98923833b5a7215839790b8ba74220d4cdb9c12fbe1cb3454c14a1fbc593bb83f0c9ffffffffc4a1e6a87213cbba608214a8fe93171d7cf35d5d0803b801f17918852b2afa21000000008a4730440220193c616e7bd61b858a9eef497b17ce23aba39b715507bcfa6f24117fca6c2a38022062b12a5ba58e8def33ccab924644deab99eb1c6e3d10f1f77911db8c4cd9c502014104fc1cc9ad78243f47dcbb731f4f7140fe8f2995c5ed5e910159cb67f0f8cf98923833b5a7215839790b8ba74220d4cdb9c12fbe1cb3454c14a1fbc593bb83f0c9ffffffff1989729a465d8e6935d3f81fd9eea74f551c3e74381d7437ee591c16489de379000000008b483045022100b84cdfd300a6023908bb6b5fa8a658583815199afff4eab95587a83b6066774702205d74a9d04c1a56440acdc4c6722f9bbd9049f22ef3b53dde1d01dfb9fdda884d014104fc1cc9ad78243f47dcbb731f4f7140fe8f2995c5ed5e910159cb67f0f8cf98923833b5a7215839790b8ba74220d4cdb9c12fbe1cb3454c14a1fbc593bb83f0c9ffffffff94879440f59a23bd1ebb7f2a520d3e776b2ea834a3c28ec9208c37ea7e36e55d000000008a4730440220349c2a2021dc0658533d48aee864c7c7e714d665e49bde78b2753fdcc1461b56022010d92d73f8a3a33dd26de79c1ae3e8beecb237f8ce356ba60249d2ea4ca158fb014104fc1cc9ad78243f47dcbb731f4f7140fe8f2995c5ed5e910159cb67f0f8cf98923833b5a7215839790b8ba74220d4cdb9c12fbe1cb3454c14a1fbc593bb83f0c9fffffffff0b6a05b5ed1c631a1a158234946e347f1a25a5d0079a07ad908265ae35cab70010000008b4830450221009c2c8ea7a23c400b456b4b497aac9867beca32fd1d4e9195bca0132d585805dc022017f7d68dff73f32bbf223e5965bdc0864f2933e21cfacdd7bad20a0c723d077d014104fc1cc9ad78243f47dcbb731f4f7140fe8f2995c5ed5e910159cb67f0f8cf98923833b5a7215839790b8ba74220d4cdb9c12fbe1cb3454c14a1fbc593bb83f0c9ffffffff0109f21f00000000001976a9141980502c78e8531c104c87353dcc82be07c0718588ac000000000100000006860da7c7d926eb9c735a7defdd689e3d98845e7bd6bffc439ec12ec374eccd32000000008b48304502210081f58f8ba3ba634946c7e28652736008d877ff90a629cea2208799fa2610eee8022070587ccc7fec40d9134a581a6a508ba2205b6ddd80c055d2b66f61651be46006014104f16e78a14b71c4995c36bdbd1a2be43e403a234e52874b0bc0813829866cfbeaf046b8669f8d0edd6555925e2d7ada37825d40fe57d3a537e261af57752a169fffffffff7d05334943bec488e842875172d516e27d6b095009559981ed0aede0a7a0d7c0010000008c493046022100bff2bbb56e756c8e0686115bd168a0d4f24f7ae9d7b465c48f988a5b3ac2c5e4022100f002d64ab94f5020964e3584b72ac9cc0161fd369a6a27f7d0c4ec624a5563e10141045d20352b47e7d91bf999e74ab9529cf5ca8385ee873355aaf87388cac6ac735fed75c8b9c947346a8cd43789c8e9cac4c5a2480c744f3c4f5e2e66e51832aa87ffffffff5e5c9f229f30a7604dd695b43529c18b5d1166cc69b60a961d4bce2c2f5977fa010000008c493046022100c7ad9617447585bd44f1370bbfa3e64e89e61731eaf1bc002ccdebc1d3151cb8022100b5fcbd1b95b38a802ed6ed277bda87843d92893070025b69f58e16f1d4adfd01014104f16e78a14b71c4995c36bdbd1a2be43e403a234e52874b0bc0813829866cfbeaf046b8669f8d0edd6555925e2d7ada37825d40fe57d3a537e261af57752a169fffffffff334d4de2a37da92b9758d2dc3aa22e3134523288b88f9aad798bb9d69b01068a010000008b4830450221008b145ae3a15ab6d7a8d860526370563501a57f63217c5e1bb13076ad41a48b0e022065b998b2f203b477bbe92e43559b18335ab6368c64cbfda9ea9cd7e195f3d1a30141048b6a00dba1a492db5035d9b801e706cecb6377076e17f8a57f28acb56c26401d6cca08ad4341ff93ea0f74e6dedc205b33cf1dbd5537f87436994fdbad482062fffffffff1ac394465ba5312cf97ffb70f467c345a44111444989a1ebcc7c6a962a9abb9010000008c493046022100c98cde5f315d964b1a106be00e75b7c16ba0ec0c4722677b55ba640b56bf61840221008646a722858ca5460742611db2a4de4f7c17a7a3c083355d2a69227aa638ab5f0141045d20352b47e7d91bf999e74ab9529cf5ca8385ee873355aaf87388cac6ac735fed75c8b9c947346a8cd43789c8e9cac4c5a2480c744f3c4f5e2e66e51832aa87ffffffff2e6fd288f4912f5a440a923d1d0d9aeba335b7197533f69fdc24f60773fa61b8010000008a473044022063ad90e01b52062bea1a0fba40c5f513ac94cb237c329b7a115be485eda035b702207dc36be9ccd2c34991a29fb245fba5111f631293bba29d4c74126c2de08f90f70141045d20352b47e7d91bf999e74ab9529cf5ca8385ee873355aaf87388cac6ac735fed75c8b9c947346a8cd43789c8e9cac4c5a2480c744f3c4f5e2e66e51832aa87ffffffff02c0448403000000001976a914b29ecadf735743ea23a01a6790d29c0189e0500788acd8960900000000001976a9142998e8a9049867b923fa5f496399096fda0d9eb088ac0000000001000000156af95cd11ab5d3350138d40a648f09b4149a518c4cdf8ec840005de0adddbba2000000006b483045022100e314784fd1a5498192968a3c6a6f9d1e3472d72185bd0be73154edaf33ab6c9502204823de1ed2101cd49edb937b5b7411575ed5840b74a9314228ccf89040ddbd5e01210238b5afd035d5435468014cc3731d3d1ec128c201650b7614036fd57b1c7f92fdffffffffa17f1c953b371b196f14faf73404bb8a02166a803f3e229eb6d04da40d7da46e0f0000006a47304402201cd361c2b7b8a7fc883e2cbc6796fafffbfa814c53a97e9df6c533ae473011240220345db857fa58c52ec4d8e80faed06a846cb7385203c08c6cdbf4855be1fafba1012103ff5d8c9b0adea5e08d0b9dae8559c5b91d807c834b5018639eb1b98affe0f36dffffffff49a663e78cdb672ef346f2019e674174ca28b864ff7d2bfa05defebd2b5084a3000000006b4830450221009d55a0214334a3a59f1bf3c87d49e9422911b6dac2045455fa9e85b680974d6a02205c24c2d9f943d54bdfd0af50501edc328a4a7bf8441470b8daa2d6ff42265de3012102a35c3171ae31a762209d6d628350c3d28e7124da414cf1d44e15d2f615280bf0ffffffffa17f1c953b371b196f14faf73404bb8a02166a803f3e229eb6d04da40d7da46e190000006b483045022100d4f3cc2cf8e36f9286135e67f401486f6a4680b8cb3055fab7c9557a8e424eca022026277ab8b47647c8d9916305ad1b08e8615ae451170d470703d97a56dd51d84b012103fea9280369228824ccf30dff697a70280d91035cdc0a271faa0683cf0b8776aeffffffffc2be9e4ca9438e9a995bbe90cada7dbe0d7aabfd681fe7a760e860a037abcf5a000000006b483045022100a6311b5347814a7d6707ffbfced261b1e93dea471eaa1b80c1847e77f12c72c90220468b9dcd03c46b4c158d300d68ed13598e8cdcbde5899a8602ae752b1e30e3ba0121030cce664e0c7a4b416a02b9fe8ff76a68214e958cbc1af661ae42c0d7364e5091ffffffffa17f1c953b371b196f14faf73404bb8a02166a803f3e229eb6d04da40d7da46e3d0000006a473044022027ecd9c0087bf313fd43fb0590994efc8a90b600c63768ae98fe4dc7f17bbb9902200aa2847a21667a8c559959c1959657512c63a18e8eb10ca84eb0a5345e68cb3b01210350adefc65a86e370fd4fdd0151a7ecbbc2a8dcdfc084cc075e83d197e4014a3effffffff45c46d6a6720124705c25ab9777ac5dfc7c53c6a6c4c387f6edd2110393524be090000006b483045022100876f0a162e66be4209413c27e0b08680e76573af7b2f5767bbf60d997cb231720220105a5c4b8ba943cfe987632b786f4fa9fc03b9b9ee8c7758c37067d550196a7e012102cced0d0ffddbcf0f9194ed107b03b919f0f3074c41b53e7376c753f562e21647ffffffff36a71464956b3f64be91833460cd327af020013bf91d921618115849fc18d4d2000000006a473044022017af06393be23f12a4c9716ed56ccc84df8495fdc51669cecb3aa11e0e73f5d9022036832eba8448f577630234f47f4842e1712605a234d6d5eadd90ae4ab563c98e012103e6f7f28ac5db1f0bcbf18c6f21ebe4b66134d57f437643f795e44d0876305dc5ffffffff8e796a2be4b0813b35b6b3def8c1f6b23b1e6bc489f73a6af0d868a3117ea39a100000006a47304402201c705d82c63689ddb3d0555582d6577c652c6e0eadc7d6caba42af6e0a94328302203139cf082ea8615e60e958dca478aa7ba51750baedad9b1f7cf2e4997f9fc09e01210344aeaa967c6932c397a21cfe46560981638adfe95985818bc1b92195ee00b93cffffffff45c46d6a6720124705c25ab9777ac5dfc7c53c6a6c4c387f6edd2110393524be0b0000006b4830450221009f831750452301cf2123d01ad490904a3a4583664577632df2fad18231bf179502204c245e238846019388c6a5789969a8a5834dcc6464f715f178545d1884ea6b8801210321e1e777b76571abc953f9138b4ebfe4d378a59bdc9b88f393546ea0a65d09ffffffffffd41087f77c0ff528b6131f1c96ad766829c0975ce55ef6e13bf82ff096aa3cee000000006b483045022100fdb3b6d0b3184439d0058aafc13f2463b69f7694e253c74cb515de78d2e2732b02206069f42cd8597aa32b82e1f245e2b8f0ec35374083a305f8fda6c91c17b1933a012102a35c3171ae31a762209d6d628350c3d28e7124da414cf1d44e15d2f615280bf0fffffffff1e3424b51cd6caac82571686f9f0df2a405ca9f45e9933f8efbcdc20da2569c060000006a473044022042568266070d02d014cb87d639521410d1b5e22f5709f32a41391327188dd2e402200550094be1358440b88e13ec5b868871958c3e6ad8adc238a51852db74d77f79012102a35c3171ae31a762209d6d628350c3d28e7124da414cf1d44e15d2f615280bf0ffffffff71dedaaa720485b6fd2886ec321fb60470312fd76fe41fcb25d2e8c32b5ff3d0000000006b483045022100a745f36bdf8baaf2118dcb0407d187cf4192f6bad13a37caf11e4a3eef382faf02204681f42a4ea5cd80144c10b7011dd4f343b79324a7222e62dc98bc4183e41a8801210345e2010b62d56cf5e79282d74deac6f9c2f1d9cf6746a1e960ca0cb18fb79f8dffffffffac3777e88e55e9cb150af0dfbea3f0f4ae11d7b39bad41fbdb47ed4a9c891948000000006b483045022100d5dd247e08cd72cfac6c3aa76995138465d9246225681c6045057ed4941933cb0220609502ccde406ef54241ecdf0edb49cee2272d6fc68f9957d5bd3d87d960e2df0121021a97caab63debfdb156e4ed5f6c68219c3f1eb95de3032b1f57ad1f123c1d858ffffffff9c9dd4b1906f8db5735fe94f2dbfec65fb2551951b3b448a6f38a24742c41de6000000006b483045022100a14979aa9be076fac6e448252f9895984d02e554cafbe8c89d10e1cd3bb805a1022034fcd2c77eff453ec3804ae410803841990a0c4119e1835e60c5296ef137080d01210345e2010b62d56cf5e79282d74deac6f9c2f1d9cf6746a1e960ca0cb18fb79f8dffffffffe5e4216f0619f1d8fbb94aad7f23dc091adf2e8afbf00b67744861cd1d4d0a15000000006a47304402207442a698da8ea7ee3f7808eb2dbd32196430d36ea319346e543e7e7fa600169f02207513c917c998f731435d80ccde038c6fafa89b17f4ad1af382cfdbeb8d7f6f78012103682a1ee1ee449924f96199b3b7d6bc5887a36af073014f69c6d09b7ceea09e04ffffffff3ac1fbabb025810b3d2d1a71138b6f8ac8717336e586c9e6468e9c16fe4c20d0010000006b48304502210089e7591fe30bb8531698f86b6686c14757115ca94549704ef63bf3898a5f164e02205acb550842243013fe211d2481a587965ec6e15871a8de167b74d90b883440270121022110aca8e9a8d8073613f2bb6679e1adb27f30bd8b4478233ac2bc3209e3ce55ffffffffc638e55a19331f8056658aaf80710876bd989d15edbe6dd506daff3a8b319555010000006a473044022019ee7ffebe9aa9051ec341e174004969b37f68e9445ff0163b2d40d1f105f24a022063bcfdb705266930b59b58780b77184c7a460affb065fd5da3bbfb4f914db6ac0121022110aca8e9a8d8073613f2bb6679e1adb27f30bd8b4478233ac2bc3209e3ce55ffffffff4b93253465059f3e3d071b82b5a804f193cf53e9c57bffb94c7fea061745206d000000006b483045022100e4aa6b909a1b570f65de2ffedb43d5f9605347e24439ef30daefb1516d1a49f002203fa103a695a0318a49163c32a69d047e3f5cbf3c8bd8d630fb446209042a03d901210235598827e3268015e559e00679829021014342335233fbc5719f7d7ebc0b2344ffffffffa3c12d507bbd3ba48918034ed31ca6205937c9cf260f4d7622103d744798b79c000000006a473044022056d26108c3b18a4d0bda657c06954c2a88cd51862bc006541ed494f11d9b7c5d022000d2b50fec1f342d862ebd7691f4860127947a4458d9083e06e901e0006a43ff01210224bb22b33b20d8cbbb2a0522d8f9c6d0e78965006e443ce843c305ec9ddab0eaffffffff346e1b8a8e10e1734fdc461b6ce153c0200ca2ecb6dc9b0ffe97c4c0e384e94f000000006a473044022005336469496a9c2d03499518470486ed9ea83bdee636cb1d8b6c258679644ba5022013bdc19bfe4fef05884c9ff947d149730b207bb365552e13dcdeb30c66ec260001210224bb22b33b20d8cbbb2a0522d8f9c6d0e78965006e443ce843c305ec9ddab0eaffffffff01cd55f102000000001976a914c7fe9f2b47bac34feac4442a91176b6707aa48b088ac00000000010000000385dc4f9bd841629c2549cb798c74b2fbd2135aa81cd178b74b4bd7beec4d990b010000008b483045022100c027692a70392a9c050ac7419f9d83a4310706b96e3f385b1fc10d2e225bce7c022003c81c085c37912236b31380f6b2b81fc73dd51d6a1742c381ee7923b8fdb671014104fa98199bbb646800133c89bf55756d1074b176869efbcdc1920dddcc67a4a37e571aa4bc6e47cd1de23b6c31f5c4881023a92fb9451236144996f74be03da328ffffffff6b6202ec1180d19c2fefc33c99d1f15ba5eb49d0190501bd32f7bf8834d93960000000008a473044022025199a900727c424bf5356820823907e39b649b3622cadf4eb889ef9f98690ec022055ca1d5a82f7911fbc78e82a9e208b554c76fcf2d664f94f183fdf5a550680b8014104fa98199bbb646800133c89bf55756d1074b176869efbcdc1920dddcc67a4a37e571aa4bc6e47cd1de23b6c31f5c4881023a92fb9451236144996f74be03da328ffffffff197953fd522666bd49d7a24d57dff1631f495877639ec2d3e78f2f8f49d8ae5e000000008a473044022023ae134a9243751aa229cb8c8071ae29dec5f1d895e17806886cacfcb5f55fcc0220751a2d0a05bf544381cbbbdd55acba79f593e714dc36b08629310ce199bad8e2014104fa98199bbb646800133c89bf55756d1074b176869efbcdc1920dddcc67a4a37e571aa4bc6e47cd1de23b6c31f5c4881023a92fb9451236144996f74be03da328ffffffff022dd04100000000001976a914c18ec0550cafcd1661b88e958d14031ecb4d0b5b88ac8f841700000000001976a914d20942f56282a083959b82ffa4c50f10a63962a088ac00000000010000000307440005094baffd6474d24fa7fb48199495f0acee6fa0ed3ef92709a7574cad010000008b483045022100a19620e7a1ac74fce8eef44c62d84efecaecfadda8b34872cdfd32b26f9904070220590c588c670bbff128e2dca9d4dcd6065f90c4c1f0c15c778fff1483d88278ec0141043eac9a482884575fe2e1134ffa08d2e0cefaf66cc69522a73b95ae97c118f39b1cc6ed985c16cbc87f255bcafa39f56e612c775ba08085b157533711988f62e5ffffffffd77b0a669cbb463a132bffa0d049778c440207602c1462a23e055baa83c92f7f000000008b483045022100eb06c4c624e3714836a93aea91791d0a1af9e01cd008fd478524566d2d0f1b49022029643a7fb1df2e81c72c4a6a14e0827eefe6f8d35b000ff50607623e0355c1ab0141043eac9a482884575fe2e1134ffa08d2e0cefaf66cc69522a73b95ae97c118f39b1cc6ed985c16cbc87f255bcafa39f56e612c775ba08085b157533711988f62e5ffffffff54cd089d6f8e6c2da46157228f60381144214039daaafcb7e60fe8c5f93db656010000008a473044022069fdedb0962f635a1e5d54d7a2234031ab849949b7d4738755fe0992be58f89f0220757dfe6e93edd3ca5710d78bd351023adcf4089ddbc7a8ff2abc60d93dd442920141043eac9a482884575fe2e1134ffa08d2e0cefaf66cc69522a73b95ae97c118f39b1cc6ed985c16cbc87f255bcafa39f56e612c775ba08085b157533711988f62e5ffffffff02b5400701000000001976a91497beda08251d956d1980fe405a279efceede7fd788ac58eb0100000000001976a914ba6a7f681e57d26f1552f70db941e24b8f1ab8b188ac0000000001000000150eedd54621891ad92feaee4c468687bf67d7193c9d811207285d3b7460808921010000006a47304402207b88c2d304048943bea1312de0839bbfa143256993b3aedee941eda03a9f64e30220769016ee38f38742c68341cdcb24d215420bfdfbace3cfee18c7b758e9431b5401210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff02afbb3a433b9d188a22f52f480cdc45c77f255672c554dcaa831c8ceb4ac3ba000000006a47304402202dff316b95f35609f95589739fe228037700c6e836fc9f9f99f5da8eeca9c8fe02204789cdcb64e945ac4931c5b2d983530791b5d96ea5b8bec87c0d022ffab150b401210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff7b5b7fd0925ac938f1392bb7713720dda0e6b7157102c0aa5ede80c27223f0e7000000006a47304402202c47a78f7b8884593e1639a8179d8dd5e752f8f4edf39484a5d01782ac5ea50c022041fa721de6c0c6ab76de8b00906fed2585473152cf141bcd7f8e8697bbc23c8d01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffffcfe9cdc298dd823043bdeae08b2a77dde165e7a1029ea59697c26d6670694c03010000006a4730440220225a95dcb69a5be677246464266f3400a2ffef4247ef835ad4f901acacb1e5d8022042556522af5ac96cf824c56d5961c289a6036bf99466835ef37e868b7bf569aa01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297ffffffffff75d01e9762648cfdb7f0260bc1121e1231194bc27394cafb2cc9b8e448fefcd000000006a4730440220088cf2d9d37c0fa86ed25b3149508b3897a8be8ed3ed734a8f3903a132ca5618022041daea99c62b965a8c4a9db436c5e9c4dfc3fea2b0f39b5f1f0b96b34d7761bb01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff797e2f85ceacd5f3977c81a74517b2182644b73e1b7464a9436c782b3f9b4bbf000000006a47304402206c392031f451252e477e179470b34ff79c6d48cf15e4f1fe92b83d877bbc5abf0220541b0b9898925c9fdf7f2ea99d8561f9aa87e79f3493c92e8ec4a3f7f09f513e01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffffd84fbddeb99ff93cf060bbe4af957a64e2e04727e24bcb70160ab8a3ac83675e010000006b4830450221009a39f1e1bcb9ab5287b72edaf03a6036565f51f1b825f01bdac34558a5fdb69502206c4521a1aa007fcec81967f1d02900269f924080e29812a99095de720c111b9201210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffffb7885dfbd3f500f70bf97ade65a99bd1c4b10b6472e8c4854dfa3f2ed3ed7eca010000006a47304402203feb717ebbc9a5cf34a3916c859d29642f192dabc3a807921fb20a43b951d2740220170b8a2a59aaee95ed2ce827639e1951d7d04b9d68631003393d8ce5bbbeb7c901210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff33c7bfc2a09acd285ffc99b2c1c538da6ed91fbb23dd0ba7c1c0cc175ef8500e000000006a473044022042bdec211b828b4fb35ab1e963f3c75f800fe5bace1124e9a3b79c347f85ffb6022058759a71b31c7e535a7cd2a5eacbdc54d1a7dc06d89a29d524c155688d07327501210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff37eeadbb03b8ca49ea492ae875dee9a3404b4ee228efc659dc8f650a5b2f1a7b010000006b483045022100d8fe0e0d8e720822c606fde1a7bedee01630152e8ba5129a55e347e57afb4a4802201cac9c33715ae981192b40e499437a41832dfcb4027d301e27290690e8d56b2001210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff083f33a77c8c0b09f991fd388e3c1aa3fdc02720c0fc48d7e9b05453f1c6f21b000000006a473044022042ace20a648f25e079d0cf1ecdf9ad74e562a7018bc7ff53b94bba4f8cae9e850220192e04b9c43d27153faa5fca60b1e06fc3cddfcd76855642e928e8a6f664ec8301210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff5a8725e516a928f28bdfa797f9b5b4a91c5e4a4508a3df7b3464974b28d1305f000000006a4730440220559a4d1f3954f6b4fff71309430465e763f5e6d6ceb08e5a8ace8c0748b011f5022073456ef435d190262bacf6ac9457ce62128c457aa24b1f5aca2ab6f1b361a06901210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff3e423119b68bad2292d499c961635be354e6034c2a6153cbc9a1485b739afa87000000006b483045022100d7c4117dee84e7e76f676c4498365bd375629289894043cd610086aa374ae21e022052aded807dd2ccd92e177caa5d08db7958d5f0b52a55e03d36caeebbc9c82cc701210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff941f1736686e63d810ce0252f1331346493376336b03704d2ddac3ead9afe863000000006a47304402206d4f16732e9ead1a3a89c43b44c24200273e989a428547d3322f9c8b844aec6e0220197b836473145bb8c1f7ab957522f6497c9be7a7fd250aecca8f736562772c1001210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff42ed61bdb2892be9b71023ae7cbd3d90b0e44813a040f2a60a0e99ad23d3d566000000006b483045022100f154cd7a6ed77ee70e1b8cf3bfa2c66ad874a5b0410427f720c2b64035f3d27102200529948c63c3ed4535e76ac57eeee5d5abd4999e406b6ed899624d9c9b8cb2db01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffffff0bea498798c3d19ab17df6df9668b3aeee2e7dab6fed11e71781ae101e3658010000006b483045022100d749f1b9cf784ad11b5bb671eb944ab80301f0ff06a9f1b97b3251d953790fb002203b0d633b6e67c74cf055c395d96746bcbd9d8f303d8db91a24b02150dac29cca01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffffce51322b39beb0f2cf12e48116f0f71c1995d955f7d71a79f6a601d6086bdf40010000006b483045022100cfeb04a2e44f6cc6537e7f494b529cbef1ade4f962a6a1bd91b8a2b7def03ed9022075c21a8f6809580c638aeaa28f518464f72e706cce327d627c56c89c3a24403e01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff7470bc83cf4651168def54f7e0caed83deb07ebc9799d1b34b10783983d65ed4000000006b483045022100bb8164b1ee21ab3dab377a357c87182e97eb093ed85142f7f144b09a884f3ae002204272632ecae7c02381ab2d338ec0eaf175a2c5a8d96588424f2f49581a341ec501210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff82884510e0f02eb232b590f0787f5847c893a8defc86b26af5e3cd921b9a1844000000006b483045022100bb66b2f7783c2013d603906ae09daba23d35c30986418fcaed1c3a16026868b40220285e53dc57ddfff8b493446519f6b559ac08dc36925434f0ca6868e61293776401210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff9f086f236860ac3222d043070c5a91a518be797f36429a9e79fb911e62521ff9010000006b483045022100ab794c98373b7b244d4321457b7674039d309fedfefa8a4659c8cd6b8195879e02206d8a6e913db5f7cab8372b81fb9d0c12068ac0bd08763ba390f31d424c1c66ef01210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff83950d4f7573ca6888f2fb28b84c33affa02873c4681ea410735bfcd2edc2b38010000006a4730440220716a57a77ca12743b5d7b9623de2ea8014e5c528bd5adbb713ec5260f168cc4702206b58bb0599c80ae059b6e66352e40b9dd20ecf4c175e58eabf28e8f1495924f801210279c10b608c0115a074494e2d3004aeca33addade2665f0ac0792bff07414297fffffffff0240420f00000000001976a914aa6d73b74d2308700d1706d374b1c781eaa0eb2688ac2f8c0600000000001976a914397052deb932aee90755dd067d8bda82f6c5653888ac000000000100000008819eefc91324f7c59824140102d16cab155074d3c0e6c30799aad00b7b015d0b010000006b483045022100a8b51bdd1c041fb88fee8957ac9d31d41de594676269b298ae5a70652b8215ed02203050b1568f2f21aec6c1a48bbcc71fda0979a426a7d03d7b212666b9473d8fc10121038a67981e039f40b34b6293102a508a5591ee119e1b66ac37dc9e4a0399138081ffffffff987ea93417c0ebf535d5e480ccd3cb3c0a6eca0d017d459b25ed07fee646e960000000006a47304402203603dd25abe3af32c228158158cc9a721bef053da3a41a65fab8d6787003384d02203dc49c4ccb2a0bb7897ef8c4bf354cd0bedfe09e2c4f0ce98a78150ce522a726012103176e1a4f9910e4a76bf4a472e2383fc2709f7e0d3bd788320dc5971a91224120ffffffff0afdc709516ff038a4447555b8af227c77fe44628470ace25cd16bdea0d60f50000000006a473044022059d131f21d082791c3e6a8ca3dbe1f72c7c843b170293e463eed11451db42dfb022026e72d4755e3e2138f472cd311574139eb1e4401d8457e4667cd5200ad170b4501210237e1e8eb9d04ba5e6607d8b2d252dc9bb6cfe4b2e63972bdb456853a597faaeeffffffff91fbfa5aa15c2d73967f15996c12679a182b6b3d41a78ca7c51c4efacce8be62000000006a473044022075a867cae15103357adc16737fa35b7b6b0e48754dd9688cf1a47ec69e1a2755022030fa16e42fe268a983302786504efcc7d930e6d22b8825145118436c70c889600121021d27865370d508559487fe37a9769852a8f13ddcc991b45c4d60df94e2b2ecbdffffffff9d3f91bdf173a66bf08409a3d6776b33d0aeee3222fda32e2800bca08efd93f5350000006b4830450221009ff69b9ea160997d978ac8cba7aef5c42d1004d9f295ec72fcc873d061a27882022008ae5242175a2d781dac8eb68b3657ea025231beb8ea9ed5d827e2e6d685e156012103630d5d09a52aafade1a0d67ef94d1ec8fe036866c9a82cf1a2f71161a1721be4ffffffff9d3f91bdf173a66bf08409a3d6776b33d0aeee3222fda32e2800bca08efd93f5780000006b483045022100ba72b7c49f41d76b96087e6842ebec0f741d0b5e2c6638deae6b4b0854ffae84022056ad077a81045366d8a5624277b30e65ad4a58e2944e20ac5e381a9b67747c90012103b69a2b64ddf7df334dfe4f682d646d27db6f85392e002c3014334e2e75cb447bffffffffbd3e33cf249fa8b9155c9ec2e92fc27abf9a0f9167e3975d466a4a6b4bce803a010000006a4730440220013c9cd0fa7ec8129b55dd083ef3ae5897bb22929259354ed4757195a061521e02202d51f2d1b23ab92037139818d3704db268c5e1f512511e89dea770e6172a0634012102203d41c4ef66496d4cc2116e63dc5d1652c52793c15d69fb03d4e4df80dfb330ffffffff0991589b0f4ef4cafe6eff660bf245059c997dd97c1b08f76520a3d50b298f2e010000006b483045022100b6e571b595ba04dd47035ad43c8d1849eea92bda67112ad92c392feec5574a37022012de75047eefa4de5f0136e33fed8c3d000f4489b2ff6f9b5b51af1db2bad080012102490b994a22bbb1e4cfdc374ffc89a482a1ee327483e9ba674617471b9e3f5cdaffffffff0311620f00000000001976a91498b68ac8c1b4f6be5ed097094ebd99df8b73989988acc09ee605000000001976a9143ea27cb55ca64e3672cb0bfc5500cf881a4fe85d88acc0d45407000000001976a914f87e8dff7e529699bff8e621acb7738b15ef0bd388ac0000000001000000024ce5339ba62ac895696f36436d97bf4e014d425121107e159429d806c436432601000000fc0047304402202ed540b1a1de820ee3a9bd5c51b864c3e80fe1db0169ac7c25efc3daf8e1b47c0220508dd345d5582bcf00a862463c502aea752dabfa41254487633c3dcde03f5ea301473044022037edee8fa4447e5b036a2a0480dbf8d1d5e622406ccc59fa7e357b973eb9220c02206f96603ed379bbaaf1550569653464cd92ba6ebbfd9ef5a4a2c42ca1e22827ea014c695221029e4109cc1472143ac35d17d08d6f23fe95c24b5a9c360b16063b23ecf6e7f7242102bbf21f7d822c684224fc2b86ab9564be7288a3e28e473a5a63bac2dedb29e1fa210358ad8427e4a13647f0b97341a005b936333247de7f5740216c5578f1e3e5e7ba53aeffffffff88611fc3c1368c2b8c42992ac6b17d8bff53ffe371ebc48f895534b46b791a3803000000fc00473044022038d5cb150f634d53516f660c89053a0ca37da9b956afcf815bf167375a0b7a100220392d823fcc331f783aa934ff173b9b3fdca16c17726686dabf86518299a44e6b014730440220046f01c9ebdda922b12900b0060a1dd1a4392cb68f046ac011d7dbd59a897ae802200797854853844761b9ece265904efdc805f97db7ed42f23f7e42f22bcbed23f9014c69522102a995fb65c2cf5fbf92064447b9d1c215fc92f05355e30f7b52ebd91e15bcadbe21028fa5722254d3e8917ba54710c0cc427d8a1bbe4e89e399e555fa633c65cbaa85210286aa0a6003d61f7040799f08b30f089b2049081de19af7cc6861cd8eb977ff8f53aeffffffff02dfd695000000000017a9143ad3245fa0d8c4a9314a65f325356f7a60dd85978764d24100000000001976a914857acf0e97e5c52b370fdabe2a3872e188d2955088ac000000000100000004a9808d72e1fb42366be1dd5a9a849438b4a3d35435c484e79e2c6001d767a6d3010000006a473044022017d281968d4da62840e5c4efb2734752fc1b78296272abbfe97ab76cc2af03b0022038697aedb4b5a81b19ea05e17ae678e3035728f4e53adf762bd712efd35977de012103360baebd37277e4879282f1f1445145d7238eb7da0ad6cdee36f7b22f69b76acffffffffa9808d72e1fb42366be1dd5a9a849438b4a3d35435c484e79e2c6001d767a6d3020000006a47304402207237b7946d79f65ab032fee607be84be3b992b4ca8b4907cbfe0f30b85f942130220446f740dffa39156d9456beac476f825d56cb0868df6350446fcaa77f9cfe225012102992c388ddeaf6764013956c6ec5f33bb431307657033fecf332495a7fb32dd76ffffffff6eb389b5739d777abd643047ac6b950f70cb45f76be05c75180d7b0e390e5504000000006a4730440220357eb3025a9a0837c8fe303c75833ea49c357b20cca0d67e081f6d9e094d53b202200fd16e60d8fd2ebed24e7db7719f74cef80e380b14d2c5e87f27486a3dde3d85012102456b9254fe15ba0bf29261cfbe2b00841e4d7c5fb62aa35f01d3f74c4f3200d2ffffffff6eb389b5739d777abd643047ac6b950f70cb45f76be05c75180d7b0e390e5504010000006a47304402202b1e82c6aa5005038db66bf95b17bb3c82f3c560395e942a0bb677e2c28ffdd40220354658cc698727e7d3e3047b6dbc1b10f480ec8902f7e7f9a134106cc201e77e01210291950e0069791a1f322d6e6473b10a86f725e89c18e155b3160fcbf3b733134affffffff0200374105000000001976a91406966b3f4bce3e79188f97c6cb3a84612535624d88ac4025c309000000001976a9148b147bd57edd9ba2c9e8e232550357292707507c88ac0000000001000000042f69d910e0a58b18ebd7563c4cad735b154354b216a84670e4650d1097f9058c010000006a473044022026b54d47527544ef8470cfc09fe335d5de83b939ea14a1a543abafe5897d865902202ec5eed1d3c3ee8685077500988b591c90e5ead92a257d8fd83fdfe97625c7fb012103921c3e7f6d8a26271aa669c9241ffed0431fecba2009b225a05345bd4b922802ffffffffc1474b48ce5362b74a05475263e200f7f14f57938caa7c81bce5fb1fbfcefefa010000006b48304502210090c270be6b78f1de566f9a44daebc9d4167d1fcc25f30c66d4519b48bc252472022073eefdb9a758ae4f285976261582dce6dbbf6baf6bc739d2602076e12974c73a012103d42441bb555ca6e389ac2623c291ee3f2980d9ef365b5531011bc955c46e2e28ffffffff2f69d910e0a58b18ebd7563c4cad735b154354b216a84670e4650d1097f9058c000000006a473044022015dc0ee31f5664058620fe1ed142549947d16ecdd3548727b472387a332f43f1022075ff617cdc0e75ffa9a8a88638e0c6417ea15dd428fa16a41f0e4172bc05296e012103667504a3bc7405cb4089d11284e99aa2d6c85b95cbd2bc7b45839241309790e3ffffffff21584474d6b0b4bc8c53c9cc4b09534265fcc103e9d27a4a8f89c2e39d41b310010000006a473044022016ac7f38d01eb11cc0111c06cb4b1033b2c709fa895391921c61dc0f957a058f02206611b4a1aa8422c9444c2b16bd669f8db9c823969dd9d32be405fb05f6cc169b01210225326486858039f7de923689da08567de6b59220b5c94c75fa7806ab7ae16d02ffffffff02e87ee30f000000001976a9141cfe17bcc5282df694a3adbad05b33e86cd04ac288ac58ea9112000000001976a914c3f482774ab14e68fbbcc9b9b6005e7412aa5dab88ac000000000100000004d86d31a392e340db1849f153f4ead374dd69a98d280a21cf413ea31dd2507e22010000006b483045022100fad3eed203cf675e387c13070f12a62985d195dd0e98ff14663192c37f69f5dc02206a7d4b7251e4cc0edddeb8f527a981fde93868ece07eff6781d2e44716e7035f0121024040f6ba07fffc5690eb30ac31ee613d78c9747677443731e173b5f9b2c0b4ceffffffff4aac8cdeab369a8bf5ca943709aa1f5d0a0d1796c80c0840e775c19fcd956283000000006b4830450221009d28de08114d2863032c1b8485618b296bc353fe82610e18fe0bc47c2817741a02203eca8b045a772baaab987253e7c12ce9ffc1b4afb6b3c00dd945f2aa10297da70121024040f6ba07fffc5690eb30ac31ee613d78c9747677443731e173b5f9b2c0b4ceffffffff5a4acd796bfc7ae82a621d423944763de029b621d6c64bff2332ff265a293675010000006a47304402204f874e721b0642d46406d4d542dd42550f7976f763edea22be776857674091e8022016985b0c857aed4b51d9089a8a9d19bd0b37b5ca85ce77545899a049eb9ea4770121024040f6ba07fffc5690eb30ac31ee613d78c9747677443731e173b5f9b2c0b4cefffffffff44b23bc15d7e2d7360f75d0c6055a1054d5eaafa80bbbb8e41c7ff72314e459010000006a4730440220526d0c617a3eee31d7073768e921c10d45b1404f9d0353d36f25bcbd8fae829402200f9998d6013731e6ac9b4a72c207e0f7ca662cc7b2ed2a8e1019358eca3c9d530121024040f6ba07fffc5690eb30ac31ee613d78c9747677443731e173b5f9b2c0b4ceffffffff02002f6859000000001976a914872166765f45d3125a6e7b464c6adb42b44b80ed88ac76671511000000001976a914187381f0dc68434d35a2acf06b763ae25bb658b588ac0000000001000000046f86122af2abc36cd18b9017f5e218d0aeb0d48cd8d678ded1f3b7220a416fa3000000006b483045022100cfa0f801e12e7f9e2996fd57c51b3e0964cc2ec77cc871b2b20669af6027fd7e02201596d6e2cc05c85c1f1b15e3cc233bb1212ac6a1f578e8e37ba522399e9c1691012102e17409d4791004d9a3b385f38488f4b23733b25786512cd93a8010cc9a2aa9ecffffffff04581122477ae8acebbd7478151f823889d65df1ba47f1da0121cca34da0d36d010000006a473044022079e1496a985d36b491a422b172c24f5759411972b23f576b1413c6616890f16102203cd56961761bd5195e0800a3e6533cd88ba7077e849756ed1cc170105b6bc8f9012103fc048737cb94121174f58a314ea6c1a0005916fef76caddf0dfdafee83d17c2affffffff8f353e7d36e3fb1c11fc9f7e3b2dd50e86609646c0bc01f729946dec6687db33000000006b4830450221009c656ef4c7adecc1e10ed57f0ec7a6e9239bc7be2b09eb947396da37646e08790220142a96f0b572b72f91feb6fececb876eacfc3214c0b953b790db3fdbaf4a38be012103247e0e71ee443bb9b1de408b97d87649fe5754d80a3242175720c1b3092221c8ffffffff49f6541e700d9a821791dada89ad66e5b5e214486ba4d60caa30b2428370b9e1000000006a473044022020369771d94f1a424c67c4bbaab02bb4b23d36e25963ef32876b1b5d6ffce60d0220486ef8e02ae9e7bd2a07510aea84c9ffa517cc33cd85421683359959af9d046d012103b2bfd7dd05d860c989b3e2036a13d7ded1ef9ea7371e6c0ba9a49919d3bc718dffffffff023c481900000000001976a914df9dc0d20149390c51d0db0be76c24d1cdbac56388ac85d71b00000000001976a9149132e50950edf4e22b0913e20cf268dc328c484288ac000000000100000004c091f9d6b044a1fd252868ec88a925f68c97e3890aed180c3624fffeb62e6bb0000000006b483045022100af59c0874ecdf4c86306d7b4290ecb2efa7aab34df95f11a62ce9e1e5be38748022078df0c8dd9a39d44afddc9cabf4a7b649c6e2cc729584fc28a1153d89ac4429c012103b215067780dc087cf64bf86e3bef6458a4702e24d8a1a64786912ed6a8f04cb2ffffffff09b0aa0461429865d6bd65788ea7c3ca723877bd45826d7ac3c9aeb681b04f5c070000006b483045022100a760218c4c33cf40e8be1eb8e642a976e6f46b2fa0fc136a74a9b237711426a002200cb66f03fa88897f825f788e4a78ccf5f993f788bf0c912b5e4213802ff92879012102ec7e292405b2d9650af62312ce38f3d224a735ede955a7b62a67f0a487dc20e6ffffffffd45f83dfd49dcadf02ac6716c39d5d7b79cf2915466e2bb2347d14d353a2b49d050000006b483045022100858917399df867452d179347950d966b5964ddfa136cda7f51bf0002bf908e9e02203b07ecac7ae839da535e3113a7a792c71fffca257a1576f651838330587378ab0121030d842fdef76774c27c0219b891fd7aa0648ca647f009853caead84b2c822d2fbffffffff04eada01f1cf34f211ac22a7323629043b9852a6e3c157fef26a2df9229d206c000000006a4730440220280f97135e20900536bc6ec1809ab907efb81c1c5f2cbd741cf2b0051a5378f90220699754cf3eed6da597ea4b4cd964522f42ad39f0319a95a5dea0e0a53aa74e9b012102e36500ea9b9af4cf1f7b70461614bc427a72443190ecf032ccb53ae19f0e53c0ffffffff025d450f00000000001976a9143704bb5562051db89b7ffaf94ace4d49ad5b11c488ac01199404000000001976a91473f4cfee8d7f66ca82f82baca6c54fe8603c8c0488ac000000000100000004a76b969761615a5671cedba45a67f8051faa3be672aa0e2ab765d3e1e9406669000000006b483045022100e36e9a28711c767300434f3be36e98b7fe248e146091b1469e50f6b48959a02d022018b8e9f724853c59ba686b887d01488c22e11c84986a25fc09defd51ff7fd0310121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffffe6cfaac578c5caebda5aee698466583532b262bcc5d3c51e5da93054dca6111c000000006b48304502210094b8d219a82efe1be7a9d842859dd23ce195e7aad99bca186bf9539a7eb8da610220784353a960e29bd8d0d51d8d1887f968a4b5abd53ef2d70442aa97a45fcc866f0121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff53ec47319ef2c9daf1f34164d5174fa9f1b5104544598e3e2de1b2bbcc2eda44000000006b483045022100dd4533718b05d90121fbc6d1115d1932b325ce9936f8f667359af3d180c0aa4c02206f2d9fc7dc8b2b5e98134755baaa8637782eea74f9f32d5a4c12974f552256f90121031d696aa1ce74877b8c64a2332e701a09a5d87664dc7e8e8b4163d5ebcf77adaaffffffff5ce0040a695fcb46a324f93ebdc0bc171c3820e082e42aa09976ab4ee561737a010000006a473044022072977b3c4c552ef0f59b516f755006615513ce68fd0a43f6820a9cec9835cb9602201e7f77d450981e2646de2e382af3847bc597cda3a5add10310b727404717804c012102715cb8c7ebeb081b2126092171aaad613a0ecf61cfb6b454e1a9f3a4d1e25022ffffffff02a0261100000000001976a914004a0481479b06d262a066121ec8d1423a04f3e988ac70d23703000000001976a91438860090779c6df12ea41cbe472359b62957527188ac00000000010000000b81bc3de513c67613d87cb7a9f2a1724fae68d31398f3a14816d695311e4c45bd000000006b483045022100ac4fd58a8fbd2313e5ac0e43309ba7f5094d1589a241ab83e945f3962065befd02202c6bccf44c87ce7ed94844c0157a4e75e2663388e7fa6c26843043c14d0153ac01210370bda3953f887ea377fcaedbbe70b1fb3bb8f1706e33890fc19762191ae975f0ffffffff81bc3de513c67613d87cb7a9f2a1724fae68d31398f3a14816d695311e4c45bd030000006a47304402206b1f047b474de8f6019292930e0a83e24249fce870c9d82f7560cf7dd5ac496a022044366d8e639f0d5704e5aaff6c2f2a90fb45ddc3567f8c1df62d2f70757e4fef0121037306a3293f071ff9f2bf11cd6cee6f8ae1fb37e1b2f40397eb403e2e6c0afb38ffffffff81bc3de513c67613d87cb7a9f2a1724fae68d31398f3a14816d695311e4c45bd070000006b483045022100b47d46a53028b8958be5533d2ecc992adf47576071e823e3bc72dcf0f0542c1602206e928913281dc8ec19931ffa50f5451363a0ab9e719664173a67215517e8d0a50121024a512e398d4809589bf61bc9d883f5a7b261d16d3f7ac0b51f345a090c53a372ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4000000006b483045022100eb88e519991237c788d25251031cde1660177031bd7256e900f9ef81578c437d022071abad8e8339346471acd4e7afbb2f9fd673d81b962484dd0e6789bdc4a51d25012103ced4017b04a849c4ce47340953c50d4d8e98420db4f7ec5a0299c3b331456517ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4020000006a473044022028d7cacf11e28566264a33f11dce836cdee5f25792a5c18817eec64f4eeea049022006a61c77e5e91ce6c0e84dd38fa8948b3076c9a6b2f197fd57c12146e3c873ab0121032725d4e881be5db8a2e4b409b2b541d4a3c2831434277be38958ecf46a720074ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4040000006b483045022100d12e475e9bb6600d7c0fa72196b2965302b03684141bc6468d11c4a423bf44f4022075ca23aaf7d00882d6d952629428ad7d42a1d78d8cdb116f71b6735b0e5f4b040121033b20a6374c5c9b28c286037e482c06a6987994606dc6cd0f8600522ddcdb8857ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4050000006a47304402203a2202058f683d5030499ef64f84dcb699d4bc271fc9c066faf20113a4458a4f022045326903e2249910abfe1fb6172cf6255c8bff7edd4893f36a8e694b20f5e89d0121031c6c03f8be7fa1d02a5c08a6917ab587fe575c76bf1ef9e18978def130bb57d5ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4060000006b4830450221008eb76c20bc8cec96c2ea68d2cb6d41579b7f2832ae8af062a97df207af5ad1fa02205622b0c7f6a8cbe82e7b28e749b306af3ea272e4b63c6f3a891e7d2e79c67b63012102e143780bc5aacf49eb2f6a7dee340d7e36fd392558dc6b485e66da6ec8e61e5affffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4080000006a4730440220169d51188e8bcedd2f8117724324450d27cfec90e4a9142ad62ccffd83a51418022016b46a2a7fe1270dfb729da7d6b21c2f4efcaa0e9a033fd3a914f01c4cc9564c0121034d5b5b22be51662a7bf43194e8a818e7a6338775dd4ec9f70c9133982f71f3a9ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e4090000006b483045022100fe880738419f23d538debd15e9a6f2bc54f8adb66e6016097eaed63aa1f5c0e1022019237739ea8932041f4cea6c0a7d66ece41197b4edb3a1a8d4288276595be5ff012102dade633be2b53b6bb33d1216fcd839f37079af8c0d27b37dad1d23da2a724534ffffffff45860c1e6813ce5c8d9b6b7d1ef198ef1b6e442283cabb5a065f3003d442f3e40a0000006b483045022100a443e547efd6ca3bfed49af73ba1da0b1dfcf573df61c4b4bc2b743c3bcfeb1902201927fef3938aa0ba247baadf065eabf46624965ed705819c9c30131b4297f77a0121022d4aef0b943ff10a5db9cee175d6b677a0279bf740b85a3bffb38956b95fc9d0ffffffff0b00e1f505000000001976a9144f34965f7cf7468b1c5cb931ec0dac228450c7ba88ac00e1f505000000001976a914d0b0b7b3bc6e40cea4244ed4cfd98792e06731b088aca7a91000000000001976a914fb5621da951819e6c8e197dbeccd39dcc12034a388ac00e1f505000000001976a9146ed40a32dbea9cdb31a53ed36dfdbbde073adbaa88ac00e1f505000000001976a914dd8fb366dc97c7d61dc387d1cc5b31403dac35b088ac00e1f505000000001976a914b0c89352d5a4e9d55d4630b927b759addae6587988ac00e1f505000000001976a914d8bd8f30b4afa83d35d51ad07d7bfdfce5f3421088ac00e1f505000000001976a9143377aefeb352fbefc7ff051e33b417806fd5772788ac00e1f505000000001976a9142383aefb128b96b8fa51388017531d852de839c588ac00e1f505000000001976a914a3081442f2531f62d4dd7c2ce3b04cb63a15874e88ac00e1f505000000001976a914af5f1ff37d57c8c6031cb8a3c3a0e8e69b72bb9788ac0000000001000000043048434b55617a71edbc0aad8fb45486c69043e4df6c920ccc8e3d834dca046c450000006a473044022054a9c5d67f961ec7af89680e72ab3343c9d3de734e824c69b4fa77956e10f8610220217a0b1bb8f9ac186a6859df1925ef682675da504657b4beeb6f89ca34e2791101210229b0a6c102bf5c905d4bcf7b6724221fd978ab4ad42dc50d6b7a4e29e4abf168ffffffff43d6b66beb75fab0b69bc0e9eba35bc83ec51cde13fc0e93400241324f695e9bff0000006c493046022100cb228150748d3b22354c004961e7c4adc8dc84b1df48017f866664c20ca52e9f022100d76507a0865d54b4ef85d7dba59d02a5162e5ba2de1871962e37b96f142a71a801210229b0a6c102bf5c905d4bcf7b6724221fd978ab4ad42dc50d6b7a4e29e4abf168ffffffff65e8ab5e443bd8fb64f149d726113cb638dd18e5d9eebaee321d61d05f4e56f11b0000006c493046022100af628ae05abd1a15796dcc70e6f3f5d18f2f47542425811e1ebd28d4cd70fed7022100b50c02835fa510ae42a1769458c67e8b7a3a7c16c3b3552c061670681306f87701210229b0a6c102bf5c905d4bcf7b6724221fd978ab4ad42dc50d6b7a4e29e4abf168ffffffff023b06deeb2a5ab76b49efb698a6595de7f4924a6cb286601e0907e4e4d955a9020000006a473044022049c0677bae6785795e4e73c036a8051e5973c6b161623cee67aa7165d71f221402204d5172511f479dc80f8f89b069c1b6c6c92eff4f78f7ff3a315279506f5d48c301210261106ecb8cf50532bd50c9189f1ee971e4869fcda56e2f1193e7d4def7eed785ffffffff02b3bc0100000000001976a914e2b94a36ed7c4abee24f8ac390940cf1645882cb88ac6ced0000000000001976a9144f45d231b5f69d9cbfdf4124a864ac0d8ad64d4188ac000000000100000002eddec1fc14de1645a7b534ae4b8123e5cf48c252382a16665b32dc72d9ff9323000000006b483045022100ca44dfa913702060b34f62f334f89cd582e3e6d4e7d28c2fd74fa531a04a974a022079f51032183f800bfb42693f1264852eff33b74ddd4589385b01aa576b18d79601210314f9b7d67d523a169e179faf44aa1ec37f80ca767573f742b7bd1f8046eeae60ffffffff4fe25062aac5f1784d173aabba656ce8f0542dfe6fae4e603dfb38eece1e493b010000006b483045022100f8ca99a3270f16366ba150ff3d67b8cde689e48d6af9d14a4263e34462157488022020c9469553fc50866484a639ec6550f44b666f7bf47d5891e0732f08b6b750b50121024239c436650505a685179c4465c43480b2dcf5ccf09cf8e5c9b987f83bf016c2ffffffff02b3bc0100000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88acc0910305000000001976a914abdab17d18308bfeb8470a846f9916514f96ed6988ac00000000010000000e1eccbdb45c491935639c9b66b72bf16d8c5576e17bb65d8efe5b1d3b2b2b2b3a000000006b4830450221008944db7ca3b10067425b511372322e8c00a62fbb86648215b1ce550ba19cfe7d0220761b2e6eb8b368eca17965df25b6962eda141434b6b875c5e5779f0c06826f09012102f5c481ef4d22a7e34821c8895713c7767a0d488b762073af1e9149e133616c70ffffffff832f06b1e87d12646afa819ac8d9726d7922e7b77f9a118090604c5ef84749d9000000006a47304402206427c7770555138d853f0a80dec5aa2a3e1af2a7bfff121624eab92ad86738da02204d6715086e2abc3ed1d9c01992f9cc1bab995ccaf241c28048603c5a7f7486f3012102512e8f9d11e85db35c25cebef218b145823401b1f1953d7b735671179c1996c5ffffffffcda6e2b0b4bbb3e2d7b1aaae693c638ab79ebfd9eb320724e2ec942c2c712530000000006a473044022035bb82942bec739e7053bf027d9a131d9ff4e418575b8664483f8a2c1d83ba4b02207cbc9ceeff08261da12867f61943cf1bda5ca68740e71b9dca8a6fa4d4e53b1d012103bc1ad40a3dff2ef9b20463e77f1f21fe84274ee72b032ca51fa96b7e572d2011ffffffff37c1202665c58da251423c09919ebf8846d25a729e5ad6f6e0189d6fe703ee66000000006b483045022100e60258b2ede8aff281f74bd61faecb34a700dfa1c365e7f28d13b070078e1833022052826be3a2754cb48febcdcdb30cea20421a4b0e2316456472c0ede41718886d01210322294cbfc1e382a5b679448d7f955c986a2563087fecebd456eb1d0a8e3fc39effffffffe42550ad7f4dcd3091efaf87b590be523c0f789acad0e8e455a211086173d40b010000006a473044022011fc06c473a9b01bb50026913f3ec993f4e113d97dacba2d8919bebe19968eb902204b5989c935c2cde6291dc9434f44380d1943a7d20ed5f11c716906b091f492e2012103198553c2ed54d3c000cec7c48fe330ffc81cd74166ee6d14d818f7d31d7da607ffffffff17903c7e53fdc3bb3a887a44449cb8f84d4e8192a23e0d68c3e2b3c40faecf41040000006a47304402205135b64bd95574ce423ef65d492f342f4f0b89974df1f80c8fa8e2ec734b303302201cbf925be716f2fbb4ca9373093caf751a8052c958579811bd6a70e59f4dd9c601210353597b12daf4531de465ced64d9e66f5659ab81507d6072d26758274f6d3bf17ffffffff256a0d2cf29b1e14b2e0cac4dcc34fc00989c1df6256da96921267ad19406178000000006b4830450221008c8096e7d8bfe717a6e5ade9f6ee80de545b4ea150a3eef7163bfb43af8213010220415dbffe504bf47a52f0ebca4a8273467aa1c726f193a57d6bbdc5a94a5d8023012102fa223797977099b1d2fe22fcff8fe0f22b8e3f0a31545fff8f6b15ad64ef1e92ffffffff0f493c25fada0542ef3678339f9efd24c318945e87e97667b165df02e90cc4d6000000006a47304402200cf194e8e45a11360a4fde3d7e5f8e8c145d87419a69c67f11a62ff8ed650031022046a6528f085db791a9d5681d3e73e8e737855c522f0ff83ee82ca6b19c23e172012102a210cf6f57f17cf4cfd379aa649f5977515472ba77d5fc23517d8746c8c6c48dffffffff9a6779c9e474b79c2c34133d114eb061d05b14304e5105e1f414d808c5f880ee000000006a47304402207b81d12d834f77b22353d68c6a7b300e6a5a8d9e5428c37f28d0e9f597e6d02302201d512bbefb2350ce0701400f308f3016eb5d70f2d3e7b8dbd39b9b2e776caddc012103e611396508c8648cfc348ac1167a227dcb08e2067448236b6288806558e2a9f4ffffffffceb2ff8d229274cabf76baf43d685ac4de2cf560e2adfcb99826cdcdbeefb66d000000006b483045022100dd151c8327b5c385f4ee572f5149383900118c099a19c2b1ed83263089b50d2e02207e58e74ba95fcf57618d3aebc109f46bac5f46d6005b234831c4c2c684d081b9012103bb7e4e7f87f3ec1e69d47042636bd60cc8fde3e2cfddc70ab5a58ea9902ecebfffffffff6941a70b4b3898d9ee26c15069a741b61d807978093af79eb809e9b4831d35e5020000006b4830450221009c066cf80849f8b4a0a3dce862c4647bdd5c0aba87ffe3c86fa3777f06457d8a022022dd2948a53402c8ee9148346b897281509e14594b3621820d6092d2567d739e012102a62b9da8d00a065563c4875b20c8d8626274fc9a0e098e7441aa9f30e3f07be6ffffffff741df0ace0c9848d676c21014fb7a64bc972dc5c1b9d09882e2dd05be0713a76000000006b483045022100fa07ce177cf69430978f858c248356f9f338a61e92e0b44cc7ad2ffd757621c3022063dd40b3d6a10ed7fd8424d589d3dde8b32ddc7b1f0285e4b21c80b3160ce938012103198553c2ed54d3c000cec7c48fe330ffc81cd74166ee6d14d818f7d31d7da607ffffffffdb65bbe6477accd63f09c9eae81dd849561f53f8d5347cb1cca63fbc54462918010000006b483045022100c307d054758453bb0d00d7351a3339fb0ddfaf9530e3e57d2325154002574757022009cd09bb5607c48b64453f1b1f1e548792c49c10d7df87566cf2ab154b06f0080121029c5139c0bd06ba5cd961d60bdfe0295735d45d0f261d2dc128577d94247d1892ffffffff91a1361ce520453c78aaed3edeebd7af223c67f99dfd7e4a75ecaf9bbcba3fc7000000006a4730440220370e0dfd3241f2aa1b0e6422cdb997e7cd5a0a18daa3fa5405f2835483538456022069608fde2084135ed7764fe3a775df9f79b4781c6475f822d6012522a7941cce0121025c94a0fa16542482cfad7cdefe74e2781be72b43a12ec543cbbba2a6a23627a8ffffffff020358f660000000001976a91421d9a838ced609f2f42528a2af4391854ee764c188acc4800f00000000001976a9143a2e1595324d2dbd05287d72a0f4cf0014b0f18388ac0000000001000000072e1539e1086947ea5fa180cb1b768acb9798033038c0c7e1f85abfeeee9524ac000000006a473044022040eaad587504e3dc05399500554fc7523617301ef4029090bee0be0c3429a22902202fca55961740c7c2227c774a6aef1e4ade5334788616d7ca3444db504d94411a01210233823b7b56598284786ba6d8cfd9ed418e09a87574be33059887c54e78f15449ffffffff93c715685f2aa2ac0deedd01d514c6f2cff438bfcaaad42f6590d5245115b861000000006b48304502210084db57a857b5130ea477d3dcf65b85a8b1f4d118edd27c257ddc1934bed0c788022051204153c48fda2998d35e88957d4c7f696e018d5f9e81095a3fea80fccdbf90012102667b9161b3a987d1ae75d08bd3caeb037bc05859ce4080c799b920e7de34152fffffffff59f28de28df36e4a65c1afe2d008824536332bd4156ef9a722391bb8dc93e6093f0000006a47304402202985d68865c240f401f1a5206293354df79016989370368ecd9d6bd6ad67437002205f55a7f97ceb235640cf677aa4bca049c2728e3896915317f7c15ae7f1f3139501210285a3bedbe36f3c54516684fb3ffad1421356654240d5a6ddf5b20ab971863762ffffffffead3e0d9e44369ffce58cd281c49d5ad8f39c49cb65fee366461a2f5c982cf4a000000006b4830450221008037a38815035343b71b44ee691bb026e087baefcaf8495c9762994b0a57c7a902207544797040e8bcf73a7328f53a77e823a482e2a8c902e3cfb9f73c0dff1fde6f0121038b6540428c0796c6a5328f114ea7edcf360e38ed893d14041de1bd57d917d19affffffffa76b5e0b1c7d5fbc43e2f698ba995d56865198e8439e7227b7bd0672091cf6e2000000006a47304402204eddf8d81b97845ca655bd7ae1a6e29275f17b4b1c301a20db0d420e3f9395980220527b2563153cfe48dfbd2671c294ca0af86a4a1083f6f4810fdf1499f1221cac012102f70467569a29375dae92d35c007d496de6733e930ea38ea29d47299793f2bc81ffffffff1dfa5428ad8c6047ca78d63f2f04a129059cde969076d65b38e47ca9e0e4cc88010000006a473044022010ebacba7832aeaa70b0874b61051de864f26e83630722fc8100e259953af149022052b707fdf8ce506690c0d0029afabc41fcff292b805966b25ca8e679289ddb7d01210282b42dc8fc746b376c1641f33cf7c64d222a703aff32455afe75e9176713d0a1ffffffff2948a2530101a4ed00167fec66d3b477d8348c421873f65d6f7507bc77055ede010000006b483045022100e007623f44b6a33322438aae23e4de3f256db3e69f3511e30f48bc644143c81c02202edf2d8401af6585d56ac30c7a83efd88a443834f7fa36c1f524a97c60652663012103c8487b70c2340b52542918815ffcaaa2623bd1b4d83ca0e3ade700e4dc9a6944ffffffff02f718601b000000001976a9146704f88d046d59c86d9deb2e29d237b9cc7e8ccf88acf1440f00000000001976a914260cfbf537d5401e5fe60c6ef9fa72348100d6c488ac0000000001000000196123c4018ab778506726a2e0eea8d7cb94a1589560601dbd6e0df8d3d91a72df0a0000006b4830450221008525ee1d88c93e9b2e0d4997a0a5e986aed404def89984f7650e27d8cf07e5790220359777703be7bf01ffbadb124a5728863641746c7da6cb5c3b5bbab2f8930c04012103e4ee7b5391ef723aca40ab8240f4d9b58cb0f6936c84a450368b8b1baae29a0dffffffffc8947469b161a17896486b273642576aca192b61b8c65fc10f7d400166f3eae7120000006b483045022100b77485adad1a5c364b48558f71425ae7a9a9e82fca0ad8faeac3967e26ce335d02205f362010c8c73e95a8d5e2e31e36b699ec67ea1e8659b4266b15384f73136d7a01210393e146a26868c645ee396844e37de0f935e1424123f5c0f56219b67cd7452fd3ffffffff11b2347e7261132e65c45a5a7b13536e8a64e7045bb3806846056ecdd3b97258110000006a47304402200d65120d022fc8d01e67014adeed2c7be47ef48c84606d04f58de1894505cc78022023ba7e93bccce8952c12c9168679ff9b0f3fbbce87180ccf025d45ef6c0372f10121035b987d0b0680a2dc3a6df57d4ab197b4f2346063f5056a866074b1547c90ca22ffffffff2547aecb2059ec30030e576e24505973f603b082b9f4613ee307ce0d45475fa9010000006b483045022100b8f8eacc70ed3e59d9dcfeb4b9752f2cf4649aca6096e14e954da4b84996b0d002202070968f771031476348fe7a0ebb07c9a334d95b3316953f00a887043afab4940121036f6cd5857ed89ebe2dfc5bcbda078f7cb586499acbbab4e310ddd1ad0dc8273effffffff800b9d1efefcbd90c435e63deaad265211c412877caeb786ced3c4f8f9d8a53f130000006b483045022100aff9cd832df2b974a8b06dc80455ca1f59557e3f23e22f1293e1bf0753b9a3d5022004155ab666c1b25502c793e1a66945d583364771c0ce15d2e366867ce6c2964c0121023fc53cb8fa5b23ccf95a8a8d16766cd754a256623820778b49d3bd808814c8d7ffffffff4c285e9e25b6799c9e19a65d5afd90e5a85a339ac29d1250c8d31535503049de0f0000006b483045022100db6779bfd8c15a29d5cc2d878b6cddcd71ee2cc5c6084f6e5db884d78e94d70502206f66be54472e08bf32b96333492938c089dbd7f8e6a1f441feda20d868dae59901210358afad1e50576f953d83c0a672dbf62623fef593cac3173eae5677e3451b090affffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208140000006a4730440220295be96d97a453e202805097a455ad0503b3fb62061cbe60ebe8e08f319834d402203bad741829ee78d9a858329f229118572f3c174ba37b3e9926018dd98d224475012102cbe176d942189550647429e6c092b135e7d257a45c32ea06686f158803c3d3edffffffff6b07d42eb24afac92e9f07f8937ae84e081394c110803dc8fa8f94e761aae3cd080000006b483045022100e2bf09bc5b67b1064dddfea96c56115b6a3a578e388fb6d9439abeb7f87228620220382e5794469975f626b09cc25520ddf0182e7cb0a58ab6804617273ac47b69e5012103c1b32a9d55335c7b5147c5bb80d1565845fea48c066583c912f60ea440c49b52fffffffff103049e0f0c7733038df7ac3cc3ee0ff18dae2e189283e0054f4b6611e3f6b9000000006b4830450221008f5d11da1b3ef7a0ac5e86e05ca503fddd8c4b2d86fa5e7416e569c7285a2a720220601af3499931e59a003e8069f2e04a01e8fbf8dc492fd5b5eda0b3d2f07c71d101210340f7a7827df5cdac10dc173d2f103a806a17496dbccd8a001e52d76f03050c80ffffffff6b07d42eb24afac92e9f07f8937ae84e081394c110803dc8fa8f94e761aae3cd0b0000006b483045022100f1156c6847ab6bc1a05b97c8b6d7e11c237c20e52155ca72632acdeeb19371a20220441d0a6fbabf83e0eda37e05b3b0a529f0d6235940b213ce6dcd60a576e3ed7c0121032c6c3eba03ac9b09130388468f07f4c03b2736cb73e8f8e870f8562f09350c0bffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208130000006b483045022100b9a5641cd8438395d311571d80eca4c16b9bc2cbda733f1e3dc83002325456e802205987bfc3c8c88c559ad07c568732ff899f93754f43a1291e2aa1cb83ef4502b4012103cdec1777bb145b9345df1875f15403070f408b9f69e40e4df4e9a7812a7a1374ffffffff8645c70310ba0f150c831ba92431cdba992b32348331b29f4b4e42151d674821110000006a473044022039c5649e2040b08134ebd78498fbe05c9dd5a3b7d9788fa84485a96f50533b40022021b96c3991d95b47585816c5914249d8e76f7237d0944c20586c35042ef1d9bb012102e0019fbdabc94eaa2323509f10feb15ef48a24a512b421fc0d27f74ff777a7f4ffffffff33de68e5fdf1302b3ecfc6e79b4da0f50810d4d98dcfec43e58913698555ea70090000006b483045022100f4cdb6558c11abb0da8ae21f6a7516f82a4b36c1af71fe8e93f41036d3d57e510220646477acbefbe10e679d0c8eba8a479bec25873a16f1d4022e34eb3922a4d2940121037f756d9be788b7d1d37472c890f2b9b6e7c73a897de7e2c4eebcd171b5d1b244ffffffff0652e525b82637a1838e85b889abb62d30c895b5642755147066f2a3e81af979040000006b48304502210085024477c17dad2e22fb55d2dace00dd2f2f028e14a38b47cc71e1ce0be018550220705dbd7e8b64baf8388d69a4cf0b516ff924d57dc8f9dad4d8b8e485f102d751012103da22982eface5c52469fab0b15ae7850369f892ff030e0223e4a90a4e296fa68ffffffff1f2ebf44f950419ff2498c15ee0c7e1be2c15374a2c8422d7476414852d56480010000006b4830450221009b07a4b6963fcc66c2118463225b52a75bec9fdf3863c4774ca836a5a5564eec0220239327d0df97b7e56d1cb2d401b12bf3185293c3dd10ea637410d21bf60b267b012103b0cdde22301f2a0ef9f23f435a52e989a244306440eb15c712d5e373a809fa8bffffffffc8947469b161a17896486b273642576aca192b61b8c65fc10f7d400166f3eae70e0000006a4730440220339e2bca1ecd2250b0657d8f6b8b2d353d35343f56abc231357dd44f6bb0839e022071b9a535803569e9ac5a490b6aca3f9492354892dcd0090bfbf98c3d58e8c049012103a02544af63026bcded0b7cb4195372cb5821ac34a55bebc3de5c83e8c2b930aaffffffff1646b1d8fe71e508a0a85b82858195a82176ec104b2b6505304de91bbd8faf93010000006a47304402203ab05e63ed3c88bd1157f6727b928c7f3ff0779dd16d87d37b840a310996db3102205f69015dca42744841cdd10878049a79d71759137f0a344bfce6a844ec48f8d1012103068056870eee1c8b00579edd794a2279282e8cafcd3b174ac0c593d0b80e86ffffffffffc8947469b161a17896486b273642576aca192b61b8c65fc10f7d400166f3eae70f0000006b483045022100afeea65ca40aeadb0adeaba2c959319d4ef6b2dc138629ebbb65b9908800ab16022077b98c4ed7de26c12c1262c89233a217979a8f878c7a42377ac4dbee253f0c660121030d93148f664dc156bb8b63152d319d5b4efbc77e3b843651d2208e4a488fa9abffffffff6123c4018ab778506726a2e0eea8d7cb94a1589560601dbd6e0df8d3d91a72df0c0000006b483045022100f5ac603c8795ca69bbb54d51f17b7123ccaed647245ed82b1392fa16d0741cb1022017cc07628f3442ade369442ed5152727ccb7bf506382c87afc5547d3ae8dec5301210384eaec7cc1826b5d8d6b5e44d2e72811813e87a34ff4ce4bb8b8fe3aef9b2ff6ffffffff4b641e8ebc9112552ddade99cf5c4b8816fc702be843eeb4a74b45c0fbd5f38a010000006b483045022100d0822f15f80058943608f832bbad476cfe74e836c7dc348ba0a9b38b37720f66022053dd5d7d14ae4171453a52e3966964cad0bde8912a28296145786356a856dde1012103eeaf93693efb47aaff34cc68976deef62e72561a86854ae18716619f66f29eedffffffff4b641e8ebc9112552ddade99cf5c4b8816fc702be843eeb4a74b45c0fbd5f38a000000006b483045022100a823704d9a2b4f0c51c21418cc111e739a3b90f011b6416d7dac4fb6c9097efa02205d860b0efd53518f62b85d284b550f4c422179a8d219f085d467305b5678d295012102c3f644ad5286b43c6a09b42c5435e87d760d4acf1ca2b1da9e0ce6daa08680f4ffffffffc8947469b161a17896486b273642576aca192b61b8c65fc10f7d400166f3eae7000000006a47304402204059941c017d85f8b47cfdc80021b1c23840065269c635c368390812e66bd5ee022057903722d7b25a3b69e13dda6c7aa04bb13b68b21499cb1279325489151df61e0121020cfd19b00cea2d696cd2602dbd8af999b997180ada23cb529103950426d31911ffffffff4dae1e41262cb398aa5fc8ec9aef959717a6630ff9ec4136c41f17882e22b8ea000000006a473044022016d06fa7ac16419210fa2bf31c208f7fda12a0d0dadc400b656f33f8189ba0ce02200831908cac90e133232ebf4794374a45a24ca6ca8b8acf9c16074bd784802a9f0121033ddf9500db250a5fcee739dec8a400d8b9b1c12ee89db3ebadfac4d9ca2224bcffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208090000006a47304402201f3db7a9bd47d98b402a4fd13e71bf9c9bec523d46c40dfe559399c9b61773a2022067c20c6de6e08b1d91cc867609983b537a05b081b9747760a2080036966e91c60121022e7b8f0cbaef47ab2c4718ef64608e61a842dfa0a8d81d3ad09db1ade341c03effffffff480cff04343adf2cb53f8eb28cd1fdf66ccdee8f1d0c856d7e248aace0cf1eba040000006b4830450221008930e7d678df725dc0af6e1f93713ea6f47250cfdd94a144f28ee8a10f4e102f02207c824df7bbb00c70007c4c40c70be7b79b92388ffeeef7decd4f1276d6e606950121021e46410e1f9aec2d74a6c41ed052820892c97962c918a306be72e1bfcfe3cdb9ffffffff1360566c00000000001976a9144ce1d946f1363e56cad54c08892cc9813a71785188aceeac0a00000000001976a914b3960cbeb5b40d62b92c90d8b8595df75ca6f32588ac90a38cda000000001976a9145f1708b2309af60159093043612e712c7187f6b388acc09a5e00000000001976a9149f12cbdf26ada0ec436edfb6aaaafd57f7a3989788acf0771195000000001976a914619975a78c21d3861c5ed1c0ce07653734aba4fa88ace03b6600000000001976a914016279a75b692e2894e2f526c955333695c2c7dd88ac00e6e849000000001976a914cd98fdd77ed0a1d2135291ac70920e35054ae56088ac40b56400000000001976a91486211625adfc6701c5af9143e0a0ac6d63916fdf88ac18ca0700000000001976a914d61c32ded3cdd773f06e109afb501ba4e6b18c7688ac50bc1600000000001976a914cd4a396eab9e4bc08829c94bda8466541682431388ac10270000000000001976a914b41bc220da5ecf631e50acbfdffdcf87fe493a9488ac10270000000000001976a914c0d16bd11bfb9494330102680a8b2c91ac8327c188acc0b6f394000000001976a914af647292f4c4d2e72e85a247450ad178db0c704688ac20f1ca00000000001976a914d380fd4164562b1be77cd9537f52c37f41e7f50388acb02e052a010000001976a91403d1cd2e83d105b05afca9e994072f54bc810c6688acb0481ce0000000001976a9143f32c0c9c9acb07a1476f0facf0b3cb38fc1c61588ac208b784f000000001976a914f65d9def92b48dc39df611f6dcdcebcbcad709bb88ac6e5c0100000000001976a9147e2a6256be6e638678577eea4621da469f02b83888acfed30a00000000001976a914cb1672c8495b4ece3a9de72d1def0ea2471eaa0688ac000000000100000011159fcc9cd142529d7e2460e835563ac6b801e07a16e18041ee8cc216fb323b35010000006a47304402207213ff7c207a465802e89f71b0b245d32702b16c03680a705183ac8809c648b802202dfc1850d5c7b0005482bd7b824dbf41c169d5830842f37b2991dc8bb831ace6012103ef3aa7c1538d0a3632ba9463af6c080129cadf4f6819117d962fc0e2b3fd2a33fffffffff511bfc106d4b4b6606d1f7e4c9aaa107073283b5f526fdf42cb10fb3ae67b38000000006b483045022100a3126f15b8c8e239c8537e2ff9327001cb56e6e742f40aaddb8ce4c1abc4d5dd0220510f953c1373daa6626daad1c51bf3d507e410ea85ce24361d6da1385c86f0be01210261d83898b6610809fbc2d5897dcd645acf86704e61a1acddeb5fe4b98dc4aa35ffffffffab864c168689d5fb2ccf5dc242573950f34e988ea89352c6563cc8153fde8a95020000006a4730440220292175f6371216e9bfb50fa8d0bf15cf2bd0be920fdf4cc2f25c01fb89ab90ba02202311fdef458a1fd2bbd9a3bebb86391d105e9e2d7f662bb64a32eecb6ab0b0160121039e177e244afca3dbbc5f4b60d7c16aa2ddbd7b68db94848a83c5eb809c4f64b8ffffffffaf638db891c1e05bd132981ee829ad71a73f3f0dd62e65b95d50d365acc865af010000006a47304402200992df12208525a173ba7c1a82e20874c38e1c575f80a330fd6ad0edc8bf4a4602204618fc927948d6f63b5fb9d069466be2c32761d8dc318e99e1c15c19a9739c5401210343863977b70823235cdbcc671c47a0a5472050e716b6b3571b4af1d28a204ba7ffffffffaf638db891c1e05bd132981ee829ad71a73f3f0dd62e65b95d50d365acc865af000000006b483045022100c701b4b5f9d63423d7ba4dd0dd29ffdc45ee76a351e79603acbcbc4bcbb756d30220746316af1b4474ab1f81652f1b8dbf5b18d79b5b3b2c01b40fc17333033dc3060121037590a1fc8f5f24bdb772aec49046f0d83e9a428b1d919189334114251c6c15fdffffffffdd7139e8604d13a5b09787feef3e91bba6898c685c2f0e9b5ae949cabeb6b9e8060000006b483045022100e6ad6cf7732a1785d12b3c5702f18cc0efca1568b909cf4ec1e6256655ad6729022005d85ef35540a9a91f2e0550f57c110efe0f10aee1465990f8d3fe0048fe5c3101210336568f57547fa9f47a7cb75f0c167546e5f87f0bf3f749c4ff43b487d6ce38c5fffffffffbd78550e1c457c6f0326981ce521da3dd8fddb73661945d82bd2c0a76e85c47000000006a473044022031fde10873a191e5c31952b5d871ad9be7f1764f2cae14cde2df85e5297e22df022038b9f6ccae01e0956cd0eab2ec30208e4c0d857b1b3a156b7856495d7cb59efd01210261d83898b6610809fbc2d5897dcd645acf86704e61a1acddeb5fe4b98dc4aa35ffffffff0173d0c9738b32500bf14042e397825aed73d2ee3efc32142a00820d2f3748b5000000008b483045022100b186a7af6046364e753085532f867d1f7cd0d9f06561eec99b8c2847629b5c6d02202d1de5c096b1717090f9d1c62a9ff8220303fc9bf62d9e419836c0bb02dcaec50141040739d353e3a1aa48c1bf99147ba24b05d6007e36af91480837db45d8614c993169a8a763919cb73cf98a46baad0c8828e95b11f5a433baa84113c52df576365affffffffb7402b75a9b8ac0d486ce49d8a1cd9c5434ada499d261035c56bd93ed29b01cc080000006b483045022100ada6870f2b7825b138ebbfb97d80bece1c945d50be48d02ddd9c6bcd88094f9302200b7d4ece236cca2f8c92f7fea7ed187e456a3b3093bc578cba57efb3e2b62733012102359edfb963073a606c50b6985e486895744595d90377c147a50f7e063759084effffffff6fd4e89c8fdbf8d056b596f26f96ae5c6d22a14c13d5364f8514636974e4d3bc000000006b483045022100c8ce1e4a696b8284aa2e446007533bfb66fe6b6c4508055e0294089fb3152229022026d3555980816100088a0cbf2e2ef05a71d80cb2bad3a5f18076206a94a35dda01210261d83898b6610809fbc2d5897dcd645acf86704e61a1acddeb5fe4b98dc4aa35ffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c5560f0000006a47304402203edb601dd4b39abf32e2f36b5463345516114c258a7dfd774d3eeab7ae3e81c9022036cbae6b6813b337d61338b8b97bc06e6ea6ce6782c484bac028fa5d882347a5012103aa1c2538031f06639873d817ab23fd9dbc1223894608c3c13254a71e4c5510aaffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208040000006b483045022100bd53ffbd35bd144fbfb7965c6f8656611ca588033872020265462cbcd8a3503d02205d1f1b7a388956af5d7cc8e0de801ef697fd3bd1abcd6c24a98e8190b534a2c901210303f59916f0be19488d3ac301bcfa744ddce0812347d29dcc47902f43d8450c82ffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c556100000006b483045022100870e70389c9a63bd99121620234bd0d68c637c68d0a5419a261416af4d8c34960220713183add423b4cea9e6a94b4a588267d304b4c8f571e7b44b3a254c7e3f42310121038dcf7ec05cb0fe0b91e5617204639e764cdcab308ed15e8a6a03db3bb445046fffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c556060000006b48304502210087af1dbe1db5161b520f8414cb1319045d747cc4a60f9046432e5c8816dfd4bc0220042f9f631f200bfe80f99a6e2d209a96e11bac5a861d3cf4645fd79fa5c68bab0121033f8c96493d58cedba0c1838728f979444026646f945fb5cb7750d1488a756d2fffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c556020000006b483045022100b5b61010e05a69ac54c2a2a82ac4b503d952c4f1f84dffdaa6b064b8204ae87b0220070035871d0ca364d093cea20473199b24beb0220fa2347f99508901da3a39a60121021606f24625933fc17f25d3e24b87dddbe4c39cb1034a2d0ef98a825075a1346fffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca2080c0000006b483045022100b7fa2509a3083a5f78ac64073773b8c350071f4c1a21577a0197036c017af731022014867803d154b64d12a3685b6bfe07cc4567d389bd6ad45b3fb89ba828256999012102fdb27b100ce472ad2b2ef5e7cb7207c1aa5949248de526b147521ec8e1c6f2c6fffffffff40075ca48b9cfd9ff4dce9061c276bfc0851827e30c2688bd91154859dff9ac000000006b483045022100847f2cea2af12f96d813b35f66758e28d8e348e81ae8782867d7737f3f5a237f0220225541c76d8dfffa4e486b6698fe673a1cd7ecc1f6cc6f2fef7d503c03b90ec5012102d041c9b36e325edee8b5f2e8ccc2434b5c06cca9d5ff57f4247eaa185c60996fffffffff15a0d0c415000000001976a914be591e385dc9f5eea2fbc5fa898cc78d2398bff588acbaa3aeba000000001976a91460922d3958fe3d511e342df6ba4f20e703393afc88aca05be01e000000001976a91451786aef809e61cd5fd7c6eec677042e98f4534388ac006cdc02000000001976a914977dca296be32635c286dca23145dd54de7abbf188acc0fb6e0c000000001976a914e3bfd71e5b3c3f96b9a252987119a2ed1d66719d88ac0a2dd0c4000000001976a914e30066fb1c581d782831443d931b8fe7ed22a66c88ac8096240b000000001976a914bd443ab8fa36b8c1971217cdd329faee33bfb6fc88acf887c6c4000000001976a914a4cb7ab932995ce96d95820ee2e4573c96608f3e88ac808e0488000000001976a91477f71e0fc266998e4fd3fb202f6bc1773238d90988ac12a50900000000001976a9141232fb0ee6be3ba74eb4de6a8c8c96dd16f23d7d88ac3abadd53010000001976a9149017b9d8f59fbce9681622844a8987a7fe2cb2ec88ac10270000000000001976a91461b4701eb5c9ae7f1cc18041ad766fa74085d18688aca0a34300000000001976a91442952a77acb97e1f6a3945826cf49d6667c114a688ace0c9fa14000000001976a91407c25af50e249708f991413c0e8b216530919b5488ac400e426f000000001976a914a8284f3e648d13806b4d9a5597dc00590c642c5c88ac1e290000000000001976a914bd7e1e8d8dc505d9e5986ac3d922fce3c7b1d4bb88ac00d9b57f000000001976a914a35920f11d17efa28aa4d3d3afaa40f2e3312a7588acaee8ce11000000001976a914c2cc8c71c9afda85f3f0a46de108d89846f2959d88ac80406a11000000001976a9144195947a8d3de0f6479e8f099fe3720c7fa1276b88ace0dba237000000001976a9141bd2d025f0ba34be5c7dc140c2f862364b70ab9588ac5089210a000000001976a914e3ed8f3da0a1349db32a5b903de080aeb3f443d188ac000000000100000001196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb6020a0000006b483045022100d528c6703f778821cee367954b598f59f6c0dd7afed0d69af38498e522c8e2df02201d153b00319ede8c490a39ff48a3c82fd8f1ff7bbc8cc14e0302ba19e06470360121024674d01fd4f992437a4c3b25b70b5d30f718c2e9b2d2d7fa7de15accb80b1b7dffffffff028010b7c1000000001976a91412ebbb91991f7cf074644b7facbdf3a3f258497788acaa822692000000001976a9146e0a608f332ea137fdfe196909d71a5db3575e4388ac00000000010000000261d3b58d2f72ac91dbc4cf130e7d006546cb5424e629ea3a5a66bf4465bfbdad070000006b48304502210090c513a153e1732f824ea6591c3776d2610dae1f226d9fa97f4c82b0cb87273f02200a59ea54836e83ebc214a9c05778b2278be2b2edd93e27ede5e122dd09f27dfd01210318f9bbae99cdafafacd43a1fb7053905d86fa0d9331785b2644c239be32a513effffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb6020f0000006a47304402204b18245af5eeaf73cbc9debecd005c34a1d61360c321df82797e6f16140213e8022022baf5f7959854c2b40eba3cfc704ce4a59212bd30397d16a577c855c50704b301210228d6fbe6eb9ee532657f26d7d4886fc8b1464c4a278ad0787861f9c5b2daafd8ffffffff02401e6e06000000001976a914f42ec64c30075fdb6d28a0c34bb23c0172d0fd0188accef57512000000001976a914275dc816f05859350316dd11bd9bf06b38b051e188ac00000000010000000453f6f8495dd2d734c6856266fd06418191ff932d9bed41fc5c9debe2957d77a3010000006b483045022100be33eae64aa4735ce3fe3290c9d18deb0924ce5a89fc7330f5a15ba004830d71022069e53dbfad425b50cdf99b97f3d466feac8bef8ca37dc03b0dede9797ee0c4770121033b4266a54404d639d92949ef264192c1c7906c16119dd64012e599c7187345cbffffffffb3cfec85a3d2881481fa2a80054572c5da7dbbf895c1538dd50b771d85daff070f0000006b483045022100e3e4a09081661260222f5e399adc3f18601a976f6325b75122d7bcb28bb0fc0102200d4af4843c7267276d685695c1d65501f2880ae26187c1f29baa14ad1081cd850121033b4266a54404d639d92949ef264192c1c7906c16119dd64012e599c7187345cbffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c5560a0000006a473044022046b0b1b5590459eab1677aeb7696d49bc8e6508e81579975d7d466edbb24dafd022038ad02e7fb4e667435d9843534253383291b553d3e23fc20551ce7f99deec3150121030bb2a4448d624c5771d96cc9d0c2ee999ab627cae68305fab4c08c89ed5a631effffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c556110000006a4730440220263ca3494b2af85ca670cf548706e316c4f2f65cb7b1ea3c202ea9a3d7bd8a01022051fc5a7c630bb4a0d8440348117290d1fdf122659d9c1cef8ba08a83f5c8e5c401210325236271e33936ac53e9ffbbe5936fb72c2aeaf2d7040c8b28c441216a1be651ffffffff02c0b8ca02000000001976a914a9586e1c4c45829520e5a27dbeb60b51583738e788acdbbb9e07000000001976a91481e2a8e9af62b241a44f17dfe98c193958577aa388ac0000000001000000042bb47ebd6b506484636a5357187ac605516fcacf5e7b6dbf0d507921e53a2e18000000006b483045022100f74f94e31670a6116a572fc31a88e8b51ba3a9169cbcf7afe6f897b9be2bf00a02207238d89ebf3b3f3e19dd8b3cd467b5fbc384e9ad331763688a96f35b8896f6eb0121028afea3428f046a9629145509aab0be079575b0e6df42af608cf64f389cc9552bffffffff511537ef31ac0c52a7ba90c9b06a817cc43deec5c0533d15fa38f1ace51319f4080000006b48304502210081adbdc31df598742d0cb14b851300fd534a05b55df5824b4c76e1bc614ef35202204486e4a27cd64960c05f641f4633dce85cd9ee244497b136e7044f71ea70b1ac012102c33652cc18460c06898033a799ac2a7cdefd586928b35e711eda1c89a9a7dbfbffffffff7744bf7f5baf9a77d223cb2b641b973b4f978d4e95e5bab7369b93786cc6c0f0000000006b483045022100fd5b6831792302921a4bc21d31f644076f10dcecfe3c3b1862376156a218fe1902204f28da53d2836dc0e27ca3d1b85b8575cf41f614ba8de36936a255d9a925385801210212632d26f7c14e8e4b76f56b97e96fd5c7885ee6ede953262cdd69b97ea6d141ffffffffd1c8536658e4c700506235e3120a1232922a5d4fcbee31d4fdd3bb58d977769f030000006b483045022100aae7dc2ab378ce8382c8def8f0192c5a99cbeb41c0824c3f2812496e9129d5b502205030c26396bd32ed4ef255b85ac093ec82475a6e8fb029427792af10f36fadf30121023b5e03659088648cfa6b5a86377b7f97fd9e9eb2bdaf10fcab2adb23ef0a1bfeffffffff04a22d0101000000001976a9144469cc59b6d244a84cf028cd5e84222dd5a1c4de88ac1db61501000000001976a91498143ade2f196f84c17cd53baac81de70a0c930f88acd6080901000000001976a91459540cf29593397272588224062065f1b61a269988ac5c961800000000001976a9149f5389b6b68fe426bd75b80b405afe075d91a3dd88ac000000000100000010a42d47160add4e5180e30a492ae63495b545350ef53e8f7a6f263e3d88145965010000008b483045022100bbaec976ab11a836eb3222c2ae969b837d3a233582519ef160a2d7c3dd3dd61102206cb2c61263d989b2950a29613227fb83d8a8138ed3aa9e39c6321602e3ed029801410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffffc369ed547521e6c9e6dedb8035016ba96131e5e3978135d7c749feefa68c0e34840600008b4830450220277fc9a3f5762d90154ab4d3af14fb73720f2a505ea6cd73e86f09b2ac1240fb022100ad1fb225af50e04eae91232d855c1613658f6c76e0f5f7aef8ed367f10ef09c001410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff85a86ba9739fce0f1ba95c89c636172374ed15d3425585da84fcb06f0cb7419bb70300008b483045022038c5129e7856d664604d4f2087d74d0112c592e45b148253d2e4f1c28f5dbad00221008bc1920a86b282ee349fe518a0a4a5dc19c0bde79818d68a7ba9a50cc269d1db01410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff7b487a69e552a2d0d29fb8ee80b3dfee1b8ad9972e605342d81e623ab6735bd8920100008b483045022100dfcdae4b798566aa48cf0920013c2eb4b42531c1e3a6fad07da5bac85f03739002206b6b5207005e327d670462adf94886030be441bc7449836ce143f33298e84cd301410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff08fc0ac6732ce3dcb5dcc8784c8a4c7a4d2fa16b45de34fdbe34a068d1a99dcd2f0100008b48304502205c749ec9b1f8c7b81e1957681168a709ca74a71613006f41c5cc58eae50a2a80022100ee1a0f72b012d8398f11205bc8d446a947cd7c0ad621d1a7100a742e3e95e45201410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff3b44fcd72757c7453f154d1ef8c99d502e85a139ce05384c763ebd5279fbd9d8f40400008b483045022100a9b8674960b9cfb4e6aa576770e069bd3a0a2ada4015aa523bb38ed38be2701d022007b8a143e3aa1db3d9137a94224348c85c2005c5ff2dce1624516c08143333de01410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824fffffffffe1021e1d9fa4d5b1da75792dda91bd66bc082265cc8dd8ec12748f2bb48001dfd0600008a47304402201c57b44cf1ad6e60dcb1bbde0fff9c070fdabd71ff0759f5799b34a67c80b5d10220570748c630f60a6273f04ac9422224c2c11debfc5884b3769c34a5a372f3abad01410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff2e1097d43f83789a11d90b5084f0e8b5dfe3fbd0e745288051e67859958dc20b470600008c493046022100ef948770e2f4d2ff979473d6b3d740b4299ccb83abeaeaaed5ddd20ee18098ee022100fc48e8c64dcdf6e7634dbe8a708ef7b5f8ea402509e0373af4f8d8f746b30c1b01410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff81e4563040aafdcba8ac842f4a7f4f4b2d478e6b691e33b9675ef909f11c57084c0400008a473044022042585b74fecc3d94bdc0525b64b8ef4094cd816b8843a9af62841ecdc046254b022007eff2f74e46853ec050ac797975718e488034db5954495e6060f620e8a14b2501410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff138910ddc7c84ff22d827b186659f4f9d4f121a8f82959c32b5e7b301e16829fc30600008b4830450220290cf13a19df2d9891edd8bae9028491db307691db4789353c753d39f533051e0221009896e8920a41c5073ffaa2ae07fb65705622c0395f7e516933609a7672209f0801410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824fffffffff74b0c51664c0bb93fa25d96a0877b4767cea1b001301d8e415392bbb41f44880c0700008b48304502200db653502756f9283ac5d8619a50795381b001a1c2b569afc722fb2a07f109f0022100be6d044cb142fd253005754274249879d7cada9796ac8ece60629b461ffab1c601410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffffdb7243c0b91485d5fb45408b7398cca2f5d028f47aa7a60d311360bccb437ffa860600008a47304402205deba9a6c9aed1cdeee86c7f9a1c3098d1e4da3d062983d95025fa8474a429c202207d118d05685b797767ebecc73a8483970d5fa28508fb26144afa9895350ccdd501410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffffdfaf3b90b8c08586d857403af4cd02d19dfa55008fae329acedf3c7ea75bc9592a0600008b48304502200af54262d748efceb2cffe1d35937b3fbe41b5469a93690b3992d8148a6d77da022100fe25ec2f7c5a9e8b0e74f7fabcec589408c19e8146719776847e8fbf361805c301410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff3a9eb364ad691f850f5523caef4739678e88cdd517e9b42f3e57f51d452b24d9e00700008b48304502204d37efa7b14e962c5f640af48025122c989d14aa4fca230e277010ee33dbaca8022100b6464198588eddbbbbb9b495e96f88268b2119120c29e822df753a59a58f886301410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff983c484c85c726b0a2d35181f831a46f646fee746cb4825ae8681c7c353a94237e0500008b483045022100b3e5381f2e05b601790bc71c5f022ad96fca46428ec8d7a83a945ecdc365ea7902200b37fa13806d818c1d842dde6d24dfdc8cd2a8f90dd360e850d3ec3ef0324bd501410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffffe509bdb4964bd03131a06c5cf08520bd793b3b13af63357895c39f887d67abb6eb0200008a4730440220127387645bf44276e056688394034bc6b4a3a125d3f837a31ff8cc724b221e8e02201cf59e74b666583d41825f3db3cf2e312fb77815e9e28df0685324de1c1c4a6b01410420d96d93f67b5f542c55ac6fafc8624b40044ab15eb785df19a5dce5fb1afe845bb0c4847905f2873182cb495f38a72b81f7ce089726f29692a9f6820c503824ffffffff0274beea09000000001976a9149371ae178d4cd94ea8ac9fb7ee3da27e945e836c88ac27e90100000000001976a91403faeac00abed33f4e4b7f0e8e7e46363190da1588ac000000000100000015d5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c556120000006a473044022055527222c3d03f7d31b0aa01f12d0a1560367a16c2957d605247313d6dcb5260022015b564e00a6e4fe0bb7aa30619c74c55caa3ade1b4236795bdf4e027400d8d22012102696d455a5d549e8eb04c9160cbe0ad192d081d62906ca0984a82e7d95fd110baffffffff61d3b58d2f72ac91dbc4cf130e7d006546cb5424e629ea3a5a66bf4465bfbdad080000006b483045022100f406a488d5f8a7fa43296ff348817f1a8eaaf8b1f8b9904edc876e119bab38a502203b13ba0de55be416b9a6999e51992820cdb3fbb938255540e93135832c8935df0121020706bf6d443b5b9ce106712c32252197708bd2aff10dbec0a64b517a6edc27fdffffffff3e675f53b4720d6b3434f5a664ed66e3b71bdab439dd56a4c99eb32ccf2f23f5010000006b483045022100e19f7ee9b6b46ec64492d8592247802c3f1808464c25e4b8be1692ca9451b23102206aee962bbeca8b7388cc2d5ae344311e4487804ba693f51211c0a14792fedeae01210200fbbbbd3661c9f621dd117bc62cecef2a6f07ac8cd9554802693bf972d7d70dfffffffff1b216386fe5995be32653b6255ef6ec1102196c73e2b596463460844127c2e3120000006a473044022025ad8f77e2b650a225aa516da4dc7fba167ff098c6ef680f2f6bba8baec583970220236abd17debf16466708fdeb14fd3f0c688832f3e32fbe674003486cf8dd8502012103082ab1c07f7a20efb7faeaefb8c74ce33f84d0e9b17dcdd7275a241cddcef1daffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c556040000006a47304402202012509a75015b807ff16cce877e8d669ce4e5ea7c0e5c5880ef20bcb175b80f022073333cd7bf17d58ac14f165499afaea1876ec2bfba84f5bd1d94ae0926bb4769012102f1f5ef25f20ab67d457cc2c939b7fa1988bfd1e70c05436cf07d6cfad2cefdeaffffffffb9323943cc113451f065def62bd723a5129743859fec8ddc644d2113432c62ab110000006b483045022100f5ba42fa52f3325c16e2ec9c0e877b32561cfcf095efb8f0ff3c4c8fc76ae3c00220689c70e76bafb1f4e401c457f01c3fcd8f6f57327534a59d8abcf39c912b989801210251e9bca2568e05b5615f54f1be129987c3cc941bf3e672043ad63a0f57503f45ffffffff3987423bb0a754a7d9008553dda307662c9e210b7128cc6bdeed9da98c90846e0a0000006a473044022007f5547c01af6865c708526ffb3cbe04f7f88bd450b00ffdbff82053784132d002200532cb72cbe992b8f57a7e3e72f92e8722105f668f673658bc5d3ec0e017830f01210270b514740d3754933ee16837c664ece8f964f9329e4c8fc4d538050b7a7404fdffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb602120000006b483045022100f4379b9094a063955696f3980e68fb8a1cc0abfe49d411c5eeaa53dcb9a7d37a022013de51ee3f0d74b98ceeb7f80efe070f3d2e926307bcc88f7daf9cd562dded3d012102f86a7a2d4580c251ed840c0422663acbd329c394eee835e176a5e1fab1540fb3ffffffffd5eda52e20301fce6844f04b317cce48c410cbcd6648537c2dfc1092c284c5560c0000006b483045022100e7348632d08e00356f9b999327dad941beab204836ba48bba79f520d490f429e022008e3d6b84ae4080112cd1e3df265ef270758ddcaf323c9387e46fd040451773701210354133c35d16bce2b7cc755c78a5cf3134e26c417b6c43b5be72d5dc37b69e961ffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208000000006946304302200498407b92b9fe009a496879085f302ec00a5a7ad8d83931c29b953a348f5ed4021f5aea5801ac737cb112e679140a3f0defeeac91f7521f1c75befd704b5d5d930121023bf53ced02dd2b96c19a8919c71f49ea964318b2dfb8c31f3c940b46bd623d48ffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca2080f0000006b483045022100b364e98a8990a5ab253258397b9289b5e1de9e7e8b9ac9399985399c2f2e0600022061b68c56bd8a594f2c1aa8bc301a0c548e193a3e13633191a7b2099fbfa974050121026be3eaed514e069fa1dec551431eb4fe45bff8b5197787f3ba1210c0dd4a8478fffffffff1b216386fe5995be32653b6255ef6ec1102196c73e2b596463460844127c2e3110000006a4730440220767f4a43c86f4c67b07f143cca929696531ad08e4a541a15b2a925ffe666baa4022048ccf00356894d551b23b632fba94cd760e9caa77b8026ee17b9b2e944f535360121024abc39893dc9c91f5997575887f5780ec59ef69b20199907070054da82c3aa98ffffffff3d13a301b7ca19f195c7ad6b4fdd74df486ad51ca2a47707daf72da705fbf82f010000006b4830450221009c4852a09c8eae6835fd2545730719e79627d13579414ca5995a9049a5f5f75002202e1e4ce6521992f6f0cbf658c5bc28c89d238ba0243d1dc712b03744c35f3b0f012102c3d05cc6723c449e0541f5944dfa147e43cac660a711655bde25e6e1e48d851effffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208010000006a47304402200301abcd9da18372fc347db50d5b6950786a8d66a36cb066a6f495531d5bde6602205c70f3b0c8d15dba3c1a8e78de9824f0481de64831429d41678f67635d0cb8080121023884ad5407fcd6310bc4b7fc1b934ccdd7c07688580bf8b7f3f7984667b03d53ffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb602100000006b483045022100970ea3f8e2a262b49964627c4e31c78a2f8f0566c68a79d003685afa6029a3b702207f1778c1aa11b2f9c87ac640d064d7c0586ff3d96a9a43d8c5fa22cd89d79f9e0121023ca6e7584d8fdf9776732f364f4a43d18886266cdddd7ca1880fe2008b604873ffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb602000000006a47304402203204ecbf2ec2eb7fcba47a7c92e19ef609c7c7c6e1ff191d8a98ee7f0dd1a427022073682115c5698d5f6134eb751b0f31bf3dc6e88bb6578f0496ad9e9376d6013c0121028795f8b0a67a234e928da8fe2e738b85939f1ea31009a4e41355db54e14fc31dffffffff5487c26443f36492c9fcb740c917a70d5a978a457186382d52d93517b581b80c010000006a473044022062bf9c431e9a9774eaeb851ddabf71ee03552cc7ffb422c1873d0a1a4eb53cdc02205233c417ddf3d88b8f72f79c24f96d6119d284fb5b1b4c1e6e918c3b21750b920121033e070f6f281e381234477b5865377789ea442bf180b6b76d79fbc0357fcbb10effffffff6a5cb595037a940569804bc04f6d16a240c338152f6934dea8d5abe91b98abfd140000006a4730440220166b0a721753780f4751693afece8568beb11535ae93b233fc253d795fc7b02d0220330fd61224b22d05b9d60138d3b5aa6f7c22db58d237f843c6be5028ee18783601210210aacf8f2a034243784bd2e7f2e5b9295d508651c6a7555fa6a01e4b65e897abffffffff6123c4018ab778506726a2e0eea8d7cb94a1589560601dbd6e0df8d3d91a72df0e0000006b483045022100eb9164606afeed8a0b4a6a341a95ebc08d4cae9abc9014c5890e5ad4d3bd3ecc0220456aafb5e920c64f0501d53de835c1a34941a32ac2114cd0c00005fceb51cbd60121034ba7be1ceba4fd6f8839ea76ff3094c61b586287dfe7fd1992b690a73bce36b9ffffffffb9323943cc113451f065def62bd723a5129743859fec8ddc644d2113432c62ab080000006a4730440220077ed68fe2192a933927df527acafd1af4c14d634c9f34f72df20a253bed3a8e02207499149f3c1968cf62b4f4bb6d859f9fb540ce046f0f515261d16a3df049e46c0121027e2d446f8e1bf0b3a03fa50b4af747d6714064a8a6bf656f3689d50928262447ffffffff6123c4018ab778506726a2e0eea8d7cb94a1589560601dbd6e0df8d3d91a72df090000006b483045022100feabb57b36c3e6c541a620b8877a65bc8443e942e08bf560cf81bdcd522a837b02207cf277b4f433b3701a0f7e2ce43165abba5d1109d857497333314830df475a6b01210352ea39bad8cd7cef30a53049d60c366a4207e38ff8a3a4124fbf93c6dace85aeffffffff1556419da2000000001976a9143fcc1dcfbd3ae129deffbcf43b7d8b54027d627f88acb55d5600000000001976a914bb029d13dd17bd65787e88a9a12f07faa1270b6f88ac00daf89a000000001976a9146d3b6a80dbc5f918414e435cbb01c212cbfc5d0d88aca064ae6f000000001976a914e483d88548aff5069ca801bf2afff0fd5db0ff0388ac61410a00000000001976a9143836172bbb30d91db07a04a0ad4e62c57d5b0bbf88ac30cba059000000001976a91412d467cea7979ce5702394ec175395ec153e916a88acba814704000000001976a914ce4dd0989021d139aabc67e502c1d891ba870b1f88ac40ca2200000000001976a914e46151c672010e8f83f2056c785cc1eb086fe5a988ac19370000000000001976a914b4becba2cdf870d86ba464fdc16cae49fbc9587a88aced340000000000001976a91450430b77ba31f95b10d07f9a7b582f61b4a2ac6f88acd0300e00000000001976a9145ece69ca06ef02e6f111d04431aa6ee09a6542d788acb0fec526000000001976a91455769bb290f85c6cec681c16a4f5a09d0c766ae488ac00430738000000001976a91413c505de2c016067bc87ccc3d4e6f85e70ebe22188ac1080dd6e000000001976a9148267ce7be08c2f1fbab2e5011d645bdeaa9cbac688ac60c41e80000000001976a9149f7dcb4f09f9753a355ec8bc83a0cb1018463c9088ace0f7434d000000001976a91412d467cea7979ce5702394ec175395ec153e916a88ac705e3637000000001976a9142463099825b1a94f26cffcb1b7893a945f3be9dd88ac480a0a00000000001976a914be924a5ad4357d2c3a418936cab8c78ee0e71b0f88acfd676000000000001976a9149ee44d6b20b5e06fabae95c5d4a3fe8261d9aef588ac88260400000000001976a9143e86b64bc1fc0cd73728e10d0e516781a9db80da88ac10e9eb0b000000001976a91448365ca2314942de6755fa6a4fd04ab1a3a38b3688ac0000000001000000036a5cb595037a940569804bc04f6d16a240c338152f6934dea8d5abe91b98abfd070000006b483045022100b92188ccc613f9eeccc11eba2fed593f6de319f44cff7f64dbe1cdd92caa7b25022005afcf4948b3e417f1bf229009365c978f48da11213acd2d1274c8d70b3ce840012102fddabf9b7c31b0f0ea36ce87b5fd39f9cca9c1eebfad949ae15f3597a67d8476ffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd090000006a47304402201bb1a024ca3526491d6b3ec1e36ea5d77c1a5633293f84c47fff43b1d2a07a6602203ed4f4828a6aa65b91d3398f8255e0ec10ac2d64e6977405599cc7c3dfa1fb4c0121032809bdf7a3f15310e00b9fd24b7be34837d015ed3cc80b5a5561431bd7849e3bffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd130000006b4830450221009cc8ac07fa6e79a40155b578b085ebdbb5adc8e3bd684486ce442e75661342fa0220024a38c68cb437514a6a409dd033af89ced7f22fe127ff6d745778b88fb68a2b012102fabd1e46d5d2914e756c5cb19a160b061b2bf3aa560223de5fe689b279165b27ffffffff02c0f7e606000000001976a914d23a2cf87ff6bd7a0ca40c10d2ab110b64f5b73a88ac82691d05000000001976a91487b8d4df1fdf28e513f4cff0f1aba8b181a31f3b88ac0000000001000000171cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca208030000006a4730440220182ed15b2c60770966e3b591595c5abdc6c1a02e4e05d0a4d9c35762f99d78f4022005cc0f71bacaa80b95f8380d2c6aa7bc618f4a14854a5780f6045a7eff6c85e801210203fda9e9fc2b5e757cabf5c28d5d93f73e49f478210dfc957b2d748d21a03bd7ffffffff35a7757973597042d66eee05991cabdabee55adc1183f2e89fbba83d9810ae65100000006b4830450221008a7309a6b2011810fd33b2009141cde1a8f28f07f8c8b8391a834d88ed448214022024c384fe0a8e0ad22d0420c0dca04a172bb4fde430bde57aaaa5306ca919ed1001210243d0b7d728a50462129f1a31a2fc5a192ed1d80ff1638ef2d36e1c635171e517ffffffffb9323943cc113451f065def62bd723a5129743859fec8ddc644d2113432c62ab050000006a473044022067641f19adb9e037a332991366c4ff34ebc9e162abfe1ce5a6f74666cae3f5ee0220313efce26ca919da3b3638db9d40faa48987e28ab913fd7147e9ee1f9e081fe5012103f056cfce34c8b3ce4656b2786822101f9a5694d3bec22cc5a04afdd6c51f1bcdffffffff6123c4018ab778506726a2e0eea8d7cb94a1589560601dbd6e0df8d3d91a72df050000006b483045022100e60e70379382b43251a29b1790ad95634fd1a5dc9e25091f32eac3b3c9aeca130220559e64017bcfc9198eaa2fafc0772ee7de0dcf87f2ae26e7637188ad90a40293012102e72e3b819ef681e4697997c9982285876052b4906d9912e45165026cd9319bfaffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd000000006a47304402203a42356a06791a6cb962c0105298f5e71a41f7e40eb76b687f64b726db9287a802204ec9dc91f045eb3cbc26e6dd791c2e1490380af478407190302ed0477faf593e012103d4246309fc4f0db7a8527a62f27c6e2ed033bd520d0efcf18104a8e8b578f163ffffffffa6a58b662a6b7481726f9839957e8418fa9d2e18cda74f10a6a6a743d08471d0010000006a473044022025bc554dc15d8b6d669bfe712b3a128d7f9505fb5d253a8e27c6d85bbfb9847e022053421243065cd4ccccbaf39e3bf4961ef547fa90a87e08ae9e5bda9cde93515b01210249a2868c9b12afb3d87eece548992c266f37649a867543eecfa83d41bf180c43ffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd060000006a47304402205f968c81133b8702f1cf2619b1e6bd53adc3c3d6e995eb5235afb3374450769802200e056f6476ddc0080aa42316d684ee8956bb35e77ed46848601e9347b35819140121027d24279e61d59ec0efb17171e17d6787dd06c62bc68ff3ca7e8f7e0eaa5b453cffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb6020c0000006a47304402204da0b624703f3992428906ac7e0e764869c06a142ffcbc902068d7a77a76ff4b02202785f0bccb028ce169dc4a136d92f5b0cd20eb36597a2b8c25ee78b25f9beb5c0121039620fda21814b9bec58509ecf2e0671ef8e4e90edf361a027f01d50aef85f881ffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd0d0000006b483045022100dce92f4a8f69ba2c989481c2bf33f85cf2f307efc038755d5fe9eeccb27e87be02203901e83c1a62b59814ea94d5edf16d145810ad8effe4a609fa8015a09c527523012103327d0fd0b9399bd4564dae81d01741f810ead31a168ce54b1264868b39e1ffdaffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb602040000006b4830450221009431dc64514749a36b7b67e9fbf851f2e6160d3bd141fdde078952d21076b20e02205718be1ab1e3c5b35f3aaf6351de7991c72a38015ba060333b714b769a9ae2ea0121039d89fd34f339dad849035222a67c4d5961ba766fb3aebf05e0bc8b213ba0ae3cffffffff3a564554adf1793768e523aa57d4e9b4d3fb37864f5320a4f14df16f329dcfc1120000006a47304402200c1891117a641d2291c21ef306c60e9b747497fe67b7b27491479ed7a7be0e6902202266b5893d7b8291c470d096cb452080622f5495459ea838502bc6659fb1ebb6012102f80a7615ee49d42e9ce266cc3a16325aa93619f217b928ebccdd41ed87e5538bffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb602080000006b483045022100b68bfa78ee84127a5929f604be85583b2f016407d994b3ff6a9db6989150738a02203ef0ccdc8781b828d8b940f1f50ab3fc329e20b2257413270c897344d030b37701210238450249b3fdf982d101124ee25d40718d3321024a8b3bd70465d6f594fd1ac3ffffffff9ef24927dc0b45471c13d95e35d140947a459d178d4e38e8a0f7c6f8f23318ca120000006a4730440220086526a21f7a86fa27bf8cbb6083c01b9daf8f6896a66671fd79e5da6a10bc01022078b3e5ae6174a849b0f7258b65361397daf2c3af879b9e47b736c56a3f2987f901210264d3bbe9047f260e3bafd6f7e769a63ae561d4be4278b059d94000144e24c34cffffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb602060000006a4730440220044deab5b46098ebf75887e59ba9345491b76508a27ea7d2eb65c2be2f10bb9402204f77b7760479fabb44db3b485ed4c4dfb7b5466bfc4bcdeb8a5a5181441a80b50121030cb211edf8301bc606c1640e1da8e40ea37412d0da6da3fc3d4b0d4531a73c84ffffffff1ca763343454481b2bc5cc77e88856b2b252dc07d76f6c970536a9738fac8dc30b0000006a47304402205a96e391d935fb7ea5cbbfac9114158f2c6a3989c15f2c10fdf8eabd9ecce395022010596e364a1b50b6445789739875919e54a561a2a0ff7f23a1e0928a0c9b860a0121023a4a866282519a6f6da167b1f2b0b3b80a9157a568159fdb981ac49f78110458ffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd050000006b483045022100f218d987dd989b734624c78dae685fe7dc2daaa55db8779e049e0e6517010192022004c6d5f51f752b3c2a6bf0633cb80219d2480c0563b956f56e16668868c68b62012102cf98fe221e19da2643d92fe81c745ef15b824940309329691ca1a080d0ffb920ffffffffdbadb003e6588a84c2cafe8df3b6459bad2144f2a1f52620a64ad29376c68246010000006b4830450221009e323e2cd40e88f577eadd323cdd9f59eaa96ee0790c4bc51856da5ce7b370570220726897aa35eb4ae378c9a23e6fd1596aae76467cccf8cd3aa8f14fdecc43d2ad012102eb92f296d3bf0cb0827898c751be9095c2c3d5db500d85b90be9cb4fc606854affffffff196c05f4611402a414fd5426e53656a049b022a4731909cf7d54f92c166eb6020e0000006b483045022100862c47528784f3d41a0596585981efc88f1f91029db1c4384e8c58e6425df7ee02205fae4d97e2fee870e23430d1ca0df17f95b46c25d834fea043f43799dec4f9b3012102ecf996d191a23bf0c52257f8028a2d621d0fcd2a6f9d0f1b1fa07d0b031cf294ffffffff1cf8e54b5d1f42c4ddbb5d5979eeeb7b8bce5efee22253ed4292b6e58bdca2080e0000006a47304402201f59511cdf3f5e6565dc37db31d687e29dbe3d087bdc196fa74162e9640e0f5f022017448fbdc3191181ce661f29f93695152b251ac8cb223f32397921247cd3ec81012103c52ab347ef0ece04162229e289e921a5b56bfd6561d383bd472bcf9c5e10a75fffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd030000006b483045022100999b30cf0a7bd33c06b46b5a943ecd6a9f229e72328ac57887a0bc5d8ef864fb02200434b5f5cbbbf04b5f0c18892b6f25bb647312c9375363b3396b6c7af0590080012103fb2f9957eb14bea00bc39ddf21a1100103fb58581a631974ecbaf2b1dc8359f4ffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd0f0000006b48304502210081ad51cab316bd6806880ebfe9d372689de04583daeee8571878ee6a5e4c4a3a0220094e21d4b90e52ad6b041d7e676a5d04190232b0062b0856f8915eac4ed99027012102cf98fe221e19da2643d92fe81c745ef15b824940309329691ca1a080d0ffb920ffffffff6123c4018ab778506726a2e0eea8d7cb94a1589560601dbd6e0df8d3d91a72df060000006b483045022100e9d7858635d653b26ec84f61b623f60881f2d5716055c160694e8c403aeebb370220722dd07b062480d383ff79aa880e165f7c67a9f480d38e97682a502dc0e5a708012103cb220107fa56482467c1e0bfcffd92a2ab81d68f9339271d5145e1ad0c32c694ffffffff88f8ca3ae27878065c01861fac3139990a4bf623ac45ba5fc9f8f457f73accdd0e0000006a47304402207208d061701a9fc0a27da57d106998b611374e16675decf24cb0e1e6876686e602207662a73e87480296b887262422a86eb82c3f7fa5dc6b37b941b9e55ef1f4851a01210326bae26746b04b59d4c2f368f2e2f9aca584135ffc70ddcd134cef283365b241ffffffff1570e5660c000000001976a91440bc6e1a8c783876fb3d5681ee558673cb144cc188ac00fbf266000000001976a914824bfea00b8e9a4fb8ba22007e620aea04486e2188ac90bb090a000000001976a914ff3c8edd6318bbdab3ce9c4d6888fa937e7a058e88ac308d0d8f000000001976a914c2efcb06863b9bda55f950f75d63918b7df9081b88ac103f0d8f000000001976a914bbda1df35de1f79ddac2120ac0ad00501f2e6df888acb0d03477000000001976a9144965470d6bb4ddd2f536bd65b10871ce9c91fa3e88ac52c6418f000000001976a914a554efd037d02f59397f55653b21fbd137e4e58588ac204e0000000000001976a91483682422c004420ac3092329b817fee37aca6df288ac00a1f13f000000001976a91415c233d56db6ffb15e2cd536f5ded14e688fa0f188ac60ea0000000000001976a91487f4a5d17b83f5976b5894519e8dda182db0c50288ac9896fc01000000001976a9149829c407361d459569e41a5ee43214290e6838d888ac22393400000000001976a9145c5a2175663072f3808672b11f473baa1e7b1bb588ac009ce4a6000000001976a914f941fbd07ed397a005a1c361628ffe4de5dbd65988ac0027b929000000001976a9144965470d6bb4ddd2f536bd65b10871ce9c91fa3e88ac3843c574000000001976a914e6f64e5fdc6b53426393c6c18e9d579827ed9e5b88ac3878da15000000001976a914ef97246ff380ad79ae38909f203da9379d99fd8d88ace05d4206010000001976a914fe67816b10fa61850e78faab1f047f86cbb9128288acd0a20c8f000000001976a91470c6be9b64b456af6342d7032df006ea6750017788ac6029700b000000001976a914dcc17a6e42f3992123dc814782b6fc23634bfa9e88ac00752b7d000000001976a9141417099b92d195f94cbe737de835a72497cbc9a988ac4053cd0d000000001976a914bb8f0bad61f57f95add4c751f279354105bc8cc188ac00000000010000000311b2347e7261132e65c45a5a7b13536e8a64e7045bb3806846056ecdd3b97258100000006a47304402201cecfe79d9b0cc374b0a24ec9791ce17548b138ebe60dce3b8d549f65d57eb2f02202d7acb1398c18758a37a6dbeb9c0f6669fb0042d2f2b7906cce3e4d48bd7eecd0121029dfe974cbd2aa008ca27ba75731c9b123cb4d700c77a3404a6c5e2c8e9b0144cffffffff2968a2c9bc7cb619ead292ad82849a4a8c4937204b4619a0ff4b80c24d49248a070000006b483045022100f6362087c730d5f60673fe95c549e4a8e45a6a65ab70f3ba9887cb5ccf88273d0220456b6a74721d19c8c3a83762167f29488de46d1edb0cc49dc0cd46f1ce1f8a3c0121039d40dbdaa76507b2708e9a8ce913db793a1ca3e940680f8a01b1a4311bf8f2b6ffffffff2968a2c9bc7cb619ead292ad82849a4a8c4937204b4619a0ff4b80c24d49248a090000006a473044022028522917d00d8258206e6802389ae294f085b910618a3292d10fece0ee60d41d0220262fee75950ae2f20990c2c8832b9b13fa5e12f46d64d657570884daa31c102d012102c05d260ec1d5352e9e1a8bbecb472875746c68b92ae7a81a47f2537961fb3408ffffffff0280539a05000000001976a91436167803060f96816e5b4801dd82c84afb7887ec88acd0162a03000000001976a914403c67cedfa93e96b129a44ec1ba294b7b7513aa88ac0000000001000000019d3f91bdf173a66bf08409a3d6776b33d0aeee3222fda32e2800bca08efd93f5590000006a47304402200b551118b1c49df27dcd1c311c6d2e7a15f6db8d6f5b7e2ddf7b9a33e2058c960220246d6c6b249162e3101a771dce401c37f58da9ee3d4f0ba90853cc4f964aed6901210220950a44f5914cf0f4b2d43319eb96746562631e2e37d9777d3a993a04876101ffffffff57ff4a0f00000000001976a914c5b908bf2a82ecaff706c6588d61cf38161f717c88ac68981000000000001976a91483c71fb414c4fe7fb4b2c60f2ca6da5e0d6dbdb188acced70f00000000001976a9147d5e20ef7c195f563d1c64a67d05f06042293f6888acb0e21100000000001976a91477fb74114ae32777d00c8996a91daacc532f91cd88acf12c1000000000001976a914cee365810cd648028db83879749a2f9659bbc4dc88ac75ed0f00000000001976a914dafe8e206bb0245609134f0af5cd91f4a8dd12c588ac0bb11000000000001976a914d6ca59283f3f75991bcd2999955f230403865e6788acfac70f00000000001976a914080da666a7dbe111800ae96b0363e36192bb2a9888aca06f1200000000001976a914ea0b0d92986786ec4f29d3aba16b9332389eeedf88ac76d90f00000000001976a9145a6b298a688d3f5161184b844b06a1c2890bf05e88ac81a40100000000001976a91438c0375abdb4a582a61ef118ee2f214d83d75e2e88ac38500800000000001976a914a87d1cc11088e265aa7f79d916070a4e7297d08e88ac7efc0f00000000001976a91457f0e34300102f853bac1026438ca0ae58d8ecf688ac784e1100000000001976a914009a8d0112472fc8f28e477b38b0f07fd842f69f88acf1c80f00000000001976a9149370d4104dba14039b200e35404608198acc643a88ace0851200000000001976a9145701e33aa1c99e01f7426db9c019d8ef0375c95688ac932f0600000000001976a914b6fca6329db8420dab864a6f6d0cd91c86d90e7f88ac8e441000000000001976a9143ffc0d1f05d70eeef246802356c96ca551fee96088ac71aa0f00000000001976a914e774e1d68e05c61381f4f32a031df02dbb0be90488ace7011200000000001976a914bb7a7a0a2d705fa4e1b1d4bf384488429fd3250788ac83b51000000000001976a9149296a3c11775574233a17e8573e4fa5b809564dc88ac08bd1100000000001976a9146e9701b919ce65399ae4a5f9d4486f63cb8f813f88ac55661000000000001976a9148c13682c8088bdbdcfb574a4fbf5aef991a7343388acf6510f00000000001976a914b25417729ebac02bac2c5d5a571b174a2ee4a91888ac2e761000000000001976a914355c50f7f0ac7fb7d03b4d2de550e47b93e2798488ac834b1000000000001976a914b1dd01301bf16e8193740b1023098672e6213b6888acf8600400000000001976a9145475e1e068a752fa593e582dea9b523a7d0830be88ac12060200000000001976a91495ff891da6a97890108e6351d6d51015745c572888acb27f1000000000001976a9149131197746a52a2644e3d435cb3e2b9233527f3b88acb1de0f00000000001976a91461ecde31b0e4b8d5d40eb750c4857ffa313544f488ac7a430f00000000001976a9145d62f3ab440fa05382ba6c2f8b41e5c581d59abd88ac15371100000000001976a914eb3acbe499a1b8dd677cab9b279980de7ec1af7188acac7a0f00000000001976a9140846706a5256647c7383835f8d0185bd100a644188ac46011000000000001976a9147133a0f8ed9e2f3ab1dd43bfb7b0fc6c9fbab3b788ac89071100000000001976a9141b724277cf253bd484d21e3762ed1369e6578beb88acca4f1000000000001976a9141002b3a4cc8ff543f56975807835bea13526773b88acb8760f00000000001976a914b2b4fe2e91bae0f1d25cd740121466aba92bef8c88ac3cf21000000000001976a9143a6b13ccc1b766dd328c8b2b21a4b1facc53324888acaf7c1000000000001976a914e802928f7deb0ecf14e136f2029f85dd37c47b3a88ac418e0100000000001976a9142e174ed3ce191fd677120a0f14954f87821c534488ac684f1000000000001976a9149df60a6a89ba26284bc6ceeaed91779ac0f5b73088ac9b4b0f00000000001976a91401e5108d31929536cd3e59aedca73e200dbde3f688ac8df00f00000000001976a914811d8e097532db812fbfeb55656570ed6934477a88aceb3f1000000000001976a9141b1033f49b5398fd4a272af587f01fe0c7fbe07d88ac80f90f00000000001976a914717e49778a282ef6f7ae1aa425b3235ef314937988ac1b9a0100000000001976a9149cb9289d2d84db42171192629573d7e11b04e88088acbe530500000000001976a914667195a90706ff1cf49db560c9328c0f7ee9a51f88ac38671000000000001976a914ed24323d37742f822bd868552e5457fda9eb16f588accc821000000000001976a914ad44ad6d308934c556624b04f2da1c6b17b3b3a688ace8c10400000000001976a9147cbfdc950f7665207739d6ee9a0c313567ece27188ac44191200000000001976a9142b788153d9c91906113556b82d900cd81bdcdf4d88ac4d6f1000000000001976a914162b08eafb95e52d4bc71950f8f89c87a7784b3788acb4441000000000001976a914972794904dee236a678290034372a9f44ca21d1488ac28201000000000001976a9145f11bd6e5f62767dcbb1990864aad76a3d784c0c88ac0f1c1200000000001976a914326e825f5543710e1821f96d58bd996f5e8d8f4488ac88da0f00000000001976a914263b3f8ce0ad4a94c53ce77fb9d21ded8d1888ca88ac6e121100000000001976a9143d0b76c0a34511ed7b0f4379f608a91b3cbf228188ace0e20f00000000001976a91412b47187fdd828786d5ddf4124a614f16cf73ac388ac17730f00000000001976a9149efa185002f574bb5b1937cc9e3eb33e5d6f2b2a88acfa231100000000001976a914ebbd2c93fb4e0b32905f6a568db5d7ee1d4971b788ac22f10f00000000001976a9145d11b003b644c089f3c50c0dc0fb418778a6063688ac04241000000000001976a914ce32ea2d498c5a50e27631cf9450fe87cd5a08a288ac35081000000000001976a914d3502d00f42effe23e657e2658f04b6b25392af988ac9ef7e20e000000001976a9145514abb9f4cc3efd544d5f173044d25097a2d55c88ac36570300000000001976a914312f8f38d306561b1a7256a365a3e8df7e57836288ac5d3c1000000000001976a914a79e020b93c1ccccb6c894cf4361231704e8d1e888ac77fc0f00000000001976a914ab82ee544de32dc687726a992e214dc75f93361b88ac23b90f00000000001976a9147e2ec5b862777b628398dce201bc3c87e7a2a02d88acb5641000000000001976a914915d8f0aa522c5920f952f8b2f22ddd4fd60deec88ac00e00f00000000001976a914007a43b3d3b29c2b969aa2e42dcc79b27ce5c24088ac5dc80f00000000001976a914c83075f09d11f6e394fba404f8611283a14277f788ac65711000000000001976a914f26568a062cbfa2906ec9b97c5108766c55b892488ac1e641000000000001976a914557c1757cdda933721b0ab81b69369bb325922bf88ace7361000000000001976a914f92d61409ad8ca5e091f316bbbd0be90deb42d4c88ac0cbe0100000000001976a914598e3a315ef75e202ae09fc73e6a136e6cce65e988acef9d1100000000001976a914778070286a15342220a3308ac2f82d9cbb0dd6a088ac35f81100000000001976a9145bac8321860e12b037dfc1ce087591e82a4295b288ac95db0f00000000001976a9145cd2e1b93aceff18bb4b9247497f8bccd05970d088acc1eb0100000000001976a9140df21fbcd42da47d3018c116b8e6b391264c854f88ac377d1100000000001976a914a96e24094aa4da3acd691f89ca3f9224e6065e4b88ac1c700100000000001976a9141320e82084d5eafd170f9576bb5990bb6c034ca588ac0eeb0f00000000001976a91420d380d2dca0e0affa20168e41b0f7edb1e97f8d88ac3bcf1100000000001976a91400a0867abd4d9c5e84c39201bf3332362ab8ab1e88acfa8e0200000000001976a91424a15128c2087af9d7bd7a37301e0a2dd3364dfd88ac8c990f00000000001976a914507a7bf03ea16ee39fafb6d3c81c01a540e86d7f88ac6e751000000000001976a914c71888a0686a338673aa1c47d16d0433afe63cc388acb6b509000000000017a914e50a8f125e38a5260cfb3f9819972fdca7e96ac387000000000100000002aaa48fff3517ac2c88360b083310ec729f825b151db86fdc1428af6809df600f1b0000006a4730440220111d5ebb0be209937173acd331d298e3600b09a15eab51c755ae993ef3badbc602200cc34f15462a82e70238dd958e093fa2a14320c6ce40cff1bfac6333693ac2a00121029a290b6fbfb9414bab29b007c8aad2eb1d7ca098a97a10f9586f6807af7dd008ffffffffdbb62663e81fc3fde6933d0f9d0dcfc08ce032f9f2de8cb22662075f078057a4010000006a473044022049b7823caa94ea4dd62f5e5dbecfeb6b79101f0c0c342325068b2dcc682e5d5e02201e2def50ccffa73758f9e51ed53d987340e67549703c648edf7433a4d53b71aa012102a9c8c1afb8da8e9ce9880ea1ed70462679555fe063f41730f38f8a2e1a8f3b1dffffffff0212060200000000001976a91422d73e3a4dc40e7e909c753b96e76e679526b0fa88acb06a0305000000001976a91499e78cd9b82e26d047b92805cb96d95c11587b7e88ac000000000100000002aaa48fff3517ac2c88360b083310ec729f825b151db86fdc1428af6809df600f210000006a47304402207363ff904c9842518b9da96a83ea873e450dd573753899c2abd44fe5a83227c102204de198c5c623c048ae3a61a7631d2dff1673a34cca5d9f4b540eea4afec9bbcf01210370c8fd1fa0f37ed6c1418c94eef2a69887dc6ab1e061a1ccd058e32dfb3cdf8cffffffffe440f7def507c98522f47ee2b47223009dbf5ad209ac7d0a277edfa5b74a3314010000006a47304402205700f2da6cba47a54e595d8befcde7d92be724e4c285f62c516a89796ca7ecd90220622bb6795bf31dd43aa6cb107da0dcf65d5c47ae9fd920b2ee5b8ad7a6681a52012102a8e1a6d3ab64d0103d20d051b76738300f794eaadb3b90399bdc02f04b2dcd96ffffffff0246011000000000001976a914bc3c30530853cbcec3999001088a8663fc116da288acf0060405000000001976a914066e7b9247218848c5d203e907f2e41cbd3c69de88ac000000000100000002aaa48fff3517ac2c88360b083310ec729f825b151db86fdc1428af6809df600f060000006a473044022059e9fd3120d800e66a9a9ac00e8d7eaf9be0328dcf3e42804bbe8f7cd2bda752022035ba1a10d7bc10ab45fe0b4771c78c2c4e51d36b055289a187ebbe6f1ccefcab01210202d6ba64ed62c421bba9836d169554f383cf23eba1daa8cd4ad02471a0cfb390ffffffffebfc2fe00dca265fd211846740acf1c63797dbbf9a7d823991c19536b21a7a13010000006b483045022100ea17b04b5db96f87b499274155d5fc083cc56904141046cd6b960f468f2f5e700220710399104c8c8114870cddbb6efc85bc388bdb638a3e8c90ff6f8589a4ed8fea012102eab0f911ccae4a076d5c0f16ec633868beba34564a6a7e9410fcad5943fae6b4ffffffff020bb11000000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88ac901c0305000000001976a914d933d5d611a97ef8d34e0220e60b937cea94f24888ac000000000100000002aaa48fff3517ac2c88360b083310ec729f825b151db86fdc1428af6809df600f510000006b48304502210098fb23e5d8112613e1f6143f53a5c988b645c7c28286181de2e89452b0bcef1602204eb8522cff6072538f18eb1ee5c6eb0717f8686e13bc96a4037f11ca06b6195901210368605aedcec34cf7e5aea3f6458ba21de9d819b1fcb409567bafb475b4d1d429ffffffffcd4be262d8ad5d0b8f49b2bad259cb9dbf6e0493992b2070454b1e430f42860f010000006b48304502210087e9d0bde6a96af3067f9fc243e7a0853263ff734d2f32f0a35779a40ea08d83022019fb8ec5bbb7e83e38dbff1953f8379548ce92c75d714a81f21e58e6bf67edd401210226ff151c3782c26cf2bd31995bb8f225476fa8f1e718be39d0072efa3faef52cffffffff020eeb0f00000000001976a914dfba28dc856c9a949fb67a55b234adb957416dfe88aca0430305000000001976a91498e005108ac83b88c57814828b81885ce770033f88ac00000000010000000563c52f2ae296e4a64fee3604b977cc7cdf9e56b9620a2f0fbac4415e7ae1ea3a010000006a47304402207120444ffd7e32a273ba1835bbc589f9e8ed4a90ee7ac19b040358e684a8c8d4022052c5c99d4e9be2ed07030d59d2fc3a4beec243a3917d6836c58d14e9cdddb8e80121020cad537a9923a96698dd84bba715bfaf57a04ff9f62f69a686928d2eb72e2202ffffffff00d887065ecc8e6db1059195e6cf0eeb674cfe916deee4bc675056b5588676ec000000006a473044022008213bb62d98f5bc20346b549d280eb60bf79fa0087cc47f4c1c000431e1014b022064dad16c1f598a859c50dda7429630ee4c8609b848fc3a79b35a7094d45d9570012103e6f979cac9a74ec369bf59b72f0ae4f82021eec9230c3275c7aae0f66834c5c2ffffffff057b18acaeacea1bda074703ad2042ef816e8c1836a104d2cba48d590505220a010000006b483045022100a5e0be71a8debe197a4c39edf2f4cbd20bf81c98342e71b0199c6a940c26719f022003a0e06035b695e61372930510961b0407139a23961aaa4576027e3c9046ed880121039db960f5446d22aba6ecec890103d321ba5df44a59f0fe5fa3277142c57bfc73ffffffff4d0d424837c04a1f3b77755d311e39c68814595f7243e8f67d585ce3cb720538010000006b483045022100a1499eac399283e757938ce653c203ca09c3886f4a5e7c1d9f8a59a92ec20f18022078557b7b254ea244075d874f215a12bf712969dbfa504899529cb06838967aa50121039edfe608de4cb9d8615bf15ab1e2c37bd778382048e06f5d048f1f80f9eb28f2ffffffff4a7b5c25f8967c0713dab7bc37e57e0e703f47389e7ca185c5bcf8b9941ae3b8010000006b483045022100e9d2d6983f55b6268d18a857d7bc47c70bfa6bb0aee203e25a11c623c0e18cdd02204604b79c39ac2ec2ab5482ca6c01c94fa1d2d5a4f135ffb2c224eaff49bfdc1e012103a735d0a91a643d5cf3d8b78f967ebce7c88a76408db2e91e6c7aa774114677ccffffffff028f450f00000000001976a914d0207df1a478b8132ac27e909bc8a94c05fd091388ac00093d00000000001976a914069532d8f9ea4e62c38badbbeb6ad322cc461c8088ac0000000001000000041836afc3bd897a5e9110ee2680877cc7bfe1ec49c7dbf7d24ae7c8dae881900e010000008a4730440220118085f424c6287a23305274af5363cc383ee13ee4714744853891f929a344db0220567f5f0f233706df1f3e8efffb6132461bd1052eb28315e5e8604825090c563e014104b0b15e43c301e02efe8b47b80fd73df20b59e358068f1b9147cce08102c411036fae6f3a91bd8cd4c55ebec209564e3b597d1df2a75aae96150268721ce8099fffffffffb26e3f19c15c5cfe62bcacd3f8bcc36dfa93f83c7ab16f743d28863fbfb773c9000000008b483045022100a79fa38ad490ef4c66b4909df46c6e3b2d5c5566d2f857a479ff6e3610ac8d26022070b0c1d6f49476b4de6c10d0873b20c78777f7c183b003909d8e6070f47ac7e4014104b0b15e43c301e02efe8b47b80fd73df20b59e358068f1b9147cce08102c411036fae6f3a91bd8cd4c55ebec209564e3b597d1df2a75aae96150268721ce8099fffffffff71da3cb3976ca72914dea699207f3ac0cedbdf85d8872961c8c6c688e00b1486000000008b483045022100f8661d875117f4c50a740c54f88b8e2645fe367a7c8613d3b2bf2c3ba786e87d02206af59e8b5b9edee9ff8f8a02a3f2d680791ae8853bbfc68eedee09fd39bad3860141041d9932917299896a4bf5b9a43fc32b6244f400e501c040e0cd2d70c54cd825e2be6a1cf05a207e2a6c24f775d52afadca19261a2d24f7547b8c836a8f17ea273ffffffff6fb8be31aa34f410fb774d44f91ef4343f8e1197e4876c413cc8a8b871558e2b000000008b483045022100ee847e8f78459be5b481ac4469a7dd9ce8b49b7cbe21bff226decf84d79993ad02203ae25c6fafbfefd1d5d9d8b885593fbb2d7aefe6087d882b262c2b7ec2b39910014104a7d5318cd8f19594b6dd73f92183d027690d33e493a84c83c810c9c12635c92ac4369483977e1b0f48388228a98c29b64ef12a9f82b8e301e386ede502cbf44bffffffff0228230000000000001976a9140fdb0d62928786f5da514606cfc6ab6591e9392388ac14e5e700000000001976a91406c06f6d928000ecbd88ea99bcde72a0d4f3f84488ac000000000100000005873a8d859656054744c2849c6c50d99af8918858ff20ab34f796171765817296000000006c493046022100d68e7cff4a4abd48f8522ababaa641508253f2a81d7a4d9146a59218a36fe8a402210081cf67880201d87993a5a29ca77cb81705d1325079fe2dfde29e945bc2e5170d01210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffffc00497ea0f6f8cdf4cf4d32b645a9f46b5ef9c0203c356c9d595ba61d98a62d8000000006c493046022100a51360e426c349fc030440566b7a3b7e9d7b4e35639d01c938a51e00f7d485580221009b0c30355deb50b0aff712669125c76bbf590c12dfbaccd8bae3f7bdca46e75801210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff2ce93cf131c43ab3b3fff0061738a3b4408c42e8eda4d66ff7db3bf38a201e5e010000006c493046022100e608c5ff0400d5fa819f51a1a4c25b4c7552318c55c96d83a00c7b9e76e80f3a0221008b3506d761936395ea6ac056464cf2e7bb2827b7914978cb108655eb2d0ce6cc01210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff5fffb1fd69558844613a293ec6cb11a1f596791384b240c10da64eea8e2fff47000000006b4830450221008e5432d1ab36164724d7843f0bec50a8849add49e6722c54790a5a681864f37b02202d4433cd44518504237039931241cd50ee03cc3115046719bc7022f23229b73401210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff5484a335a10546235aa49ddfc3b3f4aad96348b43971d4c31358be6e4611b987000000006a473044022035ef90c1f3877a9c1b73782fdae1c1d515b1fa93b946a6ee11810a16f5daa861022040a421d967895be33d9c2178f5c3c6f335d96efb7c60679cc5bdab460af9cc3101210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff0220a107000000000017a91456fd2018804b730294decb2c5b64db5e649631dc8750c30000000000001976a9144c213cee459ba9be77a63a6338fea991f08be96488ac000000000100000005a089e69367c2df1534fd17afe75a1251990f35d1ae1e2ead27f19e213b49d1f5000000006b483045022100debddb6630716323de8f628d51dc36e7308fb60a0d0506c9118b2bc0ad30b34102202501fb4454960a00d4dd2b51665f110b84da2c4e241e92ca8a9767d457cc31bf01210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff1a6bbcd6050250b37bcf2227492a2d6e1407bfb8207227ea02ab7894bf826f5a000000006b48304502203d39f463850662a467434667f68334ab2ef130b054f3b948b47cd44a6c00c031022100dac823101bfd4cc1917b4d63f764b645033091f7175d1a4382eb086a8e0f60fe01210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffffeff72ec61c005796befa6e068fedf6f838c5d84574c692725284582f822735ee000000006c4930460221009ba6735e7152039b85386460687923f60571a7dd11fd6099509a202a00e873a2022100c276f6c9988470344b0fb8c6085b0c67389da5200ab09e438c8050ffd132ed8c01210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff74e6ae82dbad0c37363c7426e1436722d310e3e66af768117cee01f2f334009d000000006c493046022100ae3ac8a3face719e12a029a9b4e812b60ab4fdf7fc428248559571dfc8ad79ae022100bf4388b1592955c5bfa4f27c304f9a998bb399dbb0e9302210f69a94eaf0e50a01210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff8292084e5eea655c4a3b37b5a6e2ee36e6a53c613fad2ded1335dae61b405f0e000000006c493046022100a1f0a2eff1ede0316ca1f1512cd6806c5f887b51a4c6abed7c7d0f4dcc103cea022100bf21eee08790836793ae45fcc93c103e6e7cd3d75e1e976d89d3088f30fae6a001210287936d8fd333d67042550a525a1a598a3edbb90cb049941d30913f945cdd0bc0ffffffff0220a107000000000017a91456fd2018804b730294decb2c5b64db5e649631dc87409c0000000000001976a9144c213cee459ba9be77a63a6338fea991f08be96488ac000000000100000007e58a911331f08ae1cb927ea9c2d55b073df111a31fb6cf456b44a7c29a13d981000000006a473044022078aad7c89fd30cd64ff7e4ae9862f6aa77e8cc5dd54dc7c819136823d19ab0520220397e8d1d41373c751b340ae36e5c755e12b3cd68ca1a880baf5a2c50beb93d2701210364318b9ad30aa93993a384db556966d2031f6f43e4842f3844bd1f65cd93ea9affffffffd912d419a7be246de1561d60b706a7d48f4346c4bde68d2c5da29bac515a50da010000006b48304502210091239c56c1b9fa16230e8da619b95c1e470d8b123c5d83e093be0c092a271f34022027ce7534139e0ca79bf1c95c0bdb94108d25895c7613d505fff6c56e245f8c7101210309048983e59de145c997fdbd9f5e05178171f992461bc29b61c6afbbe1ea416fffffffff158165f24cadd51043e21359f651937367fcb2e272a318bf745a02e1f6eb0f6c010000006b483045022100c085c9c78f51a1aa5c740a144144facc000168eadb69095aa0cb3d7075f2967d022064f6ce76354b92c33673d1e9339d688b294c6288902cbee5c1224f34143f27ea0121020cb417901a74c8accbb4539e9fbc015d841033a642a471b471a14bebe887f61affffffffc49e44882b4080297f86029b9cec0c3f1780a8aa129e0f969499ef16ed5c8109000000006b483045022100c0c17e4f731b1a53bbff8db0b4434ca58d462a7454468a4af73a6b7ad11cbd34022003b1ae1195713498b35ec996dfa9066e2f9a5b97b2f7197a18f494bd45a23ce3012103d4d363f33a55d239c53fb6fc05595b447f824f81d43496583965a1f5caf62695ffffffffb2aea8e0e4bf56e8229ebbbe4c00b33cc7674b1377ce04b2ac609c9b092f9e6e000000006a473044022061a09de0675efea1cc30ad1934df41679137373bf7a03bea5214422e723f443802202429de8d117f281f7a45c952157ff240c84abb06e515a49fbd2d22a99f94211e0121022b7d7106aa8e4169257a0b2deeb30e2419e2ccfb47d549fdb8938100a692b4beffffffff6b848ee947b03a8b6b8e37a284d79f5f02676feb34e693908e94a5028b9c1e63000000006b483045022100f07781b77dc1981078c7079d9a2a1b572d7468eb638de086ab4629e05f4e3f920220744c472e67311caf0b34984021524c4aea7d35bcc78dda6c45dc56e357f1d941012103dbe1c3932db00f29bb2a9fead1d616c52cd98b22fe97b8781592353c4851d92affffffff8fb585d2cfa36e1c2bb7b8d81072523b486bd6f0e0cb0dae81eb7824180b9d0e000000006b483045022100cb07224583b986f28c2b9608b6dabeabd8be68ab66a1f5a3185e8bcc166c893c02201a097f691966d5cb2cc2298c4ffd9700493ba3862a73e78564f58dc0dc521dc4012103d90039f7c825894480c88e0ff25b159d57839288d1af7dc03a74e1a8e3da0daaffffffff0d8d4b7508000000001976a9145798b1c2d9ad862e3f13230c73f8d3a45ba5d47d88acd3de0100000000001976a91490c5bca58fc058ae95cecf9cec3857ec038cb47588acb8e6c300000000001976a91485433c070225a28134942c30bb9aaa729d45cbce88ac2b7df901000000001976a914c10e37a8cd55d9ae65567d832a8d85a56714093088ac1b97e100000000001976a914ac4f0f5d94c6fa68101dd5ba7af0bd30bdfa6c6388aca8394701000000001976a91432a9d57674772ca22e8df9437ef435a175289ead88ace2843e09000000001976a9149cfb1ea1359dc239c324e14ec92f53ec6f266a9388ac5b420f00000000001976a914e518b376cad97add0337b7694304c0895c4424c088ac20d7aa0d000000001976a9149343f22e38dd0748df30e0676bf7e8f5bfe3689588ac40d2df03000000001976a914670ba66102010a8dbb4b834d2a536484b91d4c7c88ac70048f01000000001976a914013cfd5b16b326295a8c60bd4d9ba2b75264696d88acc0687804000000001976a914653cf6f017b060cc46ab3796f411ffa0bb095c1888acb9b55d06000000001976a9144556b5c73621dc38edf5ae67e7e6c1add6e8244788ac000000000100000004a25919b2d9ba5834827dc6e52790c9cfcf6a637484008b611aa9ca3af38336ea000000006a4730440220496b1f109dc487301c3bae236ca6f8efe691d6e09c8eec3d8d5f97719760375b02201fa6cc5ad6baacd8ed34815c37b57a5564e1a7fc6e8e8353194184ba92b42a1f012102bf07874177e347f83c839c66c1c52a7254d091878922e646dc50ce37fd841487ffffffffd3485a41cf92dac3a6c6fede35a8f7e7ee030d4874d47fc18172bdf56715dcae000000006b483045022100fcb4ce877306181168540a2fa68e451cbf0c201912396b807b9995e97a31b23d02206b8eaf5fb58bf5e74e43b8301bee6e8c5d10082412778bfc62cc017d8c0d7088012103729edb8599da8f125923e9a8207e5e7cd2c7027ed9a0212775a64ce1d600f0aaffffffffde100c0b556a7dfd90575b1fbaf37a1578ea39385403d79c2700d0ef367e0525000000006a47304402204f439a89da1f48711ecb229b0d429aaf7f6a9e8292594e183e9abf8c9342f4d302200ac2691f836dbe91a1dedc92118eb497e4f0462d530919046b12b05f186cb0bf012102b8924f3067c38fed22445d5371dd4ec67cc5c038aa2824a5f3c6b787082b86b3ffffffff76fdc1bbcd8cee9da6ec41cd7fab35ee604e5f108d0a5724d32197fd430faca8000000006a473044022022cdd1980a09779852623a041b8500ea95a27aa3ba7772fa435c7a2a0f7f7d310220222167e6ce5ed1ff8c45eaaaf95931c24b404987f04c5233c8b29e1ab0d960d00121028dd4ad13065e7cfe7b706f733ee6067e879497be5f595b6c2eb28c4bed31db3fffffffff07ce122000000000001976a9142467e249b29cb00598b2d0425f8135fedc7ed2e588acacfd0100000000001976a914b46d1b1e3af916966c0f45fe34ca590d6c14d3ed88ac20394200000000001976a9140202fddbb2435f742e4230d604af24815d797be188ac60900f00000000001976a9140d8884a248b37ee8a2312ef14c14e0654fab7b8688ac26250200000000001976a9148716b034aef06ecc5d98ce391c869a70db303a9188ac20d61300000000001976a914680ea70e06b0169c9756bf38c7736d0adf191aa288ac084e0000000000001976a9147d490fb2b7d9edcafe5dceb95abdf63b8a255c7188ac0000000001000000087609408a14b30aa7fed7c91485edd9fb19a0ff0b8e7655674bc0923cded59a0728000000fdfe00004730440220702d110a384922ba8687a7447bbf91373627b30be4481a12ff7a01690fe3bdaa02204958f9ae0bdd9b0b03641646989afb1b3712c20a5bccd841e0cbdbce008df60001493046022100f1365246bbbdeb9616e3a1581702c26d6323b34048f9508eb7ef45505b9df804022100cec9322439432f3ae6b5e7bbcc474c4b4e5b2fe52b7e21c2d70f89b48219fad8014c69522102f097ad5490aee78ca0fb0286d59c94d2ad258607cd68a1d2257182dccc69a1bd21032f732aa3f330907065589cfef2cc40fe288050c31d8956271f2d827a5f3d365d2103e0cb6f950544c56be8664abe8e7c9d32f37b33496480180a4f696425e4516b4453aeffffffff465db37737567a3e32b67d71fddd204996a294f87f3f5ae17395790c0da68c2255000000fdfd0000473044022060e2a023fd886a816704c473e5f2377bab62787ccefae0e357dbe77afb9bdce702200888336da996eb3af0fdab56d77192899c7019ad4edb361af404b409960eb7b0014830450220113163876c77e4e08eb0194000f0487481463699fe8b7a2ae69869830d7d543e022100fb321053d245b801a8c6c266836a83be89f1c6de0e59a3f834a602512c6625fc014c6952210317ed21dd6e3ef90c3aa1a6385ac7eff20b8d2ea574e8caac8fc2d2b05c9a3c88210380d8387ff569a9fe2f97d0c3c300dcc001abf283acbad5120b615d313a0ad74821036164c92b13ad43a1b58bd0f12ddded8e1b6981d44594ef9250701927f7b29e9053aeffffffff8d1b077ed5cf09d127814e2aeed3d07239ae203b3bf7ea7800d550c6a0b2f89102000000fdfd0000473044022006107410b6bded858373116de669203ec066c382e23ff3763f060b90718efaf002201f61dc47d0df192bbd8f2e871ad4bca5983bb700c3b95301552e4d2edf0cc38701483045022100b2b592ee57979e602cc2367fd7f1abf0a042c56d10ae0afbde60004f753a10db022058ef20df40d8de780723f289541ec2b924317d541617dce4d23e7ad4bc9d1e48014c69522102e12b9e6609d9104fa65e7af8ee70b7512b660268c39f797a14cacb5bd25f804721034a472f1ba414665eecce4ecde2e340cdf8da2cadd92b9cf1a89ef3e4a032c8c7210206cc704a962679606f44ad9d80be136ab49ab796125f80fdf28ed1a38a9cb07453aeffffffff8d1b077ed5cf09d127814e2aeed3d07239ae203b3bf7ea7800d550c6a0b2f89152000000fdff0000483045022100ab320f61862eb78a5eb324a70e6abd01f21ca2b735b2a669d8b2f3b1d2badbd702206de7796daa82262e78e2d8a8bdb655d9670e944017d881d5d0caad43de34d48f014930460221008deebbd859fa8d540cd68177eb40864a03b98fb78396a3c0162bcdb0e506c3ce0221008ab2718f51fee27f0ddaf53f96a3f24c54f2dad350523005e68dde6b36d3dd67014c69522103482d14cb45b034286818848616a4fc4b1bbba4a3af12c630421b87382f8f22e721034242b5a5492b8e89cde074e4a2ed873429acf40071748654dd8c6f8ce3e7d13e21023ee1e8c8e0731340babc372c9b516ef3993594abc7e87364cd5c56536227b9d553aefffffffffc7db1d32f29e6ecab3c94e7cc018b93974921a50faf4b8f93c0e68caf4f281d01000000fdfd000047304402206f02ed2f5c6f712a2fea9a3c57492784386b2a9cc7118459edbc15d29aa5a45102203911ef850036c24684ba0cbe4bb3d83136ded6c59d42651904c9cd0e647f6b0d0148304502201a3c03558809a02bf44fd2789ee7dc6f17313614f3af62148c9c5f5654b9744e022100e5f96611a3de5f76bcdf33db833e8edfc83c4c287d923abe8fae8c53f9253914014c695221022c32817fb3a4e32d6bfade84ab4b485029f68678e3fc3a6b4b7126e5d44e844021033315ab2973621dfc637d86d1fe36245df50d0a271078c1e1b51f5e094eeaeb2e2103d1cca2a83edf5a7d0cb9e9422af530e9916d3bd2f293b75419dc7cfc8e9a20da53aeffffffffe192f2a83d78167fb3e79617abc7ef1c62e0308cdeaaebb111a490a9804bc91338000000fdfe0000483045022100b3d66a272ca6b77fbc4f59c046d8c68f77daa524f9800b198185096bf2610ac302207758ece29b70a60344f178a600955a8a3105bd3a53f9309ab15e8731945b16950148304502207bb172374e02fb68acaad2f1d8b15ded9d70c3e0d6cc91e9aff973fe2b03a965022100a888842a2306c323319695e0513f705a6c58546dff95bfc7a439a55c5eea59cf014c695221022e24e284889f6a962522f74a872048ab9a49f6a45b4df1be46922af3294000bf2102808c2976f2fc730f43f9adb1e22ebfd96bf9363236a945ed69eaa4c9f399eaf52103604e127ffc4630e490fe4bbedbe69f10eb5d51725ee5b68ad0013e2e0b8337c753aeffffffff465db37737567a3e32b67d71fddd204996a294f87f3f5ae17395790c0da68c2227000000fdfe000047304402202888e7de5436dde7957d846dd1ef365ef736dbcda72dd21033552a16ce1c9528022001e840b5752d077b6600fd8af51496ae78744acfc85a2bdcfa82836c1267df170149304602210099ddfdae142cb42a0bfc19c2ff78cdf0fadf774891e9e5de2cfa7635bc7edab0022100ee594c99c814f61b1a1d516bc90e0f0da1d7c1829c8c3ff4c9b5a67de8a0cb57014c695221020dc3d127c2eddb411ff6eb7071d6e9a8c11208e47c95f899d35367a0fc3610f7210378d81d7721a8a9498db4612a5a5736834e4cdecdda2767b93e02820f176a77762103e957ff4984dd3e4c750e71a4b150b92b218d58cf045f2073788aa2055184170953aeffffffff5e023dde4f10a46a67094f66c4fef8dc3236b7e8590ea18f8824fbb68cc6067901000000fdfd00004730440220175fa15bdf400c7d5a6b031073ac16f1f30435420279802fcad283e13c982a0b02203ddb5127ae8399f3abdbc60c407c47bd981b98463a45177b49d9596495d5b08f01483045022044066221aac5ef641fd2ee53a0a8cad2f470a0cd9b19c395abd463284c0bc7d10221009ec719628246c7fe0762dc3781d9925ac4ddc99c3e64de78a0c3bd9507c15fce014c69522102eb42161ad73027321bc3e0334d2f657b74682af68821d024d4daa8b0bf7502d321032e7823d9adc9eece9f6a8a7cd71f1c619fc76e984df0c8588001d22585644c2a2103d0698947f0b5e38c96b3c5a801035f09c8de463e9dbb3ca238de42c309c4c2e553aeffffffff0436506800000000001976a914b5de8d287e058ac2967e1823016101a7cc700cf388ac409c7102000000001976a914174efcb83831aea5de5e489a1473f617481e628788ac8fddc5020000000017a91437d153e81c48278b77a099c09411d38362751846871b488315000000001976a9144bdb0b7712726c2684461cd4e5b08934def0187c88ac0000000001000000013f980a803270dd6a6786edfe545baa6a02299d5a05a593f15cae49a083e6288201000000020151ffffffff01384a0000000000001976a9140659ea0f166aecb428e51a9414992bf28cc0c9eb88ac00000000010000000121badea07dede0c45c6aa69d2579ebe56387f91e354c36079a33251ce4a860cd450000006a473044022006b63c164063d59ff707186a2ed039c6d5185edd96f264fc43d4376b884fce5202207498575f55a87cb4ae2bfe56072bac74438a8f4b29e3d488bb007307d206fa90012103ad488d5ba48f949825bce6b92439d788027f9cbc787951f7198c170a4b681a94ffffffff17701c0000000000001976a9142956227d413b490b989b552a4ab69be35fbc451c88ac5b1b0000000000001976a9142bd6d10e6740b2c5ebc0b85450ff2c69dd4529f788ac301b0000000000001976a9148ba8418e16e35622f665c481956d821f340a111188ace01a0000000000001976a9143eecb7f092221721da151281b7ce2e720bcacac088acb31a0000000000001976a9142b2545d96815677cd040c4692b8857057be9872388ac901a0000000000001976a914db2ae9e13aa7320a4bb3846dbe96d021009bd3d088ac181a0000000000001976a914b3e73a8cbabe69e4a170c438dd9c0cddea3455ad88ace8190000000000001976a914f559f58817c8c0db2c10178eff2277de1353491d88ace0190000000000001976a914f84505347756776975caac6ef0cbb6c654fc8d0c88acd8190000000000001976a91458b007ee9bba66cf9a2d8f2ef11188c0f3e2f85388aca8190000000000001976a914118bd8c9b9e021128943a0fb737fbcc55176d65688ac70190000000000001976a914cb503359f07ac61b140394b3a3a73719b2716c7288ac60190000000000001976a9149a005e082df0dce421a6402d9df949d7d30ffac188ac701c0000000000001976a914b8bb935415182eb63a99822116de4269398a23eb88ac00190000000000001976a914c0d99470ea82e172492dc65b4ad4f70d1c6ba85a88acc6180000000000001976a914e2ca06d3717aede4a1758d6fd26623beb18c155a88ac91180000000000001976a914ae0e6a316462c96ed3d9357c6026860dad06ea2188ac10180000000000001976a914ac670f702c391ecff364bf5482493352eece69e688ace0170000000000001976a91471ae8a29a1fb1b2bd6e8db48de40f576c9c3bb4688acd8170000000000001976a914d2fc79d8e848f4c5e529bdbaf2985fd32654ef4f88acb9c02f00000000001976a91442bd8225289a7abadd9ae3ca03c7728cff703b6188acd6170000000000001976a914ab3e698fca2f209c5062714159703d741001a7a088ac90170000000000001976a914c2f3d984b27f54fb595c3d9360b7b086ecce22df88ac000000000100000001935bda72d8644e92e2d6450cf91bce89e3652955768605179d0a046e74b618ce000000006b483045022100edf973ea0e40be7dad3146ec5149210060891ba2f43085658918dd5df91fe9780220737960ee427a263be22d1d9ec2f6b5d083dbddb399ed96900068b3ca526be3190121029e327a887d04cf47cb5c3c0a98752bc14b91a868b0a7d7354ac2028ecae6cbd3ffffffff01a0b39705000000001976a9147af1bab2645028cd20a491b7929dec96f94d5efc88ac0000000001000000025372c4c57f01eff16fe31289c4efc1d099380a2b67dbad9f55da402495440fab010000006b48304502210094ff5b3023b9f9657408cafba21827ef7fee96f19508515e81dca142316622e102206f44491df30309df6bb38fb459026d0eb2dd3b966506f6d28189ac0fc283bd700121022e1d51adaecfbc0e017738d48235c085906618cba0fc9941f03fddf0d0badc4fffffffffd447c8af81eefb0c2756569872623d364a3c7eeaff53252dff56b982556f83c0000000006a47304402203f67ce31c855e1823f2dd1debca9e4a5f39613b49022926e19cb5457f70624ce0220791cf612ded8a39f3f273e30015d1e6512be8282422b665c4828afb39076b2d60121031f4450d4aa56dd24b29ab792e4e0c7500e2961f197bd2bee6adcd21c3e3389e0ffffffff02c0d0010e000000001976a9141fa4e93cee43ca9aec1daa47b45fd0688a41489c88ac93a8ae20000000001976a9147b9e4573be924d06881b8153d6e5ab7522b000e288ac000000000100000001892b2fb2bc30fc18cc074a694a6ad0f3c7a76b529b422eaba93179960d47a48c000000006b483045022100f2887c5790a946300eec692f25fe951b59043b5f130cbea4055497a136e3f0b602201cdc394f8dcb3dda960469981d77cffd8c3e9e2fdbe8c5b9e4b680c995ac5eb5012103b202980f3554ff2359cca72e34e3a33de23a141848236160bf97b6f69b26f45dffffffff02b8820100000000001976a9144893c1f022614617af0f0217df7fa45f7a498c9e88ac0000000000000000136a11626c6b434954452d756e646566696e6564000000000100000001c7d45151e476d3ef37b8944d9f65b95cf5f9e4438d083764a0f5352de8031673000000006b4830450221008225c2e34e135406d6b6ca68608891a445b7ee804343c72ff044c5d4634b5719022057b87a9686d18434555ebfba15576190f4e34551798a2f2a664e455d7ce5653e0121024be17673c8cffa66ab1ee3969b6f89e0e31db476647d3ae431acbd5d4447b240ffffffff02535101000000000017a914b9bdab29754755bf730da0262a8ec8fbecaa85a68794620100000000001976a91492228f5b257c8cccd31262fd24837a3bda521d0088ac00000000010000000140e3777ba2a8e94ba5bdcc21652532cae692f3cf626817c8d07e8ab7178d782e010000006a47304402207aa519e1a01415cb116d176ee200a6558083c27e2e01fc1833fba8800b35407a022076d6814b9c61a5dc18646633acbadb10ef56c31e2a60b4e534ccb93c4efa3cb0012102ab6efabf8449c9c3f163c26848682c100bebb17f8e0f9ae7074308945b1508edffffffff02c07c7a11000000001976a914112725d290646acce6c36cfd283cad60bd2b621188acf8b95007000000001976a9146e43e09d38b9ca4a1a095a8161842e4803ec7ce888ac000000000100000001e02bbdb6fc8634876bbbb507ba4474407d474d34bc294c935476517527c9d8db010000006a473044022008da34bc1b9255e65b5c232e3f12a15eb766e5706aac5bc571922b9e1ddbedff02204f370c9a614b8d5362e8134709c82d96cd714f631adb96e79c3ab7266f9e1a770121028727951f9e85defc362016f841e8daa97ee6bcc297ff7009714df0389213619fffffffff02205fee05000000001976a9140d938222ff45ab1aa54bcc7f7369d6424f33004e88ac704c0601000000001976a91467fcd2894dbbfb5ce5b85b252bf8a838c2d6a45788ac000000000100000001c61ccdd6da33e60a7090a4373082e97eac451dc227644a09efc8847cc81fd47b010000006a4730440220270762d0afe35bb6b7c79625f691fdbd99e82ff1d6c47a64bd6c8b9bdcf5409f0220721054e9718272c772e4700fbf0ec91f26480c15dcc820403cea33523b26f9230121026d0f25723c8eac6872a367b9b014270f09c077ed371250ac4fa57d5ad381ef43ffffffff02a0860100000000001976a91419fe2c57cc57ba070cbb3d5c69d29e06e6e5adb088aca77e1100000000001976a91460f0c24dd4859f65b504af0394e22eacdc5333c588ac000000000100000001902b3b7bb311a221091be40807205f53ded1599ac1da99a6cbb3289ad384efb6000000006b4830450221008a9cb6210e5d2e478853db30bc86fb7887db9b7cd8f4aebab71274291ee0ab9b02206731912cf306aeed7e4b18c2e45233d0d706c23f51ca14daf75e3596102f70d40121030a7b28ff87f8e0c327296c12fc3e5779daee706969bd029345e04ff38ab25813ffffffff029c8a0600000000001976a914ee3294b4823a5b804c8c316315a8eb00124baf6f88ac7065c500000000001976a914d20dc2429bfdab9b6239a450cb828480ead1047188ac000000000100000001c54acaacadda3b75e3e7183570a7c4a3febda1e962abe68aa5d1ad0052240d91000000006b483045022100f9aed4750c10a0d1e0bbec3755bfefd1c9d628cd4ca1e74652c29e5f22e046ca02204473630d5c959bd0b9898c1d19d367d73fb81790f84b1b3d5786f44915db90d0012103260085357d1f06c1149873a6372a291b144d03890b8761924bf7e9f0010ec628ffffffff02f352bd00000000001976a91457d364528698fcde6f8018a77fd62e90ec16571788ac85ee9600000000001976a9144b28b59197ed1cf8ae58ed8f051c1e72a5fa3de888ac0000000001000000018ea0adf0b93418ae9002dd83ace465d27f8a00d0eea5f2757c8e8652e022b6b9000000006a473044022041db21de2713733f8f4fe78655b7589a488b8e73349b9eaa494adc6a0838d03102200158a7676749591a51fdf5e29bc2cbe0c01db9144ea19e85f287e3d15dfb3436012103b202980f3554ff2359cca72e34e3a33de23a141848236160bf97b6f69b26f45dffffffff02d07e0100000000001976a9144893c1f022614617af0f0217df7fa45f7a498c9e88ac0000000000000000236a21626c6b434954452d6b6a646637363134716173646a66693931383479657279383100000000010000000193bfcae914db1279814dea6726cfc748b755bbcc4a93a273a9c620f2508a78ab030000006a47304402203abaa04cab72480d6a829b6ac1e297d17c0216ea64cce0bdf35f24fca2d2b56c022057b1fa4a6faddfc24e582f53630994df25f93dbd7b6ee887c17526145a58b37801210359ed9fe4b091a14a825283ea157184972e40ee7bf19907f8f55475a7e09b57e3ffffffff02e0834e02000000001976a914466de898febb92569e14fa08f86c4c90ab9d91fe88accc8b0000000000001976a914c670fd303d0eed54dfc1f5510cf65a8d35c4b90388ac0000000001000000023afb3543779eee68de215e33294df8829f50d040d694591c6ecb90289353ff4201000000db00483045022100c0ec3c6093d278fce86c302c5530fbd392053d286b057e50239c8a1c064d3b1502200acb0a998419e0f498ac20e1289edb88481d6b27d25fbbb1b0410221705924e001483045022100b80149d2516873b9a9e1ed907564bd8eef80c0b1920535fd84a3f5b78cf6375d0220522cebee4005c2ed5b5a07f35caf016b519f362d92d762b871a7dceb6ddf5e110147522103fe703028715e95bbdd7ea2b1b1d42b497f1f30cea7f02313060e802b676edbe32102aeb999f6601af13b0f9391f642611e32bf1bb7db593ec1630c9fc6f9bbd1c35c52aeffffffff14254bb015e1c9544d767273680b13fc95a564194a6aa739611f1ded4c31a33d5e010000d90047304402205aea8894da710b14f0661ad722e79b074b6c1384418bdbc400f25bb3b951765402205094028481b583fe34222e78319ce57df25d5fea43d6581266d71439ea6a4daf014730440220582a636c2e9301ed94ed2a693199b3d46498d247823c1afa6691ae2dc8f7713402203bd3ed6421b7eb99c6f11709d7231b3ce1de42ea9ef76b252a40feaf0b17ce2d0147522103fe703028715e95bbdd7ea2b1b1d42b497f1f30cea7f02313060e802b676edbe32102aeb999f6601af13b0f9391f642611e32bf1bb7db593ec1630c9fc6f9bbd1c35c52aeffffffff0210270000000000001976a9147e39d0c3c9f2dd1cb6efff02ea2b3e66f0fed57988ac6c0700000000000017a9148511da076b68f24fc8a506e4688b4c0bca0e81c8870000000001000000019b8630b859bdc779e56cd05445c56f9217d733031fd346cbb886c8cb1ac79932000000006b483045022100b6c292ac096841a29de61a0cf7b555d374d46708452642a67798cdb8f6b30277022009f67af8ed398c382f42c2bc96057ad1fb39e55857ebd649f1691f15d1acf754012103e229ea70ab5ea17031d89e7c1e24e9c77639c847378fb953753d73a5ccd5c4faffffffff01be850100000000001976a9149b95ca317d2d4c255ebd4036410d2ded65ca872988ac000000000100000005cb135d9ee2626ca15b7dfe4d7610d2fa9d22bec1f42927518dc957827d87c58d000000006b483045022100f717c831ad1577900bd4fbbfa35f079c9771757b97688a6a3c88532e5843d9c7022030e31a108bb4e06f79810ce5de828fcba5ad9a20cac8fbf02a9ddb6ac8c7c8a9012102c331723cc8ed4bc09fe3a1107c2ad8c516af3e3852060bc6b4a47a9a791fcf67ffffffff218cbb397655ee7aaf4ee7f232545800346a96449546db79a9f9d054d145d891000000006b48304502202e26268ebc8529e41874136c429a9a82a5a59bc41b983574a9d874af9fe54ef1022100cc3c02aeb0c63db3c3e5f8534b03d41f7a28b007ad1dd26c6dff04e887b23a6d012102c331723cc8ed4bc09fe3a1107c2ad8c516af3e3852060bc6b4a47a9a791fcf67ffffffffe96533968cd1cfc9a7a49fe56afb0496794f6989c711ed94431c0037ab92e0a4000000006b483045022100b75656bd4cb4119e95f7a74b687d9280d0a295fd7ddb8a06ce64923ae935c6a6022051b35243b48073d99a05862475774b57e59caf57320020e00eae61f411ae304d012102c331723cc8ed4bc09fe3a1107c2ad8c516af3e3852060bc6b4a47a9a791fcf67ffffffffd8000b57b08873fdb6bb7e15a0506708cd3c3398be3a5a7f59030615c949a6d1000000006b48304502200203dc41d55f69f64c957592663f015314e145564456906743602246ec7e48f7022100f4416318828ba33e1732af39cdf7d1d6e845b3ee7c5a6315bb5d26668969b921012102c331723cc8ed4bc09fe3a1107c2ad8c516af3e3852060bc6b4a47a9a791fcf67ffffffff29c23a479db487a4157b66fb3582c5e8d28e94cfcc34ec2b4454cbac5b5bfcda000000006a47304402207bb2972b1d007357e82f537d3a74de5dfecb404def5f6bd7a794fd93bb9ba87a02204d4452cafd8874eb521e67f215ca60087de9e85d8894b542394301fa77668de9012102c331723cc8ed4bc09fe3a1107c2ad8c516af3e3852060bc6b4a47a9a791fcf67ffffffff040e120100000000001976a914a35c87540e251d00bd7c25b8561fd13c8e20621388ac060a0000000000001976a914568e17467b6f1d7a98430f189c4c3d2246f5ddde88ace8030000000000001976a914ac9d08a94f54186101973113614965453044ec5388ac4c330400000000001976a914a6559089e22b9bbc8eb6bb0dd02d341766c820aa88ac000000000100000001a42006a28d5d9b21d08919897c1c20ec84a75df119eb78140547089cc26a760b000000006a4730440220424789281497268eb87b0d9e448e043cd5356059c5bfb0335b0047cbb17084d8022063100c678b0eabc2f42066821ec8dd1c6b6e4b563b8bebb8bf91ad02c079850401210366c2654259c544a8ef1dadeab869b94bcb8b6e4da09f4698dfdde2b0a882b0b9ffffffff0260ff39a1010000001976a91427c82c6e4ce54acb9c2c67f1ab843715d50a3b1688acb9193777000000001976a914459100c6f8143640d5ba2f6f21d95c5557b0987188ac000000000100000001bea0f6596f6547a4a9ce96944f581cda73fe68e3882846fccae1bd9855db04cb000000006a47304402203fcd10fb496241f41465435ac740008018af0a1b9c6becabe3621a269dbd3eb202205f7b4cb0fdecc39baf170b0f6ae2d74b6bfeef593bb9ed0ed4d9dffb3bf5fd2a0121035411432297cdc797ff8e36bd513352e59b21c0cb6dd3bcf13b6a7baf344bafe4ffffffff024a34821e000000001976a91469a81bd81731c19ac60a473113e2ced672c9cc6e88ac43535a46000000001976a914edddf3ac5084f4df1058ad55d72e7d92b0773f5088ac000000000100000001b95bc5738e9c764338ee9afbd78644ea02df709d1a74ff18adb877528347dead000000006a473044022046d9e32c186e0fdec6b3df555c7e726a0b07080ca39aba6cb7cc287c50a60a03022065042320781b2b9403c15e50d05404c63238ffe3664db1186c11531ef01044a901210297b1240283700504758315c27f1958e8649fa5f8fb067f266925352a3a5cee17ffffffff02001c1902000000001976a914dd125f8605acc2cd784cfee8b7d8bff9f65fcb7e88ac32b96802000000001976a9148ab0a5bfca9ea41780a7b83381cc2dcbfc6298b188ac000000000100000001bfa3b6f9e193186e520e6d1bcd2dd42eed0aa3764a330e3922f325f8b8ddbc99010000006b483045022100c7a05b76a91407cadf8eb146b4fe09b7504f2654314325c8d5637c61f613cb6802202281ddad11ed6690609ec6ebb0715cda26621ff0cf4f5b69e47c2e9b4b5550ad0121024b30a1a48f4935058ac79273660a6d79550dafc71650152f14469ab3a9c8aa0cffffffff0203556d0e000000001976a914b4019007cff80b6b987f68191c1433b8d1cf6d6388acc0687804000000001976a91471729c6c03714a4a510299aab5b9030b944dccb388ac000000000100000001d70690b606e7ef96e7ef2e33460718ec7e93e9d5a98025be162e2dce64749db6010000006b483045022100f6562c9d7d2877dbac9a31de1634b3c7cbed91bef26972c9e0249fc4fb56e67e022040483f1c3c81ff807f82593d105ad37b1a0c7ed927c8bdaa1d558a9b4d0676170121022a023d7d15923fd2d3351323fe743dff984a87507dab7694adc75a80e22b6fc0ffffffff0288a3a815000000001976a914d05b8837feb7b1c20ef13ec76d2e3660e03680ab88acd4247c02000000001976a91471207fa6371951b4f6f53ca34213f753b5b4394788ac000000000100000001f231873fd290c03c2d8b13818893cb2fa88a6d7dc7dbbec29647f4f08343460c000000006b483045022100bd677305b3afd3e921f13773f92f5bcbbe732ac95f430665d0ce38f2dd715d84022071f3daaf83461cc15af5d0d2ba8dca0a8614de3a201f504c131f7a14d591a54001210240e251cfc6450738d6368155469814889a1af198adf2b65e226415af3f4b2124ffffffff0241f5e20c000000001976a9141a3265d7d31c2691570d5cb592417324cbfcff3988ac65adc508000000001976a9142d6c51edeaa5c20653638952b95a1282d145d5ff88ac0000000001000000015edf447e00d5ad32259ed93c7dce2191fc6401255f6641dab4a7333f8e8fc316000000006b483045022100abf99da57e19cb3fe61b95225ac22b0cfcd58a77bb885e16d28644371a5b35a802204009685cdbf260860ea34374b63b0f6888990d02a7202f5f7e00f6c88d448946012102319e5ddbbae6d9da7aada698790758a7db0d5424f50ab717c6fae1ecafda614effffffff0276889004000000001976a914a1b0e8d492135c75a1a109e249a8190e1b69ea2988ace96b5208000000001976a91483158b1f9e33ef4657f4e562d0f1f880d08eef4988ac000000000100000001b080e9eb487aa93eaae6df4d1cfc0b6a586f0634445bb856aa7c5cf43d41bcf20000000069463043021f1f87b9fdcbaa0f208283dadcab63c547d3b1cac6d08406f802d42a9c445aa202203b572ad168c39faa8b2ee3ec1761afd7ef2d45cd68b6f7e40783797d2d2837d60121021091eca140c51666414a3bb9d4f077f10f109ebbae632034b408846180a63b81ffffffff02c5a5e902000000001976a91408a07dec5cbc859b0ce62586b13d10e4cd8cdb2388accfe1a601000000001976a9140aa5ac2f732c75058f584c26489489f4ef15e7e688ac00000000" diff --git a/packages/kauri-bitcore-lib/benchmark/package.json b/packages/kauri-bitcore-lib/benchmark/package.json new file mode 100644 index 0000000..d9c9fec --- /dev/null +++ b/packages/kauri-bitcore-lib/benchmark/package.json @@ -0,0 +1,8 @@ +{ + "devDependencies": { + "bcoin": "0.15.0", + "bitcoinjs-lib": "^1.5.7", + "fullnode": "^0.9.0", + "benchmark": "^1.0.0" + } +} diff --git a/packages/kauri-bitcore-lib/benchmark/script.js b/packages/kauri-bitcore-lib/benchmark/script.js new file mode 100644 index 0000000..f14e8eb --- /dev/null +++ b/packages/kauri-bitcore-lib/benchmark/script.js @@ -0,0 +1,85 @@ +'use strict'; + +var benchmark = require('benchmark'); +var bitcore = require('..'); +var async = require('async'); +var blockData = require('./block-357238.json'); + +var maxTime = 30; + +console.log('Benchmarking Script'); +console.log('---------------------------------------'); + +async.series([ + function(next) { + + var c = 0; + var scripts = []; + var block = bitcore.Block.fromString(blockData); + for (var i = 0; i < block.transactions.length; i++) { + var tx = block.transactions[i]; + for (var j = 0; j < tx.inputs.length; j++) { + var input = tx.inputs[j]; + if (input.script) { + scripts.push(input.script); + } + } + for (var k = 0; k < tx.outputs.length; k++) { + var output = tx.outputs[k]; + if (output.script) { + scripts.push(output.script); + } + } + } + + function isPublicKeyOut() { + if (c >= scripts.length) { + c = 0; + } + scripts[c].isPublicKeyOut(); + c++; + } + + function isPublicKeyHashIn() { + if (c >= scripts.length) { + c = 0; + } + scripts[c].isPublicKeyHashIn(); + c++; + } + + function toAddress() { + if (c >= scripts.length) { + c = 0; + } + scripts[c].toAddress(); + c++; + } + + function getAddressInfo() { + if (c >= scripts.length) { + c = 0; + } + scripts[c].getAddressInfo(); + c++; + } + + var suite = new benchmark.Suite(); + suite.add('isPublicKeyHashIn', isPublicKeyHashIn, {maxTime: maxTime}); + suite.add('isPublicKeyOut', isPublicKeyOut, {maxTime: maxTime}); + suite.add('toAddress', toAddress, {maxTime: maxTime}); + suite.add('getAddressInfo', getAddressInfo, {maxTime: maxTime}); + suite + .on('cycle', function(event) { + console.log(String(event.target)); + }) + .on('complete', function() { + console.log('Done'); + console.log('----------------------------------------------------------------------'); + next(); + }) + .run(); + } +], function(err) { + console.log('Finished'); +}); diff --git a/packages/kauri-bitcore-lib/benchmark/serialization.js b/packages/kauri-bitcore-lib/benchmark/serialization.js new file mode 100644 index 0000000..ee948a6 --- /dev/null +++ b/packages/kauri-bitcore-lib/benchmark/serialization.js @@ -0,0 +1,122 @@ +'use strict'; + +var benchmark = require('benchmark'); +var bitcore = require('..'); +var bitcoinjs = require('bitcoinjs-lib'); +var bcoin = require('bcoin'); +var async = require('async'); +var fullnode = require('fullnode'); +var blockData = require('./block-357238.json'); + +var maxTime = 20; + +console.log('Benchmarking Block/Transaction Serialization'); +console.log('---------------------------------------'); + +async.series([ + function(next) { + + var buffers = []; + var hashBuffers = []; + console.log('Generating Random Test Data...'); + for (var i = 0; i < 100; i++) { + + // uint64le + var br = new bitcore.encoding.BufferWriter(); + var num = Math.round(Math.random() * 10000000000000); + br.writeUInt64LEBN(new bitcore.crypto.BN(num)); + buffers.push(br.toBuffer()); + + // hashes + var data = bitcore.crypto.Hash.sha256sha256(new Buffer(32)); + hashBuffers.push(data); + } + + var c = 0; + var bn; + + function readUInt64LEBN() { + if (c >= buffers.length) { + c = 0; + } + var buf = buffers[c]; + var br = new bitcore.encoding.BufferReader(buf); + bn = br.readUInt64LEBN(); + c++; + } + + var reversed; + + function readReverse() { + if (c >= hashBuffers.length) { + c = 0; + } + var buf = hashBuffers[c]; + var br = new bitcore.encoding.BufferReader(buf); + reversed = br.readReverse(); + c++; + } + + console.log('Starting benchmark...'); + + var suite = new benchmark.Suite(); + suite.add('bufferReader.readUInt64LEBN()', readUInt64LEBN, {maxTime: maxTime}); + suite.add('bufferReader.readReverse()', readReverse, {maxTime: maxTime}); + suite + .on('cycle', function(event) { + console.log(String(event.target)); + }) + .on('complete', function() { + console.log('Done'); + console.log('----------------------------------------------------------------------'); + next(); + }) + .run(); + }, + function(next) { + + var block1; + var block2; + var block3; + + function bitcoreTest() { + block1 = bitcore.Block.fromString(blockData); + } + + function bitcoinJSTest() { + block2 = bitcoinjs.Block.fromHex(blockData); + } + + var parser = new bcoin.protocol.parser(); + + function bcoinTest() { + var raw = bcoin.utils.toArray(blockData, 'hex'); + var data = parser.parseBlock(raw); + block3 = new bcoin.block(data, 'block'); + } + + var blockDataMessage = '0000000000000000' + blockData; // add mock leading magic and size + + function fullnodeTest() { + fullnode.Block().fromHex(blockDataMessage); + } + + var suite = new benchmark.Suite(); + suite.add('bitcore', bitcoreTest, {maxTime: maxTime}); + suite.add('bitcoinjs', bitcoinJSTest, {maxTime: maxTime}); + suite.add('bcoin', bcoinTest, {maxTime: maxTime}); + suite.add('fullnode', fullnodeTest, {maxTime: maxTime}); + suite + .on('cycle', function(event) { + console.log(String(event.target)); + }) + .on('complete', function() { + console.log('Fastest is ' + this.filter('fastest').pluck('name')); + console.log('----------------------------------------------------------------------'); + next(); + }) + .run(); + } +], function(err) { + console.log('Finished'); +}); diff --git a/packages/kauri-bitcore-lib/bitcore-lib.js b/packages/kauri-bitcore-lib/bitcore-lib.js new file mode 100644 index 0000000..3014204 --- /dev/null +++ b/packages/kauri-bitcore-lib/bitcore-lib.js @@ -0,0 +1,54148 @@ +require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o'; +}; + +module.exports = Address; + +var Script = require('./script'); + +}).call(this,require("buffer").Buffer) +},{"./crypto/hash":8,"./encoding/base58check":13,"./errors":17,"./networks":21,"./publickey":24,"./script":25,"./util/js":43,"./util/preconditions":44,"buffer":47,"lodash":319}],2:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var BlockHeader = require('./blockheader'); +var BN = require('../crypto/bn'); +var BufferUtil = require('../util/buffer'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var Transaction = require('../transaction'); +var $ = require('../util/preconditions'); + +/** + * Instantiate a Block from a Buffer, JSON object, or Object with + * the properties of the Block + * + * @param {*} - A Buffer, JSON string, or Object + * @returns {Block} + * @constructor + */ +function Block(arg) { + if (!(this instanceof Block)) { + return new Block(arg); + } + _.extend(this, Block._from(arg)); + return this; +} + +// https://github.com/bitcoin/bitcoin/blob/b5fa132329f0377d787a4a21c1686609c2bfaece/src/primitives/block.h#L14 +Block.MAX_BLOCK_SIZE = 1000000; + +/** + * @param {*} - A Buffer, JSON string or Object + * @returns {Object} - An object representing block data + * @throws {TypeError} - If the argument was not recognized + * @private + */ +Block._from = function _from(arg) { + var info = {}; + if (BufferUtil.isBuffer(arg)) { + info = Block._fromBufferReader(BufferReader(arg)); + } else if (_.isObject(arg)) { + info = Block._fromObject(arg); + } else { + throw new TypeError('Unrecognized argument for Block'); + } + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {Object} - An object representing block data + * @private + */ +Block._fromObject = function _fromObject(data) { + var transactions = []; + data.transactions.forEach(function(tx) { + if (tx instanceof Transaction) { + transactions.push(tx); + } else { + transactions.push(Transaction().fromObject(tx)); + } + }); + var info = { + header: BlockHeader.fromObject(data.header), + transactions: transactions + }; + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {Block} - An instance of block + */ +Block.fromObject = function fromObject(obj) { + var info = Block._fromObject(obj); + return new Block(info); +}; + +/** + * @param {BufferReader} - Block data + * @returns {Object} - An object representing the block data + * @private + */ +Block._fromBufferReader = function _fromBufferReader(br) { + var info = {}; + $.checkState(!br.finished(), 'No block data received'); + info.header = BlockHeader.fromBufferReader(br); + var transactions = br.readVarintNum(); + info.transactions = []; + for (var i = 0; i < transactions; i++) { + info.transactions.push(Transaction().fromBufferReader(br)); + } + return info; +}; + +/** + * @param {BufferReader} - A buffer reader of the block + * @returns {Block} - An instance of block + */ +Block.fromBufferReader = function fromBufferReader(br) { + $.checkArgument(br, 'br is required'); + var info = Block._fromBufferReader(br); + return new Block(info); +}; + +/** + * @param {Buffer} - A buffer of the block + * @returns {Block} - An instance of block + */ +Block.fromBuffer = function fromBuffer(buf) { + return Block.fromBufferReader(new BufferReader(buf)); +}; + +/** + * @param {string} - str - A hex encoded string of the block + * @returns {Block} - A hex encoded string of the block + */ +Block.fromString = function fromString(str) { + var buf = new Buffer(str, 'hex'); + return Block.fromBuffer(buf); +}; + +/** + * @param {Binary} - Raw block binary data or buffer + * @returns {Block} - An instance of block + */ +Block.fromRawBlock = function fromRawBlock(data) { + if (!BufferUtil.isBuffer(data)) { + data = new Buffer(data, 'binary'); + } + var br = BufferReader(data); + br.pos = Block.Values.START_OF_BLOCK; + var info = Block._fromBufferReader(br); + return new Block(info); +}; + +/** + * @returns {Object} - A plain object with the block properties + */ +Block.prototype.toObject = Block.prototype.toJSON = function toObject() { + var transactions = []; + this.transactions.forEach(function(tx) { + transactions.push(tx.toObject()); + }); + return { + header: this.header.toObject(), + transactions: transactions + }; +}; + +/** + * @returns {Buffer} - A buffer of the block + */ +Block.prototype.toBuffer = function toBuffer() { + return this.toBufferWriter().concat(); +}; + +/** + * @returns {string} - A hex encoded string of the block + */ +Block.prototype.toString = function toString() { + return this.toBuffer().toString('hex'); +}; + +/** + * @param {BufferWriter} - An existing instance of BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the Block + */ +Block.prototype.toBufferWriter = function toBufferWriter(bw) { + if (!bw) { + bw = new BufferWriter(); + } + bw.write(this.header.toBuffer()); + bw.writeVarintNum(this.transactions.length); + for (var i = 0; i < this.transactions.length; i++) { + this.transactions[i].toBufferWriter(bw); + } + return bw; +}; + +/** + * Will iterate through each transaction and return an array of hashes + * @returns {Array} - An array with transaction hashes + */ +Block.prototype.getTransactionHashes = function getTransactionHashes() { + var hashes = []; + if (this.transactions.length === 0) { + return [Block.Values.NULL_HASH]; + } + for (var t = 0; t < this.transactions.length; t++) { + hashes.push(this.transactions[t]._getHash()); + } + return hashes; +}; + +/** + * Will build a merkle tree of all the transactions, ultimately arriving at + * a single point, the merkle root. + * @link https://en.bitcoin.it/wiki/Protocol_specification#Merkle_Trees + * @returns {Array} - An array with each level of the tree after the other. + */ +Block.prototype.getMerkleTree = function getMerkleTree() { + + var tree = this.getTransactionHashes(); + + var j = 0; + for (var size = this.transactions.length; size > 1; size = Math.floor((size + 1) / 2)) { + for (var i = 0; i < size; i += 2) { + var i2 = Math.min(i + 1, size - 1); + var buf = Buffer.concat([tree[j + i], tree[j + i2]]); + tree.push(Hash.sha256sha256(buf)); + } + j += size; + } + + return tree; +}; + +/** + * Calculates the merkleRoot from the transactions. + * @returns {Buffer} - A buffer of the merkle root hash + */ +Block.prototype.getMerkleRoot = function getMerkleRoot() { + var tree = this.getMerkleTree(); + return tree[tree.length - 1]; +}; + +/** + * Verifies that the transactions in the block match the header merkle root + * @returns {Boolean} - If the merkle roots match + */ +Block.prototype.validMerkleRoot = function validMerkleRoot() { + + var h = new BN(this.header.merkleRoot.toString('hex'), 'hex'); + var c = new BN(this.getMerkleRoot().toString('hex'), 'hex'); + + if (h.cmp(c) !== 0) { + return false; + } + + return true; +}; + +/** + * @returns {Buffer} - The little endian hash buffer of the header + */ +Block.prototype._getHash = function() { + return this.header._getHash(); +}; + +var idProperty = { + configurable: false, + enumerable: true, + /** + * @returns {string} - The big endian hash buffer of the header + */ + get: function() { + if (!this._id) { + this._id = this.header.id; + } + return this._id; + }, + set: _.noop +}; +Object.defineProperty(Block.prototype, 'id', idProperty); +Object.defineProperty(Block.prototype, 'hash', idProperty); + +/** + * @returns {string} - A string formatted for the console + */ +Block.prototype.inspect = function inspect() { + return ''; +}; + +Block.Values = { + START_OF_BLOCK: 8, // Start of block in raw block data + NULL_HASH: new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') +}; + +module.exports = Block; + +}).call(this,require("buffer").Buffer) +},{"../crypto/bn":6,"../crypto/hash":8,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../transaction":28,"../util/buffer":42,"../util/preconditions":44,"./blockheader":3,"buffer":47,"lodash":319}],3:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var BN = require('../crypto/bn'); +var BufferUtil = require('../util/buffer'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var JSUtil = require('../util/js'); +var $ = require('../util/preconditions'); + +var GENESIS_BITS = 0x1d00ffff; + +/** + * Instantiate a BlockHeader from a Buffer, JSON object, or Object with + * the properties of the BlockHeader + * + * @param {*} - A Buffer, JSON string, or Object + * @returns {BlockHeader} - An instance of block header + * @constructor + */ +var BlockHeader = function BlockHeader(arg) { + if (!(this instanceof BlockHeader)) { + return new BlockHeader(arg); + } + var info = BlockHeader._from(arg); + this.version = info.version; + this.prevHash = info.prevHash; + this.merkleRoot = info.merkleRoot; + this.time = info.time; + this.timestamp = info.time; + this.bits = info.bits; + this.nonce = info.nonce; + + if (info.hash) { + $.checkState( + this.hash === info.hash, + 'Argument object hash property does not match block hash.' + ); + } + + return this; +}; + +/** + * @param {*} - A Buffer, JSON string or Object + * @returns {Object} - An object representing block header data + * @throws {TypeError} - If the argument was not recognized + * @private + */ +BlockHeader._from = function _from(arg) { + var info = {}; + if (BufferUtil.isBuffer(arg)) { + info = BlockHeader._fromBufferReader(BufferReader(arg)); + } else if (_.isObject(arg)) { + info = BlockHeader._fromObject(arg); + } else { + throw new TypeError('Unrecognized argument for BlockHeader'); + } + return info; +}; + +/** + * @param {Object} - A JSON string + * @returns {Object} - An object representing block header data + * @private + */ +BlockHeader._fromObject = function _fromObject(data) { + $.checkArgument(data, 'data is required'); + var prevHash = data.prevHash; + var merkleRoot = data.merkleRoot; + if (_.isString(data.prevHash)) { + prevHash = BufferUtil.reverse(new Buffer(data.prevHash, 'hex')); + } + if (_.isString(data.merkleRoot)) { + merkleRoot = BufferUtil.reverse(new Buffer(data.merkleRoot, 'hex')); + } + var info = { + hash: data.hash, + version: data.version, + prevHash: prevHash, + merkleRoot: merkleRoot, + time: data.time, + timestamp: data.time, + bits: data.bits, + nonce: data.nonce + }; + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromObject = function fromObject(obj) { + var info = BlockHeader._fromObject(obj); + return new BlockHeader(info); +}; + +/** + * @param {Binary} - Raw block binary data or buffer + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromRawBlock = function fromRawBlock(data) { + if (!BufferUtil.isBuffer(data)) { + data = new Buffer(data, 'binary'); + } + var br = BufferReader(data); + br.pos = BlockHeader.Constants.START_OF_HEADER; + var info = BlockHeader._fromBufferReader(br); + return new BlockHeader(info); +}; + +/** + * @param {Buffer} - A buffer of the block header + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromBuffer = function fromBuffer(buf) { + var info = BlockHeader._fromBufferReader(BufferReader(buf)); + return new BlockHeader(info); +}; + +/** + * @param {string} - A hex encoded buffer of the block header + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromString = function fromString(str) { + var buf = new Buffer(str, 'hex'); + return BlockHeader.fromBuffer(buf); +}; + +/** + * @param {BufferReader} - A BufferReader of the block header + * @returns {Object} - An object representing block header data + * @private + */ +BlockHeader._fromBufferReader = function _fromBufferReader(br) { + var info = {}; + info.version = br.readInt32LE(); + info.prevHash = br.read(32); + info.merkleRoot = br.read(32); + info.time = br.readUInt32LE(); + info.bits = br.readUInt32LE(); + info.nonce = br.readUInt32LE(); + return info; +}; + +/** + * @param {BufferReader} - A BufferReader of the block header + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromBufferReader = function fromBufferReader(br) { + var info = BlockHeader._fromBufferReader(br); + return new BlockHeader(info); +}; + +/** + * @returns {Object} - A plain object of the BlockHeader + */ +BlockHeader.prototype.toObject = BlockHeader.prototype.toJSON = function toObject() { + return { + hash: this.hash, + version: this.version, + prevHash: BufferUtil.reverse(this.prevHash).toString('hex'), + merkleRoot: BufferUtil.reverse(this.merkleRoot).toString('hex'), + time: this.time, + bits: this.bits, + nonce: this.nonce + }; +}; + +/** + * @returns {Buffer} - A Buffer of the BlockHeader + */ +BlockHeader.prototype.toBuffer = function toBuffer() { + return this.toBufferWriter().concat(); +}; + +/** + * @returns {string} - A hex encoded string of the BlockHeader + */ +BlockHeader.prototype.toString = function toString() { + return this.toBuffer().toString('hex'); +}; + +/** + * @param {BufferWriter} - An existing instance BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the BlockHeader + */ +BlockHeader.prototype.toBufferWriter = function toBufferWriter(bw) { + if (!bw) { + bw = new BufferWriter(); + } + bw.writeInt32LE(this.version); + bw.write(this.prevHash); + bw.write(this.merkleRoot); + bw.writeUInt32LE(this.time); + bw.writeUInt32LE(this.bits); + bw.writeUInt32LE(this.nonce); + return bw; +}; + +/** + * Returns the target difficulty for this block + * @param {Number} bits + * @returns {BN} An instance of BN with the decoded difficulty bits + */ +BlockHeader.prototype.getTargetDifficulty = function getTargetDifficulty(bits) { + bits = bits || this.bits; + + var target = new BN(bits & 0xffffff); + var mov = 8 * ((bits >>> 24) - 3); + while (mov-- > 0) { + target = target.mul(new BN(2)); + } + return target; +}; + +/** + * @link https://en.bitcoin.it/wiki/Difficulty + * @return {Number} + */ +BlockHeader.prototype.getDifficulty = function getDifficulty() { + var difficulty1TargetBN = this.getTargetDifficulty(GENESIS_BITS).mul(new BN(Math.pow(10, 8))); + var currentTargetBN = this.getTargetDifficulty(); + + var difficultyString = difficulty1TargetBN.div(currentTargetBN).toString(10); + var decimalPos = difficultyString.length - 8; + difficultyString = difficultyString.slice(0, decimalPos) + '.' + difficultyString.slice(decimalPos); + + return parseFloat(difficultyString); +}; + +/** + * @returns {Buffer} - The little endian hash buffer of the header + */ +BlockHeader.prototype._getHash = function hash() { + var buf = this.toBuffer(); + return Hash.sha256sha256(buf); +}; + +var idProperty = { + configurable: false, + enumerable: true, + /** + * @returns {string} - The big endian hash buffer of the header + */ + get: function() { + if (!this._id) { + this._id = BufferReader(this._getHash()).readReverse().toString('hex'); + } + return this._id; + }, + set: _.noop +}; +Object.defineProperty(BlockHeader.prototype, 'id', idProperty); +Object.defineProperty(BlockHeader.prototype, 'hash', idProperty); + +/** + * @returns {Boolean} - If timestamp is not too far in the future + */ +BlockHeader.prototype.validTimestamp = function validTimestamp() { + var currentTime = Math.round(new Date().getTime() / 1000); + if (this.time > currentTime + BlockHeader.Constants.MAX_TIME_OFFSET) { + return false; + } + return true; +}; + +/** + * @returns {Boolean} - If the proof-of-work hash satisfies the target difficulty + */ +BlockHeader.prototype.validProofOfWork = function validProofOfWork() { + var pow = new BN(this.id, 'hex'); + var target = this.getTargetDifficulty(); + + if (pow.cmp(target) > 0) { + return false; + } + return true; +}; + +/** + * @returns {string} - A string formatted for the console + */ +BlockHeader.prototype.inspect = function inspect() { + return ''; +}; + +BlockHeader.Constants = { + START_OF_HEADER: 8, // Start buffer position in raw block data + MAX_TIME_OFFSET: 2 * 60 * 60, // The max a timestamp can be in the future + LARGEST_HASH: new BN('10000000000000000000000000000000000000000000000000000000000000000', 'hex') +}; + +module.exports = BlockHeader; + +}).call(this,require("buffer").Buffer) +},{"../crypto/bn":6,"../crypto/hash":8,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"buffer":47,"lodash":319}],4:[function(require,module,exports){ +module.exports = require('./block'); + +module.exports.BlockHeader = require('./blockheader'); +module.exports.MerkleBlock = require('./merkleblock'); + +},{"./block":2,"./blockheader":3,"./merkleblock":5}],5:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var BlockHeader = require('./blockheader'); +var BufferUtil = require('../util/buffer'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var JSUtil = require('../util/js'); +var Transaction = require('../transaction'); +var errors = require('../errors'); +var $ = require('../util/preconditions'); + +/** + * Instantiate a MerkleBlock from a Buffer, JSON object, or Object with + * the properties of the Block + * + * @param {*} - A Buffer, JSON string, or Object representing a MerkleBlock + * @returns {MerkleBlock} + * @constructor + */ +function MerkleBlock(arg) { + /* jshint maxstatements: 18 */ + + if (!(this instanceof MerkleBlock)) { + return new MerkleBlock(arg); + } + + var info = {}; + if (BufferUtil.isBuffer(arg)) { + info = MerkleBlock._fromBufferReader(BufferReader(arg)); + } else if (_.isObject(arg)) { + var header; + if(arg.header instanceof BlockHeader) { + header = arg.header; + } else { + header = BlockHeader.fromObject(arg.header); + } + info = { + /** + * @name MerkleBlock#header + * @type {BlockHeader} + */ + header: header, + /** + * @name MerkleBlock#numTransactions + * @type {Number} + */ + numTransactions: arg.numTransactions, + /** + * @name MerkleBlock#hashes + * @type {String[]} + */ + hashes: arg.hashes, + /** + * @name MerkleBlock#flags + * @type {Number[]} + */ + flags: arg.flags + }; + } else { + throw new TypeError('Unrecognized argument for MerkleBlock'); + } + _.extend(this,info); + this._flagBitsUsed = 0; + this._hashesUsed = 0; + + return this; +} + +/** + * @param {Buffer} - MerkleBlock data in a Buffer object + * @returns {MerkleBlock} - A MerkleBlock object + */ +MerkleBlock.fromBuffer = function fromBuffer(buf) { + return MerkleBlock.fromBufferReader(BufferReader(buf)); +}; + +/** + * @param {BufferReader} - MerkleBlock data in a BufferReader object + * @returns {MerkleBlock} - A MerkleBlock object + */ +MerkleBlock.fromBufferReader = function fromBufferReader(br) { + return new MerkleBlock(MerkleBlock._fromBufferReader(br)); +}; + +/** + * @returns {Buffer} - A buffer of the block + */ +MerkleBlock.prototype.toBuffer = function toBuffer() { + return this.toBufferWriter().concat(); +}; + +/** + * @param {BufferWriter} - An existing instance of BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the MerkleBlock + */ +MerkleBlock.prototype.toBufferWriter = function toBufferWriter(bw) { + if (!bw) { + bw = new BufferWriter(); + } + bw.write(this.header.toBuffer()); + bw.writeUInt32LE(this.numTransactions); + bw.writeVarintNum(this.hashes.length); + for (var i = 0; i < this.hashes.length; i++) { + bw.write(new Buffer(this.hashes[i], 'hex')); + } + bw.writeVarintNum(this.flags.length); + for (i = 0; i < this.flags.length; i++) { + bw.writeUInt8(this.flags[i]); + } + return bw; +}; + +/** + * @returns {Object} - A plain object with the MerkleBlock properties + */ +MerkleBlock.prototype.toObject = MerkleBlock.prototype.toJSON = function toObject() { + return { + header: this.header.toObject(), + numTransactions: this.numTransactions, + hashes: this.hashes, + flags: this.flags + }; +}; + +/** + * Verify that the MerkleBlock is valid + * @returns {Boolean} - True/False whether this MerkleBlock is Valid + */ +MerkleBlock.prototype.validMerkleTree = function validMerkleTree() { + $.checkState(_.isArray(this.flags), 'MerkleBlock flags is not an array'); + $.checkState(_.isArray(this.hashes), 'MerkleBlock hashes is not an array'); + + // Can't have more hashes than numTransactions + if(this.hashes.length > this.numTransactions) { + return false; + } + + // Can't have more flag bits than num hashes + if(this.flags.length * 8 < this.hashes.length) { + return false; + } + + var height = this._calcTreeHeight(); + var opts = { hashesUsed: 0, flagBitsUsed: 0 }; + var root = this._traverseMerkleTree(height, 0, opts); + if(opts.hashesUsed !== this.hashes.length) { + return false; + } + return BufferUtil.equals(root, this.header.merkleRoot); +}; + +/** + * Return a list of all the txs hash that match the filter + * @returns {Array} - txs hash that match the filter + */ +MerkleBlock.prototype.filterdTxsHash = function filterdTxsHash() { + $.checkState(_.isArray(this.flags), 'MerkleBlock flags is not an array'); + $.checkState(_.isArray(this.hashes), 'MerkleBlock hashes is not an array'); + + // Can't have more hashes than numTransactions + if(this.hashes.length > this.numTransactions) { + throw new errors.MerkleBlock.InvalidMerkleTree(); + } + + // Can't have more flag bits than num hashes + if(this.flags.length * 8 < this.hashes.length) { + throw new errors.MerkleBlock.InvalidMerkleTree(); + } + + // If there is only one hash the filter do not match any txs in the block + if(this.hashes.length === 1) { + return []; + }; + + var height = this._calcTreeHeight(); + var opts = { hashesUsed: 0, flagBitsUsed: 0 }; + var txs = this._traverseMerkleTree(height, 0, opts, true); + if(opts.hashesUsed !== this.hashes.length) { + throw new errors.MerkleBlock.InvalidMerkleTree(); + } + return txs; +}; + +/** + * Traverse a the tree in this MerkleBlock, validating it along the way + * Modeled after Bitcoin Core merkleblock.cpp TraverseAndExtract() + * @param {Number} - depth - Current height + * @param {Number} - pos - Current position in the tree + * @param {Object} - opts - Object with values that need to be mutated throughout the traversal + * @param {Boolean} - checkForTxs - if true return opts.txs else return the Merkle Hash + * @param {Number} - opts.flagBitsUsed - Number of flag bits used, should start at 0 + * @param {Number} - opts.hashesUsed - Number of hashes used, should start at 0 + * @param {Array} - opts.txs - Will finish populated by transactions found during traversal that match the filter + * @returns {Buffer|null} - Buffer containing the Merkle Hash for that height + * @returns {Array} - transactions found during traversal that match the filter + * @private + */ +MerkleBlock.prototype._traverseMerkleTree = function traverseMerkleTree(depth, pos, opts, checkForTxs) { + /* jshint maxcomplexity: 12*/ + /* jshint maxstatements: 20 */ + + opts = opts || {}; + opts.txs = opts.txs || []; + opts.flagBitsUsed = opts.flagBitsUsed || 0; + opts.hashesUsed = opts.hashesUsed || 0; + var checkForTxs = checkForTxs || false; + + if(opts.flagBitsUsed > this.flags.length * 8) { + return null; + } + var isParentOfMatch = (this.flags[opts.flagBitsUsed >> 3] >>> (opts.flagBitsUsed++ & 7)) & 1; + if(depth === 0 || !isParentOfMatch) { + if(opts.hashesUsed >= this.hashes.length) { + return null; + } + var hash = this.hashes[opts.hashesUsed++]; + if(depth === 0 && isParentOfMatch) { + opts.txs.push(hash); + } + return new Buffer(hash, 'hex'); + } else { + var left = this._traverseMerkleTree(depth-1, pos*2, opts); + var right = left; + if(pos*2+1 < this._calcTreeWidth(depth-1)) { + right = this._traverseMerkleTree(depth-1, pos*2+1, opts); + } + if (checkForTxs){ + return opts.txs; + } else { + return Hash.sha256sha256(new Buffer.concat([left, right])); + }; + } +}; + +/** Calculates the width of a merkle tree at a given height. + * Modeled after Bitcoin Core merkleblock.h CalcTreeWidth() + * @param {Number} - Height at which we want the tree width + * @returns {Number} - Width of the tree at a given height + * @private + */ +MerkleBlock.prototype._calcTreeWidth = function calcTreeWidth(height) { + return (this.numTransactions + (1 << height) - 1) >> height; +}; + +/** Calculates the height of the merkle tree in this MerkleBlock + * @param {Number} - Height at which we want the tree width + * @returns {Number} - Height of the merkle tree in this MerkleBlock + * @private + */ +MerkleBlock.prototype._calcTreeHeight = function calcTreeHeight() { + var height = 0; + while (this._calcTreeWidth(height) > 1) { + height++; + } + return height; +}; + +/** + * @param {Transaction|String} - Transaction or Transaction ID Hash + * @returns {Boolean} - return true/false if this MerkleBlock has the TX or not + * @private + */ +MerkleBlock.prototype.hasTransaction = function hasTransaction(tx) { + $.checkArgument(!_.isUndefined(tx), 'tx cannot be undefined'); + $.checkArgument(tx instanceof Transaction || typeof tx === 'string', + 'Invalid tx given, tx must be a "string" or "Transaction"'); + + var hash = tx; + if(tx instanceof Transaction) { + // We need to reverse the id hash for the lookup + hash = BufferUtil.reverse(new Buffer(tx.id, 'hex')).toString('hex'); + } + + var txs = []; + var height = this._calcTreeHeight(); + this._traverseMerkleTree(height, 0, { txs: txs }); + return txs.indexOf(hash) !== -1; +}; + +/** + * @param {Buffer} - MerkleBlock data + * @returns {Object} - An Object representing merkleblock data + * @private + */ +MerkleBlock._fromBufferReader = function _fromBufferReader(br) { + $.checkState(!br.finished(), 'No merkleblock data received'); + var info = {}; + info.header = BlockHeader.fromBufferReader(br); + info.numTransactions = br.readUInt32LE(); + var numHashes = br.readVarintNum(); + info.hashes = []; + for (var i = 0; i < numHashes; i++) { + info.hashes.push(br.read(32).toString('hex')); + } + var numFlags = br.readVarintNum(); + info.flags = []; + for (i = 0; i < numFlags; i++) { + info.flags.push(br.readUInt8()); + } + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {Block} - An instance of block + */ +MerkleBlock.fromObject = function fromObject(obj) { + return new MerkleBlock(obj); +}; + +module.exports = MerkleBlock; + +}).call(this,require("buffer").Buffer) +},{"../crypto/hash":8,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../errors":17,"../transaction":28,"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"./blockheader":3,"buffer":47,"lodash":319}],6:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var BN = require('bn.js'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); + +var reversebuf = function(buf) { + var buf2 = new Buffer(buf.length); + for (var i = 0; i < buf.length; i++) { + buf2[i] = buf[buf.length - 1 - i]; + } + return buf2; +}; + +BN.Zero = new BN(0); +BN.One = new BN(1); +BN.Minus1 = new BN(-1); + +BN.fromNumber = function(n) { + $.checkArgument(_.isNumber(n)); + return new BN(n); +}; + +BN.fromString = function(str, base) { + $.checkArgument(_.isString(str)); + return new BN(str, base); +}; + +BN.fromBuffer = function(buf, opts) { + if (typeof opts !== 'undefined' && opts.endian === 'little') { + buf = reversebuf(buf); + } + var hex = buf.toString('hex'); + var bn = new BN(hex, 16); + return bn; +}; + +/** + * Instantiate a BigNumber from a "signed magnitude buffer" + * (a buffer where the most significant bit represents the sign (0 = positive, -1 = negative)) + */ +BN.fromSM = function(buf, opts) { + var ret; + if (buf.length === 0) { + return BN.fromBuffer(new Buffer([0])); + } + + var endian = 'big'; + if (opts) { + endian = opts.endian; + } + if (endian === 'little') { + buf = reversebuf(buf); + } + + if (buf[0] & 0x80) { + buf[0] = buf[0] & 0x7f; + ret = BN.fromBuffer(buf); + ret.neg().copy(ret); + } else { + ret = BN.fromBuffer(buf); + } + return ret; +}; + + +BN.prototype.toNumber = function() { + return parseInt(this.toString(10), 10); +}; + +BN.prototype.toBuffer = function(opts) { + var buf, hex; + if (opts && opts.size) { + hex = this.toString(16, 2); + var natlen = hex.length / 2; + buf = new Buffer(hex, 'hex'); + + if (natlen === opts.size) { + buf = buf; + } else if (natlen > opts.size) { + buf = BN.trim(buf, natlen); + } else if (natlen < opts.size) { + buf = BN.pad(buf, natlen, opts.size); + } + } else { + hex = this.toString(16, 2); + buf = new Buffer(hex, 'hex'); + } + + if (typeof opts !== 'undefined' && opts.endian === 'little') { + buf = reversebuf(buf); + } + + return buf; +}; + +BN.prototype.toSMBigEndian = function() { + var buf; + if (this.cmp(BN.Zero) === -1) { + buf = this.neg().toBuffer(); + if (buf[0] & 0x80) { + buf = Buffer.concat([new Buffer([0x80]), buf]); + } else { + buf[0] = buf[0] | 0x80; + } + } else { + buf = this.toBuffer(); + if (buf[0] & 0x80) { + buf = Buffer.concat([new Buffer([0x00]), buf]); + } + } + + if (buf.length === 1 & buf[0] === 0) { + buf = new Buffer([]); + } + return buf; +}; + +BN.prototype.toSM = function(opts) { + var endian = opts ? opts.endian : 'big'; + var buf = this.toSMBigEndian(); + + if (endian === 'little') { + buf = reversebuf(buf); + } + return buf; +}; + +/** + * Create a BN from a "ScriptNum": + * This is analogous to the constructor for CScriptNum in bitcoind. Many ops in + * bitcoind's script interpreter use CScriptNum, which is not really a proper + * bignum. Instead, an error is thrown if trying to input a number bigger than + * 4 bytes. We copy that behavior here. A third argument, `size`, is provided to + * extend the hard limit of 4 bytes, as some usages require more than 4 bytes. + */ +BN.fromScriptNumBuffer = function(buf, fRequireMinimal, size) { + var nMaxNumSize = size || 4; + $.checkArgument(buf.length <= nMaxNumSize, new Error('script number overflow')); + if (fRequireMinimal && buf.length > 0) { + // Check that the number is encoded with the minimum possible + // number of bytes. + // + // If the most-significant-byte - excluding the sign bit - is zero + // then we're not minimal. Note how this test also rejects the + // negative-zero encoding, 0x80. + if ((buf[buf.length - 1] & 0x7f) === 0) { + // One exception: if there's more than one byte and the most + // significant bit of the second-most-significant-byte is set + // it would conflict with the sign bit. An example of this case + // is +-255, which encode to 0xff00 and 0xff80 respectively. + // (big-endian). + if (buf.length <= 1 || (buf[buf.length - 2] & 0x80) === 0) { + throw new Error('non-minimally encoded script number'); + } + } + } + return BN.fromSM(buf, { + endian: 'little' + }); +}; + +/** + * The corollary to the above, with the notable exception that we do not throw + * an error if the output is larger than four bytes. (Which can happen if + * performing a numerical operation that results in an overflow to more than 4 + * bytes). + */ +BN.prototype.toScriptNumBuffer = function() { + return this.toSM({ + endian: 'little' + }); +}; + +BN.prototype.gt = function(b) { + return this.cmp(b) > 0; +}; + +BN.prototype.gte = function(b) { + return this.cmp(b) >= 0; +}; + +BN.prototype.lt = function(b) { + return this.cmp(b) < 0; +}; + +BN.trim = function(buf, natlen) { + return buf.slice(natlen - buf.length, buf.length); +}; + +BN.pad = function(buf, natlen, size) { + var rbuf = new Buffer(size); + for (var i = 0; i < buf.length; i++) { + rbuf[rbuf.length - 1 - i] = buf[buf.length - 1 - i]; + } + for (i = 0; i < size - natlen; i++) { + rbuf[i] = 0; + } + return rbuf; +}; + +module.exports = BN; + +}).call(this,require("buffer").Buffer) +},{"../util/preconditions":44,"bn.js":280,"buffer":47,"lodash":319}],7:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var BN = require('./bn'); +var Point = require('./point'); +var Signature = require('./signature'); +var PublicKey = require('../publickey'); +var Random = require('./random'); +var Hash = require('./hash'); +var BufferUtil = require('../util/buffer'); +var _ = require('lodash'); +var $ = require('../util/preconditions'); + +var ECDSA = function ECDSA(obj) { + if (!(this instanceof ECDSA)) { + return new ECDSA(obj); + } + if (obj) { + this.set(obj); + } +}; + +/* jshint maxcomplexity: 9 */ +ECDSA.prototype.set = function(obj) { + this.hashbuf = obj.hashbuf || this.hashbuf; + this.endian = obj.endian || this.endian; //the endianness of hashbuf + this.privkey = obj.privkey || this.privkey; + this.pubkey = obj.pubkey || (this.privkey ? this.privkey.publicKey : this.pubkey); + this.sig = obj.sig || this.sig; + this.k = obj.k || this.k; + this.verified = obj.verified || this.verified; + return this; +}; + +ECDSA.prototype.privkey2pubkey = function() { + this.pubkey = this.privkey.toPublicKey(); +}; + +ECDSA.prototype.calci = function() { + for (var i = 0; i < 4; i++) { + this.sig.i = i; + var Qprime; + try { + Qprime = this.toPublicKey(); + } catch (e) { + console.error(e); + continue; + } + + if (Qprime.point.eq(this.pubkey.point)) { + this.sig.compressed = this.pubkey.compressed; + return this; + } + } + + this.sig.i = undefined; + throw new Error('Unable to find valid recovery factor'); +}; + +ECDSA.fromString = function(str) { + var obj = JSON.parse(str); + return new ECDSA(obj); +}; + +ECDSA.prototype.randomK = function() { + var N = Point.getN(); + var k; + do { + k = BN.fromBuffer(Random.getRandomBuffer(32)); + } while (!(k.lt(N) && k.gt(BN.Zero))); + this.k = k; + return this; +}; + + +// https://tools.ietf.org/html/rfc6979#section-3.2 +ECDSA.prototype.deterministicK = function(badrs) { + /* jshint maxstatements: 25 */ + // if r or s were invalid when this function was used in signing, + // we do not want to actually compute r, s here for efficiency, so, + // we can increment badrs. explained at end of RFC 6979 section 3.2 + if (_.isUndefined(badrs)) { + badrs = 0; + } + var v = new Buffer(32); + v.fill(0x01); + var k = new Buffer(32); + k.fill(0x00); + var x = this.privkey.bn.toBuffer({ + size: 32 + }); + var hashbuf = this.endian === 'little' ? BufferUtil.reverse(this.hashbuf) : this.hashbuf + k = Hash.sha256hmac(Buffer.concat([v, new Buffer([0x00]), x, hashbuf]), k); + v = Hash.sha256hmac(v, k); + k = Hash.sha256hmac(Buffer.concat([v, new Buffer([0x01]), x, hashbuf]), k); + v = Hash.sha256hmac(v, k); + v = Hash.sha256hmac(v, k); + var T = BN.fromBuffer(v); + var N = Point.getN(); + + // also explained in 3.2, we must ensure T is in the proper range (0, N) + for (var i = 0; i < badrs || !(T.lt(N) && T.gt(BN.Zero)); i++) { + k = Hash.sha256hmac(Buffer.concat([v, new Buffer([0x00])]), k); + v = Hash.sha256hmac(v, k); + v = Hash.sha256hmac(v, k); + T = BN.fromBuffer(v); + } + + this.k = T; + return this; +}; + +// Information about public key recovery: +// https://bitcointalk.org/index.php?topic=6430.0 +// http://stackoverflow.com/questions/19665491/how-do-i-get-an-ecdsa-public-key-from-just-a-bitcoin-signature-sec1-4-1-6-k +ECDSA.prototype.toPublicKey = function() { + /* jshint maxstatements: 25 */ + var i = this.sig.i; + $.checkArgument(i === 0 || i === 1 || i === 2 || i === 3, new Error('i must be equal to 0, 1, 2, or 3')); + + var e = BN.fromBuffer(this.hashbuf); + var r = this.sig.r; + var s = this.sig.s; + + // A set LSB signifies that the y-coordinate is odd + var isYOdd = i & 1; + + // The more significant bit specifies whether we should use the + // first or second candidate key. + var isSecondKey = i >> 1; + + var n = Point.getN(); + var G = Point.getG(); + + // 1.1 Let x = r + jn + var x = isSecondKey ? r.add(n) : r; + var R = Point.fromX(isYOdd, x); + + // 1.4 Check that nR is at infinity + var nR = R.mul(n); + + if (!nR.isInfinity()) { + throw new Error('nR is not a valid curve point'); + } + + // Compute -e from e + var eNeg = e.neg().umod(n); + + // 1.6.1 Compute Q = r^-1 (sR - eG) + // Q = r^-1 (sR + -eG) + var rInv = r.invm(n); + + //var Q = R.multiplyTwo(s, G, eNeg).mul(rInv); + var Q = R.mul(s).add(G.mul(eNeg)).mul(rInv); + + var pubkey = PublicKey.fromPoint(Q, this.sig.compressed); + + return pubkey; +}; + +ECDSA.prototype.sigError = function() { + /* jshint maxstatements: 25 */ + if (!BufferUtil.isBuffer(this.hashbuf) || this.hashbuf.length !== 32) { + return 'hashbuf must be a 32 byte buffer'; + } + + var r = this.sig.r; + var s = this.sig.s; + if (!(r.gt(BN.Zero) && r.lt(Point.getN())) || !(s.gt(BN.Zero) && s.lt(Point.getN()))) { + return 'r and s not in range'; + } + + var e = BN.fromBuffer(this.hashbuf, this.endian ? { + endian: this.endian + } : undefined); + var n = Point.getN(); + var sinv = s.invm(n); + var u1 = sinv.mul(e).umod(n); + var u2 = sinv.mul(r).umod(n); + + var p = Point.getG().mulAdd(u1, this.pubkey.point, u2); + if (p.isInfinity()) { + return 'p is infinity'; + } + + if (p.getX().umod(n).cmp(r) !== 0) { + return 'Invalid signature'; + } else { + return false; + } +}; + +ECDSA.toLowS = function(s) { + //enforce low s + //see BIP 62, "low S values in signatures" + if (s.gt(BN.fromBuffer(new Buffer('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex')))) { + s = Point.getN().sub(s); + } + return s; +}; + +ECDSA.prototype._findSignature = function(d, e) { + var N = Point.getN(); + var G = Point.getG(); + // try different values of k until r, s are valid + var badrs = 0; + var k, Q, r, s; + do { + if (!this.k || badrs > 0) { + this.deterministicK(badrs); + } + badrs++; + k = this.k; + Q = G.mul(k); + r = Q.x.umod(N); + s = k.invm(N).mul(e.add(d.mul(r))).umod(N); + } while (r.cmp(BN.Zero) <= 0 || s.cmp(BN.Zero) <= 0); + + s = ECDSA.toLowS(s); + return { + s: s, + r: r + }; + +}; + +ECDSA.prototype.sign = function() { + var hashbuf = this.hashbuf; + var privkey = this.privkey; + var d = privkey.bn; + + $.checkState(hashbuf && privkey && d, new Error('invalid parameters')); + $.checkState(BufferUtil.isBuffer(hashbuf) && hashbuf.length === 32, new Error('hashbuf must be a 32 byte buffer')); + + var e = BN.fromBuffer(hashbuf, this.endian ? { + endian: this.endian + } : undefined); + + var obj = this._findSignature(d, e); + obj.compressed = this.pubkey.compressed; + + this.sig = new Signature(obj); + return this; +}; + +ECDSA.prototype.signRandomK = function() { + this.randomK(); + return this.sign(); +}; + +ECDSA.prototype.toString = function() { + var obj = {}; + if (this.hashbuf) { + obj.hashbuf = this.hashbuf.toString('hex'); + } + if (this.privkey) { + obj.privkey = this.privkey.toString(); + } + if (this.pubkey) { + obj.pubkey = this.pubkey.toString(); + } + if (this.sig) { + obj.sig = this.sig.toString(); + } + if (this.k) { + obj.k = this.k.toString(); + } + return JSON.stringify(obj); +}; + +ECDSA.prototype.verify = function() { + if (!this.sigError()) { + this.verified = true; + } else { + this.verified = false; + } + return this; +}; + +ECDSA.sign = function(hashbuf, privkey, endian) { + return ECDSA().set({ + hashbuf: hashbuf, + endian: endian, + privkey: privkey + }).sign().sig; +}; + +ECDSA.verify = function(hashbuf, sig, pubkey, endian) { + return ECDSA().set({ + hashbuf: hashbuf, + endian: endian, + sig: sig, + pubkey: pubkey + }).verify().verified; +}; + +module.exports = ECDSA; + +}).call(this,require("buffer").Buffer) +},{"../publickey":24,"../util/buffer":42,"../util/preconditions":44,"./bn":6,"./hash":8,"./point":9,"./random":10,"./signature":11,"buffer":47,"lodash":319}],8:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var crypto = require('crypto'); +var BufferUtil = require('../util/buffer'); +var $ = require('../util/preconditions'); + +var Hash = module.exports; + +Hash.sha1 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('sha1').update(buf).digest(); +}; + +Hash.sha1.blocksize = 512; + +Hash.sha256 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('sha256').update(buf).digest(); +}; + +Hash.sha256.blocksize = 512; + +Hash.sha256sha256 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return Hash.sha256(Hash.sha256(buf)); +}; + +Hash.ripemd160 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('ripemd160').update(buf).digest(); +}; + +Hash.sha256ripemd160 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return Hash.ripemd160(Hash.sha256(buf)); +}; + +Hash.sha512 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('sha512').update(buf).digest(); +}; + +Hash.sha512.blocksize = 1024; + +Hash.hmac = function(hashf, data, key) { + //http://en.wikipedia.org/wiki/Hash-based_message_authentication_code + //http://tools.ietf.org/html/rfc4868#section-2 + $.checkArgument(BufferUtil.isBuffer(data)); + $.checkArgument(BufferUtil.isBuffer(key)); + $.checkArgument(hashf.blocksize); + + var blocksize = hashf.blocksize / 8; + + if (key.length > blocksize) { + key = hashf(key); + } else if (key < blocksize) { + var fill = new Buffer(blocksize); + fill.fill(0); + key.copy(fill); + key = fill; + } + + var o_key = new Buffer(blocksize); + o_key.fill(0x5c); + + var i_key = new Buffer(blocksize); + i_key.fill(0x36); + + var o_key_pad = new Buffer(blocksize); + var i_key_pad = new Buffer(blocksize); + for (var i = 0; i < blocksize; i++) { + o_key_pad[i] = o_key[i] ^ key[i]; + i_key_pad[i] = i_key[i] ^ key[i]; + } + + return hashf(Buffer.concat([o_key_pad, hashf(Buffer.concat([i_key_pad, data]))])); +}; + +Hash.sha256hmac = function(data, key) { + return Hash.hmac(Hash.sha256, data, key); +}; + +Hash.sha512hmac = function(data, key) { + return Hash.hmac(Hash.sha512, data, key); +}; + +}).call(this,require("buffer").Buffer) +},{"../util/buffer":42,"../util/preconditions":44,"buffer":47,"crypto":51}],9:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var BN = require('./bn'); +var BufferUtil = require('../util/buffer'); + +var EC = require('elliptic').ec; +var ec = new EC('secp256k1'); +var ecPoint = ec.curve.point.bind(ec.curve); +var ecPointFromX = ec.curve.pointFromX.bind(ec.curve); + +/** + * + * Instantiate a valid secp256k1 Point from the X and Y coordinates. + * + * @param {BN|String} x - The X coordinate + * @param {BN|String} y - The Y coordinate + * @link https://github.com/indutny/elliptic + * @augments elliptic.curve.point + * @throws {Error} A validation error if exists + * @returns {Point} An instance of Point + * @constructor + */ +var Point = function Point(x, y, isRed) { + try { + var point = ecPoint(x, y, isRed); + } catch (e) { + throw new Error('Invalid Point'); + } + point.validate(); + return point; +}; + +Point.prototype = Object.getPrototypeOf(ec.curve.point()); + +/** + * + * Instantiate a valid secp256k1 Point from only the X coordinate + * + * @param {boolean} odd - If the Y coordinate is odd + * @param {BN|String} x - The X coordinate + * @throws {Error} A validation error if exists + * @returns {Point} An instance of Point + */ +Point.fromX = function fromX(odd, x){ + try { + var point = ecPointFromX(x, odd); + } catch (e) { + throw new Error('Invalid X'); + } + point.validate(); + return point; +}; + +/** + * + * Will return a secp256k1 ECDSA base point. + * + * @link https://en.bitcoin.it/wiki/Secp256k1 + * @returns {Point} An instance of the base point. + */ +Point.getG = function getG() { + return ec.curve.g; +}; + +/** + * + * Will return the max of range of valid private keys as governed by the secp256k1 ECDSA standard. + * + * @link https://en.bitcoin.it/wiki/Private_key#Range_of_valid_ECDSA_private_keys + * @returns {BN} A BN instance of the number of points on the curve + */ +Point.getN = function getN() { + return new BN(ec.curve.n.toArray()); +}; + +Point.prototype._getX = Point.prototype.getX; + +/** + * + * Will return the X coordinate of the Point + * + * @returns {BN} A BN instance of the X coordinate + */ +Point.prototype.getX = function getX() { + return new BN(this._getX().toArray()); +}; + +Point.prototype._getY = Point.prototype.getY; + +/** + * + * Will return the Y coordinate of the Point + * + * @returns {BN} A BN instance of the Y coordinate + */ +Point.prototype.getY = function getY() { + return new BN(this._getY().toArray()); +}; + +/** + * + * Will determine if the point is valid + * + * @link https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf + * @param {Point} An instance of Point + * @throws {Error} A validation error if exists + * @returns {Point} An instance of the same Point + */ +Point.prototype.validate = function validate() { + + if (this.isInfinity()){ + throw new Error('Point cannot be equal to Infinity'); + } + + var p2; + try { + p2 = ecPointFromX(this.getX(), this.getY().isOdd()); + } catch (e) { + throw new Error('Point does not lie on the curve'); + } + + if (p2.y.cmp(this.y) !== 0) { + throw new Error('Invalid y value for curve.'); + } + + + //todo: needs test case + if (!(this.mul(Point.getN()).isInfinity())) { + throw new Error('Point times N must be infinity'); + } + + return this; + +}; + +Point.pointToCompressed = function pointToCompressed(point) { + var xbuf = point.getX().toBuffer({size: 32}); + var ybuf = point.getY().toBuffer({size: 32}); + + var prefix; + var odd = ybuf[ybuf.length - 1] % 2; + if (odd) { + prefix = new Buffer([0x03]); + } else { + prefix = new Buffer([0x02]); + } + return BufferUtil.concat([prefix, xbuf]); +}; + +module.exports = Point; + +}).call(this,require("buffer").Buffer) +},{"../util/buffer":42,"./bn":6,"buffer":47,"elliptic":285}],10:[function(require,module,exports){ +(function (process,Buffer){ +'use strict'; + +function Random() { +} + +/* secure random bytes that sometimes throws an error due to lack of entropy */ +Random.getRandomBuffer = function(size) { + if (process.browser) + return Random.getRandomBufferBrowser(size); + else + return Random.getRandomBufferNode(size); +}; + +Random.getRandomBufferNode = function(size) { + var crypto = require('crypto'); + return crypto.randomBytes(size); +}; + +Random.getRandomBufferBrowser = function(size) { + if (!window.crypto && !window.msCrypto) + throw new Error('window.crypto not available'); + + if (window.crypto && window.crypto.getRandomValues) + var crypto = window.crypto; + else if (window.msCrypto && window.msCrypto.getRandomValues) //internet explorer + var crypto = window.msCrypto; + else + throw new Error('window.crypto.getRandomValues not available'); + + var bbuf = new Uint8Array(size); + crypto.getRandomValues(bbuf); + var buf = new Buffer(bbuf); + + return buf; +}; + +/* insecure random bytes, but it never fails */ +Random.getPseudoRandomBuffer = function(size) { + var b32 = 0x100000000; + var b = new Buffer(size); + var r; + + for (var i = 0; i <= size; i++) { + var j = Math.floor(i / 4); + var k = i - j * 4; + if (k === 0) { + r = Math.random() * b32; + b[i] = r & 0xff; + } else { + b[i] = (r = r >>> 8) & 0xff; + } + } + + return b; +}; + +module.exports = Random; + +}).call(this,require('_process'),require("buffer").Buffer) +},{"_process":247,"buffer":47,"crypto":51}],11:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var BN = require('./bn'); +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); + +var Signature = function Signature(r, s) { + if (!(this instanceof Signature)) { + return new Signature(r, s); + } + if (r instanceof BN) { + this.set({ + r: r, + s: s + }); + } else if (r) { + var obj = r; + this.set(obj); + } +}; + +/* jshint maxcomplexity: 7 */ +Signature.prototype.set = function(obj) { + this.r = obj.r || this.r || undefined; + this.s = obj.s || this.s || undefined; + + this.i = typeof obj.i !== 'undefined' ? obj.i : this.i; //public key recovery parameter in range [0, 3] + this.compressed = typeof obj.compressed !== 'undefined' ? + obj.compressed : this.compressed; //whether the recovered pubkey is compressed + this.nhashtype = obj.nhashtype || this.nhashtype || undefined; + return this; +}; + +Signature.fromCompact = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf), 'Argument is expected to be a Buffer'); + + var sig = new Signature(); + + var compressed = true; + var i = buf.slice(0, 1)[0] - 27 - 4; + if (i < 0) { + compressed = false; + i = i + 4; + } + + var b2 = buf.slice(1, 33); + var b3 = buf.slice(33, 65); + + $.checkArgument(i === 0 || i === 1 || i === 2 || i === 3, new Error('i must be 0, 1, 2, or 3')); + $.checkArgument(b2.length === 32, new Error('r must be 32 bytes')); + $.checkArgument(b3.length === 32, new Error('s must be 32 bytes')); + + sig.compressed = compressed; + sig.i = i; + sig.r = BN.fromBuffer(b2); + sig.s = BN.fromBuffer(b3); + + return sig; +}; + +Signature.fromDER = Signature.fromBuffer = function(buf, strict) { + var obj = Signature.parseDER(buf, strict); + var sig = new Signature(); + + sig.r = obj.r; + sig.s = obj.s; + + return sig; +}; + +// The format used in a tx +Signature.fromTxFormat = function(buf) { + var nhashtype = buf.readUInt8(buf.length - 1); + var derbuf = buf.slice(0, buf.length - 1); + var sig = new Signature.fromDER(derbuf, false); + sig.nhashtype = nhashtype; + return sig; +}; + +Signature.fromString = function(str) { + var buf = new Buffer(str, 'hex'); + return Signature.fromDER(buf); +}; + + +/** + * In order to mimic the non-strict DER encoding of OpenSSL, set strict = false. + */ +Signature.parseDER = function(buf, strict) { + $.checkArgument(BufferUtil.isBuffer(buf), new Error('DER formatted signature should be a buffer')); + if (_.isUndefined(strict)) { + strict = true; + } + + var header = buf[0]; + $.checkArgument(header === 0x30, new Error('Header byte should be 0x30')); + + var length = buf[1]; + var buflength = buf.slice(2).length; + $.checkArgument(!strict || length === buflength, new Error('Length byte should length of what follows')); + + length = length < buflength ? length : buflength; + + var rheader = buf[2 + 0]; + $.checkArgument(rheader === 0x02, new Error('Integer byte for r should be 0x02')); + + var rlength = buf[2 + 1]; + var rbuf = buf.slice(2 + 2, 2 + 2 + rlength); + var r = BN.fromBuffer(rbuf); + var rneg = buf[2 + 1 + 1] === 0x00 ? true : false; + $.checkArgument(rlength === rbuf.length, new Error('Length of r incorrect')); + + var sheader = buf[2 + 2 + rlength + 0]; + $.checkArgument(sheader === 0x02, new Error('Integer byte for s should be 0x02')); + + var slength = buf[2 + 2 + rlength + 1]; + var sbuf = buf.slice(2 + 2 + rlength + 2, 2 + 2 + rlength + 2 + slength); + var s = BN.fromBuffer(sbuf); + var sneg = buf[2 + 2 + rlength + 2 + 2] === 0x00 ? true : false; + $.checkArgument(slength === sbuf.length, new Error('Length of s incorrect')); + + var sumlength = 2 + 2 + rlength + 2 + slength; + $.checkArgument(length === sumlength - 2, new Error('Length of signature incorrect')); + + var obj = { + header: header, + length: length, + rheader: rheader, + rlength: rlength, + rneg: rneg, + rbuf: rbuf, + r: r, + sheader: sheader, + slength: slength, + sneg: sneg, + sbuf: sbuf, + s: s + }; + + return obj; +}; + + +Signature.prototype.toCompact = function(i, compressed) { + i = typeof i === 'number' ? i : this.i; + compressed = typeof compressed === 'boolean' ? compressed : this.compressed; + + if (!(i === 0 || i === 1 || i === 2 || i === 3)) { + throw new Error('i must be equal to 0, 1, 2, or 3'); + } + + var val = i + 27 + 4; + if (compressed === false) { + val = val - 4; + } + var b1 = new Buffer([val]); + var b2 = this.r.toBuffer({ + size: 32 + }); + var b3 = this.s.toBuffer({ + size: 32 + }); + return Buffer.concat([b1, b2, b3]); +}; + +Signature.prototype.toBuffer = Signature.prototype.toDER = function() { + var rnbuf = this.r.toBuffer(); + var snbuf = this.s.toBuffer(); + + var rneg = rnbuf[0] & 0x80 ? true : false; + var sneg = snbuf[0] & 0x80 ? true : false; + + var rbuf = rneg ? Buffer.concat([new Buffer([0x00]), rnbuf]) : rnbuf; + var sbuf = sneg ? Buffer.concat([new Buffer([0x00]), snbuf]) : snbuf; + + var rlength = rbuf.length; + var slength = sbuf.length; + var length = 2 + rlength + 2 + slength; + var rheader = 0x02; + var sheader = 0x02; + var header = 0x30; + + var der = Buffer.concat([new Buffer([header, length, rheader, rlength]), rbuf, new Buffer([sheader, slength]), sbuf]); + return der; +}; + +Signature.prototype.toString = function() { + var buf = this.toDER(); + return buf.toString('hex'); +}; + +/** + * This function is translated from bitcoind's IsDERSignature and is used in + * the script interpreter. This "DER" format actually includes an extra byte, + * the nhashtype, at the end. It is really the tx format, not DER format. + * + * A canonical signature exists of: [30] [total len] [02] [len R] [R] [02] [len S] [S] [hashtype] + * Where R and S are not negative (their first byte has its highest bit not set), and not + * excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, + * in which case a single 0 byte is necessary and even required). + * + * See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 + */ +Signature.isTxDER = function(buf) { + if (buf.length < 9) { + // Non-canonical signature: too short + return false; + } + if (buf.length > 73) { + // Non-canonical signature: too long + return false; + } + if (buf[0] !== 0x30) { + // Non-canonical signature: wrong type + return false; + } + if (buf[1] !== buf.length - 3) { + // Non-canonical signature: wrong length marker + return false; + } + var nLenR = buf[3]; + if (5 + nLenR >= buf.length) { + // Non-canonical signature: S length misplaced + return false; + } + var nLenS = buf[5 + nLenR]; + if ((nLenR + nLenS + 7) !== buf.length) { + // Non-canonical signature: R+S length mismatch + return false; + } + + var R = buf.slice(4); + if (buf[4 - 2] !== 0x02) { + // Non-canonical signature: R value type mismatch + return false; + } + if (nLenR === 0) { + // Non-canonical signature: R length is zero + return false; + } + if (R[0] & 0x80) { + // Non-canonical signature: R value negative + return false; + } + if (nLenR > 1 && (R[0] === 0x00) && !(R[1] & 0x80)) { + // Non-canonical signature: R value excessively padded + return false; + } + + var S = buf.slice(6 + nLenR); + if (buf[6 + nLenR - 2] !== 0x02) { + // Non-canonical signature: S value type mismatch + return false; + } + if (nLenS === 0) { + // Non-canonical signature: S length is zero + return false; + } + if (S[0] & 0x80) { + // Non-canonical signature: S value negative + return false; + } + if (nLenS > 1 && (S[0] === 0x00) && !(S[1] & 0x80)) { + // Non-canonical signature: S value excessively padded + return false; + } + return true; +}; + +/** + * Compares to bitcoind's IsLowDERSignature + * See also ECDSA signature algorithm which enforces this. + * See also BIP 62, "low S values in signatures" + */ +Signature.prototype.hasLowS = function() { + if (this.s.lt(new BN(1)) || + this.s.gt(new BN('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex'))) { + return false; + } + return true; +}; + +/** + * @returns true if the nhashtype is exactly equal to one of the standard options or combinations thereof. + * Translated from bitcoind's IsDefinedHashtypeSignature + */ +Signature.prototype.hasDefinedHashtype = function() { + if (!JSUtil.isNaturalNumber(this.nhashtype)) { + return false; + } + // accept with or without Signature.SIGHASH_ANYONECANPAY by ignoring the bit + var temp = this.nhashtype & ~Signature.SIGHASH_ANYONECANPAY; + if (temp < Signature.SIGHASH_ALL || temp > Signature.SIGHASH_SINGLE) { + return false; + } + return true; +}; + +Signature.prototype.toTxFormat = function() { + var derbuf = this.toDER(); + var buf = new Buffer(1); + buf.writeUInt8(this.nhashtype, 0); + return Buffer.concat([derbuf, buf]); +}; + +Signature.SIGHASH_ALL = 0x01; +Signature.SIGHASH_NONE = 0x02; +Signature.SIGHASH_SINGLE = 0x03; +Signature.SIGHASH_ANYONECANPAY = 0x80; + +module.exports = Signature; + +}).call(this,require("buffer").Buffer) +},{"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"./bn":6,"buffer":47,"lodash":319}],12:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var bs58 = require('bs58'); +var buffer = require('buffer'); + +var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'.split(''); + +var Base58 = function Base58(obj) { + /* jshint maxcomplexity: 8 */ + if (!(this instanceof Base58)) { + return new Base58(obj); + } + if (Buffer.isBuffer(obj)) { + var buf = obj; + this.fromBuffer(buf); + } else if (typeof obj === 'string') { + var str = obj; + this.fromString(str); + } else if (obj) { + this.set(obj); + } +}; + +Base58.validCharacters = function validCharacters(chars) { + if (buffer.Buffer.isBuffer(chars)) { + chars = chars.toString(); + } + return _.every(_.map(chars, function(char) { return _.includes(ALPHABET, char); })); +}; + +Base58.prototype.set = function(obj) { + this.buf = obj.buf || this.buf || undefined; + return this; +}; + +Base58.encode = function(buf) { + if (!buffer.Buffer.isBuffer(buf)) { + throw new Error('Input should be a buffer'); + } + return bs58.encode(buf); +}; + +Base58.decode = function(str) { + if (typeof str !== 'string') { + throw new Error('Input should be a string'); + } + return new Buffer(bs58.decode(str)); +}; + +Base58.prototype.fromBuffer = function(buf) { + this.buf = buf; + return this; +}; + +Base58.prototype.fromString = function(str) { + var buf = Base58.decode(str); + this.buf = buf; + return this; +}; + +Base58.prototype.toBuffer = function() { + return this.buf; +}; + +Base58.prototype.toString = function() { + return Base58.encode(this.buf); +}; + +module.exports = Base58; + +}).call(this,require("buffer").Buffer) +},{"bs58":281,"buffer":47,"lodash":319}],13:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var Base58 = require('./base58'); +var buffer = require('buffer'); +var sha256sha256 = require('../crypto/hash').sha256sha256; + +var Base58Check = function Base58Check(obj) { + if (!(this instanceof Base58Check)) + return new Base58Check(obj); + if (Buffer.isBuffer(obj)) { + var buf = obj; + this.fromBuffer(buf); + } else if (typeof obj === 'string') { + var str = obj; + this.fromString(str); + } else if (obj) { + this.set(obj); + } +}; + +Base58Check.prototype.set = function(obj) { + this.buf = obj.buf || this.buf || undefined; + return this; +}; + +Base58Check.validChecksum = function validChecksum(data, checksum) { + if (_.isString(data)) { + data = new buffer.Buffer(Base58.decode(data)); + } + if (_.isString(checksum)) { + checksum = new buffer.Buffer(Base58.decode(checksum)); + } + if (!checksum) { + checksum = data.slice(-4); + data = data.slice(0, -4); + } + return Base58Check.checksum(data).toString('hex') === checksum.toString('hex'); +}; + +Base58Check.decode = function(s) { + if (typeof s !== 'string') + throw new Error('Input must be a string'); + + var buf = new Buffer(Base58.decode(s)); + + if (buf.length < 4) + throw new Error("Input string too short"); + + var data = buf.slice(0, -4); + var csum = buf.slice(-4); + + var hash = sha256sha256(data); + var hash4 = hash.slice(0, 4); + + if (csum.toString('hex') !== hash4.toString('hex')) + throw new Error("Checksum mismatch"); + + return data; +}; + +Base58Check.checksum = function(buffer) { + return sha256sha256(buffer).slice(0, 4); +}; + +Base58Check.encode = function(buf) { + if (!Buffer.isBuffer(buf)) + throw new Error('Input must be a buffer'); + var checkedBuf = new Buffer(buf.length + 4); + var hash = Base58Check.checksum(buf); + buf.copy(checkedBuf); + hash.copy(checkedBuf, buf.length); + return Base58.encode(checkedBuf); +}; + +Base58Check.prototype.fromBuffer = function(buf) { + this.buf = buf; + return this; +}; + +Base58Check.prototype.fromString = function(str) { + var buf = Base58Check.decode(str); + this.buf = buf; + return this; +}; + +Base58Check.prototype.toBuffer = function() { + return this.buf; +}; + +Base58Check.prototype.toString = function() { + return Base58Check.encode(this.buf); +}; + +module.exports = Base58Check; + +}).call(this,require("buffer").Buffer) +},{"../crypto/hash":8,"./base58":12,"buffer":47,"lodash":319}],14:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var BufferUtil = require('../util/buffer'); +var BN = require('../crypto/bn'); + +var BufferReader = function BufferReader(buf) { + if (!(this instanceof BufferReader)) { + return new BufferReader(buf); + } + if (_.isUndefined(buf)) { + return; + } + if (Buffer.isBuffer(buf)) { + this.set({ + buf: buf + }); + } else if (_.isString(buf)) { + this.set({ + buf: new Buffer(buf, 'hex'), + }); + } else if (_.isObject(buf)) { + var obj = buf; + this.set(obj); + } else { + throw new TypeError('Unrecognized argument for BufferReader'); + } +}; + +BufferReader.prototype.set = function(obj) { + this.buf = obj.buf || this.buf || undefined; + this.pos = obj.pos || this.pos || 0; + return this; +}; + +BufferReader.prototype.eof = function() { + return this.pos >= this.buf.length; +}; + +BufferReader.prototype.finished = BufferReader.prototype.eof; + +BufferReader.prototype.read = function(len) { + $.checkArgument(!_.isUndefined(len), 'Must specify a length'); + var buf = this.buf.slice(this.pos, this.pos + len); + this.pos = this.pos + len; + return buf; +}; + +BufferReader.prototype.readAll = function() { + var buf = this.buf.slice(this.pos, this.buf.length); + this.pos = this.buf.length; + return buf; +}; + +BufferReader.prototype.readUInt8 = function() { + var val = this.buf.readUInt8(this.pos); + this.pos = this.pos + 1; + return val; +}; + +BufferReader.prototype.readUInt16BE = function() { + var val = this.buf.readUInt16BE(this.pos); + this.pos = this.pos + 2; + return val; +}; + +BufferReader.prototype.readUInt16LE = function() { + var val = this.buf.readUInt16LE(this.pos); + this.pos = this.pos + 2; + return val; +}; + +BufferReader.prototype.readUInt32BE = function() { + var val = this.buf.readUInt32BE(this.pos); + this.pos = this.pos + 4; + return val; +}; + +BufferReader.prototype.readUInt32LE = function() { + var val = this.buf.readUInt32LE(this.pos); + this.pos = this.pos + 4; + return val; +}; + +BufferReader.prototype.readInt32LE = function() { + var val = this.buf.readInt32LE(this.pos); + this.pos = this.pos + 4; + return val; +}; + +BufferReader.prototype.readUInt64BEBN = function() { + var buf = this.buf.slice(this.pos, this.pos + 8); + var bn = BN.fromBuffer(buf); + this.pos = this.pos + 8; + return bn; +}; + +BufferReader.prototype.readUInt64LEBN = function() { + var second = this.buf.readUInt32LE(this.pos); + var first = this.buf.readUInt32LE(this.pos + 4); + var combined = (first * 0x100000000) + second; + // Instantiating an instance of BN with a number is faster than with an + // array or string. However, the maximum safe number for a double precision + // floating point is 2 ^ 52 - 1 (0x1fffffffffffff), thus we can safely use + // non-floating point numbers less than this amount (52 bits). And in the case + // that the number is larger, we can instatiate an instance of BN by passing + // an array from the buffer (slower) and specifying the endianness. + var bn; + if (combined <= 0x1fffffffffffff) { + bn = new BN(combined); + } else { + var data = Array.prototype.slice.call(this.buf, this.pos, this.pos + 8); + bn = new BN(data, 10, 'le'); + } + this.pos = this.pos + 8; + return bn; +}; + +BufferReader.prototype.readVarintNum = function() { + var first = this.readUInt8(); + switch (first) { + case 0xFD: + return this.readUInt16LE(); + case 0xFE: + return this.readUInt32LE(); + case 0xFF: + var bn = this.readUInt64LEBN(); + var n = bn.toNumber(); + if (n <= Math.pow(2, 53)) { + return n; + } else { + throw new Error('number too large to retain precision - use readVarintBN'); + } + break; + default: + return first; + } +}; + +/** + * reads a length prepended buffer + */ +BufferReader.prototype.readVarLengthBuffer = function() { + var len = this.readVarintNum(); + var buf = this.read(len); + $.checkState(buf.length === len, 'Invalid length while reading varlength buffer. ' + + 'Expected to read: ' + len + ' and read ' + buf.length); + return buf; +}; + +BufferReader.prototype.readVarintBuf = function() { + var first = this.buf.readUInt8(this.pos); + switch (first) { + case 0xFD: + return this.read(1 + 2); + case 0xFE: + return this.read(1 + 4); + case 0xFF: + return this.read(1 + 8); + default: + return this.read(1); + } +}; + +BufferReader.prototype.readVarintBN = function() { + var first = this.readUInt8(); + switch (first) { + case 0xFD: + return new BN(this.readUInt16LE()); + case 0xFE: + return new BN(this.readUInt32LE()); + case 0xFF: + return this.readUInt64LEBN(); + default: + return new BN(first); + } +}; + +BufferReader.prototype.reverse = function() { + var buf = new Buffer(this.buf.length); + for (var i = 0; i < buf.length; i++) { + buf[i] = this.buf[this.buf.length - 1 - i]; + } + this.buf = buf; + return this; +}; + +BufferReader.prototype.readReverse = function(len) { + if (_.isUndefined(len)) { + len = this.buf.length; + } + var buf = this.buf.slice(this.pos, this.pos + len); + this.pos = this.pos + len; + return BufferUtil.reverse(buf); +}; + +module.exports = BufferReader; + +}).call(this,require("buffer").Buffer) +},{"../crypto/bn":6,"../util/buffer":42,"../util/preconditions":44,"buffer":47,"lodash":319}],15:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var bufferUtil = require('../util/buffer'); +var assert = require('assert'); + +var BufferWriter = function BufferWriter(obj) { + if (!(this instanceof BufferWriter)) + return new BufferWriter(obj); + if (obj) + this.set(obj); + else + this.bufs = []; +}; + +BufferWriter.prototype.set = function(obj) { + this.bufs = obj.bufs || this.bufs || []; + return this; +}; + +BufferWriter.prototype.toBuffer = function() { + return this.concat(); +}; + +BufferWriter.prototype.concat = function() { + return Buffer.concat(this.bufs); +}; + +BufferWriter.prototype.write = function(buf) { + assert(bufferUtil.isBuffer(buf)); + this.bufs.push(buf); + return this; +}; + +BufferWriter.prototype.writeReverse = function(buf) { + assert(bufferUtil.isBuffer(buf)); + this.bufs.push(bufferUtil.reverse(buf)); + return this; +}; + +BufferWriter.prototype.writeUInt8 = function(n) { + var buf = new Buffer(1); + buf.writeUInt8(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt16BE = function(n) { + var buf = new Buffer(2); + buf.writeUInt16BE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt16LE = function(n) { + var buf = new Buffer(2); + buf.writeUInt16LE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt32BE = function(n) { + var buf = new Buffer(4); + buf.writeUInt32BE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeInt32LE = function(n) { + var buf = new Buffer(4); + buf.writeInt32LE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt32LE = function(n) { + var buf = new Buffer(4); + buf.writeUInt32LE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt64BEBN = function(bn) { + var buf = bn.toBuffer({size: 8}); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt64LEBN = function(bn) { + var buf = bn.toBuffer({size: 8}); + this.writeReverse(buf); + return this; +}; + +BufferWriter.prototype.writeVarintNum = function(n) { + var buf = BufferWriter.varintBufNum(n); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeVarintBN = function(bn) { + var buf = BufferWriter.varintBufBN(bn); + this.write(buf); + return this; +}; + +BufferWriter.varintBufNum = function(n) { + var buf = undefined; + if (n < 253) { + buf = new Buffer(1); + buf.writeUInt8(n, 0); + } else if (n < 0x10000) { + buf = new Buffer(1 + 2); + buf.writeUInt8(253, 0); + buf.writeUInt16LE(n, 1); + } else if (n < 0x100000000) { + buf = new Buffer(1 + 4); + buf.writeUInt8(254, 0); + buf.writeUInt32LE(n, 1); + } else { + buf = new Buffer(1 + 8); + buf.writeUInt8(255, 0); + buf.writeInt32LE(n & -1, 1); + buf.writeUInt32LE(Math.floor(n / 0x100000000), 5); + } + return buf; +}; + +BufferWriter.varintBufBN = function(bn) { + var buf = undefined; + var n = bn.toNumber(); + if (n < 253) { + buf = new Buffer(1); + buf.writeUInt8(n, 0); + } else if (n < 0x10000) { + buf = new Buffer(1 + 2); + buf.writeUInt8(253, 0); + buf.writeUInt16LE(n, 1); + } else if (n < 0x100000000) { + buf = new Buffer(1 + 4); + buf.writeUInt8(254, 0); + buf.writeUInt32LE(n, 1); + } else { + var bw = new BufferWriter(); + bw.writeUInt8(255); + bw.writeUInt64LEBN(bn); + var buf = bw.concat(); + } + return buf; +}; + +module.exports = BufferWriter; + +}).call(this,require("buffer").Buffer) +},{"../util/buffer":42,"assert":45,"buffer":47}],16:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var BufferWriter = require('./bufferwriter'); +var BufferReader = require('./bufferreader'); +var BN = require('../crypto/bn'); + +var Varint = function Varint(buf) { + if (!(this instanceof Varint)) + return new Varint(buf); + if (Buffer.isBuffer(buf)) { + this.buf = buf; + } else if (typeof buf === 'number') { + var num = buf; + this.fromNumber(num); + } else if (buf instanceof BN) { + var bn = buf; + this.fromBN(bn); + } else if (buf) { + var obj = buf; + this.set(obj); + } +}; + +Varint.prototype.set = function(obj) { + this.buf = obj.buf || this.buf; + return this; +}; + +Varint.prototype.fromString = function(str) { + this.set({ + buf: new Buffer(str, 'hex') + }); + return this; +}; + +Varint.prototype.toString = function() { + return this.buf.toString('hex'); +}; + +Varint.prototype.fromBuffer = function(buf) { + this.buf = buf; + return this; +}; + +Varint.prototype.fromBufferReader = function(br) { + this.buf = br.readVarintBuf(); + return this; +}; + +Varint.prototype.fromBN = function(bn) { + this.buf = BufferWriter().writeVarintBN(bn).concat(); + return this; +}; + +Varint.prototype.fromNumber = function(num) { + this.buf = BufferWriter().writeVarintNum(num).concat(); + return this; +}; + +Varint.prototype.toBuffer = function() { + return this.buf; +}; + +Varint.prototype.toBN = function() { + return BufferReader(this.buf).readVarintBN(); +}; + +Varint.prototype.toNumber = function() { + return BufferReader(this.buf).readVarintNum(); +}; + +module.exports = Varint; + +}).call(this,require("buffer").Buffer) +},{"../crypto/bn":6,"./bufferreader":14,"./bufferwriter":15,"buffer":47}],17:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); + +function format(message, args) { + return message + .replace('{0}', args[0]) + .replace('{1}', args[1]) + .replace('{2}', args[2]); +} +var traverseNode = function(parent, errorDefinition) { + var NodeError = function() { + if (_.isString(errorDefinition.message)) { + this.message = format(errorDefinition.message, arguments); + } else if (_.isFunction(errorDefinition.message)) { + this.message = errorDefinition.message.apply(null, arguments); + } else { + throw new Error('Invalid error definition for ' + errorDefinition.name); + } + this.stack = this.message + '\n' + (new Error()).stack; + }; + NodeError.prototype = Object.create(parent.prototype); + NodeError.prototype.name = parent.prototype.name + errorDefinition.name; + parent[errorDefinition.name] = NodeError; + if (errorDefinition.errors) { + childDefinitions(NodeError, errorDefinition.errors); + } + return NodeError; +}; + +/* jshint latedef: false */ +var childDefinitions = function(parent, childDefinitions) { + _.each(childDefinitions, function(childDefinition) { + traverseNode(parent, childDefinition); + }); +}; +/* jshint latedef: true */ + +var traverseRoot = function(parent, errorsDefinition) { + childDefinitions(parent, errorsDefinition); + return parent; +}; + + +var bitcore = {}; +bitcore.Error = function() { + this.message = 'Internal error'; + this.stack = this.message + '\n' + (new Error()).stack; +}; +bitcore.Error.prototype = Object.create(Error.prototype); +bitcore.Error.prototype.name = 'bitcore.Error'; + + +var data = require('./spec'); +traverseRoot(bitcore.Error, data); + +module.exports = bitcore.Error; + +module.exports.extend = function(spec) { + return traverseNode(bitcore.Error, spec); +}; + +},{"./spec":18,"lodash":319}],18:[function(require,module,exports){ +'use strict'; + +var docsURL = 'http://bitcore.io/'; + +module.exports = [{ + name: 'InvalidB58Char', + message: 'Invalid Base58 character: {0} in {1}' +}, { + name: 'InvalidB58Checksum', + message: 'Invalid Base58 checksum for {0}' +}, { + name: 'InvalidNetwork', + message: 'Invalid version for network: got {0}' +}, { + name: 'InvalidState', + message: 'Invalid state: {0}' +}, { + name: 'NotImplemented', + message: 'Function {0} was not implemented yet' +}, { + name: 'InvalidNetworkArgument', + message: 'Invalid network: must be "livenet" or "testnet", got {0}' +}, { + name: 'InvalidArgument', + message: function() { + return 'Invalid Argument' + (arguments[0] ? (': ' + arguments[0]) : '') + + (arguments[1] ? (' Documentation: ' + docsURL + arguments[1]) : ''); + } +}, { + name: 'AbstractMethodInvoked', + message: 'Abstract Method Invocation: {0}' +}, { + name: 'InvalidArgumentType', + message: function() { + return 'Invalid Argument for ' + arguments[2] + ', expected ' + arguments[1] + ' but got ' + typeof arguments[0]; + } +}, { + name: 'Unit', + message: 'Internal Error on Unit {0}', + errors: [{ + 'name': 'UnknownCode', + 'message': 'Unrecognized unit code: {0}' + }, { + 'name': 'InvalidRate', + 'message': 'Invalid exchange rate: {0}' + }] +}, { + name: 'MerkleBlock', + message: 'Internal Error on MerkleBlock {0}', + errors: [{ + 'name': 'InvalidMerkleTree', + 'message': 'This MerkleBlock contain an invalid Merkle Tree' + }] +}, { + name: 'Transaction', + message: 'Internal Error on Transaction {0}', + errors: [{ + name: 'Input', + message: 'Internal Error on Input {0}', + errors: [{ + name: 'MissingScript', + message: 'Need a script to create an input' + }, { + name: 'UnsupportedScript', + message: 'Unsupported input script type: {0}' + }, { + name: 'MissingPreviousOutput', + message: 'No previous output information.' + }] + }, { + name: 'NeedMoreInfo', + message: '{0}' + }, { + name: 'InvalidSorting', + message: 'The sorting function provided did not return the change output as one of the array elements' + }, { + name: 'InvalidOutputAmountSum', + message: '{0}' + }, { + name: 'MissingSignatures', + message: 'Some inputs have not been fully signed' + }, { + name: 'InvalidIndex', + message: 'Invalid index: {0} is not between 0, {1}' + }, { + name: 'UnableToVerifySignature', + message: 'Unable to verify signature: {0}' + }, { + name: 'DustOutputs', + message: 'Dust amount detected in one output' + }, { + name: 'InvalidSatoshis', + message: 'Output satoshis are invalid', + }, { + name: 'FeeError', + message: 'Internal Error on Fee {0}', + errors: [{ + name: 'TooSmall', + message: 'Fee is too small: {0}', + }, { + name: 'TooLarge', + message: 'Fee is too large: {0}', + }, { + name: 'Different', + message: 'Unspent value is different from specified fee: {0}', + }] + }, { + name: 'ChangeAddressMissing', + message: 'Change address is missing' + }, { + name: 'BlockHeightTooHigh', + message: 'Block Height can be at most 2^32 -1' + }, { + name: 'NLockTimeOutOfRange', + message: 'Block Height can only be between 0 and 499 999 999' + }, { + name: 'LockTimeTooEarly', + message: 'Lock Time can\'t be earlier than UNIX date 500 000 000' + }] +}, { + name: 'Script', + message: 'Internal Error on Script {0}', + errors: [{ + name: 'UnrecognizedAddress', + message: 'Expected argument {0} to be an address' + }, { + name: 'CantDeriveAddress', + message: 'Can\'t derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out.' + }, { + name: 'InvalidBuffer', + message: 'Invalid script buffer: can\'t parse valid script from given buffer {0}' + }] +}, { + name: 'HDPrivateKey', + message: 'Internal Error on HDPrivateKey {0}', + errors: [{ + name: 'InvalidDerivationArgument', + message: 'Invalid derivation argument {0}, expected string, or number and boolean' + }, { + name: 'InvalidEntropyArgument', + message: 'Invalid entropy: must be an hexa string or binary buffer, got {0}', + errors: [{ + name: 'TooMuchEntropy', + message: 'Invalid entropy: more than 512 bits is non standard, got "{0}"' + }, { + name: 'NotEnoughEntropy', + message: 'Invalid entropy: at least 128 bits needed, got "{0}"' + }] + }, { + name: 'InvalidLength', + message: 'Invalid length for xprivkey string in {0}' + }, { + name: 'InvalidPath', + message: 'Invalid derivation path: {0}' + }, { + name: 'UnrecognizedArgument', + message: 'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"' + }] +}, { + name: 'HDPublicKey', + message: 'Internal Error on HDPublicKey {0}', + errors: [{ + name: 'ArgumentIsPrivateExtended', + message: 'Argument is an extended private key: {0}' + }, { + name: 'InvalidDerivationArgument', + message: 'Invalid derivation argument: got {0}' + }, { + name: 'InvalidLength', + message: 'Invalid length for xpubkey: got "{0}"' + }, { + name: 'InvalidPath', + message: 'Invalid derivation path, it should look like: "m/1/100", got "{0}"' + }, { + name: 'InvalidIndexCantDeriveHardened', + message: 'Invalid argument: creating a hardened path requires an HDPrivateKey' + }, { + name: 'MustSupplyArgument', + message: 'Must supply an argument to create a HDPublicKey' + }, { + name: 'UnrecognizedArgument', + message: 'Invalid argument for creation, must be string, json, buffer, or object' + }] +}]; + +},{}],19:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + + +var assert = require('assert'); +var buffer = require('buffer'); +var _ = require('lodash'); +var $ = require('./util/preconditions'); + +var BN = require('./crypto/bn'); +var Base58 = require('./encoding/base58'); +var Base58Check = require('./encoding/base58check'); +var Hash = require('./crypto/hash'); +var Network = require('./networks'); +var Point = require('./crypto/point'); +var PrivateKey = require('./privatekey'); +var Random = require('./crypto/random'); + +var errors = require('./errors'); +var hdErrors = errors.HDPrivateKey; +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); + +var MINIMUM_ENTROPY_BITS = 128; +var BITS_TO_BYTES = 1 / 8; +var MAXIMUM_ENTROPY_BITS = 512; + + +/** + * Represents an instance of an hierarchically derived private key. + * + * More info on https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki + * + * @constructor + * @param {string|Buffer|Object} arg + */ +function HDPrivateKey(arg) { + /* jshint maxcomplexity: 10 */ + if (arg instanceof HDPrivateKey) { + return arg; + } + if (!(this instanceof HDPrivateKey)) { + return new HDPrivateKey(arg); + } + if (!arg) { + return this._generateRandomly(); + } + + if (Network.get(arg)) { + return this._generateRandomly(arg); + } else if (_.isString(arg) || BufferUtil.isBuffer(arg)) { + if (HDPrivateKey.isValidSerialized(arg)) { + this._buildFromSerialized(arg); + } else if (JSUtil.isValidJSON(arg)) { + this._buildFromJSON(arg); + } else if (BufferUtil.isBuffer(arg) && HDPrivateKey.isValidSerialized(arg.toString())) { + this._buildFromSerialized(arg.toString()); + } else { + throw HDPrivateKey.getSerializedError(arg); + } + } else if (_.isObject(arg)) { + this._buildFromObject(arg); + } else { + throw new hdErrors.UnrecognizedArgument(arg); + } +} + +/** + * Verifies that a given path is valid. + * + * @param {string|number} arg + * @param {boolean?} hardened + * @return {boolean} + */ +HDPrivateKey.isValidPath = function(arg, hardened) { + if (_.isString(arg)) { + var indexes = HDPrivateKey._getDerivationIndexes(arg); + return indexes !== null && _.every(indexes, HDPrivateKey.isValidPath); + } + + if (_.isNumber(arg)) { + if (arg < HDPrivateKey.Hardened && hardened === true) { + arg += HDPrivateKey.Hardened; + } + return arg >= 0 && arg < HDPrivateKey.MaxIndex; + } + + return false; +}; + +/** + * Internal function that splits a string path into a derivation index array. + * It will return null if the string path is malformed. + * It does not validate if indexes are in bounds. + * + * @param {string} path + * @return {Array} + */ +HDPrivateKey._getDerivationIndexes = function(path) { + var steps = path.split('/'); + + // Special cases: + if (_.includes(HDPrivateKey.RootElementAlias, path)) { + return []; + } + + if (!_.includes(HDPrivateKey.RootElementAlias, steps[0])) { + return null; + } + + var indexes = steps.slice(1).map(function(step) { + var isHardened = step.slice(-1) === '\''; + if (isHardened) { + step = step.slice(0, -1); + } + if (!step || step[0] === '-') { + return NaN; + } + var index = +step; // cast to number + if (isHardened) { + index += HDPrivateKey.Hardened; + } + + return index; + }); + + return _.some(indexes, isNaN) ? null : indexes; +}; + +/** + * WARNING: This method is deprecated. Use deriveChild or deriveNonCompliantChild instead. This is not BIP32 compliant + * + * + * Get a derived child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same private key), "m/0/1/40/2'/1000", where the ' quote means a hardened + * derivation. + * + * If the first argument is a number, the child with that index will be + * derived. If the second argument is truthy, the hardened version will be + * derived. See the example usage for clarification. + * + * @example + * ```javascript + * var parent = new HDPrivateKey('xprv...'); + * var child_0_1_2h = parent.derive(0).derive(1).derive(2, true); + * var copy_of_child_0_1_2h = parent.derive("m/0/1/2'"); + * assert(child_0_1_2h.xprivkey === copy_of_child_0_1_2h); + * ``` + * + * @param {string|number} arg + * @param {boolean?} hardened + */ +HDPrivateKey.prototype.derive = function(arg, hardened) { + return this.deriveNonCompliantChild(arg, hardened); +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0. + * + * + * Get a derived child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same private key), "m/0/1/40/2'/1000", where the ' quote means a hardened + * derivation. + * + * If the first argument is a number, the child with that index will be + * derived. If the second argument is truthy, the hardened version will be + * derived. See the example usage for clarification. + * + * WARNING: The `nonCompliant` option should NOT be used, except for older implementation + * that used a derivation strategy that used a non-zero padded private key. + * + * @example + * ```javascript + * var parent = new HDPrivateKey('xprv...'); + * var child_0_1_2h = parent.deriveChild(0).deriveChild(1).deriveChild(2, true); + * var copy_of_child_0_1_2h = parent.deriveChild("m/0/1/2'"); + * assert(child_0_1_2h.xprivkey === copy_of_child_0_1_2h); + * ``` + * + * @param {string|number} arg + * @param {boolean?} hardened + */ +HDPrivateKey.prototype.deriveChild = function(arg, hardened) { + if (_.isNumber(arg)) { + return this._deriveWithNumber(arg, hardened); + } else if (_.isString(arg)) { + return this._deriveFromString(arg); + } else { + throw new hdErrors.InvalidDerivationArgument(arg); + } +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0 + * + * + * WARNING: If this is a new implementation you should NOT use this method, you should be using + * `derive` instead. + * + * This method is explicitly for use and compatibility with an implementation that + * was not compliant with BIP32 regarding the derivation algorithm. The private key + * must be 32 bytes hashing, and this implementation will use the non-zero padded + * serialization of a private key, such that it's still possible to derive the privateKey + * to recover those funds. + * + * @param {string|number} arg + * @param {boolean?} hardened + */ +HDPrivateKey.prototype.deriveNonCompliantChild = function(arg, hardened) { + if (_.isNumber(arg)) { + return this._deriveWithNumber(arg, hardened, true); + } else if (_.isString(arg)) { + return this._deriveFromString(arg, true); + } else { + throw new hdErrors.InvalidDerivationArgument(arg); + } +}; + +HDPrivateKey.prototype._deriveWithNumber = function(index, hardened, nonCompliant) { + /* jshint maxstatements: 20 */ + /* jshint maxcomplexity: 10 */ + if (!HDPrivateKey.isValidPath(index, hardened)) { + throw new hdErrors.InvalidPath(index); + } + + hardened = index >= HDPrivateKey.Hardened ? true : hardened; + if (index < HDPrivateKey.Hardened && hardened === true) { + index += HDPrivateKey.Hardened; + } + + var indexBuffer = BufferUtil.integerAsBuffer(index); + var data; + if (hardened && nonCompliant) { + // The private key serialization in this case will not be exactly 32 bytes and can be + // any value less, and the value is not zero-padded. + var nonZeroPadded = this.privateKey.bn.toBuffer(); + data = BufferUtil.concat([new buffer.Buffer([0]), nonZeroPadded, indexBuffer]); + } else if (hardened) { + // This will use a 32 byte zero padded serialization of the private key + var privateKeyBuffer = this.privateKey.bn.toBuffer({size: 32}); + assert(privateKeyBuffer.length === 32, 'length of private key buffer is expected to be 32 bytes'); + data = BufferUtil.concat([new buffer.Buffer([0]), privateKeyBuffer, indexBuffer]); + } else { + data = BufferUtil.concat([this.publicKey.toBuffer(), indexBuffer]); + } + var hash = Hash.sha512hmac(data, this._buffers.chainCode); + var leftPart = BN.fromBuffer(hash.slice(0, 32), { + size: 32 + }); + var chainCode = hash.slice(32, 64); + + var privateKey = leftPart.add(this.privateKey.toBigNumber()).umod(Point.getN()).toBuffer({ + size: 32 + }); + + if (!PrivateKey.isValid(privateKey)) { + // Index at this point is already hardened, we can pass null as the hardened arg + return this._deriveWithNumber(index + 1, null, nonCompliant); + } + + var derived = new HDPrivateKey({ + network: this.network, + depth: this.depth + 1, + parentFingerPrint: this.fingerPrint, + childIndex: index, + chainCode: chainCode, + privateKey: privateKey + }); + + return derived; +}; + +HDPrivateKey.prototype._deriveFromString = function(path, nonCompliant) { + if (!HDPrivateKey.isValidPath(path)) { + throw new hdErrors.InvalidPath(path); + } + + var indexes = HDPrivateKey._getDerivationIndexes(path); + var derived = indexes.reduce(function(prev, index) { + return prev._deriveWithNumber(index, null, nonCompliant); + }, this); + + return derived; +}; + +/** + * Verifies that a given serialized private key in base58 with checksum format + * is valid. + * + * @param {string|Buffer} data - the serialized private key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {boolean} + */ +HDPrivateKey.isValidSerialized = function(data, network) { + return !HDPrivateKey.getSerializedError(data, network); +}; + +/** + * Checks what's the error that causes the validation of a serialized private key + * in base58 with checksum to fail. + * + * @param {string|Buffer} data - the serialized private key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {errors.InvalidArgument|null} + */ +HDPrivateKey.getSerializedError = function(data, network) { + /* jshint maxcomplexity: 10 */ + if (!(_.isString(data) || BufferUtil.isBuffer(data))) { + return new hdErrors.UnrecognizedArgument('Expected string or buffer'); + } + if (!Base58.validCharacters(data)) { + return new errors.InvalidB58Char('(unknown)', data); + } + try { + data = Base58Check.decode(data); + } catch (e) { + return new errors.InvalidB58Checksum(data); + } + if (data.length !== HDPrivateKey.DataLength) { + return new hdErrors.InvalidLength(data); + } + if (!_.isUndefined(network)) { + var error = HDPrivateKey._validateNetwork(data, network); + if (error) { + return error; + } + } + return null; +}; + +HDPrivateKey._validateNetwork = function(data, networkArg) { + var network = Network.get(networkArg); + if (!network) { + return new errors.InvalidNetworkArgument(networkArg); + } + var version = data.slice(0, 4); + if (BufferUtil.integerFromBuffer(version) !== network.xprivkey) { + return new errors.InvalidNetwork(version); + } + return null; +}; + +HDPrivateKey.fromString = function(arg) { + $.checkArgument(_.isString(arg), 'No valid string was provided'); + return new HDPrivateKey(arg); +}; + +HDPrivateKey.fromObject = function(arg) { + $.checkArgument(_.isObject(arg), 'No valid argument was provided'); + return new HDPrivateKey(arg); +}; + +HDPrivateKey.prototype._buildFromJSON = function(arg) { + return this._buildFromObject(JSON.parse(arg)); +}; + +HDPrivateKey.prototype._buildFromObject = function(arg) { + /* jshint maxcomplexity: 12 */ + // TODO: Type validation + var buffers = { + version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xprivkey) : arg.version, + depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth, + parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint, + childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex, + chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode, + privateKey: (_.isString(arg.privateKey) && JSUtil.isHexa(arg.privateKey)) ? BufferUtil.hexToBuffer(arg.privateKey) : arg.privateKey, + checksum: arg.checksum ? (arg.checksum.length ? arg.checksum : BufferUtil.integerAsBuffer(arg.checksum)) : undefined + }; + return this._buildFromBuffers(buffers); +}; + +HDPrivateKey.prototype._buildFromSerialized = function(arg) { + var decoded = Base58Check.decode(arg); + var buffers = { + version: decoded.slice(HDPrivateKey.VersionStart, HDPrivateKey.VersionEnd), + depth: decoded.slice(HDPrivateKey.DepthStart, HDPrivateKey.DepthEnd), + parentFingerPrint: decoded.slice(HDPrivateKey.ParentFingerPrintStart, + HDPrivateKey.ParentFingerPrintEnd), + childIndex: decoded.slice(HDPrivateKey.ChildIndexStart, HDPrivateKey.ChildIndexEnd), + chainCode: decoded.slice(HDPrivateKey.ChainCodeStart, HDPrivateKey.ChainCodeEnd), + privateKey: decoded.slice(HDPrivateKey.PrivateKeyStart, HDPrivateKey.PrivateKeyEnd), + checksum: decoded.slice(HDPrivateKey.ChecksumStart, HDPrivateKey.ChecksumEnd), + xprivkey: arg + }; + return this._buildFromBuffers(buffers); +}; + +HDPrivateKey.prototype._generateRandomly = function(network) { + return HDPrivateKey.fromSeed(Random.getRandomBuffer(64), network); +}; + +/** + * Generate a private key from a seed, as described in BIP32 + * + * @param {string|Buffer} hexa + * @param {*} network + * @return HDPrivateKey + */ +HDPrivateKey.fromSeed = function(hexa, network) { + /* jshint maxcomplexity: 8 */ + if (JSUtil.isHexaString(hexa)) { + hexa = BufferUtil.hexToBuffer(hexa); + } + if (!Buffer.isBuffer(hexa)) { + throw new hdErrors.InvalidEntropyArgument(hexa); + } + if (hexa.length < MINIMUM_ENTROPY_BITS * BITS_TO_BYTES) { + throw new hdErrors.InvalidEntropyArgument.NotEnoughEntropy(hexa); + } + if (hexa.length > MAXIMUM_ENTROPY_BITS * BITS_TO_BYTES) { + throw new hdErrors.InvalidEntropyArgument.TooMuchEntropy(hexa); + } + var hash = Hash.sha512hmac(hexa, new buffer.Buffer('Bitcoin seed')); + + return new HDPrivateKey({ + network: Network.get(network) || Network.defaultNetwork, + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + privateKey: hash.slice(0, 32), + chainCode: hash.slice(32, 64) + }); +}; + + + +HDPrivateKey.prototype._calcHDPublicKey = function() { + if (!this._hdPublicKey) { + var HDPublicKey = require('./hdpublickey'); + this._hdPublicKey = new HDPublicKey(this); + } +}; + +/** + * Receives a object with buffers in all the properties and populates the + * internal structure + * + * @param {Object} arg + * @param {buffer.Buffer} arg.version + * @param {buffer.Buffer} arg.depth + * @param {buffer.Buffer} arg.parentFingerPrint + * @param {buffer.Buffer} arg.childIndex + * @param {buffer.Buffer} arg.chainCode + * @param {buffer.Buffer} arg.privateKey + * @param {buffer.Buffer} arg.checksum + * @param {string=} arg.xprivkey - if set, don't recalculate the base58 + * representation + * @return {HDPrivateKey} this + */ +HDPrivateKey.prototype._buildFromBuffers = function(arg) { + /* jshint maxcomplexity: 8 */ + /* jshint maxstatements: 20 */ + + HDPrivateKey._validateBufferArguments(arg); + + JSUtil.defineImmutable(this, { + _buffers: arg + }); + + var sequence = [ + arg.version, arg.depth, arg.parentFingerPrint, arg.childIndex, arg.chainCode, + BufferUtil.emptyBuffer(1), arg.privateKey + ]; + var concat = buffer.Buffer.concat(sequence); + if (!arg.checksum || !arg.checksum.length) { + arg.checksum = Base58Check.checksum(concat); + } else { + if (arg.checksum.toString() !== Base58Check.checksum(concat).toString()) { + throw new errors.InvalidB58Checksum(concat); + } + } + + var network = Network.get(BufferUtil.integerFromBuffer(arg.version)); + var xprivkey; + xprivkey = Base58Check.encode(buffer.Buffer.concat(sequence)); + arg.xprivkey = new Buffer(xprivkey); + + var privateKey = new PrivateKey(BN.fromBuffer(arg.privateKey), network); + var publicKey = privateKey.toPublicKey(); + var size = HDPrivateKey.ParentFingerPrintSize; + var fingerPrint = Hash.sha256ripemd160(publicKey.toBuffer()).slice(0, size); + + JSUtil.defineImmutable(this, { + xprivkey: xprivkey, + network: network, + depth: BufferUtil.integerFromSingleByteBuffer(arg.depth), + privateKey: privateKey, + publicKey: publicKey, + fingerPrint: fingerPrint + }); + + this._hdPublicKey = null; + + Object.defineProperty(this, 'hdPublicKey', { + configurable: false, + enumerable: true, + get: function() { + this._calcHDPublicKey(); + return this._hdPublicKey; + } + }); + Object.defineProperty(this, 'xpubkey', { + configurable: false, + enumerable: true, + get: function() { + this._calcHDPublicKey(); + return this._hdPublicKey.xpubkey; + } + }); + return this; +}; + +HDPrivateKey._validateBufferArguments = function(arg) { + var checkBuffer = function(name, size) { + var buff = arg[name]; + assert(BufferUtil.isBuffer(buff), name + ' argument is not a buffer'); + assert( + buff.length === size, + name + ' has not the expected size: found ' + buff.length + ', expected ' + size + ); + }; + checkBuffer('version', HDPrivateKey.VersionSize); + checkBuffer('depth', HDPrivateKey.DepthSize); + checkBuffer('parentFingerPrint', HDPrivateKey.ParentFingerPrintSize); + checkBuffer('childIndex', HDPrivateKey.ChildIndexSize); + checkBuffer('chainCode', HDPrivateKey.ChainCodeSize); + checkBuffer('privateKey', HDPrivateKey.PrivateKeySize); + if (arg.checksum && arg.checksum.length) { + checkBuffer('checksum', HDPrivateKey.CheckSumSize); + } +}; + +/** + * Returns the string representation of this private key (a string starting + * with "xprv..." + * + * @return string + */ +HDPrivateKey.prototype.toString = function() { + return this.xprivkey; +}; + +/** + * Returns the console representation of this extended private key. + * @return string + */ +HDPrivateKey.prototype.inspect = function() { + return ''; +}; + +/** + * Returns a plain object with a representation of this private key. + * + * Fields include:
    + *
  • network: either 'livenet' or 'testnet' + *
  • depth: a number ranging from 0 to 255 + *
  • fingerPrint: a number ranging from 0 to 2^32-1, taken from the hash of the + *
  • associated public key + *
  • parentFingerPrint: a number ranging from 0 to 2^32-1, taken from the hash + *
  • of this parent's associated public key or zero. + *
  • childIndex: the index from which this child was derived (or zero) + *
  • chainCode: an hexa string representing a number used in the derivation + *
  • privateKey: the private key associated, in hexa representation + *
  • xprivkey: the representation of this extended private key in checksum + *
  • base58 format + *
  • checksum: the base58 checksum of xprivkey + *
+ * @return {Object} + */ +HDPrivateKey.prototype.toObject = HDPrivateKey.prototype.toJSON = function toObject() { + return { + network: Network.get(BufferUtil.integerFromBuffer(this._buffers.version), 'xprivkey').name, + depth: BufferUtil.integerFromSingleByteBuffer(this._buffers.depth), + fingerPrint: BufferUtil.integerFromBuffer(this.fingerPrint), + parentFingerPrint: BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint), + childIndex: BufferUtil.integerFromBuffer(this._buffers.childIndex), + chainCode: BufferUtil.bufferToHex(this._buffers.chainCode), + privateKey: this.privateKey.toBuffer().toString('hex'), + checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + xprivkey: this.xprivkey + }; +}; + +/** + * Build a HDPrivateKey from a buffer + * + * @param {Buffer} arg + * @return {HDPrivateKey} + */ +HDPrivateKey.fromBuffer = function(arg) { + return new HDPrivateKey(arg.toString()); +}; + +/** + * Returns a buffer representation of the HDPrivateKey + * + * @return {string} + */ +HDPrivateKey.prototype.toBuffer = function() { + return BufferUtil.copy(this._buffers.xprivkey); +}; + +HDPrivateKey.DefaultDepth = 0; +HDPrivateKey.DefaultFingerprint = 0; +HDPrivateKey.DefaultChildIndex = 0; +HDPrivateKey.Hardened = 0x80000000; +HDPrivateKey.MaxIndex = 2 * HDPrivateKey.Hardened; + +HDPrivateKey.RootElementAlias = ['m', 'M', 'm\'', 'M\'']; + +HDPrivateKey.VersionSize = 4; +HDPrivateKey.DepthSize = 1; +HDPrivateKey.ParentFingerPrintSize = 4; +HDPrivateKey.ChildIndexSize = 4; +HDPrivateKey.ChainCodeSize = 32; +HDPrivateKey.PrivateKeySize = 32; +HDPrivateKey.CheckSumSize = 4; + +HDPrivateKey.DataLength = 78; +HDPrivateKey.SerializedByteSize = 82; + +HDPrivateKey.VersionStart = 0; +HDPrivateKey.VersionEnd = HDPrivateKey.VersionStart + HDPrivateKey.VersionSize; +HDPrivateKey.DepthStart = HDPrivateKey.VersionEnd; +HDPrivateKey.DepthEnd = HDPrivateKey.DepthStart + HDPrivateKey.DepthSize; +HDPrivateKey.ParentFingerPrintStart = HDPrivateKey.DepthEnd; +HDPrivateKey.ParentFingerPrintEnd = HDPrivateKey.ParentFingerPrintStart + HDPrivateKey.ParentFingerPrintSize; +HDPrivateKey.ChildIndexStart = HDPrivateKey.ParentFingerPrintEnd; +HDPrivateKey.ChildIndexEnd = HDPrivateKey.ChildIndexStart + HDPrivateKey.ChildIndexSize; +HDPrivateKey.ChainCodeStart = HDPrivateKey.ChildIndexEnd; +HDPrivateKey.ChainCodeEnd = HDPrivateKey.ChainCodeStart + HDPrivateKey.ChainCodeSize; +HDPrivateKey.PrivateKeyStart = HDPrivateKey.ChainCodeEnd + 1; +HDPrivateKey.PrivateKeyEnd = HDPrivateKey.PrivateKeyStart + HDPrivateKey.PrivateKeySize; +HDPrivateKey.ChecksumStart = HDPrivateKey.PrivateKeyEnd; +HDPrivateKey.ChecksumEnd = HDPrivateKey.ChecksumStart + HDPrivateKey.CheckSumSize; + +assert(HDPrivateKey.ChecksumEnd === HDPrivateKey.SerializedByteSize); + +module.exports = HDPrivateKey; + +}).call(this,require("buffer").Buffer) +},{"./crypto/bn":6,"./crypto/hash":8,"./crypto/point":9,"./crypto/random":10,"./encoding/base58":12,"./encoding/base58check":13,"./errors":17,"./hdpublickey":20,"./networks":21,"./privatekey":23,"./util/buffer":42,"./util/js":43,"./util/preconditions":44,"assert":45,"buffer":47,"lodash":319}],20:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var $ = require('./util/preconditions'); + +var BN = require('./crypto/bn'); +var Base58 = require('./encoding/base58'); +var Base58Check = require('./encoding/base58check'); +var Hash = require('./crypto/hash'); +var HDPrivateKey = require('./hdprivatekey'); +var Network = require('./networks'); +var Point = require('./crypto/point'); +var PublicKey = require('./publickey'); + +var bitcoreErrors = require('./errors'); +var errors = bitcoreErrors; +var hdErrors = bitcoreErrors.HDPublicKey; +var assert = require('assert'); + +var JSUtil = require('./util/js'); +var BufferUtil = require('./util/buffer'); + +/** + * The representation of an hierarchically derived public key. + * + * See https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki + * + * @constructor + * @param {Object|string|Buffer} arg + */ +function HDPublicKey(arg) { + /* jshint maxcomplexity: 12 */ + /* jshint maxstatements: 20 */ + if (arg instanceof HDPublicKey) { + return arg; + } + if (!(this instanceof HDPublicKey)) { + return new HDPublicKey(arg); + } + if (arg) { + if (_.isString(arg) || BufferUtil.isBuffer(arg)) { + var error = HDPublicKey.getSerializedError(arg); + if (!error) { + return this._buildFromSerialized(arg); + } else if (BufferUtil.isBuffer(arg) && !HDPublicKey.getSerializedError(arg.toString())) { + return this._buildFromSerialized(arg.toString()); + } else { + if (error instanceof hdErrors.ArgumentIsPrivateExtended) { + return new HDPrivateKey(arg).hdPublicKey; + } + throw error; + } + } else { + if (_.isObject(arg)) { + if (arg instanceof HDPrivateKey) { + return this._buildFromPrivate(arg); + } else { + return this._buildFromObject(arg); + } + } else { + throw new hdErrors.UnrecognizedArgument(arg); + } + } + } else { + throw new hdErrors.MustSupplyArgument(); + } +} + +/** + * Verifies that a given path is valid. + * + * @param {string|number} arg + * @return {boolean} + */ +HDPublicKey.isValidPath = function(arg) { + if (_.isString(arg)) { + var indexes = HDPrivateKey._getDerivationIndexes(arg); + return indexes !== null && _.every(indexes, HDPublicKey.isValidPath); + } + + if (_.isNumber(arg)) { + return arg >= 0 && arg < HDPublicKey.Hardened; + } + + return false; +}; + +/** + * WARNING: This method is deprecated. Use deriveChild instead. + * + * + * Get a derivated child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same public key), "m/0/1/40/2/1000". + * + * Note that hardened keys can't be derived from a public extended key. + * + * If the first argument is a number, the child with that index will be + * derived. See the example usage for clarification. + * + * @example + * ```javascript + * var parent = new HDPublicKey('xpub...'); + * var child_0_1_2 = parent.derive(0).derive(1).derive(2); + * var copy_of_child_0_1_2 = parent.derive("m/0/1/2"); + * assert(child_0_1_2.xprivkey === copy_of_child_0_1_2); + * ``` + * + * @param {string|number} arg + */ +HDPublicKey.prototype.derive = function(arg, hardened) { + return this.deriveChild(arg, hardened); +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0. + * + * + * Get a derivated child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same public key), "m/0/1/40/2/1000". + * + * Note that hardened keys can't be derived from a public extended key. + * + * If the first argument is a number, the child with that index will be + * derived. See the example usage for clarification. + * + * @example + * ```javascript + * var parent = new HDPublicKey('xpub...'); + * var child_0_1_2 = parent.deriveChild(0).deriveChild(1).deriveChild(2); + * var copy_of_child_0_1_2 = parent.deriveChild("m/0/1/2"); + * assert(child_0_1_2.xprivkey === copy_of_child_0_1_2); + * ``` + * + * @param {string|number} arg + */ +HDPublicKey.prototype.deriveChild = function(arg, hardened) { + if (_.isNumber(arg)) { + return this._deriveWithNumber(arg, hardened); + } else if (_.isString(arg)) { + return this._deriveFromString(arg); + } else { + throw new hdErrors.InvalidDerivationArgument(arg); + } +}; + +HDPublicKey.prototype._deriveWithNumber = function(index, hardened) { + if (index >= HDPublicKey.Hardened || hardened) { + throw new hdErrors.InvalidIndexCantDeriveHardened(); + } + if (index < 0) { + throw new hdErrors.InvalidPath(index); + } + + var indexBuffer = BufferUtil.integerAsBuffer(index); + var data = BufferUtil.concat([this.publicKey.toBuffer(), indexBuffer]); + var hash = Hash.sha512hmac(data, this._buffers.chainCode); + var leftPart = BN.fromBuffer(hash.slice(0, 32), {size: 32}); + var chainCode = hash.slice(32, 64); + + var publicKey; + try { + publicKey = PublicKey.fromPoint(Point.getG().mul(leftPart).add(this.publicKey.point)); + } catch (e) { + return this._deriveWithNumber(index + 1); + } + + var derived = new HDPublicKey({ + network: this.network, + depth: this.depth + 1, + parentFingerPrint: this.fingerPrint, + childIndex: index, + chainCode: chainCode, + publicKey: publicKey + }); + + return derived; +}; + +HDPublicKey.prototype._deriveFromString = function(path) { + /* jshint maxcomplexity: 8 */ + if (_.includes(path, "'")) { + throw new hdErrors.InvalidIndexCantDeriveHardened(); + } else if (!HDPublicKey.isValidPath(path)) { + throw new hdErrors.InvalidPath(path); + } + + var indexes = HDPrivateKey._getDerivationIndexes(path); + var derived = indexes.reduce(function(prev, index) { + return prev._deriveWithNumber(index); + }, this); + + return derived; +}; + +/** + * Verifies that a given serialized public key in base58 with checksum format + * is valid. + * + * @param {string|Buffer} data - the serialized public key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {boolean} + */ +HDPublicKey.isValidSerialized = function(data, network) { + return _.isNull(HDPublicKey.getSerializedError(data, network)); +}; + +/** + * Checks what's the error that causes the validation of a serialized public key + * in base58 with checksum to fail. + * + * @param {string|Buffer} data - the serialized public key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {errors|null} + */ +HDPublicKey.getSerializedError = function(data, network) { + /* jshint maxcomplexity: 10 */ + /* jshint maxstatements: 20 */ + if (!(_.isString(data) || BufferUtil.isBuffer(data))) { + return new hdErrors.UnrecognizedArgument('expected buffer or string'); + } + if (!Base58.validCharacters(data)) { + return new errors.InvalidB58Char('(unknown)', data); + } + try { + data = Base58Check.decode(data); + } catch (e) { + return new errors.InvalidB58Checksum(data); + } + if (data.length !== HDPublicKey.DataSize) { + return new hdErrors.InvalidLength(data); + } + if (!_.isUndefined(network)) { + var error = HDPublicKey._validateNetwork(data, network); + if (error) { + return error; + } + } + var version = BufferUtil.integerFromBuffer(data.slice(0, 4)); + if (version === Network.livenet.xprivkey || version === Network.testnet.xprivkey ) { + return new hdErrors.ArgumentIsPrivateExtended(); + } + return null; +}; + +HDPublicKey._validateNetwork = function(data, networkArg) { + var network = Network.get(networkArg); + if (!network) { + return new errors.InvalidNetworkArgument(networkArg); + } + var version = data.slice(HDPublicKey.VersionStart, HDPublicKey.VersionEnd); + if (BufferUtil.integerFromBuffer(version) !== network.xpubkey) { + return new errors.InvalidNetwork(version); + } + return null; +}; + +HDPublicKey.prototype._buildFromPrivate = function (arg) { + var args = _.clone(arg._buffers); + var point = Point.getG().mul(BN.fromBuffer(args.privateKey)); + args.publicKey = Point.pointToCompressed(point); + args.version = BufferUtil.integerAsBuffer(Network.get(BufferUtil.integerFromBuffer(args.version)).xpubkey); + args.privateKey = undefined; + args.checksum = undefined; + args.xprivkey = undefined; + return this._buildFromBuffers(args); +}; + +HDPublicKey.prototype._buildFromObject = function(arg) { + /* jshint maxcomplexity: 10 */ + // TODO: Type validation + var buffers = { + version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xpubkey) : arg.version, + depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth, + parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint, + childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex, + chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode, + publicKey: _.isString(arg.publicKey) ? BufferUtil.hexToBuffer(arg.publicKey) : + BufferUtil.isBuffer(arg.publicKey) ? arg.publicKey : arg.publicKey.toBuffer(), + checksum: _.isNumber(arg.checksum) ? BufferUtil.integerAsBuffer(arg.checksum) : arg.checksum + }; + return this._buildFromBuffers(buffers); +}; + +HDPublicKey.prototype._buildFromSerialized = function(arg) { + var decoded = Base58Check.decode(arg); + var buffers = { + version: decoded.slice(HDPublicKey.VersionStart, HDPublicKey.VersionEnd), + depth: decoded.slice(HDPublicKey.DepthStart, HDPublicKey.DepthEnd), + parentFingerPrint: decoded.slice(HDPublicKey.ParentFingerPrintStart, + HDPublicKey.ParentFingerPrintEnd), + childIndex: decoded.slice(HDPublicKey.ChildIndexStart, HDPublicKey.ChildIndexEnd), + chainCode: decoded.slice(HDPublicKey.ChainCodeStart, HDPublicKey.ChainCodeEnd), + publicKey: decoded.slice(HDPublicKey.PublicKeyStart, HDPublicKey.PublicKeyEnd), + checksum: decoded.slice(HDPublicKey.ChecksumStart, HDPublicKey.ChecksumEnd), + xpubkey: arg + }; + return this._buildFromBuffers(buffers); +}; + +/** + * Receives a object with buffers in all the properties and populates the + * internal structure + * + * @param {Object} arg + * @param {buffer.Buffer} arg.version + * @param {buffer.Buffer} arg.depth + * @param {buffer.Buffer} arg.parentFingerPrint + * @param {buffer.Buffer} arg.childIndex + * @param {buffer.Buffer} arg.chainCode + * @param {buffer.Buffer} arg.publicKey + * @param {buffer.Buffer} arg.checksum + * @param {string=} arg.xpubkey - if set, don't recalculate the base58 + * representation + * @return {HDPublicKey} this + */ +HDPublicKey.prototype._buildFromBuffers = function(arg) { + /* jshint maxcomplexity: 8 */ + /* jshint maxstatements: 20 */ + + HDPublicKey._validateBufferArguments(arg); + + JSUtil.defineImmutable(this, { + _buffers: arg + }); + + var sequence = [ + arg.version, arg.depth, arg.parentFingerPrint, arg.childIndex, arg.chainCode, + arg.publicKey + ]; + var concat = BufferUtil.concat(sequence); + var checksum = Base58Check.checksum(concat); + if (!arg.checksum || !arg.checksum.length) { + arg.checksum = checksum; + } else { + if (arg.checksum.toString('hex') !== checksum.toString('hex')) { + throw new errors.InvalidB58Checksum(concat, checksum); + } + } + var network = Network.get(BufferUtil.integerFromBuffer(arg.version)); + + var xpubkey; + xpubkey = Base58Check.encode(BufferUtil.concat(sequence)); + arg.xpubkey = new Buffer(xpubkey); + + var publicKey = new PublicKey(arg.publicKey, {network: network}); + var size = HDPublicKey.ParentFingerPrintSize; + var fingerPrint = Hash.sha256ripemd160(publicKey.toBuffer()).slice(0, size); + + JSUtil.defineImmutable(this, { + xpubkey: xpubkey, + network: network, + depth: BufferUtil.integerFromSingleByteBuffer(arg.depth), + publicKey: publicKey, + fingerPrint: fingerPrint + }); + + return this; +}; + +HDPublicKey._validateBufferArguments = function(arg) { + var checkBuffer = function(name, size) { + var buff = arg[name]; + assert(BufferUtil.isBuffer(buff), name + ' argument is not a buffer, it\'s ' + typeof buff); + assert( + buff.length === size, + name + ' has not the expected size: found ' + buff.length + ', expected ' + size + ); + }; + checkBuffer('version', HDPublicKey.VersionSize); + checkBuffer('depth', HDPublicKey.DepthSize); + checkBuffer('parentFingerPrint', HDPublicKey.ParentFingerPrintSize); + checkBuffer('childIndex', HDPublicKey.ChildIndexSize); + checkBuffer('chainCode', HDPublicKey.ChainCodeSize); + checkBuffer('publicKey', HDPublicKey.PublicKeySize); + if (arg.checksum && arg.checksum.length) { + checkBuffer('checksum', HDPublicKey.CheckSumSize); + } +}; + +HDPublicKey.fromString = function(arg) { + $.checkArgument(_.isString(arg), 'No valid string was provided'); + return new HDPublicKey(arg); +}; + +HDPublicKey.fromObject = function(arg) { + $.checkArgument(_.isObject(arg), 'No valid argument was provided'); + return new HDPublicKey(arg); +}; + +/** + * Returns the base58 checked representation of the public key + * @return {string} a string starting with "xpub..." in livenet + */ +HDPublicKey.prototype.toString = function() { + return this.xpubkey; +}; + +/** + * Returns the console representation of this extended public key. + * @return string + */ +HDPublicKey.prototype.inspect = function() { + return ''; +}; + +/** + * Returns a plain JavaScript object with information to reconstruct a key. + * + * Fields are:
    + *
  • network: 'livenet' or 'testnet' + *
  • depth: a number from 0 to 255, the depth to the master extended key + *
  • fingerPrint: a number of 32 bits taken from the hash of the public key + *
  • fingerPrint: a number of 32 bits taken from the hash of this key's + *
  • parent's public key + *
  • childIndex: index with which this key was derived + *
  • chainCode: string in hexa encoding used for derivation + *
  • publicKey: string, hexa encoded, in compressed key format + *
  • checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + *
  • xpubkey: the string with the base58 representation of this extended key + *
  • checksum: the base58 checksum of xpubkey + *
+ */ +HDPublicKey.prototype.toObject = HDPublicKey.prototype.toJSON = function toObject() { + return { + network: Network.get(BufferUtil.integerFromBuffer(this._buffers.version)).name, + depth: BufferUtil.integerFromSingleByteBuffer(this._buffers.depth), + fingerPrint: BufferUtil.integerFromBuffer(this.fingerPrint), + parentFingerPrint: BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint), + childIndex: BufferUtil.integerFromBuffer(this._buffers.childIndex), + chainCode: BufferUtil.bufferToHex(this._buffers.chainCode), + publicKey: this.publicKey.toString(), + checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + xpubkey: this.xpubkey + }; +}; + +/** + * Create a HDPublicKey from a buffer argument + * + * @param {Buffer} arg + * @return {HDPublicKey} + */ +HDPublicKey.fromBuffer = function(arg) { + return new HDPublicKey(arg); +}; + +/** + * Return a buffer representation of the xpubkey + * + * @return {Buffer} + */ +HDPublicKey.prototype.toBuffer = function() { + return BufferUtil.copy(this._buffers.xpubkey); +}; + +HDPublicKey.Hardened = 0x80000000; +HDPublicKey.RootElementAlias = ['m', 'M']; + +HDPublicKey.VersionSize = 4; +HDPublicKey.DepthSize = 1; +HDPublicKey.ParentFingerPrintSize = 4; +HDPublicKey.ChildIndexSize = 4; +HDPublicKey.ChainCodeSize = 32; +HDPublicKey.PublicKeySize = 33; +HDPublicKey.CheckSumSize = 4; + +HDPublicKey.DataSize = 78; +HDPublicKey.SerializedByteSize = 82; + +HDPublicKey.VersionStart = 0; +HDPublicKey.VersionEnd = HDPublicKey.VersionStart + HDPublicKey.VersionSize; +HDPublicKey.DepthStart = HDPublicKey.VersionEnd; +HDPublicKey.DepthEnd = HDPublicKey.DepthStart + HDPublicKey.DepthSize; +HDPublicKey.ParentFingerPrintStart = HDPublicKey.DepthEnd; +HDPublicKey.ParentFingerPrintEnd = HDPublicKey.ParentFingerPrintStart + HDPublicKey.ParentFingerPrintSize; +HDPublicKey.ChildIndexStart = HDPublicKey.ParentFingerPrintEnd; +HDPublicKey.ChildIndexEnd = HDPublicKey.ChildIndexStart + HDPublicKey.ChildIndexSize; +HDPublicKey.ChainCodeStart = HDPublicKey.ChildIndexEnd; +HDPublicKey.ChainCodeEnd = HDPublicKey.ChainCodeStart + HDPublicKey.ChainCodeSize; +HDPublicKey.PublicKeyStart = HDPublicKey.ChainCodeEnd; +HDPublicKey.PublicKeyEnd = HDPublicKey.PublicKeyStart + HDPublicKey.PublicKeySize; +HDPublicKey.ChecksumStart = HDPublicKey.PublicKeyEnd; +HDPublicKey.ChecksumEnd = HDPublicKey.ChecksumStart + HDPublicKey.CheckSumSize; + +assert(HDPublicKey.PublicKeyEnd === HDPublicKey.DataSize); +assert(HDPublicKey.ChecksumEnd === HDPublicKey.SerializedByteSize); + +module.exports = HDPublicKey; + +}).call(this,require("buffer").Buffer) +},{"./crypto/bn":6,"./crypto/hash":8,"./crypto/point":9,"./encoding/base58":12,"./encoding/base58check":13,"./errors":17,"./hdprivatekey":19,"./networks":21,"./publickey":24,"./util/buffer":42,"./util/js":43,"./util/preconditions":44,"assert":45,"buffer":47,"lodash":319}],21:[function(require,module,exports){ +'use strict'; +var _ = require('lodash'); + +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); +var networks = []; +var networkMaps = {}; + +/** + * A network is merely a map containing values that correspond to version + * numbers for each bitcoin network. Currently only supporting "livenet" + * (a.k.a. "mainnet") and "testnet". + * @constructor + */ +function Network() {} + +Network.prototype.toString = function toString() { + return this.name; +}; + +/** + * @function + * @member Networks#get + * Retrieves the network associated with a magic number or string. + * @param {string|number|Network} arg + * @param {string|Array} keys - if set, only check if the magic number associated with this name matches + * @return Network + */ +function get(arg, keys) { + if (~networks.indexOf(arg)) { + return arg; + } + if (keys) { + if (!_.isArray(keys)) { + keys = [keys]; + } + var containsArg = function(key) { + return networks[index][key] === arg; + }; + for (var index in networks) { + if (_.some(keys, containsArg)) { + return networks[index]; + } + } + return undefined; + } + return networkMaps[arg]; +} + +/** + * @function + * @member Networks#add + * Will add a custom Network + * @param {Object} data + * @param {string} data.name - The name of the network + * @param {string} data.alias - The aliased name of the network + * @param {Number} data.pubkeyhash - The publickey hash prefix + * @param {Number} data.privatekey - The privatekey prefix + * @param {Number} data.scripthash - The scripthash prefix + * @param {Number} data.xpubkey - The extended public key magic + * @param {Number} data.xprivkey - The extended private key magic + * @param {Number} data.networkMagic - The network magic number + * @param {Number} data.port - The network port + * @param {Array} data.dnsSeeds - An array of dns seeds + * @return Network + */ +function addNetwork(data) { + + var network = new Network(); + + JSUtil.defineImmutable(network, { + name: data.name, + alias: data.alias, + pubkeyhash: data.pubkeyhash, + privatekey: data.privatekey, + scripthash: data.scripthash, + xpubkey: data.xpubkey, + xprivkey: data.xprivkey + }); + + if (data.networkMagic) { + JSUtil.defineImmutable(network, { + networkMagic: BufferUtil.integerAsBuffer(data.networkMagic) + }); + } + + if (data.port) { + JSUtil.defineImmutable(network, { + port: data.port + }); + } + + if (data.dnsSeeds) { + JSUtil.defineImmutable(network, { + dnsSeeds: data.dnsSeeds + }); + } + _.each(network, function(value) { + if (!_.isUndefined(value) && !_.isObject(value)) { + networkMaps[value] = network; + } + }); + + networks.push(network); + + return network; + +} + +/** + * @function + * @member Networks#remove + * Will remove a custom network + * @param {Network} network + */ +function removeNetwork(network) { + for (var i = 0; i < networks.length; i++) { + if (networks[i] === network) { + networks.splice(i, 1); + } + } + for (var key in networkMaps) { + if (networkMaps[key] === network) { + delete networkMaps[key]; + } + } +} + +addNetwork({ + name: 'livenet', + alias: 'mainnet', + pubkeyhash: 0x00, + privatekey: 0x80, + scripthash: 0x05, + xpubkey: 0x0488b21e, + xprivkey: 0x0488ade4, + networkMagic: 0xf9beb4d9, + port: 8333, + dnsSeeds: [ + 'seed.bitcoin.sipa.be', + 'dnsseed.bluematt.me', + 'dnsseed.bitcoin.dashjr.org', + 'seed.bitcoinstats.com', + 'seed.bitnodes.io', + 'bitseed.xf2.org' + ] +}); + +/** + * @instance + * @member Networks#livenet + */ +var livenet = get('livenet'); + +addNetwork({ + name: 'testnet', + alias: 'regtest', + pubkeyhash: 0x6f, + privatekey: 0xef, + scripthash: 0xc4, + xpubkey: 0x043587cf, + xprivkey: 0x04358394 +}); + +/** + * @instance + * @member Networks#testnet + */ +var testnet = get('testnet'); + +// Add configurable values for testnet/regtest + +var TESTNET = { + PORT: 18333, + NETWORK_MAGIC: BufferUtil.integerAsBuffer(0x0b110907), + DNS_SEEDS: [ + 'testnet-seed.bitcoin.petertodd.org', + 'testnet-seed.bluematt.me', + 'testnet-seed.alexykot.me', + 'testnet-seed.bitcoin.schildbach.de' + ] +}; + +for (var key in TESTNET) { + if (!_.isObject(TESTNET[key])) { + networkMaps[TESTNET[key]] = testnet; + } +} + +var REGTEST = { + PORT: 18444, + NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfabfb5da), + DNS_SEEDS: [] +}; + +for (var key in REGTEST) { + if (!_.isObject(REGTEST[key])) { + networkMaps[REGTEST[key]] = testnet; + } +} + +Object.defineProperty(testnet, 'port', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.PORT; + } else { + return TESTNET.PORT; + } + } +}); + +Object.defineProperty(testnet, 'networkMagic', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.NETWORK_MAGIC; + } else { + return TESTNET.NETWORK_MAGIC; + } + } +}); + +Object.defineProperty(testnet, 'dnsSeeds', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.DNS_SEEDS; + } else { + return TESTNET.DNS_SEEDS; + } + } +}); + +/** + * @function + * @member Networks#enableRegtest + * Will enable regtest features for testnet + */ +function enableRegtest() { + testnet.regtestEnabled = true; +} + +/** + * @function + * @member Networks#disableRegtest + * Will disable regtest features for testnet + */ +function disableRegtest() { + testnet.regtestEnabled = false; +} + +/** + * @namespace Networks + */ +module.exports = { + add: addNetwork, + remove: removeNetwork, + defaultNetwork: livenet, + livenet: livenet, + mainnet: livenet, + testnet: testnet, + get: get, + enableRegtest: enableRegtest, + disableRegtest: disableRegtest +}; + +},{"./util/buffer":42,"./util/js":43,"lodash":319}],22:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var $ = require('./util/preconditions'); +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); + +function Opcode(num) { + if (!(this instanceof Opcode)) { + return new Opcode(num); + } + + var value; + + if (_.isNumber(num)) { + value = num; + } else if (_.isString(num)) { + value = Opcode.map[num]; + } else { + throw new TypeError('Unrecognized num type: "' + typeof(num) + '" for Opcode'); + } + + JSUtil.defineImmutable(this, { + num: value + }); + + return this; +} + +Opcode.fromBuffer = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return new Opcode(Number('0x' + buf.toString('hex'))); +}; + +Opcode.fromNumber = function(num) { + $.checkArgument(_.isNumber(num)); + return new Opcode(num); +}; + +Opcode.fromString = function(str) { + $.checkArgument(_.isString(str)); + var value = Opcode.map[str]; + if (typeof value === 'undefined') { + throw new TypeError('Invalid opcodestr'); + } + return new Opcode(value); +}; + +Opcode.prototype.toHex = function() { + return this.num.toString(16); +}; + +Opcode.prototype.toBuffer = function() { + return new Buffer(this.toHex(), 'hex'); +}; + +Opcode.prototype.toNumber = function() { + return this.num; +}; + +Opcode.prototype.toString = function() { + var str = Opcode.reverseMap[this.num]; + if (typeof str === 'undefined') { + throw new Error('Opcode does not have a string representation'); + } + return str; +}; + +Opcode.smallInt = function(n) { + $.checkArgument(_.isNumber(n), 'Invalid Argument: n should be number'); + $.checkArgument(n >= 0 && n <= 16, 'Invalid Argument: n must be between 0 and 16'); + if (n === 0) { + return Opcode('OP_0'); + } + return new Opcode(Opcode.map.OP_1 + n - 1); +}; + +Opcode.map = { + // push value + OP_FALSE: 0, + OP_0: 0, + OP_PUSHDATA1: 76, + OP_PUSHDATA2: 77, + OP_PUSHDATA4: 78, + OP_1NEGATE: 79, + OP_RESERVED: 80, + OP_TRUE: 81, + OP_1: 81, + OP_2: 82, + OP_3: 83, + OP_4: 84, + OP_5: 85, + OP_6: 86, + OP_7: 87, + OP_8: 88, + OP_9: 89, + OP_10: 90, + OP_11: 91, + OP_12: 92, + OP_13: 93, + OP_14: 94, + OP_15: 95, + OP_16: 96, + + // control + OP_NOP: 97, + OP_VER: 98, + OP_IF: 99, + OP_NOTIF: 100, + OP_VERIF: 101, + OP_VERNOTIF: 102, + OP_ELSE: 103, + OP_ENDIF: 104, + OP_VERIFY: 105, + OP_RETURN: 106, + + // stack ops + OP_TOALTSTACK: 107, + OP_FROMALTSTACK: 108, + OP_2DROP: 109, + OP_2DUP: 110, + OP_3DUP: 111, + OP_2OVER: 112, + OP_2ROT: 113, + OP_2SWAP: 114, + OP_IFDUP: 115, + OP_DEPTH: 116, + OP_DROP: 117, + OP_DUP: 118, + OP_NIP: 119, + OP_OVER: 120, + OP_PICK: 121, + OP_ROLL: 122, + OP_ROT: 123, + OP_SWAP: 124, + OP_TUCK: 125, + + // splice ops + OP_CAT: 126, + OP_SUBSTR: 127, + OP_LEFT: 128, + OP_RIGHT: 129, + OP_SIZE: 130, + + // bit logic + OP_INVERT: 131, + OP_AND: 132, + OP_OR: 133, + OP_XOR: 134, + OP_EQUAL: 135, + OP_EQUALVERIFY: 136, + OP_RESERVED1: 137, + OP_RESERVED2: 138, + + // numeric + OP_1ADD: 139, + OP_1SUB: 140, + OP_2MUL: 141, + OP_2DIV: 142, + OP_NEGATE: 143, + OP_ABS: 144, + OP_NOT: 145, + OP_0NOTEQUAL: 146, + + OP_ADD: 147, + OP_SUB: 148, + OP_MUL: 149, + OP_DIV: 150, + OP_MOD: 151, + OP_LSHIFT: 152, + OP_RSHIFT: 153, + + OP_BOOLAND: 154, + OP_BOOLOR: 155, + OP_NUMEQUAL: 156, + OP_NUMEQUALVERIFY: 157, + OP_NUMNOTEQUAL: 158, + OP_LESSTHAN: 159, + OP_GREATERTHAN: 160, + OP_LESSTHANOREQUAL: 161, + OP_GREATERTHANOREQUAL: 162, + OP_MIN: 163, + OP_MAX: 164, + + OP_WITHIN: 165, + + // crypto + OP_RIPEMD160: 166, + OP_SHA1: 167, + OP_SHA256: 168, + OP_HASH160: 169, + OP_HASH256: 170, + OP_CODESEPARATOR: 171, + OP_CHECKSIG: 172, + OP_CHECKSIGVERIFY: 173, + OP_CHECKMULTISIG: 174, + OP_CHECKMULTISIGVERIFY: 175, + + OP_CHECKLOCKTIMEVERIFY: 177, + + // expansion + OP_NOP1: 176, + OP_NOP2: 177, + OP_NOP3: 178, + OP_NOP4: 179, + OP_NOP5: 180, + OP_NOP6: 181, + OP_NOP7: 182, + OP_NOP8: 183, + OP_NOP9: 184, + OP_NOP10: 185, + + // template matching params + OP_PUBKEYHASH: 253, + OP_PUBKEY: 254, + OP_INVALIDOPCODE: 255 +}; + +Opcode.reverseMap = []; + +for (var k in Opcode.map) { + Opcode.reverseMap[Opcode.map[k]] = k; +} + +// Easier access to opcodes +_.extend(Opcode, Opcode.map); + +/** + * @returns true if opcode is one of OP_0, OP_1, ..., OP_16 + */ +Opcode.isSmallIntOp = function(opcode) { + if (opcode instanceof Opcode) { + opcode = opcode.toNumber(); + } + return ((opcode === Opcode.map.OP_0) || + ((opcode >= Opcode.map.OP_1) && (opcode <= Opcode.map.OP_16))); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Script opcode + */ +Opcode.prototype.inspect = function() { + return ''; +}; + +module.exports = Opcode; + +}).call(this,require("buffer").Buffer) +},{"./util/buffer":42,"./util/js":43,"./util/preconditions":44,"buffer":47,"lodash":319}],23:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var Address = require('./address'); +var Base58Check = require('./encoding/base58check'); +var BN = require('./crypto/bn'); +var JSUtil = require('./util/js'); +var Networks = require('./networks'); +var Point = require('./crypto/point'); +var PublicKey = require('./publickey'); +var Random = require('./crypto/random'); +var $ = require('./util/preconditions'); + +/** + * Instantiate a PrivateKey from a BN, Buffer and WIF. + * + * @example + * ```javascript + * // generate a new random key + * var key = PrivateKey(); + * + * // get the associated address + * var address = key.toAddress(); + * + * // encode into wallet export format + * var exported = key.toWIF(); + * + * // instantiate from the exported (and saved) private key + * var imported = PrivateKey.fromWIF(exported); + * ``` + * + * @param {string} data - The encoded data in various formats + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {PrivateKey} A new valid instance of an PrivateKey + * @constructor + */ +function PrivateKey(data, network) { + /* jshint maxstatements: 20 */ + /* jshint maxcomplexity: 8 */ + + if (!(this instanceof PrivateKey)) { + return new PrivateKey(data, network); + } + if (data instanceof PrivateKey) { + return data; + } + + var info = this._classifyArguments(data, network); + + // validation + if (!info.bn || info.bn.cmp(new BN(0)) === 0){ + throw new TypeError('Number can not be equal to zero, undefined, null or false'); + } + if (!info.bn.lt(Point.getN())) { + throw new TypeError('Number must be less than N'); + } + if (typeof(info.network) === 'undefined') { + throw new TypeError('Must specify the network ("livenet" or "testnet")'); + } + + JSUtil.defineImmutable(this, { + bn: info.bn, + compressed: info.compressed, + network: info.network + }); + + Object.defineProperty(this, 'publicKey', { + configurable: false, + enumerable: true, + get: this.toPublicKey.bind(this) + }); + + return this; + +}; + +/** + * Internal helper to instantiate PrivateKey internal `info` object from + * different kinds of arguments passed to the constructor. + * + * @param {*} data + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @return {Object} + */ +PrivateKey.prototype._classifyArguments = function(data, network) { + /* jshint maxcomplexity: 10 */ + var info = { + compressed: true, + network: network ? Networks.get(network) : Networks.defaultNetwork + }; + + // detect type of data + if (_.isUndefined(data) || _.isNull(data)){ + info.bn = PrivateKey._getRandomBN(); + } else if (data instanceof BN) { + info.bn = data; + } else if (data instanceof Buffer || data instanceof Uint8Array) { + info = PrivateKey._transformBuffer(data, network); + } else if (data.bn && data.network){ + info = PrivateKey._transformObject(data); + } else if (!network && Networks.get(data)) { + info.bn = PrivateKey._getRandomBN(); + info.network = Networks.get(data); + } else if (typeof(data) === 'string'){ + if (JSUtil.isHexa(data)) { + info.bn = new BN(new Buffer(data, 'hex')); + } else { + info = PrivateKey._transformWIF(data, network); + } + } else { + throw new TypeError('First argument is an unrecognized data type.'); + } + return info; +}; + +/** + * Internal function to get a random Big Number (BN) + * + * @returns {BN} A new randomly generated BN + * @private + */ +PrivateKey._getRandomBN = function(){ + var condition; + var bn; + do { + var privbuf = Random.getRandomBuffer(32); + bn = BN.fromBuffer(privbuf); + condition = bn.lt(Point.getN()); + } while (!condition); + return bn; +}; + +/** + * Internal function to transform a WIF Buffer into a private key + * + * @param {Buffer} buf - An WIF string + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {Object} An object with keys: bn, network and compressed + * @private + */ +PrivateKey._transformBuffer = function(buf, network) { + + var info = {}; + + if (buf.length === 32) { + return PrivateKey._transformBNBuffer(buf, network); + } + + info.network = Networks.get(buf[0], 'privatekey'); + + if (!info.network) { + throw new Error('Invalid network'); + } + + if (network && info.network !== Networks.get(network)) { + throw new TypeError('Private key network mismatch'); + } + + if (buf.length === 1 + 32 + 1 && buf[1 + 32 + 1 - 1] === 1) { + info.compressed = true; + } else if (buf.length === 1 + 32) { + info.compressed = false; + } else { + throw new Error('Length of buffer must be 33 (uncompressed) or 34 (compressed)'); + } + + info.bn = BN.fromBuffer(buf.slice(1, 32 + 1)); + + return info; +}; + +/** + * Internal function to transform a BN buffer into a private key + * + * @param {Buffer} buf + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {object} an Object with keys: bn, network, and compressed + * @private + */ +PrivateKey._transformBNBuffer = function(buf, network) { + var info = {}; + info.network = Networks.get(network) || Networks.defaultNetwork; + info.bn = BN.fromBuffer(buf); + info.compressed = false; + return info; +}; + +/** + * Internal function to transform a WIF string into a private key + * + * @param {string} buf - An WIF string + * @returns {Object} An object with keys: bn, network and compressed + * @private + */ +PrivateKey._transformWIF = function(str, network) { + return PrivateKey._transformBuffer(Base58Check.decode(str), network); +}; + +/** + * Instantiate a PrivateKey from a Buffer with the DER or WIF representation + * + * @param {Buffer} arg + * @param {Network} network + * @return {PrivateKey} + */ +PrivateKey.fromBuffer = function(arg, network) { + return new PrivateKey(arg, network); +}; + +/** + * Internal function to transform a JSON string on plain object into a private key + * return this. + * + * @param {string} json - A JSON string or plain object + * @returns {Object} An object with keys: bn, network and compressed + * @private + */ +PrivateKey._transformObject = function(json) { + var bn = new BN(json.bn, 'hex'); + var network = Networks.get(json.network); + return { + bn: bn, + network: network, + compressed: json.compressed + }; +}; + +/** + * Instantiate a PrivateKey from a WIF string + * + * @param {string} str - The WIF encoded private key string + * @returns {PrivateKey} A new valid instance of PrivateKey + */ +PrivateKey.fromString = PrivateKey.fromWIF = function(str) { + $.checkArgument(_.isString(str), 'First argument is expected to be a string.'); + return new PrivateKey(str); +}; + +/** + * Instantiate a PrivateKey from a plain JavaScript object + * + * @param {Object} obj - The output from privateKey.toObject() + */ +PrivateKey.fromObject = function(obj) { + $.checkArgument(_.isObject(obj), 'First argument is expected to be an object.'); + return new PrivateKey(obj); +}; + +/** + * Instantiate a PrivateKey from random bytes + * + * @param {string=} network - Either "livenet" or "testnet" + * @returns {PrivateKey} A new valid instance of PrivateKey + */ +PrivateKey.fromRandom = function(network) { + var bn = PrivateKey._getRandomBN(); + return new PrivateKey(bn, network); +}; + +/** + * Check if there would be any errors when initializing a PrivateKey + * + * @param {string} data - The encoded data in various formats + * @param {string=} network - Either "livenet" or "testnet" + * @returns {null|Error} An error if exists + */ + +PrivateKey.getValidationError = function(data, network) { + var error; + try { + /* jshint nonew: false */ + new PrivateKey(data, network); + } catch (e) { + error = e; + } + return error; +}; + +/** + * Check if the parameters are valid + * + * @param {string} data - The encoded data in various formats + * @param {string=} network - Either "livenet" or "testnet" + * @returns {Boolean} If the private key is would be valid + */ +PrivateKey.isValid = function(data, network){ + if (!data) { + return false; + } + return !PrivateKey.getValidationError(data, network); +}; + +/** + * Will output the PrivateKey encoded as hex string + * + * @returns {string} + */ +PrivateKey.prototype.toString = function() { + return this.toBuffer().toString('hex'); +}; + +/** + * Will output the PrivateKey to a WIF string + * + * @returns {string} A WIP representation of the private key + */ +PrivateKey.prototype.toWIF = function() { + var network = this.network; + var compressed = this.compressed; + + var buf; + if (compressed) { + buf = Buffer.concat([new Buffer([network.privatekey]), + this.bn.toBuffer({size: 32}), + new Buffer([0x01])]); + } else { + buf = Buffer.concat([new Buffer([network.privatekey]), + this.bn.toBuffer({size: 32})]); + } + + return Base58Check.encode(buf); +}; + +/** + * Will return the private key as a BN instance + * + * @returns {BN} A BN instance of the private key + */ +PrivateKey.prototype.toBigNumber = function(){ + return this.bn; +}; + +/** + * Will return the private key as a BN buffer + * + * @returns {Buffer} A buffer of the private key + */ +PrivateKey.prototype.toBuffer = function(){ + // TODO: use `return this.bn.toBuffer({ size: 32 })` in v1.0.0 + return this.bn.toBuffer(); +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0. + * + * + * Will return the private key as a BN buffer without leading zero padding + * + * @returns {Buffer} A buffer of the private key + */ +PrivateKey.prototype.toBufferNoPadding = function() { + return this.bn.toBuffer(); +}; + +/** + * Will return the corresponding public key + * + * @returns {PublicKey} A public key generated from the private key + */ +PrivateKey.prototype.toPublicKey = function(){ + if (!this._pubkey) { + this._pubkey = PublicKey.fromPrivateKey(this); + } + return this._pubkey; +}; + +/** + * Will return an address for the private key + * @param {Network=} network - optional parameter specifying + * the desired network for the address + * + * @returns {Address} An address generated from the private key + */ +PrivateKey.prototype.toAddress = function(network) { + var pubkey = this.toPublicKey(); + return Address.fromPublicKey(pubkey, network || this.network); +}; + +/** + * @returns {Object} A plain object representation + */ +PrivateKey.prototype.toObject = PrivateKey.prototype.toJSON = function toObject() { + return { + bn: this.bn.toString('hex'), + compressed: this.compressed, + network: this.network.toString() + }; +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Private key + */ +PrivateKey.prototype.inspect = function() { + var uncompressed = !this.compressed ? ', uncompressed' : ''; + return ''; +}; + +module.exports = PrivateKey; + +}).call(this,require("buffer").Buffer) +},{"./address":1,"./crypto/bn":6,"./crypto/point":9,"./crypto/random":10,"./encoding/base58check":13,"./networks":21,"./publickey":24,"./util/js":43,"./util/preconditions":44,"buffer":47,"lodash":319}],24:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var BN = require('./crypto/bn'); +var Point = require('./crypto/point'); +var Hash = require('./crypto/hash'); +var JSUtil = require('./util/js'); +var Network = require('./networks'); +var _ = require('lodash'); +var $ = require('./util/preconditions'); + +/** + * Instantiate a PublicKey from a {@link PrivateKey}, {@link Point}, `string`, or `Buffer`. + * + * There are two internal properties, `network` and `compressed`, that deal with importing + * a PublicKey from a PrivateKey in WIF format. More details described on {@link PrivateKey} + * + * @example + * ```javascript + * // instantiate from a private key + * var key = PublicKey(privateKey, true); + * + * // export to as a DER hex encoded string + * var exported = key.toString(); + * + * // import the public key + * var imported = PublicKey.fromString(exported); + * ``` + * + * @param {string} data - The encoded data in various formats + * @param {Object} extra - additional options + * @param {Network=} extra.network - Which network should the address for this public key be for + * @param {String=} extra.compressed - If the public key is compressed + * @returns {PublicKey} A new valid instance of an PublicKey + * @constructor + */ +function PublicKey(data, extra) { + + if (!(this instanceof PublicKey)) { + return new PublicKey(data, extra); + } + + $.checkArgument(data, 'First argument is required, please include public key data.'); + + if (data instanceof PublicKey) { + // Return copy, but as it's an immutable object, return same argument + return data; + } + extra = extra || {}; + + var info = this._classifyArgs(data, extra); + + // validation + info.point.validate(); + + JSUtil.defineImmutable(this, { + point: info.point, + compressed: info.compressed, + network: info.network || Network.defaultNetwork + }); + + return this; +}; + +/** + * Internal function to differentiate between arguments passed to the constructor + * @param {*} data + * @param {Object} extra + */ +PublicKey.prototype._classifyArgs = function(data, extra) { + /* jshint maxcomplexity: 10 */ + var info = { + compressed: _.isUndefined(extra.compressed) || extra.compressed + }; + + // detect type of data + if (data instanceof Point) { + info.point = data; + } else if (data.x && data.y) { + info = PublicKey._transformObject(data); + } else if (typeof(data) === 'string') { + info = PublicKey._transformDER(new Buffer(data, 'hex')); + } else if (PublicKey._isBuffer(data)) { + info = PublicKey._transformDER(data); + } else if (PublicKey._isPrivateKey(data)) { + info = PublicKey._transformPrivateKey(data); + } else { + throw new TypeError('First argument is an unrecognized data format.'); + } + if (!info.network) { + info.network = _.isUndefined(extra.network) ? undefined : Network.get(extra.network); + } + return info; +}; + +/** + * Internal function to detect if an object is a {@link PrivateKey} + * + * @param {*} param - object to test + * @returns {boolean} + * @private + */ +PublicKey._isPrivateKey = function(param) { + var PrivateKey = require('./privatekey'); + return param instanceof PrivateKey; +}; + +/** + * Internal function to detect if an object is a Buffer + * + * @param {*} param - object to test + * @returns {boolean} + * @private + */ +PublicKey._isBuffer = function(param) { + return (param instanceof Buffer) || (param instanceof Uint8Array); +}; + +/** + * Internal function to transform a private key into a public key point + * + * @param {PrivateKey} privkey - An instance of PrivateKey + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformPrivateKey = function(privkey) { + $.checkArgument(PublicKey._isPrivateKey(privkey), 'Must be an instance of PrivateKey'); + var info = {}; + info.point = Point.getG().mul(privkey.bn); + info.compressed = privkey.compressed; + info.network = privkey.network; + return info; +}; + +/** + * Internal function to transform DER into a public key point + * + * @param {Buffer} buf - An hex encoded buffer + * @param {bool=} strict - if set to false, will loosen some conditions + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformDER = function(buf, strict) { + /* jshint maxstatements: 30 */ + /* jshint maxcomplexity: 12 */ + $.checkArgument(PublicKey._isBuffer(buf), 'Must be a hex buffer of DER encoded public key'); + var info = {}; + + strict = _.isUndefined(strict) ? true : strict; + + var x; + var y; + var xbuf; + var ybuf; + + if (buf[0] === 0x04 || (!strict && (buf[0] === 0x06 || buf[0] === 0x07))) { + xbuf = buf.slice(1, 33); + ybuf = buf.slice(33, 65); + if (xbuf.length !== 32 || ybuf.length !== 32 || buf.length !== 65) { + throw new TypeError('Length of x and y must be 32 bytes'); + } + x = new BN(xbuf); + y = new BN(ybuf); + info.point = new Point(x, y); + info.compressed = false; + } else if (buf[0] === 0x03) { + xbuf = buf.slice(1); + x = new BN(xbuf); + info = PublicKey._transformX(true, x); + info.compressed = true; + } else if (buf[0] === 0x02) { + xbuf = buf.slice(1); + x = new BN(xbuf); + info = PublicKey._transformX(false, x); + info.compressed = true; + } else { + throw new TypeError('Invalid DER format public key'); + } + return info; +}; + +/** + * Internal function to transform X into a public key point + * + * @param {Boolean} odd - If the point is above or below the x axis + * @param {Point} x - The x point + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformX = function(odd, x) { + $.checkArgument(typeof odd === 'boolean', 'Must specify whether y is odd or not (true or false)'); + var info = {}; + info.point = Point.fromX(odd, x); + return info; +}; + +/** + * Internal function to transform a JSON into a public key point + * + * @param {String|Object} json - a JSON string or plain object + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformObject = function(json) { + var x = new BN(json.x, 'hex'); + var y = new BN(json.y, 'hex'); + var point = new Point(x, y); + return new PublicKey(point, { + compressed: json.compressed + }); +}; + +/** + * Instantiate a PublicKey from a PrivateKey + * + * @param {PrivateKey} privkey - An instance of PrivateKey + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromPrivateKey = function(privkey) { + $.checkArgument(PublicKey._isPrivateKey(privkey), 'Must be an instance of PrivateKey'); + var info = PublicKey._transformPrivateKey(privkey); + return new PublicKey(info.point, { + compressed: info.compressed, + network: info.network + }); +}; + +/** + * Instantiate a PublicKey from a Buffer + * @param {Buffer} buf - A DER hex buffer + * @param {bool=} strict - if set to false, will loosen some conditions + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromDER = PublicKey.fromBuffer = function(buf, strict) { + $.checkArgument(PublicKey._isBuffer(buf), 'Must be a hex buffer of DER encoded public key'); + var info = PublicKey._transformDER(buf, strict); + return new PublicKey(info.point, { + compressed: info.compressed + }); +}; + +/** + * Instantiate a PublicKey from a Point + * + * @param {Point} point - A Point instance + * @param {boolean=} compressed - whether to store this public key as compressed format + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromPoint = function(point, compressed) { + $.checkArgument(point instanceof Point, 'First argument must be an instance of Point.'); + return new PublicKey(point, { + compressed: compressed + }); +}; + +/** + * Instantiate a PublicKey from a DER hex encoded string + * + * @param {string} str - A DER hex string + * @param {String=} encoding - The type of string encoding + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromString = function(str, encoding) { + var buf = new Buffer(str, encoding || 'hex'); + var info = PublicKey._transformDER(buf); + return new PublicKey(info.point, { + compressed: info.compressed + }); +}; + +/** + * Instantiate a PublicKey from an X Point + * + * @param {Boolean} odd - If the point is above or below the x axis + * @param {Point} x - The x point + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromX = function(odd, x) { + var info = PublicKey._transformX(odd, x); + return new PublicKey(info.point, { + compressed: info.compressed + }); +}; + +/** + * Check if there would be any errors when initializing a PublicKey + * + * @param {string} data - The encoded data in various formats + * @returns {null|Error} An error if exists + */ +PublicKey.getValidationError = function(data) { + var error; + try { + /* jshint nonew: false */ + new PublicKey(data); + } catch (e) { + error = e; + } + return error; +}; + +/** + * Check if the parameters are valid + * + * @param {string} data - The encoded data in various formats + * @returns {Boolean} If the public key would be valid + */ +PublicKey.isValid = function(data) { + return !PublicKey.getValidationError(data); +}; + +/** + * @returns {Object} A plain object of the PublicKey + */ +PublicKey.prototype.toObject = PublicKey.prototype.toJSON = function toObject() { + return { + x: this.point.getX().toString('hex', 2), + y: this.point.getY().toString('hex', 2), + compressed: this.compressed + }; +}; + +/** + * Will output the PublicKey to a DER Buffer + * + * @returns {Buffer} A DER hex encoded buffer + */ +PublicKey.prototype.toBuffer = PublicKey.prototype.toDER = function() { + var x = this.point.getX(); + var y = this.point.getY(); + + var xbuf = x.toBuffer({ + size: 32 + }); + var ybuf = y.toBuffer({ + size: 32 + }); + + var prefix; + if (!this.compressed) { + prefix = new Buffer([0x04]); + return Buffer.concat([prefix, xbuf, ybuf]); + } else { + var odd = ybuf[ybuf.length - 1] % 2; + if (odd) { + prefix = new Buffer([0x03]); + } else { + prefix = new Buffer([0x02]); + } + return Buffer.concat([prefix, xbuf]); + } +}; + +/** + * Will return a sha256 + ripemd160 hash of the serialized public key + * @see https://github.com/bitcoin/bitcoin/blob/master/src/pubkey.h#L141 + * @returns {Buffer} + */ +PublicKey.prototype._getID = function _getID() { + return Hash.sha256ripemd160(this.toBuffer()); +}; + +/** + * Will return an address for the public key + * + * @param {String|Network=} network - Which network should the address be for + * @returns {Address} An address generated from the public key + */ +PublicKey.prototype.toAddress = function(network) { + var Address = require('./address'); + return Address.fromPublicKey(this, network || this.network); +}; + +/** + * Will output the PublicKey to a DER encoded hex string + * + * @returns {string} A DER hex encoded string + */ +PublicKey.prototype.toString = function() { + return this.toDER().toString('hex'); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Public key + */ +PublicKey.prototype.inspect = function() { + return ''; +}; + + +module.exports = PublicKey; + +}).call(this,require("buffer").Buffer) +},{"./address":1,"./crypto/bn":6,"./crypto/hash":8,"./crypto/point":9,"./networks":21,"./privatekey":23,"./util/js":43,"./util/preconditions":44,"buffer":47,"lodash":319}],25:[function(require,module,exports){ +module.exports = require('./script'); + +module.exports.Interpreter = require('./interpreter'); + +},{"./interpreter":26,"./script":27}],26:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); + +var Script = require('./script'); +var Opcode = require('../opcode'); +var BN = require('../crypto/bn'); +var Hash = require('../crypto/hash'); +var Signature = require('../crypto/signature'); +var PublicKey = require('../publickey'); + +/** + * Bitcoin transactions contain scripts. Each input has a script called the + * scriptSig, and each output has a script called the scriptPubkey. To validate + * an input, the input's script is concatenated with the referenced output script, + * and the result is executed. If at the end of execution the stack contains a + * "true" value, then the transaction is valid. + * + * The primary way to use this class is via the verify function. + * e.g., Interpreter().verify( ... ); + */ +var Interpreter = function Interpreter(obj) { + if (!(this instanceof Interpreter)) { + return new Interpreter(obj); + } + if (obj) { + this.initialize(); + this.set(obj); + } else { + this.initialize(); + } +}; + +/** + * Verifies a Script by executing it and returns true if it is valid. + * This function needs to be provided with the scriptSig and the scriptPubkey + * separately. + * @param {Script} scriptSig - the script's first part (corresponding to the tx input) + * @param {Script} scriptPubkey - the script's last part (corresponding to the tx output) + * @param {Transaction=} tx - the Transaction containing the scriptSig in one input (used + * to check signature validity for some opcodes like OP_CHECKSIG) + * @param {number} nin - index of the transaction input containing the scriptSig verified. + * @param {number} flags - evaluation flags. See Interpreter.SCRIPT_* constants + * + * Translated from bitcoind's VerifyScript + */ +Interpreter.prototype.verify = function(scriptSig, scriptPubkey, tx, nin, flags) { + var Transaction = require('../transaction'); + if (_.isUndefined(tx)) { + tx = new Transaction(); + } + if (_.isUndefined(nin)) { + nin = 0; + } + if (_.isUndefined(flags)) { + flags = 0; + } + this.set({ + script: scriptSig, + tx: tx, + nin: nin, + flags: flags + }); + var stackCopy; + + if ((flags & Interpreter.SCRIPT_VERIFY_SIGPUSHONLY) !== 0 && !scriptSig.isPushOnly()) { + this.errstr = 'SCRIPT_ERR_SIG_PUSHONLY'; + return false; + } + + // evaluate scriptSig + if (!this.evaluate()) { + return false; + } + + if (flags & Interpreter.SCRIPT_VERIFY_P2SH) { + stackCopy = this.stack.slice(); + } + + var stack = this.stack; + this.initialize(); + this.set({ + script: scriptPubkey, + stack: stack, + tx: tx, + nin: nin, + flags: flags + }); + + // evaluate scriptPubkey + if (!this.evaluate()) { + return false; + } + + if (this.stack.length === 0) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_NO_RESULT'; + return false; + } + + var buf = this.stack[this.stack.length - 1]; + if (!Interpreter.castToBool(buf)) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_STACK'; + return false; + } + + // Additional validation for spend-to-script-hash transactions: + if ((flags & Interpreter.SCRIPT_VERIFY_P2SH) && scriptPubkey.isScriptHashOut()) { + // scriptSig must be literals-only or validation fails + if (!scriptSig.isPushOnly()) { + this.errstr = 'SCRIPT_ERR_SIG_PUSHONLY'; + return false; + } + + // stackCopy cannot be empty here, because if it was the + // P2SH HASH <> EQUAL scriptPubKey would be evaluated with + // an empty stack and the EvalScript above would return false. + if (stackCopy.length === 0) { + throw new Error('internal error - stack copy empty'); + } + + var redeemScriptSerialized = stackCopy[stackCopy.length - 1]; + var redeemScript = Script.fromBuffer(redeemScriptSerialized); + stackCopy.pop(); + + this.initialize(); + this.set({ + script: redeemScript, + stack: stackCopy, + tx: tx, + nin: nin, + flags: flags + }); + + // evaluate redeemScript + if (!this.evaluate()) { + return false; + } + + if (stackCopy.length === 0) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK'; + return false; + } + + if (!Interpreter.castToBool(stackCopy[stackCopy.length - 1])) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK'; + return false; + } else { + return true; + } + } + + return true; +}; + +module.exports = Interpreter; + +Interpreter.prototype.initialize = function(obj) { + this.stack = []; + this.altstack = []; + this.pc = 0; + this.pbegincodehash = 0; + this.nOpCount = 0; + this.vfExec = []; + this.errstr = ''; + this.flags = 0; +}; + +Interpreter.prototype.set = function(obj) { + this.script = obj.script || this.script; + this.tx = obj.tx || this.tx; + this.nin = typeof obj.nin !== 'undefined' ? obj.nin : this.nin; + this.stack = obj.stack || this.stack; + this.altstack = obj.altack || this.altstack; + this.pc = typeof obj.pc !== 'undefined' ? obj.pc : this.pc; + this.pbegincodehash = typeof obj.pbegincodehash !== 'undefined' ? obj.pbegincodehash : this.pbegincodehash; + this.nOpCount = typeof obj.nOpCount !== 'undefined' ? obj.nOpCount : this.nOpCount; + this.vfExec = obj.vfExec || this.vfExec; + this.errstr = obj.errstr || this.errstr; + this.flags = typeof obj.flags !== 'undefined' ? obj.flags : this.flags; +}; + +Interpreter.true = new Buffer([1]); +Interpreter.false = new Buffer([]); + +Interpreter.MAX_SCRIPT_ELEMENT_SIZE = 520; + +Interpreter.LOCKTIME_THRESHOLD = 500000000; +Interpreter.LOCKTIME_THRESHOLD_BN = new BN(Interpreter.LOCKTIME_THRESHOLD); + +// flags taken from bitcoind +// bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 +Interpreter.SCRIPT_VERIFY_NONE = 0; + +// Evaluate P2SH subscripts (softfork safe, BIP16). +Interpreter.SCRIPT_VERIFY_P2SH = (1 << 0); + +// Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. +// Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be +// skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT). +Interpreter.SCRIPT_VERIFY_STRICTENC = (1 << 1); + +// Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1) +Interpreter.SCRIPT_VERIFY_DERSIG = (1 << 2); + +// Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure +// (softfork safe, BIP62 rule 5). +Interpreter.SCRIPT_VERIFY_LOW_S = (1 << 3); + +// verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7). +Interpreter.SCRIPT_VERIFY_NULLDUMMY = (1 << 4); + +// Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). +Interpreter.SCRIPT_VERIFY_SIGPUSHONLY = (1 << 5); + +// Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct +// pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating +// any other push causes the script to fail (BIP62 rule 3). +// In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). +// (softfork safe) +Interpreter.SCRIPT_VERIFY_MINIMALDATA = (1 << 6); + +// Discourage use of NOPs reserved for upgrades (NOP1-10) +// +// Provided so that nodes can avoid accepting or mining transactions +// containing executed NOP's whose meaning may change after a soft-fork, +// thus rendering the script invalid; with this flag set executing +// discouraged NOPs fails the script. This verification flag will never be +// a mandatory flag applied to scripts in a block. NOPs that are not +// executed, e.g. within an unexecuted IF ENDIF block, are *not* rejected. +Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = (1 << 7); + +// CLTV See BIP65 for details. +Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1 << 9); + +Interpreter.castToBool = function(buf) { + for (var i = 0; i < buf.length; i++) { + if (buf[i] !== 0) { + // can be negative zero + if (i === buf.length - 1 && buf[i] === 0x80) { + return false; + } + return true; + } + } + return false; +}; + +/** + * Translated from bitcoind's CheckSignatureEncoding + */ +Interpreter.prototype.checkSignatureEncoding = function(buf) { + var sig; + if ((this.flags & (Interpreter.SCRIPT_VERIFY_DERSIG | Interpreter.SCRIPT_VERIFY_LOW_S | Interpreter.SCRIPT_VERIFY_STRICTENC)) !== 0 && !Signature.isTxDER(buf)) { + this.errstr = 'SCRIPT_ERR_SIG_DER_INVALID_FORMAT'; + return false; + } else if ((this.flags & Interpreter.SCRIPT_VERIFY_LOW_S) !== 0) { + sig = Signature.fromTxFormat(buf); + if (!sig.hasLowS()) { + this.errstr = 'SCRIPT_ERR_SIG_DER_HIGH_S'; + return false; + } + } else if ((this.flags & Interpreter.SCRIPT_VERIFY_STRICTENC) !== 0) { + sig = Signature.fromTxFormat(buf); + if (!sig.hasDefinedHashtype()) { + this.errstr = 'SCRIPT_ERR_SIG_HASHTYPE'; + return false; + } + } + return true; +}; + +/** + * Translated from bitcoind's CheckPubKeyEncoding + */ +Interpreter.prototype.checkPubkeyEncoding = function(buf) { + if ((this.flags & Interpreter.SCRIPT_VERIFY_STRICTENC) !== 0 && !PublicKey.isValid(buf)) { + this.errstr = 'SCRIPT_ERR_PUBKEYTYPE'; + return false; + } + return true; +}; + +/** + * Based on bitcoind's EvalScript function, with the inner loop moved to + * Interpreter.prototype.step() + * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 + */ +Interpreter.prototype.evaluate = function() { + if (this.script.toBuffer().length > 10000) { + this.errstr = 'SCRIPT_ERR_SCRIPT_SIZE'; + return false; + } + + try { + while (this.pc < this.script.chunks.length) { + var fSuccess = this.step(); + if (!fSuccess) { + return false; + } + } + + // Size limits + if (this.stack.length + this.altstack.length > 1000) { + this.errstr = 'SCRIPT_ERR_STACK_SIZE'; + return false; + } + } catch (e) { + this.errstr = 'SCRIPT_ERR_UNKNOWN_ERROR: ' + e; + return false; + } + + if (this.vfExec.length > 0) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + + return true; +}; + +/** + * Checks a locktime parameter with the transaction's locktime. + * There are two times of nLockTime: lock-by-blockheight and lock-by-blocktime, + * distinguished by whether nLockTime < LOCKTIME_THRESHOLD = 500000000 + * + * See the corresponding code on bitcoin core: + * https://github.com/bitcoin/bitcoin/blob/ffd75adce01a78b3461b3ff05bcc2b530a9ce994/src/script/interpreter.cpp#L1129 + * + * @param {BN} nLockTime the locktime read from the script + * @return {boolean} true if the transaction's locktime is less than or equal to + * the transaction's locktime + */ +Interpreter.prototype.checkLockTime = function(nLockTime) { + + // We want to compare apples to apples, so fail the script + // unless the type of nLockTime being tested is the same as + // the nLockTime in the transaction. + if (!( + (this.tx.nLockTime < Interpreter.LOCKTIME_THRESHOLD && nLockTime.lt(Interpreter.LOCKTIME_THRESHOLD_BN)) || + (this.tx.nLockTime >= Interpreter.LOCKTIME_THRESHOLD && nLockTime.gte(Interpreter.LOCKTIME_THRESHOLD_BN)) + )) { + return false; + } + + // Now that we know we're comparing apples-to-apples, the + // comparison is a simple numeric one. + if (nLockTime.gt(new BN(this.tx.nLockTime))) { + return false; + } + + // Finally the nLockTime feature can be disabled and thus + // CHECKLOCKTIMEVERIFY bypassed if every txin has been + // finalized by setting nSequence to maxint. The + // transaction would be allowed into the blockchain, making + // the opcode ineffective. + // + // Testing if this vin is not final is sufficient to + // prevent this condition. Alternatively we could test all + // inputs, but testing just this input minimizes the data + // required to prove correct CHECKLOCKTIMEVERIFY execution. + if (!this.tx.inputs[this.nin].isFinal()) { + return false; + } + + return true; +} + +/** + * Based on the inner loop of bitcoind's EvalScript function + * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 + */ +Interpreter.prototype.step = function() { + + var fRequireMinimal = (this.flags & Interpreter.SCRIPT_VERIFY_MINIMALDATA) !== 0; + + //bool fExec = !count(vfExec.begin(), vfExec.end(), false); + var fExec = (this.vfExec.indexOf(false) === -1); + var buf, buf1, buf2, spliced, n, x1, x2, bn, bn1, bn2, bufSig, bufPubkey, subscript; + var sig, pubkey; + var fValue, fSuccess; + + // Read instruction + var chunk = this.script.chunks[this.pc]; + this.pc++; + var opcodenum = chunk.opcodenum; + if (_.isUndefined(opcodenum)) { + this.errstr = 'SCRIPT_ERR_UNDEFINED_OPCODE'; + return false; + } + if (chunk.buf && chunk.buf.length > Interpreter.MAX_SCRIPT_ELEMENT_SIZE) { + this.errstr = 'SCRIPT_ERR_PUSH_SIZE'; + return false; + } + + // Note how Opcode.OP_RESERVED does not count towards the opcode limit. + if (opcodenum > Opcode.OP_16 && ++(this.nOpCount) > 201) { + this.errstr = 'SCRIPT_ERR_OP_COUNT'; + return false; + } + + + if (opcodenum === Opcode.OP_CAT || + opcodenum === Opcode.OP_SUBSTR || + opcodenum === Opcode.OP_LEFT || + opcodenum === Opcode.OP_RIGHT || + opcodenum === Opcode.OP_INVERT || + opcodenum === Opcode.OP_AND || + opcodenum === Opcode.OP_OR || + opcodenum === Opcode.OP_XOR || + opcodenum === Opcode.OP_2MUL || + opcodenum === Opcode.OP_2DIV || + opcodenum === Opcode.OP_MUL || + opcodenum === Opcode.OP_DIV || + opcodenum === Opcode.OP_MOD || + opcodenum === Opcode.OP_LSHIFT || + opcodenum === Opcode.OP_RSHIFT) { + this.errstr = 'SCRIPT_ERR_DISABLED_OPCODE'; + return false; + } + + if (fExec && 0 <= opcodenum && opcodenum <= Opcode.OP_PUSHDATA4) { + if (fRequireMinimal && !this.script.checkMinimalPush(this.pc - 1)) { + this.errstr = 'SCRIPT_ERR_MINIMALDATA'; + return false; + } + if (!chunk.buf) { + this.stack.push(Interpreter.false); + } else if (chunk.len !== chunk.buf.length) { + throw new Error('Length of push value not equal to length of data'); + } else { + this.stack.push(chunk.buf); + } + } else if (fExec || (Opcode.OP_IF <= opcodenum && opcodenum <= Opcode.OP_ENDIF)) { + switch (opcodenum) { + // Push value + case Opcode.OP_1NEGATE: + case Opcode.OP_1: + case Opcode.OP_2: + case Opcode.OP_3: + case Opcode.OP_4: + case Opcode.OP_5: + case Opcode.OP_6: + case Opcode.OP_7: + case Opcode.OP_8: + case Opcode.OP_9: + case Opcode.OP_10: + case Opcode.OP_11: + case Opcode.OP_12: + case Opcode.OP_13: + case Opcode.OP_14: + case Opcode.OP_15: + case Opcode.OP_16: + { + // ( -- value) + // ScriptNum bn((int)opcode - (int)(Opcode.OP_1 - 1)); + n = opcodenum - (Opcode.OP_1 - 1); + buf = new BN(n).toScriptNumBuffer(); + this.stack.push(buf); + // The result of these opcodes should always be the minimal way to push the data + // they push, so no need for a CheckMinimalPush here. + } + break; + + + // + // Control + // + case Opcode.OP_NOP: + break; + + case Opcode.OP_NOP2: + case Opcode.OP_CHECKLOCKTIMEVERIFY: + + if (!(this.flags & Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) { + // not enabled; treat as a NOP2 + if (this.flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) { + this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS'; + return false; + } + break; + } + + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + // Note that elsewhere numeric opcodes are limited to + // operands in the range -2**31+1 to 2**31-1, however it is + // legal for opcodes to produce results exceeding that + // range. This limitation is implemented by CScriptNum's + // default 4-byte limit. + // + // If we kept to that limit we'd have a year 2038 problem, + // even though the nLockTime field in transactions + // themselves is uint32 which only becomes meaningless + // after the year 2106. + // + // Thus as a special case we tell CScriptNum to accept up + // to 5-byte bignums, which are good until 2**39-1, well + // beyond the 2**32-1 limit of the nLockTime field itself. + var nLockTime = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal, 5); + + // In the rare event that the argument may be < 0 due to + // some arithmetic being done first, you can always use + // 0 MAX CHECKLOCKTIMEVERIFY. + if (nLockTime.lt(new BN(0))) { + this.errstr = 'SCRIPT_ERR_NEGATIVE_LOCKTIME'; + return false; + } + + // Actually compare the specified lock time with the transaction. + if (!this.checkLockTime(nLockTime)) { + this.errstr = 'SCRIPT_ERR_UNSATISFIED_LOCKTIME'; + return false; + } + break; + + case Opcode.OP_NOP1: + case Opcode.OP_NOP3: + case Opcode.OP_NOP4: + case Opcode.OP_NOP5: + case Opcode.OP_NOP6: + case Opcode.OP_NOP7: + case Opcode.OP_NOP8: + case Opcode.OP_NOP9: + case Opcode.OP_NOP10: + { + if (this.flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) { + this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS'; + return false; + } + } + break; + + case Opcode.OP_IF: + case Opcode.OP_NOTIF: + { + // if [statements] [else [statements]] endif + // bool fValue = false; + fValue = false; + if (fExec) { + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + buf = this.stack.pop(); + fValue = Interpreter.castToBool(buf); + if (opcodenum === Opcode.OP_NOTIF) { + fValue = !fValue; + } + } + this.vfExec.push(fValue); + } + break; + + case Opcode.OP_ELSE: + { + if (this.vfExec.length === 0) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + this.vfExec[this.vfExec.length - 1] = !this.vfExec[this.vfExec.length - 1]; + } + break; + + case Opcode.OP_ENDIF: + { + if (this.vfExec.length === 0) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + this.vfExec.pop(); + } + break; + + case Opcode.OP_VERIFY: + { + // (true -- ) or + // (false -- false) and return + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + fValue = Interpreter.castToBool(buf); + if (fValue) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_VERIFY'; + return false; + } + } + break; + + case Opcode.OP_RETURN: + { + this.errstr = 'SCRIPT_ERR_OP_RETURN'; + return false; + } + break; + + + // + // Stack ops + // + case Opcode.OP_TOALTSTACK: + { + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.altstack.push(this.stack.pop()); + } + break; + + case Opcode.OP_FROMALTSTACK: + { + if (this.altstack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_ALTSTACK_OPERATION'; + return false; + } + this.stack.push(this.altstack.pop()); + } + break; + + case Opcode.OP_2DROP: + { + // (x1 x2 -- ) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.pop(); + this.stack.pop(); + } + break; + + case Opcode.OP_2DUP: + { + // (x1 x2 -- x1 x2 x1 x2) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 2]; + buf2 = this.stack[this.stack.length - 1]; + this.stack.push(buf1); + this.stack.push(buf2); + } + break; + + case Opcode.OP_3DUP: + { + // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) + if (this.stack.length < 3) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 3]; + buf2 = this.stack[this.stack.length - 2]; + var buf3 = this.stack[this.stack.length - 1]; + this.stack.push(buf1); + this.stack.push(buf2); + this.stack.push(buf3); + } + break; + + case Opcode.OP_2OVER: + { + // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) + if (this.stack.length < 4) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 4]; + buf2 = this.stack[this.stack.length - 3]; + this.stack.push(buf1); + this.stack.push(buf2); + } + break; + + case Opcode.OP_2ROT: + { + // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) + if (this.stack.length < 6) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + spliced = this.stack.splice(this.stack.length - 6, 2); + this.stack.push(spliced[0]); + this.stack.push(spliced[1]); + } + break; + + case Opcode.OP_2SWAP: + { + // (x1 x2 x3 x4 -- x3 x4 x1 x2) + if (this.stack.length < 4) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + spliced = this.stack.splice(this.stack.length - 4, 2); + this.stack.push(spliced[0]); + this.stack.push(spliced[1]); + } + break; + + case Opcode.OP_IFDUP: + { + // (x - 0 | x x) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + fValue = Interpreter.castToBool(buf); + if (fValue) { + this.stack.push(buf); + } + } + break; + + case Opcode.OP_DEPTH: + { + // -- stacksize + buf = new BN(this.stack.length).toScriptNumBuffer(); + this.stack.push(buf); + } + break; + + case Opcode.OP_DROP: + { + // (x -- ) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.pop(); + } + break; + + case Opcode.OP_DUP: + { + // (x -- x x) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.push(this.stack[this.stack.length - 1]); + } + break; + + case Opcode.OP_NIP: + { + // (x1 x2 -- x2) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.splice(this.stack.length - 2, 1); + } + break; + + case Opcode.OP_OVER: + { + // (x1 x2 -- x1 x2 x1) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.push(this.stack[this.stack.length - 2]); + } + break; + + case Opcode.OP_PICK: + case Opcode.OP_ROLL: + { + // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) + // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + bn = BN.fromScriptNumBuffer(buf, fRequireMinimal); + n = bn.toNumber(); + this.stack.pop(); + if (n < 0 || n >= this.stack.length) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - n - 1]; + if (opcodenum === Opcode.OP_ROLL) { + this.stack.splice(this.stack.length - n - 1, 1); + } + this.stack.push(buf); + } + break; + + case Opcode.OP_ROT: + { + // (x1 x2 x3 -- x2 x3 x1) + // x2 x1 x3 after first swap + // x2 x3 x1 after second swap + if (this.stack.length < 3) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + x1 = this.stack[this.stack.length - 3]; + x2 = this.stack[this.stack.length - 2]; + var x3 = this.stack[this.stack.length - 1]; + this.stack[this.stack.length - 3] = x2; + this.stack[this.stack.length - 2] = x3; + this.stack[this.stack.length - 1] = x1; + } + break; + + case Opcode.OP_SWAP: + { + // (x1 x2 -- x2 x1) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + x1 = this.stack[this.stack.length - 2]; + x2 = this.stack[this.stack.length - 1]; + this.stack[this.stack.length - 2] = x2; + this.stack[this.stack.length - 1] = x1; + } + break; + + case Opcode.OP_TUCK: + { + // (x1 x2 -- x2 x1 x2) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.splice(this.stack.length - 2, 0, this.stack[this.stack.length - 1]); + } + break; + + + case Opcode.OP_SIZE: + { + // (in -- in size) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + bn = new BN(this.stack[this.stack.length - 1].length); + this.stack.push(bn.toScriptNumBuffer()); + } + break; + + + // + // Bitwise logic + // + case Opcode.OP_EQUAL: + case Opcode.OP_EQUALVERIFY: + //case Opcode.OP_NOTEQUAL: // use Opcode.OP_NUMNOTEQUAL + { + // (x1 x2 - bool) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 2]; + buf2 = this.stack[this.stack.length - 1]; + var fEqual = buf1.toString('hex') === buf2.toString('hex'); + this.stack.pop(); + this.stack.pop(); + this.stack.push(fEqual ? Interpreter.true : Interpreter.false); + if (opcodenum === Opcode.OP_EQUALVERIFY) { + if (fEqual) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_EQUALVERIFY'; + return false; + } + } + } + break; + + + // + // Numeric + // + case Opcode.OP_1ADD: + case Opcode.OP_1SUB: + case Opcode.OP_NEGATE: + case Opcode.OP_ABS: + case Opcode.OP_NOT: + case Opcode.OP_0NOTEQUAL: + { + // (in -- out) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + bn = BN.fromScriptNumBuffer(buf, fRequireMinimal); + switch (opcodenum) { + case Opcode.OP_1ADD: + bn = bn.add(BN.One); + break; + case Opcode.OP_1SUB: + bn = bn.sub(BN.One); + break; + case Opcode.OP_NEGATE: + bn = bn.neg(); + break; + case Opcode.OP_ABS: + if (bn.cmp(BN.Zero) < 0) { + bn = bn.neg(); + } + break; + case Opcode.OP_NOT: + bn = new BN((bn.cmp(BN.Zero) === 0) + 0); + break; + case Opcode.OP_0NOTEQUAL: + bn = new BN((bn.cmp(BN.Zero) !== 0) + 0); + break; + //default: assert(!'invalid opcode'); break; // TODO: does this ever occur? + } + this.stack.pop(); + this.stack.push(bn.toScriptNumBuffer()); + } + break; + + case Opcode.OP_ADD: + case Opcode.OP_SUB: + case Opcode.OP_BOOLAND: + case Opcode.OP_BOOLOR: + case Opcode.OP_NUMEQUAL: + case Opcode.OP_NUMEQUALVERIFY: + case Opcode.OP_NUMNOTEQUAL: + case Opcode.OP_LESSTHAN: + case Opcode.OP_GREATERTHAN: + case Opcode.OP_LESSTHANOREQUAL: + case Opcode.OP_GREATERTHANOREQUAL: + case Opcode.OP_MIN: + case Opcode.OP_MAX: + { + // (x1 x2 -- out) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + bn1 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 2], fRequireMinimal); + bn2 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal); + bn = new BN(0); + + switch (opcodenum) { + case Opcode.OP_ADD: + bn = bn1.add(bn2); + break; + + case Opcode.OP_SUB: + bn = bn1.sub(bn2); + break; + + // case Opcode.OP_BOOLAND: bn = (bn1 != bnZero && bn2 != bnZero); break; + case Opcode.OP_BOOLAND: + bn = new BN(((bn1.cmp(BN.Zero) !== 0) && (bn2.cmp(BN.Zero) !== 0)) + 0); + break; + // case Opcode.OP_BOOLOR: bn = (bn1 != bnZero || bn2 != bnZero); break; + case Opcode.OP_BOOLOR: + bn = new BN(((bn1.cmp(BN.Zero) !== 0) || (bn2.cmp(BN.Zero) !== 0)) + 0); + break; + // case Opcode.OP_NUMEQUAL: bn = (bn1 == bn2); break; + case Opcode.OP_NUMEQUAL: + bn = new BN((bn1.cmp(bn2) === 0) + 0); + break; + // case Opcode.OP_NUMEQUALVERIFY: bn = (bn1 == bn2); break; + case Opcode.OP_NUMEQUALVERIFY: + bn = new BN((bn1.cmp(bn2) === 0) + 0); + break; + // case Opcode.OP_NUMNOTEQUAL: bn = (bn1 != bn2); break; + case Opcode.OP_NUMNOTEQUAL: + bn = new BN((bn1.cmp(bn2) !== 0) + 0); + break; + // case Opcode.OP_LESSTHAN: bn = (bn1 < bn2); break; + case Opcode.OP_LESSTHAN: + bn = new BN((bn1.cmp(bn2) < 0) + 0); + break; + // case Opcode.OP_GREATERTHAN: bn = (bn1 > bn2); break; + case Opcode.OP_GREATERTHAN: + bn = new BN((bn1.cmp(bn2) > 0) + 0); + break; + // case Opcode.OP_LESSTHANOREQUAL: bn = (bn1 <= bn2); break; + case Opcode.OP_LESSTHANOREQUAL: + bn = new BN((bn1.cmp(bn2) <= 0) + 0); + break; + // case Opcode.OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break; + case Opcode.OP_GREATERTHANOREQUAL: + bn = new BN((bn1.cmp(bn2) >= 0) + 0); + break; + case Opcode.OP_MIN: + bn = (bn1.cmp(bn2) < 0 ? bn1 : bn2); + break; + case Opcode.OP_MAX: + bn = (bn1.cmp(bn2) > 0 ? bn1 : bn2); + break; + // default: assert(!'invalid opcode'); break; //TODO: does this ever occur? + } + this.stack.pop(); + this.stack.pop(); + this.stack.push(bn.toScriptNumBuffer()); + + if (opcodenum === Opcode.OP_NUMEQUALVERIFY) { + // if (CastToBool(stacktop(-1))) + if (Interpreter.castToBool(this.stack[this.stack.length - 1])) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_NUMEQUALVERIFY'; + return false; + } + } + } + break; + + case Opcode.OP_WITHIN: + { + // (x min max -- out) + if (this.stack.length < 3) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + bn1 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 3], fRequireMinimal); + bn2 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 2], fRequireMinimal); + var bn3 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal); + //bool fValue = (bn2 <= bn1 && bn1 < bn3); + fValue = (bn2.cmp(bn1) <= 0) && (bn1.cmp(bn3) < 0); + this.stack.pop(); + this.stack.pop(); + this.stack.pop(); + this.stack.push(fValue ? Interpreter.true : Interpreter.false); + } + break; + + + // + // Crypto + // + case Opcode.OP_RIPEMD160: + case Opcode.OP_SHA1: + case Opcode.OP_SHA256: + case Opcode.OP_HASH160: + case Opcode.OP_HASH256: + { + // (in -- hash) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + //valtype vchHash((opcode == Opcode.OP_RIPEMD160 || + // opcode == Opcode.OP_SHA1 || opcode == Opcode.OP_HASH160) ? 20 : 32); + var bufHash; + if (opcodenum === Opcode.OP_RIPEMD160) { + bufHash = Hash.ripemd160(buf); + } else if (opcodenum === Opcode.OP_SHA1) { + bufHash = Hash.sha1(buf); + } else if (opcodenum === Opcode.OP_SHA256) { + bufHash = Hash.sha256(buf); + } else if (opcodenum === Opcode.OP_HASH160) { + bufHash = Hash.sha256ripemd160(buf); + } else if (opcodenum === Opcode.OP_HASH256) { + bufHash = Hash.sha256sha256(buf); + } + this.stack.pop(); + this.stack.push(bufHash); + } + break; + + case Opcode.OP_CODESEPARATOR: + { + // Hash starts after the code separator + this.pbegincodehash = this.pc; + } + break; + + case Opcode.OP_CHECKSIG: + case Opcode.OP_CHECKSIGVERIFY: + { + // (sig pubkey -- bool) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + bufSig = this.stack[this.stack.length - 2]; + bufPubkey = this.stack[this.stack.length - 1]; + + // Subset of script starting at the most recent codeseparator + // CScript scriptCode(pbegincodehash, pend); + subscript = new Script().set({ + chunks: this.script.chunks.slice(this.pbegincodehash) + }); + + // Drop the signature, since there's no way for a signature to sign itself + var tmpScript = new Script().add(bufSig); + subscript.findAndDelete(tmpScript); + + if (!this.checkSignatureEncoding(bufSig) || !this.checkPubkeyEncoding(bufPubkey)) { + return false; + } + + try { + sig = Signature.fromTxFormat(bufSig); + pubkey = PublicKey.fromBuffer(bufPubkey, false); + fSuccess = this.tx.verifySignature(sig, pubkey, this.nin, subscript); + } catch (e) { + //invalid sig or pubkey + fSuccess = false; + } + + this.stack.pop(); + this.stack.pop(); + // stack.push_back(fSuccess ? vchTrue : vchFalse); + this.stack.push(fSuccess ? Interpreter.true : Interpreter.false); + if (opcodenum === Opcode.OP_CHECKSIGVERIFY) { + if (fSuccess) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_CHECKSIGVERIFY'; + return false; + } + } + } + break; + + case Opcode.OP_CHECKMULTISIG: + case Opcode.OP_CHECKMULTISIGVERIFY: + { + // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool) + + var i = 1; + if (this.stack.length < i) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + var nKeysCount = BN.fromScriptNumBuffer(this.stack[this.stack.length - i], fRequireMinimal).toNumber(); + if (nKeysCount < 0 || nKeysCount > 20) { + this.errstr = 'SCRIPT_ERR_PUBKEY_COUNT'; + return false; + } + this.nOpCount += nKeysCount; + if (this.nOpCount > 201) { + this.errstr = 'SCRIPT_ERR_OP_COUNT'; + return false; + } + // int ikey = ++i; + var ikey = ++i; + i += nKeysCount; + if (this.stack.length < i) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + var nSigsCount = BN.fromScriptNumBuffer(this.stack[this.stack.length - i], fRequireMinimal).toNumber(); + if (nSigsCount < 0 || nSigsCount > nKeysCount) { + this.errstr = 'SCRIPT_ERR_SIG_COUNT'; + return false; + } + // int isig = ++i; + var isig = ++i; + i += nSigsCount; + if (this.stack.length < i) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + // Subset of script starting at the most recent codeseparator + subscript = new Script().set({ + chunks: this.script.chunks.slice(this.pbegincodehash) + }); + + // Drop the signatures, since there's no way for a signature to sign itself + for (var k = 0; k < nSigsCount; k++) { + bufSig = this.stack[this.stack.length - isig - k]; + subscript.findAndDelete(new Script().add(bufSig)); + } + + fSuccess = true; + while (fSuccess && nSigsCount > 0) { + // valtype& vchSig = stacktop(-isig); + bufSig = this.stack[this.stack.length - isig]; + // valtype& vchPubKey = stacktop(-ikey); + bufPubkey = this.stack[this.stack.length - ikey]; + + if (!this.checkSignatureEncoding(bufSig) || !this.checkPubkeyEncoding(bufPubkey)) { + return false; + } + + var fOk; + try { + sig = Signature.fromTxFormat(bufSig); + pubkey = PublicKey.fromBuffer(bufPubkey, false); + fOk = this.tx.verifySignature(sig, pubkey, this.nin, subscript); + } catch (e) { + //invalid sig or pubkey + fOk = false; + } + + if (fOk) { + isig++; + nSigsCount--; + } + ikey++; + nKeysCount--; + + // If there are more signatures left than keys left, + // then too many signatures have failed + if (nSigsCount > nKeysCount) { + fSuccess = false; + } + } + + // Clean up stack of actual arguments + while (i-- > 1) { + this.stack.pop(); + } + + // A bug causes CHECKMULTISIG to consume one extra argument + // whose contents were not checked in any way. + // + // Unfortunately this is a potential source of mutability, + // so optionally verify it is exactly equal to zero prior + // to removing it from the stack. + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + if ((this.flags & Interpreter.SCRIPT_VERIFY_NULLDUMMY) && this.stack[this.stack.length - 1].length) { + this.errstr = 'SCRIPT_ERR_SIG_NULLDUMMY'; + return false; + } + this.stack.pop(); + + this.stack.push(fSuccess ? Interpreter.true : Interpreter.false); + + if (opcodenum === Opcode.OP_CHECKMULTISIGVERIFY) { + if (fSuccess) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_CHECKMULTISIGVERIFY'; + return false; + } + } + } + break; + + default: + this.errstr = 'SCRIPT_ERR_BAD_OPCODE'; + return false; + } + } + + return true; +}; + + +}).call(this,require("buffer").Buffer) +},{"../crypto/bn":6,"../crypto/hash":8,"../crypto/signature":11,"../opcode":22,"../publickey":24,"../transaction":28,"./script":27,"buffer":47,"lodash":319}],27:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var Address = require('../address'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var Opcode = require('../opcode'); +var PublicKey = require('../publickey'); +var Signature = require('../crypto/signature'); +var Networks = require('../networks'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); +var errors = require('../errors'); +var buffer = require('buffer'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); + +/** + * A bitcoin transaction script. Each transaction's inputs and outputs + * has a script that is evaluated to validate it's spending. + * + * See https://en.bitcoin.it/wiki/Script + * + * @constructor + * @param {Object|string|Buffer=} from optional data to populate script + */ +var Script = function Script(from) { + if (!(this instanceof Script)) { + return new Script(from); + } + this.chunks = []; + + if (BufferUtil.isBuffer(from)) { + return Script.fromBuffer(from); + } else if (from instanceof Address) { + return Script.fromAddress(from); + } else if (from instanceof Script) { + return Script.fromBuffer(from.toBuffer()); + } else if (_.isString(from)) { + return Script.fromString(from); + } else if (_.isObject(from) && _.isArray(from.chunks)) { + this.set(from); + } +}; + +Script.prototype.set = function(obj) { + $.checkArgument(_.isObject(obj)); + $.checkArgument(_.isArray(obj.chunks)); + this.chunks = obj.chunks; + return this; +}; + +Script.fromBuffer = function(buffer) { + var script = new Script(); + script.chunks = []; + + var br = new BufferReader(buffer); + while (!br.finished()) { + try { + var opcodenum = br.readUInt8(); + + var len, buf; + if (opcodenum > 0 && opcodenum < Opcode.OP_PUSHDATA1) { + len = opcodenum; + script.chunks.push({ + buf: br.read(len), + len: len, + opcodenum: opcodenum + }); + } else if (opcodenum === Opcode.OP_PUSHDATA1) { + len = br.readUInt8(); + buf = br.read(len); + script.chunks.push({ + buf: buf, + len: len, + opcodenum: opcodenum + }); + } else if (opcodenum === Opcode.OP_PUSHDATA2) { + len = br.readUInt16LE(); + buf = br.read(len); + script.chunks.push({ + buf: buf, + len: len, + opcodenum: opcodenum + }); + } else if (opcodenum === Opcode.OP_PUSHDATA4) { + len = br.readUInt32LE(); + buf = br.read(len); + script.chunks.push({ + buf: buf, + len: len, + opcodenum: opcodenum + }); + } else { + script.chunks.push({ + opcodenum: opcodenum + }); + } + } catch (e) { + if (e instanceof RangeError) { + throw new errors.Script.InvalidBuffer(buffer.toString('hex')); + } + throw e; + } + } + + return script; +}; + +Script.prototype.toBuffer = function() { + var bw = new BufferWriter(); + + for (var i = 0; i < this.chunks.length; i++) { + var chunk = this.chunks[i]; + var opcodenum = chunk.opcodenum; + bw.writeUInt8(chunk.opcodenum); + if (chunk.buf) { + if (opcodenum < Opcode.OP_PUSHDATA1) { + bw.write(chunk.buf); + } else if (opcodenum === Opcode.OP_PUSHDATA1) { + bw.writeUInt8(chunk.len); + bw.write(chunk.buf); + } else if (opcodenum === Opcode.OP_PUSHDATA2) { + bw.writeUInt16LE(chunk.len); + bw.write(chunk.buf); + } else if (opcodenum === Opcode.OP_PUSHDATA4) { + bw.writeUInt32LE(chunk.len); + bw.write(chunk.buf); + } + } + } + + return bw.concat(); +}; + +Script.fromASM = function(str) { + var script = new Script(); + script.chunks = []; + + var tokens = str.split(' '); + var i = 0; + while (i < tokens.length) { + var token = tokens[i]; + var opcode = Opcode(token); + var opcodenum = opcode.toNumber(); + + if (_.isUndefined(opcodenum)) { + var buf = new Buffer(tokens[i], 'hex'); + script.chunks.push({ + buf: buf, + len: buf.length, + opcodenum: buf.length + }); + i = i + 1; + } else if (opcodenum === Opcode.OP_PUSHDATA1 || + opcodenum === Opcode.OP_PUSHDATA2 || + opcodenum === Opcode.OP_PUSHDATA4) { + script.chunks.push({ + buf: new Buffer(tokens[i + 2], 'hex'), + len: parseInt(tokens[i + 1]), + opcodenum: opcodenum + }); + i = i + 3; + } else { + script.chunks.push({ + opcodenum: opcodenum + }); + i = i + 1; + } + } + return script; +}; + +Script.fromHex = function(str) { + return new Script(new buffer.Buffer(str, 'hex')); +}; + +Script.fromString = function(str) { + if (JSUtil.isHexa(str) || str.length === 0) { + return new Script(new buffer.Buffer(str, 'hex')); + } + var script = new Script(); + script.chunks = []; + + var tokens = str.split(' '); + var i = 0; + while (i < tokens.length) { + var token = tokens[i]; + var opcode = Opcode(token); + var opcodenum = opcode.toNumber(); + + if (_.isUndefined(opcodenum)) { + opcodenum = parseInt(token); + if (opcodenum > 0 && opcodenum < Opcode.OP_PUSHDATA1) { + script.chunks.push({ + buf: new Buffer(tokens[i + 1].slice(2), 'hex'), + len: opcodenum, + opcodenum: opcodenum + }); + i = i + 2; + } else { + throw new Error('Invalid script: ' + JSON.stringify(str)); + } + } else if (opcodenum === Opcode.OP_PUSHDATA1 || + opcodenum === Opcode.OP_PUSHDATA2 || + opcodenum === Opcode.OP_PUSHDATA4) { + if (tokens[i + 2].slice(0, 2) !== '0x') { + throw new Error('Pushdata data must start with 0x'); + } + script.chunks.push({ + buf: new Buffer(tokens[i + 2].slice(2), 'hex'), + len: parseInt(tokens[i + 1]), + opcodenum: opcodenum + }); + i = i + 3; + } else { + script.chunks.push({ + opcodenum: opcodenum + }); + i = i + 1; + } + } + return script; +}; + +Script.prototype._chunkToString = function(chunk, type) { + var opcodenum = chunk.opcodenum; + var asm = (type === 'asm'); + var str = ''; + if (!chunk.buf) { + // no data chunk + if (typeof Opcode.reverseMap[opcodenum] !== 'undefined') { + if (asm) { + // A few cases where the opcode name differs from reverseMap + // aside from 1 to 16 data pushes. + if (opcodenum === 0) { + // OP_0 -> 0 + str = str + ' 0'; + } else if(opcodenum === 79) { + // OP_1NEGATE -> 1 + str = str + ' -1'; + } else { + str = str + ' ' + Opcode(opcodenum).toString(); + } + } else { + str = str + ' ' + Opcode(opcodenum).toString(); + } + } else { + var numstr = opcodenum.toString(16); + if (numstr.length % 2 !== 0) { + numstr = '0' + numstr; + } + if (asm) { + str = str + ' ' + numstr; + } else { + str = str + ' ' + '0x' + numstr; + } + } + } else { + // data chunk + if (!asm && opcodenum === Opcode.OP_PUSHDATA1 || + opcodenum === Opcode.OP_PUSHDATA2 || + opcodenum === Opcode.OP_PUSHDATA4) { + str = str + ' ' + Opcode(opcodenum).toString(); + } + if (chunk.len > 0) { + if (asm) { + str = str + ' ' + chunk.buf.toString('hex'); + } else { + str = str + ' ' + chunk.len + ' ' + '0x' + chunk.buf.toString('hex'); + } + } + } + return str; +}; + +Script.prototype.toASM = function() { + var str = ''; + for (var i = 0; i < this.chunks.length; i++) { + var chunk = this.chunks[i]; + str += this._chunkToString(chunk, 'asm'); + } + + return str.substr(1); +}; + +Script.prototype.toString = function() { + var str = ''; + for (var i = 0; i < this.chunks.length; i++) { + var chunk = this.chunks[i]; + str += this._chunkToString(chunk); + } + + return str.substr(1); +}; + +Script.prototype.toHex = function() { + return this.toBuffer().toString('hex'); +}; + +Script.prototype.inspect = function() { + return ''; +}; + +// script classification methods + +/** + * @returns {boolean} if this is a pay to pubkey hash output script + */ +Script.prototype.isPublicKeyHashOut = function() { + return !!(this.chunks.length === 5 && + this.chunks[0].opcodenum === Opcode.OP_DUP && + this.chunks[1].opcodenum === Opcode.OP_HASH160 && + this.chunks[2].buf && + this.chunks[2].buf.length === 20 && + this.chunks[3].opcodenum === Opcode.OP_EQUALVERIFY && + this.chunks[4].opcodenum === Opcode.OP_CHECKSIG); +}; + +/** + * @returns {boolean} if this is a pay to public key hash input script + */ +Script.prototype.isPublicKeyHashIn = function() { + if (this.chunks.length === 2) { + var signatureBuf = this.chunks[0].buf; + var pubkeyBuf = this.chunks[1].buf; + if (signatureBuf && + signatureBuf.length && + signatureBuf[0] === 0x30 && + pubkeyBuf && + pubkeyBuf.length + ) { + var version = pubkeyBuf[0]; + if ((version === 0x04 || + version === 0x06 || + version === 0x07) && pubkeyBuf.length === 65) { + return true; + } else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { + return true; + } + } + } + return false; +}; + +Script.prototype.getPublicKey = function() { + $.checkState(this.isPublicKeyOut(), 'Can\'t retrieve PublicKey from a non-PK output'); + return this.chunks[0].buf; +}; + +Script.prototype.getPublicKeyHash = function() { + $.checkState(this.isPublicKeyHashOut(), 'Can\'t retrieve PublicKeyHash from a non-PKH output'); + return this.chunks[2].buf; +}; + +/** + * @returns {boolean} if this is a public key output script + */ +Script.prototype.isPublicKeyOut = function() { + if (this.chunks.length === 2 && + this.chunks[0].buf && + this.chunks[0].buf.length && + this.chunks[1].opcodenum === Opcode.OP_CHECKSIG) { + var pubkeyBuf = this.chunks[0].buf; + var version = pubkeyBuf[0]; + var isVersion = false; + if ((version === 0x04 || + version === 0x06 || + version === 0x07) && pubkeyBuf.length === 65) { + isVersion = true; + } else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { + isVersion = true; + } + if (isVersion) { + return PublicKey.isValid(pubkeyBuf); + } + } + return false; +}; + +/** + * @returns {boolean} if this is a pay to public key input script + */ +Script.prototype.isPublicKeyIn = function() { + if (this.chunks.length === 1) { + var signatureBuf = this.chunks[0].buf; + if (signatureBuf && + signatureBuf.length && + signatureBuf[0] === 0x30) { + return true; + } + } + return false; +}; + +/** + * @returns {boolean} if this is a p2sh output script + */ +Script.prototype.isScriptHashOut = function() { + var buf = this.toBuffer(); + return (buf.length === 23 && + buf[0] === Opcode.OP_HASH160 && + buf[1] === 0x14 && + buf[buf.length - 1] === Opcode.OP_EQUAL); +}; + +/** + * @returns {boolean} if this is a p2sh input script + * Note that these are frequently indistinguishable from pubkeyhashin + */ +Script.prototype.isScriptHashIn = function() { + if (this.chunks.length <= 1) { + return false; + } + var redeemChunk = this.chunks[this.chunks.length - 1]; + var redeemBuf = redeemChunk.buf; + if (!redeemBuf) { + return false; + } + + var redeemScript; + try { + redeemScript = Script.fromBuffer(redeemBuf); + } catch (e) { + if (e instanceof errors.Script.InvalidBuffer) { + return false; + } + throw e; + } + var type = redeemScript.classify(); + return type !== Script.types.UNKNOWN; +}; + +/** + * @returns {boolean} if this is a mutlsig output script + */ +Script.prototype.isMultisigOut = function() { + return (this.chunks.length > 3 && + Opcode.isSmallIntOp(this.chunks[0].opcodenum) && + this.chunks.slice(1, this.chunks.length - 2).every(function(obj) { + return obj.buf && BufferUtil.isBuffer(obj.buf); + }) && + Opcode.isSmallIntOp(this.chunks[this.chunks.length - 2].opcodenum) && + this.chunks[this.chunks.length - 1].opcodenum === Opcode.OP_CHECKMULTISIG); +}; + + +/** + * @returns {boolean} if this is a multisig input script + */ +Script.prototype.isMultisigIn = function() { + return this.chunks.length >= 2 && + this.chunks[0].opcodenum === 0 && + this.chunks.slice(1, this.chunks.length).every(function(obj) { + return obj.buf && + BufferUtil.isBuffer(obj.buf) && + Signature.isTxDER(obj.buf); + }); +}; + +/** + * @returns {boolean} true if this is a valid standard OP_RETURN output + */ +Script.prototype.isDataOut = function() { + return this.chunks.length >= 1 && + this.chunks[0].opcodenum === Opcode.OP_RETURN && + (this.chunks.length === 1 || + (this.chunks.length === 2 && + this.chunks[1].buf && + this.chunks[1].buf.length <= Script.OP_RETURN_STANDARD_SIZE && + this.chunks[1].length === this.chunks.len)); +}; + +/** + * Retrieve the associated data for this script. + * In the case of a pay to public key hash or P2SH, return the hash. + * In the case of a standard OP_RETURN, return the data + * @returns {Buffer} + */ +Script.prototype.getData = function() { + if (this.isDataOut() || this.isScriptHashOut()) { + if (_.isUndefined(this.chunks[1])) { + return new Buffer(0); + } else { + return new Buffer(this.chunks[1].buf); + } + } + if (this.isPublicKeyHashOut()) { + return new Buffer(this.chunks[2].buf); + } + throw new Error('Unrecognized script type to get data from'); +}; + +/** + * @returns {boolean} if the script is only composed of data pushing + * opcodes or small int opcodes (OP_0, OP_1, ..., OP_16) + */ +Script.prototype.isPushOnly = function() { + return _.every(this.chunks, function(chunk) { + return chunk.opcodenum <= Opcode.OP_16; + }); +}; + + +Script.types = {}; +Script.types.UNKNOWN = 'Unknown'; +Script.types.PUBKEY_OUT = 'Pay to public key'; +Script.types.PUBKEY_IN = 'Spend from public key'; +Script.types.PUBKEYHASH_OUT = 'Pay to public key hash'; +Script.types.PUBKEYHASH_IN = 'Spend from public key hash'; +Script.types.SCRIPTHASH_OUT = 'Pay to script hash'; +Script.types.SCRIPTHASH_IN = 'Spend from script hash'; +Script.types.MULTISIG_OUT = 'Pay to multisig'; +Script.types.MULTISIG_IN = 'Spend from multisig'; +Script.types.DATA_OUT = 'Data push'; + +Script.OP_RETURN_STANDARD_SIZE = 80; + +/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */ +Script.prototype.classify = function() { + if (this._isInput) { + return this.classifyInput(); + } else if (this._isOutput) { + return this.classifyOutput(); + } else { + var outputType = this.classifyOutput(); + return outputType != Script.types.UNKNOWN ? outputType : this.classifyInput(); + } +}; + +Script.outputIdentifiers = {}; +Script.outputIdentifiers.PUBKEY_OUT = Script.prototype.isPublicKeyOut; +Script.outputIdentifiers.PUBKEYHASH_OUT = Script.prototype.isPublicKeyHashOut; +Script.outputIdentifiers.MULTISIG_OUT = Script.prototype.isMultisigOut; +Script.outputIdentifiers.SCRIPTHASH_OUT = Script.prototype.isScriptHashOut; +Script.outputIdentifiers.DATA_OUT = Script.prototype.isDataOut; + +/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */ +Script.prototype.classifyOutput = function() { + for (var type in Script.outputIdentifiers) { + if (Script.outputIdentifiers[type].bind(this)()) { + return Script.types[type]; + } + } + return Script.types.UNKNOWN; +}; + +Script.inputIdentifiers = {}; +Script.inputIdentifiers.PUBKEY_IN = Script.prototype.isPublicKeyIn; +Script.inputIdentifiers.PUBKEYHASH_IN = Script.prototype.isPublicKeyHashIn; +Script.inputIdentifiers.MULTISIG_IN = Script.prototype.isMultisigIn; +Script.inputIdentifiers.SCRIPTHASH_IN = Script.prototype.isScriptHashIn; + +/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */ +Script.prototype.classifyInput = function() { + for (var type in Script.inputIdentifiers) { + if (Script.inputIdentifiers[type].bind(this)()) { + return Script.types[type]; + } + } + return Script.types.UNKNOWN; +}; + + +/** + * @returns {boolean} if script is one of the known types + */ +Script.prototype.isStandard = function() { + // TODO: Add BIP62 compliance + return this.classify() !== Script.types.UNKNOWN; +}; + + +// Script construction methods + +/** + * Adds a script element at the start of the script. + * @param {*} obj a string, number, Opcode, Buffer, or object to add + * @returns {Script} this script instance + */ +Script.prototype.prepend = function(obj) { + this._addByType(obj, true); + return this; +}; + +/** + * Compares a script with another script + */ +Script.prototype.equals = function(script) { + $.checkState(script instanceof Script, 'Must provide another script'); + if (this.chunks.length !== script.chunks.length) { + return false; + } + var i; + for (i = 0; i < this.chunks.length; i++) { + if (BufferUtil.isBuffer(this.chunks[i].buf) && !BufferUtil.isBuffer(script.chunks[i].buf)) { + return false; + } + if (BufferUtil.isBuffer(this.chunks[i].buf) && !BufferUtil.equals(this.chunks[i].buf, script.chunks[i].buf)) { + return false; + } else if (this.chunks[i].opcodenum !== script.chunks[i].opcodenum) { + return false; + } + } + return true; +}; + +/** + * Adds a script element to the end of the script. + * + * @param {*} obj a string, number, Opcode, Buffer, or object to add + * @returns {Script} this script instance + * + */ +Script.prototype.add = function(obj) { + this._addByType(obj, false); + return this; +}; + +Script.prototype._addByType = function(obj, prepend) { + if (typeof obj === 'string') { + this._addOpcode(obj, prepend); + } else if (typeof obj === 'number') { + this._addOpcode(obj, prepend); + } else if (obj instanceof Opcode) { + this._addOpcode(obj, prepend); + } else if (BufferUtil.isBuffer(obj)) { + this._addBuffer(obj, prepend); + } else if (obj instanceof Script) { + this.chunks = this.chunks.concat(obj.chunks); + } else if (typeof obj === 'object') { + this._insertAtPosition(obj, prepend); + } else { + throw new Error('Invalid script chunk'); + } +}; + +Script.prototype._insertAtPosition = function(op, prepend) { + if (prepend) { + this.chunks.unshift(op); + } else { + this.chunks.push(op); + } +}; + +Script.prototype._addOpcode = function(opcode, prepend) { + var op; + if (typeof opcode === 'number') { + op = opcode; + } else if (opcode instanceof Opcode) { + op = opcode.toNumber(); + } else { + op = Opcode(opcode).toNumber(); + } + this._insertAtPosition({ + opcodenum: op + }, prepend); + return this; +}; + +Script.prototype._addBuffer = function(buf, prepend) { + var opcodenum; + var len = buf.length; + if (len >= 0 && len < Opcode.OP_PUSHDATA1) { + opcodenum = len; + } else if (len < Math.pow(2, 8)) { + opcodenum = Opcode.OP_PUSHDATA1; + } else if (len < Math.pow(2, 16)) { + opcodenum = Opcode.OP_PUSHDATA2; + } else if (len < Math.pow(2, 32)) { + opcodenum = Opcode.OP_PUSHDATA4; + } else { + throw new Error('You can\'t push that much data'); + } + this._insertAtPosition({ + buf: buf, + len: len, + opcodenum: opcodenum + }, prepend); + return this; +}; + +Script.prototype.removeCodeseparators = function() { + var chunks = []; + for (var i = 0; i < this.chunks.length; i++) { + if (this.chunks[i].opcodenum !== Opcode.OP_CODESEPARATOR) { + chunks.push(this.chunks[i]); + } + } + this.chunks = chunks; + return this; +}; + +// high level script builder methods + +/** + * @returns {Script} a new Multisig output script for given public keys, + * requiring m of those public keys to spend + * @param {PublicKey[]} publicKeys - list of all public keys controlling the output + * @param {number} threshold - amount of required signatures to spend the output + * @param {Object=} opts - Several options: + * - noSorting: defaults to false, if true, don't sort the given + * public keys before creating the script + */ +Script.buildMultisigOut = function(publicKeys, threshold, opts) { + $.checkArgument(threshold <= publicKeys.length, + 'Number of required signatures must be less than or equal to the number of public keys'); + opts = opts || {}; + var script = new Script(); + script.add(Opcode.smallInt(threshold)); + publicKeys = _.map(publicKeys, PublicKey); + var sorted = publicKeys; + if (!opts.noSorting) { + sorted = _.sortBy(publicKeys, function(publicKey) { + return publicKey.toString('hex'); + }); + } + for (var i = 0; i < sorted.length; i++) { + var publicKey = sorted[i]; + script.add(publicKey.toBuffer()); + } + script.add(Opcode.smallInt(publicKeys.length)); + script.add(Opcode.OP_CHECKMULTISIG); + return script; +}; + +/** + * A new Multisig input script for the given public keys, requiring m of those public keys to spend + * + * @param {PublicKey[]} pubkeys list of all public keys controlling the output + * @param {number} threshold amount of required signatures to spend the output + * @param {Array} signatures and array of signature buffers to append to the script + * @param {Object=} opts + * @param {boolean=} opts.noSorting don't sort the given public keys before creating the script (false by default) + * @param {Script=} opts.cachedMultisig don't recalculate the redeemScript + * + * @returns {Script} + */ +Script.buildMultisigIn = function(pubkeys, threshold, signatures, opts) { + $.checkArgument(_.isArray(pubkeys)); + $.checkArgument(_.isNumber(threshold)); + $.checkArgument(_.isArray(signatures)); + opts = opts || {}; + var s = new Script(); + s.add(Opcode.OP_0); + _.each(signatures, function(signature) { + $.checkArgument(BufferUtil.isBuffer(signature), 'Signatures must be an array of Buffers'); + // TODO: allow signatures to be an array of Signature objects + s.add(signature); + }); + return s; +}; + +/** + * A new P2SH Multisig input script for the given public keys, requiring m of those public keys to spend + * + * @param {PublicKey[]} pubkeys list of all public keys controlling the output + * @param {number} threshold amount of required signatures to spend the output + * @param {Array} signatures and array of signature buffers to append to the script + * @param {Object=} opts + * @param {boolean=} opts.noSorting don't sort the given public keys before creating the script (false by default) + * @param {Script=} opts.cachedMultisig don't recalculate the redeemScript + * + * @returns {Script} + */ +Script.buildP2SHMultisigIn = function(pubkeys, threshold, signatures, opts) { + $.checkArgument(_.isArray(pubkeys)); + $.checkArgument(_.isNumber(threshold)); + $.checkArgument(_.isArray(signatures)); + opts = opts || {}; + var s = new Script(); + s.add(Opcode.OP_0); + _.each(signatures, function(signature) { + $.checkArgument(BufferUtil.isBuffer(signature), 'Signatures must be an array of Buffers'); + // TODO: allow signatures to be an array of Signature objects + s.add(signature); + }); + s.add((opts.cachedMultisig || Script.buildMultisigOut(pubkeys, threshold, opts)).toBuffer()); + return s; +}; + +/** + * @returns {Script} a new pay to public key hash output for the given + * address or public key + * @param {(Address|PublicKey)} to - destination address or public key + */ +Script.buildPublicKeyHashOut = function(to) { + $.checkArgument(!_.isUndefined(to)); + $.checkArgument(to instanceof PublicKey || to instanceof Address || _.isString(to)); + if (to instanceof PublicKey) { + to = to.toAddress(); + } else if (_.isString(to)) { + to = new Address(to); + } + var s = new Script(); + s.add(Opcode.OP_DUP) + .add(Opcode.OP_HASH160) + .add(to.hashBuffer) + .add(Opcode.OP_EQUALVERIFY) + .add(Opcode.OP_CHECKSIG); + s._network = to.network; + return s; +}; + +/** + * @returns {Script} a new pay to public key output for the given + * public key + */ +Script.buildPublicKeyOut = function(pubkey) { + $.checkArgument(pubkey instanceof PublicKey); + var s = new Script(); + s.add(pubkey.toBuffer()) + .add(Opcode.OP_CHECKSIG); + return s; +}; + +/** + * @returns {Script} a new OP_RETURN script with data + * @param {(string|Buffer)} data - the data to embed in the output + * @param {(string)} encoding - the type of encoding of the string + */ +Script.buildDataOut = function(data, encoding) { + $.checkArgument(_.isUndefined(data) || _.isString(data) || BufferUtil.isBuffer(data)); + if (_.isString(data)) { + data = new Buffer(data, encoding); + } + var s = new Script(); + s.add(Opcode.OP_RETURN); + if (!_.isUndefined(data)) { + s.add(data); + } + return s; +}; + +/** + * @param {Script|Address} script - the redeemScript for the new p2sh output. + * It can also be a p2sh address + * @returns {Script} new pay to script hash script for given script + */ +Script.buildScriptHashOut = function(script) { + $.checkArgument(script instanceof Script || + (script instanceof Address && script.isPayToScriptHash())); + var s = new Script(); + s.add(Opcode.OP_HASH160) + .add(script instanceof Address ? script.hashBuffer : Hash.sha256ripemd160(script.toBuffer())) + .add(Opcode.OP_EQUAL); + + s._network = script._network || script.network; + return s; +}; + +/** + * Builds a scriptSig (a script for an input) that signs a public key output script. + * + * @param {Signature|Buffer} signature - a Signature object, or the signature in DER canonical encoding + * @param {number=} sigtype - the type of the signature (defaults to SIGHASH_ALL) + */ +Script.buildPublicKeyIn = function(signature, sigtype) { + $.checkArgument(signature instanceof Signature || BufferUtil.isBuffer(signature)); + $.checkArgument(_.isUndefined(sigtype) || _.isNumber(sigtype)); + if (signature instanceof Signature) { + signature = signature.toBuffer(); + } + var script = new Script(); + script.add(BufferUtil.concat([ + signature, + BufferUtil.integerAsSingleByteBuffer(sigtype || Signature.SIGHASH_ALL) + ])); + return script; +}; + +/** + * Builds a scriptSig (a script for an input) that signs a public key hash + * output script. + * + * @param {Buffer|string|PublicKey} publicKey + * @param {Signature|Buffer} signature - a Signature object, or the signature in DER canonical encoding + * @param {number=} sigtype - the type of the signature (defaults to SIGHASH_ALL) + */ +Script.buildPublicKeyHashIn = function(publicKey, signature, sigtype) { + $.checkArgument(signature instanceof Signature || BufferUtil.isBuffer(signature)); + $.checkArgument(_.isUndefined(sigtype) || _.isNumber(sigtype)); + if (signature instanceof Signature) { + signature = signature.toBuffer(); + } + var script = new Script() + .add(BufferUtil.concat([ + signature, + BufferUtil.integerAsSingleByteBuffer(sigtype || Signature.SIGHASH_ALL) + ])) + .add(new PublicKey(publicKey).toBuffer()); + return script; +}; + +/** + * @returns {Script} an empty script + */ +Script.empty = function() { + return new Script(); +}; + +/** + * @returns {Script} a new pay to script hash script that pays to this script + */ +Script.prototype.toScriptHashOut = function() { + return Script.buildScriptHashOut(this); +}; + +/** + * @return {Script} an output script built from the address + */ +Script.fromAddress = function(address) { + address = Address(address); + if (address.isPayToScriptHash()) { + return Script.buildScriptHashOut(address); + } else if (address.isPayToPublicKeyHash()) { + return Script.buildPublicKeyHashOut(address); + } + throw new errors.Script.UnrecognizedAddress(address); +}; + +/** + * Will return the associated address information object + * @return {Address|boolean} + */ +Script.prototype.getAddressInfo = function(opts) { + if (this._isInput) { + return this._getInputAddressInfo(); + } else if (this._isOutput) { + return this._getOutputAddressInfo(); + } else { + var info = this._getOutputAddressInfo(); + if (!info) { + return this._getInputAddressInfo(); + } + return info; + } +}; + +/** + * Will return the associated output scriptPubKey address information object + * @return {Address|boolean} + * @private + */ +Script.prototype._getOutputAddressInfo = function() { + var info = {}; + if (this.isScriptHashOut()) { + info.hashBuffer = this.getData(); + info.type = Address.PayToScriptHash; + } else if (this.isPublicKeyHashOut()) { + info.hashBuffer = this.getData(); + info.type = Address.PayToPublicKeyHash; + } else { + return false; + } + return info; +}; + +/** + * Will return the associated input scriptSig address information object + * @return {Address|boolean} + * @private + */ +Script.prototype._getInputAddressInfo = function() { + var info = {}; + if (this.isPublicKeyHashIn()) { + // hash the publickey found in the scriptSig + info.hashBuffer = Hash.sha256ripemd160(this.chunks[1].buf); + info.type = Address.PayToPublicKeyHash; + } else if (this.isScriptHashIn()) { + // hash the redeemscript found at the end of the scriptSig + info.hashBuffer = Hash.sha256ripemd160(this.chunks[this.chunks.length - 1].buf); + info.type = Address.PayToScriptHash; + } else { + return false; + } + return info; +}; + +/** + * @param {Network=} network + * @return {Address|boolean} the associated address for this script if possible, or false + */ +Script.prototype.toAddress = function(network) { + var info = this.getAddressInfo(); + if (!info) { + return false; + } + info.network = Networks.get(network) || this._network || Networks.defaultNetwork; + return new Address(info); +}; + +/** + * Analogous to bitcoind's FindAndDelete. Find and delete equivalent chunks, + * typically used with push data chunks. Note that this will find and delete + * not just the same data, but the same data with the same push data op as + * produced by default. i.e., if a pushdata in a tx does not use the minimal + * pushdata op, then when you try to remove the data it is pushing, it will not + * be removed, because they do not use the same pushdata op. + */ +Script.prototype.findAndDelete = function(script) { + var buf = script.toBuffer(); + var hex = buf.toString('hex'); + for (var i = 0; i < this.chunks.length; i++) { + var script2 = Script({ + chunks: [this.chunks[i]] + }); + var buf2 = script2.toBuffer(); + var hex2 = buf2.toString('hex'); + if (hex === hex2) { + this.chunks.splice(i, 1); + } + } + return this; +}; + +/** + * Comes from bitcoind's script interpreter CheckMinimalPush function + * @returns {boolean} if the chunk {i} is the smallest way to push that particular data. + */ +Script.prototype.checkMinimalPush = function(i) { + var chunk = this.chunks[i]; + var buf = chunk.buf; + var opcodenum = chunk.opcodenum; + if (!buf) { + return true; + } + if (buf.length === 0) { + // Could have used OP_0. + return opcodenum === Opcode.OP_0; + } else if (buf.length === 1 && buf[0] >= 1 && buf[0] <= 16) { + // Could have used OP_1 .. OP_16. + return opcodenum === Opcode.OP_1 + (buf[0] - 1); + } else if (buf.length === 1 && buf[0] === 0x81) { + // Could have used OP_1NEGATE + return opcodenum === Opcode.OP_1NEGATE; + } else if (buf.length <= 75) { + // Could have used a direct push (opcode indicating number of bytes pushed + those bytes). + return opcodenum === buf.length; + } else if (buf.length <= 255) { + // Could have used OP_PUSHDATA. + return opcodenum === Opcode.OP_PUSHDATA1; + } else if (buf.length <= 65535) { + // Could have used OP_PUSHDATA2. + return opcodenum === Opcode.OP_PUSHDATA2; + } + return true; +}; + +/** + * Comes from bitcoind's script DecodeOP_N function + * @param {number} opcode + * @returns {number} numeric value in range of 0 to 16 + */ +Script.prototype._decodeOP_N = function(opcode) { + if (opcode === Opcode.OP_0) { + return 0; + } else if (opcode >= Opcode.OP_1 && opcode <= Opcode.OP_16) { + return opcode - (Opcode.OP_1 - 1); + } else { + throw new Error('Invalid opcode: ' + JSON.stringify(opcode)); + } +}; + +/** + * Comes from bitcoind's script GetSigOpCount(boolean) function + * @param {boolean} use current (true) or pre-version-0.6 (false) logic + * @returns {number} number of signature operations required by this script + */ +Script.prototype.getSignatureOperationsCount = function(accurate) { + accurate = (_.isUndefined(accurate) ? true : accurate); + var self = this; + var n = 0; + var lastOpcode = Opcode.OP_INVALIDOPCODE; + _.each(self.chunks, function getChunk(chunk) { + var opcode = chunk.opcodenum; + if (opcode == Opcode.OP_CHECKSIG || opcode == Opcode.OP_CHECKSIGVERIFY) { + n++; + } else if (opcode == Opcode.OP_CHECKMULTISIG || opcode == Opcode.OP_CHECKMULTISIGVERIFY) { + if (accurate && lastOpcode >= Opcode.OP_1 && lastOpcode <= Opcode.OP_16) { + n += self._decodeOP_N(lastOpcode); + } else { + n += 20; + } + } + lastOpcode = opcode; + }); + return n; +}; + +module.exports = Script; + +}).call(this,require("buffer").Buffer) +},{"../address":1,"../crypto/hash":8,"../crypto/signature":11,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../errors":17,"../networks":21,"../opcode":22,"../publickey":24,"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"buffer":47,"lodash":319}],28:[function(require,module,exports){ +module.exports = require('./transaction'); + +module.exports.Input = require('./input'); +module.exports.Output = require('./output'); +module.exports.UnspentOutput = require('./unspentoutput'); +module.exports.Signature = require('./signature'); +module.exports.Sighash = require('./sighash'); + +},{"./input":29,"./output":35,"./sighash":36,"./signature":37,"./transaction":38,"./unspentoutput":39}],29:[function(require,module,exports){ +module.exports = require('./input'); + +module.exports.PublicKey = require('./publickey'); +module.exports.PublicKeyHash = require('./publickeyhash'); +module.exports.MultiSig = require('./multisig.js'); +module.exports.MultiSigScriptHash = require('./multisigscripthash.js'); + +},{"./input":30,"./multisig.js":31,"./multisigscripthash.js":32,"./publickey":33,"./publickeyhash":34}],30:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); +var $ = require('../../util/preconditions'); +var errors = require('../../errors'); +var BufferWriter = require('../../encoding/bufferwriter'); +var buffer = require('buffer'); +var BufferUtil = require('../../util/buffer'); +var JSUtil = require('../../util/js'); +var Script = require('../../script'); +var Sighash = require('../sighash'); +var Output = require('../output'); + +var MAXINT = 0xffffffff; // Math.pow(2, 32) - 1; +var DEFAULT_RBF_SEQNUMBER = MAXINT - 2; +var DEFAULT_SEQNUMBER = MAXINT; +var DEFAULT_LOCKTIME_SEQNUMBER = MAXINT - 1; + +function Input(params) { + if (!(this instanceof Input)) { + return new Input(params); + } + if (params) { + return this._fromObject(params); + } +} + +Input.MAXINT = MAXINT; +Input.DEFAULT_SEQNUMBER = DEFAULT_SEQNUMBER; +Input.DEFAULT_LOCKTIME_SEQNUMBER = DEFAULT_LOCKTIME_SEQNUMBER; +Input.DEFAULT_RBF_SEQNUMBER = DEFAULT_RBF_SEQNUMBER; + +Object.defineProperty(Input.prototype, 'script', { + configurable: false, + enumerable: true, + get: function() { + if (this.isNull()) { + return null; + } + if (!this._script) { + this._script = new Script(this._scriptBuffer); + this._script._isInput = true; + } + return this._script; + } +}); + +Input.fromObject = function(obj) { + $.checkArgument(_.isObject(obj)); + var input = new Input(); + return input._fromObject(obj); +}; + +Input.prototype._fromObject = function(params) { + var prevTxId; + if (_.isString(params.prevTxId) && JSUtil.isHexa(params.prevTxId)) { + prevTxId = new buffer.Buffer(params.prevTxId, 'hex'); + } else { + prevTxId = params.prevTxId; + } + this.output = params.output ? + (params.output instanceof Output ? params.output : new Output(params.output)) : undefined; + this.prevTxId = prevTxId || params.txidbuf; + this.outputIndex = _.isUndefined(params.outputIndex) ? params.txoutnum : params.outputIndex; + this.sequenceNumber = _.isUndefined(params.sequenceNumber) ? + (_.isUndefined(params.seqnum) ? DEFAULT_SEQNUMBER : params.seqnum) : params.sequenceNumber; + if (_.isUndefined(params.script) && _.isUndefined(params.scriptBuffer)) { + throw new errors.Transaction.Input.MissingScript(); + } + this.setScript(params.scriptBuffer || params.script); + return this; +}; + +Input.prototype.toObject = Input.prototype.toJSON = function toObject() { + var obj = { + prevTxId: this.prevTxId.toString('hex'), + outputIndex: this.outputIndex, + sequenceNumber: this.sequenceNumber, + script: this._scriptBuffer.toString('hex'), + }; + // add human readable form if input contains valid script + if (this.script) { + obj.scriptString = this.script.toString(); + } + if (this.output) { + obj.output = this.output.toObject(); + } + return obj; +}; + +Input.fromBufferReader = function(br) { + var input = new Input(); + input.prevTxId = br.readReverse(32); + input.outputIndex = br.readUInt32LE(); + input._scriptBuffer = br.readVarLengthBuffer(); + input.sequenceNumber = br.readUInt32LE(); + // TODO: return different classes according to which input it is + // e.g: CoinbaseInput, PublicKeyHashInput, MultiSigScriptHashInput, etc. + return input; +}; + +Input.prototype.toBufferWriter = function(writer) { + if (!writer) { + writer = new BufferWriter(); + } + writer.writeReverse(this.prevTxId); + writer.writeUInt32LE(this.outputIndex); + var script = this._scriptBuffer; + writer.writeVarintNum(script.length); + writer.write(script); + writer.writeUInt32LE(this.sequenceNumber); + return writer; +}; + +Input.prototype.setScript = function(script) { + this._script = null; + if (script instanceof Script) { + this._script = script; + this._script._isInput = true; + this._scriptBuffer = script.toBuffer(); + } else if (JSUtil.isHexa(script)) { + // hex string script + this._scriptBuffer = new buffer.Buffer(script, 'hex'); + } else if (_.isString(script)) { + // human readable string script + this._script = new Script(script); + this._script._isInput = true; + this._scriptBuffer = this._script.toBuffer(); + } else if (BufferUtil.isBuffer(script)) { + // buffer script + this._scriptBuffer = new buffer.Buffer(script); + } else { + throw new TypeError('Invalid argument type: script'); + } + return this; +}; + +/** + * Retrieve signatures for the provided PrivateKey. + * + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key to use when signing + * @param {number} inputIndex - the index of this input in the provided transaction + * @param {number} sigType - defaults to Signature.SIGHASH_ALL + * @param {Buffer} addressHash - if provided, don't calculate the hash of the + * public key associated with the private key provided + * @abstract + */ +Input.prototype.getSignatures = function() { + throw new errors.AbstractMethodInvoked( + 'Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported)' + + ' for input: ' + JSON.stringify(this) + ); +}; + +Input.prototype.isFullySigned = function() { + throw new errors.AbstractMethodInvoked('Input#isFullySigned'); +}; + +Input.prototype.isFinal = function() { + return this.sequenceNumber !== 4294967295; +}; + +Input.prototype.addSignature = function() { + throw new errors.AbstractMethodInvoked('Input#addSignature'); +}; + +Input.prototype.clearSignatures = function() { + throw new errors.AbstractMethodInvoked('Input#clearSignatures'); +}; + +Input.prototype.isValidSignature = function(transaction, signature) { + // FIXME: Refactor signature so this is not necessary + signature.signature.nhashtype = signature.sigtype; + return Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + this.output.script + ); +}; + +/** + * @returns true if this is a coinbase input (represents no input) + */ +Input.prototype.isNull = function() { + return this.prevTxId.toString('hex') === '0000000000000000000000000000000000000000000000000000000000000000' && + this.outputIndex === 0xffffffff; +}; + +Input.prototype._estimateSize = function() { + return this.toBufferWriter().toBuffer().length; +}; + +module.exports = Input; + +},{"../../encoding/bufferwriter":15,"../../errors":17,"../../script":25,"../../util/buffer":42,"../../util/js":43,"../../util/preconditions":44,"../output":35,"../sighash":36,"buffer":47,"lodash":319}],31:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); +var inherits = require('inherits'); +var Transaction = require('../transaction'); +var Input = require('./input'); +var Output = require('../output'); +var $ = require('../../util/preconditions'); + +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var Sighash = require('../sighash'); +var PublicKey = require('../../publickey'); +var BufferUtil = require('../../util/buffer'); +var TransactionSignature = require('../signature'); + +/** + * @constructor + */ +function MultiSigInput(input, pubkeys, threshold, signatures) { + Input.apply(this, arguments); + var self = this; + pubkeys = pubkeys || input.publicKeys; + threshold = threshold || input.threshold; + signatures = signatures || input.signatures; + this.publicKeys = _.sortBy(pubkeys, function(publicKey) { return publicKey.toString('hex'); }); + $.checkState(Script.buildMultisigOut(this.publicKeys, threshold).equals(this.output.script), + 'Provided public keys don\'t match to the provided output script'); + this.publicKeyIndex = {}; + _.each(this.publicKeys, function(publicKey, index) { + self.publicKeyIndex[publicKey.toString()] = index; + }); + this.threshold = threshold; + // Empty array of signatures + this.signatures = signatures ? this._deserializeSignatures(signatures) : new Array(this.publicKeys.length); +} +inherits(MultiSigInput, Input); + +MultiSigInput.prototype.toObject = function() { + var obj = Input.prototype.toObject.apply(this, arguments); + obj.threshold = this.threshold; + obj.publicKeys = _.map(this.publicKeys, function(publicKey) { return publicKey.toString(); }); + obj.signatures = this._serializeSignatures(); + return obj; +}; + +MultiSigInput.prototype._deserializeSignatures = function(signatures) { + return _.map(signatures, function(signature) { + if (!signature) { + return undefined; + } + return new TransactionSignature(signature); + }); +}; + +MultiSigInput.prototype._serializeSignatures = function() { + return _.map(this.signatures, function(signature) { + if (!signature) { + return undefined; + } + return signature.toObject(); + }); +}; + +MultiSigInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) { + $.checkState(this.output instanceof Output); + sigtype = sigtype || Signature.SIGHASH_ALL; + + var self = this; + var results = []; + _.each(this.publicKeys, function(publicKey) { + if (publicKey.toString() === privateKey.publicKey.toString()) { + results.push(new TransactionSignature({ + publicKey: privateKey.publicKey, + prevTxId: self.prevTxId, + outputIndex: self.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, self.output.script), + sigtype: sigtype + })); + } + }); + + return results; +}; + +MultiSigInput.prototype.addSignature = function(transaction, signature) { + $.checkState(!this.isFullySigned(), 'All needed signatures have already been added'); + $.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]), + 'Signature has no matching public key'); + $.checkState(this.isValidSignature(transaction, signature)); + this.signatures[this.publicKeyIndex[signature.publicKey.toString()]] = signature; + this._updateScript(); + return this; +}; + +MultiSigInput.prototype._updateScript = function() { + this.setScript(Script.buildMultisigIn( + this.publicKeys, + this.threshold, + this._createSignatures() + )); + return this; +}; + +MultiSigInput.prototype._createSignatures = function() { + return _.map( + _.filter(this.signatures, function(signature) { return !_.isUndefined(signature); }), + function(signature) { + return BufferUtil.concat([ + signature.signature.toDER(), + BufferUtil.integerAsSingleByteBuffer(signature.sigtype) + ]); + } + ); +}; + +MultiSigInput.prototype.clearSignatures = function() { + this.signatures = new Array(this.publicKeys.length); + this._updateScript(); +}; + +MultiSigInput.prototype.isFullySigned = function() { + return this.countSignatures() === this.threshold; +}; + +MultiSigInput.prototype.countMissingSignatures = function() { + return this.threshold - this.countSignatures(); +}; + +MultiSigInput.prototype.countSignatures = function() { + return _.reduce(this.signatures, function(sum, signature) { + return sum + (!!signature); + }, 0); +}; + +MultiSigInput.prototype.publicKeysWithoutSignature = function() { + var self = this; + return _.filter(this.publicKeys, function(publicKey) { + return !(self.signatures[self.publicKeyIndex[publicKey.toString()]]); + }); +}; + +MultiSigInput.prototype.isValidSignature = function(transaction, signature) { + // FIXME: Refactor signature so this is not necessary + signature.signature.nhashtype = signature.sigtype; + return Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + this.output.script + ); +}; + +/** + * + * @param {Buffer[]} signatures + * @param {PublicKey[]} publicKeys + * @param {Transaction} transaction + * @param {Integer} inputIndex + * @param {Input} input + * @returns {TransactionSignature[]} + */ +MultiSigInput.normalizeSignatures = function(transaction, input, inputIndex, signatures, publicKeys) { + return publicKeys.map(function (pubKey) { + var signatureMatch = null; + signatures = signatures.filter(function (signatureBuffer) { + if (signatureMatch) { + return true; + } + + var signature = new TransactionSignature({ + signature: Signature.fromTxFormat(signatureBuffer), + publicKey: pubKey, + prevTxId: input.prevTxId, + outputIndex: input.outputIndex, + inputIndex: inputIndex, + sigtype: Signature.SIGHASH_ALL + }); + + signature.signature.nhashtype = signature.sigtype; + var isMatch = Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + input.output.script + ); + + if (isMatch) { + signatureMatch = signature; + return false; + } + + return true; + }); + + return signatureMatch ? signatureMatch : null; + }); +}; + +MultiSigInput.OPCODES_SIZE = 1; // 0 +MultiSigInput.SIGNATURE_SIZE = 73; // size (1) + DER (<=72) + +MultiSigInput.prototype._estimateSize = function() { + return MultiSigInput.OPCODES_SIZE + + this.threshold * MultiSigInput.SIGNATURE_SIZE; +}; + +module.exports = MultiSigInput; + +},{"../../crypto/signature":11,"../../publickey":24,"../../script":25,"../../util/buffer":42,"../../util/preconditions":44,"../output":35,"../sighash":36,"../signature":37,"../transaction":38,"./input":30,"inherits":318,"lodash":319}],32:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); +var inherits = require('inherits'); +var Input = require('./input'); +var Output = require('../output'); +var $ = require('../../util/preconditions'); + +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var Sighash = require('../sighash'); +var PublicKey = require('../../publickey'); +var BufferUtil = require('../../util/buffer'); +var TransactionSignature = require('../signature'); + +/** + * @constructor + */ +function MultiSigScriptHashInput(input, pubkeys, threshold, signatures) { + Input.apply(this, arguments); + var self = this; + pubkeys = pubkeys || input.publicKeys; + threshold = threshold || input.threshold; + signatures = signatures || input.signatures; + this.publicKeys = _.sortBy(pubkeys, function(publicKey) { return publicKey.toString('hex'); }); + this.redeemScript = Script.buildMultisigOut(this.publicKeys, threshold); + $.checkState(Script.buildScriptHashOut(this.redeemScript).equals(this.output.script), + 'Provided public keys don\'t hash to the provided output'); + this.publicKeyIndex = {}; + _.each(this.publicKeys, function(publicKey, index) { + self.publicKeyIndex[publicKey.toString()] = index; + }); + this.threshold = threshold; + // Empty array of signatures + this.signatures = signatures ? this._deserializeSignatures(signatures) : new Array(this.publicKeys.length); +} +inherits(MultiSigScriptHashInput, Input); + +MultiSigScriptHashInput.prototype.toObject = function() { + var obj = Input.prototype.toObject.apply(this, arguments); + obj.threshold = this.threshold; + obj.publicKeys = _.map(this.publicKeys, function(publicKey) { return publicKey.toString(); }); + obj.signatures = this._serializeSignatures(); + return obj; +}; + +MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures) { + return _.map(signatures, function(signature) { + if (!signature) { + return undefined; + } + return new TransactionSignature(signature); + }); +}; + +MultiSigScriptHashInput.prototype._serializeSignatures = function() { + return _.map(this.signatures, function(signature) { + if (!signature) { + return undefined; + } + return signature.toObject(); + }); +}; + +MultiSigScriptHashInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) { + $.checkState(this.output instanceof Output); + sigtype = sigtype || Signature.SIGHASH_ALL; + + var self = this; + var results = []; + _.each(this.publicKeys, function(publicKey) { + if (publicKey.toString() === privateKey.publicKey.toString()) { + results.push(new TransactionSignature({ + publicKey: privateKey.publicKey, + prevTxId: self.prevTxId, + outputIndex: self.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, self.redeemScript), + sigtype: sigtype + })); + } + }); + return results; +}; + +MultiSigScriptHashInput.prototype.addSignature = function(transaction, signature) { + $.checkState(!this.isFullySigned(), 'All needed signatures have already been added'); + $.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]), + 'Signature has no matching public key'); + $.checkState(this.isValidSignature(transaction, signature)); + this.signatures[this.publicKeyIndex[signature.publicKey.toString()]] = signature; + this._updateScript(); + return this; +}; + +MultiSigScriptHashInput.prototype._updateScript = function() { + this.setScript(Script.buildP2SHMultisigIn( + this.publicKeys, + this.threshold, + this._createSignatures(), + { cachedMultisig: this.redeemScript } + )); + return this; +}; + +MultiSigScriptHashInput.prototype._createSignatures = function() { + return _.map( + _.filter(this.signatures, function(signature) { return !_.isUndefined(signature); }), + function(signature) { + return BufferUtil.concat([ + signature.signature.toDER(), + BufferUtil.integerAsSingleByteBuffer(signature.sigtype) + ]); + } + ); +}; + +MultiSigScriptHashInput.prototype.clearSignatures = function() { + this.signatures = new Array(this.publicKeys.length); + this._updateScript(); +}; + +MultiSigScriptHashInput.prototype.isFullySigned = function() { + return this.countSignatures() === this.threshold; +}; + +MultiSigScriptHashInput.prototype.countMissingSignatures = function() { + return this.threshold - this.countSignatures(); +}; + +MultiSigScriptHashInput.prototype.countSignatures = function() { + return _.reduce(this.signatures, function(sum, signature) { + return sum + (!!signature); + }, 0); +}; + +MultiSigScriptHashInput.prototype.publicKeysWithoutSignature = function() { + var self = this; + return _.filter(this.publicKeys, function(publicKey) { + return !(self.signatures[self.publicKeyIndex[publicKey.toString()]]); + }); +}; + +MultiSigScriptHashInput.prototype.isValidSignature = function(transaction, signature) { + // FIXME: Refactor signature so this is not necessary + signature.signature.nhashtype = signature.sigtype; + return Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + this.redeemScript + ); +}; + +MultiSigScriptHashInput.OPCODES_SIZE = 7; // serialized size (<=3) + 0 .. N .. M OP_CHECKMULTISIG +MultiSigScriptHashInput.SIGNATURE_SIZE = 74; // size (1) + DER (<=72) + sighash (1) +MultiSigScriptHashInput.PUBKEY_SIZE = 34; // size (1) + DER (<=33) + +MultiSigScriptHashInput.prototype._estimateSize = function() { + return MultiSigScriptHashInput.OPCODES_SIZE + + this.threshold * MultiSigScriptHashInput.SIGNATURE_SIZE + + this.publicKeys.length * MultiSigScriptHashInput.PUBKEY_SIZE; +}; + +module.exports = MultiSigScriptHashInput; + +},{"../../crypto/signature":11,"../../publickey":24,"../../script":25,"../../util/buffer":42,"../../util/preconditions":44,"../output":35,"../sighash":36,"../signature":37,"./input":30,"inherits":318,"lodash":319}],33:[function(require,module,exports){ +'use strict'; + +var inherits = require('inherits'); + +var $ = require('../../util/preconditions'); +var BufferUtil = require('../../util/buffer'); + +var Input = require('./input'); +var Output = require('../output'); +var Sighash = require('../sighash'); +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var TransactionSignature = require('../signature'); + +/** + * Represents a special kind of input of PayToPublicKey kind. + * @constructor + */ +function PublicKeyInput() { + Input.apply(this, arguments); +} +inherits(PublicKeyInput, Input); + +/** + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key with which to sign the transaction + * @param {number} index - the index of the input in the transaction input vector + * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL + * @return {Array} of objects that can be + */ +PublicKeyInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) { + $.checkState(this.output instanceof Output); + sigtype = sigtype || Signature.SIGHASH_ALL; + var publicKey = privateKey.toPublicKey(); + if (publicKey.toString() === this.output.script.getPublicKey().toString('hex')) { + return [new TransactionSignature({ + publicKey: publicKey, + prevTxId: this.prevTxId, + outputIndex: this.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, this.output.script), + sigtype: sigtype + })]; + } + return []; +}; + +/** + * Add the provided signature + * + * @param {Object} signature + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @param {number=} signature.sigtype + * @return {PublicKeyInput} this, for chaining + */ +PublicKeyInput.prototype.addSignature = function(transaction, signature) { + $.checkState(this.isValidSignature(transaction, signature), 'Signature is invalid'); + this.setScript(Script.buildPublicKeyIn( + signature.signature.toDER(), + signature.sigtype + )); + return this; +}; + +/** + * Clear the input's signature + * @return {PublicKeyHashInput} this, for chaining + */ +PublicKeyInput.prototype.clearSignatures = function() { + this.setScript(Script.empty()); + return this; +}; + +/** + * Query whether the input is signed + * @return {boolean} + */ +PublicKeyInput.prototype.isFullySigned = function() { + return this.script.isPublicKeyIn(); +}; + +PublicKeyInput.SCRIPT_MAX_SIZE = 73; // sigsize (1 + 72) + +PublicKeyInput.prototype._estimateSize = function() { + return PublicKeyInput.SCRIPT_MAX_SIZE; +}; + +module.exports = PublicKeyInput; + +},{"../../crypto/signature":11,"../../script":25,"../../util/buffer":42,"../../util/preconditions":44,"../output":35,"../sighash":36,"../signature":37,"./input":30,"inherits":318}],34:[function(require,module,exports){ +'use strict'; + +var inherits = require('inherits'); + +var $ = require('../../util/preconditions'); +var BufferUtil = require('../../util/buffer'); + +var Hash = require('../../crypto/hash'); +var Input = require('./input'); +var Output = require('../output'); +var Sighash = require('../sighash'); +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var TransactionSignature = require('../signature'); + +/** + * Represents a special kind of input of PayToPublicKeyHash kind. + * @constructor + */ +function PublicKeyHashInput() { + Input.apply(this, arguments); +} +inherits(PublicKeyHashInput, Input); + +/* jshint maxparams: 5 */ +/** + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key with which to sign the transaction + * @param {number} index - the index of the input in the transaction input vector + * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL + * @param {Buffer=} hashData - the precalculated hash of the public key associated with the privateKey provided + * @return {Array} of objects that can be + */ +PublicKeyHashInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype, hashData) { + $.checkState(this.output instanceof Output); + hashData = hashData || Hash.sha256ripemd160(privateKey.publicKey.toBuffer()); + sigtype = sigtype || Signature.SIGHASH_ALL; + + if (BufferUtil.equals(hashData, this.output.script.getPublicKeyHash())) { + return [new TransactionSignature({ + publicKey: privateKey.publicKey, + prevTxId: this.prevTxId, + outputIndex: this.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, this.output.script), + sigtype: sigtype + })]; + } + return []; +}; +/* jshint maxparams: 3 */ + +/** + * Add the provided signature + * + * @param {Object} signature + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @param {number=} signature.sigtype + * @return {PublicKeyHashInput} this, for chaining + */ +PublicKeyHashInput.prototype.addSignature = function(transaction, signature) { + $.checkState(this.isValidSignature(transaction, signature), 'Signature is invalid'); + this.setScript(Script.buildPublicKeyHashIn( + signature.publicKey, + signature.signature.toDER(), + signature.sigtype + )); + return this; +}; + +/** + * Clear the input's signature + * @return {PublicKeyHashInput} this, for chaining + */ +PublicKeyHashInput.prototype.clearSignatures = function() { + this.setScript(Script.empty()); + return this; +}; + +/** + * Query whether the input is signed + * @return {boolean} + */ +PublicKeyHashInput.prototype.isFullySigned = function() { + return this.script.isPublicKeyHashIn(); +}; + +PublicKeyHashInput.SCRIPT_MAX_SIZE = 73 + 34; // sigsize (1 + 72) + pubkey (1 + 33) + +PublicKeyHashInput.prototype._estimateSize = function() { + return PublicKeyHashInput.SCRIPT_MAX_SIZE; +}; + +module.exports = PublicKeyHashInput; + +},{"../../crypto/hash":8,"../../crypto/signature":11,"../../script":25,"../../util/buffer":42,"../../util/preconditions":44,"../output":35,"../sighash":36,"../signature":37,"./input":30,"inherits":318}],35:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); +var BN = require('../crypto/bn'); +var buffer = require('buffer'); +var bufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); +var BufferWriter = require('../encoding/bufferwriter'); +var Script = require('../script'); +var $ = require('../util/preconditions'); +var errors = require('../errors'); + +var MAX_SAFE_INTEGER = 0x1fffffffffffff; + +function Output(args) { + if (!(this instanceof Output)) { + return new Output(args); + } + if (_.isObject(args)) { + this.satoshis = args.satoshis; + if (bufferUtil.isBuffer(args.script)) { + this._scriptBuffer = args.script; + } else { + var script; + if (_.isString(args.script) && JSUtil.isHexa(args.script)) { + script = new buffer.Buffer(args.script, 'hex'); + } else { + script = args.script; + } + this.setScript(script); + } + } else { + throw new TypeError('Unrecognized argument for Output'); + } +} + +Object.defineProperty(Output.prototype, 'script', { + configurable: false, + enumerable: true, + get: function() { + if (this._script) { + return this._script; + } else { + this.setScriptFromBuffer(this._scriptBuffer); + return this._script; + } + + } +}); + +Object.defineProperty(Output.prototype, 'satoshis', { + configurable: false, + enumerable: true, + get: function() { + return this._satoshis; + }, + set: function(num) { + if (num instanceof BN) { + this._satoshisBN = num; + this._satoshis = num.toNumber(); + } else if (_.isString(num)) { + this._satoshis = parseInt(num); + this._satoshisBN = BN.fromNumber(this._satoshis); + } else { + $.checkArgument( + JSUtil.isNaturalNumber(num), + 'Output satoshis is not a natural number' + ); + this._satoshisBN = BN.fromNumber(num); + this._satoshis = num; + } + $.checkState( + JSUtil.isNaturalNumber(this._satoshis), + 'Output satoshis is not a natural number' + ); + } +}); + +Output.prototype.invalidSatoshis = function() { + if (this._satoshis > MAX_SAFE_INTEGER) { + return 'transaction txout satoshis greater than max safe integer'; + } + if (this._satoshis !== this._satoshisBN.toNumber()) { + return 'transaction txout satoshis has corrupted value'; + } + if (this._satoshis < 0) { + return 'transaction txout negative'; + } + return false; +}; + +Output.prototype.toObject = Output.prototype.toJSON = function toObject() { + var obj = { + satoshis: this.satoshis + }; + obj.script = this._scriptBuffer.toString('hex'); + return obj; +}; + +Output.fromObject = function(data) { + return new Output(data); +}; + +Output.prototype.setScriptFromBuffer = function(buffer) { + this._scriptBuffer = buffer; + try { + this._script = Script.fromBuffer(this._scriptBuffer); + this._script._isOutput = true; + } catch(e) { + if (e instanceof errors.Script.InvalidBuffer) { + this._script = null; + } else { + throw e; + } + } +}; + +Output.prototype.setScript = function(script) { + if (script instanceof Script) { + this._scriptBuffer = script.toBuffer(); + this._script = script; + this._script._isOutput = true; + } else if (_.isString(script)) { + this._script = Script.fromString(script); + this._scriptBuffer = this._script.toBuffer(); + this._script._isOutput = true; + } else if (bufferUtil.isBuffer(script)) { + this.setScriptFromBuffer(script); + } else { + throw new TypeError('Invalid argument type: script'); + } + return this; +}; + +Output.prototype.inspect = function() { + var scriptStr; + if (this.script) { + scriptStr = this.script.inspect(); + } else { + scriptStr = this._scriptBuffer.toString('hex'); + } + return ''; +}; + +Output.fromBufferReader = function(br) { + var obj = {}; + obj.satoshis = br.readUInt64LEBN(); + var size = br.readVarintNum(); + if (size !== 0) { + obj.script = br.read(size); + } else { + obj.script = new buffer.Buffer([]); + } + return new Output(obj); +}; + +Output.prototype.toBufferWriter = function(writer) { + if (!writer) { + writer = new BufferWriter(); + } + writer.writeUInt64LEBN(this._satoshisBN); + var script = this._scriptBuffer; + writer.writeVarintNum(script.length); + writer.write(script); + return writer; +}; + +module.exports = Output; + +},{"../crypto/bn":6,"../encoding/bufferwriter":15,"../errors":17,"../script":25,"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"buffer":47,"lodash":319}],36:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var buffer = require('buffer'); + +var Signature = require('../crypto/signature'); +var Script = require('../script'); +var Output = require('./output'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var BN = require('../crypto/bn'); +var Hash = require('../crypto/hash'); +var ECDSA = require('../crypto/ecdsa'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); + +var SIGHASH_SINGLE_BUG = '0000000000000000000000000000000000000000000000000000000000000001'; +var BITS_64_ON = 'ffffffffffffffff'; + +/** + * Returns a buffer of length 32 bytes with the hash that needs to be signed + * for OP_CHECKSIG. + * + * @name Signing.sighash + * @param {Transaction} transaction the transaction to sign + * @param {number} sighashType the type of the hash + * @param {number} inputNumber the input index for the signature + * @param {Script} subscript the script that will be signed + */ +var sighash = function sighash(transaction, sighashType, inputNumber, subscript) { + var Transaction = require('./transaction'); + var Input = require('./input'); + + var i; + // Copy transaction + var txcopy = Transaction.shallowCopy(transaction); + + // Copy script + subscript = new Script(subscript); + subscript.removeCodeseparators(); + + for (i = 0; i < txcopy.inputs.length; i++) { + // Blank signatures for other inputs + txcopy.inputs[i] = new Input(txcopy.inputs[i]).setScript(Script.empty()); + } + + txcopy.inputs[inputNumber] = new Input(txcopy.inputs[inputNumber]).setScript(subscript); + + if ((sighashType & 31) === Signature.SIGHASH_NONE || + (sighashType & 31) === Signature.SIGHASH_SINGLE) { + + // clear all sequenceNumbers + for (i = 0; i < txcopy.inputs.length; i++) { + if (i !== inputNumber) { + txcopy.inputs[i].sequenceNumber = 0; + } + } + } + + if ((sighashType & 31) === Signature.SIGHASH_NONE) { + txcopy.outputs = []; + + } else if ((sighashType & 31) === Signature.SIGHASH_SINGLE) { + // The SIGHASH_SINGLE bug. + // https://bitcointalk.org/index.php?topic=260595.0 + if (inputNumber >= txcopy.outputs.length) { + return new Buffer(SIGHASH_SINGLE_BUG, 'hex'); + } + + txcopy.outputs.length = inputNumber + 1; + + for (i = 0; i < inputNumber; i++) { + txcopy.outputs[i] = new Output({ + satoshis: BN.fromBuffer(new buffer.Buffer(BITS_64_ON, 'hex')), + script: Script.empty() + }); + } + } + + if (sighashType & Signature.SIGHASH_ANYONECANPAY) { + txcopy.inputs = [txcopy.inputs[inputNumber]]; + } + + var buf = new BufferWriter() + .write(txcopy.toBuffer()) + .writeInt32LE(sighashType) + .toBuffer(); + var ret = Hash.sha256sha256(buf); + ret = new BufferReader(ret).readReverse(); + return ret; +}; + +/** + * Create a signature + * + * @name Signing.sign + * @param {Transaction} transaction + * @param {PrivateKey} privateKey + * @param {number} sighash + * @param {number} inputIndex + * @param {Script} subscript + * @return {Signature} + */ +function sign(transaction, privateKey, sighashType, inputIndex, subscript) { + var hashbuf = sighash(transaction, sighashType, inputIndex, subscript); + var sig = ECDSA.sign(hashbuf, privateKey, 'little').set({ + nhashtype: sighashType + }); + return sig; +} + +/** + * Verify a signature + * + * @name Signing.verify + * @param {Transaction} transaction + * @param {Signature} signature + * @param {PublicKey} publicKey + * @param {number} inputIndex + * @param {Script} subscript + * @return {boolean} + */ +function verify(transaction, signature, publicKey, inputIndex, subscript) { + $.checkArgument(!_.isUndefined(transaction)); + $.checkArgument(!_.isUndefined(signature) && !_.isUndefined(signature.nhashtype)); + var hashbuf = sighash(transaction, signature.nhashtype, inputIndex, subscript); + return ECDSA.verify(hashbuf, signature, publicKey, 'little'); +} + +/** + * @namespace Signing + */ +module.exports = { + sighash: sighash, + sign: sign, + verify: verify +}; + +}).call(this,require("buffer").Buffer) +},{"../crypto/bn":6,"../crypto/ecdsa":7,"../crypto/hash":8,"../crypto/signature":11,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../script":25,"../util/preconditions":44,"./input":29,"./output":35,"./transaction":38,"buffer":47,"lodash":319}],37:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var inherits = require('inherits'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); + +var PublicKey = require('../publickey'); +var errors = require('../errors'); +var Signature = require('../crypto/signature'); + +/** + * @desc + * Wrapper around Signature with fields related to signing a transaction specifically + * + * @param {Object|string|TransactionSignature} arg + * @constructor + */ +function TransactionSignature(arg) { + if (!(this instanceof TransactionSignature)) { + return new TransactionSignature(arg); + } + if (arg instanceof TransactionSignature) { + return arg; + } + if (_.isObject(arg)) { + return this._fromObject(arg); + } + throw new errors.InvalidArgument('TransactionSignatures must be instantiated from an object'); +} +inherits(TransactionSignature, Signature); + +TransactionSignature.prototype._fromObject = function(arg) { + this._checkObjectArgs(arg); + this.publicKey = new PublicKey(arg.publicKey); + this.prevTxId = BufferUtil.isBuffer(arg.prevTxId) ? arg.prevTxId : new Buffer(arg.prevTxId, 'hex'); + this.outputIndex = arg.outputIndex; + this.inputIndex = arg.inputIndex; + this.signature = (arg.signature instanceof Signature) ? arg.signature : + BufferUtil.isBuffer(arg.signature) ? Signature.fromBuffer(arg.signature) : + Signature.fromString(arg.signature); + this.sigtype = arg.sigtype; + return this; +}; + +TransactionSignature.prototype._checkObjectArgs = function(arg) { + $.checkArgument(PublicKey(arg.publicKey), 'publicKey'); + $.checkArgument(!_.isUndefined(arg.inputIndex), 'inputIndex'); + $.checkArgument(!_.isUndefined(arg.outputIndex), 'outputIndex'); + $.checkState(_.isNumber(arg.inputIndex), 'inputIndex must be a number'); + $.checkState(_.isNumber(arg.outputIndex), 'outputIndex must be a number'); + $.checkArgument(arg.signature, 'signature'); + $.checkArgument(arg.prevTxId, 'prevTxId'); + $.checkState(arg.signature instanceof Signature || + BufferUtil.isBuffer(arg.signature) || + JSUtil.isHexa(arg.signature), 'signature must be a buffer or hexa value'); + $.checkState(BufferUtil.isBuffer(arg.prevTxId) || + JSUtil.isHexa(arg.prevTxId), 'prevTxId must be a buffer or hexa value'); + $.checkArgument(arg.sigtype, 'sigtype'); + $.checkState(_.isNumber(arg.sigtype), 'sigtype must be a number'); +}; + +/** + * Serializes a transaction to a plain JS object + * @return {Object} + */ +TransactionSignature.prototype.toObject = TransactionSignature.prototype.toJSON = function toObject() { + return { + publicKey: this.publicKey.toString(), + prevTxId: this.prevTxId.toString('hex'), + outputIndex: this.outputIndex, + inputIndex: this.inputIndex, + signature: this.signature.toString(), + sigtype: this.sigtype + }; +}; + +/** + * Builds a TransactionSignature from an object + * @param {Object} object + * @return {TransactionSignature} + */ +TransactionSignature.fromObject = function(object) { + $.checkArgument(object); + return new TransactionSignature(object); +}; + +module.exports = TransactionSignature; + +}).call(this,require("buffer").Buffer) +},{"../crypto/signature":11,"../errors":17,"../publickey":24,"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"buffer":47,"inherits":318,"lodash":319}],38:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var buffer = require('buffer'); +var compare = Buffer.compare || require('buffer-compare'); + +var errors = require('../errors'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var Signature = require('../crypto/signature'); +var Sighash = require('./sighash'); + +var Address = require('../address'); +var UnspentOutput = require('./unspentoutput'); +var Input = require('./input'); +var PublicKeyHashInput = Input.PublicKeyHash; +var PublicKeyInput = Input.PublicKey; +var MultiSigScriptHashInput = Input.MultiSigScriptHash; +var MultiSigInput = Input.MultiSig; +var Output = require('./output'); +var Script = require('../script'); +var PrivateKey = require('../privatekey'); +var BN = require('../crypto/bn'); + +/** + * Represents a transaction, a set of inputs and outputs to change ownership of tokens + * + * @param {*} serialized + * @constructor + */ +function Transaction(serialized) { + if (!(this instanceof Transaction)) { + return new Transaction(serialized); + } + this.inputs = []; + this.outputs = []; + this._inputAmount = undefined; + this._outputAmount = undefined; + + if (serialized) { + if (serialized instanceof Transaction) { + return Transaction.shallowCopy(serialized); + } else if (JSUtil.isHexa(serialized)) { + this.fromString(serialized); + } else if (BufferUtil.isBuffer(serialized)) { + this.fromBuffer(serialized); + } else if (_.isObject(serialized)) { + this.fromObject(serialized); + } else { + throw new errors.InvalidArgument('Must provide an object or string to deserialize a transaction'); + } + } else { + this._newTransaction(); + } +} + +var CURRENT_VERSION = 1; +var DEFAULT_NLOCKTIME = 0; +var MAX_BLOCK_SIZE = 1000000; + +// Minimum amount for an output for it not to be considered a dust output +Transaction.DUST_AMOUNT = 546; + +// Margin of error to allow fees in the vecinity of the expected value but doesn't allow a big difference +Transaction.FEE_SECURITY_MARGIN = 150; + +// max amount of satoshis in circulation +Transaction.MAX_MONEY = 21000000 * 1e8; + +// nlocktime limit to be considered block height rather than a timestamp +Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT = 5e8; + +// Max value for an unsigned 32 bit value +Transaction.NLOCKTIME_MAX_VALUE = 4294967295; + +// Value used for fee estimation (satoshis per kilobyte) +Transaction.FEE_PER_KB = 100000; + +// Safe upper bound for change address script size in bytes +Transaction.CHANGE_OUTPUT_MAX_SIZE = 20 + 4 + 34 + 4; +Transaction.MAXIMUM_EXTRA_SIZE = 4 + 9 + 9 + 4; + +/* Constructors and Serialization */ + +/** + * Create a 'shallow' copy of the transaction, by serializing and deserializing + * it dropping any additional information that inputs and outputs may have hold + * + * @param {Transaction} transaction + * @return {Transaction} + */ +Transaction.shallowCopy = function(transaction) { + var copy = new Transaction(transaction.toBuffer()); + return copy; +}; + +var hashProperty = { + configurable: false, + enumerable: true, + get: function() { + return new BufferReader(this._getHash()).readReverse().toString('hex'); + } +}; +Object.defineProperty(Transaction.prototype, 'hash', hashProperty); +Object.defineProperty(Transaction.prototype, 'id', hashProperty); + +var ioProperty = { + configurable: false, + enumerable: true, + get: function() { + return this._getInputAmount(); + } +}; +Object.defineProperty(Transaction.prototype, 'inputAmount', ioProperty); +ioProperty.get = function() { + return this._getOutputAmount(); +}; +Object.defineProperty(Transaction.prototype, 'outputAmount', ioProperty); + +/** + * Retrieve the little endian hash of the transaction (used for serialization) + * @return {Buffer} + */ +Transaction.prototype._getHash = function() { + return Hash.sha256sha256(this.toBuffer()); +}; + +/** + * Retrieve a hexa string that can be used with bitcoind's CLI interface + * (decoderawtransaction, sendrawtransaction) + * + * @param {Object|boolean=} unsafe if true, skip all tests. if it's an object, + * it's expected to contain a set of flags to skip certain tests: + * * `disableAll`: disable all checks + * * `disableSmallFees`: disable checking for fees that are too small + * * `disableLargeFees`: disable checking for fees that are too large + * * `disableIsFullySigned`: disable checking if all inputs are fully signed + * * `disableDustOutputs`: disable checking if there are no outputs that are dust amounts + * * `disableMoreOutputThanInput`: disable checking if the transaction spends more bitcoins than the sum of the input amounts + * @return {string} + */ +Transaction.prototype.serialize = function(unsafe) { + if (true === unsafe || unsafe && unsafe.disableAll) { + return this.uncheckedSerialize(); + } else { + return this.checkedSerialize(unsafe); + } +}; + +Transaction.prototype.uncheckedSerialize = Transaction.prototype.toString = function() { + return this.toBuffer().toString('hex'); +}; + +/** + * Retrieve a hexa string that can be used with bitcoind's CLI interface + * (decoderawtransaction, sendrawtransaction) + * + * @param {Object} opts allows to skip certain tests. {@see Transaction#serialize} + * @return {string} + */ +Transaction.prototype.checkedSerialize = function(opts) { + var serializationError = this.getSerializationError(opts); + if (serializationError) { + serializationError.message += ' - For more information please see: ' + + 'https://bitcore.io/api/lib/transaction#serialization-checks'; + throw serializationError; + } + return this.uncheckedSerialize(); +}; + +Transaction.prototype.invalidSatoshis = function() { + var invalid = false; + for (var i = 0; i < this.outputs.length; i++) { + if (this.outputs[i].invalidSatoshis()) { + invalid = true; + } + } + return invalid; +}; + +/** + * Retrieve a possible error that could appear when trying to serialize and + * broadcast this transaction. + * + * @param {Object} opts allows to skip certain tests. {@see Transaction#serialize} + * @return {bitcore.Error} + */ +Transaction.prototype.getSerializationError = function(opts) { + opts = opts || {}; + + if (this.invalidSatoshis()) { + return new errors.Transaction.InvalidSatoshis(); + } + + var unspent = this._getUnspentValue(); + var unspentError; + if (unspent < 0) { + if (!opts.disableMoreOutputThanInput) { + unspentError = new errors.Transaction.InvalidOutputAmountSum(); + } + } else { + unspentError = this._hasFeeError(opts, unspent); + } + + return unspentError || + this._hasDustOutputs(opts) || + this._isMissingSignatures(opts); +}; + +Transaction.prototype._hasFeeError = function(opts, unspent) { + + if (!_.isUndefined(this._fee) && this._fee !== unspent) { + return new errors.Transaction.FeeError.Different( + 'Unspent value is ' + unspent + ' but specified fee is ' + this._fee + ); + } + + if (!opts.disableLargeFees) { + var maximumFee = Math.floor(Transaction.FEE_SECURITY_MARGIN * this._estimateFee()); + if (unspent > maximumFee) { + if (this._missingChange()) { + return new errors.Transaction.ChangeAddressMissing( + 'Fee is too large and no change address was provided' + ); + } + return new errors.Transaction.FeeError.TooLarge( + 'expected less than ' + maximumFee + ' but got ' + unspent + ); + } + } + + if (!opts.disableSmallFees) { + var minimumFee = Math.ceil(this._estimateFee() / Transaction.FEE_SECURITY_MARGIN); + if (unspent < minimumFee) { + return new errors.Transaction.FeeError.TooSmall( + 'expected more than ' + minimumFee + ' but got ' + unspent + ); + } + } +}; + +Transaction.prototype._missingChange = function() { + return !this._changeScript; +}; + +Transaction.prototype._hasDustOutputs = function(opts) { + if (opts.disableDustOutputs) { + return; + } + var index, output; + for (index in this.outputs) { + output = this.outputs[index]; + if (output.satoshis < Transaction.DUST_AMOUNT && !output.script.isDataOut()) { + return new errors.Transaction.DustOutputs(); + } + } +}; + +Transaction.prototype._isMissingSignatures = function(opts) { + if (opts.disableIsFullySigned) { + return; + } + if (!this.isFullySigned()) { + return new errors.Transaction.MissingSignatures(); + } +}; + +Transaction.prototype.inspect = function() { + return ''; +}; + +Transaction.prototype.toBuffer = function() { + var writer = new BufferWriter(); + return this.toBufferWriter(writer).toBuffer(); +}; + +Transaction.prototype.toBufferWriter = function(writer) { + writer.writeInt32LE(this.version); + writer.writeVarintNum(this.inputs.length); + _.each(this.inputs, function(input) { + input.toBufferWriter(writer); + }); + writer.writeVarintNum(this.outputs.length); + _.each(this.outputs, function(output) { + output.toBufferWriter(writer); + }); + writer.writeUInt32LE(this.nLockTime); + return writer; +}; + +Transaction.prototype.fromBuffer = function(buffer) { + var reader = new BufferReader(buffer); + return this.fromBufferReader(reader); +}; + +Transaction.prototype.fromBufferReader = function(reader) { + $.checkArgument(!reader.finished(), 'No transaction data received'); + var i, sizeTxIns, sizeTxOuts; + + this.version = reader.readInt32LE(); + sizeTxIns = reader.readVarintNum(); + for (i = 0; i < sizeTxIns; i++) { + var input = Input.fromBufferReader(reader); + this.inputs.push(input); + } + sizeTxOuts = reader.readVarintNum(); + for (i = 0; i < sizeTxOuts; i++) { + this.outputs.push(Output.fromBufferReader(reader)); + } + this.nLockTime = reader.readUInt32LE(); + return this; +}; + +Transaction.prototype.toObject = Transaction.prototype.toJSON = function toObject() { + var inputs = []; + this.inputs.forEach(function(input) { + inputs.push(input.toObject()); + }); + var outputs = []; + this.outputs.forEach(function(output) { + outputs.push(output.toObject()); + }); + var obj = { + hash: this.hash, + version: this.version, + inputs: inputs, + outputs: outputs, + nLockTime: this.nLockTime + }; + if (this._changeScript) { + obj.changeScript = this._changeScript.toString(); + } + if (!_.isUndefined(this._changeIndex)) { + obj.changeIndex = this._changeIndex; + } + if (!_.isUndefined(this._fee)) { + obj.fee = this._fee; + } + return obj; +}; + +Transaction.prototype.fromObject = function fromObject(arg) { + /* jshint maxstatements: 20 */ + $.checkArgument(_.isObject(arg) || arg instanceof Transaction); + var self = this; + var transaction; + if (arg instanceof Transaction) { + transaction = transaction.toObject(); + } else { + transaction = arg; + } + _.each(transaction.inputs, function(input) { + if (!input.output || !input.output.script) { + self.uncheckedAddInput(new Input(input)); + return; + } + var script = new Script(input.output.script); + var txin; + if (script.isPublicKeyHashOut()) { + txin = new Input.PublicKeyHash(input); + } else if (script.isScriptHashOut() && input.publicKeys && input.threshold) { + txin = new Input.MultiSigScriptHash( + input, input.publicKeys, input.threshold, input.signatures + ); + } else if (script.isPublicKeyOut()) { + txin = new Input.PublicKey(input); + } else { + throw new errors.Transaction.Input.UnsupportedScript(input.output.script); + } + self.addInput(txin); + }); + _.each(transaction.outputs, function(output) { + self.addOutput(new Output(output)); + }); + if (transaction.changeIndex) { + this._changeIndex = transaction.changeIndex; + } + if (transaction.changeScript) { + this._changeScript = new Script(transaction.changeScript); + } + if (transaction.fee) { + this._fee = transaction.fee; + } + this.nLockTime = transaction.nLockTime; + this.version = transaction.version; + this._checkConsistency(arg); + return this; +}; + +Transaction.prototype._checkConsistency = function(arg) { + if (!_.isUndefined(this._changeIndex)) { + $.checkState(this._changeScript, 'Change script is expected.'); + $.checkState(this.outputs[this._changeIndex], 'Change index points to undefined output.'); + $.checkState(this.outputs[this._changeIndex].script.toString() === + this._changeScript.toString(), 'Change output has an unexpected script.'); + } + if (arg && arg.hash) { + $.checkState(arg.hash === this.hash, 'Hash in object does not match transaction hash.'); + } +}; + +/** + * Sets nLockTime so that transaction is not valid until the desired date(a + * timestamp in seconds since UNIX epoch is also accepted) + * + * @param {Date | Number} time + * @return {Transaction} this + */ +Transaction.prototype.lockUntilDate = function(time) { + $.checkArgument(time); + if (_.isNumber(time) && time < Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { + throw new errors.Transaction.LockTimeTooEarly(); + } + if (_.isDate(time)) { + time = time.getTime() / 1000; + } + + for (var i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){ + this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER; + } + } + + this.nLockTime = time; + return this; +}; + +/** + * Sets nLockTime so that transaction is not valid until the desired block + * height. + * + * @param {Number} height + * @return {Transaction} this + */ +Transaction.prototype.lockUntilBlockHeight = function(height) { + $.checkArgument(_.isNumber(height)); + if (height >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { + throw new errors.Transaction.BlockHeightTooHigh(); + } + if (height < 0) { + throw new errors.Transaction.NLockTimeOutOfRange(); + } + + for (var i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){ + this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER; + } + } + + + this.nLockTime = height; + return this; +}; + +/** + * Returns a semantic version of the transaction's nLockTime. + * @return {Number|Date} + * If nLockTime is 0, it returns null, + * if it is < 500000000, it returns a block height (number) + * else it returns a Date object. + */ +Transaction.prototype.getLockTime = function() { + if (!this.nLockTime) { + return null; + } + if (this.nLockTime < Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { + return this.nLockTime; + } + return new Date(1000 * this.nLockTime); +}; + +Transaction.prototype.fromString = function(string) { + this.fromBuffer(new buffer.Buffer(string, 'hex')); +}; + +Transaction.prototype._newTransaction = function() { + this.version = CURRENT_VERSION; + this.nLockTime = DEFAULT_NLOCKTIME; +}; + +/* Transaction creation interface */ + +/** + * @typedef {Object} Transaction~fromObject + * @property {string} prevTxId + * @property {number} outputIndex + * @property {(Buffer|string|Script)} script + * @property {number} satoshis + */ + +/** + * Add an input to this transaction. This is a high level interface + * to add an input, for more control, use @{link Transaction#addInput}. + * + * Can receive, as output information, the output of bitcoind's `listunspent` command, + * and a slightly fancier format recognized by bitcore: + * + * ``` + * { + * address: 'mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1', + * txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + * outputIndex: 0, + * script: Script.empty(), + * satoshis: 1020000 + * } + * ``` + * Where `address` can be either a string or a bitcore Address object. The + * same is true for `script`, which can be a string or a bitcore Script. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @example + * ```javascript + * var transaction = new Transaction(); + * + * // From a pay to public key hash output from bitcoind's listunspent + * transaction.from({'txid': '0000...', vout: 0, amount: 0.1, scriptPubKey: 'OP_DUP ...'}); + * + * // From a pay to public key hash output + * transaction.from({'txId': '0000...', outputIndex: 0, satoshis: 1000, script: 'OP_DUP ...'}); + * + * // From a multisig P2SH output + * transaction.from({'txId': '0000...', inputIndex: 0, satoshis: 1000, script: '... OP_HASH'}, + * ['03000...', '02000...'], 2); + * ``` + * + * @param {(Array.|Transaction~fromObject)} utxo + * @param {Array=} pubkeys + * @param {number=} threshold + */ +Transaction.prototype.from = function(utxo, pubkeys, threshold) { + if (_.isArray(utxo)) { + var self = this; + _.each(utxo, function(utxo) { + self.from(utxo, pubkeys, threshold); + }); + return this; + } + var exists = _.some(this.inputs, function(input) { + // TODO: Maybe prevTxId should be a string? Or defined as read only property? + return input.prevTxId.toString('hex') === utxo.txId && input.outputIndex === utxo.outputIndex; + }); + if (exists) { + return this; + } + if (pubkeys && threshold) { + this._fromMultisigUtxo(utxo, pubkeys, threshold); + } else { + this._fromNonP2SH(utxo); + } + return this; +}; + +Transaction.prototype._fromNonP2SH = function(utxo) { + var clazz; + utxo = new UnspentOutput(utxo); + if (utxo.script.isPublicKeyHashOut()) { + clazz = PublicKeyHashInput; + } else if (utxo.script.isPublicKeyOut()) { + clazz = PublicKeyInput; + } else { + clazz = Input; + } + this.addInput(new clazz({ + output: new Output({ + script: utxo.script, + satoshis: utxo.satoshis + }), + prevTxId: utxo.txId, + outputIndex: utxo.outputIndex, + script: Script.empty() + })); +}; + +Transaction.prototype._fromMultisigUtxo = function(utxo, pubkeys, threshold) { + $.checkArgument(threshold <= pubkeys.length, + 'Number of required signatures must be greater than the number of public keys'); + var clazz; + utxo = new UnspentOutput(utxo); + if (utxo.script.isMultisigOut()) { + clazz = MultiSigInput; + } else if (utxo.script.isScriptHashOut()) { + clazz = MultiSigScriptHashInput; + } else { + throw new Error("@TODO"); + } + this.addInput(new clazz({ + output: new Output({ + script: utxo.script, + satoshis: utxo.satoshis + }), + prevTxId: utxo.txId, + outputIndex: utxo.outputIndex, + script: Script.empty() + }, pubkeys, threshold)); +}; + +/** + * Add an input to this transaction. The input must be an instance of the `Input` class. + * It should have information about the Output that it's spending, but if it's not already + * set, two additional parameters, `outputScript` and `satoshis` can be provided. + * + * @param {Input} input + * @param {String|Script} outputScript + * @param {number} satoshis + * @return Transaction this, for chaining + */ +Transaction.prototype.addInput = function(input, outputScript, satoshis) { + $.checkArgumentType(input, Input, 'input'); + if (!input.output && (_.isUndefined(outputScript) || _.isUndefined(satoshis))) { + throw new errors.Transaction.NeedMoreInfo('Need information about the UTXO script and satoshis'); + } + if (!input.output && outputScript && !_.isUndefined(satoshis)) { + outputScript = outputScript instanceof Script ? outputScript : new Script(outputScript); + $.checkArgumentType(satoshis, 'number', 'satoshis'); + input.output = new Output({ + script: outputScript, + satoshis: satoshis + }); + } + return this.uncheckedAddInput(input); +}; + +/** + * Add an input to this transaction, without checking that the input has information about + * the output that it's spending. + * + * @param {Input} input + * @return Transaction this, for chaining + */ +Transaction.prototype.uncheckedAddInput = function(input) { + $.checkArgumentType(input, Input, 'input'); + this.inputs.push(input); + this._inputAmount = undefined; + this._updateChangeOutput(); + return this; +}; + +/** + * Returns true if the transaction has enough info on all inputs to be correctly validated + * + * @return {boolean} + */ +Transaction.prototype.hasAllUtxoInfo = function() { + return _.every(this.inputs.map(function(input) { + return !!input.output; + })); +}; + +/** + * Manually set the fee for this transaction. Beware that this resets all the signatures + * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not + * be reset). + * + * @param {number} amount satoshis to be sent + * @return {Transaction} this, for chaining + */ +Transaction.prototype.fee = function(amount) { + $.checkArgument(_.isNumber(amount), 'amount must be a number'); + this._fee = amount; + this._updateChangeOutput(); + return this; +}; + +/** + * Manually set the fee per KB for this transaction. Beware that this resets all the signatures + * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not + * be reset). + * + * @param {number} amount satoshis per KB to be sent + * @return {Transaction} this, for chaining + */ +Transaction.prototype.feePerKb = function(amount) { + $.checkArgument(_.isNumber(amount), 'amount must be a number'); + this._feePerKb = amount; + this._updateChangeOutput(); + return this; +}; + +/* Output management */ + +/** + * Set the change address for this transaction + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {Address} address An address for change to be sent to. + * @return {Transaction} this, for chaining + */ +Transaction.prototype.change = function(address) { + $.checkArgument(address, 'address is required'); + this._changeScript = Script.fromAddress(address); + this._updateChangeOutput(); + return this; +}; + + +/** + * @return {Output} change output, if it exists + */ +Transaction.prototype.getChangeOutput = function() { + if (!_.isUndefined(this._changeIndex)) { + return this.outputs[this._changeIndex]; + } + return null; +}; + +/** + * @typedef {Object} Transaction~toObject + * @property {(string|Address)} address + * @property {number} satoshis + */ + +/** + * Add an output to the transaction. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {(string|Address|Array.)} address + * @param {number} amount in satoshis + * @return {Transaction} this, for chaining + */ +Transaction.prototype.to = function(address, amount) { + if (_.isArray(address)) { + var self = this; + _.each(address, function(to) { + self.to(to.address, to.satoshis); + }); + return this; + } + + $.checkArgument( + JSUtil.isNaturalNumber(amount), + 'Amount is expected to be a positive integer' + ); + this.addOutput(new Output({ + script: Script(new Address(address)), + satoshis: amount + })); + return this; +}; + +/** + * Add an OP_RETURN output to the transaction. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {Buffer|string} value the data to be stored in the OP_RETURN output. + * In case of a string, the UTF-8 representation will be stored + * @return {Transaction} this, for chaining + */ +Transaction.prototype.addData = function(value) { + this.addOutput(new Output({ + script: Script.buildDataOut(value), + satoshis: 0 + })); + return this; +}; + + +/** + * Add an output to the transaction. + * + * @param {Output} output the output to add. + * @return {Transaction} this, for chaining + */ +Transaction.prototype.addOutput = function(output) { + $.checkArgumentType(output, Output, 'output'); + this._addOutput(output); + this._updateChangeOutput(); + return this; +}; + + +/** + * Remove all outputs from the transaction. + * + * @return {Transaction} this, for chaining + */ +Transaction.prototype.clearOutputs = function() { + this.outputs = []; + this._clearSignatures(); + this._outputAmount = undefined; + this._changeIndex = undefined; + this._updateChangeOutput(); + return this; +}; + + +Transaction.prototype._addOutput = function(output) { + this.outputs.push(output); + this._outputAmount = undefined; +}; + + +/** + * Calculates or gets the total output amount in satoshis + * + * @return {Number} the transaction total output amount + */ +Transaction.prototype._getOutputAmount = function() { + if (_.isUndefined(this._outputAmount)) { + var self = this; + this._outputAmount = 0; + _.each(this.outputs, function(output) { + self._outputAmount += output.satoshis; + }); + } + return this._outputAmount; +}; + + +/** + * Calculates or gets the total input amount in satoshis + * + * @return {Number} the transaction total input amount + */ +Transaction.prototype._getInputAmount = function() { + if (_.isUndefined(this._inputAmount)) { + var self = this; + this._inputAmount = 0; + _.each(this.inputs, function(input) { + if (_.isUndefined(input.output)) { + throw new errors.Transaction.Input.MissingPreviousOutput(); + } + self._inputAmount += input.output.satoshis; + }); + } + return this._inputAmount; +}; + +Transaction.prototype._updateChangeOutput = function() { + if (!this._changeScript) { + return; + } + this._clearSignatures(); + if (!_.isUndefined(this._changeIndex)) { + this._removeOutput(this._changeIndex); + } + var available = this._getUnspentValue(); + var fee = this.getFee(); + var changeAmount = available - fee; + if (changeAmount > 0) { + this._changeIndex = this.outputs.length; + this._addOutput(new Output({ + script: this._changeScript, + satoshis: changeAmount + })); + } else { + this._changeIndex = undefined; + } +}; +/** + * Calculates the fee of the transaction. + * + * If there's a fixed fee set, return that. + * + * If there is no change output set, the fee is the + * total value of the outputs minus inputs. Note that + * a serialized transaction only specifies the value + * of its outputs. (The value of inputs are recorded + * in the previous transaction outputs being spent.) + * This method therefore raises a "MissingPreviousOutput" + * error when called on a serialized transaction. + * + * If there's no fee set and no change address, + * estimate the fee based on size. + * + * @return {Number} fee of this transaction in satoshis + */ +Transaction.prototype.getFee = function() { + if (this.isCoinbase()) { + return 0; + } + if (!_.isUndefined(this._fee)) { + return this._fee; + } + // if no change output is set, fees should equal all the unspent amount + if (!this._changeScript) { + return this._getUnspentValue(); + } + return this._estimateFee(); +}; + +/** + * Estimates fee from serialized transaction size in bytes. + */ +Transaction.prototype._estimateFee = function() { + var estimatedSize = this._estimateSize(); + var available = this._getUnspentValue(); + return Transaction._estimateFee(estimatedSize, available, this._feePerKb); +}; + +Transaction.prototype._getUnspentValue = function() { + return this._getInputAmount() - this._getOutputAmount(); +}; + +Transaction.prototype._clearSignatures = function() { + _.each(this.inputs, function(input) { + input.clearSignatures(); + }); +}; + +Transaction._estimateFee = function(size, amountAvailable, feePerKb) { + var fee = Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB); + if (amountAvailable > fee) { + size += Transaction.CHANGE_OUTPUT_MAX_SIZE; + } + return Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB); +}; + +Transaction.prototype._estimateSize = function() { + var result = Transaction.MAXIMUM_EXTRA_SIZE; + _.each(this.inputs, function(input) { + result += input._estimateSize(); + }); + _.each(this.outputs, function(output) { + result += output.script.toBuffer().length + 9; + }); + return result; +}; + +Transaction.prototype._removeOutput = function(index) { + var output = this.outputs[index]; + this.outputs = _.without(this.outputs, output); + this._outputAmount = undefined; +}; + +Transaction.prototype.removeOutput = function(index) { + this._removeOutput(index); + this._updateChangeOutput(); +}; + +/** + * Sort a transaction's inputs and outputs according to BIP69 + * + * @see {https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki} + * @return {Transaction} this + */ +Transaction.prototype.sort = function() { + this.sortInputs(function(inputs) { + var copy = Array.prototype.concat.apply([], inputs); + copy.sort(function(first, second) { + return compare(first.prevTxId, second.prevTxId) + || first.outputIndex - second.outputIndex; + }); + return copy; + }); + this.sortOutputs(function(outputs) { + var copy = Array.prototype.concat.apply([], outputs); + copy.sort(function(first, second) { + return first.satoshis - second.satoshis + || compare(first.script.toBuffer(), second.script.toBuffer()); + }); + return copy; + }); + return this; +}; + +/** + * Randomize this transaction's outputs ordering. The shuffling algorithm is a + * version of the Fisher-Yates shuffle, provided by lodash's _.shuffle(). + * + * @return {Transaction} this + */ +Transaction.prototype.shuffleOutputs = function() { + return this.sortOutputs(_.shuffle); +}; + +/** + * Sort this transaction's outputs, according to a given sorting function that + * takes an array as argument and returns a new array, with the same elements + * but with a different order. The argument function MUST NOT modify the order + * of the original array + * + * @param {Function} sortingFunction + * @return {Transaction} this + */ +Transaction.prototype.sortOutputs = function(sortingFunction) { + var outs = sortingFunction(this.outputs); + return this._newOutputOrder(outs); +}; + +/** + * Sort this transaction's inputs, according to a given sorting function that + * takes an array as argument and returns a new array, with the same elements + * but with a different order. + * + * @param {Function} sortingFunction + * @return {Transaction} this + */ +Transaction.prototype.sortInputs = function(sortingFunction) { + this.inputs = sortingFunction(this.inputs); + this._clearSignatures(); + return this; +}; + +Transaction.prototype._newOutputOrder = function(newOutputs) { + var isInvalidSorting = (this.outputs.length !== newOutputs.length || + _.difference(this.outputs, newOutputs).length !== 0); + if (isInvalidSorting) { + throw new errors.Transaction.InvalidSorting(); + } + + if (!_.isUndefined(this._changeIndex)) { + var changeOutput = this.outputs[this._changeIndex]; + this._changeIndex = _.findIndex(newOutputs, changeOutput); + } + + this.outputs = newOutputs; + return this; +}; + +Transaction.prototype.removeInput = function(txId, outputIndex) { + var index; + if (!outputIndex && _.isNumber(txId)) { + index = txId; + } else { + index = _.findIndex(this.inputs, function(input) { + return input.prevTxId.toString('hex') === txId && input.outputIndex === outputIndex; + }); + } + if (index < 0 || index >= this.inputs.length) { + throw new errors.Transaction.InvalidIndex(index, this.inputs.length); + } + var input = this.inputs[index]; + this.inputs = _.without(this.inputs, input); + this._inputAmount = undefined; + this._updateChangeOutput(); +}; + +/* Signature handling */ + +/** + * Sign the transaction using one or more private keys. + * + * It tries to sign each input, verifying that the signature will be valid + * (matches a public key). + * + * @param {Array|String|PrivateKey} privateKey + * @param {number} sigtype + * @return {Transaction} this, for chaining + */ +Transaction.prototype.sign = function(privateKey, sigtype) { + $.checkState(this.hasAllUtxoInfo(), 'Not all utxo information is available to sign the transaction.'); + var self = this; + if (_.isArray(privateKey)) { + _.each(privateKey, function(privateKey) { + self.sign(privateKey, sigtype); + }); + return this; + } + _.each(this.getSignatures(privateKey, sigtype), function(signature) { + self.applySignature(signature); + }); + return this; +}; + +Transaction.prototype.getSignatures = function(privKey, sigtype) { + privKey = new PrivateKey(privKey); + sigtype = sigtype || Signature.SIGHASH_ALL; + var transaction = this; + var results = []; + var hashData = Hash.sha256ripemd160(privKey.publicKey.toBuffer()); + _.each(this.inputs, function forEachInput(input, index) { + _.each(input.getSignatures(transaction, privKey, index, sigtype, hashData), function(signature) { + results.push(signature); + }); + }); + return results; +}; + +/** + * Add a signature to the transaction + * + * @param {Object} signature + * @param {number} signature.inputIndex + * @param {number} signature.sigtype + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @return {Transaction} this, for chaining + */ +Transaction.prototype.applySignature = function(signature) { + this.inputs[signature.inputIndex].addSignature(this, signature); + return this; +}; + +Transaction.prototype.isFullySigned = function() { + _.each(this.inputs, function(input) { + if (input.isFullySigned === Input.prototype.isFullySigned) { + throw new errors.Transaction.UnableToVerifySignature( + 'Unrecognized script kind, or not enough information to execute script.' + + 'This usually happens when creating a transaction from a serialized transaction' + ); + } + }); + return _.every(_.map(this.inputs, function(input) { + return input.isFullySigned(); + })); +}; + +Transaction.prototype.isValidSignature = function(signature) { + var self = this; + if (this.inputs[signature.inputIndex].isValidSignature === Input.prototype.isValidSignature) { + throw new errors.Transaction.UnableToVerifySignature( + 'Unrecognized script kind, or not enough information to execute script.' + + 'This usually happens when creating a transaction from a serialized transaction' + ); + } + return this.inputs[signature.inputIndex].isValidSignature(self, signature); +}; + +/** + * @returns {bool} whether the signature is valid for this transaction input + */ +Transaction.prototype.verifySignature = function(sig, pubkey, nin, subscript) { + return Sighash.verify(this, sig, pubkey, nin, subscript); +}; + +/** + * Check that a transaction passes basic sanity tests. If not, return a string + * describing the error. This function contains the same logic as + * CheckTransaction in bitcoin core. + */ +Transaction.prototype.verify = function() { + // Basic checks that don't depend on any context + if (this.inputs.length === 0) { + return 'transaction txins empty'; + } + + if (this.outputs.length === 0) { + return 'transaction txouts empty'; + } + + // Check for negative or overflow output values + var valueoutbn = new BN(0); + for (var i = 0; i < this.outputs.length; i++) { + var txout = this.outputs[i]; + + if (txout.invalidSatoshis()) { + return 'transaction txout ' + i + ' satoshis is invalid'; + } + if (txout._satoshisBN.gt(new BN(Transaction.MAX_MONEY, 10))) { + return 'transaction txout ' + i + ' greater than MAX_MONEY'; + } + valueoutbn = valueoutbn.add(txout._satoshisBN); + if (valueoutbn.gt(new BN(Transaction.MAX_MONEY))) { + return 'transaction txout ' + i + ' total output greater than MAX_MONEY'; + } + } + + // Size limits + if (this.toBuffer().length > MAX_BLOCK_SIZE) { + return 'transaction over the maximum block size'; + } + + // Check for duplicate inputs + var txinmap = {}; + for (i = 0; i < this.inputs.length; i++) { + var txin = this.inputs[i]; + + var inputid = txin.prevTxId + ':' + txin.outputIndex; + if (!_.isUndefined(txinmap[inputid])) { + return 'transaction input ' + i + ' duplicate input'; + } + txinmap[inputid] = true; + } + + var isCoinbase = this.isCoinbase(); + if (isCoinbase) { + var buf = this.inputs[0]._scriptBuffer; + if (buf.length < 2 || buf.length > 100) { + return 'coinbase transaction script size invalid'; + } + } else { + for (i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].isNull()) { + return 'transaction input ' + i + ' has null input'; + } + } + } + return true; +}; + +/** + * Analogous to bitcoind's IsCoinBase function in transaction.h + */ +Transaction.prototype.isCoinbase = function() { + return (this.inputs.length === 1 && this.inputs[0].isNull()); +}; + +/** + * Determines if this transaction can be replaced in the mempool with another + * transaction that provides a sufficiently higher fee (RBF). + */ +Transaction.prototype.isRBF = function() { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + if (input.sequenceNumber < Input.MAXINT - 1) { + return true; + } + } + return false; +}; + +/** + * Enable this transaction to be replaced in the mempool (RBF) if a transaction + * includes a sufficiently higher fee. It will set the sequenceNumber to + * DEFAULT_RBF_SEQNUMBER for all inputs if the sequence number does not + * already enable RBF. + */ +Transaction.prototype.enableRBF = function() { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + if (input.sequenceNumber >= Input.MAXINT - 1) { + input.sequenceNumber = Input.DEFAULT_RBF_SEQNUMBER; + } + } + return this; +}; + +module.exports = Transaction; + +}).call(this,require("buffer").Buffer) +},{"../address":1,"../crypto/bn":6,"../crypto/hash":8,"../crypto/signature":11,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../errors":17,"../privatekey":23,"../script":25,"../util/buffer":42,"../util/js":43,"../util/preconditions":44,"./input":29,"./output":35,"./sighash":36,"./unspentoutput":39,"buffer":47,"buffer-compare":284,"lodash":319}],39:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var JSUtil = require('../util/js'); + +var Script = require('../script'); +var Address = require('../address'); +var Unit = require('../unit'); + +/** + * Represents an unspent output information: its script, associated amount and address, + * transaction id and output index. + * + * @constructor + * @param {object} data + * @param {string} data.txid the previous transaction id + * @param {string=} data.txId alias for `txid` + * @param {number} data.vout the index in the transaction + * @param {number=} data.outputIndex alias for `vout` + * @param {string|Script} data.scriptPubKey the script that must be resolved to release the funds + * @param {string|Script=} data.script alias for `scriptPubKey` + * @param {number} data.amount amount of bitcoins associated + * @param {number=} data.satoshis alias for `amount`, but expressed in satoshis (1 BTC = 1e8 satoshis) + * @param {string|Address=} data.address the associated address to the script, if provided + */ +function UnspentOutput(data) { + /* jshint maxcomplexity: 20 */ + /* jshint maxstatements: 20 */ + if (!(this instanceof UnspentOutput)) { + return new UnspentOutput(data); + } + $.checkArgument(_.isObject(data), 'Must provide an object from where to extract data'); + var address = data.address ? new Address(data.address) : undefined; + var txId = data.txid ? data.txid : data.txId; + if (!txId || !JSUtil.isHexaString(txId) || txId.length > 64) { + // TODO: Use the errors library + throw new Error('Invalid TXID in object', data); + } + var outputIndex = _.isUndefined(data.vout) ? data.outputIndex : data.vout; + if (!_.isNumber(outputIndex)) { + throw new Error('Invalid outputIndex, received ' + outputIndex); + } + $.checkArgument(!_.isUndefined(data.scriptPubKey) || !_.isUndefined(data.script), + 'Must provide the scriptPubKey for that output!'); + var script = new Script(data.scriptPubKey || data.script); + $.checkArgument(!_.isUndefined(data.amount) || !_.isUndefined(data.satoshis), + 'Must provide an amount for the output'); + var amount = !_.isUndefined(data.amount) ? new Unit.fromBTC(data.amount).toSatoshis() : data.satoshis; + $.checkArgument(_.isNumber(amount), 'Amount must be a number'); + JSUtil.defineImmutable(this, { + address: address, + txId: txId, + outputIndex: outputIndex, + script: script, + satoshis: amount + }); +} + +/** + * Provide an informative output when displaying this object in the console + * @returns string + */ +UnspentOutput.prototype.inspect = function() { + return ''; +}; + +/** + * String representation: just "txid:index" + * @returns string + */ +UnspentOutput.prototype.toString = function() { + return this.txId + ':' + this.outputIndex; +}; + +/** + * Deserialize an UnspentOutput from an object + * @param {object|string} data + * @return UnspentOutput + */ +UnspentOutput.fromObject = function(data) { + return new UnspentOutput(data); +}; + +/** + * Returns a plain object (no prototype or methods) with the associated info for this output + * @return {object} + */ +UnspentOutput.prototype.toObject = UnspentOutput.prototype.toJSON = function toObject() { + return { + address: this.address ? this.address.toString() : undefined, + txid: this.txId, + vout: this.outputIndex, + scriptPubKey: this.script.toBuffer().toString('hex'), + amount: Unit.fromSatoshis(this.satoshis).toBTC() + }; +}; + +module.exports = UnspentOutput; + +},{"../address":1,"../script":25,"../unit":40,"../util/js":43,"../util/preconditions":44,"lodash":319}],40:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); + +var errors = require('./errors'); +var $ = require('./util/preconditions'); + +var UNITS = { + 'BTC' : [1e8, 8], + 'mBTC' : [1e5, 5], + 'uBTC' : [1e2, 2], + 'bits' : [1e2, 2], + 'satoshis' : [1, 0] +}; + +/** + * Utility for handling and converting bitcoins units. The supported units are + * BTC, mBTC, bits (also named uBTC) and satoshis. A unit instance can be created with an + * amount and a unit code, or alternatively using static methods like {fromBTC}. + * It also allows to be created from a fiat amount and the exchange rate, or + * alternatively using the {fromFiat} static method. + * You can consult for different representation of a unit instance using it's + * {to} method, the fixed unit methods like {toSatoshis} or alternatively using + * the unit accessors. It also can be converted to a fiat amount by providing the + * corresponding BTC/fiat exchange rate. + * + * @example + * ```javascript + * var sats = Unit.fromBTC(1.3).toSatoshis(); + * var mili = Unit.fromBits(1.3).to(Unit.mBTC); + * var bits = Unit.fromFiat(1.3, 350).bits; + * var btc = new Unit(1.3, Unit.bits).BTC; + * ``` + * + * @param {Number} amount - The amount to be represented + * @param {String|Number} code - The unit of the amount or the exchange rate + * @returns {Unit} A new instance of an Unit + * @constructor + */ +function Unit(amount, code) { + if (!(this instanceof Unit)) { + return new Unit(amount, code); + } + + // convert fiat to BTC + if (_.isNumber(code)) { + if (code <= 0) { + throw new errors.Unit.InvalidRate(code); + } + amount = amount / code; + code = Unit.BTC; + } + + this._value = this._from(amount, code); + + var self = this; + var defineAccesor = function(key) { + Object.defineProperty(self, key, { + get: function() { return self.to(key); }, + enumerable: true, + }); + }; + + Object.keys(UNITS).forEach(defineAccesor); +} + +Object.keys(UNITS).forEach(function(key) { + Unit[key] = key; +}); + +/** + * Returns a Unit instance created from JSON string or object + * + * @param {String|Object} json - JSON with keys: amount and code + * @returns {Unit} A Unit instance + */ +Unit.fromObject = function fromObject(data){ + $.checkArgument(_.isObject(data), 'Argument is expected to be an object'); + return new Unit(data.amount, data.code); +}; + +/** + * Returns a Unit instance created from an amount in BTC + * + * @param {Number} amount - The amount in BTC + * @returns {Unit} A Unit instance + */ +Unit.fromBTC = function(amount) { + return new Unit(amount, Unit.BTC); +}; + +/** + * Returns a Unit instance created from an amount in mBTC + * + * @param {Number} amount - The amount in mBTC + * @returns {Unit} A Unit instance + */ +Unit.fromMillis = Unit.fromMilis = function(amount) { + return new Unit(amount, Unit.mBTC); +}; + +/** + * Returns a Unit instance created from an amount in bits + * + * @param {Number} amount - The amount in bits + * @returns {Unit} A Unit instance + */ +Unit.fromMicros = Unit.fromBits = function(amount) { + return new Unit(amount, Unit.bits); +}; + +/** + * Returns a Unit instance created from an amount in satoshis + * + * @param {Number} amount - The amount in satoshis + * @returns {Unit} A Unit instance + */ +Unit.fromSatoshis = function(amount) { + return new Unit(amount, Unit.satoshis); +}; + +/** + * Returns a Unit instance created from a fiat amount and exchange rate. + * + * @param {Number} amount - The amount in fiat + * @param {Number} rate - The exchange rate BTC/fiat + * @returns {Unit} A Unit instance + */ +Unit.fromFiat = function(amount, rate) { + return new Unit(amount, rate); +}; + +Unit.prototype._from = function(amount, code) { + if (!UNITS[code]) { + throw new errors.Unit.UnknownCode(code); + } + return parseInt((amount * UNITS[code][0]).toFixed()); +}; + +/** + * Returns the value represented in the specified unit + * + * @param {String|Number} code - The unit code or exchange rate + * @returns {Number} The converted value + */ +Unit.prototype.to = function(code) { + if (_.isNumber(code)) { + if (code <= 0) { + throw new errors.Unit.InvalidRate(code); + } + return parseFloat((this.BTC * code).toFixed(2)); + } + + if (!UNITS[code]) { + throw new errors.Unit.UnknownCode(code); + } + + var value = this._value / UNITS[code][0]; + return parseFloat(value.toFixed(UNITS[code][1])); +}; + +/** + * Returns the value represented in BTC + * + * @returns {Number} The value converted to BTC + */ +Unit.prototype.toBTC = function() { + return this.to(Unit.BTC); +}; + +/** + * Returns the value represented in mBTC + * + * @returns {Number} The value converted to mBTC + */ +Unit.prototype.toMillis = Unit.prototype.toMilis = function() { + return this.to(Unit.mBTC); +}; + +/** + * Returns the value represented in bits + * + * @returns {Number} The value converted to bits + */ +Unit.prototype.toMicros = Unit.prototype.toBits = function() { + return this.to(Unit.bits); +}; + +/** + * Returns the value represented in satoshis + * + * @returns {Number} The value converted to satoshis + */ +Unit.prototype.toSatoshis = function() { + return this.to(Unit.satoshis); +}; + +/** + * Returns the value represented in fiat + * + * @param {string} rate - The exchange rate between BTC/currency + * @returns {Number} The value converted to satoshis + */ +Unit.prototype.atRate = function(rate) { + return this.to(rate); +}; + +/** + * Returns a the string representation of the value in satoshis + * + * @returns {string} the value in satoshis + */ +Unit.prototype.toString = function() { + return this.satoshis + ' satoshis'; +}; + +/** + * Returns a plain object representation of the Unit + * + * @returns {Object} An object with the keys: amount and code + */ +Unit.prototype.toObject = Unit.prototype.toJSON = function toObject() { + return { + amount: this.BTC, + code: Unit.BTC + }; +}; + +/** + * Returns a string formatted for the console + * + * @returns {string} the value in satoshis + */ +Unit.prototype.inspect = function() { + return ''; +}; + +module.exports = Unit; + +},{"./errors":17,"./util/preconditions":44,"lodash":319}],41:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); +var URL = require('url'); + +var Address = require('./address'); +var Unit = require('./unit'); + +/** + * Bitcore URI + * + * Instantiate an URI from a bitcoin URI String or an Object. An URI instance + * can be created with a bitcoin uri string or an object. All instances of + * URI are valid, the static method isValid allows checking before instantiation. + * + * All standard parameters can be found as members of the class, the address + * is represented using an {Address} instance and the amount is represented in + * satoshis. Any other non-standard parameters can be found under the extra member. + * + * @example + * ```javascript + * + * var uri = new URI('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2'); + * console.log(uri.address, uri.amount); + * ``` + * + * @param {string|Object} data - A bitcoin URI string or an Object + * @param {Array.=} knownParams - Required non-standard params + * @throws {TypeError} Invalid bitcoin address + * @throws {TypeError} Invalid amount + * @throws {Error} Unknown required argument + * @returns {URI} A new valid and frozen instance of URI + * @constructor + */ +var URI = function(data, knownParams) { + if (!(this instanceof URI)) { + return new URI(data, knownParams); + } + + this.extras = {}; + this.knownParams = knownParams || []; + this.address = this.network = this.amount = this.message = null; + + if (typeof(data) === 'string') { + var params = URI.parse(data); + if (params.amount) { + params.amount = this._parseAmount(params.amount); + } + this._fromObject(params); + } else if (typeof(data) === 'object') { + this._fromObject(data); + } else { + throw new TypeError('Unrecognized data format.'); + } +}; + +/** + * Instantiate a URI from a String + * + * @param {string} str - JSON string or object of the URI + * @returns {URI} A new instance of a URI + */ +URI.fromString = function fromString(str) { + if (typeof(str) !== 'string') { + throw new TypeError('Expected a string'); + } + return new URI(str); +}; + +/** + * Instantiate a URI from an Object + * + * @param {Object} data - object of the URI + * @returns {URI} A new instance of a URI + */ +URI.fromObject = function fromObject(json) { + return new URI(json); +}; + +/** + * Check if an bitcoin URI string is valid + * + * @example + * ```javascript + * + * var valid = URI.isValid('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu'); + * // true + * ``` + * + * @param {string|Object} data - A bitcoin URI string or an Object + * @param {Array.=} knownParams - Required non-standard params + * @returns {boolean} Result of uri validation + */ +URI.isValid = function(arg, knownParams) { + try { + new URI(arg, knownParams); + } catch (err) { + return false; + } + return true; +}; + +/** + * Convert a bitcoin URI string into a simple object. + * + * @param {string} uri - A bitcoin URI string + * @throws {TypeError} Invalid bitcoin URI + * @returns {Object} An object with the parsed params + */ +URI.parse = function(uri) { + var info = URL.parse(uri, true); + + if (info.protocol !== 'bitcoin:') { + throw new TypeError('Invalid bitcoin URI'); + } + + // workaround to host insensitiveness + var group = /[^:]*:\/?\/?([^?]*)/.exec(uri); + info.query.address = group && group[1] || undefined; + + return info.query; +}; + +URI.Members = ['address', 'amount', 'message', 'label', 'r']; + +/** + * Internal function to load the URI instance with an object. + * + * @param {Object} obj - Object with the information + * @throws {TypeError} Invalid bitcoin address + * @throws {TypeError} Invalid amount + * @throws {Error} Unknown required argument + */ +URI.prototype._fromObject = function(obj) { + /* jshint maxcomplexity: 10 */ + + if (!Address.isValid(obj.address)) { + throw new TypeError('Invalid bitcoin address'); + } + + this.address = new Address(obj.address); + this.network = this.address.network; + this.amount = obj.amount; + + for (var key in obj) { + if (key === 'address' || key === 'amount') { + continue; + } + + if (/^req-/.exec(key) && this.knownParams.indexOf(key) === -1) { + throw Error('Unknown required argument ' + key); + } + + var destination = URI.Members.indexOf(key) > -1 ? this : this.extras; + destination[key] = obj[key]; + } +}; + +/** + * Internal function to transform a BTC string amount into satoshis + * + * @param {string} amount - Amount BTC string + * @throws {TypeError} Invalid amount + * @returns {Object} Amount represented in satoshis + */ +URI.prototype._parseAmount = function(amount) { + amount = Number(amount); + if (isNaN(amount)) { + throw new TypeError('Invalid amount'); + } + return Unit.fromBTC(amount).toSatoshis(); +}; + +URI.prototype.toObject = URI.prototype.toJSON = function toObject() { + var json = {}; + for (var i = 0; i < URI.Members.length; i++) { + var m = URI.Members[i]; + if (this.hasOwnProperty(m) && typeof(this[m]) !== 'undefined') { + json[m] = this[m].toString(); + } + } + _.extend(json, this.extras); + return json; +}; + +/** + * Will return a the string representation of the URI + * + * @returns {string} Bitcoin URI string + */ +URI.prototype.toString = function() { + var query = {}; + if (this.amount) { + query.amount = Unit.fromSatoshis(this.amount).toBTC(); + } + if (this.message) { + query.message = this.message; + } + if (this.label) { + query.label = this.label; + } + if (this.r) { + query.r = this.r; + } + _.extend(query, this.extras); + + return URL.format({ + protocol: 'bitcoin:', + host: this.address, + query: query + }); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Bitcoin URI + */ +URI.prototype.inspect = function() { + return ''; +}; + +module.exports = URI; + +},{"./address":1,"./unit":40,"lodash":319,"url":274}],42:[function(require,module,exports){ +(function (Buffer){ +'use strict'; + +var buffer = require('buffer'); +var assert = require('assert'); + +var js = require('./js'); +var $ = require('./preconditions'); + +function equals(a, b) { + if (a.length !== b.length) { + return false; + } + var length = a.length; + for (var i = 0; i < length; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +} + +module.exports = { + /** + * Fill a buffer with a value. + * + * @param {Buffer} buffer + * @param {number} value + * @return {Buffer} + */ + fill: function fill(buffer, value) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + $.checkArgumentType(value, 'number', 'value'); + var length = buffer.length; + for (var i = 0; i < length; i++) { + buffer[i] = value; + } + return buffer; + }, + + /** + * Return a copy of a buffer + * + * @param {Buffer} original + * @return {Buffer} + */ + copy: function(original) { + var buffer = new Buffer(original.length); + original.copy(buffer); + return buffer; + }, + + /** + * Returns true if the given argument is an instance of a buffer. Tests for + * both node's Buffer and Uint8Array + * + * @param {*} arg + * @return {boolean} + */ + isBuffer: function isBuffer(arg) { + return buffer.Buffer.isBuffer(arg) || arg instanceof Uint8Array; + }, + + /** + * Returns a zero-filled byte array + * + * @param {number} bytes + * @return {Buffer} + */ + emptyBuffer: function emptyBuffer(bytes) { + $.checkArgumentType(bytes, 'number', 'bytes'); + var result = new buffer.Buffer(bytes); + for (var i = 0; i < bytes; i++) { + result.write('\0', i); + } + return result; + }, + + /** + * Concatenates a buffer + * + * Shortcut for buffer.Buffer.concat + */ + concat: buffer.Buffer.concat, + + equals: equals, + equal: equals, + + /** + * Transforms a number from 0 to 255 into a Buffer of size 1 with that value + * + * @param {number} integer + * @return {Buffer} + */ + integerAsSingleByteBuffer: function integerAsSingleByteBuffer(integer) { + $.checkArgumentType(integer, 'number', 'integer'); + return new buffer.Buffer([integer & 0xff]); + }, + + /** + * Transform a 4-byte integer into a Buffer of length 4. + * + * @param {number} integer + * @return {Buffer} + */ + integerAsBuffer: function integerAsBuffer(integer) { + $.checkArgumentType(integer, 'number', 'integer'); + var bytes = []; + bytes.push((integer >> 24) & 0xff); + bytes.push((integer >> 16) & 0xff); + bytes.push((integer >> 8) & 0xff); + bytes.push(integer & 0xff); + return new Buffer(bytes); + }, + + /** + * Transform the first 4 values of a Buffer into a number, in little endian encoding + * + * @param {Buffer} buffer + * @return {number} + */ + integerFromBuffer: function integerFromBuffer(buffer) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3]; + }, + + /** + * Transforms the first byte of an array into a number ranging from -128 to 127 + * @param {Buffer} buffer + * @return {number} + */ + integerFromSingleByteBuffer: function integerFromBuffer(buffer) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + return buffer[0]; + }, + + /** + * Transforms a buffer into a string with a number in hexa representation + * + * Shorthand for buffer.toString('hex') + * + * @param {Buffer} buffer + * @return {string} + */ + bufferToHex: function bufferToHex(buffer) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + return buffer.toString('hex'); + }, + + /** + * Reverse a buffer + * @param {Buffer} param + * @return {Buffer} + */ + reverse: function reverse(param) { + var ret = new buffer.Buffer(param.length); + for (var i = 0; i < param.length; i++) { + ret[i] = param[param.length - i - 1]; + } + return ret; + }, + + /** + * Transforms an hexa encoded string into a Buffer with binary values + * + * Shorthand for Buffer(string, 'hex') + * + * @param {string} string + * @return {Buffer} + */ + hexToBuffer: function hexToBuffer(string) { + assert(js.isHexa(string)); + return new buffer.Buffer(string, 'hex'); + } +}; + +module.exports.NULL_HASH = module.exports.fill(new Buffer(32), 0); +module.exports.EMPTY_BUFFER = new Buffer(0); + +}).call(this,require("buffer").Buffer) +},{"./js":43,"./preconditions":44,"assert":45,"buffer":47}],43:[function(require,module,exports){ +'use strict'; + +var _ = require('lodash'); + +/** + * Determines whether a string contains only hexadecimal values + * + * @name JSUtil.isHexa + * @param {string} value + * @return {boolean} true if the string is the hexa representation of a number + */ +var isHexa = function isHexa(value) { + if (!_.isString(value)) { + return false; + } + return /^[0-9a-fA-F]+$/.test(value); +}; + +/** + * @namespace JSUtil + */ +module.exports = { + /** + * Test if an argument is a valid JSON object. If it is, returns a truthy + * value (the json object decoded), so no double JSON.parse call is necessary + * + * @param {string} arg + * @return {Object|boolean} false if the argument is not a JSON string. + */ + isValidJSON: function isValidJSON(arg) { + var parsed; + if (!_.isString(arg)) { + return false; + } + try { + parsed = JSON.parse(arg); + } catch (e) { + return false; + } + if (typeof(parsed) === 'object') { + return true; + } + return false; + }, + isHexa: isHexa, + isHexaString: isHexa, + + /** + * Clone an array + */ + cloneArray: function(array) { + return [].concat(array); + }, + + /** + * Define immutable properties on a target object + * + * @param {Object} target - An object to be extended + * @param {Object} values - An object of properties + * @return {Object} The target object + */ + defineImmutable: function defineImmutable(target, values) { + Object.keys(values).forEach(function(key){ + Object.defineProperty(target, key, { + configurable: false, + enumerable: true, + value: values[key] + }); + }); + return target; + }, + /** + * Checks that a value is a natural number, a positive integer or zero. + * + * @param {*} value + * @return {Boolean} + */ + isNaturalNumber: function isNaturalNumber(value) { + return typeof value === 'number' && + isFinite(value) && + Math.floor(value) === value && + value >= 0; + } +}; + +},{"lodash":319}],44:[function(require,module,exports){ +'use strict'; + +var errors = require('../errors'); +var _ = require('lodash'); + +module.exports = { + checkState: function(condition, message) { + if (!condition) { + throw new errors.InvalidState(message); + } + }, + checkArgument: function(condition, argumentName, message, docsPath) { + if (!condition) { + throw new errors.InvalidArgument(argumentName, message, docsPath); + } + }, + checkArgumentType: function(argument, type, argumentName) { + argumentName = argumentName || '(unknown name)'; + if (_.isString(type)) { + if (type === 'Buffer') { + var buffer = require('buffer'); // './buffer' fails on cordova & RN + if (!buffer.Buffer.isBuffer(argument)) { + throw new errors.InvalidArgumentType(argument, type, argumentName); + } + } else if (typeof argument !== type) { + throw new errors.InvalidArgumentType(argument, type, argumentName); + } + } else { + if (!(argument instanceof type)) { + throw new errors.InvalidArgumentType(argument, type.name, argumentName); + } + } + } +}; + +},{"../errors":17,"buffer":47,"lodash":319}],45:[function(require,module,exports){ +(function (global){ +'use strict'; + +// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js +// original notice: + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +function compare(a, b) { + if (a === b) { + return 0; + } + + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) { + return -1; + } + if (y < x) { + return 1; + } + return 0; +} +function isBuffer(b) { + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { + return global.Buffer.isBuffer(b); + } + return !!(b != null && b._isBuffer); +} + +// based on node assert, original notice: + +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +var util = require('util/'); +var hasOwn = Object.prototype.hasOwnProperty; +var pSlice = Array.prototype.slice; +var functionsHaveNames = (function () { + return function foo() {}.name === 'foo'; +}()); +function pToString (obj) { + return Object.prototype.toString.call(obj); +} +function isView(arrbuf) { + if (isBuffer(arrbuf)) { + return false; + } + if (typeof global.ArrayBuffer !== 'function') { + return false; + } + if (typeof ArrayBuffer.isView === 'function') { + return ArrayBuffer.isView(arrbuf); + } + if (!arrbuf) { + return false; + } + if (arrbuf instanceof DataView) { + return true; + } + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { + return true; + } + return false; +} +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +var regex = /\s*function\s+([^\(\s]*)\s*/; +// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js +function getName(func) { + if (!util.isFunction(func)) { + return; + } + if (functionsHaveNames) { + return func.name; + } + var str = func.toString(); + var match = str.match(regex); + return match && match[1]; +} +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = getName(stackStartFunction); + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function truncate(s, n) { + if (typeof s === 'string') { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} +function inspect(something) { + if (functionsHaveNames || !util.isFunction(something)) { + return util.inspect(something); + } + var rawname = getName(something); + var name = rawname ? ': ' + rawname : ''; + return '[Function' + name + ']'; +} +function getMessage(self) { + return truncate(inspect(self.actual), 128) + ' ' + + self.operator + ' ' + + truncate(inspect(self.expected), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; + +function _deepEqual(actual, expected, strict, memos) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if (isBuffer(actual) && isBuffer(expected)) { + return compare(actual, expected) === 0; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if ((actual === null || typeof actual !== 'object') && + (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; + + // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (isView(actual) && isView(expected) && + pToString(actual) === pToString(expected) && + !(actual instanceof Float32Array || + actual instanceof Float64Array)) { + return compare(new Uint8Array(actual.buffer), + new Uint8Array(expected.buffer)) === 0; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else if (isBuffer(actual) !== isBuffer(expected)) { + return false; + } else { + memos = memos || {actual: [], expected: []}; + + var actualIndex = memos.actual.indexOf(actual); + if (actualIndex !== -1) { + if (actualIndex === memos.expected.indexOf(expected)) { + return true; + } + } + + memos.actual.push(actual); + memos.expected.push(expected); + + return objEquiv(actual, expected, strict, memos); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b, strict, actualVisitedObjects) { + if (a === null || a === undefined || b === null || b === undefined) + return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) + return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) + return false; + var aIsArgs = isArguments(a); + var bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b, strict); + } + var ka = objectKeys(a); + var kb = objectKeys(b); + var key, i; + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length !== kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) + return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +assert.notDeepStrictEqual = notDeepStrictEqual; +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + } +} + + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } + + try { + if (actual instanceof expected) { + return true; + } + } catch (e) { + // Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; +} + +function _tryBlock(block) { + var error; + try { + block(); + } catch (e) { + error = e; + } + return error; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (typeof block !== 'function') { + throw new TypeError('"block" argument must be a function'); + } + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + actual = _tryBlock(block); + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + var userProvidedMessage = typeof message === 'string'; + var isUnwantedException = !shouldThrow && util.isError(actual); + var isUnexpectedException = !shouldThrow && actual && !expected; + + if ((isUnwantedException && + userProvidedMessage && + expectedException(actual, expected)) || + isUnexpectedException) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws(true, block, error, message); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { + _throws(false, block, error, message); +}; + +assert.ifError = function(err) { if (err) throw err; }; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"util/":277}],46:[function(require,module,exports){ + +},{}],47:[function(require,module,exports){ +(function (global){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +'use strict' + +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var isArray = require('isarray') + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() + +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } + + return that +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} + +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, value) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} + +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} + +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) + + var actual = that.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + + return that +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer + + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} + +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} + +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"base64-js":48,"ieee754":49,"isarray":50}],48:[function(require,module,exports){ +'use strict' + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function placeHoldersCount (b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} + +function byteLength (b64) { + // base64 is 4/3 + up to two characters of the original data + return (b64.length * 3 / 4) - placeHoldersCount(b64) +} + +function toByteArray (b64) { + var i, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + + arr = new Arr((len * 3 / 4) - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0; i < l; i += 4) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] + arr[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') +} + +},{}],49:[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],50:[function(require,module,exports){ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + +},{}],51:[function(require,module,exports){ +'use strict' + +exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') +exports.createHash = exports.Hash = require('create-hash') +exports.createHmac = exports.Hmac = require('create-hmac') + +var algos = require('browserify-sign/algos') +var algoKeys = Object.keys(algos) +var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys) +exports.getHashes = function () { + return hashes +} + +var p = require('pbkdf2') +exports.pbkdf2 = p.pbkdf2 +exports.pbkdf2Sync = p.pbkdf2Sync + +var aes = require('browserify-cipher') + +exports.Cipher = aes.Cipher +exports.createCipher = aes.createCipher +exports.Cipheriv = aes.Cipheriv +exports.createCipheriv = aes.createCipheriv +exports.Decipher = aes.Decipher +exports.createDecipher = aes.createDecipher +exports.Decipheriv = aes.Decipheriv +exports.createDecipheriv = aes.createDecipheriv +exports.getCiphers = aes.getCiphers +exports.listCiphers = aes.listCiphers + +var dh = require('diffie-hellman') + +exports.DiffieHellmanGroup = dh.DiffieHellmanGroup +exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup +exports.getDiffieHellman = dh.getDiffieHellman +exports.createDiffieHellman = dh.createDiffieHellman +exports.DiffieHellman = dh.DiffieHellman + +var sign = require('browserify-sign') + +exports.createSign = sign.createSign +exports.Sign = sign.Sign +exports.createVerify = sign.createVerify +exports.Verify = sign.Verify + +exports.createECDH = require('create-ecdh') + +var publicEncrypt = require('public-encrypt') + +exports.publicEncrypt = publicEncrypt.publicEncrypt +exports.privateEncrypt = publicEncrypt.privateEncrypt +exports.publicDecrypt = publicEncrypt.publicDecrypt +exports.privateDecrypt = publicEncrypt.privateDecrypt + +// the least I can do is make error messages for the rest of the node.js/crypto api. +// ;[ +// 'createCredentials' +// ].forEach(function (name) { +// exports[name] = function () { +// throw new Error([ +// 'sorry, ' + name + ' is not implemented yet', +// 'we accept pull requests', +// 'https://github.com/crypto-browserify/crypto-browserify' +// ].join('\n')) +// } +// }) + +exports.createCredentials = function () { + throw new Error([ + 'sorry, createCredentials is not implemented yet', + 'we accept pull requests', + 'https://github.com/crypto-browserify/crypto-browserify' + ].join('\n')) +} + +exports.constants = { + 'DH_CHECK_P_NOT_SAFE_PRIME': 2, + 'DH_CHECK_P_NOT_PRIME': 1, + 'DH_UNABLE_TO_CHECK_GENERATOR': 4, + 'DH_NOT_SUITABLE_GENERATOR': 8, + 'NPN_ENABLED': 1, + 'ALPN_ENABLED': 1, + 'RSA_PKCS1_PADDING': 1, + 'RSA_SSLV23_PADDING': 2, + 'RSA_NO_PADDING': 3, + 'RSA_PKCS1_OAEP_PADDING': 4, + 'RSA_X931_PADDING': 5, + 'RSA_PKCS1_PSS_PADDING': 6, + 'POINT_CONVERSION_COMPRESSED': 2, + 'POINT_CONVERSION_UNCOMPRESSED': 4, + 'POINT_CONVERSION_HYBRID': 6 +} + +},{"browserify-cipher":52,"browserify-sign":91,"browserify-sign/algos":88,"create-ecdh":139,"create-hash":140,"create-hmac":156,"diffie-hellman":170,"pbkdf2":176,"public-encrypt":192,"randombytes":243}],52:[function(require,module,exports){ +var ebtk = require('evp_bytestokey') +var aes = require('browserify-aes/browser') +var DES = require('browserify-des') +var desModes = require('browserify-des/modes') +var aesModes = require('browserify-aes/modes') +function createCipher (suite, password) { + var keyLen, ivLen + suite = suite.toLowerCase() + if (aesModes[suite]) { + keyLen = aesModes[suite].key + ivLen = aesModes[suite].iv + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8 + ivLen = desModes[suite].iv + } else { + throw new TypeError('invalid suite type') + } + var keys = ebtk(password, false, keyLen, ivLen) + return createCipheriv(suite, keys.key, keys.iv) +} +function createDecipher (suite, password) { + var keyLen, ivLen + suite = suite.toLowerCase() + if (aesModes[suite]) { + keyLen = aesModes[suite].key + ivLen = aesModes[suite].iv + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8 + ivLen = desModes[suite].iv + } else { + throw new TypeError('invalid suite type') + } + var keys = ebtk(password, false, keyLen, ivLen) + return createDecipheriv(suite, keys.key, keys.iv) +} + +function createCipheriv (suite, key, iv) { + suite = suite.toLowerCase() + if (aesModes[suite]) { + return aes.createCipheriv(suite, key, iv) + } else if (desModes[suite]) { + return new DES({ + key: key, + iv: iv, + mode: suite + }) + } else { + throw new TypeError('invalid suite type') + } +} +function createDecipheriv (suite, key, iv) { + suite = suite.toLowerCase() + if (aesModes[suite]) { + return aes.createDecipheriv(suite, key, iv) + } else if (desModes[suite]) { + return new DES({ + key: key, + iv: iv, + mode: suite, + decrypt: true + }) + } else { + throw new TypeError('invalid suite type') + } +} +exports.createCipher = exports.Cipher = createCipher +exports.createCipheriv = exports.Cipheriv = createCipheriv +exports.createDecipher = exports.Decipher = createDecipher +exports.createDecipheriv = exports.Decipheriv = createDecipheriv +function getCiphers () { + return Object.keys(desModes).concat(aes.getCiphers()) +} +exports.listCiphers = exports.getCiphers = getCiphers + +},{"browserify-aes/browser":55,"browserify-aes/modes":66,"browserify-des":73,"browserify-des/modes":74,"evp_bytestokey":84}],53:[function(require,module,exports){ +// based on the aes implimentation in triple sec +// https://github.com/keybase/triplesec +// which is in turn based on the one from crypto-js +// https://code.google.com/p/crypto-js/ + +var Buffer = require('safe-buffer').Buffer + +function asUInt32Array (buf) { + if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf) + + var len = (buf.length / 4) | 0 + var out = new Array(len) + + for (var i = 0; i < len; i++) { + out[i] = buf.readUInt32BE(i * 4) + } + + return out +} + +function scrubVec (v) { + for (var i = 0; i < v.length; v++) { + v[i] = 0 + } +} + +function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) { + var SUB_MIX0 = SUB_MIX[0] + var SUB_MIX1 = SUB_MIX[1] + var SUB_MIX2 = SUB_MIX[2] + var SUB_MIX3 = SUB_MIX[3] + + var s0 = M[0] ^ keySchedule[0] + var s1 = M[1] ^ keySchedule[1] + var s2 = M[2] ^ keySchedule[2] + var s3 = M[3] ^ keySchedule[3] + var t0, t1, t2, t3 + var ksRow = 4 + + for (var round = 1; round < nRounds; round++) { + t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++] + t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++] + t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++] + t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++] + s0 = t0 + s1 = t1 + s2 = t2 + s3 = t3 + } + + t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++] + t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++] + t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++] + t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++] + t0 = t0 >>> 0 + t1 = t1 >>> 0 + t2 = t2 >>> 0 + t3 = t3 >>> 0 + + return [t0, t1, t2, t3] +} + +// AES constants +var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36] +var G = (function () { + // Compute double table + var d = new Array(256) + for (var j = 0; j < 256; j++) { + if (j < 128) { + d[j] = j << 1 + } else { + d[j] = (j << 1) ^ 0x11b + } + } + + var SBOX = [] + var INV_SBOX = [] + var SUB_MIX = [[], [], [], []] + var INV_SUB_MIX = [[], [], [], []] + + // Walk GF(2^8) + var x = 0 + var xi = 0 + for (var i = 0; i < 256; ++i) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4) + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63 + SBOX[x] = sx + INV_SBOX[sx] = x + + // Compute multiplication + var x2 = d[x] + var x4 = d[x2] + var x8 = d[x4] + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100) + SUB_MIX[0][x] = (t << 24) | (t >>> 8) + SUB_MIX[1][x] = (t << 16) | (t >>> 16) + SUB_MIX[2][x] = (t << 8) | (t >>> 24) + SUB_MIX[3][x] = t + + // Compute inv sub bytes, inv mix columns tables + t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100) + INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8) + INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16) + INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24) + INV_SUB_MIX[3][sx] = t + + if (x === 0) { + x = xi = 1 + } else { + x = x2 ^ d[d[d[x8 ^ x2]]] + xi ^= d[d[xi]] + } + } + + return { + SBOX: SBOX, + INV_SBOX: INV_SBOX, + SUB_MIX: SUB_MIX, + INV_SUB_MIX: INV_SUB_MIX + } +})() + +function AES (key) { + this._key = asUInt32Array(key) + this._reset() +} + +AES.blockSize = 4 * 4 +AES.keySize = 256 / 8 +AES.prototype.blockSize = AES.blockSize +AES.prototype.keySize = AES.keySize +AES.prototype._reset = function () { + var keyWords = this._key + var keySize = keyWords.length + var nRounds = keySize + 6 + var ksRows = (nRounds + 1) * 4 + + var keySchedule = [] + for (var k = 0; k < keySize; k++) { + keySchedule[k] = keyWords[k] + } + + for (k = keySize; k < ksRows; k++) { + var t = keySchedule[k - 1] + + if (k % keySize === 0) { + t = (t << 8) | (t >>> 24) + t = + (G.SBOX[t >>> 24] << 24) | + (G.SBOX[(t >>> 16) & 0xff] << 16) | + (G.SBOX[(t >>> 8) & 0xff] << 8) | + (G.SBOX[t & 0xff]) + + t ^= RCON[(k / keySize) | 0] << 24 + } else if (keySize > 6 && k % keySize === 4) { + t = + (G.SBOX[t >>> 24] << 24) | + (G.SBOX[(t >>> 16) & 0xff] << 16) | + (G.SBOX[(t >>> 8) & 0xff] << 8) | + (G.SBOX[t & 0xff]) + } + + keySchedule[k] = keySchedule[k - keySize] ^ t + } + + var invKeySchedule = [] + for (var ik = 0; ik < ksRows; ik++) { + var ksR = ksRows - ik + var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)] + + if (ik < 4 || ksR <= 4) { + invKeySchedule[ik] = tt + } else { + invKeySchedule[ik] = + G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ + G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^ + G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^ + G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]] + } + } + + this._nRounds = nRounds + this._keySchedule = keySchedule + this._invKeySchedule = invKeySchedule +} + +AES.prototype.encryptBlockRaw = function (M) { + M = asUInt32Array(M) + return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds) +} + +AES.prototype.encryptBlock = function (M) { + var out = this.encryptBlockRaw(M) + var buf = Buffer.allocUnsafe(16) + buf.writeUInt32BE(out[0], 0) + buf.writeUInt32BE(out[1], 4) + buf.writeUInt32BE(out[2], 8) + buf.writeUInt32BE(out[3], 12) + return buf +} + +AES.prototype.decryptBlock = function (M) { + M = asUInt32Array(M) + + // swap + var m1 = M[1] + M[1] = M[3] + M[3] = m1 + + var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds) + var buf = Buffer.allocUnsafe(16) + buf.writeUInt32BE(out[0], 0) + buf.writeUInt32BE(out[3], 4) + buf.writeUInt32BE(out[2], 8) + buf.writeUInt32BE(out[1], 12) + return buf +} + +AES.prototype.scrub = function () { + scrubVec(this._keySchedule) + scrubVec(this._invKeySchedule) + scrubVec(this._key) +} + +module.exports.AES = AES + +},{"safe-buffer":71}],54:[function(require,module,exports){ +var aes = require('./aes') +var Buffer = require('safe-buffer').Buffer +var Transform = require('cipher-base') +var inherits = require('inherits') +var GHASH = require('./ghash') +var xor = require('buffer-xor') +var incr32 = require('./incr32') + +function xorTest (a, b) { + var out = 0 + if (a.length !== b.length) out++ + + var len = Math.min(a.length, b.length) + for (var i = 0; i < len; ++i) { + out += (a[i] ^ b[i]) + } + + return out +} + +function calcIv (self, iv, ck) { + if (iv.length === 12) { + self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])]) + return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])]) + } + var ghash = new GHASH(ck) + var len = iv.length + var toPad = len % 16 + ghash.update(iv) + if (toPad) { + toPad = 16 - toPad + ghash.update(Buffer.alloc(toPad, 0)) + } + ghash.update(Buffer.alloc(8, 0)) + var ivBits = len * 8 + var tail = Buffer.alloc(8) + tail.writeUIntBE(ivBits, 0, 8) + ghash.update(tail) + self._finID = ghash.state + var out = Buffer.from(self._finID) + incr32(out) + return out +} +function StreamCipher (mode, key, iv, decrypt) { + Transform.call(this) + + var h = Buffer.alloc(4, 0) + + this._cipher = new aes.AES(key) + var ck = this._cipher.encryptBlock(h) + this._ghash = new GHASH(ck) + iv = calcIv(this, iv, ck) + + this._prev = Buffer.from(iv) + this._cache = Buffer.allocUnsafe(0) + this._secCache = Buffer.allocUnsafe(0) + this._decrypt = decrypt + this._alen = 0 + this._len = 0 + this._mode = mode + + this._authTag = null + this._called = false +} + +inherits(StreamCipher, Transform) + +StreamCipher.prototype._update = function (chunk) { + if (!this._called && this._alen) { + var rump = 16 - (this._alen % 16) + if (rump < 16) { + rump = Buffer.alloc(rump, 0) + this._ghash.update(rump) + } + } + + this._called = true + var out = this._mode.encrypt(this, chunk) + if (this._decrypt) { + this._ghash.update(chunk) + } else { + this._ghash.update(out) + } + this._len += chunk.length + return out +} + +StreamCipher.prototype._final = function () { + if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data') + + var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID)) + if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data') + + this._authTag = tag + this._cipher.scrub() +} + +StreamCipher.prototype.getAuthTag = function getAuthTag () { + if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state') + + return this._authTag +} + +StreamCipher.prototype.setAuthTag = function setAuthTag (tag) { + if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state') + + this._authTag = tag +} + +StreamCipher.prototype.setAAD = function setAAD (buf) { + if (this._called) throw new Error('Attempting to set AAD in unsupported state') + + this._ghash.update(buf) + this._alen += buf.length +} + +module.exports = StreamCipher + +},{"./aes":53,"./ghash":58,"./incr32":59,"buffer-xor":69,"cipher-base":70,"inherits":318,"safe-buffer":71}],55:[function(require,module,exports){ +var ciphers = require('./encrypter') +var deciphers = require('./decrypter') +var modes = require('./modes/list.json') + +function getCiphers () { + return Object.keys(modes) +} + +exports.createCipher = exports.Cipher = ciphers.createCipher +exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv +exports.createDecipher = exports.Decipher = deciphers.createDecipher +exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv +exports.listCiphers = exports.getCiphers = getCiphers + +},{"./decrypter":56,"./encrypter":57,"./modes/list.json":67}],56:[function(require,module,exports){ +var AuthCipher = require('./authCipher') +var Buffer = require('safe-buffer').Buffer +var MODES = require('./modes') +var StreamCipher = require('./streamCipher') +var Transform = require('cipher-base') +var aes = require('./aes') +var ebtk = require('evp_bytestokey') +var inherits = require('inherits') + +function Decipher (mode, key, iv) { + Transform.call(this) + + this._cache = new Splitter() + this._last = void 0 + this._cipher = new aes.AES(key) + this._prev = Buffer.from(iv) + this._mode = mode + this._autopadding = true +} + +inherits(Decipher, Transform) + +Decipher.prototype._update = function (data) { + this._cache.add(data) + var chunk + var thing + var out = [] + while ((chunk = this._cache.get(this._autopadding))) { + thing = this._mode.decrypt(this, chunk) + out.push(thing) + } + return Buffer.concat(out) +} + +Decipher.prototype._final = function () { + var chunk = this._cache.flush() + if (this._autopadding) { + return unpad(this._mode.decrypt(this, chunk)) + } else if (chunk) { + throw new Error('data not multiple of block length') + } +} + +Decipher.prototype.setAutoPadding = function (setTo) { + this._autopadding = !!setTo + return this +} + +function Splitter () { + this.cache = Buffer.allocUnsafe(0) +} + +Splitter.prototype.add = function (data) { + this.cache = Buffer.concat([this.cache, data]) +} + +Splitter.prototype.get = function (autoPadding) { + var out + if (autoPadding) { + if (this.cache.length > 16) { + out = this.cache.slice(0, 16) + this.cache = this.cache.slice(16) + return out + } + } else { + if (this.cache.length >= 16) { + out = this.cache.slice(0, 16) + this.cache = this.cache.slice(16) + return out + } + } + + return null +} + +Splitter.prototype.flush = function () { + if (this.cache.length) return this.cache +} + +function unpad (last) { + var padded = last[15] + var i = -1 + while (++i < padded) { + if (last[(i + (16 - padded))] !== padded) { + throw new Error('unable to decrypt data') + } + } + if (padded === 16) return + + return last.slice(0, 16 - padded) +} + +function createDecipheriv (suite, password, iv) { + var config = MODES[suite.toLowerCase()] + if (!config) throw new TypeError('invalid suite type') + + if (typeof iv === 'string') iv = Buffer.from(iv) + if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length) + + if (typeof password === 'string') password = Buffer.from(password) + if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length) + + if (config.type === 'stream') { + return new StreamCipher(config.module, password, iv, true) + } else if (config.type === 'auth') { + return new AuthCipher(config.module, password, iv, true) + } + + return new Decipher(config.module, password, iv) +} + +function createDecipher (suite, password) { + var config = MODES[suite.toLowerCase()] + if (!config) throw new TypeError('invalid suite type') + + var keys = ebtk(password, false, config.key, config.iv) + return createDecipheriv(suite, keys.key, keys.iv) +} + +exports.createDecipher = createDecipher +exports.createDecipheriv = createDecipheriv + +},{"./aes":53,"./authCipher":54,"./modes":66,"./streamCipher":72,"cipher-base":70,"evp_bytestokey":84,"inherits":318,"safe-buffer":71}],57:[function(require,module,exports){ +var MODES = require('./modes') +var AuthCipher = require('./authCipher') +var Buffer = require('safe-buffer').Buffer +var StreamCipher = require('./streamCipher') +var Transform = require('cipher-base') +var aes = require('./aes') +var ebtk = require('evp_bytestokey') +var inherits = require('inherits') + +function Cipher (mode, key, iv) { + Transform.call(this) + + this._cache = new Splitter() + this._cipher = new aes.AES(key) + this._prev = Buffer.from(iv) + this._mode = mode + this._autopadding = true +} + +inherits(Cipher, Transform) + +Cipher.prototype._update = function (data) { + this._cache.add(data) + var chunk + var thing + var out = [] + + while ((chunk = this._cache.get())) { + thing = this._mode.encrypt(this, chunk) + out.push(thing) + } + + return Buffer.concat(out) +} + +var PADDING = Buffer.alloc(16, 0x10) + +Cipher.prototype._final = function () { + var chunk = this._cache.flush() + if (this._autopadding) { + chunk = this._mode.encrypt(this, chunk) + this._cipher.scrub() + return chunk + } + + if (!chunk.equals(PADDING)) { + this._cipher.scrub() + throw new Error('data not multiple of block length') + } +} + +Cipher.prototype.setAutoPadding = function (setTo) { + this._autopadding = !!setTo + return this +} + +function Splitter () { + this.cache = Buffer.allocUnsafe(0) +} + +Splitter.prototype.add = function (data) { + this.cache = Buffer.concat([this.cache, data]) +} + +Splitter.prototype.get = function () { + if (this.cache.length > 15) { + var out = this.cache.slice(0, 16) + this.cache = this.cache.slice(16) + return out + } + return null +} + +Splitter.prototype.flush = function () { + var len = 16 - this.cache.length + var padBuff = Buffer.allocUnsafe(len) + + var i = -1 + while (++i < len) { + padBuff.writeUInt8(len, i) + } + + return Buffer.concat([this.cache, padBuff]) +} + +function createCipheriv (suite, password, iv) { + var config = MODES[suite.toLowerCase()] + if (!config) throw new TypeError('invalid suite type') + + if (typeof password === 'string') password = Buffer.from(password) + if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length) + + if (typeof iv === 'string') iv = Buffer.from(iv) + if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length) + + if (config.type === 'stream') { + return new StreamCipher(config.module, password, iv) + } else if (config.type === 'auth') { + return new AuthCipher(config.module, password, iv) + } + + return new Cipher(config.module, password, iv) +} + +function createCipher (suite, password) { + var config = MODES[suite.toLowerCase()] + if (!config) throw new TypeError('invalid suite type') + + var keys = ebtk(password, false, config.key, config.iv) + return createCipheriv(suite, keys.key, keys.iv) +} + +exports.createCipheriv = createCipheriv +exports.createCipher = createCipher + +},{"./aes":53,"./authCipher":54,"./modes":66,"./streamCipher":72,"cipher-base":70,"evp_bytestokey":84,"inherits":318,"safe-buffer":71}],58:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer +var ZEROES = Buffer.alloc(16, 0) + +function toArray (buf) { + return [ + buf.readUInt32BE(0), + buf.readUInt32BE(4), + buf.readUInt32BE(8), + buf.readUInt32BE(12) + ] +} + +function fromArray (out) { + var buf = Buffer.allocUnsafe(16) + buf.writeUInt32BE(out[0] >>> 0, 0) + buf.writeUInt32BE(out[1] >>> 0, 4) + buf.writeUInt32BE(out[2] >>> 0, 8) + buf.writeUInt32BE(out[3] >>> 0, 12) + return buf +} + +function GHASH (key) { + this.h = key + this.state = Buffer.alloc(16, 0) + this.cache = Buffer.allocUnsafe(0) +} + +// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html +// by Juho Vähä-Herttua +GHASH.prototype.ghash = function (block) { + var i = -1 + while (++i < block.length) { + this.state[i] ^= block[i] + } + this._multiply() +} + +GHASH.prototype._multiply = function () { + var Vi = toArray(this.h) + var Zi = [0, 0, 0, 0] + var j, xi, lsbVi + var i = -1 + while (++i < 128) { + xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0 + if (xi) { + // Z_i+1 = Z_i ^ V_i + Zi[0] ^= Vi[0] + Zi[1] ^= Vi[1] + Zi[2] ^= Vi[2] + Zi[3] ^= Vi[3] + } + + // Store the value of LSB(V_i) + lsbVi = (Vi[3] & 1) !== 0 + + // V_i+1 = V_i >> 1 + for (j = 3; j > 0; j--) { + Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31) + } + Vi[0] = Vi[0] >>> 1 + + // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R + if (lsbVi) { + Vi[0] = Vi[0] ^ (0xe1 << 24) + } + } + this.state = fromArray(Zi) +} + +GHASH.prototype.update = function (buf) { + this.cache = Buffer.concat([this.cache, buf]) + var chunk + while (this.cache.length >= 16) { + chunk = this.cache.slice(0, 16) + this.cache = this.cache.slice(16) + this.ghash(chunk) + } +} + +GHASH.prototype.final = function (abl, bl) { + if (this.cache.length) { + this.ghash(Buffer.concat([this.cache, ZEROES], 16)) + } + + this.ghash(fromArray([0, abl, 0, bl])) + return this.state +} + +module.exports = GHASH + +},{"safe-buffer":71}],59:[function(require,module,exports){ +function incr32 (iv) { + var len = iv.length + var item + while (len--) { + item = iv.readUInt8(len) + if (item === 255) { + iv.writeUInt8(0, len) + } else { + item++ + iv.writeUInt8(item, len) + break + } + } +} +module.exports = incr32 + +},{}],60:[function(require,module,exports){ +var xor = require('buffer-xor') + +exports.encrypt = function (self, block) { + var data = xor(block, self._prev) + + self._prev = self._cipher.encryptBlock(data) + return self._prev +} + +exports.decrypt = function (self, block) { + var pad = self._prev + + self._prev = block + var out = self._cipher.decryptBlock(block) + + return xor(out, pad) +} + +},{"buffer-xor":69}],61:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer +var xor = require('buffer-xor') + +function encryptStart (self, data, decrypt) { + var len = data.length + var out = xor(data, self._cache) + self._cache = self._cache.slice(len) + self._prev = Buffer.concat([self._prev, decrypt ? data : out]) + return out +} + +exports.encrypt = function (self, data, decrypt) { + var out = Buffer.allocUnsafe(0) + var len + + while (data.length) { + if (self._cache.length === 0) { + self._cache = self._cipher.encryptBlock(self._prev) + self._prev = Buffer.allocUnsafe(0) + } + + if (self._cache.length <= data.length) { + len = self._cache.length + out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)]) + data = data.slice(len) + } else { + out = Buffer.concat([out, encryptStart(self, data, decrypt)]) + break + } + } + + return out +} + +},{"buffer-xor":69,"safe-buffer":71}],62:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer + +function encryptByte (self, byteParam, decrypt) { + var pad + var i = -1 + var len = 8 + var out = 0 + var bit, value + while (++i < len) { + pad = self._cipher.encryptBlock(self._prev) + bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0 + value = pad[0] ^ bit + out += ((value & 0x80) >> (i % 8)) + self._prev = shiftIn(self._prev, decrypt ? bit : value) + } + return out +} + +function shiftIn (buffer, value) { + var len = buffer.length + var i = -1 + var out = Buffer.allocUnsafe(buffer.length) + buffer = Buffer.concat([buffer, Buffer.from([value])]) + + while (++i < len) { + out[i] = buffer[i] << 1 | buffer[i + 1] >> (7) + } + + return out +} + +exports.encrypt = function (self, chunk, decrypt) { + var len = chunk.length + var out = Buffer.allocUnsafe(len) + var i = -1 + + while (++i < len) { + out[i] = encryptByte(self, chunk[i], decrypt) + } + + return out +} + +},{"safe-buffer":71}],63:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer + +function encryptByte (self, byteParam, decrypt) { + var pad = self._cipher.encryptBlock(self._prev) + var out = pad[0] ^ byteParam + + self._prev = Buffer.concat([ + self._prev.slice(1), + Buffer.from([decrypt ? byteParam : out]) + ]) + + return out +} + +exports.encrypt = function (self, chunk, decrypt) { + var len = chunk.length + var out = Buffer.allocUnsafe(len) + var i = -1 + + while (++i < len) { + out[i] = encryptByte(self, chunk[i], decrypt) + } + + return out +} + +},{"safe-buffer":71}],64:[function(require,module,exports){ +var xor = require('buffer-xor') +var Buffer = require('safe-buffer').Buffer +var incr32 = require('../incr32') + +function getBlock (self) { + var out = self._cipher.encryptBlockRaw(self._prev) + incr32(self._prev) + return out +} + +var blockSize = 16 +exports.encrypt = function (self, chunk) { + var chunkNum = Math.ceil(chunk.length / blockSize) + var start = self._cache.length + self._cache = Buffer.concat([ + self._cache, + Buffer.allocUnsafe(chunkNum * blockSize) + ]) + for (var i = 0; i < chunkNum; i++) { + var out = getBlock(self) + var offset = start + i * blockSize + self._cache.writeUInt32BE(out[0], offset + 0) + self._cache.writeUInt32BE(out[1], offset + 4) + self._cache.writeUInt32BE(out[2], offset + 8) + self._cache.writeUInt32BE(out[3], offset + 12) + } + var pad = self._cache.slice(0, chunk.length) + self._cache = self._cache.slice(chunk.length) + return xor(chunk, pad) +} + +},{"../incr32":59,"buffer-xor":69,"safe-buffer":71}],65:[function(require,module,exports){ +exports.encrypt = function (self, block) { + return self._cipher.encryptBlock(block) +} + +exports.decrypt = function (self, block) { + return self._cipher.decryptBlock(block) +} + +},{}],66:[function(require,module,exports){ +var modeModules = { + ECB: require('./ecb'), + CBC: require('./cbc'), + CFB: require('./cfb'), + CFB8: require('./cfb8'), + CFB1: require('./cfb1'), + OFB: require('./ofb'), + CTR: require('./ctr'), + GCM: require('./ctr') +} + +var modes = require('./list.json') + +for (var key in modes) { + modes[key].module = modeModules[modes[key].mode] +} + +module.exports = modes + +},{"./cbc":60,"./cfb":61,"./cfb1":62,"./cfb8":63,"./ctr":64,"./ecb":65,"./list.json":67,"./ofb":68}],67:[function(require,module,exports){ +module.exports={ + "aes-128-ecb": { + "cipher": "AES", + "key": 128, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-192-ecb": { + "cipher": "AES", + "key": 192, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-256-ecb": { + "cipher": "AES", + "key": 256, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-128-cbc": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-192-cbc": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-256-cbc": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes128": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes192": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes256": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-128-cfb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-192-cfb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-256-cfb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-128-cfb8": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-192-cfb8": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-256-cfb8": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-128-cfb1": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-192-cfb1": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-256-cfb1": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-128-ofb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-192-ofb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-256-ofb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-128-ctr": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-192-ctr": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-256-ctr": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-128-gcm": { + "cipher": "AES", + "key": 128, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-192-gcm": { + "cipher": "AES", + "key": 192, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-256-gcm": { + "cipher": "AES", + "key": 256, + "iv": 12, + "mode": "GCM", + "type": "auth" + } +} + +},{}],68:[function(require,module,exports){ +(function (Buffer){ +var xor = require('buffer-xor') + +function getBlock (self) { + self._prev = self._cipher.encryptBlock(self._prev) + return self._prev +} + +exports.encrypt = function (self, chunk) { + while (self._cache.length < chunk.length) { + self._cache = Buffer.concat([self._cache, getBlock(self)]) + } + + var pad = self._cache.slice(0, chunk.length) + self._cache = self._cache.slice(chunk.length) + return xor(chunk, pad) +} + +}).call(this,require("buffer").Buffer) +},{"buffer":47,"buffer-xor":69}],69:[function(require,module,exports){ +(function (Buffer){ +module.exports = function xor (a, b) { + var length = Math.min(a.length, b.length) + var buffer = new Buffer(length) + + for (var i = 0; i < length; ++i) { + buffer[i] = a[i] ^ b[i] + } + + return buffer +} + +}).call(this,require("buffer").Buffer) +},{"buffer":47}],70:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer +var Transform = require('stream').Transform +var StringDecoder = require('string_decoder').StringDecoder +var inherits = require('inherits') + +function CipherBase (hashMode) { + Transform.call(this) + this.hashMode = typeof hashMode === 'string' + if (this.hashMode) { + this[hashMode] = this._finalOrDigest + } else { + this.final = this._finalOrDigest + } + if (this._final) { + this.__final = this._final + this._final = null + } + this._decoder = null + this._encoding = null +} +inherits(CipherBase, Transform) + +CipherBase.prototype.update = function (data, inputEnc, outputEnc) { + if (typeof data === 'string') { + data = Buffer.from(data, inputEnc) + } + + var outData = this._update(data) + if (this.hashMode) return this + + if (outputEnc) { + outData = this._toString(outData, outputEnc) + } + + return outData +} + +CipherBase.prototype.setAutoPadding = function () {} +CipherBase.prototype.getAuthTag = function () { + throw new Error('trying to get auth tag in unsupported state') +} + +CipherBase.prototype.setAuthTag = function () { + throw new Error('trying to set auth tag in unsupported state') +} + +CipherBase.prototype.setAAD = function () { + throw new Error('trying to set aad in unsupported state') +} + +CipherBase.prototype._transform = function (data, _, next) { + var err + try { + if (this.hashMode) { + this._update(data) + } else { + this.push(this._update(data)) + } + } catch (e) { + err = e + } finally { + next(err) + } +} +CipherBase.prototype._flush = function (done) { + var err + try { + this.push(this.__final()) + } catch (e) { + err = e + } + + done(err) +} +CipherBase.prototype._finalOrDigest = function (outputEnc) { + var outData = this.__final() || Buffer.alloc(0) + if (outputEnc) { + outData = this._toString(outData, outputEnc, true) + } + return outData +} + +CipherBase.prototype._toString = function (value, enc, fin) { + if (!this._decoder) { + this._decoder = new StringDecoder(enc) + this._encoding = enc + } + + if (this._encoding !== enc) throw new Error('can\'t switch encodings') + + var out = this._decoder.write(value) + if (fin) { + out += this._decoder.end() + } + + return out +} + +module.exports = CipherBase + +},{"inherits":318,"safe-buffer":71,"stream":272,"string_decoder":273}],71:[function(require,module,exports){ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + +},{"buffer":47}],72:[function(require,module,exports){ +var aes = require('./aes') +var Buffer = require('safe-buffer').Buffer +var Transform = require('cipher-base') +var inherits = require('inherits') + +function StreamCipher (mode, key, iv, decrypt) { + Transform.call(this) + + this._cipher = new aes.AES(key) + this._prev = Buffer.from(iv) + this._cache = Buffer.allocUnsafe(0) + this._secCache = Buffer.allocUnsafe(0) + this._decrypt = decrypt + this._mode = mode +} + +inherits(StreamCipher, Transform) + +StreamCipher.prototype._update = function (chunk) { + return this._mode.encrypt(this, chunk, this._decrypt) +} + +StreamCipher.prototype._final = function () { + this._cipher.scrub() +} + +module.exports = StreamCipher + +},{"./aes":53,"cipher-base":70,"inherits":318,"safe-buffer":71}],73:[function(require,module,exports){ +(function (Buffer){ +var CipherBase = require('cipher-base') +var des = require('des.js') +var inherits = require('inherits') + +var modes = { + 'des-ede3-cbc': des.CBC.instantiate(des.EDE), + 'des-ede3': des.EDE, + 'des-ede-cbc': des.CBC.instantiate(des.EDE), + 'des-ede': des.EDE, + 'des-cbc': des.CBC.instantiate(des.DES), + 'des-ecb': des.DES +} +modes.des = modes['des-cbc'] +modes.des3 = modes['des-ede3-cbc'] +module.exports = DES +inherits(DES, CipherBase) +function DES (opts) { + CipherBase.call(this) + var modeName = opts.mode.toLowerCase() + var mode = modes[modeName] + var type + if (opts.decrypt) { + type = 'decrypt' + } else { + type = 'encrypt' + } + var key = opts.key + if (modeName === 'des-ede' || modeName === 'des-ede-cbc') { + key = Buffer.concat([key, key.slice(0, 8)]) + } + var iv = opts.iv + this._des = mode.create({ + key: key, + iv: iv, + type: type + }) +} +DES.prototype._update = function (data) { + return new Buffer(this._des.update(data)) +} +DES.prototype._final = function () { + return new Buffer(this._des.final()) +} + +}).call(this,require("buffer").Buffer) +},{"buffer":47,"cipher-base":75,"des.js":77,"inherits":318}],74:[function(require,module,exports){ +exports['des-ecb'] = { + key: 8, + iv: 0 +} +exports['des-cbc'] = exports.des = { + key: 8, + iv: 8 +} +exports['des-ede3-cbc'] = exports.des3 = { + key: 24, + iv: 8 +} +exports['des-ede3'] = { + key: 24, + iv: 0 +} +exports['des-ede-cbc'] = { + key: 16, + iv: 8 +} +exports['des-ede'] = { + key: 16, + iv: 0 +} + +},{}],75:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"dup":70,"inherits":318,"safe-buffer":76,"stream":272,"string_decoder":273}],76:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],77:[function(require,module,exports){ +'use strict'; + +exports.utils = require('./des/utils'); +exports.Cipher = require('./des/cipher'); +exports.DES = require('./des/des'); +exports.CBC = require('./des/cbc'); +exports.EDE = require('./des/ede'); + +},{"./des/cbc":78,"./des/cipher":79,"./des/des":80,"./des/ede":81,"./des/utils":82}],78:[function(require,module,exports){ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +var proto = {}; + +function CBCState(iv) { + assert.equal(iv.length, 8, 'Invalid IV length'); + + this.iv = new Array(8); + for (var i = 0; i < this.iv.length; i++) + this.iv[i] = iv[i]; +} + +function instantiate(Base) { + function CBC(options) { + Base.call(this, options); + this._cbcInit(); + } + inherits(CBC, Base); + + var keys = Object.keys(proto); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + CBC.prototype[key] = proto[key]; + } + + CBC.create = function create(options) { + return new CBC(options); + }; + + return CBC; +} + +exports.instantiate = instantiate; + +proto._cbcInit = function _cbcInit() { + var state = new CBCState(this.options.iv); + this._cbcState = state; +}; + +proto._update = function _update(inp, inOff, out, outOff) { + var state = this._cbcState; + var superProto = this.constructor.super_.prototype; + + var iv = state.iv; + if (this.type === 'encrypt') { + for (var i = 0; i < this.blockSize; i++) + iv[i] ^= inp[inOff + i]; + + superProto._update.call(this, iv, 0, out, outOff); + + for (var i = 0; i < this.blockSize; i++) + iv[i] = out[outOff + i]; + } else { + superProto._update.call(this, inp, inOff, out, outOff); + + for (var i = 0; i < this.blockSize; i++) + out[outOff + i] ^= iv[i]; + + for (var i = 0; i < this.blockSize; i++) + iv[i] = inp[inOff + i]; + } +}; + +},{"inherits":318,"minimalistic-assert":83}],79:[function(require,module,exports){ +'use strict'; + +var assert = require('minimalistic-assert'); + +function Cipher(options) { + this.options = options; + + this.type = this.options.type; + this.blockSize = 8; + this._init(); + + this.buffer = new Array(this.blockSize); + this.bufferOff = 0; +} +module.exports = Cipher; + +Cipher.prototype._init = function _init() { + // Might be overrided +}; + +Cipher.prototype.update = function update(data) { + if (data.length === 0) + return []; + + if (this.type === 'decrypt') + return this._updateDecrypt(data); + else + return this._updateEncrypt(data); +}; + +Cipher.prototype._buffer = function _buffer(data, off) { + // Append data to buffer + var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); + for (var i = 0; i < min; i++) + this.buffer[this.bufferOff + i] = data[off + i]; + this.bufferOff += min; + + // Shift next + return min; +}; + +Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { + this._update(this.buffer, 0, out, off); + this.bufferOff = 0; + return this.blockSize; +}; + +Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { + var inputOff = 0; + var outputOff = 0; + + var count = ((this.bufferOff + data.length) / this.blockSize) | 0; + var out = new Array(count * this.blockSize); + + if (this.bufferOff !== 0) { + inputOff += this._buffer(data, inputOff); + + if (this.bufferOff === this.buffer.length) + outputOff += this._flushBuffer(out, outputOff); + } + + // Write blocks + var max = data.length - ((data.length - inputOff) % this.blockSize); + for (; inputOff < max; inputOff += this.blockSize) { + this._update(data, inputOff, out, outputOff); + outputOff += this.blockSize; + } + + // Queue rest + for (; inputOff < data.length; inputOff++, this.bufferOff++) + this.buffer[this.bufferOff] = data[inputOff]; + + return out; +}; + +Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { + var inputOff = 0; + var outputOff = 0; + + var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; + var out = new Array(count * this.blockSize); + + // TODO(indutny): optimize it, this is far from optimal + for (; count > 0; count--) { + inputOff += this._buffer(data, inputOff); + outputOff += this._flushBuffer(out, outputOff); + } + + // Buffer rest of the input + inputOff += this._buffer(data, inputOff); + + return out; +}; + +Cipher.prototype.final = function final(buffer) { + var first; + if (buffer) + first = this.update(buffer); + + var last; + if (this.type === 'encrypt') + last = this._finalEncrypt(); + else + last = this._finalDecrypt(); + + if (first) + return first.concat(last); + else + return last; +}; + +Cipher.prototype._pad = function _pad(buffer, off) { + if (off === 0) + return false; + + while (off < buffer.length) + buffer[off++] = 0; + + return true; +}; + +Cipher.prototype._finalEncrypt = function _finalEncrypt() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + + var out = new Array(this.blockSize); + this._update(this.buffer, 0, out, 0); + return out; +}; + +Cipher.prototype._unpad = function _unpad(buffer) { + return buffer; +}; + +Cipher.prototype._finalDecrypt = function _finalDecrypt() { + assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt'); + var out = new Array(this.blockSize); + this._flushBuffer(out, 0); + + return this._unpad(out); +}; + +},{"minimalistic-assert":83}],80:[function(require,module,exports){ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +var des = require('../des'); +var utils = des.utils; +var Cipher = des.Cipher; + +function DESState() { + this.tmp = new Array(2); + this.keys = null; +} + +function DES(options) { + Cipher.call(this, options); + + var state = new DESState(); + this._desState = state; + + this.deriveKeys(state, options.key); +} +inherits(DES, Cipher); +module.exports = DES; + +DES.create = function create(options) { + return new DES(options); +}; + +var shiftTable = [ + 1, 1, 2, 2, 2, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 1 +]; + +DES.prototype.deriveKeys = function deriveKeys(state, key) { + state.keys = new Array(16 * 2); + + assert.equal(key.length, this.blockSize, 'Invalid key length'); + + var kL = utils.readUInt32BE(key, 0); + var kR = utils.readUInt32BE(key, 4); + + utils.pc1(kL, kR, state.tmp, 0); + kL = state.tmp[0]; + kR = state.tmp[1]; + for (var i = 0; i < state.keys.length; i += 2) { + var shift = shiftTable[i >>> 1]; + kL = utils.r28shl(kL, shift); + kR = utils.r28shl(kR, shift); + utils.pc2(kL, kR, state.keys, i); + } +}; + +DES.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._desState; + + var l = utils.readUInt32BE(inp, inOff); + var r = utils.readUInt32BE(inp, inOff + 4); + + // Initial Permutation + utils.ip(l, r, state.tmp, 0); + l = state.tmp[0]; + r = state.tmp[1]; + + if (this.type === 'encrypt') + this._encrypt(state, l, r, state.tmp, 0); + else + this._decrypt(state, l, r, state.tmp, 0); + + l = state.tmp[0]; + r = state.tmp[1]; + + utils.writeUInt32BE(out, l, outOff); + utils.writeUInt32BE(out, r, outOff + 4); +}; + +DES.prototype._pad = function _pad(buffer, off) { + var value = buffer.length - off; + for (var i = off; i < buffer.length; i++) + buffer[i] = value; + + return true; +}; + +DES.prototype._unpad = function _unpad(buffer) { + var pad = buffer[buffer.length - 1]; + for (var i = buffer.length - pad; i < buffer.length; i++) + assert.equal(buffer[i], pad); + + return buffer.slice(0, buffer.length - pad); +}; + +DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { + var l = lStart; + var r = rStart; + + // Apply f() x16 times + for (var i = 0; i < state.keys.length; i += 2) { + var keyL = state.keys[i]; + var keyR = state.keys[i + 1]; + + // f(r, k) + utils.expand(r, state.tmp, 0); + + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s = utils.substitute(keyL, keyR); + var f = utils.permute(s); + + var t = r; + r = (l ^ f) >>> 0; + l = t; + } + + // Reverse Initial Permutation + utils.rip(r, l, out, off); +}; + +DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { + var l = rStart; + var r = lStart; + + // Apply f() x16 times + for (var i = state.keys.length - 2; i >= 0; i -= 2) { + var keyL = state.keys[i]; + var keyR = state.keys[i + 1]; + + // f(r, k) + utils.expand(l, state.tmp, 0); + + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s = utils.substitute(keyL, keyR); + var f = utils.permute(s); + + var t = l; + l = (r ^ f) >>> 0; + r = t; + } + + // Reverse Initial Permutation + utils.rip(l, r, out, off); +}; + +},{"../des":77,"inherits":318,"minimalistic-assert":83}],81:[function(require,module,exports){ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +var des = require('../des'); +var Cipher = des.Cipher; +var DES = des.DES; + +function EDEState(type, key) { + assert.equal(key.length, 24, 'Invalid key length'); + + var k1 = key.slice(0, 8); + var k2 = key.slice(8, 16); + var k3 = key.slice(16, 24); + + if (type === 'encrypt') { + this.ciphers = [ + DES.create({ type: 'encrypt', key: k1 }), + DES.create({ type: 'decrypt', key: k2 }), + DES.create({ type: 'encrypt', key: k3 }) + ]; + } else { + this.ciphers = [ + DES.create({ type: 'decrypt', key: k3 }), + DES.create({ type: 'encrypt', key: k2 }), + DES.create({ type: 'decrypt', key: k1 }) + ]; + } +} + +function EDE(options) { + Cipher.call(this, options); + + var state = new EDEState(this.type, this.options.key); + this._edeState = state; +} +inherits(EDE, Cipher); + +module.exports = EDE; + +EDE.create = function create(options) { + return new EDE(options); +}; + +EDE.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._edeState; + + state.ciphers[0]._update(inp, inOff, out, outOff); + state.ciphers[1]._update(out, outOff, out, outOff); + state.ciphers[2]._update(out, outOff, out, outOff); +}; + +EDE.prototype._pad = DES.prototype._pad; +EDE.prototype._unpad = DES.prototype._unpad; + +},{"../des":77,"inherits":318,"minimalistic-assert":83}],82:[function(require,module,exports){ +'use strict'; + +exports.readUInt32BE = function readUInt32BE(bytes, off) { + var res = (bytes[0 + off] << 24) | + (bytes[1 + off] << 16) | + (bytes[2 + off] << 8) | + bytes[3 + off]; + return res >>> 0; +}; + +exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { + bytes[0 + off] = value >>> 24; + bytes[1 + off] = (value >>> 16) & 0xff; + bytes[2 + off] = (value >>> 8) & 0xff; + bytes[3 + off] = value & 0xff; +}; + +exports.ip = function ip(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + for (var i = 6; i >= 0; i -= 2) { + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >>> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inL >>> (j + i)) & 1; + } + } + + for (var i = 6; i >= 0; i -= 2) { + for (var j = 1; j <= 25; j += 8) { + outR <<= 1; + outR |= (inR >>> (j + i)) & 1; + } + for (var j = 1; j <= 25; j += 8) { + outR <<= 1; + outR |= (inL >>> (j + i)) & 1; + } + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.rip = function rip(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + for (var i = 0; i < 4; i++) { + for (var j = 24; j >= 0; j -= 8) { + outL <<= 1; + outL |= (inR >>> (j + i)) & 1; + outL <<= 1; + outL |= (inL >>> (j + i)) & 1; + } + } + for (var i = 4; i < 8; i++) { + for (var j = 24; j >= 0; j -= 8) { + outR <<= 1; + outR |= (inR >>> (j + i)) & 1; + outR <<= 1; + outR |= (inL >>> (j + i)) & 1; + } + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.pc1 = function pc1(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + // 7, 15, 23, 31, 39, 47, 55, 63 + // 6, 14, 22, 30, 39, 47, 55, 63 + // 5, 13, 21, 29, 39, 47, 55, 63 + // 4, 12, 20, 28 + for (var i = 7; i >= 5; i--) { + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inL >> (j + i)) & 1; + } + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >> (j + i)) & 1; + } + + // 1, 9, 17, 25, 33, 41, 49, 57 + // 2, 10, 18, 26, 34, 42, 50, 58 + // 3, 11, 19, 27, 35, 43, 51, 59 + // 36, 44, 52, 60 + for (var i = 1; i <= 3; i++) { + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inR >> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inL >> (j + i)) & 1; + } + } + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inL >> (j + i)) & 1; + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.r28shl = function r28shl(num, shift) { + return ((num << shift) & 0xfffffff) | (num >>> (28 - shift)); +}; + +var pc2table = [ + // inL => outL + 14, 11, 17, 4, 27, 23, 25, 0, + 13, 22, 7, 18, 5, 9, 16, 24, + 2, 20, 12, 21, 1, 8, 15, 26, + + // inR => outR + 15, 4, 25, 19, 9, 1, 26, 16, + 5, 11, 23, 8, 12, 7, 17, 0, + 22, 3, 10, 14, 6, 20, 27, 24 +]; + +exports.pc2 = function pc2(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + var len = pc2table.length >>> 1; + for (var i = 0; i < len; i++) { + outL <<= 1; + outL |= (inL >>> pc2table[i]) & 0x1; + } + for (var i = len; i < pc2table.length; i++) { + outR <<= 1; + outR |= (inR >>> pc2table[i]) & 0x1; + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.expand = function expand(r, out, off) { + var outL = 0; + var outR = 0; + + outL = ((r & 1) << 5) | (r >>> 27); + for (var i = 23; i >= 15; i -= 4) { + outL <<= 6; + outL |= (r >>> i) & 0x3f; + } + for (var i = 11; i >= 3; i -= 4) { + outR |= (r >>> i) & 0x3f; + outR <<= 6; + } + outR |= ((r & 0x1f) << 1) | (r >>> 31); + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +var sTable = [ + 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, + 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, + 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, + 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, + + 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, + 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, + 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, + 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, + + 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, + 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, + 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, + 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, + + 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, + 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, + 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, + 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, + + 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, + 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, + 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, + 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, + + 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, + 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, + 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, + 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, + + 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, + 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, + 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, + 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, + + 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, + 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, + 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, + 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 +]; + +exports.substitute = function substitute(inL, inR) { + var out = 0; + for (var i = 0; i < 4; i++) { + var b = (inL >>> (18 - i * 6)) & 0x3f; + var sb = sTable[i * 0x40 + b]; + + out <<= 4; + out |= sb; + } + for (var i = 0; i < 4; i++) { + var b = (inR >>> (18 - i * 6)) & 0x3f; + var sb = sTable[4 * 0x40 + i * 0x40 + b]; + + out <<= 4; + out |= sb; + } + return out >>> 0; +}; + +var permuteTable = [ + 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, + 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7 +]; + +exports.permute = function permute(num) { + var out = 0; + for (var i = 0; i < permuteTable.length; i++) { + out <<= 1; + out |= (num >>> permuteTable[i]) & 0x1; + } + return out >>> 0; +}; + +exports.padSplit = function padSplit(num, size, group) { + var str = num.toString(2); + while (str.length < size) + str = '0' + str; + + var out = []; + for (var i = 0; i < size; i += group) + out.push(str.slice(i, i + group)); + return out.join(' '); +}; + +},{}],83:[function(require,module,exports){ +module.exports = assert; + +function assert(val, msg) { + if (!val) + throw new Error(msg || 'Assertion failed'); +} + +assert.equal = function assertEqual(l, r, msg) { + if (l != r) + throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); +}; + +},{}],84:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer +var MD5 = require('md5.js') + +/* eslint-disable camelcase */ +function EVP_BytesToKey (password, salt, keyBits, ivLen) { + if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary') + if (salt) { + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary') + if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length') + } + + var keyLen = keyBits / 8 + var key = Buffer.alloc(keyLen) + var iv = Buffer.alloc(ivLen || 0) + var tmp = Buffer.alloc(0) + + while (keyLen > 0 || ivLen > 0) { + var hash = new MD5() + hash.update(tmp) + hash.update(password) + if (salt) hash.update(salt) + tmp = hash.digest() + + var used = 0 + + if (keyLen > 0) { + var keyStart = key.length - keyLen + used = Math.min(keyLen, tmp.length) + tmp.copy(key, keyStart, 0, used) + keyLen -= used + } + + if (used < tmp.length && ivLen > 0) { + var ivStart = iv.length - ivLen + var length = Math.min(ivLen, tmp.length - used) + tmp.copy(iv, ivStart, used, used + length) + ivLen -= length + } + } + + tmp.fill(0) + return { key: key, iv: iv } +} + +module.exports = EVP_BytesToKey + +},{"md5.js":85,"safe-buffer":87}],85:[function(require,module,exports){ +(function (Buffer){ +'use strict' +var inherits = require('inherits') +var HashBase = require('hash-base') + +var ARRAY16 = new Array(16) + +function MD5 () { + HashBase.call(this, 64) + + // state + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 +} + +inherits(MD5, HashBase) + +MD5.prototype._update = function () { + var M = ARRAY16 + for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4) + + var a = this._a + var b = this._b + var c = this._c + var d = this._d + + a = fnF(a, b, c, d, M[0], 0xd76aa478, 7) + d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12) + c = fnF(c, d, a, b, M[2], 0x242070db, 17) + b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22) + a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7) + d = fnF(d, a, b, c, M[5], 0x4787c62a, 12) + c = fnF(c, d, a, b, M[6], 0xa8304613, 17) + b = fnF(b, c, d, a, M[7], 0xfd469501, 22) + a = fnF(a, b, c, d, M[8], 0x698098d8, 7) + d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12) + c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17) + b = fnF(b, c, d, a, M[11], 0x895cd7be, 22) + a = fnF(a, b, c, d, M[12], 0x6b901122, 7) + d = fnF(d, a, b, c, M[13], 0xfd987193, 12) + c = fnF(c, d, a, b, M[14], 0xa679438e, 17) + b = fnF(b, c, d, a, M[15], 0x49b40821, 22) + + a = fnG(a, b, c, d, M[1], 0xf61e2562, 5) + d = fnG(d, a, b, c, M[6], 0xc040b340, 9) + c = fnG(c, d, a, b, M[11], 0x265e5a51, 14) + b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20) + a = fnG(a, b, c, d, M[5], 0xd62f105d, 5) + d = fnG(d, a, b, c, M[10], 0x02441453, 9) + c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14) + b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20) + a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5) + d = fnG(d, a, b, c, M[14], 0xc33707d6, 9) + c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14) + b = fnG(b, c, d, a, M[8], 0x455a14ed, 20) + a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5) + d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9) + c = fnG(c, d, a, b, M[7], 0x676f02d9, 14) + b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20) + + a = fnH(a, b, c, d, M[5], 0xfffa3942, 4) + d = fnH(d, a, b, c, M[8], 0x8771f681, 11) + c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16) + b = fnH(b, c, d, a, M[14], 0xfde5380c, 23) + a = fnH(a, b, c, d, M[1], 0xa4beea44, 4) + d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11) + c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16) + b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23) + a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4) + d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11) + c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16) + b = fnH(b, c, d, a, M[6], 0x04881d05, 23) + a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4) + d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11) + c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16) + b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23) + + a = fnI(a, b, c, d, M[0], 0xf4292244, 6) + d = fnI(d, a, b, c, M[7], 0x432aff97, 10) + c = fnI(c, d, a, b, M[14], 0xab9423a7, 15) + b = fnI(b, c, d, a, M[5], 0xfc93a039, 21) + a = fnI(a, b, c, d, M[12], 0x655b59c3, 6) + d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10) + c = fnI(c, d, a, b, M[10], 0xffeff47d, 15) + b = fnI(b, c, d, a, M[1], 0x85845dd1, 21) + a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6) + d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10) + c = fnI(c, d, a, b, M[6], 0xa3014314, 15) + b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21) + a = fnI(a, b, c, d, M[4], 0xf7537e82, 6) + d = fnI(d, a, b, c, M[11], 0xbd3af235, 10) + c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15) + b = fnI(b, c, d, a, M[9], 0xeb86d391, 21) + + this._a = (this._a + a) | 0 + this._b = (this._b + b) | 0 + this._c = (this._c + c) | 0 + this._d = (this._d + d) | 0 +} + +MD5.prototype._digest = function () { + // create padding and handle blocks + this._block[this._blockOffset++] = 0x80 + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64) + this._update() + this._blockOffset = 0 + } + + this._block.fill(0, this._blockOffset, 56) + this._block.writeUInt32LE(this._length[0], 56) + this._block.writeUInt32LE(this._length[1], 60) + this._update() + + // produce result + var buffer = new Buffer(16) + buffer.writeInt32LE(this._a, 0) + buffer.writeInt32LE(this._b, 4) + buffer.writeInt32LE(this._c, 8) + buffer.writeInt32LE(this._d, 12) + return buffer +} + +function rotl (x, n) { + return (x << n) | (x >>> (32 - n)) +} + +function fnF (a, b, c, d, m, k, s) { + return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0 +} + +function fnG (a, b, c, d, m, k, s) { + return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0 +} + +function fnH (a, b, c, d, m, k, s) { + return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0 +} + +function fnI (a, b, c, d, m, k, s) { + return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0 +} + +module.exports = MD5 + +}).call(this,require("buffer").Buffer) +},{"buffer":47,"hash-base":86,"inherits":318}],86:[function(require,module,exports){ +'use strict' +var Buffer = require('safe-buffer').Buffer +var Transform = require('stream').Transform +var inherits = require('inherits') + +function throwIfNotStringOrBuffer (val, prefix) { + if (!Buffer.isBuffer(val) && typeof val !== 'string') { + throw new TypeError(prefix + ' must be a string or a buffer') + } +} + +function HashBase (blockSize) { + Transform.call(this) + + this._block = Buffer.allocUnsafe(blockSize) + this._blockSize = blockSize + this._blockOffset = 0 + this._length = [0, 0, 0, 0] + + this._finalized = false +} + +inherits(HashBase, Transform) + +HashBase.prototype._transform = function (chunk, encoding, callback) { + var error = null + try { + this.update(chunk, encoding) + } catch (err) { + error = err + } + + callback(error) +} + +HashBase.prototype._flush = function (callback) { + var error = null + try { + this.push(this.digest()) + } catch (err) { + error = err + } + + callback(error) +} + +HashBase.prototype.update = function (data, encoding) { + throwIfNotStringOrBuffer(data, 'Data') + if (this._finalized) throw new Error('Digest already called') + if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding) + + // consume data + var block = this._block + var offset = 0 + while (this._blockOffset + data.length - offset >= this._blockSize) { + for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++] + this._update() + this._blockOffset = 0 + } + while (offset < data.length) block[this._blockOffset++] = data[offset++] + + // update length + for (var j = 0, carry = data.length * 8; carry > 0; ++j) { + this._length[j] += carry + carry = (this._length[j] / 0x0100000000) | 0 + if (carry > 0) this._length[j] -= 0x0100000000 * carry + } + + return this +} + +HashBase.prototype._update = function () { + throw new Error('_update is not implemented') +} + +HashBase.prototype.digest = function (encoding) { + if (this._finalized) throw new Error('Digest already called') + this._finalized = true + + var digest = this._digest() + if (encoding !== undefined) digest = digest.toString(encoding) + + // reset state + this._block.fill(0) + this._blockOffset = 0 + for (var i = 0; i < 4; ++i) this._length[i] = 0 + + return digest +} + +HashBase.prototype._digest = function () { + throw new Error('_digest is not implemented') +} + +module.exports = HashBase + +},{"inherits":318,"safe-buffer":87,"stream":272}],87:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],88:[function(require,module,exports){ +module.exports = require('./browser/algorithms.json') + +},{"./browser/algorithms.json":89}],89:[function(require,module,exports){ +module.exports={ + "sha224WithRSAEncryption": { + "sign": "rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "RSA-SHA224": { + "sign": "ecdsa/rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "sha256WithRSAEncryption": { + "sign": "rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "RSA-SHA256": { + "sign": "ecdsa/rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "sha384WithRSAEncryption": { + "sign": "rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "RSA-SHA384": { + "sign": "ecdsa/rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "sha512WithRSAEncryption": { + "sign": "rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA512": { + "sign": "ecdsa/rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA1": { + "sign": "rsa", + "hash": "sha1", + "id": "3021300906052b0e03021a05000414" + }, + "ecdsa-with-SHA1": { + "sign": "ecdsa", + "hash": "sha1", + "id": "" + }, + "sha256": { + "sign": "ecdsa", + "hash": "sha256", + "id": "" + }, + "sha224": { + "sign": "ecdsa", + "hash": "sha224", + "id": "" + }, + "sha384": { + "sign": "ecdsa", + "hash": "sha384", + "id": "" + }, + "sha512": { + "sign": "ecdsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-SHA1": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-WITH-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-WITH-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-WITH-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-WITH-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-RIPEMD160": { + "sign": "dsa", + "hash": "rmd160", + "id": "" + }, + "ripemd160WithRSA": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "RSA-RIPEMD160": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "md5WithRSAEncryption": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + }, + "RSA-MD5": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + } +} + +},{}],90:[function(require,module,exports){ +module.exports={ + "1.3.132.0.10": "secp256k1", + "1.3.132.0.33": "p224", + "1.2.840.10045.3.1.1": "p192", + "1.2.840.10045.3.1.7": "p256", + "1.3.132.0.34": "p384", + "1.3.132.0.35": "p521" +} + +},{}],91:[function(require,module,exports){ +(function (Buffer){ +var createHash = require('create-hash') +var stream = require('stream') +var inherits = require('inherits') +var sign = require('./sign') +var verify = require('./verify') + +var algorithms = require('./algorithms.json') +Object.keys(algorithms).forEach(function (key) { + algorithms[key].id = new Buffer(algorithms[key].id, 'hex') + algorithms[key.toLowerCase()] = algorithms[key] +}) + +function Sign (algorithm) { + stream.Writable.call(this) + + var data = algorithms[algorithm] + if (!data) throw new Error('Unknown message digest') + + this._hashType = data.hash + this._hash = createHash(data.hash) + this._tag = data.id + this._signType = data.sign +} +inherits(Sign, stream.Writable) + +Sign.prototype._write = function _write (data, _, done) { + this._hash.update(data) + done() +} + +Sign.prototype.update = function update (data, enc) { + if (typeof data === 'string') data = new Buffer(data, enc) + + this._hash.update(data) + return this +} + +Sign.prototype.sign = function signMethod (key, enc) { + this.end() + var hash = this._hash.digest() + var sig = sign(hash, key, this._hashType, this._signType, this._tag) + + return enc ? sig.toString(enc) : sig +} + +function Verify (algorithm) { + stream.Writable.call(this) + + var data = algorithms[algorithm] + if (!data) throw new Error('Unknown message digest') + + this._hash = createHash(data.hash) + this._tag = data.id + this._signType = data.sign +} +inherits(Verify, stream.Writable) + +Verify.prototype._write = function _write (data, _, done) { + this._hash.update(data) + done() +} + +Verify.prototype.update = function update (data, enc) { + if (typeof data === 'string') data = new Buffer(data, enc) + + this._hash.update(data) + return this +} + +Verify.prototype.verify = function verifyMethod (key, sig, enc) { + if (typeof sig === 'string') sig = new Buffer(sig, enc) + + this.end() + var hash = this._hash.digest() + return verify(sig, hash, key, this._signType, this._tag) +} + +function createSign (algorithm) { + return new Sign(algorithm) +} + +function createVerify (algorithm) { + return new Verify(algorithm) +} + +module.exports = { + Sign: createSign, + Verify: createVerify, + createSign: createSign, + createVerify: createVerify +} + +}).call(this,require("buffer").Buffer) +},{"./algorithms.json":89,"./sign":92,"./verify":93,"buffer":47,"create-hash":140,"inherits":318,"stream":272}],92:[function(require,module,exports){ +(function (Buffer){ +// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js +var createHmac = require('create-hmac') +var crt = require('browserify-rsa') +var EC = require('elliptic').ec +var BN = require('bn.js') +var parseKeys = require('parse-asn1') +var curves = require('./curves.json') + +function sign (hash, key, hashType, signType, tag) { + var priv = parseKeys(key) + if (priv.curve) { + // rsa keys can be interpreted as ecdsa ones in openssl + if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type') + return ecSign(hash, priv) + } else if (priv.type === 'dsa') { + if (signType !== 'dsa') throw new Error('wrong private key type') + return dsaSign(hash, priv, hashType) + } else { + if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type') + } + hash = Buffer.concat([tag, hash]) + var len = priv.modulus.byteLength() + var pad = [ 0, 1 ] + while (hash.length + pad.length + 1 < len) pad.push(0xff) + pad.push(0x00) + var i = -1 + while (++i < hash.length) pad.push(hash[i]) + + var out = crt(pad, priv) + return out +} + +function ecSign (hash, priv) { + var curveId = curves[priv.curve.join('.')] + if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.')) + + var curve = new EC(curveId) + var key = curve.keyFromPrivate(priv.privateKey) + var out = key.sign(hash) + + return new Buffer(out.toDER()) +} + +function dsaSign (hash, priv, algo) { + var x = priv.params.priv_key + var p = priv.params.p + var q = priv.params.q + var g = priv.params.g + var r = new BN(0) + var k + var H = bits2int(hash, q).mod(q) + var s = false + var kv = getKey(x, q, hash, algo) + while (s === false) { + k = makeKey(q, kv, algo) + r = makeR(g, k, p, q) + s = k.invm(q).imul(H.add(x.mul(r))).mod(q) + if (s.cmpn(0) === 0) { + s = false + r = new BN(0) + } + } + return toDER(r, s) +} + +function toDER (r, s) { + r = r.toArray() + s = s.toArray() + + // Pad values + if (r[0] & 0x80) r = [ 0 ].concat(r) + if (s[0] & 0x80) s = [ 0 ].concat(s) + + var total = r.length + s.length + 4 + var res = [ 0x30, total, 0x02, r.length ] + res = res.concat(r, [ 0x02, s.length ], s) + return new Buffer(res) +} + +function getKey (x, q, hash, algo) { + x = new Buffer(x.toArray()) + if (x.length < q.byteLength()) { + var zeros = new Buffer(q.byteLength() - x.length) + zeros.fill(0) + x = Buffer.concat([ zeros, x ]) + } + var hlen = hash.length + var hbits = bits2octets(hash, q) + var v = new Buffer(hlen) + v.fill(1) + var k = new Buffer(hlen) + k.fill(0) + k = createHmac(algo, k).update(v).update(new Buffer([ 0 ])).update(x).update(hbits).digest() + v = createHmac(algo, k).update(v).digest() + k = createHmac(algo, k).update(v).update(new Buffer([ 1 ])).update(x).update(hbits).digest() + v = createHmac(algo, k).update(v).digest() + return { k: k, v: v } +} + +function bits2int (obits, q) { + var bits = new BN(obits) + var shift = (obits.length << 3) - q.bitLength() + if (shift > 0) bits.ishrn(shift) + return bits +} + +function bits2octets (bits, q) { + bits = bits2int(bits, q) + bits = bits.mod(q) + var out = new Buffer(bits.toArray()) + if (out.length < q.byteLength()) { + var zeros = new Buffer(q.byteLength() - out.length) + zeros.fill(0) + out = Buffer.concat([ zeros, out ]) + } + return out +} + +function makeKey (q, kv, algo) { + var t + var k + + do { + t = new Buffer(0) + + while (t.length * 8 < q.bitLength()) { + kv.v = createHmac(algo, kv.k).update(kv.v).digest() + t = Buffer.concat([ t, kv.v ]) + } + + k = bits2int(t, q) + kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([ 0 ])).digest() + kv.v = createHmac(algo, kv.k).update(kv.v).digest() + } while (k.cmp(q) !== -1) + + return k +} + +function makeR (g, k, p, q) { + return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q) +} + +module.exports = sign +module.exports.getKey = getKey +module.exports.makeKey = makeKey + +}).call(this,require("buffer").Buffer) +},{"./curves.json":90,"bn.js":280,"browserify-rsa":94,"buffer":47,"create-hmac":156,"elliptic":285,"parse-asn1":99}],93:[function(require,module,exports){ +(function (Buffer){ +// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js +var BN = require('bn.js') +var EC = require('elliptic').ec +var parseKeys = require('parse-asn1') +var curves = require('./curves.json') + +function verify (sig, hash, key, signType, tag) { + var pub = parseKeys(key) + if (pub.type === 'ec') { + // rsa keys can be interpreted as ecdsa ones in openssl + if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type') + return ecVerify(sig, hash, pub) + } else if (pub.type === 'dsa') { + if (signType !== 'dsa') throw new Error('wrong public key type') + return dsaVerify(sig, hash, pub) + } else { + if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type') + } + hash = Buffer.concat([tag, hash]) + var len = pub.modulus.byteLength() + var pad = [ 1 ] + var padNum = 0 + while (hash.length + pad.length + 2 < len) { + pad.push(0xff) + padNum++ + } + pad.push(0x00) + var i = -1 + while (++i < hash.length) { + pad.push(hash[i]) + } + pad = new Buffer(pad) + var red = BN.mont(pub.modulus) + sig = new BN(sig).toRed(red) + + sig = sig.redPow(new BN(pub.publicExponent)) + sig = new Buffer(sig.fromRed().toArray()) + var out = padNum < 8 ? 1 : 0 + len = Math.min(sig.length, pad.length) + if (sig.length !== pad.length) out = 1 + + i = -1 + while (++i < len) out |= sig[i] ^ pad[i] + return out === 0 +} + +function ecVerify (sig, hash, pub) { + var curveId = curves[pub.data.algorithm.curve.join('.')] + if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')) + + var curve = new EC(curveId) + var pubkey = pub.data.subjectPrivateKey.data + + return curve.verify(hash, sig, pubkey) +} + +function dsaVerify (sig, hash, pub) { + var p = pub.data.p + var q = pub.data.q + var g = pub.data.g + var y = pub.data.pub_key + var unpacked = parseKeys.signature.decode(sig, 'der') + var s = unpacked.s + var r = unpacked.r + checkValue(s, q) + checkValue(r, q) + var montp = BN.mont(p) + var w = s.invm(q) + var v = g.toRed(montp) + .redPow(new BN(hash).mul(w).mod(q)) + .fromRed() + .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()) + .mod(p) + .mod(q) + return v.cmp(r) === 0 +} + +function checkValue (b, q) { + if (b.cmpn(0) <= 0) throw new Error('invalid sig') + if (b.cmp(q) >= q) throw new Error('invalid sig') +} + +module.exports = verify + +}).call(this,require("buffer").Buffer) +},{"./curves.json":90,"bn.js":280,"buffer":47,"elliptic":285,"parse-asn1":99}],94:[function(require,module,exports){ +(function (Buffer){ +var bn = require('bn.js'); +var randomBytes = require('randombytes'); +module.exports = crt; +function blind(priv) { + var r = getr(priv); + var blinder = r.toRed(bn.mont(priv.modulus)) + .redPow(new bn(priv.publicExponent)).fromRed(); + return { + blinder: blinder, + unblinder:r.invm(priv.modulus) + }; +} +function crt(msg, priv) { + var blinds = blind(priv); + var len = priv.modulus.byteLength(); + var mod = bn.mont(priv.modulus); + var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus); + var c1 = blinded.toRed(bn.mont(priv.prime1)); + var c2 = blinded.toRed(bn.mont(priv.prime2)); + var qinv = priv.coefficient; + var p = priv.prime1; + var q = priv.prime2; + var m1 = c1.redPow(priv.exponent1); + var m2 = c2.redPow(priv.exponent2); + m1 = m1.fromRed(); + m2 = m2.fromRed(); + var h = m1.isub(m2).imul(qinv).umod(p); + h.imul(q); + m2.iadd(h); + return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len)); +} +crt.getr = getr; +function getr(priv) { + var len = priv.modulus.byteLength(); + var r = new bn(randomBytes(len)); + while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) { + r = new bn(randomBytes(len)); + } + return r; +} + +}).call(this,require("buffer").Buffer) +},{"bn.js":280,"buffer":47,"randombytes":243}],95:[function(require,module,exports){ +module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", +"2.16.840.1.101.3.4.1.2": "aes-128-cbc", +"2.16.840.1.101.3.4.1.3": "aes-128-ofb", +"2.16.840.1.101.3.4.1.4": "aes-128-cfb", +"2.16.840.1.101.3.4.1.21": "aes-192-ecb", +"2.16.840.1.101.3.4.1.22": "aes-192-cbc", +"2.16.840.1.101.3.4.1.23": "aes-192-ofb", +"2.16.840.1.101.3.4.1.24": "aes-192-cfb", +"2.16.840.1.101.3.4.1.41": "aes-256-ecb", +"2.16.840.1.101.3.4.1.42": "aes-256-cbc", +"2.16.840.1.101.3.4.1.43": "aes-256-ofb", +"2.16.840.1.101.3.4.1.44": "aes-256-cfb" +} +},{}],96:[function(require,module,exports){ +// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js +// Fedor, you are amazing. +'use strict' + +var asn1 = require('asn1.js') + +exports.certificate = require('./certificate') + +var RSAPrivateKey = asn1.define('RSAPrivateKey', function () { + this.seq().obj( + this.key('version').int(), + this.key('modulus').int(), + this.key('publicExponent').int(), + this.key('privateExponent').int(), + this.key('prime1').int(), + this.key('prime2').int(), + this.key('exponent1').int(), + this.key('exponent2').int(), + this.key('coefficient').int() + ) +}) +exports.RSAPrivateKey = RSAPrivateKey + +var RSAPublicKey = asn1.define('RSAPublicKey', function () { + this.seq().obj( + this.key('modulus').int(), + this.key('publicExponent').int() + ) +}) +exports.RSAPublicKey = RSAPublicKey + +var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { + this.seq().obj( + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPublicKey').bitstr() + ) +}) +exports.PublicKey = PublicKey + +var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () { + this.seq().obj( + this.key('algorithm').objid(), + this.key('none').null_().optional(), + this.key('curve').objid().optional(), + this.key('params').seq().obj( + this.key('p').int(), + this.key('q').int(), + this.key('g').int() + ).optional() + ) +}) + +var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () { + this.seq().obj( + this.key('version').int(), + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPrivateKey').octstr() + ) +}) +exports.PrivateKey = PrivateKeyInfo +var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () { + this.seq().obj( + this.key('algorithm').seq().obj( + this.key('id').objid(), + this.key('decrypt').seq().obj( + this.key('kde').seq().obj( + this.key('id').objid(), + this.key('kdeparams').seq().obj( + this.key('salt').octstr(), + this.key('iters').int() + ) + ), + this.key('cipher').seq().obj( + this.key('algo').objid(), + this.key('iv').octstr() + ) + ) + ), + this.key('subjectPrivateKey').octstr() + ) +}) + +exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo + +var DSAPrivateKey = asn1.define('DSAPrivateKey', function () { + this.seq().obj( + this.key('version').int(), + this.key('p').int(), + this.key('q').int(), + this.key('g').int(), + this.key('pub_key').int(), + this.key('priv_key').int() + ) +}) +exports.DSAPrivateKey = DSAPrivateKey + +exports.DSAparam = asn1.define('DSAparam', function () { + this.int() +}) + +var ECPrivateKey = asn1.define('ECPrivateKey', function () { + this.seq().obj( + this.key('version').int(), + this.key('privateKey').octstr(), + this.key('parameters').optional().explicit(0).use(ECParameters), + this.key('publicKey').optional().explicit(1).bitstr() + ) +}) +exports.ECPrivateKey = ECPrivateKey + +var ECParameters = asn1.define('ECParameters', function () { + this.choice({ + namedCurve: this.objid() + }) +}) + +exports.signature = asn1.define('signature', function () { + this.seq().obj( + this.key('r').int(), + this.key('s').int() + ) +}) + +},{"./certificate":97,"asn1.js":100}],97:[function(require,module,exports){ +// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js +// thanks to @Rantanen + +'use strict' + +var asn = require('asn1.js') + +var Time = asn.define('Time', function () { + this.choice({ + utcTime: this.utctime(), + generalTime: this.gentime() + }) +}) + +var AttributeTypeValue = asn.define('AttributeTypeValue', function () { + this.seq().obj( + this.key('type').objid(), + this.key('value').any() + ) +}) + +var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () { + this.seq().obj( + this.key('algorithm').objid(), + this.key('parameters').optional() + ) +}) + +var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () { + this.seq().obj( + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPublicKey').bitstr() + ) +}) + +var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () { + this.setof(AttributeTypeValue) +}) + +var RDNSequence = asn.define('RDNSequence', function () { + this.seqof(RelativeDistinguishedName) +}) + +var Name = asn.define('Name', function () { + this.choice({ + rdnSequence: this.use(RDNSequence) + }) +}) + +var Validity = asn.define('Validity', function () { + this.seq().obj( + this.key('notBefore').use(Time), + this.key('notAfter').use(Time) + ) +}) + +var Extension = asn.define('Extension', function () { + this.seq().obj( + this.key('extnID').objid(), + this.key('critical').bool().def(false), + this.key('extnValue').octstr() + ) +}) + +var TBSCertificate = asn.define('TBSCertificate', function () { + this.seq().obj( + this.key('version').explicit(0).int(), + this.key('serialNumber').int(), + this.key('signature').use(AlgorithmIdentifier), + this.key('issuer').use(Name), + this.key('validity').use(Validity), + this.key('subject').use(Name), + this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo), + this.key('issuerUniqueID').implicit(1).bitstr().optional(), + this.key('subjectUniqueID').implicit(2).bitstr().optional(), + this.key('extensions').explicit(3).seqof(Extension).optional() + ) +}) + +var X509Certificate = asn.define('X509Certificate', function () { + this.seq().obj( + this.key('tbsCertificate').use(TBSCertificate), + this.key('signatureAlgorithm').use(AlgorithmIdentifier), + this.key('signatureValue').bitstr() + ) +}) + +module.exports = X509Certificate + +},{"asn1.js":100}],98:[function(require,module,exports){ +(function (Buffer){ +// adapted from https://github.com/apatil/pemstrip +var findProc = /Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m +var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m +var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m +var evp = require('evp_bytestokey') +var ciphers = require('browserify-aes') +module.exports = function (okey, password) { + var key = okey.toString() + var match = key.match(findProc) + var decrypted + if (!match) { + var match2 = key.match(fullRegex) + decrypted = new Buffer(match2[2].replace(/\r?\n/g, ''), 'base64') + } else { + var suite = 'aes' + match[1] + var iv = new Buffer(match[2], 'hex') + var cipherText = new Buffer(match[3].replace(/\r?\n/g, ''), 'base64') + var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key + var out = [] + var cipher = ciphers.createDecipheriv(suite, cipherKey, iv) + out.push(cipher.update(cipherText)) + out.push(cipher.final()) + decrypted = Buffer.concat(out) + } + var tag = key.match(startRegex)[1] + return { + tag: tag, + data: decrypted + } +} + +}).call(this,require("buffer").Buffer) +},{"browserify-aes":117,"buffer":47,"evp_bytestokey":135}],99:[function(require,module,exports){ +(function (Buffer){ +var asn1 = require('./asn1') +var aesid = require('./aesid.json') +var fixProc = require('./fixProc') +var ciphers = require('browserify-aes') +var compat = require('pbkdf2') +module.exports = parseKeys + +function parseKeys (buffer) { + var password + if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { + password = buffer.passphrase + buffer = buffer.key + } + if (typeof buffer === 'string') { + buffer = new Buffer(buffer) + } + + var stripped = fixProc(buffer, password) + + var type = stripped.tag + var data = stripped.data + var subtype, ndata + switch (type) { + case 'CERTIFICATE': + ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo + // falls through + case 'PUBLIC KEY': + if (!ndata) { + ndata = asn1.PublicKey.decode(data, 'der') + } + subtype = ndata.algorithm.algorithm.join('.') + switch (subtype) { + case '1.2.840.113549.1.1.1': + return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der') + case '1.2.840.10045.2.1': + ndata.subjectPrivateKey = ndata.subjectPublicKey + return { + type: 'ec', + data: ndata + } + case '1.2.840.10040.4.1': + ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der') + return { + type: 'dsa', + data: ndata.algorithm.params + } + default: throw new Error('unknown key id ' + subtype) + } + throw new Error('unknown key type ' + type) + case 'ENCRYPTED PRIVATE KEY': + data = asn1.EncryptedPrivateKey.decode(data, 'der') + data = decrypt(data, password) + // falls through + case 'PRIVATE KEY': + ndata = asn1.PrivateKey.decode(data, 'der') + subtype = ndata.algorithm.algorithm.join('.') + switch (subtype) { + case '1.2.840.113549.1.1.1': + return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der') + case '1.2.840.10045.2.1': + return { + curve: ndata.algorithm.curve, + privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey + } + case '1.2.840.10040.4.1': + ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der') + return { + type: 'dsa', + params: ndata.algorithm.params + } + default: throw new Error('unknown key id ' + subtype) + } + throw new Error('unknown key type ' + type) + case 'RSA PUBLIC KEY': + return asn1.RSAPublicKey.decode(data, 'der') + case 'RSA PRIVATE KEY': + return asn1.RSAPrivateKey.decode(data, 'der') + case 'DSA PRIVATE KEY': + return { + type: 'dsa', + params: asn1.DSAPrivateKey.decode(data, 'der') + } + case 'EC PRIVATE KEY': + data = asn1.ECPrivateKey.decode(data, 'der') + return { + curve: data.parameters.value, + privateKey: data.privateKey + } + default: throw new Error('unknown key type ' + type) + } +} +parseKeys.signature = asn1.signature +function decrypt (data, password) { + var salt = data.algorithm.decrypt.kde.kdeparams.salt + var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10) + var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')] + var iv = data.algorithm.decrypt.cipher.iv + var cipherText = data.subjectPrivateKey + var keylen = parseInt(algo.split('-')[1], 10) / 8 + var key = compat.pbkdf2Sync(password, salt, iters, keylen) + var cipher = ciphers.createDecipheriv(algo, key, iv) + var out = [] + out.push(cipher.update(cipherText)) + out.push(cipher.final()) + return Buffer.concat(out) +} + +}).call(this,require("buffer").Buffer) +},{"./aesid.json":95,"./asn1":96,"./fixProc":98,"browserify-aes":117,"buffer":47,"pbkdf2":176}],100:[function(require,module,exports){ +var asn1 = exports; + +asn1.bignum = require('bn.js'); + +asn1.define = require('./asn1/api').define; +asn1.base = require('./asn1/base'); +asn1.constants = require('./asn1/constants'); +asn1.decoders = require('./asn1/decoders'); +asn1.encoders = require('./asn1/encoders'); + +},{"./asn1/api":101,"./asn1/base":103,"./asn1/constants":107,"./asn1/decoders":109,"./asn1/encoders":112,"bn.js":280}],101:[function(require,module,exports){ +var asn1 = require('../asn1'); +var inherits = require('inherits'); + +var api = exports; + +api.define = function define(name, body) { + return new Entity(name, body); +}; + +function Entity(name, body) { + this.name = name; + this.body = body; + + this.decoders = {}; + this.encoders = {}; +}; + +Entity.prototype._createNamed = function createNamed(base) { + var named; + try { + named = require('vm').runInThisContext( + '(function ' + this.name + '(entity) {\n' + + ' this._initNamed(entity);\n' + + '})' + ); + } catch (e) { + named = function (entity) { + this._initNamed(entity); + }; + } + inherits(named, base); + named.prototype._initNamed = function initnamed(entity) { + base.call(this, entity); + }; + + return new named(this); +}; + +Entity.prototype._getDecoder = function _getDecoder(enc) { + enc = enc || 'der'; + // Lazily create decoder + if (!this.decoders.hasOwnProperty(enc)) + this.decoders[enc] = this._createNamed(asn1.decoders[enc]); + return this.decoders[enc]; +}; + +Entity.prototype.decode = function decode(data, enc, options) { + return this._getDecoder(enc).decode(data, options); +}; + +Entity.prototype._getEncoder = function _getEncoder(enc) { + enc = enc || 'der'; + // Lazily create encoder + if (!this.encoders.hasOwnProperty(enc)) + this.encoders[enc] = this._createNamed(asn1.encoders[enc]); + return this.encoders[enc]; +}; + +Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { + return this._getEncoder(enc).encode(data, reporter); +}; + +},{"../asn1":100,"inherits":318,"vm":278}],102:[function(require,module,exports){ +var inherits = require('inherits'); +var Reporter = require('../base').Reporter; +var Buffer = require('buffer').Buffer; + +function DecoderBuffer(base, options) { + Reporter.call(this, options); + if (!Buffer.isBuffer(base)) { + this.error('Input not Buffer'); + return; + } + + this.base = base; + this.offset = 0; + this.length = base.length; +} +inherits(DecoderBuffer, Reporter); +exports.DecoderBuffer = DecoderBuffer; + +DecoderBuffer.prototype.save = function save() { + return { offset: this.offset, reporter: Reporter.prototype.save.call(this) }; +}; + +DecoderBuffer.prototype.restore = function restore(save) { + // Return skipped data + var res = new DecoderBuffer(this.base); + res.offset = save.offset; + res.length = this.offset; + + this.offset = save.offset; + Reporter.prototype.restore.call(this, save.reporter); + + return res; +}; + +DecoderBuffer.prototype.isEmpty = function isEmpty() { + return this.offset === this.length; +}; + +DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) { + if (this.offset + 1 <= this.length) + return this.base.readUInt8(this.offset++, true); + else + return this.error(fail || 'DecoderBuffer overrun'); +} + +DecoderBuffer.prototype.skip = function skip(bytes, fail) { + if (!(this.offset + bytes <= this.length)) + return this.error(fail || 'DecoderBuffer overrun'); + + var res = new DecoderBuffer(this.base); + + // Share reporter state + res._reporterState = this._reporterState; + + res.offset = this.offset; + res.length = this.offset + bytes; + this.offset += bytes; + return res; +} + +DecoderBuffer.prototype.raw = function raw(save) { + return this.base.slice(save ? save.offset : this.offset, this.length); +} + +function EncoderBuffer(value, reporter) { + if (Array.isArray(value)) { + this.length = 0; + this.value = value.map(function(item) { + if (!(item instanceof EncoderBuffer)) + item = new EncoderBuffer(item, reporter); + this.length += item.length; + return item; + }, this); + } else if (typeof value === 'number') { + if (!(0 <= value && value <= 0xff)) + return reporter.error('non-byte EncoderBuffer value'); + this.value = value; + this.length = 1; + } else if (typeof value === 'string') { + this.value = value; + this.length = Buffer.byteLength(value); + } else if (Buffer.isBuffer(value)) { + this.value = value; + this.length = value.length; + } else { + return reporter.error('Unsupported type: ' + typeof value); + } +} +exports.EncoderBuffer = EncoderBuffer; + +EncoderBuffer.prototype.join = function join(out, offset) { + if (!out) + out = new Buffer(this.length); + if (!offset) + offset = 0; + + if (this.length === 0) + return out; + + if (Array.isArray(this.value)) { + this.value.forEach(function(item) { + item.join(out, offset); + offset += item.length; + }); + } else { + if (typeof this.value === 'number') + out[offset] = this.value; + else if (typeof this.value === 'string') + out.write(this.value, offset); + else if (Buffer.isBuffer(this.value)) + this.value.copy(out, offset); + offset += this.length; + } + + return out; +}; + +},{"../base":103,"buffer":47,"inherits":318}],103:[function(require,module,exports){ +var base = exports; + +base.Reporter = require('./reporter').Reporter; +base.DecoderBuffer = require('./buffer').DecoderBuffer; +base.EncoderBuffer = require('./buffer').EncoderBuffer; +base.Node = require('./node'); + +},{"./buffer":102,"./node":104,"./reporter":105}],104:[function(require,module,exports){ +var Reporter = require('../base').Reporter; +var EncoderBuffer = require('../base').EncoderBuffer; +var DecoderBuffer = require('../base').DecoderBuffer; +var assert = require('minimalistic-assert'); + +// Supported tags +var tags = [ + 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', + 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', + 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', + 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr' +]; + +// Public methods list +var methods = [ + 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', + 'any', 'contains' +].concat(tags); + +// Overrided methods list +var overrided = [ + '_peekTag', '_decodeTag', '_use', + '_decodeStr', '_decodeObjid', '_decodeTime', + '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', + + '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', + '_encodeNull', '_encodeInt', '_encodeBool' +]; + +function Node(enc, parent) { + var state = {}; + this._baseState = state; + + state.enc = enc; + + state.parent = parent || null; + state.children = null; + + // State + state.tag = null; + state.args = null; + state.reverseArgs = null; + state.choice = null; + state.optional = false; + state.any = false; + state.obj = false; + state.use = null; + state.useDecoder = null; + state.key = null; + state['default'] = null; + state.explicit = null; + state.implicit = null; + state.contains = null; + + // Should create new instance on each method + if (!state.parent) { + state.children = []; + this._wrap(); + } +} +module.exports = Node; + +var stateProps = [ + 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', + 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', + 'implicit', 'contains' +]; + +Node.prototype.clone = function clone() { + var state = this._baseState; + var cstate = {}; + stateProps.forEach(function(prop) { + cstate[prop] = state[prop]; + }); + var res = new this.constructor(cstate.parent); + res._baseState = cstate; + return res; +}; + +Node.prototype._wrap = function wrap() { + var state = this._baseState; + methods.forEach(function(method) { + this[method] = function _wrappedMethod() { + var clone = new this.constructor(this); + state.children.push(clone); + return clone[method].apply(clone, arguments); + }; + }, this); +}; + +Node.prototype._init = function init(body) { + var state = this._baseState; + + assert(state.parent === null); + body.call(this); + + // Filter children + state.children = state.children.filter(function(child) { + return child._baseState.parent === this; + }, this); + assert.equal(state.children.length, 1, 'Root node can have only one child'); +}; + +Node.prototype._useArgs = function useArgs(args) { + var state = this._baseState; + + // Filter children and args + var children = args.filter(function(arg) { + return arg instanceof this.constructor; + }, this); + args = args.filter(function(arg) { + return !(arg instanceof this.constructor); + }, this); + + if (children.length !== 0) { + assert(state.children === null); + state.children = children; + + // Replace parent to maintain backward link + children.forEach(function(child) { + child._baseState.parent = this; + }, this); + } + if (args.length !== 0) { + assert(state.args === null); + state.args = args; + state.reverseArgs = args.map(function(arg) { + if (typeof arg !== 'object' || arg.constructor !== Object) + return arg; + + var res = {}; + Object.keys(arg).forEach(function(key) { + if (key == (key | 0)) + key |= 0; + var value = arg[key]; + res[value] = key; + }); + return res; + }); + } +}; + +// +// Overrided methods +// + +overrided.forEach(function(method) { + Node.prototype[method] = function _overrided() { + var state = this._baseState; + throw new Error(method + ' not implemented for encoding: ' + state.enc); + }; +}); + +// +// Public methods +// + +tags.forEach(function(tag) { + Node.prototype[tag] = function _tagMethod() { + var state = this._baseState; + var args = Array.prototype.slice.call(arguments); + + assert(state.tag === null); + state.tag = tag; + + this._useArgs(args); + + return this; + }; +}); + +Node.prototype.use = function use(item) { + assert(item); + var state = this._baseState; + + assert(state.use === null); + state.use = item; + + return this; +}; + +Node.prototype.optional = function optional() { + var state = this._baseState; + + state.optional = true; + + return this; +}; + +Node.prototype.def = function def(val) { + var state = this._baseState; + + assert(state['default'] === null); + state['default'] = val; + state.optional = true; + + return this; +}; + +Node.prototype.explicit = function explicit(num) { + var state = this._baseState; + + assert(state.explicit === null && state.implicit === null); + state.explicit = num; + + return this; +}; + +Node.prototype.implicit = function implicit(num) { + var state = this._baseState; + + assert(state.explicit === null && state.implicit === null); + state.implicit = num; + + return this; +}; + +Node.prototype.obj = function obj() { + var state = this._baseState; + var args = Array.prototype.slice.call(arguments); + + state.obj = true; + + if (args.length !== 0) + this._useArgs(args); + + return this; +}; + +Node.prototype.key = function key(newKey) { + var state = this._baseState; + + assert(state.key === null); + state.key = newKey; + + return this; +}; + +Node.prototype.any = function any() { + var state = this._baseState; + + state.any = true; + + return this; +}; + +Node.prototype.choice = function choice(obj) { + var state = this._baseState; + + assert(state.choice === null); + state.choice = obj; + this._useArgs(Object.keys(obj).map(function(key) { + return obj[key]; + })); + + return this; +}; + +Node.prototype.contains = function contains(item) { + var state = this._baseState; + + assert(state.use === null); + state.contains = item; + + return this; +}; + +// +// Decoding +// + +Node.prototype._decode = function decode(input, options) { + var state = this._baseState; + + // Decode root node + if (state.parent === null) + return input.wrapResult(state.children[0]._decode(input, options)); + + var result = state['default']; + var present = true; + + var prevKey = null; + if (state.key !== null) + prevKey = input.enterKey(state.key); + + // Check if tag is there + if (state.optional) { + var tag = null; + if (state.explicit !== null) + tag = state.explicit; + else if (state.implicit !== null) + tag = state.implicit; + else if (state.tag !== null) + tag = state.tag; + + if (tag === null && !state.any) { + // Trial and Error + var save = input.save(); + try { + if (state.choice === null) + this._decodeGeneric(state.tag, input, options); + else + this._decodeChoice(input, options); + present = true; + } catch (e) { + present = false; + } + input.restore(save); + } else { + present = this._peekTag(input, tag, state.any); + + if (input.isError(present)) + return present; + } + } + + // Push object on stack + var prevObj; + if (state.obj && present) + prevObj = input.enterObject(); + + if (present) { + // Unwrap explicit values + if (state.explicit !== null) { + var explicit = this._decodeTag(input, state.explicit); + if (input.isError(explicit)) + return explicit; + input = explicit; + } + + var start = input.offset; + + // Unwrap implicit and normal values + if (state.use === null && state.choice === null) { + if (state.any) + var save = input.save(); + var body = this._decodeTag( + input, + state.implicit !== null ? state.implicit : state.tag, + state.any + ); + if (input.isError(body)) + return body; + + if (state.any) + result = input.raw(save); + else + input = body; + } + + if (options && options.track && state.tag !== null) + options.track(input.path(), start, input.length, 'tagged'); + + if (options && options.track && state.tag !== null) + options.track(input.path(), input.offset, input.length, 'content'); + + // Select proper method for tag + if (state.any) + result = result; + else if (state.choice === null) + result = this._decodeGeneric(state.tag, input, options); + else + result = this._decodeChoice(input, options); + + if (input.isError(result)) + return result; + + // Decode children + if (!state.any && state.choice === null && state.children !== null) { + state.children.forEach(function decodeChildren(child) { + // NOTE: We are ignoring errors here, to let parser continue with other + // parts of encoded data + child._decode(input, options); + }); + } + + // Decode contained/encoded by schema, only in bit or octet strings + if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) { + var data = new DecoderBuffer(result); + result = this._getUse(state.contains, input._reporterState.obj) + ._decode(data, options); + } + } + + // Pop object + if (state.obj && present) + result = input.leaveObject(prevObj); + + // Set key + if (state.key !== null && (result !== null || present === true)) + input.leaveKey(prevKey, state.key, result); + else if (prevKey !== null) + input.exitKey(prevKey); + + return result; +}; + +Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { + var state = this._baseState; + + if (tag === 'seq' || tag === 'set') + return null; + if (tag === 'seqof' || tag === 'setof') + return this._decodeList(input, tag, state.args[0], options); + else if (/str$/.test(tag)) + return this._decodeStr(input, tag, options); + else if (tag === 'objid' && state.args) + return this._decodeObjid(input, state.args[0], state.args[1], options); + else if (tag === 'objid') + return this._decodeObjid(input, null, null, options); + else if (tag === 'gentime' || tag === 'utctime') + return this._decodeTime(input, tag, options); + else if (tag === 'null_') + return this._decodeNull(input, options); + else if (tag === 'bool') + return this._decodeBool(input, options); + else if (tag === 'objDesc') + return this._decodeStr(input, tag, options); + else if (tag === 'int' || tag === 'enum') + return this._decodeInt(input, state.args && state.args[0], options); + + if (state.use !== null) { + return this._getUse(state.use, input._reporterState.obj) + ._decode(input, options); + } else { + return input.error('unknown tag: ' + tag); + } +}; + +Node.prototype._getUse = function _getUse(entity, obj) { + + var state = this._baseState; + // Create altered use decoder if implicit is set + state.useDecoder = this._use(entity, obj); + assert(state.useDecoder._baseState.parent === null); + state.useDecoder = state.useDecoder._baseState.children[0]; + if (state.implicit !== state.useDecoder._baseState.implicit) { + state.useDecoder = state.useDecoder.clone(); + state.useDecoder._baseState.implicit = state.implicit; + } + return state.useDecoder; +}; + +Node.prototype._decodeChoice = function decodeChoice(input, options) { + var state = this._baseState; + var result = null; + var match = false; + + Object.keys(state.choice).some(function(key) { + var save = input.save(); + var node = state.choice[key]; + try { + var value = node._decode(input, options); + if (input.isError(value)) + return false; + + result = { type: key, value: value }; + match = true; + } catch (e) { + input.restore(save); + return false; + } + return true; + }, this); + + if (!match) + return input.error('Choice not matched'); + + return result; +}; + +// +// Encoding +// + +Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { + return new EncoderBuffer(data, this.reporter); +}; + +Node.prototype._encode = function encode(data, reporter, parent) { + var state = this._baseState; + if (state['default'] !== null && state['default'] === data) + return; + + var result = this._encodeValue(data, reporter, parent); + if (result === undefined) + return; + + if (this._skipDefault(result, reporter, parent)) + return; + + return result; +}; + +Node.prototype._encodeValue = function encode(data, reporter, parent) { + var state = this._baseState; + + // Decode root node + if (state.parent === null) + return state.children[0]._encode(data, reporter || new Reporter()); + + var result = null; + + // Set reporter to share it with a child class + this.reporter = reporter; + + // Check if data is there + if (state.optional && data === undefined) { + if (state['default'] !== null) + data = state['default'] + else + return; + } + + // Encode children first + var content = null; + var primitive = false; + if (state.any) { + // Anything that was given is translated to buffer + result = this._createEncoderBuffer(data); + } else if (state.choice) { + result = this._encodeChoice(data, reporter); + } else if (state.contains) { + content = this._getUse(state.contains, parent)._encode(data, reporter); + primitive = true; + } else if (state.children) { + content = state.children.map(function(child) { + if (child._baseState.tag === 'null_') + return child._encode(null, reporter, data); + + if (child._baseState.key === null) + return reporter.error('Child should have a key'); + var prevKey = reporter.enterKey(child._baseState.key); + + if (typeof data !== 'object') + return reporter.error('Child expected, but input is not object'); + + var res = child._encode(data[child._baseState.key], reporter, data); + reporter.leaveKey(prevKey); + + return res; + }, this).filter(function(child) { + return child; + }); + content = this._createEncoderBuffer(content); + } else { + if (state.tag === 'seqof' || state.tag === 'setof') { + // TODO(indutny): this should be thrown on DSL level + if (!(state.args && state.args.length === 1)) + return reporter.error('Too many args for : ' + state.tag); + + if (!Array.isArray(data)) + return reporter.error('seqof/setof, but data is not Array'); + + var child = this.clone(); + child._baseState.implicit = null; + content = this._createEncoderBuffer(data.map(function(item) { + var state = this._baseState; + + return this._getUse(state.args[0], data)._encode(item, reporter); + }, child)); + } else if (state.use !== null) { + result = this._getUse(state.use, parent)._encode(data, reporter); + } else { + content = this._encodePrimitive(state.tag, data); + primitive = true; + } + } + + // Encode data itself + var result; + if (!state.any && state.choice === null) { + var tag = state.implicit !== null ? state.implicit : state.tag; + var cls = state.implicit === null ? 'universal' : 'context'; + + if (tag === null) { + if (state.use === null) + reporter.error('Tag could be ommited only for .use()'); + } else { + if (state.use === null) + result = this._encodeComposite(tag, primitive, cls, content); + } + } + + // Wrap in explicit + if (state.explicit !== null) + result = this._encodeComposite(state.explicit, false, 'context', result); + + return result; +}; + +Node.prototype._encodeChoice = function encodeChoice(data, reporter) { + var state = this._baseState; + + var node = state.choice[data.type]; + if (!node) { + assert( + false, + data.type + ' not found in ' + + JSON.stringify(Object.keys(state.choice))); + } + return node._encode(data.value, reporter); +}; + +Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { + var state = this._baseState; + + if (/str$/.test(tag)) + return this._encodeStr(data, tag); + else if (tag === 'objid' && state.args) + return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); + else if (tag === 'objid') + return this._encodeObjid(data, null, null); + else if (tag === 'gentime' || tag === 'utctime') + return this._encodeTime(data, tag); + else if (tag === 'null_') + return this._encodeNull(); + else if (tag === 'int' || tag === 'enum') + return this._encodeInt(data, state.args && state.reverseArgs[0]); + else if (tag === 'bool') + return this._encodeBool(data); + else if (tag === 'objDesc') + return this._encodeStr(data, tag); + else + throw new Error('Unsupported tag: ' + tag); +}; + +Node.prototype._isNumstr = function isNumstr(str) { + return /^[0-9 ]*$/.test(str); +}; + +Node.prototype._isPrintstr = function isPrintstr(str) { + return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); +}; + +},{"../base":103,"minimalistic-assert":114}],105:[function(require,module,exports){ +var inherits = require('inherits'); + +function Reporter(options) { + this._reporterState = { + obj: null, + path: [], + options: options || {}, + errors: [] + }; +} +exports.Reporter = Reporter; + +Reporter.prototype.isError = function isError(obj) { + return obj instanceof ReporterError; +}; + +Reporter.prototype.save = function save() { + var state = this._reporterState; + + return { obj: state.obj, pathLen: state.path.length }; +}; + +Reporter.prototype.restore = function restore(data) { + var state = this._reporterState; + + state.obj = data.obj; + state.path = state.path.slice(0, data.pathLen); +}; + +Reporter.prototype.enterKey = function enterKey(key) { + return this._reporterState.path.push(key); +}; + +Reporter.prototype.exitKey = function exitKey(index) { + var state = this._reporterState; + + state.path = state.path.slice(0, index - 1); +}; + +Reporter.prototype.leaveKey = function leaveKey(index, key, value) { + var state = this._reporterState; + + this.exitKey(index); + if (state.obj !== null) + state.obj[key] = value; +}; + +Reporter.prototype.path = function path() { + return this._reporterState.path.join('/'); +}; + +Reporter.prototype.enterObject = function enterObject() { + var state = this._reporterState; + + var prev = state.obj; + state.obj = {}; + return prev; +}; + +Reporter.prototype.leaveObject = function leaveObject(prev) { + var state = this._reporterState; + + var now = state.obj; + state.obj = prev; + return now; +}; + +Reporter.prototype.error = function error(msg) { + var err; + var state = this._reporterState; + + var inherited = msg instanceof ReporterError; + if (inherited) { + err = msg; + } else { + err = new ReporterError(state.path.map(function(elem) { + return '[' + JSON.stringify(elem) + ']'; + }).join(''), msg.message || msg, msg.stack); + } + + if (!state.options.partial) + throw err; + + if (!inherited) + state.errors.push(err); + + return err; +}; + +Reporter.prototype.wrapResult = function wrapResult(result) { + var state = this._reporterState; + if (!state.options.partial) + return result; + + return { + result: this.isError(result) ? null : result, + errors: state.errors + }; +}; + +function ReporterError(path, msg) { + this.path = path; + this.rethrow(msg); +}; +inherits(ReporterError, Error); + +ReporterError.prototype.rethrow = function rethrow(msg) { + this.message = msg + ' at: ' + (this.path || '(shallow)'); + if (Error.captureStackTrace) + Error.captureStackTrace(this, ReporterError); + + if (!this.stack) { + try { + // IE only adds stack when thrown + throw new Error(this.message); + } catch (e) { + this.stack = e.stack; + } + } + return this; +}; + +},{"inherits":318}],106:[function(require,module,exports){ +var constants = require('../constants'); + +exports.tagClass = { + 0: 'universal', + 1: 'application', + 2: 'context', + 3: 'private' +}; +exports.tagClassByName = constants._reverse(exports.tagClass); + +exports.tag = { + 0x00: 'end', + 0x01: 'bool', + 0x02: 'int', + 0x03: 'bitstr', + 0x04: 'octstr', + 0x05: 'null_', + 0x06: 'objid', + 0x07: 'objDesc', + 0x08: 'external', + 0x09: 'real', + 0x0a: 'enum', + 0x0b: 'embed', + 0x0c: 'utf8str', + 0x0d: 'relativeOid', + 0x10: 'seq', + 0x11: 'set', + 0x12: 'numstr', + 0x13: 'printstr', + 0x14: 't61str', + 0x15: 'videostr', + 0x16: 'ia5str', + 0x17: 'utctime', + 0x18: 'gentime', + 0x19: 'graphstr', + 0x1a: 'iso646str', + 0x1b: 'genstr', + 0x1c: 'unistr', + 0x1d: 'charstr', + 0x1e: 'bmpstr' +}; +exports.tagByName = constants._reverse(exports.tag); + +},{"../constants":107}],107:[function(require,module,exports){ +var constants = exports; + +// Helper +constants._reverse = function reverse(map) { + var res = {}; + + Object.keys(map).forEach(function(key) { + // Convert key to integer if it is stringified + if ((key | 0) == key) + key = key | 0; + + var value = map[key]; + res[value] = key; + }); + + return res; +}; + +constants.der = require('./der'); + +},{"./der":106}],108:[function(require,module,exports){ +var inherits = require('inherits'); + +var asn1 = require('../../asn1'); +var base = asn1.base; +var bignum = asn1.bignum; + +// Import DER constants +var der = asn1.constants.der; + +function DERDecoder(entity) { + this.enc = 'der'; + this.name = entity.name; + this.entity = entity; + + // Construct base tree + this.tree = new DERNode(); + this.tree._init(entity.body); +}; +module.exports = DERDecoder; + +DERDecoder.prototype.decode = function decode(data, options) { + if (!(data instanceof base.DecoderBuffer)) + data = new base.DecoderBuffer(data, options); + + return this.tree._decode(data, options); +}; + +// Tree methods + +function DERNode(parent) { + base.Node.call(this, 'der', parent); +} +inherits(DERNode, base.Node); + +DERNode.prototype._peekTag = function peekTag(buffer, tag, any) { + if (buffer.isEmpty()) + return false; + + var state = buffer.save(); + var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"'); + if (buffer.isError(decodedTag)) + return decodedTag; + + buffer.restore(state); + + return decodedTag.tag === tag || decodedTag.tagStr === tag || + (decodedTag.tagStr + 'of') === tag || any; +}; + +DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) { + var decodedTag = derDecodeTag(buffer, + 'Failed to decode tag of "' + tag + '"'); + if (buffer.isError(decodedTag)) + return decodedTag; + + var len = derDecodeLen(buffer, + decodedTag.primitive, + 'Failed to get length of "' + tag + '"'); + + // Failure + if (buffer.isError(len)) + return len; + + if (!any && + decodedTag.tag !== tag && + decodedTag.tagStr !== tag && + decodedTag.tagStr + 'of' !== tag) { + return buffer.error('Failed to match tag: "' + tag + '"'); + } + + if (decodedTag.primitive || len !== null) + return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); + + // Indefinite length... find END tag + var state = buffer.save(); + var res = this._skipUntilEnd( + buffer, + 'Failed to skip indefinite length body: "' + this.tag + '"'); + if (buffer.isError(res)) + return res; + + len = buffer.offset - state.offset; + buffer.restore(state); + return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); +}; + +DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) { + while (true) { + var tag = derDecodeTag(buffer, fail); + if (buffer.isError(tag)) + return tag; + var len = derDecodeLen(buffer, tag.primitive, fail); + if (buffer.isError(len)) + return len; + + var res; + if (tag.primitive || len !== null) + res = buffer.skip(len) + else + res = this._skipUntilEnd(buffer, fail); + + // Failure + if (buffer.isError(res)) + return res; + + if (tag.tagStr === 'end') + break; + } +}; + +DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, + options) { + var result = []; + while (!buffer.isEmpty()) { + var possibleEnd = this._peekTag(buffer, 'end'); + if (buffer.isError(possibleEnd)) + return possibleEnd; + + var res = decoder.decode(buffer, 'der', options); + if (buffer.isError(res) && possibleEnd) + break; + result.push(res); + } + return result; +}; + +DERNode.prototype._decodeStr = function decodeStr(buffer, tag) { + if (tag === 'bitstr') { + var unused = buffer.readUInt8(); + if (buffer.isError(unused)) + return unused; + return { unused: unused, data: buffer.raw() }; + } else if (tag === 'bmpstr') { + var raw = buffer.raw(); + if (raw.length % 2 === 1) + return buffer.error('Decoding of string type: bmpstr length mismatch'); + + var str = ''; + for (var i = 0; i < raw.length / 2; i++) { + str += String.fromCharCode(raw.readUInt16BE(i * 2)); + } + return str; + } else if (tag === 'numstr') { + var numstr = buffer.raw().toString('ascii'); + if (!this._isNumstr(numstr)) { + return buffer.error('Decoding of string type: ' + + 'numstr unsupported characters'); + } + return numstr; + } else if (tag === 'octstr') { + return buffer.raw(); + } else if (tag === 'objDesc') { + return buffer.raw(); + } else if (tag === 'printstr') { + var printstr = buffer.raw().toString('ascii'); + if (!this._isPrintstr(printstr)) { + return buffer.error('Decoding of string type: ' + + 'printstr unsupported characters'); + } + return printstr; + } else if (/str$/.test(tag)) { + return buffer.raw().toString(); + } else { + return buffer.error('Decoding of string type: ' + tag + ' unsupported'); + } +}; + +DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) { + var result; + var identifiers = []; + var ident = 0; + while (!buffer.isEmpty()) { + var subident = buffer.readUInt8(); + ident <<= 7; + ident |= subident & 0x7f; + if ((subident & 0x80) === 0) { + identifiers.push(ident); + ident = 0; + } + } + if (subident & 0x80) + identifiers.push(ident); + + var first = (identifiers[0] / 40) | 0; + var second = identifiers[0] % 40; + + if (relative) + result = identifiers; + else + result = [first, second].concat(identifiers.slice(1)); + + if (values) { + var tmp = values[result.join(' ')]; + if (tmp === undefined) + tmp = values[result.join('.')]; + if (tmp !== undefined) + result = tmp; + } + + return result; +}; + +DERNode.prototype._decodeTime = function decodeTime(buffer, tag) { + var str = buffer.raw().toString(); + if (tag === 'gentime') { + var year = str.slice(0, 4) | 0; + var mon = str.slice(4, 6) | 0; + var day = str.slice(6, 8) | 0; + var hour = str.slice(8, 10) | 0; + var min = str.slice(10, 12) | 0; + var sec = str.slice(12, 14) | 0; + } else if (tag === 'utctime') { + var year = str.slice(0, 2) | 0; + var mon = str.slice(2, 4) | 0; + var day = str.slice(4, 6) | 0; + var hour = str.slice(6, 8) | 0; + var min = str.slice(8, 10) | 0; + var sec = str.slice(10, 12) | 0; + if (year < 70) + year = 2000 + year; + else + year = 1900 + year; + } else { + return buffer.error('Decoding ' + tag + ' time is not supported yet'); + } + + return Date.UTC(year, mon - 1, day, hour, min, sec, 0); +}; + +DERNode.prototype._decodeNull = function decodeNull(buffer) { + return null; +}; + +DERNode.prototype._decodeBool = function decodeBool(buffer) { + var res = buffer.readUInt8(); + if (buffer.isError(res)) + return res; + else + return res !== 0; +}; + +DERNode.prototype._decodeInt = function decodeInt(buffer, values) { + // Bigint, return as it is (assume big endian) + var raw = buffer.raw(); + var res = new bignum(raw); + + if (values) + res = values[res.toString(10)] || res; + + return res; +}; + +DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === 'function') + entity = entity(obj); + return entity._getDecoder('der').tree; +}; + +// Utility methods + +function derDecodeTag(buf, fail) { + var tag = buf.readUInt8(fail); + if (buf.isError(tag)) + return tag; + + var cls = der.tagClass[tag >> 6]; + var primitive = (tag & 0x20) === 0; + + // Multi-octet tag - load + if ((tag & 0x1f) === 0x1f) { + var oct = tag; + tag = 0; + while ((oct & 0x80) === 0x80) { + oct = buf.readUInt8(fail); + if (buf.isError(oct)) + return oct; + + tag <<= 7; + tag |= oct & 0x7f; + } + } else { + tag &= 0x1f; + } + var tagStr = der.tag[tag]; + + return { + cls: cls, + primitive: primitive, + tag: tag, + tagStr: tagStr + }; +} + +function derDecodeLen(buf, primitive, fail) { + var len = buf.readUInt8(fail); + if (buf.isError(len)) + return len; + + // Indefinite form + if (!primitive && len === 0x80) + return null; + + // Definite form + if ((len & 0x80) === 0) { + // Short form + return len; + } + + // Long form + var num = len & 0x7f; + if (num > 4) + return buf.error('length octect is too long'); + + len = 0; + for (var i = 0; i < num; i++) { + len <<= 8; + var j = buf.readUInt8(fail); + if (buf.isError(j)) + return j; + len |= j; + } + + return len; +} + +},{"../../asn1":100,"inherits":318}],109:[function(require,module,exports){ +var decoders = exports; + +decoders.der = require('./der'); +decoders.pem = require('./pem'); + +},{"./der":108,"./pem":110}],110:[function(require,module,exports){ +var inherits = require('inherits'); +var Buffer = require('buffer').Buffer; + +var DERDecoder = require('./der'); + +function PEMDecoder(entity) { + DERDecoder.call(this, entity); + this.enc = 'pem'; +}; +inherits(PEMDecoder, DERDecoder); +module.exports = PEMDecoder; + +PEMDecoder.prototype.decode = function decode(data, options) { + var lines = data.toString().split(/[\r\n]+/g); + + var label = options.label.toUpperCase(); + + var re = /^-----(BEGIN|END) ([^-]+)-----$/; + var start = -1; + var end = -1; + for (var i = 0; i < lines.length; i++) { + var match = lines[i].match(re); + if (match === null) + continue; + + if (match[2] !== label) + continue; + + if (start === -1) { + if (match[1] !== 'BEGIN') + break; + start = i; + } else { + if (match[1] !== 'END') + break; + end = i; + break; + } + } + if (start === -1 || end === -1) + throw new Error('PEM section not found for: ' + label); + + var base64 = lines.slice(start + 1, end).join(''); + // Remove excessive symbols + base64.replace(/[^a-z0-9\+\/=]+/gi, ''); + + var input = new Buffer(base64, 'base64'); + return DERDecoder.prototype.decode.call(this, input, options); +}; + +},{"./der":108,"buffer":47,"inherits":318}],111:[function(require,module,exports){ +var inherits = require('inherits'); +var Buffer = require('buffer').Buffer; + +var asn1 = require('../../asn1'); +var base = asn1.base; + +// Import DER constants +var der = asn1.constants.der; + +function DEREncoder(entity) { + this.enc = 'der'; + this.name = entity.name; + this.entity = entity; + + // Construct base tree + this.tree = new DERNode(); + this.tree._init(entity.body); +}; +module.exports = DEREncoder; + +DEREncoder.prototype.encode = function encode(data, reporter) { + return this.tree._encode(data, reporter).join(); +}; + +// Tree methods + +function DERNode(parent) { + base.Node.call(this, 'der', parent); +} +inherits(DERNode, base.Node); + +DERNode.prototype._encodeComposite = function encodeComposite(tag, + primitive, + cls, + content) { + var encodedTag = encodeTag(tag, primitive, cls, this.reporter); + + // Short form + if (content.length < 0x80) { + var header = new Buffer(2); + header[0] = encodedTag; + header[1] = content.length; + return this._createEncoderBuffer([ header, content ]); + } + + // Long form + // Count octets required to store length + var lenOctets = 1; + for (var i = content.length; i >= 0x100; i >>= 8) + lenOctets++; + + var header = new Buffer(1 + 1 + lenOctets); + header[0] = encodedTag; + header[1] = 0x80 | lenOctets; + + for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) + header[i] = j & 0xff; + + return this._createEncoderBuffer([ header, content ]); +}; + +DERNode.prototype._encodeStr = function encodeStr(str, tag) { + if (tag === 'bitstr') { + return this._createEncoderBuffer([ str.unused | 0, str.data ]); + } else if (tag === 'bmpstr') { + var buf = new Buffer(str.length * 2); + for (var i = 0; i < str.length; i++) { + buf.writeUInt16BE(str.charCodeAt(i), i * 2); + } + return this._createEncoderBuffer(buf); + } else if (tag === 'numstr') { + if (!this._isNumstr(str)) { + return this.reporter.error('Encoding of string type: numstr supports ' + + 'only digits and space'); + } + return this._createEncoderBuffer(str); + } else if (tag === 'printstr') { + if (!this._isPrintstr(str)) { + return this.reporter.error('Encoding of string type: printstr supports ' + + 'only latin upper and lower case letters, ' + + 'digits, space, apostrophe, left and rigth ' + + 'parenthesis, plus sign, comma, hyphen, ' + + 'dot, slash, colon, equal sign, ' + + 'question mark'); + } + return this._createEncoderBuffer(str); + } else if (/str$/.test(tag)) { + return this._createEncoderBuffer(str); + } else if (tag === 'objDesc') { + return this._createEncoderBuffer(str); + } else { + return this.reporter.error('Encoding of string type: ' + tag + + ' unsupported'); + } +}; + +DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) { + if (typeof id === 'string') { + if (!values) + return this.reporter.error('string objid given, but no values map found'); + if (!values.hasOwnProperty(id)) + return this.reporter.error('objid not found in values map'); + id = values[id].split(/[\s\.]+/g); + for (var i = 0; i < id.length; i++) + id[i] |= 0; + } else if (Array.isArray(id)) { + id = id.slice(); + for (var i = 0; i < id.length; i++) + id[i] |= 0; + } + + if (!Array.isArray(id)) { + return this.reporter.error('objid() should be either array or string, ' + + 'got: ' + JSON.stringify(id)); + } + + if (!relative) { + if (id[1] >= 40) + return this.reporter.error('Second objid identifier OOB'); + id.splice(0, 2, id[0] * 40 + id[1]); + } + + // Count number of octets + var size = 0; + for (var i = 0; i < id.length; i++) { + var ident = id[i]; + for (size++; ident >= 0x80; ident >>= 7) + size++; + } + + var objid = new Buffer(size); + var offset = objid.length - 1; + for (var i = id.length - 1; i >= 0; i--) { + var ident = id[i]; + objid[offset--] = ident & 0x7f; + while ((ident >>= 7) > 0) + objid[offset--] = 0x80 | (ident & 0x7f); + } + + return this._createEncoderBuffer(objid); +}; + +function two(num) { + if (num < 10) + return '0' + num; + else + return num; +} + +DERNode.prototype._encodeTime = function encodeTime(time, tag) { + var str; + var date = new Date(time); + + if (tag === 'gentime') { + str = [ + two(date.getFullYear()), + two(date.getUTCMonth() + 1), + two(date.getUTCDate()), + two(date.getUTCHours()), + two(date.getUTCMinutes()), + two(date.getUTCSeconds()), + 'Z' + ].join(''); + } else if (tag === 'utctime') { + str = [ + two(date.getFullYear() % 100), + two(date.getUTCMonth() + 1), + two(date.getUTCDate()), + two(date.getUTCHours()), + two(date.getUTCMinutes()), + two(date.getUTCSeconds()), + 'Z' + ].join(''); + } else { + this.reporter.error('Encoding ' + tag + ' time is not supported yet'); + } + + return this._encodeStr(str, 'octstr'); +}; + +DERNode.prototype._encodeNull = function encodeNull() { + return this._createEncoderBuffer(''); +}; + +DERNode.prototype._encodeInt = function encodeInt(num, values) { + if (typeof num === 'string') { + if (!values) + return this.reporter.error('String int or enum given, but no values map'); + if (!values.hasOwnProperty(num)) { + return this.reporter.error('Values map doesn\'t contain: ' + + JSON.stringify(num)); + } + num = values[num]; + } + + // Bignum, assume big endian + if (typeof num !== 'number' && !Buffer.isBuffer(num)) { + var numArray = num.toArray(); + if (!num.sign && numArray[0] & 0x80) { + numArray.unshift(0); + } + num = new Buffer(numArray); + } + + if (Buffer.isBuffer(num)) { + var size = num.length; + if (num.length === 0) + size++; + + var out = new Buffer(size); + num.copy(out); + if (num.length === 0) + out[0] = 0 + return this._createEncoderBuffer(out); + } + + if (num < 0x80) + return this._createEncoderBuffer(num); + + if (num < 0x100) + return this._createEncoderBuffer([0, num]); + + var size = 1; + for (var i = num; i >= 0x100; i >>= 8) + size++; + + var out = new Array(size); + for (var i = out.length - 1; i >= 0; i--) { + out[i] = num & 0xff; + num >>= 8; + } + if(out[0] & 0x80) { + out.unshift(0); + } + + return this._createEncoderBuffer(new Buffer(out)); +}; + +DERNode.prototype._encodeBool = function encodeBool(value) { + return this._createEncoderBuffer(value ? 0xff : 0); +}; + +DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === 'function') + entity = entity(obj); + return entity._getEncoder('der').tree; +}; + +DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) { + var state = this._baseState; + var i; + if (state['default'] === null) + return false; + + var data = dataBuffer.join(); + if (state.defaultBuffer === undefined) + state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join(); + + if (data.length !== state.defaultBuffer.length) + return false; + + for (i=0; i < data.length; i++) + if (data[i] !== state.defaultBuffer[i]) + return false; + + return true; +}; + +// Utility methods + +function encodeTag(tag, primitive, cls, reporter) { + var res; + + if (tag === 'seqof') + tag = 'seq'; + else if (tag === 'setof') + tag = 'set'; + + if (der.tagByName.hasOwnProperty(tag)) + res = der.tagByName[tag]; + else if (typeof tag === 'number' && (tag | 0) === tag) + res = tag; + else + return reporter.error('Unknown tag: ' + tag); + + if (res >= 0x1f) + return reporter.error('Multi-octet tag encoding unsupported'); + + if (!primitive) + res |= 0x20; + + res |= (der.tagClassByName[cls || 'universal'] << 6); + + return res; +} + +},{"../../asn1":100,"buffer":47,"inherits":318}],112:[function(require,module,exports){ +var encoders = exports; + +encoders.der = require('./der'); +encoders.pem = require('./pem'); + +},{"./der":111,"./pem":113}],113:[function(require,module,exports){ +var inherits = require('inherits'); + +var DEREncoder = require('./der'); + +function PEMEncoder(entity) { + DEREncoder.call(this, entity); + this.enc = 'pem'; +}; +inherits(PEMEncoder, DEREncoder); +module.exports = PEMEncoder; + +PEMEncoder.prototype.encode = function encode(data, options) { + var buf = DEREncoder.prototype.encode.call(this, data); + + var p = buf.toString('base64'); + var out = [ '-----BEGIN ' + options.label + '-----' ]; + for (var i = 0; i < p.length; i += 64) + out.push(p.slice(i, i + 64)); + out.push('-----END ' + options.label + '-----'); + return out.join('\n'); +}; + +},{"./der":111,"inherits":318}],114:[function(require,module,exports){ +arguments[4][83][0].apply(exports,arguments) +},{"dup":83}],115:[function(require,module,exports){ +arguments[4][53][0].apply(exports,arguments) +},{"dup":53,"safe-buffer":133}],116:[function(require,module,exports){ +arguments[4][54][0].apply(exports,arguments) +},{"./aes":115,"./ghash":120,"./incr32":121,"buffer-xor":131,"cipher-base":132,"dup":54,"inherits":318,"safe-buffer":133}],117:[function(require,module,exports){ +arguments[4][55][0].apply(exports,arguments) +},{"./decrypter":118,"./encrypter":119,"./modes/list.json":129,"dup":55}],118:[function(require,module,exports){ +arguments[4][56][0].apply(exports,arguments) +},{"./aes":115,"./authCipher":116,"./modes":128,"./streamCipher":134,"cipher-base":132,"dup":56,"evp_bytestokey":135,"inherits":318,"safe-buffer":133}],119:[function(require,module,exports){ +arguments[4][57][0].apply(exports,arguments) +},{"./aes":115,"./authCipher":116,"./modes":128,"./streamCipher":134,"cipher-base":132,"dup":57,"evp_bytestokey":135,"inherits":318,"safe-buffer":133}],120:[function(require,module,exports){ +arguments[4][58][0].apply(exports,arguments) +},{"dup":58,"safe-buffer":133}],121:[function(require,module,exports){ +arguments[4][59][0].apply(exports,arguments) +},{"dup":59}],122:[function(require,module,exports){ +arguments[4][60][0].apply(exports,arguments) +},{"buffer-xor":131,"dup":60}],123:[function(require,module,exports){ +arguments[4][61][0].apply(exports,arguments) +},{"buffer-xor":131,"dup":61,"safe-buffer":133}],124:[function(require,module,exports){ +arguments[4][62][0].apply(exports,arguments) +},{"dup":62,"safe-buffer":133}],125:[function(require,module,exports){ +arguments[4][63][0].apply(exports,arguments) +},{"dup":63,"safe-buffer":133}],126:[function(require,module,exports){ +arguments[4][64][0].apply(exports,arguments) +},{"../incr32":121,"buffer-xor":131,"dup":64,"safe-buffer":133}],127:[function(require,module,exports){ +arguments[4][65][0].apply(exports,arguments) +},{"dup":65}],128:[function(require,module,exports){ +arguments[4][66][0].apply(exports,arguments) +},{"./cbc":122,"./cfb":123,"./cfb1":124,"./cfb8":125,"./ctr":126,"./ecb":127,"./list.json":129,"./ofb":130,"dup":66}],129:[function(require,module,exports){ +arguments[4][67][0].apply(exports,arguments) +},{"dup":67}],130:[function(require,module,exports){ +arguments[4][68][0].apply(exports,arguments) +},{"buffer":47,"buffer-xor":131,"dup":68}],131:[function(require,module,exports){ +arguments[4][69][0].apply(exports,arguments) +},{"buffer":47,"dup":69}],132:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"dup":70,"inherits":318,"safe-buffer":133,"stream":272,"string_decoder":273}],133:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],134:[function(require,module,exports){ +arguments[4][72][0].apply(exports,arguments) +},{"./aes":115,"cipher-base":132,"dup":72,"inherits":318,"safe-buffer":133}],135:[function(require,module,exports){ +arguments[4][84][0].apply(exports,arguments) +},{"dup":84,"md5.js":136,"safe-buffer":138}],136:[function(require,module,exports){ +arguments[4][85][0].apply(exports,arguments) +},{"buffer":47,"dup":85,"hash-base":137,"inherits":318}],137:[function(require,module,exports){ +arguments[4][86][0].apply(exports,arguments) +},{"dup":86,"inherits":318,"safe-buffer":138,"stream":272}],138:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],139:[function(require,module,exports){ +(function (Buffer){ +var elliptic = require('elliptic'); +var BN = require('bn.js'); + +module.exports = function createECDH(curve) { + return new ECDH(curve); +}; + +var aliases = { + secp256k1: { + name: 'secp256k1', + byteLength: 32 + }, + secp224r1: { + name: 'p224', + byteLength: 28 + }, + prime256v1: { + name: 'p256', + byteLength: 32 + }, + prime192v1: { + name: 'p192', + byteLength: 24 + }, + ed25519: { + name: 'ed25519', + byteLength: 32 + }, + secp384r1: { + name: 'p384', + byteLength: 48 + }, + secp521r1: { + name: 'p521', + byteLength: 66 + } +}; + +aliases.p224 = aliases.secp224r1; +aliases.p256 = aliases.secp256r1 = aliases.prime256v1; +aliases.p192 = aliases.secp192r1 = aliases.prime192v1; +aliases.p384 = aliases.secp384r1; +aliases.p521 = aliases.secp521r1; + +function ECDH(curve) { + this.curveType = aliases[curve]; + if (!this.curveType ) { + this.curveType = { + name: curve + }; + } + this.curve = new elliptic.ec(this.curveType.name); + this.keys = void 0; +} + +ECDH.prototype.generateKeys = function (enc, format) { + this.keys = this.curve.genKeyPair(); + return this.getPublicKey(enc, format); +}; + +ECDH.prototype.computeSecret = function (other, inenc, enc) { + inenc = inenc || 'utf8'; + if (!Buffer.isBuffer(other)) { + other = new Buffer(other, inenc); + } + var otherPub = this.curve.keyFromPublic(other).getPublic(); + var out = otherPub.mul(this.keys.getPrivate()).getX(); + return formatReturnValue(out, enc, this.curveType.byteLength); +}; + +ECDH.prototype.getPublicKey = function (enc, format) { + var key = this.keys.getPublic(format === 'compressed', true); + if (format === 'hybrid') { + if (key[key.length - 1] % 2) { + key[0] = 7; + } else { + key [0] = 6; + } + } + return formatReturnValue(key, enc); +}; + +ECDH.prototype.getPrivateKey = function (enc) { + return formatReturnValue(this.keys.getPrivate(), enc); +}; + +ECDH.prototype.setPublicKey = function (pub, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(pub)) { + pub = new Buffer(pub, enc); + } + this.keys._importPublic(pub); + return this; +}; + +ECDH.prototype.setPrivateKey = function (priv, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(priv)) { + priv = new Buffer(priv, enc); + } + var _priv = new BN(priv); + _priv = _priv.toString(16); + this.keys._importPrivate(_priv); + return this; +}; + +function formatReturnValue(bn, enc, len) { + if (!Array.isArray(bn)) { + bn = bn.toArray(); + } + var buf = new Buffer(bn); + if (len && buf.length < len) { + var zeros = new Buffer(len - buf.length); + zeros.fill(0); + buf = Buffer.concat([zeros, buf]); + } + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } +} + +}).call(this,require("buffer").Buffer) +},{"bn.js":280,"buffer":47,"elliptic":285}],140:[function(require,module,exports){ +(function (Buffer){ +'use strict' +var inherits = require('inherits') +var md5 = require('./md5') +var RIPEMD160 = require('ripemd160') +var sha = require('sha.js') + +var Base = require('cipher-base') + +function HashNoConstructor (hash) { + Base.call(this, 'digest') + + this._hash = hash + this.buffers = [] +} + +inherits(HashNoConstructor, Base) + +HashNoConstructor.prototype._update = function (data) { + this.buffers.push(data) +} + +HashNoConstructor.prototype._final = function () { + var buf = Buffer.concat(this.buffers) + var r = this._hash(buf) + this.buffers = null + + return r +} + +function Hash (hash) { + Base.call(this, 'digest') + + this._hash = hash +} + +inherits(Hash, Base) + +Hash.prototype._update = function (data) { + this._hash.update(data) +} + +Hash.prototype._final = function () { + return this._hash.digest() +} + +module.exports = function createHash (alg) { + alg = alg.toLowerCase() + if (alg === 'md5') return new HashNoConstructor(md5) + if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160()) + + return new Hash(sha(alg)) +} + +}).call(this,require("buffer").Buffer) +},{"./md5":142,"buffer":47,"cipher-base":143,"inherits":318,"ripemd160":145,"sha.js":148}],141:[function(require,module,exports){ +(function (Buffer){ +'use strict' +var intSize = 4 +var zeroBuffer = new Buffer(intSize) +zeroBuffer.fill(0) + +var charSize = 8 +var hashSize = 16 + +function toArray (buf) { + if ((buf.length % intSize) !== 0) { + var len = buf.length + (intSize - (buf.length % intSize)) + buf = Buffer.concat([buf, zeroBuffer], len) + } + + var arr = new Array(buf.length >>> 2) + for (var i = 0, j = 0; i < buf.length; i += intSize, j++) { + arr[j] = buf.readInt32LE(i) + } + + return arr +} + +module.exports = function hash (buf, fn) { + var arr = fn(toArray(buf), buf.length * charSize) + buf = new Buffer(hashSize) + for (var i = 0; i < arr.length; i++) { + buf.writeInt32LE(arr[i], i << 2, true) + } + return buf +} + +}).call(this,require("buffer").Buffer) +},{"buffer":47}],142:[function(require,module,exports){ +'use strict' +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +var makeHash = require('./make-hash') + +/* + * Calculate the MD5 of an array of little-endian words, and a bit length + */ +function core_md5 (x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32) + x[(((len + 64) >>> 9) << 4) + 14] = len + + var a = 1732584193 + var b = -271733879 + var c = -1732584194 + var d = 271733878 + + for (var i = 0; i < x.length; i += 16) { + var olda = a + var oldb = b + var oldc = c + var oldd = d + + a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936) + d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586) + c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819) + b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330) + a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897) + d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426) + c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341) + b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983) + a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416) + d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417) + c = md5_ff(c, d, a, b, x[i + 10], 17, -42063) + b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162) + a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682) + d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101) + c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290) + b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329) + + a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510) + d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632) + c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713) + b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302) + a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691) + d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083) + c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335) + b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848) + a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438) + d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690) + c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961) + b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501) + a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467) + d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784) + c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473) + b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734) + + a = md5_hh(a, b, c, d, x[i + 5], 4, -378558) + d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463) + c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562) + b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556) + a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060) + d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353) + c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632) + b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640) + a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174) + d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222) + c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979) + b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189) + a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487) + d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835) + c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520) + b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651) + + a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844) + d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415) + c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905) + b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055) + a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571) + d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606) + c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523) + b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799) + a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359) + d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744) + c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380) + b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649) + a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070) + d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379) + c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259) + b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551) + + a = safe_add(a, olda) + b = safe_add(b, oldb) + c = safe_add(c, oldc) + d = safe_add(d, oldd) + } + + return [a, b, c, d] +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function md5_cmn (q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b) +} + +function md5_ff (a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t) +} + +function md5_gg (a, b, c, d, x, s, t) { + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t) +} + +function md5_hh (a, b, c, d, x, s, t) { + return md5_cmn(b ^ c ^ d, a, b, x, s, t) +} + +function md5_ii (a, b, c, d, x, s, t) { + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t) +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add (x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF) + var msw = (x >> 16) + (y >> 16) + (lsw >> 16) + return (msw << 16) | (lsw & 0xFFFF) +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function bit_rol (num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)) +} + +module.exports = function md5 (buf) { + return makeHash(buf, core_md5) +} + +},{"./make-hash":141}],143:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"dup":70,"inherits":318,"safe-buffer":144,"stream":272,"string_decoder":273}],144:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],145:[function(require,module,exports){ +(function (Buffer){ +'use strict' +var inherits = require('inherits') +var HashBase = require('hash-base') + +function RIPEMD160 () { + HashBase.call(this, 64) + + // state + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 +} + +inherits(RIPEMD160, HashBase) + +RIPEMD160.prototype._update = function () { + var m = new Array(16) + for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4) + + var al = this._a + var bl = this._b + var cl = this._c + var dl = this._d + var el = this._e + + // Mj = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + // K = 0x00000000 + // Sj = 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8 + al = fn1(al, bl, cl, dl, el, m[0], 0x00000000, 11); cl = rotl(cl, 10) + el = fn1(el, al, bl, cl, dl, m[1], 0x00000000, 14); bl = rotl(bl, 10) + dl = fn1(dl, el, al, bl, cl, m[2], 0x00000000, 15); al = rotl(al, 10) + cl = fn1(cl, dl, el, al, bl, m[3], 0x00000000, 12); el = rotl(el, 10) + bl = fn1(bl, cl, dl, el, al, m[4], 0x00000000, 5); dl = rotl(dl, 10) + al = fn1(al, bl, cl, dl, el, m[5], 0x00000000, 8); cl = rotl(cl, 10) + el = fn1(el, al, bl, cl, dl, m[6], 0x00000000, 7); bl = rotl(bl, 10) + dl = fn1(dl, el, al, bl, cl, m[7], 0x00000000, 9); al = rotl(al, 10) + cl = fn1(cl, dl, el, al, bl, m[8], 0x00000000, 11); el = rotl(el, 10) + bl = fn1(bl, cl, dl, el, al, m[9], 0x00000000, 13); dl = rotl(dl, 10) + al = fn1(al, bl, cl, dl, el, m[10], 0x00000000, 14); cl = rotl(cl, 10) + el = fn1(el, al, bl, cl, dl, m[11], 0x00000000, 15); bl = rotl(bl, 10) + dl = fn1(dl, el, al, bl, cl, m[12], 0x00000000, 6); al = rotl(al, 10) + cl = fn1(cl, dl, el, al, bl, m[13], 0x00000000, 7); el = rotl(el, 10) + bl = fn1(bl, cl, dl, el, al, m[14], 0x00000000, 9); dl = rotl(dl, 10) + al = fn1(al, bl, cl, dl, el, m[15], 0x00000000, 8); cl = rotl(cl, 10) + + // Mj = 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8 + // K = 0x5a827999 + // Sj = 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12 + el = fn2(el, al, bl, cl, dl, m[7], 0x5a827999, 7); bl = rotl(bl, 10) + dl = fn2(dl, el, al, bl, cl, m[4], 0x5a827999, 6); al = rotl(al, 10) + cl = fn2(cl, dl, el, al, bl, m[13], 0x5a827999, 8); el = rotl(el, 10) + bl = fn2(bl, cl, dl, el, al, m[1], 0x5a827999, 13); dl = rotl(dl, 10) + al = fn2(al, bl, cl, dl, el, m[10], 0x5a827999, 11); cl = rotl(cl, 10) + el = fn2(el, al, bl, cl, dl, m[6], 0x5a827999, 9); bl = rotl(bl, 10) + dl = fn2(dl, el, al, bl, cl, m[15], 0x5a827999, 7); al = rotl(al, 10) + cl = fn2(cl, dl, el, al, bl, m[3], 0x5a827999, 15); el = rotl(el, 10) + bl = fn2(bl, cl, dl, el, al, m[12], 0x5a827999, 7); dl = rotl(dl, 10) + al = fn2(al, bl, cl, dl, el, m[0], 0x5a827999, 12); cl = rotl(cl, 10) + el = fn2(el, al, bl, cl, dl, m[9], 0x5a827999, 15); bl = rotl(bl, 10) + dl = fn2(dl, el, al, bl, cl, m[5], 0x5a827999, 9); al = rotl(al, 10) + cl = fn2(cl, dl, el, al, bl, m[2], 0x5a827999, 11); el = rotl(el, 10) + bl = fn2(bl, cl, dl, el, al, m[14], 0x5a827999, 7); dl = rotl(dl, 10) + al = fn2(al, bl, cl, dl, el, m[11], 0x5a827999, 13); cl = rotl(cl, 10) + el = fn2(el, al, bl, cl, dl, m[8], 0x5a827999, 12); bl = rotl(bl, 10) + + // Mj = 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12 + // K = 0x6ed9eba1 + // Sj = 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5 + dl = fn3(dl, el, al, bl, cl, m[3], 0x6ed9eba1, 11); al = rotl(al, 10) + cl = fn3(cl, dl, el, al, bl, m[10], 0x6ed9eba1, 13); el = rotl(el, 10) + bl = fn3(bl, cl, dl, el, al, m[14], 0x6ed9eba1, 6); dl = rotl(dl, 10) + al = fn3(al, bl, cl, dl, el, m[4], 0x6ed9eba1, 7); cl = rotl(cl, 10) + el = fn3(el, al, bl, cl, dl, m[9], 0x6ed9eba1, 14); bl = rotl(bl, 10) + dl = fn3(dl, el, al, bl, cl, m[15], 0x6ed9eba1, 9); al = rotl(al, 10) + cl = fn3(cl, dl, el, al, bl, m[8], 0x6ed9eba1, 13); el = rotl(el, 10) + bl = fn3(bl, cl, dl, el, al, m[1], 0x6ed9eba1, 15); dl = rotl(dl, 10) + al = fn3(al, bl, cl, dl, el, m[2], 0x6ed9eba1, 14); cl = rotl(cl, 10) + el = fn3(el, al, bl, cl, dl, m[7], 0x6ed9eba1, 8); bl = rotl(bl, 10) + dl = fn3(dl, el, al, bl, cl, m[0], 0x6ed9eba1, 13); al = rotl(al, 10) + cl = fn3(cl, dl, el, al, bl, m[6], 0x6ed9eba1, 6); el = rotl(el, 10) + bl = fn3(bl, cl, dl, el, al, m[13], 0x6ed9eba1, 5); dl = rotl(dl, 10) + al = fn3(al, bl, cl, dl, el, m[11], 0x6ed9eba1, 12); cl = rotl(cl, 10) + el = fn3(el, al, bl, cl, dl, m[5], 0x6ed9eba1, 7); bl = rotl(bl, 10) + dl = fn3(dl, el, al, bl, cl, m[12], 0x6ed9eba1, 5); al = rotl(al, 10) + + // Mj = 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2 + // K = 0x8f1bbcdc + // Sj = 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12 + cl = fn4(cl, dl, el, al, bl, m[1], 0x8f1bbcdc, 11); el = rotl(el, 10) + bl = fn4(bl, cl, dl, el, al, m[9], 0x8f1bbcdc, 12); dl = rotl(dl, 10) + al = fn4(al, bl, cl, dl, el, m[11], 0x8f1bbcdc, 14); cl = rotl(cl, 10) + el = fn4(el, al, bl, cl, dl, m[10], 0x8f1bbcdc, 15); bl = rotl(bl, 10) + dl = fn4(dl, el, al, bl, cl, m[0], 0x8f1bbcdc, 14); al = rotl(al, 10) + cl = fn4(cl, dl, el, al, bl, m[8], 0x8f1bbcdc, 15); el = rotl(el, 10) + bl = fn4(bl, cl, dl, el, al, m[12], 0x8f1bbcdc, 9); dl = rotl(dl, 10) + al = fn4(al, bl, cl, dl, el, m[4], 0x8f1bbcdc, 8); cl = rotl(cl, 10) + el = fn4(el, al, bl, cl, dl, m[13], 0x8f1bbcdc, 9); bl = rotl(bl, 10) + dl = fn4(dl, el, al, bl, cl, m[3], 0x8f1bbcdc, 14); al = rotl(al, 10) + cl = fn4(cl, dl, el, al, bl, m[7], 0x8f1bbcdc, 5); el = rotl(el, 10) + bl = fn4(bl, cl, dl, el, al, m[15], 0x8f1bbcdc, 6); dl = rotl(dl, 10) + al = fn4(al, bl, cl, dl, el, m[14], 0x8f1bbcdc, 8); cl = rotl(cl, 10) + el = fn4(el, al, bl, cl, dl, m[5], 0x8f1bbcdc, 6); bl = rotl(bl, 10) + dl = fn4(dl, el, al, bl, cl, m[6], 0x8f1bbcdc, 5); al = rotl(al, 10) + cl = fn4(cl, dl, el, al, bl, m[2], 0x8f1bbcdc, 12); el = rotl(el, 10) + + // Mj = 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 + // K = 0xa953fd4e + // Sj = 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 + bl = fn5(bl, cl, dl, el, al, m[4], 0xa953fd4e, 9); dl = rotl(dl, 10) + al = fn5(al, bl, cl, dl, el, m[0], 0xa953fd4e, 15); cl = rotl(cl, 10) + el = fn5(el, al, bl, cl, dl, m[5], 0xa953fd4e, 5); bl = rotl(bl, 10) + dl = fn5(dl, el, al, bl, cl, m[9], 0xa953fd4e, 11); al = rotl(al, 10) + cl = fn5(cl, dl, el, al, bl, m[7], 0xa953fd4e, 6); el = rotl(el, 10) + bl = fn5(bl, cl, dl, el, al, m[12], 0xa953fd4e, 8); dl = rotl(dl, 10) + al = fn5(al, bl, cl, dl, el, m[2], 0xa953fd4e, 13); cl = rotl(cl, 10) + el = fn5(el, al, bl, cl, dl, m[10], 0xa953fd4e, 12); bl = rotl(bl, 10) + dl = fn5(dl, el, al, bl, cl, m[14], 0xa953fd4e, 5); al = rotl(al, 10) + cl = fn5(cl, dl, el, al, bl, m[1], 0xa953fd4e, 12); el = rotl(el, 10) + bl = fn5(bl, cl, dl, el, al, m[3], 0xa953fd4e, 13); dl = rotl(dl, 10) + al = fn5(al, bl, cl, dl, el, m[8], 0xa953fd4e, 14); cl = rotl(cl, 10) + el = fn5(el, al, bl, cl, dl, m[11], 0xa953fd4e, 11); bl = rotl(bl, 10) + dl = fn5(dl, el, al, bl, cl, m[6], 0xa953fd4e, 8); al = rotl(al, 10) + cl = fn5(cl, dl, el, al, bl, m[15], 0xa953fd4e, 5); el = rotl(el, 10) + bl = fn5(bl, cl, dl, el, al, m[13], 0xa953fd4e, 6); dl = rotl(dl, 10) + + var ar = this._a + var br = this._b + var cr = this._c + var dr = this._d + var er = this._e + + // M'j = 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12 + // K' = 0x50a28be6 + // S'j = 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6 + ar = fn5(ar, br, cr, dr, er, m[5], 0x50a28be6, 8); cr = rotl(cr, 10) + er = fn5(er, ar, br, cr, dr, m[14], 0x50a28be6, 9); br = rotl(br, 10) + dr = fn5(dr, er, ar, br, cr, m[7], 0x50a28be6, 9); ar = rotl(ar, 10) + cr = fn5(cr, dr, er, ar, br, m[0], 0x50a28be6, 11); er = rotl(er, 10) + br = fn5(br, cr, dr, er, ar, m[9], 0x50a28be6, 13); dr = rotl(dr, 10) + ar = fn5(ar, br, cr, dr, er, m[2], 0x50a28be6, 15); cr = rotl(cr, 10) + er = fn5(er, ar, br, cr, dr, m[11], 0x50a28be6, 15); br = rotl(br, 10) + dr = fn5(dr, er, ar, br, cr, m[4], 0x50a28be6, 5); ar = rotl(ar, 10) + cr = fn5(cr, dr, er, ar, br, m[13], 0x50a28be6, 7); er = rotl(er, 10) + br = fn5(br, cr, dr, er, ar, m[6], 0x50a28be6, 7); dr = rotl(dr, 10) + ar = fn5(ar, br, cr, dr, er, m[15], 0x50a28be6, 8); cr = rotl(cr, 10) + er = fn5(er, ar, br, cr, dr, m[8], 0x50a28be6, 11); br = rotl(br, 10) + dr = fn5(dr, er, ar, br, cr, m[1], 0x50a28be6, 14); ar = rotl(ar, 10) + cr = fn5(cr, dr, er, ar, br, m[10], 0x50a28be6, 14); er = rotl(er, 10) + br = fn5(br, cr, dr, er, ar, m[3], 0x50a28be6, 12); dr = rotl(dr, 10) + ar = fn5(ar, br, cr, dr, er, m[12], 0x50a28be6, 6); cr = rotl(cr, 10) + + // M'j = 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2 + // K' = 0x5c4dd124 + // S'j = 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11 + er = fn4(er, ar, br, cr, dr, m[6], 0x5c4dd124, 9); br = rotl(br, 10) + dr = fn4(dr, er, ar, br, cr, m[11], 0x5c4dd124, 13); ar = rotl(ar, 10) + cr = fn4(cr, dr, er, ar, br, m[3], 0x5c4dd124, 15); er = rotl(er, 10) + br = fn4(br, cr, dr, er, ar, m[7], 0x5c4dd124, 7); dr = rotl(dr, 10) + ar = fn4(ar, br, cr, dr, er, m[0], 0x5c4dd124, 12); cr = rotl(cr, 10) + er = fn4(er, ar, br, cr, dr, m[13], 0x5c4dd124, 8); br = rotl(br, 10) + dr = fn4(dr, er, ar, br, cr, m[5], 0x5c4dd124, 9); ar = rotl(ar, 10) + cr = fn4(cr, dr, er, ar, br, m[10], 0x5c4dd124, 11); er = rotl(er, 10) + br = fn4(br, cr, dr, er, ar, m[14], 0x5c4dd124, 7); dr = rotl(dr, 10) + ar = fn4(ar, br, cr, dr, er, m[15], 0x5c4dd124, 7); cr = rotl(cr, 10) + er = fn4(er, ar, br, cr, dr, m[8], 0x5c4dd124, 12); br = rotl(br, 10) + dr = fn4(dr, er, ar, br, cr, m[12], 0x5c4dd124, 7); ar = rotl(ar, 10) + cr = fn4(cr, dr, er, ar, br, m[4], 0x5c4dd124, 6); er = rotl(er, 10) + br = fn4(br, cr, dr, er, ar, m[9], 0x5c4dd124, 15); dr = rotl(dr, 10) + ar = fn4(ar, br, cr, dr, er, m[1], 0x5c4dd124, 13); cr = rotl(cr, 10) + er = fn4(er, ar, br, cr, dr, m[2], 0x5c4dd124, 11); br = rotl(br, 10) + + // M'j = 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13 + // K' = 0x6d703ef3 + // S'j = 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5 + dr = fn3(dr, er, ar, br, cr, m[15], 0x6d703ef3, 9); ar = rotl(ar, 10) + cr = fn3(cr, dr, er, ar, br, m[5], 0x6d703ef3, 7); er = rotl(er, 10) + br = fn3(br, cr, dr, er, ar, m[1], 0x6d703ef3, 15); dr = rotl(dr, 10) + ar = fn3(ar, br, cr, dr, er, m[3], 0x6d703ef3, 11); cr = rotl(cr, 10) + er = fn3(er, ar, br, cr, dr, m[7], 0x6d703ef3, 8); br = rotl(br, 10) + dr = fn3(dr, er, ar, br, cr, m[14], 0x6d703ef3, 6); ar = rotl(ar, 10) + cr = fn3(cr, dr, er, ar, br, m[6], 0x6d703ef3, 6); er = rotl(er, 10) + br = fn3(br, cr, dr, er, ar, m[9], 0x6d703ef3, 14); dr = rotl(dr, 10) + ar = fn3(ar, br, cr, dr, er, m[11], 0x6d703ef3, 12); cr = rotl(cr, 10) + er = fn3(er, ar, br, cr, dr, m[8], 0x6d703ef3, 13); br = rotl(br, 10) + dr = fn3(dr, er, ar, br, cr, m[12], 0x6d703ef3, 5); ar = rotl(ar, 10) + cr = fn3(cr, dr, er, ar, br, m[2], 0x6d703ef3, 14); er = rotl(er, 10) + br = fn3(br, cr, dr, er, ar, m[10], 0x6d703ef3, 13); dr = rotl(dr, 10) + ar = fn3(ar, br, cr, dr, er, m[0], 0x6d703ef3, 13); cr = rotl(cr, 10) + er = fn3(er, ar, br, cr, dr, m[4], 0x6d703ef3, 7); br = rotl(br, 10) + dr = fn3(dr, er, ar, br, cr, m[13], 0x6d703ef3, 5); ar = rotl(ar, 10) + + // M'j = 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14 + // K' = 0x7a6d76e9 + // S'j = 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8 + cr = fn2(cr, dr, er, ar, br, m[8], 0x7a6d76e9, 15); er = rotl(er, 10) + br = fn2(br, cr, dr, er, ar, m[6], 0x7a6d76e9, 5); dr = rotl(dr, 10) + ar = fn2(ar, br, cr, dr, er, m[4], 0x7a6d76e9, 8); cr = rotl(cr, 10) + er = fn2(er, ar, br, cr, dr, m[1], 0x7a6d76e9, 11); br = rotl(br, 10) + dr = fn2(dr, er, ar, br, cr, m[3], 0x7a6d76e9, 14); ar = rotl(ar, 10) + cr = fn2(cr, dr, er, ar, br, m[11], 0x7a6d76e9, 14); er = rotl(er, 10) + br = fn2(br, cr, dr, er, ar, m[15], 0x7a6d76e9, 6); dr = rotl(dr, 10) + ar = fn2(ar, br, cr, dr, er, m[0], 0x7a6d76e9, 14); cr = rotl(cr, 10) + er = fn2(er, ar, br, cr, dr, m[5], 0x7a6d76e9, 6); br = rotl(br, 10) + dr = fn2(dr, er, ar, br, cr, m[12], 0x7a6d76e9, 9); ar = rotl(ar, 10) + cr = fn2(cr, dr, er, ar, br, m[2], 0x7a6d76e9, 12); er = rotl(er, 10) + br = fn2(br, cr, dr, er, ar, m[13], 0x7a6d76e9, 9); dr = rotl(dr, 10) + ar = fn2(ar, br, cr, dr, er, m[9], 0x7a6d76e9, 12); cr = rotl(cr, 10) + er = fn2(er, ar, br, cr, dr, m[7], 0x7a6d76e9, 5); br = rotl(br, 10) + dr = fn2(dr, er, ar, br, cr, m[10], 0x7a6d76e9, 15); ar = rotl(ar, 10) + cr = fn2(cr, dr, er, ar, br, m[14], 0x7a6d76e9, 8); er = rotl(er, 10) + + // M'j = 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 + // K' = 0x00000000 + // S'j = 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 + br = fn1(br, cr, dr, er, ar, m[12], 0x00000000, 8); dr = rotl(dr, 10) + ar = fn1(ar, br, cr, dr, er, m[15], 0x00000000, 5); cr = rotl(cr, 10) + er = fn1(er, ar, br, cr, dr, m[10], 0x00000000, 12); br = rotl(br, 10) + dr = fn1(dr, er, ar, br, cr, m[4], 0x00000000, 9); ar = rotl(ar, 10) + cr = fn1(cr, dr, er, ar, br, m[1], 0x00000000, 12); er = rotl(er, 10) + br = fn1(br, cr, dr, er, ar, m[5], 0x00000000, 5); dr = rotl(dr, 10) + ar = fn1(ar, br, cr, dr, er, m[8], 0x00000000, 14); cr = rotl(cr, 10) + er = fn1(er, ar, br, cr, dr, m[7], 0x00000000, 6); br = rotl(br, 10) + dr = fn1(dr, er, ar, br, cr, m[6], 0x00000000, 8); ar = rotl(ar, 10) + cr = fn1(cr, dr, er, ar, br, m[2], 0x00000000, 13); er = rotl(er, 10) + br = fn1(br, cr, dr, er, ar, m[13], 0x00000000, 6); dr = rotl(dr, 10) + ar = fn1(ar, br, cr, dr, er, m[14], 0x00000000, 5); cr = rotl(cr, 10) + er = fn1(er, ar, br, cr, dr, m[0], 0x00000000, 15); br = rotl(br, 10) + dr = fn1(dr, er, ar, br, cr, m[3], 0x00000000, 13); ar = rotl(ar, 10) + cr = fn1(cr, dr, er, ar, br, m[9], 0x00000000, 11); er = rotl(er, 10) + br = fn1(br, cr, dr, er, ar, m[11], 0x00000000, 11); dr = rotl(dr, 10) + + // change state + var t = (this._b + cl + dr) | 0 + this._b = (this._c + dl + er) | 0 + this._c = (this._d + el + ar) | 0 + this._d = (this._e + al + br) | 0 + this._e = (this._a + bl + cr) | 0 + this._a = t +} + +RIPEMD160.prototype._digest = function () { + // create padding and handle blocks + this._block[this._blockOffset++] = 0x80 + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64) + this._update() + this._blockOffset = 0 + } + + this._block.fill(0, this._blockOffset, 56) + this._block.writeUInt32LE(this._length[0], 56) + this._block.writeUInt32LE(this._length[1], 60) + this._update() + + // produce result + var buffer = new Buffer(20) + buffer.writeInt32LE(this._a, 0) + buffer.writeInt32LE(this._b, 4) + buffer.writeInt32LE(this._c, 8) + buffer.writeInt32LE(this._d, 12) + buffer.writeInt32LE(this._e, 16) + return buffer +} + +function rotl (x, n) { + return (x << n) | (x >>> (32 - n)) +} + +function fn1 (a, b, c, d, e, m, k, s) { + return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0 +} + +function fn2 (a, b, c, d, e, m, k, s) { + return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0 +} + +function fn3 (a, b, c, d, e, m, k, s) { + return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0 +} + +function fn4 (a, b, c, d, e, m, k, s) { + return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0 +} + +function fn5 (a, b, c, d, e, m, k, s) { + return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0 +} + +module.exports = RIPEMD160 + +}).call(this,require("buffer").Buffer) +},{"buffer":47,"hash-base":146,"inherits":318}],146:[function(require,module,exports){ +(function (Buffer){ +'use strict' +var Transform = require('stream').Transform +var inherits = require('inherits') + +function HashBase (blockSize) { + Transform.call(this) + + this._block = new Buffer(blockSize) + this._blockSize = blockSize + this._blockOffset = 0 + this._length = [0, 0, 0, 0] + + this._finalized = false +} + +inherits(HashBase, Transform) + +HashBase.prototype._transform = function (chunk, encoding, callback) { + var error = null + try { + if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding) + this.update(chunk) + } catch (err) { + error = err + } + + callback(error) +} + +HashBase.prototype._flush = function (callback) { + var error = null + try { + this.push(this._digest()) + } catch (err) { + error = err + } + + callback(error) +} + +HashBase.prototype.update = function (data, encoding) { + if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer') + if (this._finalized) throw new Error('Digest already called') + if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary') + + // consume data + var block = this._block + var offset = 0 + while (this._blockOffset + data.length - offset >= this._blockSize) { + for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++] + this._update() + this._blockOffset = 0 + } + while (offset < data.length) block[this._blockOffset++] = data[offset++] + + // update length + for (var j = 0, carry = data.length * 8; carry > 0; ++j) { + this._length[j] += carry + carry = (this._length[j] / 0x0100000000) | 0 + if (carry > 0) this._length[j] -= 0x0100000000 * carry + } + + return this +} + +HashBase.prototype._update = function (data) { + throw new Error('_update is not implemented') +} + +HashBase.prototype.digest = function (encoding) { + if (this._finalized) throw new Error('Digest already called') + this._finalized = true + + var digest = this._digest() + if (encoding !== undefined) digest = digest.toString(encoding) + return digest +} + +HashBase.prototype._digest = function () { + throw new Error('_digest is not implemented') +} + +module.exports = HashBase + +}).call(this,require("buffer").Buffer) +},{"buffer":47,"inherits":318,"stream":272}],147:[function(require,module,exports){ +var Buffer = require('safe-buffer').Buffer + +// prototype class for hash functions +function Hash (blockSize, finalSize) { + this._block = Buffer.alloc(blockSize) + this._finalSize = finalSize + this._blockSize = blockSize + this._len = 0 +} + +Hash.prototype.update = function (data, enc) { + if (typeof data === 'string') { + enc = enc || 'utf8' + data = Buffer.from(data, enc) + } + + var block = this._block + var blockSize = this._blockSize + var length = data.length + var accum = this._len + + for (var offset = 0; offset < length;) { + var assigned = accum % blockSize + var remainder = Math.min(length - offset, blockSize - assigned) + + for (var i = 0; i < remainder; i++) { + block[assigned + i] = data[offset + i] + } + + accum += remainder + offset += remainder + + if ((accum % blockSize) === 0) { + this._update(block) + } + } + + this._len += length + return this +} + +Hash.prototype.digest = function (enc) { + var rem = this._len % this._blockSize + + this._block[rem] = 0x80 + + // zero (rem + 1) trailing bits, where (rem + 1) is the smallest + // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize + this._block.fill(0, rem + 1) + + if (rem >= this._finalSize) { + this._update(this._block) + this._block.fill(0) + } + + var bits = this._len * 8 + + // uint32 + if (bits <= 0xffffffff) { + this._block.writeUInt32BE(bits, this._blockSize - 4) + + // uint64 + } else { + var lowBits = bits & 0xffffffff + var highBits = (bits - lowBits) / 0x100000000 + + this._block.writeUInt32BE(highBits, this._blockSize - 8) + this._block.writeUInt32BE(lowBits, this._blockSize - 4) + } + + this._update(this._block) + var hash = this._hash() + + return enc ? hash.toString(enc) : hash +} + +Hash.prototype._update = function () { + throw new Error('_update must be implemented by subclass') +} + +module.exports = Hash + +},{"safe-buffer":149}],148:[function(require,module,exports){ +var exports = module.exports = function SHA (algorithm) { + algorithm = algorithm.toLowerCase() + + var Algorithm = exports[algorithm] + if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)') + + return new Algorithm() +} + +exports.sha = require('./sha') +exports.sha1 = require('./sha1') +exports.sha224 = require('./sha224') +exports.sha256 = require('./sha256') +exports.sha384 = require('./sha384') +exports.sha512 = require('./sha512') + +},{"./sha":150,"./sha1":151,"./sha224":152,"./sha256":153,"./sha384":154,"./sha512":155}],149:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],150:[function(require,module,exports){ +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined + * in FIPS PUB 180-1 + * This source code is derived from sha1.js of the same repository. + * The difference between SHA-0 and SHA-1 is just a bitwise rotate left + * operation was added. + */ + +var inherits = require('inherits') +var Hash = require('./hash') +var Buffer = require('safe-buffer').Buffer + +var K = [ + 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 +] + +var W = new Array(80) + +function Sha () { + this.init() + this._w = W + + Hash.call(this, 64, 56) +} + +inherits(Sha, Hash) + +Sha.prototype.init = function () { + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 + + return this +} + +function rotl5 (num) { + return (num << 5) | (num >>> 27) +} + +function rotl30 (num) { + return (num << 30) | (num >>> 2) +} + +function ft (s, b, c, d) { + if (s === 0) return (b & c) | ((~b) & d) + if (s === 2) return (b & c) | (b & d) | (c & d) + return b ^ c ^ d +} + +Sha.prototype._update = function (M) { + var W = this._w + + var a = this._a | 0 + var b = this._b | 0 + var c = this._c | 0 + var d = this._d | 0 + var e = this._e | 0 + + for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) + for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16] + + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20) + var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0 + + e = d + d = c + c = rotl30(b) + b = a + a = t + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 +} + +Sha.prototype._hash = function () { + var H = Buffer.allocUnsafe(20) + + H.writeInt32BE(this._a | 0, 0) + H.writeInt32BE(this._b | 0, 4) + H.writeInt32BE(this._c | 0, 8) + H.writeInt32BE(this._d | 0, 12) + H.writeInt32BE(this._e | 0, 16) + + return H +} + +module.exports = Sha + +},{"./hash":147,"inherits":318,"safe-buffer":149}],151:[function(require,module,exports){ +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ + +var inherits = require('inherits') +var Hash = require('./hash') +var Buffer = require('safe-buffer').Buffer + +var K = [ + 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 +] + +var W = new Array(80) + +function Sha1 () { + this.init() + this._w = W + + Hash.call(this, 64, 56) +} + +inherits(Sha1, Hash) + +Sha1.prototype.init = function () { + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 + + return this +} + +function rotl1 (num) { + return (num << 1) | (num >>> 31) +} + +function rotl5 (num) { + return (num << 5) | (num >>> 27) +} + +function rotl30 (num) { + return (num << 30) | (num >>> 2) +} + +function ft (s, b, c, d) { + if (s === 0) return (b & c) | ((~b) & d) + if (s === 2) return (b & c) | (b & d) | (c & d) + return b ^ c ^ d +} + +Sha1.prototype._update = function (M) { + var W = this._w + + var a = this._a | 0 + var b = this._b | 0 + var c = this._c | 0 + var d = this._d | 0 + var e = this._e | 0 + + for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) + for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]) + + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20) + var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0 + + e = d + d = c + c = rotl30(b) + b = a + a = t + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 +} + +Sha1.prototype._hash = function () { + var H = Buffer.allocUnsafe(20) + + H.writeInt32BE(this._a | 0, 0) + H.writeInt32BE(this._b | 0, 4) + H.writeInt32BE(this._c | 0, 8) + H.writeInt32BE(this._d | 0, 12) + H.writeInt32BE(this._e | 0, 16) + + return H +} + +module.exports = Sha1 + +},{"./hash":147,"inherits":318,"safe-buffer":149}],152:[function(require,module,exports){ +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = require('inherits') +var Sha256 = require('./sha256') +var Hash = require('./hash') +var Buffer = require('safe-buffer').Buffer + +var W = new Array(64) + +function Sha224 () { + this.init() + + this._w = W // new Array(64) + + Hash.call(this, 64, 56) +} + +inherits(Sha224, Sha256) + +Sha224.prototype.init = function () { + this._a = 0xc1059ed8 + this._b = 0x367cd507 + this._c = 0x3070dd17 + this._d = 0xf70e5939 + this._e = 0xffc00b31 + this._f = 0x68581511 + this._g = 0x64f98fa7 + this._h = 0xbefa4fa4 + + return this +} + +Sha224.prototype._hash = function () { + var H = Buffer.allocUnsafe(28) + + H.writeInt32BE(this._a, 0) + H.writeInt32BE(this._b, 4) + H.writeInt32BE(this._c, 8) + H.writeInt32BE(this._d, 12) + H.writeInt32BE(this._e, 16) + H.writeInt32BE(this._f, 20) + H.writeInt32BE(this._g, 24) + + return H +} + +module.exports = Sha224 + +},{"./hash":147,"./sha256":153,"inherits":318,"safe-buffer":149}],153:[function(require,module,exports){ +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = require('inherits') +var Hash = require('./hash') +var Buffer = require('safe-buffer').Buffer + +var K = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 +] + +var W = new Array(64) + +function Sha256 () { + this.init() + + this._w = W // new Array(64) + + Hash.call(this, 64, 56) +} + +inherits(Sha256, Hash) + +Sha256.prototype.init = function () { + this._a = 0x6a09e667 + this._b = 0xbb67ae85 + this._c = 0x3c6ef372 + this._d = 0xa54ff53a + this._e = 0x510e527f + this._f = 0x9b05688c + this._g = 0x1f83d9ab + this._h = 0x5be0cd19 + + return this +} + +function ch (x, y, z) { + return z ^ (x & (y ^ z)) +} + +function maj (x, y, z) { + return (x & y) | (z & (x | y)) +} + +function sigma0 (x) { + return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10) +} + +function sigma1 (x) { + return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7) +} + +function gamma0 (x) { + return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3) +} + +function gamma1 (x) { + return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10) +} + +Sha256.prototype._update = function (M) { + var W = this._w + + var a = this._a | 0 + var b = this._b | 0 + var c = this._c | 0 + var d = this._d | 0 + var e = this._e | 0 + var f = this._f | 0 + var g = this._g | 0 + var h = this._h | 0 + + for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) + for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0 + + for (var j = 0; j < 64; ++j) { + var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0 + var T2 = (sigma0(a) + maj(a, b, c)) | 0 + + h = g + g = f + f = e + e = (d + T1) | 0 + d = c + c = b + b = a + a = (T1 + T2) | 0 + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 + this._f = (f + this._f) | 0 + this._g = (g + this._g) | 0 + this._h = (h + this._h) | 0 +} + +Sha256.prototype._hash = function () { + var H = Buffer.allocUnsafe(32) + + H.writeInt32BE(this._a, 0) + H.writeInt32BE(this._b, 4) + H.writeInt32BE(this._c, 8) + H.writeInt32BE(this._d, 12) + H.writeInt32BE(this._e, 16) + H.writeInt32BE(this._f, 20) + H.writeInt32BE(this._g, 24) + H.writeInt32BE(this._h, 28) + + return H +} + +module.exports = Sha256 + +},{"./hash":147,"inherits":318,"safe-buffer":149}],154:[function(require,module,exports){ +var inherits = require('inherits') +var SHA512 = require('./sha512') +var Hash = require('./hash') +var Buffer = require('safe-buffer').Buffer + +var W = new Array(160) + +function Sha384 () { + this.init() + this._w = W + + Hash.call(this, 128, 112) +} + +inherits(Sha384, SHA512) + +Sha384.prototype.init = function () { + this._ah = 0xcbbb9d5d + this._bh = 0x629a292a + this._ch = 0x9159015a + this._dh = 0x152fecd8 + this._eh = 0x67332667 + this._fh = 0x8eb44a87 + this._gh = 0xdb0c2e0d + this._hh = 0x47b5481d + + this._al = 0xc1059ed8 + this._bl = 0x367cd507 + this._cl = 0x3070dd17 + this._dl = 0xf70e5939 + this._el = 0xffc00b31 + this._fl = 0x68581511 + this._gl = 0x64f98fa7 + this._hl = 0xbefa4fa4 + + return this +} + +Sha384.prototype._hash = function () { + var H = Buffer.allocUnsafe(48) + + function writeInt64BE (h, l, offset) { + H.writeInt32BE(h, offset) + H.writeInt32BE(l, offset + 4) + } + + writeInt64BE(this._ah, this._al, 0) + writeInt64BE(this._bh, this._bl, 8) + writeInt64BE(this._ch, this._cl, 16) + writeInt64BE(this._dh, this._dl, 24) + writeInt64BE(this._eh, this._el, 32) + writeInt64BE(this._fh, this._fl, 40) + + return H +} + +module.exports = Sha384 + +},{"./hash":147,"./sha512":155,"inherits":318,"safe-buffer":149}],155:[function(require,module,exports){ +var inherits = require('inherits') +var Hash = require('./hash') +var Buffer = require('safe-buffer').Buffer + +var K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 +] + +var W = new Array(160) + +function Sha512 () { + this.init() + this._w = W + + Hash.call(this, 128, 112) +} + +inherits(Sha512, Hash) + +Sha512.prototype.init = function () { + this._ah = 0x6a09e667 + this._bh = 0xbb67ae85 + this._ch = 0x3c6ef372 + this._dh = 0xa54ff53a + this._eh = 0x510e527f + this._fh = 0x9b05688c + this._gh = 0x1f83d9ab + this._hh = 0x5be0cd19 + + this._al = 0xf3bcc908 + this._bl = 0x84caa73b + this._cl = 0xfe94f82b + this._dl = 0x5f1d36f1 + this._el = 0xade682d1 + this._fl = 0x2b3e6c1f + this._gl = 0xfb41bd6b + this._hl = 0x137e2179 + + return this +} + +function Ch (x, y, z) { + return z ^ (x & (y ^ z)) +} + +function maj (x, y, z) { + return (x & y) | (z & (x | y)) +} + +function sigma0 (x, xl) { + return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25) +} + +function sigma1 (x, xl) { + return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23) +} + +function Gamma0 (x, xl) { + return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7) +} + +function Gamma0l (x, xl) { + return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25) +} + +function Gamma1 (x, xl) { + return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6) +} + +function Gamma1l (x, xl) { + return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26) +} + +function getCarry (a, b) { + return (a >>> 0) < (b >>> 0) ? 1 : 0 +} + +Sha512.prototype._update = function (M) { + var W = this._w + + var ah = this._ah | 0 + var bh = this._bh | 0 + var ch = this._ch | 0 + var dh = this._dh | 0 + var eh = this._eh | 0 + var fh = this._fh | 0 + var gh = this._gh | 0 + var hh = this._hh | 0 + + var al = this._al | 0 + var bl = this._bl | 0 + var cl = this._cl | 0 + var dl = this._dl | 0 + var el = this._el | 0 + var fl = this._fl | 0 + var gl = this._gl | 0 + var hl = this._hl | 0 + + for (var i = 0; i < 32; i += 2) { + W[i] = M.readInt32BE(i * 4) + W[i + 1] = M.readInt32BE(i * 4 + 4) + } + for (; i < 160; i += 2) { + var xh = W[i - 15 * 2] + var xl = W[i - 15 * 2 + 1] + var gamma0 = Gamma0(xh, xl) + var gamma0l = Gamma0l(xl, xh) + + xh = W[i - 2 * 2] + xl = W[i - 2 * 2 + 1] + var gamma1 = Gamma1(xh, xl) + var gamma1l = Gamma1l(xl, xh) + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7h = W[i - 7 * 2] + var Wi7l = W[i - 7 * 2 + 1] + + var Wi16h = W[i - 16 * 2] + var Wi16l = W[i - 16 * 2 + 1] + + var Wil = (gamma0l + Wi7l) | 0 + var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0 + Wil = (Wil + gamma1l) | 0 + Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0 + Wil = (Wil + Wi16l) | 0 + Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0 + + W[i] = Wih + W[i + 1] = Wil + } + + for (var j = 0; j < 160; j += 2) { + Wih = W[j] + Wil = W[j + 1] + + var majh = maj(ah, bh, ch) + var majl = maj(al, bl, cl) + + var sigma0h = sigma0(ah, al) + var sigma0l = sigma0(al, ah) + var sigma1h = sigma1(eh, el) + var sigma1l = sigma1(el, eh) + + // t1 = h + sigma1 + ch + K[j] + W[j] + var Kih = K[j] + var Kil = K[j + 1] + + var chh = Ch(eh, fh, gh) + var chl = Ch(el, fl, gl) + + var t1l = (hl + sigma1l) | 0 + var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0 + t1l = (t1l + chl) | 0 + t1h = (t1h + chh + getCarry(t1l, chl)) | 0 + t1l = (t1l + Kil) | 0 + t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0 + t1l = (t1l + Wil) | 0 + t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0 + + // t2 = sigma0 + maj + var t2l = (sigma0l + majl) | 0 + var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0 + + hh = gh + hl = gl + gh = fh + gl = fl + fh = eh + fl = el + el = (dl + t1l) | 0 + eh = (dh + t1h + getCarry(el, dl)) | 0 + dh = ch + dl = cl + ch = bh + cl = bl + bh = ah + bl = al + al = (t1l + t2l) | 0 + ah = (t1h + t2h + getCarry(al, t1l)) | 0 + } + + this._al = (this._al + al) | 0 + this._bl = (this._bl + bl) | 0 + this._cl = (this._cl + cl) | 0 + this._dl = (this._dl + dl) | 0 + this._el = (this._el + el) | 0 + this._fl = (this._fl + fl) | 0 + this._gl = (this._gl + gl) | 0 + this._hl = (this._hl + hl) | 0 + + this._ah = (this._ah + ah + getCarry(this._al, al)) | 0 + this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0 + this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0 + this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0 + this._eh = (this._eh + eh + getCarry(this._el, el)) | 0 + this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0 + this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0 + this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0 +} + +Sha512.prototype._hash = function () { + var H = Buffer.allocUnsafe(64) + + function writeInt64BE (h, l, offset) { + H.writeInt32BE(h, offset) + H.writeInt32BE(l, offset + 4) + } + + writeInt64BE(this._ah, this._al, 0) + writeInt64BE(this._bh, this._bl, 8) + writeInt64BE(this._ch, this._cl, 16) + writeInt64BE(this._dh, this._dl, 24) + writeInt64BE(this._eh, this._el, 32) + writeInt64BE(this._fh, this._fl, 40) + writeInt64BE(this._gh, this._gl, 48) + writeInt64BE(this._hh, this._hl, 56) + + return H +} + +module.exports = Sha512 + +},{"./hash":147,"inherits":318,"safe-buffer":149}],156:[function(require,module,exports){ +'use strict' +var inherits = require('inherits') +var Legacy = require('./legacy') +var Base = require('cipher-base') +var Buffer = require('safe-buffer').Buffer +var md5 = require('create-hash/md5') +var RIPEMD160 = require('ripemd160') + +var sha = require('sha.js') + +var ZEROS = Buffer.alloc(128) + +function Hmac (alg, key) { + Base.call(this, 'digest') + if (typeof key === 'string') { + key = Buffer.from(key) + } + + var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 + + this._alg = alg + this._key = key + if (key.length > blocksize) { + var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) + key = hash.update(key).digest() + } else if (key.length < blocksize) { + key = Buffer.concat([key, ZEROS], blocksize) + } + + var ipad = this._ipad = Buffer.allocUnsafe(blocksize) + var opad = this._opad = Buffer.allocUnsafe(blocksize) + + for (var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) + this._hash.update(ipad) +} + +inherits(Hmac, Base) + +Hmac.prototype._update = function (data) { + this._hash.update(data) +} + +Hmac.prototype._final = function () { + var h = this._hash.digest() + var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg) + return hash.update(this._opad).update(h).digest() +} + +module.exports = function createHmac (alg, key) { + alg = alg.toLowerCase() + if (alg === 'rmd160' || alg === 'ripemd160') { + return new Hmac('rmd160', key) + } + if (alg === 'md5') { + return new Legacy(md5, key) + } + return new Hmac(alg, key) +} + +},{"./legacy":157,"cipher-base":158,"create-hash/md5":142,"inherits":318,"ripemd160":159,"safe-buffer":161,"sha.js":163}],157:[function(require,module,exports){ +'use strict' +var inherits = require('inherits') +var Buffer = require('safe-buffer').Buffer + +var Base = require('cipher-base') + +var ZEROS = Buffer.alloc(128) +var blocksize = 64 + +function Hmac (alg, key) { + Base.call(this, 'digest') + if (typeof key === 'string') { + key = Buffer.from(key) + } + + this._alg = alg + this._key = key + + if (key.length > blocksize) { + key = alg(key) + } else if (key.length < blocksize) { + key = Buffer.concat([key, ZEROS], blocksize) + } + + var ipad = this._ipad = Buffer.allocUnsafe(blocksize) + var opad = this._opad = Buffer.allocUnsafe(blocksize) + + for (var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + this._hash = [ipad] +} + +inherits(Hmac, Base) + +Hmac.prototype._update = function (data) { + this._hash.push(data) +} + +Hmac.prototype._final = function () { + var h = this._alg(Buffer.concat(this._hash)) + return this._alg(Buffer.concat([this._opad, h])) +} +module.exports = Hmac + +},{"cipher-base":158,"inherits":318,"safe-buffer":161}],158:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"dup":70,"inherits":318,"safe-buffer":161,"stream":272,"string_decoder":273}],159:[function(require,module,exports){ +arguments[4][145][0].apply(exports,arguments) +},{"buffer":47,"dup":145,"hash-base":160,"inherits":318}],160:[function(require,module,exports){ +arguments[4][146][0].apply(exports,arguments) +},{"buffer":47,"dup":146,"inherits":318,"stream":272}],161:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],162:[function(require,module,exports){ +arguments[4][147][0].apply(exports,arguments) +},{"dup":147,"safe-buffer":161}],163:[function(require,module,exports){ +arguments[4][148][0].apply(exports,arguments) +},{"./sha":164,"./sha1":165,"./sha224":166,"./sha256":167,"./sha384":168,"./sha512":169,"dup":148}],164:[function(require,module,exports){ +arguments[4][150][0].apply(exports,arguments) +},{"./hash":162,"dup":150,"inherits":318,"safe-buffer":161}],165:[function(require,module,exports){ +arguments[4][151][0].apply(exports,arguments) +},{"./hash":162,"dup":151,"inherits":318,"safe-buffer":161}],166:[function(require,module,exports){ +arguments[4][152][0].apply(exports,arguments) +},{"./hash":162,"./sha256":167,"dup":152,"inherits":318,"safe-buffer":161}],167:[function(require,module,exports){ +arguments[4][153][0].apply(exports,arguments) +},{"./hash":162,"dup":153,"inherits":318,"safe-buffer":161}],168:[function(require,module,exports){ +arguments[4][154][0].apply(exports,arguments) +},{"./hash":162,"./sha512":169,"dup":154,"inherits":318,"safe-buffer":161}],169:[function(require,module,exports){ +arguments[4][155][0].apply(exports,arguments) +},{"./hash":162,"dup":155,"inherits":318,"safe-buffer":161}],170:[function(require,module,exports){ +(function (Buffer){ +var generatePrime = require('./lib/generatePrime') +var primes = require('./lib/primes.json') + +var DH = require('./lib/dh') + +function getDiffieHellman (mod) { + var prime = new Buffer(primes[mod].prime, 'hex') + var gen = new Buffer(primes[mod].gen, 'hex') + + return new DH(prime, gen) +} + +var ENCODINGS = { + 'binary': true, 'hex': true, 'base64': true +} + +function createDiffieHellman (prime, enc, generator, genc) { + if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) { + return createDiffieHellman(prime, 'binary', enc, generator) + } + + enc = enc || 'binary' + genc = genc || 'binary' + generator = generator || new Buffer([2]) + + if (!Buffer.isBuffer(generator)) { + generator = new Buffer(generator, genc) + } + + if (typeof prime === 'number') { + return new DH(generatePrime(prime, generator), generator, true) + } + + if (!Buffer.isBuffer(prime)) { + prime = new Buffer(prime, enc) + } + + return new DH(prime, generator, true) +} + +exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman +exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman + +}).call(this,require("buffer").Buffer) +},{"./lib/dh":171,"./lib/generatePrime":172,"./lib/primes.json":173,"buffer":47}],171:[function(require,module,exports){ +(function (Buffer){ +var BN = require('bn.js'); +var MillerRabin = require('miller-rabin'); +var millerRabin = new MillerRabin(); +var TWENTYFOUR = new BN(24); +var ELEVEN = new BN(11); +var TEN = new BN(10); +var THREE = new BN(3); +var SEVEN = new BN(7); +var primes = require('./generatePrime'); +var randomBytes = require('randombytes'); +module.exports = DH; + +function setPublicKey(pub, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(pub)) { + pub = new Buffer(pub, enc); + } + this._pub = new BN(pub); + return this; +} + +function setPrivateKey(priv, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(priv)) { + priv = new Buffer(priv, enc); + } + this._priv = new BN(priv); + return this; +} + +var primeCache = {}; +function checkPrime(prime, generator) { + var gen = generator.toString('hex'); + var hex = [gen, prime.toString(16)].join('_'); + if (hex in primeCache) { + return primeCache[hex]; + } + var error = 0; + + if (prime.isEven() || + !primes.simpleSieve || + !primes.fermatTest(prime) || + !millerRabin.test(prime)) { + //not a prime so +1 + error += 1; + + if (gen === '02' || gen === '05') { + // we'd be able to check the generator + // it would fail so +8 + error += 8; + } else { + //we wouldn't be able to test the generator + // so +4 + error += 4; + } + primeCache[hex] = error; + return error; + } + if (!millerRabin.test(prime.shrn(1))) { + //not a safe prime + error += 2; + } + var rem; + switch (gen) { + case '02': + if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { + // unsuidable generator + error += 8; + } + break; + case '05': + rem = prime.mod(TEN); + if (rem.cmp(THREE) && rem.cmp(SEVEN)) { + // prime mod 10 needs to equal 3 or 7 + error += 8; + } + break; + default: + error += 4; + } + primeCache[hex] = error; + return error; +} + +function DH(prime, generator, malleable) { + this.setGenerator(generator); + this.__prime = new BN(prime); + this._prime = BN.mont(this.__prime); + this._primeLen = prime.length; + this._pub = undefined; + this._priv = undefined; + this._primeCode = undefined; + if (malleable) { + this.setPublicKey = setPublicKey; + this.setPrivateKey = setPrivateKey; + } else { + this._primeCode = 8; + } +} +Object.defineProperty(DH.prototype, 'verifyError', { + enumerable: true, + get: function () { + if (typeof this._primeCode !== 'number') { + this._primeCode = checkPrime(this.__prime, this.__gen); + } + return this._primeCode; + } +}); +DH.prototype.generateKeys = function () { + if (!this._priv) { + this._priv = new BN(randomBytes(this._primeLen)); + } + this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(); + return this.getPublicKey(); +}; + +DH.prototype.computeSecret = function (other) { + other = new BN(other); + other = other.toRed(this._prime); + var secret = other.redPow(this._priv).fromRed(); + var out = new Buffer(secret.toArray()); + var prime = this.getPrime(); + if (out.length < prime.length) { + var front = new Buffer(prime.length - out.length); + front.fill(0); + out = Buffer.concat([front, out]); + } + return out; +}; + +DH.prototype.getPublicKey = function getPublicKey(enc) { + return formatReturnValue(this._pub, enc); +}; + +DH.prototype.getPrivateKey = function getPrivateKey(enc) { + return formatReturnValue(this._priv, enc); +}; + +DH.prototype.getPrime = function (enc) { + return formatReturnValue(this.__prime, enc); +}; + +DH.prototype.getGenerator = function (enc) { + return formatReturnValue(this._gen, enc); +}; + +DH.prototype.setGenerator = function (gen, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(gen)) { + gen = new Buffer(gen, enc); + } + this.__gen = gen; + this._gen = new BN(gen); + return this; +}; + +function formatReturnValue(bn, enc) { + var buf = new Buffer(bn.toArray()); + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } +} + +}).call(this,require("buffer").Buffer) +},{"./generatePrime":172,"bn.js":280,"buffer":47,"miller-rabin":174,"randombytes":243}],172:[function(require,module,exports){ +var randomBytes = require('randombytes'); +module.exports = findPrime; +findPrime.simpleSieve = simpleSieve; +findPrime.fermatTest = fermatTest; +var BN = require('bn.js'); +var TWENTYFOUR = new BN(24); +var MillerRabin = require('miller-rabin'); +var millerRabin = new MillerRabin(); +var ONE = new BN(1); +var TWO = new BN(2); +var FIVE = new BN(5); +var SIXTEEN = new BN(16); +var EIGHT = new BN(8); +var TEN = new BN(10); +var THREE = new BN(3); +var SEVEN = new BN(7); +var ELEVEN = new BN(11); +var FOUR = new BN(4); +var TWELVE = new BN(12); +var primes = null; + +function _getPrimes() { + if (primes !== null) + return primes; + + var limit = 0x100000; + var res = []; + res[0] = 2; + for (var i = 1, k = 3; k < limit; k += 2) { + var sqrt = Math.ceil(Math.sqrt(k)); + for (var j = 0; j < i && res[j] <= sqrt; j++) + if (k % res[j] === 0) + break; + + if (i !== j && res[j] <= sqrt) + continue; + + res[i++] = k; + } + primes = res; + return res; +} + +function simpleSieve(p) { + var primes = _getPrimes(); + + for (var i = 0; i < primes.length; i++) + if (p.modn(primes[i]) === 0) { + if (p.cmpn(primes[i]) === 0) { + return true; + } else { + return false; + } + } + + return true; +} + +function fermatTest(p) { + var red = BN.mont(p); + return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0; +} + +function findPrime(bits, gen) { + if (bits < 16) { + // this is what openssl does + if (gen === 2 || gen === 5) { + return new BN([0x8c, 0x7b]); + } else { + return new BN([0x8c, 0x27]); + } + } + gen = new BN(gen); + + var num, n2; + + while (true) { + num = new BN(randomBytes(Math.ceil(bits / 8))); + while (num.bitLength() > bits) { + num.ishrn(1); + } + if (num.isEven()) { + num.iadd(ONE); + } + if (!num.testn(1)) { + num.iadd(TWO); + } + if (!gen.cmp(TWO)) { + while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { + num.iadd(FOUR); + } + } else if (!gen.cmp(FIVE)) { + while (num.mod(TEN).cmp(THREE)) { + num.iadd(FOUR); + } + } + n2 = num.shrn(1); + if (simpleSieve(n2) && simpleSieve(num) && + fermatTest(n2) && fermatTest(num) && + millerRabin.test(n2) && millerRabin.test(num)) { + return num; + } + } + +} + +},{"bn.js":280,"miller-rabin":174,"randombytes":243}],173:[function(require,module,exports){ +module.exports={ + "modp1": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" + }, + "modp2": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" + }, + "modp5": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" + }, + "modp14": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" + }, + "modp15": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" + }, + "modp16": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" + }, + "modp17": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" + }, + "modp18": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" + } +} +},{}],174:[function(require,module,exports){ +var bn = require('bn.js'); +var brorand = require('brorand'); + +function MillerRabin(rand) { + this.rand = rand || new brorand.Rand(); +} +module.exports = MillerRabin; + +MillerRabin.create = function create(rand) { + return new MillerRabin(rand); +}; + +MillerRabin.prototype._randbelow = function _randbelow(n) { + var len = n.bitLength(); + var min_bytes = Math.ceil(len / 8); + + // Generage random bytes until a number less than n is found. + // This ensures that 0..n-1 have an equal probability of being selected. + do + var a = new bn(this.rand.generate(min_bytes)); + while (a.cmp(n) >= 0); + + return a; +}; + +MillerRabin.prototype._randrange = function _randrange(start, stop) { + // Generate a random number greater than or equal to start and less than stop. + var size = stop.sub(start); + return start.add(this._randbelow(size)); +}; + +MillerRabin.prototype.test = function test(n, k, cb) { + var len = n.bitLength(); + var red = bn.mont(n); + var rone = new bn(1).toRed(red); + + if (!k) + k = Math.max(1, (len / 48) | 0); + + // Find d and s, (n - 1) = (2 ^ s) * d; + var n1 = n.subn(1); + for (var s = 0; !n1.testn(s); s++) {} + var d = n.shrn(s); + + var rn1 = n1.toRed(red); + + var prime = true; + for (; k > 0; k--) { + var a = this._randrange(new bn(2), n1); + if (cb) + cb(a); + + var x = a.toRed(red).redPow(d); + if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) + continue; + + for (var i = 1; i < s; i++) { + x = x.redSqr(); + + if (x.cmp(rone) === 0) + return false; + if (x.cmp(rn1) === 0) + break; + } + + if (i === s) + return false; + } + + return prime; +}; + +MillerRabin.prototype.getDivisor = function getDivisor(n, k) { + var len = n.bitLength(); + var red = bn.mont(n); + var rone = new bn(1).toRed(red); + + if (!k) + k = Math.max(1, (len / 48) | 0); + + // Find d and s, (n - 1) = (2 ^ s) * d; + var n1 = n.subn(1); + for (var s = 0; !n1.testn(s); s++) {} + var d = n.shrn(s); + + var rn1 = n1.toRed(red); + + for (; k > 0; k--) { + var a = this._randrange(new bn(2), n1); + + var g = n.gcd(a); + if (g.cmpn(1) !== 0) + return g; + + var x = a.toRed(red).redPow(d); + if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) + continue; + + for (var i = 1; i < s; i++) { + x = x.redSqr(); + + if (x.cmp(rone) === 0) + return x.fromRed().subn(1).gcd(n); + if (x.cmp(rn1) === 0) + break; + } + + if (i === s) { + x = x.redSqr(); + return x.fromRed().subn(1).gcd(n); + } + } + + return false; +}; + +},{"bn.js":280,"brorand":175}],175:[function(require,module,exports){ +var r; + +module.exports = function rand(len) { + if (!r) + r = new Rand(null); + + return r.generate(len); +}; + +function Rand(rand) { + this.rand = rand; +} +module.exports.Rand = Rand; + +Rand.prototype.generate = function generate(len) { + return this._rand(len); +}; + +// Emulate crypto API using randy +Rand.prototype._rand = function _rand(n) { + if (this.rand.getBytes) + return this.rand.getBytes(n); + + var res = new Uint8Array(n); + for (var i = 0; i < res.length; i++) + res[i] = this.rand.getByte(); + return res; +}; + +if (typeof self === 'object') { + if (self.crypto && self.crypto.getRandomValues) { + // Modern browsers + Rand.prototype._rand = function _rand(n) { + var arr = new Uint8Array(n); + self.crypto.getRandomValues(arr); + return arr; + }; + } else if (self.msCrypto && self.msCrypto.getRandomValues) { + // IE + Rand.prototype._rand = function _rand(n) { + var arr = new Uint8Array(n); + self.msCrypto.getRandomValues(arr); + return arr; + }; + + // Safari's WebWorkers do not have `crypto` + } else if (typeof window === 'object') { + // Old junk + Rand.prototype._rand = function() { + throw new Error('Not implemented yet'); + }; + } +} else { + // Node.js or Web worker with no crypto support + try { + var crypto = require('crypto'); + if (typeof crypto.randomBytes !== 'function') + throw new Error('Not supported'); + + Rand.prototype._rand = function _rand(n) { + return crypto.randomBytes(n); + }; + } catch (e) { + } +} + +},{"crypto":46}],176:[function(require,module,exports){ + +exports.pbkdf2 = require('./lib/async') + +exports.pbkdf2Sync = require('./lib/sync') + +},{"./lib/async":177,"./lib/sync":180}],177:[function(require,module,exports){ +(function (process,global){ +var checkParameters = require('./precondition') +var defaultEncoding = require('./default-encoding') +var sync = require('./sync') +var Buffer = require('safe-buffer').Buffer + +var ZERO_BUF +var subtle = global.crypto && global.crypto.subtle +var toBrowser = { + 'sha': 'SHA-1', + 'sha-1': 'SHA-1', + 'sha1': 'SHA-1', + 'sha256': 'SHA-256', + 'sha-256': 'SHA-256', + 'sha384': 'SHA-384', + 'sha-384': 'SHA-384', + 'sha-512': 'SHA-512', + 'sha512': 'SHA-512' +} +var checks = [] +function checkNative (algo) { + if (global.process && !global.process.browser) { + return Promise.resolve(false) + } + if (!subtle || !subtle.importKey || !subtle.deriveBits) { + return Promise.resolve(false) + } + if (checks[algo] !== undefined) { + return checks[algo] + } + ZERO_BUF = ZERO_BUF || Buffer.alloc(8) + var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo) + .then(function () { + return true + }).catch(function () { + return false + }) + checks[algo] = prom + return prom +} +function browserPbkdf2 (password, salt, iterations, length, algo) { + return subtle.importKey( + 'raw', password, {name: 'PBKDF2'}, false, ['deriveBits'] + ).then(function (key) { + return subtle.deriveBits({ + name: 'PBKDF2', + salt: salt, + iterations: iterations, + hash: { + name: algo + } + }, key, length << 3) + }).then(function (res) { + return Buffer.from(res) + }) +} +function resolvePromise (promise, callback) { + promise.then(function (out) { + process.nextTick(function () { + callback(null, out) + }) + }, function (e) { + process.nextTick(function () { + callback(e) + }) + }) +} +module.exports = function (password, salt, iterations, keylen, digest, callback) { + if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) + + checkParameters(iterations, keylen) + if (typeof digest === 'function') { + callback = digest + digest = undefined + } + if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') + + digest = digest || 'sha1' + var algo = toBrowser[digest.toLowerCase()] + if (!algo || typeof global.Promise !== 'function') { + return process.nextTick(function () { + var out + try { + out = sync(password, salt, iterations, keylen, digest) + } catch (e) { + return callback(e) + } + callback(null, out) + }) + } + resolvePromise(checkNative(algo).then(function (resp) { + if (resp) { + return browserPbkdf2(password, salt, iterations, keylen, algo) + } else { + return sync(password, salt, iterations, keylen, digest) + } + }), callback) +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./default-encoding":178,"./precondition":179,"./sync":180,"_process":247,"safe-buffer":183}],178:[function(require,module,exports){ +(function (process){ +var defaultEncoding +/* istanbul ignore next */ +if (process.browser) { + defaultEncoding = 'utf-8' +} else { + var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) + + defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary' +} +module.exports = defaultEncoding + +}).call(this,require('_process')) +},{"_process":247}],179:[function(require,module,exports){ +var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs +module.exports = function (iterations, keylen) { + if (typeof iterations !== 'number') { + throw new TypeError('Iterations not a number') + } + + if (iterations < 0) { + throw new TypeError('Bad iterations') + } + + if (typeof keylen !== 'number') { + throw new TypeError('Key length not a number') + } + + if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ + throw new TypeError('Bad key length') + } +} + +},{}],180:[function(require,module,exports){ +var md5 = require('create-hash/md5') +var rmd160 = require('ripemd160') +var sha = require('sha.js') + +var checkParameters = require('./precondition') +var defaultEncoding = require('./default-encoding') +var Buffer = require('safe-buffer').Buffer +var ZEROS = Buffer.alloc(128) +var sizes = { + md5: 16, + sha1: 20, + sha224: 28, + sha256: 32, + sha384: 48, + sha512: 64, + rmd160: 20, + ripemd160: 20 +} + +function Hmac (alg, key, saltLen) { + var hash = getDigest(alg) + var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 + + if (key.length > blocksize) { + key = hash(key) + } else if (key.length < blocksize) { + key = Buffer.concat([key, ZEROS], blocksize) + } + + var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]) + var opad = Buffer.allocUnsafe(blocksize + sizes[alg]) + for (var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4) + ipad.copy(ipad1, 0, 0, blocksize) + this.ipad1 = ipad1 + this.ipad2 = ipad + this.opad = opad + this.alg = alg + this.blocksize = blocksize + this.hash = hash + this.size = sizes[alg] +} + +Hmac.prototype.run = function (data, ipad) { + data.copy(ipad, this.blocksize) + var h = this.hash(ipad) + h.copy(this.opad, this.blocksize) + return this.hash(this.opad) +} + +function getDigest (alg) { + function shaFunc (data) { + return sha(alg).update(data).digest() + } + + if (alg === 'rmd160' || alg === 'ripemd160') return rmd160 + if (alg === 'md5') return md5 + return shaFunc +} + +function pbkdf2 (password, salt, iterations, keylen, digest) { + if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) + + checkParameters(iterations, keylen) + + digest = digest || 'sha1' + + var hmac = new Hmac(digest, password, salt.length) + + var DK = Buffer.allocUnsafe(keylen) + var block1 = Buffer.allocUnsafe(salt.length + 4) + salt.copy(block1, 0, 0, salt.length) + + var destPos = 0 + var hLen = sizes[digest] + var l = Math.ceil(keylen / hLen) + + for (var i = 1; i <= l; i++) { + block1.writeUInt32BE(i, salt.length) + + var T = hmac.run(block1, hmac.ipad1) + var U = T + + for (var j = 1; j < iterations; j++) { + U = hmac.run(U, hmac.ipad2) + for (var k = 0; k < hLen; k++) T[k] ^= U[k] + } + + T.copy(DK, destPos) + destPos += hLen + } + + return DK +} + +module.exports = pbkdf2 + +},{"./default-encoding":178,"./precondition":179,"create-hash/md5":142,"ripemd160":181,"safe-buffer":183,"sha.js":185}],181:[function(require,module,exports){ +arguments[4][145][0].apply(exports,arguments) +},{"buffer":47,"dup":145,"hash-base":182,"inherits":318}],182:[function(require,module,exports){ +arguments[4][146][0].apply(exports,arguments) +},{"buffer":47,"dup":146,"inherits":318,"stream":272}],183:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],184:[function(require,module,exports){ +arguments[4][147][0].apply(exports,arguments) +},{"dup":147,"safe-buffer":183}],185:[function(require,module,exports){ +arguments[4][148][0].apply(exports,arguments) +},{"./sha":186,"./sha1":187,"./sha224":188,"./sha256":189,"./sha384":190,"./sha512":191,"dup":148}],186:[function(require,module,exports){ +arguments[4][150][0].apply(exports,arguments) +},{"./hash":184,"dup":150,"inherits":318,"safe-buffer":183}],187:[function(require,module,exports){ +arguments[4][151][0].apply(exports,arguments) +},{"./hash":184,"dup":151,"inherits":318,"safe-buffer":183}],188:[function(require,module,exports){ +arguments[4][152][0].apply(exports,arguments) +},{"./hash":184,"./sha256":189,"dup":152,"inherits":318,"safe-buffer":183}],189:[function(require,module,exports){ +arguments[4][153][0].apply(exports,arguments) +},{"./hash":184,"dup":153,"inherits":318,"safe-buffer":183}],190:[function(require,module,exports){ +arguments[4][154][0].apply(exports,arguments) +},{"./hash":184,"./sha512":191,"dup":154,"inherits":318,"safe-buffer":183}],191:[function(require,module,exports){ +arguments[4][155][0].apply(exports,arguments) +},{"./hash":184,"dup":155,"inherits":318,"safe-buffer":183}],192:[function(require,module,exports){ +exports.publicEncrypt = require('./publicEncrypt'); +exports.privateDecrypt = require('./privateDecrypt'); + +exports.privateEncrypt = function privateEncrypt(key, buf) { + return exports.publicEncrypt(key, buf, true); +}; + +exports.publicDecrypt = function publicDecrypt(key, buf) { + return exports.privateDecrypt(key, buf, true); +}; +},{"./privateDecrypt":239,"./publicEncrypt":240}],193:[function(require,module,exports){ +(function (Buffer){ +var createHash = require('create-hash'); +module.exports = function (seed, len) { + var t = new Buffer(''); + var i = 0, c; + while (t.length < len) { + c = i2ops(i++); + t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]); + } + return t.slice(0, len); +}; + +function i2ops(c) { + var out = new Buffer(4); + out.writeUInt32BE(c,0); + return out; +} +}).call(this,require("buffer").Buffer) +},{"buffer":47,"create-hash":140}],194:[function(require,module,exports){ +arguments[4][94][0].apply(exports,arguments) +},{"bn.js":280,"buffer":47,"dup":94,"randombytes":243}],195:[function(require,module,exports){ +arguments[4][95][0].apply(exports,arguments) +},{"dup":95}],196:[function(require,module,exports){ +arguments[4][96][0].apply(exports,arguments) +},{"./certificate":197,"asn1.js":200,"dup":96}],197:[function(require,module,exports){ +arguments[4][97][0].apply(exports,arguments) +},{"asn1.js":200,"dup":97}],198:[function(require,module,exports){ +arguments[4][98][0].apply(exports,arguments) +},{"browserify-aes":217,"buffer":47,"dup":98,"evp_bytestokey":235}],199:[function(require,module,exports){ +arguments[4][99][0].apply(exports,arguments) +},{"./aesid.json":195,"./asn1":196,"./fixProc":198,"browserify-aes":217,"buffer":47,"dup":99,"pbkdf2":176}],200:[function(require,module,exports){ +arguments[4][100][0].apply(exports,arguments) +},{"./asn1/api":201,"./asn1/base":203,"./asn1/constants":207,"./asn1/decoders":209,"./asn1/encoders":212,"bn.js":280,"dup":100}],201:[function(require,module,exports){ +arguments[4][101][0].apply(exports,arguments) +},{"../asn1":200,"dup":101,"inherits":318,"vm":278}],202:[function(require,module,exports){ +arguments[4][102][0].apply(exports,arguments) +},{"../base":203,"buffer":47,"dup":102,"inherits":318}],203:[function(require,module,exports){ +arguments[4][103][0].apply(exports,arguments) +},{"./buffer":202,"./node":204,"./reporter":205,"dup":103}],204:[function(require,module,exports){ +arguments[4][104][0].apply(exports,arguments) +},{"../base":203,"dup":104,"minimalistic-assert":214}],205:[function(require,module,exports){ +arguments[4][105][0].apply(exports,arguments) +},{"dup":105,"inherits":318}],206:[function(require,module,exports){ +arguments[4][106][0].apply(exports,arguments) +},{"../constants":207,"dup":106}],207:[function(require,module,exports){ +arguments[4][107][0].apply(exports,arguments) +},{"./der":206,"dup":107}],208:[function(require,module,exports){ +arguments[4][108][0].apply(exports,arguments) +},{"../../asn1":200,"dup":108,"inherits":318}],209:[function(require,module,exports){ +arguments[4][109][0].apply(exports,arguments) +},{"./der":208,"./pem":210,"dup":109}],210:[function(require,module,exports){ +arguments[4][110][0].apply(exports,arguments) +},{"./der":208,"buffer":47,"dup":110,"inherits":318}],211:[function(require,module,exports){ +arguments[4][111][0].apply(exports,arguments) +},{"../../asn1":200,"buffer":47,"dup":111,"inherits":318}],212:[function(require,module,exports){ +arguments[4][112][0].apply(exports,arguments) +},{"./der":211,"./pem":213,"dup":112}],213:[function(require,module,exports){ +arguments[4][113][0].apply(exports,arguments) +},{"./der":211,"dup":113,"inherits":318}],214:[function(require,module,exports){ +arguments[4][83][0].apply(exports,arguments) +},{"dup":83}],215:[function(require,module,exports){ +arguments[4][53][0].apply(exports,arguments) +},{"dup":53,"safe-buffer":233}],216:[function(require,module,exports){ +arguments[4][54][0].apply(exports,arguments) +},{"./aes":215,"./ghash":220,"./incr32":221,"buffer-xor":231,"cipher-base":232,"dup":54,"inherits":318,"safe-buffer":233}],217:[function(require,module,exports){ +arguments[4][55][0].apply(exports,arguments) +},{"./decrypter":218,"./encrypter":219,"./modes/list.json":229,"dup":55}],218:[function(require,module,exports){ +arguments[4][56][0].apply(exports,arguments) +},{"./aes":215,"./authCipher":216,"./modes":228,"./streamCipher":234,"cipher-base":232,"dup":56,"evp_bytestokey":235,"inherits":318,"safe-buffer":233}],219:[function(require,module,exports){ +arguments[4][57][0].apply(exports,arguments) +},{"./aes":215,"./authCipher":216,"./modes":228,"./streamCipher":234,"cipher-base":232,"dup":57,"evp_bytestokey":235,"inherits":318,"safe-buffer":233}],220:[function(require,module,exports){ +arguments[4][58][0].apply(exports,arguments) +},{"dup":58,"safe-buffer":233}],221:[function(require,module,exports){ +arguments[4][59][0].apply(exports,arguments) +},{"dup":59}],222:[function(require,module,exports){ +arguments[4][60][0].apply(exports,arguments) +},{"buffer-xor":231,"dup":60}],223:[function(require,module,exports){ +arguments[4][61][0].apply(exports,arguments) +},{"buffer-xor":231,"dup":61,"safe-buffer":233}],224:[function(require,module,exports){ +arguments[4][62][0].apply(exports,arguments) +},{"dup":62,"safe-buffer":233}],225:[function(require,module,exports){ +arguments[4][63][0].apply(exports,arguments) +},{"dup":63,"safe-buffer":233}],226:[function(require,module,exports){ +arguments[4][64][0].apply(exports,arguments) +},{"../incr32":221,"buffer-xor":231,"dup":64,"safe-buffer":233}],227:[function(require,module,exports){ +arguments[4][65][0].apply(exports,arguments) +},{"dup":65}],228:[function(require,module,exports){ +arguments[4][66][0].apply(exports,arguments) +},{"./cbc":222,"./cfb":223,"./cfb1":224,"./cfb8":225,"./ctr":226,"./ecb":227,"./list.json":229,"./ofb":230,"dup":66}],229:[function(require,module,exports){ +arguments[4][67][0].apply(exports,arguments) +},{"dup":67}],230:[function(require,module,exports){ +arguments[4][68][0].apply(exports,arguments) +},{"buffer":47,"buffer-xor":231,"dup":68}],231:[function(require,module,exports){ +arguments[4][69][0].apply(exports,arguments) +},{"buffer":47,"dup":69}],232:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"dup":70,"inherits":318,"safe-buffer":233,"stream":272,"string_decoder":273}],233:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],234:[function(require,module,exports){ +arguments[4][72][0].apply(exports,arguments) +},{"./aes":215,"cipher-base":232,"dup":72,"inherits":318,"safe-buffer":233}],235:[function(require,module,exports){ +arguments[4][84][0].apply(exports,arguments) +},{"dup":84,"md5.js":236,"safe-buffer":238}],236:[function(require,module,exports){ +arguments[4][85][0].apply(exports,arguments) +},{"buffer":47,"dup":85,"hash-base":237,"inherits":318}],237:[function(require,module,exports){ +arguments[4][86][0].apply(exports,arguments) +},{"dup":86,"inherits":318,"safe-buffer":238,"stream":272}],238:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],239:[function(require,module,exports){ +(function (Buffer){ +var parseKeys = require('parse-asn1'); +var mgf = require('./mgf'); +var xor = require('./xor'); +var bn = require('bn.js'); +var crt = require('browserify-rsa'); +var createHash = require('create-hash'); +var withPublic = require('./withPublic'); +module.exports = function privateDecrypt(private_key, enc, reverse) { + var padding; + if (private_key.padding) { + padding = private_key.padding; + } else if (reverse) { + padding = 1; + } else { + padding = 4; + } + + var key = parseKeys(private_key); + var k = key.modulus.byteLength(); + if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) { + throw new Error('decryption error'); + } + var msg; + if (reverse) { + msg = withPublic(new bn(enc), key); + } else { + msg = crt(enc, key); + } + var zBuffer = new Buffer(k - msg.length); + zBuffer.fill(0); + msg = Buffer.concat([zBuffer, msg], k); + if (padding === 4) { + return oaep(key, msg); + } else if (padding === 1) { + return pkcs1(key, msg, reverse); + } else if (padding === 3) { + return msg; + } else { + throw new Error('unknown padding'); + } +}; + +function oaep(key, msg){ + var n = key.modulus; + var k = key.modulus.byteLength(); + var mLen = msg.length; + var iHash = createHash('sha1').update(new Buffer('')).digest(); + var hLen = iHash.length; + var hLen2 = 2 * hLen; + if (msg[0] !== 0) { + throw new Error('decryption error'); + } + var maskedSeed = msg.slice(1, hLen + 1); + var maskedDb = msg.slice(hLen + 1); + var seed = xor(maskedSeed, mgf(maskedDb, hLen)); + var db = xor(maskedDb, mgf(seed, k - hLen - 1)); + if (compare(iHash, db.slice(0, hLen))) { + throw new Error('decryption error'); + } + var i = hLen; + while (db[i] === 0) { + i++; + } + if (db[i++] !== 1) { + throw new Error('decryption error'); + } + return db.slice(i); +} + +function pkcs1(key, msg, reverse){ + var p1 = msg.slice(0, 2); + var i = 2; + var status = 0; + while (msg[i++] !== 0) { + if (i >= msg.length) { + status++; + break; + } + } + var ps = msg.slice(2, i - 1); + var p2 = msg.slice(i - 1, i); + + if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)){ + status++; + } + if (ps.length < 8) { + status++; + } + if (status) { + throw new Error('decryption error'); + } + return msg.slice(i); +} +function compare(a, b){ + a = new Buffer(a); + b = new Buffer(b); + var dif = 0; + var len = a.length; + if (a.length !== b.length) { + dif++; + len = Math.min(a.length, b.length); + } + var i = -1; + while (++i < len) { + dif += (a[i] ^ b[i]); + } + return dif; +} +}).call(this,require("buffer").Buffer) +},{"./mgf":193,"./withPublic":241,"./xor":242,"bn.js":280,"browserify-rsa":194,"buffer":47,"create-hash":140,"parse-asn1":199}],240:[function(require,module,exports){ +(function (Buffer){ +var parseKeys = require('parse-asn1'); +var randomBytes = require('randombytes'); +var createHash = require('create-hash'); +var mgf = require('./mgf'); +var xor = require('./xor'); +var bn = require('bn.js'); +var withPublic = require('./withPublic'); +var crt = require('browserify-rsa'); + +var constants = { + RSA_PKCS1_OAEP_PADDING: 4, + RSA_PKCS1_PADDIN: 1, + RSA_NO_PADDING: 3 +}; + +module.exports = function publicEncrypt(public_key, msg, reverse) { + var padding; + if (public_key.padding) { + padding = public_key.padding; + } else if (reverse) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(public_key); + var paddedMsg; + if (padding === 4) { + paddedMsg = oaep(key, msg); + } else if (padding === 1) { + paddedMsg = pkcs1(key, msg, reverse); + } else if (padding === 3) { + paddedMsg = new bn(msg); + if (paddedMsg.cmp(key.modulus) >= 0) { + throw new Error('data too long for modulus'); + } + } else { + throw new Error('unknown padding'); + } + if (reverse) { + return crt(paddedMsg, key); + } else { + return withPublic(paddedMsg, key); + } +}; + +function oaep(key, msg){ + var k = key.modulus.byteLength(); + var mLen = msg.length; + var iHash = createHash('sha1').update(new Buffer('')).digest(); + var hLen = iHash.length; + var hLen2 = 2 * hLen; + if (mLen > k - hLen2 - 2) { + throw new Error('message too long'); + } + var ps = new Buffer(k - mLen - hLen2 - 2); + ps.fill(0); + var dblen = k - hLen - 1; + var seed = randomBytes(hLen); + var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen)); + var maskedSeed = xor(seed, mgf(maskedDb, hLen)); + return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k)); +} +function pkcs1(key, msg, reverse){ + var mLen = msg.length; + var k = key.modulus.byteLength(); + if (mLen > k - 11) { + throw new Error('message too long'); + } + var ps; + if (reverse) { + ps = new Buffer(k - mLen - 3); + ps.fill(0xff); + } else { + ps = nonZero(k - mLen - 3); + } + return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); +} +function nonZero(len, crypto) { + var out = new Buffer(len); + var i = 0; + var cache = randomBytes(len*2); + var cur = 0; + var num; + while (i < len) { + if (cur === cache.length) { + cache = randomBytes(len*2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i++] = num; + } + } + return out; +} +}).call(this,require("buffer").Buffer) +},{"./mgf":193,"./withPublic":241,"./xor":242,"bn.js":280,"browserify-rsa":194,"buffer":47,"create-hash":140,"parse-asn1":199,"randombytes":243}],241:[function(require,module,exports){ +(function (Buffer){ +var bn = require('bn.js'); +function withPublic(paddedMsg, key) { + return new Buffer(paddedMsg + .toRed(bn.mont(key.modulus)) + .redPow(new bn(key.publicExponent)) + .fromRed() + .toArray()); +} + +module.exports = withPublic; +}).call(this,require("buffer").Buffer) +},{"bn.js":280,"buffer":47}],242:[function(require,module,exports){ +module.exports = function xor(a, b) { + var len = a.length; + var i = -1; + while (++i < len) { + a[i] ^= b[i]; + } + return a +}; +},{}],243:[function(require,module,exports){ +(function (process,global){ +'use strict' + +function oldBrowser () { + throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') +} + +var Buffer = require('safe-buffer').Buffer +var crypto = global.crypto || global.msCrypto + +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser +} + +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > 65536) throw new Error('requested too many random bytes') + // in case browserify isn't using the Uint8Array version + var rawBytes = new global.Uint8Array(size) + + // This will not work in older browsers. + // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + if (size > 0) { // getRandomValues fails on IE if size == 0 + crypto.getRandomValues(rawBytes) + } + + // XXX: phantomjs doesn't like a buffer being passed here + var bytes = Buffer.from(rawBytes.buffer) + + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) + } + + return bytes +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":247,"safe-buffer":244}],244:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],245:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + err.context = er; + throw err; + } + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}],246:[function(require,module,exports){ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} + +},{}],247:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],248:[function(require,module,exports){ +(function (global){ +/*! https://mths.be/punycode v1.4.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],249:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{}],250:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + +},{}],251:[function(require,module,exports){ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); + +},{"./decode":249,"./encode":250}],252:[function(require,module,exports){ +module.exports = require('./lib/_stream_duplex.js'); + +},{"./lib/_stream_duplex.js":253}],253:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + processNextTick(cb, err); +}; + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} +},{"./_stream_readable":255,"./_stream_writable":257,"core-util-is":261,"inherits":262,"process-nextick-args":264}],254:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":256,"core-util-is":261,"inherits":262}],255:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var processNextTick = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +// TODO(bmeurer): Change this back to const once hole checks are +// properly optimized away early in Ignition+TurboFan. +/**/ +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') { + return emitter.prependListener(event, fn); + } else { + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + } +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./_stream_duplex":253,"./internal/streams/BufferList":258,"./internal/streams/destroy":259,"./internal/streams/stream":260,"_process":247,"core-util-is":261,"events":245,"inherits":262,"isarray":263,"process-nextick-args":264,"safe-buffer":265,"string_decoder/":266,"util":46}],256:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return stream.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) stream.push(data); + + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er, data) { + done(stream, er, data); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data !== null && data !== undefined) stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + + if (ts.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} +},{"./_stream_duplex":253,"core-util-is":261,"inherits":262}],257:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var processNextTick = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = _isUint8Array(chunk) && !state.objectMode; + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + processNextTick(cb, er); + // this can emit finish, and it will always happen + // after error + processNextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + processNextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./_stream_duplex":253,"./internal/streams/destroy":259,"./internal/streams/stream":260,"_process":247,"core-util-is":261,"inherits":262,"process-nextick-args":264,"safe-buffer":265,"util-deprecate":267}],258:[function(require,module,exports){ +'use strict'; + +/**/ + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +/**/ + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); +},{"safe-buffer":265}],259:[function(require,module,exports){ +'use strict'; + +/**/ + +var processNextTick = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + processNextTick(emitErrorNT, this, err); + } + return; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + processNextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; +},{"process-nextick-args":264}],260:[function(require,module,exports){ +module.exports = require('events').EventEmitter; + +},{"events":245}],261:[function(require,module,exports){ +(function (Buffer){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +}).call(this,{"isBuffer":require("../../../../insert-module-globals/node_modules/is-buffer/index.js")}) +},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":246}],262:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],263:[function(require,module,exports){ +arguments[4][50][0].apply(exports,arguments) +},{"dup":50}],264:[function(require,module,exports){ +(function (process){ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + +}).call(this,require('_process')) +},{"_process":247}],265:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],266:[function(require,module,exports){ +'use strict'; + +var Buffer = require('safe-buffer').Buffer; + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return -1; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'.repeat(p); + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'.repeat(p + 1); + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'.repeat(p + 2); + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character for each buffered byte of a (partial) +// character needs to be added to the output. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed); + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} +},{"safe-buffer":265}],267:[function(require,module,exports){ +(function (global){ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],268:[function(require,module,exports){ +module.exports = require('./readable').PassThrough + +},{"./readable":269}],269:[function(require,module,exports){ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +},{"./lib/_stream_duplex.js":253,"./lib/_stream_passthrough.js":254,"./lib/_stream_readable.js":255,"./lib/_stream_transform.js":256,"./lib/_stream_writable.js":257}],270:[function(require,module,exports){ +module.exports = require('./readable').Transform + +},{"./readable":269}],271:[function(require,module,exports){ +module.exports = require('./lib/_stream_writable.js'); + +},{"./lib/_stream_writable.js":257}],272:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Stream; + +var EE = require('events').EventEmitter; +var inherits = require('inherits'); + +inherits(Stream, EE); +Stream.Readable = require('readable-stream/readable.js'); +Stream.Writable = require('readable-stream/writable.js'); +Stream.Duplex = require('readable-stream/duplex.js'); +Stream.Transform = require('readable-stream/transform.js'); +Stream.PassThrough = require('readable-stream/passthrough.js'); + +// Backwards-compat with node 0.4.x +Stream.Stream = Stream; + + + +// old-style streams. Note that the pipe method (the only relevant +// part of this class) is overridden in the Readable class. + +function Stream() { + EE.call(this); +} + +Stream.prototype.pipe = function(dest, options) { + var source = this; + + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); + } + } + } + + source.on('data', ondata); + + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + + dest.on('drain', ondrain); + + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend); + source.on('close', onclose); + } + + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + + dest.end(); + } + + + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + + if (typeof dest.destroy === 'function') dest.destroy(); + } + + // don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, 'error') === 0) { + throw er; // Unhandled stream error in pipe. + } + } + + source.on('error', onerror); + dest.on('error', onerror); + + // remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata); + dest.removeListener('drain', ondrain); + + source.removeListener('end', onend); + source.removeListener('close', onclose); + + source.removeListener('error', onerror); + dest.removeListener('error', onerror); + + source.removeListener('end', cleanup); + source.removeListener('close', cleanup); + + dest.removeListener('close', cleanup); + } + + source.on('end', cleanup); + source.on('close', cleanup); + + dest.on('close', cleanup); + + dest.emit('pipe', source); + + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest; +}; + +},{"events":245,"inherits":318,"readable-stream/duplex.js":252,"readable-stream/passthrough.js":268,"readable-stream/readable.js":269,"readable-stream/transform.js":270,"readable-stream/writable.js":271}],273:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} + +},{"buffer":47}],274:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var punycode = require('punycode'); +var util = require('./util'); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; + +},{"./util":275,"punycode":248,"querystring":251}],275:[function(require,module,exports){ +'use strict'; + +module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } +}; + +},{}],276:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],277:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":276,"_process":247,"inherits":318}],278:[function(require,module,exports){ +var indexOf = require('indexof'); + +var Object_keys = function (obj) { + if (Object.keys) return Object.keys(obj) + else { + var res = []; + for (var key in obj) res.push(key) + return res; + } +}; + +var forEach = function (xs, fn) { + if (xs.forEach) return xs.forEach(fn) + else for (var i = 0; i < xs.length; i++) { + fn(xs[i], i, xs); + } +}; + +var defineProp = (function() { + try { + Object.defineProperty({}, '_', {}); + return function(obj, name, value) { + Object.defineProperty(obj, name, { + writable: true, + enumerable: false, + configurable: true, + value: value + }) + }; + } catch(e) { + return function(obj, name, value) { + obj[name] = value; + }; + } +}()); + +var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function', +'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError', +'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError', +'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', +'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape']; + +function Context() {} +Context.prototype = {}; + +var Script = exports.Script = function NodeScript (code) { + if (!(this instanceof Script)) return new Script(code); + this.code = code; +}; + +Script.prototype.runInContext = function (context) { + if (!(context instanceof Context)) { + throw new TypeError("needs a 'context' argument."); + } + + var iframe = document.createElement('iframe'); + if (!iframe.style) iframe.style = {}; + iframe.style.display = 'none'; + + document.body.appendChild(iframe); + + var win = iframe.contentWindow; + var wEval = win.eval, wExecScript = win.execScript; + + if (!wEval && wExecScript) { + // win.eval() magically appears when this is called in IE: + wExecScript.call(win, 'null'); + wEval = win.eval; + } + + forEach(Object_keys(context), function (key) { + win[key] = context[key]; + }); + forEach(globals, function (key) { + if (context[key]) { + win[key] = context[key]; + } + }); + + var winKeys = Object_keys(win); + + var res = wEval.call(win, this.code); + + forEach(Object_keys(win), function (key) { + // Avoid copying circular objects like `top` and `window` by only + // updating existing context properties or new properties in the `win` + // that was only introduced after the eval. + if (key in context || indexOf(winKeys, key) === -1) { + context[key] = win[key]; + } + }); + + forEach(globals, function (key) { + if (!(key in context)) { + defineProp(context, key, win[key]); + } + }); + + document.body.removeChild(iframe); + + return res; +}; + +Script.prototype.runInThisContext = function () { + return eval(this.code); // maybe... +}; + +Script.prototype.runInNewContext = function (context) { + var ctx = Script.createContext(context); + var res = this.runInContext(ctx); + + forEach(Object_keys(ctx), function (key) { + context[key] = ctx[key]; + }); + + return res; +}; + +forEach(Object_keys(Script.prototype), function (name) { + exports[name] = Script[name] = function (code) { + var s = Script(code); + return s[name].apply(s, [].slice.call(arguments, 1)); + }; +}); + +exports.createScript = function (code) { + return exports.Script(code); +}; + +exports.createContext = Script.createContext = function (context) { + var copy = new Context(); + if(typeof context === 'object') { + forEach(Object_keys(context), function (key) { + copy[key] = context[key]; + }); + } + return copy; +}; + +},{"indexof":279}],279:[function(require,module,exports){ + +var indexOf = [].indexOf; + +module.exports = function(arr, obj){ + if (indexOf) return arr.indexOf(obj); + for (var i = 0; i < arr.length; ++i) { + if (arr[i] === obj) return i; + } + return -1; +}; +},{}],280:[function(require,module,exports){ +(function (module, exports) { + 'use strict'; + + // Utils + function assert (val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } + + // Could use `inherits` module, but don't want to move from single file + // architecture yet. + function inherits (ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + + // BN + + function BN (number, base, endian) { + if (BN.isBN(number)) { + return number; + } + + this.negative = 0; + this.words = null; + this.length = 0; + + // Reduction context + this.red = null; + + if (number !== null) { + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } + + this._init(number || 0, base || 10, endian || 'be'); + } + } + if (typeof module === 'object') { + module.exports = BN; + } else { + exports.BN = BN; + } + + BN.BN = BN; + BN.wordSize = 26; + + var Buffer; + try { + Buffer = require('buffer').Buffer; + } catch (e) { + } + + BN.isBN = function isBN (num) { + if (num instanceof BN) { + return true; + } + + return num !== null && typeof num === 'object' && + num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + + BN.max = function max (left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; + + BN.min = function min (left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; + + BN.prototype._init = function init (number, base, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base, endian); + } + + if (typeof number === 'object') { + return this._initArray(number, base, endian); + } + + if (base === 'hex') { + base = 16; + } + assert(base === (base | 0) && base >= 2 && base <= 36); + + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + } + + if (base === 16) { + this._parseHex(number, start); + } else { + this._parseBase(number, base, start); + } + + if (number[0] === '-') { + this.negative = 1; + } + + this.strip(); + + if (endian !== 'le') return; + + this._initArray(this.toArray(), base, endian); + }; + + BN.prototype._initNumber = function _initNumber (number, base, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 0x4000000) { + this.words = [ number & 0x3ffffff ]; + this.length = 1; + } else if (number < 0x10000000000000) { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } + + if (endian !== 'le') return; + + // Reverse the bytes + this._initArray(this.toArray(), base, endian); + }; + + BN.prototype._initArray = function _initArray (number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [ 0 ]; + this.length = 1; + return this; + } + + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + var j, w; + var off = 0; + if (endian === 'be') { + for (i = number.length - 1, j = 0; i >= 0; i -= 3) { + w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i = 0, j = 0; i < number.length; i += 3) { + w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this.strip(); + }; + + function parseHex (str, start, end) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; + + r <<= 4; + + // 'a' - 'f' + if (c >= 49 && c <= 54) { + r |= c - 49 + 0xa; + + // 'A' - 'F' + } else if (c >= 17 && c <= 22) { + r |= c - 17 + 0xa; + + // '0' - '9' + } else { + r |= c & 0xf; + } + } + return r; + } + + BN.prototype._parseHex = function _parseHex (number, start) { + // Create possibly bigger array to ensure that it fits the number + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + var j, w; + // Scan 24-bit chunks and add them to the number + var off = 0; + for (i = number.length - 6, j = 0; i >= start; i -= 6) { + w = parseHex(number, i, i + 6); + this.words[j] |= (w << off) & 0x3ffffff; + // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb + this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + if (i + 6 !== start) { + w = parseHex(number, start, i + 6); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; + } + this.strip(); + }; + + function parseBase (str, start, end, mul) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; + + r *= mul; + + // 'a' + if (c >= 49) { + r += c - 49 + 0xa; + + // 'A' + } else if (c >= 17) { + r += c - 17 + 0xa; + + // '0' - '9' + } else { + r += c; + } + } + return r; + } + + BN.prototype._parseBase = function _parseBase (number, base, start) { + // Initialize as zero + this.words = [ 0 ]; + this.length = 1; + + // Find length of limb in base + for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base) | 0; + + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; + + var word = 0; + for (var i = start; i < end; i += limbLen) { + word = parseBase(number, i, i + limbLen, base); + + this.imuln(limbPow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i, number.length, base); + + for (i = 0; i < mod; i++) { + pow *= base; + } + + this.imuln(pow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + }; + + BN.prototype.copy = function copy (dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + dest.words[i] = this.words[i]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; + + BN.prototype.clone = function clone () { + var r = new BN(null); + this.copy(r); + return r; + }; + + BN.prototype._expand = function _expand (size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; + + // Remove leading `0` from `this` + BN.prototype.strip = function strip () { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; + + BN.prototype._normSign = function _normSign () { + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; + + BN.prototype.inspect = function inspect () { + return (this.red ? ''; + }; + + /* + + var zeros = []; + var groupSizes = []; + var groupBases = []; + + var s = ''; + var i = -1; + while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; + } + groupSizes[0] = 0; + groupSizes[1] = 0; + groupBases[0] = 0; + groupBases[1] = 0; + var base = 2 - 1; + while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; + } + + */ + + var zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' + ]; + + var groupSizes = [ + 0, 0, + 25, 16, 12, 11, 10, 9, 8, + 8, 7, 7, 7, 7, 6, 6, + 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5 + ]; + + var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 + ]; + + BN.prototype.toString = function toString (base, padding) { + base = base || 10; + padding = padding | 0 || 1; + + var out; + if (base === 16 || base === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = this.words[i]; + var word = (((w << off) | carry) & 0xffffff).toString(16); + carry = (w >>> (24 - off)) & 0xffffff; + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off += 2; + if (off >= 26) { + off -= 26; + i--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r = c.modn(groupBase).toString(base); + c = c.idivn(groupBase); + + if (!c.isZero()) { + out = zeros[groupSize - r.length] + r + out; + } else { + out = r + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + assert(false, 'Base should be between 2 and 36'); + }; + + BN.prototype.toNumber = function toNumber () { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // NOTE: at this stage it is known that the top bit is set + ret += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + assert(false, 'Number can only safely store up to 53 bits'); + } + return (this.negative !== 0) ? -ret : ret; + }; + + BN.prototype.toJSON = function toJSON () { + return this.toString(16); + }; + + BN.prototype.toBuffer = function toBuffer (endian, length) { + assert(typeof Buffer !== 'undefined'); + return this.toArrayLike(Buffer, endian, length); + }; + + BN.prototype.toArray = function toArray (endian, length) { + return this.toArrayLike(Array, endian, length); + }; + + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert(byteLength <= reqLength, 'byte array longer than desired length'); + assert(reqLength > 0, 'Requested array length <= 0'); + + this.strip(); + var littleEndian = endian === 'le'; + var res = new ArrayType(reqLength); + + var b, i; + var q = this.clone(); + if (!littleEndian) { + // Assume big-endian + for (i = 0; i < reqLength - byteLength; i++) { + res[i] = 0; + } + + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); + + res[reqLength - i - 1] = b; + } + } else { + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); + + res[i] = b; + } + + for (; i < reqLength; i++) { + res[i] = 0; + } + } + + return res; + }; + + if (Math.clz32) { + BN.prototype._countBits = function _countBits (w) { + return 32 - Math.clz32(w); + }; + } else { + BN.prototype._countBits = function _countBits (w) { + var t = w; + var r = 0; + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + return r + t; + }; + } + + BN.prototype._zeroBits = function _zeroBits (w) { + // Short-cut + if (w === 0) return 26; + + var t = w; + var r = 0; + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + if ((t & 0x1) === 0) { + r++; + } + return r; + }; + + // Return number of used bits in a BN + BN.prototype.bitLength = function bitLength () { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; + + function toBitArray (num) { + var w = new Array(num.bitLength()); + + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; + + w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; + } + + return w; + } + + // Number of trailing zero bits + BN.prototype.zeroBits = function zeroBits () { + if (this.isZero()) return 0; + + var r = 0; + for (var i = 0; i < this.length; i++) { + var b = this._zeroBits(this.words[i]); + r += b; + if (b !== 26) break; + } + return r; + }; + + BN.prototype.byteLength = function byteLength () { + return Math.ceil(this.bitLength() / 8); + }; + + BN.prototype.toTwos = function toTwos (width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + + BN.prototype.fromTwos = function fromTwos (width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + + BN.prototype.isNeg = function isNeg () { + return this.negative !== 0; + }; + + // Return negative clone of `this` + BN.prototype.neg = function neg () { + return this.clone().ineg(); + }; + + BN.prototype.ineg = function ineg () { + if (!this.isZero()) { + this.negative ^= 1; + } + + return this; + }; + + // Or `num` with `this` in-place + BN.prototype.iuor = function iuor (num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } + + for (var i = 0; i < num.length; i++) { + this.words[i] = this.words[i] | num.words[i]; + } + + return this.strip(); + }; + + BN.prototype.ior = function ior (num) { + assert((this.negative | num.negative) === 0); + return this.iuor(num); + }; + + // Or `num` with `this` + BN.prototype.or = function or (num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; + + BN.prototype.uor = function uor (num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; + + // And `num` with `this` in-place + BN.prototype.iuand = function iuand (num) { + // b = min-length(num, this) + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = this.words[i] & num.words[i]; + } + + this.length = b.length; + + return this.strip(); + }; + + BN.prototype.iand = function iand (num) { + assert((this.negative | num.negative) === 0); + return this.iuand(num); + }; + + // And `num` with `this` + BN.prototype.and = function and (num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; + + BN.prototype.uand = function uand (num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + + // Xor `num` with `this` in-place + BN.prototype.iuxor = function iuxor (num) { + // a.length > b.length + var a; + var b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = a.words[i] ^ b.words[i]; + } + + if (this !== a) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + this.length = a.length; + + return this.strip(); + }; + + BN.prototype.ixor = function ixor (num) { + assert((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + + // Xor `num` with `this` + BN.prototype.xor = function xor (num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; + + BN.prototype.uxor = function uxor (num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + + // Not ``this`` with ``width`` bitwidth + BN.prototype.inotn = function inotn (width) { + assert(typeof width === 'number' && width >= 0); + + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + + // Extend the buffer with leading zeroes + this._expand(bytesNeeded); + + if (bitsLeft > 0) { + bytesNeeded--; + } + + // Handle complete words + for (var i = 0; i < bytesNeeded; i++) { + this.words[i] = ~this.words[i] & 0x3ffffff; + } + + // Handle the residue + if (bitsLeft > 0) { + this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); + } + + // And remove leading zeroes + return this.strip(); + }; + + BN.prototype.notn = function notn (width) { + return this.clone().inotn(width); + }; + + // Set `bit` of `this` + BN.prototype.setn = function setn (bit, val) { + assert(typeof bit === 'number' && bit >= 0); + + var off = (bit / 26) | 0; + var wbit = bit % 26; + + this._expand(off + 1); + + if (val) { + this.words[off] = this.words[off] | (1 << wbit); + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } + + return this.strip(); + }; + + // Add `num` to `this` in-place + BN.prototype.iadd = function iadd (num) { + var r; + + // negative + positive + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r = this.isub(num); + this.negative ^= 1; + return this._normSign(); + + // positive + negative + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r = this.isub(num); + num.negative = 1; + return r._normSign(); + } + + // a.length > b.length + var a, b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + + this.length = a.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + // Copy the rest of the words + } else if (a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + return this; + }; + + // Add `num` to `this` + BN.prototype.add = function add (num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + + if (this.length > num.length) return this.clone().iadd(num); + + return num.clone().iadd(this); + }; + + // Subtract `num` from `this` in-place + BN.prototype.isub = function isub (num) { + // this - (-num) = this + num + if (num.negative !== 0) { + num.negative = 0; + var r = this.iadd(num); + num.negative = 1; + return r._normSign(); + + // -this - num = -(this + num) + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + + // At this point both numbers are positive + var cmp = this.cmp(num); + + // Optimization - zeroify + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } + + // a > b + var a, b; + if (cmp > 0) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + + // Copy rest of the words + if (carry === 0 && i < a.length && a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + this.length = Math.max(this.length, i); + + if (a !== this) { + this.negative = 1; + } + + return this.strip(); + }; + + // Subtract `num` from `this` + BN.prototype.sub = function sub (num) { + return this.clone().isub(num); + }; + + function smallMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + var len = (self.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; + + // Peel one iteration (compiler can't do it, because of code complexity) + var a = self.words[0] | 0; + var b = num.words[0] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + var carry = (r / 0x4000000) | 0; + out.words[0] = lo; + + for (var k = 1; k < len; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = carry >>> 26; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = (k - j) | 0; + a = self.words[i] | 0; + b = num.words[j] | 0; + r = a * b + rword; + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; + } + out.words[k] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k] = carry | 0; + } else { + out.length--; + } + + return out.strip(); + } + + // TODO(indutny): it may be reasonable to omit it for users who don't need + // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit + // multiplication (like elliptic secp256k1). + var comb10MulTo = function comb10MulTo (self, num, out) { + var a = self.words; + var b = num.words; + var o = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a[0] | 0; + var al0 = a0 & 0x1fff; + var ah0 = a0 >>> 13; + var a1 = a[1] | 0; + var al1 = a1 & 0x1fff; + var ah1 = a1 >>> 13; + var a2 = a[2] | 0; + var al2 = a2 & 0x1fff; + var ah2 = a2 >>> 13; + var a3 = a[3] | 0; + var al3 = a3 & 0x1fff; + var ah3 = a3 >>> 13; + var a4 = a[4] | 0; + var al4 = a4 & 0x1fff; + var ah4 = a4 >>> 13; + var a5 = a[5] | 0; + var al5 = a5 & 0x1fff; + var ah5 = a5 >>> 13; + var a6 = a[6] | 0; + var al6 = a6 & 0x1fff; + var ah6 = a6 >>> 13; + var a7 = a[7] | 0; + var al7 = a7 & 0x1fff; + var ah7 = a7 >>> 13; + var a8 = a[8] | 0; + var al8 = a8 & 0x1fff; + var ah8 = a8 >>> 13; + var a9 = a[9] | 0; + var al9 = a9 & 0x1fff; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 0x1fff; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 0x1fff; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 0x1fff; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 0x1fff; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 0x1fff; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 0x1fff; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 0x1fff; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 0x1fff; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 0x1fff; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 0x1fff; + var bh9 = b9 >>> 13; + + out.negative = self.negative ^ num.negative; + out.length = 19; + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + if (c !== 0) { + o[19] = c; + out.length++; + } + return out; + }; + + // Polyfill comb + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + + function bigMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + out.length = self.length + num.length; + + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = k - j; + var a = self.words[i] | 0; + var b = num.words[j] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } + + return out.strip(); + } + + function jumboMulTo (self, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self, num, out); + } + + BN.prototype.mulTo = function mulTo (num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } + + return res; + }; + + // Cooley-Tukey algorithm for FFT + // slightly revisited to rely on looping instead of recursion + + function FFTM (x, y) { + this.x = x; + this.y = y; + } + + FFTM.prototype.makeRBT = function makeRBT (N) { + var t = new Array(N); + var l = BN.prototype._countBits(N) - 1; + for (var i = 0; i < N; i++) { + t[i] = this.revBin(i, l, N); + } + + return t; + }; + + // Returns binary-reversed representation of `x` + FFTM.prototype.revBin = function revBin (x, l, N) { + if (x === 0 || x === N - 1) return x; + + var rb = 0; + for (var i = 0; i < l; i++) { + rb |= (x & 1) << (l - i - 1); + x >>= 1; + } + + return rb; + }; + + // Performs "tweedling" phase, therefore 'emulating' + // behaviour of the recursive algorithm + FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { + for (var i = 0; i < N; i++) { + rtws[i] = rws[rbt[i]]; + itws[i] = iws[rbt[i]]; + } + }; + + FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N); + + for (var s = 1; s < N; s <<= 1) { + var l = s << 1; + + var rtwdf = Math.cos(2 * Math.PI / l); + var itwdf = Math.sin(2 * Math.PI / l); + + for (var p = 0; p < N; p += l) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + + for (var j = 0; j < s; j++) { + var re = rtws[p + j]; + var ie = itws[p + j]; + + var ro = rtws[p + j + s]; + var io = itws[p + j + s]; + + var rx = rtwdf_ * ro - itwdf_ * io; + + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + + rtws[p + j] = re + ro; + itws[p + j] = ie + io; + + rtws[p + j + s] = re - ro; + itws[p + j + s] = ie - io; + + /* jshint maxdepth : false */ + if (j !== l) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + + FFTM.prototype.guessLen13b = function guessLen13b (n, m) { + var N = Math.max(m, n) | 1; + var odd = N & 1; + var i = 0; + for (N = N / 2 | 0; N; N = N >>> 1) { + i++; + } + + return 1 << i + 1 + odd; + }; + + FFTM.prototype.conjugate = function conjugate (rws, iws, N) { + if (N <= 1) return; + + for (var i = 0; i < N / 2; i++) { + var t = rws[i]; + + rws[i] = rws[N - i - 1]; + rws[N - i - 1] = t; + + t = iws[i]; + + iws[i] = -iws[N - i - 1]; + iws[N - i - 1] = -t; + } + }; + + FFTM.prototype.normalize13b = function normalize13b (ws, N) { + var carry = 0; + for (var i = 0; i < N / 2; i++) { + var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + + Math.round(ws[2 * i] / N) + + carry; + + ws[i] = w & 0x3ffffff; + + if (w < 0x4000000) { + carry = 0; + } else { + carry = w / 0x4000000 | 0; + } + } + + return ws; + }; + + FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { + var carry = 0; + for (var i = 0; i < len; i++) { + carry = carry + (ws[i] | 0); + + rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; + rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; + } + + // Pad with zeroes + for (i = 2 * len; i < N; ++i) { + rws[i] = 0; + } + + assert(carry === 0); + assert((carry & ~0x1fff) === 0); + }; + + FFTM.prototype.stub = function stub (N) { + var ph = new Array(N); + for (var i = 0; i < N; i++) { + ph[i] = 0; + } + + return ph; + }; + + FFTM.prototype.mulp = function mulp (x, y, out) { + var N = 2 * this.guessLen13b(x.length, y.length); + + var rbt = this.makeRBT(N); + + var _ = this.stub(N); + + var rws = new Array(N); + var rwst = new Array(N); + var iwst = new Array(N); + + var nrws = new Array(N); + var nrwst = new Array(N); + var niwst = new Array(N); + + var rmws = out.words; + rmws.length = N; + + this.convert13b(x.words, x.length, rws, N); + this.convert13b(y.words, y.length, nrws, N); + + this.transform(rws, _, rwst, iwst, N, rbt); + this.transform(nrws, _, nrwst, niwst, N, rbt); + + for (var i = 0; i < N; i++) { + var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; + iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; + rwst[i] = rx; + } + + this.conjugate(rwst, iwst, N); + this.transform(rwst, iwst, rmws, _, N, rbt); + this.conjugate(rmws, _, N); + this.normalize13b(rmws, N); + + out.negative = x.negative ^ y.negative; + out.length = x.length + y.length; + return out.strip(); + }; + + // Multiply `this` by `num` + BN.prototype.mul = function mul (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; + + // Multiply employing FFT + BN.prototype.mulf = function mulf (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; + + // In-place Multiplication + BN.prototype.imul = function imul (num) { + return this.clone().mulTo(num, this); + }; + + BN.prototype.imuln = function imuln (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + + // Carry + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = (this.words[i] | 0) * num; + var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); + carry >>= 26; + carry += (w / 0x4000000) | 0; + // NOTE: lo is 27bit maximum + carry += lo >>> 26; + this.words[i] = lo & 0x3ffffff; + } + + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + + return this; + }; + + BN.prototype.muln = function muln (num) { + return this.clone().imuln(num); + }; + + // `this` * `this` + BN.prototype.sqr = function sqr () { + return this.mul(this); + }; + + // `this` * `this` in-place + BN.prototype.isqr = function isqr () { + return this.imul(this.clone()); + }; + + // Math.pow(`this`, `num`) + BN.prototype.pow = function pow (num) { + var w = toBitArray(num); + if (w.length === 0) return new BN(1); + + // Skip leading zeroes + var res = this; + for (var i = 0; i < w.length; i++, res = res.sqr()) { + if (w[i] !== 0) break; + } + + if (++i < w.length) { + for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { + if (w[i] === 0) continue; + + res = res.mul(q); + } + } + + return res; + }; + + // Shift-left in-place + BN.prototype.iushln = function iushln (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); + var i; + + if (r !== 0) { + var carry = 0; + + for (i = 0; i < this.length; i++) { + var newCarry = this.words[i] & carryMask; + var c = ((this.words[i] | 0) - newCarry) << r; + this.words[i] = c | carry; + carry = newCarry >>> (26 - r); + } + + if (carry) { + this.words[i] = carry; + this.length++; + } + } + + if (s !== 0) { + for (i = this.length - 1; i >= 0; i--) { + this.words[i + s] = this.words[i]; + } + + for (i = 0; i < s; i++) { + this.words[i] = 0; + } + + this.length += s; + } + + return this.strip(); + }; + + BN.prototype.ishln = function ishln (bits) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushln(bits); + }; + + // Shift-right in-place + // NOTE: `hint` is a lowest bit before trailing zeroes + // NOTE: if `extended` is present - it will be filled with destroyed bits + BN.prototype.iushrn = function iushrn (bits, hint, extended) { + assert(typeof bits === 'number' && bits >= 0); + var h; + if (hint) { + h = (hint - (hint % 26)) / 26; + } else { + h = 0; + } + + var r = bits % 26; + var s = Math.min((bits - r) / 26, this.length); + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + var maskedWords = extended; + + h -= s; + h = Math.max(0, h); + + // Extended mode, copy masked part + if (maskedWords) { + for (var i = 0; i < s; i++) { + maskedWords.words[i] = this.words[i]; + } + maskedWords.length = s; + } + + if (s === 0) { + // No-op, we should not move anything at all + } else if (this.length > s) { + this.length -= s; + for (i = 0; i < this.length; i++) { + this.words[i] = this.words[i + s]; + } + } else { + this.words[0] = 0; + this.length = 1; + } + + var carry = 0; + for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { + var word = this.words[i] | 0; + this.words[i] = (carry << (26 - r)) | (word >>> r); + carry = word & mask; + } + + // Push carried bits as a mask + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + + return this.strip(); + }; + + BN.prototype.ishrn = function ishrn (bits, hint, extended) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; + + // Shift-left + BN.prototype.shln = function shln (bits) { + return this.clone().ishln(bits); + }; + + BN.prototype.ushln = function ushln (bits) { + return this.clone().iushln(bits); + }; + + // Shift-right + BN.prototype.shrn = function shrn (bits) { + return this.clone().ishrn(bits); + }; + + BN.prototype.ushrn = function ushrn (bits) { + return this.clone().iushrn(bits); + }; + + // Test if n bit is set + BN.prototype.testn = function testn (bit) { + assert(typeof bit === 'number' && bit >= 0); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) return false; + + // Check bit and return + var w = this.words[s]; + + return !!(w & q); + }; + + // Return only lowers bits of number (in-place) + BN.prototype.imaskn = function imaskn (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + + assert(this.negative === 0, 'imaskn works only with positive numbers'); + + if (this.length <= s) { + return this; + } + + if (r !== 0) { + s++; + } + this.length = Math.min(s, this.length); + + if (r !== 0) { + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + this.words[this.length - 1] &= mask; + } + + return this.strip(); + }; + + // Return only lowers bits of number + BN.prototype.maskn = function maskn (bits) { + return this.clone().imaskn(bits); + }; + + // Add plain number `num` to `this` + BN.prototype.iaddn = function iaddn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.isubn(-num); + + // Possible sign change + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) < num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } + + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } + + // Add without checks + return this._iaddn(num); + }; + + BN.prototype._iaddn = function _iaddn (num) { + this.words[0] += num; + + // Carry + for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { + this.words[i] -= 0x4000000; + if (i === this.length - 1) { + this.words[i + 1] = 1; + } else { + this.words[i + 1]++; + } + } + this.length = Math.max(this.length, i + 1); + + return this; + }; + + // Subtract plain number `num` from `this` + BN.prototype.isubn = function isubn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.iaddn(-num); + + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; + } + + this.words[0] -= num; + + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; + } else { + // Carry + for (var i = 0; i < this.length && this.words[i] < 0; i++) { + this.words[i] += 0x4000000; + this.words[i + 1] -= 1; + } + } + + return this.strip(); + }; + + BN.prototype.addn = function addn (num) { + return this.clone().iaddn(num); + }; + + BN.prototype.subn = function subn (num) { + return this.clone().isubn(num); + }; + + BN.prototype.iabs = function iabs () { + this.negative = 0; + + return this; + }; + + BN.prototype.abs = function abs () { + return this.clone().iabs(); + }; + + BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { + var len = num.length + shift; + var i; + + this._expand(len); + + var w; + var carry = 0; + for (i = 0; i < num.length; i++) { + w = (this.words[i + shift] | 0) + carry; + var right = (num.words[i] | 0) * mul; + w -= right & 0x3ffffff; + carry = (w >> 26) - ((right / 0x4000000) | 0); + this.words[i + shift] = w & 0x3ffffff; + } + for (; i < this.length - shift; i++) { + w = (this.words[i + shift] | 0) + carry; + carry = w >> 26; + this.words[i + shift] = w & 0x3ffffff; + } + + if (carry === 0) return this.strip(); + + // Subtraction overflow + assert(carry === -1); + carry = 0; + for (i = 0; i < this.length; i++) { + w = -(this.words[i] | 0) + carry; + carry = w >> 26; + this.words[i] = w & 0x3ffffff; + } + this.negative = 1; + + return this.strip(); + }; + + BN.prototype._wordDiv = function _wordDiv (num, mode) { + var shift = this.length - num.length; + + var a = this.clone(); + var b = num; + + // Normalize + var bhi = b.words[b.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b = b.ushln(shift); + a.iushln(shift); + bhi = b.words[b.length - 1] | 0; + } + + // Initialize quotient + var m = a.length - b.length; + var q; + + if (mode !== 'mod') { + q = new BN(null); + q.length = m + 1; + q.words = new Array(q.length); + for (var i = 0; i < q.length; i++) { + q.words[i] = 0; + } + } + + var diff = a.clone()._ishlnsubmul(b, 1, m); + if (diff.negative === 0) { + a = diff; + if (q) { + q.words[m] = 1; + } + } + + for (var j = m - 1; j >= 0; j--) { + var qj = (a.words[b.length + j] | 0) * 0x4000000 + + (a.words[b.length + j - 1] | 0); + + // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max + // (0x7ffffff) + qj = Math.min((qj / bhi) | 0, 0x3ffffff); + + a._ishlnsubmul(b, qj, j); + while (a.negative !== 0) { + qj--; + a.negative = 0; + a._ishlnsubmul(b, 1, j); + if (!a.isZero()) { + a.negative ^= 1; + } + } + if (q) { + q.words[j] = qj; + } + } + if (q) { + q.strip(); + } + a.strip(); + + // Denormalize + if (mode !== 'div' && shift !== 0) { + a.iushrn(shift); + } + + return { + div: q || null, + mod: a + }; + }; + + // NOTE: 1) `mode` can be set to `mod` to request mod only, + // to `div` to request div only, or be absent to + // request both div & mod + // 2) `positive` is true if unsigned mod is requested + BN.prototype.divmod = function divmod (num, mode, positive) { + assert(!num.isZero()); + + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + + var div, mod, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + + if (mode !== 'mod') { + div = res.div.neg(); + } + + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.iadd(num); + } + } + + return { + div: div, + mod: mod + }; + } + + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + + if (mode !== 'mod') { + div = res.div.neg(); + } + + return { + div: div, + mod: res.mod + }; + } + + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.isub(num); + } + } + + return { + div: res.div, + mod: mod + }; + } + + // Both numbers are positive at this point + + // Strip both numbers to approximate shift value + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this + }; + } + + // Very short reduction + if (num.length === 1) { + if (mode === 'div') { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + + if (mode === 'mod') { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + + return this._wordDiv(num, mode); + }; + + // Find `this` / `num` + BN.prototype.div = function div (num) { + return this.divmod(num, 'div', false).div; + }; + + // Find `this` % `num` + BN.prototype.mod = function mod (num) { + return this.divmod(num, 'mod', false).mod; + }; + + BN.prototype.umod = function umod (num) { + return this.divmod(num, 'mod', true).mod; + }; + + // Find Round(`this` / `num`) + BN.prototype.divRound = function divRound (num) { + var dm = this.divmod(num); + + // Fast case - exact division + if (dm.mod.isZero()) return dm.div; + + var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + + var half = num.ushrn(1); + var r2 = num.andln(1); + var cmp = mod.cmp(half); + + // Round down + if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; + + // Round up + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + + BN.prototype.modn = function modn (num) { + assert(num <= 0x3ffffff); + var p = (1 << 26) % num; + + var acc = 0; + for (var i = this.length - 1; i >= 0; i--) { + acc = (p * acc + (this.words[i] | 0)) % num; + } + + return acc; + }; + + // In-place division by number + BN.prototype.idivn = function idivn (num) { + assert(num <= 0x3ffffff); + + var carry = 0; + for (var i = this.length - 1; i >= 0; i--) { + var w = (this.words[i] | 0) + carry * 0x4000000; + this.words[i] = (w / num) | 0; + carry = w % num; + } + + return this.strip(); + }; + + BN.prototype.divn = function divn (num) { + return this.clone().idivn(num); + }; + + BN.prototype.egcd = function egcd (p) { + assert(p.negative === 0); + assert(!p.isZero()); + + var x = this; + var y = p.clone(); + + if (x.negative !== 0) { + x = x.umod(p); + } else { + x = x.clone(); + } + + // A * x + B * y = x + var A = new BN(1); + var B = new BN(0); + + // C * x + D * y = y + var C = new BN(0); + var D = new BN(1); + + var g = 0; + + while (x.isEven() && y.isEven()) { + x.iushrn(1); + y.iushrn(1); + ++g; + } + + var yp = y.clone(); + var xp = x.clone(); + + while (!x.isZero()) { + for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + x.iushrn(i); + while (i-- > 0) { + if (A.isOdd() || B.isOdd()) { + A.iadd(yp); + B.isub(xp); + } + + A.iushrn(1); + B.iushrn(1); + } + } + + for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + y.iushrn(j); + while (j-- > 0) { + if (C.isOdd() || D.isOdd()) { + C.iadd(yp); + D.isub(xp); + } + + C.iushrn(1); + D.iushrn(1); + } + } + + if (x.cmp(y) >= 0) { + x.isub(y); + A.isub(C); + B.isub(D); + } else { + y.isub(x); + C.isub(A); + D.isub(B); + } + } + + return { + a: C, + b: D, + gcd: y.iushln(g) + }; + }; + + // This is reduced incarnation of the binary EEA + // above, designated to invert members of the + // _prime_ fields F(p) at a maximal speed + BN.prototype._invmp = function _invmp (p) { + assert(p.negative === 0); + assert(!p.isZero()); + + var a = this; + var b = p.clone(); + + if (a.negative !== 0) { + a = a.umod(p); + } else { + a = a.clone(); + } + + var x1 = new BN(1); + var x2 = new BN(0); + + var delta = b.clone(); + + while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { + for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + a.iushrn(i); + while (i-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + + x1.iushrn(1); + } + } + + for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + b.iushrn(j); + while (j-- > 0) { + if (x2.isOdd()) { + x2.iadd(delta); + } + + x2.iushrn(1); + } + } + + if (a.cmp(b) >= 0) { + a.isub(b); + x1.isub(x2); + } else { + b.isub(a); + x2.isub(x1); + } + } + + var res; + if (a.cmpn(1) === 0) { + res = x1; + } else { + res = x2; + } + + if (res.cmpn(0) < 0) { + res.iadd(p); + } + + return res; + }; + + BN.prototype.gcd = function gcd (num) { + if (this.isZero()) return num.abs(); + if (num.isZero()) return this.abs(); + + var a = this.clone(); + var b = num.clone(); + a.negative = 0; + b.negative = 0; + + // Remove common factor of two + for (var shift = 0; a.isEven() && b.isEven(); shift++) { + a.iushrn(1); + b.iushrn(1); + } + + do { + while (a.isEven()) { + a.iushrn(1); + } + while (b.isEven()) { + b.iushrn(1); + } + + var r = a.cmp(b); + if (r < 0) { + // Swap `a` and `b` to make `a` always bigger than `b` + var t = a; + a = b; + b = t; + } else if (r === 0 || b.cmpn(1) === 0) { + break; + } + + a.isub(b); + } while (true); + + return b.iushln(shift); + }; + + // Invert number in the field F(num) + BN.prototype.invm = function invm (num) { + return this.egcd(num).a.umod(num); + }; + + BN.prototype.isEven = function isEven () { + return (this.words[0] & 1) === 0; + }; + + BN.prototype.isOdd = function isOdd () { + return (this.words[0] & 1) === 1; + }; + + // And first word and num + BN.prototype.andln = function andln (num) { + return this.words[0] & num; + }; + + // Increment at the bit position in-line + BN.prototype.bincn = function bincn (bit) { + assert(typeof bit === 'number'); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) { + this._expand(s + 1); + this.words[s] |= q; + return this; + } + + // Add bit and propagate, if needed + var carry = q; + for (var i = s; carry !== 0 && i < this.length; i++) { + var w = this.words[i] | 0; + w += carry; + carry = w >>> 26; + w &= 0x3ffffff; + this.words[i] = w; + } + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + return this; + }; + + BN.prototype.isZero = function isZero () { + return this.length === 1 && this.words[0] === 0; + }; + + BN.prototype.cmpn = function cmpn (num) { + var negative = num < 0; + + if (this.negative !== 0 && !negative) return -1; + if (this.negative === 0 && negative) return 1; + + this.strip(); + + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + + assert(num <= 0x3ffffff, 'Number is too big'); + + var w = this.words[0] | 0; + res = w === num ? 0 : w < num ? -1 : 1; + } + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Compare two numbers and return: + // 1 - if `this` > `num` + // 0 - if `this` == `num` + // -1 - if `this` < `num` + BN.prototype.cmp = function cmp (num) { + if (this.negative !== 0 && num.negative === 0) return -1; + if (this.negative === 0 && num.negative !== 0) return 1; + + var res = this.ucmp(num); + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Unsigned comparison + BN.prototype.ucmp = function ucmp (num) { + // At this point both numbers have the same sign + if (this.length > num.length) return 1; + if (this.length < num.length) return -1; + + var res = 0; + for (var i = this.length - 1; i >= 0; i--) { + var a = this.words[i] | 0; + var b = num.words[i] | 0; + + if (a === b) continue; + if (a < b) { + res = -1; + } else if (a > b) { + res = 1; + } + break; + } + return res; + }; + + BN.prototype.gtn = function gtn (num) { + return this.cmpn(num) === 1; + }; + + BN.prototype.gt = function gt (num) { + return this.cmp(num) === 1; + }; + + BN.prototype.gten = function gten (num) { + return this.cmpn(num) >= 0; + }; + + BN.prototype.gte = function gte (num) { + return this.cmp(num) >= 0; + }; + + BN.prototype.ltn = function ltn (num) { + return this.cmpn(num) === -1; + }; + + BN.prototype.lt = function lt (num) { + return this.cmp(num) === -1; + }; + + BN.prototype.lten = function lten (num) { + return this.cmpn(num) <= 0; + }; + + BN.prototype.lte = function lte (num) { + return this.cmp(num) <= 0; + }; + + BN.prototype.eqn = function eqn (num) { + return this.cmpn(num) === 0; + }; + + BN.prototype.eq = function eq (num) { + return this.cmp(num) === 0; + }; + + // + // A reduce context, could be using montgomery or something better, depending + // on the `m` itself. + // + BN.red = function red (num) { + return new Red(num); + }; + + BN.prototype.toRed = function toRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + assert(this.negative === 0, 'red works only with positives'); + return ctx.convertTo(this)._forceRed(ctx); + }; + + BN.prototype.fromRed = function fromRed () { + assert(this.red, 'fromRed works only with numbers in reduction context'); + return this.red.convertFrom(this); + }; + + BN.prototype._forceRed = function _forceRed (ctx) { + this.red = ctx; + return this; + }; + + BN.prototype.forceRed = function forceRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + return this._forceRed(ctx); + }; + + BN.prototype.redAdd = function redAdd (num) { + assert(this.red, 'redAdd works only with red numbers'); + return this.red.add(this, num); + }; + + BN.prototype.redIAdd = function redIAdd (num) { + assert(this.red, 'redIAdd works only with red numbers'); + return this.red.iadd(this, num); + }; + + BN.prototype.redSub = function redSub (num) { + assert(this.red, 'redSub works only with red numbers'); + return this.red.sub(this, num); + }; + + BN.prototype.redISub = function redISub (num) { + assert(this.red, 'redISub works only with red numbers'); + return this.red.isub(this, num); + }; + + BN.prototype.redShl = function redShl (num) { + assert(this.red, 'redShl works only with red numbers'); + return this.red.shl(this, num); + }; + + BN.prototype.redMul = function redMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + + BN.prototype.redIMul = function redIMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + + BN.prototype.redSqr = function redSqr () { + assert(this.red, 'redSqr works only with red numbers'); + this.red._verify1(this); + return this.red.sqr(this); + }; + + BN.prototype.redISqr = function redISqr () { + assert(this.red, 'redISqr works only with red numbers'); + this.red._verify1(this); + return this.red.isqr(this); + }; + + // Square root over p + BN.prototype.redSqrt = function redSqrt () { + assert(this.red, 'redSqrt works only with red numbers'); + this.red._verify1(this); + return this.red.sqrt(this); + }; + + BN.prototype.redInvm = function redInvm () { + assert(this.red, 'redInvm works only with red numbers'); + this.red._verify1(this); + return this.red.invm(this); + }; + + // Return negative clone of `this` % `red modulo` + BN.prototype.redNeg = function redNeg () { + assert(this.red, 'redNeg works only with red numbers'); + this.red._verify1(this); + return this.red.neg(this); + }; + + BN.prototype.redPow = function redPow (num) { + assert(this.red && !num.red, 'redPow(normalNum)'); + this.red._verify1(this); + return this.red.pow(this, num); + }; + + // Prime numbers with efficient reduction + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + + // Pseudo-Mersenne prime + function MPrime (name, p) { + // P = 2 ^ N - K + this.name = name; + this.p = new BN(p, 16); + this.n = this.p.bitLength(); + this.k = new BN(1).iushln(this.n).isub(this.p); + + this.tmp = this._tmp(); + } + + MPrime.prototype._tmp = function _tmp () { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; + + MPrime.prototype.ireduce = function ireduce (num) { + // Assumes that `num` is less than `P^2` + // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) + var r = num; + var rlen; + + do { + this.split(r, this.tmp); + r = this.imulK(r); + r = r.iadd(this.tmp); + rlen = r.bitLength(); + } while (rlen > this.n); + + var cmp = rlen < this.n ? -1 : r.ucmp(this.p); + if (cmp === 0) { + r.words[0] = 0; + r.length = 1; + } else if (cmp > 0) { + r.isub(this.p); + } else { + r.strip(); + } + + return r; + }; + + MPrime.prototype.split = function split (input, out) { + input.iushrn(this.n, 0, out); + }; + + MPrime.prototype.imulK = function imulK (num) { + return num.imul(this.k); + }; + + function K256 () { + MPrime.call( + this, + 'k256', + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); + } + inherits(K256, MPrime); + + K256.prototype.split = function split (input, output) { + // 256 = 9 * 26 + 22 + var mask = 0x3fffff; + + var outLen = Math.min(input.length, 9); + for (var i = 0; i < outLen; i++) { + output.words[i] = input.words[i]; + } + output.length = outLen; + + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + + // Shift by 9 limbs + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + + for (i = 10; i < input.length; i++) { + var next = input.words[i] | 0; + input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); + prev = next; + } + prev >>>= 22; + input.words[i - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + + K256.prototype.imulK = function imulK (num) { + // K = 0x1000003d1 = [ 0x40, 0x3d1 ] + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + + // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 + var lo = 0; + for (var i = 0; i < num.length; i++) { + var w = num.words[i] | 0; + lo += w * 0x3d1; + num.words[i] = lo & 0x3ffffff; + lo = w * 0x40 + ((lo / 0x4000000) | 0); + } + + // Fast length reduction + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + + function P224 () { + MPrime.call( + this, + 'p224', + 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); + } + inherits(P224, MPrime); + + function P192 () { + MPrime.call( + this, + 'p192', + 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); + } + inherits(P192, MPrime); + + function P25519 () { + // 2 ^ 255 - 19 + MPrime.call( + this, + '25519', + '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); + } + inherits(P25519, MPrime); + + P25519.prototype.imulK = function imulK (num) { + // K = 0x13 + var carry = 0; + for (var i = 0; i < num.length; i++) { + var hi = (num.words[i] | 0) * 0x13 + carry; + var lo = hi & 0x3ffffff; + hi >>>= 26; + + num.words[i] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + + // Exported mostly for testing purposes, use plain name instead + BN._prime = function prime (name) { + // Cached version of prime + if (primes[name]) return primes[name]; + + var prime; + if (name === 'k256') { + prime = new K256(); + } else if (name === 'p224') { + prime = new P224(); + } else if (name === 'p192') { + prime = new P192(); + } else if (name === 'p25519') { + prime = new P25519(); + } else { + throw new Error('Unknown prime ' + name); + } + primes[name] = prime; + + return prime; + }; + + // + // Base reduction engine + // + function Red (m) { + if (typeof m === 'string') { + var prime = BN._prime(m); + this.m = prime.p; + this.prime = prime; + } else { + assert(m.gtn(1), 'modulus must be greater than 1'); + this.m = m; + this.prime = null; + } + } + + Red.prototype._verify1 = function _verify1 (a) { + assert(a.negative === 0, 'red works only with positives'); + assert(a.red, 'red works only with red numbers'); + }; + + Red.prototype._verify2 = function _verify2 (a, b) { + assert((a.negative | b.negative) === 0, 'red works only with positives'); + assert(a.red && a.red === b.red, + 'red works only with red numbers'); + }; + + Red.prototype.imod = function imod (a) { + if (this.prime) return this.prime.ireduce(a)._forceRed(this); + return a.umod(this.m)._forceRed(this); + }; + + Red.prototype.neg = function neg (a) { + if (a.isZero()) { + return a.clone(); + } + + return this.m.sub(a)._forceRed(this); + }; + + Red.prototype.add = function add (a, b) { + this._verify2(a, b); + + var res = a.add(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; + + Red.prototype.iadd = function iadd (a, b) { + this._verify2(a, b); + + var res = a.iadd(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; + + Red.prototype.sub = function sub (a, b) { + this._verify2(a, b); + + var res = a.sub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; + + Red.prototype.isub = function isub (a, b) { + this._verify2(a, b); + + var res = a.isub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; + + Red.prototype.shl = function shl (a, num) { + this._verify1(a); + return this.imod(a.ushln(num)); + }; + + Red.prototype.imul = function imul (a, b) { + this._verify2(a, b); + return this.imod(a.imul(b)); + }; + + Red.prototype.mul = function mul (a, b) { + this._verify2(a, b); + return this.imod(a.mul(b)); + }; + + Red.prototype.isqr = function isqr (a) { + return this.imul(a, a.clone()); + }; + + Red.prototype.sqr = function sqr (a) { + return this.mul(a, a); + }; + + Red.prototype.sqrt = function sqrt (a) { + if (a.isZero()) return a.clone(); + + var mod3 = this.m.andln(3); + assert(mod3 % 2 === 1); + + // Fast case + if (mod3 === 3) { + var pow = this.m.add(new BN(1)).iushrn(2); + return this.pow(a, pow); + } + + // Tonelli-Shanks algorithm (Totally unoptimized and slow) + // + // Find Q and S, that Q * 2 ^ S = (P - 1) + var q = this.m.subn(1); + var s = 0; + while (!q.isZero() && q.andln(1) === 0) { + s++; + q.iushrn(1); + } + assert(!q.isZero()); + + var one = new BN(1).toRed(this); + var nOne = one.redNeg(); + + // Find quadratic non-residue + // NOTE: Max is such because of generalized Riemann hypothesis. + var lpow = this.m.subn(1).iushrn(1); + var z = this.m.bitLength(); + z = new BN(2 * z * z).toRed(this); + + while (this.pow(z, lpow).cmp(nOne) !== 0) { + z.redIAdd(nOne); + } + + var c = this.pow(z, q); + var r = this.pow(a, q.addn(1).iushrn(1)); + var t = this.pow(a, q); + var m = s; + while (t.cmp(one) !== 0) { + var tmp = t; + for (var i = 0; tmp.cmp(one) !== 0; i++) { + tmp = tmp.redSqr(); + } + assert(i < m); + var b = this.pow(c, new BN(1).iushln(m - i - 1)); + + r = r.redMul(b); + c = b.redSqr(); + t = t.redMul(c); + m = i; + } + + return r; + }; + + Red.prototype.invm = function invm (a) { + var inv = a._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + + Red.prototype.pow = function pow (a, num) { + if (num.isZero()) return new BN(1).toRed(this); + if (num.cmpn(1) === 0) return a.clone(); + + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this); + wnd[1] = a; + for (var i = 2; i < wnd.length; i++) { + wnd[i] = this.mul(wnd[i - 1], a); + } + + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + + for (i = num.length - 1; i >= 0; i--) { + var word = num.words[i]; + for (var j = start - 1; j >= 0; j--) { + var bit = (word >> j) & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; + + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + + return res; + }; + + Red.prototype.convertTo = function convertTo (num) { + var r = num.umod(this.m); + + return r === num ? r.clone() : r; + }; + + Red.prototype.convertFrom = function convertFrom (num) { + var res = num.clone(); + res.red = null; + return res; + }; + + // + // Montgomery method engine + // + + BN.mont = function mont (num) { + return new Mont(num); + }; + + function Mont (m) { + Red.call(this, m); + + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - (this.shift % 26); + } + + this.r = new BN(1).iushln(this.shift); + this.r2 = this.imod(this.r.sqr()); + this.rinv = this.r._invmp(this.m); + + this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); + this.minv = this.minv.umod(this.r); + this.minv = this.r.sub(this.minv); + } + inherits(Mont, Red); + + Mont.prototype.convertTo = function convertTo (num) { + return this.imod(num.ushln(this.shift)); + }; + + Mont.prototype.convertFrom = function convertFrom (num) { + var r = this.imod(num.mul(this.rinv)); + r.red = null; + return r; + }; + + Mont.prototype.imul = function imul (a, b) { + if (a.isZero() || b.isZero()) { + a.words[0] = 0; + a.length = 1; + return a; + } + + var t = a.imul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.mul = function mul (a, b) { + if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); + + var t = a.mul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.invm = function invm (a) { + // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R + var res = this.imod(a._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; +})(typeof module === 'undefined' || module, this); + +},{"buffer":46}],281:[function(require,module,exports){ +var basex = require('base-x') +var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' + +module.exports = basex(ALPHABET) + +},{"base-x":282}],282:[function(require,module,exports){ +// base-x encoding +// Forked from https://github.com/cryptocoinjs/bs58 +// Originally written by Mike Hearn for BitcoinJ +// Copyright (c) 2011 Google Inc +// Ported to JavaScript by Stefan Thomas +// Merged Buffer refactorings from base58-native by Stephen Pair +// Copyright (c) 2013 BitPay Inc + +var Buffer = require('safe-buffer').Buffer + +module.exports = function base (ALPHABET) { + var ALPHABET_MAP = {} + var BASE = ALPHABET.length + var LEADER = ALPHABET.charAt(0) + + // pre-compute lookup table + for (var z = 0; z < ALPHABET.length; z++) { + var x = ALPHABET.charAt(z) + + if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous') + ALPHABET_MAP[x] = z + } + + function encode (source) { + if (source.length === 0) return '' + + var digits = [0] + for (var i = 0; i < source.length; ++i) { + for (var j = 0, carry = source[i]; j < digits.length; ++j) { + carry += digits[j] << 8 + digits[j] = carry % BASE + carry = (carry / BASE) | 0 + } + + while (carry > 0) { + digits.push(carry % BASE) + carry = (carry / BASE) | 0 + } + } + + var string = '' + + // deal with leading zeros + for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += ALPHABET[0] + // convert digits to a string + for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]] + + return string + } + + function decodeUnsafe (string) { + if (string.length === 0) return Buffer.allocUnsafe(0) + + var bytes = [0] + for (var i = 0; i < string.length; i++) { + var value = ALPHABET_MAP[string[i]] + if (value === undefined) return + + for (var j = 0, carry = value; j < bytes.length; ++j) { + carry += bytes[j] * BASE + bytes[j] = carry & 0xff + carry >>= 8 + } + + while (carry > 0) { + bytes.push(carry & 0xff) + carry >>= 8 + } + } + + // deal with leading zeros + for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) { + bytes.push(0) + } + + return Buffer.from(bytes.reverse()) + } + + function decode (string) { + var buffer = decodeUnsafe(string) + if (buffer) return buffer + + throw new Error('Non-base' + BASE + ' character') + } + + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} + +},{"safe-buffer":283}],283:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"buffer":47,"dup":71}],284:[function(require,module,exports){ +module.exports = function(a, b) { + if (typeof a.compare === 'function') return a.compare(b) + if (a === b) return 0 + + var x = a.length + var y = b.length + + var i = 0 + var len = Math.min(x, y) + while (i < len) { + if (a[i] !== b[i]) break + + ++i + } + + if (i !== len) { + x = a[i] + y = b[i] + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + + +},{}],285:[function(require,module,exports){ +'use strict'; + +var elliptic = exports; + +elliptic.version = require('../package.json').version; +elliptic.utils = require('./elliptic/utils'); +elliptic.rand = require('brorand'); +elliptic.curve = require('./elliptic/curve'); +elliptic.curves = require('./elliptic/curves'); + +// Protocols +elliptic.ec = require('./elliptic/ec'); +elliptic.eddsa = require('./elliptic/eddsa'); + +},{"../package.json":317,"./elliptic/curve":288,"./elliptic/curves":291,"./elliptic/ec":292,"./elliptic/eddsa":295,"./elliptic/utils":299,"brorand":300}],286:[function(require,module,exports){ +'use strict'; + +var BN = require('bn.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var getNAF = utils.getNAF; +var getJSF = utils.getJSF; +var assert = utils.assert; + +function BaseCurve(type, conf) { + this.type = type; + this.p = new BN(conf.p, 16); + + // Use Montgomery, when there is no fast reduction for the prime + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + + // Useful for many curves + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + + // Curve configuration, optional + this.n = conf.n && new BN(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + + // Temporary arrays + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + + // Generalized Greg Maxwell's trick + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } +} +module.exports = BaseCurve; + +BaseCurve.prototype.point = function point() { + throw new Error('Not implemented'); +}; + +BaseCurve.prototype.validate = function validate() { + throw new Error('Not implemented'); +}; + +BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { + assert(p.precomputed); + var doubles = p._getDoubles(); + + var naf = getNAF(k, 1); + var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); + I /= 3; + + // Translate into more windowed form + var repr = []; + for (var j = 0; j < naf.length; j += doubles.step) { + var nafW = 0; + for (var k = j + doubles.step - 1; k >= j; k--) + nafW = (nafW << 1) + naf[k]; + repr.push(nafW); + } + + var a = this.jpoint(null, null, null); + var b = this.jpoint(null, null, null); + for (var i = I; i > 0; i--) { + for (var j = 0; j < repr.length; j++) { + var nafW = repr[j]; + if (nafW === i) + b = b.mixedAdd(doubles.points[j]); + else if (nafW === -i) + b = b.mixedAdd(doubles.points[j].neg()); + } + a = a.add(b); + } + return a.toP(); +}; + +BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { + var w = 4; + + // Precompute window + var nafPoints = p._getNAFPoints(w); + w = nafPoints.wnd; + var wnd = nafPoints.points; + + // Get NAF form + var naf = getNAF(k, w); + + // Add `this`*(N+1) for every w-NAF index + var acc = this.jpoint(null, null, null); + for (var i = naf.length - 1; i >= 0; i--) { + // Count zeroes + for (var k = 0; i >= 0 && naf[i] === 0; i--) + k++; + if (i >= 0) + k++; + acc = acc.dblp(k); + + if (i < 0) + break; + var z = naf[i]; + assert(z !== 0); + if (p.type === 'affine') { + // J +- P + if (z > 0) + acc = acc.mixedAdd(wnd[(z - 1) >> 1]); + else + acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); + } else { + // J +- J + if (z > 0) + acc = acc.add(wnd[(z - 1) >> 1]); + else + acc = acc.add(wnd[(-z - 1) >> 1].neg()); + } + } + return p.type === 'affine' ? acc.toP() : acc; +}; + +BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, + points, + coeffs, + len, + jacobianResult) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + + // Fill all arrays + var max = 0; + for (var i = 0; i < len; i++) { + var p = points[i]; + var nafPoints = p._getNAFPoints(defW); + wndWidth[i] = nafPoints.wnd; + wnd[i] = nafPoints.points; + } + + // Comb small window NAFs + for (var i = len - 1; i >= 1; i -= 2) { + var a = i - 1; + var b = i; + if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { + naf[a] = getNAF(coeffs[a], wndWidth[a]); + naf[b] = getNAF(coeffs[b], wndWidth[b]); + max = Math.max(naf[a].length, max); + max = Math.max(naf[b].length, max); + continue; + } + + var comb = [ + points[a], /* 1 */ + null, /* 3 */ + null, /* 5 */ + points[b] /* 7 */ + ]; + + // Try to avoid Projective points, if possible + if (points[a].y.cmp(points[b].y) === 0) { + comb[1] = points[a].add(points[b]); + comb[2] = points[a].toJ().mixedAdd(points[b].neg()); + } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { + comb[1] = points[a].toJ().mixedAdd(points[b]); + comb[2] = points[a].add(points[b].neg()); + } else { + comb[1] = points[a].toJ().mixedAdd(points[b]); + comb[2] = points[a].toJ().mixedAdd(points[b].neg()); + } + + var index = [ + -3, /* -1 -1 */ + -1, /* -1 0 */ + -5, /* -1 1 */ + -7, /* 0 -1 */ + 0, /* 0 0 */ + 7, /* 0 1 */ + 5, /* 1 -1 */ + 1, /* 1 0 */ + 3 /* 1 1 */ + ]; + + var jsf = getJSF(coeffs[a], coeffs[b]); + max = Math.max(jsf[0].length, max); + naf[a] = new Array(max); + naf[b] = new Array(max); + for (var j = 0; j < max; j++) { + var ja = jsf[0][j] | 0; + var jb = jsf[1][j] | 0; + + naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; + naf[b][j] = 0; + wnd[a] = comb; + } + } + + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (var i = max; i >= 0; i--) { + var k = 0; + + while (i >= 0) { + var zero = true; + for (var j = 0; j < len; j++) { + tmp[j] = naf[j][i] | 0; + if (tmp[j] !== 0) + zero = false; + } + if (!zero) + break; + k++; + i--; + } + if (i >= 0) + k++; + acc = acc.dblp(k); + if (i < 0) + break; + + for (var j = 0; j < len; j++) { + var z = tmp[j]; + var p; + if (z === 0) + continue; + else if (z > 0) + p = wnd[j][(z - 1) >> 1]; + else if (z < 0) + p = wnd[j][(-z - 1) >> 1].neg(); + + if (p.type === 'affine') + acc = acc.mixedAdd(p); + else + acc = acc.add(p); + } + } + // Zeroify references + for (var i = 0; i < len; i++) + wnd[i] = null; + + if (jacobianResult) + return acc; + else + return acc.toP(); +}; + +function BasePoint(curve, type) { + this.curve = curve; + this.type = type; + this.precomputed = null; +} +BaseCurve.BasePoint = BasePoint; + +BasePoint.prototype.eq = function eq(/*other*/) { + throw new Error('Not implemented'); +}; + +BasePoint.prototype.validate = function validate() { + return this.curve.validate(this); +}; + +BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils.toArray(bytes, enc); + + var len = this.p.byteLength(); + + // uncompressed, hybrid-odd, hybrid-even + if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && + bytes.length - 1 === 2 * len) { + if (bytes[0] === 0x06) + assert(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 0x07) + assert(bytes[bytes.length - 1] % 2 === 1); + + var res = this.point(bytes.slice(1, 1 + len), + bytes.slice(1 + len, 1 + 2 * len)); + + return res; + } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && + bytes.length - 1 === len) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); + } + throw new Error('Unknown point format'); +}; + +BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); +}; + +BasePoint.prototype._encode = function _encode(compact) { + var len = this.curve.p.byteLength(); + var x = this.getX().toArray('be', len); + + if (compact) + return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); + + return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ; +}; + +BasePoint.prototype.encode = function encode(enc, compact) { + return utils.encode(this._encode(compact), enc); +}; + +BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) + return this; + + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + + return this; +}; + +BasePoint.prototype._hasDoubles = function _hasDoubles(k) { + if (!this.precomputed) + return false; + + var doubles = this.precomputed.doubles; + if (!doubles) + return false; + + return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); +}; + +BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + + var doubles = [ this ]; + var acc = this; + for (var i = 0; i < power; i += step) { + for (var j = 0; j < step; j++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step: step, + points: doubles + }; +}; + +BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + + var res = [ this ]; + var max = (1 << wnd) - 1; + var dbl = max === 1 ? null : this.dbl(); + for (var i = 1; i < max; i++) + res[i] = res[i - 1].add(dbl); + return { + wnd: wnd, + points: res + }; +}; + +BasePoint.prototype._getBeta = function _getBeta() { + return null; +}; + +BasePoint.prototype.dblp = function dblp(k) { + var r = this; + for (var i = 0; i < k; i++) + r = r.dbl(); + return r; +}; + +},{"../../elliptic":285,"bn.js":280}],287:[function(require,module,exports){ +'use strict'; + +var curve = require('../curve'); +var elliptic = require('../../elliptic'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = curve.base; + +var assert = elliptic.utils.assert; + +function EdwardsCurve(conf) { + // NOTE: Important as we are creating point in Base.call() + this.twisted = (conf.a | 0) !== 1; + this.mOneA = this.twisted && (conf.a | 0) === -1; + this.extended = this.mOneA; + + Base.call(this, 'edwards', conf); + + this.a = new BN(conf.a, 16).umod(this.red.m); + this.a = this.a.toRed(this.red); + this.c = new BN(conf.c, 16).toRed(this.red); + this.c2 = this.c.redSqr(); + this.d = new BN(conf.d, 16).toRed(this.red); + this.dd = this.d.redAdd(this.d); + + assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); + this.oneC = (conf.c | 0) === 1; +} +inherits(EdwardsCurve, Base); +module.exports = EdwardsCurve; + +EdwardsCurve.prototype._mulA = function _mulA(num) { + if (this.mOneA) + return num.redNeg(); + else + return this.a.redMul(num); +}; + +EdwardsCurve.prototype._mulC = function _mulC(num) { + if (this.oneC) + return num; + else + return this.c.redMul(num); +}; + +// Just for compatibility with Short curve +EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { + return this.point(x, y, z, t); +}; + +EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new BN(x, 16); + if (!x.red) + x = x.toRed(this.red); + + var x2 = x.redSqr(); + var rhs = this.c2.redSub(this.a.redMul(x2)); + var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); + + var y2 = rhs.redMul(lhs.redInvm()); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + var isOdd = y.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y = y.redNeg(); + + return this.point(x, y); +}; + +EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) { + y = new BN(y, 16); + if (!y.red) + y = y.toRed(this.red); + + // x^2 = (y^2 - 1) / (d y^2 + 1) + var y2 = y.redSqr(); + var lhs = y2.redSub(this.one); + var rhs = y2.redMul(this.d).redAdd(this.one); + var x2 = lhs.redMul(rhs.redInvm()); + + if (x2.cmp(this.zero) === 0) { + if (odd) + throw new Error('invalid point'); + else + return this.point(this.zero, y); + } + + var x = x2.redSqrt(); + if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + if (x.isOdd() !== odd) + x = x.redNeg(); + + return this.point(x, y); +}; + +EdwardsCurve.prototype.validate = function validate(point) { + if (point.isInfinity()) + return true; + + // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) + point.normalize(); + + var x2 = point.x.redSqr(); + var y2 = point.y.redSqr(); + var lhs = x2.redMul(this.a).redAdd(y2); + var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); + + return lhs.cmp(rhs) === 0; +}; + +function Point(curve, x, y, z, t) { + Base.BasePoint.call(this, curve, 'projective'); + if (x === null && y === null && z === null) { + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + this.z = z ? new BN(z, 16) : this.curve.one; + this.t = t && new BN(t, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + + // Use extended coordinates + if (this.curve.extended && !this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redMul(this.z.redInvm()); + } + } +} +inherits(Point, Base.BasePoint); + +EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); +}; + +EdwardsCurve.prototype.point = function point(x, y, z, t) { + return new Point(this, x, y, z, t); +}; + +Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1], obj[2]); +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.x.cmpn(0) === 0 && + this.y.cmp(this.z) === 0; +}; + +Point.prototype._extDbl = function _extDbl() { + // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html + // #doubling-dbl-2008-hwcd + // 4M + 4S + + // A = X1^2 + var a = this.x.redSqr(); + // B = Y1^2 + var b = this.y.redSqr(); + // C = 2 * Z1^2 + var c = this.z.redSqr(); + c = c.redIAdd(c); + // D = a * A + var d = this.curve._mulA(a); + // E = (X1 + Y1)^2 - A - B + var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); + // G = D + B + var g = d.redAdd(b); + // F = G - C + var f = g.redSub(c); + // H = D - B + var h = d.redSub(b); + // X3 = E * F + var nx = e.redMul(f); + // Y3 = G * H + var ny = g.redMul(h); + // T3 = E * H + var nt = e.redMul(h); + // Z3 = F * G + var nz = f.redMul(g); + return this.curve.point(nx, ny, nz, nt); +}; + +Point.prototype._projDbl = function _projDbl() { + // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html + // #doubling-dbl-2008-bbjlp + // #doubling-dbl-2007-bl + // and others + // Generally 3M + 4S or 2M + 4S + + // B = (X1 + Y1)^2 + var b = this.x.redAdd(this.y).redSqr(); + // C = X1^2 + var c = this.x.redSqr(); + // D = Y1^2 + var d = this.y.redSqr(); + + var nx; + var ny; + var nz; + if (this.curve.twisted) { + // E = a * C + var e = this.curve._mulA(c); + // F = E + D + var f = e.redAdd(d); + if (this.zOne) { + // X3 = (B - C - D) * (F - 2) + nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); + // Y3 = F * (E - D) + ny = f.redMul(e.redSub(d)); + // Z3 = F^2 - 2 * F + nz = f.redSqr().redSub(f).redSub(f); + } else { + // H = Z1^2 + var h = this.z.redSqr(); + // J = F - 2 * H + var j = f.redSub(h).redISub(h); + // X3 = (B-C-D)*J + nx = b.redSub(c).redISub(d).redMul(j); + // Y3 = F * (E - D) + ny = f.redMul(e.redSub(d)); + // Z3 = F * J + nz = f.redMul(j); + } + } else { + // E = C + D + var e = c.redAdd(d); + // H = (c * Z1)^2 + var h = this.curve._mulC(this.c.redMul(this.z)).redSqr(); + // J = E - 2 * H + var j = e.redSub(h).redSub(h); + // X3 = c * (B - E) * J + nx = this.curve._mulC(b.redISub(e)).redMul(j); + // Y3 = c * E * (C - D) + ny = this.curve._mulC(e).redMul(c.redISub(d)); + // Z3 = E * J + nz = e.redMul(j); + } + return this.curve.point(nx, ny, nz); +}; + +Point.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + + // Double in extended coordinates + if (this.curve.extended) + return this._extDbl(); + else + return this._projDbl(); +}; + +Point.prototype._extAdd = function _extAdd(p) { + // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html + // #addition-add-2008-hwcd-3 + // 8M + + // A = (Y1 - X1) * (Y2 - X2) + var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); + // B = (Y1 + X1) * (Y2 + X2) + var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); + // C = T1 * k * T2 + var c = this.t.redMul(this.curve.dd).redMul(p.t); + // D = Z1 * 2 * Z2 + var d = this.z.redMul(p.z.redAdd(p.z)); + // E = B - A + var e = b.redSub(a); + // F = D - C + var f = d.redSub(c); + // G = D + C + var g = d.redAdd(c); + // H = B + A + var h = b.redAdd(a); + // X3 = E * F + var nx = e.redMul(f); + // Y3 = G * H + var ny = g.redMul(h); + // T3 = E * H + var nt = e.redMul(h); + // Z3 = F * G + var nz = f.redMul(g); + return this.curve.point(nx, ny, nz, nt); +}; + +Point.prototype._projAdd = function _projAdd(p) { + // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html + // #addition-add-2008-bbjlp + // #addition-add-2007-bl + // 10M + 1S + + // A = Z1 * Z2 + var a = this.z.redMul(p.z); + // B = A^2 + var b = a.redSqr(); + // C = X1 * X2 + var c = this.x.redMul(p.x); + // D = Y1 * Y2 + var d = this.y.redMul(p.y); + // E = d * C * D + var e = this.curve.d.redMul(c).redMul(d); + // F = B - E + var f = b.redSub(e); + // G = B + E + var g = b.redAdd(e); + // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) + var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); + var nx = a.redMul(f).redMul(tmp); + var ny; + var nz; + if (this.curve.twisted) { + // Y3 = A * G * (D - a * C) + ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); + // Z3 = F * G + nz = f.redMul(g); + } else { + // Y3 = A * G * (D - C) + ny = a.redMul(g).redMul(d.redSub(c)); + // Z3 = c * F * G + nz = this.curve._mulC(f).redMul(g); + } + return this.curve.point(nx, ny, nz); +}; + +Point.prototype.add = function add(p) { + if (this.isInfinity()) + return p; + if (p.isInfinity()) + return this; + + if (this.curve.extended) + return this._extAdd(p); + else + return this._projAdd(p); +}; + +Point.prototype.mul = function mul(k) { + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + else + return this.curve._wnafMul(this, k); +}; + +Point.prototype.mulAdd = function mulAdd(k1, p, k2) { + return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); +}; + +Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) { + return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); +}; + +Point.prototype.normalize = function normalize() { + if (this.zOne) + return this; + + // Normalize coordinates + var zi = this.z.redInvm(); + this.x = this.x.redMul(zi); + this.y = this.y.redMul(zi); + if (this.t) + this.t = this.t.redMul(zi); + this.z = this.curve.one; + this.zOne = true; + return this; +}; + +Point.prototype.neg = function neg() { + return this.curve.point(this.x.redNeg(), + this.y, + this.z, + this.t && this.t.redNeg()); +}; + +Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); +}; + +Point.prototype.getY = function getY() { + this.normalize(); + return this.y.fromRed(); +}; + +Point.prototype.eq = function eq(other) { + return this === other || + this.getX().cmp(other.getX()) === 0 && + this.getY().cmp(other.getY()) === 0; +}; + +Point.prototype.eqXToP = function eqXToP(x) { + var rx = x.toRed(this.curve.red).redMul(this.z); + if (this.x.cmp(rx) === 0) + return true; + + var xc = x.clone(); + var t = this.curve.redN.redMul(this.z); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + + rx.redIAdd(t); + if (this.x.cmp(rx) === 0) + return true; + } + return false; +}; + +// Compatibility with BaseCurve +Point.prototype.toP = Point.prototype.normalize; +Point.prototype.mixedAdd = Point.prototype.add; + +},{"../../elliptic":285,"../curve":288,"bn.js":280,"inherits":318}],288:[function(require,module,exports){ +'use strict'; + +var curve = exports; + +curve.base = require('./base'); +curve.short = require('./short'); +curve.mont = require('./mont'); +curve.edwards = require('./edwards'); + +},{"./base":286,"./edwards":287,"./mont":289,"./short":290}],289:[function(require,module,exports){ +'use strict'; + +var curve = require('../curve'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = curve.base; + +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; + +function MontCurve(conf) { + Base.call(this, 'mont', conf); + + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.i4 = new BN(4).toRed(this.red).redInvm(); + this.two = new BN(2).toRed(this.red); + this.a24 = this.i4.redMul(this.a.redAdd(this.two)); +} +inherits(MontCurve, Base); +module.exports = MontCurve; + +MontCurve.prototype.validate = function validate(point) { + var x = point.normalize().x; + var x2 = x.redSqr(); + var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); + var y = rhs.redSqrt(); + + return y.redSqr().cmp(rhs) === 0; +}; + +function Point(curve, x, z) { + Base.BasePoint.call(this, curve, 'projective'); + if (x === null && z === null) { + this.x = this.curve.one; + this.z = this.curve.zero; + } else { + this.x = new BN(x, 16); + this.z = new BN(z, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } +} +inherits(Point, Base.BasePoint); + +MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + return this.point(utils.toArray(bytes, enc), 1); +}; + +MontCurve.prototype.point = function point(x, z) { + return new Point(this, x, z); +}; + +MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); +}; + +Point.prototype.precompute = function precompute() { + // No-op +}; + +Point.prototype._encode = function _encode() { + return this.getX().toArray('be', this.curve.p.byteLength()); +}; + +Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1] || curve.one); +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.z.cmpn(0) === 0; +}; + +Point.prototype.dbl = function dbl() { + // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 + // 2M + 2S + 4A + + // A = X1 + Z1 + var a = this.x.redAdd(this.z); + // AA = A^2 + var aa = a.redSqr(); + // B = X1 - Z1 + var b = this.x.redSub(this.z); + // BB = B^2 + var bb = b.redSqr(); + // C = AA - BB + var c = aa.redSub(bb); + // X3 = AA * BB + var nx = aa.redMul(bb); + // Z3 = C * (BB + A24 * C) + var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); + return this.curve.point(nx, nz); +}; + +Point.prototype.add = function add() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.diffAdd = function diffAdd(p, diff) { + // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 + // 4M + 2S + 6A + + // A = X2 + Z2 + var a = this.x.redAdd(this.z); + // B = X2 - Z2 + var b = this.x.redSub(this.z); + // C = X3 + Z3 + var c = p.x.redAdd(p.z); + // D = X3 - Z3 + var d = p.x.redSub(p.z); + // DA = D * A + var da = d.redMul(a); + // CB = C * B + var cb = c.redMul(b); + // X5 = Z1 * (DA + CB)^2 + var nx = diff.z.redMul(da.redAdd(cb).redSqr()); + // Z5 = X1 * (DA - CB)^2 + var nz = diff.x.redMul(da.redISub(cb).redSqr()); + return this.curve.point(nx, nz); +}; + +Point.prototype.mul = function mul(k) { + var t = k.clone(); + var a = this; // (N / 2) * Q + Q + var b = this.curve.point(null, null); // (N / 2) * Q + var c = this; // Q + + for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) + bits.push(t.andln(1)); + + for (var i = bits.length - 1; i >= 0; i--) { + if (bits[i] === 0) { + // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q + a = a.diffAdd(b, c); + // N * Q = 2 * ((N / 2) * Q + Q)) + b = b.dbl(); + } else { + // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) + b = a.diffAdd(b, c); + // N * Q + Q = 2 * ((N / 2) * Q + Q) + a = a.dbl(); + } + } + return b; +}; + +Point.prototype.mulAdd = function mulAdd() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.jumlAdd = function jumlAdd() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.eq = function eq(other) { + return this.getX().cmp(other.getX()) === 0; +}; + +Point.prototype.normalize = function normalize() { + this.x = this.x.redMul(this.z.redInvm()); + this.z = this.curve.one; + return this; +}; + +Point.prototype.getX = function getX() { + // Normalize coordinates + this.normalize(); + + return this.x.fromRed(); +}; + +},{"../../elliptic":285,"../curve":288,"bn.js":280,"inherits":318}],290:[function(require,module,exports){ +'use strict'; + +var curve = require('../curve'); +var elliptic = require('../../elliptic'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = curve.base; + +var assert = elliptic.utils.assert; + +function ShortCurve(conf) { + Base.call(this, 'short', conf); + + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + + // If the curve is endomorphic, precalculate beta and lambda + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); +} +inherits(ShortCurve, Base); +module.exports = ShortCurve; + +ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + // No efficient endomorphism + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) + return; + + // Compute beta and lambda, that lambda * P = (beta * Px; Py) + var beta; + var lambda; + if (conf.beta) { + beta = new BN(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + // Choose the smallest beta + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new BN(conf.lambda, 16); + } else { + // Choose the lambda that is matching selected beta + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + + // Get basis vectors, used for balanced length-two representation + var basis; + if (conf.basis) { + basis = conf.basis.map(function(vec) { + return { + a: new BN(vec.a, 16), + b: new BN(vec.b, 16) + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + + return { + beta: beta, + lambda: lambda, + basis: basis + }; +}; + +ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + // Find roots of for x^2 + x + 1 in F + // Root = (-1 +- Sqrt(-3)) / 2 + // + var red = num === this.p ? this.red : BN.mont(num); + var tinv = new BN(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + + var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); + + var l1 = ntinv.redAdd(s).fromRed(); + var l2 = ntinv.redSub(s).fromRed(); + return [ l1, l2 ]; +}; + +ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + // aprxSqrt >= sqrt(this.n) + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + + // 3.74 + // Run EGCD, until r(L + 1) < aprxSqrt + var u = lambda; + var v = this.n.clone(); + var x1 = new BN(1); + var y1 = new BN(0); + var x2 = new BN(0); + var y2 = new BN(1); + + // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) + var a0; + var b0; + // First vector + var a1; + var b1; + // Second vector + var a2; + var b2; + + var prevR; + var i = 0; + var r; + var x; + while (u.cmpn(0) !== 0) { + var q = v.div(u); + r = v.sub(q.mul(u)); + x = x2.sub(q.mul(x1)); + var y = y2.sub(q.mul(y1)); + + if (!a1 && r.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r.neg(); + b1 = x; + } else if (a1 && ++i === 2) { + break; + } + prevR = r; + + v = u; + u = r; + x2 = x1; + x1 = x; + y2 = y1; + y1 = y; + } + a2 = r.neg(); + b2 = x; + + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a2.sqr().add(b2.sqr()); + if (len2.cmp(len1) >= 0) { + a2 = a0; + b2 = b0; + } + + // Normalize signs + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a2.negative) { + a2 = a2.neg(); + b2 = b2.neg(); + } + + return [ + { a: a1, b: b1 }, + { a: a2, b: b2 } + ]; +}; + +ShortCurve.prototype._endoSplit = function _endoSplit(k) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v2 = basis[1]; + + var c1 = v2.b.mul(k).divRound(this.n); + var c2 = v1.b.neg().mul(k).divRound(this.n); + + var p1 = c1.mul(v1.a); + var p2 = c2.mul(v2.a); + var q1 = c1.mul(v1.b); + var q2 = c2.mul(v2.b); + + // Calculate answer + var k1 = k.sub(p1).sub(p2); + var k2 = q1.add(q2).neg(); + return { k1: k1, k2: k2 }; +}; + +ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new BN(x, 16); + if (!x.red) + x = x.toRed(this.red); + + var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + // XXX Is there any way to tell if the number is odd without converting it + // to non-red form? + var isOdd = y.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y = y.redNeg(); + + return this.point(x, y); +}; + +ShortCurve.prototype.validate = function validate(point) { + if (point.inf) + return true; + + var x = point.x; + var y = point.y; + + var ax = this.a.redMul(x); + var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); + return y.redSqr().redISub(rhs).cmpn(0) === 0; +}; + +ShortCurve.prototype._endoWnafMulAdd = + function _endoWnafMulAdd(points, coeffs, jacobianResult) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i = 0; i < points.length; i++) { + var split = this._endoSplit(coeffs[i]); + var p = points[i]; + var beta = p._getBeta(); + + if (split.k1.negative) { + split.k1.ineg(); + p = p.neg(true); + } + if (split.k2.negative) { + split.k2.ineg(); + beta = beta.neg(true); + } + + npoints[i * 2] = p; + npoints[i * 2 + 1] = beta; + ncoeffs[i * 2] = split.k1; + ncoeffs[i * 2 + 1] = split.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); + + // Clean-up references to points and coefficients + for (var j = 0; j < i * 2; j++) { + npoints[j] = null; + ncoeffs[j] = null; + } + return res; +}; + +function Point(curve, x, y, isRed) { + Base.BasePoint.call(this, curve, 'affine'); + if (x === null && y === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + // Force redgomery representation when loading from JSON + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + this.inf = false; + } +} +inherits(Point, Base.BasePoint); + +ShortCurve.prototype.point = function point(x, y, isRed) { + return new Point(this, x, y, isRed); +}; + +ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); +}; + +Point.prototype._getBeta = function _getBeta() { + if (!this.curve.endo) + return; + + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function(p) { + return curve.point(p.x.redMul(curve.endo.beta), p.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; +}; + +Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) + return [ this.x, this.y ]; + + return [ this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + } ]; +}; + +Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === 'string') + obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + + function obj2point(obj) { + return curve.point(obj[0], obj[1], red); + } + + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [ res ].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [ res ].concat(pre.naf.points.map(obj2point)) + } + }; + return res; +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + return this.inf; +}; + +Point.prototype.add = function add(p) { + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P = 2P + if (this.eq(p)) + return this.dbl(); + + // P + (-P) = O + if (this.neg().eq(p)) + return this.curve.point(null, null); + + // P + Q = O + if (this.x.cmp(p.x) === 0) + return this.curve.point(null, null); + + var c = this.y.redSub(p.y); + if (c.cmpn(0) !== 0) + c = c.redMul(this.x.redSub(p.x).redInvm()); + var nx = c.redSqr().redISub(this.x).redISub(p.x); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}; + +Point.prototype.dbl = function dbl() { + if (this.inf) + return this; + + // 2P = O + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + + var a = this.curve.a; + + var x2 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); + + var nx = c.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}; + +Point.prototype.getX = function getX() { + return this.x.fromRed(); +}; + +Point.prototype.getY = function getY() { + return this.y.fromRed(); +}; + +Point.prototype.mul = function mul(k) { + k = new BN(k, 16); + + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + else if (this.curve.endo) + return this.curve._endoWnafMulAdd([ this ], [ k ]); + else + return this.curve._wnafMul(this, k); +}; + +Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { + var points = [ this, p2 ]; + var coeffs = [ k1, k2 ]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2); +}; + +Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { + var points = [ this, p2 ]; + var coeffs = [ k1, k2 ]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2, true); +}; + +Point.prototype.eq = function eq(p) { + return this === p || + this.inf === p.inf && + (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); +}; + +Point.prototype.neg = function neg(_precompute) { + if (this.inf) + return this; + + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate = function(p) { + return p.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate) + } + }; + } + return res; +}; + +Point.prototype.toJ = function toJ() { + if (this.inf) + return this.curve.jpoint(null, null, null); + + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; +}; + +function JPoint(curve, x, y, z) { + Base.BasePoint.call(this, curve, 'jacobian'); + if (x === null && y === null && z === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new BN(0); + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + this.z = new BN(z, 16); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + this.zOne = this.z === this.curve.one; +} +inherits(JPoint, Base.BasePoint); + +ShortCurve.prototype.jpoint = function jpoint(x, y, z) { + return new JPoint(this, x, y, z); +}; + +JPoint.prototype.toP = function toP() { + if (this.isInfinity()) + return this.curve.point(null, null); + + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + + return this.curve.point(ax, ay); +}; + +JPoint.prototype.neg = function neg() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); +}; + +JPoint.prototype.add = function add(p) { + // O + P = P + if (this.isInfinity()) + return p; + + // P + O = P + if (p.isInfinity()) + return this; + + // 12M + 4S + 7A + var pz2 = p.z.redSqr(); + var z2 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u2 = p.x.redMul(z2); + var s1 = this.y.redMul(pz2.redMul(p.z)); + var s2 = p.y.redMul(z2.redMul(this.z)); + + var h = u1.redSub(u2); + var r = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + + var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(p.z).redMul(h); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.mixedAdd = function mixedAdd(p) { + // O + P = P + if (this.isInfinity()) + return p.toJ(); + + // P + O = P + if (p.isInfinity()) + return this; + + // 8M + 3S + 7A + var z2 = this.z.redSqr(); + var u1 = this.x; + var u2 = p.x.redMul(z2); + var s1 = this.y; + var s2 = p.y.redMul(z2).redMul(this.z); + + var h = u1.redSub(u2); + var r = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + + var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(h); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.dblp = function dblp(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + + if (this.curve.zeroA || this.curve.threeA) { + var r = this; + for (var i = 0; i < pow; i++) + r = r.dbl(); + return r; + } + + // 1M + 2S + 1A + N * (4S + 5M + 8A) + // N = 1 => 6M + 6S + 9A + var a = this.curve.a; + var tinv = this.curve.tinv; + + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + + // Reuse results + var jyd = jy.redAdd(jy); + for (var i = 0; i < pow; i++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); + + var t1 = jx.redMul(jyd2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + var dny = c.redMul(t2); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i + 1 < pow) + jz4 = jz4.redMul(jyd4); + + jx = nx; + jz = nz; + jyd = dny; + } + + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); +}; + +JPoint.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + + if (this.curve.zeroA) + return this._zeroDbl(); + else if (this.curve.threeA) + return this._threeDbl(); + else + return this._dbl(); +}; + +JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + // Z = 1 + if (this.zOne) { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html + // #doubling-mdbl-2007-bl + // 1M + 5S + 14A + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // S = 2 * ((X1 + YY)^2 - XX - YYYY) + var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s = s.redIAdd(s); + // M = 3 * XX + a; a = 0 + var m = xx.redAdd(xx).redIAdd(xx); + // T = M ^ 2 - 2*S + var t = m.redSqr().redISub(s).redISub(s); + + // 8 * YYYY + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + + // X3 = T + nx = t; + // Y3 = M * (S - T) - 8 * YYYY + ny = m.redMul(s.redISub(t)).redISub(yyyy8); + // Z3 = 2*Y1 + nz = this.y.redAdd(this.y); + } else { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html + // #doubling-dbl-2009-l + // 2M + 5S + 13A + + // A = X1^2 + var a = this.x.redSqr(); + // B = Y1^2 + var b = this.y.redSqr(); + // C = B^2 + var c = b.redSqr(); + // D = 2 * ((X1 + B)^2 - A - C) + var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); + d = d.redIAdd(d); + // E = 3 * A + var e = a.redAdd(a).redIAdd(a); + // F = E^2 + var f = e.redSqr(); + + // 8 * C + var c8 = c.redIAdd(c); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + + // X3 = F - 2 * D + nx = f.redISub(d).redISub(d); + // Y3 = E * (D - X3) - 8 * C + ny = e.redMul(d.redISub(nx)).redISub(c8); + // Z3 = 2 * Y1 * Z1 + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + // Z = 1 + if (this.zOne) { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html + // #doubling-mdbl-2007-bl + // 1M + 5S + 15A + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // S = 2 * ((X1 + YY)^2 - XX - YYYY) + var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s = s.redIAdd(s); + // M = 3 * XX + a + var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + // T = M^2 - 2 * S + var t = m.redSqr().redISub(s).redISub(s); + // X3 = T + nx = t; + // Y3 = M * (S - T) - 8 * YYYY + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m.redMul(s.redISub(t)).redISub(yyyy8); + // Z3 = 2 * Y1 + nz = this.y.redAdd(this.y); + } else { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // 3M + 5S + + // delta = Z1^2 + var delta = this.z.redSqr(); + // gamma = Y1^2 + var gamma = this.y.redSqr(); + // beta = X1 * gamma + var beta = this.x.redMul(gamma); + // alpha = 3 * (X1 - delta) * (X1 + delta) + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + // X3 = alpha^2 - 8 * beta + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + // Z3 = (Y1 + Z1)^2 - gamma - delta + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype._dbl = function _dbl() { + var a = this.curve.a; + + // 4M + 6S + 10A + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); + + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c.redMul(t2).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) + return this.dbl().add(this); + + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl + // 5M + 10S + ... + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // ZZ = Z1^2 + var zz = this.z.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // M = 3 * XX + a * ZZ2; a = 0 + var m = xx.redAdd(xx).redIAdd(xx); + // MM = M^2 + var mm = m.redSqr(); + // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM + var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e = e.redIAdd(e); + e = e.redAdd(e).redIAdd(e); + e = e.redISub(mm); + // EE = E^2 + var ee = e.redSqr(); + // T = 16*YYYY + var t = yyyy.redIAdd(yyyy); + t = t.redIAdd(t); + t = t.redIAdd(t); + t = t.redIAdd(t); + // U = (M + E)^2 - MM - EE - T + var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); + // X3 = 4 * (X1 * EE - 4 * YY * U) + var yyu4 = yy.redMul(u); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + // Y3 = 8 * Y1 * (U * (T - U) - E * EE) + var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + // Z3 = (Z1 + E)^2 - ZZ - EE + var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.mul = function mul(k, kbase) { + k = new BN(k, kbase); + + return this.curve._wnafMul(this, k); +}; + +JPoint.prototype.eq = function eq(p) { + if (p.type === 'affine') + return this.eq(p.toJ()); + + if (this === p) + return true; + + // x1 * z2^2 == x2 * z1^2 + var z2 = this.z.redSqr(); + var pz2 = p.z.redSqr(); + if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) + return false; + + // y1 * z2^3 == y2 * z1^3 + var z3 = z2.redMul(this.z); + var pz3 = pz2.redMul(p.z); + return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; +}; + +JPoint.prototype.eqXToP = function eqXToP(x) { + var zs = this.z.redSqr(); + var rx = x.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return true; + + var xc = x.clone(); + var t = this.curve.redN.redMul(zs); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + + rx.redIAdd(t); + if (this.x.cmp(rx) === 0) + return true; + } + return false; +}; + +JPoint.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +JPoint.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.z.cmpn(0) === 0; +}; + +},{"../../elliptic":285,"../curve":288,"bn.js":280,"inherits":318}],291:[function(require,module,exports){ +'use strict'; + +var curves = exports; + +var hash = require('hash.js'); +var elliptic = require('../elliptic'); + +var assert = elliptic.utils.assert; + +function PresetCurve(options) { + if (options.type === 'short') + this.curve = new elliptic.curve.short(options); + else if (options.type === 'edwards') + this.curve = new elliptic.curve.edwards(options); + else + this.curve = new elliptic.curve.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + + assert(this.g.validate(), 'Invalid curve'); + assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); +} +curves.PresetCurve = PresetCurve; + +function defineCurve(name, options) { + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + get: function() { + var curve = new PresetCurve(options); + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + value: curve + }); + return curve; + } + }); +} + +defineCurve('p192', { + type: 'short', + prime: 'p192', + p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', + b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', + n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', + hash: hash.sha256, + gRed: false, + g: [ + '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', + '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811' + ] +}); + +defineCurve('p224', { + type: 'short', + prime: 'p224', + p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', + b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', + n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', + hash: hash.sha256, + gRed: false, + g: [ + 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', + 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34' + ] +}); + +defineCurve('p256', { + type: 'short', + prime: null, + p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', + a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', + b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', + n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', + hash: hash.sha256, + gRed: false, + g: [ + '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5' + ] +}); + +defineCurve('p384', { + type: 'short', + prime: null, + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'fffffffe ffffffff 00000000 00000000 ffffffff', + a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'fffffffe ffffffff 00000000 00000000 fffffffc', + b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + + '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', + n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + + 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', + hash: hash.sha384, + gRed: false, + g: [ + 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + + '5502f25d bf55296c 3a545e38 72760ab7', + '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f' + ] +}); + +defineCurve('p521', { + type: 'short', + prime: null, + p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff', + a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff fffffffc', + b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + + '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + + '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', + n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', + hash: hash.sha512, + gRed: false, + g: [ + '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + + '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + + 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', + '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + + '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + + '3fad0761 353c7086 a272c240 88be9476 9fd16650' + ] +}); + +defineCurve('curve25519', { + type: 'mont', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '76d06', + b: '1', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: hash.sha256, + gRed: false, + g: [ + '9' + ] +}); + +defineCurve('ed25519', { + type: 'edwards', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '-1', + c: '1', + // -121665 * (121666^(-1)) (mod P) + d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: hash.sha256, + gRed: false, + g: [ + '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', + + // 4/5 + '6666666666666666666666666666666666666666666666666666666666666658' + ] +}); + +var pre; +try { + pre = require('./precomputed/secp256k1'); +} catch (e) { + pre = undefined; +} + +defineCurve('secp256k1', { + type: 'short', + prime: 'k256', + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', + a: '0', + b: '7', + n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', + h: '1', + hash: hash.sha256, + + // Precomputed endomorphism + beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', + lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', + basis: [ + { + a: '3086d221a7d46bcde86c90e49284eb15', + b: '-e4437ed6010e88286f547fa90abfe4c3' + }, + { + a: '114ca50f7a8e2f3f657c1108d9d44cfd8', + b: '3086d221a7d46bcde86c90e49284eb15' + } + ], + + gRed: false, + g: [ + '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', + pre + ] +}); + +},{"../elliptic":285,"./precomputed/secp256k1":298,"hash.js":301}],292:[function(require,module,exports){ +'use strict'; + +var BN = require('bn.js'); +var HmacDRBG = require('hmac-drbg'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; + +var KeyPair = require('./key'); +var Signature = require('./signature'); + +function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + + // Shortcut `elliptic.ec(curve-name)` + if (typeof options === 'string') { + assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options); + + options = elliptic.curves[options]; + } + + // Shortcut for `elliptic.ec(elliptic.curves.curveName)` + if (options instanceof elliptic.curves.PresetCurve) + options = { curve: options }; + + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + + // Point on curve + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + + // Hash for function for DRBG + this.hash = options.hash || options.curve.hash; +} +module.exports = EC; + +EC.prototype.keyPair = function keyPair(options) { + return new KeyPair(this, options); +}; + +EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return KeyPair.fromPrivate(this, priv, enc); +}; + +EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return KeyPair.fromPublic(this, pub, enc); +}; + +EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) + options = {}; + + // Instantiate Hmac_DRBG + var drbg = new HmacDRBG({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || 'utf8', + entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || 'utf8', + nonce: this.n.toArray() + }); + + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new BN(2)); + do { + var priv = new BN(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) + continue; + + priv.iaddn(1); + return this.keyFromPrivate(priv); + } while (true); +}; + +EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) + msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) + return msg.sub(this.n); + else + return msg; +}; + +EC.prototype.sign = function sign(msg, key, enc, options) { + if (typeof enc === 'object') { + options = enc; + enc = null; + } + if (!options) + options = {}; + + key = this.keyFromPrivate(key, enc); + msg = this._truncateToN(new BN(msg, 16)); + + // Zero-extend key to provide enough entropy + var bytes = this.n.byteLength(); + var bkey = key.getPrivate().toArray('be', bytes); + + // Zero-extend nonce to have the same byte size as N + var nonce = msg.toArray('be', bytes); + + // Instantiate Hmac_DRBG + var drbg = new HmacDRBG({ + hash: this.hash, + entropy: bkey, + nonce: nonce, + pers: options.pers, + persEnc: options.persEnc || 'utf8' + }); + + // Number of bytes to generate + var ns1 = this.n.sub(new BN(1)); + + for (var iter = 0; true; iter++) { + var k = options.k ? + options.k(iter) : + new BN(drbg.generate(this.n.byteLength())); + k = this._truncateToN(k, true); + if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) + continue; + + var kp = this.g.mul(k); + if (kp.isInfinity()) + continue; + + var kpX = kp.getX(); + var r = kpX.umod(this.n); + if (r.cmpn(0) === 0) + continue; + + var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); + s = s.umod(this.n); + if (s.cmpn(0) === 0) + continue; + + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | + (kpX.cmp(r) !== 0 ? 2 : 0); + + // Use complement of `s`, if it is > `n / 2` + if (options.canonical && s.cmp(this.nh) > 0) { + s = this.n.sub(s); + recoveryParam ^= 1; + } + + return new Signature({ r: r, s: s, recoveryParam: recoveryParam }); + } +}; + +EC.prototype.verify = function verify(msg, signature, key, enc) { + msg = this._truncateToN(new BN(msg, 16)); + key = this.keyFromPublic(key, enc); + signature = new Signature(signature, 'hex'); + + // Perform primitive values validation + var r = signature.r; + var s = signature.s; + if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) + return false; + if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) + return false; + + // Validate signature + var sinv = s.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u2 = sinv.mul(r).umod(this.n); + + if (!this.curve._maxwellTrick) { + var p = this.g.mulAdd(u1, key.getPublic(), u2); + if (p.isInfinity()) + return false; + + return p.getX().umod(this.n).cmp(r) === 0; + } + + // NOTE: Greg Maxwell's trick, inspired by: + // https://git.io/vad3K + + var p = this.g.jmulAdd(u1, key.getPublic(), u2); + if (p.isInfinity()) + return false; + + // Compare `p.x` of Jacobian point with `r`, + // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the + // inverse of `p.z^2` + return p.eqXToP(r); +}; + +EC.prototype.recoverPubKey = function(msg, signature, j, enc) { + assert((3 & j) === j, 'The recovery param is more than two bits'); + signature = new Signature(signature, enc); + + var n = this.n; + var e = new BN(msg); + var r = signature.r; + var s = signature.s; + + // A set LSB signifies that the y-coordinate is odd + var isYOdd = j & 1; + var isSecondKey = j >> 1; + if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error('Unable to find sencond key candinate'); + + // 1.1. Let x = r + jn. + if (isSecondKey) + r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); + else + r = this.curve.pointFromX(r, isYOdd); + + var rInv = signature.r.invm(n); + var s1 = n.sub(e).mul(rInv).umod(n); + var s2 = s.mul(rInv).umod(n); + + // 1.6.1 Compute Q = r^-1 (sR - eG) + // Q = r^-1 (sR + -eG) + return this.g.mulAdd(s1, r, s2); +}; + +EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { + signature = new Signature(signature, enc); + if (signature.recoveryParam !== null) + return signature.recoveryParam; + + for (var i = 0; i < 4; i++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e, signature, i); + } catch (e) { + continue; + } + + if (Qprime.eq(Q)) + return i; + } + throw new Error('Unable to find valid recovery factor'); +}; + +},{"../../elliptic":285,"./key":293,"./signature":294,"bn.js":280,"hmac-drbg":314}],293:[function(require,module,exports){ +'use strict'; + +var BN = require('bn.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; + +function KeyPair(ec, options) { + this.ec = ec; + this.priv = null; + this.pub = null; + + // KeyPair(ec, { priv: ..., pub: ... }) + if (options.priv) + this._importPrivate(options.priv, options.privEnc); + if (options.pub) + this._importPublic(options.pub, options.pubEnc); +} +module.exports = KeyPair; + +KeyPair.fromPublic = function fromPublic(ec, pub, enc) { + if (pub instanceof KeyPair) + return pub; + + return new KeyPair(ec, { + pub: pub, + pubEnc: enc + }); +}; + +KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { + if (priv instanceof KeyPair) + return priv; + + return new KeyPair(ec, { + priv: priv, + privEnc: enc + }); +}; + +KeyPair.prototype.validate = function validate() { + var pub = this.getPublic(); + + if (pub.isInfinity()) + return { result: false, reason: 'Invalid public key' }; + if (!pub.validate()) + return { result: false, reason: 'Public key is not a point' }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { result: false, reason: 'Public key * N != O' }; + + return { result: true, reason: null }; +}; + +KeyPair.prototype.getPublic = function getPublic(compact, enc) { + // compact is optional argument + if (typeof compact === 'string') { + enc = compact; + compact = null; + } + + if (!this.pub) + this.pub = this.ec.g.mul(this.priv); + + if (!enc) + return this.pub; + + return this.pub.encode(enc, compact); +}; + +KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === 'hex') + return this.priv.toString(16, 2); + else + return this.priv; +}; + +KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { + this.priv = new BN(key, enc || 16); + + // Ensure that the priv won't be bigger than n, otherwise we may fail + // in fixed multiplication method + this.priv = this.priv.umod(this.ec.curve.n); +}; + +KeyPair.prototype._importPublic = function _importPublic(key, enc) { + if (key.x || key.y) { + // Montgomery points only have an `x` coordinate. + // Weierstrass/Edwards points on the other hand have both `x` and + // `y` coordinates. + if (this.ec.curve.type === 'mont') { + assert(key.x, 'Need x coordinate'); + } else if (this.ec.curve.type === 'short' || + this.ec.curve.type === 'edwards') { + assert(key.x && key.y, 'Need both x and y coordinate'); + } + this.pub = this.ec.curve.point(key.x, key.y); + return; + } + this.pub = this.ec.curve.decodePoint(key, enc); +}; + +// ECDH +KeyPair.prototype.derive = function derive(pub) { + return pub.mul(this.priv).getX(); +}; + +// ECDSA +KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); +}; + +KeyPair.prototype.verify = function verify(msg, signature) { + return this.ec.verify(msg, signature, this); +}; + +KeyPair.prototype.inspect = function inspect() { + return ''; +}; + +},{"../../elliptic":285,"bn.js":280}],294:[function(require,module,exports){ +'use strict'; + +var BN = require('bn.js'); + +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; + +function Signature(options, enc) { + if (options instanceof Signature) + return options; + + if (this._importDER(options, enc)) + return; + + assert(options.r && options.s, 'Signature without r or s'); + this.r = new BN(options.r, 16); + this.s = new BN(options.s, 16); + if (options.recoveryParam === undefined) + this.recoveryParam = null; + else + this.recoveryParam = options.recoveryParam; +} +module.exports = Signature; + +function Position() { + this.place = 0; +} + +function getLength(buf, p) { + var initial = buf[p.place++]; + if (!(initial & 0x80)) { + return initial; + } + var octetLen = initial & 0xf; + var val = 0; + for (var i = 0, off = p.place; i < octetLen; i++, off++) { + val <<= 8; + val |= buf[off]; + } + p.place = off; + return val; +} + +function rmPadding(buf) { + var i = 0; + var len = buf.length - 1; + while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { + i++; + } + if (i === 0) { + return buf; + } + return buf.slice(i); +} + +Signature.prototype._importDER = function _importDER(data, enc) { + data = utils.toArray(data, enc); + var p = new Position(); + if (data[p.place++] !== 0x30) { + return false; + } + var len = getLength(data, p); + if ((len + p.place) !== data.length) { + return false; + } + if (data[p.place++] !== 0x02) { + return false; + } + var rlen = getLength(data, p); + var r = data.slice(p.place, rlen + p.place); + p.place += rlen; + if (data[p.place++] !== 0x02) { + return false; + } + var slen = getLength(data, p); + if (data.length !== slen + p.place) { + return false; + } + var s = data.slice(p.place, slen + p.place); + if (r[0] === 0 && (r[1] & 0x80)) { + r = r.slice(1); + } + if (s[0] === 0 && (s[1] & 0x80)) { + s = s.slice(1); + } + + this.r = new BN(r); + this.s = new BN(s); + this.recoveryParam = null; + + return true; +}; + +function constructLength(arr, len) { + if (len < 0x80) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + arr.push(octets | 0x80); + while (--octets) { + arr.push((len >>> (octets << 3)) & 0xff); + } + arr.push(len); +} + +Signature.prototype.toDER = function toDER(enc) { + var r = this.r.toArray(); + var s = this.s.toArray(); + + // Pad values + if (r[0] & 0x80) + r = [ 0 ].concat(r); + // Pad values + if (s[0] & 0x80) + s = [ 0 ].concat(s); + + r = rmPadding(r); + s = rmPadding(s); + + while (!s[0] && !(s[1] & 0x80)) { + s = s.slice(1); + } + var arr = [ 0x02 ]; + constructLength(arr, r.length); + arr = arr.concat(r); + arr.push(0x02); + constructLength(arr, s.length); + var backHalf = arr.concat(s); + var res = [ 0x30 ]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils.encode(res, enc); +}; + +},{"../../elliptic":285,"bn.js":280}],295:[function(require,module,exports){ +'use strict'; + +var hash = require('hash.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; +var parseBytes = utils.parseBytes; +var KeyPair = require('./key'); +var Signature = require('./signature'); + +function EDDSA(curve) { + assert(curve === 'ed25519', 'only tested with ed25519 so far'); + + if (!(this instanceof EDDSA)) + return new EDDSA(curve); + + var curve = elliptic.curves[curve].curve; + this.curve = curve; + this.g = curve.g; + this.g.precompute(curve.n.bitLength() + 1); + + this.pointClass = curve.point().constructor; + this.encodingLength = Math.ceil(curve.n.bitLength() / 8); + this.hash = hash.sha512; +} + +module.exports = EDDSA; + +/** +* @param {Array|String} message - message bytes +* @param {Array|String|KeyPair} secret - secret bytes or a keypair +* @returns {Signature} - signature +*/ +EDDSA.prototype.sign = function sign(message, secret) { + message = parseBytes(message); + var key = this.keyFromSecret(secret); + var r = this.hashInt(key.messagePrefix(), message); + var R = this.g.mul(r); + var Rencoded = this.encodePoint(R); + var s_ = this.hashInt(Rencoded, key.pubBytes(), message) + .mul(key.priv()); + var S = r.add(s_).umod(this.curve.n); + return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); +}; + +/** +* @param {Array} message - message bytes +* @param {Array|String|Signature} sig - sig bytes +* @param {Array|String|Point|KeyPair} pub - public key +* @returns {Boolean} - true if public key matches sig of message +*/ +EDDSA.prototype.verify = function verify(message, sig, pub) { + message = parseBytes(message); + sig = this.makeSignature(sig); + var key = this.keyFromPublic(pub); + var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); + var SG = this.g.mul(sig.S()); + var RplusAh = sig.R().add(key.pub().mul(h)); + return RplusAh.eq(SG); +}; + +EDDSA.prototype.hashInt = function hashInt() { + var hash = this.hash(); + for (var i = 0; i < arguments.length; i++) + hash.update(arguments[i]); + return utils.intFromLE(hash.digest()).umod(this.curve.n); +}; + +EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { + return KeyPair.fromPublic(this, pub); +}; + +EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { + return KeyPair.fromSecret(this, secret); +}; + +EDDSA.prototype.makeSignature = function makeSignature(sig) { + if (sig instanceof Signature) + return sig; + return new Signature(this, sig); +}; + +/** +* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 +* +* EDDSA defines methods for encoding and decoding points and integers. These are +* helper convenience methods, that pass along to utility functions implied +* parameters. +* +*/ +EDDSA.prototype.encodePoint = function encodePoint(point) { + var enc = point.getY().toArray('le', this.encodingLength); + enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; + return enc; +}; + +EDDSA.prototype.decodePoint = function decodePoint(bytes) { + bytes = utils.parseBytes(bytes); + + var lastIx = bytes.length - 1; + var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); + var xIsOdd = (bytes[lastIx] & 0x80) !== 0; + + var y = utils.intFromLE(normed); + return this.curve.pointFromY(y, xIsOdd); +}; + +EDDSA.prototype.encodeInt = function encodeInt(num) { + return num.toArray('le', this.encodingLength); +}; + +EDDSA.prototype.decodeInt = function decodeInt(bytes) { + return utils.intFromLE(bytes); +}; + +EDDSA.prototype.isPoint = function isPoint(val) { + return val instanceof this.pointClass; +}; + +},{"../../elliptic":285,"./key":296,"./signature":297,"hash.js":301}],296:[function(require,module,exports){ +'use strict'; + +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; +var parseBytes = utils.parseBytes; +var cachedProperty = utils.cachedProperty; + +/** +* @param {EDDSA} eddsa - instance +* @param {Object} params - public/private key parameters +* +* @param {Array} [params.secret] - secret seed bytes +* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) +* @param {Array} [params.pub] - public key point encoded as bytes +* +*/ +function KeyPair(eddsa, params) { + this.eddsa = eddsa; + this._secret = parseBytes(params.secret); + if (eddsa.isPoint(params.pub)) + this._pub = params.pub; + else + this._pubBytes = parseBytes(params.pub); +} + +KeyPair.fromPublic = function fromPublic(eddsa, pub) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(eddsa, { pub: pub }); +}; + +KeyPair.fromSecret = function fromSecret(eddsa, secret) { + if (secret instanceof KeyPair) + return secret; + return new KeyPair(eddsa, { secret: secret }); +}; + +KeyPair.prototype.secret = function secret() { + return this._secret; +}; + +cachedProperty(KeyPair, 'pubBytes', function pubBytes() { + return this.eddsa.encodePoint(this.pub()); +}); + +cachedProperty(KeyPair, 'pub', function pub() { + if (this._pubBytes) + return this.eddsa.decodePoint(this._pubBytes); + return this.eddsa.g.mul(this.priv()); +}); + +cachedProperty(KeyPair, 'privBytes', function privBytes() { + var eddsa = this.eddsa; + var hash = this.hash(); + var lastIx = eddsa.encodingLength - 1; + + var a = hash.slice(0, eddsa.encodingLength); + a[0] &= 248; + a[lastIx] &= 127; + a[lastIx] |= 64; + + return a; +}); + +cachedProperty(KeyPair, 'priv', function priv() { + return this.eddsa.decodeInt(this.privBytes()); +}); + +cachedProperty(KeyPair, 'hash', function hash() { + return this.eddsa.hash().update(this.secret()).digest(); +}); + +cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() { + return this.hash().slice(this.eddsa.encodingLength); +}); + +KeyPair.prototype.sign = function sign(message) { + assert(this._secret, 'KeyPair can only verify'); + return this.eddsa.sign(message, this); +}; + +KeyPair.prototype.verify = function verify(message, sig) { + return this.eddsa.verify(message, sig, this); +}; + +KeyPair.prototype.getSecret = function getSecret(enc) { + assert(this._secret, 'KeyPair is public only'); + return utils.encode(this.secret(), enc); +}; + +KeyPair.prototype.getPublic = function getPublic(enc) { + return utils.encode(this.pubBytes(), enc); +}; + +module.exports = KeyPair; + +},{"../../elliptic":285}],297:[function(require,module,exports){ +'use strict'; + +var BN = require('bn.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; +var cachedProperty = utils.cachedProperty; +var parseBytes = utils.parseBytes; + +/** +* @param {EDDSA} eddsa - eddsa instance +* @param {Array|Object} sig - +* @param {Array|Point} [sig.R] - R point as Point or bytes +* @param {Array|bn} [sig.S] - S scalar as bn or bytes +* @param {Array} [sig.Rencoded] - R point encoded +* @param {Array} [sig.Sencoded] - S scalar encoded +*/ +function Signature(eddsa, sig) { + this.eddsa = eddsa; + + if (typeof sig !== 'object') + sig = parseBytes(sig); + + if (Array.isArray(sig)) { + sig = { + R: sig.slice(0, eddsa.encodingLength), + S: sig.slice(eddsa.encodingLength) + }; + } + + assert(sig.R && sig.S, 'Signature without R or S'); + + if (eddsa.isPoint(sig.R)) + this._R = sig.R; + if (sig.S instanceof BN) + this._S = sig.S; + + this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; + this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; +} + +cachedProperty(Signature, 'S', function S() { + return this.eddsa.decodeInt(this.Sencoded()); +}); + +cachedProperty(Signature, 'R', function R() { + return this.eddsa.decodePoint(this.Rencoded()); +}); + +cachedProperty(Signature, 'Rencoded', function Rencoded() { + return this.eddsa.encodePoint(this.R()); +}); + +cachedProperty(Signature, 'Sencoded', function Sencoded() { + return this.eddsa.encodeInt(this.S()); +}); + +Signature.prototype.toBytes = function toBytes() { + return this.Rencoded().concat(this.Sencoded()); +}; + +Signature.prototype.toHex = function toHex() { + return utils.encode(this.toBytes(), 'hex').toUpperCase(); +}; + +module.exports = Signature; + +},{"../../elliptic":285,"bn.js":280}],298:[function(require,module,exports){ +module.exports = { + doubles: { + step: 4, + points: [ + [ + 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a', + 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821' + ], + [ + '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508', + '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf' + ], + [ + '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739', + 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695' + ], + [ + '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640', + '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9' + ], + [ + '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c', + '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36' + ], + [ + '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda', + '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f' + ], + [ + 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa', + '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999' + ], + [ + '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0', + 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09' + ], + [ + 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d', + '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d' + ], + [ + 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d', + 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088' + ], + [ + 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1', + '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d' + ], + [ + '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0', + '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8' + ], + [ + '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047', + '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a' + ], + [ + '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862', + '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453' + ], + [ + '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7', + '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160' + ], + [ + '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd', + '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0' + ], + [ + '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83', + '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6' + ], + [ + '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a', + '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589' + ], + [ + '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8', + 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17' + ], + [ + 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d', + '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda' + ], + [ + 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725', + '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd' + ], + [ + '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754', + '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2' + ], + [ + '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c', + '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6' + ], + [ + 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6', + '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f' + ], + [ + '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39', + 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01' + ], + [ + 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891', + '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3' + ], + [ + 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b', + 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f' + ], + [ + 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03', + '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7' + ], + [ + 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d', + 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78' + ], + [ + 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070', + '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1' + ], + [ + '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4', + 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150' + ], + [ + '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da', + '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82' + ], + [ + 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11', + '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc' + ], + [ + '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e', + 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b' + ], + [ + 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41', + '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51' + ], + [ + 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef', + '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45' + ], + [ + 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8', + 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120' + ], + [ + '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d', + '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84' + ], + [ + '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96', + '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d' + ], + [ + '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd', + 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d' + ], + [ + '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5', + '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8' + ], + [ + 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266', + '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8' + ], + [ + '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71', + '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac' + ], + [ + '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac', + 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f' + ], + [ + '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751', + '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962' + ], + [ + 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e', + '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907' + ], + [ + '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241', + 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec' + ], + [ + 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3', + 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d' + ], + [ + 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f', + '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414' + ], + [ + '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19', + 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd' + ], + [ + '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be', + 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0' + ], + [ + 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9', + '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811' + ], + [ + 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2', + '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1' + ], + [ + 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13', + '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c' + ], + [ + '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c', + 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73' + ], + [ + '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba', + '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd' + ], + [ + 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151', + 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405' + ], + [ + '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073', + 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589' + ], + [ + '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458', + '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e' + ], + [ + '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b', + '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27' + ], + [ + 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366', + 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1' + ], + [ + '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa', + '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482' + ], + [ + '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0', + '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945' + ], + [ + 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787', + '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573' + ], + [ + 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e', + 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82' + ] + ] + }, + naf: { + wnd: 7, + points: [ + [ + 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9', + '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672' + ], + [ + '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4', + 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6' + ], + [ + '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc', + '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da' + ], + [ + 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe', + 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37' + ], + [ + '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb', + 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b' + ], + [ + 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8', + 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81' + ], + [ + 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e', + '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58' + ], + [ + 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34', + '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77' + ], + [ + '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c', + '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a' + ], + [ + '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5', + '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c' + ], + [ + '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f', + '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67' + ], + [ + '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714', + '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402' + ], + [ + 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729', + 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55' + ], + [ + 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db', + '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482' + ], + [ + '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4', + 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82' + ], + [ + '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5', + 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396' + ], + [ + '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479', + '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49' + ], + [ + '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d', + '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf' + ], + [ + '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f', + '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a' + ], + [ + '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb', + 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7' + ], + [ + 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9', + 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933' + ], + [ + '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963', + '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a' + ], + [ + '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74', + '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6' + ], + [ + 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530', + 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37' + ], + [ + '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b', + '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e' + ], + [ + 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247', + 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6' + ], + [ + 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1', + 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476' + ], + [ + '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120', + '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40' + ], + [ + '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435', + '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61' + ], + [ + '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18', + '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683' + ], + [ + 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8', + '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5' + ], + [ + '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb', + '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b' + ], + [ + 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f', + '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417' + ], + [ + '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143', + 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868' + ], + [ + '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba', + 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a' + ], + [ + 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45', + 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6' + ], + [ + '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a', + '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996' + ], + [ + '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e', + 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e' + ], + [ + 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8', + 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d' + ], + [ + '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c', + '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2' + ], + [ + '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519', + 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e' + ], + [ + '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab', + '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437' + ], + [ + '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca', + 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311' + ], + [ + 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf', + '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4' + ], + [ + '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610', + '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575' + ], + [ + '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4', + 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d' + ], + [ + '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c', + 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d' + ], + [ + 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940', + 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629' + ], + [ + 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980', + 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06' + ], + [ + '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3', + '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374' + ], + [ + '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf', + '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee' + ], + [ + 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63', + '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1' + ], + [ + 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448', + 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b' + ], + [ + '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf', + '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661' + ], + [ + '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5', + '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6' + ], + [ + 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6', + '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e' + ], + [ + '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5', + '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d' + ], + [ + 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99', + 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc' + ], + [ + '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51', + 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4' + ], + [ + '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5', + '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c' + ], + [ + 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5', + '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b' + ], + [ + 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997', + '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913' + ], + [ + '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881', + '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154' + ], + [ + '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5', + '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865' + ], + [ + '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66', + 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc' + ], + [ + '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726', + 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224' + ], + [ + '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede', + '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e' + ], + [ + '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94', + '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6' + ], + [ + '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31', + '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511' + ], + [ + '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51', + 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b' + ], + [ + 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252', + 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2' + ], + [ + '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5', + 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c' + ], + [ + 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b', + '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3' + ], + [ + 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4', + '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d' + ], + [ + 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f', + '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700' + ], + [ + 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889', + '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4' + ], + [ + '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246', + 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196' + ], + [ + '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984', + '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4' + ], + [ + '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a', + 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257' + ], + [ + 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030', + 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13' + ], + [ + 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197', + '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096' + ], + [ + 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593', + 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38' + ], + [ + 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef', + '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f' + ], + [ + '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38', + '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448' + ], + [ + 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a', + '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a' + ], + [ + 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111', + '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4' + ], + [ + '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502', + '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437' + ], + [ + '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea', + 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7' + ], + [ + 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26', + '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d' + ], + [ + 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986', + '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a' + ], + [ + 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e', + '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54' + ], + [ + '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4', + '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77' + ], + [ + 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda', + 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517' + ], + [ + '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859', + 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10' + ], + [ + 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f', + 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125' + ], + [ + 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c', + '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e' + ], + [ + '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942', + 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1' + ], + [ + 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a', + '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2' + ], + [ + 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80', + '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423' + ], + [ + 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d', + '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8' + ], + [ + '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1', + 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758' + ], + [ + '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63', + 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375' + ], + [ + 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352', + '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d' + ], + [ + '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193', + 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec' + ], + [ + '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00', + '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0' + ], + [ + '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58', + 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c' + ], + [ + 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7', + 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4' + ], + [ + '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8', + 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f' + ], + [ + '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e', + '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649' + ], + [ + '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d', + 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826' + ], + [ + '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b', + '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5' + ], + [ + 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f', + 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87' + ], + [ + '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6', + '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b' + ], + [ + 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297', + '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc' + ], + [ + '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a', + '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c' + ], + [ + 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c', + 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f' + ], + [ + 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52', + '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a' + ], + [ + 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb', + 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46' + ], + [ + '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065', + 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f' + ], + [ + '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917', + '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03' + ], + [ + '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9', + 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08' + ], + [ + '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3', + '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8' + ], + [ + '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57', + '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373' + ], + [ + '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66', + 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3' + ], + [ + '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8', + '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8' + ], + [ + '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721', + '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1' + ], + [ + '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180', + '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9' + ] + ] + } +}; + +},{}],299:[function(require,module,exports){ +'use strict'; + +var utils = exports; +var BN = require('bn.js'); +var minAssert = require('minimalistic-assert'); +var minUtils = require('minimalistic-crypto-utils'); + +utils.assert = minAssert; +utils.toArray = minUtils.toArray; +utils.zero2 = minUtils.zero2; +utils.toHex = minUtils.toHex; +utils.encode = minUtils.encode; + +// Represent num in a w-NAF form +function getNAF(num, w) { + var naf = []; + var ws = 1 << (w + 1); + var k = num.clone(); + while (k.cmpn(1) >= 0) { + var z; + if (k.isOdd()) { + var mod = k.andln(ws - 1); + if (mod > (ws >> 1) - 1) + z = (ws >> 1) - mod; + else + z = mod; + k.isubn(z); + } else { + z = 0; + } + naf.push(z); + + // Optimization, shift by word if possible + var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1; + for (var i = 1; i < shift; i++) + naf.push(0); + k.iushrn(shift); + } + + return naf; +} +utils.getNAF = getNAF; + +// Represent k1, k2 in a Joint Sparse Form +function getJSF(k1, k2) { + var jsf = [ + [], + [] + ]; + + k1 = k1.clone(); + k2 = k2.clone(); + var d1 = 0; + var d2 = 0; + while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { + + // First phase + var m14 = (k1.andln(3) + d1) & 3; + var m24 = (k2.andln(3) + d2) & 3; + if (m14 === 3) + m14 = -1; + if (m24 === 3) + m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + var m8 = (k1.andln(7) + d1) & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + jsf[0].push(u1); + + var u2; + if ((m24 & 1) === 0) { + u2 = 0; + } else { + var m8 = (k2.andln(7) + d2) & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) + u2 = -m24; + else + u2 = m24; + } + jsf[1].push(u2); + + // Second phase + if (2 * d1 === u1 + 1) + d1 = 1 - d1; + if (2 * d2 === u2 + 1) + d2 = 1 - d2; + k1.iushrn(1); + k2.iushrn(1); + } + + return jsf; +} +utils.getJSF = getJSF; + +function cachedProperty(obj, name, computer) { + var key = '_' + name; + obj.prototype[name] = function cachedProperty() { + return this[key] !== undefined ? this[key] : + this[key] = computer.call(this); + }; +} +utils.cachedProperty = cachedProperty; + +function parseBytes(bytes) { + return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : + bytes; +} +utils.parseBytes = parseBytes; + +function intFromLE(bytes) { + return new BN(bytes, 'hex', 'le'); +} +utils.intFromLE = intFromLE; + + +},{"bn.js":280,"minimalistic-assert":315,"minimalistic-crypto-utils":316}],300:[function(require,module,exports){ +arguments[4][175][0].apply(exports,arguments) +},{"crypto":46,"dup":175}],301:[function(require,module,exports){ +var hash = exports; + +hash.utils = require('./hash/utils'); +hash.common = require('./hash/common'); +hash.sha = require('./hash/sha'); +hash.ripemd = require('./hash/ripemd'); +hash.hmac = require('./hash/hmac'); + +// Proxy hash functions to the main object +hash.sha1 = hash.sha.sha1; +hash.sha256 = hash.sha.sha256; +hash.sha224 = hash.sha.sha224; +hash.sha384 = hash.sha.sha384; +hash.sha512 = hash.sha.sha512; +hash.ripemd160 = hash.ripemd.ripemd160; + +},{"./hash/common":302,"./hash/hmac":303,"./hash/ripemd":304,"./hash/sha":305,"./hash/utils":312}],302:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var assert = require('minimalistic-assert'); + +function BlockHash() { + this.pending = null; + this.pendingTotal = 0; + this.blockSize = this.constructor.blockSize; + this.outSize = this.constructor.outSize; + this.hmacStrength = this.constructor.hmacStrength; + this.padLength = this.constructor.padLength / 8; + this.endian = 'big'; + + this._delta8 = this.blockSize / 8; + this._delta32 = this.blockSize / 32; +} +exports.BlockHash = BlockHash; + +BlockHash.prototype.update = function update(msg, enc) { + // Convert message to array, pad it, and join into 32bit blocks + msg = utils.toArray(msg, enc); + if (!this.pending) + this.pending = msg; + else + this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + + // Enough data, try updating + if (this.pending.length >= this._delta8) { + msg = this.pending; + + // Process pending data in blocks + var r = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r, msg.length); + if (this.pending.length === 0) + this.pending = null; + + msg = utils.join32(msg, 0, msg.length - r, this.endian); + for (var i = 0; i < msg.length; i += this._delta32) + this._update(msg, i, i + this._delta32); + } + + return this; +}; + +BlockHash.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert(this.pending === null); + + return this._digest(enc); +}; + +BlockHash.prototype._pad = function pad() { + var len = this.pendingTotal; + var bytes = this._delta8; + var k = bytes - ((len + this.padLength) % bytes); + var res = new Array(k + this.padLength); + res[0] = 0x80; + for (var i = 1; i < k; i++) + res[i] = 0; + + // Append length + len <<= 3; + if (this.endian === 'big') { + for (var t = 8; t < this.padLength; t++) + res[i++] = 0; + + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + res[i++] = (len >>> 24) & 0xff; + res[i++] = (len >>> 16) & 0xff; + res[i++] = (len >>> 8) & 0xff; + res[i++] = len & 0xff; + } else { + res[i++] = len & 0xff; + res[i++] = (len >>> 8) & 0xff; + res[i++] = (len >>> 16) & 0xff; + res[i++] = (len >>> 24) & 0xff; + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + + for (t = 8; t < this.padLength; t++) + res[i++] = 0; + } + + return res; +}; + +},{"./utils":312,"minimalistic-assert":315}],303:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var assert = require('minimalistic-assert'); + +function Hmac(hash, key, enc) { + if (!(this instanceof Hmac)) + return new Hmac(hash, key, enc); + this.Hash = hash; + this.blockSize = hash.blockSize / 8; + this.outSize = hash.outSize / 8; + this.inner = null; + this.outer = null; + + this._init(utils.toArray(key, enc)); +} +module.exports = Hmac; + +Hmac.prototype._init = function init(key) { + // Shorten key, if needed + if (key.length > this.blockSize) + key = new this.Hash().update(key).digest(); + assert(key.length <= this.blockSize); + + // Add padding to key + for (var i = key.length; i < this.blockSize; i++) + key.push(0); + + for (i = 0; i < key.length; i++) + key[i] ^= 0x36; + this.inner = new this.Hash().update(key); + + // 0x36 ^ 0x5c = 0x6a + for (i = 0; i < key.length; i++) + key[i] ^= 0x6a; + this.outer = new this.Hash().update(key); +}; + +Hmac.prototype.update = function update(msg, enc) { + this.inner.update(msg, enc); + return this; +}; + +Hmac.prototype.digest = function digest(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); +}; + +},{"./utils":312,"minimalistic-assert":315}],304:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var common = require('./common'); + +var rotl32 = utils.rotl32; +var sum32 = utils.sum32; +var sum32_3 = utils.sum32_3; +var sum32_4 = utils.sum32_4; +var BlockHash = common.BlockHash; + +function RIPEMD160() { + if (!(this instanceof RIPEMD160)) + return new RIPEMD160(); + + BlockHash.call(this); + + this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; + this.endian = 'little'; +} +utils.inherits(RIPEMD160, BlockHash); +exports.ripemd160 = RIPEMD160; + +RIPEMD160.blockSize = 512; +RIPEMD160.outSize = 160; +RIPEMD160.hmacStrength = 192; +RIPEMD160.padLength = 64; + +RIPEMD160.prototype._update = function update(msg, start) { + var A = this.h[0]; + var B = this.h[1]; + var C = this.h[2]; + var D = this.h[3]; + var E = this.h[4]; + var Ah = A; + var Bh = B; + var Ch = C; + var Dh = D; + var Eh = E; + for (var j = 0; j < 80; j++) { + var T = sum32( + rotl32( + sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), + s[j]), + E); + A = E; + E = D; + D = rotl32(C, 10); + C = B; + B = T; + T = sum32( + rotl32( + sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), + sh[j]), + Eh); + Ah = Eh; + Eh = Dh; + Dh = rotl32(Ch, 10); + Ch = Bh; + Bh = T; + } + T = sum32_3(this.h[1], C, Dh); + this.h[1] = sum32_3(this.h[2], D, Eh); + this.h[2] = sum32_3(this.h[3], E, Ah); + this.h[3] = sum32_3(this.h[4], A, Bh); + this.h[4] = sum32_3(this.h[0], B, Ch); + this.h[0] = T; +}; + +RIPEMD160.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'little'); + else + return utils.split32(this.h, 'little'); +}; + +function f(j, x, y, z) { + if (j <= 15) + return x ^ y ^ z; + else if (j <= 31) + return (x & y) | ((~x) & z); + else if (j <= 47) + return (x | (~y)) ^ z; + else if (j <= 63) + return (x & z) | (y & (~z)); + else + return x ^ (y | (~z)); +} + +function K(j) { + if (j <= 15) + return 0x00000000; + else if (j <= 31) + return 0x5a827999; + else if (j <= 47) + return 0x6ed9eba1; + else if (j <= 63) + return 0x8f1bbcdc; + else + return 0xa953fd4e; +} + +function Kh(j) { + if (j <= 15) + return 0x50a28be6; + else if (j <= 31) + return 0x5c4dd124; + else if (j <= 47) + return 0x6d703ef3; + else if (j <= 63) + return 0x7a6d76e9; + else + return 0x00000000; +} + +var r = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 +]; + +var rh = [ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 +]; + +var s = [ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 +]; + +var sh = [ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 +]; + +},{"./common":302,"./utils":312}],305:[function(require,module,exports){ +'use strict'; + +exports.sha1 = require('./sha/1'); +exports.sha224 = require('./sha/224'); +exports.sha256 = require('./sha/256'); +exports.sha384 = require('./sha/384'); +exports.sha512 = require('./sha/512'); + +},{"./sha/1":306,"./sha/224":307,"./sha/256":308,"./sha/384":309,"./sha/512":310}],306:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var common = require('../common'); +var shaCommon = require('./common'); + +var rotl32 = utils.rotl32; +var sum32 = utils.sum32; +var sum32_5 = utils.sum32_5; +var ft_1 = shaCommon.ft_1; +var BlockHash = common.BlockHash; + +var sha1_K = [ + 0x5A827999, 0x6ED9EBA1, + 0x8F1BBCDC, 0xCA62C1D6 +]; + +function SHA1() { + if (!(this instanceof SHA1)) + return new SHA1(); + + BlockHash.call(this); + this.h = [ + 0x67452301, 0xefcdab89, 0x98badcfe, + 0x10325476, 0xc3d2e1f0 ]; + this.W = new Array(80); +} + +utils.inherits(SHA1, BlockHash); +module.exports = SHA1; + +SHA1.blockSize = 512; +SHA1.outSize = 160; +SHA1.hmacStrength = 80; +SHA1.padLength = 64; + +SHA1.prototype._update = function _update(msg, start) { + var W = this.W; + + for (var i = 0; i < 16; i++) + W[i] = msg[start + i]; + + for(; i < W.length; i++) + W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); + + var a = this.h[0]; + var b = this.h[1]; + var c = this.h[2]; + var d = this.h[3]; + var e = this.h[4]; + + for (i = 0; i < W.length; i++) { + var s = ~~(i / 20); + var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]); + e = d; + d = c; + c = rotl32(b, 30); + b = a; + a = t; + } + + this.h[0] = sum32(this.h[0], a); + this.h[1] = sum32(this.h[1], b); + this.h[2] = sum32(this.h[2], c); + this.h[3] = sum32(this.h[3], d); + this.h[4] = sum32(this.h[4], e); +}; + +SHA1.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'big'); + else + return utils.split32(this.h, 'big'); +}; + +},{"../common":302,"../utils":312,"./common":311}],307:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var SHA256 = require('./256'); + +function SHA224() { + if (!(this instanceof SHA224)) + return new SHA224(); + + SHA256.call(this); + this.h = [ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; +} +utils.inherits(SHA224, SHA256); +module.exports = SHA224; + +SHA224.blockSize = 512; +SHA224.outSize = 224; +SHA224.hmacStrength = 192; +SHA224.padLength = 64; + +SHA224.prototype._digest = function digest(enc) { + // Just truncate output + if (enc === 'hex') + return utils.toHex32(this.h.slice(0, 7), 'big'); + else + return utils.split32(this.h.slice(0, 7), 'big'); +}; + + +},{"../utils":312,"./256":308}],308:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var common = require('../common'); +var shaCommon = require('./common'); +var assert = require('minimalistic-assert'); + +var sum32 = utils.sum32; +var sum32_4 = utils.sum32_4; +var sum32_5 = utils.sum32_5; +var ch32 = shaCommon.ch32; +var maj32 = shaCommon.maj32; +var s0_256 = shaCommon.s0_256; +var s1_256 = shaCommon.s1_256; +var g0_256 = shaCommon.g0_256; +var g1_256 = shaCommon.g1_256; + +var BlockHash = common.BlockHash; + +var sha256_K = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]; + +function SHA256() { + if (!(this instanceof SHA256)) + return new SHA256(); + + BlockHash.call(this); + this.h = [ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + ]; + this.k = sha256_K; + this.W = new Array(64); +} +utils.inherits(SHA256, BlockHash); +module.exports = SHA256; + +SHA256.blockSize = 512; +SHA256.outSize = 256; +SHA256.hmacStrength = 192; +SHA256.padLength = 64; + +SHA256.prototype._update = function _update(msg, start) { + var W = this.W; + + for (var i = 0; i < 16; i++) + W[i] = msg[start + i]; + for (; i < W.length; i++) + W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); + + var a = this.h[0]; + var b = this.h[1]; + var c = this.h[2]; + var d = this.h[3]; + var e = this.h[4]; + var f = this.h[5]; + var g = this.h[6]; + var h = this.h[7]; + + assert(this.k.length === W.length); + for (i = 0; i < W.length; i++) { + var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]); + var T2 = sum32(s0_256(a), maj32(a, b, c)); + h = g; + g = f; + f = e; + e = sum32(d, T1); + d = c; + c = b; + b = a; + a = sum32(T1, T2); + } + + this.h[0] = sum32(this.h[0], a); + this.h[1] = sum32(this.h[1], b); + this.h[2] = sum32(this.h[2], c); + this.h[3] = sum32(this.h[3], d); + this.h[4] = sum32(this.h[4], e); + this.h[5] = sum32(this.h[5], f); + this.h[6] = sum32(this.h[6], g); + this.h[7] = sum32(this.h[7], h); +}; + +SHA256.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'big'); + else + return utils.split32(this.h, 'big'); +}; + +},{"../common":302,"../utils":312,"./common":311,"minimalistic-assert":315}],309:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +var SHA512 = require('./512'); + +function SHA384() { + if (!(this instanceof SHA384)) + return new SHA384(); + + SHA512.call(this); + this.h = [ + 0xcbbb9d5d, 0xc1059ed8, + 0x629a292a, 0x367cd507, + 0x9159015a, 0x3070dd17, + 0x152fecd8, 0xf70e5939, + 0x67332667, 0xffc00b31, + 0x8eb44a87, 0x68581511, + 0xdb0c2e0d, 0x64f98fa7, + 0x47b5481d, 0xbefa4fa4 ]; +} +utils.inherits(SHA384, SHA512); +module.exports = SHA384; + +SHA384.blockSize = 1024; +SHA384.outSize = 384; +SHA384.hmacStrength = 192; +SHA384.padLength = 128; + +SHA384.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h.slice(0, 12), 'big'); + else + return utils.split32(this.h.slice(0, 12), 'big'); +}; + +},{"../utils":312,"./512":310}],310:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var common = require('../common'); +var assert = require('minimalistic-assert'); + +var rotr64_hi = utils.rotr64_hi; +var rotr64_lo = utils.rotr64_lo; +var shr64_hi = utils.shr64_hi; +var shr64_lo = utils.shr64_lo; +var sum64 = utils.sum64; +var sum64_hi = utils.sum64_hi; +var sum64_lo = utils.sum64_lo; +var sum64_4_hi = utils.sum64_4_hi; +var sum64_4_lo = utils.sum64_4_lo; +var sum64_5_hi = utils.sum64_5_hi; +var sum64_5_lo = utils.sum64_5_lo; + +var BlockHash = common.BlockHash; + +var sha512_K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 +]; + +function SHA512() { + if (!(this instanceof SHA512)) + return new SHA512(); + + BlockHash.call(this); + this.h = [ + 0x6a09e667, 0xf3bcc908, + 0xbb67ae85, 0x84caa73b, + 0x3c6ef372, 0xfe94f82b, + 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, + 0x9b05688c, 0x2b3e6c1f, + 0x1f83d9ab, 0xfb41bd6b, + 0x5be0cd19, 0x137e2179 ]; + this.k = sha512_K; + this.W = new Array(160); +} +utils.inherits(SHA512, BlockHash); +module.exports = SHA512; + +SHA512.blockSize = 1024; +SHA512.outSize = 512; +SHA512.hmacStrength = 192; +SHA512.padLength = 128; + +SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { + var W = this.W; + + // 32 x 32bit words + for (var i = 0; i < 32; i++) + W[i] = msg[start + i]; + for (; i < W.length; i += 2) { + var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2 + var c0_lo = g1_512_lo(W[i - 4], W[i - 3]); + var c1_hi = W[i - 14]; // i - 7 + var c1_lo = W[i - 13]; + var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15 + var c2_lo = g0_512_lo(W[i - 30], W[i - 29]); + var c3_hi = W[i - 32]; // i - 16 + var c3_lo = W[i - 31]; + + W[i] = sum64_4_hi( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo); + W[i + 1] = sum64_4_lo( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo); + } +}; + +SHA512.prototype._update = function _update(msg, start) { + this._prepareBlock(msg, start); + + var W = this.W; + + var ah = this.h[0]; + var al = this.h[1]; + var bh = this.h[2]; + var bl = this.h[3]; + var ch = this.h[4]; + var cl = this.h[5]; + var dh = this.h[6]; + var dl = this.h[7]; + var eh = this.h[8]; + var el = this.h[9]; + var fh = this.h[10]; + var fl = this.h[11]; + var gh = this.h[12]; + var gl = this.h[13]; + var hh = this.h[14]; + var hl = this.h[15]; + + assert(this.k.length === W.length); + for (var i = 0; i < W.length; i += 2) { + var c0_hi = hh; + var c0_lo = hl; + var c1_hi = s1_512_hi(eh, el); + var c1_lo = s1_512_lo(eh, el); + var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); + var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); + var c3_hi = this.k[i]; + var c3_lo = this.k[i + 1]; + var c4_hi = W[i]; + var c4_lo = W[i + 1]; + + var T1_hi = sum64_5_hi( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo, + c4_hi, c4_lo); + var T1_lo = sum64_5_lo( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo, + c4_hi, c4_lo); + + c0_hi = s0_512_hi(ah, al); + c0_lo = s0_512_lo(ah, al); + c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); + c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); + + var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); + var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); + + hh = gh; + hl = gl; + + gh = fh; + gl = fl; + + fh = eh; + fl = el; + + eh = sum64_hi(dh, dl, T1_hi, T1_lo); + el = sum64_lo(dl, dl, T1_hi, T1_lo); + + dh = ch; + dl = cl; + + ch = bh; + cl = bl; + + bh = ah; + bl = al; + + ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); + al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); + } + + sum64(this.h, 0, ah, al); + sum64(this.h, 2, bh, bl); + sum64(this.h, 4, ch, cl); + sum64(this.h, 6, dh, dl); + sum64(this.h, 8, eh, el); + sum64(this.h, 10, fh, fl); + sum64(this.h, 12, gh, gl); + sum64(this.h, 14, hh, hl); +}; + +SHA512.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'big'); + else + return utils.split32(this.h, 'big'); +}; + +function ch64_hi(xh, xl, yh, yl, zh) { + var r = (xh & yh) ^ ((~xh) & zh); + if (r < 0) + r += 0x100000000; + return r; +} + +function ch64_lo(xh, xl, yh, yl, zh, zl) { + var r = (xl & yl) ^ ((~xl) & zl); + if (r < 0) + r += 0x100000000; + return r; +} + +function maj64_hi(xh, xl, yh, yl, zh) { + var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); + if (r < 0) + r += 0x100000000; + return r; +} + +function maj64_lo(xh, xl, yh, yl, zh, zl) { + var r = (xl & yl) ^ (xl & zl) ^ (yl & zl); + if (r < 0) + r += 0x100000000; + return r; +} + +function s0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 28); + var c1_hi = rotr64_hi(xl, xh, 2); // 34 + var c2_hi = rotr64_hi(xl, xh, 7); // 39 + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function s0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 28); + var c1_lo = rotr64_lo(xl, xh, 2); // 34 + var c2_lo = rotr64_lo(xl, xh, 7); // 39 + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +function s1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 14); + var c1_hi = rotr64_hi(xh, xl, 18); + var c2_hi = rotr64_hi(xl, xh, 9); // 41 + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function s1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 14); + var c1_lo = rotr64_lo(xh, xl, 18); + var c2_lo = rotr64_lo(xl, xh, 9); // 41 + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +function g0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 1); + var c1_hi = rotr64_hi(xh, xl, 8); + var c2_hi = shr64_hi(xh, xl, 7); + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function g0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 1); + var c1_lo = rotr64_lo(xh, xl, 8); + var c2_lo = shr64_lo(xh, xl, 7); + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +function g1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 19); + var c1_hi = rotr64_hi(xl, xh, 29); // 61 + var c2_hi = shr64_hi(xh, xl, 6); + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function g1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 19); + var c1_lo = rotr64_lo(xl, xh, 29); // 61 + var c2_lo = shr64_lo(xh, xl, 6); + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +},{"../common":302,"../utils":312,"minimalistic-assert":315}],311:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var rotr32 = utils.rotr32; + +function ft_1(s, x, y, z) { + if (s === 0) + return ch32(x, y, z); + if (s === 1 || s === 3) + return p32(x, y, z); + if (s === 2) + return maj32(x, y, z); +} +exports.ft_1 = ft_1; + +function ch32(x, y, z) { + return (x & y) ^ ((~x) & z); +} +exports.ch32 = ch32; + +function maj32(x, y, z) { + return (x & y) ^ (x & z) ^ (y & z); +} +exports.maj32 = maj32; + +function p32(x, y, z) { + return x ^ y ^ z; +} +exports.p32 = p32; + +function s0_256(x) { + return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); +} +exports.s0_256 = s0_256; + +function s1_256(x) { + return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); +} +exports.s1_256 = s1_256; + +function g0_256(x) { + return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); +} +exports.g0_256 = g0_256; + +function g1_256(x) { + return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); +} +exports.g1_256 = g1_256; + +},{"../utils":312}],312:[function(require,module,exports){ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +exports.inherits = inherits; + +function toArray(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg === 'string') { + if (!enc) { + for (var i = 0; i < msg.length; i++) { + var c = msg.charCodeAt(i); + var hi = c >> 8; + var lo = c & 0xff; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } else if (enc === 'hex') { + msg = msg.replace(/[^a-z0-9]+/ig, ''); + if (msg.length % 2 !== 0) + msg = '0' + msg; + for (i = 0; i < msg.length; i += 2) + res.push(parseInt(msg[i] + msg[i + 1], 16)); + } + } else { + for (i = 0; i < msg.length; i++) + res[i] = msg[i] | 0; + } + return res; +} +exports.toArray = toArray; + +function toHex(msg) { + var res = ''; + for (var i = 0; i < msg.length; i++) + res += zero2(msg[i].toString(16)); + return res; +} +exports.toHex = toHex; + +function htonl(w) { + var res = (w >>> 24) | + ((w >>> 8) & 0xff00) | + ((w << 8) & 0xff0000) | + ((w & 0xff) << 24); + return res >>> 0; +} +exports.htonl = htonl; + +function toHex32(msg, endian) { + var res = ''; + for (var i = 0; i < msg.length; i++) { + var w = msg[i]; + if (endian === 'little') + w = htonl(w); + res += zero8(w.toString(16)); + } + return res; +} +exports.toHex32 = toHex32; + +function zero2(word) { + if (word.length === 1) + return '0' + word; + else + return word; +} +exports.zero2 = zero2; + +function zero8(word) { + if (word.length === 7) + return '0' + word; + else if (word.length === 6) + return '00' + word; + else if (word.length === 5) + return '000' + word; + else if (word.length === 4) + return '0000' + word; + else if (word.length === 3) + return '00000' + word; + else if (word.length === 2) + return '000000' + word; + else if (word.length === 1) + return '0000000' + word; + else + return word; +} +exports.zero8 = zero8; + +function join32(msg, start, end, endian) { + var len = end - start; + assert(len % 4 === 0); + var res = new Array(len / 4); + for (var i = 0, k = start; i < res.length; i++, k += 4) { + var w; + if (endian === 'big') + w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3]; + else + w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k]; + res[i] = w >>> 0; + } + return res; +} +exports.join32 = join32; + +function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i = 0, k = 0; i < msg.length; i++, k += 4) { + var m = msg[i]; + if (endian === 'big') { + res[k] = m >>> 24; + res[k + 1] = (m >>> 16) & 0xff; + res[k + 2] = (m >>> 8) & 0xff; + res[k + 3] = m & 0xff; + } else { + res[k + 3] = m >>> 24; + res[k + 2] = (m >>> 16) & 0xff; + res[k + 1] = (m >>> 8) & 0xff; + res[k] = m & 0xff; + } + } + return res; +} +exports.split32 = split32; + +function rotr32(w, b) { + return (w >>> b) | (w << (32 - b)); +} +exports.rotr32 = rotr32; + +function rotl32(w, b) { + return (w << b) | (w >>> (32 - b)); +} +exports.rotl32 = rotl32; + +function sum32(a, b) { + return (a + b) >>> 0; +} +exports.sum32 = sum32; + +function sum32_3(a, b, c) { + return (a + b + c) >>> 0; +} +exports.sum32_3 = sum32_3; + +function sum32_4(a, b, c, d) { + return (a + b + c + d) >>> 0; +} +exports.sum32_4 = sum32_4; + +function sum32_5(a, b, c, d, e) { + return (a + b + c + d + e) >>> 0; +} +exports.sum32_5 = sum32_5; + +function sum64(buf, pos, ah, al) { + var bh = buf[pos]; + var bl = buf[pos + 1]; + + var lo = (al + bl) >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0; + buf[pos + 1] = lo; +} +exports.sum64 = sum64; + +function sum64_hi(ah, al, bh, bl) { + var lo = (al + bl) >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; +} +exports.sum64_hi = sum64_hi; + +function sum64_lo(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; +} +exports.sum64_lo = sum64_lo; + +function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0; + var lo = al; + lo = (lo + bl) >>> 0; + carry += lo < al ? 1 : 0; + lo = (lo + cl) >>> 0; + carry += lo < cl ? 1 : 0; + lo = (lo + dl) >>> 0; + carry += lo < dl ? 1 : 0; + + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; +} +exports.sum64_4_hi = sum64_4_hi; + +function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; +} +exports.sum64_4_lo = sum64_4_lo; + +function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0; + var lo = al; + lo = (lo + bl) >>> 0; + carry += lo < al ? 1 : 0; + lo = (lo + cl) >>> 0; + carry += lo < cl ? 1 : 0; + lo = (lo + dl) >>> 0; + carry += lo < dl ? 1 : 0; + lo = (lo + el) >>> 0; + carry += lo < el ? 1 : 0; + + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; +} +exports.sum64_5_hi = sum64_5_hi; + +function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + + return lo >>> 0; +} +exports.sum64_5_lo = sum64_5_lo; + +function rotr64_hi(ah, al, num) { + var r = (al << (32 - num)) | (ah >>> num); + return r >>> 0; +} +exports.rotr64_hi = rotr64_hi; + +function rotr64_lo(ah, al, num) { + var r = (ah << (32 - num)) | (al >>> num); + return r >>> 0; +} +exports.rotr64_lo = rotr64_lo; + +function shr64_hi(ah, al, num) { + return ah >>> num; +} +exports.shr64_hi = shr64_hi; + +function shr64_lo(ah, al, num) { + var r = (ah << (32 - num)) | (al >>> num); + return r >>> 0; +} +exports.shr64_lo = shr64_lo; + +},{"inherits":313,"minimalistic-assert":315}],313:[function(require,module,exports){ +arguments[4][262][0].apply(exports,arguments) +},{"dup":262}],314:[function(require,module,exports){ +'use strict'; + +var hash = require('hash.js'); +var utils = require('minimalistic-crypto-utils'); +var assert = require('minimalistic-assert'); + +function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) + return new HmacDRBG(options); + this.hash = options.hash; + this.predResist = !!options.predResist; + + this.outLen = this.hash.outSize; + this.minEntropy = options.minEntropy || this.hash.hmacStrength; + + this._reseed = null; + this.reseedInterval = null; + this.K = null; + this.V = null; + + var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex'); + var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex'); + var pers = utils.toArray(options.pers, options.persEnc || 'hex'); + assert(entropy.length >= (this.minEntropy / 8), + 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); + this._init(entropy, nonce, pers); +} +module.exports = HmacDRBG; + +HmacDRBG.prototype._init = function init(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + + this.K = new Array(this.outLen / 8); + this.V = new Array(this.outLen / 8); + for (var i = 0; i < this.V.length; i++) { + this.K[i] = 0x00; + this.V[i] = 0x01; + } + + this._update(seed); + this._reseed = 1; + this.reseedInterval = 0x1000000000000; // 2^48 +}; + +HmacDRBG.prototype._hmac = function hmac() { + return new hash.hmac(this.hash, this.K); +}; + +HmacDRBG.prototype._update = function update(seed) { + var kmac = this._hmac() + .update(this.V) + .update([ 0x00 ]); + if (seed) + kmac = kmac.update(seed); + this.K = kmac.digest(); + this.V = this._hmac().update(this.V).digest(); + if (!seed) + return; + + this.K = this._hmac() + .update(this.V) + .update([ 0x01 ]) + .update(seed) + .digest(); + this.V = this._hmac().update(this.V).digest(); +}; + +HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { + // Optional entropy enc + if (typeof entropyEnc !== 'string') { + addEnc = add; + add = entropyEnc; + entropyEnc = null; + } + + entropy = utils.toArray(entropy, entropyEnc); + add = utils.toArray(add, addEnc); + + assert(entropy.length >= (this.minEntropy / 8), + 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); + + this._update(entropy.concat(add || [])); + this._reseed = 1; +}; + +HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error('Reseed is required'); + + // Optional encoding + if (typeof enc !== 'string') { + addEnc = add; + add = enc; + enc = null; + } + + // Optional additional data + if (add) { + add = utils.toArray(add, addEnc || 'hex'); + this._update(add); + } + + var temp = []; + while (temp.length < len) { + this.V = this._hmac().update(this.V).digest(); + temp = temp.concat(this.V); + } + + var res = temp.slice(0, len); + this._update(add); + this._reseed++; + return utils.encode(res, enc); +}; + +},{"hash.js":301,"minimalistic-assert":315,"minimalistic-crypto-utils":316}],315:[function(require,module,exports){ +arguments[4][83][0].apply(exports,arguments) +},{"dup":83}],316:[function(require,module,exports){ +'use strict'; + +var utils = exports; + +function toArray(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg !== 'string') { + for (var i = 0; i < msg.length; i++) + res[i] = msg[i] | 0; + return res; + } + if (enc === 'hex') { + msg = msg.replace(/[^a-z0-9]+/ig, ''); + if (msg.length % 2 !== 0) + msg = '0' + msg; + for (var i = 0; i < msg.length; i += 2) + res.push(parseInt(msg[i] + msg[i + 1], 16)); + } else { + for (var i = 0; i < msg.length; i++) { + var c = msg.charCodeAt(i); + var hi = c >> 8; + var lo = c & 0xff; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } + return res; +} +utils.toArray = toArray; + +function zero2(word) { + if (word.length === 1) + return '0' + word; + else + return word; +} +utils.zero2 = zero2; + +function toHex(msg) { + var res = ''; + for (var i = 0; i < msg.length; i++) + res += zero2(msg[i].toString(16)); + return res; +} +utils.toHex = toHex; + +utils.encode = function encode(arr, enc) { + if (enc === 'hex') + return toHex(arr); + else + return arr; +}; + +},{}],317:[function(require,module,exports){ +module.exports={ + "name": "elliptic", + "version": "6.4.0", + "description": "EC cryptography", + "main": "lib/elliptic.js", + "files": [ + "lib" + ], + "scripts": { + "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", + "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", + "lint": "npm run jscs && npm run jshint", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "test": "npm run lint && npm run unit", + "version": "grunt dist && git add dist/" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/elliptic.git" + }, + "keywords": [ + "EC", + "Elliptic", + "curve", + "Cryptography" + ], + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/indutny/elliptic/issues" + }, + "homepage": "https://github.com/indutny/elliptic", + "devDependencies": { + "brfs": "^1.4.3", + "coveralls": "^2.11.3", + "grunt": "^0.4.5", + "grunt-browserify": "^5.0.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-connect": "^1.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "^1.0.1", + "grunt-mocha-istanbul": "^3.0.1", + "grunt-saucelabs": "^8.6.2", + "istanbul": "^0.4.2", + "jscs": "^2.9.0", + "jshint": "^2.6.0", + "mocha": "^2.1.0" + }, + "dependencies": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "gitHead": "6b0d2b76caae91471649c8e21f0b1d3ba0f96090", + "_id": "elliptic@6.4.0", + "_shasum": "cac9af8762c85836187003c8dfe193e5e2eae5df", + "_from": "elliptic@latest", + "_npmVersion": "3.10.8", + "_nodeVersion": "7.0.0", + "_npmUser": { + "name": "indutny", + "email": "fedor@indutny.com" + }, + "dist": { + "shasum": "cac9af8762c85836187003c8dfe193e5e2eae5df", + "tarball": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz" + }, + "maintainers": [ + { + "name": "indutny", + "email": "fedor@indutny.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "readme": "ERROR: No README data found!" +} + +},{}],318:[function(require,module,exports){ +arguments[4][262][0].apply(exports,arguments) +},{"dup":262}],319:[function(require,module,exports){ +(function (global){ +/** + * @license + * Lodash + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.4'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)', + rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ + function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; + } + + /** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ + function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; + } + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(args) { + args.push(undefined, customDefaultsAssignIn); + return apply(assignInWith, undefined, args); + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' + + + + + + + + + + +``` + +## Building Custom Bundles +If you want to use a specific version of a module, instead of a release version (not recommended), you must run browserify yourself. You can get a minified browser bundle by running the following on the project root folder. + +```sh +browserify --require ./index.js:bitcore-lib | uglifyjs > bitcore-lib.min.js +``` + +```sh +browserify --require ./index.js:bitcore-mnemonic --external bitcore-lib | uglifyjs > bitcore-mnemonic.min.js +``` + +In many of the modules you can also run the command to build a browser bundle: +```sh +gulp browser +``` diff --git a/packages/kauri-bitcore-lib/docs/crypto.md b/packages/kauri-bitcore-lib/docs/crypto.md new file mode 100644 index 0000000..8dc4ecd --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/crypto.md @@ -0,0 +1,17 @@ +# Bitcoin Crypto +The cryptographic primitives (ECDSA and HMAC) implementations in this package have been reviewed by the BitPay engineering team. More audits and reviews are welcomed. + +## Random +The `bitcore.crypto.Random` namespace contains a single function, named `getRandomBuffer(size)` that returns a `Buffer` instance with random bytes. It may not work depending on the engine that bitcore is running on (doesn't work with IE versions lesser than 11). + +## BN +The `bitcore.crypto.BN` class contains a wrapper around [bn.js](https://github.com/indutny/bn.js), the bignum library used internally in bitcore. + +## Point +The `bitcore.crypto.Point` class contains a wrapper around the class Point of [elliptic.js](https://github.com/indutny/elliptic), the elliptic curve library used internally in bitcore. + +## Hash +The `bitcore.crypto.Hash` namespace contains a set of hashes and utilities. These are either the native `crypto` hash functions from `node.js` or their respective browser shims as provided by the `browserify` library. + +## ECDSA +`bitcore.crypto.ECDSA` contains a pure JavaScript implementation of the elliptic curve DSA signature scheme based on [elliptic.js](https://github.com/indutny/elliptic). diff --git a/packages/kauri-bitcore-lib/docs/encoding.md b/packages/kauri-bitcore-lib/docs/encoding.md new file mode 100644 index 0000000..b41d4bf --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/encoding.md @@ -0,0 +1,8 @@ +# Encoding +The `bitcore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem. + +## Base58 & Base58Check +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. + +## BufferReader & BufferWriter +These classes are used internally to write information in buffers. diff --git a/packages/kauri-bitcore-lib/docs/examples.md b/packages/kauri-bitcore-lib/docs/examples.md new file mode 100644 index 0000000..962736f --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/examples.md @@ -0,0 +1,113 @@ +# Bitcore examples + +## Generate a random address +```javascript +var privateKey = new bitcore.PrivateKey(); + +var address = privateKey.toAddress(); +``` + +## Generate a address from a SHA256 hash +```javascript +var value = new Buffer('correct horse battery staple'); +var hash = bitcore.crypto.Hash.sha256(value); +var bn = bitcore.crypto.BN.fromBuffer(hash); + +var address = new bitcore.PrivateKey(bn).toAddress(); +``` + +## Import an address via WIF +```javascript +var wif = 'Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct'; + +var address = new bitcore.PrivateKey(wif).toAddress(); +``` + +## Create a Transaction +```javascript +var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy'); +var utxo = { + "txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986", + "outputIndex" : 0, + "address" : "17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV", + "script" : "76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac", + "satoshis" : 50000 +}; + +var transaction = new bitcore.Transaction() + .from(utxo) + .to('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 15000) + .sign(privateKey); +``` + +## Sign a Bitcoin message +```javascript +var Message = require('bitcore-message'); + +var privateKey = new bitcore.PrivateKey('L23PpjkBQqpAF4vbMHNfTZAb3KFPBSawQ7KinFTzz7dxq6TZX8UA'); +var message = new Message('This is an example of a signed message.'); + +var signature = message.sign(privateKey); +``` + +## Verify a Bitcoin message +```javascript +var Message = require('bitcore-message'); + +var address = '13Js7D3q4KvfSqgKN8LpNq57gcahrVc5JZ'; +var signature = 'IBOvIfsAs/da1e36W8kw1cQOPqPVXCW5zJgNQ5kI8m57FycZXdeFmeyoIqJSREzE4W7vfDmdmPk0HokuJPvgPPE='; + +var verified = new Message('This is an example of a signed message.').verify(address, signature); + ``` + +## Create an OP RETURN transaction +```javascript +var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy'); +var utxo = { + "txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986", + "outputIndex" : 0, + "address" : "17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV", + "script" : "76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac", + "satoshis" : 50000 +}; + +var transaction = new bitcore.Transaction() + .from(utxo) + .addData('bitcore rocks') // Add OP_RETURN data + .sign(privateKey); +``` + +## Create a 2-of-3 multisig P2SH address +```javascript +var publicKeys = [ + '026477115981fe981a6918a6297d9803c4dc04f328f22041bedff886bbc2962e01', + '02c96db2302d19b43d4c69368babace7854cc84eb9e061cde51cfa77ca4a22b8b9', + '03c6103b3b83e4a24a0e33a4df246ef11772f9992663db0c35759a5e2ebf68d8e9' +]; +var requiredSignatures = 2; + +var address = new bitcore.Address(publicKeys, requiredSignatures); +``` + +## Spend from a 2-of-2 multisig P2SH address +```javascript +var privateKeys = [ + new bitcore.PrivateKey('91avARGdfge8E4tZfYLoxeJ5sGBdNJQH4kvjJoQFacbgwmaKkrx'), + new bitcore.PrivateKey('91avARGdfge8E4tZfYLoxeJ5sGBdNJQH4kvjJoQFacbgww7vXtT') +]; +var publicKeys = privateKeys.map(bitcore.PublicKey); +var address = new bitcore.Address(publicKeys, 2); // 2 of 2 + +var utxo = { + "txId" : "153068cdd81b73ec9d8dcce27f2c77ddda12dee3db424bff5cafdbe9f01c1756", + "outputIndex" : 0, + "address" : address.toString(), + "script" : new bitcore.Script(address).toHex(), + "satoshis" : 20000 +}; + +var transaction = new bitcore.Transaction() + .from(utxo, publicKeys, 2) + .to('mtoKs9V381UAhUia3d7Vb9GNak8Qvmcsme', 20000) + .sign(privateKeys); +``` diff --git a/packages/kauri-bitcore-lib/docs/hierarchical.md b/packages/kauri-bitcore-lib/docs/hierarchical.md new file mode 100644 index 0000000..73972d4 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/hierarchical.md @@ -0,0 +1,52 @@ +# HDKeys +Create and derive extended public and private keys according to the BIP32 standard for Hierarchical Deterministic (HD) keys. + +## Hierarchically Derived Keys +Bitcore provides full support for [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki), allowing for many key management schemas that benefit from this property. Please be sure to read and understand the basic concepts and the warnings on that BIP before using these classes. + +## HDPrivateKey +An instance of a [PrivateKey](privatekey.md) that also contains information required to derive child keys. + +Sample usage: + +```javascript +var bitcore = require('bitcore'); +var HDPrivateKey = bitcore.HDPrivateKey; + +var hdPrivateKey = new HDPrivateKey(); +var retrieved = new HDPrivateKey('xpriv...'); +var derived = hdPrivateKey.derive("m/0'"); // see deprecation warning for derive +var derivedByNumber = hdPrivateKey.derive(1).derive(2, true); +var derivedByArgument = hdPrivateKey.derive("m/1/2'"); +assert(derivedByNumber.xprivkey === derivedByArgument.xprivkey); + +var address = derived.privateKey.toAddress(); + +// obtain HDPublicKey +var hdPublicKey = hdPrivateKey.hdPublicKey; +``` + +## HDPublicKey +An instance of a PublicKey that can be derived to build extended public keys. Note that hardened paths are not available when deriving an HDPublicKey. + +```javascript +var hdPrivateKey = new HDPrivateKey(); +var hdPublicKey = hdPrivateKey.hdPublicKey; +try { + new HDPublicKey(); +} catch(e) { + console.log("Can't generate a public key without a private key"); +} + +var address = new Address(hdPublicKey.publicKey, Networks.livenet); +var derivedAddress = new Address(hdPublicKey.derive(100).publicKey, Networks.testnet); // see deprecation warning for derive +``` + +## Deprecation Warning for `HDPublicKey.derive()` and `HDPrivateKey.derive()` + + +There was a bug that was discovered with derivation that would incorrectly calculate the child key against the [BIP32 specification](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). +The bug only affected hardened derivations using an extended private key, and did not affect public key derivation. It also did not affect every derivation and would happen 1 in 256 times where where the private key for the extended private key had a leading zero *(e.g. any private key less than or equal to '0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')*. The leading zero was not included in serialization before hashing to derive a child key, as it should have been. + +As a result, `HDPublicKey.derive()` and `HDPrivateKey.derive()` are now deprecated. These methods will throw an error in the next major release. +`HDPublicKey.deriveChild()`, `HDPrivateKey.deriveChild()`, and `HDPrivateKey.deriveNonCompliantChild()` have been implemented as alternatives. Note that these new methods will not be officially supported until v1.0.0. `deriveNonCompliantChild` will derive using the non-BIP32 derivation and is equivalent to the buggy version, `derive`. The `deriveNonCompliantChild` method should not be used unless you're upgrading and need to maintain compatibility with the old derivation. diff --git a/packages/kauri-bitcore-lib/docs/index.md b/packages/kauri-bitcore-lib/docs/index.md new file mode 100644 index 0000000..fbadbd8 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/index.md @@ -0,0 +1,104 @@ +# Bitcore v0.15.0 + +## Principles + +Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. Bitcore provides a reliable API for JavaScript apps that need to interface with Bitcoin. + +To get started, just `npm install bitcore` or `bower install bitcore`. + +# Documentation Index + +## Addresses and Key Management + +* [Addresses](address.md) +* [Using Different Networks](networks.md) +* [Private Keys](privatekey.md) and [Public Keys](publickey.md) +* [Hierarchically-derived Private and Public Keys](hierarchical.md) + +## Payment Handling +* [Using Different Units](unit.md) +* [Acknowledging and Requesting Payments: Bitcoin URIs](uri.md) +* [The Transaction Class](transaction.md) + +## Bitcoin Internals +* [Scripts](script.md) +* [Block](block.md) + +## Extra +* [Crypto](crypto.md) +* [Encoding](encoding.md) + +## Module Development +* [Browser Builds](browser.md) + +## Modules + +Some functionality is implemented as a module that can be installed separately: + +* [Payment Protocol Support](https://github.com/bitpay/bitcore-payment-protocol) +* [Peer to Peer Networking](https://github.com/bitpay/bitcore-p2p) +* [Bitcoin Core JSON-RPC](https://github.com/bitpay/bitcoind-rpc) +* [Payment Channels](https://github.com/bitpay/bitcore-channel) +* [Mnemonics](https://github.com/bitpay/bitcore-mnemonic) +* [Elliptical Curve Integrated Encryption Scheme](https://github.com/bitpay/bitcore-ecies) +* [Blockchain Explorers](https://github.com/bitpay/bitcore-explorers) +* [Signed Messages](https://github.com/bitpay/bitcore-message) + +# Examples + +## Create and Save a Private Key + +```javascript +var privateKey = new bitcore.PrivateKey(); + +var exported = privateKey.toWIF(); +// e.g. L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m +var imported = bitcore.PrivateKey.fromWIF(exported); +var hexa = privateKey.toString(); +// e.g. 'b9de6e778fe92aa7edb69395556f843f1dce0448350112e14906efc2a80fa61a' +``` + +## Create an Address + +```javascript +var address = privateKey.toAddress(); +``` + +## Create a Multisig Address + +```javascript +// Build a 2-of-3 address from public keys +var p2shAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2); +``` + +## Request a Payment + +```javascript +var paymentInfo = { + address: '1DNtTk4PUCGAdiNETAzQFWZiy2fCHtGnPx', + amount: 120000 //satoshis +}; +var uri = new bitcore.URI(paymentInfo).toString(); +``` + +## Create a Transaction + +```javascript +var transaction = new Transaction() + .from(utxos) // Feed information about what unspent outputs one can use + .to(address, amount) // Add an output with the given amount of satoshis + .change(address) // Sets up a change address where the rest of the funds will go + .sign(privkeySet) // Signs all the inputs it can +``` + +## Connect to the Network + +```javascript +var peer = new Peer('5.9.85.34'); + +peer.on('inv', function(message) { + // new inventory +}); + +peer.connect(); +``` diff --git a/packages/kauri-bitcore-lib/docs/networks.md b/packages/kauri-bitcore-lib/docs/networks.md new file mode 100644 index 0000000..e8a54e2 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/networks.md @@ -0,0 +1,55 @@ +# Networks +Bitcore provides support for the main bitcoin network as well as for `testnet3`, the current test blockchain. We encourage the use of `Networks.livenet` and `Networks.testnet` as constants. Note that the library sometimes may check for equality against this object. Please avoid creating a deep copy of this object. + +The `Network` namespace has a function, `get(...)` that returns an instance of a `Network` or `undefined`. The only argument to this function is some kind of identifier of the network: either its name, a reference to a Network object, or a number used as a magic constant to identify the network (for example, the value `0` that gives bitcoin addresses the distinctive `'1'` at its beginning on livenet, is a `0x6F` for testnet). + +## Regtest + +The regtest network is useful for development as it's possible to programmatically and instantly generate blocks for testing. It's currently supported as a variation of testnet. Here is an example of how to use regtest with the Bitcore Library: + +```js +// Standard testnet +> bitcore.Networks.testnet.networkMagic; + +``` + +```js +// Enabling testnet to use the regtest port and magicNumber +> bitcore.Networks.enableRegtest(); +> bitcore.Networks.testnet.networkMagic; + +``` + +## Setting the Default Network +Most projects will only need to work with one of the networks. The value of `Networks.defaultNetwork` can be set to `Networks.testnet` if the project will need to only to work on testnet (the default is `Networks.livenet`). + +## Network constants +The functionality of testnet and livenet is mostly similar (except for some relaxed block validation rules on testnet). They differ in the constants being used for human representation of base58 encoded strings. These are sometimes referred to as "version" constants. + +Take a look at this modified snippet from [networks.js](https://github.com/bitpay/bitcore/blob/master/lib/networks.js) + +```javascript +var livenet = new Network(); +_.extend(livenet, { + name: 'livenet', + alias: 'mainnet', + pubkeyhash: 0x00, + privatekey: 0x80, + scripthash: 0x05, + xpubkey: 0x0488b21e, + xprivkey: 0x0488ade4, + port: 8333 +}); + +var testnet = new Network(); +_.extend(testnet, { + name: 'testnet', + alias: 'testnet', + pubkeyhash: 0x6f, + privatekey: 0xef, + scripthash: 0xc4, + xpubkey: 0x043587cf, + xprivkey: 0x04358394, + port: 18333 +}); +``` diff --git a/packages/kauri-bitcore-lib/docs/privatekey.md b/packages/kauri-bitcore-lib/docs/privatekey.md new file mode 100644 index 0000000..f813345 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/privatekey.md @@ -0,0 +1,47 @@ +# Private Key +Represents a bitcoin private key and is needed to be able to spend bitcoin and sign transactions. See the official [Bitcoin Wiki](https://en.bitcoin.it/wiki/Private_key) for more information about private keys. A PrivateKey in Bitcore is an immutable object that has methods to import and export into a variety of formats including [Wallet Import Format](https://en.bitcoin.it/wiki/Wallet_import_format). + +## Instantiate a Private Key +Here is how to create a new private key. It will generate a new random number using `window.crypto` or the Node.js `crypto` library. + +```javascript +var privateKey = new PrivateKey(); + +// Creates a private key from a hexa encoded number +var privateKey2 = new PrivateKey('b221d9dbb083a7f33428d7c2a3c3198ae925614d70210e28716ccaa7cd4ddb79'); +``` + +To export and import a private key, you can do the following: + +```javascript +// encode into wallet export format +var exported = privateKey.toWIF(); + +// instantiate from the exported (and saved) private key +var imported = PrivateKey.fromWIF('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); +``` + +Note: The WIF (Wallet Import Format) includes information about the network and if the associated public key is compressed or uncompressed (thus the same bitcoin address will be generated by using this format). + +To generate an Address or PublicKey from a PrivateKey: + +```javascript +var publicKey = privateKey.toPublicKey(); +var address = publicKey.toAddress(Networks.livenet); +``` + +## Validating a Private Key +The code to do these validations looks like this: + +```javascript +// validate an address +if (PrivateKey.isValid(input)){ + ... +} + +// get the specific validation error that can occurred +var error = PrivateKey.getValidationError(input, Networks.livenet); +if (error) { + // handle the error +} +``` diff --git a/packages/kauri-bitcore-lib/docs/publickey.md b/packages/kauri-bitcore-lib/docs/publickey.md new file mode 100644 index 0000000..9caf860 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/publickey.md @@ -0,0 +1,59 @@ +# Public Key +Represents a bitcoin public key and is needed to be able to receive bitcoin, as is usually represented as a bitcoin [Address](address.md). See the official [Bitcoin Wiki](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses). + +A PublicKey in Bitcore is an immutable object and can be instantiated from a [Point](crypto.md), string, [PrivateKey](privatekey.md), Buffer or a [BN](crypto.md). + +## Instantiate a Public Key +Here is how to instantiate a public key: + +```javascript + +var privateKey = new PrivateKey(); + +// from a private key +var publicKey = new PublicKey(privateKey); + +// from a der hex encoded string +var publicKey2 = new PublicKey('02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc'); +``` + +## Validating a Public Key +A public key point should be on the [secp256k1](https://en.bitcoin.it/wiki/Secp256k1) curve, instantiating a new PublicKey will validate this and will throw an error if it's invalid. To check that a public key is valid: + +```javascript +if (PublicKey.isValid('02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc')){ + // valid public key +} +``` + +## Compressed vs Uncompressed +It's important to note that there are two possible ways to represent a public key. The standard is _compressed_ and includes the X value and parity (as represented above in the documentation). There is also a longer version that is _uncompressed_ which includes both X and Y values. Using this encoding will generate a different bitcoin address, so be careful when selecting the encoding. Uncompressed public keys start with 0x04; compressed public keys begin with 0x03 or 0x02 depending on whether they're greater or less than the midpoint of the curve. These prefix bytes are all used in official secp256k1 documentation. + +Example: + +```javascript +> var bitcore = require('bitcore'); + +// compressed public key starting with 0x03 (greater than midpoint of curve) +> var compressedPK = bitcore.PublicKey('030589ee559348bd6a7325994f9c8eff12bd'+ + '5d73cc683142bd0dd1a17abc99b0dc'); +> compressedPK.compressed; +true +> compressedPK.toAddress().toString(); +'1KbUJ4x8epz6QqxkmZbTc4f79JbWWz6g37' +// compressed public key starting with 0x02 (smaller than midpoint of curve) +> var compressedPK2 = new bitcore.PublicKey('02a1633cafcc01ebfb6d78e39f687a1f'+ + '0995c62fc95f51ead10a02ee0be551b5dc'); +> compressedPK2.compressed; +true +> compressedPK.toAddress().toString(); +'1KbUJ4x8epz6QqxkmZbTc4f79JbWWz6g37' +// uncompressed public key, starting with 0x04. Contains both X and Y encoded +> var uncompressed = bitcore.PublicKey('0479BE667EF9DCBBAC55A06295CE870B07029'+ + 'BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68'+ + '554199C47D08FFB10D4B8'); +> uncompressed.compressed +false +> uncompressed.toAddress().toString() +'1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm' +``` diff --git a/packages/kauri-bitcore-lib/docs/script.md b/packages/kauri-bitcore-lib/docs/script.md new file mode 100644 index 0000000..7faa1ac --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/script.md @@ -0,0 +1,136 @@ +# Script +All bitcoin transactions have scripts embedded into its inputs and outputs. The scripts use a very simple programming language, which is evaluated from left to right using a stack. The language is designed such that it guarantees all scripts will execute in a limited amount of time (it is not Turing-Complete). + +When a transaction is validated, the input scripts are concatenated with the output scripts and evaluated. To be valid, all transaction scripts must evaluate to true. A good analogy for how this works is that the output scripts are puzzles that specify in which conditions can those bitcoins be spent. The input scripts provide the correct data to make those output scripts evaluate to true. + +For more detailed information about the bitcoin scripting language, check the online reference [on bitcoin's wiki](https://en.bitcoin.it/wiki/Script). + +The `Script` object provides an interface to construct, parse, and identify bitcoin scripts. It also gives simple interfaces to create most common script types. This class is useful if you want to create custom input or output scripts. In other case, you should probably use `Transaction`. + +## Script creation +Here's how to use `Script` to create the five most common script types: + +### Pay to Public Key Hash (p2pkh) +This is the most commonly used transaction output script. It's used to pay to a bitcoin address (a bitcoin address is a public key hash encoded in base58check) + +```javascript +// create a new p2pkh paying to a specific address +var address = Address.fromString('1NaTVwXDDUJaXDQajoa9MqHhz4uTxtgK14'); +var script = Script.buildPublicKeyHashOut(address); +assert(script.toString() === 'OP_DUP OP_HASH160 20 0xecae7d092947b7ee4998e254aa48900d26d2ce1d OP_EQUALVERIFY OP_CHECKSIG'); +``` + +### Pay to Public Key (p2pk) +Pay to public key scripts are a simplified form of the p2pkh, but aren't commonly used in new transactions anymore, because p2pkh scripts are more secure (the public key is not revealed until the output is spent). + +```javascript +// create a new p2pk paying to a specific public key +var pubkey = new PublicKey('022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'); +var script = Script.buildPublicKeyOut(pubkey); +assert(script.toString() === '33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da OP_CHECKSIG'); +``` + +### Pay to Multisig (p2ms) +Multisig outputs allow to share control of bitcoins between several keys. When creating the script, one specifies the public keys that control the funds, and how many of those keys are required to sign off spending transactions to be valid. An output with N public keys of which M are required is called an m-of-n output (For example, 2-of-3, 3-of-5, 4-of-4, etc.) + +Note that regular multisig outputs are rarely used nowadays. The best practice is to use a p2sh multisig output (See Script#toScriptHashOut()). + +```javascript +// create a new 2-of-3 multisig output from 3 given public keys +var pubkeys = [ + new PublicKey('022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'), + new PublicKey('03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9'), + new PublicKey('021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18'), +]; +var threshold = 2; +var script = Script.buildMultisigOut(pubkeys, threshold); +assert(script.toString() === 'OP_2 33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da' + + ' 33 0x03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9' + + ' 33 0x021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18 OP_3 OP_CHECKMULTISIG'); +``` + +### Pay to Script Hash (p2sh) +Pay to script hash outputs are scripts that contain the hash of another script, called `redeemScript`. To spend bitcoins sent in a p2sh output, the spending transaction must provide a script matching the script hash and data which makes the script evaluate to true. This allows to defer revealing the spending conditions to the moment of spending. It also makes it possible for the receiver to set the conditions to spend those bitcoins. + +Most multisig transactions today use p2sh outputs where the `redeemScript` is a multisig output. + +```javascript +// create a p2sh multisig output +var pubkeys = [ + new PublicKey('022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'), + new PublicKey('03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9'), + new PublicKey('021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18'), +]; +var redeemScript = Script.buildMultisigOut(pubkeys, 2); +var script = redeemScript.toScriptHashOut(); +assert(script.toString() === 'OP_HASH160 20 0x620a6eeaf538ec9eb89b6ae83f2ed8ef98566a03 OP_EQUAL'); +``` + +### Data output +Data outputs are used to push data into the blockchain. Up to 40 bytes can be pushed in a standard way, but more data can be used, if a miner decides to accept the transaction. + +```javascript +var data = 'hello world!!!'; +var script = Script.buildDataOut(data); +assert(script.toString() === 'OP_RETURN 14 0x68656c6c6f20776f726c64212121' +``` + +### Custom Scripts +To create a custom `Script` instance, you must rely on the lower-level methods `add` and `prepend`. Both methods accept the same parameter types, and insert an opcode or data at the beginning (`prepend`) or end (`add`) of the `Script`. + +``` +var script = Script() + .add('OP_IF') // add an opcode by name + .prepend(114) // add OP_2SWAP by code + .add(Opcode.OP_NOT) // add an opcode object + .add(new Buffer('bacacafe', 'hex')) // add a data buffer (will append the size of the push operation first) + +assert(script.toString() === 'OP_2SWAP OP_IF OP_NOT 4 0xbacacafe'); +``` + +## Script Parsing and Identification +`Script` has an easy interface to parse raw scripts from the network or bitcoind, and to extract useful information. An illustrative example (for more options check the API reference) + +```javascript +var raw_script = new Buffer('5221022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da2103e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e921021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc1853ae', 'hex'); +var s = new Script(raw_script); +console.log(s.toString()); +// 'OP_2 33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da 33 0x03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9 33 0x021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18 OP_3 OP_CHECKMULTISIG' + +s.isPublicKeyHashOut() // false +s.isScriptHashOut() // false +s.isMultisigOut() // true +``` + +## Script Interpreting and Validation +To validate a transaction, the bitcoin network validates all of its inputs and outputs. To validate an input, the input's script is concatenated with the referenced output script, and the result is executed. If at the end of execution the stack contains a 'true' value, then the transaction is valid. You can do this in `bitcore` by using the `Interpreter` class. The entry point (and probably the only interface you'll need for most applications) is the method `Interpreter#verify()`. + +You can use it like this: + +``` +var inputScript = Script('OP_1'); +var outputScript = Script('OP_15 OP_ADD OP_16 OP_EQUAL'); + +var verified = Interpreter().verify(inputScript, outputScript); +// verified will be true +``` + +Note that `verify` expects two scripts: one is the input script (scriptSig) and the other is the output script (scriptPubkey). This is because different conditions are checked for each. + +It also accepts some optional parameters, assuming defaults if not provided: + +``` +// first we create a transaction +var tx = new Transaction() + .from(utxo) + .to(toAddress, 100000) + .sign(privateKey); + +// we then extract the signature from the first input +var inputIndex = 0; +var signature = tx.getSignatures(privateKey)[inputIndex].signature; + +var scriptSig = Script.buildPublicKeyHashIn(publicKey, signature); +var flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_STRICTENC; +var verified = Interpreter().verify(scriptSig, scriptPubkey, tx, inputIndex, flags); +``` diff --git a/packages/kauri-bitcore-lib/docs/transaction.md b/packages/kauri-bitcore-lib/docs/transaction.md new file mode 100644 index 0000000..91c5db7 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/transaction.md @@ -0,0 +1,177 @@ +# Transaction +Bitcore provides a very simple API for creating transactions. We expect this API to be accessible for developers without knowing the working internals of bitcoin in deep detail. What follows is a small introduction to transactions with some basic knowledge required to use this API. + +A Transaction contains a set of inputs and a set of outputs. Each input contains a reference to another transaction's output, and a signature that allows the value referenced in that output to be used in this transaction. + +Note also that an output can be used only once. That's why there's a concept of "change address" in the bitcoin ecosystem: if an output of 10 BTC is available for me to spend, but I only need to transmit 1 BTC, I'll create a transaction with two outputs, one with 1 BTC that I want to spend, and the other with 9 BTC to a change address, so I can spend this 9 BTC with another private key that I own. + +So, in order to transmit a valid transaction, you must know what other transactions on the network store outputs that have not been spent and that are available for you to spend (meaning that you have the set of keys that can validate you own those funds). The unspent outputs are usually referred to as "utxo"s. + +Let's take a look at some very simple transactions: + +```javascript +var transaction = new Transaction() + .from(utxos) // Feed information about what unspent outputs one can use + .to(address, amount) // Add an output with the given amount of satoshis + .change(address) // Sets up a change address where the rest of the funds will go + .sign(privkeySet) // Signs all the inputs it can +``` + +You can obtain the input and output total amounts of the transaction in satoshis by accessing the fields `inputAmount` and `outputAmount`. + +Now, this could just be serialized to hexadecimal ASCII values (`transaction.serialize()`) and sent over to the bitcoind reference client. + +```bash +bitcoin-cli sendrawtransaction +``` + +You can also override the fee estimation with another amount, specified in satoshis: + +```javascript +var transaction = new Transaction().fee(5430); // Minimum non-dust amount +var transaction = new Transaction().fee(1e8); // Generous fee of 1 BTC +``` + +## Multisig Transactions +To send a transaction to a multisig address, the API is the same as in the above example. To spend outputs that require multiple signatures, the process needs extra information: the public keys of the signers that can unlock that output. + +```javascript +var multiSigTx = new Transaction() + .from(utxo, publicKeys, threshold) + .change(address) + .sign(myKeys); + +var serialized = multiSigTx.toObject(); +``` + +This can be serialized and sent to another party, to complete with the needed signatures: + +```javascript +var multiSigTx = new Transaction(serialized) + .sign(anotherSetOfKeys); + +assert(multiSigTx.isFullySigned()); +``` + +Also, you can just send over the signature for your private key: + +```javascript +var multiSigTx = new Transaction() + .from(utxo, publicKeys, threshold) + .change(address); + +var signature = multiSigTx.getSignatures(privateKey)[0]; +console.log(JSON.stringify(signature)); +console.log(signature.toObject()); +console.log(signature.signature.toString()); // Outputs a DER signature +console.log(signature.sigtype); +``` + +Transfer that over the wire, and on the other side, apply it to a transaction: + +```javascript +assert(transaction.isValidSignature(receivedSig)); +transaction.applySignature(receivedSig); +``` + +## Adding inputs +Transaction inputs are instances of either [Input](https://github.com/bitpay/bitcore/tree/master/lib/transaction/input) or its subclasses. `Input` has some abstract methods, as there is no actual concept of a "signed input" in the bitcoin scripting system (just valid signatures for OP_CHECKSIG and similar opcodes). They are stored in the `input` property of `Transaction` instances. + +Bitcore contains two implementations of `Input`, one for spending _Pay to Public Key Hash_ outputs (called `PublicKeyHashInput`) and another to spend _Pay to Script Hash_ outputs for which the redeem script is a Multisig script (called `MultisigScriptHashInput`). + +All inputs have the following five properties: +- `prevTxId`: a `Buffer` with the id of the transaction with the output this input is spending +- `outputIndex`: a `number` the index of the output in the previous transaction +- `sequenceNumber`: a `number`, the sequence number, see [bitcoin's developer guide on nLockTime and the sequence number](https://bitcoin.org/en/developer-guide#locktime-and-sequence-number). +- `script`: the `Script` instance for this input. Usually called `scriptSig` in the bitcoin community. +- `output`: if available, a `Output` instance of the output associated with this input. + +Both `PublicKeyHashInput` and `MultisigScriptHashInput` cache the information about signatures, even though this information could somehow be encoded in the script. Both need to have the `output` property set in order to calculate the `sighash` so signatures can be created. + +Some methods related to adding inputs are: +- `from`: A high level interface to add an input from a UTXO. It has a series of variants: + - `from(utxo)`: add an input from an [Unspent Transaction Output](http://bitcore.io/guide/unspentoutput.html). Currently, only P2PKH outputs are supported. + - `from(utxos)`: same as above, but passing in an array of Unspent Outputs. + - `from(utxo, publicKeys, threshold)`: add an input that spends a UTXO with a P2SH output for a Multisig script. The `publicKeys` argument is an array of public keys, and `threshold` is the number of required signatures in the Multisig script. + +- `addInput`: Performs a series of checks on an input and appends it to the end of the `input` vector and updates the amount of incoming bitcoins of the transaction. +- `uncheckedAddInput`: adds an input to the end of the `input` vector and updates the `inputAmount` without performing any checks. + +### PublicKeyHashInput +This input uses the `script` property to mark the input as unsigned if the script is empty. + +### MultisigScriptHashInput +This input contains a set of signatures in a `signatures` property, and each time a signature is added, a potentially partial and/or invalid script is created. The `isFullySigned` method will only return true if all needed signatures are already added and valid. If `addSignature` is added after all need signatures are already set, an exception will be thrown. + +## Signing a Transaction +The following methods are used to manage signatures for a transaction: +- `getSignatures`: takes an array of `PrivateKey` or strings from which a `PrivateKey` can be instantiated; the transaction to be signed; the kind of [signature hash to use](https://bitcoin.org/en/developer-guide#signature-hash-types). Returns an array of objects with the following properties: + - `signature`: an instance of [Signature](https://github.com/bitpay/bitcore/blob/master/lib/crypto/signature.js) + - `prevTxId`: this input's `prevTxId`, + - `outputIndex`: this input's `outputIndex`, + - `inputIndex`: this input's index in the transaction + - `sigtype`: the "sighash", the type of transaction hash used to calculate the signature + - `publicKey`: a `PublicKey` of the `PrivateKey` used to create the signature + +- `addSignature`: takes an element outputed by `getSignatures` and applies the signature to this input (modifies the script to include the new signature). +- `clearSignatures`: removes all signatures for this input +- `isFullySigned`: returns true if the input is fully signed + +## Handling Outputs +Outputs can be added by: +- The `addOutput(output)` method, which pushes an `Output` to the end of the `outputs` property and updates the `outputAmount` field. It also clears signatures (as the hash of the transaction may have changed) and updates the change output. +- The `to(address, amount)` method, that adds an output with the script that corresponds to the given address. Builds an output and calls the `addOutput` method. +- Specifying a [change address](#Fee_calculation) + +To remove all outputs, you can use `clearOutputs()`, which preserves change output configuration. + +## Serialization +There are a series of methods used for serialization: +- `toObject`: Returns a plain JavaScript object with no methods and enough information to fully restore the state of this transaction. Using other serialization methods (except for `toJSON`) will cause a some information to be lost. +- `toJSON`: Will be called when using `JSON.stringify` to return JSON-encoded string using the output from `toObject`. +- `toString` or `uncheckedSerialize`: Returns an hexadecimal serialization of the transaction, in the [serialization format for bitcoin](https://bitcoin.org/en/developer-reference#raw-transaction-format). +- `serialize`: Does a series of checks before serializing the transaction +- `inspect`: Returns a string with some information about the transaction (currently a string formatted as ``, that only shows the serialized value of the transaction. +- `toBuffer`: Serializes the transaction for sending over the wire in the bitcoin network +- `toBufferWriter`: Uses an already existing BufferWriter to copy over the serialized transaction + +## Serialization Checks +When serializing, the bitcore library performs a series of checks. These can be disabled by providing an object to the `serialize` method with the checks that you'll like to skip. +- `disableLargeFees` avoids checking that the fee is no more than `Transaction.FEE_PER_KB * Transaction.FEE_SECURITY_MARGIN * size_in_kb`. +- `disableSmallFees` avoids checking that the fee is less than `Transaction.FEE_PER_KB * size_in_kb / Transaction.FEE_SECURITY_MARGIN`. +- `disableIsFullySigned` does not check if all inputs are fully signed +- `disableDustOutputs` does not check for dust outputs being generated +- `disableMoreOutputThanInput` avoids checking that the sum of the output amounts is less than or equal to the sum of the amounts for the outputs being spent in the transaction + +These are the current default values in the bitcore library involved on these checks: +- `Transaction.FEE_PER_KB`: `10000` (satoshis per kilobyte) +- `Transaction.FEE_SECURITY_MARGIN`: `15` +- `Transaction.DUST_AMOUNT`: `546` (satoshis) + +## Fee calculation +When outputs' value don't sum up to the same amount that inputs, the difference in bitcoins goes to the miner of the block that includes this transaction. The concept of a "change address" usually is associated with this: an output with an address that can be spent by the creator of the transaction. + +For this reason, some methods in the Transaction class are provided: +- `change(address)`: Set up the change address. This will set an internal `_changeScript` property that will store the change script associated with that address. +- `fee(amount)`: Sets up the exact amount of fee to pay. If no change address is provided, this will raise an exception. +- `getFee()`: returns the estimated fee amount to be paid, based on the size of the transaction, but disregarding the priority of the outputs. + +Internally, a `_changeIndex` property stores the index of the change output (so it can get updated when a new input or output is added). + +## Time-Locking transaction +All bitcoin transactions contain a locktime field. The locktime indicates the earliest time a transaction can be added to the blockchain. Locktime allows signers to create time-locked transactions which will only become valid in the future, giving the signers a chance to change their minds. Locktime can be set in the form of a bitcoin block height (the transaction can only be included in a block with a higher height than specified) or a linux timestamp (transaction can only be confirmed after that time). For more information see [bitcoin's development guide section on locktime](https://bitcoin.org/en/developer-guide#locktime-and-sequence-number). + +In bitcore, you can set a `Transaction`'s locktime by using the methods `Transaction#lockUntilDate` and `Transaction#lockUntilBlockHeight`. You can also get a friendly version of the locktime field via `Transaction#getLockTime`; + +For example: + +```javascript +var future = new Date(2025,10,30); // Sun Nov 30 2025 +var transaction = new Transaction() + .lockUntilDate(future); +console.log(transaction.getLockTime()); +// output similar to: Sun Nov 30 2025 00:00:00 GMT-0300 (ART) +``` + +## Upcoming changes +We're debating an API for Merge Avoidance, CoinJoin, Smart contracts, CoinSwap, and Stealth Addresses. We're expecting to have all of them by some time in 2015. Payment channel creation is available in the [bitcore-channel](https://github.com/bitpay/bitcore-channel) module. diff --git a/packages/kauri-bitcore-lib/docs/unit.md b/packages/kauri-bitcore-lib/docs/unit.md new file mode 100644 index 0000000..72017c4 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/unit.md @@ -0,0 +1,80 @@ +# Unit +Unit is a utility for handling and converting bitcoin units. We strongly recommend to always use satoshis to represent amount inside your application and only convert them to other units in the front-end. + +To understand the need of using the `Unit` class when dealing with unit conversions, see this example: + +``` +> 81.99 * 100000 // wrong +8198999.999999999 +> var bitcore = require('bitcore'); +> var Unit = bitcore.Unit; +> Unit.fromMilis(81.99).toSatoshis() // correct +8199000 +``` + +## Supported units +The supported units are BTC, mBTC, bits (micro BTCs, uBTC) and satoshis. The codes for each unit can be found as members of the Unit class. + +```javascript +var btcCode = Unit.BTC; +var mbtcCode = Unit.mBTC; +var ubtcCode = Unit.uBTC; +var bitsCode = Unit.bits; +var satsCode = Unit.satoshis; +``` + +## Creating units +There are two ways for creating a unit instance. You can instantiate the class using a value and a unit code; alternatively if the unit it's fixed you could you some of the static methods. Check some examples below: + +```javascript +var unit; +var amount = 100; + +// using a unit code +var unitPreference = Unit.BTC; +unit = new Unit(amount, unitPreference); + +// using a known unit +unit = Unit.fromBTC(amount); +unit = Unit.fromMilis(amount); +unit = Unit.fromBits(amount); +unit = Unit.fromSatoshis(amount); +``` + +## Conversion +Once you have a unit instance, you can check its representation in all the available units. For your convenience the classes expose three ways to accomplish this. Using the `.to(unitCode)` method, using a fixed unit like `.toSatoshis()` or by using the accessors. + +```javascript +var unit; + +// using a unit code +var unitPreference = Unit.BTC; +value = Unit.fromSatoshis(amount).to(unitPreference); + +// using a known unit +value = Unit.fromBTC(amount).toBTC(); +value = Unit.fromBTC(amount).toMilis(); +value = Unit.fromBTC(amount).toBits(); +value = Unit.fromBTC(amount).toSatoshis(); + +// using accessors +value = Unit.fromBTC(amount).BTC; +value = Unit.fromBTC(amount).mBTC; +value = Unit.fromBTC(amount).bits; +value = Unit.fromBTC(amount).satoshis; +``` + +## Using a fiat currency +The unit class also provides a convenient alternative to create an instance from a fiat amount and the corresponding BTC/fiat exchange rate. Any unit instance can be converted to a fiat amount by providing the current exchange rate. Check the example below: + +```javascript +var unit, fiat; +var amount = 100; +var exchangeRate = 350; + +unit = new Unit(amount, exchangeRate); +unit = Unit.fromFiat(amount, exchangeRate); + +fiat = Unit.fromBits(amount).atRate(exchangeRate); +fiat = Unit.fromBits(amount).to(exchangeRate); +``` diff --git a/packages/kauri-bitcore-lib/docs/unspentoutput.md b/packages/kauri-bitcore-lib/docs/unspentoutput.md new file mode 100644 index 0000000..0aac09a --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/unspentoutput.md @@ -0,0 +1,32 @@ +# UnspentOutput +`bitcore.Transaction.UnspentOutput` is a class with stateless instances that provides information about an unspent output: +- Transaction ID and output index +- The "scriptPubKey", the script included in the output +- Amount of satoshis associated +- Address, if available + +## Parameters +The constructor is quite permissive with the input arguments. It can take outputs straight out of bitcoind's getunspent RPC call. Some of the names are not very informative for new users, so the UnspentOutput constructor also understands these aliases: +- `scriptPubKey`: just `script` is also accepted +- `amount`: expected value in BTC. If the `satoshis` alias is used, make sure to use satoshis instead of BTC. +- `vout`: this is the index of the output in the transaction, renamed to `outputIndex` +- `txid`: `txId` + +## Example + +```javascript +var utxo = new UnspentOutput({ + "txid" : "a0a08e397203df68392ee95b3f08b0b3b3e2401410a38d46ae0874f74846f2e9", + "vout" : 0, + "address" : "mgJT8iegL4f9NCgQFeFyfvnSw1Yj4M5Woi", + "scriptPubKey" : "76a914089acaba6af8b2b4fb4bed3b747ab1e4e60b496588ac", + "amount" : 0.00070000 +}); +var utxo = new UnspentOutput({ + "txId" : "a0a08e397203df68392ee95b3f08b0b3b3e2401410a38d46ae0874f74846f2e9", + "outputIndex" : 0, + "address" : "mgJT8iegL4f9NCgQFeFyfvnSw1Yj4M5Woi", + "script" : "76a914089acaba6af8b2b4fb4bed3b747ab1e4e60b496588ac", + "satoshis" : 70000 +}); +``` diff --git a/packages/kauri-bitcore-lib/docs/uri.md b/packages/kauri-bitcore-lib/docs/uri.md new file mode 100644 index 0000000..9af6242 --- /dev/null +++ b/packages/kauri-bitcore-lib/docs/uri.md @@ -0,0 +1,41 @@ +# Bitcoin URIs +Represents a bitcoin payment URI. Bitcoin URI strings became the most popular way to share payment request, sometimes as a bitcoin link and others using a QR code. + +URI Examples: + +``` +bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu +bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2 +bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2&message=Payment&label=Satoshi&extra=other-param +``` + +## URI Validation +The main use that we expect you'll have for the `URI` class in bitcore is validating and parsing bitcoin URIs. A `URI` instance exposes the address as a bitcore `Address` object and the amount in Satoshis, if present. + +The code for validating URIs looks like this: + +```javascript +var uriString = 'bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2'; +var valid = URI.isValid(uriString); +var uri = new URI(uriString); +console.log(uri.address.network, uri.amount); // 'livenet', 120000000 +``` + +## URI Parameters +All standard parameters can be found as members of the `URI` instance. However a bitcoin URI may contain other non-standard parameters, all those can be found under the `extra` namespace. + +See [the official BIP21 spec](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki) for more information. + +## Create URI +Another important use case for the `URI` class is creating a bitcoin URI for sharing a payment request. That can be accomplished by using a dictionary to create an instance of URI. + +The code for creating an URI from an Object looks like this: + +```javascript +var uriString = new URI({ + address: '12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu', + amount : 10000, // in satoshis + message: 'My payment request' +}); +var uriString = uri.toString(); +``` diff --git a/packages/kauri-bitcore-lib/gulpfile.js b/packages/kauri-bitcore-lib/gulpfile.js new file mode 100644 index 0000000..a42397b --- /dev/null +++ b/packages/kauri-bitcore-lib/gulpfile.js @@ -0,0 +1,5 @@ + + +var bitcoreTasks = require('bitcore-build'); + +bitcoreTasks('lib'); diff --git a/packages/kauri-bitcore-lib/index.js b/packages/kauri-bitcore-lib/index.js new file mode 100644 index 0000000..eaa6107 --- /dev/null +++ b/packages/kauri-bitcore-lib/index.js @@ -0,0 +1,69 @@ +'use strict'; + +var bitcore = module.exports; + +// module information +bitcore.version = 'v' + require('./package.json').version; +bitcore.versionGuard = function(version) { + if (version !== undefined) { + var message = 'More than one instance of bitcore-lib found. ' + + 'Please make sure to require bitcore-lib and check that submodules do' + + ' not also include their own bitcore-lib dependency.'; + throw new Error(message); + } +}; +bitcore.versionGuard(global._bitcore); +global._bitcore = bitcore.version; + +// crypto +bitcore.crypto = {}; +bitcore.crypto.BN = require('./lib/crypto/bn'); +bitcore.crypto.ECDSA = require('./lib/crypto/ecdsa'); +bitcore.crypto.Hash = require('./lib/crypto/hash'); +bitcore.crypto.Random = require('./lib/crypto/random'); +bitcore.crypto.Point = require('./lib/crypto/point'); +bitcore.crypto.Signature = require('./lib/crypto/signature'); + +// encoding +bitcore.encoding = {}; +bitcore.encoding.Base58 = require('./lib/encoding/base58'); +bitcore.encoding.Base58Check = require('./lib/encoding/base58check'); +bitcore.encoding.BufferReader = require('./lib/encoding/bufferreader'); +bitcore.encoding.BufferWriter = require('./lib/encoding/bufferwriter'); +bitcore.encoding.Varint = require('./lib/encoding/varint'); + +// utilities +bitcore.util = {}; +bitcore.util.buffer = require('./lib/util/buffer'); +bitcore.util.js = require('./lib/util/js'); +bitcore.util.preconditions = require('./lib/util/preconditions'); + +// errors thrown by the library +bitcore.errors = require('./lib/errors'); + +// main bitcoin library +bitcore.Address = require('./lib/address'); +bitcore.Block = require('./lib/block'); +bitcore.MerkleBlock = require('./lib/block/merkleblock'); +bitcore.BlockHeader = require('./lib/block/blockheader'); +bitcore.HDPrivateKey = require('./lib/hdprivatekey.js'); +bitcore.HDPublicKey = require('./lib/hdpublickey.js'); +bitcore.Networks = require('./lib/networks'); +bitcore.Opcode = require('./lib/opcode'); +bitcore.PrivateKey = require('./lib/privatekey'); +bitcore.PublicKey = require('./lib/publickey'); +bitcore.Script = require('./lib/script'); +bitcore.Transaction = require('./lib/transaction'); +bitcore.URI = require('./lib/uri'); +bitcore.Unit = require('./lib/unit'); + +// dependencies, subject to change +bitcore.deps = {}; +bitcore.deps.bnjs = require('bn.js'); +bitcore.deps.bs58 = require('bs58'); +bitcore.deps.Buffer = Buffer; +bitcore.deps.elliptic = require('elliptic'); +bitcore.deps._ = require('lodash'); + +// Internal usage, exposed for testing/advanced tweaking +bitcore.Transaction.sighash = require('./lib/transaction/sighash'); diff --git a/packages/kauri-bitcore-lib/karma.conf.js b/packages/kauri-bitcore-lib/karma.conf.js new file mode 100644 index 0000000..dc5d597 --- /dev/null +++ b/packages/kauri-bitcore-lib/karma.conf.js @@ -0,0 +1,36 @@ +'use strict'; + +// karma.conf.js +module.exports = function(config) { + + config.set({ + browsers: ['Firefox'], + frameworks: ['mocha', 'detectBrowsers'], + detectBrowsers: { + enabled: true, + usePhantomJS: false, + postDetection: function(availableBrowser) { + // modify to enable additional browsers if available + var runBrowsers = ['Firefox', 'Chrome']; + var browsers = []; + for(var i = 0; i < runBrowsers.length; i++) { + if(~availableBrowser.indexOf(runBrowsers[i])) { + browsers.push(runBrowsers[i]); + } + } + return browsers; + } + }, + singleRun: true, + files: [ + 'tests.js' + ], + plugins: [ + 'karma-mocha', + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-detect-browsers' + ] + }); + +}; diff --git a/packages/kauri-bitcore-lib/lib/address.js b/packages/kauri-bitcore-lib/lib/address.js new file mode 100644 index 0000000..9420e92 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/address.js @@ -0,0 +1,505 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('./util/preconditions'); +var errors = require('./errors'); +var Base58Check = require('./encoding/base58check'); +var Networks = require('./networks'); +var Hash = require('./crypto/hash'); +var JSUtil = require('./util/js'); +var PublicKey = require('./publickey'); + +/** + * Instantiate an address from an address String or Buffer, a public key or script hash Buffer, + * or an instance of {@link PublicKey} or {@link Script}. + * + * This is an immutable class, and if the first parameter provided to this constructor is an + * `Address` instance, the same argument will be returned. + * + * An address has two key properties: `network` and `type`. The type is either + * `Address.PayToPublicKeyHash` (value is the `'pubkeyhash'` string) + * or `Address.PayToScriptHash` (the string `'scripthash'`). The network is an instance of {@link Network}. + * You can quickly check whether an address is of a given kind by using the methods + * `isPayToPublicKeyHash` and `isPayToScriptHash` + * + * @example + * ```javascript + * // validate that an input field is valid + * var error = Address.getValidationError(input, 'testnet'); + * if (!error) { + * var address = Address(input, 'testnet'); + * } else { + * // invalid network or checksum (typo?) + * var message = error.messsage; + * } + * + * // get an address from a public key + * var address = Address(publicKey, 'testnet').toString(); + * ``` + * + * @param {*} data - The encoded data in various formats + * @param {Network|String|number=} network - The network: 'livenet' or 'testnet' + * @param {string=} type - The type of address: 'script' or 'pubkey' + * @returns {Address} A new valid and frozen instance of an Address + * @constructor + */ +function Address(data, network, type) { + /* jshint maxcomplexity: 12 */ + /* jshint maxstatements: 20 */ + + if (!(this instanceof Address)) { + return new Address(data, network, type); + } + + if (_.isArray(data) && _.isNumber(network)) { + return Address.createMultisig(data, network, type); + } + + if (data instanceof Address) { + // Immutable instance + return data; + } + + $.checkArgument(data, 'First argument is required, please include address data.', 'guide/address.html'); + + if (network && !Networks.get(network)) { + throw new TypeError('Second argument must be "livenet" or "testnet".'); + } + + if (type && (type !== Address.PayToPublicKeyHash && type !== Address.PayToScriptHash)) { + throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".'); + } + + var info = this._classifyArguments(data, network, type); + + // set defaults if not set + info.network = info.network || Networks.get(network) || Networks.defaultNetwork; + info.type = info.type || type || Address.PayToPublicKeyHash; + + JSUtil.defineImmutable(this, { + hashBuffer: info.hashBuffer, + network: info.network, + type: info.type + }); + + return this; +} + +/** + * Internal function used to split different kinds of arguments of the constructor + * @param {*} data - The encoded data in various formats + * @param {Network|String|number=} network - The network: 'livenet' or 'testnet' + * @param {string=} type - The type of address: 'script' or 'pubkey' + * @returns {Object} An "info" object with "type", "network", and "hashBuffer" + */ +Address.prototype._classifyArguments = function(data, network, type) { + /* jshint maxcomplexity: 10 */ + // transform and validate input data + if ((data instanceof Buffer || data instanceof Uint8Array) && data.length === 20) { + return Address._transformHash(data); + } else if ((data instanceof Buffer || data instanceof Uint8Array) && data.length === 21) { + return Address._transformBuffer(data, network, type); + } else if (data instanceof PublicKey) { + return Address._transformPublicKey(data); + } else if (data instanceof Script) { + return Address._transformScript(data, network); + } else if (typeof(data) === 'string') { + return Address._transformString(data, network, type); + } else if (_.isObject(data)) { + return Address._transformObject(data); + } else { + throw new TypeError('First argument is an unrecognized data format.'); + } +}; + +/** @static */ +Address.PayToPublicKeyHash = 'pubkeyhash'; +/** @static */ +Address.PayToScriptHash = 'scripthash'; + +/** + * @param {Buffer} hash - An instance of a hash Buffer + * @returns {Object} An object with keys: hashBuffer + * @private + */ +Address._transformHash = function(hash) { + var info = {}; + if (!(hash instanceof Buffer) && !(hash instanceof Uint8Array)) { + throw new TypeError('Address supplied is not a buffer.'); + } + if (hash.length !== 20) { + throw new TypeError('Address hashbuffers must be exactly 20 bytes.'); + } + info.hashBuffer = hash; + return info; +}; + +/** + * Deserializes an address serialized through `Address#toObject()` + * @param {Object} data + * @param {string} data.hash - the hash that this address encodes + * @param {string} data.type - either 'pubkeyhash' or 'scripthash' + * @param {Network=} data.network - the name of the network associated + * @return {Address} + */ +Address._transformObject = function(data) { + $.checkArgument(data.hash || data.hashBuffer, 'Must provide a `hash` or `hashBuffer` property'); + $.checkArgument(data.type, 'Must provide a `type` property'); + return { + hashBuffer: data.hash ? Buffer.from(data.hash, 'hex') : data.hashBuffer, + network: Networks.get(data.network) || Networks.defaultNetwork, + type: data.type + }; +}; + +/** + * Internal function to discover the network and type based on the first data byte + * + * @param {Buffer} buffer - An instance of a hex encoded address Buffer + * @returns {Object} An object with keys: network and type + * @private + */ +Address._classifyFromVersion = function(buffer) { + var version = {}; + + var pubkeyhashNetwork = Networks.get(buffer[0], 'pubkeyhash'); + var scripthashNetwork = Networks.get(buffer[0], 'scripthash'); + + if (pubkeyhashNetwork) { + version.network = pubkeyhashNetwork; + version.type = Address.PayToPublicKeyHash; + } else if (scripthashNetwork) { + version.network = scripthashNetwork; + version.type = Address.PayToScriptHash; + } + + return version; +}; + +/** + * Internal function to transform a bitcoin address buffer + * + * @param {Buffer} buffer - An instance of a hex encoded address Buffer + * @param {string=} network - The network: 'livenet' or 'testnet' + * @param {string=} type - The type: 'pubkeyhash' or 'scripthash' + * @returns {Object} An object with keys: hashBuffer, network and type + * @private + */ +Address._transformBuffer = function(buffer, network, type) { + /* jshint maxcomplexity: 9 */ + var info = {}; + if (!(buffer instanceof Buffer) && !(buffer instanceof Uint8Array)) { + throw new TypeError('Address supplied is not a buffer.'); + } + if (buffer.length !== 1 + 20) { + throw new TypeError('Address buffers must be exactly 21 bytes.'); + } + + var networkObj = Networks.get(network); + var bufferVersion = Address._classifyFromVersion(buffer); + + if (network && !networkObj) { + throw new TypeError('Unknown network'); + } + + if (!bufferVersion.network || (networkObj && networkObj !== bufferVersion.network)) { + throw new TypeError('Address has mismatched network type.'); + } + + if (!bufferVersion.type || (type && type !== bufferVersion.type)) { + throw new TypeError('Address has mismatched type.'); + } + + info.hashBuffer = buffer.slice(1); + info.network = bufferVersion.network; + info.type = bufferVersion.type; + return info; +}; + +/** + * Internal function to transform a {@link PublicKey} + * + * @param {PublicKey} pubkey - An instance of PublicKey + * @returns {Object} An object with keys: hashBuffer, type + * @private + */ +Address._transformPublicKey = function(pubkey) { + var info = {}; + if (!(pubkey instanceof PublicKey)) { + throw new TypeError('Address must be an instance of PublicKey.'); + } + info.hashBuffer = Hash.sha256ripemd160(pubkey.toBuffer()); + info.type = Address.PayToPublicKeyHash; + return info; +}; + +/** + * Internal function to transform a {@link Script} into a `info` object. + * + * @param {Script} script - An instance of Script + * @returns {Object} An object with keys: hashBuffer, type + * @private + */ +Address._transformScript = function(script, network) { + $.checkArgument(script instanceof Script, 'script must be a Script instance'); + var info = script.getAddressInfo(network); + if (!info) { + throw new errors.Script.CantDeriveAddress(script); + } + return info; +}; + +/** + * Creates a P2SH address from a set of public keys and a threshold. + * + * The addresses will be sorted lexicographically, as that is the trend in bitcoin. + * To create an address from unsorted public keys, use the {@link Script#buildMultisigOut} + * interface. + * + * @param {Array} publicKeys - a set of public keys to create an address + * @param {number} threshold - the number of signatures needed to release the funds + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @param {boolean=} nestedWitness - if the address uses a nested p2sh witness + * @return {Address} + */ +Address.createMultisig = function(publicKeys, threshold, network, nestedWitness) { + network = network || publicKeys[0].network || Networks.defaultNetwork; + var redeemScript = Script.buildMultisigOut(publicKeys, threshold); + if (nestedWitness) { + return Address.payingTo(Script.buildWitnessMultisigOutFromScript(redeemScript), network); + } + return Address.payingTo(redeemScript, network); +}; + +/** + * Internal function to transform a bitcoin address string + * + * @param {string} data + * @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet' + * @param {string=} type - The type: 'pubkeyhash' or 'scripthash' + * @returns {Object} An object with keys: hashBuffer, network and type + * @private + */ +Address._transformString = function(data, network, type) { + if (typeof(data) !== 'string') { + throw new TypeError('data parameter supplied is not a string.'); + } + data = data.trim(); + var addressBuffer = Base58Check.decode(data); + var info = Address._transformBuffer(addressBuffer, network, type); + return info; +}; + +/** + * Instantiate an address from a PublicKey instance + * + * @param {PublicKey} data + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.fromPublicKey = function(data, network) { + var info = Address._transformPublicKey(data); + network = network || Networks.defaultNetwork; + return new Address(info.hashBuffer, network, info.type); +}; + +/** + * Instantiate an address from a ripemd160 public key hash + * + * @param {Buffer} hash - An instance of buffer of the hash + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.fromPublicKeyHash = function(hash, network) { + var info = Address._transformHash(hash); + return new Address(info.hashBuffer, network, Address.PayToPublicKeyHash); +}; + +/** + * Instantiate an address from a ripemd160 script hash + * + * @param {Buffer} hash - An instance of buffer of the hash + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.fromScriptHash = function(hash, network) { + $.checkArgument(hash, 'hash parameter is required'); + var info = Address._transformHash(hash); + return new Address(info.hashBuffer, network, Address.PayToScriptHash); +}; + +/** + * Builds a p2sh address paying to script. This will hash the script and + * use that to create the address. + * If you want to extract an address associated with a script instead, + * see {{Address#fromScript}} + * + * @param {Script} script - An instance of Script + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.payingTo = function(script, network) { + $.checkArgument(script, 'script is required'); + $.checkArgument(script instanceof Script, 'script must be instance of Script'); + return Address.fromScriptHash(Hash.sha256ripemd160(script.toBuffer()), network); +}; + +/** + * Extract address from a Script. The script must be of one + * of the following types: p2pkh input, p2pkh output, p2sh input + * or p2sh output. + * This will analyze the script and extract address information from it. + * If you want to transform any script to a p2sh Address paying + * to that script's hash instead, use {{Address#payingTo}} + * + * @param {Script} script - An instance of Script + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.fromScript = function(script, network) { + $.checkArgument(script instanceof Script, 'script must be a Script instance'); + var info = Address._transformScript(script, network); + return new Address(info.hashBuffer, network, info.type); +}; + +/** + * Instantiate an address from a buffer of the address + * + * @param {Buffer} buffer - An instance of buffer of the address + * @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet' + * @param {string=} type - The type of address: 'script' or 'pubkey' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.fromBuffer = function(buffer, network, type) { + var info = Address._transformBuffer(buffer, network, type); + return new Address(info.hashBuffer, info.network, info.type); +}; + +/** + * Instantiate an address from an address string + * + * @param {string} str - An string of the bitcoin address + * @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet' + * @param {string=} type - The type of address: 'script' or 'pubkey' + * @returns {Address} A new valid and frozen instance of an Address + */ +Address.fromString = function(str, network, type) { + var info = Address._transformString(str, network, type); + return new Address(info.hashBuffer, info.network, info.type); +}; + +/** + * Instantiate an address from an Object + * + * @param {string} json - An JSON string or Object with keys: hash, network and type + * @returns {Address} A new valid instance of an Address + */ +Address.fromObject = function fromObject(obj) { + $.checkState( + JSUtil.isHexa(obj.hash), + 'Unexpected hash property, "' + obj.hash + '", expected to be hex.' + ); + var hashBuffer = Buffer.from(obj.hash, 'hex'); + return new Address(hashBuffer, obj.network, obj.type); +}; + +/** + * Will return a validation error if exists + * + * @example + * ```javascript + * // a network mismatch error + * var error = Address.getValidationError('15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', 'testnet'); + * ``` + * + * @param {string} data - The encoded data + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @param {string} type - The type of address: 'script' or 'pubkey' + * @returns {null|Error} The corresponding error message + */ +Address.getValidationError = function(data, network, type) { + var error; + try { + /* jshint nonew: false */ + new Address(data, network, type); + } catch (e) { + error = e; + } + return error; +}; + +/** + * Will return a boolean if an address is valid + * + * @example + * ```javascript + * assert(Address.isValid('15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', 'livenet')); + * ``` + * + * @param {string} data - The encoded data + * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet' + * @param {string} type - The type of address: 'script' or 'pubkey' + * @returns {boolean} The corresponding error message + */ +Address.isValid = function(data, network, type) { + return !Address.getValidationError(data, network, type); +}; + +/** + * Returns true if an address is of pay to public key hash type + * @return boolean + */ +Address.prototype.isPayToPublicKeyHash = function() { + return this.type === Address.PayToPublicKeyHash; +}; + +/** + * Returns true if an address is of pay to script hash type + * @return boolean + */ +Address.prototype.isPayToScriptHash = function() { + return this.type === Address.PayToScriptHash; +}; + +/** + * Will return a buffer representation of the address + * + * @returns {Buffer} Bitcoin address buffer + */ +Address.prototype.toBuffer = function() { + var version = Buffer.from([this.network[this.type]]); + return Buffer.concat([version, this.hashBuffer]); +}; + +/** + * @returns {Object} A plain object with the address information + */ +Address.prototype.toObject = Address.prototype.toJSON = function toObject() { + return { + hash: this.hashBuffer.toString('hex'), + type: this.type, + network: this.network.toString() + }; +}; + +/** + * Will return a the string representation of the address + * + * @returns {string} Bitcoin address + */ +Address.prototype.toString = function() { + return Base58Check.encode(this.toBuffer()); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Bitcoin address + */ +Address.prototype.inspect = function() { + return ''; +}; + +module.exports = Address; + +var Script = require('./script'); diff --git a/packages/kauri-bitcore-lib/lib/block/block.js b/packages/kauri-bitcore-lib/lib/block/block.js new file mode 100644 index 0000000..7f0a024 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/block/block.js @@ -0,0 +1,281 @@ +'use strict'; + +var _ = require('lodash'); +var BlockHeader = require('./blockheader'); +var BN = require('../crypto/bn'); +var BufferUtil = require('../util/buffer'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var Transaction = require('../transaction'); +var $ = require('../util/preconditions'); + +/** + * Instantiate a Block from a Buffer, JSON object, or Object with + * the properties of the Block + * + * @param {*} - A Buffer, JSON string, or Object + * @returns {Block} + * @constructor + */ +function Block(arg) { + if (!(this instanceof Block)) { + return new Block(arg); + } + _.extend(this, Block._from(arg)); + return this; +} + +// https://github.com/bitcoin/bitcoin/blob/b5fa132329f0377d787a4a21c1686609c2bfaece/src/primitives/block.h#L14 +Block.MAX_BLOCK_SIZE = 1000000; + +/** + * @param {*} - A Buffer, JSON string or Object + * @returns {Object} - An object representing block data + * @throws {TypeError} - If the argument was not recognized + * @private + */ +Block._from = function _from(arg) { + var info = {}; + if (BufferUtil.isBuffer(arg)) { + info = Block._fromBufferReader(BufferReader(arg)); + } else if (_.isObject(arg)) { + info = Block._fromObject(arg); + } else { + throw new TypeError('Unrecognized argument for Block'); + } + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {Object} - An object representing block data + * @private + */ +Block._fromObject = function _fromObject(data) { + var transactions = []; + data.transactions.forEach(function(tx) { + if (tx instanceof Transaction) { + transactions.push(tx); + } else { + transactions.push(Transaction().fromObject(tx)); + } + }); + var info = { + header: BlockHeader.fromObject(data.header), + transactions: transactions + }; + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {Block} - An instance of block + */ +Block.fromObject = function fromObject(obj) { + var info = Block._fromObject(obj); + return new Block(info); +}; + +/** + * @param {BufferReader} - Block data + * @returns {Object} - An object representing the block data + * @private + */ +Block._fromBufferReader = function _fromBufferReader(br) { + var info = {}; + $.checkState(!br.finished(), 'No block data received'); + info.header = BlockHeader.fromBufferReader(br); + var transactions = br.readVarintNum(); + info.transactions = []; + for (var i = 0; i < transactions; i++) { + info.transactions.push(Transaction().fromBufferReader(br)); + } + return info; +}; + +/** + * @param {BufferReader} - A buffer reader of the block + * @returns {Block} - An instance of block + */ +Block.fromBufferReader = function fromBufferReader(br) { + $.checkArgument(br, 'br is required'); + var info = Block._fromBufferReader(br); + return new Block(info); +}; + +/** + * @param {Buffer} - A buffer of the block + * @returns {Block} - An instance of block + */ +Block.fromBuffer = function fromBuffer(buf) { + return Block.fromBufferReader(new BufferReader(buf)); +}; + +/** + * @param {string} - str - A hex encoded string of the block + * @returns {Block} - A hex encoded string of the block + */ +Block.fromString = function fromString(str) { + var buf = Buffer.from(str, 'hex'); + return Block.fromBuffer(buf); +}; + +/** + * @param {Binary} - Raw block binary data or buffer + * @returns {Block} - An instance of block + */ +Block.fromRawBlock = function fromRawBlock(data) { + if (!BufferUtil.isBuffer(data)) { + data = Buffer.from(data, 'binary'); + } + var br = BufferReader(data); + br.pos = Block.Values.START_OF_BLOCK; + var info = Block._fromBufferReader(br); + return new Block(info); +}; + +/** + * @returns {Object} - A plain object with the block properties + */ +Block.prototype.toObject = Block.prototype.toJSON = function toObject() { + var transactions = []; + this.transactions.forEach(function(tx) { + transactions.push(tx.toObject()); + }); + return { + header: this.header.toObject(), + transactions: transactions + }; +}; + +/** + * @returns {Buffer} - A buffer of the block + */ +Block.prototype.toBuffer = function toBuffer() { + return this.toBufferWriter().concat(); +}; + +/** + * @returns {string} - A hex encoded string of the block + */ +Block.prototype.toString = function toString() { + return this.toBuffer().toString('hex'); +}; + +/** + * @param {BufferWriter} - An existing instance of BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the Block + */ +Block.prototype.toBufferWriter = function toBufferWriter(bw) { + if (!bw) { + bw = new BufferWriter(); + } + bw.write(this.header.toBuffer()); + bw.writeVarintNum(this.transactions.length); + for (var i = 0; i < this.transactions.length; i++) { + this.transactions[i].toBufferWriter(bw); + } + return bw; +}; + +/** + * Will iterate through each transaction and return an array of hashes + * @returns {Array} - An array with transaction hashes + */ +Block.prototype.getTransactionHashes = function getTransactionHashes() { + var hashes = []; + if (this.transactions.length === 0) { + return [Block.Values.NULL_HASH]; + } + for (var t = 0; t < this.transactions.length; t++) { + hashes.push(this.transactions[t]._getHash()); + } + return hashes; +}; + +/** + * Will build a merkle tree of all the transactions, ultimately arriving at + * a single point, the merkle root. + * @link https://en.bitcoin.it/wiki/Protocol_specification#Merkle_Trees + * @returns {Array} - An array with each level of the tree after the other. + */ +Block.prototype.getMerkleTree = function getMerkleTree() { + + var tree = this.getTransactionHashes(); + + var j = 0; + for (var size = this.transactions.length; size > 1; size = Math.floor((size + 1) / 2)) { + for (var i = 0; i < size; i += 2) { + var i2 = Math.min(i + 1, size - 1); + var buf = Buffer.concat([tree[j + i], tree[j + i2]]); + tree.push(Hash.sha256sha256(buf)); + } + j += size; + } + + return tree; +}; + +/** + * Calculates the merkleRoot from the transactions. + * @returns {Buffer} - A buffer of the merkle root hash + */ +Block.prototype.getMerkleRoot = function getMerkleRoot() { + var tree = this.getMerkleTree(); + return tree[tree.length - 1]; +}; + +/** + * Verifies that the transactions in the block match the header merkle root + * @returns {Boolean} - If the merkle roots match + */ +Block.prototype.validMerkleRoot = function validMerkleRoot() { + + var h = new BN(this.header.merkleRoot.toString('hex'), 'hex'); + var c = new BN(this.getMerkleRoot().toString('hex'), 'hex'); + + if (h.cmp(c) !== 0) { + return false; + } + + return true; +}; + +/** + * @returns {Buffer} - The little endian hash buffer of the header + */ +Block.prototype._getHash = function() { + return this.header._getHash(); +}; + +var idProperty = { + configurable: false, + enumerable: true, + /** + * @returns {string} - The big endian hash buffer of the header + */ + get: function() { + if (!this._id) { + this._id = this.header.id; + } + return this._id; + }, + set: _.noop +}; +Object.defineProperty(Block.prototype, 'id', idProperty); +Object.defineProperty(Block.prototype, 'hash', idProperty); + +/** + * @returns {string} - A string formatted for the console + */ +Block.prototype.inspect = function inspect() { + return ''; +}; + +Block.Values = { + START_OF_BLOCK: 8, // Start of block in raw block data + NULL_HASH: Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex') +}; + +module.exports = Block; diff --git a/packages/kauri-bitcore-lib/lib/block/blockheader.js b/packages/kauri-bitcore-lib/lib/block/blockheader.js new file mode 100644 index 0000000..4493122 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/block/blockheader.js @@ -0,0 +1,296 @@ +'use strict'; + +var _ = require('lodash'); +var BN = require('../crypto/bn'); +var BufferUtil = require('../util/buffer'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var JSUtil = require('../util/js'); +var $ = require('../util/preconditions'); + +var GENESIS_BITS = 0x1d00ffff; + +/** + * Instantiate a BlockHeader from a Buffer, JSON object, or Object with + * the properties of the BlockHeader + * + * @param {*} - A Buffer, JSON string, or Object + * @returns {BlockHeader} - An instance of block header + * @constructor + */ +var BlockHeader = function BlockHeader(arg) { + if (!(this instanceof BlockHeader)) { + return new BlockHeader(arg); + } + var info = BlockHeader._from(arg); + this.version = info.version; + this.prevHash = info.prevHash; + this.merkleRoot = info.merkleRoot; + this.time = info.time; + this.timestamp = info.time; + this.bits = info.bits; + this.nonce = info.nonce; + + if (info.hash) { + $.checkState( + this.hash === info.hash, + 'Argument object hash property does not match block hash.' + ); + } + + return this; +}; + +/** + * @param {*} - A Buffer, JSON string or Object + * @returns {Object} - An object representing block header data + * @throws {TypeError} - If the argument was not recognized + * @private + */ +BlockHeader._from = function _from(arg) { + var info = {}; + if (BufferUtil.isBuffer(arg)) { + info = BlockHeader._fromBufferReader(BufferReader(arg)); + } else if (_.isObject(arg)) { + info = BlockHeader._fromObject(arg); + } else { + throw new TypeError('Unrecognized argument for BlockHeader'); + } + return info; +}; + +/** + * @param {Object} - A JSON string + * @returns {Object} - An object representing block header data + * @private + */ +BlockHeader._fromObject = function _fromObject(data) { + $.checkArgument(data, 'data is required'); + var prevHash = data.prevHash; + var merkleRoot = data.merkleRoot; + if (_.isString(data.prevHash)) { + prevHash = BufferUtil.reverse(Buffer.from(data.prevHash, 'hex')); + } + if (_.isString(data.merkleRoot)) { + merkleRoot = BufferUtil.reverse(Buffer.from(data.merkleRoot, 'hex')); + } + var info = { + hash: data.hash, + version: data.version, + prevHash: prevHash, + merkleRoot: merkleRoot, + time: data.time, + timestamp: data.time, + bits: data.bits, + nonce: data.nonce + }; + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromObject = function fromObject(obj) { + var info = BlockHeader._fromObject(obj); + return new BlockHeader(info); +}; + +/** + * @param {Binary} - Raw block binary data or buffer + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromRawBlock = function fromRawBlock(data) { + if (!BufferUtil.isBuffer(data)) { + data = Buffer.from(data, 'binary'); + } + var br = BufferReader(data); + br.pos = BlockHeader.Constants.START_OF_HEADER; + var info = BlockHeader._fromBufferReader(br); + return new BlockHeader(info); +}; + +/** + * @param {Buffer} - A buffer of the block header + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromBuffer = function fromBuffer(buf) { + var info = BlockHeader._fromBufferReader(BufferReader(buf)); + return new BlockHeader(info); +}; + +/** + * @param {string} - A hex encoded buffer of the block header + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromString = function fromString(str) { + var buf = Buffer.from(str, 'hex'); + return BlockHeader.fromBuffer(buf); +}; + +/** + * @param {BufferReader} - A BufferReader of the block header + * @returns {Object} - An object representing block header data + * @private + */ +BlockHeader._fromBufferReader = function _fromBufferReader(br) { + var info = {}; + info.version = br.readInt32LE(); + info.prevHash = br.read(32); + info.merkleRoot = br.read(32); + info.time = br.readUInt32LE(); + info.bits = br.readUInt32LE(); + info.nonce = br.readUInt32LE(); + return info; +}; + +/** + * @param {BufferReader} - A BufferReader of the block header + * @returns {BlockHeader} - An instance of block header + */ +BlockHeader.fromBufferReader = function fromBufferReader(br) { + var info = BlockHeader._fromBufferReader(br); + return new BlockHeader(info); +}; + +/** + * @returns {Object} - A plain object of the BlockHeader + */ +BlockHeader.prototype.toObject = BlockHeader.prototype.toJSON = function toObject() { + return { + hash: this.hash, + version: this.version, + prevHash: BufferUtil.reverse(this.prevHash).toString('hex'), + merkleRoot: BufferUtil.reverse(this.merkleRoot).toString('hex'), + time: this.time, + bits: this.bits, + nonce: this.nonce + }; +}; + +/** + * @returns {Buffer} - A Buffer of the BlockHeader + */ +BlockHeader.prototype.toBuffer = function toBuffer() { + return this.toBufferWriter().concat(); +}; + +/** + * @returns {string} - A hex encoded string of the BlockHeader + */ +BlockHeader.prototype.toString = function toString() { + return this.toBuffer().toString('hex'); +}; + +/** + * @param {BufferWriter} - An existing instance BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the BlockHeader + */ +BlockHeader.prototype.toBufferWriter = function toBufferWriter(bw) { + if (!bw) { + bw = new BufferWriter(); + } + bw.writeInt32LE(this.version); + bw.write(this.prevHash); + bw.write(this.merkleRoot); + bw.writeUInt32LE(this.time); + bw.writeUInt32LE(this.bits); + bw.writeUInt32LE(this.nonce); + return bw; +}; + +/** + * Returns the target difficulty for this block + * @param {Number} bits + * @returns {BN} An instance of BN with the decoded difficulty bits + */ +BlockHeader.prototype.getTargetDifficulty = function getTargetDifficulty(bits) { + bits = bits || this.bits; + + var target = new BN(bits & 0xffffff); + var mov = 8 * ((bits >>> 24) - 3); + while (mov-- > 0) { + target = target.mul(new BN(2)); + } + return target; +}; + +/** + * @link https://en.bitcoin.it/wiki/Difficulty + * @return {Number} + */ +BlockHeader.prototype.getDifficulty = function getDifficulty() { + var difficulty1TargetBN = this.getTargetDifficulty(GENESIS_BITS).mul(new BN(Math.pow(10, 8))); + var currentTargetBN = this.getTargetDifficulty(); + + var difficultyString = difficulty1TargetBN.div(currentTargetBN).toString(10); + var decimalPos = difficultyString.length - 8; + difficultyString = difficultyString.slice(0, decimalPos) + '.' + difficultyString.slice(decimalPos); + + return parseFloat(difficultyString); +}; + +/** + * @returns {Buffer} - The little endian hash buffer of the header + */ +BlockHeader.prototype._getHash = function hash() { + var buf = this.toBuffer(); + return Hash.sha256sha256(buf); +}; + +var idProperty = { + configurable: false, + enumerable: true, + /** + * @returns {string} - The big endian hash buffer of the header + */ + get: function() { + if (!this._id) { + this._id = BufferReader(this._getHash()).readReverse().toString('hex'); + } + return this._id; + }, + set: _.noop +}; +Object.defineProperty(BlockHeader.prototype, 'id', idProperty); +Object.defineProperty(BlockHeader.prototype, 'hash', idProperty); + +/** + * @returns {Boolean} - If timestamp is not too far in the future + */ +BlockHeader.prototype.validTimestamp = function validTimestamp() { + var currentTime = Math.round(new Date().getTime() / 1000); + if (this.time > currentTime + BlockHeader.Constants.MAX_TIME_OFFSET) { + return false; + } + return true; +}; + +/** + * @returns {Boolean} - If the proof-of-work hash satisfies the target difficulty + */ +BlockHeader.prototype.validProofOfWork = function validProofOfWork() { + var pow = new BN(this.id, 'hex'); + var target = this.getTargetDifficulty(); + + if (pow.cmp(target) > 0) { + return false; + } + return true; +}; + +/** + * @returns {string} - A string formatted for the console + */ +BlockHeader.prototype.inspect = function inspect() { + return ''; +}; + +BlockHeader.Constants = { + START_OF_HEADER: 8, // Start buffer position in raw block data + MAX_TIME_OFFSET: 2 * 60 * 60, // The max a timestamp can be in the future + LARGEST_HASH: new BN('10000000000000000000000000000000000000000000000000000000000000000', 'hex') +}; + +module.exports = BlockHeader; diff --git a/packages/kauri-bitcore-lib/lib/block/index.js b/packages/kauri-bitcore-lib/lib/block/index.js new file mode 100644 index 0000000..d519131 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/block/index.js @@ -0,0 +1,4 @@ +module.exports = require('./block'); + +module.exports.BlockHeader = require('./blockheader'); +module.exports.MerkleBlock = require('./merkleblock'); diff --git a/packages/kauri-bitcore-lib/lib/block/merkleblock.js b/packages/kauri-bitcore-lib/lib/block/merkleblock.js new file mode 100644 index 0000000..1b949c3 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/block/merkleblock.js @@ -0,0 +1,313 @@ +'use strict'; + +var _ = require('lodash'); +var BlockHeader = require('./blockheader'); +var BufferUtil = require('../util/buffer'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var JSUtil = require('../util/js'); +var Transaction = require('../transaction'); +var errors = require('../errors'); +var $ = require('../util/preconditions'); + +/** + * Instantiate a MerkleBlock from a Buffer, JSON object, or Object with + * the properties of the Block + * + * @param {*} - A Buffer, JSON string, or Object representing a MerkleBlock + * @returns {MerkleBlock} + * @constructor + */ +function MerkleBlock(arg) { + /* jshint maxstatements: 18 */ + + if (!(this instanceof MerkleBlock)) { + return new MerkleBlock(arg); + } + + var info = {}; + if (BufferUtil.isBuffer(arg)) { + info = MerkleBlock._fromBufferReader(BufferReader(arg)); + } else if (_.isObject(arg)) { + var header; + if(arg.header instanceof BlockHeader) { + header = arg.header; + } else { + header = BlockHeader.fromObject(arg.header); + } + info = { + /** + * @name MerkleBlock#header + * @type {BlockHeader} + */ + header: header, + /** + * @name MerkleBlock#numTransactions + * @type {Number} + */ + numTransactions: arg.numTransactions, + /** + * @name MerkleBlock#hashes + * @type {String[]} + */ + hashes: arg.hashes, + /** + * @name MerkleBlock#flags + * @type {Number[]} + */ + flags: arg.flags + }; + } else { + throw new TypeError('Unrecognized argument for MerkleBlock'); + } + _.extend(this,info); + this._flagBitsUsed = 0; + this._hashesUsed = 0; + + return this; +} + +/** + * @param {Buffer} - MerkleBlock data in a Buffer object + * @returns {MerkleBlock} - A MerkleBlock object + */ +MerkleBlock.fromBuffer = function fromBuffer(buf) { + return MerkleBlock.fromBufferReader(BufferReader(buf)); +}; + +/** + * @param {BufferReader} - MerkleBlock data in a BufferReader object + * @returns {MerkleBlock} - A MerkleBlock object + */ +MerkleBlock.fromBufferReader = function fromBufferReader(br) { + return new MerkleBlock(MerkleBlock._fromBufferReader(br)); +}; + +/** + * @returns {Buffer} - A buffer of the block + */ +MerkleBlock.prototype.toBuffer = function toBuffer() { + return this.toBufferWriter().concat(); +}; + +/** + * @param {BufferWriter} - An existing instance of BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the MerkleBlock + */ +MerkleBlock.prototype.toBufferWriter = function toBufferWriter(bw) { + if (!bw) { + bw = new BufferWriter(); + } + bw.write(this.header.toBuffer()); + bw.writeUInt32LE(this.numTransactions); + bw.writeVarintNum(this.hashes.length); + for (var i = 0; i < this.hashes.length; i++) { + bw.write(Buffer.from(this.hashes[i], 'hex')); + } + bw.writeVarintNum(this.flags.length); + for (i = 0; i < this.flags.length; i++) { + bw.writeUInt8(this.flags[i]); + } + return bw; +}; + +/** + * @returns {Object} - A plain object with the MerkleBlock properties + */ +MerkleBlock.prototype.toObject = MerkleBlock.prototype.toJSON = function toObject() { + return { + header: this.header.toObject(), + numTransactions: this.numTransactions, + hashes: this.hashes, + flags: this.flags + }; +}; + +/** + * Verify that the MerkleBlock is valid + * @returns {Boolean} - True/False whether this MerkleBlock is Valid + */ +MerkleBlock.prototype.validMerkleTree = function validMerkleTree() { + $.checkState(_.isArray(this.flags), 'MerkleBlock flags is not an array'); + $.checkState(_.isArray(this.hashes), 'MerkleBlock hashes is not an array'); + + // Can't have more hashes than numTransactions + if(this.hashes.length > this.numTransactions) { + return false; + } + + // Can't have more flag bits than num hashes + if(this.flags.length * 8 < this.hashes.length) { + return false; + } + + var height = this._calcTreeHeight(); + var opts = { hashesUsed: 0, flagBitsUsed: 0 }; + var root = this._traverseMerkleTree(height, 0, opts); + if(opts.hashesUsed !== this.hashes.length) { + return false; + } + return BufferUtil.equals(root, this.header.merkleRoot); +}; + +/** + * Return a list of all the txs hash that match the filter + * @returns {Array} - txs hash that match the filter + */ +MerkleBlock.prototype.filterdTxsHash = function filterdTxsHash() { + $.checkState(_.isArray(this.flags), 'MerkleBlock flags is not an array'); + $.checkState(_.isArray(this.hashes), 'MerkleBlock hashes is not an array'); + + // Can't have more hashes than numTransactions + if(this.hashes.length > this.numTransactions) { + throw new errors.MerkleBlock.InvalidMerkleTree(); + } + + // Can't have more flag bits than num hashes + if(this.flags.length * 8 < this.hashes.length) { + throw new errors.MerkleBlock.InvalidMerkleTree(); + } + + // If there is only one hash the filter do not match any txs in the block + if(this.hashes.length === 1) { + return []; + }; + + var height = this._calcTreeHeight(); + var opts = { hashesUsed: 0, flagBitsUsed: 0 }; + var txs = this._traverseMerkleTree(height, 0, opts, true); + if(opts.hashesUsed !== this.hashes.length) { + throw new errors.MerkleBlock.InvalidMerkleTree(); + } + return txs; +}; + +/** + * Traverse a the tree in this MerkleBlock, validating it along the way + * Modeled after Bitcoin Core merkleblock.cpp TraverseAndExtract() + * @param {Number} - depth - Current height + * @param {Number} - pos - Current position in the tree + * @param {Object} - opts - Object with values that need to be mutated throughout the traversal + * @param {Boolean} - checkForTxs - if true return opts.txs else return the Merkle Hash + * @param {Number} - opts.flagBitsUsed - Number of flag bits used, should start at 0 + * @param {Number} - opts.hashesUsed - Number of hashes used, should start at 0 + * @param {Array} - opts.txs - Will finish populated by transactions found during traversal that match the filter + * @returns {Buffer|null} - Buffer containing the Merkle Hash for that height + * @returns {Array} - transactions found during traversal that match the filter + * @private + */ +MerkleBlock.prototype._traverseMerkleTree = function traverseMerkleTree(depth, pos, opts, checkForTxs) { + /* jshint maxcomplexity: 12*/ + /* jshint maxstatements: 20 */ + + opts = opts || {}; + opts.txs = opts.txs || []; + opts.flagBitsUsed = opts.flagBitsUsed || 0; + opts.hashesUsed = opts.hashesUsed || 0; + var checkForTxs = checkForTxs || false; + + if(opts.flagBitsUsed > this.flags.length * 8) { + return null; + } + var isParentOfMatch = (this.flags[opts.flagBitsUsed >> 3] >>> (opts.flagBitsUsed++ & 7)) & 1; + if(depth === 0 || !isParentOfMatch) { + if(opts.hashesUsed >= this.hashes.length) { + return null; + } + var hash = this.hashes[opts.hashesUsed++]; + if(depth === 0 && isParentOfMatch) { + opts.txs.push(hash); + } + return Buffer.from(hash, 'hex'); + } else { + var left = this._traverseMerkleTree(depth-1, pos*2, opts); + var right = left; + if(pos*2+1 < this._calcTreeWidth(depth-1)) { + right = this._traverseMerkleTree(depth-1, pos*2+1, opts); + } + if (checkForTxs){ + return opts.txs; + } else { + return Hash.sha256sha256(new Buffer.concat([left, right])); + }; + } +}; + +/** Calculates the width of a merkle tree at a given height. + * Modeled after Bitcoin Core merkleblock.h CalcTreeWidth() + * @param {Number} - Height at which we want the tree width + * @returns {Number} - Width of the tree at a given height + * @private + */ +MerkleBlock.prototype._calcTreeWidth = function calcTreeWidth(height) { + return (this.numTransactions + (1 << height) - 1) >> height; +}; + +/** Calculates the height of the merkle tree in this MerkleBlock + * @param {Number} - Height at which we want the tree width + * @returns {Number} - Height of the merkle tree in this MerkleBlock + * @private + */ +MerkleBlock.prototype._calcTreeHeight = function calcTreeHeight() { + var height = 0; + while (this._calcTreeWidth(height) > 1) { + height++; + } + return height; +}; + +/** + * @param {Transaction|String} - Transaction or Transaction ID Hash + * @returns {Boolean} - return true/false if this MerkleBlock has the TX or not + * @private + */ +MerkleBlock.prototype.hasTransaction = function hasTransaction(tx) { + $.checkArgument(!_.isUndefined(tx), 'tx cannot be undefined'); + $.checkArgument(tx instanceof Transaction || typeof tx === 'string', + 'Invalid tx given, tx must be a "string" or "Transaction"'); + + var hash = tx; + if(tx instanceof Transaction) { + // We need to reverse the id hash for the lookup + hash = BufferUtil.reverse(Buffer.from(tx.id, 'hex')).toString('hex'); + } + + var txs = []; + var height = this._calcTreeHeight(); + this._traverseMerkleTree(height, 0, { txs: txs }); + return txs.indexOf(hash) !== -1; +}; + +/** + * @param {Buffer} - MerkleBlock data + * @returns {Object} - An Object representing merkleblock data + * @private + */ +MerkleBlock._fromBufferReader = function _fromBufferReader(br) { + $.checkState(!br.finished(), 'No merkleblock data received'); + var info = {}; + info.header = BlockHeader.fromBufferReader(br); + info.numTransactions = br.readUInt32LE(); + var numHashes = br.readVarintNum(); + info.hashes = []; + for (var i = 0; i < numHashes; i++) { + info.hashes.push(br.read(32).toString('hex')); + } + var numFlags = br.readVarintNum(); + info.flags = []; + for (i = 0; i < numFlags; i++) { + info.flags.push(br.readUInt8()); + } + return info; +}; + +/** + * @param {Object} - A plain JavaScript object + * @returns {Block} - An instance of block + */ +MerkleBlock.fromObject = function fromObject(obj) { + return new MerkleBlock(obj); +}; + +module.exports = MerkleBlock; diff --git a/packages/kauri-bitcore-lib/lib/crypto/bn.js b/packages/kauri-bitcore-lib/lib/crypto/bn.js new file mode 100644 index 0000000..6136de0 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/crypto/bn.js @@ -0,0 +1,202 @@ +'use strict'; + +var BN = require('bn.js'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); + +var reversebuf = function(buf) { + var buf2 = Buffer.alloc(buf.length); + for (var i = 0; i < buf.length; i++) { + buf2[i] = buf[buf.length - 1 - i]; + } + return buf2; +}; + +BN.Zero = new BN(0); +BN.One = new BN(1); +BN.Minus1 = new BN(-1); + +BN.fromNumber = function(n) { + $.checkArgument(_.isNumber(n)); + return new BN(n); +}; + +BN.fromString = function(str, base) { + $.checkArgument(_.isString(str)); + return new BN(str, base); +}; + +BN.fromBuffer = function(buf, opts) { + if (typeof opts !== 'undefined' && opts.endian === 'little') { + buf = reversebuf(buf); + } + var hex = buf.toString('hex'); + var bn = new BN(hex, 16); + return bn; +}; + +/** + * Instantiate a BigNumber from a "signed magnitude buffer" + * (a buffer where the most significant bit represents the sign (0 = positive, -1 = negative)) + */ +BN.fromSM = function(buf, opts) { + var ret; + if (buf.length === 0) { + return BN.fromBuffer(Buffer.from([0])); + } + + var endian = 'big'; + if (opts) { + endian = opts.endian; + } + if (endian === 'little') { + buf = reversebuf(buf); + } + + if (buf[0] & 0x80) { + buf[0] = buf[0] & 0x7f; + ret = BN.fromBuffer(buf); + ret.neg().copy(ret); + } else { + ret = BN.fromBuffer(buf); + } + return ret; +}; + + +BN.prototype.toNumber = function() { + return parseInt(this.toString(10), 10); +}; + +BN.prototype.toBuffer = function(opts) { + var buf, hex; + if (opts && opts.size) { + hex = this.toString(16, 2); + var natlen = hex.length / 2; + buf = Buffer.from(hex, 'hex'); + + if (natlen === opts.size) { + buf = buf; + } else if (natlen > opts.size) { + buf = BN.trim(buf, natlen); + } else if (natlen < opts.size) { + buf = BN.pad(buf, natlen, opts.size); + } + } else { + hex = this.toString(16, 2); + buf = Buffer.from(hex, 'hex'); + } + + if (typeof opts !== 'undefined' && opts.endian === 'little') { + buf = reversebuf(buf); + } + + return buf; +}; + +BN.prototype.toSMBigEndian = function() { + var buf; + if (this.cmp(BN.Zero) === -1) { + buf = this.neg().toBuffer(); + if (buf[0] & 0x80) { + buf = Buffer.concat([Buffer.from([0x80]), buf]); + } else { + buf[0] = buf[0] | 0x80; + } + } else { + buf = this.toBuffer(); + if (buf[0] & 0x80) { + buf = Buffer.concat([Buffer.from([0x00]), buf]); + } + } + + if (buf.length === 1 & buf[0] === 0) { + buf = Buffer.from([]); + } + return buf; +}; + +BN.prototype.toSM = function(opts) { + var endian = opts ? opts.endian : 'big'; + var buf = this.toSMBigEndian(); + + if (endian === 'little') { + buf = reversebuf(buf); + } + return buf; +}; + +/** + * Create a BN from a "ScriptNum": + * This is analogous to the constructor for CScriptNum in bitcoind. Many ops in + * bitcoind's script interpreter use CScriptNum, which is not really a proper + * bignum. Instead, an error is thrown if trying to input a number bigger than + * 4 bytes. We copy that behavior here. A third argument, `size`, is provided to + * extend the hard limit of 4 bytes, as some usages require more than 4 bytes. + */ +BN.fromScriptNumBuffer = function(buf, fRequireMinimal, size) { + var nMaxNumSize = size || 4; + $.checkArgument(buf.length <= nMaxNumSize, new Error('script number overflow')); + if (fRequireMinimal && buf.length > 0) { + // Check that the number is encoded with the minimum possible + // number of bytes. + // + // If the most-significant-byte - excluding the sign bit - is zero + // then we're not minimal. Note how this test also rejects the + // negative-zero encoding, 0x80. + if ((buf[buf.length - 1] & 0x7f) === 0) { + // One exception: if there's more than one byte and the most + // significant bit of the second-most-significant-byte is set + // it would conflict with the sign bit. An example of this case + // is +-255, which encode to 0xff00 and 0xff80 respectively. + // (big-endian). + if (buf.length <= 1 || (buf[buf.length - 2] & 0x80) === 0) { + throw new Error('non-minimally encoded script number'); + } + } + } + return BN.fromSM(buf, { + endian: 'little' + }); +}; + +/** + * The corollary to the above, with the notable exception that we do not throw + * an error if the output is larger than four bytes. (Which can happen if + * performing a numerical operation that results in an overflow to more than 4 + * bytes). + */ +BN.prototype.toScriptNumBuffer = function() { + return this.toSM({ + endian: 'little' + }); +}; + +BN.prototype.gt = function(b) { + return this.cmp(b) > 0; +}; + +BN.prototype.gte = function(b) { + return this.cmp(b) >= 0; +}; + +BN.prototype.lt = function(b) { + return this.cmp(b) < 0; +}; + +BN.trim = function(buf, natlen) { + return buf.slice(natlen - buf.length, buf.length); +}; + +BN.pad = function(buf, natlen, size) { + var rbuf = Buffer.alloc(size); + for (var i = 0; i < buf.length; i++) { + rbuf[rbuf.length - 1 - i] = buf[buf.length - 1 - i]; + } + for (i = 0; i < size - natlen; i++) { + rbuf[i] = 0; + } + return rbuf; +}; + +module.exports = BN; diff --git a/packages/kauri-bitcore-lib/lib/crypto/ecdsa.js b/packages/kauri-bitcore-lib/lib/crypto/ecdsa.js new file mode 100644 index 0000000..6bea796 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/crypto/ecdsa.js @@ -0,0 +1,296 @@ +'use strict'; + +var BN = require('./bn'); +var Point = require('./point'); +var Signature = require('./signature'); +var PublicKey = require('../publickey'); +var Random = require('./random'); +var Hash = require('./hash'); +var BufferUtil = require('../util/buffer'); +var _ = require('lodash'); +var $ = require('../util/preconditions'); + +var ECDSA = function ECDSA(obj) { + if (!(this instanceof ECDSA)) { + return new ECDSA(obj); + } + if (obj) { + this.set(obj); + } +}; + +/* jshint maxcomplexity: 9 */ +ECDSA.prototype.set = function(obj) { + this.hashbuf = obj.hashbuf || this.hashbuf; + this.endian = obj.endian || this.endian; //the endianness of hashbuf + this.privkey = obj.privkey || this.privkey; + this.pubkey = obj.pubkey || (this.privkey ? this.privkey.publicKey : this.pubkey); + this.sig = obj.sig || this.sig; + this.k = obj.k || this.k; + this.verified = obj.verified || this.verified; + return this; +}; + +ECDSA.prototype.privkey2pubkey = function() { + this.pubkey = this.privkey.toPublicKey(); +}; + +ECDSA.prototype.calci = function() { + for (var i = 0; i < 4; i++) { + this.sig.i = i; + var Qprime; + try { + Qprime = this.toPublicKey(); + } catch (e) { + console.error(e); + continue; + } + + if (Qprime.point.eq(this.pubkey.point)) { + this.sig.compressed = this.pubkey.compressed; + return this; + } + } + + this.sig.i = undefined; + throw new Error('Unable to find valid recovery factor'); +}; + +ECDSA.fromString = function(str) { + var obj = JSON.parse(str); + return new ECDSA(obj); +}; + +ECDSA.prototype.randomK = function() { + var N = Point.getN(); + var k; + do { + k = BN.fromBuffer(Random.getRandomBuffer(32)); + } while (!(k.lt(N) && k.gt(BN.Zero))); + this.k = k; + return this; +}; + + +// https://tools.ietf.org/html/rfc6979#section-3.2 +ECDSA.prototype.deterministicK = function(badrs) { + /* jshint maxstatements: 25 */ + // if r or s were invalid when this function was used in signing, + // we do not want to actually compute r, s here for efficiency, so, + // we can increment badrs. explained at end of RFC 6979 section 3.2 + if (_.isUndefined(badrs)) { + badrs = 0; + } + var v = Buffer.alloc(32); + v.fill(0x01); + var k = Buffer.alloc(32); + k.fill(0x00); + var x = this.privkey.bn.toBuffer({ + size: 32 + }); + var hashbuf = this.endian === 'little' ? BufferUtil.reverse(this.hashbuf) : this.hashbuf + k = Hash.sha256hmac(Buffer.concat([v, Buffer.from([0x00]), x, hashbuf]), k); + v = Hash.sha256hmac(v, k); + k = Hash.sha256hmac(Buffer.concat([v, Buffer.from([0x01]), x, hashbuf]), k); + v = Hash.sha256hmac(v, k); + v = Hash.sha256hmac(v, k); + var T = BN.fromBuffer(v); + var N = Point.getN(); + + // also explained in 3.2, we must ensure T is in the proper range (0, N) + for (var i = 0; i < badrs || !(T.lt(N) && T.gt(BN.Zero)); i++) { + k = Hash.sha256hmac(Buffer.concat([v, Buffer.from([0x00])]), k); + v = Hash.sha256hmac(v, k); + v = Hash.sha256hmac(v, k); + T = BN.fromBuffer(v); + } + + this.k = T; + return this; +}; + +// Information about public key recovery: +// https://bitcointalk.org/index.php?topic=6430.0 +// http://stackoverflow.com/questions/19665491/how-do-i-get-an-ecdsa-public-key-from-just-a-bitcoin-signature-sec1-4-1-6-k +ECDSA.prototype.toPublicKey = function() { + /* jshint maxstatements: 25 */ + var i = this.sig.i; + $.checkArgument(i === 0 || i === 1 || i === 2 || i === 3, new Error('i must be equal to 0, 1, 2, or 3')); + + var e = BN.fromBuffer(this.hashbuf); + var r = this.sig.r; + var s = this.sig.s; + + // A set LSB signifies that the y-coordinate is odd + var isYOdd = i & 1; + + // The more significant bit specifies whether we should use the + // first or second candidate key. + var isSecondKey = i >> 1; + + var n = Point.getN(); + var G = Point.getG(); + + // 1.1 Let x = r + jn + var x = isSecondKey ? r.add(n) : r; + var R = Point.fromX(isYOdd, x); + + // 1.4 Check that nR is at infinity + var nR = R.mul(n); + + if (!nR.isInfinity()) { + throw new Error('nR is not a valid curve point'); + } + + // Compute -e from e + var eNeg = e.neg().umod(n); + + // 1.6.1 Compute Q = r^-1 (sR - eG) + // Q = r^-1 (sR + -eG) + var rInv = r.invm(n); + + //var Q = R.multiplyTwo(s, G, eNeg).mul(rInv); + var Q = R.mul(s).add(G.mul(eNeg)).mul(rInv); + + var pubkey = PublicKey.fromPoint(Q, this.sig.compressed); + + return pubkey; +}; + +ECDSA.prototype.sigError = function() { + /* jshint maxstatements: 25 */ + if (!BufferUtil.isBuffer(this.hashbuf) || this.hashbuf.length !== 32) { + return 'hashbuf must be a 32 byte buffer'; + } + + var r = this.sig.r; + var s = this.sig.s; + if (!(r.gt(BN.Zero) && r.lt(Point.getN())) || !(s.gt(BN.Zero) && s.lt(Point.getN()))) { + return 'r and s not in range'; + } + + var e = BN.fromBuffer(this.hashbuf, this.endian ? { + endian: this.endian + } : undefined); + var n = Point.getN(); + var sinv = s.invm(n); + var u1 = sinv.mul(e).umod(n); + var u2 = sinv.mul(r).umod(n); + + var p = Point.getG().mulAdd(u1, this.pubkey.point, u2); + if (p.isInfinity()) { + return 'p is infinity'; + } + + if (p.getX().umod(n).cmp(r) !== 0) { + return 'Invalid signature'; + } else { + return false; + } +}; + +ECDSA.toLowS = function(s) { + //enforce low s + //see BIP 62, "low S values in signatures" + if (s.gt(BN.fromBuffer(Buffer.from('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex')))) { + s = Point.getN().sub(s); + } + return s; +}; + +ECDSA.prototype._findSignature = function(d, e) { + var N = Point.getN(); + var G = Point.getG(); + // try different values of k until r, s are valid + var badrs = 0; + var k, Q, r, s; + do { + if (!this.k || badrs > 0) { + this.deterministicK(badrs); + } + badrs++; + k = this.k; + Q = G.mul(k); + r = Q.x.umod(N); + s = k.invm(N).mul(e.add(d.mul(r))).umod(N); + } while (r.cmp(BN.Zero) <= 0 || s.cmp(BN.Zero) <= 0); + + s = ECDSA.toLowS(s); + return { + s: s, + r: r + }; + +}; + +ECDSA.prototype.sign = function() { + var hashbuf = this.hashbuf; + var privkey = this.privkey; + var d = privkey.bn; + + $.checkState(hashbuf && privkey && d, new Error('invalid parameters')); + $.checkState(BufferUtil.isBuffer(hashbuf) && hashbuf.length === 32, new Error('hashbuf must be a 32 byte buffer')); + + var e = BN.fromBuffer(hashbuf, this.endian ? { + endian: this.endian + } : undefined); + + var obj = this._findSignature(d, e); + obj.compressed = this.pubkey.compressed; + + this.sig = new Signature(obj); + return this; +}; + +ECDSA.prototype.signRandomK = function() { + this.randomK(); + return this.sign(); +}; + +ECDSA.prototype.toString = function() { + var obj = {}; + if (this.hashbuf) { + obj.hashbuf = this.hashbuf.toString('hex'); + } + if (this.privkey) { + obj.privkey = this.privkey.toString(); + } + if (this.pubkey) { + obj.pubkey = this.pubkey.toString(); + } + if (this.sig) { + obj.sig = this.sig.toString(); + } + if (this.k) { + obj.k = this.k.toString(); + } + return JSON.stringify(obj); +}; + +ECDSA.prototype.verify = function() { + if (!this.sigError()) { + this.verified = true; + } else { + this.verified = false; + } + return this; +}; + +ECDSA.sign = function(hashbuf, privkey, endian) { + return ECDSA().set({ + hashbuf: hashbuf, + endian: endian, + privkey: privkey + }).sign().sig; +}; + +ECDSA.verify = function(hashbuf, sig, pubkey, endian) { + return ECDSA().set({ + hashbuf: hashbuf, + endian: endian, + sig: sig, + pubkey: pubkey + }).verify().verified; +}; + +module.exports = ECDSA; diff --git a/packages/kauri-bitcore-lib/lib/crypto/hash.js b/packages/kauri-bitcore-lib/lib/crypto/hash.js new file mode 100644 index 0000000..189e8f3 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/crypto/hash.js @@ -0,0 +1,85 @@ +'use strict'; + +var crypto = require('crypto'); +var BufferUtil = require('../util/buffer'); +var $ = require('../util/preconditions'); + +var Hash = module.exports; + +Hash.sha1 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('sha1').update(buf).digest(); +}; + +Hash.sha1.blocksize = 512; + +Hash.sha256 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('sha256').update(buf).digest(); +}; + +Hash.sha256.blocksize = 512; + +Hash.sha256sha256 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return Hash.sha256(Hash.sha256(buf)); +}; + +Hash.ripemd160 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('ripemd160').update(buf).digest(); +}; + +Hash.sha256ripemd160 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return Hash.ripemd160(Hash.sha256(buf)); +}; + +Hash.sha512 = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return crypto.createHash('sha512').update(buf).digest(); +}; + +Hash.sha512.blocksize = 1024; + +Hash.hmac = function(hashf, data, key) { + //http://en.wikipedia.org/wiki/Hash-based_message_authentication_code + //http://tools.ietf.org/html/rfc4868#section-2 + $.checkArgument(BufferUtil.isBuffer(data)); + $.checkArgument(BufferUtil.isBuffer(key)); + $.checkArgument(hashf.blocksize); + + var blocksize = hashf.blocksize / 8; + + if (key.length > blocksize) { + key = hashf(key); + } else if (key < blocksize) { + var fill = Buffer.alloc(blocksize); + fill.fill(0); + key.copy(fill); + key = fill; + } + + var o_key = Buffer.alloc(blocksize); + o_key.fill(0x5c); + + var i_key = Buffer.alloc(blocksize); + i_key.fill(0x36); + + var o_key_pad = Buffer.alloc(blocksize); + var i_key_pad = Buffer.alloc(blocksize); + for (var i = 0; i < blocksize; i++) { + o_key_pad[i] = o_key[i] ^ key[i]; + i_key_pad[i] = i_key[i] ^ key[i]; + } + + return hashf(Buffer.concat([o_key_pad, hashf(Buffer.concat([i_key_pad, data]))])); +}; + +Hash.sha256hmac = function(data, key) { + return Hash.hmac(Hash.sha256, data, key); +}; + +Hash.sha512hmac = function(data, key) { + return Hash.hmac(Hash.sha512, data, key); +}; diff --git a/packages/kauri-bitcore-lib/lib/crypto/point.js b/packages/kauri-bitcore-lib/lib/crypto/point.js new file mode 100644 index 0000000..6046ed3 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/crypto/point.js @@ -0,0 +1,150 @@ +'use strict'; + +var BN = require('./bn'); +var BufferUtil = require('../util/buffer'); + +var EC = require('elliptic').ec; +var ec = new EC('secp256k1'); +var ecPoint = ec.curve.point.bind(ec.curve); +var ecPointFromX = ec.curve.pointFromX.bind(ec.curve); + +/** + * + * Instantiate a valid secp256k1 Point from the X and Y coordinates. + * + * @param {BN|String} x - The X coordinate + * @param {BN|String} y - The Y coordinate + * @link https://github.com/indutny/elliptic + * @augments elliptic.curve.point + * @throws {Error} A validation error if exists + * @returns {Point} An instance of Point + * @constructor + */ +var Point = function Point(x, y, isRed) { + try { + var point = ecPoint(x, y, isRed); + } catch (e) { + throw new Error('Invalid Point'); + } + point.validate(); + return point; +}; + +Point.prototype = Object.getPrototypeOf(ec.curve.point()); + +/** + * + * Instantiate a valid secp256k1 Point from only the X coordinate + * + * @param {boolean} odd - If the Y coordinate is odd + * @param {BN|String} x - The X coordinate + * @throws {Error} A validation error if exists + * @returns {Point} An instance of Point + */ +Point.fromX = function fromX(odd, x){ + try { + var point = ecPointFromX(x, odd); + } catch (e) { + throw new Error('Invalid X'); + } + point.validate(); + return point; +}; + +/** + * + * Will return a secp256k1 ECDSA base point. + * + * @link https://en.bitcoin.it/wiki/Secp256k1 + * @returns {Point} An instance of the base point. + */ +Point.getG = function getG() { + return ec.curve.g; +}; + +/** + * + * Will return the max of range of valid private keys as governed by the secp256k1 ECDSA standard. + * + * @link https://en.bitcoin.it/wiki/Private_key#Range_of_valid_ECDSA_private_keys + * @returns {BN} A BN instance of the number of points on the curve + */ +Point.getN = function getN() { + return new BN(ec.curve.n.toArray()); +}; + +Point.prototype._getX = Point.prototype.getX; + +/** + * + * Will return the X coordinate of the Point + * + * @returns {BN} A BN instance of the X coordinate + */ +Point.prototype.getX = function getX() { + return new BN(this._getX().toArray()); +}; + +Point.prototype._getY = Point.prototype.getY; + +/** + * + * Will return the Y coordinate of the Point + * + * @returns {BN} A BN instance of the Y coordinate + */ +Point.prototype.getY = function getY() { + return new BN(this._getY().toArray()); +}; + +/** + * + * Will determine if the point is valid + * + * @link https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf + * @param {Point} An instance of Point + * @throws {Error} A validation error if exists + * @returns {Point} An instance of the same Point + */ +Point.prototype.validate = function validate() { + + if (this.isInfinity()){ + throw new Error('Point cannot be equal to Infinity'); + } + + var p2; + try { + p2 = ecPointFromX(this.getX(), this.getY().isOdd()); + } catch (e) { + throw new Error('Point does not lie on the curve'); + } + + if (p2.y.cmp(this.y) !== 0) { + throw new Error('Invalid y value for curve.'); + } + + + //todo: needs test case + if (!(this.mul(Point.getN()).isInfinity())) { + throw new Error('Point times N must be infinity'); + } + + return this; + +}; + +Point.pointToCompressed = function pointToCompressed(point) { + var xbuf = point.getX().toBuffer({size: 32}); + var ybuf = point.getY().toBuffer({size: 32}); + + var prefix; + var odd = ybuf[ybuf.length - 1] % 2; + if (odd) { + prefix = Buffer.from([0x03]); + } else { + prefix = Buffer.from([0x02]); + } + return BufferUtil.concat([prefix, xbuf]); +}; + +module.exports = Point; diff --git a/packages/kauri-bitcore-lib/lib/crypto/random.js b/packages/kauri-bitcore-lib/lib/crypto/random.js new file mode 100644 index 0000000..9938b37 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/crypto/random.js @@ -0,0 +1,57 @@ +'use strict'; + +function Random() { +} + +/* secure random bytes that sometimes throws an error due to lack of entropy */ +Random.getRandomBuffer = function(size) { + if (process.browser) + return Random.getRandomBufferBrowser(size); + else + return Random.getRandomBufferNode(size); +}; + +Random.getRandomBufferNode = function(size) { + var crypto = require('crypto'); + return crypto.randomBytes(size); +}; + +Random.getRandomBufferBrowser = function(size) { + if (!window.crypto && !window.msCrypto) + throw new Error('window.crypto not available'); + + if (window.crypto && window.crypto.getRandomValues) + var crypto = window.crypto; + else if (window.msCrypto && window.msCrypto.getRandomValues) //internet explorer + var crypto = window.msCrypto; + else + throw new Error('window.crypto.getRandomValues not available'); + + var bbuf = new Uint8Array(size); + crypto.getRandomValues(bbuf); + var buf = Buffer.from(bbuf); + + return buf; +}; + +/* insecure random bytes, but it never fails */ +Random.getPseudoRandomBuffer = function(size) { + var b32 = 0x100000000; + var b = Buffer.alloc(size); + var r; + + for (var i = 0; i <= size; i++) { + var j = Math.floor(i / 4); + var k = i - j * 4; + if (k === 0) { + r = Math.random() * b32; + b[i] = r & 0xff; + } else { + b[i] = (r = r >>> 8) & 0xff; + } + } + + return b; +}; + +module.exports = Random; diff --git a/packages/kauri-bitcore-lib/lib/crypto/signature.js b/packages/kauri-bitcore-lib/lib/crypto/signature.js new file mode 100644 index 0000000..6ba6053 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/crypto/signature.js @@ -0,0 +1,313 @@ +'use strict'; + +var BN = require('./bn'); +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); + +var Signature = function Signature(r, s) { + if (!(this instanceof Signature)) { + return new Signature(r, s); + } + if (r instanceof BN) { + this.set({ + r: r, + s: s + }); + } else if (r) { + var obj = r; + this.set(obj); + } +}; + +/* jshint maxcomplexity: 7 */ +Signature.prototype.set = function(obj) { + this.r = obj.r || this.r || undefined; + this.s = obj.s || this.s || undefined; + + this.i = typeof obj.i !== 'undefined' ? obj.i : this.i; //public key recovery parameter in range [0, 3] + this.compressed = typeof obj.compressed !== 'undefined' ? + obj.compressed : this.compressed; //whether the recovered pubkey is compressed + this.nhashtype = obj.nhashtype || this.nhashtype || undefined; + return this; +}; + +Signature.fromCompact = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf), 'Argument is expected to be a Buffer'); + + var sig = new Signature(); + + var compressed = true; + var i = buf.slice(0, 1)[0] - 27 - 4; + if (i < 0) { + compressed = false; + i = i + 4; + } + + var b2 = buf.slice(1, 33); + var b3 = buf.slice(33, 65); + + $.checkArgument(i === 0 || i === 1 || i === 2 || i === 3, new Error('i must be 0, 1, 2, or 3')); + $.checkArgument(b2.length === 32, new Error('r must be 32 bytes')); + $.checkArgument(b3.length === 32, new Error('s must be 32 bytes')); + + sig.compressed = compressed; + sig.i = i; + sig.r = BN.fromBuffer(b2); + sig.s = BN.fromBuffer(b3); + + return sig; +}; + +Signature.fromDER = Signature.fromBuffer = function(buf, strict) { + var obj = Signature.parseDER(buf, strict); + var sig = new Signature(); + + sig.r = obj.r; + sig.s = obj.s; + + return sig; +}; + +// The format used in a tx +Signature.fromTxFormat = function(buf) { + var nhashtype = buf.readUInt8(buf.length - 1); + var derbuf = buf.slice(0, buf.length - 1); + var sig = new Signature.fromDER(derbuf, false); + sig.nhashtype = nhashtype; + return sig; +}; + +Signature.fromString = function(str) { + var buf = Buffer.from(str, 'hex'); + return Signature.fromDER(buf); +}; + + +/** + * In order to mimic the non-strict DER encoding of OpenSSL, set strict = false. + */ +Signature.parseDER = function(buf, strict) { + $.checkArgument(BufferUtil.isBuffer(buf), new Error('DER formatted signature should be a buffer')); + if (_.isUndefined(strict)) { + strict = true; + } + + var header = buf[0]; + $.checkArgument(header === 0x30, new Error('Header byte should be 0x30')); + + var length = buf[1]; + var buflength = buf.slice(2).length; + $.checkArgument(!strict || length === buflength, new Error('Length byte should length of what follows')); + + length = length < buflength ? length : buflength; + + var rheader = buf[2 + 0]; + $.checkArgument(rheader === 0x02, new Error('Integer byte for r should be 0x02')); + + var rlength = buf[2 + 1]; + var rbuf = buf.slice(2 + 2, 2 + 2 + rlength); + var r = BN.fromBuffer(rbuf); + var rneg = buf[2 + 1 + 1] === 0x00 ? true : false; + $.checkArgument(rlength === rbuf.length, new Error('Length of r incorrect')); + + var sheader = buf[2 + 2 + rlength + 0]; + $.checkArgument(sheader === 0x02, new Error('Integer byte for s should be 0x02')); + + var slength = buf[2 + 2 + rlength + 1]; + var sbuf = buf.slice(2 + 2 + rlength + 2, 2 + 2 + rlength + 2 + slength); + var s = BN.fromBuffer(sbuf); + var sneg = buf[2 + 2 + rlength + 2 + 2] === 0x00 ? true : false; + $.checkArgument(slength === sbuf.length, new Error('Length of s incorrect')); + + var sumlength = 2 + 2 + rlength + 2 + slength; + $.checkArgument(length === sumlength - 2, new Error('Length of signature incorrect')); + + var obj = { + header: header, + length: length, + rheader: rheader, + rlength: rlength, + rneg: rneg, + rbuf: rbuf, + r: r, + sheader: sheader, + slength: slength, + sneg: sneg, + sbuf: sbuf, + s: s + }; + + return obj; +}; + + +Signature.prototype.toCompact = function(i, compressed) { + i = typeof i === 'number' ? i : this.i; + compressed = typeof compressed === 'boolean' ? compressed : this.compressed; + + if (!(i === 0 || i === 1 || i === 2 || i === 3)) { + throw new Error('i must be equal to 0, 1, 2, or 3'); + } + + var val = i + 27 + 4; + if (compressed === false) { + val = val - 4; + } + var b1 = Buffer.from([val]); + var b2 = this.r.toBuffer({ + size: 32 + }); + var b3 = this.s.toBuffer({ + size: 32 + }); + return Buffer.concat([b1, b2, b3]); +}; + +Signature.prototype.toBuffer = Signature.prototype.toDER = function() { + var rnbuf = this.r.toBuffer(); + var snbuf = this.s.toBuffer(); + + var rneg = rnbuf[0] & 0x80 ? true : false; + var sneg = snbuf[0] & 0x80 ? true : false; + + var rbuf = rneg ? Buffer.concat([Buffer.from([0x00]), rnbuf]) : rnbuf; + var sbuf = sneg ? Buffer.concat([Buffer.from([0x00]), snbuf]) : snbuf; + + var rlength = rbuf.length; + var slength = sbuf.length; + var length = 2 + rlength + 2 + slength; + var rheader = 0x02; + var sheader = 0x02; + var header = 0x30; + + var der = Buffer.concat([Buffer.from([header, length, rheader, rlength]), rbuf, Buffer.from([sheader, slength]), sbuf]); + return der; +}; + +Signature.prototype.toString = function() { + var buf = this.toDER(); + return buf.toString('hex'); +}; + +/** + * This function is translated from bitcoind's IsDERSignature and is used in + * the script interpreter. This "DER" format actually includes an extra byte, + * the nhashtype, at the end. It is really the tx format, not DER format. + * + * A canonical signature exists of: [30] [total len] [02] [len R] [R] [02] [len S] [S] [hashtype] + * Where R and S are not negative (their first byte has its highest bit not set), and not + * excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, + * in which case a single 0 byte is necessary and even required). + * + * See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 + */ +Signature.isTxDER = function(buf) { + if (buf.length < 9) { + // Non-canonical signature: too short + return false; + } + if (buf.length > 73) { + // Non-canonical signature: too long + return false; + } + if (buf[0] !== 0x30) { + // Non-canonical signature: wrong type + return false; + } + if (buf[1] !== buf.length - 3) { + // Non-canonical signature: wrong length marker + return false; + } + var nLenR = buf[3]; + if (5 + nLenR >= buf.length) { + // Non-canonical signature: S length misplaced + return false; + } + var nLenS = buf[5 + nLenR]; + if ((nLenR + nLenS + 7) !== buf.length) { + // Non-canonical signature: R+S length mismatch + return false; + } + + var R = buf.slice(4); + if (buf[4 - 2] !== 0x02) { + // Non-canonical signature: R value type mismatch + return false; + } + if (nLenR === 0) { + // Non-canonical signature: R length is zero + return false; + } + if (R[0] & 0x80) { + // Non-canonical signature: R value negative + return false; + } + if (nLenR > 1 && (R[0] === 0x00) && !(R[1] & 0x80)) { + // Non-canonical signature: R value excessively padded + return false; + } + + var S = buf.slice(6 + nLenR); + if (buf[6 + nLenR - 2] !== 0x02) { + // Non-canonical signature: S value type mismatch + return false; + } + if (nLenS === 0) { + // Non-canonical signature: S length is zero + return false; + } + if (S[0] & 0x80) { + // Non-canonical signature: S value negative + return false; + } + if (nLenS > 1 && (S[0] === 0x00) && !(S[1] & 0x80)) { + // Non-canonical signature: S value excessively padded + return false; + } + return true; +}; + +/** + * Compares to bitcoind's IsLowDERSignature + * See also ECDSA signature algorithm which enforces this. + * See also BIP 62, "low S values in signatures" + */ +Signature.prototype.hasLowS = function() { + if (this.s.lt(new BN(1)) || + this.s.gt(new BN('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex'))) { + return false; + } + return true; +}; + +/** + * @returns true if the nhashtype is exactly equal to one of the standard options or combinations thereof. + * Translated from bitcoind's IsDefinedHashtypeSignature + */ +Signature.prototype.hasDefinedHashtype = function() { + if (!JSUtil.isNaturalNumber(this.nhashtype)) { + return false; + } + // accept with or without Signature.SIGHASH_ANYONECANPAY by ignoring the bit + var temp = this.nhashtype & ~Signature.SIGHASH_ANYONECANPAY; + if (temp < Signature.SIGHASH_ALL || temp > Signature.SIGHASH_SINGLE) { + return false; + } + return true; +}; + +Signature.prototype.toTxFormat = function() { + var derbuf = this.toDER(); + var buf = Buffer.alloc(1); + buf.writeUInt8(this.nhashtype, 0); + return Buffer.concat([derbuf, buf]); +}; + +Signature.SIGHASH_ALL = 0x01; +Signature.SIGHASH_NONE = 0x02; +Signature.SIGHASH_SINGLE = 0x03; +Signature.SIGHASH_ANYONECANPAY = 0x80; + +module.exports = Signature; diff --git a/packages/kauri-bitcore-lib/lib/encoding/base58.js b/packages/kauri-bitcore-lib/lib/encoding/base58.js new file mode 100644 index 0000000..a2b606f --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/encoding/base58.js @@ -0,0 +1,70 @@ +'use strict'; + +var _ = require('lodash'); +var bs58 = require('bs58'); +var buffer = require('buffer'); + +var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'.split(''); + +var Base58 = function Base58(obj) { + /* jshint maxcomplexity: 8 */ + if (!(this instanceof Base58)) { + return new Base58(obj); + } + if (Buffer.isBuffer(obj)) { + var buf = obj; + this.fromBuffer(buf); + } else if (typeof obj === 'string') { + var str = obj; + this.fromString(str); + } else if (obj) { + this.set(obj); + } +}; + +Base58.validCharacters = function validCharacters(chars) { + if (buffer.Buffer.isBuffer(chars)) { + chars = chars.toString(); + } + return _.every(_.map(chars, function(char) { return _.includes(ALPHABET, char); })); +}; + +Base58.prototype.set = function(obj) { + this.buf = obj.buf || this.buf || undefined; + return this; +}; + +Base58.encode = function(buf) { + if (!buffer.Buffer.isBuffer(buf)) { + throw new Error('Input should be a buffer'); + } + return bs58.encode(buf); +}; + +Base58.decode = function(str) { + if (typeof str !== 'string') { + throw new Error('Input should be a string'); + } + return Buffer.from(bs58.decode(str)); +}; + +Base58.prototype.fromBuffer = function(buf) { + this.buf = buf; + return this; +}; + +Base58.prototype.fromString = function(str) { + var buf = Base58.decode(str); + this.buf = buf; + return this; +}; + +Base58.prototype.toBuffer = function() { + return this.buf; +}; + +Base58.prototype.toString = function() { + return Base58.encode(this.buf); +}; + +module.exports = Base58; diff --git a/packages/kauri-bitcore-lib/lib/encoding/base58check.js b/packages/kauri-bitcore-lib/lib/encoding/base58check.js new file mode 100644 index 0000000..6372eb9 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/encoding/base58check.js @@ -0,0 +1,95 @@ +'use strict'; + +var _ = require('lodash'); +var Base58 = require('./base58'); +var buffer = require('buffer'); +var sha256sha256 = require('../crypto/hash').sha256sha256; + +var Base58Check = function Base58Check(obj) { + if (!(this instanceof Base58Check)) + return new Base58Check(obj); + if (Buffer.isBuffer(obj)) { + var buf = obj; + this.fromBuffer(buf); + } else if (typeof obj === 'string') { + var str = obj; + this.fromString(str); + } else if (obj) { + this.set(obj); + } +}; + +Base58Check.prototype.set = function(obj) { + this.buf = obj.buf || this.buf || undefined; + return this; +}; + +Base58Check.validChecksum = function validChecksum(data, checksum) { + if (_.isString(data)) { + data = new buffer.Buffer(Base58.decode(data)); + } + if (_.isString(checksum)) { + checksum = new buffer.Buffer(Base58.decode(checksum)); + } + if (!checksum) { + checksum = data.slice(-4); + data = data.slice(0, -4); + } + return Base58Check.checksum(data).toString('hex') === checksum.toString('hex'); +}; + +Base58Check.decode = function(s) { + if (typeof s !== 'string') + throw new Error('Input must be a string'); + + var buf = Buffer.from(Base58.decode(s)); + + if (buf.length < 4) + throw new Error("Input string too short"); + + var data = buf.slice(0, -4); + var csum = buf.slice(-4); + + var hash = sha256sha256(data); + var hash4 = hash.slice(0, 4); + + if (csum.toString('hex') !== hash4.toString('hex')) + throw new Error("Checksum mismatch"); + + return data; +}; + +Base58Check.checksum = function(buffer) { + return sha256sha256(buffer).slice(0, 4); +}; + +Base58Check.encode = function(buf) { + if (!Buffer.isBuffer(buf)) + throw new Error('Input must be a buffer'); + var checkedBuf = Buffer.alloc(buf.length + 4); + var hash = Base58Check.checksum(buf); + buf.copy(checkedBuf); + hash.copy(checkedBuf, buf.length); + return Base58.encode(checkedBuf); +}; + +Base58Check.prototype.fromBuffer = function(buf) { + this.buf = buf; + return this; +}; + +Base58Check.prototype.fromString = function(str) { + var buf = Base58Check.decode(str); + this.buf = buf; + return this; +}; + +Base58Check.prototype.toBuffer = function() { + return this.buf; +}; + +Base58Check.prototype.toString = function() { + return Base58Check.encode(this.buf); +}; + +module.exports = Base58Check; diff --git a/packages/kauri-bitcore-lib/lib/encoding/bufferreader.js b/packages/kauri-bitcore-lib/lib/encoding/bufferreader.js new file mode 100644 index 0000000..f9a3f2c --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/encoding/bufferreader.js @@ -0,0 +1,198 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var BufferUtil = require('../util/buffer'); +var BN = require('../crypto/bn'); + +var BufferReader = function BufferReader(buf) { + if (!(this instanceof BufferReader)) { + return new BufferReader(buf); + } + if (_.isUndefined(buf)) { + return; + } + if (Buffer.isBuffer(buf)) { + this.set({ + buf: buf + }); + } else if (_.isString(buf)) { + this.set({ + buf: Buffer.from(buf, 'hex'), + }); + } else if (_.isObject(buf)) { + var obj = buf; + this.set(obj); + } else { + throw new TypeError('Unrecognized argument for BufferReader'); + } +}; + +BufferReader.prototype.set = function(obj) { + this.buf = obj.buf || this.buf || undefined; + this.pos = obj.pos || this.pos || 0; + return this; +}; + +BufferReader.prototype.eof = function() { + return this.pos >= this.buf.length; +}; + +BufferReader.prototype.finished = BufferReader.prototype.eof; + +BufferReader.prototype.read = function(len) { + $.checkArgument(!_.isUndefined(len), 'Must specify a length'); + var buf = this.buf.slice(this.pos, this.pos + len); + this.pos = this.pos + len; + return buf; +}; + +BufferReader.prototype.readAll = function() { + var buf = this.buf.slice(this.pos, this.buf.length); + this.pos = this.buf.length; + return buf; +}; + +BufferReader.prototype.readUInt8 = function() { + var val = this.buf.readUInt8(this.pos); + this.pos = this.pos + 1; + return val; +}; + +BufferReader.prototype.readUInt16BE = function() { + var val = this.buf.readUInt16BE(this.pos); + this.pos = this.pos + 2; + return val; +}; + +BufferReader.prototype.readUInt16LE = function() { + var val = this.buf.readUInt16LE(this.pos); + this.pos = this.pos + 2; + return val; +}; + +BufferReader.prototype.readUInt32BE = function() { + var val = this.buf.readUInt32BE(this.pos); + this.pos = this.pos + 4; + return val; +}; + +BufferReader.prototype.readUInt32LE = function() { + var val = this.buf.readUInt32LE(this.pos); + this.pos = this.pos + 4; + return val; +}; + +BufferReader.prototype.readInt32LE = function() { + var val = this.buf.readInt32LE(this.pos); + this.pos = this.pos + 4; + return val; +}; + +BufferReader.prototype.readUInt64BEBN = function() { + var buf = this.buf.slice(this.pos, this.pos + 8); + var bn = BN.fromBuffer(buf); + this.pos = this.pos + 8; + return bn; +}; + +BufferReader.prototype.readUInt64LEBN = function() { + var second = this.buf.readUInt32LE(this.pos); + var first = this.buf.readUInt32LE(this.pos + 4); + var combined = (first * 0x100000000) + second; + // Instantiating an instance of BN with a number is faster than with an + // array or string. However, the maximum safe number for a double precision + // floating point is 2 ^ 52 - 1 (0x1fffffffffffff), thus we can safely use + // non-floating point numbers less than this amount (52 bits). And in the case + // that the number is larger, we can instatiate an instance of BN by passing + // an array from the buffer (slower) and specifying the endianness. + var bn; + if (combined <= 0x1fffffffffffff) { + bn = new BN(combined); + } else { + var data = Array.prototype.slice.call(this.buf, this.pos, this.pos + 8); + bn = new BN(data, 10, 'le'); + } + this.pos = this.pos + 8; + return bn; +}; + +BufferReader.prototype.readVarintNum = function() { + var first = this.readUInt8(); + switch (first) { + case 0xFD: + return this.readUInt16LE(); + case 0xFE: + return this.readUInt32LE(); + case 0xFF: + var bn = this.readUInt64LEBN(); + var n = bn.toNumber(); + if (n <= Math.pow(2, 53)) { + return n; + } else { + throw new Error('number too large to retain precision - use readVarintBN'); + } + break; + default: + return first; + } +}; + +/** + * reads a length prepended buffer + */ +BufferReader.prototype.readVarLengthBuffer = function() { + var len = this.readVarintNum(); + var buf = this.read(len); + $.checkState(buf.length === len, 'Invalid length while reading varlength buffer. ' + + 'Expected to read: ' + len + ' and read ' + buf.length); + return buf; +}; + +BufferReader.prototype.readVarintBuf = function() { + var first = this.buf.readUInt8(this.pos); + switch (first) { + case 0xFD: + return this.read(1 + 2); + case 0xFE: + return this.read(1 + 4); + case 0xFF: + return this.read(1 + 8); + default: + return this.read(1); + } +}; + +BufferReader.prototype.readVarintBN = function() { + var first = this.readUInt8(); + switch (first) { + case 0xFD: + return new BN(this.readUInt16LE()); + case 0xFE: + return new BN(this.readUInt32LE()); + case 0xFF: + return this.readUInt64LEBN(); + default: + return new BN(first); + } +}; + +BufferReader.prototype.reverse = function() { + var buf = Buffer.alloc(this.buf.length); + for (var i = 0; i < buf.length; i++) { + buf[i] = this.buf[this.buf.length - 1 - i]; + } + this.buf = buf; + return this; +}; + +BufferReader.prototype.readReverse = function(len) { + if (_.isUndefined(len)) { + len = this.buf.length; + } + var buf = this.buf.slice(this.pos, this.pos + len); + this.pos = this.pos + len; + return BufferUtil.reverse(buf); +}; + +module.exports = BufferReader; diff --git a/packages/kauri-bitcore-lib/lib/encoding/bufferwriter.js b/packages/kauri-bitcore-lib/lib/encoding/bufferwriter.js new file mode 100644 index 0000000..ff38d1d --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/encoding/bufferwriter.js @@ -0,0 +1,155 @@ +'use strict'; + +var bufferUtil = require('../util/buffer'); +var assert = require('assert'); + +var BufferWriter = function BufferWriter(obj) { + if (!(this instanceof BufferWriter)) + return new BufferWriter(obj); + this.bufLen = 0; + if (obj) + this.set(obj); + else + this.bufs = []; +}; + +BufferWriter.prototype.set = function(obj) { + this.bufs = obj.bufs || this.bufs || []; + this.bufLen = this.bufs.reduce(function(prev, buf){ return prev + buf.length; }, 0); + return this; +}; + +BufferWriter.prototype.toBuffer = function() { + return this.concat(); +}; + +BufferWriter.prototype.concat = function() { + return Buffer.concat(this.bufs, this.bufLen); +}; + +BufferWriter.prototype.write = function(buf) { + assert(bufferUtil.isBuffer(buf)); + this.bufs.push(buf); + this.bufLen += buf.length; + return this; +}; + +BufferWriter.prototype.writeReverse = function(buf) { + assert(bufferUtil.isBuffer(buf)); + this.bufs.push(bufferUtil.reverse(buf)); + this.bufLen += buf.length; + return this; +}; + +BufferWriter.prototype.writeUInt8 = function(n) { + var buf = Buffer.alloc(1); + buf.writeUInt8(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt16BE = function(n) { + var buf = Buffer.alloc(2); + buf.writeUInt16BE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt16LE = function(n) { + var buf = Buffer.alloc(2); + buf.writeUInt16LE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt32BE = function(n) { + var buf = Buffer.alloc(4); + buf.writeUInt32BE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeInt32LE = function(n) { + var buf = Buffer.alloc(4); + buf.writeInt32LE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt32LE = function(n) { + var buf = Buffer.alloc(4); + buf.writeUInt32LE(n, 0); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt64BEBN = function(bn) { + var buf = bn.toBuffer({size: 8}); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeUInt64LEBN = function(bn) { + var buf = bn.toBuffer({size: 8}); + this.writeReverse(buf); + return this; +}; + +BufferWriter.prototype.writeVarintNum = function(n) { + var buf = BufferWriter.varintBufNum(n); + this.write(buf); + return this; +}; + +BufferWriter.prototype.writeVarintBN = function(bn) { + var buf = BufferWriter.varintBufBN(bn); + this.write(buf); + return this; +}; + +BufferWriter.varintBufNum = function(n) { + var buf = undefined; + if (n < 253) { + buf = Buffer.alloc(1); + buf.writeUInt8(n, 0); + } else if (n < 0x10000) { + buf = Buffer.alloc(1 + 2); + buf.writeUInt8(253, 0); + buf.writeUInt16LE(n, 1); + } else if (n < 0x100000000) { + buf = Buffer.alloc(1 + 4); + buf.writeUInt8(254, 0); + buf.writeUInt32LE(n, 1); + } else { + buf = Buffer.alloc(1 + 8); + buf.writeUInt8(255, 0); + buf.writeInt32LE(n & -1, 1); + buf.writeUInt32LE(Math.floor(n / 0x100000000), 5); + } + return buf; +}; + +BufferWriter.varintBufBN = function(bn) { + var buf = undefined; + var n = bn.toNumber(); + if (n < 253) { + buf = Buffer.alloc(1); + buf.writeUInt8(n, 0); + } else if (n < 0x10000) { + buf = Buffer.alloc(1 + 2); + buf.writeUInt8(253, 0); + buf.writeUInt16LE(n, 1); + } else if (n < 0x100000000) { + buf = Buffer.alloc(1 + 4); + buf.writeUInt8(254, 0); + buf.writeUInt32LE(n, 1); + } else { + var bw = new BufferWriter(); + bw.writeUInt8(255); + bw.writeUInt64LEBN(bn); + var buf = bw.concat(); + } + return buf; +}; + +module.exports = BufferWriter; diff --git a/packages/kauri-bitcore-lib/lib/encoding/varint.js b/packages/kauri-bitcore-lib/lib/encoding/varint.js new file mode 100644 index 0000000..6bb3240 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/encoding/varint.js @@ -0,0 +1,72 @@ +'use strict'; + +var BufferWriter = require('./bufferwriter'); +var BufferReader = require('./bufferreader'); +var BN = require('../crypto/bn'); + +var Varint = function Varint(buf) { + if (!(this instanceof Varint)) + return new Varint(buf); + if (Buffer.isBuffer(buf)) { + this.buf = buf; + } else if (typeof buf === 'number') { + var num = buf; + this.fromNumber(num); + } else if (buf instanceof BN) { + var bn = buf; + this.fromBN(bn); + } else if (buf) { + var obj = buf; + this.set(obj); + } +}; + +Varint.prototype.set = function(obj) { + this.buf = obj.buf || this.buf; + return this; +}; + +Varint.prototype.fromString = function(str) { + this.set({ + buf: Buffer.from(str, 'hex') + }); + return this; +}; + +Varint.prototype.toString = function() { + return this.buf.toString('hex'); +}; + +Varint.prototype.fromBuffer = function(buf) { + this.buf = buf; + return this; +}; + +Varint.prototype.fromBufferReader = function(br) { + this.buf = br.readVarintBuf(); + return this; +}; + +Varint.prototype.fromBN = function(bn) { + this.buf = BufferWriter().writeVarintBN(bn).concat(); + return this; +}; + +Varint.prototype.fromNumber = function(num) { + this.buf = BufferWriter().writeVarintNum(num).concat(); + return this; +}; + +Varint.prototype.toBuffer = function() { + return this.buf; +}; + +Varint.prototype.toBN = function() { + return BufferReader(this.buf).readVarintBN(); +}; + +Varint.prototype.toNumber = function() { + return BufferReader(this.buf).readVarintNum(); +}; + +module.exports = Varint; diff --git a/packages/kauri-bitcore-lib/lib/errors/index.js b/packages/kauri-bitcore-lib/lib/errors/index.js new file mode 100644 index 0000000..de6f731 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/errors/index.js @@ -0,0 +1,61 @@ +'use strict'; + +var _ = require('lodash'); + +function format(message, args) { + return message + .replace('{0}', args[0]) + .replace('{1}', args[1]) + .replace('{2}', args[2]); +} +var traverseNode = function(parent, errorDefinition) { + var NodeError = function() { + if (_.isString(errorDefinition.message)) { + this.message = format(errorDefinition.message, arguments); + } else if (_.isFunction(errorDefinition.message)) { + this.message = errorDefinition.message.apply(null, arguments); + } else { + throw new Error('Invalid error definition for ' + errorDefinition.name); + } + this.stack = this.message + '\n' + (new Error()).stack; + }; + NodeError.prototype = Object.create(parent.prototype); + NodeError.prototype.name = parent.prototype.name + errorDefinition.name; + parent[errorDefinition.name] = NodeError; + if (errorDefinition.errors) { + childDefinitions(NodeError, errorDefinition.errors); + } + return NodeError; +}; + +/* jshint latedef: false */ +var childDefinitions = function(parent, childDefinitions) { + _.each(childDefinitions, function(childDefinition) { + traverseNode(parent, childDefinition); + }); +}; +/* jshint latedef: true */ + +var traverseRoot = function(parent, errorsDefinition) { + childDefinitions(parent, errorsDefinition); + return parent; +}; + + +var bitcore = {}; +bitcore.Error = function() { + this.message = 'Internal error'; + this.stack = this.message + '\n' + (new Error()).stack; +}; +bitcore.Error.prototype = Object.create(Error.prototype); +bitcore.Error.prototype.name = 'bitcore.Error'; + + +var data = require('./spec'); +traverseRoot(bitcore.Error, data); + +module.exports = bitcore.Error; + +module.exports.extend = function(spec) { + return traverseNode(bitcore.Error, spec); +}; diff --git a/packages/kauri-bitcore-lib/lib/errors/spec.js b/packages/kauri-bitcore-lib/lib/errors/spec.js new file mode 100644 index 0000000..26bba74 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/errors/spec.js @@ -0,0 +1,184 @@ +'use strict'; + +var docsURL = 'http://bitcore.io/'; + +module.exports = [{ + name: 'InvalidB58Char', + message: 'Invalid Base58 character: {0} in {1}' +}, { + name: 'InvalidB58Checksum', + message: 'Invalid Base58 checksum for {0}' +}, { + name: 'InvalidNetwork', + message: 'Invalid version for network: got {0}' +}, { + name: 'InvalidState', + message: 'Invalid state: {0}' +}, { + name: 'NotImplemented', + message: 'Function {0} was not implemented yet' +}, { + name: 'InvalidNetworkArgument', + message: 'Invalid network: must be "livenet" or "testnet", got {0}' +}, { + name: 'InvalidArgument', + message: function() { + return 'Invalid Argument' + (arguments[0] ? (': ' + arguments[0]) : '') + + (arguments[1] ? (' Documentation: ' + docsURL + arguments[1]) : ''); + } +}, { + name: 'AbstractMethodInvoked', + message: 'Abstract Method Invocation: {0}' +}, { + name: 'InvalidArgumentType', + message: function() { + return 'Invalid Argument for ' + arguments[2] + ', expected ' + arguments[1] + ' but got ' + typeof arguments[0]; + } +}, { + name: 'Unit', + message: 'Internal Error on Unit {0}', + errors: [{ + 'name': 'UnknownCode', + 'message': 'Unrecognized unit code: {0}' + }, { + 'name': 'InvalidRate', + 'message': 'Invalid exchange rate: {0}' + }] +}, { + name: 'MerkleBlock', + message: 'Internal Error on MerkleBlock {0}', + errors: [{ + 'name': 'InvalidMerkleTree', + 'message': 'This MerkleBlock contain an invalid Merkle Tree' + }] +}, { + name: 'Transaction', + message: 'Internal Error on Transaction {0}', + errors: [{ + name: 'Input', + message: 'Internal Error on Input {0}', + errors: [{ + name: 'MissingScript', + message: 'Need a script to create an input' + }, { + name: 'UnsupportedScript', + message: 'Unsupported input script type: {0}' + }, { + name: 'MissingPreviousOutput', + message: 'No previous output information.' + }] + }, { + name: 'NeedMoreInfo', + message: '{0}' + }, { + name: 'InvalidSorting', + message: 'The sorting function provided did not return the change output as one of the array elements' + }, { + name: 'InvalidOutputAmountSum', + message: '{0}' + }, { + name: 'MissingSignatures', + message: 'Some inputs have not been fully signed' + }, { + name: 'InvalidIndex', + message: 'Invalid index: {0} is not between 0, {1}' + }, { + name: 'UnableToVerifySignature', + message: 'Unable to verify signature: {0}' + }, { + name: 'DustOutputs', + message: 'Dust amount detected in one output' + }, { + name: 'InvalidSatoshis', + message: 'Output satoshis are invalid', + }, { + name: 'FeeError', + message: 'Internal Error on Fee {0}', + errors: [{ + name: 'TooSmall', + message: 'Fee is too small: {0}', + }, { + name: 'TooLarge', + message: 'Fee is too large: {0}', + }, { + name: 'Different', + message: 'Unspent value is different from specified fee: {0}', + }] + }, { + name: 'ChangeAddressMissing', + message: 'Change address is missing' + }, { + name: 'BlockHeightTooHigh', + message: 'Block Height can be at most 2^32 -1' + }, { + name: 'NLockTimeOutOfRange', + message: 'Block Height can only be between 0 and 499 999 999' + }, { + name: 'LockTimeTooEarly', + message: 'Lock Time can\'t be earlier than UNIX date 500 000 000' + }] +}, { + name: 'Script', + message: 'Internal Error on Script {0}', + errors: [{ + name: 'UnrecognizedAddress', + message: 'Expected argument {0} to be an address' + }, { + name: 'CantDeriveAddress', + message: 'Can\'t derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out.' + }, { + name: 'InvalidBuffer', + message: 'Invalid script buffer: can\'t parse valid script from given buffer {0}' + }] +}, { + name: 'HDPrivateKey', + message: 'Internal Error on HDPrivateKey {0}', + errors: [{ + name: 'InvalidDerivationArgument', + message: 'Invalid derivation argument {0}, expected string, or number and boolean' + }, { + name: 'InvalidEntropyArgument', + message: 'Invalid entropy: must be an hexa string or binary buffer, got {0}', + errors: [{ + name: 'TooMuchEntropy', + message: 'Invalid entropy: more than 512 bits is non standard, got "{0}"' + }, { + name: 'NotEnoughEntropy', + message: 'Invalid entropy: at least 128 bits needed, got "{0}"' + }] + }, { + name: 'InvalidLength', + message: 'Invalid length for xprivkey string in {0}' + }, { + name: 'InvalidPath', + message: 'Invalid derivation path: {0}' + }, { + name: 'UnrecognizedArgument', + message: 'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"' + }] +}, { + name: 'HDPublicKey', + message: 'Internal Error on HDPublicKey {0}', + errors: [{ + name: 'ArgumentIsPrivateExtended', + message: 'Argument is an extended private key: {0}' + }, { + name: 'InvalidDerivationArgument', + message: 'Invalid derivation argument: got {0}' + }, { + name: 'InvalidLength', + message: 'Invalid length for xpubkey: got "{0}"' + }, { + name: 'InvalidPath', + message: 'Invalid derivation path, it should look like: "m/1/100", got "{0}"' + }, { + name: 'InvalidIndexCantDeriveHardened', + message: 'Invalid argument: creating a hardened path requires an HDPrivateKey' + }, { + name: 'MustSupplyArgument', + message: 'Must supply an argument to create a HDPublicKey' + }, { + name: 'UnrecognizedArgument', + message: 'Invalid argument for creation, must be string, json, buffer, or object' + }] +}]; diff --git a/packages/kauri-bitcore-lib/lib/hdprivatekey.js b/packages/kauri-bitcore-lib/lib/hdprivatekey.js new file mode 100644 index 0000000..18b16d5 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/hdprivatekey.js @@ -0,0 +1,646 @@ +'use strict'; + + +var assert = require('assert'); +var buffer = require('buffer'); +var _ = require('lodash'); +var $ = require('./util/preconditions'); + +var BN = require('./crypto/bn'); +var Base58 = require('./encoding/base58'); +var Base58Check = require('./encoding/base58check'); +var Hash = require('./crypto/hash'); +var Network = require('./networks'); +var Point = require('./crypto/point'); +var PrivateKey = require('./privatekey'); +var Random = require('./crypto/random'); + +var errors = require('./errors'); +var hdErrors = errors.HDPrivateKey; +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); + +var MINIMUM_ENTROPY_BITS = 128; +var BITS_TO_BYTES = 1 / 8; +var MAXIMUM_ENTROPY_BITS = 512; + + +/** + * Represents an instance of an hierarchically derived private key. + * + * More info on https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki + * + * @constructor + * @param {string|Buffer|Object} arg + */ +function HDPrivateKey(arg) { + /* jshint maxcomplexity: 10 */ + if (arg instanceof HDPrivateKey) { + return arg; + } + if (!(this instanceof HDPrivateKey)) { + return new HDPrivateKey(arg); + } + if (!arg) { + return this._generateRandomly(); + } + + if (Network.get(arg)) { + return this._generateRandomly(arg); + } else if (_.isString(arg) || BufferUtil.isBuffer(arg)) { + if (HDPrivateKey.isValidSerialized(arg)) { + this._buildFromSerialized(arg); + } else if (JSUtil.isValidJSON(arg)) { + this._buildFromJSON(arg); + } else if (BufferUtil.isBuffer(arg) && HDPrivateKey.isValidSerialized(arg.toString())) { + this._buildFromSerialized(arg.toString()); + } else { + throw HDPrivateKey.getSerializedError(arg); + } + } else if (_.isObject(arg)) { + this._buildFromObject(arg); + } else { + throw new hdErrors.UnrecognizedArgument(arg); + } +} + +/** + * Verifies that a given path is valid. + * + * @param {string|number} arg + * @param {boolean?} hardened + * @return {boolean} + */ +HDPrivateKey.isValidPath = function(arg, hardened) { + if (_.isString(arg)) { + var indexes = HDPrivateKey._getDerivationIndexes(arg); + return indexes !== null && _.every(indexes, HDPrivateKey.isValidPath); + } + + if (_.isNumber(arg)) { + if (arg < HDPrivateKey.Hardened && hardened === true) { + arg += HDPrivateKey.Hardened; + } + return arg >= 0 && arg < HDPrivateKey.MaxIndex; + } + + return false; +}; + +/** + * Internal function that splits a string path into a derivation index array. + * It will return null if the string path is malformed. + * It does not validate if indexes are in bounds. + * + * @param {string} path + * @return {Array} + */ +HDPrivateKey._getDerivationIndexes = function(path) { + var steps = path.split('/'); + + // Special cases: + if (_.includes(HDPrivateKey.RootElementAlias, path)) { + return []; + } + + if (!_.includes(HDPrivateKey.RootElementAlias, steps[0])) { + return null; + } + + var indexes = steps.slice(1).map(function(step) { + var isHardened = step.slice(-1) === '\''; + if (isHardened) { + step = step.slice(0, -1); + } + if (!step || step[0] === '-') { + return NaN; + } + var index = +step; // cast to number + if (isHardened) { + index += HDPrivateKey.Hardened; + } + + return index; + }); + + return _.some(indexes, isNaN) ? null : indexes; +}; + +/** + * WARNING: This method is deprecated. Use deriveChild or deriveNonCompliantChild instead. This is not BIP32 compliant + * + * + * Get a derived child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same private key), "m/0/1/40/2'/1000", where the ' quote means a hardened + * derivation. + * + * If the first argument is a number, the child with that index will be + * derived. If the second argument is truthy, the hardened version will be + * derived. See the example usage for clarification. + * + * @example + * ```javascript + * var parent = new HDPrivateKey('xprv...'); + * var child_0_1_2h = parent.derive(0).derive(1).derive(2, true); + * var copy_of_child_0_1_2h = parent.derive("m/0/1/2'"); + * assert(child_0_1_2h.xprivkey === copy_of_child_0_1_2h); + * ``` + * + * @param {string|number} arg + * @param {boolean?} hardened + */ +HDPrivateKey.prototype.derive = function(arg, hardened) { + return this.deriveNonCompliantChild(arg, hardened); +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0. + * + * + * Get a derived child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same private key), "m/0/1/40/2'/1000", where the ' quote means a hardened + * derivation. + * + * If the first argument is a number, the child with that index will be + * derived. If the second argument is truthy, the hardened version will be + * derived. See the example usage for clarification. + * + * WARNING: The `nonCompliant` option should NOT be used, except for older implementation + * that used a derivation strategy that used a non-zero padded private key. + * + * @example + * ```javascript + * var parent = new HDPrivateKey('xprv...'); + * var child_0_1_2h = parent.deriveChild(0).deriveChild(1).deriveChild(2, true); + * var copy_of_child_0_1_2h = parent.deriveChild("m/0/1/2'"); + * assert(child_0_1_2h.xprivkey === copy_of_child_0_1_2h); + * ``` + * + * @param {string|number} arg + * @param {boolean?} hardened + */ +HDPrivateKey.prototype.deriveChild = function(arg, hardened) { + if (_.isNumber(arg)) { + return this._deriveWithNumber(arg, hardened); + } else if (_.isString(arg)) { + return this._deriveFromString(arg); + } else { + throw new hdErrors.InvalidDerivationArgument(arg); + } +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0 + * + * + * WARNING: If this is a new implementation you should NOT use this method, you should be using + * `derive` instead. + * + * This method is explicitly for use and compatibility with an implementation that + * was not compliant with BIP32 regarding the derivation algorithm. The private key + * must be 32 bytes hashing, and this implementation will use the non-zero padded + * serialization of a private key, such that it's still possible to derive the privateKey + * to recover those funds. + * + * @param {string|number} arg + * @param {boolean?} hardened + */ +HDPrivateKey.prototype.deriveNonCompliantChild = function(arg, hardened) { + if (_.isNumber(arg)) { + return this._deriveWithNumber(arg, hardened, true); + } else if (_.isString(arg)) { + return this._deriveFromString(arg, true); + } else { + throw new hdErrors.InvalidDerivationArgument(arg); + } +}; + +HDPrivateKey.prototype._deriveWithNumber = function(index, hardened, nonCompliant) { + /* jshint maxstatements: 20 */ + /* jshint maxcomplexity: 10 */ + if (!HDPrivateKey.isValidPath(index, hardened)) { + throw new hdErrors.InvalidPath(index); + } + + hardened = index >= HDPrivateKey.Hardened ? true : hardened; + if (index < HDPrivateKey.Hardened && hardened === true) { + index += HDPrivateKey.Hardened; + } + + var indexBuffer = BufferUtil.integerAsBuffer(index); + var data; + if (hardened && nonCompliant) { + // The private key serialization in this case will not be exactly 32 bytes and can be + // any value less, and the value is not zero-padded. + var nonZeroPadded = this.privateKey.bn.toBuffer(); + data = BufferUtil.concat([new buffer.Buffer([0]), nonZeroPadded, indexBuffer]); + } else if (hardened) { + // This will use a 32 byte zero padded serialization of the private key + var privateKeyBuffer = this.privateKey.bn.toBuffer({size: 32}); + assert(privateKeyBuffer.length === 32, 'length of private key buffer is expected to be 32 bytes'); + data = BufferUtil.concat([new buffer.Buffer([0]), privateKeyBuffer, indexBuffer]); + } else { + data = BufferUtil.concat([this.publicKey.toBuffer(), indexBuffer]); + } + var hash = Hash.sha512hmac(data, this._buffers.chainCode); + var leftPart = BN.fromBuffer(hash.slice(0, 32), { + size: 32 + }); + var chainCode = hash.slice(32, 64); + + var privateKey = leftPart.add(this.privateKey.toBigNumber()).umod(Point.getN()).toBuffer({ + size: 32 + }); + + if (!PrivateKey.isValid(privateKey)) { + // Index at this point is already hardened, we can pass null as the hardened arg + return this._deriveWithNumber(index + 1, null, nonCompliant); + } + + var derived = new HDPrivateKey({ + network: this.network, + depth: this.depth + 1, + parentFingerPrint: this.fingerPrint, + childIndex: index, + chainCode: chainCode, + privateKey: privateKey + }); + + return derived; +}; + +HDPrivateKey.prototype._deriveFromString = function(path, nonCompliant) { + if (!HDPrivateKey.isValidPath(path)) { + throw new hdErrors.InvalidPath(path); + } + + var indexes = HDPrivateKey._getDerivationIndexes(path); + var derived = indexes.reduce(function(prev, index) { + return prev._deriveWithNumber(index, null, nonCompliant); + }, this); + + return derived; +}; + +/** + * Verifies that a given serialized private key in base58 with checksum format + * is valid. + * + * @param {string|Buffer} data - the serialized private key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {boolean} + */ +HDPrivateKey.isValidSerialized = function(data, network) { + return !HDPrivateKey.getSerializedError(data, network); +}; + +/** + * Checks what's the error that causes the validation of a serialized private key + * in base58 with checksum to fail. + * + * @param {string|Buffer} data - the serialized private key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {errors.InvalidArgument|null} + */ +HDPrivateKey.getSerializedError = function(data, network) { + /* jshint maxcomplexity: 10 */ + if (!(_.isString(data) || BufferUtil.isBuffer(data))) { + return new hdErrors.UnrecognizedArgument('Expected string or buffer'); + } + if (!Base58.validCharacters(data)) { + return new errors.InvalidB58Char('(unknown)', data); + } + try { + data = Base58Check.decode(data); + } catch (e) { + return new errors.InvalidB58Checksum(data); + } + if (data.length !== HDPrivateKey.DataLength) { + return new hdErrors.InvalidLength(data); + } + if (!_.isUndefined(network)) { + var error = HDPrivateKey._validateNetwork(data, network); + if (error) { + return error; + } + } + return null; +}; + +HDPrivateKey._validateNetwork = function(data, networkArg) { + var network = Network.get(networkArg); + if (!network) { + return new errors.InvalidNetworkArgument(networkArg); + } + var version = data.slice(0, 4); + if (BufferUtil.integerFromBuffer(version) !== network.xprivkey) { + return new errors.InvalidNetwork(version); + } + return null; +}; + +HDPrivateKey.fromString = function(arg) { + $.checkArgument(_.isString(arg), 'No valid string was provided'); + return new HDPrivateKey(arg); +}; + +HDPrivateKey.fromObject = function(arg) { + $.checkArgument(_.isObject(arg), 'No valid argument was provided'); + return new HDPrivateKey(arg); +}; + +HDPrivateKey.prototype._buildFromJSON = function(arg) { + return this._buildFromObject(JSON.parse(arg)); +}; + +HDPrivateKey.prototype._buildFromObject = function(arg) { + /* jshint maxcomplexity: 12 */ + // TODO: Type validation + var buffers = { + version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xprivkey) : arg.version, + depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth, + parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint, + childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex, + chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode, + privateKey: (_.isString(arg.privateKey) && JSUtil.isHexa(arg.privateKey)) ? BufferUtil.hexToBuffer(arg.privateKey) : arg.privateKey, + checksum: arg.checksum ? (arg.checksum.length ? arg.checksum : BufferUtil.integerAsBuffer(arg.checksum)) : undefined + }; + return this._buildFromBuffers(buffers); +}; + +HDPrivateKey.prototype._buildFromSerialized = function(arg) { + var decoded = Base58Check.decode(arg); + var buffers = { + version: decoded.slice(HDPrivateKey.VersionStart, HDPrivateKey.VersionEnd), + depth: decoded.slice(HDPrivateKey.DepthStart, HDPrivateKey.DepthEnd), + parentFingerPrint: decoded.slice(HDPrivateKey.ParentFingerPrintStart, + HDPrivateKey.ParentFingerPrintEnd), + childIndex: decoded.slice(HDPrivateKey.ChildIndexStart, HDPrivateKey.ChildIndexEnd), + chainCode: decoded.slice(HDPrivateKey.ChainCodeStart, HDPrivateKey.ChainCodeEnd), + privateKey: decoded.slice(HDPrivateKey.PrivateKeyStart, HDPrivateKey.PrivateKeyEnd), + checksum: decoded.slice(HDPrivateKey.ChecksumStart, HDPrivateKey.ChecksumEnd), + xprivkey: arg + }; + return this._buildFromBuffers(buffers); +}; + +HDPrivateKey.prototype._generateRandomly = function(network) { + return HDPrivateKey.fromSeed(Random.getRandomBuffer(64), network); +}; + +/** + * Generate a private key from a seed, as described in BIP32 + * + * @param {string|Buffer} hexa + * @param {*} network + * @return HDPrivateKey + */ +HDPrivateKey.fromSeed = function(hexa, network) { + /* jshint maxcomplexity: 8 */ + if (JSUtil.isHexaString(hexa)) { + hexa = BufferUtil.hexToBuffer(hexa); + } + if (!Buffer.isBuffer(hexa)) { + throw new hdErrors.InvalidEntropyArgument(hexa); + } + if (hexa.length < MINIMUM_ENTROPY_BITS * BITS_TO_BYTES) { + throw new hdErrors.InvalidEntropyArgument.NotEnoughEntropy(hexa); + } + if (hexa.length > MAXIMUM_ENTROPY_BITS * BITS_TO_BYTES) { + throw new hdErrors.InvalidEntropyArgument.TooMuchEntropy(hexa); + } + var hash = Hash.sha512hmac(hexa, new buffer.Buffer('Bitcoin seed')); + + return new HDPrivateKey({ + network: Network.get(network) || Network.defaultNetwork, + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + privateKey: hash.slice(0, 32), + chainCode: hash.slice(32, 64) + }); +}; + + + +HDPrivateKey.prototype._calcHDPublicKey = function() { + if (!this._hdPublicKey) { + var HDPublicKey = require('./hdpublickey'); + this._hdPublicKey = new HDPublicKey(this); + } +}; + +/** + * Receives a object with buffers in all the properties and populates the + * internal structure + * + * @param {Object} arg + * @param {buffer.Buffer} arg.version + * @param {buffer.Buffer} arg.depth + * @param {buffer.Buffer} arg.parentFingerPrint + * @param {buffer.Buffer} arg.childIndex + * @param {buffer.Buffer} arg.chainCode + * @param {buffer.Buffer} arg.privateKey + * @param {buffer.Buffer} arg.checksum + * @param {string=} arg.xprivkey - if set, don't recalculate the base58 + * representation + * @return {HDPrivateKey} this + */ +HDPrivateKey.prototype._buildFromBuffers = function(arg) { + /* jshint maxcomplexity: 8 */ + /* jshint maxstatements: 20 */ + + HDPrivateKey._validateBufferArguments(arg); + + JSUtil.defineImmutable(this, { + _buffers: arg + }); + + var sequence = [ + arg.version, arg.depth, arg.parentFingerPrint, arg.childIndex, arg.chainCode, + BufferUtil.emptyBuffer(1), arg.privateKey + ]; + var concat = buffer.Buffer.concat(sequence); + if (!arg.checksum || !arg.checksum.length) { + arg.checksum = Base58Check.checksum(concat); + } else { + if (arg.checksum.toString() !== Base58Check.checksum(concat).toString()) { + throw new errors.InvalidB58Checksum(concat); + } + } + + var network = Network.get(BufferUtil.integerFromBuffer(arg.version)); + var xprivkey; + xprivkey = Base58Check.encode(buffer.Buffer.concat(sequence)); + arg.xprivkey = Buffer.from(xprivkey); + + var privateKey = new PrivateKey(BN.fromBuffer(arg.privateKey), network); + var publicKey = privateKey.toPublicKey(); + var size = HDPrivateKey.ParentFingerPrintSize; + var fingerPrint = Hash.sha256ripemd160(publicKey.toBuffer()).slice(0, size); + + JSUtil.defineImmutable(this, { + xprivkey: xprivkey, + network: network, + depth: BufferUtil.integerFromSingleByteBuffer(arg.depth), + privateKey: privateKey, + publicKey: publicKey, + fingerPrint: fingerPrint + }); + + this._hdPublicKey = null; + + Object.defineProperty(this, 'hdPublicKey', { + configurable: false, + enumerable: true, + get: function() { + this._calcHDPublicKey(); + return this._hdPublicKey; + } + }); + Object.defineProperty(this, 'xpubkey', { + configurable: false, + enumerable: true, + get: function() { + this._calcHDPublicKey(); + return this._hdPublicKey.xpubkey; + } + }); + return this; +}; + +HDPrivateKey._validateBufferArguments = function(arg) { + var checkBuffer = function(name, size) { + var buff = arg[name]; + assert(BufferUtil.isBuffer(buff), name + ' argument is not a buffer'); + assert( + buff.length === size, + name + ' has not the expected size: found ' + buff.length + ', expected ' + size + ); + }; + checkBuffer('version', HDPrivateKey.VersionSize); + checkBuffer('depth', HDPrivateKey.DepthSize); + checkBuffer('parentFingerPrint', HDPrivateKey.ParentFingerPrintSize); + checkBuffer('childIndex', HDPrivateKey.ChildIndexSize); + checkBuffer('chainCode', HDPrivateKey.ChainCodeSize); + checkBuffer('privateKey', HDPrivateKey.PrivateKeySize); + if (arg.checksum && arg.checksum.length) { + checkBuffer('checksum', HDPrivateKey.CheckSumSize); + } +}; + +/** + * Returns the string representation of this private key (a string starting + * with "xprv..." + * + * @return string + */ +HDPrivateKey.prototype.toString = function() { + return this.xprivkey; +}; + +/** + * Returns the console representation of this extended private key. + * @return string + */ +HDPrivateKey.prototype.inspect = function() { + return ''; +}; + +/** + * Returns a plain object with a representation of this private key. + * + * Fields include:
    + *
  • network: either 'livenet' or 'testnet' + *
  • depth: a number ranging from 0 to 255 + *
  • fingerPrint: a number ranging from 0 to 2^32-1, taken from the hash of the + *
  • associated public key + *
  • parentFingerPrint: a number ranging from 0 to 2^32-1, taken from the hash + *
  • of this parent's associated public key or zero. + *
  • childIndex: the index from which this child was derived (or zero) + *
  • chainCode: an hexa string representing a number used in the derivation + *
  • privateKey: the private key associated, in hexa representation + *
  • xprivkey: the representation of this extended private key in checksum + *
  • base58 format + *
  • checksum: the base58 checksum of xprivkey + *
+ * @return {Object} + */ +HDPrivateKey.prototype.toObject = HDPrivateKey.prototype.toJSON = function toObject() { + return { + network: Network.get(BufferUtil.integerFromBuffer(this._buffers.version), 'xprivkey').name, + depth: BufferUtil.integerFromSingleByteBuffer(this._buffers.depth), + fingerPrint: BufferUtil.integerFromBuffer(this.fingerPrint), + parentFingerPrint: BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint), + childIndex: BufferUtil.integerFromBuffer(this._buffers.childIndex), + chainCode: BufferUtil.bufferToHex(this._buffers.chainCode), + privateKey: this.privateKey.toBuffer().toString('hex'), + checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + xprivkey: this.xprivkey + }; +}; + +/** + * Build a HDPrivateKey from a buffer + * + * @param {Buffer} arg + * @return {HDPrivateKey} + */ +HDPrivateKey.fromBuffer = function(arg) { + return new HDPrivateKey(arg.toString()); +}; + +/** + * Returns a buffer representation of the HDPrivateKey + * + * @return {string} + */ +HDPrivateKey.prototype.toBuffer = function() { + return BufferUtil.copy(this._buffers.xprivkey); +}; + +HDPrivateKey.DefaultDepth = 0; +HDPrivateKey.DefaultFingerprint = 0; +HDPrivateKey.DefaultChildIndex = 0; +HDPrivateKey.Hardened = 0x80000000; +HDPrivateKey.MaxIndex = 2 * HDPrivateKey.Hardened; + +HDPrivateKey.RootElementAlias = ['m', 'M', 'm\'', 'M\'']; + +HDPrivateKey.VersionSize = 4; +HDPrivateKey.DepthSize = 1; +HDPrivateKey.ParentFingerPrintSize = 4; +HDPrivateKey.ChildIndexSize = 4; +HDPrivateKey.ChainCodeSize = 32; +HDPrivateKey.PrivateKeySize = 32; +HDPrivateKey.CheckSumSize = 4; + +HDPrivateKey.DataLength = 78; +HDPrivateKey.SerializedByteSize = 82; + +HDPrivateKey.VersionStart = 0; +HDPrivateKey.VersionEnd = HDPrivateKey.VersionStart + HDPrivateKey.VersionSize; +HDPrivateKey.DepthStart = HDPrivateKey.VersionEnd; +HDPrivateKey.DepthEnd = HDPrivateKey.DepthStart + HDPrivateKey.DepthSize; +HDPrivateKey.ParentFingerPrintStart = HDPrivateKey.DepthEnd; +HDPrivateKey.ParentFingerPrintEnd = HDPrivateKey.ParentFingerPrintStart + HDPrivateKey.ParentFingerPrintSize; +HDPrivateKey.ChildIndexStart = HDPrivateKey.ParentFingerPrintEnd; +HDPrivateKey.ChildIndexEnd = HDPrivateKey.ChildIndexStart + HDPrivateKey.ChildIndexSize; +HDPrivateKey.ChainCodeStart = HDPrivateKey.ChildIndexEnd; +HDPrivateKey.ChainCodeEnd = HDPrivateKey.ChainCodeStart + HDPrivateKey.ChainCodeSize; +HDPrivateKey.PrivateKeyStart = HDPrivateKey.ChainCodeEnd + 1; +HDPrivateKey.PrivateKeyEnd = HDPrivateKey.PrivateKeyStart + HDPrivateKey.PrivateKeySize; +HDPrivateKey.ChecksumStart = HDPrivateKey.PrivateKeyEnd; +HDPrivateKey.ChecksumEnd = HDPrivateKey.ChecksumStart + HDPrivateKey.CheckSumSize; + +assert(HDPrivateKey.ChecksumEnd === HDPrivateKey.SerializedByteSize); + +module.exports = HDPrivateKey; diff --git a/packages/kauri-bitcore-lib/lib/hdpublickey.js b/packages/kauri-bitcore-lib/lib/hdpublickey.js new file mode 100644 index 0000000..39b632e --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/hdpublickey.js @@ -0,0 +1,496 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('./util/preconditions'); + +var BN = require('./crypto/bn'); +var Base58 = require('./encoding/base58'); +var Base58Check = require('./encoding/base58check'); +var Hash = require('./crypto/hash'); +var HDPrivateKey = require('./hdprivatekey'); +var Network = require('./networks'); +var Point = require('./crypto/point'); +var PublicKey = require('./publickey'); + +var bitcoreErrors = require('./errors'); +var errors = bitcoreErrors; +var hdErrors = bitcoreErrors.HDPublicKey; +var assert = require('assert'); + +var JSUtil = require('./util/js'); +var BufferUtil = require('./util/buffer'); + +/** + * The representation of an hierarchically derived public key. + * + * See https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki + * + * @constructor + * @param {Object|string|Buffer} arg + */ +function HDPublicKey(arg) { + /* jshint maxcomplexity: 12 */ + /* jshint maxstatements: 20 */ + if (arg instanceof HDPublicKey) { + return arg; + } + if (!(this instanceof HDPublicKey)) { + return new HDPublicKey(arg); + } + if (arg) { + if (_.isString(arg) || BufferUtil.isBuffer(arg)) { + var error = HDPublicKey.getSerializedError(arg); + if (!error) { + return this._buildFromSerialized(arg); + } else if (BufferUtil.isBuffer(arg) && !HDPublicKey.getSerializedError(arg.toString())) { + return this._buildFromSerialized(arg.toString()); + } else { + if (error instanceof hdErrors.ArgumentIsPrivateExtended) { + return new HDPrivateKey(arg).hdPublicKey; + } + throw error; + } + } else { + if (_.isObject(arg)) { + if (arg instanceof HDPrivateKey) { + return this._buildFromPrivate(arg); + } else { + return this._buildFromObject(arg); + } + } else { + throw new hdErrors.UnrecognizedArgument(arg); + } + } + } else { + throw new hdErrors.MustSupplyArgument(); + } +} + +/** + * Verifies that a given path is valid. + * + * @param {string|number} arg + * @return {boolean} + */ +HDPublicKey.isValidPath = function(arg) { + if (_.isString(arg)) { + var indexes = HDPrivateKey._getDerivationIndexes(arg); + return indexes !== null && _.every(indexes, HDPublicKey.isValidPath); + } + + if (_.isNumber(arg)) { + return arg >= 0 && arg < HDPublicKey.Hardened; + } + + return false; +}; + +/** + * WARNING: This method is deprecated. Use deriveChild instead. + * + * + * Get a derivated child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same public key), "m/0/1/40/2/1000". + * + * Note that hardened keys can't be derived from a public extended key. + * + * If the first argument is a number, the child with that index will be + * derived. See the example usage for clarification. + * + * @example + * ```javascript + * var parent = new HDPublicKey('xpub...'); + * var child_0_1_2 = parent.derive(0).derive(1).derive(2); + * var copy_of_child_0_1_2 = parent.derive("m/0/1/2"); + * assert(child_0_1_2.xprivkey === copy_of_child_0_1_2); + * ``` + * + * @param {string|number} arg + */ +HDPublicKey.prototype.derive = function(arg, hardened) { + return this.deriveChild(arg, hardened); +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0. + * + * + * Get a derivated child based on a string or number. + * + * If the first argument is a string, it's parsed as the full path of + * derivation. Valid values for this argument include "m" (which returns the + * same public key), "m/0/1/40/2/1000". + * + * Note that hardened keys can't be derived from a public extended key. + * + * If the first argument is a number, the child with that index will be + * derived. See the example usage for clarification. + * + * @example + * ```javascript + * var parent = new HDPublicKey('xpub...'); + * var child_0_1_2 = parent.deriveChild(0).deriveChild(1).deriveChild(2); + * var copy_of_child_0_1_2 = parent.deriveChild("m/0/1/2"); + * assert(child_0_1_2.xprivkey === copy_of_child_0_1_2); + * ``` + * + * @param {string|number} arg + */ +HDPublicKey.prototype.deriveChild = function(arg, hardened) { + if (_.isNumber(arg)) { + return this._deriveWithNumber(arg, hardened); + } else if (_.isString(arg)) { + return this._deriveFromString(arg); + } else { + throw new hdErrors.InvalidDerivationArgument(arg); + } +}; + +HDPublicKey.prototype._deriveWithNumber = function(index, hardened) { + if (index >= HDPublicKey.Hardened || hardened) { + throw new hdErrors.InvalidIndexCantDeriveHardened(); + } + if (index < 0) { + throw new hdErrors.InvalidPath(index); + } + + var indexBuffer = BufferUtil.integerAsBuffer(index); + var data = BufferUtil.concat([this.publicKey.toBuffer(), indexBuffer]); + var hash = Hash.sha512hmac(data, this._buffers.chainCode); + var leftPart = BN.fromBuffer(hash.slice(0, 32), {size: 32}); + var chainCode = hash.slice(32, 64); + + var publicKey; + try { + publicKey = PublicKey.fromPoint(Point.getG().mul(leftPart).add(this.publicKey.point)); + } catch (e) { + return this._deriveWithNumber(index + 1); + } + + var derived = new HDPublicKey({ + network: this.network, + depth: this.depth + 1, + parentFingerPrint: this.fingerPrint, + childIndex: index, + chainCode: chainCode, + publicKey: publicKey + }); + + return derived; +}; + +HDPublicKey.prototype._deriveFromString = function(path) { + /* jshint maxcomplexity: 8 */ + if (_.includes(path, "'")) { + throw new hdErrors.InvalidIndexCantDeriveHardened(); + } else if (!HDPublicKey.isValidPath(path)) { + throw new hdErrors.InvalidPath(path); + } + + var indexes = HDPrivateKey._getDerivationIndexes(path); + var derived = indexes.reduce(function(prev, index) { + return prev._deriveWithNumber(index); + }, this); + + return derived; +}; + +/** + * Verifies that a given serialized public key in base58 with checksum format + * is valid. + * + * @param {string|Buffer} data - the serialized public key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {boolean} + */ +HDPublicKey.isValidSerialized = function(data, network) { + return _.isNull(HDPublicKey.getSerializedError(data, network)); +}; + +/** + * Checks what's the error that causes the validation of a serialized public key + * in base58 with checksum to fail. + * + * @param {string|Buffer} data - the serialized public key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {errors|null} + */ +HDPublicKey.getSerializedError = function(data, network) { + /* jshint maxcomplexity: 10 */ + /* jshint maxstatements: 20 */ + if (!(_.isString(data) || BufferUtil.isBuffer(data))) { + return new hdErrors.UnrecognizedArgument('expected buffer or string'); + } + if (!Base58.validCharacters(data)) { + return new errors.InvalidB58Char('(unknown)', data); + } + try { + data = Base58Check.decode(data); + } catch (e) { + return new errors.InvalidB58Checksum(data); + } + if (data.length !== HDPublicKey.DataSize) { + return new hdErrors.InvalidLength(data); + } + if (!_.isUndefined(network)) { + var error = HDPublicKey._validateNetwork(data, network); + if (error) { + return error; + } + } + var version = BufferUtil.integerFromBuffer(data.slice(0, 4)); + if (version === Network.livenet.xprivkey || version === Network.testnet.xprivkey ) { + return new hdErrors.ArgumentIsPrivateExtended(); + } + return null; +}; + +HDPublicKey._validateNetwork = function(data, networkArg) { + var network = Network.get(networkArg); + if (!network) { + return new errors.InvalidNetworkArgument(networkArg); + } + var version = data.slice(HDPublicKey.VersionStart, HDPublicKey.VersionEnd); + if (BufferUtil.integerFromBuffer(version) !== network.xpubkey) { + return new errors.InvalidNetwork(version); + } + return null; +}; + +HDPublicKey.prototype._buildFromPrivate = function (arg) { + var args = _.clone(arg._buffers); + var point = Point.getG().mul(BN.fromBuffer(args.privateKey)); + args.publicKey = Point.pointToCompressed(point); + args.version = BufferUtil.integerAsBuffer(Network.get(BufferUtil.integerFromBuffer(args.version)).xpubkey); + args.privateKey = undefined; + args.checksum = undefined; + args.xprivkey = undefined; + return this._buildFromBuffers(args); +}; + +HDPublicKey.prototype._buildFromObject = function(arg) { + /* jshint maxcomplexity: 10 */ + // TODO: Type validation + var buffers = { + version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xpubkey) : arg.version, + depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth, + parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint, + childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex, + chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode, + publicKey: _.isString(arg.publicKey) ? BufferUtil.hexToBuffer(arg.publicKey) : + BufferUtil.isBuffer(arg.publicKey) ? arg.publicKey : arg.publicKey.toBuffer(), + checksum: _.isNumber(arg.checksum) ? BufferUtil.integerAsBuffer(arg.checksum) : arg.checksum + }; + return this._buildFromBuffers(buffers); +}; + +HDPublicKey.prototype._buildFromSerialized = function(arg) { + var decoded = Base58Check.decode(arg); + var buffers = { + version: decoded.slice(HDPublicKey.VersionStart, HDPublicKey.VersionEnd), + depth: decoded.slice(HDPublicKey.DepthStart, HDPublicKey.DepthEnd), + parentFingerPrint: decoded.slice(HDPublicKey.ParentFingerPrintStart, + HDPublicKey.ParentFingerPrintEnd), + childIndex: decoded.slice(HDPublicKey.ChildIndexStart, HDPublicKey.ChildIndexEnd), + chainCode: decoded.slice(HDPublicKey.ChainCodeStart, HDPublicKey.ChainCodeEnd), + publicKey: decoded.slice(HDPublicKey.PublicKeyStart, HDPublicKey.PublicKeyEnd), + checksum: decoded.slice(HDPublicKey.ChecksumStart, HDPublicKey.ChecksumEnd), + xpubkey: arg + }; + return this._buildFromBuffers(buffers); +}; + +/** + * Receives a object with buffers in all the properties and populates the + * internal structure + * + * @param {Object} arg + * @param {buffer.Buffer} arg.version + * @param {buffer.Buffer} arg.depth + * @param {buffer.Buffer} arg.parentFingerPrint + * @param {buffer.Buffer} arg.childIndex + * @param {buffer.Buffer} arg.chainCode + * @param {buffer.Buffer} arg.publicKey + * @param {buffer.Buffer} arg.checksum + * @param {string=} arg.xpubkey - if set, don't recalculate the base58 + * representation + * @return {HDPublicKey} this + */ +HDPublicKey.prototype._buildFromBuffers = function(arg) { + /* jshint maxcomplexity: 8 */ + /* jshint maxstatements: 20 */ + + HDPublicKey._validateBufferArguments(arg); + + JSUtil.defineImmutable(this, { + _buffers: arg + }); + + var sequence = [ + arg.version, arg.depth, arg.parentFingerPrint, arg.childIndex, arg.chainCode, + arg.publicKey + ]; + var concat = BufferUtil.concat(sequence); + var checksum = Base58Check.checksum(concat); + if (!arg.checksum || !arg.checksum.length) { + arg.checksum = checksum; + } else { + if (arg.checksum.toString('hex') !== checksum.toString('hex')) { + throw new errors.InvalidB58Checksum(concat, checksum); + } + } + var network = Network.get(BufferUtil.integerFromBuffer(arg.version)); + + var xpubkey; + xpubkey = Base58Check.encode(BufferUtil.concat(sequence)); + arg.xpubkey = Buffer.from(xpubkey); + + var publicKey = new PublicKey(arg.publicKey, {network: network}); + var size = HDPublicKey.ParentFingerPrintSize; + var fingerPrint = Hash.sha256ripemd160(publicKey.toBuffer()).slice(0, size); + + JSUtil.defineImmutable(this, { + xpubkey: xpubkey, + network: network, + depth: BufferUtil.integerFromSingleByteBuffer(arg.depth), + publicKey: publicKey, + fingerPrint: fingerPrint + }); + + return this; +}; + +HDPublicKey._validateBufferArguments = function(arg) { + var checkBuffer = function(name, size) { + var buff = arg[name]; + assert(BufferUtil.isBuffer(buff), name + ' argument is not a buffer, it\'s ' + typeof buff); + assert( + buff.length === size, + name + ' has not the expected size: found ' + buff.length + ', expected ' + size + ); + }; + checkBuffer('version', HDPublicKey.VersionSize); + checkBuffer('depth', HDPublicKey.DepthSize); + checkBuffer('parentFingerPrint', HDPublicKey.ParentFingerPrintSize); + checkBuffer('childIndex', HDPublicKey.ChildIndexSize); + checkBuffer('chainCode', HDPublicKey.ChainCodeSize); + checkBuffer('publicKey', HDPublicKey.PublicKeySize); + if (arg.checksum && arg.checksum.length) { + checkBuffer('checksum', HDPublicKey.CheckSumSize); + } +}; + +HDPublicKey.fromString = function(arg) { + $.checkArgument(_.isString(arg), 'No valid string was provided'); + return new HDPublicKey(arg); +}; + +HDPublicKey.fromObject = function(arg) { + $.checkArgument(_.isObject(arg), 'No valid argument was provided'); + return new HDPublicKey(arg); +}; + +/** + * Returns the base58 checked representation of the public key + * @return {string} a string starting with "xpub..." in livenet + */ +HDPublicKey.prototype.toString = function() { + return this.xpubkey; +}; + +/** + * Returns the console representation of this extended public key. + * @return string + */ +HDPublicKey.prototype.inspect = function() { + return ''; +}; + +/** + * Returns a plain JavaScript object with information to reconstruct a key. + * + * Fields are:
    + *
  • network: 'livenet' or 'testnet' + *
  • depth: a number from 0 to 255, the depth to the master extended key + *
  • fingerPrint: a number of 32 bits taken from the hash of the public key + *
  • fingerPrint: a number of 32 bits taken from the hash of this key's + *
  • parent's public key + *
  • childIndex: index with which this key was derived + *
  • chainCode: string in hexa encoding used for derivation + *
  • publicKey: string, hexa encoded, in compressed key format + *
  • checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + *
  • xpubkey: the string with the base58 representation of this extended key + *
  • checksum: the base58 checksum of xpubkey + *
+ */ +HDPublicKey.prototype.toObject = HDPublicKey.prototype.toJSON = function toObject() { + return { + network: Network.get(BufferUtil.integerFromBuffer(this._buffers.version)).name, + depth: BufferUtil.integerFromSingleByteBuffer(this._buffers.depth), + fingerPrint: BufferUtil.integerFromBuffer(this.fingerPrint), + parentFingerPrint: BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint), + childIndex: BufferUtil.integerFromBuffer(this._buffers.childIndex), + chainCode: BufferUtil.bufferToHex(this._buffers.chainCode), + publicKey: this.publicKey.toString(), + checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + xpubkey: this.xpubkey + }; +}; + +/** + * Create a HDPublicKey from a buffer argument + * + * @param {Buffer} arg + * @return {HDPublicKey} + */ +HDPublicKey.fromBuffer = function(arg) { + return new HDPublicKey(arg); +}; + +/** + * Return a buffer representation of the xpubkey + * + * @return {Buffer} + */ +HDPublicKey.prototype.toBuffer = function() { + return BufferUtil.copy(this._buffers.xpubkey); +}; + +HDPublicKey.Hardened = 0x80000000; +HDPublicKey.RootElementAlias = ['m', 'M']; + +HDPublicKey.VersionSize = 4; +HDPublicKey.DepthSize = 1; +HDPublicKey.ParentFingerPrintSize = 4; +HDPublicKey.ChildIndexSize = 4; +HDPublicKey.ChainCodeSize = 32; +HDPublicKey.PublicKeySize = 33; +HDPublicKey.CheckSumSize = 4; + +HDPublicKey.DataSize = 78; +HDPublicKey.SerializedByteSize = 82; + +HDPublicKey.VersionStart = 0; +HDPublicKey.VersionEnd = HDPublicKey.VersionStart + HDPublicKey.VersionSize; +HDPublicKey.DepthStart = HDPublicKey.VersionEnd; +HDPublicKey.DepthEnd = HDPublicKey.DepthStart + HDPublicKey.DepthSize; +HDPublicKey.ParentFingerPrintStart = HDPublicKey.DepthEnd; +HDPublicKey.ParentFingerPrintEnd = HDPublicKey.ParentFingerPrintStart + HDPublicKey.ParentFingerPrintSize; +HDPublicKey.ChildIndexStart = HDPublicKey.ParentFingerPrintEnd; +HDPublicKey.ChildIndexEnd = HDPublicKey.ChildIndexStart + HDPublicKey.ChildIndexSize; +HDPublicKey.ChainCodeStart = HDPublicKey.ChildIndexEnd; +HDPublicKey.ChainCodeEnd = HDPublicKey.ChainCodeStart + HDPublicKey.ChainCodeSize; +HDPublicKey.PublicKeyStart = HDPublicKey.ChainCodeEnd; +HDPublicKey.PublicKeyEnd = HDPublicKey.PublicKeyStart + HDPublicKey.PublicKeySize; +HDPublicKey.ChecksumStart = HDPublicKey.PublicKeyEnd; +HDPublicKey.ChecksumEnd = HDPublicKey.ChecksumStart + HDPublicKey.CheckSumSize; + +assert(HDPublicKey.PublicKeyEnd === HDPublicKey.DataSize); +assert(HDPublicKey.ChecksumEnd === HDPublicKey.SerializedByteSize); + +module.exports = HDPublicKey; diff --git a/packages/kauri-bitcore-lib/lib/networks.js b/packages/kauri-bitcore-lib/lib/networks.js new file mode 100644 index 0000000..affe678 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/networks.js @@ -0,0 +1,269 @@ +'use strict'; +var _ = require('lodash'); + +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); +var networks = []; +var networkMaps = {}; + +/** + * A network is merely a map containing values that correspond to version + * numbers for each bitcoin network. Currently only supporting "livenet" + * (a.k.a. "mainnet") and "testnet". + * @constructor + */ +function Network() {} + +Network.prototype.toString = function toString() { + return this.name; +}; + +/** + * @function + * @member Networks#get + * Retrieves the network associated with a magic number or string. + * @param {string|number|Network} arg + * @param {string|Array} keys - if set, only check if the magic number associated with this name matches + * @return Network + */ +function get(arg, keys) { + if (~networks.indexOf(arg)) { + return arg; + } + if (keys) { + if (!_.isArray(keys)) { + keys = [keys]; + } + var containsArg = function(key) { + return networks[index][key] === arg; + }; + for (var index in networks) { + if (_.some(keys, containsArg)) { + return networks[index]; + } + } + return undefined; + } + return networkMaps[arg]; +} + +/** + * @function + * @member Networks#add + * Will add a custom Network + * @param {Object} data + * @param {string} data.name - The name of the network + * @param {string} data.alias - The aliased name of the network + * @param {Number} data.pubkeyhash - The publickey hash prefix + * @param {Number} data.privatekey - The privatekey prefix + * @param {Number} data.scripthash - The scripthash prefix + * @param {Number} data.xpubkey - The extended public key magic + * @param {Number} data.xprivkey - The extended private key magic + * @param {Number} data.networkMagic - The network magic number + * @param {Number} data.port - The network port + * @param {Array} data.dnsSeeds - An array of dns seeds + * @return Network + */ +function addNetwork(data) { + + var network = new Network(); + + JSUtil.defineImmutable(network, { + name: data.name, + alias: data.alias, + pubkeyhash: data.pubkeyhash, + privatekey: data.privatekey, + scripthash: data.scripthash, + xpubkey: data.xpubkey, + xprivkey: data.xprivkey + }); + + if (data.networkMagic) { + JSUtil.defineImmutable(network, { + networkMagic: BufferUtil.integerAsBuffer(data.networkMagic) + }); + } + + if (data.port) { + JSUtil.defineImmutable(network, { + port: data.port + }); + } + + if (data.dnsSeeds) { + JSUtil.defineImmutable(network, { + dnsSeeds: data.dnsSeeds + }); + } + _.each(network, function(value) { + if (!_.isUndefined(value) && !_.isObject(value)) { + networkMaps[value] = network; + } + }); + + networks.push(network); + + return network; + +} + +/** + * @function + * @member Networks#remove + * Will remove a custom network + * @param {Network} network + */ +function removeNetwork(network) { + for (var i = 0; i < networks.length; i++) { + if (networks[i] === network) { + networks.splice(i, 1); + } + } + for (var key in networkMaps) { + if (networkMaps[key] === network) { + delete networkMaps[key]; + } + } +} + +addNetwork({ + name: 'livenet', + alias: 'mainnet', + pubkeyhash: 0x00, + privatekey: 0x80, + scripthash: 0x05, + xpubkey: 0x0488b21e, + xprivkey: 0x0488ade4, + networkMagic: 0xf9beb4d9, + port: 8333, + dnsSeeds: [ + 'seed.bitcoin.sipa.be', + 'dnsseed.bluematt.me', + 'dnsseed.bitcoin.dashjr.org', + 'seed.bitcoinstats.com', + 'seed.bitnodes.io', + 'bitseed.xf2.org' + ] +}); + +/** + * @instance + * @member Networks#livenet + */ +var livenet = get('livenet'); + +addNetwork({ + name: 'testnet', + alias: 'regtest', + pubkeyhash: 0x6f, + privatekey: 0xef, + scripthash: 0xc4, + xpubkey: 0x043587cf, + xprivkey: 0x04358394 +}); + +/** + * @instance + * @member Networks#testnet + */ +var testnet = get('testnet'); + +// Add configurable values for testnet/regtest + +var TESTNET = { + PORT: 18333, + NETWORK_MAGIC: BufferUtil.integerAsBuffer(0x0b110907), + DNS_SEEDS: [ + 'testnet-seed.bitcoin.petertodd.org', + 'testnet-seed.bluematt.me', + 'testnet-seed.alexykot.me', + 'testnet-seed.bitcoin.schildbach.de' + ] +}; + +for (var key in TESTNET) { + if (!_.isObject(TESTNET[key])) { + networkMaps[TESTNET[key]] = testnet; + } +} + +var REGTEST = { + PORT: 18444, + NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfabfb5da), + DNS_SEEDS: [] +}; + +for (var key in REGTEST) { + if (!_.isObject(REGTEST[key])) { + networkMaps[REGTEST[key]] = testnet; + } +} + +Object.defineProperty(testnet, 'port', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.PORT; + } else { + return TESTNET.PORT; + } + } +}); + +Object.defineProperty(testnet, 'networkMagic', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.NETWORK_MAGIC; + } else { + return TESTNET.NETWORK_MAGIC; + } + } +}); + +Object.defineProperty(testnet, 'dnsSeeds', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.DNS_SEEDS; + } else { + return TESTNET.DNS_SEEDS; + } + } +}); + +/** + * @function + * @member Networks#enableRegtest + * Will enable regtest features for testnet + */ +function enableRegtest() { + testnet.regtestEnabled = true; +} + +/** + * @function + * @member Networks#disableRegtest + * Will disable regtest features for testnet + */ +function disableRegtest() { + testnet.regtestEnabled = false; +} + +/** + * @namespace Networks + */ +module.exports = { + add: addNetwork, + remove: removeNetwork, + defaultNetwork: livenet, + livenet: livenet, + mainnet: livenet, + testnet: testnet, + get: get, + enableRegtest: enableRegtest, + disableRegtest: disableRegtest +}; diff --git a/packages/kauri-bitcore-lib/lib/opcode.js b/packages/kauri-bitcore-lib/lib/opcode.js new file mode 100644 index 0000000..d3f08d6 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/opcode.js @@ -0,0 +1,248 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('./util/preconditions'); +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); + +function Opcode(num) { + if (!(this instanceof Opcode)) { + return new Opcode(num); + } + + var value; + + if (_.isNumber(num)) { + value = num; + } else if (_.isString(num)) { + value = Opcode.map[num]; + } else { + throw new TypeError('Unrecognized num type: "' + typeof(num) + '" for Opcode'); + } + + JSUtil.defineImmutable(this, { + num: value + }); + + return this; +} + +Opcode.fromBuffer = function(buf) { + $.checkArgument(BufferUtil.isBuffer(buf)); + return new Opcode(Number('0x' + buf.toString('hex'))); +}; + +Opcode.fromNumber = function(num) { + $.checkArgument(_.isNumber(num)); + return new Opcode(num); +}; + +Opcode.fromString = function(str) { + $.checkArgument(_.isString(str)); + var value = Opcode.map[str]; + if (typeof value === 'undefined') { + throw new TypeError('Invalid opcodestr'); + } + return new Opcode(value); +}; + +Opcode.prototype.toHex = function() { + return this.num.toString(16); +}; + +Opcode.prototype.toBuffer = function() { + return Buffer.from(this.toHex(), 'hex'); +}; + +Opcode.prototype.toNumber = function() { + return this.num; +}; + +Opcode.prototype.toString = function() { + var str = Opcode.reverseMap[this.num]; + if (typeof str === 'undefined') { + throw new Error('Opcode does not have a string representation'); + } + return str; +}; + +Opcode.smallInt = function(n) { + $.checkArgument(_.isNumber(n), 'Invalid Argument: n should be number'); + $.checkArgument(n >= 0 && n <= 16, 'Invalid Argument: n must be between 0 and 16'); + if (n === 0) { + return Opcode('OP_0'); + } + return new Opcode(Opcode.map.OP_1 + n - 1); +}; + +Opcode.map = { + // push value + OP_FALSE: 0, + OP_0: 0, + OP_PUSHDATA1: 76, + OP_PUSHDATA2: 77, + OP_PUSHDATA4: 78, + OP_1NEGATE: 79, + OP_RESERVED: 80, + OP_TRUE: 81, + OP_1: 81, + OP_2: 82, + OP_3: 83, + OP_4: 84, + OP_5: 85, + OP_6: 86, + OP_7: 87, + OP_8: 88, + OP_9: 89, + OP_10: 90, + OP_11: 91, + OP_12: 92, + OP_13: 93, + OP_14: 94, + OP_15: 95, + OP_16: 96, + + // control + OP_NOP: 97, + OP_VER: 98, + OP_IF: 99, + OP_NOTIF: 100, + OP_VERIF: 101, + OP_VERNOTIF: 102, + OP_ELSE: 103, + OP_ENDIF: 104, + OP_VERIFY: 105, + OP_RETURN: 106, + + // stack ops + OP_TOALTSTACK: 107, + OP_FROMALTSTACK: 108, + OP_2DROP: 109, + OP_2DUP: 110, + OP_3DUP: 111, + OP_2OVER: 112, + OP_2ROT: 113, + OP_2SWAP: 114, + OP_IFDUP: 115, + OP_DEPTH: 116, + OP_DROP: 117, + OP_DUP: 118, + OP_NIP: 119, + OP_OVER: 120, + OP_PICK: 121, + OP_ROLL: 122, + OP_ROT: 123, + OP_SWAP: 124, + OP_TUCK: 125, + + // splice ops + OP_CAT: 126, + OP_SUBSTR: 127, + OP_LEFT: 128, + OP_RIGHT: 129, + OP_SIZE: 130, + + // bit logic + OP_INVERT: 131, + OP_AND: 132, + OP_OR: 133, + OP_XOR: 134, + OP_EQUAL: 135, + OP_EQUALVERIFY: 136, + OP_RESERVED1: 137, + OP_RESERVED2: 138, + + // numeric + OP_1ADD: 139, + OP_1SUB: 140, + OP_2MUL: 141, + OP_2DIV: 142, + OP_NEGATE: 143, + OP_ABS: 144, + OP_NOT: 145, + OP_0NOTEQUAL: 146, + + OP_ADD: 147, + OP_SUB: 148, + OP_MUL: 149, + OP_DIV: 150, + OP_MOD: 151, + OP_LSHIFT: 152, + OP_RSHIFT: 153, + + OP_BOOLAND: 154, + OP_BOOLOR: 155, + OP_NUMEQUAL: 156, + OP_NUMEQUALVERIFY: 157, + OP_NUMNOTEQUAL: 158, + OP_LESSTHAN: 159, + OP_GREATERTHAN: 160, + OP_LESSTHANOREQUAL: 161, + OP_GREATERTHANOREQUAL: 162, + OP_MIN: 163, + OP_MAX: 164, + + OP_WITHIN: 165, + + // crypto + OP_RIPEMD160: 166, + OP_SHA1: 167, + OP_SHA256: 168, + OP_HASH160: 169, + OP_HASH256: 170, + OP_CODESEPARATOR: 171, + OP_CHECKSIG: 172, + OP_CHECKSIGVERIFY: 173, + OP_CHECKMULTISIG: 174, + OP_CHECKMULTISIGVERIFY: 175, + + OP_CHECKLOCKTIMEVERIFY: 177, + + // expansion + OP_NOP1: 176, + OP_NOP2: 177, + OP_NOP3: 178, + OP_NOP4: 179, + OP_NOP5: 180, + OP_NOP6: 181, + OP_NOP7: 182, + OP_NOP8: 183, + OP_NOP9: 184, + OP_NOP10: 185, + + // template matching params + OP_PUBKEYHASH: 253, + OP_PUBKEY: 254, + OP_INVALIDOPCODE: 255 +}; + +Opcode.reverseMap = []; + +for (var k in Opcode.map) { + Opcode.reverseMap[Opcode.map[k]] = k; +} + +// Easier access to opcodes +_.extend(Opcode, Opcode.map); + +/** + * @returns true if opcode is one of OP_0, OP_1, ..., OP_16 + */ +Opcode.isSmallIntOp = function(opcode) { + if (opcode instanceof Opcode) { + opcode = opcode.toNumber(); + } + return ((opcode === Opcode.map.OP_0) || + ((opcode >= Opcode.map.OP_1) && (opcode <= Opcode.map.OP_16))); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Script opcode + */ +Opcode.prototype.inspect = function() { + return ''; +}; + +module.exports = Opcode; diff --git a/packages/kauri-bitcore-lib/lib/privatekey.js b/packages/kauri-bitcore-lib/lib/privatekey.js new file mode 100644 index 0000000..95a3bc5 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/privatekey.js @@ -0,0 +1,400 @@ +'use strict'; + +var _ = require('lodash'); +var Address = require('./address'); +var Base58Check = require('./encoding/base58check'); +var BN = require('./crypto/bn'); +var JSUtil = require('./util/js'); +var Networks = require('./networks'); +var Point = require('./crypto/point'); +var PublicKey = require('./publickey'); +var Random = require('./crypto/random'); +var $ = require('./util/preconditions'); + +/** + * Instantiate a PrivateKey from a BN, Buffer and WIF. + * + * @example + * ```javascript + * // generate a new random key + * var key = PrivateKey(); + * + * // get the associated address + * var address = key.toAddress(); + * + * // encode into wallet export format + * var exported = key.toWIF(); + * + * // instantiate from the exported (and saved) private key + * var imported = PrivateKey.fromWIF(exported); + * ``` + * + * @param {string} data - The encoded data in various formats + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {PrivateKey} A new valid instance of an PrivateKey + * @constructor + */ +function PrivateKey(data, network) { + /* jshint maxstatements: 20 */ + /* jshint maxcomplexity: 8 */ + + if (!(this instanceof PrivateKey)) { + return new PrivateKey(data, network); + } + if (data instanceof PrivateKey) { + return data; + } + + var info = this._classifyArguments(data, network); + + // validation + if (!info.bn || info.bn.cmp(new BN(0)) === 0){ + throw new TypeError('Number can not be equal to zero, undefined, null or false'); + } + if (!info.bn.lt(Point.getN())) { + throw new TypeError('Number must be less than N'); + } + if (typeof(info.network) === 'undefined') { + throw new TypeError('Must specify the network ("livenet" or "testnet")'); + } + + JSUtil.defineImmutable(this, { + bn: info.bn, + compressed: info.compressed, + network: info.network + }); + + Object.defineProperty(this, 'publicKey', { + configurable: false, + enumerable: true, + get: this.toPublicKey.bind(this) + }); + + return this; + +}; + +/** + * Internal helper to instantiate PrivateKey internal `info` object from + * different kinds of arguments passed to the constructor. + * + * @param {*} data + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @return {Object} + */ +PrivateKey.prototype._classifyArguments = function(data, network) { + /* jshint maxcomplexity: 10 */ + var info = { + compressed: true, + network: network ? Networks.get(network) : Networks.defaultNetwork + }; + + // detect type of data + if (_.isUndefined(data) || _.isNull(data)){ + info.bn = PrivateKey._getRandomBN(); + } else if (data instanceof BN) { + info.bn = data; + } else if (data instanceof Buffer || data instanceof Uint8Array) { + info = PrivateKey._transformBuffer(data, network); + } else if (data.bn && data.network){ + info = PrivateKey._transformObject(data); + } else if (!network && Networks.get(data)) { + info.bn = PrivateKey._getRandomBN(); + info.network = Networks.get(data); + } else if (typeof(data) === 'string'){ + if (JSUtil.isHexa(data)) { + info.bn = new BN(Buffer.from(data, 'hex')); + } else { + info = PrivateKey._transformWIF(data, network); + } + } else { + throw new TypeError('First argument is an unrecognized data type.'); + } + return info; +}; + +/** + * Internal function to get a random Big Number (BN) + * + * @returns {BN} A new randomly generated BN + * @private + */ +PrivateKey._getRandomBN = function(){ + var condition; + var bn; + do { + var privbuf = Random.getRandomBuffer(32); + bn = BN.fromBuffer(privbuf); + condition = bn.lt(Point.getN()); + } while (!condition); + return bn; +}; + +/** + * Internal function to transform a WIF Buffer into a private key + * + * @param {Buffer} buf - An WIF string + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {Object} An object with keys: bn, network and compressed + * @private + */ +PrivateKey._transformBuffer = function(buf, network) { + + var info = {}; + + if (buf.length === 32) { + return PrivateKey._transformBNBuffer(buf, network); + } + + info.network = Networks.get(buf[0], 'privatekey'); + + if (!info.network) { + throw new Error('Invalid network'); + } + + if (network && info.network !== Networks.get(network)) { + throw new TypeError('Private key network mismatch'); + } + + if (buf.length === 1 + 32 + 1 && buf[1 + 32 + 1 - 1] === 1) { + info.compressed = true; + } else if (buf.length === 1 + 32) { + info.compressed = false; + } else { + throw new Error('Length of buffer must be 33 (uncompressed) or 34 (compressed)'); + } + + info.bn = BN.fromBuffer(buf.slice(1, 32 + 1)); + + return info; +}; + +/** + * Internal function to transform a BN buffer into a private key + * + * @param {Buffer} buf + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {object} an Object with keys: bn, network, and compressed + * @private + */ +PrivateKey._transformBNBuffer = function(buf, network) { + var info = {}; + info.network = Networks.get(network) || Networks.defaultNetwork; + info.bn = BN.fromBuffer(buf); + info.compressed = false; + return info; +}; + +/** + * Internal function to transform a WIF string into a private key + * + * @param {string} buf - An WIF string + * @returns {Object} An object with keys: bn, network and compressed + * @private + */ +PrivateKey._transformWIF = function(str, network) { + return PrivateKey._transformBuffer(Base58Check.decode(str), network); +}; + +/** + * Instantiate a PrivateKey from a Buffer with the DER or WIF representation + * + * @param {Buffer} arg + * @param {Network} network + * @return {PrivateKey} + */ +PrivateKey.fromBuffer = function(arg, network) { + return new PrivateKey(arg, network); +}; + +/** + * Internal function to transform a JSON string on plain object into a private key + * return this. + * + * @param {string} json - A JSON string or plain object + * @returns {Object} An object with keys: bn, network and compressed + * @private + */ +PrivateKey._transformObject = function(json) { + var bn = new BN(json.bn, 'hex'); + var network = Networks.get(json.network); + return { + bn: bn, + network: network, + compressed: json.compressed + }; +}; + +/** + * Instantiate a PrivateKey from a WIF string + * + * @param {string} str - The WIF encoded private key string + * @returns {PrivateKey} A new valid instance of PrivateKey + */ +PrivateKey.fromString = PrivateKey.fromWIF = function(str) { + $.checkArgument(_.isString(str), 'First argument is expected to be a string.'); + return new PrivateKey(str); +}; + +/** + * Instantiate a PrivateKey from a plain JavaScript object + * + * @param {Object} obj - The output from privateKey.toObject() + */ +PrivateKey.fromObject = function(obj) { + $.checkArgument(_.isObject(obj), 'First argument is expected to be an object.'); + return new PrivateKey(obj); +}; + +/** + * Instantiate a PrivateKey from random bytes + * + * @param {string=} network - Either "livenet" or "testnet" + * @returns {PrivateKey} A new valid instance of PrivateKey + */ +PrivateKey.fromRandom = function(network) { + var bn = PrivateKey._getRandomBN(); + return new PrivateKey(bn, network); +}; + +/** + * Check if there would be any errors when initializing a PrivateKey + * + * @param {string} data - The encoded data in various formats + * @param {string=} network - Either "livenet" or "testnet" + * @returns {null|Error} An error if exists + */ + +PrivateKey.getValidationError = function(data, network) { + var error; + try { + /* jshint nonew: false */ + new PrivateKey(data, network); + } catch (e) { + error = e; + } + return error; +}; + +/** + * Check if the parameters are valid + * + * @param {string} data - The encoded data in various formats + * @param {string=} network - Either "livenet" or "testnet" + * @returns {Boolean} If the private key is would be valid + */ +PrivateKey.isValid = function(data, network){ + if (!data) { + return false; + } + return !PrivateKey.getValidationError(data, network); +}; + +/** + * Will output the PrivateKey encoded as hex string + * + * @returns {string} + */ +PrivateKey.prototype.toString = function() { + return this.toBuffer().toString('hex'); +}; + +/** + * Will output the PrivateKey to a WIF string + * + * @returns {string} A WIP representation of the private key + */ +PrivateKey.prototype.toWIF = function() { + var network = this.network; + var compressed = this.compressed; + + var buf; + if (compressed) { + buf = Buffer.concat([Buffer.from([network.privatekey]), + this.bn.toBuffer({size: 32}), + Buffer.from([0x01])]); + } else { + buf = Buffer.concat([Buffer.from([network.privatekey]), + this.bn.toBuffer({size: 32})]); + } + + return Base58Check.encode(buf); +}; + +/** + * Will return the private key as a BN instance + * + * @returns {BN} A BN instance of the private key + */ +PrivateKey.prototype.toBigNumber = function(){ + return this.bn; +}; + +/** + * Will return the private key as a BN buffer + * + * @returns {Buffer} A buffer of the private key + */ +PrivateKey.prototype.toBuffer = function(){ + // TODO: use `return this.bn.toBuffer({ size: 32 })` in v1.0.0 + return this.bn.toBuffer(); +}; + +/** + * WARNING: This method will not be officially supported until v1.0.0. + * + * + * Will return the private key as a BN buffer without leading zero padding + * + * @returns {Buffer} A buffer of the private key + */ +PrivateKey.prototype.toBufferNoPadding = function() { + return this.bn.toBuffer(); +}; + +/** + * Will return the corresponding public key + * + * @returns {PublicKey} A public key generated from the private key + */ +PrivateKey.prototype.toPublicKey = function(){ + if (!this._pubkey) { + this._pubkey = PublicKey.fromPrivateKey(this); + } + return this._pubkey; +}; + +/** + * Will return an address for the private key + * @param {Network=} network - optional parameter specifying + * the desired network for the address + * + * @returns {Address} An address generated from the private key + */ +PrivateKey.prototype.toAddress = function(network) { + var pubkey = this.toPublicKey(); + return Address.fromPublicKey(pubkey, network || this.network); +}; + +/** + * @returns {Object} A plain object representation + */ +PrivateKey.prototype.toObject = PrivateKey.prototype.toJSON = function toObject() { + return { + bn: this.bn.toString('hex'), + compressed: this.compressed, + network: this.network.toString() + }; +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Private key + */ +PrivateKey.prototype.inspect = function() { + var uncompressed = !this.compressed ? ', uncompressed' : ''; + return ''; +}; + +module.exports = PrivateKey; diff --git a/packages/kauri-bitcore-lib/lib/publickey.js b/packages/kauri-bitcore-lib/lib/publickey.js new file mode 100644 index 0000000..35e4022 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/publickey.js @@ -0,0 +1,393 @@ +'use strict'; + +var BN = require('./crypto/bn'); +var Point = require('./crypto/point'); +var Hash = require('./crypto/hash'); +var JSUtil = require('./util/js'); +var Network = require('./networks'); +var _ = require('lodash'); +var $ = require('./util/preconditions'); + +/** + * Instantiate a PublicKey from a {@link PrivateKey}, {@link Point}, `string`, or `Buffer`. + * + * There are two internal properties, `network` and `compressed`, that deal with importing + * a PublicKey from a PrivateKey in WIF format. More details described on {@link PrivateKey} + * + * @example + * ```javascript + * // instantiate from a private key + * var key = PublicKey(privateKey, true); + * + * // export to as a DER hex encoded string + * var exported = key.toString(); + * + * // import the public key + * var imported = PublicKey.fromString(exported); + * ``` + * + * @param {string} data - The encoded data in various formats + * @param {Object} extra - additional options + * @param {Network=} extra.network - Which network should the address for this public key be for + * @param {String=} extra.compressed - If the public key is compressed + * @returns {PublicKey} A new valid instance of an PublicKey + * @constructor + */ +function PublicKey(data, extra) { + + if (!(this instanceof PublicKey)) { + return new PublicKey(data, extra); + } + + $.checkArgument(data, 'First argument is required, please include public key data.'); + + if (data instanceof PublicKey) { + // Return copy, but as it's an immutable object, return same argument + return data; + } + extra = extra || {}; + + var info = this._classifyArgs(data, extra); + + // validation + info.point.validate(); + + JSUtil.defineImmutable(this, { + point: info.point, + compressed: info.compressed, + network: info.network || Network.defaultNetwork + }); + + return this; +}; + +/** + * Internal function to differentiate between arguments passed to the constructor + * @param {*} data + * @param {Object} extra + */ +PublicKey.prototype._classifyArgs = function(data, extra) { + /* jshint maxcomplexity: 10 */ + var info = { + compressed: _.isUndefined(extra.compressed) || extra.compressed + }; + + // detect type of data + if (data instanceof Point) { + info.point = data; + } else if (data.x && data.y) { + info = PublicKey._transformObject(data); + } else if (typeof(data) === 'string') { + info = PublicKey._transformDER(Buffer.from(data, 'hex')); + } else if (PublicKey._isBuffer(data)) { + info = PublicKey._transformDER(data); + } else if (PublicKey._isPrivateKey(data)) { + info = PublicKey._transformPrivateKey(data); + } else { + throw new TypeError('First argument is an unrecognized data format.'); + } + if (!info.network) { + info.network = _.isUndefined(extra.network) ? undefined : Network.get(extra.network); + } + return info; +}; + +/** + * Internal function to detect if an object is a {@link PrivateKey} + * + * @param {*} param - object to test + * @returns {boolean} + * @private + */ +PublicKey._isPrivateKey = function(param) { + var PrivateKey = require('./privatekey'); + return param instanceof PrivateKey; +}; + +/** + * Internal function to detect if an object is a Buffer + * + * @param {*} param - object to test + * @returns {boolean} + * @private + */ +PublicKey._isBuffer = function(param) { + return (param instanceof Buffer) || (param instanceof Uint8Array); +}; + +/** + * Internal function to transform a private key into a public key point + * + * @param {PrivateKey} privkey - An instance of PrivateKey + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformPrivateKey = function(privkey) { + $.checkArgument(PublicKey._isPrivateKey(privkey), 'Must be an instance of PrivateKey'); + var info = {}; + info.point = Point.getG().mul(privkey.bn); + info.compressed = privkey.compressed; + info.network = privkey.network; + return info; +}; + +/** + * Internal function to transform DER into a public key point + * + * @param {Buffer} buf - An hex encoded buffer + * @param {bool=} strict - if set to false, will loosen some conditions + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformDER = function(buf, strict) { + /* jshint maxstatements: 30 */ + /* jshint maxcomplexity: 12 */ + $.checkArgument(PublicKey._isBuffer(buf), 'Must be a hex buffer of DER encoded public key'); + var info = {}; + + strict = _.isUndefined(strict) ? true : strict; + + var x; + var y; + var xbuf; + var ybuf; + + if (buf[0] === 0x04 || (!strict && (buf[0] === 0x06 || buf[0] === 0x07))) { + xbuf = buf.slice(1, 33); + ybuf = buf.slice(33, 65); + if (xbuf.length !== 32 || ybuf.length !== 32 || buf.length !== 65) { + throw new TypeError('Length of x and y must be 32 bytes'); + } + x = new BN(xbuf); + y = new BN(ybuf); + info.point = new Point(x, y); + info.compressed = false; + } else if (buf[0] === 0x03) { + xbuf = buf.slice(1); + x = new BN(xbuf); + info = PublicKey._transformX(true, x); + info.compressed = true; + } else if (buf[0] === 0x02) { + xbuf = buf.slice(1); + x = new BN(xbuf); + info = PublicKey._transformX(false, x); + info.compressed = true; + } else { + throw new TypeError('Invalid DER format public key'); + } + return info; +}; + +/** + * Internal function to transform X into a public key point + * + * @param {Boolean} odd - If the point is above or below the x axis + * @param {Point} x - The x point + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformX = function(odd, x) { + $.checkArgument(typeof odd === 'boolean', 'Must specify whether y is odd or not (true or false)'); + var info = {}; + info.point = Point.fromX(odd, x); + return info; +}; + +/** + * Internal function to transform a JSON into a public key point + * + * @param {String|Object} json - a JSON string or plain object + * @returns {Object} An object with keys: point and compressed + * @private + */ +PublicKey._transformObject = function(json) { + var x = new BN(json.x, 'hex'); + var y = new BN(json.y, 'hex'); + var point = new Point(x, y); + return new PublicKey(point, { + compressed: json.compressed + }); +}; + +/** + * Instantiate a PublicKey from a PrivateKey + * + * @param {PrivateKey} privkey - An instance of PrivateKey + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromPrivateKey = function(privkey) { + $.checkArgument(PublicKey._isPrivateKey(privkey), 'Must be an instance of PrivateKey'); + var info = PublicKey._transformPrivateKey(privkey); + return new PublicKey(info.point, { + compressed: info.compressed, + network: info.network + }); +}; + +/** + * Instantiate a PublicKey from a Buffer + * @param {Buffer} buf - A DER hex buffer + * @param {bool=} strict - if set to false, will loosen some conditions + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromDER = PublicKey.fromBuffer = function(buf, strict) { + $.checkArgument(PublicKey._isBuffer(buf), 'Must be a hex buffer of DER encoded public key'); + var info = PublicKey._transformDER(buf, strict); + return new PublicKey(info.point, { + compressed: info.compressed + }); +}; + +/** + * Instantiate a PublicKey from a Point + * + * @param {Point} point - A Point instance + * @param {boolean=} compressed - whether to store this public key as compressed format + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromPoint = function(point, compressed) { + $.checkArgument(point instanceof Point, 'First argument must be an instance of Point.'); + return new PublicKey(point, { + compressed: compressed + }); +}; + +/** + * Instantiate a PublicKey from a DER hex encoded string + * + * @param {string} str - A DER hex string + * @param {String=} encoding - The type of string encoding + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromString = function(str, encoding) { + var buf = Buffer.from(str, encoding || 'hex'); + var info = PublicKey._transformDER(buf); + return new PublicKey(info.point, { + compressed: info.compressed + }); +}; + +/** + * Instantiate a PublicKey from an X Point + * + * @param {Boolean} odd - If the point is above or below the x axis + * @param {Point} x - The x point + * @returns {PublicKey} A new valid instance of PublicKey + */ +PublicKey.fromX = function(odd, x) { + var info = PublicKey._transformX(odd, x); + return new PublicKey(info.point, { + compressed: info.compressed + }); +}; + +/** + * Check if there would be any errors when initializing a PublicKey + * + * @param {string} data - The encoded data in various formats + * @returns {null|Error} An error if exists + */ +PublicKey.getValidationError = function(data) { + var error; + try { + /* jshint nonew: false */ + new PublicKey(data); + } catch (e) { + error = e; + } + return error; +}; + +/** + * Check if the parameters are valid + * + * @param {string} data - The encoded data in various formats + * @returns {Boolean} If the public key would be valid + */ +PublicKey.isValid = function(data) { + return !PublicKey.getValidationError(data); +}; + +/** + * @returns {Object} A plain object of the PublicKey + */ +PublicKey.prototype.toObject = PublicKey.prototype.toJSON = function toObject() { + return { + x: this.point.getX().toString('hex', 2), + y: this.point.getY().toString('hex', 2), + compressed: this.compressed + }; +}; + +/** + * Will output the PublicKey to a DER Buffer + * + * @returns {Buffer} A DER hex encoded buffer + */ +PublicKey.prototype.toBuffer = PublicKey.prototype.toDER = function() { + var x = this.point.getX(); + var y = this.point.getY(); + + var xbuf = x.toBuffer({ + size: 32 + }); + var ybuf = y.toBuffer({ + size: 32 + }); + + var prefix; + if (!this.compressed) { + prefix = Buffer.from([0x04]); + return Buffer.concat([prefix, xbuf, ybuf]); + } else { + var odd = ybuf[ybuf.length - 1] % 2; + if (odd) { + prefix = Buffer.from([0x03]); + } else { + prefix = Buffer.from([0x02]); + } + return Buffer.concat([prefix, xbuf]); + } +}; + +/** + * Will return a sha256 + ripemd160 hash of the serialized public key + * @see https://github.com/bitcoin/bitcoin/blob/master/src/pubkey.h#L141 + * @returns {Buffer} + */ +PublicKey.prototype._getID = function _getID() { + return Hash.sha256ripemd160(this.toBuffer()); +}; + +/** + * Will return an address for the public key + * + * @param {String|Network=} network - Which network should the address be for + * @returns {Address} An address generated from the public key + */ +PublicKey.prototype.toAddress = function(network) { + var Address = require('./address'); + return Address.fromPublicKey(this, network || this.network); +}; + +/** + * Will output the PublicKey to a DER encoded hex string + * + * @returns {string} A DER hex encoded string + */ +PublicKey.prototype.toString = function() { + return this.toDER().toString('hex'); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Public key + */ +PublicKey.prototype.inspect = function() { + return ''; +}; + + +module.exports = PublicKey; diff --git a/packages/kauri-bitcore-lib/lib/script/index.js b/packages/kauri-bitcore-lib/lib/script/index.js new file mode 100644 index 0000000..49efc67 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/script/index.js @@ -0,0 +1,3 @@ +module.exports = require('./script'); + +module.exports.Interpreter = require('./interpreter'); diff --git a/packages/kauri-bitcore-lib/lib/script/interpreter.js b/packages/kauri-bitcore-lib/lib/script/interpreter.js new file mode 100644 index 0000000..f803296 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/script/interpreter.js @@ -0,0 +1,1399 @@ +'use strict'; + +var _ = require('lodash'); + +var Script = require('./script'); +var Opcode = require('../opcode'); +var BN = require('../crypto/bn'); +var Hash = require('../crypto/hash'); +var Signature = require('../crypto/signature'); +var PublicKey = require('../publickey'); + +/** + * Bitcoin transactions contain scripts. Each input has a script called the + * scriptSig, and each output has a script called the scriptPubkey. To validate + * an input, the input's script is concatenated with the referenced output script, + * and the result is executed. If at the end of execution the stack contains a + * "true" value, then the transaction is valid. + * + * The primary way to use this class is via the verify function. + * e.g., Interpreter().verify( ... ); + */ +var Interpreter = function Interpreter(obj) { + if (!(this instanceof Interpreter)) { + return new Interpreter(obj); + } + if (obj) { + this.initialize(); + this.set(obj); + } else { + this.initialize(); + } +}; + +Interpreter.prototype.verifyWitnessProgram = function(version, program, witness, satoshis, flags) { + var scriptPubKey = new Script(); + var stack = []; + + if (version === 0) { + if (program.length === 32) { + if (witness.length === 0) { + this.errstr = 'SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY'; + return false; + } + + var scriptPubKeyBuffer = witness[witness.length - 1]; + scriptPubKey = new Script(scriptPubKeyBuffer); + var hash = Hash.sha256(scriptPubKeyBuffer); + if (hash.toString('hex') !== program.toString('hex')) { + this.errstr = 'SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH'; + return false; + } + + stack = witness.slice(0, -1); + } else if (program.length === 20) { + if (witness.length !== 2) { + this.errstr = 'SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH'; + return false; + } + + scriptPubKey.add(Opcode.OP_DUP); + scriptPubKey.add(Opcode.OP_HASH160); + scriptPubKey.add(program); + scriptPubKey.add(Opcode.OP_EQUALVERIFY); + scriptPubKey.add(Opcode.OP_CHECKSIG); + + stack = witness; + + } else { + this.errstr = 'SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH'; + return false; + } + } else if ((flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)) { + this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM'; + return false; + } else { + return true; + } + + this.initialize(); + + this.set({ + script: scriptPubKey, + stack: stack, + sigversion: 1, + satoshis: satoshis + }); + + if (!this.evaluate()) { + return false; + } + + if (this.stack.length !== 1) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE'; + return false; + } + + var buf = this.stack[this.stack.length - 1]; + if (!Interpreter.castToBool(buf)) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_STACK'; + return false; + } + + return true; +}; + + + +/** + * Verifies a Script by executing it and returns true if it is valid. + * This function needs to be provided with the scriptSig and the scriptPubkey + * separately. + * @param {Script} scriptSig - the script's first part (corresponding to the tx input) + * @param {Script} scriptPubkey - the script's last part (corresponding to the tx output) + * @param {Transaction=} tx - the Transaction containing the scriptSig in one input (used + * to check signature validity for some opcodes like OP_CHECKSIG) + * @param {number} nin - index of the transaction input containing the scriptSig verified. + * @param {number} flags - evaluation flags. See Interpreter.SCRIPT_* constants + * @param {number} witness - array of witness data + * @param {number} satoshis - number of satoshis created by this output + * + * Translated from bitcoind's VerifyScript + */ +Interpreter.prototype.verify = function(scriptSig, scriptPubkey, tx, nin, flags, witness, satoshis) { + + var Transaction = require('../transaction'); + if (_.isUndefined(tx)) { + tx = new Transaction(); + } + if (_.isUndefined(nin)) { + nin = 0; + } + if (_.isUndefined(flags)) { + flags = 0; + } + if (_.isUndefined(witness)) { + witness = null; + } + if (_.isUndefined(satoshis)) { + satoshis = 0; + } + + this.set({ + script: scriptSig, + tx: tx, + nin: nin, + sigversion: 0, + satoshis: 0, + flags: flags + }); + var stackCopy; + + if ((flags & Interpreter.SCRIPT_VERIFY_SIGPUSHONLY) !== 0 && !scriptSig.isPushOnly()) { + this.errstr = 'SCRIPT_ERR_SIG_PUSHONLY'; + return false; + } + + // evaluate scriptSig + if (!this.evaluate()) { + return false; + } + + if (flags & Interpreter.SCRIPT_VERIFY_P2SH) { + stackCopy = this.stack.slice(); + } + + var stack = this.stack; + this.initialize(); + this.set({ + script: scriptPubkey, + stack: stack, + tx: tx, + nin: nin, + flags: flags + }); + + // evaluate scriptPubkey + if (!this.evaluate()) { + return false; + } + + if (this.stack.length === 0) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_NO_RESULT'; + return false; + } + + var buf = this.stack[this.stack.length - 1]; + if (!Interpreter.castToBool(buf)) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_STACK'; + return false; + } + + var hadWitness = false; + + if ((flags & Interpreter.SCRIPT_VERIFY_WITNESS)) { + var witnessValues = {}; + if (scriptPubkey.isWitnessProgram(witnessValues)) { + hadWitness = true; + if (scriptSig.toBuffer().length !== 0) { + return false; + } + + if (!this.verifyWitnessProgram(witnessValues.version, witnessValues.program, witness, satoshis, flags)) { + return false; + } + } + } + + // Additional validation for spend-to-script-hash transactions: + if ((flags & Interpreter.SCRIPT_VERIFY_P2SH) && scriptPubkey.isScriptHashOut()) { + // scriptSig must be literals-only or validation fails + if (!scriptSig.isPushOnly()) { + this.errstr = 'SCRIPT_ERR_SIG_PUSHONLY'; + return false; + } + + // stackCopy cannot be empty here, because if it was the + // P2SH HASH <> EQUAL scriptPubKey would be evaluated with + // an empty stack and the EvalScript above would return false. + if (stackCopy.length === 0) { + throw new Error('internal error - stack copy empty'); + } + + var redeemScriptSerialized = stackCopy[stackCopy.length - 1]; + var redeemScript = Script.fromBuffer(redeemScriptSerialized); + stackCopy.pop(); + + this.initialize(); + this.set({ + script: redeemScript, + stack: stackCopy, + tx: tx, + nin: nin, + flags: flags + }); + + // evaluate redeemScript + if (!this.evaluate()) { + return false; + } + + if (stackCopy.length === 0) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK'; + return false; + } + + if (!Interpreter.castToBool(stackCopy[stackCopy.length - 1])) { + this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK'; + return false; + } + if ((flags & Interpreter.SCRIPT_VERIFY_WITNESS)) { + var p2shWitnessValues = {}; + if (redeemScript.isWitnessProgram(p2shWitnessValues)) { + hadWitness = true; + var redeemScriptPush = new Script(); + redeemScriptPush.add(redeemScript.toBuffer()); + if (scriptSig.toHex() !== redeemScriptPush.toHex()) { + this.errstr = 'SCRIPT_ERR_WITNESS_MALLEATED_P2SH'; + return false; + } + + if (!this.verifyWitnessProgram(p2shWitnessValues.version, p2shWitnessValues.program, witness, satoshis, flags)) { + return false; + } + + stack = [stack[0]]; + } + } + + if ((flags & Interpreter.SCRIPT_VERIFY_WITNESS)) { + if (!hadWitness && witness.length > 0) { + this.errstr = 'SCRIPT_ERR_WITNESS_UNEXPECTED'; + return false; + } + } + } + + return true; +}; + +module.exports = Interpreter; + +Interpreter.prototype.initialize = function(obj) { + this.stack = []; + this.altstack = []; + this.pc = 0; + this.satoshis = 0; + this.sigversion = 0; + this.pbegincodehash = 0; + this.nOpCount = 0; + this.vfExec = []; + this.errstr = ''; + this.flags = 0; +}; + +Interpreter.prototype.set = function(obj) { + this.script = obj.script || this.script; + this.tx = obj.tx || this.tx; + this.nin = typeof obj.nin !== 'undefined' ? obj.nin : this.nin; + this.stack = obj.stack || this.stack; + this.altstack = obj.altack || this.altstack; + this.pc = typeof obj.pc !== 'undefined' ? obj.pc : this.pc; + this.pbegincodehash = typeof obj.pbegincodehash !== 'undefined' ? obj.pbegincodehash : this.pbegincodehash; + this.sigversion = typeof obj.sigversion !== 'undefined' ? obj.sigversion : this.sigversion; + this.satoshis = typeof obj.satoshis !== 'undefined' ? obj.satoshis : this.satoshis; + this.nOpCount = typeof obj.nOpCount !== 'undefined' ? obj.nOpCount : this.nOpCount; + this.vfExec = obj.vfExec || this.vfExec; + this.errstr = obj.errstr || this.errstr; + this.flags = typeof obj.flags !== 'undefined' ? obj.flags : this.flags; +}; + +Interpreter.true = Buffer.from([1]); +Interpreter.false = Buffer.from([]); + +Interpreter.MAX_SCRIPT_ELEMENT_SIZE = 520; + +Interpreter.LOCKTIME_THRESHOLD = 500000000; +Interpreter.LOCKTIME_THRESHOLD_BN = new BN(Interpreter.LOCKTIME_THRESHOLD); + +// flags taken from bitcoind +// bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 +Interpreter.SCRIPT_VERIFY_NONE = 0; + +// Making v1-v16 witness program non-standard +Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM = (1 << 12); + +// Evaluate P2SH subscripts (softfork safe, BIP16). +Interpreter.SCRIPT_VERIFY_P2SH = (1 << 0); + +// Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. +// Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be +// skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT). +Interpreter.SCRIPT_VERIFY_STRICTENC = (1 << 1); + +// Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1) +Interpreter.SCRIPT_VERIFY_DERSIG = (1 << 2); + +// Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure +// (softfork safe, BIP62 rule 5). +Interpreter.SCRIPT_VERIFY_LOW_S = (1 << 3); + +// verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7). +Interpreter.SCRIPT_VERIFY_NULLDUMMY = (1 << 4); + +// Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). +Interpreter.SCRIPT_VERIFY_SIGPUSHONLY = (1 << 5); + +// Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct +// pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating +// any other push causes the script to fail (BIP62 rule 3). +// In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). +// (softfork safe) +Interpreter.SCRIPT_VERIFY_MINIMALDATA = (1 << 6); + +// Discourage use of NOPs reserved for upgrades (NOP1-10) +// +// Provided so that nodes can avoid accepting or mining transactions +// containing executed NOP's whose meaning may change after a soft-fork, +// thus rendering the script invalid; with this flag set executing +// discouraged NOPs fails the script. This verification flag will never be +// a mandatory flag applied to scripts in a block. NOPs that are not +// executed, e.g. within an unexecuted IF ENDIF block, are *not* rejected. +Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = (1 << 7); + +// CLTV See BIP65 for details. +Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1 << 9); +Interpreter.SCRIPT_VERIFY_WITNESS = (1 << 10); +Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = (1 << 11); + +Interpreter.castToBool = function(buf) { + for (var i = 0; i < buf.length; i++) { + if (buf[i] !== 0) { + // can be negative zero + if (i === buf.length - 1 && buf[i] === 0x80) { + return false; + } + return true; + } + } + return false; +}; + +/** + * Translated from bitcoind's CheckSignatureEncoding + */ +Interpreter.prototype.checkSignatureEncoding = function(buf) { + var sig; + if ((this.flags & (Interpreter.SCRIPT_VERIFY_DERSIG | Interpreter.SCRIPT_VERIFY_LOW_S | Interpreter.SCRIPT_VERIFY_STRICTENC)) !== 0 && !Signature.isTxDER(buf)) { + this.errstr = 'SCRIPT_ERR_SIG_DER_INVALID_FORMAT'; + return false; + } else if ((this.flags & Interpreter.SCRIPT_VERIFY_LOW_S) !== 0) { + sig = Signature.fromTxFormat(buf); + if (!sig.hasLowS()) { + this.errstr = 'SCRIPT_ERR_SIG_DER_HIGH_S'; + return false; + } + } else if ((this.flags & Interpreter.SCRIPT_VERIFY_STRICTENC) !== 0) { + sig = Signature.fromTxFormat(buf); + if (!sig.hasDefinedHashtype()) { + this.errstr = 'SCRIPT_ERR_SIG_HASHTYPE'; + return false; + } + } + return true; +}; + +/** + * Translated from bitcoind's CheckPubKeyEncoding + */ +Interpreter.prototype.checkPubkeyEncoding = function(buf) { + if ((this.flags & Interpreter.SCRIPT_VERIFY_STRICTENC) !== 0 && !PublicKey.isValid(buf)) { + this.errstr = 'SCRIPT_ERR_PUBKEYTYPE'; + return false; + } + return true; +}; + +/** + * Based on bitcoind's EvalScript function, with the inner loop moved to + * Interpreter.prototype.step() + * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 + */ +Interpreter.prototype.evaluate = function() { + if (this.script.toBuffer().length > 10000) { + this.errstr = 'SCRIPT_ERR_SCRIPT_SIZE'; + return false; + } + + try { + while (this.pc < this.script.chunks.length) { + var fSuccess = this.step(); + if (!fSuccess) { + return false; + } + } + + // Size limits + if (this.stack.length + this.altstack.length > 1000) { + this.errstr = 'SCRIPT_ERR_STACK_SIZE'; + return false; + } + } catch (e) { + this.errstr = 'SCRIPT_ERR_UNKNOWN_ERROR: ' + e; + return false; + } + + if (this.vfExec.length > 0) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + + return true; +}; + +/** + * Checks a locktime parameter with the transaction's locktime. + * There are two times of nLockTime: lock-by-blockheight and lock-by-blocktime, + * distinguished by whether nLockTime < LOCKTIME_THRESHOLD = 500000000 + * + * See the corresponding code on bitcoin core: + * https://github.com/bitcoin/bitcoin/blob/ffd75adce01a78b3461b3ff05bcc2b530a9ce994/src/script/interpreter.cpp#L1129 + * + * @param {BN} nLockTime the locktime read from the script + * @return {boolean} true if the transaction's locktime is less than or equal to + * the transaction's locktime + */ +Interpreter.prototype.checkLockTime = function(nLockTime) { + + // We want to compare apples to apples, so fail the script + // unless the type of nLockTime being tested is the same as + // the nLockTime in the transaction. + if (!( + (this.tx.nLockTime < Interpreter.LOCKTIME_THRESHOLD && nLockTime.lt(Interpreter.LOCKTIME_THRESHOLD_BN)) || + (this.tx.nLockTime >= Interpreter.LOCKTIME_THRESHOLD && nLockTime.gte(Interpreter.LOCKTIME_THRESHOLD_BN)) + )) { + return false; + } + + // Now that we know we're comparing apples-to-apples, the + // comparison is a simple numeric one. + if (nLockTime.gt(new BN(this.tx.nLockTime))) { + return false; + } + + // Finally the nLockTime feature can be disabled and thus + // CHECKLOCKTIMEVERIFY bypassed if every txin has been + // finalized by setting nSequence to maxint. The + // transaction would be allowed into the blockchain, making + // the opcode ineffective. + // + // Testing if this vin is not final is sufficient to + // prevent this condition. Alternatively we could test all + // inputs, but testing just this input minimizes the data + // required to prove correct CHECKLOCKTIMEVERIFY execution. + if (!this.tx.inputs[this.nin].isFinal()) { + return false; + } + + return true; +} + +/** + * Based on the inner loop of bitcoind's EvalScript function + * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 + */ +Interpreter.prototype.step = function() { + + var fRequireMinimal = (this.flags & Interpreter.SCRIPT_VERIFY_MINIMALDATA) !== 0; + + //bool fExec = !count(vfExec.begin(), vfExec.end(), false); + var fExec = (this.vfExec.indexOf(false) === -1); + var buf, buf1, buf2, spliced, n, x1, x2, bn, bn1, bn2, bufSig, bufPubkey, subscript; + var sig, pubkey; + var fValue, fSuccess; + + // Read instruction + var chunk = this.script.chunks[this.pc]; + this.pc++; + var opcodenum = chunk.opcodenum; + if (_.isUndefined(opcodenum)) { + this.errstr = 'SCRIPT_ERR_UNDEFINED_OPCODE'; + return false; + } + if (chunk.buf && chunk.buf.length > Interpreter.MAX_SCRIPT_ELEMENT_SIZE) { + this.errstr = 'SCRIPT_ERR_PUSH_SIZE'; + return false; + } + + // Note how Opcode.OP_RESERVED does not count towards the opcode limit. + if (opcodenum > Opcode.OP_16 && ++(this.nOpCount) > 201) { + this.errstr = 'SCRIPT_ERR_OP_COUNT'; + return false; + } + + + if (opcodenum === Opcode.OP_CAT || + opcodenum === Opcode.OP_SUBSTR || + opcodenum === Opcode.OP_LEFT || + opcodenum === Opcode.OP_RIGHT || + opcodenum === Opcode.OP_INVERT || + opcodenum === Opcode.OP_AND || + opcodenum === Opcode.OP_OR || + opcodenum === Opcode.OP_XOR || + opcodenum === Opcode.OP_2MUL || + opcodenum === Opcode.OP_2DIV || + opcodenum === Opcode.OP_MUL || + opcodenum === Opcode.OP_DIV || + opcodenum === Opcode.OP_MOD || + opcodenum === Opcode.OP_LSHIFT || + opcodenum === Opcode.OP_RSHIFT) { + this.errstr = 'SCRIPT_ERR_DISABLED_OPCODE'; + return false; + } + + if (fExec && 0 <= opcodenum && opcodenum <= Opcode.OP_PUSHDATA4) { + if (fRequireMinimal && !this.script.checkMinimalPush(this.pc - 1)) { + this.errstr = 'SCRIPT_ERR_MINIMALDATA'; + return false; + } + if (!chunk.buf) { + this.stack.push(Interpreter.false); + } else if (chunk.len !== chunk.buf.length) { + throw new Error('Length of push value not equal to length of data'); + } else { + this.stack.push(chunk.buf); + } + } else if (fExec || (Opcode.OP_IF <= opcodenum && opcodenum <= Opcode.OP_ENDIF)) { + switch (opcodenum) { + // Push value + case Opcode.OP_1NEGATE: + case Opcode.OP_1: + case Opcode.OP_2: + case Opcode.OP_3: + case Opcode.OP_4: + case Opcode.OP_5: + case Opcode.OP_6: + case Opcode.OP_7: + case Opcode.OP_8: + case Opcode.OP_9: + case Opcode.OP_10: + case Opcode.OP_11: + case Opcode.OP_12: + case Opcode.OP_13: + case Opcode.OP_14: + case Opcode.OP_15: + case Opcode.OP_16: + { + // ( -- value) + // ScriptNum bn((int)opcode - (int)(Opcode.OP_1 - 1)); + n = opcodenum - (Opcode.OP_1 - 1); + buf = new BN(n).toScriptNumBuffer(); + this.stack.push(buf); + // The result of these opcodes should always be the minimal way to push the data + // they push, so no need for a CheckMinimalPush here. + } + break; + + + // + // Control + // + case Opcode.OP_NOP: + break; + + case Opcode.OP_NOP2: + case Opcode.OP_CHECKLOCKTIMEVERIFY: + + if (!(this.flags & Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) { + // not enabled; treat as a NOP2 + if (this.flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) { + this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS'; + return false; + } + break; + } + + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + // Note that elsewhere numeric opcodes are limited to + // operands in the range -2**31+1 to 2**31-1, however it is + // legal for opcodes to produce results exceeding that + // range. This limitation is implemented by CScriptNum's + // default 4-byte limit. + // + // If we kept to that limit we'd have a year 2038 problem, + // even though the nLockTime field in transactions + // themselves is uint32 which only becomes meaningless + // after the year 2106. + // + // Thus as a special case we tell CScriptNum to accept up + // to 5-byte bignums, which are good until 2**39-1, well + // beyond the 2**32-1 limit of the nLockTime field itself. + var nLockTime = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal, 5); + + // In the rare event that the argument may be < 0 due to + // some arithmetic being done first, you can always use + // 0 MAX CHECKLOCKTIMEVERIFY. + if (nLockTime.lt(new BN(0))) { + this.errstr = 'SCRIPT_ERR_NEGATIVE_LOCKTIME'; + return false; + } + + // Actually compare the specified lock time with the transaction. + if (!this.checkLockTime(nLockTime)) { + this.errstr = 'SCRIPT_ERR_UNSATISFIED_LOCKTIME'; + return false; + } + break; + + case Opcode.OP_NOP1: + case Opcode.OP_NOP3: + case Opcode.OP_NOP4: + case Opcode.OP_NOP5: + case Opcode.OP_NOP6: + case Opcode.OP_NOP7: + case Opcode.OP_NOP8: + case Opcode.OP_NOP9: + case Opcode.OP_NOP10: + { + if (this.flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) { + this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS'; + return false; + } + } + break; + + case Opcode.OP_IF: + case Opcode.OP_NOTIF: + { + // if [statements] [else [statements]] endif + // bool fValue = false; + fValue = false; + if (fExec) { + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + buf = this.stack.pop(); + fValue = Interpreter.castToBool(buf); + if (opcodenum === Opcode.OP_NOTIF) { + fValue = !fValue; + } + } + this.vfExec.push(fValue); + } + break; + + case Opcode.OP_ELSE: + { + if (this.vfExec.length === 0) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + this.vfExec[this.vfExec.length - 1] = !this.vfExec[this.vfExec.length - 1]; + } + break; + + case Opcode.OP_ENDIF: + { + if (this.vfExec.length === 0) { + this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL'; + return false; + } + this.vfExec.pop(); + } + break; + + case Opcode.OP_VERIFY: + { + // (true -- ) or + // (false -- false) and return + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + fValue = Interpreter.castToBool(buf); + if (fValue) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_VERIFY'; + return false; + } + } + break; + + case Opcode.OP_RETURN: + { + this.errstr = 'SCRIPT_ERR_OP_RETURN'; + return false; + } + break; + + + // + // Stack ops + // + case Opcode.OP_TOALTSTACK: + { + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.altstack.push(this.stack.pop()); + } + break; + + case Opcode.OP_FROMALTSTACK: + { + if (this.altstack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_ALTSTACK_OPERATION'; + return false; + } + this.stack.push(this.altstack.pop()); + } + break; + + case Opcode.OP_2DROP: + { + // (x1 x2 -- ) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.pop(); + this.stack.pop(); + } + break; + + case Opcode.OP_2DUP: + { + // (x1 x2 -- x1 x2 x1 x2) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 2]; + buf2 = this.stack[this.stack.length - 1]; + this.stack.push(buf1); + this.stack.push(buf2); + } + break; + + case Opcode.OP_3DUP: + { + // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) + if (this.stack.length < 3) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 3]; + buf2 = this.stack[this.stack.length - 2]; + var buf3 = this.stack[this.stack.length - 1]; + this.stack.push(buf1); + this.stack.push(buf2); + this.stack.push(buf3); + } + break; + + case Opcode.OP_2OVER: + { + // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) + if (this.stack.length < 4) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 4]; + buf2 = this.stack[this.stack.length - 3]; + this.stack.push(buf1); + this.stack.push(buf2); + } + break; + + case Opcode.OP_2ROT: + { + // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) + if (this.stack.length < 6) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + spliced = this.stack.splice(this.stack.length - 6, 2); + this.stack.push(spliced[0]); + this.stack.push(spliced[1]); + } + break; + + case Opcode.OP_2SWAP: + { + // (x1 x2 x3 x4 -- x3 x4 x1 x2) + if (this.stack.length < 4) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + spliced = this.stack.splice(this.stack.length - 4, 2); + this.stack.push(spliced[0]); + this.stack.push(spliced[1]); + } + break; + + case Opcode.OP_IFDUP: + { + // (x - 0 | x x) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + fValue = Interpreter.castToBool(buf); + if (fValue) { + this.stack.push(buf); + } + } + break; + + case Opcode.OP_DEPTH: + { + // -- stacksize + buf = new BN(this.stack.length).toScriptNumBuffer(); + this.stack.push(buf); + } + break; + + case Opcode.OP_DROP: + { + // (x -- ) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.pop(); + } + break; + + case Opcode.OP_DUP: + { + // (x -- x x) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.push(this.stack[this.stack.length - 1]); + } + break; + + case Opcode.OP_NIP: + { + // (x1 x2 -- x2) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.splice(this.stack.length - 2, 1); + } + break; + + case Opcode.OP_OVER: + { + // (x1 x2 -- x1 x2 x1) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.push(this.stack[this.stack.length - 2]); + } + break; + + case Opcode.OP_PICK: + case Opcode.OP_ROLL: + { + // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) + // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + bn = BN.fromScriptNumBuffer(buf, fRequireMinimal); + n = bn.toNumber(); + this.stack.pop(); + if (n < 0 || n >= this.stack.length) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - n - 1]; + if (opcodenum === Opcode.OP_ROLL) { + this.stack.splice(this.stack.length - n - 1, 1); + } + this.stack.push(buf); + } + break; + + case Opcode.OP_ROT: + { + // (x1 x2 x3 -- x2 x3 x1) + // x2 x1 x3 after first swap + // x2 x3 x1 after second swap + if (this.stack.length < 3) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + x1 = this.stack[this.stack.length - 3]; + x2 = this.stack[this.stack.length - 2]; + var x3 = this.stack[this.stack.length - 1]; + this.stack[this.stack.length - 3] = x2; + this.stack[this.stack.length - 2] = x3; + this.stack[this.stack.length - 1] = x1; + } + break; + + case Opcode.OP_SWAP: + { + // (x1 x2 -- x2 x1) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + x1 = this.stack[this.stack.length - 2]; + x2 = this.stack[this.stack.length - 1]; + this.stack[this.stack.length - 2] = x2; + this.stack[this.stack.length - 1] = x1; + } + break; + + case Opcode.OP_TUCK: + { + // (x1 x2 -- x2 x1 x2) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + this.stack.splice(this.stack.length - 2, 0, this.stack[this.stack.length - 1]); + } + break; + + + case Opcode.OP_SIZE: + { + // (in -- in size) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + bn = new BN(this.stack[this.stack.length - 1].length); + this.stack.push(bn.toScriptNumBuffer()); + } + break; + + + // + // Bitwise logic + // + case Opcode.OP_EQUAL: + case Opcode.OP_EQUALVERIFY: + //case Opcode.OP_NOTEQUAL: // use Opcode.OP_NUMNOTEQUAL + { + // (x1 x2 - bool) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf1 = this.stack[this.stack.length - 2]; + buf2 = this.stack[this.stack.length - 1]; + var fEqual = buf1.toString('hex') === buf2.toString('hex'); + this.stack.pop(); + this.stack.pop(); + this.stack.push(fEqual ? Interpreter.true : Interpreter.false); + if (opcodenum === Opcode.OP_EQUALVERIFY) { + if (fEqual) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_EQUALVERIFY'; + return false; + } + } + } + break; + + + // + // Numeric + // + case Opcode.OP_1ADD: + case Opcode.OP_1SUB: + case Opcode.OP_NEGATE: + case Opcode.OP_ABS: + case Opcode.OP_NOT: + case Opcode.OP_0NOTEQUAL: + { + // (in -- out) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + bn = BN.fromScriptNumBuffer(buf, fRequireMinimal); + switch (opcodenum) { + case Opcode.OP_1ADD: + bn = bn.add(BN.One); + break; + case Opcode.OP_1SUB: + bn = bn.sub(BN.One); + break; + case Opcode.OP_NEGATE: + bn = bn.neg(); + break; + case Opcode.OP_ABS: + if (bn.cmp(BN.Zero) < 0) { + bn = bn.neg(); + } + break; + case Opcode.OP_NOT: + bn = new BN((bn.cmp(BN.Zero) === 0) + 0); + break; + case Opcode.OP_0NOTEQUAL: + bn = new BN((bn.cmp(BN.Zero) !== 0) + 0); + break; + //default: assert(!'invalid opcode'); break; // TODO: does this ever occur? + } + this.stack.pop(); + this.stack.push(bn.toScriptNumBuffer()); + } + break; + + case Opcode.OP_ADD: + case Opcode.OP_SUB: + case Opcode.OP_BOOLAND: + case Opcode.OP_BOOLOR: + case Opcode.OP_NUMEQUAL: + case Opcode.OP_NUMEQUALVERIFY: + case Opcode.OP_NUMNOTEQUAL: + case Opcode.OP_LESSTHAN: + case Opcode.OP_GREATERTHAN: + case Opcode.OP_LESSTHANOREQUAL: + case Opcode.OP_GREATERTHANOREQUAL: + case Opcode.OP_MIN: + case Opcode.OP_MAX: + { + // (x1 x2 -- out) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + bn1 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 2], fRequireMinimal); + bn2 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal); + bn = new BN(0); + + switch (opcodenum) { + case Opcode.OP_ADD: + bn = bn1.add(bn2); + break; + + case Opcode.OP_SUB: + bn = bn1.sub(bn2); + break; + + // case Opcode.OP_BOOLAND: bn = (bn1 != bnZero && bn2 != bnZero); break; + case Opcode.OP_BOOLAND: + bn = new BN(((bn1.cmp(BN.Zero) !== 0) && (bn2.cmp(BN.Zero) !== 0)) + 0); + break; + // case Opcode.OP_BOOLOR: bn = (bn1 != bnZero || bn2 != bnZero); break; + case Opcode.OP_BOOLOR: + bn = new BN(((bn1.cmp(BN.Zero) !== 0) || (bn2.cmp(BN.Zero) !== 0)) + 0); + break; + // case Opcode.OP_NUMEQUAL: bn = (bn1 == bn2); break; + case Opcode.OP_NUMEQUAL: + bn = new BN((bn1.cmp(bn2) === 0) + 0); + break; + // case Opcode.OP_NUMEQUALVERIFY: bn = (bn1 == bn2); break; + case Opcode.OP_NUMEQUALVERIFY: + bn = new BN((bn1.cmp(bn2) === 0) + 0); + break; + // case Opcode.OP_NUMNOTEQUAL: bn = (bn1 != bn2); break; + case Opcode.OP_NUMNOTEQUAL: + bn = new BN((bn1.cmp(bn2) !== 0) + 0); + break; + // case Opcode.OP_LESSTHAN: bn = (bn1 < bn2); break; + case Opcode.OP_LESSTHAN: + bn = new BN((bn1.cmp(bn2) < 0) + 0); + break; + // case Opcode.OP_GREATERTHAN: bn = (bn1 > bn2); break; + case Opcode.OP_GREATERTHAN: + bn = new BN((bn1.cmp(bn2) > 0) + 0); + break; + // case Opcode.OP_LESSTHANOREQUAL: bn = (bn1 <= bn2); break; + case Opcode.OP_LESSTHANOREQUAL: + bn = new BN((bn1.cmp(bn2) <= 0) + 0); + break; + // case Opcode.OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break; + case Opcode.OP_GREATERTHANOREQUAL: + bn = new BN((bn1.cmp(bn2) >= 0) + 0); + break; + case Opcode.OP_MIN: + bn = (bn1.cmp(bn2) < 0 ? bn1 : bn2); + break; + case Opcode.OP_MAX: + bn = (bn1.cmp(bn2) > 0 ? bn1 : bn2); + break; + // default: assert(!'invalid opcode'); break; //TODO: does this ever occur? + } + this.stack.pop(); + this.stack.pop(); + this.stack.push(bn.toScriptNumBuffer()); + + if (opcodenum === Opcode.OP_NUMEQUALVERIFY) { + // if (CastToBool(stacktop(-1))) + if (Interpreter.castToBool(this.stack[this.stack.length - 1])) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_NUMEQUALVERIFY'; + return false; + } + } + } + break; + + case Opcode.OP_WITHIN: + { + // (x min max -- out) + if (this.stack.length < 3) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + bn1 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 3], fRequireMinimal); + bn2 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 2], fRequireMinimal); + var bn3 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal); + //bool fValue = (bn2 <= bn1 && bn1 < bn3); + fValue = (bn2.cmp(bn1) <= 0) && (bn1.cmp(bn3) < 0); + this.stack.pop(); + this.stack.pop(); + this.stack.pop(); + this.stack.push(fValue ? Interpreter.true : Interpreter.false); + } + break; + + + // + // Crypto + // + case Opcode.OP_RIPEMD160: + case Opcode.OP_SHA1: + case Opcode.OP_SHA256: + case Opcode.OP_HASH160: + case Opcode.OP_HASH256: + { + // (in -- hash) + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + buf = this.stack[this.stack.length - 1]; + //valtype vchHash((opcode == Opcode.OP_RIPEMD160 || + // opcode == Opcode.OP_SHA1 || opcode == Opcode.OP_HASH160) ? 20 : 32); + var bufHash; + if (opcodenum === Opcode.OP_RIPEMD160) { + bufHash = Hash.ripemd160(buf); + } else if (opcodenum === Opcode.OP_SHA1) { + bufHash = Hash.sha1(buf); + } else if (opcodenum === Opcode.OP_SHA256) { + bufHash = Hash.sha256(buf); + } else if (opcodenum === Opcode.OP_HASH160) { + bufHash = Hash.sha256ripemd160(buf); + } else if (opcodenum === Opcode.OP_HASH256) { + bufHash = Hash.sha256sha256(buf); + } + this.stack.pop(); + this.stack.push(bufHash); + } + break; + + case Opcode.OP_CODESEPARATOR: + { + // Hash starts after the code separator + this.pbegincodehash = this.pc; + } + break; + + case Opcode.OP_CHECKSIG: + case Opcode.OP_CHECKSIGVERIFY: + { + // (sig pubkey -- bool) + if (this.stack.length < 2) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + bufSig = this.stack[this.stack.length - 2]; + bufPubkey = this.stack[this.stack.length - 1]; + + // Subset of script starting at the most recent codeseparator + // CScript scriptCode(pbegincodehash, pend); + subscript = new Script().set({ + chunks: this.script.chunks.slice(this.pbegincodehash) + }); + + // Drop the signature, since there's no way for a signature to sign itself + var tmpScript = new Script().add(bufSig); + subscript.findAndDelete(tmpScript); + + if (!this.checkSignatureEncoding(bufSig) || !this.checkPubkeyEncoding(bufPubkey)) { + return false; + } + + try { + sig = Signature.fromTxFormat(bufSig); + pubkey = PublicKey.fromBuffer(bufPubkey, false); + fSuccess = this.tx.verifySignature(sig, pubkey, this.nin, subscript, this.sigversion, this.satoshis); + } catch (e) { + //invalid sig or pubkey + fSuccess = false; + } + + this.stack.pop(); + this.stack.pop(); + // stack.push_back(fSuccess ? vchTrue : vchFalse); + this.stack.push(fSuccess ? Interpreter.true : Interpreter.false); + if (opcodenum === Opcode.OP_CHECKSIGVERIFY) { + if (fSuccess) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_CHECKSIGVERIFY'; + return false; + } + } + } + break; + + case Opcode.OP_CHECKMULTISIG: + case Opcode.OP_CHECKMULTISIGVERIFY: + { + // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool) + + var i = 1; + if (this.stack.length < i) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + var nKeysCount = BN.fromScriptNumBuffer(this.stack[this.stack.length - i], fRequireMinimal).toNumber(); + if (nKeysCount < 0 || nKeysCount > 20) { + this.errstr = 'SCRIPT_ERR_PUBKEY_COUNT'; + return false; + } + this.nOpCount += nKeysCount; + if (this.nOpCount > 201) { + this.errstr = 'SCRIPT_ERR_OP_COUNT'; + return false; + } + // int ikey = ++i; + var ikey = ++i; + i += nKeysCount; + if (this.stack.length < i) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + var nSigsCount = BN.fromScriptNumBuffer(this.stack[this.stack.length - i], fRequireMinimal).toNumber(); + if (nSigsCount < 0 || nSigsCount > nKeysCount) { + this.errstr = 'SCRIPT_ERR_SIG_COUNT'; + return false; + } + // int isig = ++i; + var isig = ++i; + i += nSigsCount; + if (this.stack.length < i) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + + // Subset of script starting at the most recent codeseparator + subscript = new Script().set({ + chunks: this.script.chunks.slice(this.pbegincodehash) + }); + + // Drop the signatures, since there's no way for a signature to sign itself + for (var k = 0; k < nSigsCount; k++) { + bufSig = this.stack[this.stack.length - isig - k]; + subscript.findAndDelete(new Script().add(bufSig)); + } + + fSuccess = true; + while (fSuccess && nSigsCount > 0) { + // valtype& vchSig = stacktop(-isig); + bufSig = this.stack[this.stack.length - isig]; + // valtype& vchPubKey = stacktop(-ikey); + bufPubkey = this.stack[this.stack.length - ikey]; + + if (!this.checkSignatureEncoding(bufSig) || !this.checkPubkeyEncoding(bufPubkey)) { + return false; + } + + var fOk; + try { + sig = Signature.fromTxFormat(bufSig); + pubkey = PublicKey.fromBuffer(bufPubkey, false); + fOk = this.tx.verifySignature(sig, pubkey, this.nin, subscript, this.sigversion, this.satoshis); + } catch (e) { + //invalid sig or pubkey + fOk = false; + } + + if (fOk) { + isig++; + nSigsCount--; + } + ikey++; + nKeysCount--; + + // If there are more signatures left than keys left, + // then too many signatures have failed + if (nSigsCount > nKeysCount) { + fSuccess = false; + } + } + + // Clean up stack of actual arguments + while (i-- > 1) { + this.stack.pop(); + } + + // A bug causes CHECKMULTISIG to consume one extra argument + // whose contents were not checked in any way. + // + // Unfortunately this is a potential source of mutability, + // so optionally verify it is exactly equal to zero prior + // to removing it from the stack. + if (this.stack.length < 1) { + this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION'; + return false; + } + if ((this.flags & Interpreter.SCRIPT_VERIFY_NULLDUMMY) && this.stack[this.stack.length - 1].length) { + this.errstr = 'SCRIPT_ERR_SIG_NULLDUMMY'; + return false; + } + this.stack.pop(); + + this.stack.push(fSuccess ? Interpreter.true : Interpreter.false); + + if (opcodenum === Opcode.OP_CHECKMULTISIGVERIFY) { + if (fSuccess) { + this.stack.pop(); + } else { + this.errstr = 'SCRIPT_ERR_CHECKMULTISIGVERIFY'; + return false; + } + } + } + break; + + default: + this.errstr = 'SCRIPT_ERR_BAD_OPCODE'; + return false; + } + } + + return true; +}; + diff --git a/packages/kauri-bitcore-lib/lib/script/script.js b/packages/kauri-bitcore-lib/lib/script/script.js new file mode 100644 index 0000000..74fbe99 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/script/script.js @@ -0,0 +1,1163 @@ +'use strict'; + +var Address = require('../address'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var Opcode = require('../opcode'); +var PublicKey = require('../publickey'); +var Signature = require('../crypto/signature'); +var Networks = require('../networks'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); +var errors = require('../errors'); +var buffer = require('buffer'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); + +/** + * A bitcoin transaction script. Each transaction's inputs and outputs + * has a script that is evaluated to validate it's spending. + * + * See https://en.bitcoin.it/wiki/Script + * + * @constructor + * @param {Object|string|Buffer=} from optional data to populate script + */ +var Script = function Script(from) { + if (!(this instanceof Script)) { + return new Script(from); + } + this.chunks = []; + + if (BufferUtil.isBuffer(from)) { + return Script.fromBuffer(from); + } else if (from instanceof Address) { + return Script.fromAddress(from); + } else if (from instanceof Script) { + return Script.fromBuffer(from.toBuffer()); + } else if (_.isString(from)) { + return Script.fromString(from); + } else if (_.isObject(from) && _.isArray(from.chunks)) { + this.set(from); + } +}; + +Script.prototype.set = function(obj) { + $.checkArgument(_.isObject(obj)); + $.checkArgument(_.isArray(obj.chunks)); + this.chunks = obj.chunks; + return this; +}; + +Script.fromBuffer = function(buffer) { + var script = new Script(); + script.chunks = []; + + var br = new BufferReader(buffer); + while (!br.finished()) { + try { + var opcodenum = br.readUInt8(); + + var len, buf; + if (opcodenum > 0 && opcodenum < Opcode.OP_PUSHDATA1) { + len = opcodenum; + script.chunks.push({ + buf: br.read(len), + len: len, + opcodenum: opcodenum + }); + } else if (opcodenum === Opcode.OP_PUSHDATA1) { + len = br.readUInt8(); + buf = br.read(len); + script.chunks.push({ + buf: buf, + len: len, + opcodenum: opcodenum + }); + } else if (opcodenum === Opcode.OP_PUSHDATA2) { + len = br.readUInt16LE(); + buf = br.read(len); + script.chunks.push({ + buf: buf, + len: len, + opcodenum: opcodenum + }); + } else if (opcodenum === Opcode.OP_PUSHDATA4) { + len = br.readUInt32LE(); + buf = br.read(len); + script.chunks.push({ + buf: buf, + len: len, + opcodenum: opcodenum + }); + } else { + script.chunks.push({ + opcodenum: opcodenum + }); + } + } catch (e) { + if (e instanceof RangeError) { + throw new errors.Script.InvalidBuffer(buffer.toString('hex')); + } + throw e; + } + } + + return script; +}; + +Script.prototype.toBuffer = function() { + var bw = new BufferWriter(); + + for (var i = 0; i < this.chunks.length; i++) { + var chunk = this.chunks[i]; + var opcodenum = chunk.opcodenum; + bw.writeUInt8(chunk.opcodenum); + if (chunk.buf) { + if (opcodenum < Opcode.OP_PUSHDATA1) { + bw.write(chunk.buf); + } else if (opcodenum === Opcode.OP_PUSHDATA1) { + bw.writeUInt8(chunk.len); + bw.write(chunk.buf); + } else if (opcodenum === Opcode.OP_PUSHDATA2) { + bw.writeUInt16LE(chunk.len); + bw.write(chunk.buf); + } else if (opcodenum === Opcode.OP_PUSHDATA4) { + bw.writeUInt32LE(chunk.len); + bw.write(chunk.buf); + } + } + } + + return bw.concat(); +}; + +Script.fromASM = function(str) { + var script = new Script(); + script.chunks = []; + + var tokens = str.split(' '); + var i = 0; + while (i < tokens.length) { + var token = tokens[i]; + var opcode = Opcode(token); + var opcodenum = opcode.toNumber(); + + if (_.isUndefined(opcodenum)) { + var buf = Buffer.from(tokens[i], 'hex'); + script.chunks.push({ + buf: buf, + len: buf.length, + opcodenum: buf.length + }); + i = i + 1; + } else if (opcodenum === Opcode.OP_PUSHDATA1 || + opcodenum === Opcode.OP_PUSHDATA2 || + opcodenum === Opcode.OP_PUSHDATA4) { + script.chunks.push({ + buf: Buffer.from(tokens[i + 2], 'hex'), + len: parseInt(tokens[i + 1]), + opcodenum: opcodenum + }); + i = i + 3; + } else { + script.chunks.push({ + opcodenum: opcodenum + }); + i = i + 1; + } + } + return script; +}; + +Script.fromHex = function(str) { + return new Script(new buffer.Buffer(str, 'hex')); +}; + +Script.fromString = function(str) { + if (JSUtil.isHexa(str) || str.length === 0) { + return new Script(new buffer.Buffer(str, 'hex')); + } + var script = new Script(); + script.chunks = []; + + var tokens = str.split(' '); + var i = 0; + while (i < tokens.length) { + var token = tokens[i]; + var opcode = Opcode(token); + var opcodenum = opcode.toNumber(); + + if (_.isUndefined(opcodenum)) { + opcodenum = parseInt(token); + if (opcodenum > 0 && opcodenum < Opcode.OP_PUSHDATA1) { + script.chunks.push({ + buf: Buffer.from(tokens[i + 1].slice(2), 'hex'), + len: opcodenum, + opcodenum: opcodenum + }); + i = i + 2; + } else { + throw new Error('Invalid script: ' + JSON.stringify(str)); + } + } else if (opcodenum === Opcode.OP_PUSHDATA1 || + opcodenum === Opcode.OP_PUSHDATA2 || + opcodenum === Opcode.OP_PUSHDATA4) { + if (tokens[i + 2].slice(0, 2) !== '0x') { + throw new Error('Pushdata data must start with 0x'); + } + script.chunks.push({ + buf: Buffer.from(tokens[i + 2].slice(2), 'hex'), + len: parseInt(tokens[i + 1]), + opcodenum: opcodenum + }); + i = i + 3; + } else { + script.chunks.push({ + opcodenum: opcodenum + }); + i = i + 1; + } + } + return script; +}; + +Script.prototype._chunkToString = function(chunk, type) { + var opcodenum = chunk.opcodenum; + var asm = (type === 'asm'); + var str = ''; + if (!chunk.buf) { + // no data chunk + if (typeof Opcode.reverseMap[opcodenum] !== 'undefined') { + if (asm) { + // A few cases where the opcode name differs from reverseMap + // aside from 1 to 16 data pushes. + if (opcodenum === 0) { + // OP_0 -> 0 + str = str + ' 0'; + } else if(opcodenum === 79) { + // OP_1NEGATE -> 1 + str = str + ' -1'; + } else { + str = str + ' ' + Opcode(opcodenum).toString(); + } + } else { + str = str + ' ' + Opcode(opcodenum).toString(); + } + } else { + var numstr = opcodenum.toString(16); + if (numstr.length % 2 !== 0) { + numstr = '0' + numstr; + } + if (asm) { + str = str + ' ' + numstr; + } else { + str = str + ' ' + '0x' + numstr; + } + } + } else { + // data chunk + if (!asm && opcodenum === Opcode.OP_PUSHDATA1 || + opcodenum === Opcode.OP_PUSHDATA2 || + opcodenum === Opcode.OP_PUSHDATA4) { + str = str + ' ' + Opcode(opcodenum).toString(); + } + if (chunk.len > 0) { + if (asm) { + str = str + ' ' + chunk.buf.toString('hex'); + } else { + str = str + ' ' + chunk.len + ' ' + '0x' + chunk.buf.toString('hex'); + } + } + } + return str; +}; + +Script.prototype.toASM = function() { + var str = ''; + for (var i = 0; i < this.chunks.length; i++) { + var chunk = this.chunks[i]; + str += this._chunkToString(chunk, 'asm'); + } + + return str.substr(1); +}; + +Script.prototype.toString = function() { + var str = ''; + for (var i = 0; i < this.chunks.length; i++) { + var chunk = this.chunks[i]; + str += this._chunkToString(chunk); + } + + return str.substr(1); +}; + +Script.prototype.toHex = function() { + return this.toBuffer().toString('hex'); +}; + +Script.prototype.inspect = function() { + return ''; +}; + +// script classification methods + +/** + * @returns {boolean} if this is a pay to pubkey hash output script + */ +Script.prototype.isPublicKeyHashOut = function() { + return !!(this.chunks.length === 5 && + this.chunks[0].opcodenum === Opcode.OP_DUP && + this.chunks[1].opcodenum === Opcode.OP_HASH160 && + this.chunks[2].buf && + this.chunks[2].buf.length === 20 && + this.chunks[3].opcodenum === Opcode.OP_EQUALVERIFY && + this.chunks[4].opcodenum === Opcode.OP_CHECKSIG); +}; + +/** + * @returns {boolean} if this is a pay to public key hash input script + */ +Script.prototype.isPublicKeyHashIn = function() { + if (this.chunks.length === 2) { + var signatureBuf = this.chunks[0].buf; + var pubkeyBuf = this.chunks[1].buf; + if (signatureBuf && + signatureBuf.length && + signatureBuf[0] === 0x30 && + pubkeyBuf && + pubkeyBuf.length + ) { + var version = pubkeyBuf[0]; + if ((version === 0x04 || + version === 0x06 || + version === 0x07) && pubkeyBuf.length === 65) { + return true; + } else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { + return true; + } + } + } + return false; +}; + +Script.prototype.getPublicKey = function() { + $.checkState(this.isPublicKeyOut(), 'Can\'t retrieve PublicKey from a non-PK output'); + return this.chunks[0].buf; +}; + +Script.prototype.getPublicKeyHash = function() { + $.checkState(this.isPublicKeyHashOut(), 'Can\'t retrieve PublicKeyHash from a non-PKH output'); + return this.chunks[2].buf; +}; + +/** + * @returns {boolean} if this is a public key output script + */ +Script.prototype.isPublicKeyOut = function() { + if (this.chunks.length === 2 && + this.chunks[0].buf && + this.chunks[0].buf.length && + this.chunks[1].opcodenum === Opcode.OP_CHECKSIG) { + var pubkeyBuf = this.chunks[0].buf; + var version = pubkeyBuf[0]; + var isVersion = false; + if ((version === 0x04 || + version === 0x06 || + version === 0x07) && pubkeyBuf.length === 65) { + isVersion = true; + } else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { + isVersion = true; + } + if (isVersion) { + return PublicKey.isValid(pubkeyBuf); + } + } + return false; +}; + +/** + * @returns {boolean} if this is a pay to public key input script + */ +Script.prototype.isPublicKeyIn = function() { + if (this.chunks.length === 1) { + var signatureBuf = this.chunks[0].buf; + if (signatureBuf && + signatureBuf.length && + signatureBuf[0] === 0x30) { + return true; + } + } + return false; +}; + +/** + * @returns {boolean} if this is a p2sh output script + */ +Script.prototype.isScriptHashOut = function() { + var buf = this.toBuffer(); + return (buf.length === 23 && + buf[0] === Opcode.OP_HASH160 && + buf[1] === 0x14 && + buf[buf.length - 1] === Opcode.OP_EQUAL); +}; + +/** + * @returns {boolean} if this is a p2wsh output script + */ +Script.prototype.isWitnessScriptHashOut = function() { + var buf = this.toBuffer(); + return (buf.length === 34 && buf[0] === 0 && buf[1] === 32); +}; + +/** + * @returns {boolean} if this is a p2wpkh output script + */ +Script.prototype.isWitnessPublicKeyHashOut = function() { + var buf = this.toBuffer(); + return (buf.length === 22 && buf[0] === 0 && buf[1] === 20); +}; + +/** + * @param {Object=} values - The return values + * @param {Number} values.version - Set with the witness version + * @param {Buffer} values.program - Set with the witness program + * @returns {boolean} if this is a p2wpkh output script + */ +Script.prototype.isWitnessProgram = function(values) { + if (!values) { + values = {}; + } + var buf = this.toBuffer(); + if (buf.length < 4 || buf.length > 42) { + return false; + } + if (buf[0] !== Opcode.OP_0 && !(buf[0] >= Opcode.OP_1 && buf[0] <= Opcode.OP_16)) { + return false; + } + + if (buf.length === buf[1] + 2) { + values.version = buf[0]; + values.program = buf.slice(2, buf.length); + return true; + } + + return false; +}; + +/** + * @returns {boolean} if this is a p2sh input script + * Note that these are frequently indistinguishable from pubkeyhashin + */ +Script.prototype.isScriptHashIn = function() { + if (this.chunks.length <= 1) { + return false; + } + var redeemChunk = this.chunks[this.chunks.length - 1]; + var redeemBuf = redeemChunk.buf; + if (!redeemBuf) { + return false; + } + + var redeemScript; + try { + redeemScript = Script.fromBuffer(redeemBuf); + } catch (e) { + if (e instanceof errors.Script.InvalidBuffer) { + return false; + } + throw e; + } + var type = redeemScript.classify(); + return type !== Script.types.UNKNOWN; +}; + +/** + * @returns {boolean} if this is a mutlsig output script + */ +Script.prototype.isMultisigOut = function() { + return (this.chunks.length > 3 && + Opcode.isSmallIntOp(this.chunks[0].opcodenum) && + this.chunks.slice(1, this.chunks.length - 2).every(function(obj) { + return obj.buf && BufferUtil.isBuffer(obj.buf); + }) && + Opcode.isSmallIntOp(this.chunks[this.chunks.length - 2].opcodenum) && + this.chunks[this.chunks.length - 1].opcodenum === Opcode.OP_CHECKMULTISIG); +}; + + +/** + * @returns {boolean} if this is a multisig input script + */ +Script.prototype.isMultisigIn = function() { + return this.chunks.length >= 2 && + this.chunks[0].opcodenum === 0 && + this.chunks.slice(1, this.chunks.length).every(function(obj) { + return obj.buf && + BufferUtil.isBuffer(obj.buf) && + Signature.isTxDER(obj.buf); + }); +}; + +/** + * @returns {boolean} true if this is a valid standard OP_RETURN output + */ +Script.prototype.isDataOut = function() { + return this.chunks.length >= 1 && + this.chunks[0].opcodenum === Opcode.OP_RETURN && + (this.chunks.length === 1 || + (this.chunks.length === 2 && + this.chunks[1].buf && + this.chunks[1].buf.length <= Script.OP_RETURN_STANDARD_SIZE && + this.chunks[1].length === this.chunks.len)); +}; + +/** + * Retrieve the associated data for this script. + * In the case of a pay to public key hash or P2SH, return the hash. + * In the case of a standard OP_RETURN, return the data + * @returns {Buffer} + */ +Script.prototype.getData = function() { + if (this.isDataOut() || this.isScriptHashOut()) { + if (_.isUndefined(this.chunks[1])) { + return Buffer.alloc(0); + } else { + return Buffer.from(this.chunks[1].buf); + } + } + if (this.isPublicKeyHashOut()) { + return Buffer.from(this.chunks[2].buf); + } + throw new Error('Unrecognized script type to get data from'); +}; + +/** + * @returns {boolean} if the script is only composed of data pushing + * opcodes or small int opcodes (OP_0, OP_1, ..., OP_16) + */ +Script.prototype.isPushOnly = function() { + return _.every(this.chunks, function(chunk) { + return chunk.opcodenum <= Opcode.OP_16; + }); +}; + + +Script.types = {}; +Script.types.UNKNOWN = 'Unknown'; +Script.types.PUBKEY_OUT = 'Pay to public key'; +Script.types.PUBKEY_IN = 'Spend from public key'; +Script.types.PUBKEYHASH_OUT = 'Pay to public key hash'; +Script.types.PUBKEYHASH_IN = 'Spend from public key hash'; +Script.types.SCRIPTHASH_OUT = 'Pay to script hash'; +Script.types.SCRIPTHASH_IN = 'Spend from script hash'; +Script.types.MULTISIG_OUT = 'Pay to multisig'; +Script.types.MULTISIG_IN = 'Spend from multisig'; +Script.types.DATA_OUT = 'Data push'; + +Script.OP_RETURN_STANDARD_SIZE = 80; + +/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */ +Script.prototype.classify = function() { + if (this._isInput) { + return this.classifyInput(); + } else if (this._isOutput) { + return this.classifyOutput(); + } else { + var outputType = this.classifyOutput(); + return outputType != Script.types.UNKNOWN ? outputType : this.classifyInput(); + } +}; + +Script.outputIdentifiers = {}; +Script.outputIdentifiers.PUBKEY_OUT = Script.prototype.isPublicKeyOut; +Script.outputIdentifiers.PUBKEYHASH_OUT = Script.prototype.isPublicKeyHashOut; +Script.outputIdentifiers.MULTISIG_OUT = Script.prototype.isMultisigOut; +Script.outputIdentifiers.SCRIPTHASH_OUT = Script.prototype.isScriptHashOut; +Script.outputIdentifiers.DATA_OUT = Script.prototype.isDataOut; + +/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */ +Script.prototype.classifyOutput = function() { + for (var type in Script.outputIdentifiers) { + if (Script.outputIdentifiers[type].bind(this)()) { + return Script.types[type]; + } + } + return Script.types.UNKNOWN; +}; + +Script.inputIdentifiers = {}; +Script.inputIdentifiers.PUBKEY_IN = Script.prototype.isPublicKeyIn; +Script.inputIdentifiers.PUBKEYHASH_IN = Script.prototype.isPublicKeyHashIn; +Script.inputIdentifiers.MULTISIG_IN = Script.prototype.isMultisigIn; +Script.inputIdentifiers.SCRIPTHASH_IN = Script.prototype.isScriptHashIn; + +/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */ +Script.prototype.classifyInput = function() { + for (var type in Script.inputIdentifiers) { + if (Script.inputIdentifiers[type].bind(this)()) { + return Script.types[type]; + } + } + return Script.types.UNKNOWN; +}; + + +/** + * @returns {boolean} if script is one of the known types + */ +Script.prototype.isStandard = function() { + // TODO: Add BIP62 compliance + return this.classify() !== Script.types.UNKNOWN; +}; + + +// Script construction methods + +/** + * Adds a script element at the start of the script. + * @param {*} obj a string, number, Opcode, Buffer, or object to add + * @returns {Script} this script instance + */ +Script.prototype.prepend = function(obj) { + this._addByType(obj, true); + return this; +}; + +/** + * Compares a script with another script + */ +Script.prototype.equals = function(script) { + $.checkState(script instanceof Script, 'Must provide another script'); + if (this.chunks.length !== script.chunks.length) { + return false; + } + var i; + for (i = 0; i < this.chunks.length; i++) { + if (BufferUtil.isBuffer(this.chunks[i].buf) && !BufferUtil.isBuffer(script.chunks[i].buf)) { + return false; + } + if (BufferUtil.isBuffer(this.chunks[i].buf) && !BufferUtil.equals(this.chunks[i].buf, script.chunks[i].buf)) { + return false; + } else if (this.chunks[i].opcodenum !== script.chunks[i].opcodenum) { + return false; + } + } + return true; +}; + +/** + * Adds a script element to the end of the script. + * + * @param {*} obj a string, number, Opcode, Buffer, or object to add + * @returns {Script} this script instance + * + */ +Script.prototype.add = function(obj) { + this._addByType(obj, false); + return this; +}; + +Script.prototype._addByType = function(obj, prepend) { + if (typeof obj === 'string') { + this._addOpcode(obj, prepend); + } else if (typeof obj === 'number') { + this._addOpcode(obj, prepend); + } else if (obj instanceof Opcode) { + this._addOpcode(obj, prepend); + } else if (BufferUtil.isBuffer(obj)) { + this._addBuffer(obj, prepend); + } else if (obj instanceof Script) { + this.chunks = this.chunks.concat(obj.chunks); + } else if (typeof obj === 'object') { + this._insertAtPosition(obj, prepend); + } else { + throw new Error('Invalid script chunk'); + } +}; + +Script.prototype._insertAtPosition = function(op, prepend) { + if (prepend) { + this.chunks.unshift(op); + } else { + this.chunks.push(op); + } +}; + +Script.prototype._addOpcode = function(opcode, prepend) { + var op; + if (typeof opcode === 'number') { + op = opcode; + } else if (opcode instanceof Opcode) { + op = opcode.toNumber(); + } else { + op = Opcode(opcode).toNumber(); + } + this._insertAtPosition({ + opcodenum: op + }, prepend); + return this; +}; + +Script.prototype._addBuffer = function(buf, prepend) { + var opcodenum; + var len = buf.length; + if (len >= 0 && len < Opcode.OP_PUSHDATA1) { + opcodenum = len; + } else if (len < Math.pow(2, 8)) { + opcodenum = Opcode.OP_PUSHDATA1; + } else if (len < Math.pow(2, 16)) { + opcodenum = Opcode.OP_PUSHDATA2; + } else if (len < Math.pow(2, 32)) { + opcodenum = Opcode.OP_PUSHDATA4; + } else { + throw new Error('You can\'t push that much data'); + } + this._insertAtPosition({ + buf: buf, + len: len, + opcodenum: opcodenum + }, prepend); + return this; +}; + +Script.prototype.hasCodeseparators = function() { + for (var i = 0; i < this.chunks.length; i++) { + if (this.chunks[i].opcodenum === Opcode.OP_CODESEPARATOR) { + return true; + } + } + return false; +}; + +Script.prototype.removeCodeseparators = function() { + var chunks = []; + for (var i = 0; i < this.chunks.length; i++) { + if (this.chunks[i].opcodenum !== Opcode.OP_CODESEPARATOR) { + chunks.push(this.chunks[i]); + } + } + this.chunks = chunks; + return this; +}; + +// high level script builder methods + +/** + * @returns {Script} a new Multisig output script for given public keys, + * requiring m of those public keys to spend + * @param {PublicKey[]} publicKeys - list of all public keys controlling the output + * @param {number} threshold - amount of required signatures to spend the output + * @param {Object=} opts - Several options: + * - noSorting: defaults to false, if true, don't sort the given + * public keys before creating the script + */ +Script.buildMultisigOut = function(publicKeys, threshold, opts) { + $.checkArgument(threshold <= publicKeys.length, + 'Number of required signatures must be less than or equal to the number of public keys'); + opts = opts || {}; + var script = new Script(); + script.add(Opcode.smallInt(threshold)); + publicKeys = _.map(publicKeys, PublicKey); + var sorted = publicKeys; + if (!opts.noSorting) { + sorted = _.sortBy(publicKeys, function(publicKey) { + return publicKey.toString('hex'); + }); + } + for (var i = 0; i < sorted.length; i++) { + var publicKey = sorted[i]; + script.add(publicKey.toBuffer()); + } + script.add(Opcode.smallInt(publicKeys.length)); + script.add(Opcode.OP_CHECKMULTISIG); + return script; +}; + +Script.buildWitnessMultisigOutFromScript = function(script) { + if (script instanceof Script) { + var s = new Script(); + s.add(Opcode.OP_0); + s.add(Hash.sha256(script.toBuffer())); + return s; + } else { + throw new TypeError('First argument is expected to be a p2sh script'); + } +}; + +/** + * A new Multisig input script for the given public keys, requiring m of those public keys to spend + * + * @param {PublicKey[]} pubkeys list of all public keys controlling the output + * @param {number} threshold amount of required signatures to spend the output + * @param {Array} signatures and array of signature buffers to append to the script + * @param {Object=} opts + * @param {boolean=} opts.noSorting don't sort the given public keys before creating the script (false by default) + * @param {Script=} opts.cachedMultisig don't recalculate the redeemScript + * + * @returns {Script} + */ +Script.buildMultisigIn = function(pubkeys, threshold, signatures, opts) { + $.checkArgument(_.isArray(pubkeys)); + $.checkArgument(_.isNumber(threshold)); + $.checkArgument(_.isArray(signatures)); + opts = opts || {}; + var s = new Script(); + s.add(Opcode.OP_0); + _.each(signatures, function(signature) { + $.checkArgument(BufferUtil.isBuffer(signature), 'Signatures must be an array of Buffers'); + // TODO: allow signatures to be an array of Signature objects + s.add(signature); + }); + return s; +}; + +/** + * A new P2SH Multisig input script for the given public keys, requiring m of those public keys to spend + * + * @param {PublicKey[]} pubkeys list of all public keys controlling the output + * @param {number} threshold amount of required signatures to spend the output + * @param {Array} signatures and array of signature buffers to append to the script + * @param {Object=} opts + * @param {boolean=} opts.noSorting don't sort the given public keys before creating the script (false by default) + * @param {Script=} opts.cachedMultisig don't recalculate the redeemScript + * + * @returns {Script} + */ +Script.buildP2SHMultisigIn = function(pubkeys, threshold, signatures, opts) { + $.checkArgument(_.isArray(pubkeys)); + $.checkArgument(_.isNumber(threshold)); + $.checkArgument(_.isArray(signatures)); + opts = opts || {}; + var s = new Script(); + s.add(Opcode.OP_0); + _.each(signatures, function(signature) { + $.checkArgument(BufferUtil.isBuffer(signature), 'Signatures must be an array of Buffers'); + // TODO: allow signatures to be an array of Signature objects + s.add(signature); + }); + s.add((opts.cachedMultisig || Script.buildMultisigOut(pubkeys, threshold, opts)).toBuffer()); + return s; +}; + +/** + * @returns {Script} a new pay to public key hash output for the given + * address or public key + * @param {(Address|PublicKey)} to - destination address or public key + */ +Script.buildPublicKeyHashOut = function(to) { + $.checkArgument(!_.isUndefined(to)); + $.checkArgument(to instanceof PublicKey || to instanceof Address || _.isString(to)); + if (to instanceof PublicKey) { + to = to.toAddress(); + } else if (_.isString(to)) { + to = new Address(to); + } + var s = new Script(); + s.add(Opcode.OP_DUP) + .add(Opcode.OP_HASH160) + .add(to.hashBuffer) + .add(Opcode.OP_EQUALVERIFY) + .add(Opcode.OP_CHECKSIG); + s._network = to.network; + return s; +}; + +/** + * @returns {Script} a new pay to public key output for the given + * public key + */ +Script.buildPublicKeyOut = function(pubkey) { + $.checkArgument(pubkey instanceof PublicKey); + var s = new Script(); + s.add(pubkey.toBuffer()) + .add(Opcode.OP_CHECKSIG); + return s; +}; + +/** + * @returns {Script} a new OP_RETURN script with data + * @param {(string|Buffer)} data - the data to embed in the output + * @param {(string)} encoding - the type of encoding of the string + */ +Script.buildDataOut = function(data, encoding) { + $.checkArgument(_.isUndefined(data) || _.isString(data) || BufferUtil.isBuffer(data)); + if (_.isString(data)) { + data = Buffer.from(data, encoding); + } + var s = new Script(); + s.add(Opcode.OP_RETURN); + if (!_.isUndefined(data)) { + s.add(data); + } + return s; +}; + +/** + * @param {Script|Address} script - the redeemScript for the new p2sh output. + * It can also be a p2sh address + * @returns {Script} new pay to script hash script for given script + */ +Script.buildScriptHashOut = function(script) { + $.checkArgument(script instanceof Script || + (script instanceof Address && script.isPayToScriptHash())); + var s = new Script(); + s.add(Opcode.OP_HASH160) + .add(script instanceof Address ? script.hashBuffer : Hash.sha256ripemd160(script.toBuffer())) + .add(Opcode.OP_EQUAL); + + s._network = script._network || script.network; + return s; +}; + +/** + * Builds a scriptSig (a script for an input) that signs a public key output script. + * + * @param {Signature|Buffer} signature - a Signature object, or the signature in DER canonical encoding + * @param {number=} sigtype - the type of the signature (defaults to SIGHASH_ALL) + */ +Script.buildPublicKeyIn = function(signature, sigtype) { + $.checkArgument(signature instanceof Signature || BufferUtil.isBuffer(signature)); + $.checkArgument(_.isUndefined(sigtype) || _.isNumber(sigtype)); + if (signature instanceof Signature) { + signature = signature.toBuffer(); + } + var script = new Script(); + script.add(BufferUtil.concat([ + signature, + BufferUtil.integerAsSingleByteBuffer(sigtype || Signature.SIGHASH_ALL) + ])); + return script; +}; + +/** + * Builds a scriptSig (a script for an input) that signs a public key hash + * output script. + * + * @param {Buffer|string|PublicKey} publicKey + * @param {Signature|Buffer} signature - a Signature object, or the signature in DER canonical encoding + * @param {number=} sigtype - the type of the signature (defaults to SIGHASH_ALL) + */ +Script.buildPublicKeyHashIn = function(publicKey, signature, sigtype) { + $.checkArgument(signature instanceof Signature || BufferUtil.isBuffer(signature)); + $.checkArgument(_.isUndefined(sigtype) || _.isNumber(sigtype)); + if (signature instanceof Signature) { + signature = signature.toBuffer(); + } + var script = new Script() + .add(BufferUtil.concat([ + signature, + BufferUtil.integerAsSingleByteBuffer(sigtype || Signature.SIGHASH_ALL) + ])) + .add(new PublicKey(publicKey).toBuffer()); + return script; +}; + +/** + * @returns {Script} an empty script + */ +Script.empty = function() { + return new Script(); +}; + +/** + * @returns {Script} a new pay to script hash script that pays to this script + */ +Script.prototype.toScriptHashOut = function() { + return Script.buildScriptHashOut(this); +}; + +/** + * @return {Script} an output script built from the address + */ +Script.fromAddress = function(address) { + address = Address(address); + if (address.isPayToScriptHash()) { + return Script.buildScriptHashOut(address); + } else if (address.isPayToPublicKeyHash()) { + return Script.buildPublicKeyHashOut(address); + } + throw new errors.Script.UnrecognizedAddress(address); +}; + +/** + * Will return the associated address information object + * @return {Address|boolean} + */ +Script.prototype.getAddressInfo = function(opts) { + if (this._isInput) { + return this._getInputAddressInfo(); + } else if (this._isOutput) { + return this._getOutputAddressInfo(); + } else { + var info = this._getOutputAddressInfo(); + if (!info) { + return this._getInputAddressInfo(); + } + return info; + } +}; + +/** + * Will return the associated output scriptPubKey address information object + * @return {Address|boolean} + * @private + */ +Script.prototype._getOutputAddressInfo = function() { + var info = {}; + if (this.isScriptHashOut()) { + info.hashBuffer = this.getData(); + info.type = Address.PayToScriptHash; + } else if (this.isPublicKeyHashOut()) { + info.hashBuffer = this.getData(); + info.type = Address.PayToPublicKeyHash; + } else { + return false; + } + return info; +}; + +/** + * Will return the associated input scriptSig address information object + * @return {Address|boolean} + * @private + */ +Script.prototype._getInputAddressInfo = function() { + var info = {}; + if (this.isPublicKeyHashIn()) { + // hash the publickey found in the scriptSig + info.hashBuffer = Hash.sha256ripemd160(this.chunks[1].buf); + info.type = Address.PayToPublicKeyHash; + } else if (this.isScriptHashIn()) { + // hash the redeemscript found at the end of the scriptSig + info.hashBuffer = Hash.sha256ripemd160(this.chunks[this.chunks.length - 1].buf); + info.type = Address.PayToScriptHash; + } else { + return false; + } + return info; +}; + +/** + * @param {Network=} network + * @return {Address|boolean} the associated address for this script if possible, or false + */ +Script.prototype.toAddress = function(network) { + var info = this.getAddressInfo(); + if (!info) { + return false; + } + info.network = Networks.get(network) || this._network || Networks.defaultNetwork; + return new Address(info); +}; + +/** + * Analogous to bitcoind's FindAndDelete. Find and delete equivalent chunks, + * typically used with push data chunks. Note that this will find and delete + * not just the same data, but the same data with the same push data op as + * produced by default. i.e., if a pushdata in a tx does not use the minimal + * pushdata op, then when you try to remove the data it is pushing, it will not + * be removed, because they do not use the same pushdata op. + */ +Script.prototype.findAndDelete = function(script) { + var buf = script.toBuffer(); + var hex = buf.toString('hex'); + for (var i = 0; i < this.chunks.length; i++) { + var script2 = Script({ + chunks: [this.chunks[i]] + }); + var buf2 = script2.toBuffer(); + var hex2 = buf2.toString('hex'); + if (hex === hex2) { + this.chunks.splice(i, 1); + } + } + return this; +}; + +/** + * Comes from bitcoind's script interpreter CheckMinimalPush function + * @returns {boolean} if the chunk {i} is the smallest way to push that particular data. + */ +Script.prototype.checkMinimalPush = function(i) { + var chunk = this.chunks[i]; + var buf = chunk.buf; + var opcodenum = chunk.opcodenum; + if (!buf) { + return true; + } + if (buf.length === 0) { + // Could have used OP_0. + return opcodenum === Opcode.OP_0; + } else if (buf.length === 1 && buf[0] >= 1 && buf[0] <= 16) { + // Could have used OP_1 .. OP_16. + return opcodenum === Opcode.OP_1 + (buf[0] - 1); + } else if (buf.length === 1 && buf[0] === 0x81) { + // Could have used OP_1NEGATE + return opcodenum === Opcode.OP_1NEGATE; + } else if (buf.length <= 75) { + // Could have used a direct push (opcode indicating number of bytes pushed + those bytes). + return opcodenum === buf.length; + } else if (buf.length <= 255) { + // Could have used OP_PUSHDATA. + return opcodenum === Opcode.OP_PUSHDATA1; + } else if (buf.length <= 65535) { + // Could have used OP_PUSHDATA2. + return opcodenum === Opcode.OP_PUSHDATA2; + } + return true; +}; + +/** + * Comes from bitcoind's script DecodeOP_N function + * @param {number} opcode + * @returns {number} numeric value in range of 0 to 16 + */ +Script.prototype._decodeOP_N = function(opcode) { + if (opcode === Opcode.OP_0) { + return 0; + } else if (opcode >= Opcode.OP_1 && opcode <= Opcode.OP_16) { + return opcode - (Opcode.OP_1 - 1); + } else { + throw new Error('Invalid opcode: ' + JSON.stringify(opcode)); + } +}; + +/** + * Comes from bitcoind's script GetSigOpCount(boolean) function + * @param {boolean} use current (true) or pre-version-0.6 (false) logic + * @returns {number} number of signature operations required by this script + */ +Script.prototype.getSignatureOperationsCount = function(accurate) { + accurate = (_.isUndefined(accurate) ? true : accurate); + var self = this; + var n = 0; + var lastOpcode = Opcode.OP_INVALIDOPCODE; + _.each(self.chunks, function getChunk(chunk) { + var opcode = chunk.opcodenum; + if (opcode == Opcode.OP_CHECKSIG || opcode == Opcode.OP_CHECKSIGVERIFY) { + n++; + } else if (opcode == Opcode.OP_CHECKMULTISIG || opcode == Opcode.OP_CHECKMULTISIGVERIFY) { + if (accurate && lastOpcode >= Opcode.OP_1 && lastOpcode <= Opcode.OP_16) { + n += self._decodeOP_N(lastOpcode); + } else { + n += 20; + } + } + lastOpcode = opcode; + }); + return n; +}; + +module.exports = Script; diff --git a/packages/kauri-bitcore-lib/lib/transaction/index.js b/packages/kauri-bitcore-lib/lib/transaction/index.js new file mode 100644 index 0000000..b7a27df --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/index.js @@ -0,0 +1,8 @@ +module.exports = require('./transaction'); + +module.exports.Input = require('./input'); +module.exports.Output = require('./output'); +module.exports.UnspentOutput = require('./unspentoutput'); +module.exports.Signature = require('./signature'); +module.exports.Sighash = require('./sighash'); +module.exports.SighashWitness = require('./sighashwitness'); diff --git a/packages/kauri-bitcore-lib/lib/transaction/input/index.js b/packages/kauri-bitcore-lib/lib/transaction/input/index.js new file mode 100644 index 0000000..7005ed0 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/input/index.js @@ -0,0 +1,6 @@ +module.exports = require('./input'); + +module.exports.PublicKey = require('./publickey'); +module.exports.PublicKeyHash = require('./publickeyhash'); +module.exports.MultiSig = require('./multisig.js'); +module.exports.MultiSigScriptHash = require('./multisigscripthash.js'); diff --git a/packages/kauri-bitcore-lib/lib/transaction/input/input.js b/packages/kauri-bitcore-lib/lib/transaction/input/input.js new file mode 100644 index 0000000..1c27a2e --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/input/input.js @@ -0,0 +1,219 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('../../util/preconditions'); +var errors = require('../../errors'); +var BufferWriter = require('../../encoding/bufferwriter'); +var buffer = require('buffer'); +var BufferUtil = require('../../util/buffer'); +var JSUtil = require('../../util/js'); +var Script = require('../../script'); +var Sighash = require('../sighash'); +var Output = require('../output'); + +var MAXINT = 0xffffffff; // Math.pow(2, 32) - 1; +var DEFAULT_RBF_SEQNUMBER = MAXINT - 2; +var DEFAULT_SEQNUMBER = MAXINT; +var DEFAULT_LOCKTIME_SEQNUMBER = MAXINT - 1; + +function Input(params) { + if (!(this instanceof Input)) { + return new Input(params); + } + if (params) { + return this._fromObject(params); + } +} + +Input.MAXINT = MAXINT; +Input.DEFAULT_SEQNUMBER = DEFAULT_SEQNUMBER; +Input.DEFAULT_LOCKTIME_SEQNUMBER = DEFAULT_LOCKTIME_SEQNUMBER; +Input.DEFAULT_RBF_SEQNUMBER = DEFAULT_RBF_SEQNUMBER; + +Object.defineProperty(Input.prototype, 'script', { + configurable: false, + enumerable: true, + get: function() { + if (this.isNull()) { + return null; + } + if (!this._script) { + this._script = new Script(this._scriptBuffer); + this._script._isInput = true; + } + return this._script; + } +}); + +Input.fromObject = function(obj) { + $.checkArgument(_.isObject(obj)); + var input = new Input(); + return input._fromObject(obj); +}; + +Input.prototype._fromObject = function(params) { + var prevTxId; + if (_.isString(params.prevTxId) && JSUtil.isHexa(params.prevTxId)) { + prevTxId = new buffer.Buffer(params.prevTxId, 'hex'); + } else { + prevTxId = params.prevTxId; + } + this.witnesses = []; + this.output = params.output ? + (params.output instanceof Output ? params.output : new Output(params.output)) : undefined; + this.prevTxId = prevTxId || params.txidbuf; + this.outputIndex = _.isUndefined(params.outputIndex) ? params.txoutnum : params.outputIndex; + this.sequenceNumber = _.isUndefined(params.sequenceNumber) ? + (_.isUndefined(params.seqnum) ? DEFAULT_SEQNUMBER : params.seqnum) : params.sequenceNumber; + if (_.isUndefined(params.script) && _.isUndefined(params.scriptBuffer)) { + throw new errors.Transaction.Input.MissingScript(); + } + this.setScript(params.scriptBuffer || params.script); + return this; +}; + +Input.prototype.toObject = Input.prototype.toJSON = function toObject() { + var obj = { + prevTxId: this.prevTxId.toString('hex'), + outputIndex: this.outputIndex, + sequenceNumber: this.sequenceNumber, + script: this._scriptBuffer.toString('hex'), + }; + // add human readable form if input contains valid script + if (this.script) { + obj.scriptString = this.script.toString(); + } + if (this.output) { + obj.output = this.output.toObject(); + } + return obj; +}; + +Input.fromBufferReader = function(br) { + var input = new Input(); + input.prevTxId = br.readReverse(32); + input.outputIndex = br.readUInt32LE(); + input._scriptBuffer = br.readVarLengthBuffer(); + input.sequenceNumber = br.readUInt32LE(); + // TODO: return different classes according to which input it is + // e.g: CoinbaseInput, PublicKeyHashInput, MultiSigScriptHashInput, etc. + return input; +}; + +Input.prototype.toBufferWriter = function(writer) { + if (!writer) { + writer = new BufferWriter(); + } + writer.writeReverse(this.prevTxId); + writer.writeUInt32LE(this.outputIndex); + var script = this._scriptBuffer; + writer.writeVarintNum(script.length); + writer.write(script); + writer.writeUInt32LE(this.sequenceNumber); + return writer; +}; + +Input.prototype.setScript = function(script) { + this._script = null; + if (script instanceof Script) { + this._script = script; + this._script._isInput = true; + this._scriptBuffer = script.toBuffer(); + } else if (JSUtil.isHexa(script)) { + // hex string script + this._scriptBuffer = new buffer.Buffer(script, 'hex'); + } else if (_.isString(script)) { + // human readable string script + this._script = new Script(script); + this._script._isInput = true; + this._scriptBuffer = this._script.toBuffer(); + } else if (BufferUtil.isBuffer(script)) { + // buffer script + this._scriptBuffer = new buffer.Buffer(script); + } else { + throw new TypeError('Invalid argument type: script'); + } + return this; +}; + +/** + * Retrieve signatures for the provided PrivateKey. + * + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key to use when signing + * @param {number} inputIndex - the index of this input in the provided transaction + * @param {number} sigType - defaults to Signature.SIGHASH_ALL + * @param {Buffer} addressHash - if provided, don't calculate the hash of the + * public key associated with the private key provided + * @abstract + */ +Input.prototype.getSignatures = function() { + throw new errors.AbstractMethodInvoked( + 'Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported)' + + ' for input: ' + JSON.stringify(this) + ); +}; + +Input.prototype.getSatoshisBuffer = function() { + $.checkState(this.output instanceof Output); + $.checkState(this.output._satoshisBN); + return new BufferWriter().writeUInt64LEBN(this.output._satoshisBN).toBuffer(); +}; + + +Input.prototype.isFullySigned = function() { + throw new errors.AbstractMethodInvoked('Input#isFullySigned'); +}; + +Input.prototype.isFinal = function() { + return this.sequenceNumber !== 4294967295; +}; + +Input.prototype.addSignature = function() { + throw new errors.AbstractMethodInvoked('Input#addSignature'); +}; + +Input.prototype.clearSignatures = function() { + throw new errors.AbstractMethodInvoked('Input#clearSignatures'); +}; + +Input.prototype.hasWitnesses = function() { + if (this.witnesses && this.witnesses.length > 0) { + return true; + } + return false; +}; + +Input.prototype.getWitnesses = function() { + return this.witnesses; +}; + +Input.prototype.setWitnesses = function(witnesses) { + this.witnesses = witnesses; +}; + +Input.prototype.isValidSignature = function(transaction, signature) { + // FIXME: Refactor signature so this is not necessary + signature.signature.nhashtype = signature.sigtype; + return Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + this.output.script + ); +}; + +/** + * @returns true if this is a coinbase input (represents no input) + */ +Input.prototype.isNull = function() { + return this.prevTxId.toString('hex') === '0000000000000000000000000000000000000000000000000000000000000000' && + this.outputIndex === 0xffffffff; +}; + +Input.prototype._estimateSize = function() { + return this.toBufferWriter().toBuffer().length; +}; + +module.exports = Input; diff --git a/packages/kauri-bitcore-lib/lib/transaction/input/multisig.js b/packages/kauri-bitcore-lib/lib/transaction/input/multisig.js new file mode 100644 index 0000000..03a8413 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/input/multisig.js @@ -0,0 +1,211 @@ +'use strict'; + +var _ = require('lodash'); +var inherits = require('inherits'); +var Transaction = require('../transaction'); +var Input = require('./input'); +var Output = require('../output'); +var $ = require('../../util/preconditions'); + +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var Sighash = require('../sighash'); +var PublicKey = require('../../publickey'); +var BufferUtil = require('../../util/buffer'); +var TransactionSignature = require('../signature'); + +/** + * @constructor + */ +function MultiSigInput(input, pubkeys, threshold, signatures) { + Input.apply(this, arguments); + var self = this; + pubkeys = pubkeys || input.publicKeys; + threshold = threshold || input.threshold; + signatures = signatures || input.signatures; + this.publicKeys = _.sortBy(pubkeys, function(publicKey) { return publicKey.toString('hex'); }); + $.checkState(Script.buildMultisigOut(this.publicKeys, threshold).equals(this.output.script), + 'Provided public keys don\'t match to the provided output script'); + this.publicKeyIndex = {}; + _.each(this.publicKeys, function(publicKey, index) { + self.publicKeyIndex[publicKey.toString()] = index; + }); + this.threshold = threshold; + // Empty array of signatures + this.signatures = signatures ? this._deserializeSignatures(signatures) : new Array(this.publicKeys.length); +} +inherits(MultiSigInput, Input); + +MultiSigInput.prototype.toObject = function() { + var obj = Input.prototype.toObject.apply(this, arguments); + obj.threshold = this.threshold; + obj.publicKeys = _.map(this.publicKeys, function(publicKey) { return publicKey.toString(); }); + obj.signatures = this._serializeSignatures(); + return obj; +}; + +MultiSigInput.prototype._deserializeSignatures = function(signatures) { + return _.map(signatures, function(signature) { + if (!signature) { + return undefined; + } + return new TransactionSignature(signature); + }); +}; + +MultiSigInput.prototype._serializeSignatures = function() { + return _.map(this.signatures, function(signature) { + if (!signature) { + return undefined; + } + return signature.toObject(); + }); +}; + +MultiSigInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) { + $.checkState(this.output instanceof Output); + sigtype = sigtype || Signature.SIGHASH_ALL; + + var self = this; + var results = []; + _.each(this.publicKeys, function(publicKey) { + if (publicKey.toString() === privateKey.publicKey.toString()) { + results.push(new TransactionSignature({ + publicKey: privateKey.publicKey, + prevTxId: self.prevTxId, + outputIndex: self.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, self.output.script), + sigtype: sigtype + })); + } + }); + + return results; +}; + +MultiSigInput.prototype.addSignature = function(transaction, signature) { + $.checkState(!this.isFullySigned(), 'All needed signatures have already been added'); + $.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]), + 'Signature has no matching public key'); + $.checkState(this.isValidSignature(transaction, signature)); + this.signatures[this.publicKeyIndex[signature.publicKey.toString()]] = signature; + this._updateScript(); + return this; +}; + +MultiSigInput.prototype._updateScript = function() { + this.setScript(Script.buildMultisigIn( + this.publicKeys, + this.threshold, + this._createSignatures() + )); + return this; +}; + +MultiSigInput.prototype._createSignatures = function() { + return _.map( + _.filter(this.signatures, function(signature) { return !_.isUndefined(signature); }), + function(signature) { + return BufferUtil.concat([ + signature.signature.toDER(), + BufferUtil.integerAsSingleByteBuffer(signature.sigtype) + ]); + } + ); +}; + +MultiSigInput.prototype.clearSignatures = function() { + this.signatures = new Array(this.publicKeys.length); + this._updateScript(); +}; + +MultiSigInput.prototype.isFullySigned = function() { + return this.countSignatures() === this.threshold; +}; + +MultiSigInput.prototype.countMissingSignatures = function() { + return this.threshold - this.countSignatures(); +}; + +MultiSigInput.prototype.countSignatures = function() { + return _.reduce(this.signatures, function(sum, signature) { + return sum + (!!signature); + }, 0); +}; + +MultiSigInput.prototype.publicKeysWithoutSignature = function() { + var self = this; + return _.filter(this.publicKeys, function(publicKey) { + return !(self.signatures[self.publicKeyIndex[publicKey.toString()]]); + }); +}; + +MultiSigInput.prototype.isValidSignature = function(transaction, signature) { + // FIXME: Refactor signature so this is not necessary + signature.signature.nhashtype = signature.sigtype; + return Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + this.output.script + ); +}; + +/** + * + * @param {Buffer[]} signatures + * @param {PublicKey[]} publicKeys + * @param {Transaction} transaction + * @param {Integer} inputIndex + * @param {Input} input + * @returns {TransactionSignature[]} + */ +MultiSigInput.normalizeSignatures = function(transaction, input, inputIndex, signatures, publicKeys) { + return publicKeys.map(function (pubKey) { + var signatureMatch = null; + signatures = signatures.filter(function (signatureBuffer) { + if (signatureMatch) { + return true; + } + + var signature = new TransactionSignature({ + signature: Signature.fromTxFormat(signatureBuffer), + publicKey: pubKey, + prevTxId: input.prevTxId, + outputIndex: input.outputIndex, + inputIndex: inputIndex, + sigtype: Signature.SIGHASH_ALL + }); + + signature.signature.nhashtype = signature.sigtype; + var isMatch = Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + input.output.script + ); + + if (isMatch) { + signatureMatch = signature; + return false; + } + + return true; + }); + + return signatureMatch ? signatureMatch : null; + }); +}; + +MultiSigInput.OPCODES_SIZE = 1; // 0 +MultiSigInput.SIGNATURE_SIZE = 73; // size (1) + DER (<=72) + +MultiSigInput.prototype._estimateSize = function() { + return MultiSigInput.OPCODES_SIZE + + this.threshold * MultiSigInput.SIGNATURE_SIZE; +}; + +module.exports = MultiSigInput; diff --git a/packages/kauri-bitcore-lib/lib/transaction/input/multisigscripthash.js b/packages/kauri-bitcore-lib/lib/transaction/input/multisigscripthash.js new file mode 100644 index 0000000..0007a00 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/input/multisigscripthash.js @@ -0,0 +1,241 @@ +'use strict'; + +/* jshint maxparams:5 */ + +var _ = require('lodash'); +var inherits = require('inherits'); +var Input = require('./input'); +var Output = require('../output'); +var $ = require('../../util/preconditions'); + +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var Sighash = require('../sighash'); +var SighashWitness = require('../sighashwitness'); +var BufferWriter = require('../../encoding/bufferwriter'); +var BufferUtil = require('../../util/buffer'); +var TransactionSignature = require('../signature'); + +/** + * @constructor + */ +function MultiSigScriptHashInput(input, pubkeys, threshold, signatures, nestedWitness) { + /* jshint maxstatements:20 */ + Input.apply(this, arguments); + var self = this; + pubkeys = pubkeys || input.publicKeys; + threshold = threshold || input.threshold; + signatures = signatures || input.signatures; + this.nestedWitness = nestedWitness ? true : false; + this.publicKeys = _.sortBy(pubkeys, function(publicKey) { return publicKey.toString('hex'); }); + this.redeemScript = Script.buildMultisigOut(this.publicKeys, threshold); + if (this.nestedWitness) { + var nested = Script.buildWitnessMultisigOutFromScript(this.redeemScript); + $.checkState(Script.buildScriptHashOut(nested).equals(this.output.script), + 'Provided public keys don\'t hash to the provided output (nested witness)'); + var scriptSig = new Script(); + scriptSig.add(nested.toBuffer()); + this.setScript(scriptSig); + } else { + $.checkState(Script.buildScriptHashOut(this.redeemScript).equals(this.output.script), + 'Provided public keys don\'t hash to the provided output'); + } + + this.publicKeyIndex = {}; + _.each(this.publicKeys, function(publicKey, index) { + self.publicKeyIndex[publicKey.toString()] = index; + }); + this.threshold = threshold; + // Empty array of signatures + this.signatures = signatures ? this._deserializeSignatures(signatures) : new Array(this.publicKeys.length); +} +inherits(MultiSigScriptHashInput, Input); + +MultiSigScriptHashInput.prototype.toObject = function() { + var obj = Input.prototype.toObject.apply(this, arguments); + obj.threshold = this.threshold; + obj.publicKeys = _.map(this.publicKeys, function(publicKey) { return publicKey.toString(); }); + obj.signatures = this._serializeSignatures(); + return obj; +}; + +MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures) { + return _.map(signatures, function(signature) { + if (!signature) { + return undefined; + } + return new TransactionSignature(signature); + }); +}; + +MultiSigScriptHashInput.prototype._serializeSignatures = function() { + return _.map(this.signatures, function(signature) { + if (!signature) { + return undefined; + } + return signature.toObject(); + }); +}; + +MultiSigScriptHashInput.prototype.getScriptCode = function() { + var writer = new BufferWriter(); + if (!this.redeemScript.hasCodeseparators()) { + var redeemScriptBuffer = this.redeemScript.toBuffer(); + writer.writeVarintNum(redeemScriptBuffer.length); + writer.write(redeemScriptBuffer); + } else { + throw new Error('@TODO'); + } + return writer.toBuffer(); +}; + +MultiSigScriptHashInput.prototype.getSighash = function(transaction, privateKey, index, sigtype) { + var self = this; + var hash; + if (self.nestedWitness) { + var scriptCode = self.getScriptCode(); + var satoshisBuffer = self.getSatoshisBuffer(); + hash = SighashWitness.sighash(transaction, sigtype, index, scriptCode, satoshisBuffer); + } else { + hash = Sighash.sighash(transaction, sigtype, index, self.redeemScript); + } + return hash; +}; + +MultiSigScriptHashInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) { + $.checkState(this.output instanceof Output); + sigtype = sigtype || Signature.SIGHASH_ALL; + + var self = this; + var results = []; + _.each(this.publicKeys, function(publicKey) { + if (publicKey.toString() === privateKey.publicKey.toString()) { + var signature; + if (self.nestedWitness) { + var scriptCode = self.getScriptCode(); + var satoshisBuffer = self.getSatoshisBuffer(); + signature = SighashWitness.sign(transaction, privateKey, sigtype, index, scriptCode, satoshisBuffer); + } else { + signature = Sighash.sign(transaction, privateKey, sigtype, index, self.redeemScript); + } + results.push(new TransactionSignature({ + publicKey: privateKey.publicKey, + prevTxId: self.prevTxId, + outputIndex: self.outputIndex, + inputIndex: index, + signature: signature, + sigtype: sigtype + })); + } + }); + return results; +}; + +MultiSigScriptHashInput.prototype.addSignature = function(transaction, signature) { + $.checkState(!this.isFullySigned(), 'All needed signatures have already been added'); + $.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]), + 'Signature has no matching public key'); + $.checkState(this.isValidSignature(transaction, signature)); + this.signatures[this.publicKeyIndex[signature.publicKey.toString()]] = signature; + this._updateScript(); + return this; +}; + +MultiSigScriptHashInput.prototype._updateScript = function() { + if (this.nestedWitness) { + var stack = [ + new Buffer(0), + ]; + var signatures = this._createSignatures(); + for (var i = 0; i < signatures.length; i++) { + stack.push(signatures[i]); + } + stack.push(this.redeemScript.toBuffer()); + this.setWitnesses(stack); + } else { + var scriptSig = Script.buildP2SHMultisigIn( + this.publicKeys, + this.threshold, + this._createSignatures(), + { cachedMultisig: this.redeemScript } + ); + this.setScript(scriptSig); + } + return this; +}; + +MultiSigScriptHashInput.prototype._createSignatures = function() { + return _.map( + _.filter(this.signatures, function(signature) { return !_.isUndefined(signature); }), + function(signature) { + return BufferUtil.concat([ + signature.signature.toDER(), + BufferUtil.integerAsSingleByteBuffer(signature.sigtype) + ]); + } + ); +}; + +MultiSigScriptHashInput.prototype.clearSignatures = function() { + this.signatures = new Array(this.publicKeys.length); + this._updateScript(); +}; + +MultiSigScriptHashInput.prototype.isFullySigned = function() { + return this.countSignatures() === this.threshold; +}; + +MultiSigScriptHashInput.prototype.countMissingSignatures = function() { + return this.threshold - this.countSignatures(); +}; + +MultiSigScriptHashInput.prototype.countSignatures = function() { + return _.reduce(this.signatures, function(sum, signature) { + return sum + (!!signature); + }, 0); +}; + +MultiSigScriptHashInput.prototype.publicKeysWithoutSignature = function() { + var self = this; + return _.filter(this.publicKeys, function(publicKey) { + return !(self.signatures[self.publicKeyIndex[publicKey.toString()]]); + }); +}; + +MultiSigScriptHashInput.prototype.isValidSignature = function(transaction, signature) { + if (this.nestedWitness) { + signature.signature.nhashtype = signature.sigtype; + var scriptCode = this.getScriptCode(); + var satoshisBuffer = this.getSatoshisBuffer(); + return SighashWitness.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + scriptCode, + satoshisBuffer + ); + } else { + // FIXME: Refactor signature so this is not necessary + signature.signature.nhashtype = signature.sigtype; + return Sighash.verify( + transaction, + signature.signature, + signature.publicKey, + signature.inputIndex, + this.redeemScript + ); + } +}; + +MultiSigScriptHashInput.OPCODES_SIZE = 7; // serialized size (<=3) + 0 .. N .. M OP_CHECKMULTISIG +MultiSigScriptHashInput.SIGNATURE_SIZE = 74; // size (1) + DER (<=72) + sighash (1) +MultiSigScriptHashInput.PUBKEY_SIZE = 34; // size (1) + DER (<=33) + +MultiSigScriptHashInput.prototype._estimateSize = function() { + return MultiSigScriptHashInput.OPCODES_SIZE + + this.threshold * MultiSigScriptHashInput.SIGNATURE_SIZE + + this.publicKeys.length * MultiSigScriptHashInput.PUBKEY_SIZE; +}; + +module.exports = MultiSigScriptHashInput; diff --git a/packages/kauri-bitcore-lib/lib/transaction/input/publickey.js b/packages/kauri-bitcore-lib/lib/transaction/input/publickey.js new file mode 100644 index 0000000..3cb2fe5 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/input/publickey.js @@ -0,0 +1,89 @@ +'use strict'; + +var inherits = require('inherits'); + +var $ = require('../../util/preconditions'); +var BufferUtil = require('../../util/buffer'); + +var Input = require('./input'); +var Output = require('../output'); +var Sighash = require('../sighash'); +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var TransactionSignature = require('../signature'); + +/** + * Represents a special kind of input of PayToPublicKey kind. + * @constructor + */ +function PublicKeyInput() { + Input.apply(this, arguments); +} +inherits(PublicKeyInput, Input); + +/** + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key with which to sign the transaction + * @param {number} index - the index of the input in the transaction input vector + * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL + * @return {Array} of objects that can be + */ +PublicKeyInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) { + $.checkState(this.output instanceof Output); + sigtype = sigtype || Signature.SIGHASH_ALL; + var publicKey = privateKey.toPublicKey(); + if (publicKey.toString() === this.output.script.getPublicKey().toString('hex')) { + return [new TransactionSignature({ + publicKey: publicKey, + prevTxId: this.prevTxId, + outputIndex: this.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, this.output.script), + sigtype: sigtype + })]; + } + return []; +}; + +/** + * Add the provided signature + * + * @param {Object} signature + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @param {number=} signature.sigtype + * @return {PublicKeyInput} this, for chaining + */ +PublicKeyInput.prototype.addSignature = function(transaction, signature) { + $.checkState(this.isValidSignature(transaction, signature), 'Signature is invalid'); + this.setScript(Script.buildPublicKeyIn( + signature.signature.toDER(), + signature.sigtype + )); + return this; +}; + +/** + * Clear the input's signature + * @return {PublicKeyHashInput} this, for chaining + */ +PublicKeyInput.prototype.clearSignatures = function() { + this.setScript(Script.empty()); + return this; +}; + +/** + * Query whether the input is signed + * @return {boolean} + */ +PublicKeyInput.prototype.isFullySigned = function() { + return this.script.isPublicKeyIn(); +}; + +PublicKeyInput.SCRIPT_MAX_SIZE = 73; // sigsize (1 + 72) + +PublicKeyInput.prototype._estimateSize = function() { + return PublicKeyInput.SCRIPT_MAX_SIZE; +}; + +module.exports = PublicKeyInput; diff --git a/packages/kauri-bitcore-lib/lib/transaction/input/publickeyhash.js b/packages/kauri-bitcore-lib/lib/transaction/input/publickeyhash.js new file mode 100644 index 0000000..b5338c6 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/input/publickeyhash.js @@ -0,0 +1,95 @@ +'use strict'; + +var inherits = require('inherits'); + +var $ = require('../../util/preconditions'); +var BufferUtil = require('../../util/buffer'); + +var Hash = require('../../crypto/hash'); +var Input = require('./input'); +var Output = require('../output'); +var Sighash = require('../sighash'); +var Script = require('../../script'); +var Signature = require('../../crypto/signature'); +var TransactionSignature = require('../signature'); + +/** + * Represents a special kind of input of PayToPublicKeyHash kind. + * @constructor + */ +function PublicKeyHashInput() { + Input.apply(this, arguments); +} +inherits(PublicKeyHashInput, Input); + +/* jshint maxparams: 5 */ +/** + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key with which to sign the transaction + * @param {number} index - the index of the input in the transaction input vector + * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL + * @param {Buffer=} hashData - the precalculated hash of the public key associated with the privateKey provided + * @return {Array} of objects that can be + */ +PublicKeyHashInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype, hashData) { + $.checkState(this.output instanceof Output); + hashData = hashData || Hash.sha256ripemd160(privateKey.publicKey.toBuffer()); + sigtype = sigtype || Signature.SIGHASH_ALL; + + if (BufferUtil.equals(hashData, this.output.script.getPublicKeyHash())) { + return [new TransactionSignature({ + publicKey: privateKey.publicKey, + prevTxId: this.prevTxId, + outputIndex: this.outputIndex, + inputIndex: index, + signature: Sighash.sign(transaction, privateKey, sigtype, index, this.output.script), + sigtype: sigtype + })]; + } + return []; +}; +/* jshint maxparams: 3 */ + +/** + * Add the provided signature + * + * @param {Object} signature + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @param {number=} signature.sigtype + * @return {PublicKeyHashInput} this, for chaining + */ +PublicKeyHashInput.prototype.addSignature = function(transaction, signature) { + $.checkState(this.isValidSignature(transaction, signature), 'Signature is invalid'); + this.setScript(Script.buildPublicKeyHashIn( + signature.publicKey, + signature.signature.toDER(), + signature.sigtype + )); + return this; +}; + +/** + * Clear the input's signature + * @return {PublicKeyHashInput} this, for chaining + */ +PublicKeyHashInput.prototype.clearSignatures = function() { + this.setScript(Script.empty()); + return this; +}; + +/** + * Query whether the input is signed + * @return {boolean} + */ +PublicKeyHashInput.prototype.isFullySigned = function() { + return this.script.isPublicKeyHashIn(); +}; + +PublicKeyHashInput.SCRIPT_MAX_SIZE = 73 + 34; // sigsize (1 + 72) + pubkey (1 + 33) + +PublicKeyHashInput.prototype._estimateSize = function() { + return PublicKeyHashInput.SCRIPT_MAX_SIZE; +}; + +module.exports = PublicKeyHashInput; diff --git a/packages/kauri-bitcore-lib/lib/transaction/output.js b/packages/kauri-bitcore-lib/lib/transaction/output.js new file mode 100644 index 0000000..a54454a --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/output.js @@ -0,0 +1,168 @@ +'use strict'; + +var _ = require('lodash'); +var BN = require('../crypto/bn'); +var buffer = require('buffer'); +var bufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); +var BufferWriter = require('../encoding/bufferwriter'); +var Script = require('../script'); +var $ = require('../util/preconditions'); +var errors = require('../errors'); + +var MAX_SAFE_INTEGER = 0x1fffffffffffff; + +function Output(args) { + if (!(this instanceof Output)) { + return new Output(args); + } + if (_.isObject(args)) { + this.satoshis = args.satoshis; + if (bufferUtil.isBuffer(args.script)) { + this._scriptBuffer = args.script; + } else { + var script; + if (_.isString(args.script) && JSUtil.isHexa(args.script)) { + script = new buffer.Buffer(args.script, 'hex'); + } else { + script = args.script; + } + this.setScript(script); + } + } else { + throw new TypeError('Unrecognized argument for Output'); + } +} + +Object.defineProperty(Output.prototype, 'script', { + configurable: false, + enumerable: true, + get: function() { + if (this._script) { + return this._script; + } else { + this.setScriptFromBuffer(this._scriptBuffer); + return this._script; + } + + } +}); + +Object.defineProperty(Output.prototype, 'satoshis', { + configurable: false, + enumerable: true, + get: function() { + return this._satoshis; + }, + set: function(num) { + if (num instanceof BN) { + this._satoshisBN = num; + this._satoshis = num.toNumber(); + } else if (_.isString(num)) { + this._satoshis = parseInt(num); + this._satoshisBN = BN.fromNumber(this._satoshis); + } else { + $.checkArgument( + JSUtil.isNaturalNumber(num), + 'Output satoshis is not a natural number' + ); + this._satoshisBN = BN.fromNumber(num); + this._satoshis = num; + } + $.checkState( + JSUtil.isNaturalNumber(this._satoshis), + 'Output satoshis is not a natural number' + ); + } +}); + +Output.prototype.invalidSatoshis = function() { + if (this._satoshis > MAX_SAFE_INTEGER) { + return 'transaction txout satoshis greater than max safe integer'; + } + if (this._satoshis !== this._satoshisBN.toNumber()) { + return 'transaction txout satoshis has corrupted value'; + } + if (this._satoshis < 0) { + return 'transaction txout negative'; + } + return false; +}; + +Output.prototype.toObject = Output.prototype.toJSON = function toObject() { + var obj = { + satoshis: this.satoshis + }; + obj.script = this._scriptBuffer.toString('hex'); + return obj; +}; + +Output.fromObject = function(data) { + return new Output(data); +}; + +Output.prototype.setScriptFromBuffer = function(buffer) { + this._scriptBuffer = buffer; + try { + this._script = Script.fromBuffer(this._scriptBuffer); + this._script._isOutput = true; + } catch(e) { + if (e instanceof errors.Script.InvalidBuffer) { + this._script = null; + } else { + throw e; + } + } +}; + +Output.prototype.setScript = function(script) { + if (script instanceof Script) { + this._scriptBuffer = script.toBuffer(); + this._script = script; + this._script._isOutput = true; + } else if (_.isString(script)) { + this._script = Script.fromString(script); + this._scriptBuffer = this._script.toBuffer(); + this._script._isOutput = true; + } else if (bufferUtil.isBuffer(script)) { + this.setScriptFromBuffer(script); + } else { + throw new TypeError('Invalid argument type: script'); + } + return this; +}; + +Output.prototype.inspect = function() { + var scriptStr; + if (this.script) { + scriptStr = this.script.inspect(); + } else { + scriptStr = this._scriptBuffer.toString('hex'); + } + return ''; +}; + +Output.fromBufferReader = function(br) { + var obj = {}; + obj.satoshis = br.readUInt64LEBN(); + var size = br.readVarintNum(); + if (size !== 0) { + obj.script = br.read(size); + } else { + obj.script = new buffer.Buffer([]); + } + return new Output(obj); +}; + +Output.prototype.toBufferWriter = function(writer) { + if (!writer) { + writer = new BufferWriter(); + } + writer.writeUInt64LEBN(this._satoshisBN); + var script = this._scriptBuffer; + writer.writeVarintNum(script.length); + writer.write(script); + return writer; +}; + +module.exports = Output; diff --git a/packages/kauri-bitcore-lib/lib/transaction/sighash.js b/packages/kauri-bitcore-lib/lib/transaction/sighash.js new file mode 100644 index 0000000..aad6816 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/sighash.js @@ -0,0 +1,136 @@ +'use strict'; + +var buffer = require('buffer'); + +var Signature = require('../crypto/signature'); +var Script = require('../script'); +var Output = require('./output'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var BN = require('../crypto/bn'); +var Hash = require('../crypto/hash'); +var ECDSA = require('../crypto/ecdsa'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); + +var SIGHASH_SINGLE_BUG = '0000000000000000000000000000000000000000000000000000000000000001'; +var BITS_64_ON = 'ffffffffffffffff'; + +/** + * Returns a buffer of length 32 bytes with the hash that needs to be signed + * for OP_CHECKSIG. + * + * @name Signing.sighash + * @param {Transaction} transaction the transaction to sign + * @param {number} sighashType the type of the hash + * @param {number} inputNumber the input index for the signature + * @param {Script} subscript the script that will be signed + */ +var sighash = function sighash(transaction, sighashType, inputNumber, subscript) { + var Transaction = require('./transaction'); + var Input = require('./input'); + + var i; + // Copy transaction + var txcopy = Transaction.shallowCopy(transaction); + + // Copy script + subscript = new Script(subscript); + subscript.removeCodeseparators(); + + for (i = 0; i < txcopy.inputs.length; i++) { + // Blank signatures for other inputs + txcopy.inputs[i] = new Input(txcopy.inputs[i]).setScript(Script.empty()); + } + + txcopy.inputs[inputNumber] = new Input(txcopy.inputs[inputNumber]).setScript(subscript); + + if ((sighashType & 31) === Signature.SIGHASH_NONE || + (sighashType & 31) === Signature.SIGHASH_SINGLE) { + + // clear all sequenceNumbers + for (i = 0; i < txcopy.inputs.length; i++) { + if (i !== inputNumber) { + txcopy.inputs[i].sequenceNumber = 0; + } + } + } + + if ((sighashType & 31) === Signature.SIGHASH_NONE) { + txcopy.outputs = []; + + } else if ((sighashType & 31) === Signature.SIGHASH_SINGLE) { + // The SIGHASH_SINGLE bug. + // https://bitcointalk.org/index.php?topic=260595.0 + if (inputNumber >= txcopy.outputs.length) { + return Buffer.from(SIGHASH_SINGLE_BUG, 'hex'); + } + + txcopy.outputs.length = inputNumber + 1; + + for (i = 0; i < inputNumber; i++) { + txcopy.outputs[i] = new Output({ + satoshis: BN.fromBuffer(new buffer.Buffer(BITS_64_ON, 'hex')), + script: Script.empty() + }); + } + } + + if (sighashType & Signature.SIGHASH_ANYONECANPAY) { + txcopy.inputs = [txcopy.inputs[inputNumber]]; + } + + var buf = new BufferWriter() + .write(txcopy.toBuffer()) + .writeInt32LE(sighashType) + .toBuffer(); + var ret = Hash.sha256sha256(buf); + ret = new BufferReader(ret).readReverse(); + return ret; +}; + +/** + * Create a signature + * + * @name Signing.sign + * @param {Transaction} transaction + * @param {PrivateKey} privateKey + * @param {number} sighash + * @param {number} inputIndex + * @param {Script} subscript + * @return {Signature} + */ +function sign(transaction, privateKey, sighashType, inputIndex, subscript) { + var hashbuf = sighash(transaction, sighashType, inputIndex, subscript); + var sig = ECDSA.sign(hashbuf, privateKey, 'little').set({ + nhashtype: sighashType + }); + return sig; +} + +/** + * Verify a signature + * + * @name Signing.verify + * @param {Transaction} transaction + * @param {Signature} signature + * @param {PublicKey} publicKey + * @param {number} inputIndex + * @param {Script} subscript + * @return {boolean} + */ +function verify(transaction, signature, publicKey, inputIndex, subscript) { + $.checkArgument(!_.isUndefined(transaction)); + $.checkArgument(!_.isUndefined(signature) && !_.isUndefined(signature.nhashtype)); + var hashbuf = sighash(transaction, signature.nhashtype, inputIndex, subscript); + return ECDSA.verify(hashbuf, signature, publicKey, 'little'); +} + +/** + * @namespace Signing + */ +module.exports = { + sighash: sighash, + sign: sign, + verify: verify +}; diff --git a/packages/kauri-bitcore-lib/lib/transaction/sighashwitness.js b/packages/kauri-bitcore-lib/lib/transaction/sighashwitness.js new file mode 100644 index 0000000..7fe04a9 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/sighashwitness.js @@ -0,0 +1,149 @@ +'use strict'; + +/* jshint maxparams:5 */ + +var Signature = require('../crypto/signature'); +var Script = require('../script'); +var Output = require('./output'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var BN = require('../crypto/bn'); +var Hash = require('../crypto/hash'); +var ECDSA = require('../crypto/ecdsa'); +var $ = require('../util/preconditions'); +var _ = require('lodash'); + +/** + * Returns a buffer of length 32 bytes with the hash that needs to be signed + * for witness programs as defined by: + * https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki + * + * @name Signing.sighash + * @param {Transaction} transaction the transaction to sign + * @param {number} sighashType the type of the hash + * @param {number} inputNumber the input index for the signature + * @param {Buffer} scriptCode + * @param {Buffer} satoshisBuffer + */ +var sighash = function sighash(transaction, sighashType, inputNumber, scriptCode, satoshisBuffer) { + /* jshint maxstatements: 50 */ + + var hashPrevouts; + var hashSequence; + var hashOutputs; + + if (!(sighashType & Signature.SIGHASH_ANYONECANPAY)) { + var buffers = []; + for (var n = 0; n < transaction.inputs.length; n++) { + var input = transaction.inputs[n]; + var prevTxIdBuffer = new BufferReader(input.prevTxId).readReverse(); + buffers.push(prevTxIdBuffer); + var outputIndexBuffer = new Buffer(new Array(4)); + outputIndexBuffer.writeUInt32LE(input.outputIndex, 0); + buffers.push(outputIndexBuffer); + } + hashPrevouts = Hash.sha256sha256(Buffer.concat(buffers)); + } + + if (!(sighashType & Signature.SIGHASH_ANYONECANPAY) && + (sighashType & 0x1f) !== Signature.SIGHASH_SINGLE && (sighashType & 0x1f) !== Signature.SIGHASH_NONE) { + + var sequenceBuffers = []; + for (var m = 0; m < transaction.inputs.length; m++) { + var sequenceBuffer = new Buffer(new Array(4)); + sequenceBuffer.writeUInt32LE(transaction.inputs[m].sequenceNumber, 0); + sequenceBuffers.push(sequenceBuffer); + } + hashSequence = Hash.sha256sha256(Buffer.concat(sequenceBuffers)); + } + + var outputWriter = new BufferWriter(); + if ((sighashType & 0x1f) !== Signature.SIGHASH_SINGLE && (sighashType & 0x1f) !== Signature.SIGHASH_NONE) { + for (var p = 0; p < transaction.outputs.length; p++) { + transaction.outputs[p].toBufferWriter(outputWriter); + } + hashOutputs = Hash.sha256sha256(outputWriter.toBuffer()); + } else if ((sighashType & 0x1f) === Signature.SIGHASH_SINGLE && inputNumber < transaction.outputs.length) { + transaction.outputs[inputNumber].toBufferWriter(outputWriter); + hashOutputs = Hash.sha256sha256(outputWriter.toBuffer()); + } + + // Version + var writer = new BufferWriter(); + writer.writeUInt32LE(transaction.version); + + // Input prevouts/nSequence (none/all, depending on flags) + writer.write(hashPrevouts); + writer.write(hashSequence); + + // The input being signed (replacing the scriptSig with scriptCode + amount) + // The prevout may already be contained in hashPrevout, and the nSequence + // may already be contain in hashSequence. + var outpointId = new BufferReader(transaction.inputs[inputNumber].prevTxId).readReverse(); + writer.write(outpointId); + writer.writeUInt32LE(transaction.inputs[inputNumber].outputIndex); + + writer.write(scriptCode); + + writer.write(satoshisBuffer); + + writer.writeUInt32LE(transaction.inputs[inputNumber].sequenceNumber); + + // Outputs (none/one/all, depending on flags) + writer.write(hashOutputs); + + // Locktime + writer.writeUInt32LE(transaction.nLockTime); + + // Sighash type + writer.writeInt32LE(sighashType); + + return Hash.sha256sha256(writer.toBuffer()); + +}; + +/** + * Create a signature + * + * @name Signing.sign + * @param {Transaction} transaction + * @param {PrivateKey} privateKey + * @param {number} sighash + * @param {number} inputIndex + * @param {Script} subscript + * @return {Signature} + */ +function sign(transaction, privateKey, sighashType, inputIndex, scriptCode, satoshisBuffer) { + var hashbuf = sighash(transaction, sighashType, inputIndex, scriptCode, satoshisBuffer); + var sig = ECDSA.sign(hashbuf, privateKey).set({ + nhashtype: sighashType + }); + return sig; +} + +/** + * Verify a signature + * + * @name Signing.verify + * @param {Transaction} transaction + * @param {Signature} signature + * @param {PublicKey} publicKey + * @param {number} inputIndex + * @param {Script} subscript + * @return {boolean} + */ +function verify(transaction, signature, publicKey, inputIndex, scriptCode, satoshisBuffer) { + $.checkArgument(!_.isUndefined(transaction)); + $.checkArgument(!_.isUndefined(signature) && !_.isUndefined(signature.nhashtype)); + var hashbuf = sighash(transaction, signature.nhashtype, inputIndex, scriptCode, satoshisBuffer); + return ECDSA.verify(hashbuf, signature, publicKey); +} + +/** + * @namespace Signing + */ +module.exports = { + sighash: sighash, + sign: sign, + verify: verify +}; diff --git a/packages/kauri-bitcore-lib/lib/transaction/signature.js b/packages/kauri-bitcore-lib/lib/transaction/signature.js new file mode 100644 index 0000000..5e40f99 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/signature.js @@ -0,0 +1,89 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var inherits = require('inherits'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); + +var PublicKey = require('../publickey'); +var errors = require('../errors'); +var Signature = require('../crypto/signature'); + +/** + * @desc + * Wrapper around Signature with fields related to signing a transaction specifically + * + * @param {Object|string|TransactionSignature} arg + * @constructor + */ +function TransactionSignature(arg) { + if (!(this instanceof TransactionSignature)) { + return new TransactionSignature(arg); + } + if (arg instanceof TransactionSignature) { + return arg; + } + if (_.isObject(arg)) { + return this._fromObject(arg); + } + throw new errors.InvalidArgument('TransactionSignatures must be instantiated from an object'); +} +inherits(TransactionSignature, Signature); + +TransactionSignature.prototype._fromObject = function(arg) { + this._checkObjectArgs(arg); + this.publicKey = new PublicKey(arg.publicKey); + this.prevTxId = BufferUtil.isBuffer(arg.prevTxId) ? arg.prevTxId : Buffer.from(arg.prevTxId, 'hex'); + this.outputIndex = arg.outputIndex; + this.inputIndex = arg.inputIndex; + this.signature = (arg.signature instanceof Signature) ? arg.signature : + BufferUtil.isBuffer(arg.signature) ? Signature.fromBuffer(arg.signature) : + Signature.fromString(arg.signature); + this.sigtype = arg.sigtype; + return this; +}; + +TransactionSignature.prototype._checkObjectArgs = function(arg) { + $.checkArgument(PublicKey(arg.publicKey), 'publicKey'); + $.checkArgument(!_.isUndefined(arg.inputIndex), 'inputIndex'); + $.checkArgument(!_.isUndefined(arg.outputIndex), 'outputIndex'); + $.checkState(_.isNumber(arg.inputIndex), 'inputIndex must be a number'); + $.checkState(_.isNumber(arg.outputIndex), 'outputIndex must be a number'); + $.checkArgument(arg.signature, 'signature'); + $.checkArgument(arg.prevTxId, 'prevTxId'); + $.checkState(arg.signature instanceof Signature || + BufferUtil.isBuffer(arg.signature) || + JSUtil.isHexa(arg.signature), 'signature must be a buffer or hexa value'); + $.checkState(BufferUtil.isBuffer(arg.prevTxId) || + JSUtil.isHexa(arg.prevTxId), 'prevTxId must be a buffer or hexa value'); + $.checkArgument(arg.sigtype, 'sigtype'); + $.checkState(_.isNumber(arg.sigtype), 'sigtype must be a number'); +}; + +/** + * Serializes a transaction to a plain JS object + * @return {Object} + */ +TransactionSignature.prototype.toObject = TransactionSignature.prototype.toJSON = function toObject() { + return { + publicKey: this.publicKey.toString(), + prevTxId: this.prevTxId.toString('hex'), + outputIndex: this.outputIndex, + inputIndex: this.inputIndex, + signature: this.signature.toString(), + sigtype: this.sigtype + }; +}; + +/** + * Builds a TransactionSignature from an object + * @param {Object} object + * @return {TransactionSignature} + */ +TransactionSignature.fromObject = function(object) { + $.checkArgument(object); + return new TransactionSignature(object); +}; + +module.exports = TransactionSignature; diff --git a/packages/kauri-bitcore-lib/lib/transaction/transaction.js b/packages/kauri-bitcore-lib/lib/transaction/transaction.js new file mode 100644 index 0000000..cc669e2 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/transaction.js @@ -0,0 +1,1333 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var buffer = require('buffer'); +var compare = Buffer.compare || require('buffer-compare'); + +var errors = require('../errors'); +var BufferUtil = require('../util/buffer'); +var JSUtil = require('../util/js'); +var BufferReader = require('../encoding/bufferreader'); +var BufferWriter = require('../encoding/bufferwriter'); +var Hash = require('../crypto/hash'); +var Signature = require('../crypto/signature'); +var Sighash = require('./sighash'); +var SighashWitness = require('./sighashwitness'); + +var Address = require('../address'); +var UnspentOutput = require('./unspentoutput'); +var Input = require('./input'); +var PublicKeyHashInput = Input.PublicKeyHash; +var PublicKeyInput = Input.PublicKey; +var MultiSigScriptHashInput = Input.MultiSigScriptHash; +var MultiSigInput = Input.MultiSig; +var Output = require('./output'); +var Script = require('../script'); +var PrivateKey = require('../privatekey'); +var BN = require('../crypto/bn'); + +/** + * Represents a transaction, a set of inputs and outputs to change ownership of tokens + * + * @param {*} serialized + * @constructor + */ +function Transaction(serialized) { + if (!(this instanceof Transaction)) { + return new Transaction(serialized); + } + this.inputs = []; + this.outputs = []; + this._inputAmount = undefined; + this._outputAmount = undefined; + + if (serialized) { + if (serialized instanceof Transaction) { + return Transaction.shallowCopy(serialized); + } else if (JSUtil.isHexa(serialized)) { + this.fromString(serialized); + } else if (BufferUtil.isBuffer(serialized)) { + this.fromBuffer(serialized); + } else if (_.isObject(serialized)) { + this.fromObject(serialized); + } else { + throw new errors.InvalidArgument('Must provide an object or string to deserialize a transaction'); + } + } else { + this._newTransaction(); + } +} +var CURRENT_VERSION = 1; +var DEFAULT_NLOCKTIME = 0; +var MAX_BLOCK_SIZE = 1000000; + +// Minimum amount for an output for it not to be considered a dust output +Transaction.DUST_AMOUNT = 546; + +// Margin of error to allow fees in the vecinity of the expected value but doesn't allow a big difference +Transaction.FEE_SECURITY_MARGIN = 150; + +// max amount of satoshis in circulation +Transaction.MAX_MONEY = 21000000 * 1e8; + +// nlocktime limit to be considered block height rather than a timestamp +Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT = 5e8; + +// Max value for an unsigned 32 bit value +Transaction.NLOCKTIME_MAX_VALUE = 4294967295; + +// Value used for fee estimation (satoshis per kilobyte) +Transaction.FEE_PER_KB = 100000; + +// Safe upper bound for change address script size in bytes +Transaction.CHANGE_OUTPUT_MAX_SIZE = 20 + 4 + 34 + 4; +Transaction.MAXIMUM_EXTRA_SIZE = 4 + 9 + 9 + 4; + +/* Constructors and Serialization */ + +/** + * Create a 'shallow' copy of the transaction, by serializing and deserializing + * it dropping any additional information that inputs and outputs may have hold + * + * @param {Transaction} transaction + * @return {Transaction} + */ +Transaction.shallowCopy = function(transaction) { + var copy = new Transaction(transaction.toBuffer()); + return copy; +}; + +var hashProperty = { + configurable: false, + enumerable: true, + get: function() { + this._hash = new BufferReader(this._getHash()).readReverse().toString('hex'); + return this._hash; + } +}; + +var witnessHashProperty = { + configurable: false, + enumerable: true, + get: function() { + return new BufferReader(this._getWitnessHash()).readReverse().toString('hex'); + } +}; + +Object.defineProperty(Transaction.prototype, 'witnessHash', witnessHashProperty); +Object.defineProperty(Transaction.prototype, 'hash', hashProperty); +Object.defineProperty(Transaction.prototype, 'id', hashProperty); + +var ioProperty = { + configurable: false, + enumerable: true, + get: function() { + return this._getInputAmount(); + } +}; +Object.defineProperty(Transaction.prototype, 'inputAmount', ioProperty); +ioProperty.get = function() { + return this._getOutputAmount(); +}; +Object.defineProperty(Transaction.prototype, 'outputAmount', ioProperty); + +/** + * Retrieve the little endian hash of the transaction (used for serialization) + * @return {Buffer} + */ +Transaction.prototype._getHash = function() { + return Hash.sha256sha256(this.toBuffer(true)); +}; + +/** + * Retrieve the little endian hash of the transaction including witness data + * @return {Buffer} + */ +Transaction.prototype._getWitnessHash = function() { + return Hash.sha256sha256(this.toBuffer(false)); +}; + +/** + * Retrieve a hexa string that can be used with bitcoind's CLI interface + * (decoderawtransaction, sendrawtransaction) + * + * @param {Object|boolean=} unsafe if true, skip all tests. if it's an object, + * it's expected to contain a set of flags to skip certain tests: + * * `disableAll`: disable all checks + * * `disableSmallFees`: disable checking for fees that are too small + * * `disableLargeFees`: disable checking for fees that are too large + * * `disableIsFullySigned`: disable checking if all inputs are fully signed + * * `disableDustOutputs`: disable checking if there are no outputs that are dust amounts + * * `disableMoreOutputThanInput`: disable checking if the transaction spends more bitcoins than the sum of the input amounts + * @return {string} + */ +Transaction.prototype.serialize = function(unsafe) { + if (true === unsafe || unsafe && unsafe.disableAll) { + return this.uncheckedSerialize(); + } else { + return this.checkedSerialize(unsafe); + } +}; + +Transaction.prototype.uncheckedSerialize = Transaction.prototype.toString = function() { + return this.toBuffer().toString('hex'); +}; + +/** + * Retrieve a hexa string that can be used with bitcoind's CLI interface + * (decoderawtransaction, sendrawtransaction) + * + * @param {Object} opts allows to skip certain tests. {@see Transaction#serialize} + * @return {string} + */ +Transaction.prototype.checkedSerialize = function(opts) { + var serializationError = this.getSerializationError(opts); + if (serializationError) { + serializationError.message += ' - For more information please see: ' + + 'https://bitcore.io/api/lib/transaction#serialization-checks'; + throw serializationError; + } + return this.uncheckedSerialize(); +}; + +Transaction.prototype.invalidSatoshis = function() { + var invalid = false; + for (var i = 0; i < this.outputs.length; i++) { + if (this.outputs[i].invalidSatoshis()) { + invalid = true; + } + } + return invalid; +}; + +/** + * Retrieve a possible error that could appear when trying to serialize and + * broadcast this transaction. + * + * @param {Object} opts allows to skip certain tests. {@see Transaction#serialize} + * @return {bitcore.Error} + */ +Transaction.prototype.getSerializationError = function(opts) { + opts = opts || {}; + + if (this.invalidSatoshis()) { + return new errors.Transaction.InvalidSatoshis(); + } + + var unspent = this._getUnspentValue(); + var unspentError; + if (unspent < 0) { + if (!opts.disableMoreOutputThanInput) { + unspentError = new errors.Transaction.InvalidOutputAmountSum(); + } + } else { + unspentError = this._hasFeeError(opts, unspent); + } + + return unspentError || + this._hasDustOutputs(opts) || + this._isMissingSignatures(opts); +}; + +Transaction.prototype._hasFeeError = function(opts, unspent) { + + if (!_.isUndefined(this._fee) && this._fee !== unspent) { + return new errors.Transaction.FeeError.Different( + 'Unspent value is ' + unspent + ' but specified fee is ' + this._fee + ); + } + + if (!opts.disableLargeFees) { + var maximumFee = Math.floor(Transaction.FEE_SECURITY_MARGIN * this._estimateFee()); + if (unspent > maximumFee) { + if (this._missingChange()) { + return new errors.Transaction.ChangeAddressMissing( + 'Fee is too large and no change address was provided' + ); + } + return new errors.Transaction.FeeError.TooLarge( + 'expected less than ' + maximumFee + ' but got ' + unspent + ); + } + } + + if (!opts.disableSmallFees) { + var minimumFee = Math.ceil(this._estimateFee() / Transaction.FEE_SECURITY_MARGIN); + if (unspent < minimumFee) { + return new errors.Transaction.FeeError.TooSmall( + 'expected more than ' + minimumFee + ' but got ' + unspent + ); + } + } +}; + +Transaction.prototype._missingChange = function() { + return !this._changeScript; +}; + +Transaction.prototype._hasDustOutputs = function(opts) { + if (opts.disableDustOutputs) { + return; + } + var index, output; + for (index in this.outputs) { + output = this.outputs[index]; + if (output.satoshis < Transaction.DUST_AMOUNT && !output.script.isDataOut()) { + return new errors.Transaction.DustOutputs(); + } + } +}; + +Transaction.prototype._isMissingSignatures = function(opts) { + if (opts.disableIsFullySigned) { + return; + } + if (!this.isFullySigned()) { + return new errors.Transaction.MissingSignatures(); + } +}; + +Transaction.prototype.inspect = function() { + return ''; +}; + +Transaction.prototype.toBuffer = function(noWitness) { + var writer = new BufferWriter(); + return this.toBufferWriter(writer, noWitness).toBuffer(); +}; + +Transaction.prototype.hasWitnesses = function() { + for (var i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].hasWitnesses()) { + return true; + } + } + return false; +}; + +Transaction.prototype.toBufferWriter = function(writer, noWitness) { + writer.writeInt32LE(this.version); + + var hasWitnesses = this.hasWitnesses(); + + if (hasWitnesses && !noWitness) { + writer.write(new Buffer('0001', 'hex')); + } + + writer.writeVarintNum(this.inputs.length); + + _.each(this.inputs, function(input) { + input.toBufferWriter(writer); + }); + + writer.writeVarintNum(this.outputs.length); + _.each(this.outputs, function(output) { + output.toBufferWriter(writer); + }); + + if (hasWitnesses && !noWitness) { + _.each(this.inputs, function(input) { + var witnesses = input.getWitnesses(); + writer.writeVarintNum(witnesses.length); + for (var j = 0; j < witnesses.length; j++) { + writer.writeVarintNum(witnesses[j].length); + writer.write(witnesses[j]); + } + }); + } + + writer.writeUInt32LE(this.nLockTime); + return writer; +}; + +Transaction.prototype.fromBuffer = function(buffer) { + var reader = new BufferReader(buffer); + return this.fromBufferReader(reader); +}; + +Transaction.prototype.fromBufferReader = function(reader) { + $.checkArgument(!reader.finished(), 'No transaction data received'); + + this.version = reader.readInt32LE(); + var sizeTxIns = reader.readVarintNum(); + + // check for segwit + var hasWitnesses = false; + if (sizeTxIns === 0 && reader.buf[reader.pos] !== 0) { + reader.pos += 1; + hasWitnesses = true; + sizeTxIns = reader.readVarintNum(); + } + + for (var i = 0; i < sizeTxIns; i++) { + var input = Input.fromBufferReader(reader); + this.inputs.push(input); + } + + var sizeTxOuts = reader.readVarintNum(); + for (var j = 0; j < sizeTxOuts; j++) { + this.outputs.push(Output.fromBufferReader(reader)); + } + + if (hasWitnesses) { + for (var k = 0; k < sizeTxIns; k++) { + var itemCount = reader.readVarintNum(); + var witnesses = []; + for (var l = 0; l < itemCount; l++) { + var size = reader.readVarintNum(); + var item = reader.read(size); + witnesses.push(item); + } + this.inputs[k].setWitnesses(witnesses); + } + } + + this.nLockTime = reader.readUInt32LE(); + return this; +}; + + +Transaction.prototype.toObject = Transaction.prototype.toJSON = function toObject() { + var inputs = []; + this.inputs.forEach(function(input) { + inputs.push(input.toObject()); + }); + var outputs = []; + this.outputs.forEach(function(output) { + outputs.push(output.toObject()); + }); + var obj = { + hash: this.hash, + version: this.version, + inputs: inputs, + outputs: outputs, + nLockTime: this.nLockTime + }; + if (this._changeScript) { + obj.changeScript = this._changeScript.toString(); + } + if (!_.isUndefined(this._changeIndex)) { + obj.changeIndex = this._changeIndex; + } + if (!_.isUndefined(this._fee)) { + obj.fee = this._fee; + } + return obj; +}; + +Transaction.prototype.fromObject = function fromObject(arg) { + /* jshint maxstatements: 20 */ + $.checkArgument(_.isObject(arg) || arg instanceof Transaction); + var self = this; + var transaction; + if (arg instanceof Transaction) { + transaction = transaction.toObject(); + } else { + transaction = arg; + } + _.each(transaction.inputs, function(input) { + if (!input.output || !input.output.script) { + self.uncheckedAddInput(new Input(input)); + return; + } + var script = new Script(input.output.script); + var txin; + if (script.isPublicKeyHashOut()) { + txin = new Input.PublicKeyHash(input); + } else if (script.isScriptHashOut() && input.publicKeys && input.threshold) { + txin = new Input.MultiSigScriptHash( + input, input.publicKeys, input.threshold, input.signatures + ); + } else if (script.isPublicKeyOut()) { + txin = new Input.PublicKey(input); + } else { + throw new errors.Transaction.Input.UnsupportedScript(input.output.script); + } + self.addInput(txin); + }); + _.each(transaction.outputs, function(output) { + self.addOutput(new Output(output)); + }); + if (transaction.changeIndex) { + this._changeIndex = transaction.changeIndex; + } + if (transaction.changeScript) { + this._changeScript = new Script(transaction.changeScript); + } + if (transaction.fee) { + this._fee = transaction.fee; + } + this.nLockTime = transaction.nLockTime; + this.version = transaction.version; + this._checkConsistency(arg); + return this; +}; + +Transaction.prototype._checkConsistency = function(arg) { + if (!_.isUndefined(this._changeIndex)) { + $.checkState(this._changeScript, 'Change script is expected.'); + $.checkState(this.outputs[this._changeIndex], 'Change index points to undefined output.'); + $.checkState(this.outputs[this._changeIndex].script.toString() === + this._changeScript.toString(), 'Change output has an unexpected script.'); + } + if (arg && arg.hash) { + $.checkState(arg.hash === this.hash, 'Hash in object does not match transaction hash.'); + } +}; + +/** + * Sets nLockTime so that transaction is not valid until the desired date(a + * timestamp in seconds since UNIX epoch is also accepted) + * + * @param {Date | Number} time + * @return {Transaction} this + */ +Transaction.prototype.lockUntilDate = function(time) { + $.checkArgument(time); + if (_.isNumber(time) && time < Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { + throw new errors.Transaction.LockTimeTooEarly(); + } + if (_.isDate(time)) { + time = time.getTime() / 1000; + } + + for (var i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){ + this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER; + } + } + + this.nLockTime = time; + return this; +}; + +/** + * Sets nLockTime so that transaction is not valid until the desired block + * height. + * + * @param {Number} height + * @return {Transaction} this + */ +Transaction.prototype.lockUntilBlockHeight = function(height) { + $.checkArgument(_.isNumber(height)); + if (height >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { + throw new errors.Transaction.BlockHeightTooHigh(); + } + if (height < 0) { + throw new errors.Transaction.NLockTimeOutOfRange(); + } + + for (var i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){ + this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER; + } + } + + + this.nLockTime = height; + return this; +}; + +/** + * Returns a semantic version of the transaction's nLockTime. + * @return {Number|Date} + * If nLockTime is 0, it returns null, + * if it is < 500000000, it returns a block height (number) + * else it returns a Date object. + */ +Transaction.prototype.getLockTime = function() { + if (!this.nLockTime) { + return null; + } + if (this.nLockTime < Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { + return this.nLockTime; + } + return new Date(1000 * this.nLockTime); +}; + +Transaction.prototype.fromString = function(string) { + this.fromBuffer(buffer.Buffer.from(string, 'hex')); +}; + +Transaction.prototype._newTransaction = function() { + this.version = CURRENT_VERSION; + this.nLockTime = DEFAULT_NLOCKTIME; +}; + +/* Transaction creation interface */ + +/** + * @typedef {Object} Transaction~fromObject + * @property {string} prevTxId + * @property {number} outputIndex + * @property {(Buffer|string|Script)} script + * @property {number} satoshis + */ + +/** + * Add an input to this transaction. This is a high level interface + * to add an input, for more control, use @{link Transaction#addInput}. + * + * Can receive, as output information, the output of bitcoind's `listunspent` command, + * and a slightly fancier format recognized by bitcore: + * + * ``` + * { + * address: 'mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1', + * txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + * outputIndex: 0, + * script: Script.empty(), + * satoshis: 1020000 + * } + * ``` + * Where `address` can be either a string or a bitcore Address object. The + * same is true for `script`, which can be a string or a bitcore Script. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @example + * ```javascript + * var transaction = new Transaction(); + * + * // From a pay to public key hash output from bitcoind's listunspent + * transaction.from({'txid': '0000...', vout: 0, amount: 0.1, scriptPubKey: 'OP_DUP ...'}); + * + * // From a pay to public key hash output + * transaction.from({'txId': '0000...', outputIndex: 0, satoshis: 1000, script: 'OP_DUP ...'}); + * + * // From a multisig P2SH output + * transaction.from({'txId': '0000...', inputIndex: 0, satoshis: 1000, script: '... OP_HASH'}, + * ['03000...', '02000...'], 2); + * ``` + * + * @param {(Array.|Transaction~fromObject)} utxo + * @param {Array=} pubkeys + * @param {number=} threshold + * @param {boolean=} nestedWitness - Indicates that the utxo is nested witness p2sh + */ +Transaction.prototype.from = function(utxo, pubkeys, threshold, nestedWitness) { + if (_.isArray(utxo)) { + var self = this; + _.each(utxo, function(utxo) { + self.from(utxo, pubkeys, threshold); + }); + return this; + } + var exists = _.some(this.inputs, function(input) { + // TODO: Maybe prevTxId should be a string? Or defined as read only property? + return input.prevTxId.toString('hex') === utxo.txId && input.outputIndex === utxo.outputIndex; + }); + if (exists) { + return this; + } + if (pubkeys && threshold) { + this._fromMultisigUtxo(utxo, pubkeys, threshold, nestedWitness); + } else { + this._fromNonP2SH(utxo); + } + return this; +}; + +Transaction.prototype._fromNonP2SH = function(utxo) { + var clazz; + utxo = new UnspentOutput(utxo); + if (utxo.script.isPublicKeyHashOut()) { + clazz = PublicKeyHashInput; + } else if (utxo.script.isPublicKeyOut()) { + clazz = PublicKeyInput; + } else { + clazz = Input; + } + this.addInput(new clazz({ + output: new Output({ + script: utxo.script, + satoshis: utxo.satoshis + }), + prevTxId: utxo.txId, + outputIndex: utxo.outputIndex, + script: Script.empty() + })); +}; + +Transaction.prototype._fromMultisigUtxo = function(utxo, pubkeys, threshold, nestedWitness) { + $.checkArgument(threshold <= pubkeys.length, + 'Number of required signatures must be greater than the number of public keys'); + var clazz; + utxo = new UnspentOutput(utxo); + if (utxo.script.isMultisigOut()) { + clazz = MultiSigInput; + } else if (utxo.script.isScriptHashOut()) { + clazz = MultiSigScriptHashInput; + } else { + throw new Error("@TODO"); + } + this.addInput(new clazz({ + output: new Output({ + script: utxo.script, + satoshis: utxo.satoshis + }), + prevTxId: utxo.txId, + outputIndex: utxo.outputIndex, + script: Script.empty() + }, pubkeys, threshold, false, nestedWitness)); +}; + +/** + * Add an input to this transaction. The input must be an instance of the `Input` class. + * It should have information about the Output that it's spending, but if it's not already + * set, two additional parameters, `outputScript` and `satoshis` can be provided. + * + * @param {Input} input + * @param {String|Script} outputScript + * @param {number} satoshis + * @return Transaction this, for chaining + */ +Transaction.prototype.addInput = function(input, outputScript, satoshis) { + $.checkArgumentType(input, Input, 'input'); + if (!input.output && (_.isUndefined(outputScript) || _.isUndefined(satoshis))) { + throw new errors.Transaction.NeedMoreInfo('Need information about the UTXO script and satoshis'); + } + if (!input.output && outputScript && !_.isUndefined(satoshis)) { + outputScript = outputScript instanceof Script ? outputScript : new Script(outputScript); + $.checkArgumentType(satoshis, 'number', 'satoshis'); + input.output = new Output({ + script: outputScript, + satoshis: satoshis + }); + } + return this.uncheckedAddInput(input); +}; + +/** + * Add an input to this transaction, without checking that the input has information about + * the output that it's spending. + * + * @param {Input} input + * @return Transaction this, for chaining + */ +Transaction.prototype.uncheckedAddInput = function(input) { + $.checkArgumentType(input, Input, 'input'); + this.inputs.push(input); + this._inputAmount = undefined; + this._updateChangeOutput(); + return this; +}; + +/** + * Returns true if the transaction has enough info on all inputs to be correctly validated + * + * @return {boolean} + */ +Transaction.prototype.hasAllUtxoInfo = function() { + return _.every(this.inputs.map(function(input) { + return !!input.output; + })); +}; + +/** + * Manually set the fee for this transaction. Beware that this resets all the signatures + * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not + * be reset). + * + * @param {number} amount satoshis to be sent + * @return {Transaction} this, for chaining + */ +Transaction.prototype.fee = function(amount) { + $.checkArgument(_.isNumber(amount), 'amount must be a number'); + this._fee = amount; + this._updateChangeOutput(); + return this; +}; + +/** + * Manually set the fee per KB for this transaction. Beware that this resets all the signatures + * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not + * be reset). + * + * @param {number} amount satoshis per KB to be sent + * @return {Transaction} this, for chaining + */ +Transaction.prototype.feePerKb = function(amount) { + $.checkArgument(_.isNumber(amount), 'amount must be a number'); + this._feePerKb = amount; + this._updateChangeOutput(); + return this; +}; + +/* Output management */ + +/** + * Set the change address for this transaction + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {Address} address An address for change to be sent to. + * @return {Transaction} this, for chaining + */ +Transaction.prototype.change = function(address) { + $.checkArgument(address, 'address is required'); + this._changeScript = Script.fromAddress(address); + this._updateChangeOutput(); + return this; +}; + + +/** + * @return {Output} change output, if it exists + */ +Transaction.prototype.getChangeOutput = function() { + if (!_.isUndefined(this._changeIndex)) { + return this.outputs[this._changeIndex]; + } + return null; +}; + +/** + * @typedef {Object} Transaction~toObject + * @property {(string|Address)} address + * @property {number} satoshis + */ + +/** + * Add an output to the transaction. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {(string|Address|Array.)} address + * @param {number} amount in satoshis + * @return {Transaction} this, for chaining + */ +Transaction.prototype.to = function(address, amount) { + if (_.isArray(address)) { + var self = this; + _.each(address, function(to) { + self.to(to.address, to.satoshis); + }); + return this; + } + + $.checkArgument( + JSUtil.isNaturalNumber(amount), + 'Amount is expected to be a positive integer' + ); + this.addOutput(new Output({ + script: Script(new Address(address)), + satoshis: amount + })); + return this; +}; + +/** + * Add an OP_RETURN output to the transaction. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {Buffer|string} value the data to be stored in the OP_RETURN output. + * In case of a string, the UTF-8 representation will be stored + * @return {Transaction} this, for chaining + */ +Transaction.prototype.addData = function(value) { + this.addOutput(new Output({ + script: Script.buildDataOut(value), + satoshis: 0 + })); + return this; +}; + + +/** + * Add an output to the transaction. + * + * @param {Output} output the output to add. + * @return {Transaction} this, for chaining + */ +Transaction.prototype.addOutput = function(output) { + $.checkArgumentType(output, Output, 'output'); + this._addOutput(output); + this._updateChangeOutput(); + return this; +}; + + +/** + * Remove all outputs from the transaction. + * + * @return {Transaction} this, for chaining + */ +Transaction.prototype.clearOutputs = function() { + this.outputs = []; + this._clearSignatures(); + this._outputAmount = undefined; + this._changeIndex = undefined; + this._updateChangeOutput(); + return this; +}; + + +Transaction.prototype._addOutput = function(output) { + this.outputs.push(output); + this._outputAmount = undefined; +}; + + +/** + * Calculates or gets the total output amount in satoshis + * + * @return {Number} the transaction total output amount + */ +Transaction.prototype._getOutputAmount = function() { + if (_.isUndefined(this._outputAmount)) { + var self = this; + this._outputAmount = 0; + _.each(this.outputs, function(output) { + self._outputAmount += output.satoshis; + }); + } + return this._outputAmount; +}; + + +/** + * Calculates or gets the total input amount in satoshis + * + * @return {Number} the transaction total input amount + */ +Transaction.prototype._getInputAmount = function() { + if (_.isUndefined(this._inputAmount)) { + var self = this; + this._inputAmount = 0; + _.each(this.inputs, function(input) { + if (_.isUndefined(input.output)) { + throw new errors.Transaction.Input.MissingPreviousOutput(); + } + self._inputAmount += input.output.satoshis; + }); + } + return this._inputAmount; +}; + +Transaction.prototype._updateChangeOutput = function() { + if (!this._changeScript) { + return; + } + this._clearSignatures(); + if (!_.isUndefined(this._changeIndex)) { + this._removeOutput(this._changeIndex); + } + var available = this._getUnspentValue(); + var fee = this.getFee(); + var changeAmount = available - fee; + if (changeAmount > 0) { + this._changeIndex = this.outputs.length; + this._addOutput(new Output({ + script: this._changeScript, + satoshis: changeAmount + })); + } else { + this._changeIndex = undefined; + } +}; +/** + * Calculates the fee of the transaction. + * + * If there's a fixed fee set, return that. + * + * If there is no change output set, the fee is the + * total value of the outputs minus inputs. Note that + * a serialized transaction only specifies the value + * of its outputs. (The value of inputs are recorded + * in the previous transaction outputs being spent.) + * This method therefore raises a "MissingPreviousOutput" + * error when called on a serialized transaction. + * + * If there's no fee set and no change address, + * estimate the fee based on size. + * + * @return {Number} fee of this transaction in satoshis + */ +Transaction.prototype.getFee = function() { + if (this.isCoinbase()) { + return 0; + } + if (!_.isUndefined(this._fee)) { + return this._fee; + } + // if no change output is set, fees should equal all the unspent amount + if (!this._changeScript) { + return this._getUnspentValue(); + } + return this._estimateFee(); +}; + +/** + * Estimates fee from serialized transaction size in bytes. + */ +Transaction.prototype._estimateFee = function() { + var estimatedSize = this._estimateSize(); + var available = this._getUnspentValue(); + return Transaction._estimateFee(estimatedSize, available, this._feePerKb); +}; + +Transaction.prototype._getUnspentValue = function() { + return this._getInputAmount() - this._getOutputAmount(); +}; + +Transaction.prototype._clearSignatures = function() { + _.each(this.inputs, function(input) { + input.clearSignatures(); + }); +}; + +Transaction._estimateFee = function(size, amountAvailable, feePerKb) { + var fee = Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB); + if (amountAvailable > fee) { + size += Transaction.CHANGE_OUTPUT_MAX_SIZE; + } + return Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB); +}; + +Transaction.prototype._estimateSize = function() { + var result = Transaction.MAXIMUM_EXTRA_SIZE; + _.each(this.inputs, function(input) { + result += input._estimateSize(); + }); + _.each(this.outputs, function(output) { + result += output.script.toBuffer().length + 9; + }); + return result; +}; + +Transaction.prototype._removeOutput = function(index) { + var output = this.outputs[index]; + this.outputs = _.without(this.outputs, output); + this._outputAmount = undefined; +}; + +Transaction.prototype.removeOutput = function(index) { + this._removeOutput(index); + this._updateChangeOutput(); +}; + +/** + * Sort a transaction's inputs and outputs according to BIP69 + * + * @see {https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki} + * @return {Transaction} this + */ +Transaction.prototype.sort = function() { + this.sortInputs(function(inputs) { + var copy = Array.prototype.concat.apply([], inputs); + copy.sort(function(first, second) { + return compare(first.prevTxId, second.prevTxId) + || first.outputIndex - second.outputIndex; + }); + return copy; + }); + this.sortOutputs(function(outputs) { + var copy = Array.prototype.concat.apply([], outputs); + copy.sort(function(first, second) { + return first.satoshis - second.satoshis + || compare(first.script.toBuffer(), second.script.toBuffer()); + }); + return copy; + }); + return this; +}; + +/** + * Randomize this transaction's outputs ordering. The shuffling algorithm is a + * version of the Fisher-Yates shuffle, provided by lodash's _.shuffle(). + * + * @return {Transaction} this + */ +Transaction.prototype.shuffleOutputs = function() { + return this.sortOutputs(_.shuffle); +}; + +/** + * Sort this transaction's outputs, according to a given sorting function that + * takes an array as argument and returns a new array, with the same elements + * but with a different order. The argument function MUST NOT modify the order + * of the original array + * + * @param {Function} sortingFunction + * @return {Transaction} this + */ +Transaction.prototype.sortOutputs = function(sortingFunction) { + var outs = sortingFunction(this.outputs); + return this._newOutputOrder(outs); +}; + +/** + * Sort this transaction's inputs, according to a given sorting function that + * takes an array as argument and returns a new array, with the same elements + * but with a different order. + * + * @param {Function} sortingFunction + * @return {Transaction} this + */ +Transaction.prototype.sortInputs = function(sortingFunction) { + this.inputs = sortingFunction(this.inputs); + this._clearSignatures(); + return this; +}; + +Transaction.prototype._newOutputOrder = function(newOutputs) { + var isInvalidSorting = (this.outputs.length !== newOutputs.length || + _.difference(this.outputs, newOutputs).length !== 0); + if (isInvalidSorting) { + throw new errors.Transaction.InvalidSorting(); + } + + if (!_.isUndefined(this._changeIndex)) { + var changeOutput = this.outputs[this._changeIndex]; + this._changeIndex = _.findIndex(newOutputs, changeOutput); + } + + this.outputs = newOutputs; + return this; +}; + +Transaction.prototype.removeInput = function(txId, outputIndex) { + var index; + if (!outputIndex && _.isNumber(txId)) { + index = txId; + } else { + index = _.findIndex(this.inputs, function(input) { + return input.prevTxId.toString('hex') === txId && input.outputIndex === outputIndex; + }); + } + if (index < 0 || index >= this.inputs.length) { + throw new errors.Transaction.InvalidIndex(index, this.inputs.length); + } + var input = this.inputs[index]; + this.inputs = _.without(this.inputs, input); + this._inputAmount = undefined; + this._updateChangeOutput(); +}; + +/* Signature handling */ + +/** + * Sign the transaction using one or more private keys. + * + * It tries to sign each input, verifying that the signature will be valid + * (matches a public key). + * + * @param {Array|String|PrivateKey} privateKey + * @param {number} sigtype + * @return {Transaction} this, for chaining + */ +Transaction.prototype.sign = function(privateKey, sigtype) { + $.checkState(this.hasAllUtxoInfo(), 'Not all utxo information is available to sign the transaction.'); + var self = this; + if (_.isArray(privateKey)) { + _.each(privateKey, function(privateKey) { + self.sign(privateKey, sigtype); + }); + return this; + } + _.each(this.getSignatures(privateKey, sigtype), function(signature) { + self.applySignature(signature); + }); + return this; +}; + +Transaction.prototype.getSignatures = function(privKey, sigtype) { + privKey = new PrivateKey(privKey); + sigtype = sigtype || Signature.SIGHASH_ALL; + var transaction = this; + var results = []; + var hashData = Hash.sha256ripemd160(privKey.publicKey.toBuffer()); + _.each(this.inputs, function forEachInput(input, index) { + _.each(input.getSignatures(transaction, privKey, index, sigtype, hashData), function(signature) { + results.push(signature); + }); + }); + return results; +}; + +/** + * Add a signature to the transaction + * + * @param {Object} signature + * @param {number} signature.inputIndex + * @param {number} signature.sigtype + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @return {Transaction} this, for chaining + */ +Transaction.prototype.applySignature = function(signature) { + this.inputs[signature.inputIndex].addSignature(this, signature); + return this; +}; + +Transaction.prototype.isFullySigned = function() { + _.each(this.inputs, function(input) { + if (input.isFullySigned === Input.prototype.isFullySigned) { + throw new errors.Transaction.UnableToVerifySignature( + 'Unrecognized script kind, or not enough information to execute script.' + + 'This usually happens when creating a transaction from a serialized transaction' + ); + } + }); + return _.every(_.map(this.inputs, function(input) { + return input.isFullySigned(); + })); +}; + +Transaction.prototype.isValidSignature = function(signature) { + var self = this; + if (this.inputs[signature.inputIndex].isValidSignature === Input.prototype.isValidSignature) { + throw new errors.Transaction.UnableToVerifySignature( + 'Unrecognized script kind, or not enough information to execute script.' + + 'This usually happens when creating a transaction from a serialized transaction' + ); + } + return this.inputs[signature.inputIndex].isValidSignature(self, signature); +}; + +/** + * @returns {bool} whether the signature is valid for this transaction input + */ +Transaction.prototype.verifySignature = function(sig, pubkey, nin, subscript, sigversion, satoshis) { + + if (_.isUndefined(sigversion)) { + sigversion = 0; + } + + if (sigversion === 1) { + var subscriptBuffer = subscript.toBuffer(); + var scriptCodeWriter = new BufferWriter(); + scriptCodeWriter.writeVarintNum(subscriptBuffer.length); + scriptCodeWriter.write(subscriptBuffer); + + var satoshisBuffer; + if (satoshis) { + $.checkState(JSUtil.isNaturalNumber(satoshis)); + satoshisBuffer = new BufferWriter().writeUInt64LEBN(new BN(satoshis)).toBuffer(); + } else { + satoshisBuffer = this.inputs[nin].getSatoshisBuffer(); + } + var verified = SighashWitness.verify( + this, + sig, + pubkey, + nin, + scriptCodeWriter.toBuffer(), + satoshisBuffer + ); + return verified; + } + + return Sighash.verify(this, sig, pubkey, nin, subscript); +}; + +/** + * Check that a transaction passes basic sanity tests. If not, return a string + * describing the error. This function contains the same logic as + * CheckTransaction in bitcoin core. + */ +Transaction.prototype.verify = function() { + // Basic checks that don't depend on any context + if (this.inputs.length === 0) { + return 'transaction txins empty'; + } + + if (this.outputs.length === 0) { + return 'transaction txouts empty'; + } + + // Check for negative or overflow output values + var valueoutbn = new BN(0); + for (var i = 0; i < this.outputs.length; i++) { + var txout = this.outputs[i]; + + if (txout.invalidSatoshis()) { + return 'transaction txout ' + i + ' satoshis is invalid'; + } + if (txout._satoshisBN.gt(new BN(Transaction.MAX_MONEY, 10))) { + return 'transaction txout ' + i + ' greater than MAX_MONEY'; + } + valueoutbn = valueoutbn.add(txout._satoshisBN); + if (valueoutbn.gt(new BN(Transaction.MAX_MONEY))) { + return 'transaction txout ' + i + ' total output greater than MAX_MONEY'; + } + } + + // Size limits + if (this.toBuffer().length > MAX_BLOCK_SIZE) { + return 'transaction over the maximum block size'; + } + + // Check for duplicate inputs + var txinmap = {}; + for (i = 0; i < this.inputs.length; i++) { + var txin = this.inputs[i]; + + var inputid = txin.prevTxId + ':' + txin.outputIndex; + if (!_.isUndefined(txinmap[inputid])) { + return 'transaction input ' + i + ' duplicate input'; + } + txinmap[inputid] = true; + } + + var isCoinbase = this.isCoinbase(); + if (isCoinbase) { + var buf = this.inputs[0]._scriptBuffer; + if (buf.length < 2 || buf.length > 100) { + return 'coinbase transaction script size invalid'; + } + } else { + for (i = 0; i < this.inputs.length; i++) { + if (this.inputs[i].isNull()) { + return 'transaction input ' + i + ' has null input'; + } + } + } + return true; +}; + +/** + * Analogous to bitcoind's IsCoinBase function in transaction.h + */ +Transaction.prototype.isCoinbase = function() { + return (this.inputs.length === 1 && this.inputs[0].isNull()); +}; + +/** + * Determines if this transaction can be replaced in the mempool with another + * transaction that provides a sufficiently higher fee (RBF). + */ +Transaction.prototype.isRBF = function() { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + if (input.sequenceNumber < Input.MAXINT - 1) { + return true; + } + } + return false; +}; + +/** + * Enable this transaction to be replaced in the mempool (RBF) if a transaction + * includes a sufficiently higher fee. It will set the sequenceNumber to + * DEFAULT_RBF_SEQNUMBER for all inputs if the sequence number does not + * already enable RBF. + */ +Transaction.prototype.enableRBF = function() { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + if (input.sequenceNumber >= Input.MAXINT - 1) { + input.sequenceNumber = Input.DEFAULT_RBF_SEQNUMBER; + } + } + return this; +}; + +module.exports = Transaction; diff --git a/packages/kauri-bitcore-lib/lib/transaction/unspentoutput.js b/packages/kauri-bitcore-lib/lib/transaction/unspentoutput.js new file mode 100644 index 0000000..c6a58b0 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/transaction/unspentoutput.js @@ -0,0 +1,100 @@ +'use strict'; + +var _ = require('lodash'); +var $ = require('../util/preconditions'); +var JSUtil = require('../util/js'); + +var Script = require('../script'); +var Address = require('../address'); +var Unit = require('../unit'); + +/** + * Represents an unspent output information: its script, associated amount and address, + * transaction id and output index. + * + * @constructor + * @param {object} data + * @param {string} data.txid the previous transaction id + * @param {string=} data.txId alias for `txid` + * @param {number} data.vout the index in the transaction + * @param {number=} data.outputIndex alias for `vout` + * @param {string|Script} data.scriptPubKey the script that must be resolved to release the funds + * @param {string|Script=} data.script alias for `scriptPubKey` + * @param {number} data.amount amount of bitcoins associated + * @param {number=} data.satoshis alias for `amount`, but expressed in satoshis (1 BTC = 1e8 satoshis) + * @param {string|Address=} data.address the associated address to the script, if provided + */ +function UnspentOutput(data) { + /* jshint maxcomplexity: 20 */ + /* jshint maxstatements: 20 */ + if (!(this instanceof UnspentOutput)) { + return new UnspentOutput(data); + } + $.checkArgument(_.isObject(data), 'Must provide an object from where to extract data'); + var address = data.address ? new Address(data.address) : undefined; + var txId = data.txid ? data.txid : data.txId; + if (!txId || !JSUtil.isHexaString(txId) || txId.length > 64) { + // TODO: Use the errors library + throw new Error('Invalid TXID in object', data); + } + var outputIndex = _.isUndefined(data.vout) ? data.outputIndex : data.vout; + if (!_.isNumber(outputIndex)) { + throw new Error('Invalid outputIndex, received ' + outputIndex); + } + $.checkArgument(!_.isUndefined(data.scriptPubKey) || !_.isUndefined(data.script), + 'Must provide the scriptPubKey for that output!'); + var script = new Script(data.scriptPubKey || data.script); + var amount = !_.isUndefined(data.amount) ? new Unit.fromBTC(data.amount).toSatoshis() : data.satoshis; + amount = amount || data.value; + $.checkArgument(amount, 'Must provide an amount for the output'); + $.checkArgument(_.isNumber(amount), 'Amount must be a number'); + JSUtil.defineImmutable(this, { + address: address, + txId: txId, + outputIndex: outputIndex, + script: script, + satoshis: amount + }); +} + +/** + * Provide an informative output when displaying this object in the console + * @returns string + */ +UnspentOutput.prototype.inspect = function() { + return ''; +}; + +/** + * String representation: just "txid:index" + * @returns string + */ +UnspentOutput.prototype.toString = function() { + return this.txId + ':' + this.outputIndex; +}; + +/** + * Deserialize an UnspentOutput from an object + * @param {object|string} data + * @return UnspentOutput + */ +UnspentOutput.fromObject = function(data) { + return new UnspentOutput(data); +}; + +/** + * Returns a plain object (no prototype or methods) with the associated info for this output + * @return {object} + */ +UnspentOutput.prototype.toObject = UnspentOutput.prototype.toJSON = function toObject() { + return { + address: this.address ? this.address.toString() : undefined, + txid: this.txId, + vout: this.outputIndex, + scriptPubKey: this.script.toBuffer().toString('hex'), + amount: Unit.fromSatoshis(this.satoshis).toBTC() + }; +}; + +module.exports = UnspentOutput; diff --git a/packages/kauri-bitcore-lib/lib/unit.js b/packages/kauri-bitcore-lib/lib/unit.js new file mode 100644 index 0000000..b5dee29 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/unit.js @@ -0,0 +1,238 @@ +'use strict'; + +var _ = require('lodash'); + +var errors = require('./errors'); +var $ = require('./util/preconditions'); + +var UNITS = { + 'BTC' : [1e8, 8], + 'mBTC' : [1e5, 5], + 'uBTC' : [1e2, 2], + 'bits' : [1e2, 2], + 'satoshis' : [1, 0] +}; + +/** + * Utility for handling and converting bitcoins units. The supported units are + * BTC, mBTC, bits (also named uBTC) and satoshis. A unit instance can be created with an + * amount and a unit code, or alternatively using static methods like {fromBTC}. + * It also allows to be created from a fiat amount and the exchange rate, or + * alternatively using the {fromFiat} static method. + * You can consult for different representation of a unit instance using it's + * {to} method, the fixed unit methods like {toSatoshis} or alternatively using + * the unit accessors. It also can be converted to a fiat amount by providing the + * corresponding BTC/fiat exchange rate. + * + * @example + * ```javascript + * var sats = Unit.fromBTC(1.3).toSatoshis(); + * var mili = Unit.fromBits(1.3).to(Unit.mBTC); + * var bits = Unit.fromFiat(1.3, 350).bits; + * var btc = new Unit(1.3, Unit.bits).BTC; + * ``` + * + * @param {Number} amount - The amount to be represented + * @param {String|Number} code - The unit of the amount or the exchange rate + * @returns {Unit} A new instance of an Unit + * @constructor + */ +function Unit(amount, code) { + if (!(this instanceof Unit)) { + return new Unit(amount, code); + } + + // convert fiat to BTC + if (_.isNumber(code)) { + if (code <= 0) { + throw new errors.Unit.InvalidRate(code); + } + amount = amount / code; + code = Unit.BTC; + } + + this._value = this._from(amount, code); + + var self = this; + var defineAccesor = function(key) { + Object.defineProperty(self, key, { + get: function() { return self.to(key); }, + enumerable: true, + }); + }; + + Object.keys(UNITS).forEach(defineAccesor); +} + +Object.keys(UNITS).forEach(function(key) { + Unit[key] = key; +}); + +/** + * Returns a Unit instance created from JSON string or object + * + * @param {String|Object} json - JSON with keys: amount and code + * @returns {Unit} A Unit instance + */ +Unit.fromObject = function fromObject(data){ + $.checkArgument(_.isObject(data), 'Argument is expected to be an object'); + return new Unit(data.amount, data.code); +}; + +/** + * Returns a Unit instance created from an amount in BTC + * + * @param {Number} amount - The amount in BTC + * @returns {Unit} A Unit instance + */ +Unit.fromBTC = function(amount) { + return new Unit(amount, Unit.BTC); +}; + +/** + * Returns a Unit instance created from an amount in mBTC + * + * @param {Number} amount - The amount in mBTC + * @returns {Unit} A Unit instance + */ +Unit.fromMillis = Unit.fromMilis = function(amount) { + return new Unit(amount, Unit.mBTC); +}; + +/** + * Returns a Unit instance created from an amount in bits + * + * @param {Number} amount - The amount in bits + * @returns {Unit} A Unit instance + */ +Unit.fromMicros = Unit.fromBits = function(amount) { + return new Unit(amount, Unit.bits); +}; + +/** + * Returns a Unit instance created from an amount in satoshis + * + * @param {Number} amount - The amount in satoshis + * @returns {Unit} A Unit instance + */ +Unit.fromSatoshis = function(amount) { + return new Unit(amount, Unit.satoshis); +}; + +/** + * Returns a Unit instance created from a fiat amount and exchange rate. + * + * @param {Number} amount - The amount in fiat + * @param {Number} rate - The exchange rate BTC/fiat + * @returns {Unit} A Unit instance + */ +Unit.fromFiat = function(amount, rate) { + return new Unit(amount, rate); +}; + +Unit.prototype._from = function(amount, code) { + if (!UNITS[code]) { + throw new errors.Unit.UnknownCode(code); + } + return parseInt((amount * UNITS[code][0]).toFixed()); +}; + +/** + * Returns the value represented in the specified unit + * + * @param {String|Number} code - The unit code or exchange rate + * @returns {Number} The converted value + */ +Unit.prototype.to = function(code) { + if (_.isNumber(code)) { + if (code <= 0) { + throw new errors.Unit.InvalidRate(code); + } + return parseFloat((this.BTC * code).toFixed(2)); + } + + if (!UNITS[code]) { + throw new errors.Unit.UnknownCode(code); + } + + var value = this._value / UNITS[code][0]; + return parseFloat(value.toFixed(UNITS[code][1])); +}; + +/** + * Returns the value represented in BTC + * + * @returns {Number} The value converted to BTC + */ +Unit.prototype.toBTC = function() { + return this.to(Unit.BTC); +}; + +/** + * Returns the value represented in mBTC + * + * @returns {Number} The value converted to mBTC + */ +Unit.prototype.toMillis = Unit.prototype.toMilis = function() { + return this.to(Unit.mBTC); +}; + +/** + * Returns the value represented in bits + * + * @returns {Number} The value converted to bits + */ +Unit.prototype.toMicros = Unit.prototype.toBits = function() { + return this.to(Unit.bits); +}; + +/** + * Returns the value represented in satoshis + * + * @returns {Number} The value converted to satoshis + */ +Unit.prototype.toSatoshis = function() { + return this.to(Unit.satoshis); +}; + +/** + * Returns the value represented in fiat + * + * @param {string} rate - The exchange rate between BTC/currency + * @returns {Number} The value converted to satoshis + */ +Unit.prototype.atRate = function(rate) { + return this.to(rate); +}; + +/** + * Returns a the string representation of the value in satoshis + * + * @returns {string} the value in satoshis + */ +Unit.prototype.toString = function() { + return this.satoshis + ' satoshis'; +}; + +/** + * Returns a plain object representation of the Unit + * + * @returns {Object} An object with the keys: amount and code + */ +Unit.prototype.toObject = Unit.prototype.toJSON = function toObject() { + return { + amount: this.BTC, + code: Unit.BTC + }; +}; + +/** + * Returns a string formatted for the console + * + * @returns {string} the value in satoshis + */ +Unit.prototype.inspect = function() { + return ''; +}; + +module.exports = Unit; diff --git a/packages/kauri-bitcore-lib/lib/uri.js b/packages/kauri-bitcore-lib/lib/uri.js new file mode 100644 index 0000000..912a0c3 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/uri.js @@ -0,0 +1,223 @@ +'use strict'; + +var _ = require('lodash'); +var URL = require('url'); + +var Address = require('./address'); +var Unit = require('./unit'); + +/** + * Bitcore URI + * + * Instantiate an URI from a bitcoin URI String or an Object. An URI instance + * can be created with a bitcoin uri string or an object. All instances of + * URI are valid, the static method isValid allows checking before instantiation. + * + * All standard parameters can be found as members of the class, the address + * is represented using an {Address} instance and the amount is represented in + * satoshis. Any other non-standard parameters can be found under the extra member. + * + * @example + * ```javascript + * + * var uri = new URI('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2'); + * console.log(uri.address, uri.amount); + * ``` + * + * @param {string|Object} data - A bitcoin URI string or an Object + * @param {Array.=} knownParams - Required non-standard params + * @throws {TypeError} Invalid bitcoin address + * @throws {TypeError} Invalid amount + * @throws {Error} Unknown required argument + * @returns {URI} A new valid and frozen instance of URI + * @constructor + */ +var URI = function(data, knownParams) { + if (!(this instanceof URI)) { + return new URI(data, knownParams); + } + + this.extras = {}; + this.knownParams = knownParams || []; + this.address = this.network = this.amount = this.message = null; + + if (typeof(data) === 'string') { + var params = URI.parse(data); + if (params.amount) { + params.amount = this._parseAmount(params.amount); + } + this._fromObject(params); + } else if (typeof(data) === 'object') { + this._fromObject(data); + } else { + throw new TypeError('Unrecognized data format.'); + } +}; + +/** + * Instantiate a URI from a String + * + * @param {string} str - JSON string or object of the URI + * @returns {URI} A new instance of a URI + */ +URI.fromString = function fromString(str) { + if (typeof(str) !== 'string') { + throw new TypeError('Expected a string'); + } + return new URI(str); +}; + +/** + * Instantiate a URI from an Object + * + * @param {Object} data - object of the URI + * @returns {URI} A new instance of a URI + */ +URI.fromObject = function fromObject(json) { + return new URI(json); +}; + +/** + * Check if an bitcoin URI string is valid + * + * @example + * ```javascript + * + * var valid = URI.isValid('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu'); + * // true + * ``` + * + * @param {string|Object} data - A bitcoin URI string or an Object + * @param {Array.=} knownParams - Required non-standard params + * @returns {boolean} Result of uri validation + */ +URI.isValid = function(arg, knownParams) { + try { + new URI(arg, knownParams); + } catch (err) { + return false; + } + return true; +}; + +/** + * Convert a bitcoin URI string into a simple object. + * + * @param {string} uri - A bitcoin URI string + * @throws {TypeError} Invalid bitcoin URI + * @returns {Object} An object with the parsed params + */ +URI.parse = function(uri) { + var info = URL.parse(uri, true); + + if (info.protocol !== 'bitcoin:') { + throw new TypeError('Invalid bitcoin URI'); + } + + // workaround to host insensitiveness + var group = /[^:]*:\/?\/?([^?]*)/.exec(uri); + info.query.address = group && group[1] || undefined; + + return info.query; +}; + +URI.Members = ['address', 'amount', 'message', 'label', 'r']; + +/** + * Internal function to load the URI instance with an object. + * + * @param {Object} obj - Object with the information + * @throws {TypeError} Invalid bitcoin address + * @throws {TypeError} Invalid amount + * @throws {Error} Unknown required argument + */ +URI.prototype._fromObject = function(obj) { + /* jshint maxcomplexity: 10 */ + + if (!Address.isValid(obj.address)) { + throw new TypeError('Invalid bitcoin address'); + } + + this.address = new Address(obj.address); + this.network = this.address.network; + this.amount = obj.amount; + + for (var key in obj) { + if (key === 'address' || key === 'amount') { + continue; + } + + if (/^req-/.exec(key) && this.knownParams.indexOf(key) === -1) { + throw Error('Unknown required argument ' + key); + } + + var destination = URI.Members.indexOf(key) > -1 ? this : this.extras; + destination[key] = obj[key]; + } +}; + +/** + * Internal function to transform a BTC string amount into satoshis + * + * @param {string} amount - Amount BTC string + * @throws {TypeError} Invalid amount + * @returns {Object} Amount represented in satoshis + */ +URI.prototype._parseAmount = function(amount) { + amount = Number(amount); + if (isNaN(amount)) { + throw new TypeError('Invalid amount'); + } + return Unit.fromBTC(amount).toSatoshis(); +}; + +URI.prototype.toObject = URI.prototype.toJSON = function toObject() { + var json = {}; + for (var i = 0; i < URI.Members.length; i++) { + var m = URI.Members[i]; + if (this.hasOwnProperty(m) && typeof(this[m]) !== 'undefined') { + json[m] = this[m].toString(); + } + } + _.extend(json, this.extras); + return json; +}; + +/** + * Will return a the string representation of the URI + * + * @returns {string} Bitcoin URI string + */ +URI.prototype.toString = function() { + var query = {}; + if (this.amount) { + query.amount = Unit.fromSatoshis(this.amount).toBTC(); + } + if (this.message) { + query.message = this.message; + } + if (this.label) { + query.label = this.label; + } + if (this.r) { + query.r = this.r; + } + _.extend(query, this.extras); + + return URL.format({ + protocol: 'bitcoin:', + host: this.address, + query: query + }); +}; + +/** + * Will return a string formatted for the console + * + * @returns {string} Bitcoin URI + */ +URI.prototype.inspect = function() { + return ''; +}; + +module.exports = URI; diff --git a/packages/kauri-bitcore-lib/lib/util/buffer.js b/packages/kauri-bitcore-lib/lib/util/buffer.js new file mode 100644 index 0000000..3c12619 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/util/buffer.js @@ -0,0 +1,177 @@ +'use strict'; + +var buffer = require('buffer'); +var assert = require('assert'); + +var js = require('./js'); +var $ = require('./preconditions'); + +function equals(a, b) { + if (a.length !== b.length) { + return false; + } + var length = a.length; + for (var i = 0; i < length; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +} + +module.exports = { + /** + * Fill a buffer with a value. + * + * @param {Buffer} buffer + * @param {number} value + * @return {Buffer} + */ + fill: function fill(buffer, value) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + $.checkArgumentType(value, 'number', 'value'); + var length = buffer.length; + for (var i = 0; i < length; i++) { + buffer[i] = value; + } + return buffer; + }, + + /** + * Return a copy of a buffer + * + * @param {Buffer} original + * @return {Buffer} + */ + copy: function(original) { + var buffer = Buffer.alloc(original.length); + original.copy(buffer); + return buffer; + }, + + /** + * Returns true if the given argument is an instance of a buffer. Tests for + * both node's Buffer and Uint8Array + * + * @param {*} arg + * @return {boolean} + */ + isBuffer: function isBuffer(arg) { + return buffer.Buffer.isBuffer(arg) || arg instanceof Uint8Array; + }, + + /** + * Returns a zero-filled byte array + * + * @param {number} bytes + * @return {Buffer} + */ + emptyBuffer: function emptyBuffer(bytes) { + $.checkArgumentType(bytes, 'number', 'bytes'); + var result = new buffer.Buffer(bytes); + for (var i = 0; i < bytes; i++) { + result.write('\0', i); + } + return result; + }, + + /** + * Concatenates a buffer + * + * Shortcut for buffer.Buffer.concat + */ + concat: buffer.Buffer.concat, + + equals: equals, + equal: equals, + + /** + * Transforms a number from 0 to 255 into a Buffer of size 1 with that value + * + * @param {number} integer + * @return {Buffer} + */ + integerAsSingleByteBuffer: function integerAsSingleByteBuffer(integer) { + $.checkArgumentType(integer, 'number', 'integer'); + return new buffer.Buffer([integer & 0xff]); + }, + + /** + * Transform a 4-byte integer into a Buffer of length 4. + * + * @param {number} integer + * @return {Buffer} + */ + integerAsBuffer: function integerAsBuffer(integer) { + $.checkArgumentType(integer, 'number', 'integer'); + var bytes = []; + bytes.push((integer >> 24) & 0xff); + bytes.push((integer >> 16) & 0xff); + bytes.push((integer >> 8) & 0xff); + bytes.push(integer & 0xff); + return Buffer.from(bytes); + }, + + /** + * Transform the first 4 values of a Buffer into a number, in little endian encoding + * + * @param {Buffer} buffer + * @return {number} + */ + integerFromBuffer: function integerFromBuffer(buffer) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3]; + }, + + /** + * Transforms the first byte of an array into a number ranging from -128 to 127 + * @param {Buffer} buffer + * @return {number} + */ + integerFromSingleByteBuffer: function integerFromBuffer(buffer) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + return buffer[0]; + }, + + /** + * Transforms a buffer into a string with a number in hexa representation + * + * Shorthand for buffer.toString('hex') + * + * @param {Buffer} buffer + * @return {string} + */ + bufferToHex: function bufferToHex(buffer) { + $.checkArgumentType(buffer, 'Buffer', 'buffer'); + return buffer.toString('hex'); + }, + + /** + * Reverse a buffer + * @param {Buffer} param + * @return {Buffer} + */ + reverse: function reverse(param) { + var ret = new buffer.Buffer(param.length); + for (var i = 0; i < param.length; i++) { + ret[i] = param[param.length - i - 1]; + } + return ret; + }, + + /** + * Transforms an hexa encoded string into a Buffer with binary values + * + * Shorthand for Buffer(string, 'hex') + * + * @param {string} string + * @return {Buffer} + */ + hexToBuffer: function hexToBuffer(string) { + assert(js.isHexa(string)); + return new buffer.Buffer(string, 'hex'); + } +}; + +module.exports.NULL_HASH = module.exports.fill(Buffer.alloc(32), 0); +module.exports.EMPTY_BUFFER = Buffer.alloc(0); diff --git a/packages/kauri-bitcore-lib/lib/util/js.js b/packages/kauri-bitcore-lib/lib/util/js.js new file mode 100644 index 0000000..c53e1e1 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/util/js.js @@ -0,0 +1,84 @@ +'use strict'; + +var _ = require('lodash'); + +/** + * Determines whether a string contains only hexadecimal values + * + * @name JSUtil.isHexa + * @param {string} value + * @return {boolean} true if the string is the hexa representation of a number + */ +var isHexa = function isHexa(value) { + if (!_.isString(value)) { + return false; + } + return /^[0-9a-fA-F]+$/.test(value); +}; + +/** + * @namespace JSUtil + */ +module.exports = { + /** + * Test if an argument is a valid JSON object. If it is, returns a truthy + * value (the json object decoded), so no double JSON.parse call is necessary + * + * @param {string} arg + * @return {Object|boolean} false if the argument is not a JSON string. + */ + isValidJSON: function isValidJSON(arg) { + var parsed; + if (!_.isString(arg)) { + return false; + } + try { + parsed = JSON.parse(arg); + } catch (e) { + return false; + } + if (typeof(parsed) === 'object') { + return true; + } + return false; + }, + isHexa: isHexa, + isHexaString: isHexa, + + /** + * Clone an array + */ + cloneArray: function(array) { + return [].concat(array); + }, + + /** + * Define immutable properties on a target object + * + * @param {Object} target - An object to be extended + * @param {Object} values - An object of properties + * @return {Object} The target object + */ + defineImmutable: function defineImmutable(target, values) { + Object.keys(values).forEach(function(key){ + Object.defineProperty(target, key, { + configurable: false, + enumerable: true, + value: values[key] + }); + }); + return target; + }, + /** + * Checks that a value is a natural number, a positive integer or zero. + * + * @param {*} value + * @return {Boolean} + */ + isNaturalNumber: function isNaturalNumber(value) { + return typeof value === 'number' && + isFinite(value) && + Math.floor(value) === value && + value >= 0; + } +}; diff --git a/packages/kauri-bitcore-lib/lib/util/preconditions.js b/packages/kauri-bitcore-lib/lib/util/preconditions.js new file mode 100644 index 0000000..43afc04 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/util/preconditions.js @@ -0,0 +1,34 @@ +'use strict'; + +var errors = require('../errors'); +var _ = require('lodash'); + +module.exports = { + checkState: function(condition, message) { + if (!condition) { + throw new errors.InvalidState(message); + } + }, + checkArgument: function(condition, argumentName, message, docsPath) { + if (!condition) { + throw new errors.InvalidArgument(argumentName, message, docsPath); + } + }, + checkArgumentType: function(argument, type, argumentName) { + argumentName = argumentName || '(unknown name)'; + if (_.isString(type)) { + if (type === 'Buffer') { + var buffer = require('buffer'); // './buffer' fails on cordova & RN + if (!buffer.Buffer.isBuffer(argument)) { + throw new errors.InvalidArgumentType(argument, type, argumentName); + } + } else if (typeof argument !== type) { + throw new errors.InvalidArgumentType(argument, type, argumentName); + } + } else { + if (!(argument instanceof type)) { + throw new errors.InvalidArgumentType(argument, type.name, argumentName); + } + } + } +}; diff --git a/packages/kauri-bitcore-lib/package-lock.json b/packages/kauri-bitcore-lib/package-lock.json new file mode 100644 index 0000000..1264a3d --- /dev/null +++ b/packages/kauri-bitcore-lib/package-lock.json @@ -0,0 +1,10992 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "JSON2": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/JSON2/-/JSON2-0.1.0.tgz", + "integrity": "sha1-jXSTBApj1YNa919H3suDq2yMB5A=" + }, + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + }, + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "requires": { + "mime-types": "2.1.18", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==" + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + } + } + }, + "acorn-node": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.3.0.tgz", + "integrity": "sha512-efP54n3d1aLfjL2UMdaXa6DsswwzJeI5rqhbFvXMrKiJ6eJFpf+7R0zN7t8IC+XKn2YOAFAv6xbBNgHUkoHWLw==", + "requires": { + "acorn": "5.5.3", + "xtend": "4.0.1" + } + }, + "adm-zip": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.7.tgz", + "integrity": "sha1-hgbCy/HEJs6MjsABdER/1Jtur8E=" + }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=" + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + }, + "ansi-cyan": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-red": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=" + }, + "any-shell-escape": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/any-shell-escape/-/any-shell-escape-0.1.1.tgz", + "integrity": "sha1-1Vq5ciRMcaml4asIefML8RCAaVk=" + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "1.1.0" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + } + } + }, + "archiver": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.7.1.tgz", + "integrity": "sha1-zxUteU+Gu9k/mFjaYNNqrqutm78=", + "requires": { + "file-utils": "0.1.5", + "lazystream": "0.1.0", + "lodash": "2.4.2", + "readable-stream": "1.0.34", + "zip-stream": "0.2.3" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=" + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=" + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=" + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=" + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.1", + "minimalistic-assert": "1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "requires": { + "acorn": "4.0.13" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" + } + } + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "4.17.4" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "asyncreduce": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/asyncreduce/-/asyncreduce-0.1.4.tgz", + "integrity": "sha1-GCEOAZeL/cugQ5VUl6XNMVwKakE=", + "requires": { + "runnel": "0.5.3" + } + }, + "atob": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.0.tgz", + "integrity": "sha512-SuiKH8vbsOyCALjA/+EINmt/Kdl+TQPrtFgW7XZZcwtryFu9e5kQoX3bjCW6mIvGH1fbeAZZuvwGR5IlBRznGw==" + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + } + } + }, + "base-x": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", + "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" + }, + "base64-js": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz", + "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==" + }, + "base64id": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", + "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=" + }, + "batch": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.5.0.tgz", + "integrity": "sha1-/S4Fp6XWlrTbkxQBPihdj/NVfsM=" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=" + }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "requires": { + "callsite": "1.0.0" + } + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" + }, + "bitcore-build": { + "version": "git+https://github.com/bitpay/bitcore-build.git#d4e8b2b2f1e2c065c3a807dcb6a6250f61d67ab3", + "requires": { + "brfs": "1.5.0", + "browserify": "13.3.0", + "chai": "3.5.0", + "gulp": "3.9.1", + "gulp-bump": "2.9.0", + "gulp-coveralls": "0.1.4", + "gulp-git": "2.5.2", + "gulp-jshint": "2.1.0", + "gulp-mocha": "4.3.1", + "gulp-rename": "1.2.2", + "gulp-shell": "0.6.5", + "gulp-uglify": "2.1.2", + "gulp-util": "3.0.8", + "istanbul": "0.4.5", + "karma": "1.7.1", + "karma-detect-browsers": "2.3.2", + "karma-mocha": "1.3.0", + "karma-phantomjs-launcher": "1.0.4", + "lodash": "4.17.4", + "mocha": "3.5.3", + "plato": "1.7.0", + "run-sequence": "1.2.2", + "zuul": "3.11.1" + }, + "dependencies": { + "chai": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "requires": { + "assertion-error": "1.1.0", + "deep-eql": "0.1.3", + "type-detect": "1.0.0" + } + } + } + }, + "bl": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", + "requires": { + "readable-stream": "1.0.34" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.16" + }, + "dependencies": { + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + } + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", + "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "kind-of": "6.0.2", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "brfs": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.5.0.tgz", + "integrity": "sha512-PscWJn5IGjcK5g5lqEeRPYJ5efZk93YbopLu6UXZcb9dPZUfMN/UMyyT/tddpi7A9yIDM9TEdCOA3A4WGST1hg==", + "requires": { + "quote-stream": "1.0.2", + "resolve": "1.6.0", + "static-module": "2.2.3", + "through2": "2.0.3" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "requires": { + "JSONStream": "1.3.2", + "combine-source-map": "0.8.0", + "defined": "1.0.0", + "safe-buffer": "5.1.1", + "through2": "2.0.3", + "umd": "3.0.3" + } + }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + } + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" + }, + "browserify": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", + "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", + "requires": { + "JSONStream": "1.3.2", + "assert": "1.4.1", + "browser-pack": "6.1.0", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "0.0.1", + "inherits": "2.0.1", + "insert-module-globals": "7.0.5", + "labeled-stream-splicer": "2.0.1", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.6", + "resolve": "1.6.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.8.1", + "string_decoder": "0.10.31", + "subarg": "1.0.0", + "syntax-error": "1.4.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.1", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" + }, + "dependencies": { + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "requires": { + "inherits": "2.0.1", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + } + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.1", + "safe-buffer": "5.1.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "requires": { + "browserify-aes": "1.2.0", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.1" + } + }, + "browserify-istanbul": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/browserify-istanbul/-/browserify-istanbul-0.1.5.tgz", + "integrity": "sha1-AcjjHWo1juUVD0Mhw/KJlalkw58=", + "requires": { + "istanbul": "0.2.16", + "minimatch": "0.2.14", + "through": "2.3.8" + }, + "dependencies": { + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "escodegen": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", + "integrity": "sha1-8CQBb1qI4Eb9EgBQVek5gC5sXyM=", + "requires": { + "esprima": "1.1.1", + "estraverse": "1.5.1", + "esutils": "1.0.0", + "source-map": "0.1.43" + }, + "dependencies": { + "esprima": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "integrity": "sha1-W28VR/TRAuZw4UDFCb5ncdautUk=" + } + } + }, + "esprima": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.5.tgz", + "integrity": "sha1-CZNQL+r2aBODJXVvMPmlH+7sEek=" + }, + "estraverse": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", + "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=" + }, + "esutils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", + "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=" + }, + "handlebars": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-1.3.0.tgz", + "integrity": "sha1-npsTCpPjiUkTItl1zz7BgYw3zjQ=", + "requires": { + "optimist": "0.3.7", + "uglify-js": "2.3.6" + } + }, + "istanbul": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.2.16.tgz", + "integrity": "sha1-hwVFoNT0tM4WEDnp6AWpjCxwC9k=", + "requires": { + "abbrev": "1.0.9", + "async": "0.9.2", + "escodegen": "1.3.3", + "esprima": "1.2.5", + "fileset": "0.1.8", + "handlebars": "1.3.0", + "js-yaml": "3.6.1", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "resolve": "0.7.4", + "which": "1.0.9", + "wordwrap": "0.0.3" + } + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + }, + "optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "requires": { + "wordwrap": "0.0.3" + } + }, + "resolve": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.7.4.tgz", + "integrity": "sha1-OVqe+ehz+/4SvRRAi9kbuTYAPWk=" + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "uglify-js": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz", + "integrity": "sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo=", + "optional": true, + "requires": { + "async": "0.2.10", + "optimist": "0.3.7", + "source-map": "0.1.43" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "optional": true + } + } + }, + "which": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", + "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8=" + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.0.6" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.1", + "parse-asn1": "5.1.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "requires": { + "pako": "0.2.9" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "3.0.4" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "requires": { + "base64-js": "1.2.3", + "ieee754": "1.1.11", + "isarray": "1.0.0" + } + }, + "buffer-compare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.1.1.tgz", + "integrity": "sha1-W+e+hTr4kZjR9N3AkNHWakiu9ZY=" + }, + "buffer-crc32": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz", + "integrity": "sha1-vj5TgvwCttYySVasGvmKqYsIU0w=" + }, + "buffer-equal": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", + "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=" + }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "bump-regex": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/bump-regex/-/bump-regex-2.9.0.tgz", + "integrity": "sha512-o4WC1mKw/kM0zScuOxZKi243lc+/h09b41u2A7HlWbxHsEDsTTZtqDZYkQj65l24J8+9Saahn5ep+EyeqpQoCg==", + "requires": { + "semver": "5.5.0", + "xtend": "4.0.1" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + } + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, + "cached-path-relative": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=" + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "requires": { + "callsites": "0.2.0" + } + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=" + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=" + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chai": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-1.10.0.tgz", + "integrity": "sha1-5AMcyHZURhp1lD5aNatG6vOcHrk=", + "requires": { + "assertion-error": "1.0.0", + "deep-eql": "0.1.3" + }, + "dependencies": { + "assertion-error": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.0.tgz", + "integrity": "sha1-x/hUOP3UZrx8oWq5DIFRN5el0js=" + } + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "char-split": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/char-split/-/char-split-0.2.0.tgz", + "integrity": "sha1-h1XtpkHl2yd90PUJtRfIJ+UKjt8=", + "requires": { + "through": "2.3.4" + }, + "dependencies": { + "through": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.4.tgz", + "integrity": "sha1-SV5A6Nio6uvHwnXqiMK4/BTFZFU=" + } + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.1.3", + "glob-parent": "2.0.0", + "inherits": "2.0.1", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "2.0.1", + "safe-buffer": "5.1.1" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==" + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "requires": { + "exit": "0.1.2", + "glob": "7.1.2" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "requires": { + "restore-cursor": "1.0.1" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + } + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=" + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=" + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "requires": { + "inherits": "2.0.1", + "process-nextick-args": "2.0.0", + "readable-stream": "2.3.6" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + }, + "colors": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.1.tgz", + "integrity": "sha512-s8+wktIuDSLffCywiwSxQOMqtPxML11a/dtHE17tMn4B1MSWw/C22EKf7M2KGUBcDaVFEGT+S8N02geDXeuNKg==" + }, + "combine-lists": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", + "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", + "requires": { + "lodash": "4.17.4" + } + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.7" + }, + "dependencies": { + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" + }, + "compress-commons": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", + "integrity": "sha1-Qi2SdDDAGr0GzUVbbfwEy0z4ADw=", + "requires": { + "buffer-crc32": "0.2.1", + "crc32-stream": "0.3.4", + "node-int64": "0.3.3", + "readable-stream": "1.0.34" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "compressible": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.13.tgz", + "integrity": "sha1-DRAgq5JLL9tNYnmHXH1tq6a6p6k=", + "requires": { + "mime-db": "1.33.0" + } + }, + "compression": { + "version": "1.5.0", + "resolved": "http://registry.npmjs.org/compression/-/compression-1.5.0.tgz", + "integrity": "sha1-zMGlR4jaGzrXcpxJ9qALOsmt9H8=", + "requires": { + "accepts": "1.2.13", + "bytes": "2.1.0", + "compressible": "2.0.13", + "debug": "2.2.0", + "on-headers": "1.0.1", + "vary": "1.0.1" + }, + "dependencies": { + "accepts": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", + "integrity": "sha1-5fHzkoxtlf2WVYw27D2dDeSm7Oo=", + "requires": { + "mime-types": "2.1.18", + "negotiator": "0.5.3" + } + }, + "bytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.1.0.tgz", + "integrity": "sha1-rJPEEOL/ycx89LRks4KJBn9eR7Q=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + }, + "negotiator": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz", + "integrity": "sha1-Jp1cR2gQ7JLtvntsLygxY4T5p+g=" + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "1.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "connect": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", + "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.0", + "parseurl": "1.3.2", + "utils-merge": "1.0.1" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "requires": { + "date-now": "0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz", + "integrity": "sha1-ROByFIrwHm6OJK+/EmkNaK5pjss=" + }, + "cookiejar": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-1.3.0.tgz", + "integrity": "sha1-3QCzVnkCHpnL1OhVua0EGRNHR2U=" + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-js": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.4.tgz", + "integrity": "sha1-8si/GB8qgLkvNgEhQpzmOi8K6uA=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "coveralls": { + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.3.tgz", + "integrity": "sha512-iiAmn+l1XqRwNLXhW8Rs5qHZRFMYp9ZIPjEOVRpC/c4so6Y/f4/lFi0FfR5B9cCqgyhkJ5cZmbvcVRfP8MHchw==", + "requires": { + "js-yaml": "3.6.1", + "lcov-parse": "0.0.10", + "log-driver": "1.2.5", + "minimist": "1.2.0", + "request": "2.79.0" + } + }, + "crc32-stream": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", + "integrity": "sha1-c7wltF+sHbZjIjGnv86JJ+nwZVI=", + "requires": { + "buffer-crc32": "0.2.1", + "readable-stream": "1.0.34" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.1", + "ripemd160": "2.0.1", + "sha.js": "2.4.11" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.1", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.11" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "4.1.2", + "shebang-command": "1.2.0", + "which": "1.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", + "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + } + } + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "requires": { + "boom": "2.10.1" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.1", + "pbkdf2": "3.0.14", + "public-encrypt": "4.0.0", + "randombytes": "2.0.6", + "randomfill": "1.0.4" + } + }, + "ctype": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=" + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "requires": { + "array-find-index": "1.0.2" + } + }, + "custom-event": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=" + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "requires": { + "es5-ext": "0.10.42" + } + }, + "dargs": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-5.1.0.tgz", + "integrity": "sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=" + }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=" + } + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "requires": { + "clone": "1.0.4" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "deprecated": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", + "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=" + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "requires": { + "JSONStream": "1.3.2", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "2.0.3" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "requires": { + "inherits": "2.0.1", + "minimalistic-assert": "1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" + }, + "detective": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", + "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "requires": { + "acorn": "5.5.3", + "defined": "1.0.0" + } + }, + "di": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", + "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=" + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=" + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "dom-serialize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", + "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", + "requires": { + "custom-event": "1.0.1", + "ent": "2.2.0", + "extend": "3.0.1", + "void-elements": "2.0.1" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + } + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=" + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "requires": { + "readable-stream": "2.3.6" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.1", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "emitter-component": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/emitter-component/-/emitter-component-1.0.0.tgz", + "integrity": "sha1-8E3Rj8PcPpp0y8DzELCIZm5MAW8=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", + "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", + "requires": { + "once": "1.3.3" + }, + "dependencies": { + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "requires": { + "wrappy": "1.0.2" + } + } + } + }, + "engine.io": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.3.tgz", + "integrity": "sha1-jef5eJXSDTm4X4ju7nd7K9QrE9Q=", + "requires": { + "accepts": "1.3.3", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "ws": "1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + } + } + }, + "engine.io-client": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.3.tgz", + "integrity": "sha1-F5jtk0USRkU9TG9jXXogH+lA1as=", + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "1.1.2", + "xmlhttprequest-ssl": "1.5.3", + "yeast": "0.1.2" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + } + } + }, + "engine.io-parser": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.2.tgz", + "integrity": "sha1-k3sHnwAH0Ik+xW1GyyILjLQ1Igo=", + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary": "0.1.7", + "wtf-8": "1.0.0" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=" + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es5-ext": { + "version": "0.10.42", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz", + "integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==", + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "next-tick": "1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.42", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.42", + "es6-iterator": "2.0.3", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==" + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.42", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.42" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.42", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "escodegen": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", + "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "requires": { + "esprima": "3.1.3", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.6.1" + } + }, + "escomplex-plugin-metrics-module": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/escomplex-plugin-metrics-module/-/escomplex-plugin-metrics-module-0.0.10.tgz", + "integrity": "sha1-6pZ8sSwSOCDSTnrATkJ4oZvPzoM=", + "requires": { + "typhonjs-escomplex-commons": "0.0.14" + } + }, + "escomplex-plugin-metrics-project": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/escomplex-plugin-metrics-project/-/escomplex-plugin-metrics-project-0.0.10.tgz", + "integrity": "sha1-Z6Y1wctV4vO+y3dO/mpANOYjiqg=", + "requires": { + "typhonjs-escomplex-commons": "0.0.14" + } + }, + "escomplex-plugin-syntax-babylon": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/escomplex-plugin-syntax-babylon/-/escomplex-plugin-syntax-babylon-0.0.10.tgz", + "integrity": "sha1-sUcBSYHP57yKK0NJfmsyiRqD5yA=", + "requires": { + "escomplex-plugin-syntax-estree": "0.0.10", + "typhonjs-escomplex-commons": "0.0.14" + } + }, + "escomplex-plugin-syntax-estree": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/escomplex-plugin-syntax-estree/-/escomplex-plugin-syntax-estree-0.0.10.tgz", + "integrity": "sha1-b1MfnZM/vB68lDjpwQGxtGNs/Gg=", + "requires": { + "typhonjs-escomplex-commons": "0.0.14" + } + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.0.1.tgz", + "integrity": "sha1-/xLq/cBOpx0XOgmdRlihNucVeTQ=", + "requires": { + "chalk": "1.1.3", + "concat-stream": "1.6.2", + "debug": "2.6.9", + "doctrine": "1.5.0", + "es6-map": "0.1.5", + "escope": "3.6.0", + "espree": "3.5.4", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "1.3.1", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "is-my-json-valid": "2.17.2", + "is-resolvable": "1.1.0", + "js-yaml": "3.6.1", + "json-stable-stringify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "1.2.1", + "progress": "1.1.8", + "require-uncached": "1.0.3", + "shelljs": "0.6.1", + "strip-bom": "3.0.0", + "strip-json-comments": "1.0.4", + "table": "3.8.3", + "text-table": "0.2.0", + "user-home": "2.0.0" + }, + "dependencies": { + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "0.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "user-home": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "requires": { + "os-homedir": "1.0.2" + } + } + } + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "requires": { + "acorn": "5.5.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.42" + } + }, + "eventemitter3": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=" + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "1.3.4", + "safe-buffer": "5.1.1" + } + }, + "execa": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz", + "integrity": "sha1-V7aaWU8IF1nGnlNw8NF7nLEWWP4=", + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=" + }, + "expand-braces": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", + "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", + "requires": { + "array-slice": "0.2.3", + "array-unique": "0.2.1", + "braces": "0.1.5" + }, + "dependencies": { + "array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=" + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "braces": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", + "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", + "requires": { + "expand-range": "0.1.1" + } + }, + "expand-range": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", + "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", + "requires": { + "is-number": "0.1.1", + "repeat-string": "0.2.2" + } + }, + "is-number": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", + "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=" + }, + "repeat-string": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", + "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=" + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "requires": { + "fill-range": "2.2.3" + }, + "dependencies": { + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "requires": { + "kind-of": "3.2.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "requires": { + "homedir-polyfill": "1.0.1" + } + }, + "express": { + "version": "3.4.8", + "resolved": "https://registry.npmjs.org/express/-/express-3.4.8.tgz", + "integrity": "sha1-qnqJht4HBTM39Lxe2aZFPZzI4uE=", + "requires": { + "buffer-crc32": "0.2.1", + "commander": "1.3.2", + "connect": "2.12.0", + "cookie": "0.1.0", + "cookie-signature": "1.0.1", + "debug": "0.8.1", + "fresh": "0.2.0", + "merge-descriptors": "0.0.1", + "methods": "0.1.0", + "mkdirp": "0.3.5", + "range-parser": "0.0.4", + "send": "0.1.4" + }, + "dependencies": { + "bytes": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.1.tgz", + "integrity": "sha1-VVsIq8sGP4l1kFMCUj5M1P/f3zE=" + }, + "commander": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-1.3.2.tgz", + "integrity": "sha1-io8w7GcKb91kr1LxkUuQfXnq1bU=", + "requires": { + "keypress": "0.1.0" + } + }, + "connect": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-2.12.0.tgz", + "integrity": "sha1-Mdj6DcrN8ZCNgivSkjvootKn7Zo=", + "requires": { + "batch": "0.5.0", + "buffer-crc32": "0.2.1", + "bytes": "0.2.1", + "cookie": "0.1.0", + "cookie-signature": "1.0.1", + "debug": "0.8.1", + "fresh": "0.2.0", + "methods": "0.1.0", + "multiparty": "2.2.0", + "negotiator": "0.3.0", + "pause": "0.0.1", + "qs": "0.6.6", + "raw-body": "1.1.2", + "send": "0.1.4", + "uid2": "0.0.3" + } + }, + "cookie": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz", + "integrity": "sha1-kOtGndzpBchm3mh+/EMTHYgB+dA=" + }, + "debug": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz", + "integrity": "sha1-IP9NJvXkIstoobrLu2EDmtjBwTA=" + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=" + }, + "negotiator": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.3.0.tgz", + "integrity": "sha1-cG1pLv7d9XTVfqn7GriaT6fuj2A=" + }, + "qs": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", + "integrity": "sha1-bgFQmP9RlouKPIGQAdXyyJvEsQc=" + }, + "range-parser": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz", + "integrity": "sha1-wEJ//vUcEKy6B4KkbJYC50T/Ygs=" + }, + "raw-body": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.2.tgz", + "integrity": "sha1-x0swBN6l3v0WlhcRBqx0DsMdYr4=", + "requires": { + "bytes": "0.2.1" + } + } + } + }, + "express-state": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/express-state/-/express-state-1.0.3.tgz", + "integrity": "sha1-tvNodDqV2KkbdoOt9ZPQKxV37AI=" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "extract-zip": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz", + "integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=", + "requires": { + "concat-stream": "1.6.0", + "debug": "2.6.9", + "mkdirp": "0.5.0", + "yauzl": "2.4.1" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "requires": { + "minimist": "0.0.8" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "falafel": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz", + "integrity": "sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw=", + "requires": { + "acorn": "5.5.3", + "foreach": "2.0.5", + "isarray": "0.0.1", + "object-keys": "1.0.11" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + } + } + }, + "fancy-log": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", + "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", + "requires": { + "ansi-gray": "0.1.1", + "color-support": "1.1.3", + "time-stamp": "1.1.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "requires": { + "pend": "1.2.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } + } + }, + "file-entry-cache": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", + "integrity": "sha1-RMYepgeuS+nBQC9B9EJwy/4zT/g=", + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } + } + }, + "file-utils": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/file-utils/-/file-utils-0.1.5.tgz", + "integrity": "sha1-3IFTyFU4fLTaywoXJVMfpESmtIw=", + "requires": { + "findup-sync": "0.1.3", + "glob": "3.2.11", + "iconv-lite": "0.2.11", + "isbinaryfile": "0.1.9", + "lodash": "2.1.0", + "minimatch": "0.2.14", + "rimraf": "2.2.8" + }, + "dependencies": { + "findup-sync": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", + "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=", + "requires": { + "glob": "3.2.11", + "lodash": "2.4.2" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + } + } + }, + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "requires": { + "inherits": "2.0.1", + "minimatch": "0.3.0" + }, + "dependencies": { + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "iconv-lite": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", + "integrity": "sha1-HOYKOleGSiktEyH/RgnKS7llrcg=" + }, + "isbinaryfile": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-0.1.9.tgz", + "integrity": "sha1-Fe7ONcSrcI2JJNqZ+4dPK1zAtsQ=" + }, + "lodash": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.1.0.tgz", + "integrity": "sha1-Bjfqqjaooc/IZcOt+5Qhib+wmY0=" + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + }, + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" + } + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + }, + "fileset": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", + "integrity": "sha1-UGuRqTluqn4y+0KoQHfHoMc2t0E=", + "requires": { + "glob": "3.2.11", + "minimatch": "0.4.0" + }, + "dependencies": { + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "requires": { + "inherits": "2.0.1", + "minimatch": "0.3.0" + }, + "dependencies": { + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "minimatch": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.4.0.tgz", + "integrity": "sha1-vSx9Bg0sjI/Xzefx8u0tWycP2xs=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "find-index": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", + "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=" + }, + "find-nearest-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-nearest-file/-/find-nearest-file-1.0.0.tgz", + "integrity": "sha1-v1OdfQ8CmWYx+iGWaA9ndnYrn3A=" + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "requires": { + "detect-file": "1.0.0", + "is-glob": "3.1.0", + "micromatch": "3.1.10", + "resolve-dir": "1.0.1" + } + }, + "fined": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", + "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", + "requires": { + "expand-tilde": "2.0.2", + "is-plain-object": "2.0.4", + "object.defaults": "1.1.0", + "object.pick": "1.3.0", + "parse-filepath": "1.0.2" + } + }, + "firefox-profile": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/firefox-profile/-/firefox-profile-0.2.7.tgz", + "integrity": "sha1-/kavwu1qlvYsXDvURvoln2AUqQk=", + "requires": { + "adm-zip": "0.4.7", + "archiver": "0.7.1", + "async": "0.2.10", + "fs-extra": "0.8.1", + "lazystream": "0.1.0", + "node-uuid": "1.4.8", + "wrench": "1.5.9", + "xml2js": "0.4.19" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" + }, + "fs-extra": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.8.1.tgz", + "integrity": "sha1-Dld5/7/t9RG8dVWVx/A8BtS0Po0=", + "requires": { + "jsonfile": "1.1.1", + "mkdirp": "0.3.5", + "ncp": "0.4.2", + "rimraf": "2.2.8" + } + }, + "jsonfile": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-1.1.1.tgz", + "integrity": "sha1-2k/WrXfxolUgPqY8e8Mtwx72RDM=" + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=" + }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=" + }, + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" + } + } + }, + "first-chunk-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", + "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=" + }, + "flagged-respawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz", + "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=" + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "requires": { + "for-in": "1.0.2" + } + }, + "forEachAsync": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/forEachAsync/-/forEachAsync-2.2.1.tgz", + "integrity": "sha1-43I/AJA5EOHrSx2zrVG1xkoxn+w=", + "requires": { + "sequence": "2.2.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "foreach-shim": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/foreach-shim/-/foreach-shim-0.1.1.tgz", + "integrity": "sha1-vmHXX0artxdvWr0pXjWIV1G3HZQ=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "formatio": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.1.1.tgz", + "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", + "requires": { + "samsam": "1.1.2" + } + }, + "formidable": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz", + "integrity": "sha1-Kz9MQRy7X91pXESEPiojUUpDIxo=" + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "0.2.2" + } + }, + "fresh": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz", + "integrity": "sha1-v9lALPPfEsSkwxDHn5mj3eE9NKc=" + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "optional": true, + "requires": { + "nan": "2.10.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "gaze": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", + "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "requires": { + "globule": "0.1.0" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=" + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "requires": { + "is-property": "1.0.2" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "glob-stream": { + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", + "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", + "requires": { + "glob": "4.5.3", + "glob2base": "0.0.12", + "minimatch": "2.0.10", + "ordered-read-streams": "0.1.0", + "through2": "0.6.5", + "unique-stream": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "2.0.10", + "once": "1.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "glob-watcher": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", + "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", + "requires": { + "gaze": "0.5.2" + } + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "requires": { + "find-index": "0.1.1" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "requires": { + "global-prefix": "1.0.2", + "is-windows": "1.0.2", + "resolve-dir": "1.0.1" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "requires": { + "expand-tilde": "2.0.2", + "homedir-polyfill": "1.0.1", + "ini": "1.3.5", + "is-windows": "1.0.2", + "which": "1.3.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } + } + }, + "globs-to-files": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/globs-to-files/-/globs-to-files-1.0.0.tgz", + "integrity": "sha1-VEkPbR9Ln9LenZlEUUb/s3VQOA0=", + "requires": { + "array-uniq": "1.0.3", + "asyncreduce": "0.1.4", + "glob": "5.0.15", + "xtend": "4.0.1" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "globule": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", + "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" + }, + "lodash": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", + "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=" + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "glogg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", + "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", + "requires": { + "sparkles": "1.0.0" + } + }, + "graceful-fs": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", + "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "requires": { + "natives": "1.1.3" + } + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=" + }, + "gulp": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", + "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", + "requires": { + "archy": "1.0.0", + "chalk": "1.1.3", + "deprecated": "0.0.1", + "gulp-util": "3.0.8", + "interpret": "1.1.0", + "liftoff": "2.5.0", + "minimist": "1.2.0", + "orchestrator": "0.3.8", + "pretty-hrtime": "1.0.3", + "semver": "4.3.6", + "tildify": "1.2.0", + "v8flags": "2.1.1", + "vinyl-fs": "0.3.14" + } + }, + "gulp-bump": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/gulp-bump/-/gulp-bump-2.9.0.tgz", + "integrity": "sha512-Cu+QOhwb2Jr2K6yo2u2mh4GWQRpSAMZD/z0v8FStlrOGaqML9u1On7XcyR1pS/PN3HQ9wsd/Ks6AcCQb+j3BgA==", + "requires": { + "bump-regex": "2.9.0", + "plugin-error": "0.1.2", + "plugin-log": "0.1.0", + "semver": "5.5.0", + "through2": "2.0.3" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + } + } + }, + "gulp-coveralls": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/gulp-coveralls/-/gulp-coveralls-0.1.4.tgz", + "integrity": "sha1-L2IKyN9i0LhrS73mTaNnzEGhkMk=", + "requires": { + "coveralls": "2.13.3", + "gulp-util": "3.0.8", + "through2": "1.1.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", + "requires": { + "readable-stream": "1.1.14", + "xtend": "4.0.1" + } + } + } + }, + "gulp-git": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/gulp-git/-/gulp-git-2.5.2.tgz", + "integrity": "sha512-rMbJ7W7ucHEPUkcia3eVrvSvQMB+WF80GfkfWEQMJPh6vUgr6f6AuCzNhj0m3xHS/2aaFzumhlt2RzD5EWFkug==", + "requires": { + "any-shell-escape": "0.1.1", + "fancy-log": "1.3.2", + "lodash.template": "4.4.0", + "plugin-error": "0.1.2", + "require-dir": "1.0.0", + "strip-bom-stream": "3.0.0", + "through2": "2.0.3", + "vinyl": "2.1.0" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=" + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.templatesettings": "4.1.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "requires": { + "lodash._reinterpolate": "3.0.0" + } + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "requires": { + "clone": "2.1.2", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.1.2", + "remove-trailing-separator": "1.1.0", + "replace-ext": "1.0.0" + } + } + } + }, + "gulp-jshint": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/gulp-jshint/-/gulp-jshint-2.1.0.tgz", + "integrity": "sha512-sP3NK8Y/1e58O0PH9t6s7DAr/lKDSUbIY207oWSeufM6/VclB7jJrIBcPCsyhrFTCDUl9DauePbt6VqP2vPM5w==", + "requires": { + "lodash": "4.17.4", + "minimatch": "3.0.4", + "plugin-error": "0.1.2", + "rcloader": "0.2.2", + "through2": "2.0.3" + } + }, + "gulp-mocha": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-4.3.1.tgz", + "integrity": "sha1-d5ULQ7z/gWWVdnwHNOD9p9Fz3Nk=", + "requires": { + "dargs": "5.1.0", + "execa": "0.6.3", + "gulp-util": "3.0.8", + "mocha": "3.5.3", + "npm-run-path": "2.0.2", + "through2": "2.0.3" + } + }, + "gulp-rename": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.2.tgz", + "integrity": "sha1-OtRCh2PwXidk3sHGfYaNsnVoeBc=" + }, + "gulp-shell": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/gulp-shell/-/gulp-shell-0.6.5.tgz", + "integrity": "sha512-f3m1WcS0o2B72/PGj1Jbv9zYR9rynBh/EQJv64n01xQUo7j7anols0eww9GG/WtDTzGVQLrupVDYkifRFnj5Zg==", + "requires": { + "async": "2.6.0", + "chalk": "2.3.2", + "fancy-log": "1.3.2", + "lodash": "4.17.4", + "lodash.template": "4.4.0", + "plugin-error": "0.1.2", + "through2": "2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.templatesettings": "4.1.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "requires": { + "lodash._reinterpolate": "3.0.0" + } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "gulp-uglify": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-2.1.2.tgz", + "integrity": "sha1-bbhbHQ7mPRgFhZK2WGSdZcLsRUE=", + "requires": { + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash": "4.17.4", + "make-error-cause": "1.2.2", + "through2": "2.0.3", + "uglify-js": "2.8.29", + "uglify-save-license": "0.4.1", + "vinyl-sourcemaps-apply": "0.2.1" + } + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.2.0", + "fancy-log": "1.3.2", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "requires": { + "glogg": "1.0.1" + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "requires": { + "chalk": "1.1.3", + "commander": "2.15.1", + "is-my-json-valid": "2.17.2", + "pinkie-promise": "2.0.1" + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-binary": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", + "integrity": "sha1-aOYesWIQyVRaClzOBqhzkS/h5ow=", + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + } + } + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "requires": { + "sparkles": "1.0.0" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "requires": { + "inherits": "2.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "hasha": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", + "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "requires": { + "is-stream": "1.1.0", + "pinkie-promise": "2.0.1" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hbs": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/hbs/-/hbs-2.4.0.tgz", + "integrity": "sha1-9MlWy2YNaXTcYSFLfEmiH2qqP1E=", + "requires": { + "handlebars": "1.0.12", + "walk": "2.2.1" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" + }, + "handlebars": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-1.0.12.tgz", + "integrity": "sha1-GMbTRAw16RsZs/9YK5FRq0mF1Pw=", + "requires": { + "optimist": "0.3.7", + "uglify-js": "2.3.6" + } + }, + "optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "requires": { + "wordwrap": "0.0.3" + } + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "requires": { + "amdefine": "1.0.1" + } + }, + "uglify-js": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz", + "integrity": "sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo=", + "requires": { + "async": "0.2.10", + "optimist": "0.3.7", + "source-map": "0.1.43" + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "highlight.js": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-7.5.0.tgz", + "integrity": "sha1-AFJZXu8VhF2ELgKgMxOvrcPr1sw=" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==" + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=" + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.3.0", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": "1.5.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "http-proxy": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=", + "requires": { + "eventemitter3": "1.2.0", + "requires-port": "1.0.0" + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.14.1" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=" + }, + "humanize-duration": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-2.4.0.tgz", + "integrity": "sha1-BNqJ5nhK8ciBsG68n0lN2gewihc=" + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "ieee754": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.11.tgz", + "integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==" + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "requires": { + "repeating": "2.0.1" + } + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "requires": { + "source-map": "0.5.7" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "inquirer": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "requires": { + "ansi-escapes": "1.4.0", + "ansi-regex": "2.1.1", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "figures": "1.7.0", + "lodash": "4.17.4", + "readline2": "1.0.1", + "run-async": "0.1.0", + "rx-lite": "3.1.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" + } + }, + "insert-module-globals": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.5.tgz", + "integrity": "sha512-wgRtrCpMm0ruH2hgLUIx+9YfJsgJQmU1KkPUzTuatW9dbH19yPRqAQhFX1HJU6zbmg2IMmt80BgSE5MWuksw3Q==", + "requires": { + "JSONStream": "1.3.2", + "combine-source-map": "0.8.0", + "concat-stream": "1.6.2", + "is-buffer": "1.1.6", + "lexical-scope": "1.2.0", + "process": "0.11.10", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + }, + "ipaddr.js": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "requires": { + "is-relative": "1.0.0", + "is-windows": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "1.11.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==" + }, + "is-my-json-valid": { + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + } + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=" + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "requires": { + "is-unc-path": "1.0.0" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isbinaryfile": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz", + "integrity": "sha1-Sj6XTsDLqQBNP8bN5yCeppNopiE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "requires": { + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.11", + "js-yaml": "3.6.1", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.0", + "wordwrap": "1.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=" + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-middleware": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/istanbul-middleware/-/istanbul-middleware-0.2.2.tgz", + "integrity": "sha1-g8TBPBKOGg1qFHeSORrzwVqKuOA=", + "requires": { + "archiver": "0.14.4", + "body-parser": "1.12.4", + "express": "4.16.3", + "istanbul": "0.4.5" + }, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "2.1.18", + "negotiator": "0.6.1" + } + }, + "archiver": { + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", + "integrity": "sha1-W53bn17hzu8hy487Ag5iQOy0MVw=", + "requires": { + "async": "0.9.2", + "buffer-crc32": "0.2.1", + "glob": "4.3.5", + "lazystream": "0.1.0", + "lodash": "3.2.0", + "readable-stream": "1.0.34", + "tar-stream": "1.1.5", + "zip-stream": "0.5.2" + } + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "body-parser": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.12.4.tgz", + "integrity": "sha1-CQcAxLoohiqFIO83g5X97l9hwik=", + "requires": { + "bytes": "1.0.0", + "content-type": "1.0.4", + "debug": "2.2.0", + "depd": "1.0.1", + "iconv-lite": "0.4.8", + "on-finished": "2.2.1", + "qs": "2.4.2", + "raw-body": "2.0.2", + "type-is": "1.6.16" + } + }, + "bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "depd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", + "integrity": "sha1-gK7GTJ1tl+ZcwqnKqTwKpqv3Oqo=" + }, + "ee-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz", + "integrity": "sha1-ag18YiHkkP7v2S7D9EHJzozQl/Q=" + }, + "express": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "requires": { + "accepts": "1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.3", + "qs": "6.5.1", + "range-parser": "1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "1.4.0", + "type-is": "1.6.16", + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.16" + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } + } + } + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.4.0", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + } + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "glob": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", + "integrity": "sha1-gPuwjKVA8jiszl0R0em8QedRc9M=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "2.0.10", + "once": "1.4.0" + } + }, + "iconv-lite": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.8.tgz", + "integrity": "sha1-xgGadZXyzvynAuq2lKAQvNkpjSA=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "lodash": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + }, + "on-finished": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz", + "integrity": "sha1-XIXBzDYpn3gCllP2Z/J7a5nrwCk=", + "requires": { + "ee-first": "1.1.0" + } + }, + "qs": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", + "integrity": "sha1-9854jld33wtQENp/fE5zujJHD1o=" + }, + "raw-body": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.0.2.tgz", + "integrity": "sha1-osL5jIUxzumcY9jSOLfel7tln8o=", + "requires": { + "bytes": "2.1.0", + "iconv-lite": "0.4.8" + }, + "dependencies": { + "bytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.1.0.tgz", + "integrity": "sha1-rJPEEOL/ycx89LRks4KJBn9eR7Q=" + } + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.3", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.4.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + } + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "zip-stream": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz", + "integrity": "sha1-Mty8UG0Nq00hNyYlvX66rDwv/1Y=", + "requires": { + "compress-commons": "0.2.9", + "lodash": "3.2.0", + "readable-stream": "1.0.34" + } + } + } + }, + "js-yaml": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", + "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", + "requires": { + "argparse": "1.0.10", + "esprima": "2.7.3" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "jshint": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", + "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", + "requires": { + "cli": "1.0.1", + "console-browserify": "1.1.0", + "exit": "0.1.2", + "htmlparser2": "3.8.3", + "lodash": "3.7.0", + "minimatch": "3.0.4", + "shelljs": "0.3.0", + "strip-json-comments": "1.0.4" + }, + "dependencies": { + "lodash": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", + "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=" + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + } + } + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "4.1.11" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "optional": true + } + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "karma": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-1.7.1.tgz", + "integrity": "sha512-k5pBjHDhmkdaUccnC7gE3mBzZjcxyxYsYVaqiL2G5AqlfLyBO5nw2VdNK+O16cveEPd/gIOWULH7gkiYYwVNHg==", + "requires": { + "bluebird": "3.5.1", + "body-parser": "1.18.2", + "chokidar": "1.7.0", + "colors": "1.2.1", + "combine-lists": "1.0.1", + "connect": "3.6.6", + "core-js": "2.5.4", + "di": "0.0.1", + "dom-serialize": "2.2.1", + "expand-braces": "0.1.2", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "http-proxy": "1.16.2", + "isbinaryfile": "3.0.2", + "lodash": "3.10.1", + "log4js": "0.6.38", + "mime": "1.6.0", + "minimatch": "3.0.4", + "optimist": "0.6.1", + "qjobs": "1.2.0", + "range-parser": "1.2.0", + "rimraf": "2.6.2", + "safe-buffer": "5.1.1", + "socket.io": "1.7.3", + "source-map": "0.5.7", + "tmp": "0.0.31", + "useragent": "2.3.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "karma-detect-browsers": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/karma-detect-browsers/-/karma-detect-browsers-2.3.2.tgz", + "integrity": "sha512-EFku2S5IpUEpJR2XxJa/onW6tIuapa3kYWJDD7Tk6LqhhIxfKWvJ+vnleLop6utXT28204hZptnfH7PGSmk4Nw==", + "requires": { + "which": "1.3.0" + } + }, + "karma-mocha": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-1.3.0.tgz", + "integrity": "sha1-7qrH/8DiAetjxGdEDStpx883eL8=", + "requires": { + "minimist": "1.2.0" + } + }, + "karma-phantomjs-launcher": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", + "integrity": "sha1-0jyjSAG9qYY60xjju0vUBisTrNI=", + "requires": { + "lodash": "4.17.4", + "phantomjs-prebuilt": "2.1.16" + } + }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=" + }, + "keypress": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", + "integrity": "sha1-SjGI1CkbZrT2XtuZ+AaqmuKTWSo=" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "requires": { + "graceful-fs": "4.1.11" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "optional": true + } + } + }, + "labeled-stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", + "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "requires": { + "inherits": "2.0.1", + "isarray": "2.0.4", + "stream-splicer": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==" + } + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + }, + "lazystream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", + "integrity": "sha1-GyXWPHcqTCDwpe0KnXf0hLbhaSA=", + "requires": { + "readable-stream": "1.0.34" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=" + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lexical-scope": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", + "requires": { + "astw": "2.2.0" + } + }, + "liftoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", + "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "requires": { + "extend": "3.0.1", + "findup-sync": "2.0.0", + "fined": "1.1.0", + "flagged-respawn": "1.0.0", + "is-plain-object": "2.0.4", + "object.map": "1.0.1", + "rechoir": "0.6.2", + "resolve": "1.6.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "load-script": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/load-script/-/load-script-0.0.5.tgz", + "integrity": "sha1-y9VLJ81zCZArdJZAxw6Zb0xkO2M=" + }, + "localtunnel": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.5.0.tgz", + "integrity": "sha1-W+lJd5Ml6fMnMCGj840ueo3NfE8=", + "requires": { + "debug": "0.7.4", + "optimist": "0.3.4", + "request": "2.11.4" + }, + "dependencies": { + "debug": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", + "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=" + }, + "optimist": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.4.tgz", + "integrity": "sha1-TW0L1x/60NpLpPbYdtXusE4HSAs=", + "requires": { + "wordwrap": "0.0.3" + } + }, + "request": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/request/-/request-2.11.4.tgz", + "integrity": "sha1-Y0fX1E5S3FiBCMwc5c7pdfyJJt4=", + "requires": { + "form-data": "0.0.3", + "mime": "1.2.7" + }, + "dependencies": { + "form-data": { + "version": "0.0.3", + "bundled": true, + "requires": { + "async": "0.1.9", + "combined-stream": "0.0.3", + "mime": "1.2.7" + }, + "dependencies": { + "async": { + "version": "0.1.9", + "bundled": true + }, + "combined-stream": { + "version": "0.0.3", + "bundled": true, + "requires": { + "delayed-stream": "0.0.5" + }, + "dependencies": { + "delayed-stream": { + "version": "0.0.5", + "bundled": true + } + } + } + } + }, + "mime": { + "version": "1.2.7", + "bundled": true + } + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=" + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=" + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=" + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" + }, + "lodash._isnative": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", + "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=" + }, + "lodash._objecttypes": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", + "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=" + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=" + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=" + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=" + }, + "lodash._shimkeys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", + "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", + "requires": { + "lodash._objecttypes": "2.4.1" + } + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._basecreate": "3.0.3", + "lodash._isiterateecall": "3.0.9" + } + }, + "lodash.defaults": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", + "integrity": "sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ=", + "requires": { + "lodash._objecttypes": "2.4.1", + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.isobject": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", + "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", + "requires": { + "lodash._objecttypes": "2.4.1" + } + }, + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + }, + "lodash.isobject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=" + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=" + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "log-driver": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=" + }, + "log4js": { + "version": "0.6.38", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", + "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", + "requires": { + "readable-stream": "1.0.34", + "semver": "4.3.6" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "lolex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz", + "integrity": "sha1-fD2mL/yzDw9agKJWbKJORdigHzE=" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + }, + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "requires": { + "vlq": "0.2.3" + } + }, + "make-error": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", + "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==" + }, + "make-error-cause": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", + "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", + "requires": { + "make-error": "1.3.4" + } + }, + "make-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.0.tgz", + "integrity": "sha1-V7713IXSOSO6I3ZzJNjo+PPZaUs=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "1.0.1" + } + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.1" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "2.0.1", + "safe-buffer": "5.1.1" + } + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + } + } + }, + "merge-descriptors": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-0.0.1.tgz", + "integrity": "sha1-L/CYDJJM+B0LXR+2ARd8uLtWwNA=" + }, + "merge-source-map": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", + "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", + "requires": { + "source-map": "0.5.7" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "methods": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/methods/-/methods-0.1.0.tgz", + "integrity": "sha1-M11Cnu/SG3us8unJIqjSvRSjDk8=" + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.1", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "module-deps": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "requires": { + "JSONStream": "1.3.2", + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "defined": "1.0.0", + "detective": "4.7.1", + "duplexer2": "0.1.4", + "inherits": "2.0.1", + "parents": "1.0.1", + "readable-stream": "2.3.6", + "resolve": "1.6.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" + }, + "dependencies": { + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "requires": { + "inherits": "2.0.1", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + } + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multiparty": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-2.2.0.tgz", + "integrity": "sha1-pWfCrwAK0i3I8qZT2Rl4rh9TFvQ=", + "requires": { + "readable-stream": "1.1.14", + "stream-counter": "0.2.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "requires": { + "duplexer2": "0.0.2" + }, + "dependencies": { + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "requires": { + "readable-stream": "1.1.14" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "mute-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=" + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "optional": true + }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "natives": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.3.tgz", + "integrity": "sha512-BZGSYV4YOLxzoTK73l0/s/0sH9l8SHs2ocReMH1f8JYSh5FUWu4ZrKCpJdRkWXV6HFR/pZDz7bwWOVAY07q77g==" + }, + "ncp": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz", + "integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "node-int64": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.3.3.tgz", + "integrity": "sha1-LW5rLs5d6FiLQ9iNG8QbJs0fqE0=" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1.0.9" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "requires": { + "hosted-git-info": "2.6.0", + "is-builtin-module": "1.0.0", + "semver": "4.3.6", + "validate-npm-package-license": "3.0.3" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "object-inspect": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.4.1.tgz", + "integrity": "sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw==" + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "3.0.1" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "requires": { + "array-each": "1.0.1", + "array-slice": "1.1.0", + "for-own": "1.0.0", + "isobject": "3.0.1" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "requires": { + "for-own": "1.0.0", + "make-iterator": "1.0.0" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + }, + "dependencies": { + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "requires": { + "for-in": "1.0.2" + } + } + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "3.0.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + }, + "opener": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.0.tgz", + "integrity": "sha1-0R+G7usHaINzXJ1Qn1OP6C0QuUE=" + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=" + }, + "orchestrator": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", + "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", + "requires": { + "end-of-stream": "0.1.5", + "sequencify": "0.0.7", + "stream-consume": "0.1.1" + } + }, + "ordered-read-streams": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", + "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=" + }, + "os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=" + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "osenv": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz", + "integrity": "sha1-zWrY3bKQkVrZ4idlV2Al1BHynLY=" + }, + "outpipe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", + "requires": { + "shell-quote": "1.6.1" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=" + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "requires": { + "path-platform": "0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "requires": { + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.14" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "requires": { + "is-absolute": "1.0.0", + "map-cache": "0.2.2", + "path-root": "0.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", + "requires": { + "better-assert": "1.0.2" + } + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "requires": { + "better-assert": "1.0.2" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "requires": { + "better-assert": "1.0.2" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=" + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=" + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "requires": { + "path-root-regex": "0.1.2" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + } + } + }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "requires": { + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.11" + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "phantomjs-prebuilt": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", + "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", + "requires": { + "es6-promise": "4.2.4", + "extract-zip": "1.6.6", + "fs-extra": "1.0.0", + "hasha": "2.2.0", + "kew": "0.7.0", + "progress": "1.1.8", + "request": "2.85.0", + "request-progress": "2.0.1", + "which": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "requires": { + "hoek": "4.2.1" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.1" + } + } + } + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.1", + "sntp": "2.1.0" + } + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.1" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "request": { + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", + "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "requires": { + "hoek": "4.2.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "2.0.4" + } + }, + "plato": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/plato/-/plato-1.7.0.tgz", + "integrity": "sha1-mQCltJEKoZDeCKRbrmF1M0/WRqc=", + "requires": { + "eslint": "3.0.1", + "fs-extra": "0.30.0", + "glob": "7.0.6", + "jshint": "2.9.5", + "lodash": "4.13.1", + "posix-getopt": "1.2.0", + "typhonjs-escomplex": "0.0.9" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1", + "path-is-absolute": "1.0.1", + "rimraf": "2.6.2" + } + }, + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "lodash": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", + "integrity": "sha1-g+SxCRP0hJbU0W/sSlYK8u50S2g=" + } + } + }, + "plugin-error": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", + "requires": { + "ansi-cyan": "0.1.1", + "ansi-red": "0.1.1", + "arr-diff": "1.1.0", + "arr-union": "2.1.0", + "extend-shallow": "1.1.4" + }, + "dependencies": { + "arr-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", + "requires": { + "arr-flatten": "1.1.0", + "array-slice": "0.2.3" + } + }, + "arr-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=" + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=" + }, + "extend-shallow": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", + "requires": { + "kind-of": "1.1.0" + } + }, + "kind-of": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=" + } + } + }, + "plugin-log": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/plugin-log/-/plugin-log-0.1.0.tgz", + "integrity": "sha1-hgSc9qsQgzOYqTHzaJy67nteEzM=", + "requires": { + "chalk": "1.1.3", + "dateformat": "1.0.12" + }, + "dependencies": { + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + } + } + }, + "pluralize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=" + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "posix-getopt": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/posix-getopt/-/posix-getopt-1.2.0.tgz", + "integrity": "sha1-Su7rfa3mb8qKk2XdqfawBXQctiE=" + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=" + }, + "proxy-addr": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", + "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.6.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.6" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "q": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.0.1.tgz", + "integrity": "sha1-EYcq7t7okmgRCxCnGESP+xARKhQ=" + }, + "qjobs": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==" + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=" + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" + }, + "quote-stream": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-1.0.2.tgz", + "integrity": "sha1-hJY/jJwmuULhU/7rU6rnRlK34LI=", + "requires": { + "buffer-equal": "0.0.1", + "minimist": "1.2.0", + "through2": "2.0.3" + } + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "2.0.6", + "safe-buffer": "5.1.1" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.5.0" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } + }, + "rcfinder": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/rcfinder/-/rcfinder-0.1.9.tgz", + "integrity": "sha1-8+gPOH3fmugK4wpBADKWQuroERU=", + "requires": { + "lodash.clonedeep": "4.5.0" + } + }, + "rcloader": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.2.2.tgz", + "integrity": "sha1-WNIpi0YtC5v9ITPSoex0+9cFxxc=", + "requires": { + "lodash.assign": "4.2.0", + "lodash.isobject": "3.0.2", + "lodash.merge": "4.6.1", + "rcfinder": "0.1.9" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "requires": { + "readable-stream": "2.3.6" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.6", + "set-immediate-shim": "1.0.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + } + } + }, + "readline2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "mute-stream": "0.0.5" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "1.6.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "reduce-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/reduce-component/-/reduce-component-1.0.1.tgz", + "integrity": "sha1-4Mk1QsV0UhvqE98PlIjtgqt3xdo=" + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "1.0.2" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=" + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.4.3", + "uuid": "3.2.1" + } + }, + "request-progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", + "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "requires": { + "throttleit": "1.0.0" + } + }, + "require-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/require-dir/-/require-dir-1.0.0.tgz", + "integrity": "sha512-PUJcQVTP4n6F8Un1GEEWhqnmBMfukVsL5gqwBxt7RF+nP+9hSOLJ/vSs5iUoXw1UWDgzqg9B/IIb15kfQKWsAQ==" + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "resolve": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", + "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "requires": { + "expand-tilde": "2.0.2", + "global-modules": "1.0.0" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "7.1.2" + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.1" + } + }, + "run-async": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "requires": { + "once": "1.4.0" + } + }, + "run-sequence": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/run-sequence/-/run-sequence-1.2.2.tgz", + "integrity": "sha1-UJWgvr6YczsBQL0I3YDsAw3azes=", + "requires": { + "chalk": "1.1.3", + "gulp-util": "3.0.8" + } + }, + "runnel": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/runnel/-/runnel-0.5.3.tgz", + "integrity": "sha1-+TYrFloF/G9eRuRY93offs3A2uw=" + }, + "rx-lite": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=" + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "0.1.15" + } + }, + "samsam": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.1.2.tgz", + "integrity": "sha1-vsEf3IOp/aBjQBIQ5AF2wwJNFWc=" + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=" + }, + "send": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/send/-/send-0.1.4.tgz", + "integrity": "sha1-vnDY0b4B3mGCGvE3gLUDRaT3Gr0=", + "requires": { + "debug": "2.6.9", + "fresh": "0.2.0", + "mime": "1.2.11", + "range-parser": "0.0.4" + }, + "dependencies": { + "mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=" + }, + "range-parser": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz", + "integrity": "sha1-wEJ//vUcEKy6B4KkbJYC50T/Ygs=" + } + } + }, + "sequence": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/sequence/-/sequence-2.2.1.tgz", + "integrity": "sha1-f1YXiV1ENRwKBH52RGdpBJChawM=" + }, + "sequencify": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", + "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=" + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.2" + }, + "dependencies": { + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.3", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.4.0" + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "2.0.1", + "safe-buffer": "5.1.1" + } + }, + "shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=" + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "requires": { + "json-stable-stringify": "0.0.1", + "sha.js": "2.4.11" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "shelljs": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz", + "integrity": "sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=" + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sinon": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-1.17.7.tgz", + "integrity": "sha1-RUKk9JugxFwF6y6d2dID4rjv4L8=", + "requires": { + "formatio": "1.1.1", + "lolex": "1.3.2", + "samsam": "1.1.2", + "util": "0.10.3" + } + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=" + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.1", + "use": "3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "requires": { + "hoek": "2.16.3" + } + }, + "socket.io": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.7.3.tgz", + "integrity": "sha1-uK+cq6AJSeVo42nxMn6pvp6iRhs=", + "requires": { + "debug": "2.3.3", + "engine.io": "1.8.3", + "has-binary": "0.1.7", + "object-assign": "4.1.0", + "socket.io-adapter": "0.5.0", + "socket.io-client": "1.7.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + }, + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=" + } + } + }, + "socket.io-adapter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", + "integrity": "sha1-y21LuL7IHhB4uZZ3+c7QBGBmu4s=", + "requires": { + "debug": "2.3.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + } + } + }, + "socket.io-client": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.7.3.tgz", + "integrity": "sha1-sw6GqhDV7zVGYBwJzeR2Xjgdo3c=", + "requires": { + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.3.3", + "engine.io-client": "1.8.3", + "has-binary": "0.1.7", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseuri": "0.0.5", + "socket.io-parser": "2.3.1", + "to-array": "0.1.4" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + } + } + }, + "socket.io-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", + "integrity": "sha1-3VMgJRA85Clpcya+/WQAX8/ltKA=", + "requires": { + "component-emitter": "1.1.2", + "debug": "2.2.0", + "isarray": "0.0.1", + "json3": "3.3.2" + }, + "dependencies": { + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + }, + "source-map-cjs": { + "version": "0.1.32", + "resolved": "https://registry.npmjs.org/source-map-cjs/-/source-map-cjs-0.1.32.tgz", + "integrity": "sha1-sRPwAGW0hPTToRI+8IQEalYijOc=" + }, + "source-map-resolve": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", + "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "requires": { + "atob": "2.1.0", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=" + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==" + }, + "split": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/split/-/split-0.1.2.tgz", + "integrity": "sha1-8HEHRMRT1VH8cUPq2YPaYBTjNsw=", + "requires": { + "through": "1.1.2" + }, + "dependencies": { + "through": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/through/-/through-1.1.2.tgz", + "integrity": "sha1-NEpUJaN3MxTKfg62US+6+vdsC/4=" + } + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "3.0.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sshpk": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "stack-mapper": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stack-mapper/-/stack-mapper-0.2.2.tgz", + "integrity": "sha1-eJApBUk3t9R8G1tnYSy7Hnz+cHE=", + "requires": { + "array-map": "0.0.0", + "foreach-shim": "0.1.1", + "isarray": "0.0.1", + "source-map-cjs": "0.1.32" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + } + } + }, + "stacktrace-js": { + "version": "http://github.com/defunctzombie/stacktrace.js/tarball/07e7b9516f1449f5c209e4f67f11a43f738c1712", + "integrity": "sha512-83HwNyHv1Yjt2MfgjTndX7CpGWZ47E6JMN/naowOmjYpu8EmjXDyrpz69OmubqEqA3LYl/Z84cmNs1TVusumWQ==" + }, + "static-eval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.0.tgz", + "integrity": "sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw==", + "requires": { + "escodegen": "1.9.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "static-module": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/static-module/-/static-module-2.2.3.tgz", + "integrity": "sha512-OdNOIoJGjYH2OW9KZoGg4RfiBmtKkGijUFTH8w9oCRe8Q+CfVUuY/nlPZmqdsCFWMz2Ho0euzaJA/a6pUpCmZA==", + "requires": { + "concat-stream": "1.6.2", + "convert-source-map": "1.5.1", + "duplexer2": "0.1.4", + "escodegen": "1.9.1", + "falafel": "2.1.0", + "has": "1.0.1", + "magic-string": "0.22.5", + "merge-source-map": "1.0.4", + "object-inspect": "1.4.1", + "quote-stream": "1.0.2", + "readable-stream": "2.3.6", + "shallow-copy": "0.0.1", + "static-eval": "2.0.0", + "through2": "2.0.3" + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "requires": { + "inherits": "2.0.1", + "readable-stream": "2.3.6" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "requires": { + "duplexer2": "0.1.4", + "readable-stream": "2.3.6" + } + }, + "stream-consume": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.1.tgz", + "integrity": "sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg==" + }, + "stream-counter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz", + "integrity": "sha1-3tJmVWMZyLDiIoErnPOyb6fZR94=", + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "stream-http": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz", + "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==", + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.1", + "readable-stream": "2.3.6", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + } + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "requires": { + "inherits": "2.0.1", + "readable-stream": "2.3.6" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", + "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", + "requires": { + "first-chunk-stream": "1.0.0", + "is-utf8": "0.2.1" + } + }, + "strip-bom-buf": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", + "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-bom-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-3.0.0.tgz", + "integrity": "sha1-lWvMXYRDD2klapDtgjdlzYWOFZw=", + "requires": { + "first-chunk-stream": "2.0.0", + "strip-bom-buf": "1.0.0" + }, + "dependencies": { + "first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", + "requires": { + "readable-stream": "2.3.6" + } + } + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=" + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "requires": { + "minimist": "1.2.0" + } + }, + "superagent": { + "version": "0.15.7", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-0.15.7.tgz", + "integrity": "sha1-CVxwuK//vAcvFFjzloTUhU1jM6M=", + "requires": { + "cookiejar": "1.3.0", + "debug": "0.7.4", + "emitter-component": "1.0.0", + "formidable": "1.0.14", + "methods": "0.0.1", + "mime": "1.2.5", + "qs": "0.6.5", + "reduce-component": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", + "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=" + }, + "methods": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz", + "integrity": "sha1-J3yQ+L7zlwlkWoNxxRw7bGSOBow=" + }, + "mime": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.5.tgz", + "integrity": "sha1-nu0HMCKov14WyFZsaGe4gyv7+hM=" + }, + "qs": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.5.tgz", + "integrity": "sha1-KUsmjksNQlD23eGbO4s0k13/FO8=" + } + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "requires": { + "acorn-node": "1.3.0" + } + }, + "table": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "requires": { + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.4", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "0.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "tap-finished": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", + "integrity": "sha1-CLW1Q/3ASDApDGxWEnlVLnHEvWc=", + "requires": { + "tap-parser": "0.2.1", + "through": "2.3.8" + }, + "dependencies": { + "tap-parser": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", + "integrity": "sha1-jh6CPyEU7iHQMuLzHk+2QqKW9Qs=", + "requires": { + "split": "0.1.2" + } + } + } + }, + "tap-parser": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.7.0.tgz", + "integrity": "sha1-coph1kaApbSNXb2dvQpNSPXDW8s=", + "requires": { + "inherits": "2.0.1", + "minimist": "0.2.0", + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "minimist": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz", + "integrity": "sha1-Tf/lJdriuGTGbC4jxicdev3s784=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "tar-stream": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", + "integrity": "sha1-vpIYwTDCACnhB7D5Z/sj3gV50Tw=", + "requires": { + "bl": "0.9.5", + "end-of-stream": "1.4.1", + "readable-stream": "1.0.34", + "xtend": "4.0.1" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, + "throttleit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, + "tildify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", + "requires": { + "os-homedir": "1.0.2" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=" + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "requires": { + "process": "0.11.10" + } + }, + "tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "1.4.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==" + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=" + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.18" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "typhonjs-ast-walker": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/typhonjs-ast-walker/-/typhonjs-ast-walker-0.1.1.tgz", + "integrity": "sha1-gUVUptrSnhyyy2K8io6GwXTBaOM=" + }, + "typhonjs-escomplex": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/typhonjs-escomplex/-/typhonjs-escomplex-0.0.9.tgz", + "integrity": "sha1-1Phd0oOOeiioVNnyVhbLxyo/Dg8=", + "requires": { + "babylon": "6.18.0", + "commander": "2.15.1", + "typhonjs-escomplex-module": "0.0.9", + "typhonjs-escomplex-project": "0.0.9" + } + }, + "typhonjs-escomplex-commons": { + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/typhonjs-escomplex-commons/-/typhonjs-escomplex-commons-0.0.14.tgz", + "integrity": "sha1-V643xFegv6LSRHroJj4CKOK6wco=" + }, + "typhonjs-escomplex-module": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/typhonjs-escomplex-module/-/typhonjs-escomplex-module-0.0.9.tgz", + "integrity": "sha1-31vDYLJg/zbi1pvFu0O3PvPzNlw=", + "requires": { + "escomplex-plugin-metrics-module": "0.0.10", + "escomplex-plugin-syntax-babylon": "0.0.10", + "typhonjs-ast-walker": "0.1.1", + "typhonjs-escomplex-commons": "0.0.14", + "typhonjs-plugin-manager": "0.0.3" + } + }, + "typhonjs-escomplex-project": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/typhonjs-escomplex-project/-/typhonjs-escomplex-project-0.0.9.tgz", + "integrity": "sha1-C6bwzDq6hiwjqXGpCa6rQR6+G/Q=", + "requires": { + "escomplex-plugin-metrics-project": "0.0.10", + "typhonjs-escomplex-commons": "0.0.14", + "typhonjs-escomplex-module": "0.0.9", + "typhonjs-plugin-manager": "0.0.3" + } + }, + "typhonjs-plugin-manager": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/typhonjs-plugin-manager/-/typhonjs-plugin-manager-0.0.3.tgz", + "integrity": "sha1-hN1eHQG0QRm95JPqZW3O+JJVq4Q=" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "uglify-save-license": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/uglify-save-license/-/uglify-save-license-0.4.1.tgz", + "integrity": "sha1-lXJsF8xv0XHDYX479NjYKqjEzOE=" + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=" + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==" + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" + }, + "underscore": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" + }, + "underscore.string": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "unique-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", + "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + } + } + }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "requires": { + "kind-of": "6.0.2" + } + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=" + }, + "useragent": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", + "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", + "requires": { + "lru-cache": "4.1.2", + "tmp": "0.0.31" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", + "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + } + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "requires": { + "inherits": "2.0.1" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "requires": { + "user-home": "1.1.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "vargs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", + "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=" + }, + "vary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz", + "integrity": "sha1-meSYFWaihhGN+yuBc1ffeZM3bRA=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "requires": { + "clone": "1.0.4", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", + "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", + "requires": { + "defaults": "1.0.3", + "glob-stream": "3.1.18", + "glob-watcher": "0.0.6", + "graceful-fs": "3.0.11", + "mkdirp": "0.5.1", + "strip-bom": "1.0.0", + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "clone": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", + "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", + "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + } + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "requires": { + "source-map": "0.5.7" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==" + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "requires": { + "indexof": "0.0.1" + } + }, + "void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" + }, + "walk": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.2.1.tgz", + "integrity": "sha1-WtofjknkfUt0Rdi+ei4eYxq0MBY=", + "requires": { + "forEachAsync": "2.2.1" + } + }, + "watchify": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.7.0.tgz", + "integrity": "sha1-7i8sXIw3MSMD+Zi4GLKzRQ7v5kg=", + "requires": { + "anymatch": "1.3.2", + "browserify": "13.3.0", + "chokidar": "1.7.0", + "defined": "1.0.0", + "outpipe": "1.1.1", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "wd": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/wd/-/wd-0.3.11.tgz", + "integrity": "sha1-UicWx5p6EOeBrLssbK/liPcB/MA=", + "requires": { + "archiver": "0.12.0", + "async": "0.9.2", + "lodash": "2.4.2", + "q": "1.0.1", + "request": "2.46.0", + "underscore.string": "2.3.3", + "vargs": "0.1.0" + }, + "dependencies": { + "archiver": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.12.0.tgz", + "integrity": "sha1-uMzeJQjKuQkrtxBmMBOcDzmigMw=", + "requires": { + "async": "0.9.2", + "buffer-crc32": "0.2.1", + "glob": "4.0.6", + "lazystream": "0.1.0", + "lodash": "2.4.2", + "readable-stream": "1.0.34", + "tar-stream": "1.0.2", + "zip-stream": "0.4.1" + } + }, + "asn1": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=" + }, + "assert-plus": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=" + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "aws-sign2": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=" + }, + "boom": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", + "requires": { + "hoek": "0.9.1" + } + }, + "caseless": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz", + "integrity": "sha1-gWfBq4OX+1u5X5bSjlqBxQ8kesQ=" + }, + "combined-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "requires": { + "delayed-stream": "0.0.5" + } + }, + "compress-commons": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.1.6.tgz", + "integrity": "sha1-DHQIcP3ljLpRbwrAyCLjOguF36M=", + "requires": { + "buffer-crc32": "0.2.1", + "crc32-stream": "0.3.4", + "readable-stream": "1.0.34" + } + }, + "cryptiles": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", + "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", + "requires": { + "boom": "0.4.2" + } + }, + "delayed-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "forever-agent": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", + "integrity": "sha1-bQ4JxJIflKJ/Y9O0nF/v8epMUTA=" + }, + "form-data": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", + "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", + "requires": { + "async": "0.9.2", + "combined-stream": "0.0.7", + "mime": "1.2.11" + } + }, + "glob": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", + "integrity": "sha1-aVxQvdTi+1xdNwsJHziNNwfikac=", + "requires": { + "graceful-fs": "3.0.11", + "inherits": "2.0.1", + "minimatch": "1.0.0", + "once": "1.4.0" + } + }, + "hawk": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", + "integrity": "sha1-h81JH5tG5OKurKM1QWdmiF0tHtk=", + "requires": { + "boom": "0.4.2", + "cryptiles": "0.2.2", + "hoek": "0.9.1", + "sntp": "0.2.4" + } + }, + "hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=" + }, + "http-signature": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", + "requires": { + "asn1": "0.1.11", + "assert-plus": "0.1.5", + "ctype": "0.5.3" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + }, + "mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=" + }, + "mime-types": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz", + "integrity": "sha1-mVrhOSq4r/y/yyZB3QVOlDwNXc4=" + }, + "minimatch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", + "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=" + }, + "oauth-sign": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz", + "integrity": "sha1-8ilW8x6nFRqCHl8vsywRPK2Ln2k=" + }, + "qs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", + "integrity": "sha1-GbV/8k3CqZzh+L32r82ln472H4g=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "request": { + "version": "2.46.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.46.0.tgz", + "integrity": "sha1-NZGV1S6vcgvGl0JXnQStbSZagnQ=", + "requires": { + "aws-sign2": "0.5.0", + "bl": "0.9.5", + "caseless": "0.6.0", + "forever-agent": "0.5.2", + "form-data": "0.1.4", + "hawk": "1.1.1", + "http-signature": "0.10.1", + "json-stringify-safe": "5.0.1", + "mime-types": "1.0.2", + "node-uuid": "1.4.8", + "oauth-sign": "0.4.0", + "qs": "1.2.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.4.3" + } + }, + "sntp": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", + "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", + "requires": { + "hoek": "0.9.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "tar-stream": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.0.2.tgz", + "integrity": "sha1-/Rm0oXkA+nBPahM+MEWurQViq5U=", + "requires": { + "bl": "0.9.5", + "end-of-stream": "1.4.1", + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "zip-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.4.1.tgz", + "integrity": "sha1-TqeVqM4Z6fq0mjHR0IdyFBWfA6M=", + "requires": { + "compress-commons": "0.1.6", + "lodash": "2.4.2", + "readable-stream": "1.0.34" + } + } + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "wrench": { + "version": "1.5.9", + "resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.9.tgz", + "integrity": "sha1-QRaRxjqbJTGxcAJnJ5veyiOyFCo=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "requires": { + "mkdirp": "0.5.1" + } + }, + "ws": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", + "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", + "requires": { + "options": "0.0.6", + "ultron": "1.0.2" + } + }, + "wtf-8": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", + "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=" + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": "1.2.4", + "xmlbuilder": "9.0.7" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + }, + "xmlhttprequest-ssl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", + "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yamljs": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.1.4.tgz", + "integrity": "sha1-ZleJr8KtS5Ar9APwDoW2Q04PMwA=", + "requires": { + "argparse": "0.1.16", + "glob": "3.1.21" + }, + "dependencies": { + "argparse": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", + "requires": { + "underscore": "1.7.0", + "underscore.string": "2.4.0" + } + }, + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + }, + "underscore.string": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs=" + } + } + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + } + } + }, + "yauzl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "requires": { + "fd-slicer": "1.0.1" + } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" + }, + "zip-stream": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.2.3.tgz", + "integrity": "sha1-rvCVN2z+E4lZqBNBmB0mM4tG2NM=", + "requires": { + "debug": "0.7.4", + "lodash.defaults": "2.4.1", + "readable-stream": "1.0.34" + }, + "dependencies": { + "debug": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", + "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "zuul": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/zuul/-/zuul-3.11.1.tgz", + "integrity": "sha1-cIC7vyKm2X9gh5s7jyqCPFqZurI=", + "requires": { + "JSON2": "0.1.0", + "batch": "0.5.0", + "browserify": "13.0.0", + "browserify-istanbul": "0.1.5", + "char-split": "0.2.0", + "colors": "0.6.2", + "commander": "2.1.0", + "compression": "1.5.0", + "convert-source-map": "1.0.0", + "debug": "2.1.0", + "express": "3.4.8", + "express-state": "1.0.3", + "find-nearest-file": "1.0.0", + "firefox-profile": "0.2.7", + "globs-to-files": "1.0.0", + "hbs": "2.4.0", + "highlight.js": "7.5.0", + "http-proxy": "1.11.2", + "humanize-duration": "2.4.0", + "istanbul-middleware": "0.2.2", + "load-script": "0.0.5", + "lodash": "3.10.1", + "opener": "1.4.0", + "osenv": "0.0.3", + "shallow-copy": "0.0.1", + "shell-quote": "1.4.1", + "stack-mapper": "0.2.2", + "stacktrace-js": "http://github.com/defunctzombie/stacktrace.js/tarball/07e7b9516f1449f5c209e4f67f11a43f738c1712", + "superagent": "0.15.7", + "tap-finished": "0.0.1", + "tap-parser": "0.7.0", + "watchify": "3.7.0", + "wd": "0.3.11", + "xtend": "2.1.2", + "yamljs": "0.1.4", + "zuul-localtunnel": "1.1.0" + }, + "dependencies": { + "assert": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.3.0.tgz", + "integrity": "sha1-A5OaYiWCqBLMICMgoLmlbJuBWEk=", + "requires": { + "util": "0.10.3" + } + }, + "browserify": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.0.0.tgz", + "integrity": "sha1-jyI7sk/07kM15r6pZx3ilOQ7pqM=", + "requires": { + "JSONStream": "1.3.2", + "assert": "1.3.0", + "browser-pack": "6.1.0", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "5.0.15", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "0.0.1", + "inherits": "2.0.1", + "insert-module-globals": "7.0.5", + "isarray": "0.0.1", + "labeled-stream-splicer": "2.0.1", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.6", + "resolve": "1.6.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.8.1", + "string_decoder": "0.10.31", + "subarg": "1.0.0", + "syntax-error": "1.4.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.1", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" + }, + "dependencies": { + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=" + }, + "commander": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=" + }, + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "requires": { + "inherits": "2.0.1", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + } + } + }, + "convert-source-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.0.0.tgz", + "integrity": "sha1-29y2lSPTr1gve1yUs8Jezy87c1U=" + }, + "debug": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.1.0.tgz", + "integrity": "sha1-M6uRVlnYwsyKQUQ9lNbr03aX7SE=", + "requires": { + "ms": "0.6.2" + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "http-proxy": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.11.2.tgz", + "integrity": "sha1-xQ0vsG7KedQjjmb9lDk9LkHmN0A=", + "requires": { + "eventemitter3": "1.2.0", + "requires-port": "0.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" + }, + "ms": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz", + "integrity": "sha1-2JwhJMb9wTU9Zai3e/GqxLGTcIw=" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "requires-port": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-0.0.1.tgz", + "integrity": "sha1-S0QUQR2d98hVmV3YmajHiilRwW0=" + }, + "shell-quote": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.4.1.tgz", + "integrity": "sha1-rhhEK1NqCMcgI5sHnS8iisvt7kA=", + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "0.4.0" + } + } + } + }, + "zuul-localtunnel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/zuul-localtunnel/-/zuul-localtunnel-1.1.0.tgz", + "integrity": "sha1-cK0n+wpq+WiiFR/F1eiV2qGu0V0=", + "requires": { + "localtunnel": "1.5.0" + } + } + } +} diff --git a/packages/kauri-bitcore-lib/package.json b/packages/kauri-bitcore-lib/package.json new file mode 100644 index 0000000..76bd10f --- /dev/null +++ b/packages/kauri-bitcore-lib/package.json @@ -0,0 +1,52 @@ +{ + "name": "kauri-bitcore-lib", + "version": "0.1.0", + "description": "A pure and powerful JavaScript cryptocurrency library heavily based on bitcore-lib", + "author": "Encrypt-S ", + "main": "index.js", + "scripts": { + "lint": "gulp lint", + "test": "gulp test", + "coverage": "gulp coverage", + "build": "gulp" + }, + "keywords": [ + "bitcoin", + "transaction", + "address", + "p2p", + "ecies", + "cryptocurrency", + "blockchain", + "payment", + "bip21", + "bip32", + "bip37", + "bip69", + "bip70", + "multisig" + ], + "repository": { + "type": "git", + "url": "https://github.com/encrypt-s/kauri-wallet.git" + }, + "browser": { + "request": "browser-request" + }, + "dependencies": { + "bn.js": "=4.11.8", + "bs58": "=4.0.1", + "buffer-compare": "=1.1.1", + "elliptic": "=6.4.0", + "inherits": "=2.0.1", + "lodash": "=4.17.4" + }, + "devDependencies": { + "bitcore-build": "https://github.com/bitpay/bitcore-build.git#d4e8b2b2f1e2c065c3a807dcb6a6250f61d67ab3", + "brfs": "^1.2.0", + "chai": "^1.10.0", + "gulp": "^3.8.10", + "sinon": "^1.13.0" + }, + "license": "MIT" +} diff --git a/packages/kauri-bitcore-lib/test/address.js b/packages/kauri-bitcore-lib/test/address.js new file mode 100644 index 0000000..feb5cab --- /dev/null +++ b/packages/kauri-bitcore-lib/test/address.js @@ -0,0 +1,572 @@ +'use strict'; + +/* jshint maxstatements: 30 */ + +var chai = require('chai'); +var should = chai.should(); +var expect = chai.expect; + +var bitcore = require('..'); +var PublicKey = bitcore.PublicKey; +var Address = bitcore.Address; +var Script = bitcore.Script; +var Networks = bitcore.Networks; + +var validbase58 = require('./data/bitcoind/base58_keys_valid.json'); +var invalidbase58 = require('./data/bitcoind/base58_keys_invalid.json'); + +describe('Address', function() { + + var pubkeyhash = new Buffer('3c3fa3d4adcaf8f52d5b1843975e122548269937', 'hex'); + var buf = Buffer.concat([new Buffer([0]), pubkeyhash]); + var str = '16VZnHwRhwrExfeHFHGjwrgEMq8VcYPs9r'; + + it('can\'t build without data', function() { + (function() { + return new Address(); + }).should.throw('First argument is required, please include address data.'); + }); + + it('should throw an error because of bad network param', function() { + (function() { + return new Address(PKHLivenet[0], 'main', 'pubkeyhash'); + }).should.throw('Second argument must be "livenet" or "testnet".'); + }); + + it('should throw an error because of bad type param', function() { + (function() { + return new Address(PKHLivenet[0], 'livenet', 'pubkey'); + }).should.throw('Third argument must be "pubkeyhash" or "scripthash"'); + }); + + describe('bitcoind compliance', function() { + validbase58.map(function(d) { + if (!d[2].isPrivkey) { + it('should describe address ' + d[0] + ' as valid', function() { + var type; + if (d[2].addrType === 'script') { + type = 'scripthash'; + } else if (d[2].addrType === 'pubkey') { + type = 'pubkeyhash'; + } + var network = 'livenet'; + if (d[2].isTestnet) { + network = 'testnet'; + } + return new Address(d[0], network, type); + }); + } + }); + invalidbase58.map(function(d) { + it('should describe input ' + d[0].slice(0, 10) + '... as invalid', function() { + expect(function() { + return new Address(d[0]); + }).to.throw(Error); + }); + }); + }); + + // livenet valid + var PKHLivenet = [ + '15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', + '1A6ut1tWnUq1SEQLMr4ttDh24wcbJ5o9TT', + '1BpbpfLdY7oBS9gK7aDXgvMgr1DPvNhEB2', + '1Jz2yCRd5ST1p2gUqFB5wsSQfdm3jaFfg7', + ' 1Jz2yCRd5ST1p2gUqFB5wsSQfdm3jaFfg7 \t\n' + ]; + + // livenet p2sh + var P2SHLivenet = [ + '342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey', + '33vt8ViH5jsr115AGkW6cEmEz9MpvJSwDk', + '37Sp6Rv3y4kVd1nQ1JV5pfqXccHNyZm1x3', + '3QjYXhTkvuj8qPaXHTTWb5wjXhdsLAAWVy', + '\t \n3QjYXhTkvuj8qPaXHTTWb5wjXhdsLAAWVy \r' + ]; + + // testnet p2sh + var P2SHTestnet = [ + '2N7FuwuUuoTBrDFdrAZ9KxBmtqMLxce9i1C', + '2NEWDzHWwY5ZZp8CQWbB7ouNMLqCia6YRda', + '2MxgPqX1iThW3oZVk9KoFcE5M4JpiETssVN', + '2NB72XtkjpnATMggui83aEtPawyyKvnbX2o' + ]; + + //livenet bad checksums + var badChecksums = [ + '15vkcKf7gB23wLAnZLmbVuMiiVDc3nq4a2', + '1A6ut1tWnUq1SEQLMr4ttDh24wcbj4w2TT', + '1BpbpfLdY7oBS9gK7aDXgvMgr1DpvNH3B2', + '1Jz2yCRd5ST1p2gUqFB5wsSQfdmEJaffg7' + ]; + + //livenet non-base58 + var nonBase58 = [ + '15vkcKf7g#23wLAnZLmb$uMiiVDc3nq4a2', + '1A601ttWnUq1SEQLMr4ttDh24wcbj4w2TT', + '1BpbpfLdY7oBS9gK7aIXgvMgr1DpvNH3B2', + '1Jz2yCRdOST1p2gUqFB5wsSQfdmEJaffg7' + ]; + + //testnet valid + var PKHTestnet = [ + 'n28S35tqEMbt6vNad7A5K3mZ7vdn8dZ86X', + 'n45x3R2w2jaSC62BMa9MeJCd3TXxgvDEmm', + 'mursDVxqNQmmwWHACpM9VHwVVSfTddGsEM', + 'mtX8nPZZdJ8d3QNLRJ1oJTiEi26Sj6LQXS' + ]; + + describe('validation', function() { + + it('getValidationError detects network mismatchs', function() { + var error = Address.getValidationError('37BahqRsFrAd3qLiNNwLNV3AWMRD7itxTo', 'testnet'); + should.exist(error); + }); + + it('isValid returns true on a valid address', function() { + var valid = Address.isValid('37BahqRsFrAd3qLiNNwLNV3AWMRD7itxTo', 'livenet'); + valid.should.equal(true); + }); + + it('isValid returns false on network mismatch', function() { + var valid = Address.isValid('37BahqRsFrAd3qLiNNwLNV3AWMRD7itxTo', 'testnet'); + valid.should.equal(false); + }); + + it('validates correctly the P2PKH test vector', function() { + for (var i = 0; i < PKHLivenet.length; i++) { + var error = Address.getValidationError(PKHLivenet[i]); + should.not.exist(error); + } + }); + + it('validates correctly the P2SH test vector', function() { + for (var i = 0; i < P2SHLivenet.length; i++) { + var error = Address.getValidationError(P2SHLivenet[i]); + should.not.exist(error); + } + }); + + it('validates correctly the P2SH testnet test vector', function() { + for (var i = 0; i < P2SHTestnet.length; i++) { + var error = Address.getValidationError(P2SHTestnet[i], 'testnet'); + should.not.exist(error); + } + }); + + it('rejects correctly the P2PKH livenet test vector with "testnet" parameter', function() { + for (var i = 0; i < PKHLivenet.length; i++) { + var error = Address.getValidationError(PKHLivenet[i], 'testnet'); + should.exist(error); + } + }); + + it('validates correctly the P2PKH livenet test vector with "livenet" parameter', function() { + for (var i = 0; i < PKHLivenet.length; i++) { + var error = Address.getValidationError(PKHLivenet[i], 'livenet'); + should.not.exist(error); + } + }); + + it('should not validate if checksum is invalid', function() { + for (var i = 0; i < badChecksums.length; i++) { + var error = Address.getValidationError(badChecksums[i], 'livenet', 'pubkeyhash'); + should.exist(error); + error.message.should.equal('Checksum mismatch'); + } + }); + + it('should not validate on a network mismatch', function() { + var error, i; + for (i = 0; i < PKHLivenet.length; i++) { + error = Address.getValidationError(PKHLivenet[i], 'testnet', 'pubkeyhash'); + should.exist(error); + error.message.should.equal('Address has mismatched network type.'); + } + for (i = 0; i < PKHTestnet.length; i++) { + error = Address.getValidationError(PKHTestnet[i], 'livenet', 'pubkeyhash'); + should.exist(error); + error.message.should.equal('Address has mismatched network type.'); + } + }); + + it('should not validate on a type mismatch', function() { + for (var i = 0; i < PKHLivenet.length; i++) { + var error = Address.getValidationError(PKHLivenet[i], 'livenet', 'scripthash'); + should.exist(error); + error.message.should.equal('Address has mismatched type.'); + } + }); + + it('should not validate on non-base58 characters', function() { + for (var i = 0; i < nonBase58.length; i++) { + var error = Address.getValidationError(nonBase58[i], 'livenet', 'pubkeyhash'); + should.exist(error); + error.message.should.equal('Non-base58 character'); + } + }); + + it('testnet addresses are validated correctly', function() { + for (var i = 0; i < PKHTestnet.length; i++) { + var error = Address.getValidationError(PKHTestnet[i], 'testnet'); + should.not.exist(error); + } + }); + + it('addresses with whitespace are validated correctly', function() { + var ws = ' \r \t \n 1A6ut1tWnUq1SEQLMr4ttDh24wcbJ5o9TT \t \n \r'; + var error = Address.getValidationError(ws); + should.not.exist(error); + Address.fromString(ws).toString().should.equal('1A6ut1tWnUq1SEQLMr4ttDh24wcbJ5o9TT'); + }); + }); + + describe('instantiation', function() { + it('can be instantiated from another address', function() { + var address = Address.fromBuffer(buf); + var address2 = new Address({ + hashBuffer: address.hashBuffer, + network: address.network, + type: address.type + }); + address.toString().should.equal(address2.toString()); + }); + }); + + describe('encodings', function() { + + it('should make an address from a buffer', function() { + Address.fromBuffer(buf).toString().should.equal(str); + new Address(buf).toString().should.equal(str); + new Address(buf).toString().should.equal(str); + }); + + it('should make an address from a string', function() { + Address.fromString(str).toString().should.equal(str); + new Address(str).toString().should.equal(str); + }); + + it('should make an address using a non-string network', function() { + Address.fromString(str, Networks.livenet).toString().should.equal(str); + }); + + it('should throw with bad network param', function() { + (function(){ + Address.fromString(str, 'somenet'); + }).should.throw('Unknown network'); + }); + + it('should error because of unrecognized data format', function() { + (function() { + return new Address(new Error()); + }).should.throw(bitcore.errors.InvalidArgument); + }); + + it('should error because of incorrect format for pubkey hash', function() { + (function() { + return new Address.fromPublicKeyHash('notahash'); + }).should.throw('Address supplied is not a buffer.'); + }); + + it('should error because of incorrect format for script hash', function() { + (function() { + return new Address.fromScriptHash('notascript'); + }).should.throw('Address supplied is not a buffer.'); + }); + + it('should error because of incorrect type for transform buffer', function() { + (function() { + return Address._transformBuffer('notabuffer'); + }).should.throw('Address supplied is not a buffer.'); + }); + + it('should error because of incorrect length buffer for transform buffer', function() { + (function() { + return Address._transformBuffer(new Buffer(20)); + }).should.throw('Address buffers must be exactly 21 bytes.'); + }); + + it('should error because of incorrect type for pubkey transform', function() { + (function() { + return Address._transformPublicKey(new Buffer(20)); + }).should.throw('Address must be an instance of PublicKey.'); + }); + + it('should error because of incorrect type for script transform', function() { + (function() { + return Address._transformScript(new Buffer(20)); + }).should.throw('Invalid Argument: script must be a Script instance'); + }); + + it('should error because of incorrect type for string transform', function() { + (function() { + return Address._transformString(new Buffer(20)); + }).should.throw('data parameter supplied is not a string.'); + }); + + it('should make an address from a pubkey hash buffer', function() { + var hash = pubkeyhash; //use the same hash + var a = Address.fromPublicKeyHash(hash, 'livenet'); + a.network.should.equal(Networks.livenet); + a.toString().should.equal(str); + var b = Address.fromPublicKeyHash(hash, 'testnet'); + b.network.should.equal(Networks.testnet); + b.type.should.equal('pubkeyhash'); + new Address(hash, 'livenet').toString().should.equal(str); + }); + + it('should make an address using the default network', function() { + var hash = pubkeyhash; //use the same hash + var network = Networks.defaultNetwork; + Networks.defaultNetwork = Networks.livenet; + var a = Address.fromPublicKeyHash(hash); + a.network.should.equal(Networks.livenet); + // change the default + Networks.defaultNetwork = Networks.testnet; + var b = Address.fromPublicKeyHash(hash); + b.network.should.equal(Networks.testnet); + // restore the default + Networks.defaultNetwork = network; + }); + + it('should throw an error for invalid length hashBuffer', function() { + (function() { + return Address.fromPublicKeyHash(buf); + }).should.throw('Address hashbuffers must be exactly 20 bytes.'); + }); + + it('should make this address from a compressed pubkey', function() { + var pubkey = new PublicKey('0285e9737a74c30a873f74df05124f2aa6f53042c2fc0a130d6cbd7d16b944b004'); + var address = Address.fromPublicKey(pubkey, 'livenet'); + address.toString().should.equal('19gH5uhqY6DKrtkU66PsZPUZdzTd11Y7ke'); + }); + + it('should use the default network for pubkey', function() { + var pubkey = new PublicKey('0285e9737a74c30a873f74df05124f2aa6f53042c2fc0a130d6cbd7d16b944b004'); + var address = Address.fromPublicKey(pubkey); + address.network.should.equal(Networks.defaultNetwork); + }); + + it('should make this address from an uncompressed pubkey', function() { + var pubkey = new PublicKey('0485e9737a74c30a873f74df05124f2aa6f53042c2fc0a130d6cbd7d16b944b00' + + '4833fef26c8be4c4823754869ff4e46755b85d851077771c220e2610496a29d98'); + var a = Address.fromPublicKey(pubkey, 'livenet'); + a.toString().should.equal('16JXnhxjJUhxfyx4y6H4sFcxrgt8kQ8ewX'); + var b = new Address(pubkey, 'livenet', 'pubkeyhash'); + b.toString().should.equal('16JXnhxjJUhxfyx4y6H4sFcxrgt8kQ8ewX'); + }); + + it('should classify from a custom network', function() { + var custom = { + name: 'customnetwork', + pubkeyhash: 0x1c, + privatekey: 0x1e, + scripthash: 0x28, + xpubkey: 0x02e8de8f, + xprivkey: 0x02e8da54, + networkMagic: 0x0c110907, + port: 7333 + }; + var addressString = 'CX4WePxBwq1Y6u7VyMJfmmitE7GiTgC9aE'; + Networks.add(custom); + var network = Networks.get('customnetwork'); + var address = Address.fromString(addressString); + address.type.should.equal(Address.PayToPublicKeyHash); + address.network.should.equal(network); + Networks.remove(network); + }); + + describe('from a script', function() { + it('should fail to build address from a non p2sh,p2pkh script', function() { + var s = new Script('OP_CHECKMULTISIG'); + (function() { + return new Address(s); + }).should.throw('needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out'); + }); + it('should make this address from a p2pkh output script', function() { + var s = new Script('OP_DUP OP_HASH160 20 ' + + '0xc8e11b0eb0d2ad5362d894f048908341fa61b6e1 OP_EQUALVERIFY OP_CHECKSIG'); + var buf = s.toBuffer(); + var a = Address.fromScript(s, 'livenet'); + a.toString().should.equal('1KK9oz4bFH8c1t6LmighHaoSEGx3P3FEmc'); + var b = new Address(s, 'livenet'); + b.toString().should.equal('1KK9oz4bFH8c1t6LmighHaoSEGx3P3FEmc'); + }); + + it('should make this address from a p2sh input script', function() { + var s = Script.fromString('OP_HASH160 20 0xa6ed4af315271e657ee307828f54a4365fa5d20f OP_EQUAL'); + var a = Address.fromScript(s, 'livenet'); + a.toString().should.equal('3GueMn6ruWVfQTN4XKBGEbCbGLwRSUhfnS'); + var b = new Address(s, 'livenet'); + b.toString().should.equal('3GueMn6ruWVfQTN4XKBGEbCbGLwRSUhfnS'); + }); + + it('returns the same address if the script is a pay to public key hash out', function() { + var address = '16JXnhxjJUhxfyx4y6H4sFcxrgt8kQ8ewX'; + var script = Script.buildPublicKeyHashOut(new Address(address)); + Address(script, Networks.livenet).toString().should.equal(address); + }); + it('returns the same address if the script is a pay to script hash out', function() { + var address = '3BYmEwgV2vANrmfRymr1mFnHXgLjD6gAWm'; + var script = Script.buildScriptHashOut(new Address(address)); + Address(script, Networks.livenet).toString().should.equal(address); + }); + }); + + it('should derive from this known address string livenet', function() { + var address = new Address(str); + var buffer = address.toBuffer(); + var slice = buffer.slice(1); + var sliceString = slice.toString('hex'); + sliceString.should.equal(pubkeyhash.toString('hex')); + }); + + it('should derive from this known address string testnet', function() { + var a = new Address(PKHTestnet[0], 'testnet'); + var b = new Address(a.toString()); + b.toString().should.equal(PKHTestnet[0]); + b.network.should.equal(Networks.testnet); + }); + + it('should derive from this known address string livenet scripthash', function() { + var a = new Address(P2SHLivenet[0], 'livenet', 'scripthash'); + var b = new Address(a.toString()); + b.toString().should.equal(P2SHLivenet[0]); + }); + + it('should derive from this known address string testnet scripthash', function() { + var address = new Address(P2SHTestnet[0], 'testnet', 'scripthash'); + address = new Address(address.toString()); + address.toString().should.equal(P2SHTestnet[0]); + }); + + }); + + describe('#toBuffer', function() { + + it('3c3fa3d4adcaf8f52d5b1843975e122548269937 corresponds to hash 16VZnHwRhwrExfeHFHGjwrgEMq8VcYPs9r', function() { + var address = new Address(str); + address.toBuffer().slice(1).toString('hex').should.equal(pubkeyhash.toString('hex')); + }); + + }); + + describe('#object', function() { + + it('roundtrip to-from-to', function() { + var obj = new Address(str).toObject(); + var address = Address.fromObject(obj); + address.toString().should.equal(str); + }); + + it('will fail with invalid state', function() { + expect(function() { + return Address.fromObject('¹'); + }).to.throw(bitcore.errors.InvalidState); + }); + }); + + describe('#toString', function() { + + it('livenet pubkeyhash address', function() { + var address = new Address(str); + address.toString().should.equal(str); + }); + + it('scripthash address', function() { + var address = new Address(P2SHLivenet[0]); + address.toString().should.equal(P2SHLivenet[0]); + }); + + it('testnet scripthash address', function() { + var address = new Address(P2SHTestnet[0]); + address.toString().should.equal(P2SHTestnet[0]); + }); + + it('testnet pubkeyhash address', function() { + var address = new Address(PKHTestnet[0]); + address.toString().should.equal(PKHTestnet[0]); + }); + + }); + + describe('#inspect', function() { + it('should output formatted output correctly', function() { + var address = new Address(str); + var output = ''; + address.inspect().should.equal(output); + }); + }); + + describe('questions about the address', function() { + it('should detect a P2SH address', function() { + new Address(P2SHLivenet[0]).isPayToScriptHash().should.equal(true); + new Address(P2SHLivenet[0]).isPayToPublicKeyHash().should.equal(false); + new Address(P2SHTestnet[0]).isPayToScriptHash().should.equal(true); + new Address(P2SHTestnet[0]).isPayToPublicKeyHash().should.equal(false); + }); + it('should detect a Pay To PubkeyHash address', function() { + new Address(PKHLivenet[0]).isPayToPublicKeyHash().should.equal(true); + new Address(PKHLivenet[0]).isPayToScriptHash().should.equal(false); + new Address(PKHTestnet[0]).isPayToPublicKeyHash().should.equal(true); + new Address(PKHTestnet[0]).isPayToScriptHash().should.equal(false); + }); + }); + + it('throws an error if it couldn\'t instantiate', function() { + expect(function() { + return new Address(1); + }).to.throw(TypeError); + }); + it('can roundtrip from/to a object', function() { + var address = new Address(P2SHLivenet[0]); + expect(new Address(address.toObject()).toString()).to.equal(P2SHLivenet[0]); + }); + + it('will use the default network for an object', function() { + var obj = { + hash: '19a7d869032368fd1f1e26e5e73a4ad0e474960e', + type: 'scripthash' + }; + var address = new Address(obj); + address.network.should.equal(Networks.defaultNetwork); + }); + + describe('creating a P2SH address from public keys', function() { + + var public1 = '02da5798ed0c055e31339eb9b5cef0d3c0ccdec84a62e2e255eb5c006d4f3e7f5b'; + var public2 = '0272073bf0287c4469a2a011567361d42529cd1a72ab0d86aa104ecc89342ffeb0'; + var public3 = '02738a516a78355db138e8119e58934864ce222c553a5407cf92b9c1527e03c1a2'; + var publics = [public1, public2, public3]; + + it('can create an address from a set of public keys', function() { + var address = Address.createMultisig(publics, 2, Networks.livenet); + address.toString().should.equal('3FtqPRirhPvrf7mVUSkygyZ5UuoAYrTW3y'); + address = new Address(publics, 2, Networks.livenet); + address.toString().should.equal('3FtqPRirhPvrf7mVUSkygyZ5UuoAYrTW3y'); + }); + + it('works on testnet also', function() { + var address = Address.createMultisig(publics, 2, Networks.testnet); + address.toString().should.equal('2N7T3TAetJrSCruQ39aNrJvYLhG1LJosujf'); + }); + + it('can create an address from a set of public keys with a nested witness program', function() { + var address = Address.createMultisig(publics, 2, Networks.livenet, true); + address.toString().should.equal('3PpK1bBqUmPK3Q6QPSUK7BQSZ1DMWL6aes'); + }); + + it('can also be created by Address.createMultisig', function() { + var address = Address.createMultisig(publics, 2); + var address2 = Address.createMultisig(publics, 2); + address.toString().should.equal(address2.toString()); + }); + + it('fails if invalid array is provided', function() { + expect(function() { + return Address.createMultisig([], 3, 'testnet'); + }).to.throw('Number of required signatures must be less than or equal to the number of public keys'); + }); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/block/block.js b/packages/kauri-bitcore-lib/test/block/block.js new file mode 100644 index 0000000..d4e643f --- /dev/null +++ b/packages/kauri-bitcore-lib/test/block/block.js @@ -0,0 +1,268 @@ +'use strict'; + +var bitcore = require('../..'); +var BN = require('../../lib/crypto/bn'); +var BufferReader = bitcore.encoding.BufferReader; +var BufferWriter = bitcore.encoding.BufferWriter; +var BlockHeader = bitcore.BlockHeader; +var Block = bitcore.Block; +var chai = require('chai'); +var fs = require('fs'); +var should = chai.should(); +var Transaction = bitcore.Transaction; + +// https://test-insight.bitpay.com/block/000000000b99b16390660d79fcc138d2ad0c89a0d044c4201a02bdf1f61ffa11 +var dataRawBlockBuffer = fs.readFileSync('test/data/blk86756-testnet.dat'); +var dataRawBlockBinary = fs.readFileSync('test/data/blk86756-testnet.dat', 'binary'); +var dataJson = fs.readFileSync('test/data/blk86756-testnet.json').toString(); +var data = require('../data/blk86756-testnet'); +var dataBlocks = require('../data/bitcoind/blocks'); + +describe('Block', function() { + + var blockhex = data.blockhex; + var blockbuf = new Buffer(blockhex, 'hex'); + var bh = BlockHeader.fromBuffer(new Buffer(data.blockheaderhex, 'hex')); + var txs = []; + JSON.parse(dataJson).transactions.forEach(function(tx) { + txs.push(new Transaction().fromObject(tx)); + }); + var json = dataJson; + + var genesishex = '0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000'; + var genesisbuf = new Buffer(genesishex, 'hex'); + var genesisidhex = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'; + var blockOneHex = '010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e362990101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000'; + var blockOneBuf = new Buffer(blockOneHex, 'hex'); + var blockOneId = '00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048'; + + it('should make a new block', function() { + var b = Block(blockbuf); + b.toBuffer().toString('hex').should.equal(blockhex); + }); + + it('should not make an empty block', function() { + (function() { + return new Block(); + }).should.throw('Unrecognized argument for Block'); + }); + + describe('#constructor', function() { + + it('should set these known values', function() { + var b = new Block({ + header: bh, + transactions: txs + }); + should.exist(b.header); + should.exist(b.transactions); + }); + + it('should properly deserialize blocks', function() { + dataBlocks.forEach(function(block) { + var b = Block.fromBuffer(new Buffer(block.data, 'hex')); + b.transactions.length.should.equal(block.transactions); + }); + }); + + }); + + describe('#fromRawBlock', function() { + + it('should instantiate from a raw block binary', function() { + var x = Block.fromRawBlock(dataRawBlockBinary); + x.header.version.should.equal(2); + new BN(x.header.bits).toString('hex').should.equal('1c3fffc0'); + }); + + it('should instantiate from raw block buffer', function() { + var x = Block.fromRawBlock(dataRawBlockBuffer); + x.header.version.should.equal(2); + new BN(x.header.bits).toString('hex').should.equal('1c3fffc0'); + }); + + }); + + describe('#fromJSON', function() { + + it('should set these known values', function() { + var block = Block.fromObject(JSON.parse(json)); + should.exist(block.header); + should.exist(block.transactions); + }); + + it('should set these known values', function() { + var block = new Block(JSON.parse(json)); + should.exist(block.header); + should.exist(block.transactions); + }); + + }); + + describe('#toJSON', function() { + + it('should recover these known values', function() { + var block = Block.fromObject(JSON.parse(json)); + var b = block.toJSON(); + should.exist(b.header); + should.exist(b.transactions); + }); + + }); + + describe('#fromString/#toString', function() { + + it('should output/input a block hex string', function() { + var b = Block.fromString(blockhex); + b.toString().should.equal(blockhex); + }); + + }); + + describe('#fromBuffer', function() { + + it('should make a block from this known buffer', function() { + var block = Block.fromBuffer(blockbuf); + block.toBuffer().toString('hex').should.equal(blockhex); + }); + + it('should instantiate from block buffer from the network', function() { + var networkBlock = '02000000e74122c23a90d7bb207fad2cfd07fbdc33de36352b5561120000000000000000d6097b7aded2327c8ca979ff85367f664879a7a7f42e1914ab880e63276b8dd1b12eff54c02e171831fb8d1ea201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5b03984b05e4b883e5bda9e7a59ee4bb99e9b1bcfabe6d6d5cb348c1c7d580627835202f5ad93c2f3db10bb850a1a513979f8328d9f35aff1000000000000000006189dd01cf00004d696e6564206279207975313333353131373131ffffffff0111622195000000001976a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac000000000100000001a9f062bdd6bf76f3059169ce8f30905e23b08b25e30570b2baca08ff2878b0e3000000008a473044022037da4b94dfbfe08e425b4b72476047bb45850fe9af109926dabebb8c7f0b93da022014de78058989b54d1a7ae19644c83ca4e26efd4000a4fe8e45659209468cd4cf014104861822906143d90a413c28c5aec29985ac36783d2c157fd0f87c55a5663aef51e74b0181740f3247aa1e7ab78b07379e1b1a94384c9442cfa5eeca8898769537ffffffff02e8030000000000001976a914b28ae06f3050160e775c806a42e7d1d127ab5dd388acb8820100000000001976a914017c96cc0f3a81c2604d9820dbb1b490127d2bca88ac000000000100000001b36da34608b43f5af519bff8f4ed4a30969963de3a7b7cd27ef897d14a0732f5000000006a47304402206ab21b1f1aa900eedfc4dbba741f972644647eb19627d1a664d1756d65e029820220070caebd37d1393e4e4af176f64d718bd860d6af08355a42cedeba6f509c240501210386b0396cf4aece2bf608adfd0e8d95414f6bdcd61b217241ec980d2f5f76eee6ffffffff01e882d000000000001976a914539c3e80f41382631d2d03c4778ed0fdf81b7d2588ac00000000010000000133f61c96b620149bdd45808dc8f2795bd8d9874a1d91fae44dad627445adc09a010000006a473044022035f04cdb8048e0a4995ae9bc8e59373f99b2751d5a920f7847d572090ea1265d022052e5eac0fd3e556171b4fe4bc15e4d5fd2a5f801d1707ce84dd9d74b1975abb0012102b9913536286170a0f6adcc2988cc2552bf1f97ec30d75d1ca6bd20b6b5394e62ffffffff0118fd6700000000001976a914539c3e80f41382631d2d03c4778ed0fdf81b7d2588ac00000000010000000151148eeeb3612d11bdd073f98f964c9431bd5ca67aa0ede8004e98f6d627f5dd000000006a473044022016838fbd4c9684407e771d2a99fc2a230ab655f315f1b5086949f286f71bff3102204ab02bf9e188619bc9b79bc9b01788f98900373a639b0888463fae7b3a4c66b20121029ac24d1abfa92582156ab553cc1562d56f48bcebadeadf1904fdff2dab74da62ffffffff0110ca4d00000000001976a914539c3e80f41382631d2d03c4778ed0fdf81b7d2588ac0000000001000000019c05873dc500ba9ae3616d92282c6a8723a8703be8c85fb880a4330b2995a56e000000006a473044022038ae1c068b089a73df1d369de616ce3bac0110fdb824523922934a6fb0e3f01102201fdb5edd8d77f2e97c4f898ac022be1e0c41d90550aa410d12471af305e520000121030c07ddac3638f0f9309d9e344fc9653aaf6430b4b38d703570763acb8246132fffffffff01d0aa4d00000000001976a914539c3e80f41382631d2d03c4778ed0fdf81b7d2588ac000000000100000001649072082c6150572663065f26554692502cbb8006f6ecac39e8cb421f5de070000000006a473044022004428233b5b46e36e244669d1370663c594d487b525cefb8d693e38286ba861202200f54176b57e8ec2a8e6ae4df41cf0cdc556fd7d6a58adef23e32bf6e744e1cf5012102820ebfafe39f5f4bf0b7e25ae9915cb7de8ceff88c0d01cac19bdb50a4b1e051ffffffff02c61b2107000000001976a914c225ab6924b62a12e85aa53f366eaee38609ed6d88ac3a986013000000001976a914c0fbecd8b2f85c31c5ac86630de53c7ae7ce464c88ac0000000001000000015a5c351916611a4b995dc75c482dd8afc6a813a5ce678cc7c5fb9e95b6e69bd3000000008b48304502201fe6c1b80f37c5e452c2ca4d1bee0fbc87e8fc17a13967d1cc9f685a29cc3e77022100f1a1fdbf297f50c46a2fe179170233181075260134fe3a8d8cf14490d72d10e9014104ec8286c3e7d962cd687cb9f3860c3e73866d4f79e57fe4df692680b6488c37b7009c4a963a5649323721ae3f20d6f393d7865f85b829a27f0b541bbdd7f15838ffffffff024e38c404000000001976a91484e16c064a30f69c78f9b3b42002fd89d8c900f988ac808d5b00000000001976a914a6e86762140b6d7f661b251cb7c3cf1afb2d870588ac000000000100000002507c35d72b8ebb55a43b5cf450f17f5f13cd3da4b263609cfc6e4508132a4ed1000000006a4730440220772619770d94488234ea4f47430f05cd5c78697a2e7791b12c6819602ad9004902204b2bc4aa967d0709a4c99d5f36f2317c44794489084cb593726c4062ad911cc3012102094d1fc9488b1ce68d021c6623b6d12ce2dfc0d6f527e6f2096765c245158624feffffffa216eab2a659f25ca6bc7bee9cc4a5e54772118f0a50d98f0656edfecdd849ad000000006a473044022009bb9bec4494389220e3188b37551b1dcabd035a7114a309c2ea62d1b7228d95022034beac693b005a9b5312b5c48c41f31da0665e1359be81dce8930c4c47de67f7012103fd5c201fed02e586282d48d353db05b58140e7a94e02d886204c35076eb70bf0feffffff029fbe0b00000000001976a91412ccec1db43e3a4cfde88e25129302f2a2246a4e88ac309b2400000000001976a9141e1800460fbaa6eda2ff7b52833555255af3926388ac8c4b050001000000010cc8087f431d229fa6daccad29eaa779c17312325e2cf651fa849b763fd85953010000006a473044022069b16749d22001b0a21744683d2d75ce9ad9f2492824912ab52b8830ea825dfc0220450abe230ceebfd021d262508ad447b249866e248c80d4e5c7827308671426c6012103fbef068b7a0dfdbda3f53acb71cbe12c39f76550177b975d2038c2e32dc430bbffffffff0211d58700000000001976a9148341537bc729cd32e1b6304ad7800357052c848988ac002d3101000000001976a914469dad04041ecfdd7e98079cda2dfde6015db7fe88ac000000000100000001eb4f434c6dfb2ea5e453afcc3b19c7834283196056e5e55222196a24898ec396020000006a47304402201a89a95ca205d07c70b327cd13d5cd17e02e79b0f1de9bc4e69bb50562cbab3702202970e1e064e68a9f2223c4a61e8065f4df299e87c62ca99598b1e375141ffe6401210358f1c439eb89915cb7f33e1c87373d6664684c0cb5095ea60ed585b78230a8f5ffffffff01d873070c000000001976a9149586513770ac55d28829279275f2932062d5816a88ac000000000100000001d0203c594d3a05ec4e01a649927a8ddd3ec45052bfb78e62e3da4bafb801160d000000006a47304402204255fb29cf9c7c8f451d714d9a076af5fe3f073a261194eb9f49ac5fc3f0ece802203d6e6d9f858da72b77edd739461702eee90facb55b4e682e009c9b40511391d50121027c386ac59a9a1dfbe52f11151388664d6ac544a9957ffc3c389b63a05404f479ffffffff01708a4f01000000001976a9149586513770ac55d28829279275f2932062d5816a88ac000000000100000001f0c4498ee70b44e5ef0fc7c9ae9d43d5dcc31f7498e161968eafe9935e2a57c5000000006a47304402205af8a8a26addfd6b631c8c4af22eb5f45f5c42bd2e2a060041c860f634e240fd02201510e5417cf1f9cc1ecb55980f13538a16a53952ff4ae8e1265557e68f4e8f95012102a7ac4f4831ea24367dcc21e2d586e56d06c78ce6859325686de71e479622dd62ffffffff0176200000000000001976a9144827ff0289efaf9374ce8db5d40a1e7e56fc36a188ac000000000100000001d77155da4a5b0435ea9369150cf44ec7556d3a716c79a4159c509cf1ac947ffc000000006b483045022100db0fe1cbeb3dd70f97633019424ab83046a01e4fc5c3d241d03226092fff7f58022050a7ec815892734a5ed85791433f79a1c436ab19d3dcb9706a378b2dacf86078012103f9ce7b512cbe79da51ea4bb25f24dc435ac87a55ea8cb5fa99411177255cc89fffffffff0110577500000000001976a9145cbb4918a6e7ac4c2de529afd3f0ead258fe129088ac0000000001000000015d011bd73d1c66ef56eff8bc3ca0ab99c500512119dd07028bfabf400dd22b22000000006b483045022100c9c30e7dac291752b08514d59ae9e034f8697ca1457cf55dba90d6d33e21f05b02207f802094dd1d6e427f45be7f8ce4ac4687eebd754a4a9ad148c2506ff5623d3e0121027544301ab1cdea80f629d7bd7a61eeff0f7c3eaed35679b4422b5e017189790fffffffff01f9744400000000001976a9148c692ee5b907848285c29f3dfeaa6ff9c79f156388ac000000000100000001602d404fe5970e4da1a5454baa50808a53df3d97bcacaf1ec798d5db3312e57c000000006b483045022100a9fc8ed2b99ae012b76d5cabcba58ba2c901c153f9572a6e359b18b4b0577fe602201b2f701e30400962b9441bcec0bd7e78baaf04e80480d874f6a156789a044195012102cba6951d129436ad8256685668bca8ce044a2e81fdceadeabfd39ac6b362ee00ffffffff018cfcd000000000001976a9149586513770ac55d28829279275f2932062d5816a88ac0000000001000000017cd5b2e220f41041f3b707945caf720be28057a269c6d4cc9945d984c34aa4f9010000008a47304402204a567d5bfda4edd2bf7a6e239307eb8b2ea84c3caea8542278409d09f6fe762e0220655fdbd14dfdfed1371d362a510d84e9afdd76083cac8087f83ccc084b451dbd01410486b1655a520d98dce4e50fd573a5579f69bf3fd73cbb3911d296ce47b0d27082bd9217421c00c4c52bdc227498a4ff061370be924913192efbc5b28a245119edffffffff0170c9fa02000000001976a9149090c8dae016b9fd3a9fdad72ba4df54b1834a3f88ac000000000100000001716ff994b731a312d2c4eec8915b9552465d4b21dd47f685a99e8e814315bde1010000006a473044022071d095a786bf87ba8ce3fb07dc75f9fd77ad74dbb296c12b10b3efbffad0c561022032c2e1ecec570e9a031a31a0ce41c099152ab179a543379b85c5ad10aee4a1770121025e06cd8d479b3808dcaf919b1289ab837316ce962732ef272b4fdac5777fee56ffffffff02a0f703000000000017a91461981717dc4d24394220e11fd09d42bf2ab5bcb5874f600000000000001976a914d4696a9c84387c12240ad5485fb9b4d6b7336b6288ac000000000100000001ee5a78d068854fcbfaa23774b9ce121f83bf809862266e97600883c3f108ecfc000000008a47304402201a01877972a71d7cf48e6213d5e79544aeb4c7b2852463f82b21a2c6264c1bea02205d622c4caf8f461dc92f2d1e9cba92d5b522a7e0029f22225466611ccd8817d3014104da6bc6a6139bb008454bfc8371141a5fb8ba6de87e9ab1578ab4c31e1b25513d6d1b1b0e66b0e39a29f6baf19f9f0faaf51d22bac02b1c07eb08058498763784ffffffff0120f40e00000000001976a914ca7eaccd4ef037929be65c7706992b055a41362e88ac00000000010000000121c6ce4a254c4d3138f1a7b61986720bd14d2903e7fbcc6aec3ffc88f8bb62dd000000008a473044022070ea08ad064f8b8709ada1680a6d153f1d52f3d1033c4c34fb45e6fb15ab552a0220070eca82b87d2bc4a44c1f6495456853b29dabdc092cbd18a9b498d6108c4f290141044a3460b7e035b73998236aca3312d8a694f7b1fceeac872e4ce65d012a6f7d8698fde52a204260e8ea1eb210597409b8ef2ad8ece83daafc40377071ffde1c6bffffffff0120bf0200000000001976a9142178ad5ea2623ae333116185b1540b29f09808f088ac0000000001000000016c2708faa270ae79b3c5c7e754d40609fd31cf4af60fbd56299c9cad52a5fc19010000006a47304402204faf65d5779f2c109ab8a9481c3f655846d2ce2e6af8c72334fc853daabb5bc602205aaf7bb1e112ae29fe9f01f8e4efb410612359c1cdb96511d8acf1ad3b32300c01210381ec871716e98a71777fecb4e18f05c56c3e44a079234f0c1cce75fc68e0d00dffffffff0225c91620000000001976a91460ff4529c00d5730ed8c63f6c2e0894e7b86e58488ac00497f0f000000001976a9143f2a486ea9689c05455033bb588917767c8ab10d88ac000000000100000001649072082c6150572663065f26554692502cbb8006f6ecac39e8cb421f5de070010000006a4730440220085b4b898bf767e25972b24cc21c4b43aec7f6dd501c8a4865be496ffd6a4edd02205da61f3c71fae81530f51d055a44e45186cf20c38128b92f34375d4ca0a1743e012102d5db1bacfc9a4c375a9223db95e33ae1f591af8dbdc600865e5053f225da24b9ffffffff0204bb5809000000001976a91495951cc4260ac3a378cda2e3395f811f88c4c7dc88acfe226800000000001976a9144a86401e50d73d8aa53a073b7c0c06157bda1ce488ac000000000100000001d33571f1fd3b59be9ad3d3f715dccbae79bb2e59b9cc933bf408855495f30cb9000000006a4730440220754a9a82cb29213bd687eb304c122ba75587fe91877ecd749ddc11c1582ce0cd02202fd6dbae3242b7095e82a105d0abcb63d28a4e3473af2bf4a5f2eecd58e0c5f9012103a3191ea65afb1b5974e502a53981381b5c5f6d34035c66d67cd2072f26d0a62effffffff02e082ce05000000001976a914ab5309ce0f75a383a80ec11e65750b3d1ac24a2a88ac204e0000000000001976a914c8b0325d344252d7df7a61ea11b9c1570a31680288ac0000000001000000016ac3a07914ec216826fd443655dec92110b86da10426ca8a5b447ba74ebd3841000000006a473044022072ac351fd4a03bb6a0e965bcfc3472d64a2e3afb0a5a65d41e59fe6faf7202b6022003cbcc236ed4178c3057b6b3e3c0f1bef577503631c20ccad7cdf9cbbe0cb047012103d24e158108ce0fa7322e1f95515e201b0d4f78c78b21652b3a276c109884eae2ffffffff024054fa02000000001976a914e6b42818894cf54e996aab26e94d7328f179357488ac005a6202000000001976a914b6dca96067a94ccded28ef8ddc9e6338aab7979188ac0000000001000000012bcbfdbb246f6795352e15ef30ffc30a823266d410b13940de1c6bebe2e950ec010000006a47304402200bf6a4e0d050186cad9ec0520faf230ae95069a23f1f1d7a94160e2671da26e102206e519151d5c82f41794df47ba57e2a747ad3b9351666c7b36d168134400e9de3012102af03be02630ba0a38a2f9d38832fedb4e8b5bf979422f234085fa44a38dfeb11ffffffff0210270000000000001976a9142d5e62586a3d244c5e3c4ecc32eaf7630639a1fe88ac8dd90f00000000001976a914420da0b7a488010afd9cc41cf96ff14a05ce970188ac0000000001000000016e726655a6ceef71c0629ee997aea74fbf3ae906699e069d6c9b93bd62d6f666010000006a4730440220527961b5de466f8eb082579be880d422866ce91255f3a2101f3f7bce6f4cf56002204e3e4909c9dd1b4ff736070d64590902ae3044118defe23a22f9e30c813c8d01012103f4aa7eaf4813e36dce5b07feb06be26c40d8650d6b87ff71e0748be9899ab50effffffff0210270000000000001976a91449254ac0c3f62eba4312a85dec152d34be8b95ba88ac60900f00000000001976a91497cc736c7499b6dc1016f728073d04783fad514988ac000000000100000001273aca4518c4bf276bd9ea75a9e2c1dedc724599104ecbde61f85c4c23a53e6e000000006a47304402203d9d92a705c310dc331da23c9c33133b238a326e0d137bbafa3fa573395e5595022050c5076a0ef48e2af4ae38d25e715dda448dfbce281b7571ceb85f643f1bdd7e012102f548a1debbe3727f8d01a8df06d03e2748c158570318c3e256cdc675db0fdd59ffffffff02020c8300000000001976a9146d860b78f982c94e590d4986f0ece2121202d94088ac4a0e1200000000001976a9140e51e95ce63f343d4268bd071a03c567ff80bb3588ac0000000001000000012db825d3ca7b56f1c9c60ccd4e4760222a3fb3c41a3271ea228350d27b4ded04010000006a473044022028d12c789842ae14d29cfbc6739c166414f9c508e45f1c1542925e72d8512de102204c8fd0be2c28f1acabfb34eaba2cd4930cd3d27478264c740f78145d43e3b2a90121022c3e626b9df73142c40993d79b995ea820b5c5237859f0e4c405a5a7d8c37e58ffffffff02b0633700000000001976a914e098b0eab9e76331604b9a9dc7446c62f20b6f1a88ac4015d200000000001976a914ccf3eb1c37695a7c5eedb040325b535bb4430b0588ac0000000001000000019c975c4bfb36f1faa640ac2b179aca4cfbf745dece1dfbd5acc26820fcb634c2140000006a47304402206ec42f99865e495ac51e1383876f4bda098f1406e7743378fb214612c40b09a102202d6ce2dcb64d57bb391590ca626ba19fdbc45396591f4b32e6271e1d3327a8cd0121022a023d7d15923fd2d3351323fe743dff984a87507dab7694adc75a80e22b6fc0ffffffff0222689001000000001976a914757662cfa0463ea90634d203c71ce57c5e092e9c88ac9d73c900000000001976a914e8d84dfd711bb9ec2b74e8bc2bfc95506f482aec88ac0000000001000000012812f85fdc7b6abbfe8a0b88a9a896273b986ac81b4323f8367676f4bb745ec2010000006a473044022045dc6d8e30bac58d090383a6f64c4856a03f09520c019ee3e8d8a47096293f3d02203a772ae961d0dce63c1ce6191235ad6306ba75d9a51146f0b6ff68bcfe70e90601210367c1a91e6ba1125d451539058ba452cd02a97b45381d3b3a70726cb46938491fffffffff0260900f00000000001976a914ca2eeeee7e725d58a2dc104ad5fed4cda700b46088ac66990301000000001976a9142bc3de6fe26eaf73f7e69ec00c6a295a6cf5c39488ac00000000010000000151b46528b920fc823690945fd7ea4629fb960bf408383bed8550cc1542e2b96f010000006a47304402202643a944d6d552e44957b4c94e6cf519c922613fe05369f11cc7e7bc2b7d2eea02205fbd2d5c3551304e91b5a8ea58097e104f99293f1f709adc4fa65492778a1a9e01210330b757708b1578b69440e07c9a13160e90e838fe05cd1e8c88eb6b70da950501ffffffff02d74e0100000000001976a91493eb43b95cc78327c0b962273bc12934b81be4e288ac3fe10300000000001976a9149093dba908264eec7eeabf40969842e3a4f31de088ac0000000001000000011cd13e76ea53b8862eed3b6c5b57e90c1ea82491f49f58aef2935113b05b00b4010000006a4730440220085d68cf406921d17752a717d8f744965c31d49c751231c10f7fe84f7d3eafe1022068f69330824a929f95bbc0b9ad6e3865c2479398e1023bce9295eb2364947d39012102afdc01cfd4f30ac98301015dbb4d95db2423effb73eb5562712834b293348132ffffffff026c2b1e01000000001976a9143bb03138f0525466232e9a5b3ef8d067740ab1a388ac4d538300000000001976a9148b95334f9e312aec176095274f4ba94e22b204ee88ac000000000100000001a3d41ae91943253125f5daf3557d225a0e902663916d61f532092d4622f4c798010000006a4730440220572b6675f8bdb97bb01e1ec1b3f4e5ff15ca23689f4ba8331f4ce7cbde672d16022042f483bd519cf8aa82b3dc9eddaef8673b244405bb94e0f04aea46ac4e68a288012103bfd8dcf3a70403a1ed4d1e519d9c4acb2eb922ca98b8588a8e50c0596b869e82ffffffff02442a0000000000001976a914e43126376d70c8ede82b626fd27f016e7bf74b0088ac3e810f00000000001976a914b02faa6a8a3776e9e8730edcf0a10474b06198fe88ac000000000100000001c323f4fd89d4cc5dbf5eef2cb3b708c5eb52ec6ab8b91e7bcc194482c90539f7010000006a4730440220423272b85b1758045a77f3e2f57a9293c59112c48d85c90410bc7964b97afc3b022022dcdb4e7f8c9254ae286fd6818b0c452f26ff6d85318ca97acf1f60bac370a3012103ee28fd365326672cc05f8e798e3c5a0ecfa00123c26b88e4f91cb81f58715c73ffffffff02e0673500000000001976a914cec8ad83c825d2f78c4f8a24f15253892f67618788ac28b90000000000001976a914b27940450993cdb1cfe6330958e82acb98d4b84488ac000000000100000001f02f961b41c006d8f72eeff8b3b57116217325e3d2db188720fb19b2a1fe8141000000006b48304502202631b16684b0ab481fe5189871507168360def8c43d893bc9bb9c36fccb61d140221009b1f2f853f113a3eb3f12543adb1f8b0e67de9d5a7d369ade56dc03d94535a04012102b87670dd656e3e542eaa7f0d12528dad3222d5eabad3dbe0866d0765b170967affffffff0278e00100000000001976a9142b84df243d010fdac32c714338fd811783d3d2fa88acb8f8c0c9000000001976a9143cc16c4522a396ea37a1d4ac57f700779601d5c088ac000000000100000001ca72c6efed43e4b8a86a6b4c7b3c988a239372a7ac6e84bac3961287309fa132010000006b483045022100d7d936b0f0c12ea909010e45fff284ead7d08569e3ffe716a2ce2c87c9245fd50220621f444a4a151d22cdb3ad5f586110db7b4f454b7eb0069685fa69260a0ef71c0121028f81e539260205ae7bbc22cf9c388b57cc5f9e2a180302db5a878f124107e4efffffffff02d3328702000000001976a9141f541dfebbeb51cd77f68ee3e879877f981658d388acabf9bd08140000001976a91485301528e5ad68e21925f1f38e60d9e11dc1eb7c88ac0000000001000000015eb75b01e18ca08845933b30a397ae03b6230a854c58836efd8ccf831666661d010000006b483045022100c3be50a3b07c6c4508df4cf3935816e8d5a12f44cc852b5f0e297c668c4c231f02200d20115aa2e66e9c79aabdc0c684b941b0e2e238e12329bca2f4f2f49c86860d012102da535e96fc5a1b3c3a77c07cf254e47bdac7220ce188892ce1e54511b49dc477ffffffff0280c3c901000000001976a914e1ed9eccb3653a240fcdbac8c76d52f17fc964f388ace0533546000000001976a9147da7a23cf7445bd6be3811dfe3af49fb7f0a2cc088ac000000000100000001ba183a01ead18e32468681b9cfae7d7dadebf3099381807b89df6b1f5351de2e000000006b483045022100bb685f3cc05680c798fdb0a8d66110079e0a19ad627ec75f4f5f677fcf4e82ce02207648e482d70beff1c7f783b12a99dd43f40ea57d63367e7fcf4c1cfb7cd04304012102105268f9eaa0f694ba4104a2fa34a2fe9ed0a6fa234febc64a7969c8e952bc64ffffffff02905a6a00000000001976a914d3e5c3a1f16fdf0008e07168506482d7482711ce88ac40420f00000000001976a9149913be3ba628eba6811bc0cc252eafbef73ee40288ac0000000001000000015efa958a8905fcdc2c5e0b222ebcbdf45a05356432a32a934cdceb3563019f5f010000006b483045022100c21f70b9addee155acc29ff3fe05d6c5a6246373c43e7ccfdb6d5fbee037b2bf022007d6bee18e535b45daaf6808dbdbe686d1b8fcbd92fe46aa31dbe4f7e377a616012102d46da59ba6dc1eb24c88295e14e4733696fa12bb04d68f2ea184727065f5bf66ffffffff02d2ba4a05000000001976a914174c26508d593f90ed1a55a6f092d381b3dd736788ac2b25544e000000001976a914c0a135c4b05a187289ed8d25a31cfa04bd1ca4aa88ac000000000100000001320aa3852a23214f3f444e2683f3b545a555cd46544d3aa97383f840839ea1f8000000006b483045022100b55e45c19fd6a810d045a77ca2fa33827e85bd88bf6147729d37de3aaad6b2fd022068d4b78993b5a0bdd364b002aeafde175f33592b1f7c51e5f0f95355cb54a3ae0121028d47279ea007706e624271a369bdae02d5658b6b5deadc1b0221518ed096352dffffffff0240420f00000000001976a914da5dde86d69a5d9dad88763f2df4b048953c7d0488ac80380100000000001976a914f5710c7a405f1aeca11b79ed8203ae5328853ba388ac000000000100000001777e61de7f2cea472a3a851bd5403599ecccb8ffb382582861e0f5172b1867d9010000006b483045022100fff70cc33bd128648a9dfe6c5b2e2bfad4f1c3eb5a8cbf97f0038409c8598aaf022064c89f5a37ca3980a171c0004333aa35a305b5ac1b11532218ad73401be3f26901210266ee2a40edde81f8acd7b19c219fc07ab476a2b4f8a3d7cfe81c5f511435f1a0ffffffff0230d6b601000000001976a9145621f431fa99c7d87e40573fa2bc31e781abba5c88ac00255602000000001976a9145ed051ff5a28a48678b34d635e7f203b9ef4e09f88ac000000000100000001cf8357bf24882d3a03544c4657de9f7cfd9191eb1f7bcc17ee2ec22e6a84e694030000006b483045022100a0af8623feedb5e3921487422de1347844340a5471c220042d1586aac492d930022029cea3c5dea4408d58e5fc366fe9cb1f992e73a1c3052a18a8dfcc4e1fe80c190121027bdf5ea599028ced662ed71b4f9c36b803ae07c70144c434dc872fe58176a8edffffffff02bed38101000000001976a91438675862d52a02d8ebb5b0c7746436521c9e5bd988ac25133200000000001976a914e5711ed1d4b0751bff7c8266f613c5b1fc6df31388ac000000000100000001e8d02977a8c854749336aa21237a74c1449a1432c97b9984f7ef73663f4d9add000000006b4830450220549ebac060a94f875f70893baef873558e5ffe9bef6662e4a74d3d3d41596f66022100dada2ca77d646fd9c24c1215abe80c3998e5521cd408fd3924073729e50231390121035fdd68c73f464c0364ad77084edd6566a2e94cd6ba60227fc2bb52f7dae31d8effffffff0270791205000000001976a9143341879a5abd625fb07c88d5681869438d39ec6688ac904cc800000000001976a9149307b74ca38170f6c4617efe73bb842aafe763ac88ac00000000010000000192c4bc2ee78b5faf50ab4b79658d38089283dcd2c9044fb7229505618d0a253b010000006b483045022100a23f73354759e9f97f814e82fd63079ce3ce37312c1679619298795115ab7501022001110cafbfffb01a2793bba530caf994c3344ae29d0b594ac2ac8b781be27dea012103be139acb8b1eb484385939a6cec7297ba3d65158407bcb62153b4af94a099581ffffffff0293b80000000000001976a914d5a99e28eaf7a5337a6f3a56a1d2436dea59fea888ac22479700000000001976a914ca4f1c265b75374e4102ac2559a5694fc8799f4f88ac000000000100000001c4c7b5e9622430320c9202d5af797a04283818ebc53aa4e450962d6c0c5b9d04010000006b483045022100889fdb81acc0348fe140e73cef1219dc2fe8af67e813eaf009d60ba59e39c5cf02200396f4ab692a5c4c17aedf5b129a39a49314917f4ba68d74d553eac2fe13c9e6012103881abad2f5b53ce1b1d1fed517344a0823a8bd2d6aeaa61776d5011e2376eff4ffffffff027c330000000000001976a91491373ef109cc861eb6e948b046753cd004aa11f288ac66559700000000001976a91439bcf6db3c66a9e032083b405c3b4dda0267f38388ac00000000010000000144a7f3a00f9bb763b2d5dcc4f54d3387cedfc47e19fffa6d83060956b0f1d197000000006b483045022100be57d9b2fb8578dcae72ec784e11d72f0956b56670deeff316746f438854f28902203530051affd587a800fa5a52904bc00fd3dd249501f0aa08898da73fc9e88cbc0121024bc3b58780d69d43cd8fcf9c850289567014f5d5963c1245b3fc8bef93498927ffffffff0268334100000000001976a914b0a72052ae4630c850c68b23885202b1596d956e88ac38a01b07000000001976a9147241ec9ac7c29efe9985fbc69927f70029b40af988ac000000000100000001579d2101d3b10dce5716e2a7c7b5727bb30086cfee4b6da1823f66f5b0baf213010000006b483045022100f1975cf86198a316ecda478fda199f134a9783e615f1d3df16816838d7d9306402200c2ca1dc6c200627624be248221aab8de11c86a483744aed29276c0a4b7bcab4012102b2d192c1740e213ef0804b579535234f45c69674473f5a691199c9ffd72f2bdbffffffff0279294e00000000001976a91408843fcfcce6c092f1ba9d17acbf644c803e422088ac87bf2901000000001976a914ecbc2f775d741490d4cfe4d3a61d6b57b7d2ab3788ac0000000001000000015edc6c135fb3b7b95c945c3a64a60ab38f42572dbca58b5dc22d678a7af1b45c000000006b483045022100e3e60dc61028174ba8198627b29242faa12232d57570db169c97b9cfa8acbb4502207fdfdb729a9a04afbb1f73e8765de137957d9be5d39f1ce442dfcbd00921e4fd012102b3c3b2d51c86500f1e754198e38474a6ceab39759d233e9299e514a4f789d3b1ffffffff02ec261a00000000001976a914eb29476acf4ad065d90af94e2662201a06f7ae3e88ac1a6e3400000000001976a91412082207ee0f399539b547ebff49727374bc2ae888ac000000000100000001d3addb2ceb3cfe904b0552c8467efa6306a42cf45b56426e19d6b6176d9e22e4010000006b483045022100ed5922e3053025c7527d5704def6ddb56f8a02ce45f56c1198d84fde89c0b214022020a980d86a056f378d4942c8ba6fbe3f18b55fee3406b15a300026311a151074012103ad9b97eecf95726db5713be1700376d33a5ff83aee6a15197075ef59285551b9ffffffff02b02a3400000000001976a9140d40bf9e554dd37839394a15c84ad2a3794b89a888ac52df2200000000001976a9140b71aeee3833b17c82ee31051df0668fc37d463088ac0000000001000000016fdeb0188cdae06b9e83d5aac5ec68c09136199b8165adb6cf75f5efa22e67af010000006b483045022100c92be15f1296a8a865ab2d6d41e781b7cb7b8d0dbaf5dae34fdb9ded70eef93b0220479b34b7f370d1f9cbbfab757b5e1880d8e35d4ab5c1fb1ae3aece33cacb4a20012102a106d4af749bdf605f5eac7ad9d46a72f7f0598fafb82a03c2e635ea68b8f4ddffffffff02cc880f00000000001976a9146c5184afd13a71dfde0dcb681813c3861866af3f88ac0b300000000000001976a914f425a393ebbe9a3fc3c34957d8bc691863c895c488ac000000000100000001d8de133e6f5c5411ed92c39e18cfa9aa5e71a50e7e0f3cb29db9e351341159e2000000006c493046022100c85b8d6ef594ea9a69f1fec82c117243b196a3485eadc66bbebcef98027b4850022100f3b83cc70610e77c9430f17f75d2d7e055f3733778145b4781734c1aab2ad02d0121028d47279ea007706e624271a369bdae02d5658b6b5deadc1b0221518ed096352dffffffff0240420f00000000001976a914da5dde86d69a5d9dad88763f2df4b048953c7d0488ac80380100000000001976a914f5710c7a405f1aeca11b79ed8203ae5328853ba388ac000000000100000001853160f3b6e2785caca300bac5430d2b3c7c0de1ab18b63bb96167f3da618f17000000008a47304402204b8babc6c254750f2008dbcd2e4b7ad04191228df503eda79ef225665ea09e3102206dca042aca915cf1490f63f859c81e7fe80dcf90ffb97344358dbd4f0bc2236a014104409e655d836f67c7c095da0184c65515431b296401602a3d68262869f3f992c6cc7f913a43be3ad0cc1df3d37512c80a1e37405b733a203243f0152512d4bb04ffffffff02c02a6410000000001976a9141a99c14fe5b2abad38bca2c355db786c7a82d6ad88ac30b57e05000000001976a914185c9e53b6e4171f1aa6b35390b2b960b71741d688ac000000000100000001f7c5a3cb32097876d35001d0ec50f28d7f0fbaede580a918ea4287c3f8e116c8010000008a4730440220665bf3b4cc7b07f2b53f4036b3b3bf74c85bab72efed6802c200c4eeb7deed9502206257341efe59353402f24e616634aa4c6e90388072a33dc5ffd0f205b768dcdf01410450dc028d6bfdc291021090ac8d42a568d69fa2638fc89dc76c4bc82cc2ce38186034560319fe0665f316c8dc66e31f779ab9665eb632e49067bc64c43568eb98ffffffff02201efc01000000001976a914e5665fa435239a42dec015c04ab3f83e80fa045a88ac0b74f1d8010000001976a9146187ad1cb7f4093a7ebd89dce4ef2354009388ba88ac0000000001000000015f73519677abddd79f854d9a93b4d6cecd211c6cd78ec302f60475fc6f9fa08b000000008a47304402201a454001be9d3404269c127a255d807a3536a92e4fbf449682288b03da44e6cc02203146198c92074a632bc37e92ef1c712c8615c825a33c14597ff77c587876826b014104b8789f0453d982a2f2b51a8bc5a3bc71e2ab9562cf2e7bd85dcd1ac21e8d3b77cdbbb2ac8c7f75eaa94fe23008370b3d0ca8e19c95b3071e89a6916c7e3c4d8effffffff0200879303000000001976a91433f4812fdd403247e86d7a1cd7e8cda3a09b9e2b88acf0135808000000001976a914a89469416e1cec6311eb04a798615429640cda4d88ac000000000100000001c9274bb3273d026c99e00cfdc35f0a70b01c35b08604c8d2243b0c8bbf476d6f010000008a47304402203e3e7237d3680c114d804843d6fbcb893b01ad31aa171843dbf089bdb01d8cfc02201470d19947d78f9c9299c57d6c3cb47b6c4fb0bc7d082fd6996984e0395740a80141040ef0c03173ad8917cd86938950401f95039526feaa187115c8a237504920cd0619883e1cc408ddc4808dc6ac7649ab6c08831f261aeff4631bdabbd263984a0effffffff0260e31600000000001976a9141030ab0117a2bcd090a0e044d87ecc80d6bab66188ac2a528c05000000001976a914ceeae18e590c48de17b3f978465c89894ed6f95788ac0000000001000000016a411d2a3de51595a80f22f2e1ba84576371d971472f9ac24b6132a1fb1fe808000000008a4730440220111aa46e1633d7be21c6dd89a26ea8174410b9db5545f663216a2161866749130220539f94c9ed985b977c7ef40f23e63eb9d899e4bd905ac449f388ead7b83b0bbf014104f8b6b50f288bf5805a54e71d76e0ed2483218fe9aa8c12a8bbbbd4c4e3999aa446a87edbc5722d01bd256259fd33cb24513c2514a684780ab490cbd93ca36092ffffffff0261464d00000000001976a9149e14f554d90fc1f8e80392953a9b4afc8ec2827a88acfb246800000000001976a91457d9454d85d5cdba9a6a1f0b54450012f3a1d03388ac0000000001000000013babeb83449c990c4fede2465099db7f217a1649e1207319d0907f04f5c43191000000008a473044022078bacdd5e66a1a12e33cebaf303c07cce0a43b757b9ea0f85ae33cfe66cdd2ee022050826d3c4427ef0bf5357fdb95db33d207c8fc9ad9c53459027c31046d549a8e014104293397b707b5a23a9ffee09940b3e16d9dd585dbb80e0b7ef083148c492d2b32e65f878c0d3926fbeaedbe0792f8a2bd04da33f8dbf507126af5078c044a1db0ffffffff0230e60200000000001976a914f5710c7a405f1aeca11b79ed8203ae5328853ba388ac00350c00000000001976a914f0dd368cc5ce378301947691548fb9b2c8a0b69088ac000000000100000001124d837c44bd2b345237f27bf759245ce2f7da168c67f13fc206e83bece9d4d5010000008b48304502210087b09589c4b5feb5e4663fb4d22e7068af25c6d4a4fec8edf6455ea5a4388578022059acaa0056cbf6c3a9b334b1f2018cfebcea18b4e7f84f6fe1aafe6798aee2e20141041e11ba348505b1e8be9a4e1723377ed31d03f1640cc68782e8a9d24e550181bf8a3e09d19edaafb0df0698882f4585ab5bcfc5e6c4169d58e7bf1068e55dc9feffffffff023a986013000000001976a9149a0f7f1e60867d16cb60a4dafa61dc32cd2e3a0d88acc8f8ff33000000001976a9146e971364ae0bede923b7cb28d367413510760b4788ac0000000001000000017966a2d0eb7fce33ace82bc4c0d1d4f8a96b4fd7d13f759fb60b90b56f37d38c010000008b483045022100ca95c5064dc2ee585c15fc1ee3fedcfdf7cceff3346faa18ebe8bce5842a30ba02203527488c6b4a5718bfce41a2de6fce65aa7138f1a2f6c72f3e55705a75bd7f2f0141047a69bd825ab06eb8d8b46fe4f86e2b806d4d536d4694b84c668675b0fe00b4d4b52eaa3655080863de126d28f393e9c77621d07d8c3bd0d1056a3d00a7171db4ffffffff02009d1c00000000001976a91475fe37e63a11f3dbc9dcef07825483b8105bcfab88acb9317802000000001976a914e80d9f396d5da926d25d8c7fcfbacca2c8c9fc6988ac000000000100000001deee959fee56f2612657baf6129364b6730ce35f2f2dab657ce22af82ee1b4a3010000008b483045022100f82e75a0a04a8cb14395ba3de6a47b68050796777c23c287012e3161a3bd0f6902203899b588ed685ca8896a012614d2c42115598ea08d55f5fc5cbf7f84b207816f0141048d6a16767516cfa38e2e9fe2af31e27dfb15cca7cd8c926d64a5a2c33480a895b3c83664b50714116d9c6e48cf3d87903bc54577bad0bb24d99e10010c3109c9ffffffff02d4f21b00000000001976a9144f51332849fb0546182081b805b5fc528b2120ab88ac8bad1000000000001976a914c6b2a32b468cef28a9d4a2304ff83f80314fe64c88ac00000000010000000111bbb5438301722fd575accaf2a839070aa7050fdb48e0da00835f14a49ba3fd030000008b483045022100c88c8f183041c7bb7998ec27cffe2fc02bf3e5a7f2b250423d70a72c0d90a43d02205fcca7bc718117b4e6f1e3ea5670b89682512e49734ed42900f7722a2c36e394014104094de7f3d8b58ebecaa329f2d9ee41c7040225415fe910753f491d2a9c044f721f7568760ca14e5e8c9fc70045e33f714cf83a152dce27d5027990a72324e0eeffffffff0242f33707000000001976a914b6b2df18fb4fa92b4e0f5f96ac3d5331c5cc36ed88ac0e21b204000000001976a914de82acab0f37d0a26ee5a51e58524d5eba30eba488ac000000000100000001f3aa5055dbb96f18313808c7c1305b3bbb5dbcee1c2398528c891fcd493faf19010000008b4830450221009efc33106f82dbdba82fd6319a6b53fe9baec4342d66d7b68518bb651199f0a302202cb1b73072a7a8cc290f10d9fa8ae41b749eb168d71f17280872b200474938e2014104417443fa374c00cca0ea30604c7aefd6f21b374a67b5ab3050075f9d62c12d47e43aad055ba447e2e4ec7676f683dd33d3e3646709dac153446ffde34ee2e34affffffff02bc750a00000000001976a91443262f596e7a65672ca56334a795cea898121dcc88ac4dc91500000000001976a914b1eeede25eb666a34bb33acdc5ae7850abbe81e188ac00000000010000000110c7918c6e46668bbc05114864e3f8fef4e96fa0f6cbed9faa1c753f6536d3b8010000008b483045022100e368c9ef534ec91c1cdbcd5f0e5f95ec670645e8a5a05a226dc3fb89c2d3878e02204f2b0d49bfa0e5f947adb2adb5f5da55b69dc016df97072003368fb79469c5390141048f60ccb14e412221aabf01f713eaf25d12e764505ab9f54d5faafa75482006f9891cd4a57ca98edea9719dd1f4874a5574f3062c585ead24c104f912d88f76c2ffffffff02a61b3400000000001976a9141fe1c54e815d5e667f310ca8f4fc610a06ce154988ac9ea55401000000001976a9140d4a24d35fe37112cc1be874ac266960fb666fdd88ac0000000001000000013e4feb6ed0f5b761429cbd095483bb9325d049e394b88b8f82d4af888a999479010000008b483045022100e6ea99c65c417aef733d0f6feae1a2e43c73461520d50e2bf7626665459b0a8f02200572553dba49b258332a3c2ce461b648ece6649c6cd206be04a6b7c5bdf082e601410420d2e23be09a121d8290649441d4d6a00a69df7f61281e0746c529c7429ab475371435829b91965f719894da5439e69cf04aaadb5a91a4a4d3b5a4eb396f6037ffffffff021c980501000000001976a9142b2a422e2ba5e050d1812a9d4f0bdb3c5c0a791e88ac71073102000000001976a914b8e02b9cd3b7a25f31e4fcfbf4f828ab9a177f9788ac000000000100000001b935034809ae629d9f29f0ded3440f4e2d8baf9f9cf89879b3610f51b165f254010000008b483045022100e63c9ff9aeaa8845a7feeddcda844988163b2c5ed529184121026d2553cb07ef022061528663de154ec2d3392a43a62b2ecea1d5d8fd7c859e1d89786ee2730ca28801410429d01739dace5cfac8447d8551d06718a609deaf1e826a7fc25c6648b88bd5da1cda9105f845aabb8c216a3857826d0aaeb32f0c71c45e574b5634b1820c8192ffffffff02978b6701000000001976a91486df3b2d24ae69ef12b1f0eb2fe4b2907047a5aa88acf43d5100000000001976a9148ab2ae9d4eefdf5c13e88b297b853b8461a7ac6988ac000000000100000001cb21cafaf3b7b016f86233c6364f6cbc16e314ccb4aa11b1ba260d47e1e67925010000008b4830450221008e893cbcbde1824f54b782da2ec8a075c29486273680b336f145aee0c11859e9022039ba1e22d90ab46600e4ea4c97a2f23def73b55a06f694e8569194eead821bdb014104c716b5b08e411785cb2712c12e58ce18c7a3c6aa31f707fd83fe40fa251edb1a9422a1beaab829623b55991f1222baa611c8f6ecc6f5d0837b6903bb49883134ffffffff02d31c5e00000000001976a914cbe6ca3c6ee0d502f6df956f3b9ddb80275d958288acd6072402000000001976a91428c553835cb95c12f1f9dc7b7ba9eac3eb7c3ed888ac000000000100000001f021ac29a2d0b05eb6e2b471c0af9113efcc7c8f6dc85d5513f56ee549cb91c8010000008b48304502210097b2e5921231da06c6c4e5d343104cc70b7e7b197eda82447a90b09f77b7074302200f23ae89a2e4c12fd309c27afedf5055a68461631107ff161baa3617938f66c901410423a38d2d3aa597789d39903b7eb80e989ecc66ccf10f5ca8bd274dbbb703c4a4596ffba4fe62de1aefe4580c761e72c2e1b4c6fce017e239e18888f71a41cd64ffffffff0220e88d00000000001976a914bf0b795fd8b79b7f62796070779727226577843388acf81f6a00000000001976a91438d8af7bc118d40dedf94b738f8fac011f05b64288ac0000000001000000011569a87b45e016068b575b73d60ee9ef7d35a8319a5255e2a547b4ff00794415000000008b483045022100aabf3e1277a077d5247d2a9d532b48a3e8e7b585281f69d8692ab1a988604e1a0220191cceb0cf29cd10aefef6444f11aa2b433d4c9d95d7fa354e61681c2af30e9a01410470d0259b8f0d5034c235c829a8b13915e04c747159f6bb26e89fee3bd9a0c50f60ae594e54243fc7639e1e2cf67c6594533a993b02a85293d87a66f598540571ffffffff02a0bb0d00000000001976a914da5dde883cc084fad0d72ab4cdeb11205fc63bf888ac70110100000000001976a914ca7eaccd4ef037929be65c7706992b055a41362e88ac000000000100000001181fed550dc092404ea20275e94359f3e5d96161353811f48bdff313de0c125b000000008b483045022100fda418ec9a3147fdefda1309bf58137e7921e57d30d67dcced102b5d78e9905702201733f69f5754a8867923aafc9e5c4a96e315be2aac11021ed38b37dd4bb92ce2014104da6bc6a6139bb008454bfc8371141a5fb8ba6de87e9ab1578ab4c31e1b25513d6d1b1b0e66b0e39a29f6baf19f9f0faaf51d22bac02b1c07eb08058498763784ffffffff0190940d00000000001976a914ca7eaccd4ef037929be65c7706992b055a41362e88ac00000000010000000111bbb5438301722fd575accaf2a839070aa7050fdb48e0da00835f14a49ba3fd020000006a47304402200b77bf39c7a72b581b8fd7bccb0e032350f7abb7b4254cf8e0f5248c1d9ae9f70220526af0fb6a3b2cc92a82cb06bce250a06877f0fde151e67415e6a2f28405a865012103d799787474d743ed1b8df4d417783c1b5e2e78a102e33f277a64971390ea294dffffffff03945912e5010000001976a9149bc9957b09c245d39c3917510bd9e05736c67cbf88acf420cf00000000001976a91407981dcf86e5e13ba4c065d9f9476c34eabcfb4988ac80fb651e000000001976a914e65218b9a7683303f6dc805d402d25950257092c88ac0000000001000000018fefa67b4502fc780064b4d10b77cdddc2d0bcd2d69f799e51c0df2552ea939e000000006b4830450221008e50d557ef26f173463a86adba49966dabeccc7ffef92b4e4ce785b88a0ccc5c022052afcedc884a2f603e8a5b12a746795d6aea8226430db51f4bbb12e40b57f120012103674f89df91621af00629f97f566767f688355ebc97fc01d14c51b70fbda24525ffffffff03db3f2000000000001976a91427cdde93ddfa070233c68b694cb85fb9997aece888ac599f0200000000001976a914ff5c109fce9d655d33680d55e9c7a74c455883db88ac7b9e0e00000000001976a914c0192c748170eb5490b9163e0f5f7c3c9c50c34288ac000000000100000001740120c1e446bb1a839c9b9a1bcbdb8fbad2d68055c8d847810088d7a1468320000000006b483045022100d1bc0a611e92abbf8c4e8a44b6347ce1a366b2aba335ae345c8be11b144c638b0220662ae07f35733a14b0fa48eb377fe7318dee6e635d59e3a063234d7226c73fd9012103ce4498a8412968f705d75b1ba7b5d79299e20bb9cc19f4acd8eb59dd0916ddc2ffffffff04c059d100000000001976a914813c4d05243cb64d32b21460360112bfd3b499b388ac1495a000000000001976a9142e143d46f8fc8e6dc94dcdde9ab3c73cbe6d9cd888ac800e8500000000001976a914cba04cb546c9eccab7c6f835d60e0189843ee5b488ac20a10700000000001976a914b31a32c32834bde2651e51e36e22f37cca431e4a88ac0000000001000000025eae9c64a6e9a9a896b4b8f833844a96e6806b0e021307f4730dbbb097fe6645060000006a4730440220680d2fae8d08cf2ded9401c070efa27f98353740402e8b28a5943ba240049f2202205cc09fca3247aaac8c86db9337826e94b6f98f10817539105d1d1ba7b277f49401210224394819d214109a51c2abac3bceafd404a6a0591c1e9100db89f22e23c2ef66ffffffffda990246ee3a8368cc2e827ff0ba41172c9fd3a1089fc0ba62c1b0f95532a998010000006b48304502210080681ac2afc3f59503bd79ae605c7aabc4ac88b66115ed9994ea2db59218e42402205b61511542311259a37d93f9ca5e48933c05cd9c82ab35f4365b631a3c400a4901210224394819d214109a51c2abac3bceafd404a6a0591c1e9100db89f22e23c2ef66ffffffff01b0360000000000001976a9143b5b06bf745bd18b66e3dd4bba1824a16672eb7888ac0000000001000000025725fc135209a978b44c8d242d4e0365dab7ef21590bf6c6b9c6ba33e135331c000000006a473044022074df443fea96a9d6cbbff9a34931134045b3063c203dce34371178014e3cf1930220215dbda357261975ffffbd9039a947bc71acda571e231f12d05b23f91f68eb840121034dd36bfbfdd7e845479ee48682c4f782fe66e85d135ebb826d7ee119719bd9c4ffffffffc07afbf00251f537e8fedcc834f43246f8a97db021818e834a433898721b4be9000000006b48304502210085e2773bd046141d81d01d5b59e0d5986646ff2f2eb186d7028ccbd04199c981022006e4de78ece565e3c81849403f9190bd131acf1d86fc1a6e7cc43c059a95d77d0121024dac20befa60963a0dba41a7625a632d7398e49afb92111d0d4a2c7a8c688d95ffffffff0170cee4090000000017a914c3c8e5cc4486a617748d946eeeacbd99039d04518700000000010000000113564c11a0fb53e31b4c382e25cfe3dfe59e266759fd2895808def70f24bf7af00000000fc00473044022026e6f4ae9c5033efdb48aed1190f98e4177190846a4a66a7336d4dc21d6cc55902205bd1cf2fcfd1c194ce10f204117be485c21c94130f4b8d177f225779ab9a74c501473044022005afa168749712cdbe76694e51dcb060e37d33caad49d806afa3e6ad4189e552022011eec2bd514609fa9c390647561f03400cd67c9f047ecad32224b36f38dfb1f5014c6952210372f70a3f4ea93f6775c0e87486b1308115479ccfb219ac6aa62df34246b32ef02102748c8d6bea89f79627402514daabcd28814e4a543812ae334e101a40212303262103e981b390020a5465c4c3504e2e7f63838642812ead315580a5c3cc8848dc427e53aeffffffff01905f0100000000001976a914f9187f5c76e90d574746bd5f61883e753c0e1de188ac000000000100000002bd1452be9adfb2aaee1c51c312b44fc8adc35fd4c2fc4fcab5b2111c9a51a02d540000006a47304402202b7d09a5b90651e4e77a220000fa134feef96c570d182556f597b7bb8253043302207d0829f620d8bdc86dda3b141cc37e78393cb6e6c3ed88801bc17378ec74f0dd01210259f00dfb22a5f496d6575945175813e211c855fcb39f0a94f5c431fb512bfd40ffffffff39b53904843a12da55a44806f77f0d352ace33565ce0bda2bb21ba3d241353ea000000006a4730440220316c78a229aa870d5c3ee4c897f8924fd7fdeec5ada8a00a9f25445f2601781902206385395c271339a2dd6e285efbcab98d6112d3fc11edb810e860aad34b21f11101210299c4795dac95e81964bea178d62b007fa8fe7f047fd4a21161924783f0d880cdffffffff0140bf0f00000000001976a914eb84dbf2edd461b3e983f7de911239e150cc6f8d88ac000000000100000002d115fa1ae8fd0b6d5878dc787fe79712b546b53316a1f1cd5450abed7ef89206610300006a47304402202e4772a3f45f40da54d54d2d68b5d6f3f0b7f8737697362a0b7f4374873678c0022068d25a1dfe8faccd349a53e3c116bfb7af1a1051956da3f8ce19e74b35314849012102eb8e086efb575a031c5a01d9e10bb3984bb4bd88b2430cc60a3ffe3bd9df5026ffffffff07ddd6f71e0da29004d4649bc51729457c81ada42aadd970cb13b5766f3c82f46f0800006a473044022046c6e3d999914176aec9ad2bf3af460165812b4b1acbc5881ca8fbdf7445bb9d0220687c03a8fb427f305fc5daaf705694537bc8995becd735c72d9b8bb43b0b05a7012102eb8e086efb575a031c5a01d9e10bb3984bb4bd88b2430cc60a3ffe3bd9df5026ffffffff019c160000000000001976a91415a2c078b214cc95d7ad87c7eb45c264f2c9063c88ac0000000001000000027caa31452e709a5aea64e201b8d712751aaa63828dc1a466fc5eb5ca86d6fc79000000008b4830450221008089d52ee9a0ed71ad25441df44a8bc4c2ed82879fa430e73e3686030f5f080d0220099c02362fc29844694aa133f00207f71d7e8ff1650d1ef974f36cf32950b360014104d84611fa78824128dcacf21ecccce744620a8610e906072ae6cb573d01f9c333f02f9fb799afda52ff5116fdef053460f01e7c7a372ec4f94e0bee8af7125d93ffffffff68656e1123c69cf73337643417eebca345d41d5ca847393d3db0e451b8e40172010000008a473044022076bed872ddf06522b16804382c2c96a7828dbecd8e59547d6f46503e4349f89e0220437ae2fcf9046e306eef258a75f10332d0b775e93c0c5bd2920d654f40cd754b0141040d756049f1ec92e3d3c3cf01ae02ffea271c4b4aeecc71f7a278de5c09b9112c2e61db1aa4b430722931a60c4a89479a62f25694d8861bddff5941258f36a1ffffffffff024b630a00000000001976a914a0c5b38f7c2368e96dfc4526bf2ed463ca0d4b9288acb7620100000000001976a914a12136aca8620119ea6aa100ac3da9b99809b69688ac0000000001000000012596aa4b5997ecdd15a1d400697d8e52828a01cd65f7e35651164e4f96c49c63000000006a4730440220233648a5d8773ab004c2cc9d8982498a20c456653399115e38b8e6751a678fd90220479eabf4540a653d4c57950061fb8970a4063873b48b0e5ac63ebf2ecffdf16f0121026f4f7b5176851570e91b518d7d301d557a7404dffbc8a88fcd66bd525c0f3480ffffffff06e4884700000000001976a9149b7687c561eed2073b263a35f1a47753caf5b32d88ac70288302000000001976a914e63fbe349c4a83009a1eb1a365051fec31b4451688ace0775c00000000001976a9143b6aa25bc62434c30a4a798a9e3f3996bef7137888acac19ec02000000001976a9145ecf0cd918f472fb4a2a72a45b46dd95b13530f088ac603c1701000000001976a914de6e34bd2f7907743107141a500c599cb9ed1aca88ac100b3b09000000001976a91431d7bb7e733709288eb30d0f19811203bc7f4f7d88ac0000000001000000021fafffdb425cad075e85adc266dc22005480cf93fbace93fbf9023921c79477e010000006a473044022038edf155b171df595a8f38cc9ef2b9c517134301a7c607a28a68caf809e4cc190220782572761ceb03104779f6a0442e678df799edc73f25eb2c3497bfd1c5e686d001210245c19602bcfeae6f09481e45a847fa2d5391fd13712e9a9a12bbf61aa8e80527ffffffff9f8620f6c9f531ed3b5d1c5f55e7a511c24d1d855aac206c90276e35c2fe0684010000006a473044022056825d30a6ac44bb833ba62f1150fc8a4c2b31a5fd43909c2354065a9746ca1a0220408199839300a0c9137b3963f174a75700c119e88825ad840f061c8eab0a300a012102e20ee178f2eb8c71d6c19c82a1c27a43c90616e0fc8d065d181d530b455457aeffffffff02e2f94100000000001976a914dfba28dc856c9a949fb67a55b234adb957416dfe88ac34c0f201000000001976a9144c64073ba9d839d4cb578f88cf3f72690eddb5a388ac0000000001000000028eea3e838f3a9d04730a6c2c78373437160b36cce20c140ffe56f15c92a003dd010000006a4730440220590cb1f0005d74882aa09c87def0ec1762b7af74ab3ad267a5c09fafab9bfb9702207b708cfa0e4b66a7af158d0d7d4553c1a190887d4cd1c34e04502d366c64cef2012102aa621b1cac7e835b5ec78e6324136d3d70c9ac213dec4aa97b32d691eb081d8bffffffff7a38994b5605c572e160e7b7b9e9de1eb4c9889a8f300d8b7045168e4e03e93f010000006a47304402203cb6f7dfdedc77f35ab86df573b6b853dafc1a28d9154dfe93f8195ba0a06dd602203c3f05e8a5cff0f9510d27260d1c9df01181ccfcdaeddca804c462c44af52e3f012103d3e562c5114b26191c8bd2af9f195c5eb5c8f6b757a7e72016570169c7679374ffffffff02d75e1c00000000001976a914dfba28dc856c9a949fb67a55b234adb957416dfe88ac4943f001000000001976a9143b29af8b165554c52b710dda5285dec00038238c88ac000000000100000002b791f6682e071fe6b384ce2fb0c8f1fd58c867f9ae076e98be8190c454bc5211000000006a4730440220206e8872d69b18b7dc0b16fba168a81685c33b8bfe10da79c0730023bff7a787022076afd2b9e6f296f1fdfdc73d5cbd5fe510c75c647af8ded2b3670ce242d67dc50121023cb02d3bbd8bc227b20b6f8affa80464e1f9f2aa684f2e6175ad18f6f1ed3ac7ffffffff1b39183f6c881581dedce68a6a708602c9f897e86ffc8363beda770c957fe955010000006a47304402207dfd5c4ce70c05ee332904eea35315934125b7cb48e765ac0b9ab6d9600c516a02205377ab5b89a53398781e3e3a262aa45628f999308f3cbdd591d2a62c896351e001210338c12cce00a01ee5675f76a685a9bc57af8b3285a8b074e465880adf6794b8c7ffffffff0264ae0700000000001976a91454157b374cbe22e6d57577b5ea31ba7696f46c0c88ac18196f00000000001976a914ca359613589c6df6e4646d962effd2a6e6b7556088ac000000000100000002b5b715cd300ea36492e8fe95a1001a00c5120f9a3969a47cc9c7191978e87c80040000006a473044022007bd254e07ed53ecf3a100f4ee2539109404f8ce589c70c7e497cb116301705202201d268081223073aef6ac12a3798b367023e20c0ba5a40b93ee331b057ba06a10012103e8e47440766a0d1f4696f5520b2b0c86aaecb8b2a7a33de489c477d753a34677ffffffff0f9a358cb817afba91e264ff1b41364d98628b52bf1a7f0c916a9f08fbaa7850000000006a47304402200dc3cacdecdea6d5c81fe97534afc4510c42f94a6770fe515570c378e10a60db02203bd3b614870c72c0639df43af4441b34379ded3f85d9e5a0bc521fc0746d02b00121022552d66996d64cb87f4827433bb345a0b7a1d3b02f394c7e889fa9e1791f6c00ffffffff026f420f00000000001976a914ec4d996b5d9f22dd1e4ebcde6e06dce850d6d8f588aca0860100000000001976a91474ef9b69d30a2b2af63adc749ac3169d40abd67688ac000000000100000002cc129ac4ba3782defdbdabe80c93569371935a14805aba8f403a2587a36efde0000000006b48304502210092464f2d4cb41ec0d39a450fa9186752dea45fd92714739d5796ae8eb78321ce02206a26d3e3a3313d09ed604d2c4a2b54c640b8a001b0bc0f8f245d0e723d8c0d970121038795e76aea87acfdf50f3ea0a3fd7886dad42d6eea24b31827512298fddc7f92ffffffff85c6b1af317eb00c4996f718d3e4ba1a16f6bada87f2b088ed38c785cc7a4545010000006a47304402204e82c7d2e67150dacebf7d61c1dedd53f42ecd602d47a22d454af6b970d3ed6902205d7f516fef463fa02798a7c298df281d81071612d05a3bdabb9a1129ee8baf23012103e2405329b76406222ac182eb477bebb6bbdffc3ef2e7c593463ce80fde269dfeffffffff029cbd1d01000000001976a9141c6959c775b5052cf11a0f88a2e2974e31a8a3b788acdc7d5a00000000001976a9147c6cc52376541171ff54df4698ba81bdf5157f9288ac0000000001000000029692fd40f4e29b1f0cf49eff3e02e5c929483730421e5a9bbd7a4e73fdeed5bd010000006a47304402202bf7daebd603aaf7f4b9d582f140c2a0fdee2f25fbbb1624c7321640a7fcc97e0220010bf367935d627a51f40e4b127586e8a8b7a0e51e8bf110b013f4c8f8687624012103536b9d1c215dd201bc407510bc6412e95ab0fcae3bcd5cd652cf4a82069f2c07ffffffff2133ecf456f347a9ad36f2746167d2f92fd12b3ffe564f0168e8499f64b0b6cb000000006b483045022100e994ceaa431fcea10c2d694796ce0f4d2ab1a6787bc28fa38501bc78d3877b620220587efccb520c8fbfb31b73475bcb06e680cdf84b98e1e4fbb185dbb66ec81d55012103536b9d1c215dd201bc407510bc6412e95ab0fcae3bcd5cd652cf4a82069f2c07ffffffff0229303d02000000001976a914a79436ae0070b735d13053ab80ff3bc8d3847fef88ac29310200000000001976a914d4851ddc7a7a212119e5966bffdd773a4a79507d88ac000000000100000002a17278f78dc2f7f232559f7648bda45b5ac0de1bf24f394f6fd290f8d053776b000000006b4830450221008d1e8c702eb08fc8f29c2f1e7a92ec0e4feb37ab698327b84d11fd0e449f1f35022029c629969663a4e74bd267d1e8e4a8aa79f9f1c2cded78818ab42bce1c8311a5012103080030c8f06254fa1675a99e8d43bdd3b6cd7c54c1eed27dbfd6fb9f5239a0bdffffffff5ee938e6039b2265bfc85adad30e637d565319385cb6d62fd1a90f710dff89b8010000006a473044022062614fe509ab2087ad3dd28a613ae2d2bf806e445770a6268455807a781fa95902203d732e0185abd6baa5bccff351d076a8e2dcedda6929fa18843457d03aa71f9b01210359d7dd8e411ebcf6979752e44e1bff9d89b40d4108704cb7ada6c1c36d2c71eeffffffff0280fb1f00000000001976a9142a447615d9816e83fc4763a579965e1bdbd8070e88ac2f480f00000000001976a91478e5fb84b45767d0e16f8056b0b3c54bb1afe7fc88ac0000000001000000022dfccd5d3548f6977d59c7b50de23ac55053b5b7266dc7ff6277089e40c69bc3010000006b4830450221009b6ab9be70cc5ee818b2815d7daaaf1b987bf553aebb6e657a4abc6674edc7e40220305be626ae66f2f9e5cf0a9c95b586300f1b75f43b4d3ce8fe982621dc9103ae0121037a1f7216c20906ced708b56f4699dd4e7616a504ceb355af4021049737f8f3a6ffffffffd27117a6d9bedea429a9afe15a58e669a462b009cb712c705df1ccd2f47811c6010000006a47304402203a6933c7c2cd22ae0eae63e8ea3c708110a1ec495dc0e9471f445847885d871d02204b4de74b13180b1181d278c52e830cdd876595a86a0120b2cddbcd429cdd42a7012102618c263d7426a22aac903249263f42eb9781f7a1cf5c4ca1b191d3207ee9a2bcffffffff02f09b8219000000001976a914f7a6bae5731af376f690551e17a6f272e43bb25e88aca040dd00000000001976a914f00b08101bd21c669f58e9eb669743a31954c29988ac000000000100000002e9ff749dda3d1cc920635d8add3ee2959f4eb8e6de08892ea447b813d3911333010000006b483045022100b2524879f4df70682b0193b44f524a959da0c1c06076249a4bd659dc4b7af43702207d1014a1c1d18ef27bca1a9448acde908b9d778a6fe70af278a38d124587485d0121038e6dba49984aa152ef0235b279495490a48d3af44b1708c10d29968c5582b68effffffff8b68f63f412ef83d4d2043adb7cb199b515f790ca2b5e0936e167e228fa8d6ba010000006a473044022031d49e83a109d9b5a1c642c1c7680c9b59f37f808645fa48d63c6ba0dbeb1d6002200cd3bd2f7ebb25e5ba829dbb070a876c843669e516fda59e6dd08c00652bc95a0121029f5f4a4d9cd48691cfb8d8662193193271affd0d29b359cdfca0e1b5ec4233c9ffffffff0243adae01000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88acb1f66502000000001976a9144e47227e4f9265c307be2d9c116ce3bb5984fc2288ac000000000100000002fa8bb8e245285095b5b6cc54938a1b7ca962b0ec0253df633cd8a73f30a754f3000000006b4830450221008e2081de5ee39db3d5cae1823aa28dbefdcc45103604ebe41ebfa40d629999b402204c6b9a411ac007c91bb45a89f08fa8d039dd1f77cd4ccb0aee62c7a3930f913f012103acd7c49fa50c2d6d0ebda873cf8f2b853e55fd688972e2e07aea867abefc4744ffffffffae2e01136a8e2ecf92696aefe327f9a5d1d245759f8cf9b3fbcfafb1ab58432e010000006a47304402202627cf535e4a1d7acaac7cc1d35e1e7de4a25338755754d8fe63032c35a8aad202201ea21b0f1a766f919a5c83d5ee75043a18821daa04578cd709cae4c8c00fde58012103327a03c8df819cd44719936978102598f80e0f3e2a755f6810f224d3ef1e09b8ffffffff02cf0a0600000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88ac9a154f03000000001976a914a1196b3eab885462bb15b22a25f84a14811e6bb088ac000000000100000002e886cdfd7c9c1744798d6dbadeff47e1c49be1dd52646f568f9acb08d7fa277e000000006a47304402203f4c3a66f0746b942e36ffecad93d74112824136bdf9c598d839a92719549b3c022028f6d45d304e26747d48c3bec3045ae3b239ad516007b3d38badb1ea50205bae012103f0d831fce8615a857d39e695f45f247338afc87e85abc903598db38a5d628895ffffffff0fe0cca889ad4349942ede802af2053e63c51087afaf540186416a8041e2556b9a0000006b4830450221009355f5d5e0473ff99116f25735db998516771546c8a62eb5797a107bb924a19802203b80649b9fb59855601d19bd4ea34cd838077af0b1548c6773bed05230cba3a1012102d8da4b76f21aacc52fcf0ff6197c34856a18978fe1e7337b3f433bb5ef0f548fffffffff02219a0100000000001976a914bdb11212ce17c19563c95fee7c92149366b33c4d88aca7491000000000001976a914fc0abc5bdb6536b8ee53491f79a307b7e41efafa88ac000000000100000002114ae6e237a7608e1ed77f8eb4418b9733201944f547962e1bb8a7e917e47b0d000000006b483045022100b4bfa5600eb69ae778c5161e92b2ac264d51fb9d8290a1ce7c9f6385711883eb02203849342ead32d95c83b0732aea56d037e01bed1092e71fb4c5552a2fa591c6fb012102f9740daa1cc88c48e8b78e3b889af2f21aec7e3cad7d3d8ed6574572f1c31c5dffffffffa56f6719de1ae0f491e334f780a7204a833cde3a950fd150935d2fece7a83805000000006a473044022016761e99b60ba1c9599d9cfaec54c14f20582c8906a3336b1eeab77a899ceec0022054987514ba0626219ae5ba4eb0a0183830572def6a5073229853f4b96ba20cae012102a46391bd7ba047f50f67ebe58ea05b631df90cb096d0db736357bef6216ad0f1ffffffff02445b0000000000001976a9146ede94d77318a624286101afc4f12f5d66eea8ce88ac5a4f1000000000001976a9141e22b511b0ba3a65a794f58d8dfcfc58b35b671588ac00000000010000000268fb85cf40333c9d6c68099d574c189578a5a0e22b0975080ea340d99c17541c000000006b483045022100c03f78e69d3473b143d318b6b26782427f26865cb4d55011f020cf8a6b804d76022029da988e434b878ad34db92a6cb030715f9d20d2e3723ccd1718475fdfd76eeb012103fe9fa8f0045869889558c255ebba869b0f5bc2931ed2412af8dd05841471e681ffffffff1af0ca6a06cb4d3ff0708dbcc9b070b93ea843a86f67d6ef796d8b929432cb99000000006a47304402201843eff603cf74c309c6775cdd03e1089c4d47bb93719efa011be83a0a78f25d02205a6fb730c271cd701e0e7ab21bb0eae77a335a57b28063be7dd13a7c78cfc286012102f128af487ba7bd9a2c5363f0d858c796528c8ceb232eefd75c881aa43f4574adffffffff02400d0300000000001976a914a9385529fdad30064bda677835467c1059118e6a88acd6500f00000000001976a914b1f1b70012d186c87cae45b978ccf17241d53e4188ac0000000001000000025fa2f80bbfa0a59e95d5d21c7b3978ecfde71462e363c20b0f6874a732f69ee5010000006b483045022100f2f214d1eb1a9ac723799145d3f889ac5b21bce51ef9b48687d4af3293b1113e02203d891b3db82702852681a5bbb1b5ee1b0addefed37098c2cd3ece76a4ae0740c012103b5e87580b49bb682210712a2134e733b5335c039d01b827eff509abe7d0f2cb9ffffffffc5348ea29760b1ed1a0ffac627a58314c860cdbfa07864d88523f9ea89dc5420010000006b48304502206b9d8323493158adda276247574802ba9ab71a045c449045cfa6430d783d5c6e022100ed9c44471fd75fc0beb2690e67d052a0160692dd1ce5dfbecfe8da5f2a45f97d012103b5e87580b49bb682210712a2134e733b5335c039d01b827eff509abe7d0f2cb9ffffffff0240634800000000001976a9143cc8164e264fe4ae736c4083410d4c2cd30f452d88acc04f1300000000001976a914b6c945bc0f1ff79d1fce2b5864f5cdd62e0a7ae688ac00000000010000000269705dc38bcaac091786dbd082e377e071ef1c7b0f34b3e860ab97157bc9e090000000006b483045022100bca2d06dc1d7744ed538ac733eb6b107898e9395c458ae6f87678c0d4c62c06802207c0a068f528f67f046f63ca0df539e82b18441a6019add90d7fe6079db7729530121035e67c94c80626b9d35a4eb2d08281ff89d736a6b531f22c6731ad51d41355745ffffffffe0057a257aeebe7b2cdef5890ed9f7c549f7724716abb4e4e88cdacd08e061e8010000006b483045022100f1575f5258feaa5df6fb9cdb96875284e36773c26c8f689b56b82f5875049168022052ffc8bb404e8210ac9895d79569759b02bb83d72d239f67a840492ff578de4d0121036542ce5ef42cf0db962d58a183291deb34be7cf5f9a2c3fa404b43c5bb5e37b8ffffffff027000094f000000001976a914fb19253681ef5bf4ea16c708643698dd3846ecb388ac00cf7b05000000001976a914828d5dcb5c89dc352289e7d1d201b3a6ab3ee9b388ac000000000100000002c2211586b41a4bc97d01bbc2bafc4074a46aea31058c34911a7ae9e54087cb7f020000006b483045022100935217d81b8a302c4c8d706dca706a6f0192a531d0b0fd2b5aec33956061d069022036c58a8d87409387e0fa3db953b7dbd678f9bbd6ee058233b6a3d197548a59aa012102cd1f1602f26dde53fee26e989a16785fb5a4de6f2cec27ef09a8eff8f1306bd1ffffffff6c7e953c87dd495747226fa97c8888a99d778363aeadca95a1c93bde4ceb88db000000006b483045022100a7b9b1afa8bf629f2768269dedb1d6c5601fa7b8c71f2943d663f04cd861d89d022057d8481172aa5faa69c408aecf6ac67d46b24314abd1275b8bc0f91b934002900121038cdb5ab9f97b9e5c7a485d6c3b1577a2da3785e86479450b27a02e634cc642a8ffffffff02a0860100000000001976a9142d5e62586a3d244c5e3c4ecc32eaf7630639a1fe88ac6b470f00000000001976a914c6aaaede9f9d43193b7749d5c57c9ad1c4c327ab88ac000000000100000002c481e49d3c43af9803e5c2ab43cd65f7e683a9c4a582d192df4565bcd3439be5010000006b483045022100808ce8f7f0ac830207b9bc54dff1b11d5c0ffe3381e8b3de7854f1cf4fc2e90b022016b5a54a012d494438c7c04f37e75d8c7cb6fa6ead1c90323d05fd17625e915c0121030ae096c2324003b60aff4614385a5d0c78fd0202fcbd6ee74021b50fcc394dfbffffffffab402046c0ce06d4bb83206bc558cc075a3774ecf64a9d3ad1c3236143e46f2b010000006b483045022100a3952b2e1ce07249e655071d301fb4a3f60012fb38a81404cbacac9340aeecbd022029e2916ffe02943932c789635abc91dc213bc886422209f26ee6e83b513c5cc30121035897535e4918dcedbf540e47b1f44a42c2abf2918af9f83db348be90df4d6690ffffffff02599f0200000000001976a914dfba28dc856c9a949fb67a55b234adb957416dfe88ac6168190f000000001976a914e95b7436132f3a0a7a4f58b11708a73b2d597d4f88ac0000000001000000022f924c484cacc1c8008cdd196f03c7aa91a9a7b688fc0d7d16b3eb9f7a085f3c010000006b48304502210081f30eaaa2f75c6aa26dd1b6a1a4cf3a06003cf9f38e8d903752dc8bad382246022021ea28f2ae4350e8ca479288fcd07e93cde3727b087c923d8b979b2160c06904012103db1f92c07a99df028296c4dfa2f8eacc0980611d43613e279f1d71da0cebe2bfffffffff736b38a753465f81031cd2dca539625c0e785904a363c92ef57854357bc8f09b010000006b4830450221009602d7fba6edb9e06a708e6bf4d7a5d0fd4afdc82214510841c4225023c098070220037446eb63435bed4552df905f1d6a44b1252815adf3f1bcb4c5b12485b33891012103f0dfafbc9070eb84f4df5338e0a4d661e5add8e4f9d6f41000f14408d4204088ffffffff0200255602000000001976a914fdded20c0ea9bfbd6277fd8e662a6814319cedf588ace95ac402000000001976a91460cbca5891b04d6db63338d9e59048e77d4d90b588ac0000000001000000020e2a262144de4c498d3509463bcd50b6b02bafeed4adb4c7bb0d18f52cabff12000000006b483045022100fa08411f7cb42bb615b713fbe21e0257b72cb4f5f61c5a668c545cdbda8eb785022059e5a689c2c9d5260efcb0df8437d0033618cca583e0a35d97e31599156d8398012103c30c6695c1cd0570dc692a8223a0c72259377224721c0bd215cfc181cd7fdbedffffffffb01ec2d5d2476756358a2195dab0c77c4216484cc43965b95e01bd237438626f000000006b483045022100d0479500671b90b83de9eaa4fc369337b3118070c97226311cdfed89b0866b2f02201743fcf337a267c1ba5dcc1bfe186c98e51d8bc7788c1c329007bd8027b6cf4a012103a1be5261bc6e5885d1f881d016282faa9bf08205967be417085993db989169eaffffffff02394e0f00000000001976a914ef8994da5f26394a1f3b772fbf1b07a3bbcbfdde88ac20aa4400000000001976a9145c5463f5273c54c6faaff36f12b3e3d2fdd58af388ac000000000100000003b5dc3f08854409bf610c1369338329ecbcabbd30f86813ac44eaef68b2d398aa010000006b483045022100932a007751ad135aab3918808c4a262c728d1f0bdea0f8fb68dc98ed17a5b18c0220716ceff39e163cac1882f3a8abd9d7240fe426067281417f84f08129e28e73210121038ca47fb100bf5ecaccd7378c7d0d6320169d6192158f82c6940967c35ac227e2ffffffff7946a2ac77792419d935ec7b08a666d5305e6db00f767a10ac9745b67eb62478010000006b483045022100d5e5653a8f4f90f29686b27b0e3520ca157bb6f1f19c05dc2555a3b42e83ee7002205b4da1a5559e18fdfc12d9ec79cb566630bb56f80fba222c28ac4a651e0b37410121038ca47fb100bf5ecaccd7378c7d0d6320169d6192158f82c6940967c35ac227e2ffffffff8ce02cc3f66713b94f7dd4a9af382f3321c49a925b7dc33d3c45f236bfa5817f010000006b483045022100ce81963ff8916fbfe939d17efcc683b7eb2fedc3f7d9ad3e7d8427a14fac021102200534fadf789ac9c605650f749e398e40792e0939764a6b2974364d6a69461d1c0121038ca47fb100bf5ecaccd7378c7d0d6320169d6192158f82c6940967c35ac227e2ffffffff015ec05900000000001976a914a78b8d26957613f8d16d647c70213eb7e705266388ac000000000100000002c5ab219f6881a8fed6c8fb224630b44c51e9c75f6847633533d5515c5a9a1724000000008a473044022071bcf7933a1a325667060e2f689ed4543433b5457418b12e4e5aec320133966402202b21b656d4f9f099e82b8f013578d81abd35a06fa6d3fba0fa48e26ee992238d014104293397b707b5a23a9ffee09940b3e16d9dd585dbb80e0b7ef083148c492d2b32e65f878c0d3926fbeaedbe0792f8a2bd04da33f8dbf507126af5078c044a1db0ffffffffe296e946ad2212a4b4b4ecc1468a21576bcef94c965cf6e0c4a5a18ec96d2a37010000006a4730440220656fd430b4bf4a79b211bf6e82a74fbaf13c23f44ff3d4f7ffded6d70a2a28a8022048c458a111246e53f4aa47983b1ffdcdbb15c9bf519eddf34c0cee5f4c0f45610121028d15246e451c1b64b013ad3e83b10cca9805aa0f1aec81149b2e02d71b77bf4bffffffff02d0a11000000000001976a914f5710c7a405f1aeca11b79ed8203ae5328853ba388ac20a10700000000001976a914f0dd368cc5ce378301947691548fb9b2c8a0b69088ac000000000100000002aea1c43db415e4e30a620d9de6557d1ec730b52ef7af744742856f00d122f579000000008a47304402207cc4bf147281ad9a57757d7ad9f7fc1164ec781fc1b1edf6bcc7a5b3f344bfc4022052754cc113d8b741f65be90efd1bc476581860132b5281cc58aca1f7ca3a3319014104a6c93aed872a7a83556c454db39973449982278c9d38f2328de2798646909f58552c6dc6d59c6c1da81c6bb180aa08ab13ec4bf5c7f39a995bb9758d19d60c7dffffffff99e274fce738828e563324729caa0767adbff6872e728ac5d4f9d494ad3cd848000000008a4730440220527f4adb1580aca6885fe0766750c91b4763c87b6509e81f0e54b33c9cf021ee02201998d3745caa90f7d56b175c370ba6a75975a80d60276ae120f9b6dad3d13f59014104eaf51b074e8c8b59badfe96dfd9458fd07e6368ca94116d5eea4fc7976c063e89463ab797da2d51c538eebc0974a95a929d13e98edb6563287474af7d1397702ffffffff02e69b1000000000001976a914f12aa4feb7d9803b624d85d72538ceed5aa2898b88ac8a8c0100000000001976a9146d116a93760198d2f043893ed5d8eb9088f38eec88ac00000000010000000205d4d2c1e92ca4e05ae626a32e283170afc735fc60904312833ffe31c1f7c8db010000008a47304402200eb58e6e83d58cbc8f99e0eee1fc3cebb722e423715f552335095117643fe28a02202e75a991ce1acc9c9b31cca94a558bc1a9c63b822cd66b46f634882824a7c02f0141042ec075981515fc9020e95c8d474a04d520100e17c48e0c1304ec35d6e33fcc8f7b7ceb2dd047a9d92a3c739089faf2ab3aab7311ab11cd882e48de02d4da9997ffffffff5ac4ee047e29eb7050e4f2e9a43195a1f875f624ef9d46daab96cbd156725c76000000008b4830450221008c39cb069d681752b00751ad5dccd2b00fb8bffd08c9ad43ca59bf782792fcd40220520ab6e4db72270afb6195a02d11049aa5410b5b4f9c69a1e13b9729fa960f890141042ec075981515fc9020e95c8d474a04d520100e17c48e0c1304ec35d6e33fcc8f7b7ceb2dd047a9d92a3c739089faf2ab3aab7311ab11cd882e48de02d4da9997ffffffff0247631b12000000001976a914f30ea2308c4c059b40111232999ac8ebf3c5c60c88acbff40300000000001976a914af50323ec6b3b12a5d6ac9ad81799b2f3e37ff8c88ac000000000100000002dfd757919106b76174a92af02561da7d4f804d389b06fc0131c107814fb3ecba000000008a47304402203834dd07a1effce5c9e474e3ed3992d3d7a0bc531a907fffe631ab61844147540220744e183eb5329ec16c0b2e65acdbb3477655585ff1805cb170813117f49f298001410456a9625593897575b54771d32d7037612c5d8ced907eae645d43aec3994dd010d9b43db7c50e134c6bd4644477192f5ec11bd838e943a384d5410b35f6e11357fffffffff7c3183ae2619c6d6aac6691339658391e47e2cb71e9eee8f3f88fea1a1af899010000008b483045022100ff84610e9cabbcaa98bb83ed73645436a31792e993bac9a766ce976aa3a12fc60220147bb35a35c2b426625e6b828c779bc1240e26f582ee4dfd1d51f1849f82652e014104c735efaedd169c5545c2eb27bd21fb50282798090c410faac286f3658f778f1c8286062f749d1703102d19446a53c92981a64a56de3dd13c2ab60ff18646e7a8ffffffff0200a3e111000000001976a914b104f5f94cfb336281c25d23a94d58b4d6ff310188ac94ed0000000000001976a914394c27ad741f345520157abccf2097a01de4d9ef88ac000000000100000002bdf33f8fcce5ebc3a436b9c28a61fdf8002760ee67a4bdef070ccc6ebdbc4844010000008b483045022100e5b09c224aab23028920f3d053cbba686e933cb92865a4177a62b6d787bddc250220183da984c55b8f08d59d851fad2a9496bf0de4f1e921a8249e452b6777d602ad014104060aa2bb92a0ab8a996038e393b3b0a9c89d77fd7e0f79fe56d2425ea3d249bce201565386a82781d1a045a8277fb69c982f5f7f5056a79c21c8da8cbf9bf2edffffffff31718e811b1f655b2d1495a8f80338781d27826a3091a04a8c33247496812653010000008a4730440220360566ef60561ed82612096495f0b070e67daac7def829d2e2b7c23ed81397f602201a156960cf0f946d736bac5d2d76976deb3f0721f43438926f7df2e8dc16443a014104060aa2bb92a0ab8a996038e393b3b0a9c89d77fd7e0f79fe56d2425ea3d249bce201565386a82781d1a045a8277fb69c982f5f7f5056a79c21c8da8cbf9bf2edffffffff024def3600000000001976a91410ccd94064fa2e1dfe3c3a1877d296d14600636488ac3fc60000000000001976a9142cb1dd92fa9aeb9420d35bdab9fd68293a2e6c8788ac000000000100000002fc1609b18ca3fcf95d806e06b3dc6782522838e7a3dee132bc43a44b1cd74290000000008a473044022024b4ffeee484e590c6dcb573630d25fd02d7948881083d0ac1997a54837ad77702200d02963fda604beedf1f254b0d37d2d95fbbc9f062c884b1156fb9b51b67a33b01410464be64caf9fce8219048e43f1679893f36a7817a727305b5873e9796c3fca526f94b46cab4901267a739606972af59619455d380a53d821ebd6e657f0391addbffffffffe840455f404eac395dc37fbf4e068213bfddaa38f1041407b7f17ec05df3e6df010000008b483045022100fca8e796b514fcef86ede7b2bf30375356ac18e31dd73e03fec9c04c42181c7f02204fc9595d11e61fc7bc6364325c89ec502daee9c2b2ecc6ecfcbf92a1a31dc368014104c39fd3d1cb89d5be371aa0837d0e93feb5ece3bf0f6d61690ab6c1b126730b3b90bed98c19b1a4818b2edfbd927dc9d450f3c9ca2c01565c23f89e0e806e6579ffffffff0290051000000000001976a914bc8d74df37f65c832ceb7e58464326ec9ba6998388ac9e3b0100000000001976a91492251b417cdbcc4eb991b4cb848fec85bd9f306888ac000000000100000002ace568f57549ad4d9d164c87709b5ca1ba3e29395cf70f1eda3bdac0e3a5b7ad000000008a47304402203e9c28e46d3027ce061046414f9be2dff479ebe93db3f7cc911eb39102b13af10220018fd9ade10af3b712ee00484e0ac296608e8c8aeae89ead469385dbcdd03f380141048eb9167d6ac5e47a6e53f4cce771be822a615a6f919661705528e8155d8d173d67ee9f0ca409a6697f2727a6d524692a335fe6766deeaa46209f3fa30404f01fffffffff6b5bf4e8492b9ea3eb50ee8b5823da3cd75f31f14bdaabff945d235093d16808010000008b4830450221009b5251ef4ac5fb22dd22d4bf4a3751a9f344a271080f6c6d449115d76083d74802206a70be002af0c7c4f3058f74acaf39d96f9b770234404934ea81fc2cb3b5aa3a0141042f53c8e430be2cd02d415f166ca79da8fa9ad64b3c691aa1c81543b2e299b12f0007c3051e0be2ce92c41295767dacad7959c448eb660fd8a806949a06b2658affffffff0200a3e111000000001976a91488bf392c6adea62ff4dc9d6d55a7826f345d739b88ac6eed0000000000001976a9144e03e6ed32f4d0f3585dc4a5c771fc589a0b921e88ac00000000010000000288c10545d1b34990a39ec293f61211dc7a6871a4d37e0c7cfb8df792c835b913010000008a4730440220760083dd6480a37ec194e2477714ed60dda6519e555e85060c08a4fcfa8616e00220565999c736c4f7a695532d5ecb25dabc68c89b33190980c861adaa524f182cae0141049b6c72b3831db502ed62fcdf85534de12f3d56a222d993e26e38fe139e59b0d650782f9650d7607196dce66374904fbcf1baebd6b5d7dbb8096de648ee6d540cffffffff49af6fd65d2ccf5265bf11594c5c5cbb9c10301bba8f837bb19c25ceebc0e1f6010000008b483045022100d13eaae86ecad48669bf83fc6207f3a47a105e5f4b1313ca46807fd80271684902207ea29df51897b053edc4419c1a68eca6420eea7f185e19b7a5db223b5142a7630141049b6c72b3831db502ed62fcdf85534de12f3d56a222d993e26e38fe139e59b0d650782f9650d7607196dce66374904fbcf1baebd6b5d7dbb8096de648ee6d540cffffffff0280a21900000000001976a914c3de9416f7f92a40dee37a2d1a90e4733622e02a88ac15240000000000001976a914efd63a6eab86c082f65232607f41df7b3e22fb5b88ac000000000100000002e6d394ae5bd33ad5b3b8fa0541ef2adabef79e061fe512088c551edf1ce2a201000000008a47304402206c1e3387f59add5d7783ab4853eeb08b4d26e3f334bdc2706eea31a49de3e24502204166271c44c75d24a978bcf5d04ab149d033d6a16799c8869d9c9ddc42572a9101410480df6adca7edf7b6ac450a470b0a00b67eb82f7739e7b829fe3985ca2d1696f161c7a794af1da6d8e8cccd1fc24de7025e37a83989bdb484274e4f1b531a5c47ffffffff8a1b54c0a4d3afc521de01f3d9040a7b7507d73247abba60f719a967bb14433a010000008b483045022100e97dbf54aa2905cb6a48ae02177affff2542ea62b579d1415c1efc07935f9d76022062dcd24e07f2cd043bec6fcf2b6e7f5d83ee87fc33da7fe75391d4e993f3494801410480df6adca7edf7b6ac450a470b0a00b67eb82f7739e7b829fe3985ca2d1696f161c7a794af1da6d8e8cccd1fc24de7025e37a83989bdb484274e4f1b531a5c47ffffffff02bf450600000000001976a914da5dde86d69a5d9dad88763f2df4b048953c7d0488ac9ade0000000000001976a9145f2839e8075dfe25989942ad2778a6cb1f28367a88ac00000000010000000219cb00628209dd4814a28f716e83460ad240420743e46c5f925db2cfd718238b000000008a47304402200bb788cf1c128107de1a93e1e21cabadb15824beeb41d232932ac13699cd11dc02207849c4b091e3672e6f176bd5b447fa3634e83b103926ad8e856adb7e41c4d9dd014104293397b707b5a23a9ffee09940b3e16d9dd585dbb80e0b7ef083148c492d2b32e65f878c0d3926fbeaedbe0792f8a2bd04da33f8dbf507126af5078c044a1db0ffffffffcfd51f86e568b026d11be583c597a125845de6065142758e266c6dbe9db8a27d010000006b483045022100ee430a5bca97fc7ac70245c9f893896eea6cee0deae2919c8000c3e7432356f902202302d77ebdd4a1eb3ef1ff738162ea2c368216e2ccb5415cd455c9a12bd36a080121028d15246e451c1b64b013ad3e83b10cca9805aa0f1aec81149b2e02d71b77bf4bffffffff0242bf0600000000001976a9145f2839e8075dfe25989942ad2778a6cb1f28367a88ac88b40800000000001976a914f0dd368cc5ce378301947691548fb9b2c8a0b69088ac00000000010000000219cb00628209dd4814a28f716e83460ad240420743e46c5f925db2cfd718238b010000008b483045022100a73c958e920a94dc5aa2b031d9fafcccb2bbc6b426d15f56be19eaf95630b44602207f84e5367645cb86e51eda70f67b05532b62f7500785d9028e7b68eb08484bc701410480df6adca7edf7b6ac450a470b0a00b67eb82f7739e7b829fe3985ca2d1696f161c7a794af1da6d8e8cccd1fc24de7025e37a83989bdb484274e4f1b531a5c47ffffffff36412ad0920aa5c363524e445f8600f6301158d727288f56c04ebc120f7a5140000000008b483045022100b6898b1f3d301f4fbb81bb2a92de1ff3c10cc5c07cd2a91974aeffeadb2b1bdb02202d68f25865c4e11922e60be8cd4fdaa887d4275a611069646898d3e2eacbeeaa01410480df6adca7edf7b6ac450a470b0a00b67eb82f7739e7b829fe3985ca2d1696f161c7a794af1da6d8e8cccd1fc24de7025e37a83989bdb484274e4f1b531a5c47ffffffff01cc760700000000001976a914da5dde883cc084fad0d72ab4cdeb11205fc63bf888ac000000000100000002181fed550dc092404ea20275e94359f3e5d96161353811f48bdff313de0c125b010000008a473044022033dbeb610009361bcbf5f8984b2abe7fe00e3e48d93f4222d2e82a34208cf91e022056bc9291adc93cc9e3dac7edb71ec1a4e34fc97ab428ba900832c478ce89bfe101410470d0259b8f0d5034c235c829a8b13915e04c747159f6bb26e89fee3bd9a0c50f60ae594e54243fc7639e1e2cf67c6594533a993b02a85293d87a66f598540571ffffffff3d8538714482ff493bc11d89d7554d1bd34fcbec692a97ab310ef0657c257bd8000000008b483045022100aa0e9191f91f98a11ac3bc148bc63ea268973e1f479e2e0f576a90a87c90a8400220345923cee26bfb4cef2474f59a6bcdc9db96302d47dff5b2ddba3fddb306f91601410470d0259b8f0d5034c235c829a8b13915e04c747159f6bb26e89fee3bd9a0c50f60ae594e54243fc7639e1e2cf67c6594533a993b02a85293d87a66f598540571ffffffff02a0bb0d00000000001976a914da5dde883cc084fad0d72ab4cdeb11205fc63bf888ac50c30000000000001976a914ca7eaccd4ef037929be65c7706992b055a41362e88ac0000000001000000026f8ce9f97b17ef4a29d33e7f0f19a5c0d379048594311c460e15783d89e514ba000000008a473044022011420ece4381ebf2880bbb3f472a832796532fdec42fee694d546292b2ddd56002205dcbde0dfabab8fe79416d3df0a663deff9f45b7e37ffdae76e334a357cc8be2014104da6bc6a6139bb008454bfc8371141a5fb8ba6de87e9ab1578ab4c31e1b25513d6d1b1b0e66b0e39a29f6baf19f9f0faaf51d22bac02b1c07eb08058498763784ffffffff3cc8543ae0f38541ad69ac9c9d4af6acf968575aee9eafab07017b61277e7b43010000006b483045022100b95b0de07d7b4ee5d89db1411b4a455a81daa9bd1b7fe45a6a83a451be94d26e0220026b410960a98edc0521a8fd51a80354f8594eeb2cdad94f300063554a92f1ad0121028d15246e451c1b64b013ad3e83b10cca9805aa0f1aec81149b2e02d71b77bf4bffffffff0220f40e00000000001976a914ca7eaccd4ef037929be65c7706992b055a41362e88aca2200900000000001976a914f0dd368cc5ce378301947691548fb9b2c8a0b69088ac0000000001000000028773f9efa141d42f501f5cc1c8694ba847a09e1113966559a1cf96d3198687a3010000008b483045022100b12995e84ab5b91d68a45420090bbd2a4d4fdbc91e48cd0e2401d83551670d48022051b21cf5d1909f81e6fe0f5e1edf2283903e8092a1d1b24726e4823442714d4d0141045004624f44b8d7172fc04c126c2629536f533c0174aacc87070167a4b6ab65981ffd6a8e220a53198fd14d8f1bc82ec0ce8db600c7390cf2a74808cfd896f002ffffffffa38749f84b00ffd22e22de1fcf6a5bdc3070557f8bd800e7f4fde67b6719bc89010000008b483045022100feb99393b1e4d80eda329f3146208da1f13204151955f8297d7bcfd6a67e438102205220dd1c50dccdb482c3427c768da37bb71a2d191b21f4150e36a06ac273cb130141045004624f44b8d7172fc04c126c2629536f533c0174aacc87070167a4b6ab65981ffd6a8e220a53198fd14d8f1bc82ec0ce8db600c7390cf2a74808cfd896f002ffffffff0280841e00000000001976a914270349d5f1a856c2317702cb4b8c9a3e31f76b4588ac50802000000000001976a914543027ebd4cc39877b31631a8b616e5229bf043e88ac000000000100000002bb6e625354fd3f403717fb5fff24b4f00cf5ef52d4f61ebc53e56b26cfb5f164000000008b48304502206e7fd08c23d34af8abe9abba51b9015ae59828e60d60ca4b332749c652f515f4022100a149fc9b3cbd694fa6b4ee658c97767c52405e4142cf018b428107fa2bea823701410426f96e96c52076004e0bdbe21485f69512f82d80980511d76e3b67ade5a58b2a3aa0754c78c2dbfedf89b7439268c02b58bbfc40600db582c2030bfa907408b6ffffffff3e8e253918d27342899a518d083278646a388a348fd94dac0281662f5266f952000000008c493046022100f348ea07d739eecbebc93656b4185f4dbafdb3f61e777ed463d36733ae1c5ed4022100e84b7d09d6bd5b192fde407a27b7f8114b4ec6012d3bea28d760d64204e2acb801410426f96e96c52076004e0bdbe21485f69512f82d80980511d76e3b67ade5a58b2a3aa0754c78c2dbfedf89b7439268c02b58bbfc40600db582c2030bfa907408b6ffffffff02610d2900000000001976a91454ab536bd2c85df8ed88c3942427c415fadbc07488acda351400000000001976a9140df75ad11969c404099bbcec9446ce766a41221388ac000000000100000002f6d5f482decf065e881e3b8dd18c3d53ebbeb82e24947be82d838f06d4d9938c030000008a47304402202718a4644f526346da9f44c820607f162921a6e6d741e2195d0885d238dcf2b302207811bfdc67534ffaf9bbdaf4da3f47a88cac37c11cff6848ac04436abab640e6014104689dd09a2134c5c6ada1541fc715c292395a622fb59096b942e2dc13b8318cec2f3cf1def51074ca8cfe6f2ba654e37430b01797bbd68d529a49ec3cb23c80a9ffffffffa803e6094b44ee1049d88bac8910f4010fca1b62fbc845760d5cb63a0d80bb16010000008b483045022100a602dc66832a3ec78fd258e0251a106f8467eb0b83f37bc4d9997b840b8dc1c1022000f04d410a6736330da64abdb7da91f7dd21fe57ae31f292a3b43e7e9f22b6cc01410452fac25ea480b3483e56df06f8f34ea12ad9f6efd071c792d8d64355fe4da6dba9750cdb9003dc9744042be98cfbefd42429c1b2a2e46f4e28345bb493ee1e08ffffffff03b1210808000000001976a914472e53c0a19483ab7d32a9debc65721789f00af888ac138e6208000000001976a914f562781e972686456514455c29b0d0c21f3abb7c88ac94ed0000000000001976a9144a36d029c3bfe8bbbeb4206478b1552b612415a088ac000000000100000002b85900e96279f8be262c776ccabce64f557b4021e8f671324a3e92ff7adc60c2000000008b483045022100befee20276bfe9a3a9e59965b99039180d3fdd75afc6d571b1d7d346a75b04cf0220778c9c5d793aaf2284c2ccdd52cb2714978b7a13351a73ca4be693525bfffc7a01410479ecc33109084e334c338e31ad4282c39440de359d946d4e66671c6478f80ba84ce6949681ff2e52f8e3f2e05080cc25592a662079633c1d75a6be3dae1b890cffffffff33ede880a22775417667dac13d94f2ca8aab606841b155b6d8a8c9d85ee2283c010000008a4730440220726f0140a3408d1a276a74a31711c7648f611c794db34bfb378c799c0553624102206900604a95f4b24ad32970354d793db0ce535b485beb9f47256b9453f27edfa00141049f1d8a77c4227b75aef9748e02e3c81767f4b551b0bf4d6469df1c0c87e4955a1c036495bd5017143f3b7489dadf5ee564f1d8627ec01e831228d2b557a70e01ffffffff03a0860100000000001976a914bd314932e2643a7fc53ea6e9db8f8954903c687688ace5540100000000001976a91405d99d15e7ce574767642428057bcb8815878f6f88ac94ed0000000000001976a914488402e337a27c5e1990f8158d5621d007ac996d88ac000000000100000002aade3463dfee6d1b8ab52537cf7400fa4768d624bd48528c81d2bbd46308139c230000008a473044022029a590e9af3b0eec2f7e7ab08c110fa0bae0cb8272709ca2e56583c9f40dd3b202202812625f2808d84df406babdb26bddda1687f1bb0440585513efa6cc501d34f701410479ecc33109084e334c338e31ad4282c39440de359d946d4e66671c6478f80ba84ce6949681ff2e52f8e3f2e05080cc25592a662079633c1d75a6be3dae1b890cffffffff550af905cefb299a098f5d9989587c19a7653753fe8232d7e003582b562deb1e010000008b483045022100b730d3dc5c39cba3fdc3831012680e2f6165894e44a8809ac1a06d90bc571a5002206f5007f1eeb08c73031a4f6147e4a57224109017777f8c926b0c3045206559e00141040333fecf212d7876c9e823dd139d3fdcc6433f63065bb6df4e6a2370009bb56970519ae201827a5aba6b4f7f47d0b72c9910763c7aed7419728140cf5001ffccffffffff03a0860100000000001976a9145ca37b62f843a168b4c304dffa176e888971ea4a88ac44480000000000001976a9148ce57da128e76afb72f35d6a1770178af5fb8fb588ac54510000000000001976a914a63fe52b9a7d54c8ef07a79bff9acea31d1fabbf88ac000000000100000002add9ab6b125165b9a08d8f709ef5018d995f90a4bc2baf661bb9baf60c561bab000000008a473044022004dea9857ab3543ef685efdedea2f516a553714edfa7299094924abd986860390220192cfd3c805d2838216eb2cf7460068158b27e5b12b605a7a4afebf497e4eb69014104e42aa0dc9c3e95e824fc43f361af768ac9fb3958d85dfc8f2d9c3642b41cd3a387c388dd6728b75784fb00907181021b01f75307cd1f55c71e30e56cb875282effffffff1de496d83543d397d5f7a85df548a2f2543ff5bbe35d39823d4873d1d6fb7550010000008b483045022100d12d74c4469a76b6d5a68e4dadadce2f04ffa09638d9e073f42c24eaf9e374ac02202099f90bc3026684aee486fcc5b399afc41092d8fce72f4805642d4a74ea08470141047e25cfe8a868e82a054641ccdd75c7643ba009432958b185a709d2a48129cd13d98f8d77f72ddff26c0c51b643e43066bf9a331ee2b11da6e5c751481e24f6faffffffff0392b62c03000000001976a914f33a3446bde3bb98efc4676014c2792d6d09bcb988acedb61000000000001976a9144a1f68109dca42d44ab4df8d4bcd58d32ae132b488acc6e30000000000001976a9144c9864fe2946035139773bf7c107247e9929627188ac0000000001000000032db47904bc4900f297e8d75c48bb5be7d21611ee57cc391ee1ee6de3db15476c010000008a473044022054e1ed8ef08c7bb0af9b3d9e9dc57d88bb0d158c66228c61f286c5263362215c02203a17fee2f7eeaa8e16b50a3f265e9f883a407b664d08210b85661f1fec53ccb101410464d46bb645d6f9eca350d806709e00f9f53d3357e403d5bca1c71230d58c474e931f896191c98b2028eafe3e3127d3cfbd600b78442fab715fc0192acfbabc36ffffffff60f73776facb40af231e413586187fb90110b5ca86e95ecdf325f7d955512c44000000008a473044022070de91c247070ec7f5618abdac25b0f0c609d685fdf53c745e86dceca6076d9e02202cee8d97f481484072016579b4c2beb9ab9a166cc31bd936883ef4a0a574a853014104abcb40d71a3a7cc16f9633a8a5d27861d53198f0f06d5e3260d6a2211fc25e2adc0dcbad7ed6e022ca7fc2bc53dd375eecba2655955cd37c5c2ed273f3d38a31fffffffffc0d2d353aa040a2408cd43c467a7bf23a7edc37c0bd6a69529bc72411203c5c010000008b483045022100b37e88bec14e072e5854dee2d655828e4ebdec7a7a3c62411e20b4814a01ac6702203318715db84c93dbc65f0a20909b36000fc48fa8d057c6608fa692d720b6fcff014104af3d0ffecb4cf642d1b73e8096bf73d5d5edde746f7b2f20ff3e684ce8162d75eb97844b0c1fda1932fd16619981f365864b5a84156506cf7bf33ebed0c8d7f9ffffffff026ee72d03000000001976a914b15131337b9b3d290e6e4429e1534771d55e86a688ac2b740200000000001976a914bbb737e6444189401d4d8a98c08afb399cfb205688ac0000000001000000021b06fa54ea348b0375d6afd257c3bbbac50ecafd5e0e585daf3e8d87d89ac7ef000000008b483045022100ebd9cde62571625523ad4c0a4d57b8e58c5d6a41e761cf2e396d392218df098102202dd41ced1104974fbba8535d81afa6d5595eb7a49a05fab3ca8e580056b0a8b20141049a7894a2b9ae3451f0f13cce15315fe69f31bc3857a6efab818b6e1617d962f6899a07602bf35a32e954ed2904596739d6904401fbd9dbec59b665dcbfa643daffffffff30d77fd44adb739c8049987a5c641103b4561e320f9c1a2d3900dca7e670e81e010000008b48304502210088b75ff97f3bf4c35e1eee5374c36cda60d801858cf9ac24fbe668b1b5453dcb02206b92d708003ddd84fca36896f334afc9ac2c3317745a28f60ac7c807053c3e0501410426f74a0bb07f232eb875de4f3f511bdf52ec2f92f9b029b70a3a7537f600e5baa0fa515fa5482708d169537b87972d7b63df73c23cee564022546f26772aee6fffffffff03a1191c03000000001976a91436cb7c1d5b9c52d37b24fbe8ef7b36dff93e656288ac96641c00000000001976a914c87b9699a7f45b81fc8ea5ca1040445be3e4ed7188ac94ed0000000000001976a91431a5070f13c596d6d70d5653be2ef861f8b0963488ac000000000100000002e265ca1488f1e4f826e33f996228eac9214516dc28eb771d54a61b6b4a1240b2000000008a47304402203a89f205597cd212db981dbde2143778ad87fd35a9f06d1ea35a09e3488cad9702207af35319ab5b6e32a703c0e2dbab32bce8b4a8337eafca60b6b3f163b5a4e167014104c050050a33240b943652854625020a92a6e4bb2d8bd9ae9ae5f1c092d99a10cca228c2fda9fb87b5209a3b8a0eaefde464a558e6201c9abbf1079233e43ffda9ffffffff49608af7672697979b0115fd9963e54400b246513c3ce59fce75add70181f8e8020000008b483045022100da744899eeb5161a9d982f1bf5d330e6119271ba497fd7a3555c72ace127233a0220744a1b9bf3a0d19e9c4f5d2496e76c21cddc9b032ddad9604cdbb4be0bbfe165014104f765397683b5af62d01ab2708aadb90c775e6a2cfdbb386f03f65703097f961118821487aec80af67e3b9707c1011b5ecf83bdb6f9e2f93f1a5f283fdf9e0bf4ffffffff02100d1c03000000001976a9143f8eeb5da54790785452145a94c4f2eaff78cd5088ac84c60000000000001976a9149c99dcaef83ac9ff5e81ba6c4620f924877d489a88ac00000000010000000392498c1329832ddf168765dd5325278966343c2f788e0fdbc375ca17a424ba59330000006b483045022100cba4cbe9b5bb2d6f312a1658552ea71bd6e78cafae9f748e870e0e6c79bd7e43022038963de40612d078b637e2a801d7d8a3d94e9b052d614bf202b6c9ab82b20a3b012103c054590554fc059039a0519ef407c7336178652930d09c620dc4fefec621bd1bffffffffe0d33964c2b8eb83ecf76c9b25b79595d6f9f44897c69b1f522d8b5c7cf6c86a000000006a473044022016174b530395460e770593f6b913aaec4d1abda9a8c4f37173f7148f5758b3e50220506753eda9bcf96a606b6d6b1801d888593d65bd925aa9fa21bba845ff27978b0121034163ba3439c948b2762906c11ed0885074c9d45479a830228899537357089086ffffffff0322c9836888efa7f8a54a743ac34780621a95fd6d76c52a7f9998be9c64b48d000000006b483045022100972d2f15136ed4cf6a806618b20099af99cee15d599d4a6980d82427916de31d02203d0b6e5967a1c8a6dea2ae2b516d9619a91a796fe172892fd38338f8ef5bed8a01210391dabd268cccd7c13a5f527bda8d976514a298a59ae7e093c862dcefd3b6dd05ffffffff027ea1c30b0000000017a91464a0363d19b5913ecd7fbfd3d7d0fb0b1227a39487a201ca15010000001976a9145bd0ce93ae8d518f715ba2892c3bb433b2554c1688ac000000000100000003bab657ebdaaec260f39698e6f3a5901b4820fa1b1472f0721fc7750cea59e94a010000006a473044022072f0461305904a2017480c048e8fc1c16af970e06fb18a4f882d71a22f73cf270220162404ecb3309b9797c349b3a0a6c7e5cf717a756b23c69d26877ba9d8975093012103f5af354bc11893a5d142a7dec5d31223fe180f3efb07219b28ac8bb78d2432b1ffffffff8487c8384bfbfb052c400d4202340608d4f8a429541a4b2b2269939057da9042000000006b4830450221008806be3e28ed4971bce05cef39916aeb7c8c37cb294177152076bcbc95d28aa6022057e7465cff8ba1e35b5e4af87cc5d97e8c35ac5ed53eba67485499a01d1f5190012102a5f1c6c743128c2bcb507ba68738e8116f8e0c2421e7f39955b677f956cf0e18ffffffff15f622e8919049707ee68ff4fc8cc70908e2833f772ba2e3dbf5548f90b3e250000000006a47304402203e3e04e7b273951d7346d41a9c4e9132092da7f80326dcd4c57f29fbbecb88240220017c93e80c36c6c99e205149649d61f737f7610b089a76adc7352613994dc231012102959683ad6f667636d6ac0583760d785a83a538f4de67e610c5adf01004eb5fb9ffffffff02c0e1e400000000001976a9148667a0b47a63a67ef38b833a589e333acfb360f088ac10090500000000001976a914b648c6f166a4c321d665b62eb5595bee38b6bd0288ac000000000100000003d662818c9116036316d5b1ef415557c50d5a49d1d9abb1f002472d18ea7649e8010000006a4730440220204cf8379d64fa04839ee58f8cf1db5a7d13d8a5289c29cb0916248b708b50ef02205d7e1ea13f1e65bacf68ef59cc750cc569f95431f639a1551dce62d2e56025ea012102bff66d64e5fde31244ecfb168b8f68542bc85bf323bac9e07e733af2dfa1736bfffffffff5443c88535d23f62d80abd7d7aa009c5c3705559285481badb71d73cb6f4ead000000006b4830450221009d82b6cb6dbe43dd1a03412432862b382d8628adbe738370dbbbdf72f4586c7002201fc44f13d788f8aba7de4cc3e178727c407620c9b658d82549e4b545b27e7ec8012102bff66d64e5fde31244ecfb168b8f68542bc85bf323bac9e07e733af2dfa1736bffffffff6d5c97e4ad9e977ae1f6c42d887a5a670f474cdfd1451d5fa6c13962f81e420f000000006a47304402207228d53e4c89b083b2747865aed8971a76924641426e88fac89329d59910190002204311d07f3c6cb13f9b32dbebaef23227f3a55c2b20446a2b3b3286c3f8327a82012102bff66d64e5fde31244ecfb168b8f68542bc85bf323bac9e07e733af2dfa1736bffffffff029f513400000000001976a91479ac58c0ec17d19ef2cb7853f4dd6eb4293a00b988ac7c782300000000001976a914c387c3ba41c54daa3e01eafefd36838b5fe8a27888ac000000000100000002e4fe9a7b03bd1abdcfdd587402827bf5f02fd4bafe1758049e1557d24adf023d000000006b48304502210095825a2e491b737395c2c5cade58c7a161ac8fe729858de307f9cb916f79647d022020b8469f31210e54917c52c0aa0bed7d04ca1bf5e10955edafe363ef99039691012103d56be50a08ec7d8ddabfa78590188d24f98ad437e2cfae7b7520fa062021fb5dffffffffe01f36cdaf5cece96e40b6af47b7a1bbf83525589227a3666473b49969927c2c010000006b483045022100f8549405d53d58bf2afbb4520bbdc071a31727c4749ca2c31b537599324b5669022021af2323ecb749a121c37576a5531cb65b32da75af5faf75942058849ec586e1012103c42c432bb89d4f541ffff5772871cd897fc149adc5a811d86985a5adc89aa4ebffffffff029f513400000000001976a914da53e43b441ea706fe63fdcf5e360463e83dce9b88ac0c1a2000000000001976a914ae806ee5fcceac6e7958c0af6905c37ad0ff1b1f88ac000000000100000003ff8278a55a71e2b4b25804f8c4e87bfb7286ebd077129e76effec957f048738d000000006a47304402206b28431597cf59d64418152d67b6ff14b5e89708a5d14cbfe505bed76c3a7a53022064baa4217cdcd76ede50f78b15ee9b63639bd2f63a7797e1f29ef31b34fed1930121024222dfc7ceb3a0755306a68b1c77c3147a48e6158943c38e9b900c379091441cffffffffa0037fdabd5442aab4b95ceacb22526b27b77844e93aaf6ce040ccaf9c64dacc010000006b483045022100fc111908aed79a663202225768e82083aef3f2e9eea707edcb331fb1781084e702205eef6812715e4cb597897c7192b66b4637645fd6ea2dcef6688da1640e3f806b012102fe622835f43bd4f78cc465aa379f76a21fca153bd421b4ec0e80fd802e439131ffffffffe72eb6138c6f8a05a1699797f6df1aedd954881f29ca4c978bc66cde321d2664010000006b483045022100859ececf2aa0b8e43995bc3abf94aab5ef90269cb8434048bbb97c7ce8fe31a3022076d92871bec8840c802ec245b2d028706cb04e0c60373f1e49158c516e9b08470121031136babf6e01a0ab7a1788e83e9792068bf2a4b1bc92a42601186063f6ff5e75ffffffff02c6a84e00000000001976a91407a5820f962325b4fe9d894c9f721cfd481618f488ac005a6202000000001976a9141e13f46b4fe4ca9020caada60df641c80ad82ae788ac00000000010000000370a7045990f6d00bfbca584703493bcbaae577fb62287dfd98367937d152a6db000000006b483045022100c4f1da6fe9ce03e908190886cd6627e80a59c4804cfae36c765438e99d33592d0220633eaf175453ed61d07be3c4937d35e835d27c1e2d8b1c36e60e6ba07f2b706e012103eebe1f21a4bbf4a026c9668a9dffa6285b09915a6da4abe6ec437004da8e3491ffffffff9c4864a6a744696a75563dfc9399019af8a6345d9c2cd7171ef281c04ac275d3010000006a47304402202e09d36241a4dbf105aa65f5e56f5473fea8198d001416a96fe2f7be5bec00b5022056af0f20f48eefc8d2d3dd131323c7cdb0488f30cf7dba0721ba0b8c3e06ce61012103f7f2917018fae7de83f0a04d2f73dba3ae39ec2c3d5c6b8ffc2f0024f5b33cf6ffffffff76c1281fefe8c53f2546ab3da5f40060d12cbc6d5e14253c63c50628c4d121aa000000006b483045022100dd9598b600b1e014a785a70a624522ea6672114f2c74653f4ed65c30c91161d602207e9e10918fd01b9f71d9d3698767c3880b9a33b8843c9c80a6a4386455a94d8201210212e631428341b5b408fb8e1001878c2495f1404722d5b2bd4fb06569eb58c706ffffffff02005a6202000000001976a914a94e5cf642c1e100b7777b789c07c614f353b62f88acc4450f00000000001976a91450c6cb882f47c64329ba865b9055ea95bb317bbc88ac0000000001000000034e5e7887a22d54d87d7e75c2d297d644e813cd5f54d8be892c2f389c86dcb7bf0c0000006b483045022100df137de8f526bf3cf57e8ed9f6c762cee6ac8f752d1e50d71b9bab98d1b8d0f202200633505ccb7698ed9bd1854fed686464a89624786f9cb52a50cb64cf81fe9cb70121036def04e46ecdaf13ecd6ad3a5db9647bebe79150179b867d0c0a2c760aa8d9b5ffffffff9123cfbfe058749491bee5bbdeef7dc5810cac18e41b1eee672c94c3f7a0b989010000006a47304402206b6d2b5450a98b534519abf7770652e02d927c4501da7cdf8b1afdf9a98e65de0220195edc0dbfe63fc809c00ed46e95dd0cb8766eda8043f8e696efca5a52f468bf0121036def04e46ecdaf13ecd6ad3a5db9647bebe79150179b867d0c0a2c760aa8d9b5ffffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc13926307070000006b483045022100997b921015b253701c072d3b4afde5fe4e529cebb9e2a1d7f37736456184574c02204924afdd74d8267d3f5731ab6eceffab4ae03f0d5cc60b1464837064bb68d77801210312346d4ae2c915936986296c2c42c96f1fbfa931832af9b475f911855680f08bffffffff02e02bb002000000001976a91457162eb62138da24afee34646d9ee37de68546c288acc918a604000000001976a9148ebcf60d674bf740de4c61b39cb0a39c57120a0688ac0000000001000000032395e5d3ae093f701d604b23375ac44bd31aba63f61811e1a0d832b80847835e010000006b483045022100a1b23c4dc659eb71a34bb6626627c48d0594231d668730947c08c8f7d0f083ec022025e43b87ad01921c526d6d0c681420c33c098b43db86d88c3f9266205099636801210201676d6db697046ff852d66265d1343d8e97173ecf81940238d21a61763b5e53ffffffff4be714871033b0b7bff214d2ecd3841d20107f65e8095b29f54268e27030447a070000006b483045022100d66d8be96a3439bf4d63ca8bf49ed9cfd54268ce93db4d45e4f95bce6a2c924102203e3482c196206fd65a210f6d6221a967881dc92b01c2b7db5469dc1ad56aae2e012102a42d0ee4a818fbf92351ab0148580c159366fd90b95ebe6beead2db22fdcb8dfffffffff86d4f00e5528d34c382d32b55387b5f70f48758351ef67288d7d729c2b370e06120000006a47304402202b0d08309b5d56bc78926f93e9a4fc3dcd74a32499c76b7a83646279ff40462d022047d2868337d08775ebd31fc0ae62b3318910fc598b9e0b19570b5b2ce83971b0012102a42d0ee4a818fbf92351ab0148580c159366fd90b95ebe6beead2db22fdcb8dfffffffff02b8480f00000000001976a9143a93f10fbc5d799710e31e5edf01ec444f0ca51b88ac40420f00000000001976a914459cef560e3a369916ea9ea3ea9b707a053bbff888ac0000000001000000039d91aaa66da8edcddf1ae6b6260329b814489e6b0aff46e271003cdde6cdb4ab250000006b483045022100d25724b6514d817372d10dbd2e71a016aff7ddbcd8a4e6b3e59794912578c64202204b2e62af5892801804f14f804da633f61da891c71ab2b305cdffd3c4c2ec8d060121039c8804ab7b479fdce96dc4afe21fa77cdf31b4d15e8312f11adf5c0d02a3ceeeffffffff3237743d3b1999927d4190e1c452d9ef98ed8d821d03f635b4b15e71e1dd5cd6520000006a47304402203e6efedd80b5ff47dd02d70b67f0396b6316c1b2fa0f18e0e7104982471653120220280c3a8a0082e324fde1ba0ccfe50890417301c7e61299f7bde88507ed12137f0121035466ddf546ac8b55de30f9185a5c29ca4cb653b123c6aa20aa310cf23ab7114fffffffff294c939ae46cd1d247a2328c4179ad519de6766b5de6f1f5441397943925b1de010000006b483045022100894ce5326ad352ca174efa4029b91bc61a683fb0537310e8a86f83c764d3c0de02203ca7cfe5987ef468cbcbd3a904d1b980aa57036e5f3021377b7b5376cbdc380f0121022052d131c1afec8603217ba8677caa9323ff8d36bd729449ed69156b9f7aa674ffffffff02c91a0000000000001976a914761f7cd356e3395f23932d7bb337ea89866fc58d88ac7d500000000000001976a91428046bc33c89989db5c81a62a66c811f4c20b69688ac000000000100000006edd7610a7bc56727561ffab2ab4753925d6bf651ea27075ee85a1cd9f41d0608000000008b483045022100d48ef657d06fe457e5906e4db897c33e71398d2475ffe4d7d6725f469532add60220422686a3f0879d63df302e89af19801adb5bda0b711592097bfb5bb0e15a8d3501410423b5f7b2332ef81a045e01c67af6bed905ac5eee3a1712abcdb0ec6d84a8173c75b39c962b636b1028f707697c55a5a6e58ff8b43d28f9bc63a70949a85d18d2ffffffffa37bae54b5e8cf1a31f0549e0466e06c45548ff903da468a5b31904efbb255ad010000008b483045022100c961d69903a18b5870179debeba05dcffc172123dc9750601997d2f5082ae4e002207f009395775c2578d4bd7fbb774e344f38c05d3462bf2b6faac4756f7ac77630014104d4a6240fcf510dbf8f4bdcbaea74dfbe4b6d7344db67c30c2fbbc2e9c24d204ce024c00cf0722686e4fafc10f153b1dac6f260ea7307bff9b8ba4fb0b2c23a88ffffffff22b5f57dea707b4bcffa44f628bc9cddb82797aa2f0fe054bba6e01013e39aee000000008b483045022100e18b753345f6816b4035a361ee20f5ce370b0aab886b464000ba3e83fde250b902201152a1f130692561b78576861ec1ee93f9ea67b388c145ee29c88cc6d99f98db014104b4a4c2d644bbfe5545fdf00c34342387710aa4a60cd1194e168305f775e7e74641fc7529c2fbae5bd5cc3733f6866302a748d9b84c1a1a16e949215a5670fc6fffffffff51b06c532c42c185b91f04a2a55657bf6eeeaba35ac48bf5df977f7e0e46d69e010000008a47304402202ddad561b2a022b6cfcac80d9a17732858007eb46b082ded9736510c9c3d907a0220035c63609d9e6b6acdf2d3440c6fac76409c5621d6666011f1df1c0a59dc41f20141045c4906d48d260ed65be33c99e5cf6d381d9400aa027f1b6a2cde78679247cbc49f4ea9eca853668702797732f612dfa785b984185b8362a0662bf6de299fb98afffffffffcb9b2f6ad263eeace1ec1eb653ac873223e49f0e377a896bcf6040774251cf0010000008b483045022100d2123b325f58f80820c2ce6ee793a577de3d484afd7db8fe6e10487ada1d094c0220532eb8d3be9df32f7365bec27cc708187966ea9b7812c58d09eb94a7ebbe311e0141045c4906d48d260ed65be33c99e5cf6d381d9400aa027f1b6a2cde78679247cbc49f4ea9eca853668702797732f612dfa785b984185b8362a0662bf6de299fb98affffffffb95b40bcc0e2bc28e20a3cd237642f52c1165abc9727ce97cb8494a00a0720cf010000008a47304402203ac8593e88c20e9d3fa6e6a7797c5b6fcfbd0a837db3b59d3823631beff397d502206c01e6fca945d61b501e0d54f895981db4f560e35a8e90038203ac88eba8e28e0141045c4906d48d260ed65be33c99e5cf6d381d9400aa027f1b6a2cde78679247cbc49f4ea9eca853668702797732f612dfa785b984185b8362a0662bf6de299fb98affffffff02c667be04000000001976a914a73e49d9cf3d61329cf15929366761fcb3c0efe088ac345fa800000000001976a91406c06f6d92846223d090c353a01c873eabb2f70988ac000000000100000001888ba4f9bb01bf9d18bbab26c25f4ce989f799650e84c299bfad14c199a44583040000006b483045022100c189a9933b6e6fd4a717bcf9161aff88c0cddd698cfcb08848ad751faed45217022079d4ad9ea936c867f0009c26be35ab04c59cb10cd0b3129da83a92e8cc58feb201210223082d95d956cef3053996ab5eafb1dec04798401a3f444fc56a49bbb8787f49ffffffff0d2b270000000000001976a91463a19dd83408c8bba9b11b1bf3fa549f57694c6a88ac16270000000000001976a9146ec41bd2140dbeebf4a0dcc1e156d03382a7d68388ac1c270000000000001976a91490d809037623cb98d394e49b44e993b541366db688ac11270000000000001976a9147e80f64281739d87817f3e213bb90046d8fdb31c88ac17270000000000001976a9141cd0cb02580147e8d9d7f88e1bce63d723f9bb9788ace0270000000000001976a914556fe723c062476a9495ebbfe5c85d7ed55de11d88acc0270000000000001976a914e590dfa70eeb62a34590966e4f1fa55341918f4688ac5344cd01000000001976a914e03f6429b25bdccf13feb78c2eabf725919c1cfc88ac1f270000000000001976a91473923aef34dd69f94f2a2660e24e51bccd58ad3088ac11270000000000001976a9145daf72c8ec988397d3dd088799d61bfaf8c8ae2188ac17270000000000001976a91455e4a39188e3bfca34e162190d5da797299f913688ac0c8b0100000000001976a914a738f17c9422af56422e02099a6f7737ce637fef88ace4a50000000000001976a914e43bc2ae3e263afba96fca24f991b3e8ae6177e488ac000000000100000003869d5ea0650440be0334589d98a58f82101d76534e6a19eb5f22c84e9aae63ca010000006b483045022100d8e793670eff5f3a41dd083a5190ac0b5bfe10f67e0a18531e29f4ebd2f447cc022076289432c5dafb84a1ad3a922ab1e91a8d6f836d320dd31fab1095a618c495c901210329802bf3d593bcaa9ec40d1cd4568782e289f3d4cc28e622ada5517efda9e728ffffffff5c335e6084c8f739a9ec0975810e409f2f14627f622923753452c0a522911228000000006b483045022100d105cbb1f6fa5af93f719619d6446423c4b4a96f236a70a84a39fdad371ed8e60220239117bd6c601b58162cf45a3d151d5df645adccab95f57c2912442110001be001210329802bf3d593bcaa9ec40d1cd4568782e289f3d4cc28e622ada5517efda9e728ffffffffe12ace827af1168b1e055149893a5cf40ea91568384236b7e3a52d9381ddbf2b000000006b4830450221008377dc51c6f1a6810dbb38973314ff289868a70d03ae34b1b6e403cb01a74b0502205ae5b9512d8f199b2be4033f672e934107cfa29a887648e07670e43d4e3a729001210329802bf3d593bcaa9ec40d1cd4568782e289f3d4cc28e622ada5517efda9e728ffffffff04ac020000000000004751210329802bf3d593bcaa9ec40d1cd4568782e289f3d4cc28e622ada5517efda9e7282102e970a940f8bcdfb9e9165fe6de05c94b9b65f5bad1e17cea44b4099640874d3452ae22020000000000001976a9144bfe5fab8a0d3680187266ed77260cbca5ffc12c88acd2810100000000001976a9142d5e62586a3d244c5e3c4ecc32eaf7630639a1fe88ac22020000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac0000000001000000043fb289a48460716e4ed08da7f40d4ba66b16a28c77a1fbcd0cecb226ba9b95ef010000006b483045022100eed851fb6a7ec6c72588cc3e0d3ece38766d60dee4ac4ce55ecb865ce6d1868102201497abfb12e1fdf35e9eca23aea46f022d3a0feb0ca3267a8b2dd2fee003ce11012103c0a948938917a04fcee738927de1e769ac3c296ef3671832bce487f1689029bcffffffff022ba6eb9681568b49f3772656caf2dccecdb3fa0843eb6e77f2d0def34704f7000000006a473044022028b12fedad9a4d809b6bdf8897aa8cec209286dcc6f18db3f0948e59c3aadf4902206d142cbd57d008d016bd2fd9a7338fbeebecd3efed679329775134ab0ed880da012103c0a948938917a04fcee738927de1e769ac3c296ef3671832bce487f1689029bcffffffff841a2e91611714993a47566632e29faa1a1411b92bb3d3a35c4997b3f6de8c97010000006a473044022023c3b45dd6274055e46310f623ed00a3b9f3268fc7f31eb79c3d9ea266c2e54b02203b37dd29938acfdbcec421dc0bdf884d34100e9c04e066ade4a01e93dda40938012103c0a948938917a04fcee738927de1e769ac3c296ef3671832bce487f1689029bcffffffff65df3232638cff6bff9525ae6b0d7c5b563d06ab657a2b046d7e2dc00054f520010000006b483045022100dbaae1667bf3278f7c7ccdcec687393b0859c3f742b4f87f8a4070ed739feba30220620066ae3d31ad0eaf061168a61f6e103ba1096b3b88f3eb5e26ec7453e656e1012103c0a948938917a04fcee738927de1e769ac3c296ef3671832bce487f1689029bcffffffff02b0b33200000000001976a9147a14361a09d777e17437d38cf7f3e5e46f65cd6088ac21510d00000000001976a9141d319c9e95533e797a0f7886ba66bad810b30f0d88ac000000000100000004539796a9f1331b2171f0766ecb43d4db97d748e592499019b2dc90edc049cd84010000006b483045022100d97d5b8455320e04ffa9ba8e66bf3d226685581dc224812f0696e7e1820d931d022033dfac7674efcf93db65b365fcbe6cbb541b325b940ccad89f8ac81fc7626deb012103fcf4acccd7c34e8182d47bec14f77f8992a77bae1b19753581ee16ede9dbb713ffffffff0bdb924289d30abf1ca1ff5be9dda72b272116fcdb1b8324e10c50873bb3f59c010000006b483045022100e065599f095ac58d07f844c7b3df86f668207d9b6da35d8936fbffa9a2e1573002203c8c957712169d91239082098d29f1c9726a600ee398e43faa094ed3d27d09d0012103fcf4acccd7c34e8182d47bec14f77f8992a77bae1b19753581ee16ede9dbb713ffffffff76cd3b4d3c823924f56483f8d3657e0884b91766d533881c082e93312ab6075a7e0100006b483045022100b2cadb8030f826f50f10c3ee26bc5af3537d41b07fcc7264bb2b7388aa9c8923022017ed24099f967db3b0d61dd8c8cf15e0ff3447b7c55d34f32a854113462228c5012103fcf4acccd7c34e8182d47bec14f77f8992a77bae1b19753581ee16ede9dbb713ffffffffae740291fc71add2329a65c2503de2275ebb4caa3f44be304d2d3ca35ee79a1d010000006a47304402207442f403d042a7fd464bceac50eae27a6cd6e76d82b6452b1a2de78e55345e2202204fc6cf74c93ff0bffc9cd996fc914a7912a17a756cd4cf88f65af648344b027e012103fcf4acccd7c34e8182d47bec14f77f8992a77bae1b19753581ee16ede9dbb713ffffffff0220a10700000000001976a91467dc78286bb047d1fb34b61fb9596aef0377d60288ac5dc21300000000001976a9147d5aaa79d6cef73bdfa2c6d29ae0bc163a029b4788ac000000000100000008c7493c5a2b1cf714ffeef7345d4fdc844b5ae78caa497a0b5015adcca84e913f330000008a4730440220379d25f5499a8ba349ce13218aa7a4ca9fe8c7408ec0bda865a7823827b39c8f022068941ad4894175d405078385dfd86e8ca031f6a7fa6812b98a4be0ff923a1b8d0141047a824fc5a97280f66e50f7a44b21896cafa17b6996567eccb467bd583a83963a96221214664efe412d91578cc74c38c512aa4e9dae1ae0d0063d1a219c04684affffffffaba24afc9598fe456c67ba4563584bb63ecdded496dd253d3dd09c211ad14c34010000008b483045022100875741dec657aba23a90894e0e55312d7992108198288a5246ba1d649faf9f7e02204a1855b1ab58aca2fb903dabbf0bef465308038976b306e321c8e6b73c7be1a70141047a824fc5a97280f66e50f7a44b21896cafa17b6996567eccb467bd583a83963a96221214664efe412d91578cc74c38c512aa4e9dae1ae0d0063d1a219c04684affffffff708950e3f327dab9673004db5a5d8d6bb419437e9813511a682b57052929d9792f0000008a473044022027e4cff1c53e71b17d1c50e6b29d9291d406b81f51b458b58cc7b6a42ec4249f022023bf054acd5ecb18c22047759d54f45f05ea216f9baa92d069f94bbb2f23f76c0141047a824fc5a97280f66e50f7a44b21896cafa17b6996567eccb467bd583a83963a96221214664efe412d91578cc74c38c512aa4e9dae1ae0d0063d1a219c04684affffffffda42171bd2a4415c3bf6b90bf9732488a104418c7ce6d586f85b6cdc3d9880784a0100008b483045022100b559a877422b974111f75be12ea4681afe86a26d1a611f4748a682daf1e37fa3022014cd671a74399948b88a4d6bdb494ca360fe462ed6f025d5fb48b1ef9858fbff0141047a824fc5a97280f66e50f7a44b21896cafa17b6996567eccb467bd583a83963a96221214664efe412d91578cc74c38c512aa4e9dae1ae0d0063d1a219c04684affffffffbb58ad675838fd456317fa8cb07f2a83cbd35fc854da4ffed1119b114d6f4186000000008b483045022100bcd24dbcec2024a42bef06f6435a631edaeb6c52b54c669cac8590f6b0f83e89022073c928e1a421e58c1d4ef478b00ff67bc2268ec11632101474bb910bd723b76d0141047a824fc5a97280f66e50f7a44b21896cafa17b6996567eccb467bd583a83963a96221214664efe412d91578cc74c38c512aa4e9dae1ae0d0063d1a219c04684affffffffd5f0f20daea7d482155b4a24840145740de7a5eb62e041e13d9f9730cdba9899010000008a47304402200c7993991e94760ee0894e1f1534ba82db588a82f6a7c51f8815bb370938d0740220108e87d53c6bd30e08cd1d1582726cb663042cc09975289e9bac0d8eb483a3d7014104cec552e67ac80c9237132a133ad6a7ff8b577fb53988b4d6251924eda0658859d2e767e83dbf895ee1581c3c635ede319a4f684a39689d27af90e381d234cf7dffffffff5a8730c0cc6ee731d5d3ddb52d3515a1e577a83d83a6c15bf31c29db8be16942280300008b483045022100cb97f7c2f4353baf99d17e849ebb925ef20ad044b78e64da602ac2eb58043769022070e0686bb1eae1c29049ae3ac26845d4c5b7e45ddb64df7fd24aeef1fa6787af0141047a824fc5a97280f66e50f7a44b21896cafa17b6996567eccb467bd583a83963a96221214664efe412d91578cc74c38c512aa4e9dae1ae0d0063d1a219c04684affffffff770bc7f7c00d62beb0e59ddbfa130eca87e2aa3ddd7daa8de34018e7b462150c010000008a473044022035a8dc844d0af45a1f128f1b0f604a5a6d9cb3cac088e57672c97eb216a53dc702201e3ac62d6a59b0dba34542ee24ca3d3369fb789d04877af147297a8f0a112cca014104e6666dd418424d6b35af9d0f0c0285f596d517ae89e3ca1de3f884d8c00fae46f8de683e16fd7462e8e8c1b3ab63e1a921a3b2126c8e9d6c22f1a5e1c7a1c871ffffffff021ac00200000000001976a9148629714b466d5b8656661fc8c85e8997f190caa188ac803b0100000000001976a9143893a14ac05ebf6a52a9ed2838fcaebd39ab608688ac00000000010000000f55ad86faa09f030aee8f58e27b80bc7b849d8e7a0ba6b378302fbbae56e7df23100000006b483045022100f438e4794713e6e85861b5e821906186c97f3782021d52c13fcbc0c826c402770220344ebdcfb405ac946fb3c39c81c92c0925bb6536917c606e09771dabb9139b170121028dcf43555920b975673fa8d65de59e84c06574f9bd94b294d15e3697f590f612ffffffff47cea2934ce2500c3b5325e908393a56e1ff13c3df8b4deff73f7af45b3c2bc40f0000006b483045022100f72c5fb60b9d64509ea4a43508390897b30905bed8a96c77fff4d2311554a34c02204f898845dd3de6f0c81aee9c54e2f57f205464617c4f5e7fe4fdcacee518fdc50121020124b4a9dd247b5b1fe3dea733be14ca6ce3f56a6fe23bed4d4fad30b7f14b89ffffffff47cea2934ce2500c3b5325e908393a56e1ff13c3df8b4deff73f7af45b3c2bc4000000006b483045022100cf7a33ae908a62fe9221fd768a5f6ff58ef2359f46fc7cacbb7d3f8515e19f2502200bdc893f10a4fdc6e9a802c7a8102bccc1e9d5e33ac35a44bb7cb95b572aee070121029c82295543dd378c7d13073b439e16bc2f354e0566234d2c2f9904e53cf692e7ffffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde030000006b483045022100dea9ab110eafe1cfc1dfde9fe730ef5bba8a96c6234cef33b3ce4126f622698202202e1d7ba8ff9bcf7156bac0c7923a5aab255b6931e3bffa3f906df27cea616271012102bb2833f994636ef7de7761ffeb80e77e8292f07611a2ca8ea254422dd0ad7dffffffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc13926307060000006b483045022100f393863e5676490548f4dfe15a93b3e428717d871e124bdad6b7bd3d9093deb3022045b6a3641c5ff4065fde59e896723c883b4225a2d0bed59ac75b7498dac4c8120121029dcf8c7cd53a2b4b18ef4a1fd1fc4bde9cd1b2d22a7e40360e2b9943ee702740fffffffffcf1922514dc48c1bb631110c8ba6d92737b7bb991fff301438828f75d0ffc73000000008b483045022100d4895f52db026b7bd61e5d0c238705c4ae21730c58af92b8b481ebaaa30a7a16022045b04842653518ae9c11a0c334c87db3db8f7f31c8aad92e0fd52672ce523a0b0141043a1bdc3563e134448c92472f1389ec158fba49ddb4d4f257fbaac26b7cb9816bae29cc317bbdc96693165f1c8c300e7dcfd9b3f6de3734a1ee242c33d2ce1e1affffffff47cea2934ce2500c3b5325e908393a56e1ff13c3df8b4deff73f7af45b3c2bc4080000006a47304402203b20cf23c0958d659af0a085c18e3746ff5a80df5ab9653afc47c664a5f3f75502205e46ecd9da959da670e8346cbdd26c34acedcccb997f6f58b1265ae1d8e3cd750121037cdbced5fdc351a6607d68abe8949b25b3ccb1e95fea4d85a15c5fbf29db8ff1ffffffffb68e141800bb7d0cbbbbe5c842aaaa53fb27505f42c8040502b03ce547ca408b090000006a473044022067ea18daba0705333686aef070b728a25c9958680ac552a824153190e74137cf022046ff40f2cfd935c67897574684a0fef181548ff261563bbf69f1e8abbee42de001210368722eaa8e19a979040733f048e28708ca2a2baef5fedbe6612d7b0d595a5026ffffffff55ad86faa09f030aee8f58e27b80bc7b849d8e7a0ba6b378302fbbae56e7df23070000006a47304402204938ad3a90d183fb80189621e0a2c4a7b87ac0662777d1a69b9365aa640bf76b022049e86a8d64c087aa1a5bd945e3f685a3787fc974f96b54a652b798f53cd2e0a2012102cd34684a88a2165a1037b245ea8d917dcf49eae7f1d1d0ce1e830cb1cc73f984ffffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde010000006a473044022053ea3754de7317ff847ee557a1125b7b396e74f1314e2765c9b45f283b300428022043b8925e4bb74de99ea12a8b20121d02c666a947122c0ae87c49e5f2a1b2e4ae012102960fda75ed6cede9ca4536a00fcbb99a9edfd510049341524dc9aa01528cd6a2ffffffffb68e141800bb7d0cbbbbe5c842aaaa53fb27505f42c8040502b03ce547ca408b0f0000006a47304402203b590d969e14b6786e2560ad027ca978709d0a69994d7f2ca0d7e2b40e560707022015ef73b332dbd7e88b3f51563d949d993759df371a783b3f213ae6175735bf9b012103d70c3c2407445bf30e1877562c686d487987205e6b39724aa60b85f6666697cfffffffff2fb6d5ef691bd78529c644197a5f5466acb759567ba50b43e3e68104cd4bdb77010000006a4730440220443e2f99436629352b710f8e46b439ee059295135724ceb4ff111022f042f3fd02206dee1bf9fcad1d736c2bf1cada1d223515c1144bebad1d333c45d06f9721cc40012103fdbd81b8921b932c64b40f0ee28e77aa15dc15dfd672e58b43a57549b3a316f3ffffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde080000006a4730440220278710cd5b6300c62c1ccc92c5be0912de36be7e30a50661db0119988387a9f802207056df06530d756429bf6effa80cad5e37fe910ef29259d356de4b67932b63ed01210224f9be7f81dc4357a2f18ae0b698fc5c60134918514f25aef52c5da73c52bfeaffffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde020000006a47304402205550ae898228e245332db632e1fc2ef85be0da85d809c419b834abdc0c370401022045a136d4aff7ef8cc3b6097143c2691cd843c4170f0f1e5423396b1e0a44c6c801210344de1a320b1f05a57b98e9687384a1cb232e1d76eae8a9a270900166bdef196effffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde040000006b483045022100a63a3e8038634cfe47b95607287451f007051c0680711f8c93490ae49b65a66502201b560e18e42c961733d29bca24cec4887e79cc9617674245166ad1298be5d0b3012102b4a6d812b3354b47c0c41561fd1667adffbeb48eb296f10a9db252ab0c6938b7ffffffff15c80d0903000000001976a91489214f459783ab99ab411d8f8338d8b366b126fe88ac60fbf56c000000001976a914ac52c193aeaca17ff5f8511272b06171c4639b6188acb6a40e00000000001976a9142a5817a0d0c1c24da4ea7b375600ecfe42fe7c9488ace0af015a000000001976a91469b1ebcb5d58d44ea9d92c34a6c853c063f0047188ac0cdc964d010000001976a914d4249ef620cf5b96db358135e4d392f130385fe588ac1035a830000000001976a9149292005022ba766c61496b85f7680c0375a040a588ac6603ae29000000001976a9141455543b92f177ee2d5046ae72275438afd8a7bf88ac06f42d00000000001976a914b85daec89f67060ec37c54e5eb417b44934a0f5b88aca6d8e823010000001976a914a8c4cbed19d6cd0406004e34254deb1657a79de688acba3cfa04000000001976a914b879050a15b00dbb29d88f14d079eefed99eed7c88ac92e14261000000001976a9145d1643253120d1799defdb730bb1a94be873c69988ac583daf29000000001976a914f507d70fda905feb6d3cf00e7ec49b5f4880fe6688ac9f5a0200000000001976a91447ced88f66c87207baaed3c98ba232aa69de537388ac00e110bd000000001976a914028e1f3dc45530fbfaab1a232c5d9777c1554a0388ac1ca8bc29000000001976a914ecf09155e97a9b3ef4926228536c1ac59539776388acb0770401000000001976a914ff933d6753f14b4aa554bac93d0c5229fd98028788ac802c05d0000000001976a914fd52a6126e4709da83504678931dfe37db457a6e88aca2a6f502000000001976a9142ae6b68848a2b43c78dd9ea34a0d68a066a185dd88acc46a0d00000000001976a914fe13b17ed6971a532e4464728e97601644ad462188ac50a75ef9000000001976a9148fc2714b3e339a16be73cd5bd2082dd63e69e4f588ac67992b00000000001976a9145123b7783a07eac14e4ff9905704a66cbc398aeb88ac000000000100000013d7fb3e99ec6ad179955cefea5e1940eed8d61c0f8f9674592c845a6fd8ca70ec000000006a47304402203e66268320b52ff95eb3970a945a39a8e72ff0e17924b940c0504ae506a827f1022054fb9c19d1446a52b7ec971a4217ccf5c6615844862bfdeffe64e1e82f68e68101210284fbc92cc6d4433cf6d02aeda5d19d4d67fd2f284e1de9168f0286d8b247e511ffffffffef43ef6705e4293b06868032b86f1b6d9bd092f54fa98dffe666b69f1d4500bb0c0000006a473044022057fcad6492f86370b903aa58d65fdcb1eaac10d5bfedee3b72a6bec433c6d26f0220748f6e3fe3ff107c1d7d8e0d5258a06e841e8d0de4f537d6a59e658f560d1de2012102feff76de7a04d338094cd290e82b2ab027e4f54983f966b7bb6943bcd1bace4cffffffffef43ef6705e4293b06868032b86f1b6d9bd092f54fa98dffe666b69f1d4500bb070000006a4730440220594130000dc237b189d2acbf7963a076a1243e436eba5ddabbe9482afa990da502203615011cbf4e8686d61fc27b49a5c0223a008b1c4c60fe5488b88af0ce89930b012103494ef6a3fdf2832bf96837eafdeb528d47b027a7477f0a466cab51d0ea5f3cb1ffffffffad6dd2e138f49e6c05ebd631fabc1d7795f73988eee66364b7e398022350b295070000006a4730440220631116baf74db92c0e8ad3c8dd84c23350c21ae2412faa9a5f78f410ef27bd1602205dd4fa83596799573b88fec9299d130497ef9adb6ba23b26fa711ebccf93074a012102decce366a6a724e883c1832f8b93fc33b32bf61fa0c757a5e9561c2cd58b6b94ffffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde050000006b483045022100b62e9a1adee18146bdaa758826436d5c48967e11919c0d1c466d5271ecc78b2e02200264535c086f85f29fa2bd6cf4d73e50149a565e02bcf1463ce5511cf7e8588c01210376f2f130d1d27bde88f0a467f2c6ef28c97d516c4891e5d3112f197982a53185ffffffffb68e141800bb7d0cbbbbe5c842aaaa53fb27505f42c8040502b03ce547ca408b070000006b483045022100ac9e630853b2f4eab1d04f4f9c760ab06a8654539b973e8d0cd229444a06730302201c437d09dad554473f92b5116f2c954b1f8433eef58b8de5010b2ee37de9be640121024a2d0fb36c556f2e0f365ec91ad252c3bc57fd0d2542974d893a325da107ffb0ffffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc13926307130000006a4730440220568609afdef0dc4a1e143ad11d2abbad05be7d553b0e251acc6defb1a7da155902202cfff19622227fdec91da6984ece10dd7810018686c4561d540634702045f8990121022221ffc3a562cf28c24193f0861790de03f0062934b7ce00d49a4c27dcf8ec00ffffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc13926307050000006b483045022100a8e3ce7e600c4859f9f6f6b1609f2b83361d9ddaaf41aa57a04ab9d7e813307602201cabf9f783057560d4f44557361157cf0e830c0af6833eaed123853dcf311b830121038f21f9f3d38ee280e72d9135941663195a7fb0abe3e28f4d9b3bbb4b48583838ffffffffef43ef6705e4293b06868032b86f1b6d9bd092f54fa98dffe666b69f1d4500bb010000006b483045022100dac425607bfdb4658eb2feed11bbfa3e45e2a2888fa3e3e7e576c5eeaa0b84be022029b7ede1cd2ec4c72cbf03728a1eeb136e4eefc9e25a62fe2a6f00784be15b92012103be8103b917c25d5b250d74608d6fa4f8776463ba20b9f7e4e131b58ac29e7962ffffffff0d2f6a1abeb76bf038bf0de8a4946cecfdfca99caf6035a071684e1dc200d9f8030000006b48304502210093d02720b7f6bbd69afde4aac2b67ca828b5f41a7e765ce8da810f33fabcbf79022003a2f25d249e45959da9a3522307d8363a966de6ac58a782dbd1e9dbc1c59886012103adc3502860959d8731c39bfcc502d836899e9a4c432ed3e113469f2a86e3ded5ffffffff0b80f043e007e4a021dcd2b5cf448cd1a457bb14b5810da16ab5161ede0f2d43070000006b48304502210088106d9057ab0d0b7c0a0053ed7ced94249dd120fe7a7ef3c95820af1b2a42c40220152f79003d2c57a056401b9153981bc2ae3e9ee7e9d512852ae7b12afba6d51d012103570a61bd857d9945e74fd550aebedddeac46b8a15c1bea6a730101a00202902effffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc139263070f0000006b483045022100ed50345435ee34b9ad5ca3a25f7bb5767e3c1bee109fb6c54cdf7863994611f7022055c9baad30e6056519bd21e11d7cccb7759b6c4c910bb927d7ee0545a648355301210219848d7910dd1d9e5d20236577ea519fc6a59a6b84a44ecb8d475d121a5d3dc6ffffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc139263070c0000006a47304402207f7027c0fd99046f6585089c33f1676932ba73a6738eb82dc6539b68c381c616022040b070d15820c7f4b99ee1f413047d4d014e549b80383693eccbc3127738a45b012103448381cbd4cc253e878dce1c51593b309e58f97574e918b70da1d348ff842609ffffffffb68e141800bb7d0cbbbbe5c842aaaa53fb27505f42c8040502b03ce547ca408b140000006a47304402203cdeec90e5b730533604c859327219cd975b3575bac8fd033e904f31c001b15e0220146f4b58a1db758e75c0dfcd6e1bbcf50736bb94b1f00680d3b4ebd01187fa890121038506951c80bef6103099d3c0c090eb75d6c5319856c6c17b8b222393e5917b27ffffffffd0af5d9e4198d457576e0f6f0660b2268c6c9c794dcf35b6fcb97f09b77962c5110000006b4830450221009ec10a2516bd3a0cbfd30612981964d5e1285912948e8e46f802b14e3eaf5e1002202d699385b4f94c11206669e1bea585aa4354a18a5ed6f3632ce85f30a06861dc0121031dc422f14ca460f8eda4b47481a417c9ea5285421a1e7403779beb05d77f6ae9ffffffff78f434073747d95b0e7528db9fdf01fbc1f7a7cdc41b83db2a5e74bc13926307040000006b483045022100aae2e85df6382393aa2584ebf3691ccdde0f8f8dde5a8fb4b899e6ae74087e5b022034c18eaf3164e88d67b97268ee041050ffeee8e8baae873fa0a414ea3d57690a012102015c9a906bb14f64e3fbe6373a7311b92cb8076e5239d33cce60c40bd94f6353ffffffff84d20e975f1b268e95a866a2ac1d91e48d6bec5f9a0df34269b996303b0c7162010000006a47304402203f4eeee326950e6c91ba8e2838744a874cfa864914b516346d89b2b11b01da14022020c69aaa0920bf592028280da9c89f997cbf840968d283ab13f825a59243d023012102207579fac69a3f8c702fa779fb4ffb3ce72084716abca9a014697ad91aa1069bffffffffd0af5d9e4198d457576e0f6f0660b2268c6c9c794dcf35b6fcb97f09b77962c5000000006a47304402204f848a906c1f955ffb82f606490a77313aa8a6d7bbd629b8274c1f3cb2ca6db0022039766c5dbad62568369608bbf30b60c5deee64fdf7c6cd5d29e61710b8067aeb012103991eb4f1a47dd1f634d1075142486ae74ab7abb0e68202a928cfb8cb2e76c894ffffffffab719c3ddd5d7945263f26143912927b79974e558d68df3a1236cb79be9c5cde070000006b483045022100931da94c1f8788283e064933a759178f8dcb6481744dd74d1d01982b20aa3c210220186f595a53ac7477bc9b2c847fa246cadc91cfd2bb91201e92dfd003e9fdf69d01210374865af212f1e5a1246107a8fe4ea81d1362d1a6bb63c91ed2f5bcca5ed3120cffffffff1566525609000000001976a9140fcb0e28c1cb5f16b7fa5169ed20865ee6e9e0f488ac00c2eb0b000000001976a914827742a437edbd9457730797678838cc770e4b3e88ac001c4e0e000000001976a9143f215fa3fcb48276dc8319223459383003e236af88acd0206f13000000001976a9149414c2506ce1d3f557a4b14c59206e81cb189e6188ac23e20700000000001976a9147f7d3fd076faad73a6700be65901e0bd27191deb88ac3ae0a023000000001976a914b8f95fe58db996aa2eb88bf5acef88fa266e0fda88ac76828d1a000000001976a914a77cba1d132c6f336e73afbfe656a2fd756620c888ac1265f501000000001976a9142eca8491b59821a95b4decb10d33de11a87c1af988ac80bbee02000000001976a914ac01ff5dd3b4c6d4f8499537163672ce1f7387aa88ac48280904000000001976a9148535af0a130683b1dc3c7667ae2cb6d77410169188acdad10f03000000001976a91483b63006fc1ae9483a0b9d443a6606fae2bf793988acd0f33d12000000001976a91463699a81cf865eb1b09cfc82148e8953d97d68b988ac7a8fe105000000001976a914a6a89f46fff859b8a0303aebd82da16c0ef0faab88ac53a0851a000000001976a914835e9f30a7c6b5341a4bd152d355987f9519213c88ace0fd1c00000000001976a91405ee1086e645298320abaad9bac166549429c41888acc45d1309000000001976a914104239a9d15fba7252a5620feab2ce33cdc4f91888ac00ef1c0d000000001976a914694b0ebbae242491eb7bada96b08d1630926ef9a88acdcd4e323000000001976a9146dd0ec807e8705d3cd6f14a965540ef1ca1e368788ac1bac1700000000001976a914e05b7c3a1c5dcee2cb962d4de5abe93bab16ae4588acd04da014000000001976a914dd0d7f52c52b5f8484f46a6951a74a95c294b0cf88aca16f9500000000001976a914969bbc4bba55af8b16aa169fc545698294954a1888ac0000000001000000283eed827ef96f1b7075210c7f049093cc760f0dc61d2d474a6b700734045c1a62010000008b483045022100d1e0bde370391361865b48a6d103b79573d8dcf24305000f5ed4c190fa8115d0022001b9a5ca7a2a36422c11eabd7f592d9e9916dd39b2932cc76e14753d88f6ce1c0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff4db464587f85685e87ae5c5ba62eec2d1a8f19952dc2584ace49ee9b7fc2af001f0100008a4730440220286cd99d44561316f447c5450d0396a6a0c4dae803e4f3cdcc91d5df7eb3134e022067076f79112da30cd65ddc59d0d5843e9f0f38e4ae1c558362b730dd1b1d17380141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff830fd53ee0997ec32ac64e171568ccdd3ad8033980e41429d0dc69914f51be83ef0700008a4730440220685e7ab1c7da0bd69fbd650b407a08989567c8894c085dbc6d252f89c2e900f302206bad211388fee8a3b96323e6c3a242c57bbd2dcb13e9c971b3b7139bf2b712d90141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff8c9db2a3fc07fd6004e6c2a71ef51ebaec7a6c1dca4f2874a5e61b4f8bb793ca1d0100008a473044022071385d36cb9efe530fc24929f001d4ddffd3d057716c78b174fb516358d0afdc0220350eb07e6dbe09802b4dfb41ae300082c952acb1636b85e5681ce209fa038c3c0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffcf215866352f9dd5ad7394d701e507f36c67b64428521bfe7b103f1130193d00240700008a47304402204d3eb9f948aac5b695cd99eb435551cd72327833229cc9e5b1d385333a44a6ab02203b161195dca449dd0c0c2c904716530344c70bd79411e5299a35cd9ff228ba160141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffa3467a857b4747d17c31d9701ee8f4ab337cfb71c2b7f71bde9a7a76ef414320bb0100008b483045022100ef05e86165d535c10ce5c7127dd96525f49afd5269dab4e9601f6729f74f8a7102206bfdd93df11f87c8fd0e03b92e57c0104617d85098a98e08e48204212106251a0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffc2e5c82ae5a7831c6e19f54394dc0959fe2e2ae889b2c6ee353af72cff8d0acb1e0100008b483045022100b8f6ac0a0fbe7a51912298a3aea6db020cb59b145551ae47ab2bc56c6f5c1746022007d79692e77679c0d9d9d04e63f8aa17d6c1bf4363e6728cc2c491fc6ff14a6b0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff1e3b385edfa983193c713af8ecaa6c6693f4c5ba4d2a07846790f0116dcb6c35530700008b483045022100942c7f577573d6f0b18b3b10857895a9cee2146db83fa2759bd0cb33e4156b9c02205a128e121a3def39d37446eff4a3a1b664a1fc372044fac8d5ee6fbbdbd1ed250141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1fffffffffda89832950b955e6865ac76c5bbd4a7c76b41ada24da7f21e1b48b7dc8272561f0100008a473044022071d5f7d2b4d3d73c736c0069007259118c8704f47bef9938ccfe7c6eb82c99b8022053d6fcad0a74a5c059c307dd6e702452880aeddc12046135eb786ad2a776f93b0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff3ed10d0764cb1816cf93160551da026692696726e9aebeae2bd1aada0c3528cad50100008b483045022100db8b85469e3b788491ffc218e76fd4a216df384f28db6a8b9e7bae87b3c9f9bb02203efa7aabd83d5c11ab1091e42d20b629a32e871e336a46723fffe39538c1bafb0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff27b5ab68d9ca206ca5a4470dd580b76feb370270ca0903803020b3d371f350aedb0100008a473044022066c3a71679ea23cdb2fef21ed2dd12f086255b44bfaff06828c64e274e736a010220414701c93a206e34624038374c74a154e67945f46de8b415f4b200009976d6c00141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff10aa5e5dd5de1713efeaa5a6198878e092cbedddf5b6abbcbd9335f660661c531f0100008a47304402207953f275f9dd7d68a901016d24ed6a080e4b34635f8bf4e54d5846ee811e92bf022064644bf657def7ea6c3be981686fce501baa7186513242c36aa77f9f304168110141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffba5f43bfef7cb6a50ceeeb163a61723e11410614c92de99012a061c40804cfaec20100008a473044022055f9c6cd9ff4b060081648265b198864bc4a727efe5f6e87b9254fabb84fd9cf02206175594222860690d32e1dd2efd51d67bbc35e1635016ab8d148d02c201554790141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff8d78152d1709bf625de8a6706d047e737a9b96bf5b661f25746e46f2ed22219e010000008a473044022067c29b5d471e24cee3b5757aeb9d712fc188c5f745d398ba991dc8ef7f71e1e1022067a1a350ede3095a6c67d280ba1f01f0d2fe0f5e6eb4dc2db57756ee9ac2f9990141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffaf938d296a140d1e5c33a8413b9809363bc9fd3db15613b8b2ed1436b95b63731f0100008a47304402200a6f18ab2dcf7d91f02575223b1821a40b168e18fb1ca0781599afb969fc3864022039c97aeb5d2427aece295e3bfa619db071000a0ad5660d596f31a2c4b56d717d0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff26d8bc4dc318d3483744f51f4d4a521e876c9d505b3b9a33562a6741a01a699fdb0100008b483045022100f62d7e2d683b6517195ceb39b41d5893abb2f437d38c8a468e5cf028b4b93e22022056d0e83d53df4785545a1431a82d953513e2759513639958ade8c1e4b8fb08bc0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffd2c71d0dc40fb8a428412023ac3cb072d902036d9d76383a52a4e0991dab3f57000000008b483045022100d504306e66407dded2769e8c9fd4fa26d08b25e1308e505dfd00b6fca157d5c6022012a62af4cca34b03e8ab3096d8fe9e1714ec96367dd299ecd2faa62f5f2f05060141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff626539cd2bb704ea8f58ef265a399ac8eb6ab9ee8f4b56303796392de6d71147000000008b483045022100fd553c743bf97d7aa461ffa84f0c22126e9ad10a393ee1cff8d2b14cf0b38e4f0220343d61595754fc7b6dfdd7461b9fb6315fa7a426f45c7ae33d2fa127f3eb5dfa0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff5e900e591609ef3853fb9d6c653a85a4419b0fe0a4bef72b40db6868cb8f939f000000008a4730440220457a09638551fe1fa85e10e3896ad610e410049e664ead147d9f9779f40a73a102200158696da4c13d004f63b755175a1a7141bb0e8e33c86b3ea42c70b9da060ef80141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffea26be75210fb968647fe384d9f07821d38f01ae174ae76bbe47a4f113693d18000000008b483045022100fbf10c5ec91e28d325e1553795eb880f894b695f494c8ccb47f30ab6aa4006f1022051461c846c1a138e8db8878c15b90b012daf4a2bb3bbacd883a3bf643c449cce0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff8b3714f7e1618f11937e6d24ab02b8d3c95e279adb9684d57d2efea263739687010000008b483045022100d1b55814828527fc47b2ad8571cb6bc6ca3a21e144e782e758a0c1b3e2c0bbca022024065a6ee8a2cf322031c3235ce90160dc4014717d09486b4940a4c4a88471e60141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff144d3477ab4a57dc3f78c9c1ab230861e9ab80aa9e04ac2f5ec3c07544f0230f000000008b483045022100ad3376b0d12ab79bf8976dab3cfea3c200b13e9770dc2ca4cf28b03205b2582702207dae7dea1cb35c9c3fafc2ccd09f7fba2fc82f6ea866ca42bcde69167503bb8e0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff3ce4ca74d951c5f45e02f9463a6a54b26c352d2aa83dfdf05cbabd760b0b5407010000008b483045022100c640f6b7f6f124593b1334db6fc74d80d87b550906c54f98c5ab73b99853f5bc02207ee54b250a462442647a828a06b6a1458b0c9017078fe533534f58cb6f1f6f310141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff9f559f0e4a8c65e5be2b18538329eb88ad8b4fd4ef9f4632d32ae0999e16e4ad010000008a47304402200300189f60ba8056981b6738091957b32c45ba5ebf8e2ab1ee15655d7764aa7902200cfb1d395fe1f585f1552c0ad23b54ea03eb25e6333b6fa446eda66cbdfc20a60141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff4fb8c745bc34284cf212ea6106cdeb8ce37fa14c549cc3765d9acf475ad09ee0000000008a47304402200634e0d7928bb8f85bd5178495fabfca9d27cfd9b808bd44980f8d473885adb7022003638f04d5bd20cc5201fd8a07fa042599edc831b6cc010dc7b25bba3e568fff0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffb937d2e2ff26accf1088a35825330ccd7f0d1d78b69b4f54111a37536a332504010000008a47304402206f38e86043e29102f01d449489c8a5a7a88358b1a08851fdfcdcc23d4de2e785022024b8ebd5e7ab3330c78a8c6e1b4b0cf07704b8b05b1cd9fececc5a8d86aa257b0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffd2f0ae14e2bc19114b22bd57630a484bf21bb5fadd218c5abaa2fe723830cf4f0c0000008a4730440220170aa2247f2108d525c55ade9d8dab7510ceb0d16e270f3153901018e2638dc702201666b69bd9466705fe02b059e769a9943db53d81c5c39655111a185ddec2cfea0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffc1754d047ecefb750fa1927be6de9fabf96e2becdd3617e26dbc45be68cad2d3010000008b483045022100c1cf10efacbbaa5a0e4debabf4748b9a90d182eb09fe76b43ecda6928aed1257022004507bb709efd770e975559849a0c95dcf950a6fd5c4a53c9469d492d45b3aeb0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff9d64f5c22f9d9290284bdde5fb286fcf684b236fd6bdece6e02d07776757a4c2000000008a473044022056ef3635e03a494f00108969d4b82a5857f3fa6373be1f022740158bcfcf771c02204fdfbd12fe204e4e467ccff61ca4f8962bf51fbbafea655e3f809a53a44177df0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1fffffffff465d892dafd2aadfd914ff8af877ae6e4d72d58ea10c4a438a708f0f873edd9010000008a473044022064840358fb7b292b624f14a08c110bbda0b174177bc305303d5ad4a78cb5009502202242bbbbc075012cfaea52e06846961436ab88535a3d6be34bf1c131866025d50141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff9748db5a541909357aa325359c6f0c797bb157156de96e5a9f5f20ca06882b64000000008b483045022100d35b0e57e370466553e88e86cbf54704cb3d2d826e9a1774055dd8382e8f155602204a1ee8659f9a760133e0832171c20e07907400668d3169daed4482aa62ead27b0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff6fea9d0b3b2b24cc6b352b27e4c3bc038752b143d3620d085e17ccd805661b83010000008b483045022100981712dca424adf195780c75384118271f41934022e89ebf47289ae78b43d2dc02205ff030bbb218cd7b4e15b035f962cc708f07929208cb172afb39e2f379f4c0450141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffb2f914cf1fe445e76933254e00ef9a4f8a3142377fa7592e2407292334d30baa000000008b483045022100c8565b696194a5e248b60cac7e82a567dae65a928c3bab1cff0c744df969907a02201bdead056a33689421fcdcac23186dfa11613782af793387c6805a04583223090141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1fffffffffafdeed2ef13e5a0ed961697460e2ee5c36536b91f5a4661dfc13d6a5200ad83010000008a473044022013c3b669571bc35a83293065275dc0e196332ce5703a00443dc6066ede813a3e02203a04f6e3617729763acb9e661747e1564a93b200799210268a2a0003c62205ad0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffe696cd39802f7e9bf2963eae114c9deb00bb86a03f6df452c43c53ee689f1ab0010000008b483045022100a4b17e6107a3b5b2a3a62cadfe018a725a250cecda572a23d006e16e4781195002202563cb9c19c605cf7a490023f6164627119a241e658ff58896ef1a6b592790b20141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff7662abb9e1a9a1b8ba8ce1222075cec7eaec1aba80aedaa090af514876c23dc7000000008b483045022100fb85e713601fa08b4da4682627224121437dd46f85fc0f9dd1305a36e6c351eb02207bbdeeb67050a83e2d919dced90fb930d6c1d6743379b56695485bc0652586bf0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff6a6be5256d050bda7f91301c1696841b9aa9d4610386d40369bc3e0c01c3aab8010000008b48304502210090cecf9de11738c28b534592e0139371c1f12f18590a1f39fdfef19dcc76ea79022075fba124cf04255677d433fe34864886a4d75cc66088e38e465f756a9e6a81980141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff5a51dfd9d76f6164401f31d30a1971a6e7467d19fb1a319b0d546ef3e87b777a000000008a47304402202c7345033ebf73b7fbd69a7ac26a62ae7293d1fbe4717880737c2b83e06f96b702202e1a34ccabb36fb3088c63f37e87eb4b744e1376afe8f25686a6c5483b7014670141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff4be714871033b0b7bff214d2ecd3841d20107f65e8095b29f54268e27030447ac60100008b483045022100c6f38ac86ff34b89f6c07512313d59c36ad958c12f9b4d2daaa6b92d108e2f8702202bf655afafde6df24343bdcb82d98c9dca52edbd9b5574405d41f3be017216450141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffffb4dbd3b8da503bfa60726dbb7eb38d39641236c692b699209496a44555c9968c010000008b483045022100e75a40386e6ef94ff84434e3c3e3ca02da3f6a718b62203b024f7aa5ee7028db02202f0e3726d743e74a8bbf9e89fb86ad35603e3a984960dcdb5b4fd7ddb509ef7a0141042a1f4f9afd99e458f577cba0afeaa3e7e1fa7cf3c8854cdef57f84ef18e87334f9abf072baf9368382424c83f89d208e2837cd7fb906dbb91502075db7366ba1ffffffff0200e1f505000000001976a914dd44b69a14f0ad169d628451f3793e8591639bcf88ac9e083001000000001976a914596d3055016c76fe13b46e299e458c03d0e102f288ac00000000010000000552bb594c351c7b26b6c29b84ba47688468bae4093fae25049abdd41911bb5ffb000000006b4830450221009078968631250c4690a3dc3562e598f186a8986b4b19ab2cdd9b85c2d9a44d9302205cf040c6418677d94caec9e37f59ccd681ca131a298ac54de8cbc9fdf5736f7201210383fe170364b867c94cecc3ee0f0c8ff5c19c18c44a42b2b3df36d59bf9b1fe19ffffffff534af251e89d80a5b0fda190c880d6ab909a37bf4ca44c1b3bae3154847c6e8d000000006a47304402203076c781e832a56dba20b51d807e6ae772918000cf0bc8105a74ffcbda158aee02201770b0049639dcb92e395d6422c2b1719fad48a1ed3c5065bba82d236e65a157012103b66c014184f07f571ab6fdac8864134038373e5abe905e3afdecf0f98189d15fffffffff92498c1329832ddf168765dd5325278966343c2f788e0fdbc375ca17a424ba590d0000006a47304402201860dc8a6203376581dbf581fa56745d43cc22f23976c712a456cc41599db1a0022032e02cbdb43e70d86fe741d3eefe990d1f3c05e316ccccd54986948e519a452e01210227997757925471709e647321fe566c74ab4487fea0831e405313349ea78ad5f6ffffffff3231f0e7ece48eece297979f6d67efd91015c8309256fe26a46b2431284d9518010000006b48304502210095b82ab7237217b26db7c7d226222388ec2d4daab988f7f980f8abbe49dac3fa02207a4c9ca49e021c79e0581fb6ae165f846957bd6343ab1a7e92f5c352a3f3fecf012103d7972106d09adcbb0f0fa60321eba7fc51ac06eda3c8f44963eb4c1cdeae8b5efffffffff7a7ad6e2267a5811506f4b4e0e84d01ecae49f4fa490847e69e2c31bc241da7010000006a4730440220040ab56b2dd8a818835d1d802957224157712e5e60bbc936fbd92f8e30f379720220188a1aaacf1cf4295cf42c8d096da5973939b32d47748137ca9ab279474f8ea501210390a8456aa253d30b208973ea44b074acdd0e4cb15e25d5f2de295290cb6bcca2ffffffff026fda0f00000000001976a914abcc5501c2bdab5c7ddfb8af54d12c46c418972588ac0008af2f000000001976a914c082abbfb3ec413ba489209b11aecaac5aacc4ff88ac000000000100000005638d152911ad71b0ae3128a7f552462e722f103bc34cfc4ee940454ac2af8e283f0000006a47304402205891102c12f372653a2ad7edcaf16b6344359b723ef301e63512c1b69fead374022042d4c7d9f55266f450e6285e0ae3d15a74a1213eebfd028847039927f6bf928b0121028c8bf6dcd49baf18e6ef57228ea54c9e4039b7f7d99946626434fc17c9e425faffffffff638d152911ad71b0ae3128a7f552462e722f103bc34cfc4ee940454ac2af8e28400000006a473044022012906e7d0c21d45416f386fa5e8b70e44ac657845d6276918ab6217c0811056102201adfafb846be7cfd7b8251d1567cc0b01b82e8db28ba3d5d9804a45809b897bf0121026baa49ed6bfe52f16f0d328b8bfeee05f99388b3b4641dce900c3684a95a28d4ffffffff638d152911ad71b0ae3128a7f552462e722f103bc34cfc4ee940454ac2af8e285b0000006b483045022100c6811fc1edf9421d07645f7f792056479f31016fb5d65eed08453047e8a9e3dd02206517429e0cbee9b1751e2479419d0cf93e5d1e0959bced6ed623bef870a6253c012103802fcdb8d6635484fd21c0320daf6b9b2e0b811db96442d9be99a822676a0fb3ffffffff638d152911ad71b0ae3128a7f552462e722f103bc34cfc4ee940454ac2af8e285d0000006b483045022100c07527eb9f0efe6a5fb8b23f35d1a47445baffdd40bffdf994768ddf19f97594022062dce10bfeaf75137fef51b619b049f3ab7456b5ad55eadcc4ad26a6403d37d7012103bdfc3fe7c752f21f3101b331c7ca0a8bd760b083260a02b000fea68c04684dbfffffffff638d152911ad71b0ae3128a7f552462e722f103bc34cfc4ee940454ac2af8e28650000006b483045022100d5c6a7d346c936496c2f00418bb649ccc15425726219013c14b7d6607a6bf03602201bca73549878a6179e5421dd89d280dbadaca281e3b1919a61e0b467a1b7e19601210362b1ebc2050133818f3ddb2bd1afaa712bd43da9e3baf8d91a905acc451af5e4ffffffff02409c0000000000001976a914ecb15a858fa33b5f121edd856b6110982e01f46088acd0dd0600000000001976a914ce3f9c438767b93be5503b14adc8b56c4d5df67588ac00000000010000000567d7a52aaf377a247714679712258769ca57afbf4cd0d7984f8580dca3021603000000008a47304402206ebd94b22d7b2ad26ddbdfe4002a34bf08e108d95ace0e4c828c103d112606d402203117f01fe96d349c13d117740f148132aa987e242b993f0be3e864a2168e5f9e01410443d0c474d738e11f29da45995202320b05c2a847f94a59ff6ab083857261d8e35213914d59cc963d83dfcb15d37120b9308b0db96f09cb49ee3956f128a9beb0ffffffffdd2f6ca977a4aaf843cf489cf0fb0ad61ad51ce11f34cfc482a76b7b838d4fca000000008a473044022056284030b1bc05ffb9d2d9ad9231d43e62ad2fd60b1e819d4747ddc4b01e435702200bcd2b125fb6e6733ab2824a5d077c16406c5cd079f0e2d7f0592c316f3763a601410443d0c474d738e11f29da45995202320b05c2a847f94a59ff6ab083857261d8e35213914d59cc963d83dfcb15d37120b9308b0db96f09cb49ee3956f128a9beb0ffffffffa6f00f891a86d3a630e09b43aa24b91ab5c7a9fb5904d7f4e82cdd7b52fe7330310000006a473044022040e7701c13339a22ecc7edb3f1a9d2f15989d27da10f825f84912abb5aa468b3022046984c24232b5295750535afe70204acceb604814aeb85d9da0f7f2f49d4faa3012103f7901b70bd57e655f3fa3842519b4aedcf2a7d1bb25937854b386a8bbe0900acffffffff612e526f4a0df2cd9c20b1aac8548577e6935ab0d26d0f4280ed7ebac6bd12bc000000006b483045022100e691b5777435676d61fd56d139234a64e6f3dc7ff5ee5f489f18de8088ea33280220597dcac0822fafd9fce5dc0a843ff806c8c31e797fd008565c0be1fc8973e2300121020febfe84f518d971c1c3158c878b61c3fb7250600c532cc0df8f0a02016cec26ffffffff61665659744ea3566b3795258247cc65bd597c4fdce1d47fb54dc8a1f1960543b40000008a4730440220569889e4ee6f12df5b249389ac33ed066e7a07b8939068ab92959d5305d8bec702206cb4a5a1f7c67b151b36c0f2278395242e4750bba43e02dc5af2aed710b79cce01410443d0c474d738e11f29da45995202320b05c2a847f94a59ff6ab083857261d8e35213914d59cc963d83dfcb15d37120b9308b0db96f09cb49ee3956f128a9beb0ffffffff01404b4c00000000001976a9148bc8d05aa085575014d2515cc23e7865b1728fed88ac0000000001000000013bf82ab6ec03fb21a12fc8434a2f409c6e05b6a59ef22e7dd27ca76754650ae8fb0000006b483045022100c173e802f6af265f13b3b90f4236e4d9c712c725b7c1df10c4c6db25cdc433c702206900e08269c384ed113caf8d4bf4cf12c0100e96c7c1c8fdb449465510dd068b0121038c5c3b57f3d238befbb3d2d30722c84a258e7a7c1c6104517c34bbc5628fad3affffffff01c6ab0000000000001976a914d702201d250b4286c770ec453efe24fb6cd685ae88ac000000000100000001f6155abd104103c8bf63c7c71373dc09dda4c2d274bd4daca3a3f9fbcbecaa0a000000006b48304502210089d02527090fd13eacc5db55b4b82de45f12fed4e2e024de611dd7c479ce2c7b02206ac4e5b9d68516d088e335678bc1055a9b412623aa0fef10d16426f340f423c30121023380650476b0473c1af2a2beb4a861e37fbc6d131626f60defd2660adcd7ac47ffffffff02a6558600000000001976a91405acb15c954eb47058ce41875e79fd573ab3569b88ac514b2d00000000001976a914c21ba1a47928f8bef6be74b75d0c20e095efa8d388ac0000000001000000015108c49440d32f496d75e4df926b9d44028574f26f3415d79d7b69851a9b37e4000000006a47304402206e6ff17253c0742b63090795267d5bc940b1b490cc7a22ad6289f77888f1d6510220041ffa2cf43ac960b94beed09012571490fe2b55ade666ab3cd22f47d2184af101210328e1bca9b6d122c93fabb896f88f278a2a2452999a0e503c44566cfa005302d5ffffffff02b0838500000000001976a9146b4744b1caa854a95c829bb750e9f1d20496e5c588ace6aa0000000000001976a91405b535c47c2c3833621182b5be2acfec19ed265a88ac0000000001000000012cc5d2942e896f62113305f7a171983a8fc8b7d0243975055d02fcc70d368a4b000000006b483045022100dac592e83757daebff93fcf84b43e5d6b8272a334fb65b9db1bc4f40fc8571d70220340fc78e510071e9be79a583de253920105c158f77bafa9f64ff7919067a2e7d012103c6d94cf9b34ddbf57655ae016139681e1d544480589da64ec7fa52cfc3b86d26ffffffff02f007d500000000001976a9140eed60663e5a3661056131458d1fa6dfa957209f88ac48aa67000000000017a914a97a15771369c7747cb3fedcfbeb8f6fbed3c96d87000000000100000001ebc0408c8fa08a7111298be3a425045354e89a2cbe0d8a72a0bf9fbaaae5ed3b010000006a473044022015489c2aebd9f29902801c9c1c4e0edfaf00a687a61c14447a98c7aa2a26294b02207dd3fe965c7fe87cb5fa349d7e28712d3dfeab7b1f3953f79dd28e755750dc840121034a74dbc431735a515e44a69e12d33717119159f9820a542e8f086bdac5da5e68ffffffff026d786300000000001976a91410b274988d65f957fb3fd7e8950e34d847a9495b88ac9632b600000000001976a914df29a6dfcc9407be57f07c7116bfc0bcae3b34eb88ac0000000001000000019ac686ad93e3190110b70c40a6db567fb6dc7b1cc70aa9b591390f5b80a70ee1030000006c493046022100bf2afe55acf5edf17f00476dabc468cce1aa87048f6a3aa58ee34828d801d513022100a629446e50c72d0c9eb78aa89d2cb95e4d63a3c9eea4bdbc12634072725c727f0121030749fcca4a7dd8e6a27fa6189ce4cad476a4ed5b4a2a40fda660852a54b22107ffffffff0218156400000000001976a9146737d81de609e9af1f8759a39b1fce6629d1357a88ac50160800000000001976a914f13f79a8b06c3f32b8aa0fdcaabfb17df1b2f30788ac00000000010000000108433a84a70189ae539cae0d92f87babf71ac70ac01eab375252730cba4e36d6aa010000da004830450221008a98e2763c78dc6ed251a430bcfcce4e435bbad9e1b82f36d1a6e172b01b14ea02202b4fbdcc6c9d53bf65279aaf2000518973be9d616c24c72cc50a9c04169a43d6014730440220379f36b1fa865cc7dd7105c95676fc86309e400b709aadc300a5c2d7e910a529022020df8f63955815031c4bc063bc9f46323d038f6ed5b154f4c6df2d02f820da37014752210204ee8c004fe69866d3b8f3a7c0189c9c057a04cc313005edc639f9f50be504602102d4767c371c863dbeff2b79b0907d25b3d6cec8c7b24a5a08ae565853698e27bf52aeffffffff0188130000000000001976a91436b5253fd9868b203ce55ad5cb0098f6b8a1aa6f88ac0000000001000000b87c4198e55d1e4ceef534b613c02910a5b575630d525050e0a1fe113dbff28aa3000000008b483045022100eeda446aeea3481faaa212da516c602432b0914969c7db1bc4dc762ce791f8840220302d9db3df494c5e69fe1ea5572ab5d13643689a609e749b4e25b1c2de12f46a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3277512f83aa03c92e1684f99b078b312e31b4512b85c2b1803de35906dd2064010000008a473044022000ade40c68e440f3cc3228770ceea71e32b730b302eca0faa5285c1424eb84660220260b07b9c9b8584225cd8f1f494fc2b847c67220a7f931bdf4195fabad232bf6014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa0119a50b72d800af4da404c23f6a0f9f2d5dc70b237b8a42437083e3f5ea591000000008b4830450221008e26d9f386a1dbe1bec9d64992fff72267d58c820f95777339a7beb33074274302202490d80c8e493b3c2aad40e8d46b3e5b422843c69dbe1ea54dcde9befb302058014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3e9719e662788884c92bcac44b49dc598beacce1b86c7cf354813251963970dc000000008a473044022070633190d0a813e19eb534246bf78e50750f7efa502968da05145b740b32dbab022013df01422c6e9579fdd7c702599dfa5d1e4a20ffe6549ddb77651ccd1c835d41014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff4f1dc75a10e37f7c07f25b42bfbdb8687b366efc4f35722fc66996437dade1ec000000008a473044022040664463aa5027baa60345d6085d3320fc923fa9e4b891ac2c63d8257c2843450220119695d223bd88abedb993dc5d7f163324b927a2c38200a7cb9e53e9e74ab7e7014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff2a60b2351dffb2858ad98d9bf14c8f2cbf843ca4fef386b6380ffd7dd030e430010000008a47304402201b99e239f503030ebe369f04047343ed2dd17600fec55819dc343a28304bb096022053debd56b2cf5d60a661ab6c217e1545be5de2ea329e2d02c275567867c58df1014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6e16cf94944e72e495e516c09595cbd1d80209917f8fbecfa3b8256ce822fccc000000008a47304402207e6ae3d939a29f5aa7c71b15b58ab64bf52e5fae57f1096e029d5e371d0c446602204aab472539cdde0526deaf4595d93c5eeefcadef136ac2b7416e09b181945f9e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff254a1807b6d5e9403375c54dcbd520555f3e6266dd4ca144d8bbc16f3870ce50000000008b4830450221008fc243d30ecaad533fe51664ed759f0ac389b1e9e265c7956856e16d25356d9d022033dd3c3f84be5a6d344f734a4146722a3a58820bad630c5b82bb1ea50e932856014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff47c4b165a7ce79f892ea3515670726db487f354984b3cb5894e9c414ba6483ef000000008b483045022100be633ae66d39450a26f732abf591b635f476e6736ee9dfeea05d6ef779e61a4302207d4dce0bb91815ed5f24bdc0b6a3214b0c661b62975ac351bab0fc736f8c87c9014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff9de2082c61edb091a37250493c017922742c956803ddf7148a84cf59e5c72404000000008a47304402201e298e468241d16d1e15c6ebfd8174a15331755574e1ab5923fa47eb851cd208022078545a5af7a96537f5e6cf91f167f2eb84874e350a96805ca7bd900000d59266014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31fffffffffd64001351aacdc62258c3b6adc122a1db38491f4a8dfaca57bff5d005ce5ff3000000008a473044022011ee32514619892c0206b22ee435cae58ffb701d3e72f02d84f4fbefb2fe07be022048b2849b9ccb51959083e34195af970b96fadf32451b4f07500e1b567ea1de56014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff03cf3296b916bf32c037cd73e6fd5a25e6ad692fe0068842962ea6e436a4b321000000008b483045022100e16691b53d93ec9db9290b331967a970d3790ce63e4f8b77f86d4fa0887f6cf5022050f3b26be49efd4bc2e8050ce1edb098f00ed68736c926e17490ace907a6b022014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffc485d158f7314bc0b2c9a66518e7acae4d396b8d573b50c552ca00108b4b4aba000000008b483045022100f9c2a5b8aa10dc498498e68ef463873b64adc8e3a46ea67f690180c7461a32fb02207709d8753ad5a56ce2b7abe36d3cc4ee66e15e949fe4afb0004256d8523069d5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffaf18b493a975a6ec7721fc23a8cc8e0c700780310dd587bb2b9f23a629e68a62000000008b48304502210090ece15ef481a340c19d65f6d100f426a604eb9a73296a8022352a1dcdf2f7ed0220158956495c8b0891d8905b24f50db1f1029a95130f9ae5b021ef3b6e9dd86bfa014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff407810ae14f48ffb8cbffdba13e00dc412d5965ed29730b2e37fb2558302906f000000008a473044022051844ab15f6ad2f31c443720a7944c940a48d309ef13fec718c9c77ede6a6f250220226faa94f75f1eff928f2e28b33615509189976ed6040c55002bfddc68350070014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffac0f6e6d5dea966c7ec24cc88c93067a7875e0f9d36e0f3cbd210b5715b6edd2000000008a47304402206aebb839d7f647e4cf973779dc38e636de9bac10fd998fec10d78e4afe01ed3402202557554620d5c7914c63b55c8219bfa0b3096794f347cca99200ddeb49e20153014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff957dedf22d0a86b4c020e8715dd8065bf8699d1a63bc7c1ddd74112f06cc81de000000008b483045022100a6b59866f2049ebfc358529f0d551ae8b2baace5c25776b238270109072f62fe0220108697a0fd6e455de2a601660efa6b00cd4f26722436f613a6736b933fac8d33014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd467f7377a086ce0704916327ceae6c1963d2ee38729f0cc8c66b4b6d7c4baca010000008a473044022026cd4956d3455e90b3f8c1c5a50ace75411e04b8f68a6a2027950b83c4ded28f0220321bdcbef2ad151cd16dc61320b32b5d295624f3348b70c2b7e90744cea4ed15014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff503880629d78f396845186291c3ce00fe99c8b62df583d5f3987d8ad69273de0000000008a47304402201a4147043ed4ae14d820288f5b746d6b0ab7b2a2a237251ab9acb5e73864493602203054cae22af872328f220c0b3b4ddef7fda256f34491591ff8c9e0e4f5baae6b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff19814da5f966f8ad13350f6a639d37c7ea7f66769cd3c3e8d08fb65e263a121a010000008b483045022100fa192e15b372b949f84e30bb31ddc236bd8edb48fec5254d35c22b250cff875d0220645ac2488f5341dfd75a8dd16832742e2ab141df84030254b09b67f277d9938a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff29742ee87db55f67e77c3acdbc812042d37e803c1cc1e1a451d8ca84ded54a02000000008b483045022100ee6ba558c1f6e302b201bc1e07824469490cb967dea4d5b6168e6727b1f870f402205ad60c9fc9dc75b3ed341b32d8c6f3b69e68658036bd4cf4f6a4ccbb298fab30014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffed776aac195f445a7f76b41416804b4182f96b617d0e2be718436b18333f1642000000008b483045022100956f4c4692cb71cbd568a8e84b9959de21293ce8d2605fb27def79b4444553fb02203e5d65820636ed4cc233bb670cb573e574da0651b05a5eb9f56fc682a45d7585014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5df8698fb02381bb28768dc0c4049dc377b0fb376ec3b7761a2b57a662e02bc3000000008a4730440220353f2709edd69a12b03238f6f343d487a17b33b247604fe032ccdbc5f13dfefe022067f0a3296881303aaebacb12b2dd859e4c123c338cd9f65eb8e7d9010a7ecd29014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff61fbdcfd7048345a445e00a48386285056f8d7a7ed9b52805a5e400117b87d1d000000008a47304402206b9ead4a53cafcf84fa44faba826205b9b2e340614efb10c4a670480d956b3b202202e47059725ef945f042369569297448c4e5928472a6881aa57d580a83c94600f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5061a471874e56a7591c26bc1802abd5bd2d0cd62f9138d90303f2b1875ed031000000008b483045022100c57982480c741738418e284d03c296d5a8680502c262de9336d334f7b9424ae502207fdbfea795314e434605a29fe15d2c9321db7dcae4c780dbf688c8da7299f1fb014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff53698b5ccc19c0f781f1429d418360f63cd2579ea8696d876af97a5717c3e5db010000008b483045022100e9a73aadbf54f29a239a65e6c842b772950b0a18ef26e4421e9a162d666ecdce0220439a00b842cf60195042db8a98aba17239f79089a31fe71161fd9350690b2f15014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff2641fc9b8e682eac377dd41360754ac38100f9065d237649f9fcb12acd902c8a000000008a473044022004e04b483d1b884161414df372a61df26466bff4ce271e39c16cbbecc84eedd302203672dc6d0f58d10cf0bdea1f647df855d66e206b854af4138f51c0757f20a094014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff52a934404054bdbb9ea752b99187b46745c28fea81025eb26ab667bdc8757040000000008a4730440220044022550bd2c3e57fff2e47d01170f57199ebc64081936e7f493588d227f01402207e6233f2d50023f83afa9e6f9174b3881c5e60f2f367b9850e0057fd3eeb1b9c014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff627b10f07a1ca1017923798fdbd0b447bdb3cea80b399044dbbaac4827a6da66000000008a4730440220129e328bf95b2253bd7f510cdbe1280c8140ffad110d00008c3ac1e6c1636c2602201cc89204ad03315271c7306b7f6ba0f3fd9795e868597f767091f98bd689b645014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5eb612fad48ca64c6e9da2fc9bb0bb42cacb4f1cfedf960b664d408e61a8ce2f000000008a473044022078d986296e71bf978095d31d7404e5f7f49ac936b17bd401682cbcae354a23a4022071bdc4f2e7cad5fb521399d737fe10809a3f03e410372c60101c0ef633e53fed014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb3b1dea271be16cffb2723caca96800805133119df59a5413c4c18b2a73dced7000000008b483045022100c9e25c79d1fa49ecab1345b2989c63a87383c3b6b7d8161708741bcbda62c7d902200ca94940c6056f1960f5d19a0852e11e29f430afc8c12fe176bbb0d9245de2ff014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8eda448ed420c500b4751224a3c1bc829c82ddb2571c1604033499eefa415f44010000008b483045022100ac9a41dcf327bb5a9927a2b43ede6067427e24dc737b4331996b1fe326bb901f02202974a02008b35f66d87e2b8bbb6554c3cf26eead36baa4ffaade682c6fc8d6e0014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffea50912337935deeb270d8ec170ed43468f0f4ab8935513544e514e8cc82785f000000008a47304402205e668cac8f8200fc964b950a4e57668cba72f09915b2b5088d984a571eeb2f87022038295f8b5d84b1b784ca4059c3bb6a4c06098f27bde87d394bd896061ce95b32014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffc3860da9b15f6097f6948d6dbdcef23d0599d6b8d8678e44a2ab4584fd5759d0000000008a4730440220086f115a6a3cc10160eb7e84bfdc0dedd27b2e53f7a9d4c353ad5cab37a49be702202030d5668c906219319a25e37c933616f05a0cbcd7588c62d73db831ffd09818014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffad775652988c4b5414d96411f13c557f5ab822adfce99be9b1168966329cdd2d010000008b483045022100cd8fd9d3d845b267e8069e906ced74999587703de5692d2192d0a52db62f20a0022049c2798b6a7b776e2e37b0f707d7846a7d04b91d01173a31dddc19c8230e1755014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff37cd20486aae1e6b1564221a8e51635db9380dcc3379d60922248ab16c687b38010000008a47304402203f16aa07ca09e56ff1dfc5d80cc9be3716d9b1cdeb27c7ababeafc5a8af0861f02202e9296d02d55d6fbbd801e86c62598fb519e38a60e980d4ed023dec2d5c8cdfd014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8e6bd97bd3b51402e59e71e99d131e3a1049a84ba6ff62c3b6fb41727d6e8d46010000008b483045022100fb0f62ed272d2be75dfc8a8ac33b6d82e251834f42eb1f604594efebd4b5ecf302200cc28c19730ed6eba6218826868c1c69b65cc706cf9357678c5ce8f0b8a20ad3014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff4e867af2aabb9bd83bd9100739079ea285883a30650f7e2e1481b52b7af97b2c000000008a4730440220539667b0654549b9b15816dcdeb6498ec687f6c67fd723096d1adf0fe22afead0220418b18da629e89af14787fdf547e41047d4c9a5bc71669ccd890d9021a33605a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7158df8dc7240f4cee203e70373fc27ac1fa11710b0483e606145d6b15011908000000008b483045022100c2c84d90e345c94614e34fe7c46f2375c49b84bb67c6ee11161439bdc1935f5f0220798e8cd6aa9da32ae8b84afd20aa4695970c0b5139f77bc4213c27b82dc8a03e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffde33795b1eac1a780dc22f07c04df835de23b71417f82fe77c395e212bfe33bf010000008a47304402204128e0aa2a2505477844653dfafd8323130c3e1308476049c7c479ad6972498e022002e8c192849b7e03211ad6756b0c14a4d80f4fa0a67418d6f1efc8a99ad79b7e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffe84954e619677efd1aeea6b00bc4452878d5918dbfb2a8e186fb6ee2fec4663d000000008b483045022100f273c82287b4fc9355546c2c1d4b2fa55127e554d26727d7b6fc231513fe31fb0220453a6f0103757d048cb574d7af5c48f3cba459ed1ec4a1c4c78e525fa1fe2f29014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8580a0ed63d7bb72b3173dfd709f5878b1dc3d00d97f799fae88290fb20fb7c8010000008b483045022100990eca1c490380afe9433aad3cb733b6159d2663d508a66a022e7ed8a51bb5240220170eceda6d93055cb505b19fcbe942841dee55f9a6148ef1c999f0d8f675e1f3014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff24589ca66e842e9eda1119cdcf750913bf57704a8db23f07aab13e419e9a3d3f000000008b4830450221009a3550d9b7c8289a19a9d5c0515965a0dc8eb836fca04f1958b322b756777b4602203a710b314c1fd1172d86f9235b3c8eaaeb6854a053a05d6f44c0c8c01f93e613014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffe510ab6abdc2f0eceac3bb9c719a8c7506d824737e9ef0bcba0f4c118fa2ecbf010000008a473044022023a97e79a14144efad96ef147eb6ba6e372492b2b6fd6fa2f0e0e7d5ff846f5e02207179786786eb72f4666aab36d0b5e766a984f9167cbaae8d53c37de339ee8e34014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffe5536289772ae083c041c11bf0a963ed22c608d1b5bd4115158d11bdf031430d010000008b483045022100813886331fd81eefa7bca4c9d67b159ef58267dda0d2821bbb99646b52fcb3d80220701b7aac212609cc13a344c41135ec3028fbc00294f0fcf4a8cf9a36ee5d6b9e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7c8f010bc0a031404fa7823393641d152200c555b47651b2e0825c197553236f000000008b483045022100c2809cdca3471f5196e5fee32487965c8ff919910aa58459c90c622d5544e5eb022025b9a4b474b021269be086d8b90b766c17a3a1bac4bdd336cd423f8afb2ade2a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffcdbe97681bb0119b19317af8ccb326e992fdd232327c00a76237cebbfa536ba7000000008a47304402202ed67072685202d2ad437ffb1e35ddc6652e7aa35010541ed9e69eac811b379e022035d8224cbfa385eda5d79a776fb33b97a6aaee526d46f45bfbe1bf34f9914b8b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa2f8d98625a03e292702649f7c3f9118663b8bee54a731698c84bedd814d0917000000008b483045022100a3f56fdfe39c9312164d646298bf9b91eadf6c803d7a8206af0a3e948455c56402204451edf99e7c5ce263f9479260cce2c1596f6a23dbe580e71b98b44087524ae6014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff219db259b8f0779017c8b183713041ce18312152443ba1ab61a22e3017f76d61010000008b483045022100bc08e13b2f94a8100830ce531b2b2a06e70a21cdfdca10eac7f889b54e31338602205ebd473a861350671e9f08991d4512e3ded92c8a091e6f98194f3b08fb4b8e4a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd8760ba4d949f9002282bf254a4b414e2f1ce4d3e0b874c21c4e5f6fd3974589000000008b48304502210083d38ba80768150228d781cbeaa44fce32e99fc44558266de28bd92ea4d61f6b02204911bdff074b0b7541599070385f6c7cfacdd0d64a018ba9502f50539e4f8b0f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa2aca55af7f47273c1efd1930d43b10dfcdb4dd9675c95acc11b8ce085d02b92010000008b483045022100a1a98d816e3d3ef94cf774e166dfd3853b8b44fd019f06254018bcdf9cffa3ab02203ca23adf7ee90210136f103a03857ae8f021f406e290c6f6ec47f9ce11b02ff0014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd796e114a60b46521652d943ec69f89b708c44034e1403b7e906e505ac5de134010000008b483045022100f84173dd064f7c9e978599df7eb8ec4e689e294fab7da9f681a8bcd64449b85a022034c80a3e6c40ec4e1ef3f86b21ab2b138851863aad5c9c1711f784e080431875014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff51149c823fa3c91390b6fac44db7b3e67a25682364486d09727f5fe357cc247d000000008a4730440220080d35dd7f0112a1b4e327249aa5526d3ce79e388f4786ceb0b171759611ef0e02204f7211fb127fd188f9d88f3a65d351dd4465f4dae7323db11d2b1c6ec0097693014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa4be8955ffd66dfd7e06c220abc009a36607b6c7002e95094cf48b5f8b8c738b000000008b483045022100d3919ea8cdd491a699c68b1a2eb23849110cdf07c7e5d5a59a528ad1d1ba80a6022033944f0def54dea79cb28ae27a40e0e2c45d417ad4e2a044f99d5a9eb8d463bc014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3a310aba7c3e3dfdd24bae393d7b3f9ab0d4ebe7a9b2ae7b9e0543d7737bd3f5000000008a47304402202ce7b6b9b16cf6ed83ea30c395fd277e1d1edc48fa8202e206d6ba17d6f92059022028ba664e1618965e6f586b84989cb0df0f23d7222374653cd95fb8eec206820b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb93c390e1b4b837fa28e8a91628b8f08c3134bd754c2bd2b3906d198db9be11a010000008a47304402205bdee36f23809b9ed67d9b40d41eaeb02a6f7c314800c61fdced84e6e6d4afd3022028d03be15d43bd22f799f86a5a1fbf8744a8633b50d36cb1eb14115c4a332394014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb60d5082bcbf074956e986273799c5f9cf561b1440aac7bd2921eb35150f305d000000008a473044022025ef764daff376fa6ddf9641d4c2e6682ffd764d14b3af80895d2cd29d9b0e5602206cadfcc1bf24fe780fe9690c26419c166540c03a3917e597c7bd24b00d54c649014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffae3f8629958ea057d99081e94e956aae9f0fed7631bfe2055d86d823f7300df8000000008b4830450221008e5698e1ad05c297cae346fab32e6e0e4d8ccd497ac99d85b3058db3aca5024b02202153ef5dfd5218229bfb61bec530bfb87cf6d62d923f5e2e57b20617f99b3e2e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5a645dbcfe1d7f8c84362491d30be34147e29f5c5fe89ce41071cf82cd4fc090000000008a4730440220237d6e715aeafe591a4bbce13ca2205d4742e67ba7126cbe2e0548ea84f240f002202781feac551bc415f954c68412e75dd8161152a1123ceb09a5158ef02493931a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffbbeb3c7158a5a0c1c013c7d716f889936dc7317510caa3e00c1bdb2b82d9cc09000000008a4730440220186ccadbc99b4a2a05aa2a8cf30c4e7b2941452c5b2932defb7e3a7ff22c51d40220257aca08118cae27a827856365b541420dd568bd42e64e342874bdf35fe28d12014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffe34c3dcd2193f88130bbe0662b898a005d0c95554752aa99b7a5bb8868b45e0d000000008b483045022100e791d6f955bdf42a7deec8968e677592e666fcd11dde697d4d3f8e53d13f68b3022021bf1cb5084685d614ce6d876da9cf353bb8bd6a85bf176bffce8f509a458c97014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb19eec286c735a140c6fa491c9ab42f997e0f7d7822074526af4281c1b3f3643000000008b483045022100e5dade3f507443886b3d6ae840999e9ab2196b2e2895e7fdc835eff9ce93cd96022059f81d7217ef38f296db35bff0ba928baf7edb86bc543e810bb37af621e73dfa014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3247d44c025670b907831a6611b123322eb8028ec5ff393b68b20315fd16d28b000000008a47304402203a6fee558c5d4c52bf67ff18a8361cb7af1f850dbb0f930da270f7ae80d93363022021b8c162a1fa670af36e206affcef61b9f8bdbbc3448ccedaa9819d5c3f2d8d8014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8e972204e06c5792a1ebaaec8426654ab5e5a7b1f292c4f94fe5590c0f7d85d2000000008b483045022100c3b507fe529100d38feb60c5f6d09b685468094bf060e8b7f41836088e1ecc6d0220370a76e3ca0252710351e2af8b88a50580265e0a7f96c70d4bbf751a04c5614a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6dda38a03bdfa0c362bb6f2b2cab2c6f69f5711f297555af29382841a69e99e0000000008b483045022100829071fdb1c8b1e77ced838aa68b5b21885219b0658d252346cf8130fa3acf0202207996837b080bd26087ea3572ef33617851b41c7a10c905fa34d1f4cbe6258e01014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff75571451fdc37d95afab561755d8a7852356bce9d4ba3148786e0b055be9824b000000008b483045022100920ccbe0ac458f1933f038752c170bc0cc479356f64d5d1b32117a9518c1859402202a4cb804b739f3bacd1b9d4b6bba0ef7cc44bf581619d2ecfef9ade76a3c5f7e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7b8b65702b722659bb26abc601d21bea053f503af730879e73b44b2df07d2005000000008a47304402204a663f4a80cc5602e325e096645497216e4a799686e8f3b5f1463dbd7112dea0022031a9fa3d5dd682dedb0b8dbdfd53cdd318a43ad448f434e932e7db3c50e21c71014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5483de99c58fe38bb9f18e39c5bee7e293feab4e5a1cbf33d809a9009a778e9e000000008a47304402202c3e0974aa34f852c20cc355374a6bfed1d519bd76593454ab1ae355b7aea20f0220180f297e3c2a2b83bf369bffddcd162d9bbb491ce4cb74c18822fec9bec36e26014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb6920943981c338874eb4b81bdbb238f7f9f7c364ddc2a4101589859cddc29bd000000008b483045022100e3e4521e165b08889b8add001a7f2e6d2e4cf784e175659c023367551335bb3702204672996b313569c15d6c4b6e5a7582325264878af7dea45234b53b4a1e94d736014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb979117ecba981a558c7fdaeb120dfd674ff65deff370c3fc3d033a36e7595be010000008b483045022100a8eae5b8478ecba8abffe1314e280386f78009b6c388f6a3cca25b61e8e1976002205d957f4e19cba9b09b630b53d4f9effcf3f2e9b8e6c548d7c67d90b1dcd0ebdc014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3bde6a3172c412b733a84b7aabc70cf261ae4d0f1b7f435e6ee21c8a547b1a9d010000008b483045022100f5014f528e70fa7a109a77b6a920290fb412fafbb2b20a52bc4ad398b670e00302203c53316f83aa14db4fb3de7556545e54424752809e08aef42cc4fcc1ac4a4fe3014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffad564f40dba7d0351204717637ffdf446c2a838eab98508b3563b64e4738d14f000000008a473044022019a80059a77d926ea71a8fadb9c1e8a2f0538fe736be5bbe49411f8917f32ffc022073ac901cb186196c5f70faf346039ed9d2a534f3bf38d05db2be4aa1f6f7cd3b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff9a3335f1bd1029838236285fffa275d042c5c55edeb86f8e9f166f23b38b1407000000008b483045022100b4c615707e0084697d8bf79d0764cb02d6fe7c7a1325fcace111b177b02db1d90220658caecc16db36b4321d3bb85e348a74ef18ffbcb0247cc97fce27bcef8db6f5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff84e05905b9f91889ad2bbf1581de3b2cef77726987ddddfb45cb67407a28d4c6010000008a47304402203e6d59a681e2edda2718b013f7f2c88972b8385b9ed62a5349da1e9b9580279c0220454262933f9f008c0bec68c81c3188f29f124a3e2bf24dea8b875dd842196cb2014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffcf5c10bf6a3639a715e876dccbd829d0735b8072e793868dfb3ef72e0342aacc000000008a4730440220056b1c4c548224de2adb5b3019fb95b867767a84f5dd9bb9cc091392f607c7ed0220272772c57ef153d4523b82572a976f8974f79054d64754177db0e2579227888c014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff1353fd4879d2278fa903ae59f4822c219e87110b8ead3d31b2c3a6410bdef4fe010000008b483045022100ef2baf818f7f44bfd339aee5ab8609b1d344eb31a94184f8ad3ba1f19767dfb202201371689e1adb59af5c8ebc6e35f23eeabb612c43bf26403cec751b31fdd96bc8014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5399d5a7d6530ad48628e7a038972745a1769c0c299898a9c9136f6ac5533a35010000008a473044022045534e0591902f508ff50fe55845729e88d44ff7d9bcb93a0afdb00576fb87d102205f79b79a3795b2857eee7aa819dd794012e73a4d10e58a33d8131e8337bf5e22014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffefca3bafc2d9d0b40da3bf3152ca227b5e380fe6c28829b00512007a5aeb4946000000008b483045022100f5fe50463e05d2a3a3750e3556ca046a768f67349a7ed109072f0e66bbd23f8802202fc58b737a8095d1bf0b0d22d836408581bf323d174afe9b293c4eba8e3ae44c014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff19c71b3562d72d49250f6532ef8fc0e6e1d5e5a01dd36abd72be7d2bf011ee5d000000008a4730440220697b858e69242298680abfdb451fb9e82f9f6cb04c791a1c824b7c804cc16827022059d229da3b946f4f451e4e697e4485ea91a74207d4f5929602271335f7f3a8dd014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5bb75916582eee737a89e43d804d7c95a3ce0076efae967ab58d322497413a2c000000008b483045022100c55a8673ac09b50d1f55bcd8436834759b5d8b76525288234856c18aeb4447fe02204c512676c1411d8f7ba3bbf1668bba888e3732bee4284c3160102619c91e36cf014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff341eadc37fe707beb9cb10820d3dafed594c2db879bc86073590f0e425789b31000000008b483045022100e74da24be0cc25f466a4f32bf607ba08643b8f38fdc645995a5175ec064b174902207afdcb708992f7269c8e8abf22840fc77d8e5993192f96b502a66296e63e3430014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd7be31e7640389705769614fb7e7b1a406105f4c77f3430321288241eace429a010000008b483045022100dbe14444bd0d76a13deb03a407e007513fab9d8fedf00449dfa67c7c9b909986022051a761687d81fd381501b61a6c115c7e2996680a9985f4cf44a8fabb92d6647d014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff9921eb3073740ec243a76c2fb58f2ceffaf63abce4dfedb8128f51f1a17223f3000000008a47304402205a54eb9d87b9ddb8145e3e4c04e8f2b930f5b003d678980f823e13a205ba771902206169c29b8314c19f8bb7a26af21d9d63221321b9cdb87ebfb44ff742f0e9d0f7014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb8c300713e7999b0913f7dcf9615339400a7bd9f6d1158de1d291c15d96d7f4e000000008a4730440220799e39435b2080b98336c844d5a997ed783986d07a69567005548a5e5107464c022003d741fdcedd1fa7c4a82625b6f984bc6f16bac6d68db8a3ae4ed7b68e38a49c014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff739960f57711539f31ab19c617003fd874fd35c224e00a7bdb754ef7572da76d000000008a47304402202f29fd429fa832762307779eb15d4fa0b4abfcfd33d00ac94d31e10669ac4b5b0220126c3399e52f5035ca9cbb1b21edc21757778196541461ff1384a25a1699f6c1014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffcb1cab67a095611e20621cc2fb878095609eff0fc0747b06bfe93111dbfa5838000000008a473044022073e8ca9be3260b524207a8fac634b1490e1ceaadf41119b4c10a07fc59f8ee2002200840eb9c98bfd9c3ee72297ca5d2f9b72ce7d3416a0998b62cd9116a960edaa7014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffffa386af16e1c935e1cf0f82b6c7029da3ff28136423dd647d8d6522269487ca000000008a47304402203cd12209d80f2d93fc31c3e4aefd8e807710efec83aae3fd34ddade3dc3ac2a3022030729e72abd3e3ba61a376152a97ef6bfbf02ba23c0dcd848ac1e208e5884420014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb6b803d129190d7560678decff3967de9813e32e191884a4406e3e4b8a38364e000000008b483045022100f32857b4044ba6701765a5ad531c16f3c129a681c30a156440f3d3a4e4ec8c56022002daa8432d861214fcfa164108768b74b7ff97886d3bad9885a655e0a6d61d98014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffedff6fb28d5cae891c26c8786af0447643fec708759e24cb16f4863052d5ed9f000000008b4830450221008a5e583a76082dd398b9b1a5bf97572895d434e5d1fb5e783e273e18b8fd75d002202c6f6a296645f5ab2522a69b7f0be28dfa36daec6b353f4c1caf8ae5ce7efaf5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3f06bdf732290cefa08becffadb08ac9c85aff5bcb320eb84344a0312dbb19f1000000008a473044022067475d8413b0ab578daac369522b046c4cc9d067e628edc50a9249365cbdc696022022717187cecf56df7e7478cfd5c1a41c0d2106a88560cac26e8ab496b5858b47014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff76d7eeebfe78df9b2345b901a3cf1b811d785d33bfc9ef69e0eee8ab2bac87e4000000008b48304502210089ab8911c742bb4190a24969ea3906d495f5ecf196ac962125b375e32080160302205b857923b24e44bc6818707e630f223c590773f7539952d188b6b439addf8d7f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff1b67c1337d493431ba6555403bb29074f8594b9bd89bdc171268b6cb8d5fabbc000000008b48304502210086dc86d6ade4211304b0fd399c655c4d5b27431296dfb1f037996232452feac902204cfb1430b507445582343967e5f5def131cb786321fefc53d8c07176e2262a6c014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8a5e0517eab85e25654c717a25c72505ff56570b395d1e6493f22d87085f3d1c000000008a47304402205df97747e1ebf980b5a7ce5c1eba4bad652307d1d36c230dcffa02fa91781d4c022010ceb03ce1a0ce334f92799e6cb58711e677ea3fcd2a5b23f8b415cdfc7703de014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffc41c319801e90eadc57b4f08c09c204b0c87a8939d421eba2e8f46a05a814643000000008a47304402202ea29bdbd504a29e67206f618090c1ba496668561a93f0b26643bb132a944b2002201e789b05303dd5cc68aed8d9c5ff78d4a129bfb5536ffd6214ece0219ee5bd3f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff87411b1e6a12e903d3c2ddf919ff303feefe09afb13f8bb853ff9d0f987cacd3010000008b48304502210091f26b68caff41a6e423d36ff91102c24ad6ae4858ec791afad4367f2eae7897022076bf9bf94b8343a7bc630b607fa273ab0390f7cd2af9fa9b4d9de4b7a7112e80014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd4547281b9edc214d147cba1d7408b5ee26c6c2389348b7d3e7859b54714d98d000000008b483045022100bc0ef15413d09d82ef92d065210741e9241aebbe2c3bba552422c775861d894e0220174058888e772f68206baa57696941b0a538cb1bfcafe7713e5c33cb9b5e3383014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff00b9358cbb2deef7cf26a8e7dc8f8d2c31d1ee56d6c7042ca031f4c30564c9c9000000008a47304402206de0742f744af7968b90c7e1eef0735af93cdd12496760917f9e0dc5a17bf6dc0220788c2f233444bc8a8155121c53c68e2c10463f94e8f409d49914b05c1ef62ecb014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff005d8b79412ff14f0ada5292feaff0ffa9138e1276aeeea6f66c994ab57b47f2000000008b483045022100fbc626da5f5c298532fdb3aff395ca38f7a36fb9591c06ea6ecdfadbd72d8a3302201f9a078c57189ca9dc7f7f488b80598b75e25d2fb0eaf2fbe12fcd88124c161a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff920f59399168b74eb11785fa6701f41e692b2ffac1fa29b446de85fa0cde86c1000000008a473044022063ef51b31d42c8001ce1a15d57ac90d5bbc36ca39a091eac4e7f1373a0ac8a2c022022285e9e83fa333780162268473decaa3be30d62ac6f4e67d4e0353cf7eea38a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff0d4ed410fa70a65455632fc4e4cc609228151a21b5b9b0dfb292afda40a10c4a000000008a473044022067ed12233108143cbcd70f21e4ecdc6a89aa648be55d9b3597d2494eb5d664480220268784e125afc8e96d7b1a28b1f46af59701d4bbaa47529577cad8dc4bf27032014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffac8bead47aac599802cdf05d30f62b1404248fcc9f2e1d76b768384bde25796b000000008a4730440220250cdb1f8c7e33a6887554c8645aeffbad4434ea33703b51b032223ef9a8b00502205a95738f10bf77717776ab15173038cd68e7276b4b3ff9aa732553ef579c74db014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffbbf3cbe2bf5a4fcb0d10224b5e1dca14036a806de3bf46654ea18a6190054f8c000000008a47304402202fc4d3538bf1601ae9871f3e27cab9fc2eb427e05101fcbe0ea411d8a8238a480220076a72ab277f468eeeb1615c478071b6fff12300caadcfaba5bf4eedd5c8838f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb87e4c78efbb64f9f92b27c694b5b7c784f80606028c1d487994e47c2a274914000000008b48304502210097dcd6cdaa57786c862dc115db567e4cb386df0869908cf89c19bd17233d488d02207feb6656c0f769d06a9ca9b75f1ef13fa25822eccbc0fafaff044c6d908885c2014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd5773bfe1952cfc90cc46490fa0a126f52d72847a0ce0ab919f6bacc51850d3a000000008b483045022100a441d259d25af870d39eccc0685a6c8aee1ce27b400abdb07f9565f414bb5bda022032277fe7eb2a08390e50c89dcfdc937c3fc892ee9a946976c91202cfe7c427f8014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffbc594876b467b2b0ecaf21d327681a3be9989778a5804ad49e8f817fa1f27997000000008a47304402205f001fa929d3092c150c243b31abcbb15a7dcddd7162abfe08b4dc33961c25bb022072ae3b951b7a660a8e1a91b7265fdad94182b3692b74cb0407e8247cbf56e96b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffe32b4cab0e68dc9ff28e822dec3745f0c103ecb2f337a29d22c0dacb4cb6e4a6010000008a47304402202daa1fa6db42805ea5c841eafe1c0dcab99f2e269d96c725ea176fe2116ed6c402201650154cb20b6a5f535558ab67f3dd16c621c1e745b7c142b4d8514a2cb59d6f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd1b5374661c8cae0e214e8309d8c04ed3cc9c7689f2b5a98354ec15d6d0be2a6000000008a473044022046ee82dedddc26ca99eed8499b12a695a9c7a2ef1381b17e50552ca61cd228d902206fdf2a5d54e55015105dcbdb19b33702dd1a01f2f1ca8e621c45cf759cbd282b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff2cd9d8b0c6e15541f1b8590154e02cc8950ee5e9b694907368db04134192325e000000008a47304402203f251d4d7843f0f9e8c2b679df7f4ff693df1b31cacc1470e5f7ceb8c6be0c7a02205706ab52b580d5be3385fbacb34593fa1f49d910e6411aff9938f8261ddb6fba014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd8d5f536f8cfb7e90a37fdaaea180db7bf30568e6c286bfc86fd92a36d00fcd5000000008a47304402201cf7e79bd55e39a9daad974e903caa4347a4fa79ae380caf41b5254bf74bb64402204ac03a15b33f5cf4132a67b307edbc814a37bf1c781581420d95d8526a94ac23014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff613c450cc4ada24ac4637e521fc758349f02f8b82183b0bdfa071e3d8fbda581000000008b483045022100cfe5bbf4116cc4a70b204abfceb2791581a072634364d27cd6638c8ecd7301360220708cfdcf732825f742679a83cc2922985f5aaac6458aeaae51f9262b35331165014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6d3c2512f4e9d6e1f992264b0f8d3876783f08bfe9dd96fe92c5fb21c971b075010000008b483045022100f051f41838cf40a4aa1faa774026b125ee8986d3b785694a56299e753484c587022049c5ebe12a1b44d198abe3b4ffadc266abd9741dfd1ab9533a03a5620527f6a8014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff1cdcd99d5fece0543ac159abe33fc1189fcd55988a133ccb74380e05833dff33000000008a47304402207c2e321bec96b02445d522bdcee1a17c2f693623afddfb4088c82ea5071ea56b02203b49d9b7d7118794ea6849e7d63387d894ffe8c881cd0edaeb6bca2db7476767014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5bb6206b44dbb0a762caab0ddddf0c6a7d2ec3a4eaaebfc1ce8611cc0438a626000000008b483045022100a43ce3cd6788b2ec10617d4540959da885d62fe90875c2c6dc6627a5d156d5f80220789fd46d7324dfd50e346f3a9568c36f05bfbd2c793ce19cff31c71dd9b0354f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff410a2272cbbdf4d1c3d85e487932959c1c66fa09467fbc32bd6bd478182c1698000000008b483045022100d02ea2ca50f8f4ad625f7f738e487fb523c75d104b06b9704870ebe4f457375702203eee932f0fc09aa5c19b54b5b51ba030b32e677c212438b36207560f340b912d014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff90f0ebc055fdabc61ec6fa5c2e1fabe664b66c8e95dd25abffa7116baf9eb787000000008b483045022100fdcc51cc1e937b35463fee6f1a49874980bbb8f5143ee587adda7a1c35ee8fbf0220762707a80fcc93e94c55fdf2b7d4daf640691810405f7b64bc6e353dac8471ac014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8242d17e7b3e7a61334eadc44357d499a397b9453570831735753b50768d3f69000000008a47304402206d684282153be872c4e11772cf9d915407a09f2ad49ad8b2ca76a44c79c9aa0202206f035aef0350317f6644280981d43975607ef5b157d74d73bff94b4216807662014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6e9d70f0655a4b92a677f7646b820b349cbb227aeb6f9d6cf0d1f72bbe891e25000000008b483045022100801dca6e34108199bb96d955eb37556ad3e8751b649e9991a082feda63cf756d02207aad67f56de4ae23028fc0eff5a905a26e5455cbbd45a6ac96c4ef356626e323014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7b470a939f1dafbef8d3dfb097800a0a678ce4c76ac700923849b1fb4afb7216000000008a47304402202758edc5a3f8b1e3433b8f094d8deafb6cea8b4ad77fc9548c67a54298b2846402204f1fc190cb5b4388f1f500640a99752e2cf481a07f67bfed4ea8ec56565455ec014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3fc6443e9c98af6c888f420a7b130d93fc5bb43f6d0dbe4cec07390ee72813aa000000008b48304502210087a84272b59b56835ac01806589a9a2b902327edb4f9449c710a0e09e0c2518b022062a1114886705a19d448d7e22c2bee2c13f64860eeb4ef2879d60b0226661e08014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff04d0bcba3b007db4a9c06564d40afbff8183f9ff23bbbdebf7ff995051d2fc94000000008a47304402203b031f0b0b884383d498e78a937854ca1d0316d4d17e4fc2d5c047ee7b98db2602206789a7890ef8a41f9877e6885337bdfe6b564d1b9f7f29ebe19e5cbf330e3f87014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff77e7c34ae68833d9dc46c3c81dceaf4bbafcb64546b021557dd5949d2918f60f000000008a47304402204fb919701f43f138d2be8cc68dbc8dda72e6e76c47e472e89589f8fe67ae211702202cc2b296ae6052d22da1e16abf57588579c89e41e60c16f8423fa675e4337076014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb9b5dfb3aad4209ebf9800b7cd1682b7c230aec93ad443385873bdcd22fd0df0010000008b483045022100e5a755a5d58cbcc719d782f0f26efc0cfea38a8eab375bf3267cc4327dc67d090220262a6641c87c0a5c465faadc8b9bc4558975b990633d8c7ceff85e4eed7e4813014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff97bc3f5ba4abc5b8868d26262a126dca3703b1ec087530408cf11356e89b03db000000008b483045022100d9e3088b40a6179018b0778f8dbdf2f4475c7e3c10d3dcda1334812333a47ff202207ec5631f210a76fc5c440c2d21bc05d5b9fe8f8b0ec84b0c3da0b93e509b5a5a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff504ffaba0bb537c161043856362ef433ad59008a179c5fd160b2b2752ebb3681000000008b483045022100a9549a4a6ad21118c583e75999aecee0c5150361e8ed244f08e3808b997ad7ed02201827c923c7c6001aa4b9fbb5ea514dffc5b5047393273df76ab9ec9a8a8b5895014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5822c751db3aec1f9c186ad04c647833fb306d65971aac91b93d28c9212c35f4000000008a4730440220707b3659923b8dfd76c7d903dbfbe0aadea217e6a275cd427d160149bf24a30102203f3cad64eb867d1e81f3eb5025bdeb94ec15df254367a6da85decb7f923cc6c5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7c8176d62010dceefdcaaf2041c93751f4921bcc66e11af6bd7407cd023b1c31010000008a47304402207500f7ae56f554fa5da181796d8a2c3789ef83a0c19a3195e512261669a52aca022004cf4984ac55396daacb6f0fdc158dafcf879916feec9b5293bfa295d7da6919014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffca192f3548af8c5e4527acb43698086b7d8554a6186f45d0f0677d4341497058000000008b483045022100d17b1db7013bea0ffc9682ae183367030034ab17951636bcf18196e818d4f96202207d284c19394d64d0db8485ff68086e140cd9c0c4750fdf23f98478fcbce2c945014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff302d83d4861b1805001d50261f5a57c16accfe008c71c7c2b3bc315a045650c0000000008b483045022100be2858873d48f5509da2f0d24f4c2e0ffa170242021e30cad8519884474cb13302206680758cb2cc534b2ba1d5a76cc50e25438ced3741410d0249dfae6c96b1b3e5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3a55da4edf4d70fa0365e33978ccb01e4cec1580f88151bd4afe464f13bb0bab000000008b483045022100867bc26135f26fc394d4fbb7543769cab8d396b441e8663fc98d90130469a7c50220048fb394a87e67e4aee54374a6838d96a04305c315a07f428b2a59acef6fdd38014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffca848424a7316a36a62d61706881a46ccdf9b674233ab36c9df770faea8027d5000000008b4830450221008b379fc7c944ae0c5aea0d999bfe255a4b246a83b7672010f95bbbefe19c92cc0220662010cc05e771ea21032c6f4322f9c519a51945eeeca629f5d2c2f3dc56a76d014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffab95bd888d54daaf79c9ffa61919094a7984e018ff7e96677c551672ac197120000000008b483045022100ed4e1245c7335d86da3d1344ab431a217added435df3f9e29b5f75951383381302200905a3663b79abde7b1908403a120baf9a86fc58f88858aa2b09f0c0aa4c929b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff005d5bf27713fcfbe9eb5241413b4b878d9ced694085b87b0c6b78862ed58133000000008a473044022040ef397be77a634b06a169811c7683c1d057c8e382b2e2a70818370acee89e0b022036d4d6132f815e5fb459c92b720f5af12b5ad492731d7dbc09c761693b4ea17e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff320d3d03fd2dc18439b9548d7a087b8e1e050e33903cd2fab7277ed219d605d8000000008b483045022100bdf2df098ed75d0a9a703cfd452a74ff2a11bc5e302086fa97e36866dd091184022033cbe0d4cecc337274d5b2995d403d4117180c41e68c7c1142800ef853f15773014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff24ec65c908b33ed3bfc086cf10e85df742308afbad37cd5af41c07ff85a2cf95010000008a4730440220650a1491229ba89784106d55904d0e19df732e583c0ee6324456bbf9186ffc120220331de16013fce3d496057903a7f68a53a1ff29e733523711c5afefbb64627a5a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff42a2a3b811d8fb56b7a4223ff019967eb5041ac5bf659adc358ba067ca0259bb010000008b483045022100e1909855740e31c8405cd39ca6777ed2e2d0b0416d3488d3ddd0463164724e5f0220623010050534f4f6c26d51cdc421b27fc657048380c1241d5e756ab11e121d04014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa1034a6a2d9d4c65ea7648a31226024d39153076ba09b9d45b393725915cfb30000000008b483045022100806de8e5fadd6eb2c5ecb78af6ea63382ca80e03984edcb888ccf894d912676c0220526be08d98dce7b22a87cf32c09d9f0f12502d29a03e0604330e0c8a87346e3a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff0698cb56a5908c6192e0c8e6d041af203127f9354211806fa07465725cafbfb7000000008b483045022100d376b3a52f06dd22289bdd9b40840a16bb3feeea3fa5af0ef0e327cd59bb51a102201c475286124ad3b3d21fc7ce1fae1a4682f5a3bdae3ca108f84aa71e4a5faff9014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd2810d3708794a0ca2f443aa48fbe57059c8522aae88d7626aa003fca715027b000000008a47304402206ce297a3fff1f387e8b51e2ee0a3989188a6704d2c8aaecd6456c5149420486f022052905a95e2df32b446c965c28090ed6f6905fdd8b37576cf81894999a4836b18014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff07a5c3cde1aee46dd25ffeb5d2a38c389c0935e104dfe5fe80358da0c9ff1fad000000008a47304402205d25eacc41ac1542219bf37e4987cb43320e2bf9ed728f2bda380a687e64969b02203aaccc2840818b2e0b071eea44d4839d77f02ddbbd1e3d723dcde4a449a69e69014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd328309a12f9a353b568c8942f646f4d4872556b244975ee2c4f32b58d8532e1010000008a4730440220691de8e44b34e8f8d2258d5615367ad8411598cf558dd39d7e3a3263fc214cee0220375a35915efc51ac011244e40eccc9c9287767601a5c130e64944a8c6182ebc2014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffdf261cdd4022f6a492796611e95e22f39361baf7fffd3c2f869836b191326aa6010000008b483045022100c755e0ebaeec6c5876d9bae03b7c371c23cc88b742754a3566f034bb3382941302200a159f45ece620a9c7264483c5a35dda1c52f98d1e7c1664d0051ae265655cb5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31fffffffff1cddd934535d9494cd76b4fd950cc1f18a9bb4cd4f5bc8053d7f6595cb9a277010000008a473044022008d270eed1bf8eda19798a8587eed7dacc943b5ccdef759756861bd86d6979e80220123c49dca5b8c9f46e37e727b55fb6400a72d37bf0b869f98ca51a3068d9e24a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31fffffffff2121cbafc846910733618448595e5227285a4bbbb222ef751e79c276b8a5a5b010000008b483045022100ee978bb7a709e99b3de5bf0f4d213df1fff26145a9ba8b7eb1be7f4c62810b5402200f26d59fcc72489834d6b77659e065ba324c83b323350274d41628324f98e99e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd588a900826ff889224a12bc60ec4ddb1aedafe345c4dcef01b8f8ff53952c8c010000008b4830450221009bd2b206b18db4f2a79dc0468c778b5434cf032328a7388f5ce6ac1e1d930f46022049de0061a046f8c6a372f75f1f1ae33baa998085c5a67e93cc73bc8381cb5850014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff63c1431b6515b603e3ecee029845246a4cc30aa445fb16a654c7f3aaed307c8d010000008a47304402205fe9e3253c5b7062344b9446b6c110ff30979f120623839377800120229ff2a202204b3f996326348c13804c01e061de002e6a9f0eabff0122ea786f167ef9937906014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff39c83f0172a417fe3afa61601d11cc64db00491d0ea5f409c50782b7f185ef33010000008b483045022100dbf8faf92cb26d2cb7e849fd6779bd471cde07dd5e3af43fc5f91e16b9a58abc0220246d519d7f42eb64a5c36964863289dbad4a2a24597d48ae6215cc75c1bdb1b5014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffb38a77cc124413448d78400e54534142da5374de08023f1326915822b441f1f4010000008a47304402206c6acfb1a35cd54e5d6a37da42d382db6b2ca45b5e398b1f3af05905ebd1e1b1022001cf35c338d098a8a59735f504f5c79d4a02e3a929ab0d5e7c1aaec1b2c8a8bf014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff1d32ac194c07011c38e81f7ea7dfddbfb63e947e47ebddf7d2f918de49d261f0000000008b48304502210099d9a8cd8d28b4b604fb600882695d6a134468dfaa32b560ff7b1199cd54850d02204e69288a83597f174823bb61228390061942013141194d70a828137036c329da014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6e6a9f6d2fc82e551a32366407056e8c3cbd83154553b1b03152df76ea7aff83000000008b483045022100e89ce7cbb9f6971f5de1445df82ce70763623f797b2466c2ff72759ff05d4b9d022028ed2d146dc025d6df3276baaa5ac4d7d58f44a61c58f05b755aa29de943c18d014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff132aad09768c7203015b216bccb0cb0ef8ad2f1a88c852b38ed2b47e54d84852000000008b483045022100fe99f91e45dc47fd23397588edbd85644daed0af86b8df537ba3e40ae8661c510220658080555caa11751066ad65a13227ec08dd22a090470f55cb8eee8d5c9d4aa3014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff74699364152cf9503099025f2633e64040215009f88c48f5a53a1846c76774d2000000008b483045022100bf3582ea3e3abd9e2e85e3f3d2c113b9d9744583b5a775260e5473932366a8c502207f3d6395d48bc3a2a9550ec8ba04988f12a846174f668a43bd7999d4cc289931014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffd3d918664de66eb38492b1a560dbabfd3aad8bc417230302c85de69084c5eb6c000000008a47304402204af19318445c1bac157f30c18f83cab8ab01a60aed6fe3dbea3c4262ee1e047a022079b0aee834f9c150ee80c227a08d04c1459be273e05b7a956bf0daf76c9faaa9014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff8a78c1c76af02f23da8fa9972a64c4a2ea937fb9e74ded960ff6d9865c290361000000008a47304402201f1ff75678b2cde661d9924508f05680c655d0295254555ec1f0e0434523ecbe0220700157e0f1f855adf5896d1e859d1c528f519f583bbe9198b517b01962ace788014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7259a0d989c12b84cb6c8287ea3a14d991cb43eb82c9414561e11e433693e789000000008b483045022100c1723a623ac964b47f9eda1fa0d677b654509f2aafdf31a9ccec9b780322594e0220451a0afdde1853efdf6fa04255aa9145b2f32cec01dd3cf8eea533b553c6e9bd014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff1a670f8e3a391c3c1825b5e240b4386d07e06c85999037e73350c2d8faf7fba5000000008a47304402202c038661489357f534f70cd4bc62f2de54cfc17ce3bdaf906f2597e024ddb70202203b4f23660e011052a1b6455f4e3a8475ccdf9aec711451fd36050e9e4ace6ecd014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7ef67493e1ca6e65e4689c761fa9ad0ea4db3a8c466754cc0e5274a87c88ba3c000000008a47304402204452da0cddc8ce6e0028d01784d158cbe16e53bb4d6b9bb47498885ceaa18c3b02206aafa51747d4df8aaab35ab3200446734e496cbb1a602434c4b64154bf4febeb014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff483c8cc18b5b1436540955c219dad2f7462def2c4f4b516dde21db381595ab64000000008a47304402204febc808cf2533b62b3fd11f7031bc63494b54bb5bb24b6ce9df1991d8361562022023d3a81bc83a769cf9177d38b728998dfff09983b0b91246f70f8b6d201d3be3014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff215bdac20fe63e8335f9ea0c43f0d8a25d33a98aaac3d9cce2f582e9963f1b60000000008a473044022073294aa66121a59af5a437731c9e5cc43551f4881c1b204f0eebd2ced278df4a02206006c675103253b36c272c2656522c816b0bd1507001d578d9141762cf8669c7014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa91d00e346908b7dbfb1b99d50cf97174326c96baf2c80f46b1fc2a3c59f21a3000000008a47304402200d4f7c879f014360685964a6bdd2c893166399ce0b58cf2dc4b0d41711e769b302204af0b15fcb364f1244e94d282d34de8d4e01cae46ea48122649c3a8344fc237e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff1ac78c4e3f938507b6221ab9c9f3a626f75401d0cc9cd52610f81f442c26d295000000008b483045022100d19a1aba79b29b94dd3e3cb9eea7e6fed13af4a92f12321e2a062fd6f7b7fc1f0220360a0bc78872046f29dd7cb5bc038f0150c9ea255e2e0f6c774c6c36c994221a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff2d91dce60581601295b0f7ff77b30b40fe9f78dcf2fad0fa9ba6fe314dda731c010000008a47304402204b331c66e6c6c57f1a62727e3b826a9a41a44d76d28e971e3b6840e12907bd8e02202cc7007afd33b189cd9bd8a942b39888e32d4add4d7986398d2b4332626b3517014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff935aaeb916d3407de9642165789893f1c9e7fd9efe32c9bc28d7aa47a3bc074c010000008b483045022100c0337f80e2292fde2a35c355caa3db54d007b37ca154ffcc1f6133beba00664e02205ec8fae0b65b7aeb3e22adfe233d9829b7c773c00a695b5b90bfb948f38e931f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6a25951027174bf71897b0053f6b7802c806aab3365985bda5f6bdb0d5471023010000008b483045022100cd020ee32cfc152bfb7bd9c1e6ca0b7338a7f06fe896d5eb98581147c8dd9c1f022034e74292c5371c6639d6feb59050fd30e6c520f7b68c44c2908e05643fb8b040014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff57ad14afc7991423c5334bcd87d1a13d16c0c8cd1be9c64b6353b0b35f902d3b000000008b483045022100b0b8801dd2230d1f0c6e4c077ae47917900902ff446472f257ff61c95eaf61a402207398f2dc2a16042acfeffa0196761f96c451b0a06db971f9180e17165438fed9014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa4235ea316fd8e8acb55c1c21f1bd3301f60bb1abf38ccb8888e9c7abd0d8c55000000008a4730440220698bf4e31c91ae559f3f754c06740c98b74accaca0d2ff5d6e1c7536c44f169a02205e4dc61282e66f9e53bbb63e87c75d98d954478e1545beca45f498b12babf840014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff5e92da56e2fabe175184be5c050b88d35d5b8333642ddabb2e13738e856ca200000000008b483045022100c9345da7f30cc6828487a8283e1c64209ef0e29761c83297e61428224dddbde4022042085694970b494cec4a19a624ca03870ce6eeb57acda5aa8e71685dd20e6f9a014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff89b0db9276f277e311df97deee08b19339236b25ee841d663b1957ad953d1e0e000000008b483045022100ec0ea2ed79bf747637c932c567e958eef7efa699104e950fc358a5ca8f9d7b52022038e78b215d0e1decf4ca0ec3183548bc58806aabdb0ea6bf13c2f6762bc2e8a8014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff092fa51d98dd7c8aaaa8b00a4887d80d4f74047e678a61ec5e5c73e32d61ffbe000000008b483045022100d3da2824110c0c6b7afea911a6abc92f600dcf8a011cc1c535ec00c520cd8a6b0220320c14ce6d4b7d3e4afe1ce756d9b53d8276c053856a5db720ed299ef2f2a83e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6af4728adb84d71999f175f0857930699508950727fbf3e99d44d8faa11391b0010000008a47304402203be009029197b002a5299979235fc2e87c014fd1cd05ee8437f5e07f1d959ce40220516915baa772c83c1db33dad66071223f90346ad4a80946cb3fec9de28ec180e014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff025d770801f54a073e14f1577ab3e392ce4cc606fed40dd10ce502ef2fd6319a000000008b483045022100e40f3c18270265710d1c13eff2973504e6e5495c6669d5be8e76ef37d467624802207cbc8d70d8d67d883865b5d830e88663230b501a71682bc24a85eeb4125bff49014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff6aaab7a7deeb45df42475cbb94dfe7ebfeb933a0701007d3598e570d52057eee000000008a473044022062eb92b45fde372be23a4303d6db8f18fcd5df0ebec8c4ac09e92671bc5c8ddc02205d619dda7697f12d0919c5e279fda221a7cdb34fc803c68397f7ad1a9113ebb8014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3f3f10bca4e619d545eec4c8de8d39f2f00d2e11496de84592bf0d359c882072000000008b4830450221008cfad63762e582869626df188e02d1c0ba60d007a8db4187fc24871712fa26b502200b4a6f3ddd6a111e50c677e26add7a86c3b7e3c6d4d0f1f323f12e5d74ce31e4014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffa331749f551ee590a5f2eb0908ddcf1bc11510ade17341b499718e1721c0c62b010000008a47304402207e8d20740a72b1c0f408a245a3205c56eaa719c7e8e582877103bdf29e123d5c0220503be1571dca8c2e9e7a33b886efe8950a2630f10e3346a84cacc5fa2228e3bf014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffbccbc5790606effb348cf836286c780c6924a187fa2a5e7d8b6a1e09d8a1bee0010000008b4830450221008b26d9f2a9c8fb48e4bb58936bffdf827e01021630dbb046bcbffe32b2a25e3d02207e9a0f8d87e894d79d26e7b1ae7c31fff681cf8f750a4cc53908323abaa6607c014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff091205b3a39937f559baa29509fd05f5a4ee8c99bcb2ea9dae01a711b09d5eea000000008a47304402200e5e51efcb65fe808bbd651899bd0066676423dfac8632741fdabdd6f871ad3c0220067c775af3a930d87517d9d47f5270ee842151c5f7b386a69813d34df6f56b94014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff3bd2e5f5963812c511990473f571df69b7c771ff39837f5cf78763f2d0ae720b010000008a47304402205c2112bc85801508d99068b15be0eb7e6659294b9d2fa5178590c213d220cd8c02207f5eca0f05a6e222a162fe315e37635ad0cb5c9eac15db1b4f034a43908e8bd6014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff2640720e73ca59450543e5d7e31df9d7627b3b813f39a4f9f1c5c0aa33eab6f1000000008a47304402204ecda19976af6e6ab59dbb8c2fd96d5f8b69cad6605517c2c0d5d83427b230a202202e575fa7b7702fc9600ed471c794903ea2b6654624e711b4e98fb9d68dee6ce9014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffc781bf6d0c5a01c9a664a9ecdbc430244a9959f1a1e6f411fcfef32a0effa4bf000000008a47304402206dbc53812699cdd117d98a2f40fecb45eef0a3cdb3421e1835f279bf71a8250e02205c7c5014c0274a4bf2354a69db5e1fb0619114e484fd7697218cbb1a4f1bc01b014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff73a878aa68bf12ed0f027367f0ca1b75ef3c685f93019f9a0fa2369428e99f84000000008a47304402201d9f838135c01a453e2f57b5e20b896510c4c6b3ff9c682fc52bf94a1bc726dd02201975732143c12b706a0389a002dd8eb8cf02cc35fed12eb4cb169b1c4ead5b80014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffc6c0b577374e63c8be2f3673ee6877a15cb1957c2459d668e8c16791c18fd385010000008a47304402207a921c13c5b80154379a7e530d557e3f8f36438f87f9083638912e201f95a3d4022056a253d5f2fa5be5573fdb0e63762b44f34c2ca2837c506845ed1ff084f4de9f014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31fffffffff7178c2ad8a788cd9b8414c316a90e7a2b9aa4d0e3500a078bb78f78adaf2f27010000008b4830450221009d5983a820386a665e3abe92949aaba92ee9efd4dfce0f6cdc64ba1d5fa6952c0220564297e5930c4895c0c244be47377e1be4f207f96aa111219b1fa1e8200506c0014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff7e9eb93b7347214c7a4fe15bcbb753124a84ebd259013a148dd90cfe83f12a62000000008a47304402201178601ace2551471f7da7fb398c1f9e2d2f789e5d8a662fc32b73a983c7f36c022074affc15eeb6c499dc98bd7bf1de94f1bb60af71b6c0e2ac6b67f7e63623eec6014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff41c542485a6dd3e2acd62f57c34a6ff33dd73d875991c39b69f0a47cafae4c98000000008b483045022100fb311ce78f3bdadd9c80effea6446257f95429963414ce669ad9b50b1a59588d02201f39e30778ce8d91aa8732db5901cb9e4052d0551ec178853e736b1baab7d4b0014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffffc791001af9897690ee3b3aab38893b9c04295a2ea6caf83017dcdddf190b7c20010000008b483045022100d2ccbeff28c4019ccbeb67cbd0d669af90ec2bdd4d2301fd93ea0db8f3db9a220220116e9cd2ed250cf417d0f45a6361a47bd1f26d92a49a933a8042490627b68fb9014104a5ed97469860bbe8f05b9964dbc83bb17e5d14383a54fc4395e1e698d01011f6827632c50871df697d46faab766a267cd3b12a17244db5af311133953b440e31ffffffff0261236e23010000001976a914510e4273e56cb363926a149dd7b86e8838e98f9f88acdbed4901000000001976a914b526df90f2bb0c5830b469b8b8f96d25e127de5d88ac000000000100000001d27b447bd3730b2c58e05dbd5a6aec7473150f8f7e69482cd7e6eb3ab26d9f7001000000da00483045022100a698a2d989bd249ba70571230b354b8e54845663ff7d32afac2b3591154061e7022061d18cc45f7e6080799c2d18aa10d4e7b55f5b50fa3db99babd19c460c34c5f301473044022065da4ed1421c0d0c3e157c2cd736e4c22d6af912a84cf1fc0e6f418e51a7bf7402207bcd88362d13127897881bc9ed3120f114b6a5a027b6f2979e65810c1676882f0147522103eac01e7ba42cfdd382d140754497ca33bc561750077e8adf73f963e288df6ba0210396945cc1bba0e1920753033878225a9db6773e25ee54b34b9998da8d7264e73152aeffffffff0288130000000000001976a914ba5dbe9f26ce3e4019bedcc8d820f50cfe7f482088ac802429000000000017a914d9ac0ca54a0c406d20b84fdf9b3cda1809521c4b87000000000100000002ba215a16780773a6492d9a9faa379e245852ce64b772e9554437895f14686f91000000006b4830450221009ad06b19d68f485d5616de7d64a373cd959d4fcb8b263d78e77194a780fe40030220659a86324793846cd91dab815fe86f5965c574711f08b0e8bec67ca60f3efb1801210282d8a0845f70288da1c9733a34ac3d53f8af2d3af472f39b66a3c7d9a4d9f8fbffffffff4617c6d64467436a2ae1299d5ced9b686be607f0bd5614a717c81c718d362b79010000006b483045022100d34ddc1164b0a11ce669c9a46b6d1fd0c1cd7d1680d5e724670718f7ab529fad0220204f57df044d968962c62c8ab7f6b9df4a86c40d5b5d2ffb384dfcc6723e32ab012103093e395799cf1d2047d2bb108b849754bc5f9f8fe3072f40e72e56ed049512b7ffffffff02dc0a1400000000001976a914f44903978916e08286ca171309579ed21639218a88ac1c300000000000001976a914b803863ac070da84ae68b20626c5d6f47542495588ac000000000100000002b9d39f88260df204f6a0bf620b4fde95003d095cd6422a01946dc939ea8ee30801000000da0047304402203edfcd14022dc4624ef6197cd8549512273e5a38519a922b1584e07fe98aa45e022044745d2ca6eb1f2ddcc6d954029a0a5ebd263cc97a5f0c7d65af2610b798bc6701483045022100886f7f4c740f7fae0e76d9dd2be028c86c01950b930b7eb7a9057f612092e0ed02203134d8d0f080e4dd6dc85b60c51c03beef2e12138404aaaa53be0ace160c20110147522103cb5e916302a280d56688daf22122e67665cd9208ff4273dd2fa1fa39625950f3210369552a76669aed6e02979aa08d743409f55f3a668db8aa4aa50735a3cc231ac452aeffffffff2a4bf2c8f4ce17ef610b9c9afdd1dff65752d7b1ca0963b0ad5141350b5cefca01000000da00473044022002427e1469cbe60062b157454f42eb90780f2a86c78cbaff072b7908240604f3022042a6abd842e2e3d7921fe186f5c0089f22a0f5bd688d182f45bab62c6772f00401483045022100ad9be23e59184041b3cd082611ac83be295f7dcb5d23cab7bba38a2ddaa231e402202d47f2853f772f90baab685ec38f1121dde0279cca4c0e0b6de69ecb4ec1eaec0147522103cb5e916302a280d56688daf22122e67665cd9208ff4273dd2fa1fa39625950f3210369552a76669aed6e02979aa08d743409f55f3a668db8aa4aa50735a3cc231ac452aeffffffff02da534800000000001976a9145232cc109276d3307a91a54ce6f2c23c050082e588ac0806e62a0000000017a914df7131367555744a89e69ba16b645862dd753b8987000000000100000002a46329f00f5ce42835c20480cb8b7e9a5694a21653e194b7f1aa2bd79c98ed0700000000da00483045022100b1bd78e127df911775ce386e6004c556a31517a8c05bb03fb994b0551e4c728f022050e995dc70d5d933c6ca0baf8932235aeb8086fb45b6b2ef0ad55f26632c2bb301473044022071a0801adb35bf1ff897d6fed026f565508bdd8a7e675594523292fb66159808022004f5e611bd2a21307ae5f524b622d01162efd6fe5ca0f1a0b4e3a90525481ac00147522103729b6873394c29d1153f3ca9f4aafc84d825d6a68d793d373ce3cfb9cfbae53d21035734ae241e88a345de09a9b6810951e41781f610d2c8716aa25d634bd0c5401552aeffffffff320d8349e448c80a3638544e6a2b38730571812fe9ba0bfaf73898c9f08e1dce00000000da004830450221008c2de186e21b9cdf6a1c20fd3b29b79f12da360bcdca773beff8d030a870206602202ca28215f1f2c17c5c2b560af7f31fc84fefd61055edef25e07f4f911edbeb7801473044022043877b82b7fefc3b6f839eec53f056403a7923b1f61fc3bc02ad9ed6c44730430220640566554e16cc457bbf5317b2d83db8129d941328b022c89c1abe06dd3227330147522103729b6873394c29d1153f3ca9f4aafc84d825d6a68d793d373ce3cfb9cfbae53d21035734ae241e88a345de09a9b6810951e41781f610d2c8716aa25d634bd0c5401552aeffffffff02b0360000000000001976a9141d9357551b00179418f6a1c9fcd16938ca7a1bc388ac586209000000000017a914d16a297f5eb2d9a3f149d1e76885c07e55b331158700000000010000000490e92033022183502fc32e5a9920eb38944c0c5a7c3028d08683b14e369aebdb000000006a473044022076e178d40c102a5724dfe890d7a2d8870a31f6b20f42114637ffe922006ef62f022036e69d20e6a0e564b36495623f50c9fd5500cb5ad57563a6e98b6a04019d7b23012103569ac034acb343be34cce17996e90e5367227b473cefc946f6bfa19da60dec40ffffffff7620fbecf73fc14ddfe74e266f8e884cc645e38e99f64f2bcc5e8fb7c0c369d2000000006a473044022057c8251a4a12262eb30d92cd79ed091476f8d1c278274cb9a9c933eb615f748b0220610d008d558389cd737cf87cbbb4525ef602e2b9b4ab155da4af1b41d545abf001210310f74ae1830d58ec6a42284826c030475e3b8c58bcfe32ac3a9ed9f72600b413ffffffffc08e3516a48c9754d4ffde13d725a900943555c0ffbd91b745c198487201e505000000006a47304402202b4c1b05e480ef74cd8ddc9c72419212238a27b462c1c64c63d15739af0e7cef02200ffa0373a964f8b02bc7759ec411b65d20319af7babaf3dd6041d50f2b13f546012103057f484429b599b0b6b6fb6f2c6f2dc1892ca320b57d2f7e2d191c2a0eeff31dffffffff0eb66cecbd0c506f31bd65a96ec0933780e7b0d15f2fa9dfbcd962d444d0a628000000006b483045022100d39695bd98dc06360284a8f5e40094dda9be0901f86c3d01021630953693e10502200751956dc08e823737ff191d834b752e23e23db83a53b14abe99c9b23cf038c9012102a5f0e7ec7005fd18303f813fec8ba1846d6f8e401ce4356f27a644bb0c06618dffffffff029ffa0100000000001976a9147d690a03eb998edeacd67c2714a486087e1b698c88ac394c0f00000000001976a9147d6cd03388492a093456cf21149fc1962a17ebb688ac0000000001000000099f455fc2ab8ccddf2b1ee25c9bbbd118606364aec7f237ac75e8c8406d91bcbe1c0000006a47304402200a53dcca5564c250ba89c67a9b5daeb82a8a79cfeb08481cda4d98822c53e66c02206d953ecf27189cfd84b74f00e455734cd841e038372cdf91f12edd3a40286df8012103ebdcdeffc072cfa522ba305fe1fe0c6431be0abefef55f826ecd49807a53fcf8ffffffffbd7dd753cbf7d1edb51a170d82d2be5b29d4dc4d6944958eed2d485772d015c4140000006a47304402204a0c05c663005e865a6aadf41d9b2d7228aea34725eb8919a2d76a746e964b71022012c54eca0abdb155f588c79da79c794807fee244163fb049a31cf9ae78708758012103ebdcdeffc072cfa522ba305fe1fe0c6431be0abefef55f826ecd49807a53fcf8ffffffffbd7dd753cbf7d1edb51a170d82d2be5b29d4dc4d6944958eed2d485772d015c4d90000006a47304402201337ac7f3aa09842185a561c6bad4f5fbeb1a200071ab6ffb25495e4a9de3dd802201db68a253107f61ae76acff775609d899ae1ff52cbfa5b044bdfbbb778da416801210249abf28e6f462d56a0078ba3a45eb467a47701310838a2b515ea4f3f469ab0d8ffffffff894083ac923a4260dbb13f1bd3993ca10d3152fe2973297a94cde3de721db134010000008b483045022100e4f50cc4ff4b39106ab3183a3220a90ee5175ad9b933f28cccff4d060cae2e6602207cc1b9c082d786aeba7f89a92605a75e2096f74964b7961dfb1851d9b7fa64da0141047336b05430fee858729a60f791cbbe2e88d8aa90256ccc20558d80d7d3e3047b557ed522450279514207a5fa2af76c6d8df9e4c7b0fe04190631cb9f57358e4effffffffea113aa0c02d7b5515a60ff173cef170c13442e2163ec4ebb5427834cd056cd1000000008b483045022100d4b5f97c9b86b6dfd8f1bfbcb5ed2eac556fa254a93134087f476c155fb638d50220126dd77c277a80b858732ee366f4675d84840d5380867f8787ecacaf98455ffa014104192b7f06039a557345ae4b50b1290dc2af54e935387c6867c76ed4f67d7ab1192fc501dc94452fd3aebe9da5919d640ab3326dc9bcc04e12abae5298b01c24c5ffffffff0835921a048823a94d7600cb1a362578b4a0427d695fdacd4a4326dfd4a93e73020000006b48304502210099717705c7b33be308251f2de07895f5fa85e4680460ec8998a9e2d51405057a02203b84ce6e3461dea109f12258639c127858fd5a14e4bda13b26a24e4493be79fa012102b3613ca1742d38bf89511aa98217a11b7fe2f6c829b30b02f07744aa2acdd9edffffffff0835921a048823a94d7600cb1a362578b4a0427d695fdacd4a4326dfd4a93e73030000006b483045022100fac990201a2fd67e0d77f0495cb927641db216ce5b59be2a57eaa8ac25bed280022034c75345243656403945acd14317aafa805faff6b07f3ef2807401cb33012c40012103f4c2744ee15671eae703c6a5d74818e3dad735c043b8628851656a1c85d8cd3affffffff5159105b6d33699103a6e712b196b9cff22375e462ed13b2d491982efec2112e010000006a47304402201b8bee4547adcebdc29e2f9ed76e735df2449b79a4f4000418d48ef10ef2507b02201e97a396c2c5c926f8db831a4218d3c8fc70dfc6446f8da6e428a60c437009ef012103d8b4b62ba86bb31fad7d6297bab00f05b4a4346b119415b7922001a230c5f731ffffffff3e476b1db06c88385084ca98fa3b5a23e46b0fe4a2c0e4e5e6b0961d5c3decf8000000006a47304402205ccee8ae656ae9a79f215ac37f0266661eb42673ed134f3d2330ef767cbfdddf022024508069bd9bf158f79a8906fdfddbcc32f036f7bb09aa0029190c4aa76411f8012103d9289fc2e8662c1e7d79f3c140f069d7f5d12d83b260d764564e2ce9db068d0fffffffff0280f0fa02000000001976a914e221989cfd4b54c17999b9cc1de35904aeb2bbcf88ac5f490f00000000001976a9148584f2972d7d4fb42cbb978e35f4ada50e9e369a88ac00000000010000000416acccf6c13002c544c5d315f7a2af99ff4409c4be0a1c6b42de665b435b970b540000008b483045022100c34e3e676277cd728d4a1ca4cf86f764cb372a92f11fef56f64912de1b350460022050dbe5beb5b2e5b307e23030d1a198bfebea968c5a950efea57b2157c650ad6e014104475a197830331fe7fd1a89d49d119d1743074ca8ab85f5c6cf8127e834f4a0204a6a4a4a941d87f2017c18a0db424c36b0981bb1d974205d5f84afe9ea10d712ffffffff212751f66e30fe4342619c70a803a1e30f3a90ea0783b8ccfeb739294cecde5c0d0000008b483045022100a0b5e2456232c617806eb0f74f3509a7595dca7f281a40073dca1ef870ed782a022003f285302ab824e652d30124207db2bb14778a0ee69c0f6dd457c4c25a08517b014104475a197830331fe7fd1a89d49d119d1743074ca8ab85f5c6cf8127e834f4a0204a6a4a4a941d87f2017c18a0db424c36b0981bb1d974205d5f84afe9ea10d712ffffffff15968d47dbc33da80a24ca16201045c79992e41f36ee787b2b5608f8bd3023efb60000008a4730440220062e634821d2a7612a74b8652e36bc05aa5a9849e4b7a338b0de4d99e85c7fb602200a239bef9fbebbfc0793d5b34cefbf1627ab691ac230adf6c3170fe6224f4e8d014104475a197830331fe7fd1a89d49d119d1743074ca8ab85f5c6cf8127e834f4a0204a6a4a4a941d87f2017c18a0db424c36b0981bb1d974205d5f84afe9ea10d712ffffffffe3bae31e9608ab0b50f3b79db06877add30cd23f6b7c9c1854b7a1a4f54fda52b60000008a473044022054d643139f7d22c29d2e532f10c134ae6ab5380af6490e94ffa93ee70b35ad67022074a78160bd73de58d08721ca8849d943d987c2f683545c35ec905e1408bae7ae014104475a197830331fe7fd1a89d49d119d1743074ca8ab85f5c6cf8127e834f4a0204a6a4a4a941d87f2017c18a0db424c36b0981bb1d974205d5f84afe9ea10d712ffffffff01db8f0200000000001976a914f867fe60e2548a7143c254190a6d254c6dad7c3788ac0000000001000000fda5012a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d8070000006b483045022100c95e641e2007df0eab2ac26a805be3d72808cf84aad375706cab0f93e464b471022078a0db3467bb370304d97fea2a30d23876cfbf365dab4afaa0b12c9b9006c0250121027e52e8b25aa97fed2d2db4616604d7e3f400fbac239eb079790bf6a6b34b2610ffffffff2a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d8210000006a47304402200652f84ebb685da926ca8ff3ff87e2188e8c231d3e98a55d68cc1368c9b7617c02204871ee9906f44e8d91d644c73639acd5dfddcb66400fd77f313d3ca1000ad2ac012102ff192b32ceb6ca7c147da931b3886549e18ec1d47a482ce5375235458d479a5effffffff2a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d8270000006a473044022015108d406303a4e342f712d5548b6644e8d60ef67fc010934c8f254d239a0c4502207f2b24205d52f17d9a05e37ad58e24c494774469c31c8552ac35c7ce503d6621012102a5c4276fb5e2b3218fc67f5c3fd87bfc9fc75f12bc0e8fb6ad1c50a6df0009eaffffffff2a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d8420000006a473044022016d794d41b6dad8b62a6a51ed29153c69a4b97a1d686a804d4953984535af2f10220770f6483e72f3442c309f912fb6df3fae88ffa2679f90c839bccd39989bb32e401210221c7ab81dbf119a938f75adab81d255c60bde3836b7c7707ee9a7bdd301e80b5ffffffff2a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d8430000006a473044022045cbdc549be2e27a5ec8058b57f6dc10df757a16661eae6ce4a934e2facecad502207cd0662a5844a38a614ab8b2d171f80bb403f7ace9f3ee31978847b95b0dfc4601210360e66e446a61398bc9232016e6a2f34e5c26f362479398702acd988ce66807f1ffffffff2a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d85d0000006a47304402200755b40438bd36aad288bb02270dcac3c9ff1a66af1ceaace41f18d53482992b02203e622ba7dd901918b7b60e012c17160b8818769cbea764785e207e07d7fdd5eb0121026c9c8daf61faedc31b1adc045f6db1d90d8a46c7f457017d8f5ea01873d57789ffffffff2a0476d36095a99756f5ebaa9cd184f9ba4d4b52a515aef452cc90b61972d8d85e0000006b483045022100afd20a33bda3e233b956a0487c68dc8b63a8cea6560349527ddcc23628b5c51c0220713c89412c92651b35d50135bab2e5bb36060838105df48fcc9b121ed832cd83012103c798853d7f5fcc815ad4fde1183d3d80a40003b818fa86a21403aabfbd0d9959ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d000000006b483045022100893c5648ab3c75fbbb5d68d439407b7fc4803f1f1415c744f66af0ce8670885c0220735a7ea1f2967fd7aeab6ff2615d25eb3cf16c3dad0ccf5454aa6bb666e5622b01210252e8d828e4939310e60577062aa5414d03bda9248b3b1b284ac0ec0d77dc39ffffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d0d0000006a4730440220025185c440839506e1e56f75c0af7ad44deaa2867204d123c49a93d5a2df286202200dbaea862c2aa32c703fb724b4240b7450dc32c1c2ddd91fa0afd14ad4e18787012102f2b84f3bf02c118d60b1cd602d6126594993c70af1b6895127f3a7333d397011ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d190000006a4730440220229e610175b723981e63727a1140298737e63d79bed5dd1c27e46e40ce86893402200e38354cee3317a502bc7973242e87ff2fd2f5eaab9e331c22091c44544a1426012103d23bc2304b5382f53bc573bb7d3d32ce2fdd81eb1cd1910611c8f54dbb794771ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1b0000006a473044022066b171da2d12b9ec89351042cad56f0cbae009407d41ab80749eb4df35c7d8c1022070b874f9f4536c085c1b0924ffce4a6fc29d51060ecac9ccf88bbada2e6f81db0121022bccd2c3fe9a40ab0c9e6ae7cd4555920281bce457120b58a62f237a770f35a0ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1c0000006b48304502210082a58252112cd43f1d497df929795d5563754c6bca3b16ea4a47df84f927885802207e78f65a172111e10cf2daeb75136eb7c54a45abd55163dee42eba0c44285d47012103cec48e102fe0a049ebc494ddd3d14d3792b6735516ad9b50297c4733a17b90d5ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1f0000006a473044022010a136afcaa7177272947872dc34100aa39377d2e89e5bd9b2339062255a80e2022010a047d4e8921ea6045f14e83c905e2ebb99dd28df7c3c2f230e6cb980db377f0121021461bf989e3d749eef8073ecb337427f17042db80720c0e362f01793d6e42610ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d230000006a4730440220785f635d4fb6faffad8d4afd8a362c1cc1e2309814d20df0bdd30c90a1a3bae502203b0223b27fb4190eae8cf7b08796c4e8d6c66ba07fb97084475e5e89d41621f9012103cc1cb2bfb5a8610d0b253b93f9bd07c2bde18e387b149f2947b753b36566c511ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d460000006b483045022100bbf58acc4085bab384da8fbeef8d4fcc3eb6b4012708cf80e7a8c490ed866f4902203c125c27b5570a281e899029da2d44a4b23d8c6fd2758afe1f174a7a02ea0e210121025ea8074d10f85c04eef3b63930923fcbb122a5c9dfdbf41a56b47e91b3473c62ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d480000006a4730440220486cc50c3a9e70d5e6ac3447c0ad95a7614d14d524315bf21244476d41295a6f0220160a55e0608eea70362729a3b02affe32ce7616f3fa0640d9fd54222901659c3012102e4562907fccfcf4b9a743e4715d5a9cc1ba203054c63a5f4d0ac660870d35ebfffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d4c0000006b483045022100c4f759b47f2ec1d3c71f47d699be64fef5d91a85d2354fe902bba96e88f19e9b02202dc2f1fe29df71904873e3903d55b43f317b734a9d2bbff1f424c502f5d59ce901210201a71c6842cbee9ff2e7c0aecf1042ce5d30103f4f73d8ef35447ba56fa78430ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d530000006b483045022100e03965fd123dd8dd86ff71f4065e4140250bb15024287cf5a3360a5adcb49a1702205f491a0ab1c61ee5ea2081998bbf04cd15b16b6a0bb142f3e55af2b706be13c1012102ed801ac57a9715ea9d33bae10cf77e955e97d3eb8ec3e0610b2e1618aea49743ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d5a0000006a473044022064e7d380461dfd83426363c29426b53ccf537419b84dd67e9e8503e46c7cc32102201ddc0f4f953d82d63cbbf259487108a10100c04954879c502203f4d22b89ecd1012102b944e9570267305e26e166d0e782432bc5145c60d9b399eacff1b1b05497ace5ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d5c0000006a47304402207473f92e3e6a4f10b5a3f4ff1e4840e83b15b8078b2af3c86d71cad85e38a98202207602514d7405e834653e88c1e0daf07fd3c70db66228292296c2359c5c8ac1e30121026c9c8daf61faedc31b1adc045f6db1d90d8a46c7f457017d8f5ea01873d57789ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d5f0000006a47304402202ffb79456780f95c5aca97fec0e5ad0f107241a5dc045aa3a486dfee8739eec5022079fcd30c14439d1dac99b1c9f95bedf7b233a0bb24aad295a9cb0a33343e9ae301210375d0cd09e670b856e4d4d78aecfeae7ab5a7512c545fbeeec5e886eba5058191ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d610000006a47304402201c9fac88dcc73ec3f87ec5b6f155e1e81ccd9cdd7067eff5569ef7a7e6fb7af202201bf4a539f6ba10e224b3e9c21568f251aab2d3ff2756bc0138e4f7b48dd37f08012102d091a45a2368c4fa118ad23fe1759efd5b69aac7748ebdc04a3c7956c772bd42ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d630000006a47304402206b093609e4d69e2b01affac61f690085d61c06491189fa3452aa26a36c517a610220662249f96f5ba0048cbf0efed79318759a8d5bf002b9ce479bed7866d8e4d5410121020476e85e348a8447b7c73a039a774715c51466d82c55a24935264f22de8e5a6cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d640000006b483045022100d2dd95ab01f5896bfc6cb54e7b0b1913df9213a875677e81d69be50b60d3d18402204e8e4fdf7e9c7444223a0d089b00e711a0456a74f18ee292b69c655cc22b9f04012103640004c90bbe3d4afc532736742932f32ac2e2742845ffe1f0e11fde8b0737e5ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d650000006b483045022100b19fcfef7d9cdddae7f99f9d2a11716dd78bd3701d993ff799cf68e157c02479022000f9ed5c27432a938257b8cb23240768f85f7afbba600b88f492d0b8c8ebf77401210287fc31cc44bb9a7bfd7f487f5042c5ef237fdf4586f38696f62f7332aa526872ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d670000006b483045022100f88a016e2968e7b70a0f01ff5a5b121bad8fa6d2da58d4a53626228e5f492c5702201523c08ac69bfbbbc44ae6f287abac7d107df595de5a89c0a5ef1f87a215dfa90121020537f5d907e4ff313a83e488234fbb52aff34028d8d04106861ff4ef71abdb5dffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d680000006b48304502210099577e9abd6e030ec1a30c5424d35a5487ef75aba44b74b176bfc70e02bca30d0220128f31ac116af9e0f58f26b7b2ea8b96ec5c0eb1d2a0108fc9ea8995f8652a42012102ef521a7a55cbf3fe9950765a737d88289aa2bfcc2aa3c9ec8772b1c8d43a3ba6ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d690000006b483045022100d367f14810a9a9ff272a8920126288d185e2eb6419c61a2e9daaed6c057882df02201537548794e192b0e0dc9e0348ee37a2b6f9e96d42cbaea6854ff2ea232f1ef0012102220cbeb0304f1fc487b145533d5a59d270235b550775adbbe064133789d5a374ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6c0000006b483045022100853a1f1bdde73e98671dded1446ca76ed4a3866603729e9b4f22aab56b85178c02203b7d4c7496f70e23a806a8aa6f149fc01d9d0f1ed92e83eb3989fb8d2f388cec012102b1530fe1f946149b84d63d2366668fa931ec5860b8f7f3b0ecad46e0bff32260ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6e0000006b483045022100ec303a6cb61e91dc97cb48105de39620a2e0add2db15020832b7479b134f6152022062c3f8d863db9ec05e8f7f46c8119b66d645df5327a5abe0641fef4ac0ce7b8b012102f51dba1a63b3fcc2d5d57598461b9d8c63a159b6509d3d0b269ddaf3c0ea255cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d810000006a473044022043a339ce4571e5592faf6d59713ed8ec1419f6189750d65662b1650151fe359d02204267412810803c7ed0eceaf83813210df62b708e432f8240680edd99bad18665012102bdca2c5703625f8a3a800d14cabb4b622dfe766e29cbc4e03f3e2faa227e4ceeffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d830000006b483045022100f975b9bc745fef2aa6f0dd7af5f0d9b17b803d9bdaf73422f797996fac3f0fbe0220072095d5085ba7df3fac613addea427f2ce2bb9d1d168a5e0439e4187b9fa9870121024f20cc2f4c33c2d1161a439be2a7695eb3703ef7a203966d3f32b201089af9b7ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d840000006a47304402205275b466e547db4b7780968623b4229feb946b480a8fef793b6983d45a07670202204a9316d7edde843648368aeb70e8c86f8f8539c165962b626fc165edb89eb27a0121033a84598a27229755e6c2ace0c5fa4fffc51fcc46a4357a904409879a1218397bffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d890000006a47304402202c06c9bb2815d4a271f6addfe592dde181d22dc47b3f8c7c8f188d5043305118022070675d3d59076900a0bca00a86886e8d08dccd8641649b1fe0627e29c9ed67b1012102092c130bafd3f042a14faf0791e49dee1c4e4c45fa8151f8c29e28a1eb156065ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d8b0000006b48304502210096ba3427c920a108c973adca05ae1d5d30bb6f232e6493d36ab00ba0b0d7c77f0220164120670bfa1eef85ce6b538afe7b9baa7179f00d03052bf97268c2f34f56c3012102e28092d1ada820e1aca104ffb1c7c48f3a2a5e8c5f90838939235dbf01a144c4ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d920000006a473044022039c06148010d4f7852bf61dbb5838ecc0aa1e2a26cb2b84b9bb9f6cbfc0e39e4022018985f0505f88b5a27ea1ff3a817706e50183dc46c21fe76fc64e71c9d2fd982012102e79e860ef42ad0f30a2f347b4c06dbe0d82a36ce559fa65044a7fc033372105dffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d930000006b48304502210096479f7298a3ecb791a14f2d919aaebc65c84ccb91535ea69272e1e8db30820a02207a99010921e49c95adae92c2f3274a9bce475fa95fc9db839abd352f0c2db82e012103daafedba4fd924b5c08c6c19f407d9a8dd8796c6db74f9a3473827dcb48f40c1ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d980000006b483045022100f716c60b8a68c37d9134092a89da0f534a3949c528e8356f35346cc6d0c3245d022071d89d381f0cfb13a3e6d759380166e6b87035e0613e34ebbed758ac6d057e4901210381f6523b99eda5a898dfb4f47e14d15bb956ed10e759b81f3e102747d2197dcaffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d9c0000006b483045022100a817618f0995dbcb6a3dd14f28f8539c9e8bc0fd34ffdae1aca4ad7601f117ec02202b704b4ac8d9d509442f87c31c2f7f878a3129235f3dc036b68a4bc27ec383340121021813cdd05350838ff535db25d1605c183c7b4141d0ee2ef2bad24671945f35ceffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dab0000006a47304402207c68f2e388bd29780acef2a0d16352609edf43af8b358274d8ebf7fcdc663b98022034b180c7a304fb6433a8aa70816d7f846c41cb35cbe17ddf566b68b3bacf742e012102ab574812cea5df5f4ccb2bc7cb6a2ee3ff9188213cb664db475b749cb0991283ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8db70000006a473044022074e687a2c3b2f62436088a709ab64dcd91b55fb228580ae564d54645ffa82b6602207e1aa74c7c87f7c8bf8e8feff0d9aa6709533697db1a220c701b4bf1a6ab8e47012103d5ef5cb73c67cde8a2ceccf5d41dcb665955ba4d7ae511e049295ac0c796a4aaffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dbb0000006b483045022100cf1b92ed2a335f4146964606de11dc787047444a52030825ec3a6496c37df65502203b72f38996a8cb7d4f40733a66ea0cf3e326b38b555dd47e565eb40f536df14e0121031f6390da5e2c34d9747e450778e62217b57d4bb4dd7b4093a6720675bbfab1aaffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dc90000006b483045022100d7d20e06bb88f79785db6720af4e0dcae92976dabf6dbe407d885df621ba2eb502200c014a36b6ca2916f28ca41bdeb0750bf3b70e73fd364ea4d4a281919b19a6fc012103c0eb8b1c197366c5aca991758cb9ece316d77cbdabc880279b28ef0417fa96d8ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dd00000006a47304402206a52107134e27f4a2b5b50af9ebc41259b7de083e5fbb274074dd444f29ddca402206380a2a499c8d4db5eb956c57dc66a4a55c9075403dce289a199a2f99e476c97012103c017e13a66a2fbb5773eb8c158fd91d87d51398ee06058d52874555e24d90439ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dd10000006b483045022100a0249312c747a7c42fc5dede0624c940e4764256084fa5f4fc29a5bc29654973022068a2c9b827abcb7c9686ccc83231b9b7082449c8bddb0a3c01b7e6e6d28279bf012102c6bac6f6a26107f1b6ac7731d0eb1f68be1a960fcb936138d5ec1003e3009b9fffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dde0000006b483045022100c258e3c1990bdbba3f7d6db50f314ca6f78eb85c95cf99cc102b88b6baa7b3db022008c2f2c2ede6697abc4b42b268c228be25e8937ff904075709a335fb4276eb6f0121030504f2b3f5ef6f01d3300ebfc4d477b76aad88f96b8e17015c032f17ab4b7941ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8de90000006a473044022024787ddca037f88f5b1e264d57c904114bddf0deb99b9530f8f61cf48f21f9d6022030b3773a96d75274ceb3cef1696f92816f32f004b0e7d310c6dfb19a510bf5e7012102085bb3c49dcc6335149e8e7bb4bbe22f815814183ed53b7ee65de391462235dcffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dec0000006b483045022100cd48773c658caa98ab6a0b984b9112eed0f452783de35de5a37a7231b6c8c0d702200e5d8c4a6e625256895cd1bd296f35b50d176f184d4869d76e3626dff7e6bd9501210215fa4ab10ea2dc19364ca008396577725ebca25bdc5108617cc2915c344c575affffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dee0000006b483045022100b06b7a904c7df67eab6a9435bf0a6de07a20d5817fb0a50eb4abdb871765de4e022059ccd1fa0e0c12e37c243189ec2f8c5781a55ba6f0d276f255e91b1e8d7a0cad01210224d78b34605ccebe94d1ccf7428094f852dd5da910125aeba8b87cf1c12d9be7ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8df10000006a47304402207b033df5dce1e78551a20a3fe083096a2eb79f50843e706a80083c09d41ea2c8022075dd7b28eab6cd0434e201922fb634765142e07440a0bb5c6c71b8697d2e5945012103fdd7c5ed26ba61578966971b16eba7a3864044610a345b54bde3987184fb2ca8ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8df90000006b483045022100bfd439a666cb7c28d16b0529150f2f2596d633e80c2fed9638ea0efbdf8ca5000220242a25953596d500eaa364aa5c476b603736b59db0ff4d268dd99d4bf276af2401210253d4804dd1539f083fe2fff11ce66fba62baff916bf0c0272bf22c45a09772ceffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dfb0000006b48304502210088c9e18476c6a5826a80eec2f9b391ddcc5e9d280eb67225c26922b91da6b4040220755b38be69cc7aca30668127eadc1f51fca3b6e61d7dbde34cfc59c5b4ef34ca01210289e2a3024ce7a0451144fbf6017e31fd10998413361057f43e85b6a5d82f19f2ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dfc0000006a47304402200748712d5844e76a3f63870458dfa5eef7f3b04b821ca32d7db98954b6b5a688022039816fcbdca22667ddd285a0f89bd0d7649ed52e24d956fab67566412eec3cac012102838ffc97652219dcb7e571b0a88639c2a6bbc111e0b0c287aed28e49badebbf7ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dfe0000006b4830450221008b66cf0126f57bcabb0868476d8e27bd33bcb54ab0207a5c0e55ba6dde4f0ee902200ba2dde14385b206106744e55452b8451bc5a25feba480aad6c65646b0a07c48012102c47390ada367119450bf53473cb9a1bfcecc563d51ace4d258482fcc86e341dfffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dff0000006a473044022067b1df43975f5848b11db8f4ea0c79338fac49711fd89b3bf9da5005ee6bd88802205adb39dc244fd3442271b155ec8f56a7412889a051e51d62e3e16e11c3a3bab50121037171c297ba15cc70dd4d9c040944b085d555c97798758591eb95b42263f23b5cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d020100006a47304402204625d6b400ba3990c5ad379b90e970fe6d64307cc5bdbe71f9006c4ad8d0595a0220164c8deba9762dfb909a9bcb1626c943333f06461e2c58b51b41ad6340005afa0121021849eb6126a81231d59d590e73325f2eae6f8dd6758cedf5ce7cb04da2053956ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d040100006b4830450221008fbbe55a9d67fef6a04fc975f851ac54967fa0800270c04010341ce4228271840220549b04c3c7a8d5520b6c9f05f3f1cdc54ec209efcb28aad110b53b470a06b42e012102659d3c8aa3b8ed1f7ccaf816e04d6753fc0511959fc4092bf3402efdfd1ddaf5ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d050100006a47304402206f653ee2be1e3226eb4a725db388030f0fdc46b5ec6820f84fd34236bf2820cf022005a212288b956c70aacfdd4a4ea2b8a6d50b573cd7ffdc0f5769eb15bf31e611012103ad75d6dc4bb9b4b1ccf7c6859244167b3b46b218d5d7c10001d3096ffd0aac01ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d080100006a47304402204e1723e2d61967726cf3a2b0a162d7a4371d4d4b3f0fb207809f5ce1c55f547c0220018e66868f2d47e89738d4161682512248d58f3ed1e1a94afd6b173ab7911e1e01210275d67da7cbc7c0bc0e30740d659c8465c2e2af74fd0e2d29abdeddb82963c59bffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d0b0100006a4730440220036f42f9ec22b5b7273358397b51b8fa134080a900ccdfc49db8f62aa5df8343022019000511752b4d1e9f9f7c452f098d65c116b25e12c10568e940f7254c4f6f1f012103628f06885c53e23474d28cd2610288270d191923617b0856e9e0bff0a807aeb8ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d0d0100006a473044022039b64c02fd04e0cab94a175c55ba7326cb051d43507500c57119beb86ca3b204022061aff32ba90e68522831abad438e34070f37b41e26f23cb7921f03f851357a2c0121020878a547339dbc2a9375ea4b3197d792daffa18461b2e33bac0edb76fac50f63ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d130100006a47304402203a72392081261036c93eabd9c6cdcddf15bfcae6de19785b939711dd093820a702207693129a5a6c141eb57366585e553b875b0a6480e77b9b6ec2de822b13a80ca70121038861dc0fdd8bdefa9747c60b91be7f88648e1c0db70341c7ca393cd1d9145a53ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1b0100006b483045022100a46259b42b8c8caef414dad6b9c1c39338848cc204df8e9e0467213037f563e40220676ce2f9215bf1ec1558bec6bcd259f245fb4b8b3e283cb523812a2262f92e120121030df38f26078d2072ae8c53866fcfce2398fbb3d1b39ae3ad0f79eb77de9facadffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d2e0100006a473044022000954c6bf95490186b020b7d456657cb19c71a851996448b0dbb7a69fbce5ed8022069de6c4eb1d106eaf56f728dc41adf33238b435c7c1caeb29ed9bcdcdaa82b920121026596df661f5d6ce02be34806c12efbd77636e7c0e9e8685eec7e9162adf6ce7effffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d310100006b483045022100a9f01e13961c4d024c59a169e4ff959735b29bcaa109c865dec40e54ecdbf925022042494176bffb8a64cdd934e62c1314ac32a0da057bd5c5494bbf64ab52226582012103483a33dfb5497521fe2133beaae584e2672327663d930cd866f24886ea51002affffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d3e0100006b483045022100834f8522b6e99a850694255e864c56efd473f5ba7f0bbbcdb5697872ea95823f022035ab23ba7be772044cbb77cc8eed0fcc22d10c67d444b6a57559d2b93293cb7b012103c357a607dfbed1b44707ac9abbc0b67b515a3369a10748dc3c5164336a4072ceffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d430100006b483045022100ef7c3b7682046528f18972baeb85a84b83bffc165dc26aa4fe2e188d350ab2860220068be06ddb4c5706c570921f960bdfcb4142a5c38e543669cf25adf1616b2ac8012103cc7aa2a2c6d662f66dd8e880611b4d9df0019f0d436cbae665a2e3994f3661f8ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d4b0100006a473044022034849a5b0860f2f6dae657f02aff9e558543ef689c052b4066931619a1d1fd5e02205d843fb322134487f975c718a9aac313517f9a58a91e5ccb42ac5903acad60bf012103435b160c6b7532d7a6df4b1b32a67f02a42451fc8f2c2535a3350dbe0c889e5cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d4c0100006a4730440220653b76c650c8ccb86f8880761ace38192a55848f4ee992b13d845b61edd227ef022031ace2a0fb499bc3e66300820f8fa277f2b45df3488f66c8a9b92a5120b03fb00121027965cba44c23b05468d010b09a66c88f11f837fc82d93e65735270d1c0e2af77ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d4f0100006b483045022100d6dc421210cb807fbd8237ce505035c3434b8607c6d8eded004fadb0d1d5bb720220681a22e1903957027f574b16f3eac1b51285365f216ca55f2916233844efe36e012102eb8582dc08ea8270bd164d684176a105fd70dd5165766194f1613ea501b7385bffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d520100006a473044022054acdc886ef6db020e1a2bbfb7416608133796ea0f97734f60a53d38cad59bbf02204364f26aa2555905ffd368546b136cb1e44b83ef3ee3f8d20c6b252585e6a289012103feee761b7175fcd481dde6568aecc1dd9cf04df3d65b70f005541dfa9403763dffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d570100006b4830450221008118b31c53fbf7840f17729835a3ad7ff09d2b8ce8b2f4a1ef861759194da10502203b63de6d057dc7793a41e0e7c397e5993580863777c17f00456c976d104d395701210239e8726d971e4500e1988e528f061ab92d730e4b9a93155ffb540d41c05b11feffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d580100006a47304402206b8b0c86e8bf85d2d4ba4c3348a26dc4601ffa6c21258314cf76efdd2dda725402206a26aed98b41635581f887299376e70ffc9c17080e34783290969adb457e4fe701210261191a870744f836b3571a815a1b1ea13a7aa0ffacbf3d45943986ebe3768b8dffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d5f0100006a473044022068e6fe616d8d273bcb1e1f07746145ea7441a3b3fe73b0579f48a28abc22f43b022072097a0511e2af032bf7ef0cb89b08a5c636745489bc5faf6dac703eda0ca06b01210200385356b4ddde07e2d9bdd89f457ba05c5e9da33ad7b50a92051bd2a91a90a6ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6a0100006a47304402200c241b59ae006b8105e3b334020ac5f13381fad06dadf25b0698e60b2233e3e90220478a91dbdc52c1ec8f1af7e400d8d1332c4aeb38dcd9944b551d99a3e0586488012102a48b5b01a33b59a2a3eadf23d108ce1ca951ab4d5bc81c4e87c7284f70e28e48ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6b0100006a473044022054190595b148c32d55eab3bc9a38ee35d3aa6cd6814b64bdaa2403bfef15ec4902202563745d7d4815ec9d232cd8b38a4bdb463dde55d51203498e381fc1b60e6ad0012102d36d24cb8d752b99f3c771d502b762ace0991b697c4e4a23bfbb9740a9f48a99ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6c0100006b483045022100eef3daa0a589d1baeb18a95e511624676e3e2320030d00e4b0a160560b4a296a02203d02195e9883de19490407fa99d972a858a8a94264bd28e909d908d7172ffc33012102b99681d93faf7d71411527c099d59def01beb5aca0bbb37f48df055a24627828ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6d0100006b483045022100e8ef1e3d015f8b83d4950cd754fd5fb9ffaa2afbbcb7ab38e457242388c0736d0220760d4f9b3bf5e7498c8a15ab486b4bf174bec6a18385c37382e5dbf45ee0a70c01210281b87d0e4b299a674d62ec6d25454bfe20337f8d7ea3e3b1e689615cb5526cbaffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d6e0100006b483045022100b8daa336abf403bcd90bc233616adcaa17c2e055725dbae1fbaefb95e8151da30220193f9022846b60b2cc43a633266413ca0b04f83be5f329bb006bced45d10fd7c012103048a2bcd8bf1d2964705c847c4d767a531342071436cc1703562fd5ca7937f3bffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d820100006a4730440220386741223d2f6aab0307d1374bbf4840363a89344daec60ef1e05d253028b14b02204c33aaf3bf08d89ca6921ff2334f77f6939ed26fc4aef08a3a587c4d719a26fa0121033c07e5f15c4d4e4fa886adabdcff18f5160a0229be7f97ea925b10096c867f5cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d850100006b483045022100d6fc51f59b76711a70e77cd2b0a07cbe9f318a8b3eae0f593b9b1c23cef315dc02200e3d77a869930b29c12e7e487ef4b39fcb087de0f56e99d479b741adc85b0ca20121036fdcf58eb2d612438d6117303f666df1bf0f29d09b3fa886b351b80c81480acaffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d890100006b483045022100a1d17f403f7e3bcca15116e50daa4d1aa96b6f7b53fcd6b6c180541e53e9aaa5022073f4c37082067d60b1fc6d78d432928f8d950ce558b20de68def7aa2c139695b012103bba57eaa6d0f43f79a382db7fa868b7917293e2a663512ee0b546117164bb91cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d900100006a47304402206b3f60e339b0754eb37c1abf84d52c3678acb419a27ebe69d8640a7916a0605a022062840aef8c126e2fef8c9f26c574399f9ff42bb0c7e43ccd2989bc0c5c58558a012103b922bff588b20500c8565f39e16fa7389954d354e813e9d044b7cae10f7e5eeeffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d940100006a473044022011cb2c0fd65e4f040a4af0e800a9d0da4d87c67aadfcbe8f943d6e5fe82a7c9f022055e92b0c643b6343da526f628b7e0decfd39064de9ed7a4680ecf4425fa1707a01210364f61b677581f5c898e5360e126cacf49c54422502b47ae3bc28f2df238af0daffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d9b0100006a473044022005836c5a53db3cf1383b361003663d5c91b43227ae0ef4e77aa9301a4be2a7a602205a298ea75a3463064108d5ff5ddd7f5d948e1e7587ab74f451cf367aedec3cd0012103045fc5c01ebea94b876878e8cb1f81644720b16ae3b43875921c5feabef1cbeeffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d9c0100006a473044022059c867737de096574360feb30b967cae2d1c7b40071babaae5407212202e74db0220295fa86daf9570e5b0206c42b45c91377d50d56fcd38bf3d6e0f62c0e2b3b6ee0121028955e012d5ffff6d63758ed9793352cae5ef426481be6c3e5fc71171d1b40a40ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d9d0100006b4830450221008203c9ad7210a05efd7c149e3248214b6a10ef2d54dd83e3f4c3d7ac94a482e702204fab424b741654ff5f409197485a507a2e900a5b4c097d315bf9cb4b276165530121030673a0b89d175ff09c2edd0b310b9582c2eec64036a02d536882189a8a6801dfffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8da10100006a47304402205fb0f84e129e1c53ad675452226509329f40c378f1e13e9c1ea3ed25c084a11702201625ee2a6b758153600dc122c127bfad5f30000df090a2b8b3bdeb61580c152b012102db821d5fec8b536e019e96f82161686fbbb0b3b15246db02173c6e93f02d0a81ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8da30100006b483045022100e88d325a434642d4c60c892d4c7c926b4df87dddf25155b289bcc161571f0fc802204dc4a084205abe098a957c0a970d8438e5330aa59edea71e222b8d44f60806b40121029a75eed8d11d13c7b36d336dec0c37a9ac360d0f7c43355a1cb8763dc4845e98ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8da70100006b483045022100c838056c473164edb49850a3165a1410d47758d7b1b82e53eb2288714e5f844002206e8fdc6b5a9b0f74082ed640ea7bf0df85ec48f60ce9e0f94caf849e8793974f0121039b4dd60a8065305889b5f07fe5f4de59c8ab144dc851ba405b5cf9282cbf8637ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8da80100006a473044022054bd2e818703bd381152b2a9837295a22a7e5364a3715196bc0026c26284ed9f02207b6549d92c8cee6981bb84b85b566e3daa40c0bb5514574e1df8f58c1d8764b90121027d510e7ef2d251d74ab897b4bfae915cfb3979a043552c0d8ede26a95ad91fb5ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dac0100006a47304402203f421411be23aaa66d1db5ac9228060f97acdd62f5966ee7a497187b0794d6cd022069fd055bcc7b9f25f4135ae382a3fcdeedd6e57716325c5cc23e6d1f94f38172012103b1d2977a5cef19d66d6d12e74e069993023e4cd6cd3373e845be0e4c79290ee1ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dae0100006a4730440220027ff809af616652e7c323497c7b21547e900f000fd0a83e11b87acbaa64f87e022014cd4203e604e9c99a4674bb54d3670dbba24402d49798500dab0d1dfe6554f601210330f147db0faee2e800e1bf2eed4841793d0bd0d5fe692847fd7065af8b0e01fbffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8daf0100006b483045022100b665474cf5b8553756bc64d8414b3f6cd25fa2580a143362a28293bd96f684af02206e3814dd31c78adb0fe855137f92f5f7eb2215ca68f88959d113ca61f66cf7c601210271eed898412d9d8d04b21b2484ec39d9308edd10651373b44e2c6972e486f302ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8db00100006a47304402205cea8138fb7e544c8f54d2afd9b4528c1ea43f09f6f51123edf629718440bf2502202abca4f1bd41da14d6da97831db5327126cebcea7425d0917a05aebcc0b4bc80012102399b853c2fdbf93a7e0d320bfe8a64c4125f58d485aba150baabeeff5bb8b646ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8db10100006a47304402200b81ad3776e89920bfa72699531edde8e3e836ec54b49c7922b4a66fc7bd1cc202201b41cd2817a419eaf667a071478ad1a424081437db7b7db0951ea30040fbcbdc0121034d3e3498a4f125bfc0cf3eeabe8ae604910a22c27a825c5f345ae7186023ae82ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8db60100006b483045022100d029c7090bb9b64d96920515b158a9c79bf6666be7c755e00fd85c48c8fb03de022037881d78f67dca093cddf2cba9d6f93e108afff9d8db2f5b46507bc3b2e92a84012102c3d8316da0c1250d9d9f22f225d72021344ba9ea3aef22dc9cb89d8d326baab4ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dba0100006946304302201f7935ab4459cd8b8ad9b3afee270c213218bdbc2f1afdd1c05517225901ea54021f3e95f71becd2a8ce281427810ab6494a2e213fad920dba6f960767282bacf3012102dd11e61aed947dfeb87f4898e5383715d9c4064a18f92dec576f484eacb2770dffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dbb0100006a47304402201a05238c25ee15f4d19e763e99463dc4d8514ddcedd5fbf52a7a60dda56df3d4022015ea1ddfafa6d335347b0797877718ae31b35d1470593db2d3315eaab301a0c2012102383c6cf9f6f16dcb47445d984395f04b1a41ddd42cc66d0aa1b40b2a685d43b2ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dc00100006a4730440220743442be0b13d5022b8cf31206d25592e6efc1ebf11c22e06e73ae664fc50456022014882eeb158f755f2d7443983729c5b81cfbd30965d948606fc475eee1ccd3ef01210280010e2da50bf224d2ad15cd764acf0aaae9bfc9efc45a8d88258cdcb673e95fffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dc80100006b48304502210094b490aac0d953e517725d7b8244c6f2f059b960405ddce907dc005e100a9fe6022022a5740dd9a927fc26146f25288bb9a387e9ad099568412fbe76d5e11e4768af012102b8e37b15ed2962547879341e41c3b55659929ee5c259df0b740320d0d627968bffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dcb0100006a473044022004f18fe83b4490b4eca0383d3b56c9055b29efe6ca94c3acda476a428becd04f022021035ed356c63e0647e4cc8cbeaa083ddb6702728da9202058a4612a16f69b9a012103661abe9ca452dd39e739dcffe5a57fa01b09cbb16f0c77efb7e83203c60b0357ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8de80100006b483045022100c60c5ff1453a041d06b26b81759f846cf69fd75fa9360fa1c15e679bff52cd650220325d1dd7ec3d6a2300ce070fb7e72d76dcbf822eef29b766a897e09efea4a0a3012102a86b88cd9ba8ae114080ac297beb46a1e9d94175018f0593fecf69fbdf0de37cffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8def0100006a47304402202e4a26ec62104dd8984c9a870f84a9a499b5ebee1f300b3f18065101e7f5b096022012f1ff7449c51fd7ff622c285b39b720cee505c78d4eb64569340b6dc6977538012102727f658519de2b214fc282a4ce9f6deaf09ff34d20b95f45f97199916cae95aeffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8dfb0100006a47304402202748342a9a3e51f4bd4169d0f4839d147aea77db107c90eb2b664f665a1f730902201577f054d76941945c3dc672ce30d0775fff5251375c63370e8e05069c5bfc230121039a467d42aa858bb84b7115483e4aaa32a033b7bbc04969b1b283fe1eeda525afffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d030200006b4830450221009b58e8bb89bd25151988bdec1619da76f99cea0d5f1b1e36535b53fbe69630bc02204457ffa90d82212f9a3d3065adfdaddde9cd6940cdfa9b56a2410ddf31cca1090121035a3e4b6d57a68da2264a66e8dd4f95f08773b6bb45dcb13c0c4c0c02a1370bfbffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d050200006a47304402206e0afcd5808327fe657e0e5d9ad420d145a186e2dc7c2cce3b2ca8934e037b800220398f2ee374791529915a7311a11d0eab48e246bba355d73c6c0f7dcdcc9c575d01210398b42c0bdb3ee0a36db5bfaa54df1af62c8e618c45d2f607d50b41981021f5e1ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d090200006a47304402201a7b5700f0231c8b1b1b985cca610e1ba8398dd5e2ccb00afaaa021685c760d302200c1d98f9cd633fbc53576f4f35c47fe5f92bba44da9d63462045d061bef85142012102365bb4d19f31fb2ebb9e0dc2a3de342ca54c9851e11e395cb90fc00372ff0032ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d0a0200006a4730440220570faa67153cdb600537c95cabcc27a6f3be50adb1cb34415ddf28716e28fd30022033024b95a07e46808d4448c7672cf7e55b62c4996dcc49d9728db8d8b2171ea5012102869610d6807e1b8fa4ee9fc9ec77a5c65c815c459ff6c0c43ca58a385fb21ff9ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d120200006a47304402200691a6bd9a218b55b22d7c8fe7e30cb4b5fc8d9f0f467105a12840c4242e774902202ec960bb27f11ea233edd7e8846061744ff4ef43d190a1410e3f5b77960b754f01210310d3e7e2dd65d14ea328df383f942ce917d764a74b4211f1cd885c3a15f07072ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d150200006a47304402204d5eb7479a87d8f7c5e4b10fa730c2c8f7f249bb98f33ac3f33b653c83fe6d5a022052ff9a19d2cc5d405efe6c487414d62b5c7d37d63b7e7ecccbf247abb1303fa101210395fda29e25b649eb29f8ff2c5553a494ef95093cf746a8b229826a1de3361daaffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d180200006b483045022100aaf10af8a32cdfbae477c509516dbc21d22e9d849a2dc98f8385a7e52170eb6002203b774d805c6c76e876c98cc2809f50aad53a18e677991b3fcb05d672a3b751230121031afc3db826d4afc2b8ce67eb4cc00f1ee10f42618dfff7147d9a9cc70e09c3a8ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d190200006b483045022100d060760d508f9938cb5da7164203a7ccdf7c953c637e2b1e8fd6491e28c3232202205ae876673c4ca0350446b86e8bc4e1b06aec36ab7d1aaa8e426f4101758c04240121022abaf62caece617e1e21f254ea8f039d15b3e1d3114c873bc2b13a74b3284a85ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1a0200006b483045022100ca3e9d9e40d47a35652e0d2cf1492b6d6f99ec73e52c4326c2e217849822521002203cf8780eac3153cf7e6c278edaf55f7b23c124e7258f25a0948dc9e77eb008d1012103c974162d97e336a85a0ab0524dff7642361aa223e828b28043cbe72914b70b62ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1b0200006b483045022100fd1061fd38f51e8404eee8de6bd32532b963c85b0c60b6b12b2762b58d2645b702205d16be604e7503a4adb0b89ab83efe0a71f0a3805788ab21cd2191f2030b0291012102ce403cb7fb712e1c9843fade390efed93527e69b909bc4080590108b0f62185bffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1e0200006a47304402201b2c7422c861f1afeb4a10537250a58674319b40eaed8ab917bf4c01a6e3ab98022018f5a40ab9c659ebb24e8366d997d401959e2b1c5db310ed3360ddfc3c0b55940121038787f749b550633c0ce68c87a5978c93724f21deaca1e27bb75f18b48cec83ccffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d1f0200006a473044022049cb99756a94f213c4a117667726ecd2c30b66cd3a73dea718378bee7aaf006302200d64a25a5489927ec6d64dbfb6ff1c4fcb2c02d9177b70586eb5dbb90b48ffb10121032c416ccb3b041baef859872db424aa5364116abae839402eb16d2e66d5aca646ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d200200006a4730440220730f2ba94915cf66bce625f231d4b0f9205334b53feb95426c6293519163eca00220707e1a06c4b574a91fbb9b0b882ceacee3838ac5910f39c4078b9bc2a5442cad0121026ce0c77f80afd4c0034136698a4a96cdcf0075258293d883bf9f4370a1d1d25effffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d220200006b4830450221008fe9b998a72c096aeb74b8ef285beaa82d9c22446fb19f5850defa23acff457d0220223cc831bcbad7ff1119059054d1c867fe98cd14f90f9f45e39a4ac8d695bf20012102a0074a676f3348c8ef8e8f9d06f8c619f92f21a816a9b5be96c01079133f9153ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d260200006a47304402202d08bd80d982ba29d7222e51326737fbff9ad94ede724c59243e650f49afcbe402202275771bc11143e9f336119144226f52ba7d57976447b7501878f4cee6639882012103dc6a39ca42438d74f372f2e6c39b78cae0a6a0497ba9b324b37323a429c25693ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d430200006a4730440220772a000a10c3f2087d88503030079805ab985b3d923fb89fb5716f11dac5afe60220555cef4e3c4dc02c5f8fe6698ae4e48410eef130b328eec11f7f42b66b638f1801210221806710404c53649237bef9592c17097c4d173029ac24cba99e2e2654da33ffffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d4c0200006b483045022100aef1b74b7a4dc7d34369a87b59de0649e67b1c6a2569870eceaaaa1bbe772209022031f6cb38abe93ae0beb2e70a72dd291d83137675c8a65af97c647bdaccdb3a43012102fef18983aeb87b4361a6d0df281dd301db5976bb29cdfa0f6eed403be5921941ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d500200006a47304402203ee99c495c372e89ab7a116a584c0233105543463aa9677c63b3c11f8e59de85022048b4be2b999e1c80870e2ca9829b6a13144c3d530a6cbf7353fbdd5472ce8a97012103912a48f56f2dcc6877cfa5a5b34d6d1fb545c2dafe35b3bb3224f7df2c744b62ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d520200006b48304502210093b6a50d5d21ba73d2f4eaa931dad23fb37d9e14092bf5e6a998ced21a5129d502205f678ffdce4feda9a0cb651c677700a08643eb2af259bf7f7e7e05075ea5c2c70121035f91879f6236f544660bc6ef4db7b54a75d81877188804b624b2451a22d9e603ffffffffcce475baddbbe9b5f28e614a5077882d98fb5636ac0a8ea882a8158750a5af8d560200006b4830450221008ef854b9f8cfff81ba5cf3840a7e30757e8a04607902585d2d28ceb29838d4e2022070f0a093cff8838bfe9a7183025068bcf14d5c3a034082ad778915612a775354012102fa32f17b49b73beecba0c2f8227b08683b56eb78c8a40edca596a9010c91c51affffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1030000006b483045022100a796aae8ee86bc1b60cff71107f85b32a564b2fdce68a3325bea0e803462da06022036ffa4e3cce3e6f61c961904589e0382da12e356c5118ae975da0f5cb4ddf06c01210265d1581eb36fb426a10567e42a77c021f054af9baca4bc20cca40c4d7e7a6b72ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1090000006b483045022100e112752ad37ffefe392a93492df41fd20b3cc00a3dcd8bc58d1fcca5438148bb02205edb6517da39e5142d3bc08125aa71d400417138caf22f402a57131ac73ae442012102d09c0636e4ef75d55f30e3ce8bfd0e15b8dad9f4125fc896269d8d94ccdcccbaffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce10c0000006b483045022100ee1558240424404caf77056eb5bfc77476744b556b9a9fb53fe46598de76cb2d02200539461619399d4c70fbe092fec1a79486089c253ebee07ce0dcdfd87131f90e01210398b42c0bdb3ee0a36db5bfaa54df1af62c8e618c45d2f607d50b41981021f5e1ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce10d0000006a473044022009da225ff9f6ec4917fa24a10f2a25e42cce512c4a7877da14cb289588bda61e0220315b19e7880821a941d11541baa233a2a43a2807c2cd0192def20a52ece188ad012102e177e59930592cf7f25ed9e65932249f4395e9088234a938aa9e8dd8fea737bbffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce10e0000006a473044022026a21b23f0c94b2e4fddfe0623e95ccf58733375ef3a9aa56c5ee85e2f2b02ee022068682ec97d429d5dac141e98d47ba6974428e3436280e3eec253da257d5bf5ee012103feee761b7175fcd481dde6568aecc1dd9cf04df3d65b70f005541dfa9403763dffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1100000006b483045022100e7d9d061b253fff6fbc7f5b533661e2b08ce7d4496b80d988b69b389887b6a6b022036c72c7d0f1b1f349fc8307dfe71d30edd93a3dffd73b613fa834f3daca076fc012102bdca2c5703625f8a3a800d14cabb4b622dfe766e29cbc4e03f3e2faa227e4ceeffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1210000006a47304402201f94668fedf809b34c1950e29bf98e749077eebe7b555ac6f182d1cbe95a4cfa02205d051a3b51213779e0f550b584674d33cdeb43a169cd2ebb63021172f63022520121031afc3db826d4afc2b8ce67eb4cc00f1ee10f42618dfff7147d9a9cc70e09c3a8ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1240000006a47304402204111c3e5248ff15a7b212cf8bdbce95d4318a4267310a0b488fd8f3385d723c802207ce823aa9d90642244d48b22cd62de54c2eea000df629d062cd2444725b7b2d401210310d3e7e2dd65d14ea328df383f942ce917d764a74b4211f1cd885c3a15f07072ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce12b0000006a473044022018dc25150db8380232511b5cb9302ea3d903cc7d666906716b4e30f0a739ff0c02206d772aaadf196d0147c85ca297ee737d41291df5f4541ec54d36c9b755b9ac8701210200385356b4ddde07e2d9bdd89f457ba05c5e9da33ad7b50a92051bd2a91a90a6ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1320000006a473044022059f1028839ab4af6940f16a1e516283d8f0e5a82634c05677fbd3cc35f77e0c202206cda1e5ea5f7fbe92eaa3762848e504c0d7f40374fe3176d81ed366e07076582012103bda66744af00c2926e8a9fe7d4e4b10b44978e31b6c1c621a2dd2192ea1cdc89ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1360000006a4730440220019aa11c92b978eca86cd3cbb88ad40f9035174559bf802195dbb8ac2d7099cd02205196846deb50c0cb171f46f247de8f98b3eee3eeeca79dcc8db095fee0372ca4012103b85351a7b2041a50095248f463f53e82bf504063491099fdc3b0c9a83190bf8fffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1380000006a47304402206d2295d8bf8dfa5b596ea218b3badbb648371beac8550de84899dc33affbfd6202204c882dce7c35e7fd922c2e603fb3eea9a9b1f4a955bfd50ee2ca9946127c1cf6012103c974162d97e336a85a0ab0524dff7642361aa223e828b28043cbe72914b70b62ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1390000006a473044022020cf5cfb7369179e400e3025a2f78d5be4f975ac26287e634a159dfe1c857b9b022038736df5d7fb7db76ded1f590123f73858a358c85e4688de3b6f73000f2d7c13012102365bb4d19f31fb2ebb9e0dc2a3de342ca54c9851e11e395cb90fc00372ff0032ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce13c0000006b483045022100e7bca4ae4c32b339a2359f07b7ec2ec369a19e874f06fb4e7a7a45a6aa5a0d2d02204b2dec6c29ab65723761f9a1fa1fd71959714a956fe67792fa67cb2521a2517a012102869610d6807e1b8fa4ee9fc9ec77a5c65c815c459ff6c0c43ca58a385fb21ff9ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce13d0000006b4830450221008251823c9ca39a29ee0f4e2bec048584bb6ae7be78a758372111f0a38515bad802200ac17d99279c9725233d40ca3a76b0d4ea888e5d459b9f8953257303f7dfefec01210375d0cd09e670b856e4d4d78aecfeae7ab5a7512c545fbeeec5e886eba5058191ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1460000006a47304402206a45ed38986493559e31b146a54279f6d3db81b6d458a6b492bc5d6da1846e9602206d2361598a468eb52b6ebda3a79e0c592a803059f9108926e2960a0696f9430c0121021d6d6d74787f56298827ba2de6b362ed728437b43636605185bd2c7d38b7a2c6ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1480000006b483045022100a759eac0127618b9b67b3eafb4f542e5ba700edc002460a72448622f770bf5ac0220444cd313d27bb968e215fbdd5ef938d2bac2269f62b19f75831d2c8a6c1bf55e0121035a3e4b6d57a68da2264a66e8dd4f95f08773b6bb45dcb13c0c4c0c02a1370bfbffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce14b0000006b483045022100ac393f5efb0faff6e47e460d94705b5c28e0d4660954c86bcb8d2dfd2024bc2802200f9758bb634bdae1e15deaf25dd18a014d642e3b372383d569ef1a051cbdf006012103d44ec737656e1fd7b52f1dd5d6e223eacfac855527cc86e5c89ea8230222bb65ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce14c0000006a4730440220643219e1e5397c263a571c823f6e2b69c35ce651c4da3c9ca4fd89160a481c9202206878f8d2dc692303c853868ac5083c094e8da9c2f1bb871ef700e2cb980b8a7d012102207ef56f0c83b6d2fdf865cfc9c8398a0e91d5ed6fbfdf5fb8607f1050fadc44ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce14e0000006a473044022059f45814196e8b57b0f82de0ab3703f78692b0048620c123d6f649563ec6b5bf0220057d85bdc145d2be54bd1b00151bc99f23ede82366d3113078d31aefd154faa7012103c08c0d0d0e4715e37f3f434e06fc3634a820e9dbb7db953efa1fa2b707ddd61bffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1500000006b483045022100a0da2f47b157feea9366a90a779be3850997faae8554b99e12e3724f8d153f29022077957501320a4648124d3b358f0c6bc3c075dfaf6443b410d4e833f1a2b35a33012103048a2bcd8bf1d2964705c847c4d767a531342071436cc1703562fd5ca7937f3bffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1550000006b483045022100d8c72f6baec07631b9bfe35474e29a8f4a730d84ded906892f05dcc5aa3526c10220663ae767e4a776030eb98f529b96567f6e73913c9a2b519d0d4d2ff6a491e46101210281b87d0e4b299a674d62ec6d25454bfe20337f8d7ea3e3b1e689615cb5526cbaffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1560000006a47304402207b418b4cccecdc3109842012a197fb955d9838ffe22390343cd4c6ec001c6430022001bc698f4b73de6406d16f6217a6c992f47e78b0dcc993248b12a0eb4088868c0121038787f749b550633c0ce68c87a5978c93724f21deaca1e27bb75f18b48cec83ccffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce15e0000006b483045022100a19e82cd51a2dfb1ace2e1cf2c4c33452467412d55e7fe175e563e71f3b2cdbe0220757786bb52a4c3cfd0e6f2d56d67dbdf2bffe4bf0f124d9cb7c5e2a95fc364070121022abaf62caece617e1e21f254ea8f039d15b3e1d3114c873bc2b13a74b3284a85ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1610000006a47304402202044ffc93608403fff54930e308033adc5359ebf9b65435fd1a29204d42e0837022044776b7fc9b011bcf390df52dc0b88f7573da88bfe53edf1f59c2feb210df3b8012102da7da607a3d5689f3b548b84158cd7d01b6a3d06ce46e21d30a89f2ae3b38d3bffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1620000006b483045022100b6e413a1f591c6c41b215ad6637d209faa8d5efa2820c6755496c3f3d0095e6a02206749a0b8a3b985b1866d2b75538dac1b4b6c1250fc97f20501c1404670089158012103ad415589158489b4849f08a35d5232ab97b8af419f54a51293eacaa207f1255fffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce16a0000006b483045022100acbd746359056e3d2c511c76b3ef543a4baf5db97011383f281795a30e6f1555022006bd970c51340437ce3e148dea839bbc96f5adaaa03fcd20cb72f7e4c8416696012103c808a9293397918ae34b7c6c754554ed70f7b092899f39f40c84efe6b44b3cb9ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1750000006b4830450221009c29bd4b22b5dbcbc8b723fc00808e5dde928458df472f7f1ef508f8b4915acd0220344d78cca5a0c0cfb03a8d5b4217944233529173f5bfb8777a301654b49315cc012102a0074a676f3348c8ef8e8f9d06f8c619f92f21a816a9b5be96c01079133f9153ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1760000006a473044022046d183986cc6462ad04761a493816a31700ad9bc60c4be0589354279973ca55d02200f653217d2f08fb2bf2f779f2839c577a8a4688f5d345c5c6e6a8e0f5436a621012102001c8add5f438e5bb88384cb5a0636eef778de49c72ebebb820d60ec450c72f3ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce17c0000006b483045022100b5ff9dd5493ace5193217c279274a800200c1cae77e90b66da01eed7c9eb47690220383c858d65d93c097ae532c236f337163d07a98aa0e623ed1395aa586108752f01210254e690cb1831c658615c1eb7619d37baa29261662d643a0346019186edd5e8e8ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1820000006a47304402201413569e40213407ec132964bf8a5f5c53f787abcf7f8cd8a211f2b626f009b9022040dfeb7ed9c53cca8a1825bbc327f9a42ee4254b610e2de491d7436fcfec11ba012102467d9c0ba7fdcb7c5bcfb88c409da4abd7bb7f0f1392ea537375d308beb726caffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1850000006b483045022100ef1ebf71f7b7b33b29cedb92462ee186247dab4ddf5977b5f385ff90033c6164022052c042fb195caf30b8fab1376d5703abe1565c49b4dd69d8ea5fa483e6e415d3012103dc6a39ca42438d74f372f2e6c39b78cae0a6a0497ba9b324b37323a429c25693ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1890000006a47304402206f171f092aa1c83b385293e6c8651d332b0a26bae1e4a1b936f579b64c85b51002207e1178443936f66cd0b64265378ff25bc74422fdb57e3561323ac04e688c76e601210201a71c6842cbee9ff2e7c0aecf1042ce5d30103f4f73d8ef35447ba56fa78430ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce18f0000006a4730440220403520ed55944828f742a4b8c72feac418271e14b516d2331f6de2173248c972022046784ac0666c9f8e9495e9ea027530c8254d382677ecc3730b1e07dba775fdd001210290297b638a0a815a09ee946947567946ce8d40ad4ca4b814e42d4b86d64e5161ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1950000006b483045022100bd08c38e9b00a560692034bbd25013f50d130a335c87a7e727fa97b6c228a3fc0220287d22c6826d9fa683a3914afb5a9c04959de7355fd6beb25ace68db19d3239e012102c6bac6f6a26107f1b6ac7731d0eb1f68be1a960fcb936138d5ec1003e3009b9fffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a30000006b483045022100848a82938d6268129d76e94c7b777f8c0a1d599ce007fa34d1eef5a711cc815e0220240cd29affd1c5daba89606afae3e6d98583c18731f2346cdb72be6eff28384d0121021a5795b6607ad6e840c9e286bd0483015f198c14579a07b09abe352f3adc21a8ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a90000006a47304402205acabe46f8f7371a38e439a909e0cdfe69ecb7b9f8d1af57057f6291e3e5544902206e16fd082122e56e3165afac33b873dd781610cb32b324f5ba2cb28a1ea8e08b012102aa40eec24fd5aa30cf2ba80b1dfcce8b3cea6f81b63c4798c40c52b0641d7d6bffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ad0000006b483045022100c7d466f3db1f924d4c43b80a717c9dbf42bad03e305e3dad837d987417567f120220474d5655aef0d0510388194185ae579bb5b3a66bb15dab578840a645c2e24100012102dcc2a5abc3a39b4840455b057c912c3685b6801e7df26d3674ef6d2ac12a8d9cffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1c70000006b483045022100e2a7032b935736a85de81c73b23872c3c9bcb6122eb18a40962ecd02049f3bb702205b510375ddae6c39ccff655ee40d8044d2af612b595e2b19e0dcaafc6e22ff380121029d46352f694824dfcc800fb6781602a527d7ed003be2d6b1d64c8e6eef50df7affffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1d50000006b4830450221008ffc2ab065cb3a260ad98968f6acbf193018b0062e8ea6a92e4f687377accd6b022012826fd27976709a57c0148d4840964f4a3c3e18b7fc1c070845ce13589fd32d0121039a467d42aa858bb84b7115483e4aaa32a033b7bbc04969b1b283fe1eeda525afffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1da0000006b483045022100df98058d7a7cd1e6157cdb1a5a2b1bd889cd20a55ddfbccf8035c31b7357e4df02206ab0498e35c1e28cda73de832e7266534fa4c07ab361e2775f3f4eaf1d71b14701210253261bb6c86f395e68f7480f90e0e7a47b32ce0d56b75be775345a5fd009ea25ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1e70000006a47304402206ed58549646a47e9bc7dfe95fe060fc5eab35bdbcfad49b3533bb35d2954287d02203ff50dff4929b869c1ac746749f66bddd6a6945e228d11286e40078b143b2087012103cec48e102fe0a049ebc494ddd3d14d3792b6735516ad9b50297c4733a17b90d5ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1e90000006b483045022100d748aaa58a76351cfa2adf3fbed17cac0188ec7c822430358bb67d4c5c0493b40220358651be876f294274b82e4ab27cbe614223cdeeba7f18ed4de9eea029430f98012102b99681d93faf7d71411527c099d59def01beb5aca0bbb37f48df055a24627828ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ea0000006a4730440220208d5ababeded05d060511ee084d4bfb8445a6bce9f0d3344ed18d387175315b02201a060f0adf15f82bae7fc1ce52d60d1ff80dde87bce1701fec63829f8869cd110121030df38f26078d2072ae8c53866fcfce2398fbb3d1b39ae3ad0f79eb77de9facadffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1f10000006b483045022100e64c57c363d4d317d4c63b2543af5d18d5c80a8c19ce959f1b3c64544debcf62022054414f5c39ecd2e4b7c3598bca35fb8f44b8c443c6369806f47275c4d69124ce01210381e1b57ebcdb3b56c0da96dd3f40c4809533f3949d00740175af286551fd39e5ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1f40000006a473044022000af69b4690dda54e96bcc22ef1ccc6e597ec9643bd791693b87a7541281dc4d022014b7c8bda024a5bc12db33999a3561e97831b0ba05297547e5975dbd793045fb01210291cded3a99d54bfbba91178c3ac811e0545b9ae98594cd88165bd8d8a6c5adcfffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1fb0000006a47304402205b306ce1132daac159bb1616dbfebeaf141abb669a6e8c0cfe6083ce5d2acc390220688d5478cf187590de77896b1edd9a2a203e95262edb5f269eef7b8ea83ada19012102ed801ac57a9715ea9d33bae10cf77e955e97d3eb8ec3e0610b2e1618aea49743ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1fd0000006a47304402202493af2acfd48e7ef306a2ca586cf1ce37b0b0df15dd529978d04d0c126b190402204cf7fa00378a962f5a02c13af86da3ebb83eb41757f47b4dde7364e207a73679012103661abe9ca452dd39e739dcffe5a57fa01b09cbb16f0c77efb7e83203c60b0357ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1100100006b483045022100976aacbc4b3226fde372eb72a011f8343e0996675b5ab5dca8caf4c9411498b102204ab6c4955d76ec1500c7c918c58ffc1baaa0cafe7d37f3fb3a3369dd924de9990121027d510e7ef2d251d74ab897b4bfae915cfb3979a043552c0d8ede26a95ad91fb5ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1190100006a473044022100dd2cb049a9f33e199f8cc28e3e7679eff17ef0aedfda59399558c0c49db19d90021f562725a736cf9b9c12b5f1db508915bb520a83340271fb8c94e205099d33260121025ea8074d10f85c04eef3b63930923fcbb122a5c9dfdbf41a56b47e91b3473c62ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce11a0100006b483045022100a5b1934e7acdf80039d21c94784cc4a0fcb3df42a349e03788b91de12f5ccc7202207961a88464ddf26ecb8c46902b55478d4224255d5be4d3e2b8715c4f5c0b64a4012102c059b935facfa01366100691c91328659bbdb885e3c802467cacd44e92bea4cdffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce11b0100006b483045022100961ea22b02b1cc46a09275dd082e1f59172ad5db2db9a092c179bac9910399c702204172b2a043a152abe48acd87505cfdf1d4c7bc61a60e4106d156286e15cc39cb012102cd0581d13ebd3d022a63c8d86140e52bccf1b454f824ab7fefdfd6a338c0a4a7ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce11d0100006a47304402202f5ec2b5364ee715fc43b743f73062f04c4bda8e3f287b840f16d32756f58efe02204aee179ba38fcfb3b077ede655d099d9cbaf546bc4159d30f27669e360d4ede5012103a1cdaec2cb6677a444b56fb6f4c7dfdad2f16e0e83da9d08bc0ab837d44ca694ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1230100006b483045022100ff8373e26ca26ca23c5e0f999e5ee448ecc8086c972b64619653a31da0a624e00220361762c6aac55ed25f420152a24133dc731b0a36803b496602a5ab5c5d220538012103966efefa3922def76bcb9c9da9ca320ff071df2253a95e554e88f0a43dbd1af5ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1260100006b483045022100f153ca090f3011070d662bc4b07e99ca4b134eb18f54226a923b090ffe79bfc80220447feb3a9d45e98a9707ec5bb9b7373cea53207529823c0db76c8655e173c6cb012103c0eb8b1c197366c5aca991758cb9ece316d77cbdabc880279b28ef0417fa96d8ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1280100006a473044022027f3f6b2eaf4d288835b317f989ad1188e49613b44c068eef0ec1a9f44a7c98102203e27fa6e447b42ab288937e4c2c2bac355db38c2681dc293ce88d3b9791c09350121026596df661f5d6ce02be34806c12efbd77636e7c0e9e8685eec7e9162adf6ce7effffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce12d0100006a47304402203b55c002ee815b3bdd84fa67e7ce831b70e8e3e7b1b65ff1ec8f504093845ed902200ea8bdf7d242d4fc592ac9d64a03e72c98a38fb73cf06d80e783badd944e3982012102407e47a6ad48d7be1d7769a0825e1c80da8c6e138d4a3244d02b82c86b134b73ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1440100006b483045022100fd421e1001a1a80d0f84072d648d66bac47a69fcc376596cee7f18e17cb5e41f02200b38c605e725a14f744f72dd62405aee66f6679d104dc0ab5870447990ab1f730121035619b45c3b340326aef6829d231c44907d48f1e9a9c79f2ad67bfbac67391755ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1460100006b483045022100c46d879804431bd6213fcd9154be70249545951b25a52f753b7dcb821c280f42022007f8b7abfa8419862c4a37142b476baf5e05a67b094828d06779a4bda7899e4d0121028e1b5a54a6a54245bf21f0848d672d3f688d11e9328f944365b146e38efb4bffffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce15f0100006a4730440220102fe149d1bdd0efdd007a7cc71c3b83b0386a848551748e7654e5e9dda4178602202db140ecb33fdafb218274777c946f42c28ee486a298488763a7a3781f0733a3012102b944e9570267305e26e166d0e782432bc5145c60d9b399eacff1b1b05497ace5ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1600100006b4830450221009224cd25356cfda7872374fccfc4113a6d050b6810ea69b6086722b30e653e3b02200eb98f74952c550e924daea631810f0931d8b4ff9327244fd38e8ff2accee5c301210394e8f35ed26bf683033a5275478aa2fef20dd21fbf5fc5baeb9ad4c4d4226698ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1630100006a473044022009eaf02543c90f2e987a81e1eef361c5315dbb17bb30475a4b2b0d1dd207d1bd02201210a494912a07390746a10294d9f9a371d06b9083625b66aaf43b17d41e82a5012103628f06885c53e23474d28cd2610288270d191923617b0856e9e0bff0a807aeb8ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1670100006a473044022044b02743085cca9ec5a2d5a81b6b99cfcb4339be69ba8b65fd9fb74815310bb902203d97807b80072d56ef4aff0395de843fe965323a5484d7edc2781af29654c7b201210360e66e446a61398bc9232016e6a2f34e5c26f362479398702acd988ce66807f1ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce16d0100006b483045022100a3e4fa2e154c224a621ddf06b086f79e62f183b89834a9dabc3d2dc9f468636a02202f0bfd705f6398d94d8970b305f1dba71eeda8f601ffbecd9f60ccc87b83008a0121039c596113a41cfd570dcd458350e7370af3986daa6e3953a1b5f6c4d9bd3114abffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce16e0100006a473044022013e0955cf80da8f0662294963cb6d3fd4c0eb694b7a7dc7d8ae1f615205a5a3002203e1790833a50d3d662582987ac0ecefe24db18987ec8bb3b46a6f81c2ae9ed31012103c357a607dfbed1b44707ac9abbc0b67b515a3369a10748dc3c5164336a4072ceffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a10100006a4730440220460db28bc3addb3370375346727656c1a8c55bb482b54583e4faf9466ce69bf802201ca90204d80bc78b716b84e2dce5f456c61c9de267181493149ad3d2c81388920121030f7d9bd8007d826c505a99dcbc9c155d1fee0bc95c4cf820501cbbd0566b2d0dffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a80100006a47304402205a9859cc2f2518dd90e063c9cabad05a73657d133367687ca269a05558b4577902205aea5452e9feb3f57737b33c7d278d429acf81d66ca3550579d4cb4f3f098467012103f96fd1a1f4db52fc0457a3d13be145d0a6f332d4e70ad776a08522d749dba056ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1b30100006a47304402200d6c40bd724d9143caa8a19f9b690eaf19d40971af193b37986477432e7cb7a202207f1ecf7adefb6f34847e200d3236d4754213a2540eb639c3ea719a81ff7ab4dc012102727f658519de2b214fc282a4ce9f6deaf09ff34d20b95f45f97199916cae95aeffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1b70100006a47304402204b2577ee7c4e548440eb876a2ce5b2108f5ef2b50cd29e4af9ba76c9fe0a6ece022076de26cd97bada67601db24f5c1ee7585aa441256b955ea1a4100e05cab5f4c4012103531725f6d0eba124ee177084ce0be3312fc88d45ad517ff08791b95810f94670ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1b90100006b483045022100d93a9613b27c7d264e5169757cef11ead4c89928df6671df78adb3916d86727d022070358d8e0837fe188eb1f5ae61f8ad2e0bdbbaf4653dad1fa7d2a4534177c4cd012103771ab78fab9c924f56d9bed1f4567ca8eaa7b84958575f7724d1b8949ceb2d36ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1bd0100006a473044022036caa3da4ad597835733b9988a0c2c93a2ce84ab2cfba3e881ae8b3d78caa63c022056a559471c90dde6e92ec8c6e043e5f231ef229ac6d8938db3b07bf4c302252301210395fda29e25b649eb29f8ff2c5553a494ef95093cf746a8b229826a1de3361daaffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1d50100006a473044022053ed4be0141efa9996949751e9c0ab4f1a1ee2b9598836f9e93282a2bfce86db02207133eb7956820da32dad04c275735a9cd973839d71f0b4f8177d45b027dfd846012103483a33dfb5497521fe2133beaae584e2672327663d930cd866f24886ea51002affffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ea0100006a473044022035e53c2f8502874c854ae8d9d7ab6aaee793d9d2d69d814f82520422a8685f8102207e387d04d3c6fdf5b3e767afb6ba5988b43a10fec28dc798e3eebe9f048fbfaa0121035d9ce97541161d79ba3346e6c755cef41cc110b2fa78a658c349b3ba8e7ddbe1ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ee0100006b483045022100c0f43856a459c691b1065b11fb80c687618f339a13326257bcdec0baac9539fe022055e2273109decc4eafdbfdc0456b0dedf53d484fadc7ce5cb8756d5a8c159c3a0121023ede75e5bc13b2103eb0d3c8c7dfb60b6c7b810f49ce005a55ae4b7d0eb1f658ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ef0100006b483045022100eef38a4bb2747e5bb1800c3f4085ce43e56fc868aff98f3307a0358c158e33dd022079862e3b9f1abd528cb9a41b842ea5ca7e04212e810d65ad4fb899a9b0c6a2c8012102e79e860ef42ad0f30a2f347b4c06dbe0d82a36ce559fa65044a7fc033372105dffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1f20100006b483045022100866fc8dfc71d4a3e6098b27e1f837dcb18e48cc3aa7ca3d5f223bdb9a7ccf8fd02200ccb4860b6375794e17eaf20ce7cf01cbe2e392c989857c0c1d055937be3b845012102765b7ef38aa3489505eb3927828dd8923aa0525d117a7ae20b1f59f96df0c7b1ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce11b0200006b483045022100cbd1c355903d6363fc5cf087016ddd2d18609fc669eced315e8ba9bdf6abcd1a0220027940c9598180501779ec8d1588367e24775d1982edbf54d601e00545e895ab012102812793e164e39f5631e622575caaa9cac7bf43737f7f95302280566b8c7f31aeffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1230200006b483045022100c6941f9c43f6257ca934f984adb1bf248f78098f40f72bbf2dd6aaade13f06d50220099e7a882d56cf1f075a2ed8106e477e3c4be7eac3e2de113fb7440fbfd1ab6d0121024f467b75f6c16df2f8239406df5646651b6be9e9f50b504b60ae9a1209a1e993ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1280200006b483045022100d3d4821b1600e7fc7c7ce3a66377b6085f5a02e9e67c755bbd182d34767e7fa8022017a414ba662470886ef289a686f761e27c6fc2280f5cfa5664b1e143f431a3790121020d934c98a189f626654c773dcb53de3de5690b48f0fc64ad92b25f8d08e9015fffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce12c0200006a47304402207f9e201874f3ffe97fed726620eb1b3dfbbed6f3ef2782caf09af8cf8a6623030220021479bd9ba60b76ffc4f081b5817c74b103d99869982d3b408eb678798d7e5d0121021813cdd05350838ff535db25d1605c183c7b4141d0ee2ef2bad24671945f35ceffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce12e0200006a473044022017c26f22dba6fcb856906553a64b4500749316af603077d318358fcd2c77ad970220230bca1d5f797d53a470dfad6278d92b2b94a505e6e3e8c33a11946c71963c1e012102a48b5b01a33b59a2a3eadf23d108ce1ca951ab4d5bc81c4e87c7284f70e28e48ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1310200006b483045022100dbb4430985bb573d8b8a577ca5347ab0d195468a9de0f23b69f5c9fe584f5dc90220293bae1aa0d291dcdecbe147c767361b90c43be5ba8a01bea34f3ed34caf4a96012103a52b0909c010f6df76c29f4e53ce078884d7a0edb027d3a680cf1ff2106ec18affffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1320200006b483045022100931b902c13c655ab99db6143feffd7c48b52491bb41491def8cb1c53f34f75ed02207a08369ec4a934c7136bddbd8570eb557b0c865c2d7e6d56c757ab7f7fa4ff6b0121023a186f3c944d8349cd144d419f2f043eebcf260f5cf06557d87a11b731c0e76cffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1360200006b483045022100f9d4917400ec6fdc41cdf2274f1760b54d1bcbecab9deb00efc294380d1ffc880220631d22cb4f9f2e3a7e0450023e6f089b6d00eaf9b37925d4bbf46ceee71b81a4012102c686a2956d0d18adeb6af37438ef2392a7e1b0c070d253212d333013500c408affffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1370200006b483045022100d8b04e92ba289360d3589e77ad35126c5cd759787b4bfbe2ba8163f3a9406f6b0220478f3638c63af6d2c6e5a2ef890523cbe4381a5b8e174673d599bc453cd20ce2012102d091a45a2368c4fa118ad23fe1759efd5b69aac7748ebdc04a3c7956c772bd42ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1390200006b4830450221009a5d8dbf8561fab292d34cba14d1b0bc76c475fa7229f1dfdc63d392349c7f770220343b743c1db463b91b443ef3bee68eacc92f01d6eda9c27a655bb47ce1f4ef700121030d170f347bc5ed046ce73ccf1a60d017ae7cee5f7254104bac52dd0de19ad91dffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce13e0200006a47304402204446051fee410f77a847137e376f2f123575ae8352c4f11c4271f9c42c8210040220560aa920725767de3930e3b35473723a7ae39fc543ef8d10972e3508a142e7a601210367285ed00b1ea1c032beb9515c6ccde95b57965c483871b83cccdb58c20857fdffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1400200006a473044022004bff4c7ce6489cdb962c1900274a2879a9e7388c00267c4833f0742aaf54c5302202ec1183039fcd4c48afac3a97a214776b4d85b8cebff1216deb4c74d73fb6a420121036b80696a61486e2fe3bdfea251522ff9e66eb66a4c5162fdf60ac6c833ea90d4ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1660200006a4730440220679fb3854cf2634447696468f9367640b61737c23883bd45235c87d734759f0f02206981cccb33b6348a2f32c4abcc2b34e2cc127c97a9328319a464a3bc7ff7bef60121028035704b48f9cb31a48e577bee6c22f6c259f9b6b23d6c2cd325148e8112ab12ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1750200006a47304402204f79a45812f628cf1d11b79adfe77cd1d7a0ade3f64e983d5e5feb1e6dac132d022021ba37477841b0370cbeecc3c9ed844c1ea1d0569f4bccb735b772510023d45201210261191a870744f836b3571a815a1b1ea13a7aa0ffacbf3d45943986ebe3768b8dffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1760200006a47304402203f35d4957abeae071b8f0cd2bd8acc52f364aeec88913fa3c75c5328da0b400a02206e6a4a1209bd4c2bdc6435aef7c9b2439ff0c093f1fc524dc4216d21277933440121022981500e07f5e6bac5b5187a33fe6ece5962db6f98defb2b5db580398ace645cffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1800200006a47304402203ed2fb6c30ebe4ebefaefb23e37e4ee7e636e46574350ca8da134a4c0176894e02202b105e20c5178946c576f2f530b70c532a9ec83f0d23b0769a8a5cc62be494e40121028ac506e0e8d1a686e602f6ab99fcf9db7d91f10d9f677f67fd5e3f2f273b167fffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1810200006a473044022053a357744855f26e6c45a8624588ddcc5fb697b08e75697b61105110f444930702201e2e5de286be705bf72fc6a619812c522b80f5aedc917b9e041e23cc52225ddd012102f9b763a3b03e3a2efd7861ce9863c32e863e919e96573c923581e8f64fcd495cffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1840200006b4830450221009a4cb0b438cc08110b96116ffe7a5f990feade8fa6bfe64e9cb53d71f0d2fd7f022028c58666bf6868e277af9f1f2f086b4e2be80ade355d66ed967b7f1c8aa444b3012102fef18983aeb87b4361a6d0df281dd301db5976bb29cdfa0f6eed403be5921941ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1850200006b483045022100efbe5a98380d87a33a1b32415542ff5804a3eb9e2849eb35a7869b812512610b022019f08404a2e2a990c4ec76d431d0b54fd990c7d364f56b0c9cd0a6e3f72f0d54012102092c130bafd3f042a14faf0791e49dee1c4e4c45fa8151f8c29e28a1eb156065ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1920200006a473044022035250088d01cada30ade05f3c3b36d70d861bd1cdf06043be51bbf8a1490275d022076c597cf590d29983e7e4a1e86b27d56fb7082927dbfbcce011b7493da642b230121026ce0c77f80afd4c0034136698a4a96cdcf0075258293d883bf9f4370a1d1d25effffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce19e0200006a4730440220776d3446fbcc8939e09783c04ea919190dd817947d9700df4f70f095c1777d2002205164b3ad67db0578bda2da7ad6b43ca6164d8cfdca77a080b4200fb1bb503bd00121036fdcf58eb2d612438d6117303f666df1bf0f29d09b3fa886b351b80c81480acaffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a40200006a4730440220093839389b62068ed30bc99a49d738d482022f88c6cd5176b109d44483a091cb0220684c0077fe2ac4bf51208dbdfba52b79d031afbc3e2629c21f7d1630383214aa0121033f10a61831dcba9c5a55a79d7e4889a24f71e2bd65f34ce770ec07654fe9c5c6ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a80200006a473044022054e1cbc2ddacfb9d34d95a304bb7f78d2dac06b168fbfbcca1d16871b1faffa002200794a401df56c7dd0dba4f8f2bde962345e2e1ecc89974056c79401f96f7fa330121029460ffd6c8b809d3cf267772a31a9ad2e94a0fad6677446fc81d03e5da48b73dffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1a90200006a473044022065a97b7d338e2476fd512d4895a7b8359cb7fb096b9401206109735be41ebab302200d556b237b96831f0b558c8c2bc2bf4614c237f893ea8c500a7656e518d3039e012103ff89a25c084b465f1c5d854078ceddd639920e4a06b1ac84dc033fee257752c3ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ba0200006b48304502210095d50f2221faa05a2f24f7abc226f3c580141969d72e26d0b7d706c1f95d69b702204929bbb23f7712b19c9cd84ee774a7c845e5dad1873713945904666acb0f5b52012102fcd18fe4278faafebc53b6da5660745d2f018def26e4ac1c23f055893256eb61ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1c80200006a4730440220154b98a27af29babd05fbdbddcd83c2945c12e193111bb01a81ff7c6d8074b7a0220025d9ee492e11b4f35ad0fc65c817f1371828a4961c3702680c0c7d5b2ba0548012103421a402b70c808024d2b6e353822aa266272106b814b4c84ccba22211d2288dcffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1d00200006b483045022100fe1af213c6c257329c6b91478180f36b9ab517134359e2710335e02c1479d302022050a2063bdcf822ed723e48d10ba43dd04a3eb8ed5ac4638c9be5b2f935a331a8012103cc1cb2bfb5a8610d0b253b93f9bd07c2bde18e387b149f2947b753b36566c511ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1d30200006a47304402201d6935d87c82a1e0d6c2fa606d0bc8701d047db1f57edc75ab6032a48c18d60a022037b3c5c7262125313c39886615ca74893bb863688203a7143f34b0c74746c7c301210257ef3ad11cdfdd5206252442bcb4a3c8bb6aa5c333e9292d28a6b08acd627c68ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1e40200006b483045022100ba49330e9f406e4c86e9967c64131bd0700b141f3833c75dd0044ea4479ce8e602206ff81e4d19a934f76348973aac37c345fb105371f288c7e217ac5fdef3809c1c0121027186a3f30963c7d158c4fca8c002f8565d9d19e010800f352ff841d101068eccffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1ec0200006b483045022100c52c36c0eb07d44c8f16179629353c3ea91a50f2b8c29ca2389c87a96f5edb780220087db3618d5258513284139dce469eef56b20c0388b3b508aa08f060cc73988b012102368b25c7524d1dcc32833d493cadd47cb44078f321fbbf0ce3ec4695c1f60f88ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1f10200006a473044022027fa07b35fcaa0720e069251fa2c0f89fbd80aa24688deeb3ce6684d1e1a787002203aea48c806ac23d7ccd9cccacd8993e0258ef48f27010247b0e3ab3b6e269bfa012103a841b267fbd3eaa91bd3cfafb1e825bc3ce407aaec3dcf141c3a7f3ba73b85a0ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1f40200006a4730440220670673d5e0db628e220c73e17aa0111e24f6796090fd66605e48825beaadae7b02201e5554bf875da04100c60f310f6ff44ee37cedf6457efbb8e35eb459088832580121031127a9b77b881ab4ff268cd9845cf781f63aff8f7882e0a7f3e207a720072751ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1fd0200006a47304402206f2314f3361b7a931a18598d5dc3a05eaeb6fd032b88c41efbfc7bd0fd5707e2022046b6866073a3badc6615fc1e67897a945a9b4b097cfba7c679efec8906cfc18d012102dbd4392d0aa21a4ed840662efba31af122eb1469ae9a02c4c2f83a5c8095a7f3ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1fe0200006a473044022048eebdbb1590bb51df31a0e61a2fe84e28380fb9fc2f599abb0dd97c59014bc702204f809646714ea082bf56d0c70a3d9e0a4659610f27056415d9a2f523ef5da413012103c017e13a66a2fbb5773eb8c158fd91d87d51398ee06058d52874555e24d90439ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce12a0300006b48304502210094178aa187fb866720628d18efe0273d3d23f6d81478a73f600c647fdb2054d802204b18dc266e41da1626f763df02d7287384a41451b8cf87421ef765bb5dda37cb012103978b1b884a950a5c50b0ef7a9c3274d03469f06cd1c4b6a9efa35572442099f4ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1410300006b483045022100c7431c64b989d55da3bd961e9476f32fc15ea62ca7b564f3da0920ccfc2f219b02205b3826c561c8b19aaad27b16fd275c083eaf5e4db56f332e4fd21469b680185f0121022bccd2c3fe9a40ab0c9e6ae7cd4555920281bce457120b58a62f237a770f35a0ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1020000006a47304402207e2ceb28d1d5ec8a3a2bae661d8dd900da5c1efaf2c62d0479d550c4fe5e05d8022011ae069c65ae1f7471d41835b7b7f18513bb316fdb0662b280e892083c5e6032012103cec48e102fe0a049ebc494ddd3d14d3792b6735516ad9b50297c4733a17b90d5ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c10c0000006a47304402205e30558218a9e2de55a0c2c60fc64f63f79d6cd9f3755d04b7b2059cea909cb5022045ae6c4d510ab2bd2b36c0fb1b26849ce4aee47c68ded194adb2713752cf46d1012103ad415589158489b4849f08a35d5232ab97b8af419f54a51293eacaa207f1255fffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1140000006a47304402207d0e11f83485cb2e11872e112dd9ebe3bf915e80dbf7fd32dae074b40746046d022068fda22c86fdd9221ae00ee47da62511dc4c4c1aa06b3fca3800f088b90756fe01210319587887e9c21c023db40d7fd0bcfc1acbaed6796d02c1d6e66a31d0adebaa16ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1160000006b483045022100c25b07d519298d806e2144113a123ee190d6500223226363dfc5a4f194157c2d02207515d1538d54f66a197dbdec6868d035d41080944cd83c654250ad97efa6a2aa012102cbc5aba426b7bc5ffb99f5c3dceb94a6aec3e538b745cf2ade901614831f660cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11a0000006a47304402204b583ab90021b1114c79234a0c2f808724ba758e7eecc264ca6267c5544a60a002206584514632f12f4d2ce46683acdacbfd9d80242f522a2d037441352c29bbe1ca012103dbe7ba93d1eb0dc93928d2f6ce4e8a58786c5a713db103041f08001bdf6fb10cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11b0000006b483045022100843a6ebeec93c84e1a7024818a549fd8a81fe84f508c6f8db826969f6831d431022057c163146db80b195ace0ca7db23281f80ad82255e3277bf17c60a501321f6d3012103f96fd1a1f4db52fc0457a3d13be145d0a6f332d4e70ad776a08522d749dba056ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11e0000006a47304402206033b437f9eaed1d69b525249b99c1fde9b08a230d877f08d9ed1bb0937ac53e022006583b02855dfd2f0758263f3e15cc8db2950267b1140132c49f4b2f063482d901210355de154c8c1798416b3a9ad0a253c3b6ac8cf3f86744f3116a5a024f8776a0b3ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1260000006b483045022100b7c8006e9ef1a5388a03f4515559c7be9d4a3523a872beb859bd04f3d1c094a902204a1a77c44d4dd31406c1b5a4a0c47ec7d6a8229f9dceee04ffadd5c6cf682f2a012102134f3dd1d9aa169e979cfc942b4acf53f98f9eebd6035274e63a26488ee18481ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c12a0000006b48304502210080bd1b73bc7d89b162e759832cf34e4ff19f859338d245fdc0be2b082f39c69e02207b93a46e8ee07f28e0617b6376c5657119cdfad9bc1c6365493adc7ac91398a5012103e5c650c07667218e554028e18c0ffea102484ad04ddb1840e5a8b1330dcdf97affffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c12b0000006b483045022100f85e9ed8178cc1197ebb4b35f391e698ed19a1ced00737f4e4069888dc3e2f8d02202eec34d757281cca45433ec7f3ccf1477ec52fa601e6196f074e76b61e9c64150121029d73cd3df300cc294c5e08f354ab262e75f33e2cafd0f0c5fe9d640b5aeef2b1ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1310000006a473044022072b09fafaeebfe781e3a15524dac07146624d7677a162d4bb506077ae2c349a402203bd79dce9df9bdb2331bb084f3170ef43427bffabbd78a40bf9a0daeb60f4fce0121031381cb42f1d3adcf86e68d1f293189b11390543b91ca52e8dceaa03f9b30fb0effffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1350000006a47304402203a693560347b2ffbda244b509b03f1e8c8cdd9a3a24ce49fe8d5a340a6263ca802205d6db80a6d2569e6d3a611f056fc2c6ee557f5cb21aac34a0dd28ff12d7c18a40121032aa3ecfcfa7a4240529f51d0ef4101164b4986c156f82f74426e7aedc9196beeffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1380000006a4730440220780114e1a5cfb1d0d438e6b749da50a71f72448d96f7db63f637a55d4e7d323c02203a7c9735335711a506902067493be57b64b5d94b1ed2a6c97253c70701acbf82012102f9b763a3b03e3a2efd7861ce9863c32e863e919e96573c923581e8f64fcd495cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1460000006a473044022048dfdca6c8d4388167141b9e66952ab7aa9bc84975ca9871d2439d0cbf32a2cd02207777703ccd32aee6c7fcea7fe737ceffd3ebe1a2c5f8c5e240da6436d89d3a0c01210243a7aca40e7cdecfca37b1166207c581a3fce3d19374a4d3b8476ad6d1c70681ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1480000006a473044022051306324185a84f72dc97c72505739d9397781134c16bee0bd677779a3d42038022051b351286993c783accac0ec07a983e7f4a54c5299e9505d05e4228bc9aa6ce30121025ea8074d10f85c04eef3b63930923fcbb122a5c9dfdbf41a56b47e91b3473c62ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c14d0000006a47304402207045360fdd9c9dd44bd4c2bd82bd845fc50c561dcde952fc9b671909ee180d93022063fa229ea02da39b564876efd4475e2b90f1241d096abf92a03979f75055177501210294a8388e3dae50e5270bbcc5d216e2436640ae94e79f72e11369581dac0ee8ebffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c14e0000006a473044022076ba9aeec5c747ca6d4e110d2874100bb09b6fa79dc2d1a7477186971358bb62022005a30b40fb4dde5c0c32b8009c01ee8381cd709fdc6966a62cc0b5fed44d54de0121026cb924cbcc18026ad8a1863a0ba8e138421ee71d94b1209b3fbe80f3ade72095ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1510000006b483045022100a5df0ab8703d3ee32fa5d9ff2e5bf6532a2c88069cd49e1f8104f7371f93403e02203bc72f5e763406e3d5a2431f46c73c24b7b90cae435186e6118dfe07f6a4b0a501210240f55a69fe7db3396c0527e192be91e194ab10fd66540e77edca56cdfba8b1dbffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1520000006b483045022100b47b3f57485805b68b588a71e926150f781934eb03fa03e820d5d6352edfc75b02200460e42c19d41056a5fd609c5be852cd24cfc2e1bbffde82d3ab7074ce32a336012103c3ad46bdb26dc757802c7fcf7ec3ad7c2d80c798371314a0b18cd7116ed8e79cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1540000006b483045022100d43332fddb8939cdc4bcc18f2aaa708a49617b8dee4ac192b02f268731c4028f02207e7136b3611dd6fabdc23da7df847b00427bb4de75b5d7fd78a24b3b0fd42490012103154ae5898aa507a8b85734bc65e55a05f8ef7403b5eb930d2b10c6baaeae5bfaffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1560000006a47304402205cb847fea5f862fbaa3eb029fb66a7c2169f034a7609b43b85d963f8a42c053c02205c5b15ee1ea0a04dc7967a155501701cc4491ccbfab121589b03e3d74ab42da70121033f10a61831dcba9c5a55a79d7e4889a24f71e2bd65f34ce770ec07654fe9c5c6ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16b0000006a4730440220085045b614c0a88a793a23d1896f1cb4ecbe0f99a690a9a5f5265c4d39effaf8022055c98ce76470351a17848cd8c7eddd588b17ac79fff41214de315bde5fa8cab501210254e690cb1831c658615c1eb7619d37baa29261662d643a0346019186edd5e8e8ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16e000000694630430220449129beeb6eb697147309bda4503bcd54cfdf40c16adacf362c0a3982005851021f759ad3a2062961de9039021fe544ae6dfd26fd823558b8aff3c03982cad8bb01210381e1b57ebcdb3b56c0da96dd3f40c4809533f3949d00740175af286551fd39e5ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16f0000006a4730440220791daab85a89c37bdfc66800cc0aa8f301d1d0e074efeb22d953db7ea4d6e051022064a53999ddcf17140eaeca5b6281e871d35158c51634b5705d551ae128669d6f0121037229e6a626c5643a8775db71891525f555ef31dd5e17faa2f1f359875c25dfdcffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1700000006a47304402206f903ddde3fd2229d0bd46da2e93d081c92496530bc797934a89365f716940fa02205ee7f7789a5756f15382f0ab6ad5930c429205e81d27be3662dd4d478f6f97ab01210257ef3ad11cdfdd5206252442bcb4a3c8bb6aa5c333e9292d28a6b08acd627c68ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c17e0000006b4830450221008e99d744660ae4ee80d61f3e289b6152717ae18c186741fbb5871d6e8c602ba102200a49efaf0264d612cb280d3228005ca4226c693c8651dd82ccc99353c6f56ca101210275f3d5d97e27c20ec966c8b3915802dab7d9fcf9aac1054de04eb4349ee23800ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1840000006b483045022100d0424db7363d25d79d94b39ad46932e85c59db92bc7d69bccc54bce100270ad302200a56e8aadba19c1d826cbe04f5ab6ba9936b276fb1940f934bf6d0123d4c1142012103bdfbdfea12ccbf3f46026490bf9ae6d6f179e08523edef0c65a2842366f83b9fffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1870000006a473044022057a783d20b70cdb2cbfbb567da26ffa725bc127994b964bcc7882a454c5f222002201834c10a2b8673457dba323f96fc489acf754ae9e7870ba4b3a968fabc617cc7012102de203808d960a70c9c03fb19b8b454f5b39bf2db7e539b329aee1a224dc10c30ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1a20000006b483045022100eeb03c49d146f9562a3e1b71ddb5a3e67a623ee426f9388ca3c48f9af64edaef022078c5670fcdb07157ccfcbe96a9c3cb8a5716bd6041ad2d882b4e2c8d994199f201210244b5dc8420f26953076388f782a00cd4a5e7f8459fbe010e07e46209e2e16d46ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1a80000006a473044022052b259d0a727b435292de04e0e5e3934e220ff0795e6431223eaf2bb4a029e8102203bd8f0965fcdeaf61d1eb0cb5dd8b915baa564aaf8f6123c0872e87d024f1ce7012103ad0ea873e25c5df4784476028a1b9712b488fd43f3d1328a78b6087251b148d8ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1ac0000006b483045022100a39e46811b1e3155a7591191ffef7a1f71119767564d3da0bc86fd2bdfd89d9d02202704758039b9b8b44882cda103d04d81fcda07166844bab9c155609351c1209a012102383c6cf9f6f16dcb47445d984395f04b1a41ddd42cc66d0aa1b40b2a685d43b2ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1b30000006b483045022100c445164a1e32975beba08880f10f3579b3f43a1f4a994a183a2ba517de03d2e502206480f1c5a629ed1172d3f830f1dd2e99e501b6bc422bc0405b45d6f7b812a73d012102da7da607a3d5689f3b548b84158cd7d01b6a3d06ce46e21d30a89f2ae3b38d3bffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1bc0000006a47304402205584beb0b3396b2e500d9b1b36a4a4a70d870a047629eeef9155d4701423a94f0220252ebec6fedab9c85a52b26bdab1d555fcbca9cb964366ae03cd717013f3abe2012103a841b267fbd3eaa91bd3cfafb1e825bc3ce407aaec3dcf141c3a7f3ba73b85a0ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1c10000006b483045022100d28f4547be7d4bf9a542f02215689ecf6ccc92819416828f15ddbdff6c8bd44302205a3c58569507c10eeeb772411d5ae70235b94e2a969ca3e44aaf395d7d8740c8012102f8c0685818898b45bab049f8a425553ca599649058bcf93f4bd9be88e2f70d68ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d60000006a47304402200814800f4e931a46e5992ffd6b8bfef5c801862287d1c41c4ad4dc2723fccf3a022005744606cb083b5af3b10f85367bb5014ccf9d9054eaca427c8c26bfb4afe90f012103be185088cee0178a35d7d9341fc759408cf97ac2735bb05fcfbf6884b1548e68ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1da0000006b483045022100ab5de2d01a7e345ff79eb6000b25e017a690b98a5b5267514c594fcaeeeeeb9c02203532baac3b2a93cb6aae13c9d2da6434a442d21d4b61f003b7fee0f2aec7a17b012102ab574812cea5df5f4ccb2bc7cb6a2ee3ff9188213cb664db475b749cb0991283ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1e60000006b483045022100f260eedda49b27f03f7e49f255936eadaa8207554f9c461adeffabffaf71b146022072a0cf027cd2466e63475dff2f454d7181656c1710cde87b4f713164b1902f1b012103c98ba4248f4a629155630c476814dbe4d51eb5670e728c8e4325a114951b9feaffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1ef0000006a4730440220713b7a56314d8528f41d7d1b2587335f5fea69b8713eb3748de7fa4763d1333c022072c3974b293ea92f9a95a5d8eeeea5053c40fb54d681398a4b4dd924d5a75f4201210290297b638a0a815a09ee946947567946ce8d40ad4ca4b814e42d4b86d64e5161ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1f30000006a473044022023848ce5ec8185a7399c8c1790dfa15adf617af23c207091498faad353516b3202200d0bba502ce4253f7bca5fce44ff1791c068da0fffaf756b907b3be50acef16c01210201a71c6842cbee9ff2e7c0aecf1042ce5d30103f4f73d8ef35447ba56fa78430ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1f60000006a47304402204f70057f1b142bb52097127782cbdde144c00045650e7280d906ab93d881a41c02200fa1f37648d9df168d28872618908a7fa4dc39de7745d80beb5e9386357d8c670121034e7dc9404e4663f804876b10ac0a7c67d5e5bf69042c155fe64c65ee255b0c37ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1fc0000006a47304402204d849d3f2a32b257f606b713fd655c409d7d504a2d91c724ebc30e55c564d7560220292d49489ccc115c1109e450930e0e9d98219ad631796a81fa6eec6dea8048c30121025830212d902083c9426c82faf3d87a2795420890c03e98190b091ea2f86cad59ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1fd0000006a47304402204c46627c53cf4ce553e27fd12b569a991a6358eb202ff9b13a8e12bbc5959d8002203e5b608b05451f9131de70dbac159f516c7510eadbcce56a57a2bc23d1d7065d012103b86eec845d655828ce9dc6238aa912c4c66567cb1ff8e301fbcf5c5cac889ae6ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1fe0000006b4830450221008d10e50561f19f1b2bc7aafaac9111a6dd707efd8a092a1dae9118e45b743a0a02206ab8a588881cd446df171c8ec2c0d4bd14c0d670750928a0c2a64164260bcc350121027375441fa3ede1ac7a84778934aa509bd445fefb207609420c34af415c016ff6ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1010100006b483045022100d4235e80da9c8c59f0ed10c80c5dda053cbd230f99a663b5ef845ad26399feef02200e11adee8d75ed0e9263eb234ee8ad4ae3258e1b4c0cd3c42e5b109ab2dd6507012102df66553dd06d7331d250d82c7516d0462bc7f6c0a0a5e96351eb7d3d5decab21ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c10a0100006a47304402200f1e1e7afd45f2332be4846d7324ff84781ad833946eab93f79c0cb79d5c59c8022046308a18e592ec3b42d72df8fe352e697e2aa22c3b90300f5b6c174144d89f61012102f3018b097fb866dae7a8c5489421ac92bb977be9c0b3a5f165c423859b0984bbffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c10c0100006b483045022100d7e544f3805719ffcfad7e4a7a4a1b54fee6795bf1d26b0b65e8d0972e53fdd5022005cd9336bfe305cdf92dd5a2eae29b61b7779e6ec100073d08c67691d938b85c012102a48b5b01a33b59a2a3eadf23d108ce1ca951ab4d5bc81c4e87c7284f70e28e48ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c10e0100006b483045022100861da85671b0c175dfd9ca8597c08462647053db7d43066c26693d87ff63f36c02202ceef07bd6e8b24ede21d7b9323716599fc96061d898dbc8cebae698296f2ca8012102b944e9570267305e26e166d0e782432bc5145c60d9b399eacff1b1b05497ace5ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c10f0100006b483045022100921cca5c7093879de45e06394e868176eeb82f82d50ba9ec1e0033fd27b5fd3802204720d7118edb84192f86fadde7812f371ca65d655a265ce575d27d2dbb7c9861012102178c8a3273c867bd874609bfbe96839bee20545eaaf07e9ff89777d2817f1cebffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1110100006b483045022100e7e7b5053768a8db37c2866c77f41eaca267ea91a35d1d8d8c9fab9fb80d5ff90220319f65acc061f2cbb4e7c003af9c635dfbc5031d91972768a5ae8f2027e8cafd01210395fda29e25b649eb29f8ff2c5553a494ef95093cf746a8b229826a1de3361daaffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1120100006b483045022100a56ed9e4f0c3851ab1070bed261761126800179d8360b555225fa38fb900842902204bd095ebe85b2d12ca4dea2e94394d1064b251b884adb2d0c6858333b64146500121028e1b5a54a6a54245bf21f0848d672d3f688d11e9328f944365b146e38efb4bffffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1130100006b483045022100eb5e4152e99af6dd5f42b7f6ac22882748f024263d4f391ec4ff6ad577c3443002207a4a57b7eb8537aa75e342fc2f5e43c2ed943e188188b299132aa50026a4e06a0121023ede75e5bc13b2103eb0d3c8c7dfb60b6c7b810f49ce005a55ae4b7d0eb1f658ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1140100006b483045022100c36c26937afcfae4f40a0ad928712715d43582799bf6b8bcd6594e20b34802f7022077b83f2ce8440dd7df61632615d66af4c8dcd422e2f122ab98a01878124fa5f6012102c059b935facfa01366100691c91328659bbdb885e3c802467cacd44e92bea4cdffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1190100006a47304402200bb4881eee4fc55e254fad94c67442dc8fc2f421acabb80d0e86ab6c3a74309c022060c1e4e4a141ee3133736165fcffb50413866713a1d4bf01fbabf3f0a5f67cbb0121036b80696a61486e2fe3bdfea251522ff9e66eb66a4c5162fdf60ac6c833ea90d4ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11a0100006a47304402205e54387f30877b358fbfcea2d0eec5af1d4e573d81a072795c0a085ef72930d1022078717ec3adb219af592d17d981ac0f4d2c055f8bd4b32c22ad951a2e19c2e8b40121035619b45c3b340326aef6829d231c44907d48f1e9a9c79f2ad67bfbac67391755ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11b0100006b483045022100e5f0dd15f2da589e52c26cb96455269d4d3d7317e0f4ac5106b2f2f9965ad54e02205336d9686d2f1ad47c7e712e24b064e365bb977eed6d68ed8d87e79fcc288aa4012103a1cdaec2cb6677a444b56fb6f4c7dfdad2f16e0e83da9d08bc0ab837d44ca694ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11c0100006a473044022014669f8b19daabe1e9c6e7c97dd3f9e8e1260b45e543110e229c4ac2df7d0a3202206b44929e72e8097388c38a154fbbf47f213838c446b3cefb6d1ad9990744f7940121030d170f347bc5ed046ce73ccf1a60d017ae7cee5f7254104bac52dd0de19ad91dffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1240100006a473044022011cf1d95fce0cae6d692cbe96527e73e78295edc21ac05a80d1140cb6a8bef2602204385a2586735d35bcca6438afff35e48ceb9489be857e342452097e098928754012102cd0581d13ebd3d022a63c8d86140e52bccf1b454f824ab7fefdfd6a338c0a4a7ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1250100006b483045022100a0429b5e1577cd8e80a7aeea28317e348175723bc32440e8e104eb4adcae9c4702200edc7c39f7747dbe44ed29838bf25bcdc7e8e2826346cb55d56db8e90c54594e0121020d934c98a189f626654c773dcb53de3de5690b48f0fc64ad92b25f8d08e9015fffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1260100006a47304402204023db73553e1cb230d304ce893f408c2997b08767bfc5b831fd0138c499c4e0022078522c39530867bc8d7d53927b0a37107d36664f023781be79ad28880e8e95f2012102812793e164e39f5631e622575caaa9cac7bf43737f7f95302280566b8c7f31aeffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1270100006b4830450221008d55f32d80e593826162f59cc290e38d98268879b5eafeeefd78cc177b1a89a002203ed550ba71a006389458fd12a7f440aff31df0b388ee00ca27c04ed436ecb6af012103a52b0909c010f6df76c29f4e53ce078884d7a0edb027d3a680cf1ff2106ec18affffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1280100006a473044022068adbbcbc81e989b5684ae88f758d2fd17a2b0c58781fe956b2aea3b232284660220561d1725741ba4ace25906d21e203111aeb31c79dcdcacddc7460d2f588f71bf012102dbd4392d0aa21a4ed840662efba31af122eb1469ae9a02c4c2f83a5c8095a7f3ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1290100006a47304402207a0c11df27f422bfed97dd1d245057402708f6155697702296ff55ea31a2d757022069172e61307badaa12e341d224a867e3319e4aa6d9760a1f588df7a5241a68ec01210360e66e446a61398bc9232016e6a2f34e5c26f362479398702acd988ce66807f1ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1320100006a473044022040dcde34453812617c17211b377be1487a67ab5bbe791187e76ac55784c26aea02204c9b2fdd516436285524e7c1e5e36913ada279d16bc3d22496fbf16ae37e4e4c012103771ab78fab9c924f56d9bed1f4567ca8eaa7b84958575f7724d1b8949ceb2d36ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1330100006a473044022016d9389cfac10f2fa72ea449609909ce7c094f89e72c96dfdf0d71ece091e5f8022039bcb2c5231034c3feebf78b79297ee505a484722ebbb1293a8c1a41fb5689680121029c3a25dc611d682d85bd00a5104a920092865e1ff4ad3bd2de36b4832ac374cfffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1340100006a473044022045f4e7457cce177cdf5b6113647c1c9eb16ec6a5a7ef947b44f71695d5c510ff02206ca62fe434a06e469ec392ccaf68ca333fafbf1f0c9de14269e76487eae80f5a012102c686a2956d0d18adeb6af37438ef2392a7e1b0c070d253212d333013500c408affffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1360100006a4730440220793d34fff42b616bf53f9ff8bb8d27bb69598a8964b2312d5c6f878be539e33302201baf5b3ed160ef3879825e9ad2bbe39cd2620c363a685a2ccbe4b213368819520121039c596113a41cfd570dcd458350e7370af3986daa6e3953a1b5f6c4d9bd3114abffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c15c0100006a47304402207e52360bfeaae3173266e7a808c5e7ca770a5cf3f2b25b549f652a061344a10202201d44b1a75a19743a51fe49ac0f5ff822b7b97f05e5940d129e41b04d9eb12ddb0121021d6d6d74787f56298827ba2de6b362ed728437b43636605185bd2c7d38b7a2c6ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c15d0100006a47304402207c0b6d0f79c00ae00ca763c5b3bcfb8f0f4dada2f28f12c19a23b56459f6987d022044d97882c3af733e68a17575c617850c1cc6ec93ad703140f84dabc99b477c25012103b85351a7b2041a50095248f463f53e82bf504063491099fdc3b0c9a83190bf8fffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c15f0100006a47304402200c238b48948ae5254c72bbc5f9980d6f78c6411c63a952f783f871070c4ebdb502204590781da41c8207df5689360644253908edb9169cb052692df4ccd9cc1cf46501210209af668e09809496c4acee142dece9a37ad00839805a6769376a18f60a3a8bb3ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1640100006b483045022100c698c263e1b40b5bbbed6f3a619af92ccc9bd3af5a39a1b8cdd148f2429ceef202203a37aa84af3a5c0dc0e0b583f111ef78ad3c37ab80371ba27edfd4a848bf57c40121030df38f26078d2072ae8c53866fcfce2398fbb3d1b39ae3ad0f79eb77de9facadffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1660100006a47304402202fb63395b7e996c618015cae5a1971cef6614b73e9f3a321f9daa727c6a1a95102203c1eb0ab003436e3b4d7c9a959d6d6affa5dc6440ed7871607a2e14e7e5bcdd30121022bccd2c3fe9a40ab0c9e6ae7cd4555920281bce457120b58a62f237a770f35a0ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1680100006a4730440220326370ca79173884eaab15f5cc9254b673c6c598260668aee5cc34cc1f5f4c9d02205a2abf73b8f401be110719a34c4f4d8244896f1919e8b030cd7aa11f23debfbf012103563639e27c2df8e945bfac8bed17d2f0320ead623aa358c251ac00f83e833dc7ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16b0100006b483045022100d68f87f24772d287d9daa82728a092c0ba0f3eacc7e4e5a839a242e619136abf02203434f2aabe1b6335448342662bc4a4ad8575bba36e6dcbd54edc0d01b13d7297012103e9ae7c902f748221a9bc6dc13dd3894c4160c7d821e6c7acce0560e92cff231affffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16d0100006b483045022100d186b892201252aae37849971a29980d1f7d91bccac00ffe561ed836272738ea022070629d0257acb9d21d44f109bea479188f22ece0f3f2da617f41145cf411b556012103c357a607dfbed1b44707ac9abbc0b67b515a3369a10748dc3c5164336a4072ceffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16e0100006b483045022100a301dd8f780545ba68d7615a447210482dc64eb920d88c02a534e2bf267d12a00220166f0418ede111363814c147cece1681ab21973b7e4bb6511f7ec3d4f7c87b540121030b8d0dce74c5e9ef271e8e1882729ee0a272d0daeca7fade9c47413a30b6861fffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16f0100006a473044022076e277afdf7cbd3af104116935edfcac34ccb56057f83bfbe9fd053f57f4ea4902200810a644d1f0f06eebf67723b62f0bea2e80469057497e5b68153acdcf5c0779012102207ef56f0c83b6d2fdf865cfc9c8398a0e91d5ed6fbfdf5fb8607f1050fadc44ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1710100006b483045022100f9321e8653cdb00782ce4786c743f1bd77fcc3565d4776c10baccd49dfaca93f022072a1f854351fa4e4cfdb77f655172b1205a862228d39c00b027c9a7e93c7a48e012103561b995e7c0bef58f05c78d6debf651b47596fa8642791cb87256d46bdd15a55ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1720100006a47304402200feee05210cfc4dbc0f3bd7f7dd7b1c2c635c2fdbc372d2f36ae9ea266bf216302201e35c025dc26f0e112214921bfc82696767f7d97e82067ca288c41ffe4cbdb40012102e79e860ef42ad0f30a2f347b4c06dbe0d82a36ce559fa65044a7fc033372105dffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1740100006a4730440220232103647230a1e5dcae5fe4ba1abf81b2fdd4b50cf078c8468e2df6f4d24a1202207db933d6441b0e2f4db35af53bc59e1215b35b7c14706d8c7d2f4b4627ff8db5012103cc1cb2bfb5a8610d0b253b93f9bd07c2bde18e387b149f2947b753b36566c511ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1750100006b483045022100c8dcaa349c76ad8e9ae0a80851938dc5e866d1a8bce653661e8aaf6fddc83df9022032e73f147b77fe6b9f901809f8090c37be4cfab701eb911ce20dec54864b5030012102001c8add5f438e5bb88384cb5a0636eef778de49c72ebebb820d60ec450c72f3ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1760100006a473044022024d5ce69fcd58219ab80ae61331d10339a69b45176c1fd077b9455b6532997920220146cbfb6b989f754b52aa6b3b6863d290dd455aab7d594b9e85d2e33e44735da012103ff89a25c084b465f1c5d854078ceddd639920e4a06b1ac84dc033fee257752c3ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c17c0100006a47304402207487ace7f49476c32429c0819c95eecb2856313240a1fc409146d297899fef4e0220746cb7ce7d8c5773dd3afbb9d8d36b5225b1f3e6a720eab6467cc5069ea5541101210265d1581eb36fb426a10567e42a77c021f054af9baca4bc20cca40c4d7e7a6b72ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1800100006b483045022100860ad1fc2b92937080c9615405b8a11bd3ae2b37b2f5d8c14588e43730c77a1202203c1184bb3a112c107f1f1decb5ff7c2e0ae31c3b591039be61e028932a621b0b012103ec9213e95d4f572091411c9e7451deb5df05c3f2400015c69336d453446edf8cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1950100006a473044022015458b01c46adff34da2313a67069c9c1533608e83a68fb11dc094a413f3bda402205740331af5fae271efd7be64ae0c24e69b6c864900a6c373409b721c598a4eae01210360c328e5bf3421491d2bbcd68819e4646163a526916f74ebd0675673fe82454cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1a00100006b483045022100c3c6e55c4025f8338c30ad6581250e41ed82b4ed1124e26802daf36e280fa7f602201e999e26e3dd3ac67227dc2a26f6c2ed90188b84039e282ce649d366e5b61a36012102de3bb7d8edcc2e5cba3d9850c5691d91a322e2888fb6f111351420320501c7b2ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1ad0100006a47304402204b720ed603fbb7fb0a8dc371f9170356fef1161bdbe5dc6ae889edc00ea65b5a02207b2423b8c0f226449abbaabb86bfccef1d28cfb2074e17e876cfa063997ff1130121035983a0bb2f97c118c75867afa075c44cbc81f8b448c00243a6297724e75dd793ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1b80100006b483045022100db246ef1d851733fe1f567357304164f1014724f2c8e485da0e10086774ef09702205e5866f0b3e5a82e7d32dc5358f29934cd0ac7a07e7353f3cfe0d1a8db45ed54012103783e97757e436c200c24647d6dfc414bdd4d6f859562c5fbf3d57fea7e24dcf8ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1ba0100006a473044022021389dbd672f0f893d0b7bc4559357fd3d11e46ed0db9b38dab8d005e82b994d02202fe086ac26d12e6842982f9653553187b9af48d6b1db3f4efb38d9c331613a86012103ba0be2c463e5b5d894f771f899811862b765d09c735fc16eadd9c2ef97030851ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1bc0100006b483045022100d55f97b555c5064e6e8902e8e1802b918f6755ac0909dde8ec2ebb81992cd13702204aada200f3bacdcc800609e33d4b4164951da0f463e6ba0c11797612ba83eef50121039a467d42aa858bb84b7115483e4aaa32a033b7bbc04969b1b283fe1eeda525afffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1bf0100006b483045022100da28401d08c132142b96a330b96aa9dc2b4d994b3276d4acea2d5ce645d2618502200561adf94be34b23fe59363858752e0dd0548118f1b0e20bcc6509b0f9482cbc012103bda66744af00c2926e8a9fe7d4e4b10b44978e31b6c1c621a2dd2192ea1cdc89ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d00100006a473044022057ea948e707dea3d86eaf12eefe16bad4923448478389b44fae09ef0988bd1ad022037a2a9d83f6cdf079fe31291f13085d5a209aceff48146f29c277600a63ed076012102ed801ac57a9715ea9d33bae10cf77e955e97d3eb8ec3e0610b2e1618aea49743ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d20100006b483045022100c8d05c1ec13543217056e91f658d2d69ef2261e1a96346bdddc618dfa9bf634b022020022c382c6f2dbf51aa3249d03b406742b115c31a833ea7822977cfaca0e7f20121035c7cc3e6bfce86040d9133c267210955e6b85537eacd0634e5f10aabc1bdd017ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1dc0100006b4830450221008c42775f4e2ce3c3394c33030f3a25a64888776bd28a56bab8773e283da24b0e0220272b6ae63f1010080142c9282a617ef00276194859444d2db717f8bf0c8e2ff501210367285ed00b1ea1c032beb9515c6ccde95b57965c483871b83cccdb58c20857fdffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1dd0100006b483045022100849109c514040b23c75d81bed0585d316c0a2dde3d8926621792a3f6a6a59f3f022074cfb8eb92a2517d026c8253351c28d29e95350a886361ab3a29fe7e96139bd1012103966efefa3922def76bcb9c9da9ca320ff071df2253a95e554e88f0a43dbd1af5ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1df0100006b483045022100f5ed0d3c85aa5ffd649a8a8087982289e7010357789e945428c6c4b269e4654e02201260a7eb8fc1b02c6de2b144463927afb4e3c87fc0c65a6d43d1625e40895a2c01210281d386c40c59fb1ef1881f1b84bcc92427b8536ab222c52235bae910c9285dacffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1e40100006a473044022056b14b482e057b70b89003edadc9fc9a9ccb4e89017fc42d2e4ed1926902a84002203b1be778de305d62f03bf5b22bf80ca30fe66bd2073f15998ee3cd3ceab4cceb012102ff192b32ceb6ca7c147da931b3886549e18ec1d47a482ce5375235458d479a5effffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1e50100006a4730440220243de4b91d94bebac601f72fb64a89b5e541d628a5944817624ec04905d3098e02207ff99fe167804fbcaab1d56628b72faaa2c7e3e1fe0dd05f9a01c1d368a066f9012102a5c4276fb5e2b3218fc67f5c3fd87bfc9fc75f12bc0e8fb6ad1c50a6df0009eaffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1eb0100006a4730440220502bbae45580b9a5166cb4a1be1a6d7c02af0579d8ae74d46894c6a13d191aa202200b3ac854054a1f17414eac57a710d19d5a93d41d0e9bd12584c7374d077fc2b70121024f467b75f6c16df2f8239406df5646651b6be9e9f50b504b60ae9a1209a1e993ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1ee0100006b483045022100a55afab22a2d9931970e0cc320e3ab9cee62f3ca47a8adc4923b0ee9b144f01802204182cf9c8272e6a9fe3e58c4632f75a37fc3e82bea741003fa096aa3183182080121023a186f3c944d8349cd144d419f2f043eebcf260f5cf06557d87a11b731c0e76cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1f20100006b483045022100f9e3d0bbc090c85f2510f346b6dbd76af2f9be724768c3854b7f0ee9c1fa4eb102202c9a6abe8581e308dcaf1a714c93984fa94e48f85ba2149a17f13087abd725c8012102fda3f6006fffb7975d967c5b473fa64b712ae2b469095b3cfec51eb70d665204ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1f30100006b4830450221008a53b245e639f2d6aef246709156a30f546d9e3a91e9359c5d4cb9f3eb80b3c202205f2db7f30bb163243825281a0f57340f0b768c029a44787c8ca83a9b26bd01200121035d9ce97541161d79ba3346e6c755cef41cc110b2fa78a658c349b3ba8e7ddbe1ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1f80100006b483045022100c53db2e6181df4b401c79e3ccb97358121dfaea7fbde135db1e1c15f7649ba6b0220753f38bb138baaa5ae2d8bba4a5d36fd55120b17a2471694969b1dded9e61b730121028ac506e0e8d1a686e602f6ab99fcf9db7d91f10d9f677f67fd5e3f2f273b167fffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1030200006b483045022100be20c7168865b2b8c53f452b112643415963ec2628b3115c26e94310d6ffdd2d02204165e6f64532a35a77a8b712541fbe4e32b240d815a9782806a994c5dc195d8f012103fdd7c5ed26ba61578966971b16eba7a3864044610a345b54bde3987184fb2ca8ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1190200006b483045022100e4a31fd6b7622848ff706a3c02a6f1e06433e917887638e904b6dc55f04e617102206e513e2af1634ff2c959df22cf622b403b9379f055452ef8a36070523370515f012103628f06885c53e23474d28cd2610288270d191923617b0856e9e0bff0a807aeb8ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c11b0200006a47304402201db8da5f70a05b7daf6bcfbd742cce7b6bedc1bfbf9c467d4ee220f2ba3fd07502207b1926a925c0f5d60e7a0d1bab7a0cd8f3dab5108bd50e7114740b8079203dfc012102e55506f1a590c2ab666ac1ee6a4867d29d5d5e51df33272e78d5e8cc0c805373ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1270200006a47304402207231aa4d05e65edf095e4c5f4ff545e9a083a549b98d217b40a552ee90f445e302205a6a26ecb8934140f5068074b21965616203e0791f2c784924c1ddef19a9da6201210221c7ab81dbf119a938f75adab81d255c60bde3836b7c7707ee9a7bdd301e80b5ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1280200006a4730440220789b372f1ad5a63e97ffc30cff76d758c9a05961bc4e4260d85c66642b6ba1bb02205c66855819f78af7257b4772e9c7d27f344dfda87982877bfbee590b35c3aa84012103c08c0d0d0e4715e37f3f434e06fc3634a820e9dbb7db953efa1fa2b707ddd61bffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1290200006b483045022100c0be199a0cdb2dbc6f9e52f1a52068adb7565332af7447f9fc22417a4662a76b022019ce6043d0b72e429e3d7ab48416d1e3e1505c83cb44f8fde10bf21621ac43e2012102407e47a6ad48d7be1d7769a0825e1c80da8c6e138d4a3244d02b82c86b134b73ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c12b0200006b4830450221009d74913022239d6f4b700d43a3c2098075991168de7c69240fc5db51f82b550802200223e44184e664e6258a3b25e81897a4c71da2cedf85c12e4c4c6b554407c911012102acbb90364ef941aa87dd5364e8bb3f15a88203c1ab377566825fd747e0aa6cacffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c12d0200006b483045022100ab0103e735f39f93dd8d1cd844ee98b4eaa17b29dcac2d968904074c3df5ce2902200b8290665fa178e26f057582c17032b1aee584f2f4288bf41fabfd6b78d37208012103235173889e3df92f2bf3cf88b52fbadd58211cb3df76b9cb5f5f7046f2500301ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c12e0200006b4830450221009fd5ae1aa33964e5f9cb4179373a3937b712f2645c8cc4ecc6e9c867c5898754022058ea415c52cb550abf515d05a8edeb09ddc6e5593093d35e8748f19db4f11f4f012103c017e13a66a2fbb5773eb8c158fd91d87d51398ee06058d52874555e24d90439ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1340200006a47304402205215e412351ae943b95161e9a9b2c6f471abf7b1002604d4bc6455f64500b4d002202629325596d78f14279277392e3d02f8ea195f5efe7aece2c4d1c728aec765dc0121029d46352f694824dfcc800fb6781602a527d7ed003be2d6b1d64c8e6eef50df7affffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1360200006a47304402200256fcb3d766d4b74ae66b46710e321b4778f9532823b778863201f396e6688a0220049967c904dde6af5f38d659741f524680a89d164e1fd5a3beab580dcbf4507f012102765b7ef38aa3489505eb3927828dd8923aa0525d117a7ae20b1f59f96df0c7b1ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c15f0200006b483045022100866edb83dcff43cbe923d2d13c3dc4d320e0fd02c2277d44c0b3a99f8fd07527022031620880000c14c9450f92165f9a472c722afc97b4a2f248a2ef6abffdfc762301210261191a870744f836b3571a815a1b1ea13a7aa0ffacbf3d45943986ebe3768b8dffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1610200006a473044022051caaa02be3eaec5c4ddcf798a87925382d30f419b78fe988b6fb2993872e51802203ec0755e03ae821074c1b3297a0bdb8b5b1de6169e165b1c1d11714127e107a6012102e4562907fccfcf4b9a743e4715d5a9cc1ba203054c63a5f4d0ac660870d35ebfffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16d0200006b483045022100c67adb798d345237fc08b938c1a1ccc489846dfad538d0ad39981eed8504a3cb02202ea640592068c08ef55fe09b4f1cfd5764104b7cfa5bcf690cf5e1acd6b1d36f01210362ed038dbba6b24df044dd51557462b845547273183bbe3aa6c67c0cabf0ea4cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c16f0200006a4730440220767d431ce4646cb5e6ba4c29b3bd4a8d07f878272bd48b0600ec40c9a08e9d9f022041d543294659ed9e5e5a74c9e7745dacbe956aff0cfc0de9fdffa13e36dffc8a012103745777d16ff9d42b2d09eec3d5132c7a719764f1ffc215769ab6c7beab05181cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1700200006a47304402202e9b385df79d95668e1517024507f5967ce07dfddf420f63b7c5fa2960435e3302204898f0c107da783bedd2b3a2cd9212beac7ccbd14a5453156309481516154c3b012102b642f0057b3d76784e58d22088b8845f67e27eea8d9ca92b8f4fcfb23a0b16a1ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c17a0200006b483045022100f6d23136a92adc72a106b6524e80665b09af34d7d1d850bc4accd8be5963cea6022033bec0a03be7c42cea86bef491b3ae3466228e9cddb8e8567d2fa5de4306e7ee0121030f3468386c873a408e11fcc45534d6f8151b883f036f5f377eb79ad8b51bce56ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c17f0200006b48304502210083d075cde413642af7280886b056445615f1936da2e38b42abd9e2186710683802205981df2dad0940540f773c5e51b66a77cf740cb33d33f9356e12832769c3781301210229b48fcff732b7873b310126a69d54fae60ce316874d6c762ccc9e085f68841cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1810200006a47304402201bdf3f5ea0b4b7e6be3c6bc38f2e7ebe431426a1bdc1da4c0100dcfffe57c09f02204c585cb0d2588985ec1e82b7a79c93cbf1c86a8f28c054d841fc16c2c05efd75012102424ba81a01cb0b447a1458c5dbe7fc113adbe6ca5c53052ebd28752249493d8cffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1840200006a47304402206d6746a56ceb9d8cc5b36ab610cf7d58db9529da6f5f3eeec2665cbfd40b6d280220702182d024b8514c6c3a618d10be2bca52a4d637194eecaa42a9843d81552a3e012102d09c0636e4ef75d55f30e3ce8bfd0e15b8dad9f4125fc896269d8d94ccdcccbaffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c18e0200006a473044022006d85918f570198f86ed13374e5332e4816e183676eaf31d0a46d945b301f1b1022064d13f7021af415b835b7a70ab24af05fe1f1e4e168327edd245cfd154ea1c5e012102368b25c7524d1dcc32833d493cadd47cb44078f321fbbf0ce3ec4695c1f60f88ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1950200006a4730440220267fbaf726513478d1f5146da71c7c345a0aa15aa0350c06ddcfa8d68069cf490220453f6dbc8a0ffc78073a40e8db5fa1df6203824742c26ed0b8c5a8f18ce34b1c012102e177e59930592cf7f25ed9e65932249f4395e9088234a938aa9e8dd8fea737bbffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1b20200006a473044022067e3a5759cb8b59d734d79858039b62ac12b62965f3aff64a54852e43e17b0900220248436c0008e12193254a62a3108842f95972243dfce14bd4d95e5c602034889012102fef18983aeb87b4361a6d0df281dd301db5976bb29cdfa0f6eed403be5921941ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1bb0200006a47304402200dcafb80d9ffffefd5f73db3184d4d7fe09f29e89e04b081fe1d5eacfaf98d3002206868357ee66de526ae9572fbbfd564fba9b276da79b1011d5bf6ba5c082d16ae01210329030722d978a8f6da9f3f3d1e27ac87fd71ae0526ce122193dd184987e9c843ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1bd0200006b483045022100e2b32957e6c07bdbb52999069e58b939e734d0e3f44515366a3175249c015b57022014efe65a78004edb3782490336ec554085b555af814572df03adac484649e331012102373e53ce9f2bf9d2bf03a673096e5d5765d0f3ba47dbe2c6c47e89b053945b7dffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1bf0200006b483045022100fd07cede26bcc15221644053fbe40325ab099366c531d582eda989084bbaeea40220688f6776208625084293987941d68271bdfbe207aa4dba732733326b08a93c50012102bdca2c5703625f8a3a800d14cabb4b622dfe766e29cbc4e03f3e2faa227e4ceeffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d00200006b483045022100be9b2ec070fe903959a0cbfd1c1ef0de5768b01989c7aaa9821a6ef5e1e79eea022026ec2fc6b51b0b189434f619223d07e3b2ffc6eaa4fec751fefafa7d5a85e4cc01210217585e9d7a441b1a5cf6227bdb4249ab19d692920b3c400defbaf04ba3971106ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d20200006b483045022100a2038e751e69fa057e5ec349af69363bc0070c6ddd6eae299a29f8f64cd3c0670220475bb60545bd230940b2345b073695ea814f83d740a4f071260537fc31532075012102fcd18fe4278faafebc53b6da5660745d2f018def26e4ac1c23f055893256eb61ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d40200006b483045022100d7c7a4703f594d4bb4ef266cf109b61078e58c5f52e33866b21175d4e389ab3102201aa1d2c08f5e71e299368f18240088a8a1af242bc1ae2551bad79e856aa35a7b0121038347dc7409a829d9b7583c54132795c2fa4450bb21f109a14f523dcd54f316ceffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1d90200006a473044022022b9efad0130159aeeb0aaaf6be556bbca5c3b9e953add448207cd344856743c02207ab80178349832cb98a5776ceeb85f2556ebffd95ab98abba379901e247926e80121026596df661f5d6ce02be34806c12efbd77636e7c0e9e8685eec7e9162adf6ce7effffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1da0200006a47304402205dc46a72acd6f4f72332b005cb859215b5ab31bc70f9b2273032db774321904a02202a6c9424fe921a84f76d89ccbc16103c5ca624058f9592e4ac89894d3b3eb20b012102c3d8316da0c1250d9d9f22f225d72021344ba9ea3aef22dc9cb89d8d326baab4ffffffffe8205279b473e7aa25b6e1af1d08ff7d4e374edb9b51523bb3f2de8c6a0909c1de0200006a4730440220544c2abfb1f99e93284482bebfd3896b433636853f3ed8268f0f150f6efa287f0220026e69e3111ae67bb6fe6c7ae47670e1c0c7a065a57e13bf48ef8646ec999d310121021813cdd05350838ff535db25d1605c183c7b4141d0ee2ef2bad24671945f35ceffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d340000006b483045022100c651f4093a0619d99e15655d93a8680c552fba5d06a9241aee29398c2d1c3b01022036d1f06847034cd02646e4656c48980e4c1b324a22807ffa1dd874bf2975bfa9012103fab9fe19ad44ff70410f6ae2819cbf9191d026eb2aaa6dabbadbba01a11da13dffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d3a0000006a473044022011b6be5a307d93a09f666cf934bb3a92e1bca61c45814302be50300a576d6247022051d2a7c1bba62b8a79f63b53f32497ab1dea583290e928899869908963a290b30121037229e6a626c5643a8775db71891525f555ef31dd5e17faa2f1f359875c25dfdcffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d400000006a47304402204e3d105dff49e720553a1bf76ccee35012481f65e41b1eff98a48c3b01f0aa6602201055db4eed7d203640ceab2589994188eb8dc5bdfdaa3a26d938ade6624c30f1012102b82efa454258adfd0e5ba4b328b2bc5330983f705b793cb181482e79f80e9930ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d4b0000006b483045022100a11e6dc3fc67eccdf62858e8f5106cd281d2f70d592d04ad2078c972d08efb0c022042e0ab45565cfa5a11c3ff4d62f8b6dbc6f4a526d79dcda0fd7bc6f983c41eb10121032c416ccb3b041baef859872db424aa5364116abae839402eb16d2e66d5aca646ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d540000006a473044022020a0b9610bdcbed7c2b0e0dcb59a2de6273493ccd33ac080dee77b7abee881bf022045de7dcfcbccf289835e7b690f75b6285352227cac888ea673c99216db7e8a52012102467d9c0ba7fdcb7c5bcfb88c409da4abd7bb7f0f1392ea537375d308beb726caffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d5a0000006a4730440220214f53a525785f646828a726ab51041b3a19eaca305e27828d6e2b022bbcc3bd022069aba6a28acbb70c6abd5755fc0757e319049c99eaa62e464a423c33e9a9ea17012103125358e37ef869b7d243e2cdde883514386a2ed00e185a976c22b51a377cf1a9ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d5b0000006b48304502210088e40beac5270955ee2ab00d6eff4e06bbb03873eb8b2f3db4c73af0e9b56ca2022063c22e296096c54fe4563df30cbf7024d3bb3af0ca305ca62a45d78a34b5696d012102c51cc9443ac01d5afa5a175d610649191434827fe0275828993a80468c417529ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d600000006b4830450221008c76c753bff610210392a3ece465a6cfd6be7204aac61f5c74541beec233c850022067c4cc522d4bf20de28f176cfb3e058fa0464d4e35ceffb404b52358cfd060e90121028a152ff0467a7e0003e2df129e0f4afe783b8b80b590680550768282d091864dffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d630000006b483045022100f598201a78ae3776c193609007ac99f082450a213b0b4532dda08ba61c8ef73e02204ba4c2fd15fc4e96cb82cfc7d777e9d7962b56a02ddc52b449d50ae7c05c45410121030504f2b3f5ef6f01d3300ebfc4d477b76aad88f96b8e17015c032f17ab4b7941ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d650000006a4730440220508e44f9c0972c721e0e02f8faa6c03598189d4321b8d95e59a08bc396d9ceb202201150e0cdd633ab30c4561c4bb15381a37ea0d1cba72f576d26c000f42be618ac0121031acd4aa6584cc492552970924773f327f01a195a7eaa11ce7403e8bf33deca9dffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d660000006b483045022100c8399cab0f1fba3aa80e1073168fc8625a5eddbe0a6c55fd95617bb7187c3616022014c487e3fc2a34cd239cbaae3cb9a84948a2c429b57c22657b40ce183074dae601210204c81ba289892783af47a530bb90b1ed2a40b5b075ba78c571f4ad7a23ce8789ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d9c0000006a47304402200cef576689285a1002b9ab7708a892f822f42b41cbdf56faef4c7a798e787cfe0220406e0e6d705044b1a8286d47d9d498b7a0f189899dfea712063b22d6b65331eb012102de203808d960a70c9c03fb19b8b454f5b39bf2db7e539b329aee1a224dc10c30ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d9d0000006b483045022100897cbe00d0d33e17f7286e2675dfd331e97558e38973b2d8de294241b28d694b0220516caee45cfa6d4c52cdcd70f8d33369ecffa9dc3bfc591ff41226119fc29c51012103dc6a39ca42438d74f372f2e6c39b78cae0a6a0497ba9b324b37323a429c25693ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04da10000006a473044022050e956aa0b79ef3acf680428387385202191016fe91f8da2a26e8c12c58534de02206451fcfb7a2772e55520314fecf74a4dedb980d2a1a9acff91e3bcc1781ade2e0121022f7408dd4da48b2e180101b9a68bd33fa5f4b50641138539b41910ae7f06ecdfffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04daa0000006b483045022100acfcdb0296ccc93611637ac70d2f901f8f2a7e6bf8e7beafea7b7b3edb5e3c7e02202291b9068ea1ffe02f03165ee164f4644719f93605c14e3793af5dda30403db90121027d238c0007250e50e13826c5ba631692699cbefc723f1af81bf4fdd7c1567c40ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dab0000006a47304402204fc6836bbc8ebf419e42eff8d3e83839b36d5c828653f08ad7cdc44bb26c286b02207e51ba252e7fa8b39d32f82a6d334c05227ebea45277f26893d96d0f76d430ef012103a980c6a7e06e582eb8e3f9e2f74800ca9253a7a019e0ea3c1235e471268fc253ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04db20000006b4830450221009aa80d095b6157670e141401e1e9f66b739f28ac53a559bb47e231e257edfd4502204b77c18f1da1bff0208cac1c31b3c2cd4d36240a702a8cb192f40b63935c298d012102da7ce91a1f9f94c4e4d87e474512777e0b7d702961152176968ea999dbfc3ec3ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04db80000006b483045022100dfed5ff1d938f1c11b82669de0a05813aa618496e2640ae6a298794b347a24fd022042f1e30b9796768af4e8e7a55ebfbc340c9564dfe2d12ecfc3a64215aceb722a012102fda3f6006fffb7975d967c5b473fa64b712ae2b469095b3cfec51eb70d665204ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dba0000006b4830450221009bde25cc62278c354ecb751b0a60da5f6b384af9a26a2d3ccae35f9fe5c875a70220440973ed436bfe8fbc4454c5718d0ad7a8238a1e802c56d065d6c15bd7fb30c9012103bdfbdfea12ccbf3f46026490bf9ae6d6f179e08523edef0c65a2842366f83b9fffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dbe0000006a473044022070fe68a82fd2be9294aa2be9554474dd434491373933037ac84b6c404a4ade7302201c1ed802e861efeaedaa53ebeb6a4303325dd5c096a2aa7e94671740c0f6a080012103bc3019acc5d6c21e5a1f3fe7ffd43a66cbb19bb9522addaf13eef3a229dcbf04ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dbf0000006a47304402205375add2afa177cc967def4c9145187595cbb691737df1ea22b5ddbb1e38428002204bcb401bef7a6a08c59e2fe9de725b7f8fdf11b0e8477551c36ed84a886961bf0121029c3a25dc611d682d85bd00a5104a920092865e1ff4ad3bd2de36b4832ac374cfffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dc00000006a47304402201cbf699e95c22ca00d541b298c30be2908f86947eedaacf3a1bbc2823a0ae275022051c995b5b499c3481812308aa38301825a65309839bd7016803ef79a8484c1f60121033c07e5f15c4d4e4fa886adabdcff18f5160a0229be7f97ea925b10096c867f5cffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dc10000006a4730440220248fca32d208085984d21faeb86a6d8591aee8efdc01f7fbe7c0f38aab8f4ded022011adac25a8a4aadb1cb6ff0d897996f19e3886051a529577dac27473dc25f25b01210275f3d5d97e27c20ec966c8b3915802dab7d9fcf9aac1054de04eb4349ee23800ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dc50000006a473044022001354d0f1440d1b246c9689a8adaa6daadd7d0aa7ab93b99974d344206e706e00220096f649c9de140e47f1ae1825491ed97e7905d8f3cf4683080be95924a12f179012103d402e991d2209db833cc442d2f237c4597c1ec046a1ce786759ae5a25cb540a9ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04deb0000006b483045022100bb822ed9466b3f2e10b5bc5eed6ac5adab802b54e2cd9228c00f24697c92de40022075b2d8e65ef1562b0ee2653706728a0ae977b3171c7ad35f94e89d690fe6e092012103435b160c6b7532d7a6df4b1b32a67f02a42451fc8f2c2535a3350dbe0c889e5cffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04df50000006b483045022100aab73969efd8dcf674232af198dea3c6a7f08321d67e7e4d0d753cd892f7aa4702206821823c64e00720df6efdde856f46091e88d405c3bd8cd56d0593f4de0c09fc01210218cdd60d110982bf9e30a2880577a203d6bce3ac23f49c97db76b14756a8b13effffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dfc0000006a473044022039f7a7216086e4c7b8dc1f812240cf87245c3b3687595ba3ae448cfe9063497c02203a55bb226dbeed02039841f74f393945e1a297b576a1c0183f33b930583c3a6d0121030f5851d0ecf4f3f67f7a7766457647b9a5f576f2f277020707b8b8d7c0f29fabffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04dfe0000006b483045022100e5e44d7bbbafd43ef8cee9d0b93173b847b38061f714866bc70838bffa498d1402205c76cc970c91cbb23437b0c66f34005d8ec7f781dde92bd3c233ac18f0bccabd012103aaebf34aedec0cd42deb2937c160fdcb97bd2a6eb6e6e7b39172e87c8eedfdf6ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d030100006b483045022100fd49010e2bbd1556647ed0c2ea093640625a66e7c735734d1e9c03e86f45e52b0220113b6503de9e447d9a5d49d16c9ef6fbd1e33bca1334a499ebb51d1d3cddefdf0121033324938acd374e47c423e07ce826a7a5bffc6daf37626544b2d06647ec9e757effffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d070100006a473044022022f9d9ced8975da0c22a1d52df023f018f1c38c0f998be2d91059a5d4ec3765e022071572117af11cc8b5ca9e1aea9a3e2b9b4d490055db52f37ed54fdbd0acdf54e01210217f2ab02d668df006ccee4e2d7f1775886f9bc0e05988fa6ada6bec60b76cfdbffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d1a0100006b483045022100d453aaaadad61755a3f489db54da02c61f399a75f18f16c58d9c3154ec7c7e57022028e757bdad5aa8fafb435d3496dffb03e6774ee713a9c879194ba97b98d1f259012103235173889e3df92f2bf3cf88b52fbadd58211cb3df76b9cb5f5f7046f2500301ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d240100006a4730440220064ee21337cf7f595e06a9387ba3817a6b8f01819d83aed4e8200e57b7e469ce02207f91702bcbeec7c438d67f44dd5ff94f7de9a4f7f2298f540795d1f1349b50cc012103661abe9ca452dd39e739dcffe5a57fa01b09cbb16f0c77efb7e83203c60b0357ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d260100006a47304402205bfaa9df8db1f052c1d21b3167be884fb2f800260d0a02cb5cc8363b3e719ac202206a396d3c916cb21efffbb216bc790f12e8c21244bb1e460aec5c4400ab33103c01210265d1581eb36fb426a10567e42a77c021f054af9baca4bc20cca40c4d7e7a6b72ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d340100006b4830450221008f2f454314cd66d6a2e387cbb571dd0772441cf92e94584084684feb897d13cb0220072df0d79cbcc8d28f0f061400b6a00157a0b9fb1d45d1d0fdce2438e15e5913012102207ef56f0c83b6d2fdf865cfc9c8398a0e91d5ed6fbfdf5fb8607f1050fadc44ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d380100006a47304402203e68893a11b612efaf965fcd5ccaff70bb988d5a07cb0ceb307094c5bc914b7702204888ca05a7a3bbde208ba0819c3503cae767ecdde2fe9c4b8930069a179e55db01210290297b638a0a815a09ee946947567946ce8d40ad4ca4b814e42d4b86d64e5161ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d390100006b483045022100ddf9e0b0abe6e8fc21f838018111b4fa9749a5ad3e0261798b3d55730672433702207d95da6999e8ba05a496a9374bada56bd97af55a8f78ebf6e2388a79fc2aa5340121039a467d42aa858bb84b7115483e4aaa32a033b7bbc04969b1b283fe1eeda525afffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d3c0100006a47304402205f3f21bb10e840235baf505e18847d8df04a1c916022d1689ea763be8fd6652e02200f3a1295695a119ce2827f63f1a968218b4312d4e6eb371793dda3f66dc9371a012103bda66744af00c2926e8a9fe7d4e4b10b44978e31b6c1c621a2dd2192ea1cdc89ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d3e0100006b483045022100a72ad4071f5adc2eab9b47dfc6d74f3fcb3e2c7011b7f9b2c1eda0dc50ef28a0022005bfb847bfa5a052300fdda82ca941101534e5c2d8cc2d5ab8cf52a53c5ae34001210362ed038dbba6b24df044dd51557462b845547273183bbe3aa6c67c0cabf0ea4cffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d450100006b483045022100a53fdf11cdab6b2d4bc27b339b64f83d1827327eac22379a1f03aae5c4bb6cb202206fb1826649a8debc88e6281d6ccb3b5204ae1d5ceb24ae52716d5aa6858c46a7012102a48b5b01a33b59a2a3eadf23d108ce1ca951ab4d5bc81c4e87c7284f70e28e48ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d470100006b483045022100ecfc64cf2fcab3e5bb5c98110844795dcf75370193679af93fe05eb5ace40141022027cce8d27fb4a9453dfe4340a45e271281b137e19a7b3b0943e7b12588a3669501210395fda29e25b649eb29f8ff2c5553a494ef95093cf746a8b229826a1de3361daaffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d490100006a4730440220098c7979cbaeb1ca9a6816db7339d0f1a31c34fa1164e92adf388a8c7a4d18a802202670fef7b6c49785e889cd3e5e9043b8e854f876ac3d034b7f00044b793a04b8012102406168425a18fced174a6c8f6b7fc4afd5a145ab318c4b5217578d904fecc423ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d560100006b483045022100a4d52a574aadad59af87ee34f29f0afaa903b86bdd87202cc254fe8f30368ca60220178bc9f0527cf301c665dd6c363627e085f8c28b359c1f57b33b39c5694a205c012102f2a31ffb3afc4e87b31ceab7ea9e6ebb8224fd3d8513a612467493b0ca9f16e5ffffffff011c68ff8b2108ae7807e39103235fe872654d9cab4dc4b4c40248394ad3e04d570100006a4730440220762ddae95bb59e460e1e028debe18f0eacc07c3490631507786f59f28475b7d8022064ca70bab2ebd8554e387092dbcba1b4af516025c73ab6d6690e63a7a3275d4d012102ab2e84067502ae4213ded3ee19b1f8c12f70fa8422079a7899bdee45911e5601ffffffffd22123dbb9e97d97bda1ae9dd0aada7170e584067c2645a1e3470c81dd16bedb110000006a47304402207f6ed6a18010b4372cf9c108128201887c2aa8430d78dc127a5e207b7983c532022037fc6c49baf10acc7d13d244549dc5ef4f0ea147b8103dc427bd81859b04def9012103b1d2977a5cef19d66d6d12e74e069993023e4cd6cd3373e845be0e4c79290ee1ffffffffd22123dbb9e97d97bda1ae9dd0aada7170e584067c2645a1e3470c81dd16bedb2e0000006a47304402205b81e12831deca0232a712a53f69ad51c1a38ce4628df041579e369a5becb1ea022072df22adc97f93c2fdf917e86783b6ffb825b963673c364ece198381fcd3a1ed012103d5ef5cb73c67cde8a2ceccf5d41dcb665955ba4d7ae511e049295ac0c796a4aaffffffffd22123dbb9e97d97bda1ae9dd0aada7170e584067c2645a1e3470c81dd16bedb300000006b48304502210084b5f49374556b9e2182a298e5b49665aca25c49bdfa9f9bb06e40ac424c6e53022034842bef214565d8a5a8867a85b0967981261326a86a58bb0c509ad3d54d65d401210330f147db0faee2e800e1bf2eed4841793d0bd0d5fe692847fd7065af8b0e01fbffffffffd22123dbb9e97d97bda1ae9dd0aada7170e584067c2645a1e3470c81dd16bedb430000006b483045022100c60469f511d1e4666c3d43c010db849fef48977b2e7e72603a394709811d8f8802200ecc8b6cf9fa117040f7408fd60daa3faab6fb751e8a2990b34bf84307d6340201210229b48fcff732b7873b310126a69d54fae60ce316874d6c762ccc9e085f68841cffffffffd22123dbb9e97d97bda1ae9dd0aada7170e584067c2645a1e3470c81dd16bedb470000006a473044022008440936d645d817009e6a745d6071a0636676643891a6a7fd7f661226fef995022070cd3eb6618f212e40829eb071c7aac15b6c3df486e8d62a54aa9d89e81f8f68012103235173889e3df92f2bf3cf88b52fbadd58211cb3df76b9cb5f5f7046f2500301ffffffffd22123dbb9e97d97bda1ae9dd0aada7170e584067c2645a1e3470c81dd16bedb760000006b483045022100fe13e74bbe60522286dc6ada0755874e0bada1edec8d04c2dc6c479a8cd322b902204c5de0e514ec352897408f575d320e38f33cb356ce5dfd055fd0f72c023fb68b01210362ed038dbba6b24df044dd51557462b845547273183bbe3aa6c67c0cabf0ea4cffffffff723233eaee72e43c545516c55435bd2c81a1b508f1c906714551ca5ab07ba82d020000006b483045022100f4527f6bf203b2c964694706971520b527bac35ec78720283998f4f97b5959db02206f01a395c2149b27fe13253f6cad37e27c3237ba19c71db17621340fa62e6e7b0121025f6b53f4faa269f8fd0cb9c21a84782627e9d7dc495a37aef947e0f19e5b490effffffff017f47e200000000001976a914b5f78d55fcc7580519f10cbc467c111f80ff743e88ac0000000001000000019683987f834045a0e96549f563eced5d2e2a4cc20c4adba16f92b97521a7666d000000006a473044022010c169383471633e7346c31ab98dd19887ec2d5f683368012f7f1088f44ff114022050cce93b0eeeed2df872a3fe3dd31fa73c6d30dfe4ab8aa0e3ee4f8c29e8ca88012102392568f053515eaa3fabe6d8cd1f0771fb4a9ee076dd0d8638b714d6603d2040ffffffff02dad11000000000001976a914b250a838f20ebe174ebdf6176bbd40b0eb10d58b88ac40420f00000000001976a914f98cf91ab614dbbf94c591227ca604423125e7a288ac00000000010000000295fc49fa80593f458ca163a6c284040cf780044524b920fdd3002484fbfdf68a010000006a473044022056ced18a1ce4b3b90aa97f270c5684321017b777d5aa543f27ac2fd7ead5275a022028906086a7f2a10259229392590c7d09f6712795b3b80cd5972277f00493a7850121030cd3a60e9d5bbe20759835497421404f2b3e7651231bbde6c49886dcddabc738ffffffff4be714871033b0b7bff214d2ecd3841d20107f65e8095b29f54268e27030447a410000006b483045022100ee0d50095e08db2eba2ee7fe0531e0309886282a957e73edd04b7747f31172b902205926eff21df9a3c67674e221652bc084133c30b997c448b80e2599341a947ec90121033ff747cbbb4c9c450d9355c58ebe034611ac5dfeb6593a764e86df584be9427dffffffff0200f91500000000001976a914b0ae71a83c999f387a433f3a87fe77cb6b6c768a88ac64040000000000001976a91409f37a533d5432e1a60d9059a3a70655844d0c6b88ac000000000100000011d2d484d34717203f37a6fc47c38ee78b86d983ad542c55b28977bf2451d6c084000000006b483045022100ad32aa03fd4243cda4cf67f8d6181169cd3cfb19e3f417b1aef623f8fd44de0002204ee1de1955af1862da265fb1cf7b446f58f157fec62d0ce27d81622414c051b10121035e34ca1654e4563a705184aa8fb851f001d140c4ef66ce255ab02f6e3280763cffffffff68602e161b5af094ff4ecce669954978277155de6a0629f6a95ae2619c251263330000006b483045022100b98e67cb2c7e02f755d580fac80a247390526b5f22da2ce2c4479f29c1714a7b0220340996366d4ef1fd58b946b6d8fc2fd331b27dfdec97e8353f3acc59cd25e378012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff7d3bb57753bb999d054605ed53b82043f8f9f3c5f2c5dedc27c883df8b05351e810400006a473044022075aaba9c3a7fab43faf8565e10c1aa01e88f3b1f56923ac6e1ae093216cb51bc0220792f30636726898ee70332220bd2f2a31957fa7a68eb5a0009bf0c593affffba012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffffdcf6d5a683d8432a0c2bbaff8263be61902a8b1e5f6187338d4b45687ceffe1a5b0000006b483045022100daa29798d4ee06152746331703887974c3242541c9ec3d1941b02fa6c51e6ed2022064c68e93d453adfcbac582e749392c3763470a9143cd13577cde3a1a47998e8d012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff26ab92f05388883725239c6621241455546e50f83b483a60a58f747889fe5e4fbc0800006a4730440220202baa87fd0fe9aade6f3e3a946edbfa446fba9ddfe7c9bc681a3f90a7824bc202202cefa396b41a51e163c95fc5d0bc1c0620fd6807a8a24ef6a119f0cfe911da7e012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff281ca586e067a9cfb126b6851b1af50b7f3b722aa7f4607d7a3cd872acf844645d0500006b483045022100d76665ec77e0217d1ce8bdbab918d38add30e55bebca850a114f645c6424522e0220524ae9f86bf0a30c290c1a5880b38f5e94fccf12a7ddc043173d23ef4e68a22e012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff84b66e3431cea1a4727e9fc6ff3714ecd50896fa5d49448926ad21bcf6aec25e550000006a47304402201c7063faff2bdc59db866aca354a613b8235284e9a3fdf33448f0f9abaf4046e0220413d78169cb4a300e0832087829833390c4ec4c47d7ea6b28c5d48ce8e5bd2d6012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff103aea34301370c042607edc89ff90f192b6d79e99e290633764bbe4b5cb4bfc2d0000006b483045022100a904af251cf29fad607a6ce56e100e4b073184ad68abc45abe391c3991d5841402206e2c9ba87522192c3a73b56e33a2a5c2b231535307f03e4ff6f0c40f3f0d85fc012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffffd4cffe9a2f50bb1a08eb4ddfb1a31ba86de783b35eb68d7b982e8aecc22df625350000006a47304402200c44ee6f856f3d89cfb335fb608592bb6d31a30b14d500c059b6d1e35304f4a502203a59c6aca5e258d1565ed0619fd7fba1b1a61e30744ff654d3a9434fd05934da012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff72de34fd4f59dcef28fd6a60f2fcbf276fdb9ae494473bb0265b64bc5001f7104b0700006a47304402205797eb9a000e9cb19b258e4dfe927ef647013122aacbd017469b92243a58ff5902203595440f7095c434574f298a86e279c158aa5d5a3c7052388ebb18851a5db78a012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff893cd3ef8130644b74d8f936e82595ca18ec095ca47a23233f4fffeda7e58c52430000006b483045022100d3e0662d420df1d2bd8c3ae3690adc005a5e2ac1ce82a7ffdb2c7f04e2483929022067196650e670abfc141a22f6cdc2e3be1cbaa8f3d7e58180caa868fbe7c29c06012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff7741337671b30cf29649d5f375332bfc3af8fefc3fb4704c7be4f5618843fda3360000006a473044022061db9a1f59eae734e414e7b5d3a3fbafd7b2d6876958641f98ece8a89756c8f80220739f2a3faaeeda4fcf855d81cf46be3d4eb065599ddb6e3d236016c401358dc7012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffffbd756bb55d6c80e929071c9171bbfa929fd434dfb1c11d2abb07b9a399958838390000006b483045022100f68a3b94ce1618b614eaecd52381c90ac0690f96dcc6b73896a15e34ec18576302205c72b3bd30b028e80597bf9230ab8a17f9029b8780d9802decef90db8ca70225012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffffdd18874296cf22078d7e2763b6c65451a6046c2050f86b0e1dcea83c5e450966230500006a473044022013b0623171e46dff5650499955e3339ebae67ad08070d21dda98515660115878022005c5e1717ba46a4992c15b4f9c683443a56227b5477b60cd96526033a043e461012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff30d17fa1464f3ee104ac73d36415ee929bd00aa0771110230739f3766c0572d3ee0100006b483045022100bc7f78de139843473cefb5e359828d74a49f58e94eb500741abcb9a346fdcb04022018fd4c13bf96206546b7d61e5fb15bc0176774fde2a7e3ffa7a55d095b1c34eb012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff7535ad709eee6d0c61f5670afb1613303a85195c7e81f9717e3d06316900634e290200006b4830450221008209ada22fd6f580d385fcdd03769295a28eab3ef39870665ad39a47464560af0220153642331e1cfbfe8111db19c15aa09fb5e5d336bbde270d0ec0e9eb52300da6012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff0ac876832debadeaf7b7fdcbdd09cda529b7ea962e34a433c89addf557e09e97390000006b483045022100e3df4777911c982e60a97873af56ef90fbac0408807bada0cbbbf9c7eeb7387f022010e3113809d9d3091937d0465a5d1a612728d1393e34313a1c589144a6bb6c15012102d25ecbeb1898e8b050e508da1c1655594869512a6fb172000f690e612b0676daffffffff02d8030000000000001976a9145978eb0c5724b0724478fc0ec651cc603c27258288ac08c90100000000001976a9141651fef006ab0ad0f4014d3b0a127a945b947b0e88ac000000000100000006161bbf26e83f566300cc382d948a94252750b8cbcec13e9a669817a11fb61f49450000006b483045022100f6a96333a865bd4d1adf14080fe18c76c1db5a493131100847616ed44a5b74ec0220680ec2afdda4a31c413d73665d388ce542f6d5f9a430bfaa588e48f19ed7fe15012103fd3d2c65beef2b22b8ffd69f9abc4c737dbd71104fdc8c8effab6db1aff46343ffffffff47be55af3052320ebf5257de244e1b6ad33b6fa3e14e5822049ca50cd5f82c17850000006b483045022100e432633fb1f043a59632e1eb4911db10536eadf9cdc19f4e09e70ddf4e274d810220131c9b14a5acce5815ad4bf92921bd377bb685ff3b7f947583fe2dec84efacb7012103fd3d2c65beef2b22b8ffd69f9abc4c737dbd71104fdc8c8effab6db1aff46343ffffffff10bff1960f98239427ee5beca495269f38b03d08fd3a2d87b94e9d3020f9edb6bf0500006b483045022100b33699cc861f5f5eca33161f1777f208be0108bf4079ce52d14fd0d68c40319d02207e97fdd1f7a69da9c0dd5c098962ef642d7b81e1faa2580eaf38f207a852d671012103fd3d2c65beef2b22b8ffd69f9abc4c737dbd71104fdc8c8effab6db1aff46343ffffffff90decc43b6d900d53c0c9fd1609c50b6b97b2853be27046b534864bf9eb3002e190000006a473044022066f974a70cc86edc2b8675853f7a0c024cf36a9fff804872a95967f54070515d022006520defc864b59fac6eaf8a3747096389bd9f907cd02153f280af6159920f39012103fd3d2c65beef2b22b8ffd69f9abc4c737dbd71104fdc8c8effab6db1aff46343ffffffff8b41bfadb911a722fc423944953b4e2d5952b364b53f56e45af1ea3f8d007ce1210100006a47304402204ccde391a43155fa75165ea9f609f82637548283d047197ac64e40c854630b300220444e75376a8cfb1852edb39021b078e4ed29674c35e2f41a72ae10772bbf38da012103fd3d2c65beef2b22b8ffd69f9abc4c737dbd71104fdc8c8effab6db1aff46343ffffffff3237743d3b1999927d4190e1c452d9ef98ed8d821d03f635b4b15e71e1dd5cd6680000006b483045022100b96d784a7b063b17d2adaaa4d11335df5d42e988703db6390b1ef020d4074911022064b1cb831a479d57f01c407ce68fac31a138eeef9adc75e4aa958c9e73134712012103fd3d2c65beef2b22b8ffd69f9abc4c737dbd71104fdc8c8effab6db1aff46343ffffffff013cb00100000000001976a91427276168ff506f57631e733e921d96a63d2fb4f988ac00000000'; + var x = Block.fromBuffer(networkBlock); + x.toBuffer().toString('hex').should.equal(networkBlock); + }); + + }); + + describe('#fromBufferReader', function() { + + it('should make a block from this known buffer', function() { + var block = Block.fromBufferReader(BufferReader(blockbuf)); + block.toBuffer().toString('hex').should.equal(blockhex); + }); + + }); + + describe('#toBuffer', function() { + + it('should recover a block from this known buffer', function() { + var block = Block.fromBuffer(blockbuf); + block.toBuffer().toString('hex').should.equal(blockhex); + }); + + }); + + describe('#toBufferWriter', function() { + + it('should recover a block from this known buffer', function() { + var block = Block.fromBuffer(blockbuf); + block.toBufferWriter().concat().toString('hex').should.equal(blockhex); + }); + + it('doesn\'t create a bufferWriter if one provided', function() { + var writer = new BufferWriter(); + var block = Block.fromBuffer(blockbuf); + block.toBufferWriter(writer).should.equal(writer); + }); + + }); + + describe('#toObject', function() { + + it('should recover a block from genesis block buffer', function() { + var block = Block.fromBuffer(blockOneBuf); + block.id.should.equal(blockOneId); + block.toObject().should.deep.equal({ + header: { + hash: '00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048', + version: 1, + prevHash: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', + merkleRoot: '0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098', + time: 1231469665, + bits: 486604799, + nonce: 2573394689 + }, + transactions: [{ + hash: '0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098', + version: 1, + inputs: [{ + prevTxId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 4294967295, + sequenceNumber: 4294967295, + script: '04ffff001d0104' + }], + outputs: [{ + satoshis: 5000000000, + script: '410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c' + + '52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac' + }], + nLockTime: 0 + }] + }); + }); + + it('roundtrips correctly', function() { + var block = Block.fromBuffer(blockOneBuf); + var obj = block.toObject(); + var block2 = Block.fromObject(obj); + block2.toObject().should.deep.equal(block.toObject()); + }); + + }); + + describe('#_getHash', function() { + + it('should return the correct hash of the genesis block', function() { + var block = Block.fromBuffer(genesisbuf); + var blockhash = new Buffer(Array.apply([], new Buffer(genesisidhex, 'hex')).reverse()); + block._getHash().toString('hex').should.equal(blockhash.toString('hex')); + }); + }); + + describe('#id', function() { + + it('should return the correct id of the genesis block', function() { + var block = Block.fromBuffer(genesisbuf); + block.id.should.equal(genesisidhex); + }); + it('"hash" should be the same as "id"', function() { + var block = Block.fromBuffer(genesisbuf); + block.id.should.equal(block.hash); + }); + + }); + + describe('#inspect', function() { + + it('should return the correct inspect of the genesis block', function() { + var block = Block.fromBuffer(genesisbuf); + block.inspect().should.equal(''); + }); + + }); + + describe('#merkleRoot', function() { + + it('should describe as valid merkle root', function() { + var x = Block.fromRawBlock(dataRawBlockBinary); + var valid = x.validMerkleRoot(); + valid.should.equal(true); + }); + + it('should describe as invalid merkle root', function() { + var x = Block.fromRawBlock(dataRawBlockBinary); + x.transactions.push(new Transaction()); + var valid = x.validMerkleRoot(); + valid.should.equal(false); + }); + + it('should get a null hash merkle root', function() { + var x = Block.fromRawBlock(dataRawBlockBinary); + x.transactions = []; // empty the txs + var mr = x.getMerkleRoot(); + mr.should.deep.equal(Block.Values.NULL_HASH); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/block/blockheader.js b/packages/kauri-bitcore-lib/test/block/blockheader.js new file mode 100644 index 0000000..07e5008 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/block/blockheader.js @@ -0,0 +1,302 @@ +'use strict'; + +var bitcore = require('../..'); +var BN = require('../../lib/crypto/bn'); +var BufferReader = bitcore.encoding.BufferReader; +var BufferWriter = bitcore.encoding.BufferWriter; + +var BlockHeader = bitcore.BlockHeader; +var fs = require('fs'); +var should = require('chai').should(); + +// https://test-insight.bitpay.com/block/000000000b99b16390660d79fcc138d2ad0c89a0d044c4201a02bdf1f61ffa11 +var dataRawBlockBuffer = fs.readFileSync('test/data/blk86756-testnet.dat'); +var dataRawBlockBinary = fs.readFileSync('test/data/blk86756-testnet.dat', 'binary'); +var dataRawId = '000000000b99b16390660d79fcc138d2ad0c89a0d044c4201a02bdf1f61ffa11'; +var data = require('../data/blk86756-testnet'); + +describe('BlockHeader', function() { + + var version = data.version; + var prevblockidbuf = new Buffer(data.prevblockidhex, 'hex'); + var merklerootbuf = new Buffer(data.merkleroothex, 'hex'); + var time = data.time; + var bits = data.bits; + var nonce = data.nonce; + var bh = new BlockHeader({ + version: version, + prevHash: prevblockidbuf, + merkleRoot: merklerootbuf, + time: time, + bits: bits, + nonce: nonce + }); + var bhhex = data.blockheaderhex; + var bhbuf = new Buffer(bhhex, 'hex'); + + it('should make a new blockheader', function() { + BlockHeader(bhbuf).toBuffer().toString('hex').should.equal(bhhex); + }); + + it('should not make an empty block', function() { + (function() { + BlockHeader(); + }).should.throw('Unrecognized argument for BlockHeader'); + }); + + describe('#constructor', function() { + + it('should set all the variables', function() { + var bh = new BlockHeader({ + version: version, + prevHash: prevblockidbuf, + merkleRoot: merklerootbuf, + time: time, + bits: bits, + nonce: nonce + }); + should.exist(bh.version); + should.exist(bh.prevHash); + should.exist(bh.merkleRoot); + should.exist(bh.time); + should.exist(bh.bits); + should.exist(bh.nonce); + }); + + it('will throw an error if the argument object hash property doesn\'t match', function() { + (function() { + var bh = new BlockHeader({ + hash: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', + version: version, + prevHash: prevblockidbuf, + merkleRoot: merklerootbuf, + time: time, + bits: bits, + nonce: nonce + }); + }).should.throw('Argument object hash property does not match block hash.'); + }); + + }); + + describe('version', function() { + it('is interpreted as an int32le', function() { + var hex = 'ffffffff00000000000000000000000000000000000000000000000000000000000000004141414141414141414141414141414141414141414141414141414141414141010000000200000003000000'; + var header = BlockHeader.fromBuffer(new Buffer(hex, 'hex')); + header.version.should.equal(-1); + header.timestamp.should.equal(1); + }); + }); + + + describe('#fromObject', function() { + + it('should set all the variables', function() { + var bh = BlockHeader.fromObject({ + version: version, + prevHash: prevblockidbuf.toString('hex'), + merkleRoot: merklerootbuf.toString('hex'), + time: time, + bits: bits, + nonce: nonce + }); + should.exist(bh.version); + should.exist(bh.prevHash); + should.exist(bh.merkleRoot); + should.exist(bh.time); + should.exist(bh.bits); + should.exist(bh.nonce); + }); + + }); + + describe('#toJSON', function() { + + it('should set all the variables', function() { + var json = bh.toJSON(); + should.exist(json.version); + should.exist(json.prevHash); + should.exist(json.merkleRoot); + should.exist(json.time); + should.exist(json.bits); + should.exist(json.nonce); + }); + + }); + + describe('#fromJSON', function() { + + it('should parse this known json string', function() { + + var jsonString = JSON.stringify({ + version: version, + prevHash: prevblockidbuf, + merkleRoot: merklerootbuf, + time: time, + bits: bits, + nonce: nonce + }); + + var json = new BlockHeader(JSON.parse(jsonString)); + should.exist(json.version); + should.exist(json.prevHash); + should.exist(json.merkleRoot); + should.exist(json.time); + should.exist(json.bits); + should.exist(json.nonce); + }); + + }); + + describe('#fromString/#toString', function() { + + it('should output/input a block hex string', function() { + var b = BlockHeader.fromString(bhhex); + b.toString().should.equal(bhhex); + }); + + }); + + describe('#fromBuffer', function() { + + it('should parse this known buffer', function() { + BlockHeader.fromBuffer(bhbuf).toBuffer().toString('hex').should.equal(bhhex); + }); + + }); + + describe('#fromBufferReader', function() { + + it('should parse this known buffer', function() { + BlockHeader.fromBufferReader(BufferReader(bhbuf)).toBuffer().toString('hex').should.equal(bhhex); + }); + + }); + + describe('#toBuffer', function() { + + it('should output this known buffer', function() { + BlockHeader.fromBuffer(bhbuf).toBuffer().toString('hex').should.equal(bhhex); + }); + + }); + + describe('#toBufferWriter', function() { + + it('should output this known buffer', function() { + BlockHeader.fromBuffer(bhbuf).toBufferWriter().concat().toString('hex').should.equal(bhhex); + }); + + it('doesn\'t create a bufferWriter if one provided', function() { + var writer = new BufferWriter(); + var blockHeader = BlockHeader.fromBuffer(bhbuf); + blockHeader.toBufferWriter(writer).should.equal(writer); + }); + + }); + + describe('#inspect', function() { + + it('should return the correct inspect of the genesis block', function() { + var block = BlockHeader.fromRawBlock(dataRawBlockBinary); + block.inspect().should.equal(''); + }); + + }); + + describe('#fromRawBlock', function() { + + it('should instantiate from a raw block binary', function() { + var x = BlockHeader.fromRawBlock(dataRawBlockBinary); + x.version.should.equal(2); + new BN(x.bits).toString('hex').should.equal('1c3fffc0'); + }); + + it('should instantiate from raw block buffer', function() { + var x = BlockHeader.fromRawBlock(dataRawBlockBuffer); + x.version.should.equal(2); + new BN(x.bits).toString('hex').should.equal('1c3fffc0'); + }); + + }); + + describe('#validTimestamp', function() { + + var x = BlockHeader.fromRawBlock(dataRawBlockBuffer); + + it('should validate timpstamp as true', function() { + var valid = x.validTimestamp(x); + valid.should.equal(true); + }); + + + it('should validate timestamp as false', function() { + x.time = Math.round(new Date().getTime() / 1000) + BlockHeader.Constants.MAX_TIME_OFFSET + 100; + var valid = x.validTimestamp(x); + valid.should.equal(false); + }); + + }); + + describe('#validProofOfWork', function() { + + it('should validate proof-of-work as true', function() { + var x = BlockHeader.fromRawBlock(dataRawBlockBuffer); + var valid = x.validProofOfWork(x); + valid.should.equal(true); + + }); + + it('should validate proof of work as false because incorrect proof of work', function() { + var x = BlockHeader.fromRawBlock(dataRawBlockBuffer); + var nonce = x.nonce; + x.nonce = 0; + var valid = x.validProofOfWork(x); + valid.should.equal(false); + x.nonce = nonce; + }); + + }); + + describe('#getDifficulty', function() { + it('should get the correct difficulty for block 86756', function() { + var x = BlockHeader.fromRawBlock(dataRawBlockBuffer); + x.bits.should.equal(0x1c3fffc0); + x.getDifficulty().should.equal(4); + }); + + it('should get the correct difficulty for testnet block 552065', function() { + var x = new BlockHeader({ + bits: 0x1b00c2a8 + }); + x.getDifficulty().should.equal(86187.62562209); + }); + + it('should get the correct difficulty for livenet block 373043', function() { + var x = new BlockHeader({ + bits: 0x18134dc1 + }); + x.getDifficulty().should.equal(56957648455.01001); + }); + + it('should get the correct difficulty for livenet block 340000', function() { + var x = new BlockHeader({ + bits: 0x1819012f + }); + x.getDifficulty().should.equal(43971662056.08958); + }); + + it('should use exponent notation if difficulty is larger than Javascript number', function() { + var x = new BlockHeader({ + bits: 0x0900c2a8 + }); + x.getDifficulty().should.equal(1.9220482782645836 * 1e48); + }); + }); + + it('coverage: caches the "_id" property', function() { + var blockHeader = BlockHeader.fromRawBlock(dataRawBlockBuffer); + blockHeader.id.should.equal(blockHeader.id); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/block/merkleblock.js b/packages/kauri-bitcore-lib/test/block/merkleblock.js new file mode 100644 index 0000000..4eb78e4 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/block/merkleblock.js @@ -0,0 +1,230 @@ +'use strict'; + +var should = require('chai').should(); + +var bitcore = require('../..'); +var MerkleBlock = bitcore.MerkleBlock; +var BufferReader = bitcore.encoding.BufferReader; +var BufferWriter = bitcore.encoding.BufferWriter; +var Transaction = bitcore.Transaction; +var data = require('../data/merkleblocks.js'); +var transactionVector = require('../data/tx_creation'); + + +describe('MerkleBlock', function() { + var blockhex = data.HEX[0]; + var blockbuf = new Buffer(blockhex,'hex'); + var blockJSON = JSON.stringify(data.JSON[0]); + var blockObject = JSON.parse(JSON.stringify(data.JSON[0])); + + describe('#constructor', function() { + it('should make a new merkleblock from buffer', function() { + var b = MerkleBlock(blockbuf); + b.toBuffer().toString('hex').should.equal(blockhex); + }); + + it('should make a new merkleblock from object', function() { + var b = MerkleBlock(blockObject); + b.toObject().should.deep.equal(blockObject); + }); + + it('should make a new merkleblock from JSON', function() { + var b = MerkleBlock(JSON.parse(blockJSON)); + JSON.stringify(b).should.equal(blockJSON); + }); + + it('should not make an empty block', function() { + (function() { + return new MerkleBlock(); + }).should.throw('Unrecognized argument for MerkleBlock'); + }); + }); + + describe('#fromObject', function() { + + it('should set these known values', function() { + var block = MerkleBlock.fromObject(JSON.parse(blockJSON)); + should.exist(block.header); + should.exist(block.numTransactions); + should.exist(block.hashes); + should.exist(block.flags); + }); + + it('should set these known values', function() { + var block = MerkleBlock(JSON.parse(blockJSON)); + should.exist(block.header); + should.exist(block.numTransactions); + should.exist(block.hashes); + should.exist(block.flags); + }); + + it('accepts an object as argument', function() { + var block = MerkleBlock(blockbuf); + MerkleBlock.fromObject(block.toObject()).should.exist(); + }); + + }); + + describe('#toJSON', function() { + + it('should recover these known values', function() { + var block = new MerkleBlock(JSON.parse(blockJSON)); + var b = JSON.parse(JSON.stringify(block)); + should.exist(block.header); + should.exist(block.numTransactions); + should.exist(block.hashes); + should.exist(block.flags); + should.exist(b.header); + should.exist(b.numTransactions); + should.exist(b.hashes); + should.exist(b.flags); + }); + + }); + + describe('#fromBuffer', function() { + + it('should make a block from this known buffer', function() { + var block = MerkleBlock.fromBuffer(blockbuf); + block.toBuffer().toString('hex').should.equal(blockhex); + }); + + }); + + describe('#fromBufferReader', function() { + + it('should make a block from this known buffer', function() { + var block = MerkleBlock.fromBufferReader(BufferReader(blockbuf)); + block.toBuffer().toString('hex').should.equal(blockhex); + }); + + }); + + describe('#toBuffer', function() { + + it('should recover a block from this known buffer', function() { + var block = MerkleBlock.fromBuffer(blockbuf); + block.toBuffer().toString('hex').should.equal(blockhex); + }); + + }); + + describe('#toBufferWriter', function() { + + it('should recover a block from this known buffer', function() { + var block = MerkleBlock.fromBuffer(blockbuf); + block.toBufferWriter().concat().toString('hex').should.equal(blockhex); + }); + + it('doesn\'t create a bufferWriter if one provided', function() { + var writer = new BufferWriter(); + var block = MerkleBlock.fromBuffer(blockbuf); + block.toBufferWriter(writer).should.equal(writer); + }); + + }); + + + describe('#validMerkleTree', function() { + + it('should validate good merkleblocks', function() { + data.JSON.forEach(function(data) { + var b = MerkleBlock(data); + b.validMerkleTree().should.equal(true); + }); + }); + + it('should not validate merkleblocks with too many hashes', function() { + var b = MerkleBlock(data.JSON[0]); + // Add too many hashes + var i = 0; + while(i <= b.numTransactions) { + b.hashes.push('bad' + i++); + } + b.validMerkleTree().should.equal(false); + }); + + it('should not validate merkleblocks with too few bit flags', function() { + var b = MerkleBlock(JSON.parse(blockJSON)); + b.flags.pop(); + b.validMerkleTree().should.equal(false); + }); + + }); + + describe('#filterdTxsHash', function() { + + it('should validate good merkleblocks', function() { + var hashOfFilteredTx = '6f64fd5aa9dd01f74c03656d376625cf80328d83d9afebe60cc68b8f0e245bd9' + var b = MerkleBlock(data.JSON[3]); + b.filterdTxsHash()[0].should.equal(hashOfFilteredTx); + }); + + it('should fail with merkleblocks with too many hashes', function() { + var b = MerkleBlock(data.JSON[0]); + // Add too many hashes + var i = 0; + while(i <= b.numTransactions) { + b.hashes.push('bad' + i++); + } + (function() { + b.filterdTxsHash(); + }).should.throw('This MerkleBlock contain an invalid Merkle Tree'); + }); + + it('should fail with merkleblocks with too few bit flags', function() { + var b = MerkleBlock(JSON.parse(blockJSON)); + b.flags.pop(); + (function() { + b.filterdTxsHash(); + }).should.throw('This MerkleBlock contain an invalid Merkle Tree'); + }); + + }); + + describe('#hasTransaction', function() { + + it('should find transactions via hash string', function() { + var jsonData = data.JSON[0]; + var txId = new Buffer(jsonData.hashes[1],'hex').toString('hex'); + var b = MerkleBlock(jsonData); + b.hasTransaction(txId).should.equal(true); + b.hasTransaction(txId + 'abcd').should.equal(false); + }); + + it('should find transactions via Transaction object', function() { + var jsonData = data.JSON[0]; + var txBuf = new Buffer(data.TXHEX[0][0],'hex'); + var tx = new Transaction().fromBuffer(txBuf); + var b = MerkleBlock(jsonData); + b.hasTransaction(tx).should.equal(true); + }); + + it('should not find non-existant Transaction object', function() { + // Reuse another transaction already in data/ dir + var serialized = transactionVector[0][7]; + var tx = new Transaction().fromBuffer(new Buffer(serialized, 'hex')); + var b = MerkleBlock(data.JSON[0]); + b.hasTransaction(tx).should.equal(false); + }); + + it('should not match with merkle nodes', function() { + var b = MerkleBlock(data.JSON[0]); + + var hashData = [ + ['3612262624047ee87660be1a707519a443b1c1ce3d248cbfc6c15870f6c5daa2', false], + ['019f5b01d4195ecbc9398fbf3c3b1fa9bb3183301d7a1fb3bd174fcfa40a2b65', true], + ['41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068', false], + ['20d2a7bc994987302e5b1ac80fc425fe25f8b63169ea78e68fbaaefa59379bbf', false] + ]; + + hashData.forEach(function check(d){ + b.hasTransaction(d[0]).should.equal(d[1]); + }); + + }); + + }); + +}); + diff --git a/packages/kauri-bitcore-lib/test/crypto/bn.js b/packages/kauri-bitcore-lib/test/crypto/bn.js new file mode 100644 index 0000000..085b40c --- /dev/null +++ b/packages/kauri-bitcore-lib/test/crypto/bn.js @@ -0,0 +1,153 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../..'); +var BN = bitcore.crypto.BN; + +describe('BN', function() { + it('should create a bn', function() { + var bn = new BN(50); + should.exist(bn); + bn.toString().should.equal('50'); + }); + + it('should parse this number', function() { + var bn = new BN(999970000); + bn.toString().should.equal('999970000'); + }); + + it('should parse numbers below and at bn.js internal word size', function() { + var bn = new BN(Math.pow(2, 26) - 1); + bn.toString().should.equal((Math.pow(2, 26) - 1).toString()); + bn = new BN(Math.pow(2, 26)); + bn.toString().should.equal((Math.pow(2, 26)).toString()); + }); + + describe('#add', function() { + + it('should add two small numbers together', function() { + var bn1 = new BN(50); + var bn2 = new BN(75); + var bn3 = bn1.add(bn2); + bn3.toString().should.equal('125'); + }); + + }); + + describe('#sub', function() { + + it('should subtract a small number', function() { + var bn1 = new BN(50); + var bn2 = new BN(25); + var bn3 = bn1.sub(bn2); + bn3.toString().should.equal('25'); + }); + + }); + + describe('#gt', function() { + + it('should say 1 is greater than 0', function() { + var bn1 = new BN(1); + var bn0 = new BN(0); + bn1.gt(bn0).should.equal(true); + }); + + it('should say a big number is greater than a small big number', function() { + var bn1 = new BN('24023452345398529485723980457'); + var bn0 = new BN('34098234283412341234049357'); + bn1.gt(bn0).should.equal(true); + }); + + it('should say a big number is great than a standard number', function() { + var bn1 = new BN('24023452345398529485723980457'); + var bn0 = new BN(5); + bn1.gt(bn0).should.equal(true); + }); + + }); + + describe('to/from ScriptNumBuffer', function() { + [0, 1, 10, 256, 1000, 65536, 65537, -1, -1000, -65536, -65537].forEach(function(n) { + it('rountrips correctly for ' + n, function() { + BN.fromScriptNumBuffer(new BN(n).toScriptNumBuffer()).toNumber().should.equal(n); + }); + }); + }); + + describe('#fromString', function() { + it('should make BN from a string', function() { + BN.fromString('5').toString().should.equal('5'); + }); + it('should work with hex string', function() { + BN.fromString('7fffff0000000000000000000000000000000000000000000000000000000000', 16) + .toString(16).should.equal('7fffff0000000000000000000000000000000000000000000000000000000000'); + }); + }); + + describe('#toString', function() { + it('should make a string', function() { + new BN(5).toString().should.equal('5'); + }); + }); + + describe('@fromBuffer', function() { + + it('should work with big endian', function() { + var bn = BN.fromBuffer(new Buffer('0001', 'hex'), { + endian: 'big' + }); + bn.toString().should.equal('1'); + }); + + it('should work with big endian 256', function() { + var bn = BN.fromBuffer(new Buffer('0100', 'hex'), { + endian: 'big' + }); + bn.toString().should.equal('256'); + }); + + it('should work with little endian if we specify the size', function() { + var bn = BN.fromBuffer(new Buffer('0100', 'hex'), { + size: 2, + endian: 'little' + }); + bn.toString().should.equal('1'); + }); + + }); + + describe('#toBuffer', function() { + + it('should create a 4 byte buffer', function() { + var bn = new BN(1); + bn.toBuffer({ + size: 4 + }).toString('hex').should.equal('00000001'); + }); + + it('should create a 4 byte buffer in little endian', function() { + var bn = new BN(1); + bn.toBuffer({ + size: 4, + endian: 'little' + }).toString('hex').should.equal('01000000'); + }); + + it('should create a 2 byte buffer even if you ask for a 1 byte', function() { + var bn = new BN('ff00', 16); + bn.toBuffer({ + size: 1 + }).toString('hex').should.equal('ff00'); + }); + + it('should create a 4 byte buffer even if you ask for a 1 byte', function() { + var bn = new BN('ffffff00', 16); + bn.toBuffer({ + size: 4 + }).toString('hex').should.equal('ffffff00'); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/crypto/ecdsa.js b/packages/kauri-bitcore-lib/test/crypto/ecdsa.js new file mode 100644 index 0000000..1ddae96 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/crypto/ecdsa.js @@ -0,0 +1,325 @@ +'use strict'; + +var ECDSA = require('../../lib/crypto/ecdsa'); +var Hash = require('../../lib/crypto/hash'); +var Privkey = require('../../lib/privatekey'); +var Pubkey = require('../../lib/publickey'); +var Signature = require('../../lib/crypto/signature'); +var BN = require('../../lib/crypto/bn'); +var point = require('../../lib/crypto/point'); +var should = require('chai').should(); +var vectors = require('../data/ecdsa'); + +describe('ECDSA', function() { + + it('instantiation', function() { + var ecdsa = new ECDSA(); + should.exist(ecdsa); + }); + + var ecdsa = new ECDSA(); + ecdsa.hashbuf = Hash.sha256(new Buffer('test data')); + ecdsa.privkey = new Privkey(BN.fromBuffer( + new Buffer('fee0a1f7afebf9d2a5a80c0c98a31c709681cce195cbcd06342b517970c0be1e', 'hex') + )); + ecdsa.privkey2pubkey(); + + describe('#set', function() { + it('sets hashbuf', function() { + should.exist(ECDSA().set({ + hashbuf: ecdsa.hashbuf + }).hashbuf); + }); + }); + + describe('#calci', function() { + it('calculates i correctly', function() { + ecdsa.randomK(); + ecdsa.sign(); + ecdsa.calci(); + should.exist(ecdsa.sig.i); + }); + + it('calulates this known i', function() { + var hashbuf = Hash.sha256(new Buffer('some data')); + var r = new BN('71706645040721865894779025947914615666559616020894583599959600180037551395766', 10); + var s = new BN('109412465507152403114191008482955798903072313614214706891149785278625167723646', 10); + var ecdsa = new ECDSA({ + privkey: new Privkey(BN.fromBuffer(Hash.sha256(new Buffer('test')))), + hashbuf: hashbuf, + sig: new Signature({ + r: r, + s: s + }) + }); + + ecdsa.calci(); + ecdsa.sig.i.should.equal(1); + }); + + }); + + describe('#fromString', function() { + + it('round trip with fromString', function() { + var str = ecdsa.toString(); + var ecdsa2 = new ECDSA.fromString(str); + should.exist(ecdsa2.hashbuf); + should.exist(ecdsa2.privkey); + }); + + }); + + describe('#randomK', function() { + + it('should generate a new random k when called twice in a row', function() { + ecdsa.randomK(); + var k1 = ecdsa.k; + ecdsa.randomK(); + var k2 = ecdsa.k; + (k1.cmp(k2) === 0).should.equal(false); + }); + + it('should generate a random k that is (almost always) greater than this relatively small number', function() { + ecdsa.randomK(); + var k1 = ecdsa.k; + var k2 = new BN(Math.pow(2, 32)).mul(new BN(Math.pow(2, 32))).mul(new BN(Math.pow(2, 32))); + k2.gt(k1).should.equal(false); + }); + + }); + + describe('#deterministicK', function() { + it('should generate the same deterministic k', function() { + ecdsa.deterministicK(); + ecdsa.k.toBuffer().toString('hex') + .should.equal('fcce1de7a9bcd6b2d3defade6afa1913fb9229e3b7ddf4749b55c4848b2a196e'); + }); + it('should generate the same deterministic k if badrs is set', function() { + ecdsa.deterministicK(0); + ecdsa.k.toBuffer().toString('hex') + .should.equal('fcce1de7a9bcd6b2d3defade6afa1913fb9229e3b7ddf4749b55c4848b2a196e'); + ecdsa.deterministicK(1); + ecdsa.k.toBuffer().toString('hex') + .should.not.equal('fcce1de7a9bcd6b2d3defade6afa1913fb9229e3b7ddf4749b55c4848b2a196e'); + ecdsa.k.toBuffer().toString('hex') + .should.equal('727fbcb59eb48b1d7d46f95a04991fc512eb9dbf9105628e3aec87428df28fd8'); + }); + it('should compute this test vector correctly', function() { + // test fixture from bitcoinjs + // https://github.com/bitcoinjs/bitcoinjs-lib/blob/10630873ebaa42381c5871e20336fbfb46564ac8/test/fixtures/ecdsa.json#L6 + var ecdsa = new ECDSA(); + ecdsa.hashbuf = Hash.sha256(new Buffer('Everything should be made as simple as possible, but not simpler.')); + ecdsa.privkey = new Privkey(new BN(1)); + ecdsa.privkey2pubkey(); + ecdsa.deterministicK(); + ecdsa.k.toBuffer().toString('hex') + .should.equal('ec633bd56a5774a0940cb97e27a9e4e51dc94af737596a0c5cbb3d30332d92a5'); + ecdsa.sign(); + ecdsa.sig.r.toString() + .should.equal('23362334225185207751494092901091441011938859014081160902781146257181456271561'); + ecdsa.sig.s.toString() + .should.equal('50433721247292933944369538617440297985091596895097604618403996029256432099938'); + }); + }); + + describe('#toPublicKey', function() { + it('should calculate the correct public key', function() { + ecdsa.k = new BN('114860389168127852803919605627759231199925249596762615988727970217268189974335', 10); + ecdsa.sign(); + ecdsa.sig.i = 0; + var pubkey = ecdsa.toPublicKey(); + pubkey.point.eq(ecdsa.pubkey.point).should.equal(true); + }); + + it('should calculate the correct public key for this signature with low s', function() { + ecdsa.k = new BN('114860389168127852803919605627759231199925249596762615988727970217268189974335', 10); + ecdsa.sig = Signature.fromString('3045022100ec3cfe0e335791ad278b4ec8eac93d0347' + + 'a97877bb1d54d35d189e225c15f6650220278cf15b05ce47fb37d2233802899d94c774d5480bba9f0f2d996baa13370c43'); + ecdsa.sig.i = 0; + var pubkey = ecdsa.toPublicKey(); + pubkey.point.eq(ecdsa.pubkey.point).should.equal(true); + }); + + it('should calculate the correct public key for this signature with high s', function() { + ecdsa.k = new BN('114860389168127852803919605627759231199925249596762615988727970217268189974335', 10); + ecdsa.sign(); + ecdsa.sig = Signature.fromString('3046022100ec3cfe0e335791ad278b4ec8eac93d0347' + + 'a97877bb1d54d35d189e225c15f665022100d8730ea4fa31b804c82ddcc7fd766269f33a079ea38e012c9238f2e2bcff34fe'); + ecdsa.sig.i = 1; + var pubkey = ecdsa.toPublicKey(); + pubkey.point.eq(ecdsa.pubkey.point).should.equal(true); + }); + + }); + + describe('#sigError', function() { + + it('should return an error if the hash is invalid', function() { + var ecdsa = new ECDSA(); + ecdsa.sigError().should.equal('hashbuf must be a 32 byte buffer'); + }); + + it('should return an error if r, s are invalid', function() { + var ecdsa = new ECDSA(); + ecdsa.hashbuf = Hash.sha256(new Buffer('test')); + var pk = Pubkey.fromDER(new Buffer('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49' + + '710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341', 'hex')); + ecdsa.pubkey = pk; + ecdsa.sig = new Signature(); + ecdsa.sig.r = new BN(0); + ecdsa.sig.s = new BN(0); + ecdsa.sigError().should.equal('r and s not in range'); + }); + + it('should return an error if the signature is incorrect', function() { + ecdsa.sig = Signature.fromString('3046022100e9915e6236695f093a4128ac2a956c40' + + 'ed971531de2f4f41ba05fac7e2bd019c02210094e6a4a769cc7f2a8ab3db696c7cd8d56bcdbfff860a8c81de4bc6a798b90827'); + ecdsa.sig.r = ecdsa.sig.r.add(new BN(1)); + ecdsa.sigError().should.equal('Invalid signature'); + }); + + }); + + describe('#sign', function() { + + it('should create a valid signature', function() { + ecdsa.randomK(); + ecdsa.sign(); + ecdsa.verify().verified.should.equal(true); + }); + + it('should should throw an error if hashbuf is not 32 bytes', function() { + var ecdsa2 = ECDSA().set({ + hashbuf: ecdsa.hashbuf.slice(0, 31), + privkey: ecdsa.privkey + }); + ecdsa2.randomK(); + ecdsa2.sign.bind(ecdsa2).should.throw('hashbuf must be a 32 byte buffer'); + }); + + it('should default to deterministicK', function() { + var ecdsa2 = new ECDSA(ecdsa); + ecdsa2.k = undefined; + var called = 0; + var deterministicK = ecdsa2.deterministicK.bind(ecdsa2); + ecdsa2.deterministicK = function() { + deterministicK(); + called++; + }; + ecdsa2.sign(); + called.should.equal(1); + }); + + it('should generate right K', function() { + var msg1 = new Buffer('52204d20fd0131ae1afd173fd80a3a746d2dcc0cddced8c9dc3d61cc7ab6e966', 'hex'); + var msg2 = [].reverse.call(new Buffer(msg1)) + var pk = new Buffer('16f243e962c59e71e54189e67e66cf2440a1334514c09c00ddcc21632bac9808', 'hex'); + var signature1 = ECDSA.sign(msg1, Privkey.fromBuffer(pk)).toBuffer().toString('hex'); + var signature2 = ECDSA.sign(msg2, Privkey.fromBuffer(pk), 'little').toBuffer().toString('hex'); + signature1.should.equal(signature2); + }); + + }); + + describe('#toString', function() { + it('should convert this to a string', function() { + var str = ecdsa.toString(); + (typeof str === 'string').should.equal(true); + }); + }); + + describe('signing and verification', function() { + describe('@sign', function() { + it('should produce a signature', function() { + var sig = ECDSA.sign(ecdsa.hashbuf, ecdsa.privkey); + (sig instanceof Signature).should.equal(true); + }); + it('should produce a signature, and be different when called twice', function() { + ecdsa.signRandomK(); + should.exist(ecdsa.sig); + var ecdsa2 = ECDSA(ecdsa); + ecdsa2.signRandomK(); + ecdsa.sig.toString().should.not.equal(ecdsa2.sig.toString()); + }); + }); + + describe('#verify', function() { + it('should verify a signature that was just signed', function() { + ecdsa.sig = Signature.fromString('3046022100e9915e6236695f093a4128ac2a956c' + + '40ed971531de2f4f41ba05fac7e2bd019c02210094e6a4a769cc7f2a8ab3db696c7cd8d56bcdbfff860a8c81de4bc6a798b90827'); + ecdsa.verify().verified.should.equal(true); + }); + it('should verify this known good signature', function() { + ecdsa.signRandomK(); + ecdsa.verify().verified.should.equal(true); + }); + it('should verify a valid signature, and unverify an invalid signature', function() { + var sig = ECDSA.sign(ecdsa.hashbuf, ecdsa.privkey); + ECDSA.verify(ecdsa.hashbuf, sig, ecdsa.pubkey).should.equal(true); + var fakesig = new Signature(sig.r.add(new BN(1)), sig.s); + ECDSA.verify(ecdsa.hashbuf, fakesig, ecdsa.pubkey).should.equal(false); + }); + it('should work with big and little endian', function() { + var sig = ECDSA.sign(ecdsa.hashbuf, ecdsa.privkey, 'big'); + ECDSA.verify(ecdsa.hashbuf, sig, ecdsa.pubkey, 'big').should.equal(true); + ECDSA.verify(ecdsa.hashbuf, sig, ecdsa.pubkey, 'little').should.equal(false); + sig = ECDSA.sign(ecdsa.hashbuf, ecdsa.privkey, 'little'); + ECDSA.verify(ecdsa.hashbuf, sig, ecdsa.pubkey, 'big').should.equal(false); + ECDSA.verify(ecdsa.hashbuf, sig, ecdsa.pubkey, 'little').should.equal(true); + }); + }); + + describe('vectors', function() { + + vectors.valid.forEach(function(obj, i) { + it('should validate valid vector ' + i, function() { + var ecdsa = ECDSA().set({ + privkey: new Privkey(BN.fromBuffer(new Buffer(obj.d, 'hex'))), + k: BN.fromBuffer(new Buffer(obj.k, 'hex')), + hashbuf: Hash.sha256(new Buffer(obj.message)), + sig: new Signature().set({ + r: new BN(obj.signature.r), + s: new BN(obj.signature.s), + i: obj.i + }) + }); + var ecdsa2 = ECDSA(ecdsa); + ecdsa2.k = undefined; + ecdsa2.sign(); + ecdsa2.calci(); + ecdsa2.k.toString().should.equal(ecdsa.k.toString()); + ecdsa2.sig.toString().should.equal(ecdsa.sig.toString()); + ecdsa2.sig.i.should.equal(ecdsa.sig.i); + ecdsa.verify().verified.should.equal(true); + }); + }); + + vectors.invalid.sigError.forEach(function(obj, i) { + it('should validate invalid.sigError vector ' + i + ': ' + obj.description, function() { + var ecdsa = ECDSA().set({ + pubkey: Pubkey.fromPoint(point.fromX(true, 1)), + sig: new Signature(new BN(obj.signature.r), new BN(obj.signature.s)), + hashbuf: Hash.sha256(new Buffer(obj.message)) + }); + ecdsa.sigError().should.equal(obj.exception); + }); + }); + + vectors.deterministicK.forEach(function(obj, i) { + it('should validate deterministicK vector ' + i, function() { + var hashbuf = Hash.sha256(new Buffer(obj.message)); + var privkey = Privkey(BN.fromBuffer(new Buffer(obj.privkey, 'hex')), 'mainnet'); + var ecdsa = ECDSA({ + privkey: privkey, + hashbuf: hashbuf + }); + ecdsa.deterministicK(0).k.toString('hex').should.equal(obj.k_bad00); + ecdsa.deterministicK(1).k.toString('hex').should.equal(obj.k_bad01); + ecdsa.deterministicK(15).k.toString('hex').should.equal(obj.k_bad15); + }); + }); + + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/crypto/hash.js b/packages/kauri-bitcore-lib/test/crypto/hash.js new file mode 100644 index 0000000..c079fee --- /dev/null +++ b/packages/kauri-bitcore-lib/test/crypto/hash.js @@ -0,0 +1,139 @@ +'use strict'; + +require('chai').should(); +var bitcore = require('../..'); +var Hash = bitcore.crypto.Hash; + +describe('Hash', function() { + var buf = new Buffer([0, 1, 2, 3, 253, 254, 255]); + var str = 'test string'; + + describe('@sha1', function() { + + it('calculates the hash of this buffer correctly', function() { + var hash = Hash.sha1(buf); + hash.toString('hex').should.equal('de69b8a4a5604d0486e6420db81e39eb464a17b2'); + hash = Hash.sha1(new Buffer(0)); + hash.toString('hex').should.equal('da39a3ee5e6b4b0d3255bfef95601890afd80709'); + }); + + it('throws an error when the input is not a buffer', function() { + Hash.sha1.bind(Hash, str).should.throw('Invalid Argument'); + }); + + }); + + describe('#sha256', function() { + + it('calculates the hash of this buffer correctly', function() { + var hash = Hash.sha256(buf); + hash.toString('hex').should.equal('6f2c7b22fd1626998287b3636089087961091de80311b9279c4033ec678a83e8'); + }); + + it('fails when the input is not a buffer', function() { + Hash.sha256.bind(Hash, str).should.throw('Invalid Argument'); + }); + + }); + + describe('#sha256hmac', function() { + + it('computes this known big key correctly', function() { + var key = new Buffer('b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad' + + 'b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad' + + 'b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad' + + 'b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad'); + var data = new Buffer(''); + Hash.sha256hmac(data, key).toString('hex') + .should.equal('fb1f87218671f1c0c4593a88498e02b6dfe8afd814c1729e89a1f1f6600faa23'); + }); + + it('computes this known empty test vector correctly', function() { + var key = new Buffer(''); + var data = new Buffer(''); + Hash.sha256hmac(data, key).toString('hex') + .should.equal('b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad'); + }); + + it('computes this known non-empty test vector correctly', function() { + var key = new Buffer('key'); + var data = new Buffer('The quick brown fox jumps over the lazy dog'); + Hash.sha256hmac(data, key).toString('hex') + .should.equal('f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8'); + }); + + }); + + describe('#sha256sha256', function() { + + it('calculates the hash of this buffer correctly', function() { + var hash = Hash.sha256sha256(buf); + hash.toString('hex').should.equal('be586c8b20dee549bdd66018c7a79e2b67bb88b7c7d428fa4c970976d2bec5ba'); + }); + + it('fails when the input is not a buffer', function() { + Hash.sha256sha256.bind(Hash, str).should.throw('Invalid Argument'); + }); + + }); + + describe('#sha256ripemd160', function() { + + it('calculates the hash of this buffer correctly', function() { + var hash = Hash.sha256ripemd160(buf); + hash.toString('hex').should.equal('7322e2bd8535e476c092934e16a6169ca9b707ec'); + }); + + it('fails when the input is not a buffer', function() { + Hash.sha256ripemd160.bind(Hash, str).should.throw('Invalid Argument'); + }); + + }); + + describe('#ripemd160', function() { + + it('calculates the hash of this buffer correctly', function() { + var hash = Hash.ripemd160(buf); + hash.toString('hex').should.equal('fa0f4565ff776fee0034c713cbf48b5ec06b7f5c'); + }); + + it('fails when the input is not a buffer', function() { + Hash.ripemd160.bind(Hash, str).should.throw('Invalid Argument'); + }); + + }); + + describe('#sha512', function() { + + it('calculates the hash of this buffer correctly', function() { + var hash = Hash.sha512(buf); + hash.toString('hex') + .should.equal('c0530aa32048f4904ae162bc14b9eb535eab6c465e960130005fedd' + + 'b71613e7d62aea75f7d3333ba06e805fc8e45681454524e3f8050969fe5a5f7f2392e31d0'); + }); + + it('fails when the input is not a buffer', function() { + Hash.sha512.bind(Hash, str).should.throw('Invalid Argument'); + }); + + }); + + describe('#sha512hmac', function() { + + it('calculates this known empty test vector correctly', function() { + var hex = 'b936cee86c9f87aa5d3c6f2e84cb5a4239a5fe50480a6ec66b70ab5b1f4a' + + 'c6730c6c515421b327ec1d69402e53dfb49ad7381eb067b338fd7b0cb22247225d47'; + Hash.sha512hmac(new Buffer([]), new Buffer([])).toString('hex').should.equal(hex); + }); + + it('calculates this known non-empty test vector correctly', function() { + var hex = 'c40bd7c15aa493b309c940e08a73ffbd28b2e4cb729eb94480d727e4df577' + + 'b13cc403a78e6150d83595f3b17c4cc331f12ca5952691de3735a63c1d4c69a2bac'; + var data = new Buffer('test1'); + var key = new Buffer('test2'); + Hash.sha512hmac(data, key).toString('hex').should.equal(hex); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/crypto/point.js b/packages/kauri-bitcore-lib/test/crypto/point.js new file mode 100644 index 0000000..95f5b53 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/crypto/point.js @@ -0,0 +1,173 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../..'); +var Point = bitcore.crypto.Point; +var BN = bitcore.crypto.BN; + +describe('Point', function() { + + var valid = { + x: 'ac242d242d23be966085a2b2b893d989f824e06c9ad0395a8a52f055ba39abb2', + y: '4836ab292c105a711ed10fcfd30999c31ff7c02456147747e03e739ad527c380', + }; + + var invalidPair = { + x: 'ac242d242d23be966085a2b2b893d989f824e06c9ad0395a8a52f055ba39abb2', + y: '0000000000000000000000000000000000000000000000000000000000000000', + }; + + it('should create a point', function() { + var p = Point(valid.x, valid.y); + should.exist(p); + }); + + it('should create a point when called with "new"', function() { + var p = new Point(valid.x,valid.y); + should.exist(p); + }); + + describe('#getX', function() { + + it('should return x', function() { + var p = Point(valid.x,valid.y); + var x = p.getX(); + x.toString('hex', 64).should.equal(valid.x); + }); + + it('should be convertable to a buffer', function() { + var p = Point(valid.x,valid.y); + var a = p.getX().toBuffer({size: 32}); + a.length.should.equal(32); + a.should.deep.equal(new Buffer(valid.x, 'hex')); + }); + + }); + + describe('#getY', function() { + + it('should return y', function() { + var p = Point(valid.x,valid.y); + p.getY().toString('hex', 64).should.equal(valid.y); + }); + + it('should be convertable to a buffer', function() { + var p = Point(valid.x,valid.y); + var a = p.getY().toBuffer({size: 32}); + a.length.should.equal(32); + a.should.deep.equal(new Buffer(valid.y, 'hex')); + }); + + }); + + describe('#add', function() { + + it('should accurately add g to itself', function() { + var p1 = Point.getG(); + var p2 = Point.getG(); + var p3 = p1.add(p2); + p3.getX().toString().should.equal('89565891926547004231252920425935692360644145829622209'+ + '833684329913297188986597'); + p3.getY().toString().should.equal('12158399299693830322967808612713398636155367887041628'+ + '176798871954788371653930'); + }); + + }); + + describe('#mul', function() { + + it('should accurately multiply g by 2', function() { + var g = Point.getG(); + var b = g.mul(new BN(2)); + b.getX().toString().should.equal('8956589192654700423125292042593569236064414582962220983'+ + '3684329913297188986597'); + b.getY().toString().should.equal('1215839929969383032296780861271339863615536788704162817'+ + '6798871954788371653930'); + }); + + it('should accurately multiply g by n-1', function() { + var g = Point.getG(); + var n = Point.getN(); + var b = g.mul(n.sub(new BN(1))); + b.getX().toString().should.equal('55066263022277343669578718895168534326250603453777594175'+ + '500187360389116729240'); + b.getY().toString().should.equal('83121579216557378445487899878180864668798711284981320763'+ + '518679672151497189239'); + }); + + //not sure if this is technically accurate or not... + //normally, you should always multiply g by something less than n + //but it is the same result in OpenSSL + it('should accurately multiply g by n+1', function() { + var g = Point.getG(); + var n = Point.getN(); + var b = g.mul(n.add(new BN(1))); + b.getX().toString().should.equal('550662630222773436695787188951685343262506034537775941755'+ + '00187360389116729240'); + b.getY().toString().should.equal('326705100207588169780830851305070431844712733806592432759'+ + '38904335757337482424'); + }); + + }); + + describe('@fromX', function() { + + it('should return g', function() { + var g = Point.getG(); + var p = Point.fromX(false, g.getX()); + g.eq(p).should.equal(true); + }); + + }); + + describe('#validate', function() { + + it('should describe this point as valid', function() { + var p = Point(valid.x, valid.y); + should.exist(p.validate()); + }); + + it('should describe this point as invalid because of zero y', function() { + var x = 'ac242d242d23be966085a2b2b893d989f824e06c9ad0395a8a52f055ba39abb2'; + var y = '0000000000000000000000000000000000000000000000000000000000000000'; + (function() { + var p = Point(x, y); + }).should.throw('Invalid y value for curve.'); + }); + + + it('should describe this point as invalid because of invalid y', function() { + var x = 'ac242d242d23be966085a2b2b893d989f824e06c9ad0395a8a52f055ba39abb2'; + var y = '00000000000000000000000000000000000000000000000000000000000000FF'; + (function() { + var p = Point(x, y); + }).should.throw('Invalid y value for curve.'); + }); + + + it('should describe this point as invalid because out of curve bounds', function() { + + // point larger than max + var x = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEDCE6AF48A03BBFD25E8CD0364141'; + // calculated y of x + var y = 'ed3970f129bc2ca7c7c6cf92fa7da4de6a1dfc9c14da4bf056aa868d3dd74034'; + + (function() { + // set the point + var p = Point(x, y); + }).should.throw('Point does not lie on the curve'); + }); + + it('should describe this point as invalid because out of curve bounds', function() { + + var x = '0000000000000000000000000000000000000000000000000000000000000000'; + + (function() { + // set the point + var p = Point.fromX(false, x); + }).should.throw('Invalid X'); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/crypto/random.js b/packages/kauri-bitcore-lib/test/crypto/random.js new file mode 100644 index 0000000..cf08bc2 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/crypto/random.js @@ -0,0 +1,36 @@ +'use strict'; + +var bitcore = require('../..'); +var Random = bitcore.crypto.Random; + +describe('Random', function() { + + describe('@getRandomBuffer', function() { + + it('should return a buffer', function() { + var bytes = Random.getRandomBuffer(8); + bytes.length.should.equal(8); + Buffer.isBuffer(bytes).should.equal(true); + }); + + it('should not equate two 256 bit random buffers', function() { + var bytes1 = Random.getRandomBuffer(32); + var bytes2 = Random.getRandomBuffer(32); + bytes1.toString('hex').should.not.equal(bytes2.toString('hex')); + }); + + it('should generate 100 8 byte buffers in a row that are not equal', function() { + var hexs = []; + for (var i = 0; i < 100; i++) { + hexs[i] = Random.getRandomBuffer(8).toString('hex'); + } + for (i = 0; i < 100; i++) { + for (var j = i + 1; j < 100; j++) { + hexs[i].should.not.equal(hexs[j]); + } + } + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/crypto/signature.js b/packages/kauri-bitcore-lib/test/crypto/signature.js new file mode 100644 index 0000000..5ea73c0 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/crypto/signature.js @@ -0,0 +1,340 @@ +'use strict'; + +var _ = require('lodash'); +var should = require('chai').should(); +var bitcore = require('../..'); +var BN = bitcore.crypto.BN; +var Signature = bitcore.crypto.Signature; +var JSUtil = bitcore.util.js; +var Interpreter = bitcore.Script.Interpreter; + +var sig_canonical = require('../data/bitcoind/sig_canonical'); +var sig_noncanonical = require('../data/bitcoind/sig_noncanonical'); + +describe('Signature', function() { + + it('should make a blank signature', function() { + var sig = new Signature(); + should.exist(sig); + }); + + it('should work with conveniently setting r, s', function() { + var r = new BN(); + var s = new BN(); + var sig = new Signature(r, s); + should.exist(sig); + sig.r.toString().should.equal(r.toString()); + sig.s.toString().should.equal(s.toString()); + }); + + describe('#set', function() { + + it('should set compressed', function() { + should.exist(Signature().set({ + compressed: true + })); + }); + + it('should set nhashtype', function() { + var sig = Signature().set({ + nhashtype: Signature.SIGHASH_ALL + }); + sig.nhashtype.should.equal(Signature.SIGHASH_ALL); + sig.set({ + nhashtype: Signature.SIGHASH_ALL | Signature.SIGHASH_ANYONECANPAY + }); + sig.nhashtype.should.equal(Signature.SIGHASH_ALL | Signature.SIGHASH_ANYONECANPAY); + }); + + }); + + describe('#fromCompact', function() { + + it('should create a signature from a compressed signature', function() { + var blank = new Buffer(32); + blank.fill(0); + var compressed = Buffer.concat([ + new Buffer([0 + 27 + 4]), + blank, + blank + ]); + var sig = Signature.fromCompact(compressed); + sig.r.cmp(BN.Zero).should.equal(0); + sig.s.cmp(BN.Zero).should.equal(0); + sig.compressed.should.equal(true); + }); + + it('should create a signature from an uncompressed signature', function() { + var sigHexaStr = '1cd5e61ab5bfd0d1450997894cb1a53e917f89d82eb43f06fa96f32c96e061aec12fc1188e8b' + + '0dc553a2588be2b5b68dbbd7f092894aa3397786e9c769c5348dc6'; + var sig = Signature.fromCompact(new Buffer(sigHexaStr, 'hex')); + var r = 'd5e61ab5bfd0d1450997894cb1a53e917f89d82eb43f06fa96f32c96e061aec1'; + var s = '2fc1188e8b0dc553a2588be2b5b68dbbd7f092894aa3397786e9c769c5348dc6'; + sig.r.toString('hex').should.equal(r); + sig.s.toString('hex').should.equal(s); + sig.compressed.should.equal(false); + }); + + }); + + describe('#fromDER', function() { + + var buf = new Buffer('3044022075fc517e541bd54769c080b64397e32161c850f6c1b2b67a5c433affbb3e62770220729e85cc46ffab881065ec07694220e71d4df9b2b8c8fd12c3122cf3a5efbcf2', 'hex'); + + it('should parse this DER format signature', function() { + var sig = Signature.fromDER(buf); + sig.r.toBuffer({ + size: 32 + }).toString('hex').should.equal('75fc517e541bd54769c080b64397e32161c850f6c1b2b67a5c433affbb3e6277'); + sig.s.toBuffer({ + size: 32 + }).toString('hex').should.equal('729e85cc46ffab881065ec07694220e71d4df9b2b8c8fd12c3122cf3a5efbcf2'); + }); + + }); + + describe('#fromString', function() { + + var buf = new Buffer('3044022075fc517e541bd54769c080b64397e32161c850f6c1b2b67a5c433affbb3e62770220729e85cc46ffab881065ec07694220e71d4df9b2b8c8fd12c3122cf3a5efbcf2', 'hex'); + + it('should parse this DER format signature in hex', function() { + var sig = Signature.fromString(buf.toString('hex')); + sig.r.toBuffer({ + size: 32 + }).toString('hex').should.equal('75fc517e541bd54769c080b64397e32161c850f6c1b2b67a5c433affbb3e6277'); + sig.s.toBuffer({ + size: 32 + }).toString('hex').should.equal('729e85cc46ffab881065ec07694220e71d4df9b2b8c8fd12c3122cf3a5efbcf2'); + }); + + }); + + describe('#toTxFormat', function() { + + it('should parse this known signature and rebuild it with updated zero-padded sighash types', function() { + var original = '30450221008bab1f0a2ff2f9cb8992173d8ad73c229d31ea8e10b0f4d4ae1a0d8ed76021fa02200993a6ec81755b9111762fc2cf8e3ede73047515622792110867d12654275e7201'; + var buf = new Buffer(original, 'hex'); + var sig = Signature.fromTxFormat(buf); + sig.nhashtype.should.equal(Signature.SIGHASH_ALL); + sig.set({ + nhashtype: Signature.SIGHASH_ALL | Signature.SIGHASH_ANYONECANPAY + }); + sig.toTxFormat().toString('hex').should.equal(original.slice(0, -2) + '81'); + sig.set({ + nhashtype: Signature.SIGHASH_SINGLE + }); + sig.toTxFormat().toString('hex').should.equal(original.slice(0, -2) + '03'); + }); + + }); + + describe('#fromTxFormat', function() { + + it('should convert from this known tx-format buffer', function() { + var buf = new Buffer('30450221008bab1f0a2ff2f9cb8992173d8ad73c229d31ea8e10b0f4d4ae1a0d8ed76021fa02200993a6ec81755b9111762fc2cf8e3ede73047515622792110867d12654275e7201', 'hex'); + var sig = Signature.fromTxFormat(buf); + sig.r.toString().should.equal('63173831029936981022572627018246571655303050627048489594159321588908385378810'); + sig.s.toString().should.equal('4331694221846364448463828256391194279133231453999942381442030409253074198130'); + sig.nhashtype.should.equal(Signature.SIGHASH_ALL); + }); + + it('should parse this known signature and rebuild it', function() { + var hex = '3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501'; + var buf = new Buffer(hex, 'hex'); + var sig = Signature.fromTxFormat(buf); + sig.toTxFormat().toString('hex').should.equal(hex); + }); + + }); + + describe('#parseDER', function() { + + it('should parse this signature generated in node', function() { + var sighex = '30450221008bab1f0a2ff2f9cb8992173d8ad73c229d31ea8e10b0f4d4ae1a0d8ed76021fa02200993a6ec81755b9111762fc2cf8e3ede73047515622792110867d12654275e72'; + var sig = new Buffer(sighex, 'hex'); + var parsed = Signature.parseDER(sig); + parsed.header.should.equal(0x30); + parsed.length.should.equal(69); + parsed.rlength.should.equal(33); + parsed.rneg.should.equal(true); + parsed.rbuf.toString('hex').should.equal('008bab1f0a2ff2f9cb8992173d8ad73c229d31ea8e10b0f4d4ae1a0d8ed76021fa'); + parsed.r.toString().should.equal('63173831029936981022572627018246571655303050627048489594159321588908385378810'); + parsed.slength.should.equal(32); + parsed.sneg.should.equal(false); + parsed.sbuf.toString('hex').should.equal('0993a6ec81755b9111762fc2cf8e3ede73047515622792110867d12654275e72'); + parsed.s.toString().should.equal('4331694221846364448463828256391194279133231453999942381442030409253074198130'); + }); + + it('should parse this 69 byte signature', function() { + var sighex = '3043021f59e4705959cc78acbfcf8bd0114e9cc1b389a4287fb33152b73a38c319b50302202f7428a27284c757e409bf41506183e9e49dfb54d5063796dfa0d403a4deccfa'; + var sig = new Buffer(sighex, 'hex'); + var parsed = Signature.parseDER(sig); + parsed.header.should.equal(0x30); + parsed.length.should.equal(67); + parsed.rlength.should.equal(31); + parsed.rneg.should.equal(false); + parsed.rbuf.toString('hex').should.equal('59e4705959cc78acbfcf8bd0114e9cc1b389a4287fb33152b73a38c319b503'); + parsed.r.toString().should.equal('158826015856106182499128681792325160381907915189052224498209222621383996675'); + parsed.slength.should.equal(32); + parsed.sneg.should.equal(false); + parsed.sbuf.toString('hex').should.equal('2f7428a27284c757e409bf41506183e9e49dfb54d5063796dfa0d403a4deccfa'); + parsed.s.toString().should.equal('21463938592353267769710297084836796652964571266930856168996063301532842380538'); + }); + + it('should parse this 68 byte signature', function() { + var sighex = '3042021e17cfe77536c3fb0526bd1a72d7a8e0973f463add210be14063c8a9c37632022061bfa677f825ded82ba0863fb0c46ca1388dd3e647f6a93c038168b59d131a51'; + var sig = new Buffer(sighex, 'hex'); + var parsed = Signature.parseDER(sig); + parsed.header.should.equal(0x30); + parsed.length.should.equal(66); + parsed.rlength.should.equal(30); + parsed.rneg.should.equal(false); + parsed.rbuf.toString('hex').should.equal('17cfe77536c3fb0526bd1a72d7a8e0973f463add210be14063c8a9c37632'); + parsed.r.toString().should.equal('164345250294671732127776123343329699648286106708464198588053542748255794'); + parsed.slength.should.equal(32); + parsed.sneg.should.equal(false); + parsed.sbuf.toString('hex').should.equal('61bfa677f825ded82ba0863fb0c46ca1388dd3e647f6a93c038168b59d131a51'); + parsed.s.toString().should.equal('44212963026209759051804639008236126356702363229859210154760104982946304432721'); + }); + + it('should parse this signature from script_valid.json', function() { + var sighex = '304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef051'; + var sig = Buffer(sighex, 'hex'); + var parsed = Signature.parseDER(sig, false); + should.exist(parsed); + }); + + }); + + describe('#toDER', function() { + + it('should convert these known r and s values into a known signature', function() { + var r = new BN('63173831029936981022572627018246571655303050627048489594159321588908385378810'); + var s = new BN('4331694221846364448463828256391194279133231453999942381442030409253074198130'); + var sig = new Signature({ + r: r, + s: s + }); + var der = sig.toDER(r, s); + der.toString('hex').should.equal('30450221008bab1f0a2ff2f9cb8992173d8ad73c229d31ea8e10b0f4d4ae1a0d8ed76021fa02200993a6ec81755b9111762fc2cf8e3ede73047515622792110867d12654275e72'); + }); + + }); + + describe('#toString', function() { + it('should convert this signature in to hex DER', function() { + var r = new BN('63173831029936981022572627018246571655303050627048489594159321588908385378810'); + var s = new BN('4331694221846364448463828256391194279133231453999942381442030409253074198130'); + var sig = new Signature({ + r: r, + s: s + }); + var hex = sig.toString(); + hex.should.equal('30450221008bab1f0a2ff2f9cb8992173d8ad73c229d31ea8e10b0f4d4ae1a0d8ed76021fa02200993a6ec81755b9111762fc2cf8e3ede73047515622792110867d12654275e72'); + }); + }); + + + describe('@isTxDER', function() { + it('should know this is a DER signature', function() { + var sighex = '3042021e17cfe77536c3fb0526bd1a72d7a8e0973f463add210be14063c8a9c37632022061bfa677f825ded82ba0863fb0c46ca1388dd3e647f6a93c038168b59d131a5101'; + var sigbuf = new Buffer(sighex, 'hex'); + Signature.isTxDER(sigbuf).should.equal(true); + }); + + it('should know this is not a DER signature', function() { + //for more extensive tests, see the script interpreter + var sighex = '3042021e17cfe77536c3fb0526bd1a72d7a8e0973f463add210be14063c8a9c37632022061bfa677f825ded82ba0863fb0c46ca1388dd3e647f6a93c038168b59d131a5101'; + var sigbuf = new Buffer(sighex, 'hex'); + sigbuf[0] = 0x31; + Signature.isTxDER(sigbuf).should.equal(false); + }); + + + describe('bitcoind fixtures', function() { + var test_sigs = function(set, expected) { + var i = 0; + set.forEach(function(vector) { + if (!JSUtil.isHexa(vector)) { + // non-hex strings are ignored + return; + } + it('should be ' + (expected ? '' : 'in') + 'valid for fixture #' + i, function() { + var sighex = vector; + var interp = Interpreter(); + interp.flags = Interpreter.SCRIPT_VERIFY_DERSIG | + Interpreter.SCRIPT_VERIFY_STRICTENC; + var result = interp.checkSignatureEncoding(new Buffer(sighex, 'hex')); + result.should.equal(expected); + }); + i++; + }); + }; + test_sigs(sig_canonical, true); + test_sigs(sig_noncanonical, false); + }); + + }); + describe('#hasLowS', function() { + it('should detect high and low S', function() { + var r = new BN('63173831029936981022572627018246571655303050627048489594159321588908385378810'); + + var sig = new Signature({ + r: r, + s: new BN('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A1', 'hex') + }); + sig.hasLowS().should.equal(false); + + var sig2 = new Signature({ + r: r, + s: new BN('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex') + }); + sig2.hasLowS().should.equal(true); + + var sig3 = new Signature({ + r: r, + s: new BN(1) + }); + sig3.hasLowS().should.equal(true); + + var sig4 = new Signature({ + r: r, + s: new BN(0) + }); + sig4.hasLowS().should.equal(false); + + }); + }); + + describe('#hasDefinedHashtype', function() { + it('should reject invalid sighash types and accept valid ones', function() { + var sig = new Signature(); + sig.hasDefinedHashtype().should.equal(false); + var testCases = [ + [undefined, false], + [null, false], + [0, false], + [1.1, false], + [-1, false], + [-1.1, false], + ['', false], + ['1', false], + [Signature.SIGHASH_ANYONECANPAY, false], + [Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_ALL, true], + [Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_NONE, true], + [Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_SINGLE, true], + [Signature.SIGHASH_ALL, true], + [Signature.SIGHASH_NONE, true], + [Signature.SIGHASH_SINGLE, true], + [Signature.SIGHASH_SINGLE + 1, false], + [(Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_SINGLE) + 1, false], + [(Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_ALL) - 1, false], + ]; + _.each(testCases, function(testCase) { + sig.nhashtype = testCase[0]; + sig.hasDefinedHashtype().should.equal(testCase[1]); + }); + }); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/data/bip69.json b/packages/kauri-bitcore-lib/test/data/bip69.json new file mode 100644 index 0000000..7a46d81 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bip69.json @@ -0,0 +1,215 @@ +{ + "inputs": [ + { + "description": "Ordered by txId, descending (reverse-byte-order ascending)", + "inputs": [ + { + "txId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "vout": 0 + }, + { + "txId": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "vout": 0 + }, + { + "txId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "vout": 0 + }, + { + "txId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbff", + "vout": 0 + }, + { + "txId": "ffbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "vout": 0 + } + ], + "expected": [0, 2, 3, 1, 4] + }, + { + "description": "Ordered by vout, ascending", + "inputs": [ + { + "txId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "vout": 1 + }, + { + "txId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "vout": 2 + }, + { + "txId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "vout": 0 + } + ], + "expected": [2, 0, 1] + }, + { + "description": "Ordered by txId, then vout", + "inputs": [ + { + "txId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "vout": 99 + }, + { + "txId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "vout": 99 + }, + { + "txId": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "vout": 0 + }, + { + "txId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "vout": 0 + } + ], + "expected": [0, 3, 1, 2] + }, + { + "description": "BIP69 test vector 1", + "inputs": [ + { "txId": "0e53ec5dfb2cb8a71fec32dc9a634a35b7e24799295ddd5278217822e0b31f57", "vout": 0 }, + { "txId": "26aa6e6d8b9e49bb0630aac301db6757c02e3619feb4ee0eea81eb1672947024", "vout": 1 }, + { "txId": "28e0fdd185542f2c6ea19030b0796051e7772b6026dd5ddccd7a2f93b73e6fc2", "vout": 0 }, + { "txId": "381de9b9ae1a94d9c17f6a08ef9d341a5ce29e2e60c36a52d333ff6203e58d5d", "vout": 1 }, + { "txId": "3b8b2f8efceb60ba78ca8bba206a137f14cb5ea4035e761ee204302d46b98de2", "vout": 0 }, + { "txId": "402b2c02411720bf409eff60d05adad684f135838962823f3614cc657dd7bc0a", "vout": 1 }, + { "txId": "54ffff182965ed0957dba1239c27164ace5a73c9b62a660c74b7b7f15ff61e7a", "vout": 1 }, + { "txId": "643e5f4e66373a57251fb173151e838ccd27d279aca882997e005016bb53d5aa", "vout": 0 }, + { "txId": "6c1d56f31b2de4bfc6aaea28396b333102b1f600da9c6d6149e96ca43f1102b1", "vout": 1 }, + { "txId": "7a1de137cbafb5c70405455c49c5104ca3057a1f1243e6563bb9245c9c88c191", "vout": 0 }, + { "txId": "7d037ceb2ee0dc03e82f17be7935d238b35d1deabf953a892a4507bfbeeb3ba4", "vout": 1 }, + { "txId": "a5e899dddb28776ea9ddac0a502316d53a4a3fca607c72f66c470e0412e34086", "vout": 0 }, + { "txId": "b4112b8f900a7ca0c8b0e7c4dfad35c6be5f6be46b3458974988e1cdb2fa61b8", "vout": 0 }, + { "txId": "bafd65e3c7f3f9fdfdc1ddb026131b278c3be1af90a4a6ffa78c4658f9ec0c85", "vout": 0 }, + { "txId": "de0411a1e97484a2804ff1dbde260ac19de841bebad1880c782941aca883b4e9", "vout": 1 }, + { "txId": "f0a130a84912d03c1d284974f563c5949ac13f8342b8112edff52971599e6a45", "vout": 0 }, + { "txId": "f320832a9d2e2452af63154bc687493484a0e7745ebd3aaf9ca19eb80834ad60", "vout": 0 } + ], + "expected": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] + }, + { + "description": "BIP69 test vector 2", + "inputs": [ + { "txId": "35288d269cee1941eaebb2ea85e32b42cdb2b04284a56d8b14dcc3f5c65d6055", "vout": 0 }, + { "txId": "35288d269cee1941eaebb2ea85e32b42cdb2b04284a56d8b14dcc3f5c65d6055", "vout": 1 } + ], + "expected": [0, 1] + } + ], + "outputs": [ + { + "description": "Ordered by Amount, ascending", + "outputs": [ + { + "script": "00000000", + "value": 3000 + }, + { + "script": "00000000", + "value": 2000 + }, + { + "script": "00000000", + "value": 1000 + } + ], + "expected": [2, 1, 0] + }, + { + "description": "Ordered by Script, ascending", + "outputs": [ + { + "script": "00000000", + "value": 1000 + }, + { + "script": "22222222", + "value": 1000 + }, + { + "script": "11111111", + "value": 1000 + } + ], + "expected": [0, 2, 1] + }, + { + "description": "Ordered by Amount, then Script", + "outputs": [ + { + "script": "11111111", + "value": 1000 + }, + { + "script": "11111111", + "value": 2000 + }, + { + "script": "00000000", + "value": 3000 + }, + { + "script": "00000000", + "value": 2000 + } + ], + "expected": [0, 3, 1, 2] + }, + { + "description": "Sorting is irrelevant for equivalent outputs", + "outputs": [ + { + "script": "00000000", + "value": 2000 + }, + { + "script": "11111111", + "value": 2000 + }, + { + "script": "00000000", + "value": 2000 + }, + { + "script": "11111111", + "value": 3000 + }, + { + "script": "22222222", + "value": 3000 + } + ], + "expected": [0, 2, 1, 3, 4] + }, + { + "description": "BIP69 test vector 1", + "outputs": [ + { + "script": "76a9144a5fba237213a062f6f57978f796390bdcf8d01588ac", + "value": 400057456 + }, + { + "script": "76a9145be32612930b8323add2212a4ec03c1562084f8488ac", + "value": 40000000000 + } + ], + "expected": [0, 1] + }, + { + "description": "BIP69 test vector 2", + "outputs": [ + { + "script": "41046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac", + "value": 100000000 + }, + { + "script": "41044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac", + "value": 2400000000 + } + ], + "expected": [0, 1] + } + ] +} diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_invalid.json b/packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_invalid.json new file mode 100644 index 0000000..615fe55 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_invalid.json @@ -0,0 +1,152 @@ +[ + [ + "" + ], + [ + "x" + ], + [ + "37qgekLpCCHrQuSjvX3fs496FWTGsHFHizjJAs6NPcR47aefnnCWECAhHV6E3g4YN7u7Yuwod5Y" + ], + [ + "dzb7VV1Ui55BARxv7ATxAtCUeJsANKovDGWFVgpTbhq9gvPqP3yv" + ], + [ + "MuNu7ZAEDFiHthiunm7dPjwKqrVNCM3mAz6rP9zFveQu14YA8CxExSJTHcVP9DErn6u84E6Ej7S" + ], + [ + "rPpQpYknyNQ5AEHuY6H8ijJJrYc2nDKKk9jjmKEXsWzyAQcFGpDLU2Zvsmoi8JLR7hAwoy3RQWf" + ], + [ + "4Uc3FmN6NQ6zLBK5QQBXRBUREaaHwCZYsGCueHauuDmJpZKn6jkEskMB2Zi2CNgtb5r6epWEFfUJq" + ], + [ + "7aQgR5DFQ25vyXmqZAWmnVCjL3PkBcdVkBUpjrjMTcghHx3E8wb" + ], + [ + "17QpPprjeg69fW1DV8DcYYCKvWjYhXvWkov6MJ1iTTvMFj6weAqW7wybZeH57WTNxXVCRH4veVs" + ], + [ + "KxuACDviz8Xvpn1xAh9MfopySZNuyajYMZWz16Dv2mHHryznWUp3" + ], + [ + "7nK3GSmqdXJQtdohvGfJ7KsSmn3TmGqExug49583bDAL91pVSGq5xS9SHoAYL3Wv3ijKTit65th" + ], + [ + "cTivdBmq7bay3RFGEBBuNfMh2P1pDCgRYN2Wbxmgwr4ki3jNUL2va" + ], + [ + "gjMV4vjNjyMrna4fsAr8bWxAbwtmMUBXJS3zL4NJt5qjozpbQLmAfK1uA3CquSqsZQMpoD1g2nk" + ], + [ + "emXm1naBMoVzPjbk7xpeTVMFy4oDEe25UmoyGgKEB1gGWsK8kRGs" + ], + [ + "7VThQnNRj1o3Zyvc7XHPRrjDf8j2oivPTeDXnRPYWeYGE4pXeRJDZgf28ppti5hsHWXS2GSobdqyo" + ], + [ + "1G9u6oCVCPh2o8m3t55ACiYvG1y5BHewUkDSdiQarDcYXXhFHYdzMdYfUAhfxn5vNZBwpgUNpso" + ], + [ + "31QQ7ZMLkScDiB4VyZjuptr7AEc9j1SjstF7pRoLhHTGkW4Q2y9XELobQmhhWxeRvqcukGd1XCq" + ], + [ + "DHqKSnpxa8ZdQyH8keAhvLTrfkyBMQxqngcQA5N8LQ9KVt25kmGN" + ], + [ + "2LUHcJPbwLCy9GLH1qXmfmAwvadWw4bp4PCpDfduLqV17s6iDcy1imUwhQJhAoNoN1XNmweiJP4i" + ], + [ + "7USRzBXAnmck8fX9HmW7RAb4qt92VFX6soCnts9s74wxm4gguVhtG5of8fZGbNPJA83irHVY6bCos" + ], + [ + "1DGezo7BfVebZxAbNT3XGujdeHyNNBF3vnficYoTSp4PfK2QaML9bHzAMxke3wdKdHYWmsMTJVu" + ], + [ + "2D12DqDZKwCxxkzs1ZATJWvgJGhQ4cFi3WrizQ5zLAyhN5HxuAJ1yMYaJp8GuYsTLLxTAz6otCfb" + ], + [ + "8AFJzuTujXjw1Z6M3fWhQ1ujDW7zsV4ePeVjVo7D1egERqSW9nZ" + ], + [ + "163Q17qLbTCue8YY3AvjpUhotuaodLm2uqMhpYirsKjVqnxJRWTEoywMVY3NbBAHuhAJ2cF9GAZ" + ], + [ + "2MnmgiRH4eGLyLc9eAqStzk7dFgBjFtUCtu" + ], + [ + "461QQ2sYWxU7H2PV4oBwJGNch8XVTYYbZxU" + ], + [ + "2UCtv53VttmQYkVU4VMtXB31REvQg4ABzs41AEKZ8UcB7DAfVzdkV9JDErwGwyj5AUHLkmgZeobs" + ], + [ + "cSNjAsnhgtiFMi6MtfvgscMB2Cbhn2v1FUYfviJ1CdjfidvmeW6mn" + ], + [ + "gmsow2Y6EWAFDFE1CE4Hd3Tpu2BvfmBfG1SXsuRARbnt1WjkZnFh1qGTiptWWbjsq2Q6qvpgJVj" + ], + [ + "nksUKSkzS76v8EsSgozXGMoQFiCoCHzCVajFKAXqzK5on9ZJYVHMD5CKwgmX3S3c7M1U3xabUny" + ], + [ + "L3favK1UzFGgdzYBF2oBT5tbayCo4vtVBLJhg2iYuMeePxWG8SQc" + ], + [ + "7VxLxGGtYT6N99GdEfi6xz56xdQ8nP2dG1CavuXx7Rf2PrvNMTBNevjkfgs9JmkcGm6EXpj8ipyPZ" + ], + [ + "2mbZwFXF6cxShaCo2czTRB62WTx9LxhTtpP" + ], + [ + "dB7cwYdcPSgiyAwKWL3JwCVwSk6epU2txw" + ], + [ + "HPhFUhUAh8ZQQisH8QQWafAxtQYju3SFTX" + ], + [ + "4ctAH6AkHzq5ioiM1m9T3E2hiYEev5mTsB" + ], + [ + "Hn1uFi4dNexWrqARpjMqgT6cX1UsNPuV3cHdGg9ExyXw8HTKadbktRDtdeVmY3M1BxJStiL4vjJ" + ], + [ + "Sq3fDbvutABmnAHHExJDgPLQn44KnNC7UsXuT7KZecpaYDMU9Txs" + ], + [ + "6TqWyrqdgUEYDQU1aChMuFMMEimHX44qHFzCUgGfqxGgZNMUVWJ" + ], + [ + "giqJo7oWqFxNKWyrgcBxAVHXnjJ1t6cGoEffce5Y1y7u649Noj5wJ4mmiUAKEVVrYAGg2KPB3Y4" + ], + [ + "cNzHY5e8vcmM3QVJUcjCyiKMYfeYvyueq5qCMV3kqcySoLyGLYUK" + ], + [ + "37uTe568EYc9WLoHEd9jXEvUiWbq5LFLscNyqvAzLU5vBArUJA6eydkLmnMwJDjkL5kXc2VK7ig" + ], + [ + "EsYbG4tWWWY45G31nox838qNdzksbPySWc" + ], + [ + "nbuzhfwMoNzA3PaFnyLcRxE9bTJPDkjZ6Rf6Y6o2ckXZfzZzXBT" + ], + [ + "cQN9PoxZeCWK1x56xnz6QYAsvR11XAce3Ehp3gMUdfSQ53Y2mPzx" + ], + [ + "1Gm3N3rkef6iMbx4voBzaxtXcmmiMTqZPhcuAepRzYUJQW4qRpEnHvMojzof42hjFRf8PE2jPde" + ], + [ + "2TAq2tuN6x6m233bpT7yqdYQPELdTDJn1eU" + ], + [ + "ntEtnnGhqPii4joABvBtSEJG6BxjT2tUZqE8PcVYgk3RHpgxgHDCQxNbLJf7ardf1dDk2oCQ7Cf" + ], + [ + "Ky1YjoZNgQ196HJV3HpdkecfhRBmRZdMJk89Hi5KGfpfPwS2bUbfd" + ], + [ + "2A1q1YsMZowabbvta7kTy2Fd6qN4r5ZCeG3qLpvZBMzCixMUdkN2Y4dHB1wPsZAeVXUGD83MfRED" + ] +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_valid.json b/packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_valid.json new file mode 100644 index 0000000..4a8d352 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/base58_keys_valid.json @@ -0,0 +1,452 @@ +[ + [ + "1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i", + "65a16059864a2fdbc7c99a4723a8395bc6f188eb", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3CMNFxN1oHBc4R1EpboAL5yzHGgE611Xou", + "74f209f6ea907e2ea48f74fae05782ae8a665257", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "mo9ncXisMeAoXwqcV5EWuyncbmCcQN4rVs", + "53c0307d6851aa0ce7825ba883c6bd9ad242b486", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2N2JD6wb56AfK4tfmM6PwdVmoYk2dCKf4Br", + "6349a418fc4578d10a372b54b45c280cc8c4382f", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr", + "eddbdc1168f1daeadbd3e44c1e3f8f5a284c2029f78ad26af98583a499de5b19", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "Kz6UJmQACJmLtaQj5A3JAge4kVTNQ8gbvXuwbmCj7bsaabudb3RD", + "55c9bccb9ed68446d1b75273bbce89d7fe013a8acd1625514420fb2aca1a21c4", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "9213qJab2HNEpMpYNBa7wHGFKKbkDn24jpANDs2huN3yi4J11ko", + "36cb93b9ab1bdabf7fb9f2c04f1b9cc879933530ae7842398eef5a63a56800c2", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cTpB4YiyKiBcPxnefsDpbnDxFDffjqJob8wGCEDXxgQ7zQoMXJdH", + "b9f4892c9e8282028fea1d2667c4dc5213564d41fc5783896a0d843fc15089f3", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1Ax4gZtb7gAit2TivwejZHYtNNLT18PUXJ", + "6d23156cbbdcc82a5a47eee4c2c7c583c18b6bf4", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3QjYXhTkvuj8qPaXHTTWb5wjXhdsLAAWVy", + "fcc5460dd6e2487c7d75b1963625da0e8f4c5975", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "n3ZddxzLvAY9o7184TB4c6FJasAybsw4HZ", + "f1d470f9b02370fdec2e6b708b08ac431bf7a5f7", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2NBFNJTktNa7GZusGbDbGKRZTxdK9VVez3n", + "c579342c2c4c9220205e2cdc285617040c924a0a", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5K494XZwps2bGyeL71pWid4noiSNA2cfCibrvRWqcHSptoFn7rc", + "a326b95ebae30164217d7a7f57d72ab2b54e3be64928a19da0210b9568d4015e", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L1RrrnXkcKut5DEMwtDthjwRcTTwED36thyL1DebVrKuwvohjMNi", + "7d998b45c219a1e38e99e7cbd312ef67f77a455a9b50c730c27f02c6f730dfb4", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "93DVKyFYwSN6wEo3E2fCrFPUp17FtrtNi2Lf7n4G3garFb16CRj", + "d6bca256b5abc5602ec2e1c121a08b0da2556587430bcf7e1898af2224885203", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cTDVKtMGVYWTHCb1AFjmVbEbWjvKpKqKgMaR3QJxToMSQAhmCeTN", + "a81ca4e8f90181ec4b61b6a7eb998af17b2cb04de8a03b504b9e34c4c61db7d9", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1C5bSj1iEGUgSTbziymG7Cn18ENQuT36vv", + "7987ccaa53d02c8873487ef919677cd3db7a6912", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3AnNxabYGoTxYiTEZwFEnerUoeFXK2Zoks", + "63bcc565f9e68ee0189dd5cc67f1b0e5f02f45cb", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "n3LnJXCqbPjghuVs8ph9CYsAe4Sh4j97wk", + "ef66444b5b17f14e8fae6e7e19b045a78c54fd79", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2NB72XtkjpnATMggui83aEtPawyyKvnbX2o", + "c3e55fceceaa4391ed2a9677f4a4d34eacd021a0", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5KaBW9vNtWNhc3ZEDyNCiXLPdVPHCikRxSBWwV9NrpLLa4LsXi9", + "e75d936d56377f432f404aabb406601f892fd49da90eb6ac558a733c93b47252", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L1axzbSyynNYA8mCAhzxkipKkfHtAXYF4YQnhSKcLV8YXA874fgT", + "8248bd0375f2f75d7e274ae544fb920f51784480866b102384190b1addfbaa5c", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "927CnUkUbasYtDwYwVn2j8GdTuACNnKkjZ1rpZd2yBB1CLcnXpo", + "44c4f6a096eac5238291a94cc24c01e3b19b8d8cef72874a079e00a242237a52", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cUcfCMRjiQf85YMzzQEk9d1s5A4K7xL5SmBCLrezqXFuTVefyhY7", + "d1de707020a9059d6d3abaf85e17967c6555151143db13dbb06db78df0f15c69", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1Gqk4Tv79P91Cc1STQtU3s1W6277M2CVWu", + "adc1cc2081a27206fae25792f28bbc55b831549d", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "33vt8ViH5jsr115AGkW6cEmEz9MpvJSwDk", + "188f91a931947eddd7432d6e614387e32b244709", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "mhaMcBxNh5cqXm4aTQ6EcVbKtfL6LGyK2H", + "1694f5bc1a7295b600f40018a618a6ea48eeb498", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2MxgPqX1iThW3oZVk9KoFcE5M4JpiETssVN", + "3b9b3fd7a50d4f08d1a5b0f62f644fa7115ae2f3", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5HtH6GdcwCJA4ggWEL1B3jzBBUB8HPiBi9SBc5h9i4Wk4PSeApR", + "091035445ef105fa1bb125eccfb1882f3fe69592265956ade751fd095033d8d0", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L2xSYmMeVo3Zek3ZTsv9xUrXVAmrWxJ8Ua4cw8pkfbQhcEFhkXT8", + "ab2b4bcdfc91d34dee0ae2a8c6b6668dadaeb3a88b9859743156f462325187af", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "92xFEve1Z9N8Z641KQQS7ByCSb8kGjsDzw6fAmjHN1LZGKQXyMq", + "b4204389cef18bbe2b353623cbf93e8678fbc92a475b664ae98ed594e6cf0856", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cVM65tdYu1YK37tNoAyGoJTR13VBYFva1vg9FLuPAsJijGvG6NEA", + "e7b230133f1b5489843260236b06edca25f66adb1be455fbd38d4010d48faeef", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1JwMWBVLtiqtscbaRHai4pqHokhFCbtoB4", + "c4c1b72491ede1eedaca00618407ee0b772cad0d", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3QCzvfL4ZRvmJFiWWBVwxfdaNBT8EtxB5y", + "f6fe69bcb548a829cce4c57bf6fff8af3a5981f9", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "mizXiucXRCsEriQCHUkCqef9ph9qtPbZZ6", + "261f83568a098a8638844bd7aeca039d5f2352c0", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2NEWDzHWwY5ZZp8CQWbB7ouNMLqCia6YRda", + "e930e1834a4d234702773951d627cce82fbb5d2e", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5KQmDryMNDcisTzRp3zEq9e4awRmJrEVU1j5vFRTKpRNYPqYrMg", + "d1fab7ab7385ad26872237f1eb9789aa25cc986bacc695e07ac571d6cdac8bc0", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L39Fy7AC2Hhj95gh3Yb2AU5YHh1mQSAHgpNixvm27poizcJyLtUi", + "b0bbede33ef254e8376aceb1510253fc3550efd0fcf84dcd0c9998b288f166b3", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "91cTVUcgydqyZLgaANpf1fvL55FH53QMm4BsnCADVNYuWuqdVys", + "037f4192c630f399d9271e26c575269b1d15be553ea1a7217f0cb8513cef41cb", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cQspfSzsgLeiJGB2u8vrAiWpCU4MxUT6JseWo2SjXy4Qbzn2fwDw", + "6251e205e8ad508bab5596bee086ef16cd4b239e0cc0c5d7c4e6035441e7d5de", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "19dcawoKcZdQz365WpXWMhX6QCUpR9SY4r", + "5eadaf9bb7121f0f192561a5a62f5e5f54210292", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "37Sp6Rv3y4kVd1nQ1JV5pfqXccHNyZm1x3", + "3f210e7277c899c3a155cc1c90f4106cbddeec6e", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "myoqcgYiehufrsnnkqdqbp69dddVDMopJu", + "c8a3c2a09a298592c3e180f02487cd91ba3400b5", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2N7FuwuUuoTBrDFdrAZ9KxBmtqMLxce9i1C", + "99b31df7c9068d1481b596578ddbb4d3bd90baeb", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5KL6zEaMtPRXZKo1bbMq7JDjjo1bJuQcsgL33je3oY8uSJCR5b4", + "c7666842503db6dc6ea061f092cfb9c388448629a6fe868d068c42a488b478ae", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "KwV9KAfwbwt51veZWNscRTeZs9CKpojyu1MsPnaKTF5kz69H1UN2", + "07f0803fc5399e773555ab1e8939907e9badacc17ca129e67a2f5f2ff84351dd", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "93N87D6uxSBzwXvpokpzg8FFmfQPmvX4xHoWQe3pLdYpbiwT5YV", + "ea577acfb5d1d14d3b7b195c321566f12f87d2b77ea3a53f68df7ebf8604a801", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cMxXusSihaX58wpJ3tNuuUcZEQGt6DKJ1wEpxys88FFaQCYjku9h", + "0b3b34f0958d8a268193a9814da92c3e8b58b4a4378a542863e34ac289cd830c", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "13p1ijLwsnrcuyqcTvJXkq2ASdXqcnEBLE", + "1ed467017f043e91ed4c44b4e8dd674db211c4e6", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3ALJH9Y951VCGcVZYAdpA3KchoP9McEj1G", + "5ece0cadddc415b1980f001785947120acdb36fc", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ] +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/blocks.json b/packages/kauri-bitcore-lib/test/data/bitcoind/blocks.json new file mode 100644 index 0000000..8f7ceb8 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/blocks.json @@ -0,0 +1,27 @@ +[ + { + "comment": "A random real block (0000000000013b8ab2cd513b0261a14096412195a72a0c4827d229dcc7e0f7af) with 9 transactions", + "transactions": 9, + "data": "0100000090f0a9f110702f808219ebea1173056042a714bad51b916cb6800000000000005275289558f51c9966699404ae2294730c3c9f9bda53523ce50e9b95e558da2fdb261b4d4c86041b1ab1bf930901000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0146ffffffff0100f2052a01000000434104e18f7afbe4721580e81e8414fc8c24d7cfacf254bb5c7b949450c3e997c2dc1242487a8169507b631eb3771f2b425483fb13102c4eb5d858eef260fe70fbfae0ac00000000010000000196608ccbafa16abada902780da4dc35dafd7af05fa0da08cf833575f8cf9e836000000004a493046022100dab24889213caf43ae6adc41cf1c9396c08240c199f5225acf45416330fd7dbd022100fe37900e0644bf574493a07fc5edba06dbc07c311b947520c2d514bc5725dcb401ffffffff0100f2052a010000001976a914f15d1921f52e4007b146dfa60f369ed2fc393ce288ac000000000100000001fb766c1288458c2bafcfec81e48b24d98ec706de6b8af7c4e3c29419bfacb56d000000008c493046022100f268ba165ce0ad2e6d93f089cfcd3785de5c963bb5ea6b8c1b23f1ce3e517b9f022100da7c0f21adc6c401887f2bfd1922f11d76159cbc597fbd756a23dcbb00f4d7290141042b4e8625a96127826915a5b109852636ad0da753c9e1d5606a50480cd0c40f1f8b8d898235e571fe9357d9ec842bc4bba1827daaf4de06d71844d0057707966affffffff0280969800000000001976a9146963907531db72d0ed1a0cfb471ccb63923446f388ac80d6e34c000000001976a914f0688ba1c0d1ce182c7af6741e02658c7d4dfcd388ac000000000100000002c40297f730dd7b5a99567eb8d27b78758f607507c52292d02d4031895b52f2ff010000008b483045022100f7edfd4b0aac404e5bab4fd3889e0c6c41aa8d0e6fa122316f68eddd0a65013902205b09cc8b2d56e1cd1f7f2fafd60a129ed94504c4ac7bdc67b56fe67512658b3e014104732012cb962afa90d31b25d8fb0e32c94e513ab7a17805c14ca4c3423e18b4fb5d0e676841733cb83abaf975845c9f6f2a8097b7d04f4908b18368d6fc2d68ecffffffffca5065ff9617cbcba45eb23726df6498a9b9cafed4f54cbab9d227b0035ddefb000000008a473044022068010362a13c7f9919fa832b2dee4e788f61f6f5d344a7c2a0da6ae740605658022006d1af525b9a14a35c003b78b72bd59738cd676f845d1ff3fc25049e01003614014104732012cb962afa90d31b25d8fb0e32c94e513ab7a17805c14ca4c3423e18b4fb5d0e676841733cb83abaf975845c9f6f2a8097b7d04f4908b18368d6fc2d68ecffffffff01001ec4110200000043410469ab4181eceb28985b9b4e895c13fa5e68d85761b7eee311db5addef76fa8621865134a221bd01f28ec9999ee3e021e60766e9d1f3458c115fb28650605f11c9ac000000000100000001cdaf2f758e91c514655e2dc50633d1e4c84989f8aa90a0dbc883f0d23ed5c2fa010000008b48304502207ab51be6f12a1962ba0aaaf24a20e0b69b27a94fac5adf45aa7d2d18ffd9236102210086ae728b370e5329eead9accd880d0cb070aea0c96255fae6c4f1ddcce1fd56e014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff02404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac002d3101000000001976a9141befba0cdc1ad56529371864d9f6cb042faa06b588ac000000000100000001b4a47603e71b61bc3326efd90111bf02d2f549b067f4c4a8fa183b57a0f800cb010000008a4730440220177c37f9a505c3f1a1f0ce2da777c339bd8339ffa02c7cb41f0a5804f473c9230220585b25a2ee80eb59292e52b987dad92acb0c64eced92ed9ee105ad153cdb12d001410443bd44f683467e549dae7d20d1d79cbdb6df985c6e9c029c8d0c6cb46cc1a4d3cf7923c5021b27f7a0b562ada113bc85d5fda5a1b41e87fe6e8802817cf69996ffffffff0280651406000000001976a9145505614859643ab7b547cd7f1f5e7e2a12322d3788ac00aa0271000000001976a914ea4720a7a52fc166c55ff2298e07baf70ae67e1b88ac00000000010000000586c62cd602d219bb60edb14a3e204de0705176f9022fe49a538054fb14abb49e010000008c493046022100f2bc2aba2534becbdf062eb993853a42bbbc282083d0daf9b4b585bd401aa8c9022100b1d7fd7ee0b95600db8535bbf331b19eed8d961f7a8e54159c53675d5f69df8c014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff03ad0e58ccdac3df9dc28a218bcf6f1997b0a93306faaa4b3a28ae83447b2179010000008b483045022100be12b2937179da88599e27bb31c3525097a07cdb52422d165b3ca2f2020ffcf702200971b51f853a53d644ebae9ec8f3512e442b1bcb6c315a5b491d119d10624c83014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff2acfcab629bbc8685792603762c921580030ba144af553d271716a95089e107b010000008b483045022100fa579a840ac258871365dd48cd7552f96c8eea69bd00d84f05b283a0dab311e102207e3c0ee9234814cfbb1b659b83671618f45abc1326b9edcc77d552a4f2a805c0014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffffdcdc6023bbc9944a658ddc588e61eacb737ddf0a3cd24f113b5a8634c517fcd2000000008b4830450221008d6df731df5d32267954bd7d2dda2302b74c6c2a6aa5c0ca64ecbabc1af03c75022010e55c571d65da7701ae2da1956c442df81bbf076cdbac25133f99d98a9ed34c014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffffe15557cd5ce258f479dfd6dc6514edf6d7ed5b21fcfa4a038fd69f06b83ac76e010000008b483045022023b3e0ab071eb11de2eb1cc3a67261b866f86bf6867d4558165f7c8c8aca2d86022100dc6e1f53a91de3efe8f63512850811f26284b62f850c70ca73ed5de8771fb451014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff01404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac00000000010000000166d7577163c932b4f9690ca6a80b6e4eb001f0a2fa9023df5595602aae96ed8d000000008a4730440220262b42546302dfb654a229cefc86432b89628ff259dc87edd1154535b16a67e102207b4634c020a97c3e7bbd0d4d19da6aa2269ad9dded4026e896b213d73ca4b63f014104979b82d02226b3a4597523845754d44f13639e3bf2df5e82c6aab2bdc79687368b01b1ab8b19875ae3c90d661a3d0a33161dab29934edeb36aa01976be3baf8affffffff02404b4c00000000001976a9144854e695a02af0aeacb823ccbc272134561e0a1688ac40420f00000000001976a914abee93376d6b37b5c2940655a6fcaf1c8e74237988ac0000000001000000014e3f8ef2e91349a9059cb4f01e54ab2597c1387161d3da89919f7ea6acdbb371010000008c49304602210081f3183471a5ca22307c0800226f3ef9c353069e0773ac76bb580654d56aa523022100d4c56465bdc069060846f4fbf2f6b20520b2a80b08b168b31e66ddb9c694e240014104976c79848e18251612f8940875b2b08d06e6dc73b9840e8860c066b7e87432c477e9a59a453e71e6d76d5fe34058b800a098fc1740ce3012e8fc8a00c96af966ffffffff02c0e1e400000000001976a9144134e75a6fcb6042034aab5e18570cf1f844f54788ac404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac00000000" + }, + { + "comment": "Random real block (000000005a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6) with 4 transactions", + "transactions": 4, + "data": "0100000075616236cc2126035fadb38deb65b9102cc2c41c09cdf29fc051906800000000fe7d5e12ef0ff901f6050211249919b1c0653771832b3a80c66cea42847f0ae1d4d26e49ffff001d00f0a4410401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d029105ffffffff0100f2052a010000004341046d8709a041d34357697dfcb30a9d05900a6294078012bf3bb09c6f9b525f1d16d5503d7905db1ada9501446ea00728668fc5719aa80be2fdfc8a858a4dbdd4fbac00000000010000000255605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d28350000000049483045022100aa46504baa86df8a33b1192b1b9367b4d729dc41e389f2c04f3e5c7f0559aae702205e82253a54bf5c4f65b7428551554b2045167d6d206dfe6a2e198127d3f7df1501ffffffff55605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d2835010000004847304402202329484c35fa9d6bb32a55a70c0982f606ce0e3634b69006138683bcd12cbb6602200c28feb1e2555c3210f1dddb299738b4ff8bbe9667b68cb8764b5ac17b7adf0001ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac0000000001000000025f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028000000004847304402205d6058484157235b06028c30736c15613a28bdb768ee628094ca8b0030d4d6eb0220328789c9a2ec27ddaec0ad5ef58efded42e6ea17c2e1ce838f3d6913f5e95db601ffffffff5f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028010000004a493046022100c45af050d3cea806cedd0ab22520c53ebe63b987b8954146cdca42487b84bdd6022100b9b027716a6b59e640da50a864d6dd8a0ef24c76ce62391fa3eabaf4d2886d2d01ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac000000000100000002e2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b0000000048473044022016e7a727a061ea2254a6c358376aaa617ac537eb836c77d646ebda4c748aac8b0220192ce28bf9f2c06a6467e6531e27648d2b3e2e2bae85159c9242939840295ba501ffffffffe2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b010000004a493046022100b7a1a755588d4190118936e15cd217d133b0e4a53c3c15924010d5648d8925c9022100aaef031874db2114f2d869ac2de4ae53908fbfea5b2b1862e181626bb9005c9f01ffffffff0200e1f505000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00000000" + }, + { + "comment": "A random real block (000000005a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6) with 4 transactions", + "transactions": 4, + "data": "0100000075616236cc2126035fadb38deb65b9102cc2c41c09cdf29fc051906800000000fe7d5e12ef0ff901f6050211249919b1c0653771832b3a80c66cea42847f0ae1d4d26e49ffff001d00f0a4410401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d029105ffffffff0100f2052a010000004341046d8709a041d34357697dfcb30a9d05900a6294078012bf3bb09c6f9b525f1d16d5503d7905db1ada9501446ea00728668fc5719aa80be2fdfc8a858a4dbdd4fbac00000000010000000255605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d28350000000049483045022100aa46504baa86df8a33b1192b1b9367b4d729dc41e389f2c04f3e5c7f0559aae702205e82253a54bf5c4f65b7428551554b2045167d6d206dfe6a2e198127d3f7df1501ffffffff55605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d2835010000004847304402202329484c35fa9d6bb32a55a70c0982f606ce0e3634b69006138683bcd12cbb6602200c28feb1e2555c3210f1dddb299738b4ff8bbe9667b68cb8764b5ac17b7adf0001ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac0000000001000000025f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028000000004847304402205d6058484157235b06028c30736c15613a28bdb768ee628094ca8b0030d4d6eb0220328789c9a2ec27ddaec0ad5ef58efded42e6ea17c2e1ce838f3d6913f5e95db601ffffffff5f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028010000004a493046022100c45af050d3cea806cedd0ab22520c53ebe63b987b8954146cdca42487b84bdd6022100b9b027716a6b59e640da50a864d6dd8a0ef24c76ce62391fa3eabaf4d2886d2d01ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac000000000100000002e2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b0000000048473044022016e7a727a061ea2254a6c358376aaa617ac537eb836c77d646ebda4c748aac8b0220192ce28bf9f2c06a6467e6531e27648d2b3e2e2bae85159c9242939840295ba501ffffffffe2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b010000004a493046022100b7a1a755588d4190118936e15cd217d133b0e4a53c3c15924010d5648d8925c9022100aaef031874db2114f2d869ac2de4ae53908fbfea5b2b1862e181626bb9005c9f01ffffffff0200e1f505000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00000000" + }, + { + "comment": "A random real block (000000000000dab0130bbcc991d3d7ae6b81aa6f50a798888dfe62337458dc45) with one tx", + "transactions": 1, + "data": "0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b8fa45d630101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff08044c86041b020a02ffffffff0100f2052a01000000434104ecd3229b0571c3be876feaac0442a9f13c5a572742927af1dc623353ecf8c202225f64868137a18cdd85cbbb4c74fbccfd4f49639cf1bdc94a5672bb15ad5d4cac00000000" + }, + { + "comment": "A random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4) with 7 transactions", + "transactions": 7, + "data": "0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b554b85290701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000" + } +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/script_invalid.json b/packages/kauri-bitcore-lib/test/data/bitcoind/script_invalid.json new file mode 100644 index 0000000..86d39b5 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/script_invalid.json @@ -0,0 +1,672 @@ +[ +["Format is: [scriptPubKey, scriptSig, flags, ... comments]"], +["It is evaluated as if there was a crediting coinbase transaction with two 0"], +["pushes as scriptSig, and one output of 0 satoshi and given scriptPubKey,"], +["followed by a spending transaction which spends this output as only input (and"], +["correct prevout hash), using the given scriptSig. All nLockTimes are 0, all"], +["nSequences are max."], + +["", "DEPTH", "P2SH,STRICTENC", "Test the test: we should have an empty stack after scriptSig evaluation"], +[" ", "DEPTH", "P2SH,STRICTENC", "and multiple spaces should not change that."], +[" ", "DEPTH", "P2SH,STRICTENC"], +[" ", "DEPTH", "P2SH,STRICTENC"], + +["", "", "P2SH,STRICTENC"], +["", "NOP", "P2SH,STRICTENC"], +["", "NOP DEPTH", "P2SH,STRICTENC"], +["NOP", "", "P2SH,STRICTENC"], +["NOP", "DEPTH", "P2SH,STRICTENC"], +["NOP","NOP", "P2SH,STRICTENC"], +["NOP","NOP DEPTH", "P2SH,STRICTENC"], + +["DEPTH", "", "P2SH,STRICTENC"], + +["0x4c01","0x01 NOP", "P2SH,STRICTENC", "PUSHDATA1 with not enough bytes"], +["0x4d0200ff","0x01 NOP", "P2SH,STRICTENC", "PUSHDATA2 with not enough bytes"], +["0x4e03000000ffff","0x01 NOP", "P2SH,STRICTENC", "PUSHDATA4 with not enough bytes"], + +["1", "IF 0x50 ENDIF 1", "P2SH,STRICTENC", "0x50 is reserved"], +["0x52", "0x5f ADD 0x60 EQUAL", "P2SH,STRICTENC", "0x51 through 0x60 push 1 through 16 onto stack"], +["0","NOP", "P2SH,STRICTENC"], +["1", "IF VER ELSE 1 ENDIF", "P2SH,STRICTENC", "VER non-functional"], +["0", "IF VERIF ELSE 1 ENDIF", "P2SH,STRICTENC", "VERIF illegal everywhere"], +["0", "IF ELSE 1 ELSE VERIF ENDIF", "P2SH,STRICTENC", "VERIF illegal everywhere"], +["0", "IF VERNOTIF ELSE 1 ENDIF", "P2SH,STRICTENC", "VERNOTIF illegal everywhere"], +["0", "IF ELSE 1 ELSE VERNOTIF ENDIF", "P2SH,STRICTENC", "VERNOTIF illegal everywhere"], + +["1 IF", "1 ENDIF", "P2SH,STRICTENC", "IF/ENDIF can't span scriptSig/scriptPubKey"], +["1 IF 0 ENDIF", "1 ENDIF", "P2SH,STRICTENC"], +["1 ELSE 0 ENDIF", "1", "P2SH,STRICTENC"], +["0 NOTIF", "123", "P2SH,STRICTENC"], + +["0", "DUP IF ENDIF", "P2SH,STRICTENC"], +["0", "IF 1 ENDIF", "P2SH,STRICTENC"], +["0", "DUP IF ELSE ENDIF", "P2SH,STRICTENC"], +["0", "IF 1 ELSE ENDIF", "P2SH,STRICTENC"], +["0", "NOTIF ELSE 1 ENDIF", "P2SH,STRICTENC"], + +["0 1", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 0", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], + +["0 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], + +["1", "IF RETURN ELSE ELSE 1 ENDIF", "P2SH,STRICTENC", "Multiple ELSEs"], +["1", "IF 1 ELSE ELSE RETURN ENDIF", "P2SH,STRICTENC"], + +["1", "ENDIF", "P2SH,STRICTENC", "Malformed IF/ELSE/ENDIF sequence"], +["1", "ELSE ENDIF", "P2SH,STRICTENC"], +["1", "ENDIF ELSE", "P2SH,STRICTENC"], +["1", "ENDIF ELSE IF", "P2SH,STRICTENC"], +["1", "IF ELSE ENDIF ELSE", "P2SH,STRICTENC"], +["1", "IF ELSE ENDIF ELSE ENDIF", "P2SH,STRICTENC"], +["1", "IF ENDIF ENDIF", "P2SH,STRICTENC"], +["1", "IF ELSE ELSE ENDIF ENDIF", "P2SH,STRICTENC"], + +["1", "RETURN", "P2SH,STRICTENC"], +["1", "DUP IF RETURN ENDIF", "P2SH,STRICTENC"], + +["1", "RETURN 'data'", "P2SH,STRICTENC", "canonical prunable txout format"], +["0 IF", "RETURN ENDIF 1", "P2SH,STRICTENC", "still prunable because IF/ENDIF can't span scriptSig/scriptPubKey"], + +["0", "VERIFY 1", "P2SH,STRICTENC"], +["1", "VERIFY", "P2SH,STRICTENC"], +["1", "VERIFY 0", "P2SH,STRICTENC"], + +["1 TOALTSTACK", "FROMALTSTACK 1", "P2SH,STRICTENC", "alt stack not shared between sig/pubkey"], + +["IFDUP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["DROP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["DUP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["1", "DUP 1 ADD 2 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["NOP", "NIP", "P2SH,STRICTENC"], +["NOP", "1 NIP", "P2SH,STRICTENC"], +["NOP", "1 0 NIP", "P2SH,STRICTENC"], +["NOP", "OVER 1", "P2SH,STRICTENC"], +["1", "OVER", "P2SH,STRICTENC"], +["0 1", "OVER DEPTH 3 EQUALVERIFY", "P2SH,STRICTENC"], +["19 20 21", "PICK 19 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["NOP", "0 PICK", "P2SH,STRICTENC"], +["1", "-1 PICK", "P2SH,STRICTENC"], +["19 20 21", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["NOP", "0 ROLL", "P2SH,STRICTENC"], +["1", "-1 ROLL", "P2SH,STRICTENC"], +["19 20 21", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["NOP", "ROT 1", "P2SH,STRICTENC"], +["NOP", "1 ROT 1", "P2SH,STRICTENC"], +["NOP", "1 2 ROT 1", "P2SH,STRICTENC"], +["NOP", "0 1 2 ROT", "P2SH,STRICTENC"], +["NOP", "SWAP 1", "P2SH,STRICTENC"], +["1", "SWAP 1", "P2SH,STRICTENC"], +["0 1", "SWAP 1 EQUALVERIFY", "P2SH,STRICTENC"], +["NOP", "TUCK 1", "P2SH,STRICTENC"], +["1", "TUCK 1", "P2SH,STRICTENC"], +["1 0", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "P2SH,STRICTENC"], +["NOP", "2DUP 1", "P2SH,STRICTENC"], +["1", "2DUP 1", "P2SH,STRICTENC"], +["NOP", "3DUP 1", "P2SH,STRICTENC"], +["1", "3DUP 1", "P2SH,STRICTENC"], +["1 2", "3DUP 1", "P2SH,STRICTENC"], +["NOP", "2OVER 1", "P2SH,STRICTENC"], +["1", "2 3 2OVER 1", "P2SH,STRICTENC"], +["NOP", "2SWAP 1", "P2SH,STRICTENC"], +["1", "2 3 2SWAP 1", "P2SH,STRICTENC"], + +["'a' 'b'", "CAT", "P2SH,STRICTENC", "CAT disabled"], +["'a' 'b' 0", "IF CAT ELSE 1 ENDIF", "P2SH,STRICTENC", "CAT disabled"], +["'abc' 1 1", "SUBSTR", "P2SH,STRICTENC", "SUBSTR disabled"], +["'abc' 1 1 0", "IF SUBSTR ELSE 1 ENDIF", "P2SH,STRICTENC", "SUBSTR disabled"], +["'abc' 2 0", "IF LEFT ELSE 1 ENDIF", "P2SH,STRICTENC", "LEFT disabled"], +["'abc' 2 0", "IF RIGHT ELSE 1 ENDIF", "P2SH,STRICTENC", "RIGHT disabled"], + +["NOP", "SIZE 1", "P2SH,STRICTENC"], + +["'abc'", "IF INVERT ELSE 1 ENDIF", "P2SH,STRICTENC", "INVERT disabled"], +["1 2 0 IF AND ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "AND disabled"], +["1 2 0 IF OR ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "OR disabled"], +["1 2 0 IF XOR ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "XOR disabled"], +["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "2MUL disabled"], +["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "2DIV disabled"], +["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "MUL disabled"], +["2 2 0 IF DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DIV disabled"], +["2 2 0 IF MOD ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "MOD disabled"], +["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "LSHIFT disabled"], +["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "RSHIFT disabled"], + +["0 1","EQUAL", "P2SH,STRICTENC"], +["1 1 ADD", "0 EQUAL", "P2SH,STRICTENC"], +["11 1 ADD 12 SUB", "11 EQUAL", "P2SH,STRICTENC"], + +["2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "arithmetic operands must be in range [-2^31...2^31] "], +["-2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "arithmetic operands must be in range [-2^31...2^31] "], +["2147483647 DUP ADD", "4294967294 NUMEQUAL", "P2SH,STRICTENC", "NUMEQUAL must be in numeric range"], +["'abcdef' NOT", "0 EQUAL", "P2SH,STRICTENC", "NOT is an arithmetic operand"], + +["2 DUP MUL", "4 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 DUP DIV", "1 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 2MUL", "4 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 2DIV", "1 EQUAL", "P2SH,STRICTENC", "disabled"], +["7 3 MOD", "1 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC", "disabled"], + +["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL", "P2SH,STRICTENC"], +["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL", "P2SH,STRICTENC"], + +["Ensure 100% coverage of discouraged NOPS"], +["1", "NOP1", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP2", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP3", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP4", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP5", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP6", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP7", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP8", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP9", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP10", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], + +["NOP10", "1", "P2SH,DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in scriptSig"], + +["1 0x01 0xb9", "HASH160 0x14 0x15727299b05b45fdaf9ac9ecf7565cfe27c3e567 EQUAL", + "P2SH,DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in redeemScript"], + +["0x50","1", "P2SH,STRICTENC", "opcode 0x50 is reserved"], +["1", "IF 0xba ELSE 1 ENDIF", "P2SH,STRICTENC", "opcodes above NOP10 invalid if executed"], +["1", "IF 0xbb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xca ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xce ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xda ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xde ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xea ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xeb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xec ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xed ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xee ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xef ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfa ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xff ELSE 1 ENDIF", "P2SH,STRICTENC"], + +["1 IF 1 ELSE", "0xff ENDIF", "P2SH,STRICTENC", "invalid because scriptSig and scriptPubKey are processed separately"], + +["NOP", "RIPEMD160", "P2SH,STRICTENC"], +["NOP", "SHA1", "P2SH,STRICTENC"], +["NOP", "SHA256", "P2SH,STRICTENC"], +["NOP", "HASH160", "P2SH,STRICTENC"], +["NOP", "HASH256", "P2SH,STRICTENC"], + +["NOP", +"'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'", +"P2SH,STRICTENC", +">520 byte push"], +["0", +"IF 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' ENDIF 1", +"P2SH,STRICTENC", +">520 byte push in non-executed IF branch"], +["1", +"0x61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", +">201 opcodes executed. 0x61 is NOP"], +["0", +"IF 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 ENDIF 1", +"P2SH,STRICTENC", +">201 opcodes including non-executed IF branch. 0x61 is NOP"], +["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"1 2 3 4 5 6 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", +">1,000 stack size (0x6f is 3DUP)"], +["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"1 TOALTSTACK 2 TOALTSTACK 3 4 5 6 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", +">1,000 stack+altstack size"], +["NOP", +"0 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f 2DUP 0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", +"10,001-byte scriptPubKey"], + +["NOP1","NOP10", "P2SH,STRICTENC"], + +["1","VER", "P2SH,STRICTENC", "OP_VER is reserved"], +["1","VERIF", "P2SH,STRICTENC", "OP_VERIF is reserved"], +["1","VERNOTIF", "P2SH,STRICTENC", "OP_VERNOTIF is reserved"], +["1","RESERVED", "P2SH,STRICTENC", "OP_RESERVED is reserved"], +["1","RESERVED1", "P2SH,STRICTENC", "OP_RESERVED1 is reserved"], +["1","RESERVED2", "P2SH,STRICTENC", "OP_RESERVED2 is reserved"], +["1","0xba", "P2SH,STRICTENC", "0xba == OP_NOP10 + 1"], + +["2147483648", "1ADD 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers"], +["2147483648", "NEGATE 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers"], +["-2147483648", "1ADD 1", "P2SH,STRICTENC", "Because we use a sign bit, -2147483648 is also 5 bytes"], +["2147483647", "1ADD 1SUB 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], +["2147483648", "1SUB 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], + +["2147483648 1", "BOOLOR 1", "P2SH,STRICTENC", "We cannot do BOOLOR on 5-byte integers (but we can still do IF etc)"], +["2147483648 1", "BOOLAND 1", "P2SH,STRICTENC", "We cannot do BOOLAND on 5-byte integers"], + +["1", "1 ENDIF", "P2SH,STRICTENC", "ENDIF without IF"], +["1", "IF 1", "P2SH,STRICTENC", "IF without ENDIF"], +["1 IF 1", "ENDIF", "P2SH,STRICTENC", "IFs don't carry over"], + +["NOP", "IF 1 ENDIF", "P2SH,STRICTENC", "The following tests check the if(stack.size() < N) tests in each opcode"], +["NOP", "NOTIF 1 ENDIF", "P2SH,STRICTENC", "They are here to catch copy-and-paste errors"], +["NOP", "VERIFY 1", "P2SH,STRICTENC", "Most of them are duplicated elsewhere,"], + +["NOP", "TOALTSTACK 1", "P2SH,STRICTENC", "but, hey, more is always better, right?"], +["1", "FROMALTSTACK", "P2SH,STRICTENC"], +["1", "2DROP 1", "P2SH,STRICTENC"], +["1", "2DUP", "P2SH,STRICTENC"], +["1 1", "3DUP", "P2SH,STRICTENC"], +["1 1 1", "2OVER", "P2SH,STRICTENC"], +["1 1 1 1 1", "2ROT", "P2SH,STRICTENC"], +["1 1 1", "2SWAP", "P2SH,STRICTENC"], +["NOP", "IFDUP 1", "P2SH,STRICTENC"], +["NOP", "DROP 1", "P2SH,STRICTENC"], +["NOP", "DUP 1", "P2SH,STRICTENC"], +["1", "NIP", "P2SH,STRICTENC"], +["1", "OVER", "P2SH,STRICTENC"], +["1 1 1 3", "PICK", "P2SH,STRICTENC"], +["0", "PICK 1", "P2SH,STRICTENC"], +["1 1 1 3", "ROLL", "P2SH,STRICTENC"], +["0", "ROLL 1", "P2SH,STRICTENC"], +["1 1", "ROT", "P2SH,STRICTENC"], +["1", "SWAP", "P2SH,STRICTENC"], +["1", "TUCK", "P2SH,STRICTENC"], + +["NOP", "SIZE 1", "P2SH,STRICTENC"], + +["1", "EQUAL 1", "P2SH,STRICTENC"], +["1", "EQUALVERIFY 1", "P2SH,STRICTENC"], + +["NOP", "1ADD 1", "P2SH,STRICTENC"], +["NOP", "1SUB 1", "P2SH,STRICTENC"], +["NOP", "NEGATE 1", "P2SH,STRICTENC"], +["NOP", "ABS 1", "P2SH,STRICTENC"], +["NOP", "NOT 1", "P2SH,STRICTENC"], +["NOP", "0NOTEQUAL 1", "P2SH,STRICTENC"], + +["1", "ADD", "P2SH,STRICTENC"], +["1", "SUB", "P2SH,STRICTENC"], +["1", "BOOLAND", "P2SH,STRICTENC"], +["1", "BOOLOR", "P2SH,STRICTENC"], +["1", "NUMEQUAL", "P2SH,STRICTENC"], +["1", "NUMEQUALVERIFY 1", "P2SH,STRICTENC"], +["1", "NUMNOTEQUAL", "P2SH,STRICTENC"], +["1", "LESSTHAN", "P2SH,STRICTENC"], +["1", "GREATERTHAN", "P2SH,STRICTENC"], +["1", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["1", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["1", "MIN", "P2SH,STRICTENC"], +["1", "MAX", "P2SH,STRICTENC"], +["1 1", "WITHIN", "P2SH,STRICTENC"], + +["NOP", "RIPEMD160 1", "P2SH,STRICTENC"], +["NOP", "SHA1 1", "P2SH,STRICTENC"], +["NOP", "SHA256 1", "P2SH,STRICTENC"], +["NOP", "HASH160 1", "P2SH,STRICTENC"], +["NOP", "HASH256 1", "P2SH,STRICTENC"], + +["", +"0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG", +"P2SH,STRICTENC", +"202 CHECKMULTISIGS, fails due to 201 op limit"], + +["1", +"0 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], + +["", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG", +"P2SH,STRICTENC", +"Fails due to 201 sig op limit"], + +["1", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], + + +["0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21", "21 CHECKMULTISIG 1", "P2SH,STRICTENC", "nPubKeys > 20"], +["0 'sig' 1 0", "CHECKMULTISIG 1", "P2SH,STRICTENC", "nSigs > nPubKeys"], + + +["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC", "Tests for Script.IsPushOnly()"], +["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC"], + +["0 0x01 0x50", "HASH160 0x14 0xece424a6bb6ddf4db592c0faed60685047a361b1 EQUAL", "P2SH,STRICTENC", "OP_RESERVED in P2SH should fail"], +["0 0x01 VER", "HASH160 0x14 0x0f4d7845db968f2a81b530b6f3c1d6246d4c7e01 EQUAL", "P2SH,STRICTENC", "OP_VER in P2SH should fail"], + +["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], + +["MINIMALDATA enforcement for PUSHDATAs"], + +["0x4c 0x00", "DROP 1", "MINIMALDATA", "Empty vector minimally represented by OP_0"], +["0x01 0x81", "DROP 1", "MINIMALDATA", "-1 minimally represented by OP_1NEGATE"], +["0x01 0x01", "DROP 1", "MINIMALDATA", "1 to 16 minimally represented by OP_1 to OP_16"], +["0x01 0x02", "DROP 1", "MINIMALDATA"], +["0x01 0x03", "DROP 1", "MINIMALDATA"], +["0x01 0x04", "DROP 1", "MINIMALDATA"], +["0x01 0x05", "DROP 1", "MINIMALDATA"], +["0x01 0x06", "DROP 1", "MINIMALDATA"], +["0x01 0x07", "DROP 1", "MINIMALDATA"], +["0x01 0x08", "DROP 1", "MINIMALDATA"], +["0x01 0x09", "DROP 1", "MINIMALDATA"], +["0x01 0x0a", "DROP 1", "MINIMALDATA"], +["0x01 0x0b", "DROP 1", "MINIMALDATA"], +["0x01 0x0c", "DROP 1", "MINIMALDATA"], +["0x01 0x0d", "DROP 1", "MINIMALDATA"], +["0x01 0x0e", "DROP 1", "MINIMALDATA"], +["0x01 0x0f", "DROP 1", "MINIMALDATA"], +["0x01 0x10", "DROP 1", "MINIMALDATA"], + +["0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", + "PUSHDATA1 of 72 bytes minimally represented by direct push"], + +["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", + "PUSHDATA2 of 255 bytes minimally represented by PUSHDATA1"], + +["0x4f 0x00100000 0x11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", + "PUSHDATA4 of 256 bytes minimally represented by PUSHDATA2"], + + +["MINIMALDATA enforcement for numeric arguments"], + +["0x01 0x00", "NOT DROP 1", "MINIMALDATA", "numequals 0"], +["0x02 0x0000", "NOT DROP 1", "MINIMALDATA", "numequals 0"], +["0x01 0x80", "NOT DROP 1", "MINIMALDATA", "0x80 (negative zero) numequals 0"], +["0x02 0x0080", "NOT DROP 1", "MINIMALDATA", "numequals 0"], +["0x02 0x0500", "NOT DROP 1", "MINIMALDATA", "numequals 5"], +["0x03 0x050000", "NOT DROP 1", "MINIMALDATA", "numequals 5"], +["0x02 0x0580", "NOT DROP 1", "MINIMALDATA", "numequals -5"], +["0x03 0x050080", "NOT DROP 1", "MINIMALDATA", "numequals -5"], +["0x03 0xff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xffff"], +["0x03 0xff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xff7f"], +["0x04 0xffff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xffffff"], +["0x04 0xffff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xffff7f"], + +["Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule"], + +["1 0x02 0x0000", "PICK DROP", "MINIMALDATA"], +["1 0x02 0x0000", "ROLL DROP 1", "MINIMALDATA"], +["0x02 0x0000", "1ADD DROP 1", "MINIMALDATA"], +["0x02 0x0000", "1SUB DROP 1", "MINIMALDATA"], +["0x02 0x0000", "NEGATE DROP 1", "MINIMALDATA"], +["0x02 0x0000", "ABS DROP 1", "MINIMALDATA"], +["0x02 0x0000", "NOT DROP 1", "MINIMALDATA"], +["0x02 0x0000", "0NOTEQUAL DROP 1", "MINIMALDATA"], + +["0 0x02 0x0000", "ADD DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "ADD DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "SUB DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "SUB DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "BOOLAND DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "BOOLAND DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "BOOLOR DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "BOOLOR DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "NUMEQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 1", "NUMEQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "NUMEQUALVERIFY 1", "MINIMALDATA"], +["0x02 0x0000 0", "NUMEQUALVERIFY 1", "MINIMALDATA"], +["0 0x02 0x0000", "NUMNOTEQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "NUMNOTEQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "LESSTHAN DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "LESSTHAN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "GREATERTHAN DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "GREATERTHAN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "LESSTHANOREQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "LESSTHANOREQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "GREATERTHANOREQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "GREATERTHANOREQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "MIN DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "MIN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "MAX DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "MAX DROP 1", "MINIMALDATA"], + +["0x02 0x0000 0 0", "WITHIN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000 0", "WITHIN DROP 1", "MINIMALDATA"], +["0 0 0x02 0x0000", "WITHIN DROP 1", "MINIMALDATA"], + +["0 0 0x02 0x0000", "CHECKMULTISIG DROP 1", "MINIMALDATA"], +["0 0x02 0x0000 0", "CHECKMULTISIG DROP 1", "MINIMALDATA"], +["0 0x02 0x0000 0 1", "CHECKMULTISIG DROP 1", "MINIMALDATA"], +["0 0 0x02 0x0000", "CHECKMULTISIGVERIFY 1", "MINIMALDATA"], +["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", "MINIMALDATA"], + + +["Order of CHECKMULTISIG evaluation tests, inverted by swapping the order of"], +["pubkeys/signatures so they fail due to the STRICTENC rules on validly encoded"], +["signatures and pubkeys."], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with the first pubkey invalid, and both signatures validly encoded." +], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0", + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid." +], + +["Automatically generated test cases"], +[ + "0x47 0x3044022053205076a7bb12d2db3162a2d97d8197631f829b065948b7019b15482af819a902204328dcc02c994ca086b1226d0d5f1674d23cfae0d846143df812b81cab3391e801", + "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "", + "P2PK, bad sig" +], +[ + "0x47 0x30440220151ea78fa148b59f399b23731b634645ebc142f299ee9838d46fb78cf7e0bc0102200d62327dcd54ac6bcfb1516b035b1bf8eaea438c52c62d3450d1f3a8f030e0de01 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", + "DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG", + "", + "P2PKH, bad pubkey" +], +[ + "0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790201", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "", + "P2PK anyonecanpay marked with normal hashtype" +], +[ + "0x47 0x304402202166fcd5e607de452d3c6f15e059505cf21654346592f9650ba906b9e8be88fa022005d976d28eb8de477102feba28807b3ad361e7fa24796d259c9d61452f7c318c01 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", + "P2SH", + "P2SH(P2PK), bad redeemscript" +], +[ + "0x47 0x3044022064cc90ca89ad721384b231653b945579359a24b928ef8539b331172628c9cc6102203e238869ab5dac3fc293db53c12e7dd3079e86cfde9024b689efc7227e4d671001 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", + "P2SH", + "P2SH(P2PKH), bad sig" +], +[ + "0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402206d32e6d6b131ef2fe77b6a9b90b120d74e3e238e79dcffb10523a6ec94f93d65022067ae8772632ddf4c389258c6b70ed0ff94f20ee8f60207aa192a52a2469cddd901 0", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "", + "3-of-3, 2 sigs" +], +[ + "0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", + "P2SH", + "P2SH(2-of-3), 1 sig" +], +[ + "0x47 0x30440220001d6702bfa4f49c3a2542af9b1c2844a2eaac55f86f310f42d26a5dd17d6a8002202cdadbe608c00b50dd951c6ba0877d5b07a970f3e265c18697bc413a0a86f69901", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "DERSIG", + "P2PK with too much R padding" +], +[ + "0x48 0x304502207d2b258e959605e2ea50b46fea1325b7391ffb0c14a5b58ef8ad3851da3644380221007e75136df5f2e38216c4338b31c97e8307102edb97d611e06914e1f8fba68ead01", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "DERSIG", + "P2PK with too much S padding" +], +[ + "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "DERSIG", + "P2PK with too little R padding" +], +[ + "0x47 0x30440220003040725f724b0e2142fc44ac71f6e13161f6410aeb6dee477952ede3b6a6ca022041ff4940ee3d88116ad281d7cc556e1f2c9427d82290bd7974a25addbcd5bede01", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "DERSIG", + "P2PK NOT with bad sig with too much R padding" +], +[ + "0x47 0x30440220003040725f724a0e2142fc44ac71f6e13161f6410aeb6dee477952ede3b6a6ca022041ff4940ee3d88116ad281d7cc556e1f2c9427d82290bd7974a25addbcd5bede01", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "", + "P2PK NOT with too much R padding but no DERSIG" +], +[ + "0x47 0x30440220003040725f724a0e2142fc44ac71f6e13161f6410aeb6dee477952ede3b6a6ca022041ff4940ee3d88116ad281d7cc556e1f2c9427d82290bd7974a25addbcd5bede01", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "DERSIG", + "P2PK NOT with too much R padding" +], +[ + "0x49 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef05101", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "LOW_S", + "P2PK with high S" +], +[ + "0x47 0x30440220745d63eb70d45652128b450aa5ca7d9b513439963f261cb1c40a60f0785e7ee402204877785b38945ca9dbec78e1c1d4dd12148cc25c868bd27480023b49ae0f310501", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "STRICTENC", + "P2PK with hybrid pubkey" +], +[ + "0x47 0x30440220606f6f9f6cebc94ebfb6a4bff0b682bd99f05511295545ce9b275e98be3c946102206871d6a76f4e1b43d9763cfc5647844e4811682b1cab0325f060f44ddf44002201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "", + "P2PK NOT with hybrid pubkey but no STRICTENC" +], +[ + "0x47 0x30440220606f6f9f6cebc94ebfb6a4bff0b682bd99f05511295545ce9b275e98be3c946102206871d6a76f4e1b43d9763cfc5647844e4811682b1cab0325f060f44ddf44002201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with hybrid pubkey" +], +[ + "0x47 0x30440220606f6f9f6cebc84ebfb6a4bff0b682bd99f05511295545ce9b275e98be3c946102206871d6a76f4e1b43d9763cfc5647844e4811682b1cab0325f060f44ddf44002201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with invalid hybrid pubkey" +], +[ + "0 0x47 0x304402203cdcf66792fe97e3955655ede5dad004950e58b369831ffa7743132c507b272c022031fbcfb4a72b3e00217abf2f5557585f1f9891f12827d2f0a2ae2978e7f9f11001", + "1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG", + "STRICTENC", + "1-of-2 with the first 1 hybrid pubkey" +], +[ + "0x47 0x304402201c215cb13e4954e60ce4f6de74941904c771f998de7b1d9627e82a1949fde517022031c2197455f3dbecbb78321201308d7b039424e38d480772d7cd4eb465a083f405", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "STRICTENC", + "P2PK with undefined hashtype" +], +[ + "0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with invalid sig and undefined hashtype" +], +[ + "1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402206d32e6d6b131ef2fe77b6a9b90b120d74e3e238e79dcffb10523a6ec94f93d65022067ae8772632ddf4c389258c6b70ed0ff94f20ee8f60207aa192a52a2469cddd901 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "NULLDUMMY", + "3-of-3 with nonzero dummy" +], +[ + "1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", + "NULLDUMMY", + "3-of-3 NOT with invalid sig with nonzero dummy" +], +[ + "0 0x47 0x304402206cb053202e1501e6faa24e6e309bf46a2f9255aa9484ff4a26efb7434f78a58a0220132b10419c3b99601f154bf86cf12259aacd8c6f363a73dacb1d0b941680bb4c01 DUP", + "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "SIGPUSHONLY", + "2-of-2 with two identical keys and sigs pushed using OP_DUP" +], +[ + "0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "", + "P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY" +], +[ + "0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "SIGPUSHONLY", + "P2SH(P2PK) with non-push scriptSig" +], + +["The End"] +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/script_valid.json b/packages/kauri-bitcore-lib/test/data/bitcoind/script_valid.json new file mode 100644 index 0000000..d3075de --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/script_valid.json @@ -0,0 +1,821 @@ +[ +["Format is: [scriptPubKey, scriptSig, flags, ... comments]"], +["It is evaluated as if there was a crediting coinbase transaction with two 0"], +["pushes as scriptSig, and one output of 0 satoshi and given scriptPubKey,"], +["followed by a spending transaction which spends this output as only input (and"], +["correct prevout hash), using the given scriptSig. All nLockTimes are 0, all"], +["nSequences are max."], + +["", "DEPTH 0 EQUAL", "P2SH,STRICTENC", "Test the test: we should have an empty stack after scriptSig evaluation"], +[" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC", "and multiple spaces should not change that."], +[" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +[" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["1 2", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC", "Similarly whitespace around and between symbols"], +["1 2", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +[" 1 2", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +["1 2 ", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +[" 1 2 ", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], + +["1", "", "P2SH,STRICTENC"], +["0x02 0x01 0x00", "", "P2SH,STRICTENC", "all bytes are significant, not only the last one"], +["0x09 0x00000000 0x00000000 0x10", "", "P2SH,STRICTENC", "equals zero when cast to Int64"], + +["0x01 0x0b", "11 EQUAL", "P2SH,STRICTENC", "push 1 byte"], +["0x02 0x417a", "'Az' EQUAL", "P2SH,STRICTENC"], +["0x4b 0x417a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a", + "'Azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' EQUAL", "P2SH,STRICTENC", "push 75 bytes"], + +["0x4c 0x01 0x07","7 EQUAL", "P2SH,STRICTENC", "0x4c is OP_PUSHDATA1"], +["0x4d 0x0100 0x08","8 EQUAL", "P2SH,STRICTENC", "0x4d is OP_PUSHDATA2"], +["0x4e 0x01000000 0x09","9 EQUAL", "P2SH,STRICTENC", "0x4e is OP_PUSHDATA4"], + +["0x4c 0x00","0 EQUAL", "P2SH,STRICTENC"], +["0x4d 0x0000","0 EQUAL", "P2SH,STRICTENC"], +["0x4e 0x00000000","0 EQUAL", "P2SH,STRICTENC"], +["0x4f 1000 ADD","999 EQUAL", "P2SH,STRICTENC"], +["0", "IF 0x50 ENDIF 1", "P2SH,STRICTENC", "0x50 is reserved (ok if not executed)"], +["0x51", "0x5f ADD 0x60 EQUAL", "P2SH,STRICTENC", "0x51 through 0x60 push 1 through 16 onto stack"], +["1","NOP", "P2SH,STRICTENC"], +["0", "IF VER ELSE 1 ENDIF", "P2SH,STRICTENC", "VER non-functional (ok if not executed)"], +["0", "IF RESERVED RESERVED1 RESERVED2 ELSE 1 ENDIF", "P2SH,STRICTENC", "RESERVED ok in un-executed IF"], + +["1", "DUP IF ENDIF", "P2SH,STRICTENC"], +["1", "IF 1 ENDIF", "P2SH,STRICTENC"], +["1", "DUP IF ELSE ENDIF", "P2SH,STRICTENC"], +["1", "IF 1 ELSE ENDIF", "P2SH,STRICTENC"], +["0", "IF ELSE 1 ENDIF", "P2SH,STRICTENC"], + +["1 1", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 0", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], + +["1 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], + +["0", "IF 0 ELSE 1 ELSE 0 ENDIF", "P2SH,STRICTENC", "Multiple ELSE's are valid and executed inverts on each ELSE encountered"], +["1", "IF 1 ELSE 0 ELSE ENDIF", "P2SH,STRICTENC"], +["1", "IF ELSE 0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL", "P2SH,STRICTENC"], +["'' 1", "IF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL", "P2SH,STRICTENC"], + +["1", "NOTIF 0 ELSE 1 ELSE 0 ENDIF", "P2SH,STRICTENC", "Multiple ELSE's are valid and execution inverts on each ELSE encountered"], +["0", "NOTIF 1 ELSE 0 ELSE ENDIF", "P2SH,STRICTENC"], +["0", "NOTIF ELSE 0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "NOTIF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL", "P2SH,STRICTENC"], +["'' 0", "NOTIF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL", "P2SH,STRICTENC"], + +["0", "IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "P2SH,STRICTENC", "Nested ELSE ELSE"], +["1", "NOTIF 0 NOTIF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 0 NOTIF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "P2SH,STRICTENC"], + +["0", "IF RETURN ENDIF 1", "P2SH,STRICTENC", "RETURN only works if executed"], + +["1 1", "VERIFY", "P2SH,STRICTENC"], +["1 0x05 0x01 0x00 0x00 0x00 0x00", "VERIFY", "P2SH,STRICTENC", "values >4 bytes can be cast to boolean"], + +["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL", "P2SH,STRICTENC"], +["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL", "P2SH,STRICTENC"], + +["0 IFDUP", "DEPTH 1 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["1 IFDUP", "DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +["0 DROP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["0", "DUP 1 ADD 1 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["0 1", "NIP", "P2SH,STRICTENC"], +["1 0", "OVER DEPTH 3 EQUALVERIFY", "P2SH,STRICTENC"], +["22 21 20", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT 22 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT DROP 20 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT DROP DROP 21 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT ROT 21 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT ROT ROT 20 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 24 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT DROP 25 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP 20 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP DROP 21 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP 2DROP 22 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP 2DROP DROP 23 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2ROT 22 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2ROT 2ROT 20 EQUAL", "P2SH,STRICTENC"], +["1 0", "SWAP 1 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["0 1", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "P2SH,STRICTENC"], +["13 14", "2DUP ROT EQUALVERIFY EQUAL", "P2SH,STRICTENC"], +["-1 0 1 2", "3DUP DEPTH 7 EQUALVERIFY ADD ADD 3 EQUALVERIFY 2DROP 0 EQUALVERIFY", "P2SH,STRICTENC"], +["1 2 3 5", "2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL", "P2SH,STRICTENC"], +["1 3 5 7", "2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL", "P2SH,STRICTENC"], +["0", "SIZE 0 EQUAL", "P2SH,STRICTENC"], +["1", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["127", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["128", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["32767", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["32768", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["8388607", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["8388608", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["2147483647", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["2147483648", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["549755813887", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["549755813888", "SIZE 6 EQUAL", "P2SH,STRICTENC"], +["9223372036854775807", "SIZE 8 EQUAL", "P2SH,STRICTENC"], +["-1", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["-127", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["-128", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["-32767", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["-32768", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["-8388607", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["-8388608", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["-2147483647", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["-2147483648", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["-549755813887", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["-549755813888", "SIZE 6 EQUAL", "P2SH,STRICTENC"], +["-9223372036854775807", "SIZE 8 EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL", "P2SH,STRICTENC"], + +["42", "SIZE 1 EQUALVERIFY 42 EQUAL", "P2SH,STRICTENC", "SIZE does not consume argument"], + +["2 -2 ADD", "0 EQUAL", "P2SH,STRICTENC"], +["2147483647 -2147483647 ADD", "0 EQUAL", "P2SH,STRICTENC"], +["-1 -1 ADD", "-2 EQUAL", "P2SH,STRICTENC"], + +["0 0","EQUAL", "P2SH,STRICTENC"], +["1 1 ADD", "2 EQUAL", "P2SH,STRICTENC"], +["1 1ADD", "2 EQUAL", "P2SH,STRICTENC"], +["111 1SUB", "110 EQUAL", "P2SH,STRICTENC"], +["111 1 ADD 12 SUB", "100 EQUAL", "P2SH,STRICTENC"], +["0 ABS", "0 EQUAL", "P2SH,STRICTENC"], +["16 ABS", "16 EQUAL", "P2SH,STRICTENC"], +["-16 ABS", "-16 NEGATE EQUAL", "P2SH,STRICTENC"], +["0 NOT", "NOP", "P2SH,STRICTENC"], +["1 NOT", "0 EQUAL", "P2SH,STRICTENC"], +["11 NOT", "0 EQUAL", "P2SH,STRICTENC"], +["0 0NOTEQUAL", "0 EQUAL", "P2SH,STRICTENC"], +["1 0NOTEQUAL", "1 EQUAL", "P2SH,STRICTENC"], +["111 0NOTEQUAL", "1 EQUAL", "P2SH,STRICTENC"], +["-111 0NOTEQUAL", "1 EQUAL", "P2SH,STRICTENC"], +["1 1 BOOLAND", "NOP", "P2SH,STRICTENC"], +["1 0 BOOLAND", "NOT", "P2SH,STRICTENC"], +["0 1 BOOLAND", "NOT", "P2SH,STRICTENC"], +["0 0 BOOLAND", "NOT", "P2SH,STRICTENC"], +["16 17 BOOLAND", "NOP", "P2SH,STRICTENC"], +["1 1 BOOLOR", "NOP", "P2SH,STRICTENC"], +["1 0 BOOLOR", "NOP", "P2SH,STRICTENC"], +["0 1 BOOLOR", "NOP", "P2SH,STRICTENC"], +["0 0 BOOLOR", "NOT", "P2SH,STRICTENC"], +["16 17 BOOLOR", "NOP", "P2SH,STRICTENC"], +["11 10 1 ADD", "NUMEQUAL", "P2SH,STRICTENC"], +["11 10 1 ADD", "NUMEQUALVERIFY 1", "P2SH,STRICTENC"], +["11 10 1 ADD", "NUMNOTEQUAL NOT", "P2SH,STRICTENC"], +["111 10 1 ADD", "NUMNOTEQUAL", "P2SH,STRICTENC"], +["11 10", "LESSTHAN NOT", "P2SH,STRICTENC"], +["4 4", "LESSTHAN NOT", "P2SH,STRICTENC"], +["10 11", "LESSTHAN", "P2SH,STRICTENC"], +["-11 11", "LESSTHAN", "P2SH,STRICTENC"], +["-11 -10", "LESSTHAN", "P2SH,STRICTENC"], +["11 10", "GREATERTHAN", "P2SH,STRICTENC"], +["4 4", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["10 11", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["-11 11", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["-11 -10", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["11 10", "LESSTHANOREQUAL NOT", "P2SH,STRICTENC"], +["4 4", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["10 11", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["-11 11", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["-11 -10", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["11 10", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["4 4", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["10 11", "GREATERTHANOREQUAL NOT", "P2SH,STRICTENC"], +["-11 11", "GREATERTHANOREQUAL NOT", "P2SH,STRICTENC"], +["-11 -10", "GREATERTHANOREQUAL NOT", "P2SH,STRICTENC"], +["1 0 MIN", "0 NUMEQUAL", "P2SH,STRICTENC"], +["0 1 MIN", "0 NUMEQUAL", "P2SH,STRICTENC"], +["-1 0 MIN", "-1 NUMEQUAL", "P2SH,STRICTENC"], +["0 -2147483647 MIN", "-2147483647 NUMEQUAL", "P2SH,STRICTENC"], +["2147483647 0 MAX", "2147483647 NUMEQUAL", "P2SH,STRICTENC"], +["0 100 MAX", "100 NUMEQUAL", "P2SH,STRICTENC"], +["-100 0 MAX", "0 NUMEQUAL", "P2SH,STRICTENC"], +["0 -2147483647 MAX", "0 NUMEQUAL", "P2SH,STRICTENC"], +["0 0 1", "WITHIN", "P2SH,STRICTENC"], +["1 0 1", "WITHIN NOT", "P2SH,STRICTENC"], +["0 -2147483647 2147483647", "WITHIN", "P2SH,STRICTENC"], +["-1 -100 100", "WITHIN", "P2SH,STRICTENC"], +["11 -100 100", "WITHIN", "P2SH,STRICTENC"], +["-2147483647 -100 100", "WITHIN NOT", "P2SH,STRICTENC"], +["2147483647 -100 100", "WITHIN NOT", "P2SH,STRICTENC"], + +["2147483647 2147483647 SUB", "0 EQUAL", "P2SH,STRICTENC"], +["2147483647 DUP ADD", "4294967294 EQUAL", "P2SH,STRICTENC", ">32 bit EQUAL is valid"], +["2147483647 NEGATE DUP ADD", "-4294967294 EQUAL", "P2SH,STRICTENC"], + +["''", "RIPEMD160 0x14 0x9c1185a5c5e9fc54612808977ee8f548b2258d31 EQUAL", "P2SH,STRICTENC"], +["'a'", "RIPEMD160 0x14 0x0bdc9d2d256b3ee9daae347be6f4dc835a467ffe EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "RIPEMD160 0x14 0xf71c27109c692c1b56bbdceb5b9d2865b3708dbc EQUAL", "P2SH,STRICTENC"], +["''", "SHA1 0x14 0xda39a3ee5e6b4b0d3255bfef95601890afd80709 EQUAL", "P2SH,STRICTENC"], +["'a'", "SHA1 0x14 0x86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "SHA1 0x14 0x32d10c7b8cf96570ca04ce37f2a19d84240d3a89 EQUAL", "P2SH,STRICTENC"], +["''", "SHA256 0x20 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EQUAL", "P2SH,STRICTENC"], +["'a'", "SHA256 0x20 0xca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "SHA256 0x20 0x71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 EQUAL", "P2SH,STRICTENC"], +["''", "DUP HASH160 SWAP SHA256 RIPEMD160 EQUAL", "P2SH,STRICTENC"], +["''", "DUP HASH256 SWAP SHA256 SHA256 EQUAL", "P2SH,STRICTENC"], +["''", "NOP HASH160 0x14 0xb472a266d0bd89c13706a4132ccfb16f7c3b9fcb EQUAL", "P2SH,STRICTENC"], +["'a'", "HASH160 NOP 0x14 0x994355199e516ff76c4fa4aab39337b9d84cf12b EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "HASH160 0x4c 0x14 0xc286a1af0947f58d1ad787385b1c2c4a976f9e71 EQUAL", "P2SH,STRICTENC"], +["''", "HASH256 0x20 0x5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456 EQUAL", "P2SH,STRICTENC"], +["'a'", "HASH256 0x20 0xbf5d3affb73efd2ec6c36ad3112dd933efed63c4e1cbffcfa88e2759c144f2d8 EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "HASH256 0x4c 0x20 0xca139bc10c2f660da42666f72e89a225936fc60f193c161124a672050c434671 EQUAL", "P2SH,STRICTENC"], + + +["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL", "P2SH,STRICTENC"], +["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL", "P2SH,STRICTENC"], + +["1", "NOP", "P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS", "Discourage NOPx flag allows OP_NOP"], + +["0", "IF NOP10 ENDIF 1", "P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS", + "Discouraged NOPs are allowed if not executed"], + +["0", "IF 0xba ELSE 1 ENDIF", "P2SH,STRICTENC", "opcodes above NOP10 invalid if executed"], +["0", "IF 0xbb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xca ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xce ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xda ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xde ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xea ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xeb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xec ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xed ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xee ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xef ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfa ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xff ELSE 1 ENDIF", "P2SH,STRICTENC"], + +["NOP", +"'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'", +"P2SH,STRICTENC", +"520 byte push"], +["1", +"0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", +"201 opcodes executed. 0x61 is NOP"], +["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", +"1,000 stack size (0x6f is 3DUP)"], +["1 TOALTSTACK 2 TOALTSTACK 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"1 2 3 4 5 6 7 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", +"1,000 stack size (altstack cleared between scriptSig/scriptPubKey)"], +["'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f 2DUP 0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", +"Max-size (10,000-byte), max-push(520 bytes), max-opcodes(201), max stack size(1,000 items). 0x6f is 3DUP, 0x61 is NOP"], + +["0", +"IF 0x5050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050 ENDIF 1", +"P2SH,STRICTENC", +">201 opcodes, but RESERVED (0x50) doesn't count towards opcode limit."], + +["NOP","1", "P2SH,STRICTENC"], + +["1", "0x01 0x01 EQUAL", "P2SH,STRICTENC", "The following is useful for checking implementations of BN_bn2mpi"], +["127", "0x01 0x7F EQUAL", "P2SH,STRICTENC"], +["128", "0x02 0x8000 EQUAL", "P2SH,STRICTENC", "Leave room for the sign bit"], +["32767", "0x02 0xFF7F EQUAL", "P2SH,STRICTENC"], +["32768", "0x03 0x008000 EQUAL", "P2SH,STRICTENC"], +["8388607", "0x03 0xFFFF7F EQUAL", "P2SH,STRICTENC"], +["8388608", "0x04 0x00008000 EQUAL", "P2SH,STRICTENC"], +["2147483647", "0x04 0xFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["2147483648", "0x05 0x0000008000 EQUAL", "P2SH,STRICTENC"], +["549755813887", "0x05 0xFFFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["549755813888", "0x06 0xFFFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["9223372036854775807", "0x08 0xFFFFFFFFFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["-1", "0x01 0x81 EQUAL", "P2SH,STRICTENC", "Numbers are little-endian with the MSB being a sign bit"], +["-127", "0x01 0xFF EQUAL", "P2SH,STRICTENC"], +["-128", "0x02 0x8080 EQUAL", "P2SH,STRICTENC"], +["-32767", "0x02 0xFFFF EQUAL", "P2SH,STRICTENC"], +["-32768", "0x03 0x008080 EQUAL", "P2SH,STRICTENC"], +["-8388607", "0x03 0xFFFFFF EQUAL", "P2SH,STRICTENC"], +["-8388608", "0x04 0x00008080 EQUAL", "P2SH,STRICTENC"], +["-2147483647", "0x04 0xFFFFFFFF EQUAL", "P2SH,STRICTENC"], +["-2147483648", "0x05 0x0000008080 EQUAL", "P2SH,STRICTENC"], +["-4294967295", "0x05 0xFFFFFFFF80 EQUAL", "P2SH,STRICTENC"], +["-549755813887", "0x05 0xFFFFFFFFFF EQUAL", "P2SH,STRICTENC"], +["-549755813888", "0x06 0x000000008080 EQUAL", "P2SH,STRICTENC"], +["-9223372036854775807", "0x08 0xFFFFFFFFFFFFFFFF EQUAL", "P2SH,STRICTENC"], + +["2147483647", "1ADD 2147483648 EQUAL", "P2SH,STRICTENC", "We can do math on 4-byte integers, and compare 5-byte ones"], +["2147483647", "1ADD 1", "P2SH,STRICTENC"], +["-2147483647", "1ADD 1", "P2SH,STRICTENC"], + +["1", "0x02 0x0100 EQUAL NOT", "P2SH,STRICTENC", "Not the same byte array..."], +["1", "0x02 0x0100 NUMEQUAL", "P2SH,STRICTENC", "... but they are numerically equal"], +["11", "0x4c 0x03 0x0b0000 NUMEQUAL", "P2SH,STRICTENC"], +["0", "0x01 0x80 EQUAL NOT", "P2SH,STRICTENC"], +["0", "0x01 0x80 NUMEQUAL", "P2SH,STRICTENC", "Zero numerically equals negative zero"], +["0", "0x02 0x0080 NUMEQUAL", "P2SH,STRICTENC"], +["0x03 0x000080", "0x04 0x00000080 NUMEQUAL", "P2SH,STRICTENC"], +["0x03 0x100080", "0x04 0x10000080 NUMEQUAL", "P2SH,STRICTENC"], +["0x03 0x100000", "0x04 0x10000000 NUMEQUAL", "P2SH,STRICTENC"], + +["NOP", "NOP 1", "P2SH,STRICTENC", "The following tests check the if(stack.size() < N) tests in each opcode"], +["1", "IF 1 ENDIF", "P2SH,STRICTENC", "They are here to catch copy-and-paste errors"], +["0", "NOTIF 1 ENDIF", "P2SH,STRICTENC", "Most of them are duplicated elsewhere,"], +["1", "VERIFY 1", "P2SH,STRICTENC", "but, hey, more is always better, right?"], + +["0", "TOALTSTACK 1", "P2SH,STRICTENC"], +["1", "TOALTSTACK FROMALTSTACK", "P2SH,STRICTENC"], +["0 0", "2DROP 1", "P2SH,STRICTENC"], +["0 1", "2DUP", "P2SH,STRICTENC"], +["0 0 1", "3DUP", "P2SH,STRICTENC"], +["0 1 0 0", "2OVER", "P2SH,STRICTENC"], +["0 1 0 0 0 0", "2ROT", "P2SH,STRICTENC"], +["0 1 0 0", "2SWAP", "P2SH,STRICTENC"], +["1", "IFDUP", "P2SH,STRICTENC"], +["NOP", "DEPTH 1", "P2SH,STRICTENC"], +["0", "DROP 1", "P2SH,STRICTENC"], +["1", "DUP", "P2SH,STRICTENC"], +["0 1", "NIP", "P2SH,STRICTENC"], +["1 0", "OVER", "P2SH,STRICTENC"], +["1 0 0 0 3", "PICK", "P2SH,STRICTENC"], +["1 0", "PICK", "P2SH,STRICTENC"], +["1 0 0 0 3", "ROLL", "P2SH,STRICTENC"], +["1 0", "ROLL", "P2SH,STRICTENC"], +["1 0 0", "ROT", "P2SH,STRICTENC"], +["1 0", "SWAP", "P2SH,STRICTENC"], +["0 1", "TUCK", "P2SH,STRICTENC"], + +["1", "SIZE", "P2SH,STRICTENC"], + +["0 0", "EQUAL", "P2SH,STRICTENC"], +["0 0", "EQUALVERIFY 1", "P2SH,STRICTENC"], + +["0", "1ADD", "P2SH,STRICTENC"], +["2", "1SUB", "P2SH,STRICTENC"], +["-1", "NEGATE", "P2SH,STRICTENC"], +["-1", "ABS", "P2SH,STRICTENC"], +["0", "NOT", "P2SH,STRICTENC"], +["-1", "0NOTEQUAL", "P2SH,STRICTENC"], + +["1 0", "ADD", "P2SH,STRICTENC"], +["1 0", "SUB", "P2SH,STRICTENC"], +["-1 -1", "BOOLAND", "P2SH,STRICTENC"], +["-1 0", "BOOLOR", "P2SH,STRICTENC"], +["0 0", "NUMEQUAL", "P2SH,STRICTENC"], +["0 0", "NUMEQUALVERIFY 1", "P2SH,STRICTENC"], +["-1 0", "NUMNOTEQUAL", "P2SH,STRICTENC"], +["-1 0", "LESSTHAN", "P2SH,STRICTENC"], +["1 0", "GREATERTHAN", "P2SH,STRICTENC"], +["0 0", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["0 0", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["-1 0", "MIN", "P2SH,STRICTENC"], +["1 0", "MAX", "P2SH,STRICTENC"], +["-1 -1 0", "WITHIN", "P2SH,STRICTENC"], + +["0", "RIPEMD160", "P2SH,STRICTENC"], +["0", "SHA1", "P2SH,STRICTENC"], +["0", "SHA256", "P2SH,STRICTENC"], +["0", "HASH160", "P2SH,STRICTENC"], +["0", "HASH256", "P2SH,STRICTENC"], +["NOP", "CODESEPARATOR 1", "P2SH,STRICTENC"], + +["NOP", "NOP1 1", "P2SH,STRICTENC"], +["NOP", "NOP2 1", "P2SH,STRICTENC"], +["NOP", "NOP3 1", "P2SH,STRICTENC"], +["NOP", "NOP4 1", "P2SH,STRICTENC"], +["NOP", "NOP5 1", "P2SH,STRICTENC"], +["NOP", "NOP6 1", "P2SH,STRICTENC"], +["NOP", "NOP7 1", "P2SH,STRICTENC"], +["NOP", "NOP8 1", "P2SH,STRICTENC"], +["NOP", "NOP9 1", "P2SH,STRICTENC"], +["NOP", "NOP10 1", "P2SH,STRICTENC"], + +["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], +["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "Zero sigs means no sigs are checked"], +["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], + +["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], +["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "Zero sigs means no sigs are checked"], +["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], + +["", "0 0 'a' 'b' 2 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "Test from up to 20 pubkeys, all not checked"], +["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 2 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], + +["", +"0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG", +"P2SH,STRICTENC", +"nOpCount is incremented by the number of keys evaluated in addition to the usual one op per op. In this case we have zero keys, so we can execute 201 CHECKMULTISIGS"], + +["1", +"0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], + +["", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG", +"P2SH,STRICTENC", +"Even though there are no signatures being checked nOpCount is incremented by the number of keys."], + +["1", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], + +["0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC", "Very basic P2SH"], +["0x4c 0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC"], + +["0x40 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", +"0x4d 0x4000 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 EQUAL", +"P2SH,STRICTENC", +"Basic PUSH signedness check"], + +["0x4c 0x40 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", +"0x4d 0x4000 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 EQUAL", +"P2SH,STRICTENC", +"Basic PUSHDATA1 signedness check"], + +["all PUSHDATA forms are equivalent"], + +["0x4c 0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA1 of 75 bytes equals direct push of it"], +["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4c 0xFF 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"], + +["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], + +["Numeric pushes"], + +["0x01 0x81", "0x4f EQUAL", "", "OP1_NEGATE pushes 0x81"], +["0x01 0x01", "0x51 EQUAL", "", "OP_1 pushes 0x01"], +["0x01 0x02", "0x52 EQUAL", "", "OP_2 pushes 0x02"], +["0x01 0x03", "0x53 EQUAL", "", "OP_3 pushes 0x03"], +["0x01 0x04", "0x54 EQUAL", "", "OP_4 pushes 0x04"], +["0x01 0x05", "0x55 EQUAL", "", "OP_5 pushes 0x05"], +["0x01 0x06", "0x56 EQUAL", "", "OP_6 pushes 0x06"], +["0x01 0x07", "0x57 EQUAL", "", "OP_7 pushes 0x07"], +["0x01 0x08", "0x58 EQUAL", "", "OP_8 pushes 0x08"], +["0x01 0x09", "0x59 EQUAL", "", "OP_9 pushes 0x09"], +["0x01 0x0a", "0x5a EQUAL", "", "OP_10 pushes 0x0a"], +["0x01 0x0b", "0x5b EQUAL", "", "OP_11 pushes 0x0b"], +["0x01 0x0c", "0x5c EQUAL", "", "OP_12 pushes 0x0c"], +["0x01 0x0d", "0x5d EQUAL", "", "OP_13 pushes 0x0d"], +["0x01 0x0e", "0x5e EQUAL", "", "OP_14 pushes 0x0e"], +["0x01 0x0f", "0x5f EQUAL", "", "OP_15 pushes 0x0f"], +["0x01 0x10", "0x60 EQUAL", "", "OP_16 pushes 0x10"], + +["Equivalency of different numeric encodings"], + +["0x02 0x8000", "128 NUMEQUAL", "", "0x8000 equals 128"], +["0x01 0x00", "0 NUMEQUAL", "", "0x00 numequals 0"], +["0x01 0x80", "0 NUMEQUAL", "", "0x80 (negative zero) numequals 0"], +["0x02 0x0080", "0 NUMEQUAL", "", "0x0080 numequals 0"], +["0x02 0x0500", "5 NUMEQUAL", "", "0x0500 numequals 5"], +["0x03 0xff7f80", "0x02 0xffff NUMEQUAL", "", ""], +["0x03 0xff7f00", "0x02 0xff7f NUMEQUAL", "", ""], +["0x04 0xffff7f80", "0x03 0xffffff NUMEQUAL", "", ""], +["0x04 0xffff7f00", "0x03 0xffff7f NUMEQUAL", "", ""], + +["Unevaluated non-minimal pushes are ignored"], + +["0 IF 0x4c 0x00 ENDIF 1", "", "MINIMALDATA", "non-minimal PUSHDATA1 ignored"], +["0 IF 0x4d 0x0000 ENDIF 1", "", "MINIMALDATA", "non-minimal PUSHDATA2 ignored"], +["0 IF 0x4c 0x00000000 ENDIF 1", "", "MINIMALDATA", "non-minimal PUSHDATA4 ignored"], +["0 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "1NEGATE equiv"], +["0 IF 0x01 0x01 ENDIF 1", "", "MINIMALDATA", "OP_1 equiv"], +["0 IF 0x01 0x02 ENDIF 1", "", "MINIMALDATA", "OP_2 equiv"], +["0 IF 0x01 0x03 ENDIF 1", "", "MINIMALDATA", "OP_3 equiv"], +["0 IF 0x01 0x04 ENDIF 1", "", "MINIMALDATA", "OP_4 equiv"], +["0 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "OP_5 equiv"], +["0 IF 0x01 0x06 ENDIF 1", "", "MINIMALDATA", "OP_6 equiv"], +["0 IF 0x01 0x07 ENDIF 1", "", "MINIMALDATA", "OP_7 equiv"], +["0 IF 0x01 0x08 ENDIF 1", "", "MINIMALDATA", "OP_8 equiv"], +["0 IF 0x01 0x09 ENDIF 1", "", "MINIMALDATA", "OP_9 equiv"], +["0 IF 0x01 0x0a ENDIF 1", "", "MINIMALDATA", "OP_10 equiv"], +["0 IF 0x01 0x0b ENDIF 1", "", "MINIMALDATA", "OP_11 equiv"], +["0 IF 0x01 0x0c ENDIF 1", "", "MINIMALDATA", "OP_12 equiv"], +["0 IF 0x01 0x0d ENDIF 1", "", "MINIMALDATA", "OP_13 equiv"], +["0 IF 0x01 0x0e ENDIF 1", "", "MINIMALDATA", "OP_14 equiv"], +["0 IF 0x01 0x0f ENDIF 1", "", "MINIMALDATA", "OP_15 equiv"], +["0 IF 0x01 0x10 ENDIF 1", "", "MINIMALDATA", "OP_16 equiv"], + +["Numeric minimaldata rules are only applied when a stack item is numerically evaluated; the push itself is allowed"], + +["0x01 0x00", "1", "MINIMALDATA"], +["0x01 0x80", "1", "MINIMALDATA"], +["0x02 0x0180", "1", "MINIMALDATA"], +["0x02 0x0100", "1", "MINIMALDATA"], +["0x02 0x0200", "1", "MINIMALDATA"], +["0x02 0x0300", "1", "MINIMALDATA"], +["0x02 0x0400", "1", "MINIMALDATA"], +["0x02 0x0500", "1", "MINIMALDATA"], +["0x02 0x0600", "1", "MINIMALDATA"], +["0x02 0x0700", "1", "MINIMALDATA"], +["0x02 0x0800", "1", "MINIMALDATA"], +["0x02 0x0900", "1", "MINIMALDATA"], +["0x02 0x0a00", "1", "MINIMALDATA"], +["0x02 0x0b00", "1", "MINIMALDATA"], +["0x02 0x0c00", "1", "MINIMALDATA"], +["0x02 0x0d00", "1", "MINIMALDATA"], +["0x02 0x0e00", "1", "MINIMALDATA"], +["0x02 0x0f00", "1", "MINIMALDATA"], +["0x02 0x1000", "1", "MINIMALDATA"], + +["Valid version of the 'Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule' script_invalid test"], + +["1 0x02 0x0000", "PICK DROP", ""], +["1 0x02 0x0000", "ROLL DROP 1", ""], +["0x02 0x0000", "1ADD DROP 1", ""], +["0x02 0x0000", "1SUB DROP 1", ""], +["0x02 0x0000", "NEGATE DROP 1", ""], +["0x02 0x0000", "ABS DROP 1", ""], +["0x02 0x0000", "NOT DROP 1", ""], +["0x02 0x0000", "0NOTEQUAL DROP 1", ""], + +["0 0x02 0x0000", "ADD DROP 1", ""], +["0x02 0x0000 0", "ADD DROP 1", ""], +["0 0x02 0x0000", "SUB DROP 1", ""], +["0x02 0x0000 0", "SUB DROP 1", ""], +["0 0x02 0x0000", "BOOLAND DROP 1", ""], +["0x02 0x0000 0", "BOOLAND DROP 1", ""], +["0 0x02 0x0000", "BOOLOR DROP 1", ""], +["0x02 0x0000 0", "BOOLOR DROP 1", ""], +["0 0x02 0x0000", "NUMEQUAL DROP 1", ""], +["0x02 0x0000 1", "NUMEQUAL DROP 1", ""], +["0 0x02 0x0000", "NUMEQUALVERIFY 1", ""], +["0x02 0x0000 0", "NUMEQUALVERIFY 1", ""], +["0 0x02 0x0000", "NUMNOTEQUAL DROP 1", ""], +["0x02 0x0000 0", "NUMNOTEQUAL DROP 1", ""], +["0 0x02 0x0000", "LESSTHAN DROP 1", ""], +["0x02 0x0000 0", "LESSTHAN DROP 1", ""], +["0 0x02 0x0000", "GREATERTHAN DROP 1", ""], +["0x02 0x0000 0", "GREATERTHAN DROP 1", ""], +["0 0x02 0x0000", "LESSTHANOREQUAL DROP 1", ""], +["0x02 0x0000 0", "LESSTHANOREQUAL DROP 1", ""], +["0 0x02 0x0000", "GREATERTHANOREQUAL DROP 1", ""], +["0x02 0x0000 0", "GREATERTHANOREQUAL DROP 1", ""], +["0 0x02 0x0000", "MIN DROP 1", ""], +["0x02 0x0000 0", "MIN DROP 1", ""], +["0 0x02 0x0000", "MAX DROP 1", ""], +["0x02 0x0000 0", "MAX DROP 1", ""], + +["0x02 0x0000 0 0", "WITHIN DROP 1", ""], +["0 0x02 0x0000 0", "WITHIN DROP 1", ""], +["0 0 0x02 0x0000", "WITHIN DROP 1", ""], + +["0 0 0x02 0x0000", "CHECKMULTISIG DROP 1", ""], +["0 0x02 0x0000 0", "CHECKMULTISIG DROP 1", ""], +["0 0x02 0x0000 0 1", "CHECKMULTISIG DROP 1", ""], +["0 0 0x02 0x0000", "CHECKMULTISIGVERIFY 1", ""], +["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", ""], + +["CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and"], +["pubkeys in a specific order, and will exit early if the number of signatures"], +["left to check is greater than the number of keys left. As STRICTENC fails the"], +["script when it reaches an invalidly encoded signature or pubkey, we can use it"], +["to test the exact order in which signatures and pubkeys are evaluated by"], +["distinguishing CHECKMULTISIG returning false on the stack and the script as a"], +["whole failing."], +["See also the corresponding inverted versions of these tests in script_invalid.json"], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with the second pubkey invalid, and both signatures validly encoded. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid pubkey." +], +[ + "0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature." +], + +["Automatically generated test cases"], +[ + "0x47 0x3044022053205076a7bb13d2db3162a2d97d8197631f829b065948b7019b15482af819a902204328dcc02c994ca086b1226d0d5f1674d23cfae0d846143df812b81cab3391e801", + "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "", + "P2PK" +], +[ + "0x47 0x304402206e05a6fe23c59196ffe176c9ddc31e73a9885638f9d1328d47c0c703863b8876022076feb53811aa5b04e0e79f938eb19906cc5e67548bc555a8e8b8b0fc603d840c01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", + "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", + "", + "P2PKH" +], +[ + "0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790281", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "", + "P2PK anyonecanpay" +], +[ + "0x47 0x304402202166fcd5e607de452d3c6f15e059505cf21654346592f9650ba906b9e8be88fa022005d976d28eb8de477102feba28807b3ad361e7fa24796d259c9d61452f7c318c01 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", + "P2SH", + "P2SH(P2PK)" +], +[ + "0x47 0x3044022064cc90ca89ad721384b231653b945579359a24b928ef8539b331172628c9cc6102203e238869ab5dac3fc293db53c12e7dd3079e86cfde9024b689efc7227e4d671001 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", + "", + "P2SH(P2PKH), bad sig but no VERIFY_P2SH" +], +[ + "0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402206d32e6d6b131ef2fe77b6a9b90b120d74e3e238e79dcffb10523a6ec94f93d65022067ae8772632ddf4c389258c6b70ed0ff94f20ee8f60207aa192a52a2469cddd901 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "", + "3-of-3" +], +[ + "0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0x47 0x304402204511cf05e85c2be07c6c176c5338a08ed3cb34212667f39613340881169986c002207cc48b27aa3691a20706a5773ec9923cadd20fedffd00c24457d85f83f0b51fe01 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", + "P2SH", + "P2SH(2-of-3)" +], +[ + "0x47 0x30440220001d6702bfa4f49c3a2542af9b1c2844a2eaac55f86f310f42d26a5dd17d6a8002202cdadbe608c00b50dd951c6ba0877d5b07a970f3e265c18697bc413a0a86f69901", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "", + "P2PK with too much R padding but no DERSIG" +], +[ + "0x48 0x304502207d2b258e959605e2ea50b46fea1325b7391ffb0c14a5b58ef8ad3851da3644380221007e75136df5f2e38216c4338b31c97e8307102edb97d611e06914e1f8fba68ead01", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "", + "P2PK with too much S padding but no DERSIG" +], +[ + "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "", + "P2PK with too little R padding but no DERSIG" +], +[ + "0x47 0x30440220003040725f724b0e2142fc44ac71f6e13161f6410aeb6dee477952ede3b6a6ca022041ff4940ee3d88116ad281d7cc556e1f2c9427d82290bd7974a25addbcd5bede01", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "", + "P2PK NOT with bad sig with too much R padding but no DERSIG" +], +[ + "0x49 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef05101", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "", + "P2PK with high S but no LOW_S" +], +[ + "0x47 0x30440220745d63eb70d45652128b450aa5ca7d9b513439963f261cb1c40a60f0785e7ee402204877785b38945ca9dbec78e1c1d4dd12148cc25c868bd27480023b49ae0f310501", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "", + "P2PK with hybrid pubkey but no STRICTENC" +], +[ + "0x47 0x30440220606f6f9f6cebc84ebfb6a4bff0b682bd99f05511295545ce9b275e98be3c946102206871d6a76f4e1b43d9763cfc5647844e4811682b1cab0325f060f44ddf44002201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "", + "P2PK NOT with invalid hybrid pubkey but no STRICTENC" +], +[ + "0 0x47 0x304402203a5ee39032637c431af0a3ac42e32e0627390bd44f6f98c9c04e6d714635ad0202207b42fcd889c3ae8a1b515608f38535f1f9be815176ee8d1b65a27c767cf37aed01", + "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "", + "1-of-2 with the second 1 hybrid pubkey and no STRICTENC" +], +[ + "0 0x47 0x304402203a5ee39032637c431af0a3ac42e32e0627390bd44f6f98c9c04e6d714635ad0202207b42fcd889c3ae8a1b515608f38535f1f9be815176ee8d1b65a27c767cf37aed01", + "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "STRICTENC", + "1-of-2 with the second 1 hybrid pubkey" +], +[ + "0x47 0x304402201c215cb13e4954e60ce4f6de74941904c771f998de7b1d9627e82a1949fde517022031c2197455f3dbecbb78321201308d7b039424e38d480772d7cd4eb465a083f405", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "", + "P2PK with undefined hashtype but no STRICTENC" +], +[ + "0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", + "", + "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC" +], +[ + "1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402206d32e6d6b131ef2fe77b6a9b90b120d74e3e238e79dcffb10523a6ec94f93d65022067ae8772632ddf4c389258c6b70ed0ff94f20ee8f60207aa192a52a2469cddd901 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "", + "3-of-3 with nonzero dummy but no NULLDUMMY" +], +[ + "1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", + "", + "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY" +], +[ + "0 0x47 0x304402206cb053202e1501e6faa24e6e309bf46a2f9255aa9484ff4a26efb7434f78a58a0220132b10419c3b99601f154bf86cf12259aacd8c6f363a73dacb1d0b941680bb4c01 DUP", + "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "", + "2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY" +], +[ + "0 0x47 0x304402206cb053202e1501e6faa24e6e309bf46a2f9255aa9484ff4a26efb7434f78a58a0220132b10419c3b99601f154bf86cf12259aacd8c6f363a73dacb1d0b941680bb4c01 0x47 0x304402206cb053202e1501e6faa24e6e309bf46a2f9255aa9484ff4a26efb7434f78a58a0220132b10419c3b99601f154bf86cf12259aacd8c6f363a73dacb1d0b941680bb4c01", + "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "SIGPUSHONLY", + "2-of-2 with two identical keys and sigs pushed" +], + +["The End"] +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/sig_canonical.json b/packages/kauri-bitcore-lib/test/data/bitcoind/sig_canonical.json new file mode 100644 index 0000000..e43a086 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/sig_canonical.json @@ -0,0 +1,7 @@ +[ + "300602010002010001", + "3008020200ff020200ff01", + "304402203932c892e2e550f3af8ee4ce9c215a87f9bb831dcac87b2838e2c2eaa891df0c022030b61dd36543125d56b9f9f3a1f9353189e5af33cdda8d77a5209aec03978fa001", + "30450220076045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01", + "3046022100876045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01" +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/sig_noncanonical.json b/packages/kauri-bitcore-lib/test/data/bitcoind/sig_noncanonical.json new file mode 100644 index 0000000..d9a6c1c --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/sig_noncanonical.json @@ -0,0 +1,22 @@ +[ + "non-hex strings are ignored", + + "too short:", "30050201FF020001", + "too long:", "30470221005990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba6105022200002d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "hashtype:", "304402205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed11", + "type:", "314402205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "total length:", "304502205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "S len oob:", "301F01205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb101", + "R+S:", "304502205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed0001", + + "R type:", "304401205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "R len = 0:", "3024020002202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "R<0:", "304402208990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "R padded:", "30450221005990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610502202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + + + "S type:", "304402205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba610501202d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "S len = 0:", "302402205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba6105020001", + "S<0:", "304402205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba61050220fd5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01", + "S padded:", "304502205990e0584b2b238e1dfaad8d6ed69ecc1a4a13ac85fc0b31d0df395eb1ba61050221002d5876262c288beb511d061691bf26777344b702b00f8fe28621fe4e566695ed01" +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/tx_invalid.json b/packages/kauri-bitcore-lib/test/data/bitcoind/tx_invalid.json new file mode 100644 index 0000000..e304985 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/tx_invalid.json @@ -0,0 +1,174 @@ +[ +["The following are deserialized transactions which are invalid."], +["They are in the form"], +["[[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], +["serializedTransaction, verifyFlags]"], +["Objects that are only a single string (like this one) are ignored"], + +["0e1b5688cf179cd9f7cbda1fac0090f6e684bbf8cd946660120197c3f3681809 but with extra junk appended to the end of the scriptPubKey"], +[[["6ca7ec7b1847f6bdbd737176050e6a08d66ccd55bb94ad24f4018024107a5827", 0, "0x41 0x043b640e983c9690a14c039a2037ecc3467b27a0dcd58f19d76c7bc118d09fec45adc5370a1c5bf8067ca9f5557a4cf885fdb0fe0dcc9c3a7137226106fbc779a5 CHECKSIG VERIFY 1"]], +"010000000127587a10248001f424ad94bb55cd6cd6086a0e05767173bdbdf647187beca76c000000004948304502201b822ad10d6adc1a341ae8835be3f70a25201bbff31f59cbb9c5353a5f0eca18022100ea7b2f7074e9aa9cf70aa8d0ffee13e6b45dddabf1ab961bda378bcdb778fa4701ffffffff0100f2052a010000001976a914fc50c5907d86fed474ba5ce8b12a66e0a4c139d888ac00000000", "P2SH"], + +["This is the nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG from tx_valid.json"], +["but with the signature duplicated in the scriptPubKey with a non-standard pushdata prefix"], +["See FindAndDelete, which will only remove if it uses the same pushdata prefix as is standard"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], + +["Same as above, but with the sig in the scriptSig also pushed with the same non-standard OP_PUSHDATA"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006b4c473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], + +["An invalid P2SH Transaction"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", "P2SH"], + +["Tests for CheckTransaction()"], + +["No outputs"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x05ab9e14d983742513f0f451e105ffb4198d1dd4 EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022100f16703104aab4e4088317c862daec83440242411b039d14280e03dd33b487ab802201318a7be236672c5c56083eb7a5a195bc57a40af7923ff8545016cd3b571e2a601232103c40e5d339df3f30bf753e7e04450ae4ef76c9e45587d1d993bdc4cd06f0651c7acffffffff0000000000", "P2SH"], + +["Negative output"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xae609aca8061d77c5e111f6bb62501a6bbe2bfdb EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d4830450220063222cbb128731fc09de0d7323746539166544d6c1df84d867ccea84bcc8903022100bf568e8552844de664cd41648a031554327aa8844af34b4f27397c65b92c04de0123210243ec37dee0e2e053a9c976f43147e79bc7d9dc606ea51010af1ac80db6b069e1acffffffff01ffffffffffffffff015100000000", "P2SH"], + +["MAX_MONEY + 1 output"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010140075af0750700015100000000", "P2SH"], + +["MAX_MONEY output + 1 output"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510001000000000000015100000000", "P2SH"], + +["Duplicate inputs"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x236d0639db62b0773fd8ac34dc85ae19e9aba80a EQUAL"]], +"01000000020001000000000000000000000000000000000000000000000000000000000000000000006c47304402204bb1197053d0d7799bf1b30cd503c44b58d6240cccbdc85b6fe76d087980208f02204beeed78200178ffc6c74237bb74b3f276bbb4098b5605d814304fe128bf1431012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff0001000000000000000000000000000000000000000000000000000000000000000000006c47304402202306489afef52a6f62e90bf750bbcdf40c06f5c6b138286e6b6b86176bb9341802200dba98486ea68380f47ebb19a7df173b99e6bc9c681d6ccf3bde31465d1f16b3012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff010000000000000000015100000000", "P2SH"], + +["Coinbase of size 1"], +["Note the input is just required to make the tester happy"], +[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0151ffffffff010000000000000000015100000000", "P2SH"], + +["Coinbase of size 101"], +["Note the input is just required to make the tester happy"], +[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff655151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "P2SH"], + +["Null txin"], +[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "HASH160 0x14 0x02dae7dbbda56097959cba59b1989dd3e47937bf EQUAL"]], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6e49304602210086f39e028e46dafa8e1e3be63906465f4cf038fbe5ed6403dc3e74ae876e6431022100c4625c675cfc5c7e3a0e0d7eaec92ac24da20c73a88eb40d09253e51ac6def5201232103a183ddc41e84753aca47723c965d1b5c8b0e2b537963518355e6dd6cf8415e50acffffffff010000000000000000015100000000", "P2SH"], + +["Same as the transactions in valid with one input SIGHASH_ALL and one SIGHASH_ANYONECANPAY, but we set the _ANYONECANPAY sequence number, invalidating the SIGHASH_ALL signature"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"], + ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], + "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df10101000000000200000000000000000000000000000000000000000000000000000000000000000000484730440220201dc2d030e380e8f9cfb41b442d930fa5a685bb2c8db5906671f865507d0670022018d9e7a8d4c8d86a73c2a724ee38ef983ec249827e0e464841735955c707ece98101000000010100000000000000015100000000", "P2SH"], + +["CHECKMULTISIG with incorrect signature order"], +["Note the input is just required to make the tester happy"], +[[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]], +"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe000048304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f401483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "P2SH"], + + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with the dummy value missing"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + + +["CHECKMULTISIG SCRIPT_VERIFY_NULLDUMMY tests:"], + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a010047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["As above, but using a OP_1"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["As above, but using a OP_1NEGATE"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["As above, but with the dummy byte missing"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + + +["Empty stack when we try to run CHECKSIG"], +[[["ad503f72c18df5801ee64d76090afe4c607fb2b822e9b7b63c5826c50e22fc3b", 0, "0x21 0x027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5 CHECKSIG NOT"]], +"01000000013bfc220ec526583cb6b7e922b8b27f604cfe0a09764de61e80f58dc1723f50ad0000000000ffffffff0101000000000000002321027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5ac00000000", "P2SH"], + +["CHECKLOCKTIMEVERIFY tests"], + +["By-height locks, with argument just beyond tx nLockTime"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000fe64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], + +["By-time locks, with argument just beyond tx nLockTime (but within numerical boundries)"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000001 NOP2 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Argument missing"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Argument negative with by-blockheight nLockTime=0"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Argument negative with by-blocktime nLockTime=500,000,000"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 NOP2 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Input locked"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Another input being unlocked isn't sufficient; the CHECKLOCKTIMEVERIFY-using input must be unlocked"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"] , + ["0000000000000000000000000000000000000000000000000000000000000200", 1, "1"]], +"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00020000000000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Argument/tx height/time mismatch, both versions"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Argument 2^32 with nLockTime=2^32-1"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967296 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Same, but with nLockTime=2^31-1"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffff7f", "P2SH,CHECKLOCKTIMEVERIFY"], + +["6 byte non-minimally-encoded arguments are invalid even in their contents are valid"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x06 0x000000000000 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Failure due to failing CHECKLOCKTIMEVERIFY in scriptSig"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Failure due to failing CHECKLOCKTIMEVERIFY in redeemScript"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Failure due to empty stack before CHECKLOCKTIMEVERIFY in redeemScript"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000001b1010000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + + +["Make diffs cleaner by leaving a comment here without comma at the end"] +] diff --git a/packages/kauri-bitcore-lib/test/data/bitcoind/tx_valid.json b/packages/kauri-bitcore-lib/test/data/bitcoind/tx_valid.json new file mode 100644 index 0000000..438ca9c --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/bitcoind/tx_valid.json @@ -0,0 +1,224 @@ +[ +["The following are deserialized transactions which are valid."], +["They are in the form"], +["[[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], +["serializedTransaction, verifyFlags]"], +["Objects that are only a single string (like this one) are ignored"], + +["The following is 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is of particular interest because it contains an invalidly-encoded signature which OpenSSL accepts"], +["See http://r6.ca/blog/20111119T211504Z.html"], +["It is also the first OP_CHECKMULTISIG transaction in standard form"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000490047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with an arbitrary extra byte stuffed into the signature at pos length - 2"], +["The dummy byte is fine however, so the NULLDUMMY flag should be happy"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a01ff47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + +["As above, but using a OP_1"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + +["As above, but using a OP_1NEGATE"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + +["The following is c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73"], +["It is of interest because it contains a 0-sequence as well as a signature of SIGHASH type 0 (which is not a real type)"], +[[["406b2b06bcd34d3c8733e6b79f7a394c8a431fbf4ff5ac705c93f4076bb77602", 0, "DUP HASH160 0x14 0xdc44b1164188067c3a32d4780f5996fa14a4f2d9 EQUALVERIFY CHECKSIG"]], +"01000000010276b76b07f4935c70acf54fbf1f438a4c397a9fb7e633873c4dd3bc062b6b40000000008c493046022100d23459d03ed7e9511a47d13292d3430a04627de6235b6e51a40f9cd386f2abe3022100e7d25b080f0bb8d8d5f878bba7d54ad2fda650ea8d158a33ee3cbd11768191fd004104b0e2c879e4daf7b9ab68350228c159766676a14f5815084ba166432aab46198d4cca98fa3e9981d0a90b2effc514b76279476550ba3663fdcaff94c38420e9d5000000000100093d00000000001976a9149a7b0f3b80c6baaeedce0a0842553800f832ba1f88ac00000000", "P2SH"], + +["A nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], + +["Same as above, but with the signature duplicated in the scriptPubKey with the proper pushdata prefix"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], + +["The following is f7fdd091fa6d8f5e7a8c2458f5c38faffff2d3f1406b6e4fe2c99dcc0d2d1cbb"], +["It caught a bug in the workaround for 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63 in an overly simple implementation"], +[[["b464e85df2a238416f8bdae11d120add610380ea07f4ef19c5f9dfd472f96c3d", 0, "DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG"], +["b7978cc96e59a8b13e0865d3f95657561a7f725be952438637475920bac9eb21", 1, "DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG"]], +"01000000023d6cf972d4dff9c519eff407ea800361dd0a121de1da8b6f4138a2f25de864b4000000008a4730440220ffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e022049cffa1cdc102a0b56e0e04913606c70af702a1149dc3b305ab9439288fee090014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff21ebc9ba20594737864352e95b727f1a565756f9d365083eb1a8596ec98c97b7010000008a4730440220503ff10e9f1e0de731407a4a245531c9ff17676eda461f8ceeb8c06049fa2c810220c008ac34694510298fa60b3f000df01caa244f165b727d4896eb84f81e46bcc4014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff01f0da5200000000001976a914857ccd42dded6df32949d4646dfa10a92458cfaa88ac00000000", "P2SH"], + +["The following tests for the presence of a bug in the handling of SIGHASH_SINGLE"], +["It results in signing the constant 1, instead of something generated based on the transaction,"], +["when the input doing the signing has an index greater than the maximum output index"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0xe52b482f2faa8ecbf0db344f93c84ac908557f33 EQUALVERIFY CHECKSIG"], ["0000000000000000000000000000000000000000000000000000000000000200", 0, "1"]], +"01000000020002000000000000000000000000000000000000000000000000000000000000000000000151ffffffff0001000000000000000000000000000000000000000000000000000000000000000000006b483045022100c9cdd08798a28af9d1baf44a6c77bcc7e279f47dc487c8c899911bc48feaffcc0220503c5c50ae3998a733263c5c0f7061b483e2b56c4c41b456e7d2f5a78a74c077032102d5c25adb51b61339d2b05315791e21bbe80ea470a49db0135720983c905aace0ffffffff010000000000000000015100000000", "P2SH"], + +["An invalid P2SH Transaction"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", "NONE"], + +["A valid P2SH Transaction using the standard transaction type put forth in BIP 16"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x8febbed40483661de6958d957412f82deed8e2f7 EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100c66c9cdf4c43609586d15424c54707156e316d88b0a1534c9e6b0d4f311406310221009c0fe51dbc9c4ab7cc25d3fdbeccf6679fe6827f08edf2b4a9f16ee3eb0e438a0123210338e8034509af564c62644c07691942e0c056752008a173c89f60ab2a88ac2ebfacffffffff010000000000000000015100000000", "P2SH"], + +["Tests for CheckTransaction()"], +["MAX_MONEY output"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010040075af0750700015100000000", "P2SH"], + +["MAX_MONEY output + 0 output"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510000000000000000015100000000", "P2SH"], + +["Coinbase of size 2"], +["Note the input is just required to make the tester happy"], +[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025151ffffffff010000000000000000015100000000", "P2SH"], + +["Coinbase of size 100"], +["Note the input is just required to make the tester happy"], +[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6451515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "P2SH"], + +["Simple transaction with first input is signed with SIGHASH_ALL, second with SIGHASH_ANYONECANPAY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"], + ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], + "010000000200010000000000000000000000000000000000000000000000000000000000000000000049483045022100d180fd2eb9140aeb4210c9204d3f358766eb53842b2a9473db687fa24b12a3cc022079781799cd4f038b85135bbe49ec2b57f306b2bb17101b17f71f000fcab2b6fb01ffffffff0002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", "P2SH"], + +["Same as above, but we change the sequence number of the first input to check that SIGHASH_ANYONECANPAY is being followed"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"], + ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], + "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df101010000000002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", "P2SH"], + +["afd9c17f8913577ec3509520bd6e5d63e9c0fd2a5f70c787993b097ba6ca9fae which has several SIGHASH_SINGLE signatures"], +[[["63cfa5a09dc540bf63e53713b82d9ea3692ca97cd608c384f2aa88e51a0aac70", 0, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"], + ["04e8d0fcf3846c6734477b98f0f3d4badfb78f020ee097a0be5fe347645b817d", 1, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"], + ["ee1377aff5d0579909e11782e1d2f5f7b84d26537be7f5516dd4e43373091f3f", 1, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"]], + "010000000370ac0a1ae588aaf284c308d67ca92c69a39e2db81337e563bf40c59da0a5cf63000000006a4730440220360d20baff382059040ba9be98947fd678fb08aab2bb0c172efa996fd8ece9b702201b4fb0de67f015c90e7ac8a193aeab486a1f587e0f54d0fb9552ef7f5ce6caec032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff7d815b6447e35fbea097e00e028fb7dfbad4f3f0987b4734676c84f3fcd0e804010000006b483045022100c714310be1e3a9ff1c5f7cacc65c2d8e781fc3a88ceb063c6153bf950650802102200b2d0979c76e12bb480da635f192cc8dc6f905380dd4ac1ff35a4f68f462fffd032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff3f1f097333e4d46d51f5e77b53264db8f7f5d2e18217e1099957d0f5af7713ee010000006c493046022100b663499ef73273a3788dea342717c2640ac43c5a1cf862c9e09b206fcb3f6bb8022100b09972e75972d9148f2bdd462e5cb69b57c1214b88fc55ca638676c07cfc10d8032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff0380841e00000000001976a914bfb282c70c4191f45b5a6665cad1682f2c9cfdfb88ac80841e00000000001976a9149857cc07bed33a5cf12b9c5e0500b675d500c81188ace0fd1c00000000001976a91443c52850606c872403c0601e69fa34b26f62db4a88ac00000000", "P2SH"], + + ["ddc454a1c0c35c188c98976b17670f69e586d9c0f3593ea879928332f0a069e7, which spends an input that pushes using a PUSHDATA1 that is negative when read as signed"], + [[["c5510a5dd97a25f43175af1fe649b707b1df8e1a41489bac33a23087027a2f48", 0, "0x4c 0xae 0x606563686f2022553246736447566b58312b5a536e587574356542793066794778625456415675534a6c376a6a334878416945325364667657734f53474f36633338584d7439435c6e543249584967306a486956304f376e775236644546673d3d22203e20743b206f70656e73736c20656e63202d7061737320706173733a5b314a564d7751432d707269766b65792d6865785d202d64202d6165732d3235362d636263202d61202d696e207460 DROP DUP HASH160 0x14 0xbfd7436b6265aa9de506f8a994f881ff08cc2872 EQUALVERIFY CHECKSIG"]], + "0100000001482f7a028730a233ac9b48411a8edfb107b749e61faf7531f4257ad95d0a51c5000000008b483045022100bf0bbae9bde51ad2b222e87fbf67530fbafc25c903519a1e5dcc52a32ff5844e022028c4d9ad49b006dd59974372a54291d5764be541574bb0c4dc208ec51f80b7190141049dd4aad62741dc27d5f267f7b70682eee22e7e9c1923b9c0957bdae0b96374569b460eb8d5b40d972e8c7c0ad441de3d94c4a29864b212d56050acb980b72b2bffffffff0180969800000000001976a914e336d0017a9d28de99d16472f6ca6d5a3a8ebc9988ac00000000", "P2SH"], + +["Correct signature order"], +["Note the input is just required to make the tester happy"], +[[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]], +"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe0000483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa0148304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f4014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "P2SH"], + +["cc60b1f899ec0a69b7c3f25ddf32c4524096a9c5b01cbd84c6d0312a0c478984, which is a fairly strange transaction which relies on OP_CHECKSIG returning 0 when checking a completely invalid sig of length 0"], +[[["cbebc4da731e8995fe97f6fadcd731b36ad40e5ecb31e38e904f6e5982fa09f7", 0, "0x2102085c6600657566acc2d6382a47bc3f324008d2aa10940dd7705a48aa2a5a5e33ac7c2103f5d0fb955f95dd6be6115ce85661db412ec6a08abcbfce7da0ba8297c6cc0ec4ac7c5379a820d68df9e32a147cffa36193c6f7c43a1c8c69cda530e1c6db354bfabdcfefaf3c875379a820f531f3041d3136701ea09067c53e7159c8f9b2746a56c3d82966c54bbc553226879a5479827701200122a59a5379827701200122a59a6353798277537982778779679a68"]], +"0100000001f709fa82596e4f908ee331cb5e0ed46ab331d7dcfaf697fe95891e73dac4ebcb000000008c20ca42095840735e89283fec298e62ac2ddea9b5f34a8cbb7097ad965b87568100201b1b01dc829177da4a14551d2fc96a9db00c6501edfa12f22cd9cefd335c227f483045022100a9df60536df5733dd0de6bc921fab0b3eee6426501b43a228afa2c90072eb5ca02201c78b74266fac7d1db5deff080d8a403743203f109fbcabf6d5a760bf87386d20100ffffffff01c075790000000000232103611f9a45c18f28f06f19076ad571c344c82ce8fcfe34464cf8085217a2d294a6ac00000000", "P2SH"], + +["Empty pubkey"], +[[["229257c295e7f555421c1bfec8538dd30a4b5c37c1c8810bbe83cafa7811652c", 0, "0x00 CHECKSIG NOT"]], +"01000000012c651178faca83be0b81c8c1375c4b0ad38d53c8fe1b1c4255f5e795c25792220000000049483045022100d6044562284ac76c985018fc4a90127847708c9edb280996c507b28babdc4b2a02203d74eca3f1a4d1eea7ff77b528fde6d5dc324ec2dbfdb964ba885f643b9704cd01ffffffff010100000000000000232102c2410f8891ae918cab4ffc4bb4a3b0881be67c7a1e7faa8b5acf9ab8932ec30cac00000000", "P2SH"], + +["Empty signature"], +[[["9ca93cfd8e3806b9d9e2ba1cf64e3cc6946ee0119670b1796a09928d14ea25f7", 0, "0x21 0x028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02 CHECKSIG NOT"]], +"0100000001f725ea148d92096a79b1709611e06e94c63c4ef61cbae2d9b906388efd3ca99c000000000100ffffffff0101000000000000002321028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02ac00000000", "P2SH"], + +[[["444e00ed7840d41f20ecd9c11d3f91982326c731a02f3c05748414a4fa9e59be", 0, "1 0x00 0x21 0x02136b04758b0b6e363e7a6fbe83aaf527a153db2b060d36cc29f7f8309ba6e458 2 CHECKMULTISIG"]], +"0100000001be599efaa4148474053c2fa031c7262398913f1dc1d9ec201fd44078ed004e44000000004900473044022022b29706cb2ed9ef0cb3c97b72677ca2dfd7b4160f7b4beb3ba806aa856c401502202d1e52582412eba2ed474f1f437a427640306fd3838725fab173ade7fe4eae4a01ffffffff010100000000000000232103ac4bba7e7ca3e873eea49e08132ad30c7f03640b6539e9b59903cf14fd016bbbac00000000", "P2SH"], + +[[["e16abbe80bf30c080f63830c8dbf669deaef08957446e95940227d8c5e6db612", 0, "1 0x21 0x03905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9f 0x00 2 CHECKMULTISIG"]], +"010000000112b66d5e8c7d224059e946749508efea9d66bf8d0c83630f080cf30be8bb6ae100000000490047304402206ffe3f14caf38ad5c1544428e99da76ffa5455675ec8d9780fac215ca17953520220779502985e194d84baa36b9bd40a0dbd981163fa191eb884ae83fc5bd1c86b1101ffffffff010100000000000000232103905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9fac00000000", "P2SH"], + +[[["ebbcf4bfce13292bd791d6a65a2a858d59adbf737e387e40370d4e64cc70efb0", 0, "2 0x21 0x033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194 0x21 0x03a88b326f8767f4f192ce252afe33c94d25ab1d24f27f159b3cb3aa691ffe1423 2 CHECKMULTISIG NOT"]], +"0100000001b0ef70cc644e0d37407e387e73bfad598d852a5aa6d691d72b2913cebff4bceb000000004a00473044022068cd4851fc7f9a892ab910df7a24e616f293bcb5c5fbdfbc304a194b26b60fba022078e6da13d8cb881a22939b952c24f88b97afd06b4c47a47d7f804c9a352a6d6d0100ffffffff0101000000000000002321033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194ac00000000", "P2SH"], + +[[["ba4cd7ae2ad4d4d13ebfc8ab1d93a63e4a6563f25089a18bf0fc68f282aa88c1", 0, "2 0x21 0x037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1 0x21 0x02edc823cd634f2c4033d94f5755207cb6b60c4b1f1f056ad7471c47de5f2e4d50 2 CHECKMULTISIG NOT"]], +"0100000001c188aa82f268fcf08ba18950f263654a3ea6931dabc8bf3ed1d4d42aaed74cba000000004b0000483045022100940378576e069aca261a6b26fb38344e4497ca6751bb10905c76bb689f4222b002204833806b014c26fd801727b792b1260003c55710f87c5adbd7a9cb57446dbc9801ffffffff0101000000000000002321037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1ac00000000", "P2SH"], + + +["OP_CODESEPARATOR tests"], + +["Test that SignatureHash() removes OP_CODESEPARATOR with FindAndDelete()"], +[[["bc7fd132fcf817918334822ee6d9bd95c889099c96e07ca2c1eb2cc70db63224", 0, "CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]], +"01000000012432b60dc72cebc1a27ce0969c0989c895bdd9e62e8234839117f8fc32d17fbc000000004a493046022100a576b52051962c25e642c0fd3d77ee6c92487048e5d90818bcf5b51abaccd7900221008204f8fb121be4ec3b24483b1f92d89b1b0548513a134e345c5442e86e8617a501ffffffff010000000000000000016a00000000", "P2SH"], +[[["83e194f90b6ef21fa2e3a365b63794fb5daa844bdc9b25de30899fcfe7b01047", 0, "CODESEPARATOR CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]], +"01000000014710b0e7cf9f8930de259bdc4b84aa5dfb9437b665a3e3a21ff26e0bf994e183000000004a493046022100a166121a61b4eeb19d8f922b978ff6ab58ead8a5a5552bf9be73dc9c156873ea02210092ad9bc43ee647da4f6652c320800debcf08ec20a094a0aaf085f63ecb37a17201ffffffff010000000000000000016a00000000", "P2SH"], + +["Hashed data starts at the CODESEPARATOR"], +[[["326882a7f22b5191f1a0cc9962ca4b878cd969cf3b3a70887aece4d801a0ba5e", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CODESEPARATOR CHECKSIG"]], +"01000000015ebaa001d8e4ec7a88703a3bcf69d98c874bca6299cca0f191512bf2a7826832000000004948304502203bf754d1c6732fbf87c5dcd81258aefd30f2060d7bd8ac4a5696f7927091dad1022100f5bcb726c4cf5ed0ed34cc13dadeedf628ae1045b7cb34421bc60b89f4cecae701ffffffff010000000000000000016a00000000", "P2SH"], + +["But only if execution has reached it"], +[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 1"]], +"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a900000000924830450221009c0a27f886a1d8cb87f6f595fbc3163d28f7a81ec3c4b252ee7f3ac77fd13ffa02203caa8dfa09713c8c4d7ef575c75ed97812072405d932bd11e6a1593a98b679370148304502201e3861ef39a526406bad1e20ecad06be7375ad40ddb582c9be42d26c3a0d7b240221009d0a3985e96522e59635d19cc4448547477396ce0ef17a58e7d74c3ef464292301ffffffff010000000000000000016a00000000", "P2SH"], + +["CHECKSIG is legal in scriptSigs"], +[[["ccf7f4053a02e653c36ac75c891b7496d0dc5ce5214f6c913d9cf8f1329ebee0", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"0100000001e0be9e32f1f89c3d916c4f21e55cdcd096741b895cc76ac353e6023a05f4f7cc00000000d86149304602210086e5f736a2c3622ebb62bd9d93d8e5d76508b98be922b97160edc3dcca6d8c47022100b23c312ac232a4473f19d2aeb95ab7bdf2b65518911a0d72d50e38b5dd31dc820121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac4730440220508fa761865c8abd81244a168392876ee1d94e8ed83897066b5e2df2400dad24022043f5ee7538e87e9c6aef7ef55133d3e51da7cc522830a9c4d736977a76ef755c0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["Same semantics for OP_CODESEPARATOR"], +[[["10c9f0effe83e97f80f067de2b11c6a00c3088a4bce42c5ae761519af9306f3c", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"01000000013c6f30f99a5161e75a2ce4bca488300ca0c6112bde67f0807fe983feeff0c91001000000e608646561646265656675ab61493046022100ce18d384221a731c993939015e3d1bcebafb16e8c0b5b5d14097ec8177ae6f28022100bcab227af90bab33c3fe0a9abfee03ba976ee25dc6ce542526e9b2e56e14b7f10121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac493046022100c3b93edcc0fd6250eb32f2dd8a0bba1754b0f6c3be8ed4100ed582f3db73eba2022100bf75b5bd2eff4d6bf2bda2e34a40fcc07d4aa3cf862ceaa77b47b81eff829f9a01ab21038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["Signatures are removed from the script they are in by FindAndDelete() in the CHECKSIG code; even multiple instances of one signature can be removed."], +[[["6056ebd549003b10cbbd915cea0d82209fe40b8617104be917a26fa92cbe3d6f", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"01000000016f3dbe2ca96fa217e94b1017860be49f20820dea5c91bdcb103b0049d5eb566000000000fd1d0147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac47304402203757e937ba807e4a5da8534c17f9d121176056406a6465054bdd260457515c1a02200f02eccf1bec0f3a0d65df37889143c2e88ab7acec61a7b6f5aa264139141a2b0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["That also includes ahead of the opcode being executed."], +[[["5a6b0021a6042a686b6b94abc36b387bef9109847774e8b1e51eb8cc55c53921", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"01000000012139c555ccb81ee5b1e87477840991ef7b386bc3ab946b6b682a04a621006b5a01000000fdb40148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f2204148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390175ac4830450220646b72c35beeec51f4d5bc1cbae01863825750d7f490864af354e6ea4f625e9c022100f04b98432df3a9641719dbced53393022e7249fb59db993af1118539830aab870148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a580039017521038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["Finally CHECKMULTISIG removes all signatures prior to hashing the script containing those signatures. In conjunction with the SIGHASH_SINGLE bug this lets us test whether or not FindAndDelete() is actually present in scriptPubKey/redeemScript evaluation by including a signature of the digest 0x01 We can compute in advance for our pubkey, embed it it in the scriptPubKey, and then also using a normal SIGHASH_ALL signature. If FindAndDelete() wasn't run, the 'bugged' signature would still be in the hashed script, and the normal signature would fail."], + +["Here's an example on mainnet within a P2SH redeemScript. Remarkably it's a standard transaction in <0.9"], +[[["b5b598de91787439afd5938116654e0b16b7a0d0f82742ba37564219c5afcbf9", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"], + ["ab9805c6d57d7070d9a42c5176e47bb705023e6b67249fb6760880548298e742", 0, "HASH160 0x14 0xd8dacdadb7462ae15cd906f1878706d0da8660e6 EQUAL"]], +"0100000002f9cbafc519425637ba4227f8d0a0b7160b4e65168193d5af39747891de98b5b5000000006b4830450221008dd619c563e527c47d9bd53534a770b102e40faa87f61433580e04e271ef2f960220029886434e18122b53d5decd25f1f4acb2480659fea20aabd856987ba3c3907e0121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffff42e7988254800876b69f24676b3e0205b77be476512ca4d970707dd5c60598ab00000000fd260100483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a53034930460221008431bdfa72bc67f9d41fe72e94c88fb8f359ffa30b33c72c121c5a877d922e1002210089ef5fc22dd8bfc6bf9ffdb01a9862d27687d424d1fefbab9e9c7176844a187a014c9052483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c7153aeffffffff01a08601000000000017a914d8dacdadb7462ae15cd906f1878706d0da8660e68700000000", "P2SH"], + +["Same idea, but with bare CHECKMULTISIG"], +[[["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"], + ["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 1, "2 0x48 0x3045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 3 CHECKMULTISIG"]], +"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000", "P2SH"], + +["CHECKLOCKTIMEVERIFY tests"], + +["By-height locks, with argument == 0 and == tx nLockTime"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], + +["By-time locks, with argument just beyond tx nLockTime (but within numerical boundries)"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Any non-maxint nSequence is fine"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["The argument can be calculated rather than created directly by a PUSHDATA"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 1ADD NOP2 1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Perhaps even by an ADD producing a 5-byte result that is out of bounds for other opcodes"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 2147483647 ADD NOP2 1"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "P2SH,CHECKLOCKTIMEVERIFY"], + +["5 byte non-minimally-encoded arguments are valid"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x05 0x0000000000 NOP2 1"]], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Valid CHECKLOCKTIMEVERIFY in scriptSig"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000001000000", "P2SH,CHECKLOCKTIMEVERIFY"], + +["Valid CHECKLOCKTIMEVERIFY in redeemScript"], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]], +"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000001000000", "P2SH,CHECKLOCKTIMEVERIFY"], + + +["Make diffs cleaner by leaving a comment here without comma at the end"] +] diff --git a/packages/kauri-bitcore-lib/test/data/blk86756-testnet.dat b/packages/kauri-bitcore-lib/test/data/blk86756-testnet.dat new file mode 100644 index 0000000000000000000000000000000000000000..207abdac05c64e3bd7eac65736d13bd32f24b5b6 GIT binary patch literal 9500 zcmb7~byU>fy2fDu=>|b^Xb}aG?nb&n8l*v*fgz<^N>aK*Ku}P+Te=&hyIVl+40@E` zy=UFynYH-C#dr4mJRhF@?!CWTRBU8K5poz901OO_^!ow@cOJS(-}p_pCU8N*#_b>dU{Vnfdc89DN< z6UC%%qWzmpjwfRCd^`WDdh2X#K{7VUKw@_#!<{OJaAjrb-A06maHcOO)=~9=l4d{j z;a3t*#Q+pAZyip?!GeBV*=Q`gafT>?9`f`h0{SP-PgiK;fv6d2216?S*3PTH@;a(HfsN29&z=_7&AGV`0$&r(Tx-FH6Bo3Y^ZkiDrbzULL zPhfddokGb0x-EQIpoO92-~(H|bM1^$Nk97RY=j|mv*?)O1{Kj{lBWFY2@Q;N%&ZI_ z?_mIjTY5{z*oR!h#-D7V4grs-+ve-4W^~Cu4~KQFx1Aet?Z z#^U)?Q2@|2SF)@cZnwzNrZODlg_cc7?`bgQ*yiJx-gesiJ+1-(d?r_wwmpqeStqxR zP~Uhgc-)NpnCSAoYYEm7DZ#`Z0G0yqBvQ59E;hA*Q|r8oE~r(<*Nkw&jAas+xo^qi z4gM}K)F5`i#!kDE1$VjO;64ubQn+d~yDXE}T#6TSwhyR+un;QAQu3)d1iD|ZOKQin z4Nau3g}sE0R1qh)SFKwXr~Ss;^9-xCafOgarbtP|&`otXdEO#xGrW@=i>_o)De|tS zNGnb_S3n3ZhKTxX+HxeyWcS618ou7W(dL?m09~dkG;->rIiV}!mTAB(b^V#g(89OW z%~(;R#Be-l=x1Noa*LUczIYd36jU^@^W^sv9JcET0Pim>iUC9fK_uG^?{hk&?@-57 zfJs-oAcboU9v@VVK<=nzK{@&wE@Eq?T^cdgj#3Q$)BL24WmXnNSkmHKL+r8fKH}Ts z*}Bk`q2$7Mqc?}#XnSg=03dLzzubEh$aU^=VhYp9Uucq_c<{Kn)^|yzo?Gbul)*L>on^BMg{l zQ#~Vmo)PbsQ|tIZ1tIT`B-4k*%gLX&gZL3AirU362uc^-JdHZBMam5si+9*{8390s zrSb|YAo_ZvZ57@C0!FdjppbW5I>(6~k=2cy*oP&Eq*UW;YL}6n(xYkX?V_of8J$_H z@DsxR06dfVg=Uh@s9WX(A31&#O|+GJ{4Q2c!CZC~GrD&~@;STn`=Fx6_CL(0x`^l3 zky))%PS%u*-|t1Uvr1pxVSeS0%R@$!X0_X_p=xOEmh@@~r^C2jTgoL@KXYqZ7g=<$v59 zRsMj36AZG*zG?b|pv;7s@|Vov>FqdbAE!x};w~?LFK1?*!so{fUtd>J6^tBUqD9F0 zBk7fW(zOgOgDGzskx9GQ4u=S5oB){xj~Zo~eK}i%7Z?Dfs?V?t9x`R-%bmx66#t4n z%bK`8k8>}iYC|Y-W(-M&5aIibUfq~bU z|MVK3Iti?n`^TV0%|Vn)C3$fOel_1s3>~TJh{%+oRrOZxChF%%;y@PwP)z7GFhc0O z4CL^&gx&S!4n-L`4uZY{aE_WRxMCYE_b$7KZU3+Y|ak_2kK-kBsy7qc}#d0O0A3Rq7H5ztCOyB%qjNuIpkm@eT@_d^uKE^SeH+KL;v@!1K3ah`-ufS`SY(R zO(K=tQ`CZj4I7<CR-z@0a33Qxa zi&mLBa&=x=I9gLflRuw|gH$^F#*Pj!?-wG^=0e3)> zUV@0sI8Hz5q5Ej#JTvy-(-dtu2(ORtq6~yU>hv6$;r}H4W7QW8dS{I~X4L#@o7fk; zhFTAZ{+V<`OO>QkI4!zx5!zL2;(ngK>Ly``&=@ZBX z+pMjH=XBBQIF9;=HTyob?GhJe@QsD~Q|!M?dJQRVgnMe(zC~c~y@(dL?l?3zHCshZ zu!ga~a0Q9=YpA53NvC^V`i&>peF&wcAw%>0(PGn@iv3L=yiXr~Os^RGIwvIQLHA|E zkFI=n*q&CXJ|fNC9y*OQ0{PcqF67<&fQdZ%1)|9=)LcWfYW3hrg|0_Og(rYFH2$8T zmcdl}YL{$N2Zh`%^ruav(7LzF=pvJ%y6UqeTzxv{j4^L|T?ysL%6~4Sgg&bTG7nla zi!437>}=O8YaQ=n-hmzyB6|if>bzgpuJw^ws~P=p7pJ-~$ICl>=vhum{WBkEp)6Ih>X-I-5KXNM0P@LOHQGqE-o$u#XKSY_e`H)w z6{dP`in04Rn+@MnUj^dO{N4j(cl~6z&PpbahlxcYvP?_XnnG6`u()Bn+r0^hP={f& zCxh6ygvR9&40z;*n(eLRc*PwOn`mQ5o?}V+qYl3{0oB7_S3S2CnQ`+-Qm#mQcOb zzo@6r7#WVjfw3YY`uf$cB0`sns^x>agYgBiJ|5KJ&$&!|g%bNvXZh_{oam}?As&Ul;wKr4Csc;3W(_{p5E3d!um?H7p^fjUo{zEu^5@ws^kL3d|w zt*;QG5x*)1&^#XvbwwkP++XxKz1&nqt)VB|Pe<*BLf`TIfSF-6s{c3xbkHeQPfo&t zw(R>>XUbYh&c>&TX96ne*OoDCG0CQ6YQ`1s>5Uj~a`|T51)(L0NY&t>NT8)Gp}Qu8 z`o2I&h)7G~%VfA|ullJAY_fHN9MH}Mj*Ax0o1d@5M&HiGyoL>_9c6(I%^3@=_K>Vc-yXScXM=-P z>T@^|HvwwxDZE0tp-~1DgC}>WXGsT^yoB3qD=tj;GB3(INY;-!{dipY)j3=x9<30_ z1>K+hoXwJb25@Xj>C}Cw#bv`?(|#pylR0?2t%?_4;u{8%N%%n=rg?4H8}|j==MaCB zK;?RGJ{jcG<4(Y}&|(qpuk7x5AJRe@&3adZ4<#;U`UHr1^g%G!IF9f6xP8daNhdYg z#TGH44htN*PTWLW&rk_*v8#!`pb78-O}LrqhFb}%YIq2AkD=IqYLeC2?xL8#P`m8U z$N??$qZ3qRr+)LKmj<1y?9aZ2)rV*riT7Rzus!0Se>wZ&-Jk&?8Llr=!GU6Y7rI+W z<^Ax#&idVrdJlSv)pP3~J_x~t?8g`|Uk|UB-~O}1{QK1wDjW(FU=H7m2z0YAFeP(7 zUwA0Bz~iRhM$ASb+$lNCxqh^M@Ml*HLZLuxo~+k1Afz;LOKuS}Q6#}IHJyvZkw9!ysJWGL z&OqL|bltFbKFQj5kKnkV-aPf*8dTD+tj914T#HdUr-9ti&Lko^X=%rY1N^>}2 zO9u_i4I$Jw`x(=B58J|NO+*=nnI%%{vbpESM!b?4?dCX3&aU4=k}zkonFueps8}6h z^@G%GmxPg^s6;1JEksf82(0vF6XQ1Pcc~W{?Ih!-ie872CJu#>B3*?<*q;Aa)Oo}< zQU(y=Feeo8SgEvZ^M)dYw#e*p41xDYkAnTu-L2RhmYgMT zE-*=0%}Wc`)`;$&Z-O{n8Mh4tS7|)4O)&IN{&qYXd1BG8Rc5SIbx}-c_Q^7mv~AQM5rc zd2#23J#2-wr6NNBUU5!kBj90-Er1(A?i&;1vzBwqx74v_*`QIq?H{#dv0%ByB`exM zJJ}2|MO-F?pwfSCVf+&wbZfAOBaU=wDN%fv5w|iim%P(qoF)1^YvpNgacwF&ytHpPD|7rw+&4 zuh>n#6q!zId|G6$&Ll2m@DBAymTixN;E}?nn~eI?$z)U4*10L&~XOpbc=;9qd z_sdZn9)#?nwi`45k~%vrlQfuMJBvl+@ni}3)#p8F`pivYl5=o*obYsvw!v@ekhK!j zN&ehMVQTydA7bCBnKHwt(jG8_WZ|iM$%xbPGA;l}#=bYX+rhx3cf8qpQ}a#Z%}f6; zysz@Vad1>1tuaf+K-%7u*9h7}A))S>FWCb(KKIHW7ihG}f{v4MSanDvoXbGB)c^Bp zYRkz5rFA18}_vM@gq+xKhwA0~wvs28mg< zNu$xU&Z-GUK`b^0aF>ZUGry?*P_Ao*#ps~Y6Ri7f*3G)N!?jF$Ru&T)tiO2O82)~L zobpG?-evp7sL1g>Kbh#kSrSA(hXlhGyrJUbJ!qnSZf6A^nn?pAFs0AkGigLuV*T^H zJbN`6J0iMxH}DsISX2Q(qEZ#WaOS5d*-6!S^5TsrouE}w;$}_`lkHF$wV6yuh$O|V zI(Y6M+Q$}xt$i{j{84t1>TE%V&#@Ietj}C~L_%+=-+h(%@6SMyg=A1+w^{$>$x+d_ z=(84#DQ|UA9t%3s^;f!+_3v}t7Fxuk`(_axv+ya!lWHw6_m*c~;OkK~sx+x0MnQ-9 zxtfx8dpHbw^%l&2e7l0#uZQtHXVoj3oS|7)eU?2;+FK6--CL5zGdiXeJLtXN#iMNp z5KE*}ITAafDU}8HK_Fo-w1@u9&QUFOKwXPe>E#biLavQus)1e}pLiPDwi+$($6JyD zMJ<1_u4ep!-nZDgRT$`vVk7f#++&omCzz~i$5esa(K@~r4AE35_9`TqJl=^a)?8%b zAowxQxopVX_iO}xD^`ai&&qNL^_qD^`&+tbZ0_1yGG3|_FLReR|AE-ng1xp*b5@g3@XDd^{cWdWmW1 z5uaZe@a57Cwwx1{Nx#c?UxO7zzl?Mp%Qq)hJcJJOtHTUA2=o}v2Goix51AcUi@y%c zt4}2r5bNIVrlzXcBC&*8jAN&4dQ!-rjOLWThl`Jm*NsU~xZ0fjm8rXkR`x0ZVi9dU z-Jg-!`^jqM;U|6Bm^Y<15uSo_wi%J8J?X?c$U)HQY^sOc^(dYG=pp|`Ze^Vf;1O9? zUC+m1Ze$_r4bD{lZm6iA6OdsmO#VRFi3#W2G{emDkrJ=!4a=*LrFV}O=z$MPHV+`0 zGS_yhZa&35RKXlzpy-rpAZZP=?K&+ki&dyBIk9io{L3XCaQEmbn#|q7V&S~sE=aCu zhb#%B^VswIKO6ghc>Bdd#rSwtmrLsLYjMT24-!=s*q`y4oTOxpR2mvpndmg{V1FCo zgz>(5N3o%G8aAj?%HqKuYkpwBVWy6kLMNM*e;CAKQrVKcD=$L1OT18vY21&#oezQa{2sJImM~M5*YSWl7 zYn24t@tS)QFw|5V{qSQe6MQKzhv|o|3Gor-Hz^QNsm};}@U!0?J_+Ogkw#;ufyc{7 zz3*W6ZSTp32Zc3{Fhmq$n4m%yULfjNu)dQ5{>r)ElD2-i9M!kOA)^ZJqHOSOYyZzL zTJFBAahoS0JWsF-x{gNi^bTu!R1SJC(McX#)a}F-n`o(R}sWw0wdkwe%ZNN z@*a*Qno52s3=_<#EtVzdq_qsMOFsr;@vlxw|LM$pN7Rp6nfW>ehh0a@c*D{KFXUhz zVMg3$-3ZXv_(~bHGXaRGd`(NNxdyTIVwmZNS1VUv{NOi=r2XVk7DkgX4zb4ZAfjdx z=Qf&o^U|ZrH?L%W9PS_%U%*YRm>r2BD^t8rezADV{qCmSG)rjwhwN%TR+G;TU3#p_ zw{k(9f9Cz{;8aQjDQ>2}(!6g#e_tKOlQZ-ucT~t#Iswtot90z|57Y`B+{*8(ba?0xNav7mLa+AGnH)g&FF}r03N|*DOwfT~ZPhS- zU$d)(`d!z<*W6r6tj4S?5=Fx1t)~466CTcNrG|u?Mf!RSYWx^dNq9HUCL#`Sh?pHE zBx|bX%nmx9#O+nEdIf>cm{brkeRr=QCXS}CWJ+l5G0-v7;i3-LSi-{t0JPhq2y32! zNhUz)dPdb5pO0&0&tyniK*ma%e;`{&8wv|G!j$cbtIg7=ojTXwW#Ja`uG}>43MbvV z@R=uD*!t&e8tH)nwolcytoGi}Pu6UAhB+ZW8!! z^*;0D3K!8=aAG^uIMi0Wg(2lP8o#ud2<=Gycw3S0epx(oUGZ`Fm;E9u-k~?(6QQCP z^|JVK=fQe;S~LuIDjw^Tdm?J^yYx%f&(^u3^Vj0iFhuveGRoGmAAVUi`vL%(Rc&~R+M_q-G;0$+3(k?b?Pis=O)8w-2M22 z$B$Ok2sm01iE3y?sh_v!IV3IL^DwAuU5>=Iw${GkOEnV}yU_}j>x(<*_;E(&LS|p} zwZRV!+NdbU74Gg$%>dzyK!mvod7d{D0rKntG4mp~B^3lz)Yq?s4`r4UxWL9z%g%bs z*425;z9=KMi-XsI+XKWetTzi5sv6x*pbPTy2j5YLWDFDUVGIwM&h9 zPp4wt8^Eo`hG%;@IDpN|*oc9qD0Z4*9SvPmrQ`bBikcW9wL(cU>k8;A`8QOo2KQ!X zMkto4VaFH2ee@$7#&@u`bqmS@C$1w0Q?_F%x}4%iBl3+AO97LZ2))~iCTd1C_mNcIOeQL>2xu;x^uuxY zR{FyFy|&I*kr(TGlou+>@4i0*C4Fx~fL!lw$vMsxH6Pk+eNsO1l z8tcpOcix_og3)JR48<$e7C(jxv3XO1o|==6u<&%8LdmbX2Wyoi>n2{|}kp BWlR77 literal 0 HcmV?d00001 diff --git a/packages/kauri-bitcore-lib/test/data/blk86756-testnet.js b/packages/kauri-bitcore-lib/test/data/blk86756-testnet.js new file mode 100644 index 0000000..51ed9cd --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/blk86756-testnet.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = { + version: 2, + time: 1371410638, + bits: 473956288, + nonce: 3594009557, + prevblockidhex: '4baaa9507c3b27908397ea7bc177a998e9f4fe38b9d5130be7b5353c00000000', + merkleroothex: '97fc4c97868288e984ff9f246f2c38510f5c37a3d5b41aae7004b01e2dd5e658', + blockheaderhex: '020000004baaa9507c3b27908397ea7bc177a998e9f4fe38b9d5130be7b5353c0000000097fc4c97868288e984ff9f246f2c38510f5c37a3d5b41aae7004b01e2dd5e658ce10be51c0ff3f1cd53b38d6', + blockhex: '020000004baaa9507c3b27908397ea7bc177a998e9f4fe38b9d5130be7b5353c0000000097fc4c97868288e984ff9f246f2c38510f5c37a3d5b41aae7004b01e2dd5e658ce10be51c0ff3f1cd53b38d61601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0b03e45201062f503253482fffffffff034034152a010000001976a914ee9a7590f91e04832054f0645bbf243c9fac8e2288ac0000000000000000434104ffd03de44a6e11b9917f3a29f9443283d9871c9d743ef30d5eddcd37094b64d1b3d8090496b53256786bf5c82932ec23c3b74d9f05a6f95a8b5529352656664bac0000000000000000252458e99e66e2b90bd8b2a0e2bfcce91e1f09ee7621d95e9a728ca2372d45df3ded00000000000000000100000001d6e149959b6248eee5a17c23a518e5e5e399e98f7d42a2833810f3baf1525acf000000006b4830450221009273f5d777408439a40c33ee96630a877d4f29af3f60f5c230e5254ee6f08f4302207975a64f43dc632f34479aa403b9956c484ad0c90a3c50d2e1b5037e1abb586f012103449772f2c60c2f4e1f1f74cb6c521a48f12d51ea681b64c8fc074fd8108123f6ffffffff02cb6a8233000000001976a9140487c481a671649e1db182ede98d093a335d671388ac25a21d9d000000001976a914590ea00fa3a18281d3020e7ba0c3a1d6aea663c088ac0000000001000000022a24c5dfbdb9dc5e1eb5d38dc9e8c5f8643aee53fcb0d2e44a04924b55c65c6b000000006a47304402207aa649b3ba03eeac6c6fb88e74800ca418297f62da75c58284a0c5f6cdfa96b70220324eb99fecdb0eb8bd4eec05bec0f440f4c2132c1afbaa7aaf10f31d17d8ef020121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3cffffffff1186e9edc6526a3ab463d1f0123ae38e5593364d2f80de9d8031a48274b718ab000000006c49304602210084cd799ec732e95a08c9e1ef98e99e43767b6bc4eb6af6cf65ecdf2be6bc96ab022100da1d1c450d675d383b92095c2b9949d693b82b54ac81ba219fad98f8500589ad012102b567c3f3442f71b6762404be7cc06ffd3b170d4cb98b90dab169187a07eb6786ffffffff0260dc2c00000000001976a91468340b9145127d2529dd7ebc3a4567d5579997ac88acd0ed2d00000000001976a9143770e8980281b63351861a17881cecbfaaa5c74b88ac0000000001000000020f5000a056f91d03c489d7d1558f09c7bc330af3ca8e43706d5cb08fd6c60aad010000006a47304402201068b39118afc383bb1b7de9aa8fe02cddbd8be5d29cab99d5fff23a0cef5667022020d6cfb4712fc61c13c7ca26e32028cce3d68afea7957ab4bfc5ee03bf9615d4012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff08d4577f5634796567fb0cd50abd1886df3555f71847a1977ba5bc75195405a7010000006a47304402206728ade49cb5ec883e07d8acc6450e17b0e27b7f64c81143b4632eaded365e2e02202be3b4b723200de8c070b914d0050ead71d1418196a037f55f1a6dff4e45aee30121039e65fd2479d4edb0f3db6eecacdadcdc5ddd6d8ef518cf861466dfe1c21cc891ffffffff02d0b13700000000001976a9149a704e2c99955f50694de60f93cdd449473678aa88acc0c62d00000000001976a914dac91bdfe809346e9df5e753adaaef9336344bfc88ac000000000100000002fc85133b1e259f6deec25953bccfa75df61fd23a471553c80c043c2ea716a675000000006a47304402203da7beabc48687b746a7149679bd8982032816771b5634d1d651af59ce9fa86d0220198ea81d1a547e3493988dd94ffefff3b8fe030340886aa4ffc1b205532f0f9d012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff04297137bc2c9f486713e4e4fab43134da153e0f8ee8e852554090d02f2605a5000000006a47304402206b729bfd4c132b673c9f1a66c645ed374338963f1e6a3b56229f72b4358f8077022023bea16c89d267313da6df152a976b36a36e1bbea738d698f0ce72ef315962df012103ba341f7dd2401a2cd51682d418fd8a12b4d0b09acb8971f0671c2211366a8531ffffffff0220753800000000001976a9144769612ee7c6e977df40a8cdfd837c85cc7a48f788acc0c62d00000000001976a914dac91bdfe809346e9df5e753adaaef9336344bfc88ac0000000001000000021cb5734a303cefa1ace87b8cc386a573f1eed8370e14c0a830fd04249b7756a6000000006a473044022059bbf19179b81fad8a15ba3dff94271d55d443da636dbaeba6ea0bb5901b8779022045417e208f41f8b37473caaf367a61ed21b31f1205605020de241e89b7ec0ca60121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3cffffffffbabb329d773e9101e127f7c1e95533fb384c79260789dc06fdf73296c9ef352d000000006b4830450220012c555e725f4eb0d767efdc07aec149c63522b06253e9d1ce6245b90c71951e022100edcce82ddd7e52a3b85bf9a4acc73a3b6df5c9b40fda36e8de09890860599ddf012102b567c3f3442f71b6762404be7cc06ffd3b170d4cb98b90dab169187a07eb6786ffffffff0210fb3000000000001976a9143770e8980281b63351861a17881cecbfaaa5c74b88ac20cf2900000000001976a914e1144ff8ca0ac143b83ada244040bfe9c8d1d63888ac0000000001000000029a494e6072106a040e279b4566f25fc35441a84f6228812142eb5515688832f5000000006b483045022100b35809ba9abcea1ec143c7cd0a27845b3f5139a6bb52757c9e24d86319f8d16c022079f8381c5287af7e6488d6a589e73caf23c487bf355ac22b7c01cf58830110bf0121023d1c9bcd771cc12b60cce62e9b8196788dd365089b70d898d60917a174e16f6affffffffec7d5d39d4db41d7d9ba0653b6c9758f20cf89a4c2e60bb27645a966889fdfd6000000006a473044022008848d34f2ca77f8bf79eb83b89ee8a24292d0c3936350a37f1522664e2e216002204ad05817044e18d0c26e89139b9fb98a21ceda2249a7cfa58f3ec420af9477c7012103af07092ed729d97d5e2ae9f8a295f1b2da268e7414ce3df9b374051d7647092bffffffff0220753800000000001976a914b1b9b659297859bd310ba8ba6f95573c635b191a88acc0c62d00000000001976a914636c549bf6035b27cf3823f5482911ebb2bce5d088ac0000000001000000028c88435add45be7b1521756b8ee3bfc51558040c3922e11facff1d6cdc7fc841000000006a47304402201bf92a99fd85e09de43b9039801f387ad6ea996d71c02185019a18cd2691d68502204500ea82873501c25c5b1476f9cd75d70b2a34a4162470e3390f89ff6a5830110121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3cffffffffbb1d138f7c9e8df06a87cd068fc303cb960c7b5670515a7759653fd3b71c6e7e000000006b4830450220277eb0e03b897cd20ac3bfa15af82ae2c1e75472ffce0482ce1594cd4536e83802210088164c46f3fc82ed3530b7552a1da6ecd2f690647485bb0fe1a706ae0f09d5b6012102718b695944b9e6f12db75e7dc7b77f023c8b9706405b62dac6e6c94dc1c7214effffffff0230c11d00000000001976a914e22f515855329b13602778a1d681295e485390b888acd0ed2d00000000001976a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac000000000100000002948a4df70264c816b3c65bb1315bc20df2ee12baaba580818ed232a59dbe3282000000006b483045022100e96feaa777c517aa67498d51c52b7c177c18f7eb96c7ec109bcf4b7d1993245e02203d4f6dc06f4ac4ff947d81a45c9e53b12ee89e4223aa670eee2ca435157f6054012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807ffffffff8dddf5d111131865b48f2b141f635ac6c41f14adc748ea0cd6087fd69b60d573000000006b4830450220588e7eb9477043dc7b7d9f554b5db44823d9b7108a73d224af8cb24b190ebc94022100deb2fd7cfbff5f7679a38a16c18075dc9eb705850054415eba27a0f769f94e8d012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807ffffffff0220cf2900000000001976a9147ff6d70c9f71e29f3b3b77e1acb0bae8d1af12d288ac10fb3000000000001976a9141c5b740011cff8324ed10c3e8f63f6261f36613a88ac0000000001000000027624f057be29a1d4d39112006d1a1acaca84b78f5e2323c3ae587365f91b6014000000006a47304402201bfc0a95285de492ca53fd2ab89b58cdb1d9d817d7c4ade64e31bb63ccf73b7802206d4f72973c9aa804d9a5c9b749a49aec579ab7875d30c1e0b9ab8d3d7b8041ad012102926efc059307ca51862547d58b7a0c1749f0e27df6fbea550bbb291ef0a00bcbffffffffed83ae0fa16dd5602ca174f1c845be1f1c370ce483925dda6e524e6f82b93bd8000000006c4930460221008de29b6fafdadc7a1430ff453c9cb4ea96f9186c1c43b9d1f243876c4d187c5a022100f03f8a8a43c39a619c03db80bedaf9111ee817a574edf912795b3bef85024d46012102891fda8944ae461484abdc5898a94d666d8e54ed47f534218601c9a39e1058b8ffffffff02c0c62d00000000001976a914fc9c507e2cf3563c63bf9ec7b38773c2a1e1c47288acd0933c00000000001976a914736d9e4703437b3f245cda14ab4ed2d52b0a622d88ac000000000100000002a34b87af6103eac5adaba08069aca7f19c6091f6b1f4b8ca788e54970cab2039010000006b483045022049ce62033552a024ce0badb3d3c9db84af929c373b816dade2611563871e48840221009f80e97265ce861637468c98237a06df9c7482cc7c1739e1c36a8e85537c7f160121032e68cde689f248f9dcce3f1b3b607400fd1275aa3d3a821ff81dd95a3645e20fffffffffa973c9f57b44c4f70b181311ba1ab60c3f3c20663a3127d3c418b9bb3b175ef4000000006b48304502204d5decc921dff956fbcfa1a574e43e0d17b9a49ee07f294b74f854f0dd7e0160022100d49781e18670f3372961dd5799d162071e13832fa9f15197c90d7b8ab8168e8d012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807ffffffff0260dc2c00000000001976a914cc0d9d6d476efe8205891836f40e00caf2fde49288acd0ed2d00000000001976a9143770e8980281b63351861a17881cecbfaaa5c74b88ac0000000001000000026904c207207b72a9671e78f8e1284ae13b7b60c51b352142c849d338e8f3e8f1010000006a4730440220740a2107c2d9be5f621822667b9cc34566511c0e6767de900f3b46fa0852d62302207cf2fcf969e48fce7ad43880bd3a7ee5658a421a3fb718e3fd824e22e4bac6ee012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807ffffffffa3693948981b6fab5aeb9df82b1fc8e3fdbfeff8d934ce0617f4a9be699e06e7010000006c493046022100942e3ffd4522789f747b0c0d18a7228ba9f343294a34ffb0a53801b0d1626963022100eacf2ea0eef2c58e2666442bd331489dbda43adfd6d4809c2e71de38aff7fd92012103de66ea9a044ee251ba8a6dfe1d68ee1c2e17acaf5d8b568a515ff37752b6ea0effffffff0260dc2c00000000001976a914ac64ed9c139e44fd8d1d9ad28d1d08fc8a8f70f888acd0ed2d00000000001976a9143770e8980281b63351861a17881cecbfaaa5c74b88ac0000000001000000023b45e99dd007030fd8511434235b70a7d29041eb1e72d3cb2dda7d1e769ec13c000000006b48304502201c10c88a04850d9101b6cbcb51c28d9ca34f693fd918ba3c26775c5993cbdfc1022100e5d7708777b9592d709863859ce0f4d590f56acf5bb3655e119cac10d597c463012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff87cc87cf0be7989073235f455fe6524324bfe8cba5f4ee3c2a59c46fec3bf14a010000006b48304502205cd5ea454979d705d4573d7b6f6a1bae22e5f146e0ccd14079a959a429bf69fc022100d88f05762b394621ec967546151b682f8103bed05b6d99b80adfadd626a721c5012103803aa78d28c40170231e0520fc38daa405140ed6e177c0747ce9d8d7dd6cdee4ffffffff0210dd3500000000001976a914bc1e95774ee2e36d2687714da14551132f0588b088acc0c62d00000000001976a914859819cb59368e07d4c95b5221fa4c466d66694988ac0000000001000000027848ce7fbc4f3b3e56a778607e046aa2b2cf891cdba8b61186095d4931b44c72000000006b483045022100850533f400465b01658b7dfcb05b3bae38a89344065f8321f69f7b1b2036446f0220663a629b5f2b1cf8748558ae71c8b49cda87e43347d4cbf4c84e3a79bc904a49012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff0e33c08e14303d5660127f5d3792ca11c18321a276e71f53415af75a2319ee92010000006b483045022020d4bbbc5c300aadbc52110f7aa971d77bcf567c91d288ed6af0a98fc8f75e74022100ea84ee6d3fbeb672e92ea993d27202fc9ecd33ba7494d8b064518649fc2c17dc0121036a91343ca1c973401accb1fb902336d2a7a1b4f670ff82d9acc5c380d6a627f0ffffffff02a03c3700000000001976a9144cc35fc2651b5b3e4f22dfa9b6ebef0ca1797fb088acc0c62d00000000001976a91449452bed77744157799ba71fdb43efbd66968ad188ac0000000001000000022a6cc52c8804088ddbc164cfa01e4d9ee7e839c7a8f5d2f1b59b70a50d253f24000000006b483045022100bd72079af0ba0965d01dc6de2502ceebe38fa94fcf9850140e7ce1e5ef29d3cc02207da0e0b881594a9bc8750143dfa41ce8255e14f24784a551d3d1c4a2acecc0a2012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff36262f4b7717eca333432cd9af776bb5ef4b29a2ea1b1cf877b49642db945c62010000006b483045022100f074c81f476f50dad72d3d07cef668532bb2b0cc772b49abf67cafd476e4e41302201e36efd9eec72b2f5ff4eac4ffbbe0598c6185b63c6ba8e03737b708e73149940121022d7e055cd28a8b7ca2613687e9b5cd4ff4a959c54d74f49c12345d1d8f78b374ffffffff02c0c62d00000000001976a914fc9c507e2cf3563c63bf9ec7b38773c2a1e1c47288ac70383900000000001976a9145ab29618ded8892f8189ca3ce81bef83d3ddda1688ac000000000100000002d724e595476277be4337bb8f39ca700b4f9df1bfb84089c4afd338e1079e9add010000006b483045022100f775b297513593c1c6e461902ab6405c4c38ce3b37d9292fe074153b8c466c29022010ded748e9e7fb1fbb263b8f466e6a1352e05ddb8842a17f712478e3d9c177040121023d1c9bcd771cc12b60cce62e9b8196788dd365089b70d898d60917a174e16f6affffffffff40fb739e2271f4aaa851dd46fcd1895ddd7a98850ef191ba3b50325c29a4ed010000006b4830450220686b1c5ecd7ea0e9078784f5ea0100035a962809fd1d0cf7a131604ecfb26f02022100ddf7b8874a375edfa4d0d7b93cfd214d0327e550add318f1a8a379cceae8dac601210363c3fa31a5453a29f6cde46c9d77698fd8276cf9f511dd6e5d079a231fea568effffffff02a01e3c00000000001976a914b0c1cda106bb5085bd9c0c9982773c7bd066fabc88acc0c62d00000000001976a914859819cb59368e07d4c95b5221fa4c466d66694988ac000000000100000002a9b95beed9491639bc0d1bb833005cf45429ef9a50505f9b91f3c7588feb87ef010000006c493046022100854bc0ee8b24e2b625798148fc505cb37464f72688456dc54b0c25c4dd564091022100c2863ab346c23157baaeb45e6d102e7354cc895ee0dd7b6ecdc77ab34bdd4d0f0121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3cffffffff8eaaf0d722fe9deffbc6e9d543f406844c93d1dd1c073d739863c314d2adf4ef000000006a47304402203f28684b208f0f4bf87ca22544e59585a7807fcd5a2ec78fc93ce915e282335502201ab05402d3a2b2914dd955971fade92dc874e6441bc2383766ec8b4c56dca27501210251a3bd043afe5cf46a40c4ce4caf3e917190583588634711507d6ef77acc438bffffffff02d0ed2d00000000001976a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac90ab1e00000000001976a914b27f37b7cee282e7890f4f6df9b49574f35e855288ac000000000100000002fadecb6a5b1bd5f0688fc7dd049dadd956c30006e4dc57155f22c054c1550791000000006b48304502201dcb7d73d180cda9ddb192e50fcf5f0efaa5e680931f2bc25e58dd368d4b815f0221008149257f9394b01188aa84f92aec7374339076b408360767236a3af18718cddc0121032e68cde689f248f9dcce3f1b3b607400fd1275aa3d3a821ff81dd95a3645e20fffffffff569ed0585b1d5261fe5a1839e99c23d0cd3b82972526c5bb5b812ceb493facc3010000006b48304502205665ae2983ad6ec44220810a6f4c28d77dd518cc891eb9ed67503a756e97c477022100ab456b8a9c1f977623956943d8f1892c3bf84d8adefaa405606d3473f37fb8b4012102bbdf0772bbacab8eaba47d783d30fa401b08a0ecc4bccd49357171ac38791c0effffffff02d0ed2d00000000001976a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac504b1400000000001976a914a6a0900e3c77496dc68be8ee130a21b446b8266588ac0000000001000000023d9d0df887b3621c3c884515d1a4c0a22e2bc4aa02300493cb568189847265db010000006b483045022100af41bf6edc04de96ad8b0d0e0794a7055c9677f2616fcfc1b053f87ad5c60c0f02201ef5279534263776cca80957368791a362354d7a40f3f175874b909de2d7f9a10121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3cffffffff70f6c965fcbae21ee712571b683b33e3b4d0e9c5d1fd685046db7176e3bf432e000000006b483045022033da8150f9870e045581f5894366f57345946174b43b7f8c0f9b24f7afad395c022100e3db87d42b1050ea8f2e964a13eeae86cc57e771c4dfa29f7f055c74a39be3b801210221f705f7d58ceea66122bcdc7220db0583d8ce1d7d948ed86007905268f55162ffffffff02d0ed2d00000000001976a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac50802000000000001976a91447830d334d04acd62668904b6fab06a90742e75088ac0000000001000000022e48318fb557623da627d1c3f81ab34b99a87ce701440dfb907ad6a8691b51f2000000006c493046022100d2733fcc63dd86bc4653d268f16e467e87a7be9e1d3f45cbeccb2423b7eb1c6c022100e3963622c12dab3e9c0c76a8ef13151114cb0f17abe6c29cca2fcbac264dfc980121020ce8a0852e31812de6b8f2b2604d948cb06f8f7f404e70a19067cca01b5d0988ffffffff675f09c92aa029f3283ee9a6b8bd6f022a1ea3bdccb1d33a09416ee9389e3ecb000000006b48304502202beb8d4ff142762f12f867a1686c2a523c55ff336b8ae3992ae1292019afeaf1022100a2e7edb9ffb29628540fd02b21c84abf1cc48d70c9f6adb39550b8aff572c65a012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff02d0933c00000000001976a914449c3ac7336a78f0c6401f51710949005d2c7ffa88acc0c62d00000000001976a914636c549bf6035b27cf3823f5482911ebb2bce5d088ac00000000010000000233232e2ce65e394a2c7e46519fae48b9b711b5152f764a4d6454bfc0552f275a000000006c493046022100928f760eaabaed51bfc4db0188c84a6a19ef34a88786f2a25d8050c8356d858d022100c1a35c67f2c21b4837eaf73e195c74eb213bdaa4650fe77da072db9f84b90d0c0121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3cfffffffff7fc20459ede0aeba4e9224ac667212ff815c651ca4feaaf40880b9f9d82413a010000006c493046022100c098dd6d9b20ed80de2d86d2c1bc9328b1c42f04b03c3767aec9d846d4538c9d0221009e32178215a499f22d8d3afe9f257159143c3d24f07371e0ef2de97d216e3b42012102078d4050a314870bd68960765015e5f884e35c60b44e23e0f2d264b73aaca477ffffffff0210fb3000000000001976a9141c5b740011cff8324ed10c3e8f63f6261f36613a88ac20cf2900000000001976a9147bdb65a92af2520836f77e5ebccc697d814149ce88ac000000000100000002dae9bc0142c15e33fe26a494d1233e80adf68b50a131f467eb13450caa56e43d000000006c493046022100ecf03f0bafb0cf6e08ac80336565bf79b6bac800f546e9f953fb14df7bf239ac022100982e27f2f0b3f8569cef126c0c54a88b002f00d570106c74f5c4b314c9609442012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662ffffffff6904c207207b72a9671e78f8e1284ae13b7b60c51b352142c849d338e8f3e8f1000000006c493046022100febc4cdfbd5073ee756c9763b0e18009893b422e13c25e8f74ca97b84c0cf73f022100a85a6c10debf45e8ad00db28fce5fcb68404e9ac4b844f0ae1d59c0ef210d714012103dc9adee9c23ca7a091b4eafc4dfef2ed07adf903dae568f345095321aa9c57e2ffffffff02a03c3700000000001976a91467a341d7fe4de6a810c182ed27a09554e0b4405d88acc0c62d00000000001976a914f7f1f64a590896dccfb869ced060f058007f388b88ac00000000' +}; diff --git a/packages/kauri-bitcore-lib/test/data/blk86756-testnet.json b/packages/kauri-bitcore-lib/test/data/blk86756-testnet.json new file mode 100644 index 0000000..577e32c --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/blk86756-testnet.json @@ -0,0 +1,684 @@ +{ + "header":{ + "hash":"000000000b99b16390660d79fcc138d2ad0c89a0d044c4201a02bdf1f61ffa11", + "version":2, + "prevHash":"000000003c35b5e70b13d5b938fef4e998a977c17bea978390273b7c50a9aa4b", + "merkleRoot":"58e6d52d1eb00470ae1ab4d5a3375c0f51382c6f249fff84e9888286974cfc97", + "time":1371410638, + "bits":473956288, + "nonce":3594009557 + }, + "transactions":[ + { + "hash":"a6f7b4284fb753eab9b554283c4fe1f1d7e143e6cf3b975d0376d7c08ba4cdf5", + "version":1, + "inputs":[ + { + "prevTxId":"0000000000000000000000000000000000000000000000000000000000000000", + "outputIndex":4294967295, + "sequenceNumber":4294967295, + "script":"03e45201062f503253482f" + } + ], + "outputs":[ + { + "satoshis":5001000000, + "script":"76a914ee9a7590f91e04832054f0645bbf243c9fac8e2288ac" + }, + { + "satoshis":0, + "script":"4104ffd03de44a6e11b9917f3a29f9443283d9871c9d743ef30d5eddcd37094b64d1b3d8090496b53256786bf5c82932ec23c3b74d9f05a6f95a8b5529352656664bac" + }, + { + "satoshis":0, + "script":"2458e99e66e2b90bd8b2a0e2bfcce91e1f09ee7621d95e9a728ca2372d45df3ded00000000" + } + ], + "nLockTime":0 + }, + { + "hash":"60c2679c0e791b19638c975528bf5bd55d81e192003c7d1f3fda53fe534b0a7f", + "version":1, + "inputs":[ + { + "prevTxId":"cf5a52f1baf3103883a2427d8fe999e3e5e518a5237ca1e5ee48629b9549e1d6", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"4830450221009273f5d777408439a40c33ee96630a877d4f29af3f60f5c230e5254ee6f08f4302207975a64f43dc632f34479aa403b9956c484ad0c90a3c50d2e1b5037e1abb586f012103449772f2c60c2f4e1f1f74cb6c521a48f12d51ea681b64c8fc074fd8108123f6", + "scriptString":"72 0x30450221009273f5d777408439a40c33ee96630a877d4f29af3f60f5c230e5254ee6f08f4302207975a64f43dc632f34479aa403b9956c484ad0c90a3c50d2e1b5037e1abb586f01 33 0x03449772f2c60c2f4e1f1f74cb6c521a48f12d51ea681b64c8fc074fd8108123f6" + } + ], + "outputs":[ + { + "satoshis":864185035, + "script":"76a9140487c481a671649e1db182ede98d093a335d671388ac" + }, + { + "satoshis":2635964965, + "script":"76a914590ea00fa3a18281d3020e7ba0c3a1d6aea663c088ac" + } + ], + "nLockTime":0 + }, + { + "hash":"d35ce8868da34cdd63dad93b698867cee01e1e5c762a48059528b15eceba9278", + "version":1, + "inputs":[ + { + "prevTxId":"6b5cc6554b92044ae4d2b0fc53ee3a64f8c5e8c98dd3b51e5edcb9bddfc5242a", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"47304402207aa649b3ba03eeac6c6fb88e74800ca418297f62da75c58284a0c5f6cdfa96b70220324eb99fecdb0eb8bd4eec05bec0f440f4c2132c1afbaa7aaf10f31d17d8ef020121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c", + "scriptString":"71 0x304402207aa649b3ba03eeac6c6fb88e74800ca418297f62da75c58284a0c5f6cdfa96b70220324eb99fecdb0eb8bd4eec05bec0f440f4c2132c1afbaa7aaf10f31d17d8ef0201 33 0x022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c" + }, + { + "prevTxId":"ab18b77482a431809dde802f4d3693558ee33a12f0d163b43a6a52c6ede98611", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"49304602210084cd799ec732e95a08c9e1ef98e99e43767b6bc4eb6af6cf65ecdf2be6bc96ab022100da1d1c450d675d383b92095c2b9949d693b82b54ac81ba219fad98f8500589ad012102b567c3f3442f71b6762404be7cc06ffd3b170d4cb98b90dab169187a07eb6786", + "scriptString":"73 0x304602210084cd799ec732e95a08c9e1ef98e99e43767b6bc4eb6af6cf65ecdf2be6bc96ab022100da1d1c450d675d383b92095c2b9949d693b82b54ac81ba219fad98f8500589ad01 33 0x02b567c3f3442f71b6762404be7cc06ffd3b170d4cb98b90dab169187a07eb6786" + } + ], + "outputs":[ + { + "satoshis":2940000, + "script":"76a91468340b9145127d2529dd7ebc3a4567d5579997ac88ac" + }, + { + "satoshis":3010000, + "script":"76a9143770e8980281b63351861a17881cecbfaaa5c74b88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"7801b9230e03ce29fcfcaf9648939ba522b5d0e303b7683c9babd658ae857903", + "version":1, + "inputs":[ + { + "prevTxId":"ad0ac6d68fb05c6d70438ecaf30a33bcc7098f55d1d789c4031df956a000500f", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"47304402201068b39118afc383bb1b7de9aa8fe02cddbd8be5d29cab99d5fff23a0cef5667022020d6cfb4712fc61c13c7ca26e32028cce3d68afea7957ab4bfc5ee03bf9615d4012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"71 0x304402201068b39118afc383bb1b7de9aa8fe02cddbd8be5d29cab99d5fff23a0cef5667022020d6cfb4712fc61c13c7ca26e32028cce3d68afea7957ab4bfc5ee03bf9615d401 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + }, + { + "prevTxId":"a705541975bca57b97a14718f75535df8618bd0ad50cfb67657934567f57d408", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"47304402206728ade49cb5ec883e07d8acc6450e17b0e27b7f64c81143b4632eaded365e2e02202be3b4b723200de8c070b914d0050ead71d1418196a037f55f1a6dff4e45aee30121039e65fd2479d4edb0f3db6eecacdadcdc5ddd6d8ef518cf861466dfe1c21cc891", + "scriptString":"71 0x304402206728ade49cb5ec883e07d8acc6450e17b0e27b7f64c81143b4632eaded365e2e02202be3b4b723200de8c070b914d0050ead71d1418196a037f55f1a6dff4e45aee301 33 0x039e65fd2479d4edb0f3db6eecacdadcdc5ddd6d8ef518cf861466dfe1c21cc891" + } + ], + "outputs":[ + { + "satoshis":3650000, + "script":"76a9149a704e2c99955f50694de60f93cdd449473678aa88ac" + }, + { + "satoshis":3000000, + "script":"76a914dac91bdfe809346e9df5e753adaaef9336344bfc88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"1367dbd80e679ccc7008ad5803d60fc60baa126a2490697197224dea823cc407", + "version":1, + "inputs":[ + { + "prevTxId":"75a616a72e3c040cc85315473ad21ff65da7cfbc5359c2ee6d9f251e3b1385fc", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"47304402203da7beabc48687b746a7149679bd8982032816771b5634d1d651af59ce9fa86d0220198ea81d1a547e3493988dd94ffefff3b8fe030340886aa4ffc1b205532f0f9d012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"71 0x304402203da7beabc48687b746a7149679bd8982032816771b5634d1d651af59ce9fa86d0220198ea81d1a547e3493988dd94ffefff3b8fe030340886aa4ffc1b205532f0f9d01 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + }, + { + "prevTxId":"a505262fd090405552e8e88e0f3e15da3431b4fae4e41367489f2cbc37712904", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"47304402206b729bfd4c132b673c9f1a66c645ed374338963f1e6a3b56229f72b4358f8077022023bea16c89d267313da6df152a976b36a36e1bbea738d698f0ce72ef315962df012103ba341f7dd2401a2cd51682d418fd8a12b4d0b09acb8971f0671c2211366a8531", + "scriptString":"71 0x304402206b729bfd4c132b673c9f1a66c645ed374338963f1e6a3b56229f72b4358f8077022023bea16c89d267313da6df152a976b36a36e1bbea738d698f0ce72ef315962df01 33 0x03ba341f7dd2401a2cd51682d418fd8a12b4d0b09acb8971f0671c2211366a8531" + } + ], + "outputs":[ + { + "satoshis":3700000, + "script":"76a9144769612ee7c6e977df40a8cdfd837c85cc7a48f788ac" + }, + { + "satoshis":3000000, + "script":"76a914dac91bdfe809346e9df5e753adaaef9336344bfc88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"dcb4af4edae739299a633aca1f8d482d44e3d7b99bc4bac574cd470bdb6ad64c", + "version":1, + "inputs":[ + { + "prevTxId":"a656779b2404fd30a8c0140e37d8eef173a586c38c7be8aca1ef3c304a73b51c", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"473044022059bbf19179b81fad8a15ba3dff94271d55d443da636dbaeba6ea0bb5901b8779022045417e208f41f8b37473caaf367a61ed21b31f1205605020de241e89b7ec0ca60121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c", + "scriptString":"71 0x3044022059bbf19179b81fad8a15ba3dff94271d55d443da636dbaeba6ea0bb5901b8779022045417e208f41f8b37473caaf367a61ed21b31f1205605020de241e89b7ec0ca601 33 0x022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c" + }, + { + "prevTxId":"2d35efc99632f7fd06dc890726794c38fb3355e9c1f727e101913e779d32bbba", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"4830450220012c555e725f4eb0d767efdc07aec149c63522b06253e9d1ce6245b90c71951e022100edcce82ddd7e52a3b85bf9a4acc73a3b6df5c9b40fda36e8de09890860599ddf012102b567c3f3442f71b6762404be7cc06ffd3b170d4cb98b90dab169187a07eb6786", + "scriptString":"72 0x30450220012c555e725f4eb0d767efdc07aec149c63522b06253e9d1ce6245b90c71951e022100edcce82ddd7e52a3b85bf9a4acc73a3b6df5c9b40fda36e8de09890860599ddf01 33 0x02b567c3f3442f71b6762404be7cc06ffd3b170d4cb98b90dab169187a07eb6786" + } + ], + "outputs":[ + { + "satoshis":3210000, + "script":"76a9143770e8980281b63351861a17881cecbfaaa5c74b88ac" + }, + { + "satoshis":2740000, + "script":"76a914e1144ff8ca0ac143b83ada244040bfe9c8d1d63888ac" + } + ], + "nLockTime":0 + }, + { + "hash":"7a1dc3bb633c50f7f53d3d8b9d10a86da38483616841de7bd51b8cca3b564a1c", + "version":1, + "inputs":[ + { + "prevTxId":"f53288681555eb42218128624fa84154c35ff266459b270e046a1072604e499a", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"483045022100b35809ba9abcea1ec143c7cd0a27845b3f5139a6bb52757c9e24d86319f8d16c022079f8381c5287af7e6488d6a589e73caf23c487bf355ac22b7c01cf58830110bf0121023d1c9bcd771cc12b60cce62e9b8196788dd365089b70d898d60917a174e16f6a", + "scriptString":"72 0x3045022100b35809ba9abcea1ec143c7cd0a27845b3f5139a6bb52757c9e24d86319f8d16c022079f8381c5287af7e6488d6a589e73caf23c487bf355ac22b7c01cf58830110bf01 33 0x023d1c9bcd771cc12b60cce62e9b8196788dd365089b70d898d60917a174e16f6a" + }, + { + "prevTxId":"d6df9f8866a94576b20be6c2a489cf208f75c9b65306bad9d741dbd4395d7dec", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"473044022008848d34f2ca77f8bf79eb83b89ee8a24292d0c3936350a37f1522664e2e216002204ad05817044e18d0c26e89139b9fb98a21ceda2249a7cfa58f3ec420af9477c7012103af07092ed729d97d5e2ae9f8a295f1b2da268e7414ce3df9b374051d7647092b", + "scriptString":"71 0x3044022008848d34f2ca77f8bf79eb83b89ee8a24292d0c3936350a37f1522664e2e216002204ad05817044e18d0c26e89139b9fb98a21ceda2249a7cfa58f3ec420af9477c701 33 0x03af07092ed729d97d5e2ae9f8a295f1b2da268e7414ce3df9b374051d7647092b" + } + ], + "outputs":[ + { + "satoshis":3700000, + "script":"76a914b1b9b659297859bd310ba8ba6f95573c635b191a88ac" + }, + { + "satoshis":3000000, + "script":"76a914636c549bf6035b27cf3823f5482911ebb2bce5d088ac" + } + ], + "nLockTime":0 + }, + { + "hash":"7766eac176f9db586456b150b7f0f757fd2c8a9b6d7ae8d42977580effe1c964", + "version":1, + "inputs":[ + { + "prevTxId":"41c87fdc6c1dffac1fe122390c045815c5bfe38e6b7521157bbe45dd5a43888c", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"47304402201bf92a99fd85e09de43b9039801f387ad6ea996d71c02185019a18cd2691d68502204500ea82873501c25c5b1476f9cd75d70b2a34a4162470e3390f89ff6a5830110121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c", + "scriptString":"71 0x304402201bf92a99fd85e09de43b9039801f387ad6ea996d71c02185019a18cd2691d68502204500ea82873501c25c5b1476f9cd75d70b2a34a4162470e3390f89ff6a58301101 33 0x022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c" + }, + { + "prevTxId":"7e6e1cb7d33f6559775a5170567b0c96cb03c38f06cd876af08d9e7c8f131dbb", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"4830450220277eb0e03b897cd20ac3bfa15af82ae2c1e75472ffce0482ce1594cd4536e83802210088164c46f3fc82ed3530b7552a1da6ecd2f690647485bb0fe1a706ae0f09d5b6012102718b695944b9e6f12db75e7dc7b77f023c8b9706405b62dac6e6c94dc1c7214e", + "scriptString":"72 0x30450220277eb0e03b897cd20ac3bfa15af82ae2c1e75472ffce0482ce1594cd4536e83802210088164c46f3fc82ed3530b7552a1da6ecd2f690647485bb0fe1a706ae0f09d5b601 33 0x02718b695944b9e6f12db75e7dc7b77f023c8b9706405b62dac6e6c94dc1c7214e" + } + ], + "outputs":[ + { + "satoshis":1950000, + "script":"76a914e22f515855329b13602778a1d681295e485390b888ac" + }, + { + "satoshis":3010000, + "script":"76a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"819427319cedc05e63e092cbe5e72a3186bea072c01814dd8476d3ef85893ab8", + "version":1, + "inputs":[ + { + "prevTxId":"8232be9da532d28e8180a5abba12eef20dc25b31b15bc6b316c86402f74d8a94", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"483045022100e96feaa777c517aa67498d51c52b7c177c18f7eb96c7ec109bcf4b7d1993245e02203d4f6dc06f4ac4ff947d81a45c9e53b12ee89e4223aa670eee2ca435157f6054012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807", + "scriptString":"72 0x3045022100e96feaa777c517aa67498d51c52b7c177c18f7eb96c7ec109bcf4b7d1993245e02203d4f6dc06f4ac4ff947d81a45c9e53b12ee89e4223aa670eee2ca435157f605401 33 0x02690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807" + }, + { + "prevTxId":"73d5609bd67f08d60cea48c7ad141fc4c65a631f142b8fb465181311d1f5dd8d", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"4830450220588e7eb9477043dc7b7d9f554b5db44823d9b7108a73d224af8cb24b190ebc94022100deb2fd7cfbff5f7679a38a16c18075dc9eb705850054415eba27a0f769f94e8d012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807", + "scriptString":"72 0x30450220588e7eb9477043dc7b7d9f554b5db44823d9b7108a73d224af8cb24b190ebc94022100deb2fd7cfbff5f7679a38a16c18075dc9eb705850054415eba27a0f769f94e8d01 33 0x02690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807" + } + ], + "outputs":[ + { + "satoshis":2740000, + "script":"76a9147ff6d70c9f71e29f3b3b77e1acb0bae8d1af12d288ac" + }, + { + "satoshis":3210000, + "script":"76a9141c5b740011cff8324ed10c3e8f63f6261f36613a88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"cbbf483ac272ed5f9cca3ceccf6f08ada34d87fd6a5ccb34ac14e13dfbd4cf1c", + "version":1, + "inputs":[ + { + "prevTxId":"14601bf9657358aec323235e8fb784caca1a1a6d001291d3d4a129be57f02476", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"47304402201bfc0a95285de492ca53fd2ab89b58cdb1d9d817d7c4ade64e31bb63ccf73b7802206d4f72973c9aa804d9a5c9b749a49aec579ab7875d30c1e0b9ab8d3d7b8041ad012102926efc059307ca51862547d58b7a0c1749f0e27df6fbea550bbb291ef0a00bcb", + "scriptString":"71 0x304402201bfc0a95285de492ca53fd2ab89b58cdb1d9d817d7c4ade64e31bb63ccf73b7802206d4f72973c9aa804d9a5c9b749a49aec579ab7875d30c1e0b9ab8d3d7b8041ad01 33 0x02926efc059307ca51862547d58b7a0c1749f0e27df6fbea550bbb291ef0a00bcb" + }, + { + "prevTxId":"d83bb9826f4e526eda5d9283e40c371c1fbe45c8f174a12c60d56da10fae83ed", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"4930460221008de29b6fafdadc7a1430ff453c9cb4ea96f9186c1c43b9d1f243876c4d187c5a022100f03f8a8a43c39a619c03db80bedaf9111ee817a574edf912795b3bef85024d46012102891fda8944ae461484abdc5898a94d666d8e54ed47f534218601c9a39e1058b8", + "scriptString":"73 0x30460221008de29b6fafdadc7a1430ff453c9cb4ea96f9186c1c43b9d1f243876c4d187c5a022100f03f8a8a43c39a619c03db80bedaf9111ee817a574edf912795b3bef85024d4601 33 0x02891fda8944ae461484abdc5898a94d666d8e54ed47f534218601c9a39e1058b8" + } + ], + "outputs":[ + { + "satoshis":3000000, + "script":"76a914fc9c507e2cf3563c63bf9ec7b38773c2a1e1c47288ac" + }, + { + "satoshis":3970000, + "script":"76a914736d9e4703437b3f245cda14ab4ed2d52b0a622d88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"a887d7d752368dbaf40d418fc26915bbcef06b6625739c17fd332914d7c57f94", + "version":1, + "inputs":[ + { + "prevTxId":"3920ab0c97548e78cab8f4b1f691609cf1a7ac6980a0abadc5ea0361af874ba3", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"483045022049ce62033552a024ce0badb3d3c9db84af929c373b816dade2611563871e48840221009f80e97265ce861637468c98237a06df9c7482cc7c1739e1c36a8e85537c7f160121032e68cde689f248f9dcce3f1b3b607400fd1275aa3d3a821ff81dd95a3645e20f", + "scriptString":"72 0x3045022049ce62033552a024ce0badb3d3c9db84af929c373b816dade2611563871e48840221009f80e97265ce861637468c98237a06df9c7482cc7c1739e1c36a8e85537c7f1601 33 0x032e68cde689f248f9dcce3f1b3b607400fd1275aa3d3a821ff81dd95a3645e20f" + }, + { + "prevTxId":"f45e173bbbb918c4d327313a66203c3f0cb61aba1113180bf7c4447bf5c973a9", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"48304502204d5decc921dff956fbcfa1a574e43e0d17b9a49ee07f294b74f854f0dd7e0160022100d49781e18670f3372961dd5799d162071e13832fa9f15197c90d7b8ab8168e8d012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807", + "scriptString":"72 0x304502204d5decc921dff956fbcfa1a574e43e0d17b9a49ee07f294b74f854f0dd7e0160022100d49781e18670f3372961dd5799d162071e13832fa9f15197c90d7b8ab8168e8d01 33 0x02690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807" + } + ], + "outputs":[ + { + "satoshis":2940000, + "script":"76a914cc0d9d6d476efe8205891836f40e00caf2fde49288ac" + }, + { + "satoshis":3010000, + "script":"76a9143770e8980281b63351861a17881cecbfaaa5c74b88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"db164f27acf3d43e5e5dbed5c173902ecfb1010b992568d086712b62a5e331ef", + "version":1, + "inputs":[ + { + "prevTxId":"f1e8f3e838d349c84221351bc5607b3be14a28e1f8781e67a9727b2007c20469", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"4730440220740a2107c2d9be5f621822667b9cc34566511c0e6767de900f3b46fa0852d62302207cf2fcf969e48fce7ad43880bd3a7ee5658a421a3fb718e3fd824e22e4bac6ee012102690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807", + "scriptString":"71 0x30440220740a2107c2d9be5f621822667b9cc34566511c0e6767de900f3b46fa0852d62302207cf2fcf969e48fce7ad43880bd3a7ee5658a421a3fb718e3fd824e22e4bac6ee01 33 0x02690619097c609c03c8b82f7d289aac8a4d2fe36e5a41fc3701138deeeccd9807" + }, + { + "prevTxId":"e7069e69bea9f41706ce34d9f8efbffde3c81f2bf89deb5aab6f1b98483969a3", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"493046022100942e3ffd4522789f747b0c0d18a7228ba9f343294a34ffb0a53801b0d1626963022100eacf2ea0eef2c58e2666442bd331489dbda43adfd6d4809c2e71de38aff7fd92012103de66ea9a044ee251ba8a6dfe1d68ee1c2e17acaf5d8b568a515ff37752b6ea0e", + "scriptString":"73 0x3046022100942e3ffd4522789f747b0c0d18a7228ba9f343294a34ffb0a53801b0d1626963022100eacf2ea0eef2c58e2666442bd331489dbda43adfd6d4809c2e71de38aff7fd9201 33 0x03de66ea9a044ee251ba8a6dfe1d68ee1c2e17acaf5d8b568a515ff37752b6ea0e" + } + ], + "outputs":[ + { + "satoshis":2940000, + "script":"76a914ac64ed9c139e44fd8d1d9ad28d1d08fc8a8f70f888ac" + }, + { + "satoshis":3010000, + "script":"76a9143770e8980281b63351861a17881cecbfaaa5c74b88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"f9840db5cc0479fcd40701543af5db8ba6f127f8f4f0c04752f69278f436ea02", + "version":1, + "inputs":[ + { + "prevTxId":"3cc19e761e7dda2dcbd3721eeb4190d2a7705b23341451d80f0307d09de9453b", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"48304502201c10c88a04850d9101b6cbcb51c28d9ca34f693fd918ba3c26775c5993cbdfc1022100e5d7708777b9592d709863859ce0f4d590f56acf5bb3655e119cac10d597c463012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"72 0x304502201c10c88a04850d9101b6cbcb51c28d9ca34f693fd918ba3c26775c5993cbdfc1022100e5d7708777b9592d709863859ce0f4d590f56acf5bb3655e119cac10d597c46301 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + }, + { + "prevTxId":"4af13bec6fc4592a3ceef4a5cbe8bf244352e65f455f23739098e70bcf87cc87", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"48304502205cd5ea454979d705d4573d7b6f6a1bae22e5f146e0ccd14079a959a429bf69fc022100d88f05762b394621ec967546151b682f8103bed05b6d99b80adfadd626a721c5012103803aa78d28c40170231e0520fc38daa405140ed6e177c0747ce9d8d7dd6cdee4", + "scriptString":"72 0x304502205cd5ea454979d705d4573d7b6f6a1bae22e5f146e0ccd14079a959a429bf69fc022100d88f05762b394621ec967546151b682f8103bed05b6d99b80adfadd626a721c501 33 0x03803aa78d28c40170231e0520fc38daa405140ed6e177c0747ce9d8d7dd6cdee4" + } + ], + "outputs":[ + { + "satoshis":3530000, + "script":"76a914bc1e95774ee2e36d2687714da14551132f0588b088ac" + }, + { + "satoshis":3000000, + "script":"76a914859819cb59368e07d4c95b5221fa4c466d66694988ac" + } + ], + "nLockTime":0 + }, + { + "hash":"48464b4a6f6f126c220ac43159f1ae9b6e516702126d00762c335d9deb6563ea", + "version":1, + "inputs":[ + { + "prevTxId":"724cb431495d098611b6a8db1c89cfb2a26a047e6078a7563e3b4fbc7fce4878", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"483045022100850533f400465b01658b7dfcb05b3bae38a89344065f8321f69f7b1b2036446f0220663a629b5f2b1cf8748558ae71c8b49cda87e43347d4cbf4c84e3a79bc904a49012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"72 0x3045022100850533f400465b01658b7dfcb05b3bae38a89344065f8321f69f7b1b2036446f0220663a629b5f2b1cf8748558ae71c8b49cda87e43347d4cbf4c84e3a79bc904a4901 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + }, + { + "prevTxId":"92ee19235af75a41531fe776a22183c111ca92375d7f1260563d30148ec0330e", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"483045022020d4bbbc5c300aadbc52110f7aa971d77bcf567c91d288ed6af0a98fc8f75e74022100ea84ee6d3fbeb672e92ea993d27202fc9ecd33ba7494d8b064518649fc2c17dc0121036a91343ca1c973401accb1fb902336d2a7a1b4f670ff82d9acc5c380d6a627f0", + "scriptString":"72 0x3045022020d4bbbc5c300aadbc52110f7aa971d77bcf567c91d288ed6af0a98fc8f75e74022100ea84ee6d3fbeb672e92ea993d27202fc9ecd33ba7494d8b064518649fc2c17dc01 33 0x036a91343ca1c973401accb1fb902336d2a7a1b4f670ff82d9acc5c380d6a627f0" + } + ], + "outputs":[ + { + "satoshis":3620000, + "script":"76a9144cc35fc2651b5b3e4f22dfa9b6ebef0ca1797fb088ac" + }, + { + "satoshis":3000000, + "script":"76a91449452bed77744157799ba71fdb43efbd66968ad188ac" + } + ], + "nLockTime":0 + }, + { + "hash":"54b986c38ae88a0fdf5efb43d1f8db2d0c1331e746d25d676bc422e93cc1ff67", + "version":1, + "inputs":[ + { + "prevTxId":"243f250da5709bb5f1d2f5a8c739e8e79e4d1ea0cf64c1db8d0804882cc56c2a", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"483045022100bd72079af0ba0965d01dc6de2502ceebe38fa94fcf9850140e7ce1e5ef29d3cc02207da0e0b881594a9bc8750143dfa41ce8255e14f24784a551d3d1c4a2acecc0a2012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"72 0x3045022100bd72079af0ba0965d01dc6de2502ceebe38fa94fcf9850140e7ce1e5ef29d3cc02207da0e0b881594a9bc8750143dfa41ce8255e14f24784a551d3d1c4a2acecc0a201 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + }, + { + "prevTxId":"625c94db4296b477f81c1beaa2294befb56b77afd92c4333a3ec17774b2f2636", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"483045022100f074c81f476f50dad72d3d07cef668532bb2b0cc772b49abf67cafd476e4e41302201e36efd9eec72b2f5ff4eac4ffbbe0598c6185b63c6ba8e03737b708e73149940121022d7e055cd28a8b7ca2613687e9b5cd4ff4a959c54d74f49c12345d1d8f78b374", + "scriptString":"72 0x3045022100f074c81f476f50dad72d3d07cef668532bb2b0cc772b49abf67cafd476e4e41302201e36efd9eec72b2f5ff4eac4ffbbe0598c6185b63c6ba8e03737b708e731499401 33 0x022d7e055cd28a8b7ca2613687e9b5cd4ff4a959c54d74f49c12345d1d8f78b374" + } + ], + "outputs":[ + { + "satoshis":3000000, + "script":"76a914fc9c507e2cf3563c63bf9ec7b38773c2a1e1c47288ac" + }, + { + "satoshis":3750000, + "script":"76a9145ab29618ded8892f8189ca3ce81bef83d3ddda1688ac" + } + ], + "nLockTime":0 + }, + { + "hash":"8422b9cdd10e63b7daf4c5a5ac6958c50d1f03f51bd76d1b0e1379c89110f354", + "version":1, + "inputs":[ + { + "prevTxId":"dd9a9e07e138d3afc48940b8bff19d4f0b70ca398fbb3743be77624795e524d7", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"483045022100f775b297513593c1c6e461902ab6405c4c38ce3b37d9292fe074153b8c466c29022010ded748e9e7fb1fbb263b8f466e6a1352e05ddb8842a17f712478e3d9c177040121023d1c9bcd771cc12b60cce62e9b8196788dd365089b70d898d60917a174e16f6a", + "scriptString":"72 0x3045022100f775b297513593c1c6e461902ab6405c4c38ce3b37d9292fe074153b8c466c29022010ded748e9e7fb1fbb263b8f466e6a1352e05ddb8842a17f712478e3d9c1770401 33 0x023d1c9bcd771cc12b60cce62e9b8196788dd365089b70d898d60917a174e16f6a" + }, + { + "prevTxId":"eda4295c32503bba91f10e85987add5d89d1fc46dd51a8aaf471229e73fb40ff", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"4830450220686b1c5ecd7ea0e9078784f5ea0100035a962809fd1d0cf7a131604ecfb26f02022100ddf7b8874a375edfa4d0d7b93cfd214d0327e550add318f1a8a379cceae8dac601210363c3fa31a5453a29f6cde46c9d77698fd8276cf9f511dd6e5d079a231fea568e", + "scriptString":"72 0x30450220686b1c5ecd7ea0e9078784f5ea0100035a962809fd1d0cf7a131604ecfb26f02022100ddf7b8874a375edfa4d0d7b93cfd214d0327e550add318f1a8a379cceae8dac601 33 0x0363c3fa31a5453a29f6cde46c9d77698fd8276cf9f511dd6e5d079a231fea568e" + } + ], + "outputs":[ + { + "satoshis":3940000, + "script":"76a914b0c1cda106bb5085bd9c0c9982773c7bd066fabc88ac" + }, + { + "satoshis":3000000, + "script":"76a914859819cb59368e07d4c95b5221fa4c466d66694988ac" + } + ], + "nLockTime":0 + }, + { + "hash":"0172e18055af32e502eb6d29e2d7700747c9938de5c145ab652bc9999c51fbd9", + "version":1, + "inputs":[ + { + "prevTxId":"ef87eb8f58c7f3919b5f50509aef2954f45c0033b81b0dbc391649d9ee5bb9a9", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"493046022100854bc0ee8b24e2b625798148fc505cb37464f72688456dc54b0c25c4dd564091022100c2863ab346c23157baaeb45e6d102e7354cc895ee0dd7b6ecdc77ab34bdd4d0f0121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c", + "scriptString":"73 0x3046022100854bc0ee8b24e2b625798148fc505cb37464f72688456dc54b0c25c4dd564091022100c2863ab346c23157baaeb45e6d102e7354cc895ee0dd7b6ecdc77ab34bdd4d0f01 33 0x022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c" + }, + { + "prevTxId":"eff4add214c36398733d071cddd1934c8406f443d5e9c6fbef9dfe22d7f0aa8e", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"47304402203f28684b208f0f4bf87ca22544e59585a7807fcd5a2ec78fc93ce915e282335502201ab05402d3a2b2914dd955971fade92dc874e6441bc2383766ec8b4c56dca27501210251a3bd043afe5cf46a40c4ce4caf3e917190583588634711507d6ef77acc438b", + "scriptString":"71 0x304402203f28684b208f0f4bf87ca22544e59585a7807fcd5a2ec78fc93ce915e282335502201ab05402d3a2b2914dd955971fade92dc874e6441bc2383766ec8b4c56dca27501 33 0x0251a3bd043afe5cf46a40c4ce4caf3e917190583588634711507d6ef77acc438b" + } + ], + "outputs":[ + { + "satoshis":3010000, + "script":"76a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac" + }, + { + "satoshis":2010000, + "script":"76a914b27f37b7cee282e7890f4f6df9b49574f35e855288ac" + } + ], + "nLockTime":0 + }, + { + "hash":"040efc4e5a76a012626d64106c14c9fcacc451061bb105c057d25a9020f67237", + "version":1, + "inputs":[ + { + "prevTxId":"910755c154c0225f1557dce40600c356d9ad9d04ddc78f68f0d51b5b6acbdefa", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"48304502201dcb7d73d180cda9ddb192e50fcf5f0efaa5e680931f2bc25e58dd368d4b815f0221008149257f9394b01188aa84f92aec7374339076b408360767236a3af18718cddc0121032e68cde689f248f9dcce3f1b3b607400fd1275aa3d3a821ff81dd95a3645e20f", + "scriptString":"72 0x304502201dcb7d73d180cda9ddb192e50fcf5f0efaa5e680931f2bc25e58dd368d4b815f0221008149257f9394b01188aa84f92aec7374339076b408360767236a3af18718cddc01 33 0x032e68cde689f248f9dcce3f1b3b607400fd1275aa3d3a821ff81dd95a3645e20f" + }, + { + "prevTxId":"c3ac3f49eb2c815bbbc5262597823bcdd0239ce939185afe61521d5b58d09e56", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"48304502205665ae2983ad6ec44220810a6f4c28d77dd518cc891eb9ed67503a756e97c477022100ab456b8a9c1f977623956943d8f1892c3bf84d8adefaa405606d3473f37fb8b4012102bbdf0772bbacab8eaba47d783d30fa401b08a0ecc4bccd49357171ac38791c0e", + "scriptString":"72 0x304502205665ae2983ad6ec44220810a6f4c28d77dd518cc891eb9ed67503a756e97c477022100ab456b8a9c1f977623956943d8f1892c3bf84d8adefaa405606d3473f37fb8b401 33 0x02bbdf0772bbacab8eaba47d783d30fa401b08a0ecc4bccd49357171ac38791c0e" + } + ], + "outputs":[ + { + "satoshis":3010000, + "script":"76a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac" + }, + { + "satoshis":1330000, + "script":"76a914a6a0900e3c77496dc68be8ee130a21b446b8266588ac" + } + ], + "nLockTime":0 + }, + { + "hash":"6d0d9d9fefa0abe4892a304b6ea0da54a7e2fc87d9b8cf32e68e868f045dc955", + "version":1, + "inputs":[ + { + "prevTxId":"db657284898156cb93043002aac42b2ea2c0a4d11545883c1c62b387f80d9d3d", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"483045022100af41bf6edc04de96ad8b0d0e0794a7055c9677f2616fcfc1b053f87ad5c60c0f02201ef5279534263776cca80957368791a362354d7a40f3f175874b909de2d7f9a10121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c", + "scriptString":"72 0x3045022100af41bf6edc04de96ad8b0d0e0794a7055c9677f2616fcfc1b053f87ad5c60c0f02201ef5279534263776cca80957368791a362354d7a40f3f175874b909de2d7f9a101 33 0x022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c" + }, + { + "prevTxId":"2e43bfe37671db465068fdd1c5e9d0b4e3333b681b5712e71ee2bafc65c9f670", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"483045022033da8150f9870e045581f5894366f57345946174b43b7f8c0f9b24f7afad395c022100e3db87d42b1050ea8f2e964a13eeae86cc57e771c4dfa29f7f055c74a39be3b801210221f705f7d58ceea66122bcdc7220db0583d8ce1d7d948ed86007905268f55162", + "scriptString":"72 0x3045022033da8150f9870e045581f5894366f57345946174b43b7f8c0f9b24f7afad395c022100e3db87d42b1050ea8f2e964a13eeae86cc57e771c4dfa29f7f055c74a39be3b801 33 0x0221f705f7d58ceea66122bcdc7220db0583d8ce1d7d948ed86007905268f55162" + } + ], + "outputs":[ + { + "satoshis":3010000, + "script":"76a9141882e6174c19c4a2ac6c7d807170e76cbc75160f88ac" + }, + { + "satoshis":2130000, + "script":"76a91447830d334d04acd62668904b6fab06a90742e75088ac" + } + ], + "nLockTime":0 + }, + { + "hash":"cb44de025ed8fb7dab371789bd8328c7df7916058556ec0cd32bd856e3acdc86", + "version":1, + "inputs":[ + { + "prevTxId":"f2511b69a8d67a90fb0d4401e77ca8994bb31af8c3d127a63d6257b58f31482e", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"493046022100d2733fcc63dd86bc4653d268f16e467e87a7be9e1d3f45cbeccb2423b7eb1c6c022100e3963622c12dab3e9c0c76a8ef13151114cb0f17abe6c29cca2fcbac264dfc980121020ce8a0852e31812de6b8f2b2604d948cb06f8f7f404e70a19067cca01b5d0988", + "scriptString":"73 0x3046022100d2733fcc63dd86bc4653d268f16e467e87a7be9e1d3f45cbeccb2423b7eb1c6c022100e3963622c12dab3e9c0c76a8ef13151114cb0f17abe6c29cca2fcbac264dfc9801 33 0x020ce8a0852e31812de6b8f2b2604d948cb06f8f7f404e70a19067cca01b5d0988" + }, + { + "prevTxId":"cb3e9e38e96e41093ad3b1ccbda31e2a026fbdb8a6e93e28f329a02ac9095f67", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"48304502202beb8d4ff142762f12f867a1686c2a523c55ff336b8ae3992ae1292019afeaf1022100a2e7edb9ffb29628540fd02b21c84abf1cc48d70c9f6adb39550b8aff572c65a012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"72 0x304502202beb8d4ff142762f12f867a1686c2a523c55ff336b8ae3992ae1292019afeaf1022100a2e7edb9ffb29628540fd02b21c84abf1cc48d70c9f6adb39550b8aff572c65a01 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + } + ], + "outputs":[ + { + "satoshis":3970000, + "script":"76a914449c3ac7336a78f0c6401f51710949005d2c7ffa88ac" + }, + { + "satoshis":3000000, + "script":"76a914636c549bf6035b27cf3823f5482911ebb2bce5d088ac" + } + ], + "nLockTime":0 + }, + { + "hash":"69910ceb1bdb1551d5fef5979e698c665e1d5c8d365c3d9a0925bf05631e8ab0", + "version":1, + "inputs":[ + { + "prevTxId":"5a272f55c0bf54644d4a762f15b511b7b948ae9f51467e2c4a395ee62c2e2333", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"493046022100928f760eaabaed51bfc4db0188c84a6a19ef34a88786f2a25d8050c8356d858d022100c1a35c67f2c21b4837eaf73e195c74eb213bdaa4650fe77da072db9f84b90d0c0121022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c", + "scriptString":"73 0x3046022100928f760eaabaed51bfc4db0188c84a6a19ef34a88786f2a25d8050c8356d858d022100c1a35c67f2c21b4837eaf73e195c74eb213bdaa4650fe77da072db9f84b90d0c01 33 0x022d9055b471959ea9385bf8c92788c45d836818d86833d91331cee37d8c15ee3c" + }, + { + "prevTxId":"3a41829d9f0b8840afea4fca51c615f82f2167c64a22e9a4eb0ade9e4520fcf7", + "outputIndex":1, + "sequenceNumber":4294967295, + "script":"493046022100c098dd6d9b20ed80de2d86d2c1bc9328b1c42f04b03c3767aec9d846d4538c9d0221009e32178215a499f22d8d3afe9f257159143c3d24f07371e0ef2de97d216e3b42012102078d4050a314870bd68960765015e5f884e35c60b44e23e0f2d264b73aaca477", + "scriptString":"73 0x3046022100c098dd6d9b20ed80de2d86d2c1bc9328b1c42f04b03c3767aec9d846d4538c9d0221009e32178215a499f22d8d3afe9f257159143c3d24f07371e0ef2de97d216e3b4201 33 0x02078d4050a314870bd68960765015e5f884e35c60b44e23e0f2d264b73aaca477" + } + ], + "outputs":[ + { + "satoshis":3210000, + "script":"76a9141c5b740011cff8324ed10c3e8f63f6261f36613a88ac" + }, + { + "satoshis":2740000, + "script":"76a9147bdb65a92af2520836f77e5ebccc697d814149ce88ac" + } + ], + "nLockTime":0 + }, + { + "hash":"ca62089ca56d89d36f53d84bc035c839ab20e7d9284e3f93fb4cb408057b4601", + "version":1, + "inputs":[ + { + "prevTxId":"3de456aa0c4513eb67f431a1508bf6ad803e23d194a426fe335ec14201bce9da", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"493046022100ecf03f0bafb0cf6e08ac80336565bf79b6bac800f546e9f953fb14df7bf239ac022100982e27f2f0b3f8569cef126c0c54a88b002f00d570106c74f5c4b314c9609442012103b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662", + "scriptString":"73 0x3046022100ecf03f0bafb0cf6e08ac80336565bf79b6bac800f546e9f953fb14df7bf239ac022100982e27f2f0b3f8569cef126c0c54a88b002f00d570106c74f5c4b314c960944201 33 0x03b3385ed65f34e06927d8835e86103c3de352dbdece5cb704f6899886a0334662" + }, + { + "prevTxId":"f1e8f3e838d349c84221351bc5607b3be14a28e1f8781e67a9727b2007c20469", + "outputIndex":0, + "sequenceNumber":4294967295, + "script":"493046022100febc4cdfbd5073ee756c9763b0e18009893b422e13c25e8f74ca97b84c0cf73f022100a85a6c10debf45e8ad00db28fce5fcb68404e9ac4b844f0ae1d59c0ef210d714012103dc9adee9c23ca7a091b4eafc4dfef2ed07adf903dae568f345095321aa9c57e2", + "scriptString":"73 0x3046022100febc4cdfbd5073ee756c9763b0e18009893b422e13c25e8f74ca97b84c0cf73f022100a85a6c10debf45e8ad00db28fce5fcb68404e9ac4b844f0ae1d59c0ef210d71401 33 0x03dc9adee9c23ca7a091b4eafc4dfef2ed07adf903dae568f345095321aa9c57e2" + } + ], + "outputs":[ + { + "satoshis":3620000, + "script":"76a91467a341d7fe4de6a810c182ed27a09554e0b4405d88ac" + }, + { + "satoshis":3000000, + "script":"76a914f7f1f64a590896dccfb869ced060f058007f388b88ac" + } + ], + "nLockTime":0 + } + ] +} diff --git a/packages/kauri-bitcore-lib/test/data/ecdsa.json b/packages/kauri-bitcore-lib/test/data/ecdsa.json new file mode 100644 index 0000000..67ccd37 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/ecdsa.json @@ -0,0 +1,230 @@ +{ + "valid": [ + { + "d": "01", + "k": "ec633bd56a5774a0940cb97e27a9e4e51dc94af737596a0c5cbb3d30332d92a5", + "message": "Everything should be made as simple as possible, but not simpler.", + "i": 0, + "signature": { + "r": "23362334225185207751494092901091441011938859014081160902781146257181456271561", + "s": "50433721247292933944369538617440297985091596895097604618403996029256432099938" + } + }, + { + "d": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "k": "9dc74cbfd383980fb4ae5d2680acddac9dac956dca65a28c80ac9c847c2374e4", + "message": "Equations are more important to me, because politics is for the present, but an equation is something for eternity.", + "i": 0, + "signature": { + "r": "38341707918488238920692284707283974715538935465589664377561695343399725051885", + "s": "3180566392414476763164587487324397066658063772201694230600609996154610926757" + } + }, + { + "d": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "k": "fd27071f01648ebbdd3e1cfbae48facc9fa97edc43bbbc9a7fdc28eae13296f5", + "message": "Not only is the Universe stranger than we think, it is stranger than we can think.", + "i": 0, + "signature": { + "r": "115464191557905790016094131873849783294273568009648050793030031933291767741904", + "s": "50562520307781850052192542766631199590053690478900449960232079510155113443971" + } + }, + { + "d": "0000000000000000000000000000000000000000000000000000000000000001", + "k": "f0cd2ba5fc7c183de589f6416220a36775a146740798756d8d949f7166dcc87f", + "message": "How wonderful that we have met with a paradox. Now we have some hope of making progress.", + "i": 1, + "signature": { + "r": "87230998027579607140680851455601772643840468630989315269459846730712163783123", + "s": "53231320085894623106179381504478252331065330583563809963303318469380290929875" + } + }, + { + "d": "69ec59eaa1f4f2e36b639716b7c30ca86d9a5375c7b38d8918bd9c0ebc80ba64", + "k": "6bb4a594ad57c1aa22dbe991a9d8501daf4688bf50a4892ef21bd7c711afda97", + "message": "Computer science is no more about computers than astronomy is about telescopes.", + "i": 0, + "signature": { + "r": "51348483531757779992459563033975330355971795607481991320287437101831125115997", + "s": "6277080015686056199074771961940657638578000617958603212944619747099038735862" + } + }, + { + "d": "00000000000000000000000000007246174ab1e92e9149c6e446fe194d072637", + "k": "097b5c8ee22c3ea78a4d3635e0ff6fe85a1eb92ce317ded90b9e71aab2b861cb", + "message": "...if you aren't, at any given time, scandalized by code you wrote five or even three years ago, you're not learning anywhere near enough", + "i": 1, + "signature": { + "r": "113979859486826658566290715281614250298918272782414232881639314569529560769671", + "s": "6517071009538626957379450615706485096874328019806177698938278220732027419959" + } + }, + { + "d": "000000000000000000000000000000000000000000056916d0f9b31dc9b637f3", + "k": "19355c36c8cbcdfb2382e23b194b79f8c97bf650040fc7728dfbf6b39a97c25b", + "message": "The question of whether computers can think is like the question of whether submarines can swim.", + "i": 1, + "signature": { + "r": "93122007060065279508564838030979550535085999589142852106617159184757394422777", + "s": "3078539468410661027472930027406594684630312677495124015420811882501887769839" + } + } + ], + "invalid": { + "sigError": [ + { + "description": "The wrong signature", + "exception": "Invalid signature", + "d": "01", + "message": "foo", + "signature": { + "r": "38341707918488238920692284707283974715538935465589664377561695343399725051885", + "s": "3180566392414476763164587487324397066658063772201694230600609996154610926757" + } + }, + { + "description": "Invalid r value (< 0)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "-1", + "s": "2" + } + }, + { + "description": "Invalid r value (== 0)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "0", + "s": "2" + } + }, + { + "description": "Invalid r value (>= n)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "115792089237316195423570985008687907852837564279074904382605163141518161494337", + "s": "2" + } + }, + { + "description": "Invalid s value (< 0)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "2", + "s": "-1" + } + }, + { + "description": "Invalid s value (== 0)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "2", + "s": "0" + } + }, + { + "description": "Invalid s value (>= n)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "2", + "s": "115792089237316195423570985008687907852837564279074904382605163141518161494337" + } + }, + { + "description": "Invalid r, s values (r = s = -n)", + "exception": "r and s not in range", + "d": "01", + "message": "foo", + "signature": { + "r": "-115792089237316195423570985008687907852837564279074904382605163141518161494337", + "s": "-115792089237316195423570985008687907852837564279074904382605163141518161494337" + } + } + ] + }, + "deterministicK": [ + { + "message": "test data", + "privkey": "fee0a1f7afebf9d2a5a80c0c98a31c709681cce195cbcd06342b517970c0be1e", + "k_bad00": "fcce1de7a9bcd6b2d3defade6afa1913fb9229e3b7ddf4749b55c4848b2a196e", + "k_bad01": "727fbcb59eb48b1d7d46f95a04991fc512eb9dbf9105628e3aec87428df28fd8", + "k_bad15": "398f0e2c9f79728f7b3d84d447ac3a86d8b2083c8f234a0ffa9c4043d68bd258" + }, + { + "message": "Everything should be made as simple as possible, but not simpler.", + "privkey": "0000000000000000000000000000000000000000000000000000000000000001", + "k_bad00": "ec633bd56a5774a0940cb97e27a9e4e51dc94af737596a0c5cbb3d30332d92a5", + "k_bad01": "df55b6d1b5c48184622b0ead41a0e02bfa5ac3ebdb4c34701454e80aabf36f56", + "k_bad15": "def007a9a3c2f7c769c75da9d47f2af84075af95cadd1407393dc1e26086ef87" + }, + { + "message": "Satoshi Nakamoto", + "privkey": "0000000000000000000000000000000000000000000000000000000000000002", + "k_bad00": "d3edc1b8224e953f6ee05c8bbf7ae228f461030e47caf97cde91430b4607405e", + "k_bad01": "f86d8e43c09a6a83953f0ab6d0af59fb7446b4660119902e9967067596b58374", + "k_bad15": "241d1f57d6cfd2f73b1ada7907b199951f95ef5ad362b13aed84009656e0254a" + }, + { + "message": "Diffie Hellman", + "privkey": "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", + "k_bad00": "c378a41cb17dce12340788dd3503635f54f894c306d52f6e9bc4b8f18d27afcc", + "k_bad01": "90756c96fef41152ac9abe08819c4e95f16da2af472880192c69a2b7bac29114", + "k_bad15": "7b3f53300ab0ccd0f698f4d67db87c44cf3e9e513d9df61137256652b2e94e7c" + }, + { + "message": "Japan", + "privkey": "8080808080808080808080808080808080808080808080808080808080808080", + "k_bad00": "f471e61b51d2d8db78f3dae19d973616f57cdc54caaa81c269394b8c34edcf59", + "k_bad01": "6819d85b9730acc876fdf59e162bf309e9f63dd35550edf20869d23c2f3e6d17", + "k_bad15": "d8e8bae3ee330a198d1f5e00ad7c5f9ed7c24c357c0a004322abca5d9cd17847" + }, + { + "message": "Bitcoin", + "privkey": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "k_bad00": "36c848ffb2cbecc5422c33a994955b807665317c1ce2a0f59c689321aaa631cc", + "k_bad01": "4ed8de1ec952a4f5b3bd79d1ff96446bcd45cabb00fc6ca127183e14671bcb85", + "k_bad15": "56b6f47babc1662c011d3b1f93aa51a6e9b5f6512e9f2e16821a238d450a31f8" + }, + { + "message": "i2FLPP8WEus5WPjpoHwheXOMSobUJVaZM1JPMQZq", + "privkey": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "k_bad00": "6e9b434fcc6bbb081a0463c094356b47d62d7efae7da9c518ed7bac23f4e2ed6", + "k_bad01": "ae5323ae338d6117ce8520a43b92eacd2ea1312ae514d53d8e34010154c593bb", + "k_bad15": "3eaa1b61d1b8ab2f1ca71219c399f2b8b3defa624719f1e96fe3957628c2c4ea" + }, + { + "message": "lEE55EJNP7aLrMtjkeJKKux4Yg0E8E1SAJnWTCEh", + "privkey": "3881e5286abc580bb6139fe8e83d7c8271c6fe5e5c2d640c1f0ed0e1ee37edc9", + "k_bad00": "5b606665a16da29cc1c5411d744ab554640479dd8abd3c04ff23bd6b302e7034", + "k_bad01": "f8b25263152c042807c992eacd2ac2cc5790d1e9957c394f77ea368e3d9923bd", + "k_bad15": "ea624578f7e7964ac1d84adb5b5087dd14f0ee78b49072aa19051cc15dab6f33" + }, + { + "message": "2SaVPvhxkAPrayIVKcsoQO5DKA8Uv5X/esZFlf+y", + "privkey": "7259dff07922de7f9c4c5720d68c9745e230b32508c497dd24cb95ef18856631", + "k_bad00": "3ab6c19ab5d3aea6aa0c6da37516b1d6e28e3985019b3adb388714e8f536686b", + "k_bad01": "19af21b05004b0ce9cdca82458a371a9d2cf0dc35a813108c557b551c08eb52e", + "k_bad15": "117a32665fca1b7137a91c4739ac5719fec0cf2e146f40f8e7c21b45a07ebc6a" + }, + { + "message": "00A0OwO2THi7j5Z/jp0FmN6nn7N/DQd6eBnCS+/b", + "privkey": "0d6ea45d62b334777d6995052965c795a4f8506044b4fd7dc59c15656a28f7aa", + "k_bad00": "79487de0c8799158294d94c0eb92ee4b567e4dc7ca18addc86e49d31ce1d2db6", + "k_bad01": "9561d2401164a48a8f600882753b3105ebdd35e2358f4f808c4f549c91490009", + "k_bad15": "b0d273634129ff4dbdf0df317d4062a1dbc58818f88878ffdb4ec511c77976c0" + } + ] +} diff --git a/packages/kauri-bitcore-lib/test/data/merkleblocks.js b/packages/kauri-bitcore-lib/test/data/merkleblocks.js new file mode 100644 index 0000000..c5be8d2 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/merkleblocks.js @@ -0,0 +1,486 @@ +'use strict'; + +module.exports = { + TXHEX: [ + [ // From Mainnet Block 100014 + // From: http://btc.blockr.io/api/v1/tx/raw/652b0aa4cf4f17bdb31f7a1d308331bba91f3b3cbf8f39c9cb5e19d4015b9f01 + "0100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000" + ], + ], + HEX: [ + // Mainnet Block 100014 + "01000000" + // Version + "82bb869cf3a793432a66e826e05a6fc37469f8efb7421dc88067010000000000" + // prevHash + "7f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d97287" + // MerkleRoot + "76381b4d" + // Time + "4c86041b" + // Bits + "554b8529" + // Nonce + "07000000" + // Transaction Count + "04" + // Hash Count + "3612262624047ee87660be1a707519a443b1c1ce3d248cbfc6c15870f6c5daa2" + // Hash1 + "019f5b01d4195ecbc9398fbf3c3b1fa9bb3183301d7a1fb3bd174fcfa40a2b65" + // Hash2 + "41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068" + // Hash3 + "20d2a7bc994987302e5b1ac80fc425fe25f8b63169ea78e68fbaaefa59379bbf" + // Hash4 + "01" + // Num Flag Bytes + "1d" // Flags + ], + JSON: [ + { // Mainnet Block 100014 + header: { + hash: "000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4", + version: 1, + prevHash: "0000000000016780c81d42b7eff86974c36f5ae026e8662a4393a7f39c86bb82", + merkleRoot: "8772d9d0fdf8c1303c7b1167e3c73b095fd970e33c799c6563d98b2e96c5167f", + time: 1293629558, + bits: 453281356, + nonce: 696601429 + }, + numTransactions: 7, + hashes: [ + "3612262624047ee87660be1a707519a443b1c1ce3d248cbfc6c15870f6c5daa2", + "019f5b01d4195ecbc9398fbf3c3b1fa9bb3183301d7a1fb3bd174fcfa40a2b65", + "41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068", + "20d2a7bc994987302e5b1ac80fc425fe25f8b63169ea78e68fbaaefa59379bbf" + ], + flags: [ 29 ] + }, + { // Mainnet Block 12363 + header: { + hash: "00000000ae81d8be56fcad40f7b2ca03612a9ab681ca5bc6628ab3c2d914ef9a", + version: 1, + prevHash: "00000000acc3e6a055e05edc7cd0cfac6187cd73adc3c06d408d05c95edaaef8", + merkleRoot: "67313e7a73b62faffe9380578a1a96727c1f0af62e61eb8aa050064007a008d0", + time: 1240800408, + nonce: 2506812214, + bits: 486604799, + }, + numTransactions: 1, + hashes: [ + "d008a007400650a08aeb612ef60a1f7c72961a8a578093feaf2fb6737a3e3167" + ], + flags: [ 0 ] + }, + { // Mainnet Block 280472 + flags : [ + 255, 85, 218, 225, 90, 173, 229, 43, 183, 195, 213, 229, 43, 108, 43, + 219, 226, 215, 217, 226, 61, 92, 253, 92, 237, 134, 215, 170, 174, 182, + 170, 237, 220, 251, 106, 235, 109, 109, 253, 219, 58, 159, 182, 221, + 190, 189, 181, 126, 251, 223, 223, 254, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 15 + ], + numTransactions : 1159, + hashes : [ + "ad6c32eef89f29f29d43d14500dcb0ac35cba42626244a4dbded64e27d3cdbe4", + "31878bc4a8004d4d2457f7c93571a927de9f22fcacca0356f96fbed5500e1a93", + "252931be626437e48a264aac1f7d178e1ffe8e1c94812e4970f7ab19dfadf074", + "53bd172839306e615ee24552b3ff3c8e2ce2e5a9a6d0c9d1160f1c4bcd73cfde", + "21f3e6be36f0c770938b63505ee2a6065cf9ba5b3ba0d9e115ef9081fb386554", + "7b5bff18588f2f82c130ef92351b289d4a2e6a79dfd2c969ab626fe41d5f3341", + "4672cdcffcd1f3eb4ece0e6558d3d6cef9f42a142df6d46fa6daa4efe5e25a4c", + "f2ba2db60d57f29734fcf98099391a1404c5c1399eb87a6c00f8df9974d1e85d", + "25f5dea2941e8ff493ac7810a4e11cc2846720633469479e8ae29eecee0b2cd2", + "08c71bc1ea3583602db17a5681189f346472447df48bb0254eca8bcdc0e7f2fe", + "42ccdd6e22c0f9da824c6d036f02fe0e5d33368bfa701567bab3fb49acbd9d12", + "971b294ae8678ccc2b1e16c22eb44ded5ef1738dc85d509998982c8d6d742ac5", + "0332bacb6ca645b25682cda96b72c990729e2cf58b0845dc1364cf9785cd09de", + "26ea9fe5be9baddfa879b2e756d71f446779efceef157de30bf799bb632996d0", + "7abcc87284e324bb22d9f2f3365a1745dc9af5e525b659ed60f62d948883f4f5", + "cbcd1f8f2b6dab1253e74d15d1f04c95955e485e5fe462064291d88f84180578", + "fb703bcbdb66148eedb309291609b4e881e94bb9ec8dde1372fa11756ca2e7c5", + "8bd19b733b82e2d02801a55bfd59e262066704c5b09799391224c70862fabfa6", + "ceaeaa83b77263ca910511d385392613695c4882c7fb018c9d37a246b56132e8", + "8c1003d7a5086e57dbd29667668140c1624cc96e96ca97c60f5deb94f15e9a57", + "85945287f9867b8402a287571ea9849fdd5b381873bfc0a6ddd823ef6058f6a5", + "b8d9bb4aea6db726f91cc37040723de9b69048dc725cd0316f7ec7dc10c6d276", + "be9338992c7d0ec10a6364ab8afcde1cf42d45360cc1707208b8d29315742b84", + "7d8b1015509a837ca028c3ec40cddb8e59a96c036e30d18ce84922b8f34e0d1f", + "e9e502636caaa0aa6b978571e3facd5f7a25d25df889583c54e959331051810d", + "489a38d2430ebd638f945bbbc3117345dd2bda666be09bcf454b09272fcc6754", + "b0fe9b242568bbfdbd90932db48dfc42beb4ebdba110b4d7e98b198dfdca4a20", + "0518e5cec967cfdd27d3b3791202bc2e0520cce858f632da776caba97828cdc8", + "97f60954c04de156ceec938437b0eacacf9105bfbb9ea604852eb6454cbbb24d", + "946e2b6387d87d49c151ac2969877410a8f1d65fecc5a99071ec751a6fd7fe6f", + "34d717eb07d2845d9dc1aa0cd620e3ea8d7bd2f25daacc8a058eb9c6a393a896", + "5993d871822b19dfdaa04b7911a790327297132d063f0ce2112323a938904e1c", + "b46666bf125488c07d62af75af71661edc7ef83f17df71bde09c3ceaa574521f", + "6bb9ebc3d94a4d3d528afec8d79f13c5179248cc474d13a3d6f9d279afce0fd8", + "52da5e469bacd7282e515a65a6ca6599bcc8b5e56f7293121b8db41c22483133", + "d2d511a18e5e1a7c2fe485fcd6b3263cec624b1a4e182c8987404adf6434b652", + "9b2fe6183ee437f4c7ce0e368df73256d684b71f48f8f308f62b856604360581", + "30e3e6b952ccd05c32a6c5efefe908fab145a9d7676366c699bd521edd57424c", + "b60c41d49f1c8bb492449c76f63b64a42130579083d5dbfea8377a4a968aa5f1", + "731889fdb1d00f8bd5035071552ee432a0752822d6aca4c35d8f7f14d98b415c", + "b8b7fe24a3b116caab6bc686fb4dd9013027aa349e6e14cdd229c01e9a785444", + "26a8870eaa040d6e0489ee5028d1474d3a895e049f336c7e9ba531e24400393b", + "2a65c6d121dbc11d1c9e58ceedbeee70ff7f6f4c8cfaf5515b9e41c335ea9f03", + "c3724ee9b9c2897fda1c56ce9135ce95eacbb7f9e45a46882e082f2b50b7c19a", + "3168e28ac53cafe312eb0e8bdf454ec77e34390787eab7d78bfd8dfe33640804", + "b461a62a62d6ca50a10b32f09dda4a8f7c18073a86a048634f4331c8c54b4545", + "e9902fd47c94ee0eb0bc3e11836820e1763df3dd5dd0e5da978cbedffa04fbe4", + "01a1d6550ae60519fc796320703a6c3c72e133049845ee6cab9e3850ae6a4274", + "aac3276405f3cadc64a23a1007d85a203135ecb0a656cca11ba7f68ec1d7d8ba", + "cf0a4c57afb757c2a0cbb2d1fd39a10600063bf74695f13a4440fb6e5ade526b", + "feae17a192599d2647adf0218b39ef0e660742349d2395a0b106f6eb2d664796", + "503fc34490ad5de912e86bdb62ccd678d0b9d401cef010d48c935d455364744e", + "fd605fd1f8a121442d09748d3276dd5739a193256c318bce07f29b73e5e2797f", + "270ffccd7a0a1959e1a07d0c2d04cb5b0b1aeaea5abe5b56234c0295718c4269", + "7e7c89a24303966a0b3ec1afa006dec7abc0e46539beb74268534d5721590605", + "2f088d956302164764e6cdcacbcd3ff6545f150fcb2866107c4b4a22dff4444b", + "aa18717fbb5575f3c25195cd59e74c6f096e5622402294900eab58c86ef1f3f9", + "b125a208eb149e923cc70d29248d13549f46f9c353ae99b8818c54f1160efe81", + "d751efaacc03f71d0a306b08b11782d1a002e4211b6905c4524455fd9362bf5f", + "5d67344da8d35bcb0c099e90e9aec2a708a68b6ad9f6b7939cfe1d2eb872a14d", + "ff13ea7bc835d1046c39f50de61e229b154f5b9354e21afdb8202032928c03f9", + "568c957db832e8daa663afb3ebe50f9bc07a546c142a3b8dd8e3ae23c4f3e61b", + "c681f6304af1d4d636ffcc9a511534629f1116dc2209ca33f47aaf0a6a7a38ce", + "822063a0f81c69a738c4596d125847d8d174d33c73d89e5bb10d10e4c8657579", + "bdf5b3f862edd508694af8d64d8eb6dc980de6987f9a5f4012379de6827f4516", + "531177870b5efef4a0985dd48afa13fea0b8e6be87c658d147c2d84e48826e59", + "e523b181cb1aa4d3fcb1f424b609de93bd0a6388cf17a24dcfb76fccc60ecd0c", + "a11e5210eceef1a5dca92d15f08f106061799de1880a84ddd739ad7c162b7023", + "ed61b91c7439b7364820abaffb094bedeb859de42100ceb7a72b098a050fadb6", + "f089c202de5553fc4246fa0d6be72cf54506d7608a153e55806ca1dddfc42764", + "28c3e63756f72b27ae32d07b280bcf1edc13df039361617cb0f29eb17e8559ed", + "a9a1b2b3157d78e642e4b8f534bd1a97a9039ecde41baa1ab0953d7ca527b7d1", + "eece909a9ffaf785c96a29fd2f027048e767d03ca30acfa9813dd99ee3882608", + "fb56466712c8584cb48a5936da28c71773212b9fd2af4c378ccdd498aeefc789", + "4adaa4526cc5f25fd2be1874103da8ce75506d9c05cfadfef3aa684dc9ebc5bc", + "5db5c19d1836da8d44dfcf6a32a9884a39d9b24c1745b7ad07ee90edd165e7ba", + "a85d0a2d898ef48ca6ab120a86c6f58b11091b7f7c4f6faa931d0594db4ea695", + "3514809d3cd2cfc96f5c79e9d08533a7a7238d7ea29d07b6a66be8cdbb3b159c", + "3987a7cff18d70cfa10342c4bc714cd540d5eadcf553af4a93a431209ae0f4f2", + "288bc3cb0fdec441494ca970901cb84e807f522743eb9e53fb7a6b171b1f00df", + "356de5250f43bb8a97a079912fb6be18df2f50e928bff2c37121c01ebcf88c9d", + "dbd2daea97a3a335afc5a2c7207ca176cf01ba40caff06a823e646736d71f2a5", + "6be37d83809273e581a2b373a1778471e33599b695fdf3b7791f65030ef1b38a", + "c7c339fd0998e022c606b02b421031d25a319682b3fd7ff41a48d630b1b8bc9c", + "eeee90adecccafff27ec24f264399190afef7e4b78e6f2f92f0c2c7c47aabe3e", + "79cf1aed207b3603b197630c9d282a8b36de4a92ddb96c1d3ca61efa1c4b7021", + "5553b7a0fcb823ec9e5252c194fe5d8df716cef98bada8a50819f89989a00931", + "a7c060926f5b3219a7b7e131ab6547bd64809cf75b24053952a87e324addc8ac", + "e7649498c748a4cd00221ae6f729e16e29e4fd27d9c28d5ed95bcc6f00377872", + "998a4ead843602e37a210823c221b9755a7a21a7d5283e5db54bac51df16c3ac", + "3fbce6ff59cbb982e3df5ce2917274ca87828f811083eab4b41534d34472dec7", + "b9b417bd9a55634ca616edc371c9e8c09cb0611626b84ce3acfeeb32a1f2627f", + "c303c7dc74f66c512cc2d165ef89d57cee257359b3ee0e00edb3737348f88068", + "07aa9856735c0110c2f8190d3be1aab49f6c6edf4bf231c94428b5ca7509b91d", + "cd59eb7e808f543925e6ab47f794f0bcfc9d91fcb7758b7fa1df3abfbc3c3e9b", + "c549035e1d22855eb6c2bf371b2ac5846e0bef1d0f4700a5192ddc88de27a97a", + "0ac1249b989f412d714daf732137498f9b4bed4d790aae420e9b9b5b6022d6fc", + "83f5604c6f2c8fe5bfbd274f51ba754610b565fa93dd558771787728d1e17d19", + "b106d7fdeab23c1886978f7de80ef1ee2395177cbf26fa5940173369fa42b2dc", + "44a95badbd41ec197043f6907b32d759d935c3fe68af3d5080672cfcfad11d98", + "79843495d689579abe43332a2d0c265abe42dbe8fa94f822d2e6702af0e0a0a9", + "80ea7ea2beefedf6abf2c085a9c2f89ff9ae0da7f42bc1d1478ff641d449181a", + "67657bb03abea359ffc6166e12589162ecb30a5c37a0886e14b20d481652bdae", + "e2095adc5a1dfbf89b28dea1b3cf2d726984fa5343943513dba7b66c347321d6", + "24fa9fa1f60cda5b002b453c79600c458bc513f4f7ea31f2ee40af9a5b0c5533", + "3eeecf1563fc3cee96fc92dac5eba03fc95a7de585f402ef1c6125988393f8d4", + "e64d7d4bf18f87ac4c638b821bab5615fcfca45cfa2470d3e12693b5413618d8", + "2828ce70f254c1f8e18d92c4f28206fd9f2b42f3be1d67405df64d96324939b9", + "f2b24eed42be177653d2f95ec1885d78f3ef1ce32a0088bc4fa2671976156e4c", + "0946f3d99392b7161cd29c0e84acbabbcd7f5f9d58d3288b21151f8170239cf1", + "31290c1047285ab1a97728ad4e51896f890c18452a4fef561023b1aa58d8d197", + "82e79c4ef466cad39b3e08d4b3d05cfba17ea58a5ad4c2d2e0539114bcba88f1", + "8c35a97de4a9831eb2415be5a9883e3477cdf1cd19ed6a24984fa1b45d7e9f90", + "99d0d7783bcb87cd7e976fa6fdc28fd58dd688b087142d9767e432c1f298a261", + "5218233bba9cbc0527e131a3d9d5ea290821ddf58eb8c9b52918f5654804a0a5", + "f4fe4e1a4c22ad8d9725c8cf04b0b509a0ada3458da3ff3c12cbaa389cf8638f", + "ce133d2fa135f4f102b368cfd5ce02078dec518c9b170f4dbcc3ae823b16680f", + "8276e57b19b15fa200e0bf2cc3f221793a14e41b5a8eb3d5155be747747565f1", + "e08977c0b9b3b6d1c9f0dd33e075e9565b1ea67fdfb968a297d643ea56ede5a4", + "34df12dc797251aedb4196d1ed2a67e5febee79f89b35c503ceefabbfba43544", + "336454288c2a05f22211a3e7522624ba70fc3ad381ad43aa227185077be4806c", + "51975d2024c1eeae7d2b44a12a1af2891d234dcee2d0ff500ae03d341b57880b", + "02bba57b27d557180e9edf91a09950cd2340e8fb44a5cb787c5d0f3011a542f3", + "908420fed38c9785eebccf1204e07e3f9d4434ab299342ba489daec0cbf686d7", + "d187e9b16d142e22522ec7098c3412b61fecdf98f1cca554ab4c1a1d2ab489e1", + "7249f156f19b30541f6c816b5387a26cb803a63b41930f08ba3f0107e31208f6", + "497faeb327567a9af6056ec1a7fdbc8154dff2ebb9896df855a5090eaba2a03d", + "eb51ce48cf06179e1ad3135f8e3c8e6c21d3b856690b8a34f063bd348bcc77f7", + "17e156c54f3efa435e8a2fe19b9b6700dee338090a97599f23810aaf0db00d2a", + "f230f52bb22cc4af6373065cb15fc91ca1f6c74eaac3ccc6c1b88553aed581b2", + "bf2c9b5a78e3b1ef95c0fcb8efd85d6f3a3cb594f03b7917ac192023d0c7da30", + "ed438001c7fbd49ea89d1b6116e8ce8da19810631cb045d7093d2ef43ba8a486", + "f99e2575f6d7532e0dd296d126768942e5820a99428023959cd1505e239224fe", + "7147f6dd56c363a1f32cfe475c0a612b65d359154b93866fe516880537990f4e", + "0af258f3304e644b31abfd08b6fcc21159a7729712ed8d2e0856d368f54a4269", + "77608ddabf1f39cec2b3f9cb4cc4d36fd1b04f00a5765c779ee342e4d3c6e5ae", + "e74c05c43ecfb8e7182a334823ee134da43e2e1ab4f92e9c6f3e5e813f30e6d3", + "2b952ea819ab78b34136e4d3d698ca41a58d00e558675cffed4206a93a5f5ef9", + "8e82ae850e62ed480e4a55512dedbd065fb553a419214c87790420d8d2e1b3c8", + "8c560c3b6047002cef9654937b2c8e98fbf741b36e423bce5ff1ede18c7b43d2", + "99a9daa989002fed2ad6819b3c95fe0b04fd9ae0164eafe6f84c7dde3dac66d5", + "a599224017b1f90d4d94180a2cb782f95ca75b65b946522b52c035b13a5d518a", + "692186550a90b67eb0d057f95ca2e194c32222737a44e7ff64b840f7ef2f9ec6", + "3a1532b43af74c7ff2deceee0aea597d63b058fa9af5f491206886060adbbdd9", + "3b744e52f07254f53b70e85389e484c570eb476bea247e1e706ca3b357ccb113", + "7f9d11ef6cb1d0d78aa151aa4c0c6faf8a0cd7543751a4c6da40d9d6dd0e9e89", + "fd82c6589a3df264abce32d31578d46551d1c067c6b9316e47c041c303fa24ec", + "94943dd079fb25b56c6d28c00d3d87ba207ff957ea3328c05e53f95eeac4f16c", + "7519a0ea3b65c23d88d30f5cd84a552259e99ae2322a3cfba3314e9987583bb1", + "be599f62b04f2f77d5c844590b7ca1efd8677fc483f4455e7de901d315d56b5b", + "3bc6500d77b4b5e2882e810610ceac4280e87e6171baf242c890b157b1c3020d", + "3251411ad79102964f144282c1a71fa4e953f6afc8897c9622e14746e9c1a476", + "a79e5d72f0ae70cf43d6988742fe75abd45356ae8d42f2c93c933b0608b9ae70", + "c0eb798ad1cccd38bc8bcca1b1d9a03c394f11e513ac77afc16759ad688b847c", + "9dd585798374b2fd53f2ce173399cdd80c482cb432ac78d7b000aaa6e941ef42", + "7de291dacd196f97b4a031cd553082061cf16cb9b4c8544cfbb16cae7bdfb5d9", + "a923a968585828bf9e2d8874e7eb2165968cb4fcd309e383482e5f6c74bdb45c", + "f856c43a55434ed1727ffac57906f44d6ce73c0896a8f28b961dc0a75fa9b394", + "9e00caae373307a3070eafa659bcd614333dc56a834e81e042523f0419decc67", + "b7c1be14d0824b183ec39184a5b7eda29383796b3dea8d38daccfdfc6ae311c6", + "99640304779e8b265f8d8ae495d5bcd4f82927b623cc57cbb347a5c5c27b682d", + "43a8149510152a2967f5d2b16064312d4cb488d1b6866d5258e877b22e2a1f40", + "c0d28c084fc8188e512995263431561e8c1eb4b7842f1ea11a3cb8485151195e", + "3eba131992984494ba739e8dbecfda6c2fdbec127b094dd43d583a7fbaf6378c", + "8932c9acdec6135447870fd3c0ce74f1345f72dbc38942a42bf418045964b34c", + "e35943cb6de6851111b62d722456f589c2619531adf8268e5332da1afe544282", + "4a310270a3ceb81cc8af14e6d6c9e617d66d361e7d8960558f5cae2a061331b4", + "0d4306cf7404111bf247576a15fe0a66cef0417c47d1fd9e576c09650961c2f2", + "1e846b2677d149da1c012b055fe001c279535acdb83dfba6253b21b625d559ec", + "6dd565d87f2a6fd6c4944f38e9a240696454df79f5ea58e9887676fd74cea688", + "f07f97b58b5d4224b0c11e8ee2f3f9314209958c5da578e7db949b0f6542738e", + "14f5c29aae9fc1d709962dea0fee3070e0ac8eaede64d940d2f43a584a23cf5a", + "00268073af8e1f2f82d742be9d13076ca08173f6bcec3d89c96de3d7823a2f03", + "ef583223b4d2bd42387968c349d928a6f329f6f79912261730b52f90f7960bcc", + "23aea669fd0edf1439db8c121847775336b40340d5743d7ce73e3be8fe184a26", + "fbabfb448b25bfb43fb9df1091127e6c15ea3b6662eb714eaf0a167aa67415a8", + "0ebfc4c6fe4ea2b7700ae9132509253166bb215b8800e86a7633295b140c8ac7", + "778dae382d063c92dda40744b1af2063d0ab77ef46bbeebd5ab57686bb87c959", + "982800d89a84ecfc5a01b8d9a96b69448433a920d4713313f59726174f36a8d7", + "9e9dbdfb7f6198dd07e75ed2665130a941baf1b73601f777cafdfbfa59ee176c", + "e3090a666d5af8611fd8ddc7dd9f0290a5e0d0e40f440c1ed6713d41645465e5", + "b5a78ab61b943ebcdb1dc4e0533b68e0310c9bb37ed23f1c4773409c392f214a", + "bb73f7729212748081ac45731c15630ecd89652ad3b2a563de5aa6795ac0494f", + "a12a2ce969ee1d6261eb7be74cbeafdafcc867767e76b3f9433272681cae3939", + "9e9852c0087dcd88f1fac2383e884894611ec3fd19760316da106ab7b4594f17", + "6182ece2e1b252d838e81d52b2000aab1eef0c8b3efc51df77167929dc495a57", + "ae59c591c044e6f24c54662ae1b64b1e75e20510d2229f6b68bbd4547cf13326", + "4ebb82be6043b5122a86cb6b51434fc23082d2197b5eaff824b52e0295e54d80", + "33f559a179624c63ffe1b3739a5fd5825e117a1fd59003a168f9f892d1de3aa0", + "aac18754690516f5ce0e6c8a8974b0f9db560c6abcd943a09bcf3f3818e4a1ba", + "f73ecb180fe4f4107c6c8f4f3f81bdffa3909db577450ad8a10b7e61029b3e11", + "0fd732521ede730dc8bfb58ec1313f370a5887ec67f395dc048e132681a4cb07", + "bdcc038ebf3c3176dcbbd8b6b7bd8c7737ae279caba99e81f569dbeb29857a42", + "46e287c04d6662f4612f8ba3f88e9a129088b21ad83e8847401f9edfe4ab18ba", + "8d70e5307862c2c60c221a3acd586c9169ae54dbe1f2a108328cf84946007fab", + "8e0de399cb79028aceaa634392b64705cf97864e37f8e488effb2fc6f4a46531", + "57c5e60a4f2b3e82d95f9e78bf70d6a3c27d98873a10aa9eab7e2f279af22a38", + "b5f1729e763fb6f4dbf168fe0d20d03e1c39a9378a045891f0764bb800d6d32c", + "6dddabd46c2167fd89f0bb942a4e1405828b400bb3763a542013dadb3f7307ef", + "54fe8d2f742a0b59a33281aa38a2f1803acf36d538702d693f14099654c94551", + "30a2b9320396248bc3ca27e6976a06336f6ed55be72a2fec222ca8925b36ddee", + "2c13bb82bd5236bd32b087a3bfe291fc4829d0f09f2e701113859abd3ea1cc8c", + "67d852403b6ee6b8146c6a52c33d5585a0377fbb240e841fd30f3fe73f5bd165", + "4a863fa1f3602e380ced5b710b0c77c9f69fc7eda0f137c3b48732758c2e1386", + "30e84049ab91ea6716204a27139fcbc57fceea8ecab28e04bbf690e24f558bbd", + "9aa2e2dd7a770399718421f20fe27b2dc9923e9f6b57d1fa5add3617d24bfeab", + "1e31d7c86bf694f8856cb1c869c665baa452d445c9305bf4a709c37fd2665e82", + "61af97100797147e99daee9fd3b867847970b8fd7d95ef1d3bdfc1c7fa8bc949", + "ac049081dcde776e22911e892e05d1069b7795b7bd332cd88f208fbb72960886", + "8683457c0e857617c0ec755f448d306a2fdc1144de8698f1e33c1dda9d8bb964", + "3dff8d5494fa343f49be420f8d4876446a114ddd3475959c6ac26c51b9b01906", + "c41e7a4e855d7df1ea78e713dc1aa6218de3077a42db5662d80db125011d8620", + "baf74f03d301c85890748a90b06addc4bf4d5d008ec0fde0ae07b9bb8f9dd4a1", + "4185ae388931e194b63dc8ef22e51d4f449b759156a1453a387b6dd40447c00c", + "982021842949f144b1317d0b4961a0f2b40e181fa225a4ad87649f4144d2c880", + "b56c39853ee20c6223032e08507e8eb8cb690441e863bb69f6768afd660052b1", + "1a0f05b6165cfa23f19627024f0b37ca549edc203505b41dde07a9b88bbd7535", + "430cfc29ce4b35ad3b8835b12c688d60bd2bc7df1200074b3c539b7da5eb585e", + "774371f57e9ae885e19294de121a520c3001229e106fc596f2940e3ea1ff0ef3", + "47bc2e2bb4a810348ef348e26ac813d6d5a54baa3433f2abd1612b717d3da015", + "4b72a447be4322ba818576dab8a3ba31a9cefc20421770388fd4829ee934f028", + "6fc3d154fe6e2c509113a13f9e969f20499972b826cd15ac33dc1eb6baf7bfd2", + "2d48e4d127a962377c01058c26c61cd87b5345b6f2818463b5e41c711000caf2", + "a2282c6f0cb806627a207ee1d912c66333f9bc33e92127a278c720a4b0a0ad9e", + "9bce3752dc7a13fad93acc8ac931e764ce6c6909ad22bb087ef0b66beb0bb732", + "705436abdbcaa17582fabd4a86d4d2c2dbab89a07b2ec813b2d71a3e21ecfd27", + "3dbfd8fc113f4ac6524f55266cfa9970118bba6c468c15f4e1afde5041fb2fe4", + "7a6558e365bb9b1532cea9883c5560be5d1df01c4ee21f39ef26e85347a07c76", + "cd7bd7b7115b9973f0560584422296992dd5dee7016d5c3e49c88d9635ee4547", + "a48c74a64066aa0013d5cb76ba25ca73bb4f9ad2017214d566cccd71d2ad8f49", + "5a703dd802e7b0cd8660dcd1cdb4cbeca7ddce66ee89648538f1cec7f0e4ae16", + "c2dab8adf040a2fbcbad196d50b2357fb35432f9a4fe09377adc0ef71e0b9f7d", + "02dc0a4d4b25d732c7455547a555067181924632f99b5693397dc636b28423bf", + "6cfc763f0b00b2d469529582b38b6b9608e9406f0b6fb2e2aa2de4197eb16c5a", + "8828a15c1d52c1e3967fd652db870c8cc1a6aad787418c307f415611da3fcf0e", + "7f53dc6e2fdc3a61e5e296e75c2697da21f8f92bc346388f6a17c25ef7686ed6", + "becbaba75af9ace5c4899513cdbb1eca3b016c4c2968154eb0ec3bc5facf6e71", + "3f7859a6b06d096d20bc644889a226eaa5d747d860b9fa0d0cded49bdcbf8fe0", + "cd9250c8c2eb6c28ca2aaabf41d91b18f75edad3e9df82aad70272702fe2feae", + "d56bfb137e6d4150095d242cd0e63fc6cde099a3e670ce9a5d8f2e6ffba77a07", + "b3bd7ec83a8057aa609bb485c4e247e67e4cb923d4764765862db65b6af15307", + "1942bdf5f85eef33c1c64ad92469bf78bf7fac628a22feaf193d86adc62e8b93", + "cd313479b8467c29655be09d63d4c1208fbbd6607a19c9a13f6bf094d28812a4", + "0d31559805703d361e04e48283e62ed21dacebf8104fa7ccbcb5e59d468f70e1", + "ac1e224a387d2d9a6d6ef7c19451af3efa599753b9fe44b4e737b6d2e37fb551", + "9116da1e18ba243f3ed29a76197fa8e2d957d6f11169cc1275709e6cdc4a8756", + "b1ef2f49b0b26ec4ce558f5dec98416cf8bcabb9a8702784f3cdf00a5d676587", + "797aaaa86ab5d64bcc4e34d92eff8f63551e579b8fd66b7f01b662d218740e5f", + "c4e31b52cc3bc49bcaf2c632b9597c8e4f5f066b2bc8692ded5663c756b48387", + "2e4b5491eb23250e5e855acb6417b59da3da9ccdc1217e34cd04ca40030eb464", + "900c4d49c267c2d251768442f29fbc1c2aaef0cdf8f8855a9b68be9d7367f046", + "5f940e3736a9ca25f61c16230165594983a5bb1426789aafa2e24f7b7a127f3c", + "a372e58ff796ed4bc28a27aa04393b17060f97b9fea62272446ef389d534e727", + "799eeb62f4e6d0b192a6b8811913b6781043093853f4ad3dfd80ad40dc13cdf6", + "c5da9d51154df4a5904bb2b582bdbd1111cf720e6f03ef5f97f95423df58e147", + "92b302bc860da5db46234ee558fb1aff62ca70bc2b18f142eb5200131e14bc8a", + "aebf6338cb63544de46b9f45311918232722ca625bee66278ecd2f180b0be5ae", + "9a907c10d6033bc91fb1847766307267b8d029379b9859d9c80c209a7cf082a0", + "de28f5c0d46ad54b57c465d8a9e416b849bfd41472ee7d250a360e4d439b3251", + "f651d87f4cbd99f72a7459cf77d8425031627de145041a1689955adcacc88b60", + "4f8641f49563c14b43285257c71df4c60621a5320b8a0bb575bcdb85c1bc131b", + "0810ddc592b81998e465024698f3898c104ed8d13e9f675497c824a81111a28f", + "49050203987cc982c7ebb2620de5fde348a751e00c05ed358fc6b91ce0067baf", + "37694a5c185d87fab218d8b37c39c094fbe00098e3da83d1986a8e12123b8f72", + "9e6aa46a83ce984bf5fcf16fcc535335e3757c8f06774fa467b1c024140c30af", + "0b259dcf3bbd58a9a1369259cef787ea352a1c0ede4fbef2b7d1c785e9f44a02", + "74dfb52467dc994e6007d2e57900630f2d0e8e4ecc57c9097bf0c0cbd908575f", + "94d44a100ca284444dfb0106efcaf04107908975f2b301aa9bb3dd0b437380c6", + "47b11267b2c7be15ee78e744f2dd90ffd5e7a3c21bd3cf8a52df0e553ccdf9a8", + "8f15cdf786ed0c6df1489e8cd28031d1a3fae8f006ac30602ca9a0ec5725d410", + "110a9949642519b08293304865bf19a95f9590db6db8c0d677491715d7decefd", + "918e80b22117f5e587840cd3f6da607312a8792c4e8194f1a191bcd2f550b16b", + "85f9ac70add31496aa4b4bcc4443bc8c15d377e90af375fffc001b4380a2309c", + "5e57b6a99301201ea691dbfacfd7105c940c0374eabd14150ef09875cf5e5468", + "712093cbd1ad05d632da00dad2306d7aa09e48fe651021ecaf13c1e0122d3609", + "93758b69bbc55048f3f64ab02ba05b748a2301ba8fdabda5ad31c5132f3b17f7", + "6fa9a1fd4ec39f4691555ba3064cac5afaa9ee90604bc9c24b6b4c452b5dbd66", + "d062b6b04643123071223138c91a28e50e89ffd48f676c187a647c9ca2637c07", + "53e011f498d01672e4f15ac8c41e44f7aac84c7eb55f37e6d98e50e072133236", + "a29db89a18a11505801ca8146b38e596cda6a53ceb57e6bf05014f62b03a708b", + "0673a9faf5ab50c4c0d16d3d1c9493fd1c6972790f9da84c24b4316bac674d7d", + "fddae5c3c65653c5058ed34da5645b3889bf54bba81c7ab5acbe4d534eb7297a", + "3a87acd3df6a48b023f261a8b316e6b51ccab88bbc5f05ea2aa686e53eb75926", + "a640148dcb71dd66cae73f98727b204e6f8f7ac43132858c81313aa8e2162700", + "d06710316f1ae7ce8234e6ab9800c5a2eb9a62d758090eea1744e7bc7b0d5a07", + "4002aba5e583c3ca558def1aebcc2d01967cc32703fd28f27b79c35275c17e82", + "e33205319a12141ce884fa1802fb5d14806fa02993b6cab412563104ba2875f6", + "984036f284a988ba0b19eec68e485b8f86a592725c9bfa3d2c887f076d4dc669", + "5a6df37a1c8b1056d84940dd1c6352d93483dbfc0960d33ee23a58ccc9f50ed1", + "92b59222427a0caf431ada26da149218d7ed2fea050b11df2cb0a118dda11087", + "5ddf4869c2578c1ccfa3a17c4f728ac6cd9d8bb5b19def13335a8fffb3947e2a", + "3cffff6af9917186588a5291bd997f900ebbd997205a8597ed86b32c313d15f9", + "26212b92d9e7073dbfaf31e501d603f2a4a0a72e6d51eeba003f6c4769e199b9", + "8b9a2208d6e17986f28ce6df7e3f1d2e15cf25225b7852dadbf6771ee21a391d", + "b9ba75b8bc86ae75dff2b9cba3521f9158596bfc4471813688f5a2a471a94a7e", + "51431dbfbde822ef6ccde33a7d7988f34e5042a1ba0cca9b9ba6eb86e797b67e", + "19b8b5c3dc7427d3b4fbe20fc117fe2ffa0ea2101f60701cda8fe4de0b0af495", + "3ed134a30673821c38cced4cc3affec64de7ac890ef88c0f98fb72e59ebe7cdc", + "27bfdd5fd4cab4cccfdf4a2af342958f40d1f82f792896b461b35fc968b3dfd6", + "d4395b2c014b8d988cbe25ad50d02ab03a8fa47875d3ea28a4e37bdf48965530", + "0092d15bfd929deaa455dfe5be976707cbcc761eea63ce216b2457e0d70ad1ad", + "5b6934565705b73e362e79108a153375a6b43fb706b2480ceb0bd75673e8817f", + "122618aa4adf9ec938c48da1c586e059d2847d3d249df5fe613921d6cf4d1117", + "34106ad21d6c03450bd922cb2cd82f8087f4e0e78cc33b678552f96da0ccab6a", + "a46b6cb6e14305fcd0bc642e0930bdaef7c04b6bf3014e138b153ef24a9b3213", + "f71d42a86c0f3a9edd76158f1a1d0ae4a7f34ad836e5521ffd287cc00bfa430f", + "08541a74d5a6d7bcdcdfb04f932b35592ae31e860dea533ae75388ee4973e7d5", + "fe396de692968efa4617b7401edfaf4f75ba296e3321017adf3ccc9ac811b9a2", + "ad94d80fd601ba309e56b6195099794360f8091c8e77db843c113141aaaa9592", + "708744f24ca16598075fbf661c64ec10e735bd3154193fd3a8064d415ed2be20", + "cd7f5f414e2bbe5e05092d727505a2baea0058c9ed4d98f1bc69f60224d7683f", + "fa1045fcedf7041863cf6a2f3ff8dead976c01f3968e9fc0ab94dc14cc392377", + "3d88497ed93e4989b734e47a0a1e285901577ca3f0ab5c54d322dca6818f8dfc", + "ae739e369f8a632b8ef1cf4d98effc0a9154b091f23797f4f8624f34551752dc", + "d40cc8fb2938db8a0351c79d41fae7d3c7d8668a0c32ed4cd956c4cdc770b93f", + "b93950b8f2eccb0a713d3e96e4c9218d1993b9af8a7e8621dbebce519e6b6ad6", + "4f54da34c556e2a0e36d2fd0afed57b391998ccf54517bf6701c64167d3ab6b8", + "97beb30f09514b58013365ef00196667c79a82cf188f8f2417b2d06bbb610b0e", + "e37a52762caddcca8b095f782bbeff5fa20e04b123fd0f9658753b7e2a9943e6", + "9f171cc54a54340c757c468cf608af52a5e56e6a7da6813675520d32fa0272b6", + "777b198faf560d71bf276e7e98acf63d2ee0556b7ab8edf7c8547fb2c4d66e50", + "73cfc9e8632891d77c12e184f27478c19c3c49e78b92caf0bb07596277fca003", + "086ce6966f0ee6f8baaf00d5e3ef95314cca0a717f6596d4462b770d381d1427", + "4a43d62b2764e121390416a339232e6281dfc51b5b4a33c08fcf55f114e0f17e", + "d665b4bfe9fdbd04fc1bccefa1c56cd7634664277a1117e936e78ca5595462b6", + "6c7c0f93dab33466e3ba8b88a7e040081c1ca6d0804c715c2fcc225774bc8e89", + "41c740f4009bae19d4903f2b8a0ac687a9d13079c86ff3d9d532ed5f57f58987", + "535a8f16b8ede6a96cfb53799f1cc99add60b3fa8fcdd90cdf75df6132f6f637", + "0da3a7ac204385a5aa5128ad7d1060e25f13914fd0ffd243de1badd36d2f8dc5", + "ccfc0881c0d34e67d405ce8fbe9b9cd6b52e901312c3018e5b86f55bbc7ecc2e", + "2ad0c7bfcfc937c40ce40587aa420081dfac80c415bbd77f000a2bff22332bd0", + "6327f17b88e3ca7a0d76b2a2b149174159636cbee049ef8fd74ee838c586e12b", + "af47446bea26a8475dc65e1b4e311277a64df12f83ff48a7ad18eecc3e3766fb", + "5d9a44a90439991093e7303a776c495d318b5012cff8217c8623b4b3d44d9cd8", + "440f7e994a260ca4293745a431276c9c87e9cfccec2e7bd8e3d1492fc56a3e8e", + "0186122f88baad1fc4294795dca301240a6ef4d34999e59387e095a2ffbda869", + "411cd7fd695dd595e671afece2bfaadd9e34477fa66858c9643276e81dd16598", + "0b3d09cd01d2bbe2a24398c812eafcfff85e15a9debbab1f7af88eaf618ba2e5", + "3ebb9d27bd068459f386ea4966709b963cd38c828ae35ca4c0085f86dc9ba941", + "6df6a782e21c1f51844b6a01d334a75cbc5557679eb0d3ed24d403da431d21b3", + "b7a5eb26ea3373ef1e5eff05f0acbe8e633cda2d22216d7a1476768437b52027", + "f090be97792dce7e57ac104229b40b10ad306e7f16faec89705997e43b4e0ec4", + "6226b38f52683080de6ea3b0d49a2be57e46d8b38df20e4eba377d89e7555b43", + "595605106e9cd66abb02eb4389a922f26f4981672a9c814074d5f85176c2ce52", + "9bed6bb275376acbd52c871423858452c76f1e098f6b4c3bb0f581c43b1b78af", + "5a5d91cc51f19b2d053f70e68ed7f7809caec0ccc135a368b88e739af7498d21", + "37d0445b8ef3357db5b68226f16270505af0ca8d926d85c66f28b4683bb9f3ca", + "99e5fb26ba2d82674a216b1de505f0d137f3bff7094d70869afe75f1d305c9ac", + "88bc0a7fca01ab1e96b2dabd211605a6212bb5d45f59d7afa3eed9f7bc8cee2d", + "10871ee43797f3ecb4848dc419147c536466edbaca83bfff9c09ef47d2152eeb", + "86fa8cf2806d39a4bcf2a94ccf104d2b54fd72baab034fdbd6fbe7e0ea0dfb37", + "ea7ca070c12582f44c4b083d94aa3fc050bcbe5ce45f4b0d8f47437d223b8d38", + "c4861ea926ca6b8d17c35052c5dd11383583ea686ba3355910364dc6e1e771a6", + "0221bbe4da98b60cd39c2d4787893d5bf1f70e303e7d7fe6fd9dde6528541ddb", + "22a2206974c27030f99f35f259c44ffa64ef11b8e6330a3fcd1a68a8f686ffcd", + "089fe5d906bbf100a911891eac4dea621bf33d0ca79e63856918c0f14598fd48", + "be38f160ef5db2bc51789e67907f5b7955dbf6226b917507eedfd61d15e1b07a", + "ae727ffcd38a5c26ee1a1af45b9ac07a2c9b21550714b15edf909a6b5622ee78", + "4f6cc96186ec9524363c36dbf2caddc3a059d5210694fcd35f3ad3bf831290dc", + "8a0ad15c6a35e1b677adb1151d9b6df49b11fd2f7921b331b5135844ce8a2e5a", + "e4a7addaf81a40e00d9fb3967188ffeffdec0d7b61778dbc12f7f342fca79e5d", + "564acc06212018c0ee33d6109bd062433161a501d0e4a3eee423dafafb21a33f", + "f6332c5c8debbe2e49a1e431b1cfed8b0790943eecc9c3708a2f52204bc997c1", + "b06cfd8e8e17b9afa585ea76f5647b4d54b64f4ad1b41780075f4982daaa68bd", + "1f596a1cee4760ab7b507b18e4f7418e6230de72b9d619cc8f6ac0df5ffa88f4", + "2738eb6f6f0a436e43f04b3fedda30cea5c3b8e36eb94fd3a73b7841ea6e3a6a", + "b84fa9e606a6fd6ee381e2831f1b80a14a1626032fdc3678b121954c5d0ce98a", + "4c4acf3cefd0b466d418d3b7f58f9b41681f803a81878e6fad8409f430e8bf04", + "6fdceb9e02428d9175acbe04590b693a5c644eb8cae672f4c4d06d145ea8ab1a", + "823486c19fd887d93dc2d1478edf5773ba381f13f0ae6f287c1038e7c81aef1c", + "036bf6944a47791471e9a2cb86615de837f3aa234a7d1cd024026b3e1daee79e" + ], + header : { + hash: "00000000000000018eaf634bf13b7e5e50860b99466b91140538223c75b75049", + prevHash : "000000000000000124f6ce137a43bb288d63cc84f9847033cb84595ead05f9de", + merkleRoot : "792f40129c95aec653d2838ef4b031bf541f11c764ca6c3ecc2e20b396ce83cb", + time : 1389715824, + version : 2, + nonce : 322045839, + bits : 419587686, + } + }, + { // Mainnet FilteredBlock 399775 with filter: 6f64fd5aa9dd01f74c03656d376625cf80328d83d9afebe60cc68b8f0e245bd9 + "header": { + "hash": "0000000000000000011b04bc9f4f3856e299b53a335eb1c42be906237c860bb8", + "version": 4, + "prevHash": "0000000000000000015373947aa93c7cb16a308fb0a59644d4123072ad24ce5b", + "merkleRoot": "ac1841eb3b7d380ee114270e3b1c7df349f1e27e2f0f7891138199bc07e006f8", + "time": 1456274787, + "bits": 403093919, + "nonce": 736568686 + }, + "numTransactions": 3309, + "hashes": [ + "adaf1e41a5349a7e2b27e6f2b5fc1186d576d21b47531a410a654439f49bd5a9", + "0f64562b6d361757bfdc5926d28cafb7c45e4822b4ad5a14e65530d0c9d44cd2", + "c34dec8d5954d8c151c3a594a5a6d1f3a1ec8a1a6c470b27aea879b7757328fb", + "c044e5d998fe29cdbe88f87c97c3547f142f5b491cb909d9b0a8e9d3ab7fc984", + "51ecd2d2b02b0ca1a3b439eae3adf87ab37dd87f7be0c5b3437cd22350079101", + "684ebe37c6eaae2879249ff20b3769d5f2f7ad853a5363a4baee68c0c85777a5", + "e561fbeb0faff42f95f2dc8d57d432d4d1a9f84483597a0602e1edc3390f1e33", + "02c070afc743c885a6c8d94d15d6e9c3b991c636b4284258dd37686c8792fe44", + "6f64fd5aa9dd01f74c03656d376625cf80328d83d9afebe60cc68b8f0e245bd9", + "a296fef97b3da0825bac00c794ea234913421b7c1cbb8571978d8d5ba3b16de2", + "691c6855c5da434a06cb39a7e47d9337da0e39112ad975cc70cecc882233920a", + "6a9e7f8e6d1d8c326a774ff691bdf424252cee710f8e5d9da2c094e999c15efc", + "0723ffc695fef989e86784fa2b47097d55f6aac244631536d8d901f5cd9bf170" + ], + "flags": [171,86,23,0] + } + ] +}; diff --git a/packages/kauri-bitcore-lib/test/data/messages.json b/packages/kauri-bitcore-lib/test/data/messages.json new file mode 100644 index 0000000..cc1fa33 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/messages.json @@ -0,0 +1,22 @@ +{ + "VERSION": { + "message": "f9beb4d976657273696f6e000000000065000000fc970f17721101000100000000000000ba62885400000000010000000000000000000000000000000000ffffba8886dceab0010000000000000000000000000000000000ffff05095522208de7e1c1ef80a1cea70f2f5361746f7368693a302e392e312fa317050001", + "payload": "721101000100000000000000ba62885400000000010000000000000000000000000000000000ffffba8886dceab0010000000000000000000000000000000000ffff05095522208de7e1c1ef80a1cea70f2f5361746f7368693a302e392e312fa317050001" + }, + "VERACK": { + "message": "f9beb4d976657261636b000000000000000000005df6e0e2", + "payload": "" + }, + "INV": { + "message": "f9beb4d9696e76000000000000000000890200006e4f18431201000000f97347795bf7490ddeba98c129086f54e06633936a49a2a398defb49e5edbb00010000009cb17394db9280b2d5e7d9f01456358384e7453300d48138ca1590e8cd86632f010000000f810b6071b9808117c4b82619b4ae0a7994ed5a0f2c050e50fd5742c3b4e90901000000962798bce9cbfcee9a8c6b5df4cf8bed944eb31ec975e8c1be79b7ab010a1cb501000000baa905bcfc9d2641ecd759724f796a7614e91c7492507b418ba8e077a6e57054010000009a5ac6dae146392edf8b6e96c30951ed7752f9095fab61728207db0f135b18a30100000050e5f153e3f0d89ea432d9a26f088a89b3ca38dbf3f0247ddf15f80779915da801000000c255841510a284b88ba696ed9edfeb4cdb34966271c30bc3bce9fd881106850f0100000000e45af8455894f72cccc4053e1f5e6076a673982b1f4ca5b2abc7b6496823ab01000000c7e6dc049e5b0fdc0f8fac8934e84e9b2f0c3036c7c02638cc05ee2575d6be1701000000aef6435c03c99ee83702aaaf106dc853dee5bcb6025f3af67d1ec72202c437ad010000005369fc3dc81403fe52f766ef585245af908404be1b46e2ef67c93b748ef467e3010000002400f16a63c411ae5e336175afc26515e548c7267c0debdb6aa46830399ba35f01000000ceb4fa6a8ca2713baee2214422b73da47a20934c83d25017bd80053e65ef3091010000000d899968e591703ddd6fd6ce073837588209f8b3b245ecf1bf93e77b9806a6c501000000bddeb56581ad7882d8f2abc78e5a48b3de02d923cd1cfc7525d2dfe80470248a01000000f286188c0947b023f0ba5dd1ea596751d50f67fbe31e64ead39dd711d3585b5801000000e17ad100ebffd2d5a630d37fd2496b2f5ab6ae5c8812da3c642fb6b8dd37f5fd", + "payload": "1201000000f97347795bf7490ddeba98c129086f54e06633936a49a2a398defb49e5edbb00010000009cb17394db9280b2d5e7d9f01456358384e7453300d48138ca1590e8cd86632f010000000f810b6071b9808117c4b82619b4ae0a7994ed5a0f2c050e50fd5742c3b4e90901000000962798bce9cbfcee9a8c6b5df4cf8bed944eb31ec975e8c1be79b7ab010a1cb501000000baa905bcfc9d2641ecd759724f796a7614e91c7492507b418ba8e077a6e57054010000009a5ac6dae146392edf8b6e96c30951ed7752f9095fab61728207db0f135b18a30100000050e5f153e3f0d89ea432d9a26f088a89b3ca38dbf3f0247ddf15f80779915da801000000c255841510a284b88ba696ed9edfeb4cdb34966271c30bc3bce9fd881106850f0100000000e45af8455894f72cccc4053e1f5e6076a673982b1f4ca5b2abc7b6496823ab01000000c7e6dc049e5b0fdc0f8fac8934e84e9b2f0c3036c7c02638cc05ee2575d6be1701000000aef6435c03c99ee83702aaaf106dc853dee5bcb6025f3af67d1ec72202c437ad010000005369fc3dc81403fe52f766ef585245af908404be1b46e2ef67c93b748ef467e3010000002400f16a63c411ae5e336175afc26515e548c7267c0debdb6aa46830399ba35f01000000ceb4fa6a8ca2713baee2214422b73da47a20934c83d25017bd80053e65ef3091010000000d899968e591703ddd6fd6ce073837588209f8b3b245ecf1bf93e77b9806a6c501000000bddeb56581ad7882d8f2abc78e5a48b3de02d923cd1cfc7525d2dfe80470248a01000000f286188c0947b023f0ba5dd1ea596751d50f67fbe31e64ead39dd711d3585b5801000000e17ad100ebffd2d5a630d37fd2496b2f5ab6ae5c8812da3c642fb6b8dd37f5fd" + }, + "ADDR": { + "message": "f9beb4d9616464720000000000000000b93a0000480bab8afdf5016816fa53010000000000000000000000000000000000ffff51403eea208ddb2a8854010000000000000000000000000000000000ffff707c60d9208d31413a54010000000000000000000000000000000000ffff5ed5fd13208d182c8854010000000000000000000000000000000000ffff505f3f81208d65ecb853010000000000000000000000000000000000ffff54d72104208dcca94054010000000000000000000000000000000000ffff40bbe1f2208d73238854010000000000000000000000000000000000ffff55d683cd208d5d258854010000000000000000000000000000000000ffffd523a66d208dcbea87540100000000000000200100005ef579fd2c9d47be4b56d671208db3e58754010000000000000000000000000000000000ffffae373156208d11e58754810000000000000000000000000000000000ffff51071276208d38f48754010000000000000000000000000000000000ffff6d4372e0208d4f448854010000000000000000000000000000000000ffffc556cbea208deb208854010000000000000000000000000000000000ffff450eb059208d97336054010000000000000000000000000000000000ffff4d60444a208dad608754010000000000000000000000000000000000ffff01abd3c3208d2cbe8754010000000000000000000000000000000000ffff7963d8b8208d9dfa8754010000000000000000000000000000000000ffffcebe862c208da7f66554010000000000000000000000000000000000ffff62f2a82e208d430d8854010000000000000000000000000000000000ffff6deb6956208d08148854010000000000000000000000000000000000ffff4b9804ef208d950e8854010000000000000000000000000000000000ffff6b8dd2e1208d1cfc8754010000000000000000000000000000000000ffffb2fe1dab208de7458754010000000000000000000000000000000000ffff32cccb82208d12625654010000000000000000000000000000000000ffff55e6f35a208dd7908354010000000000000000000000000000000000ffff4c642e6f208d17398854010000000000000000000000000000000000ffff45ea14df208dc72d8854010000000000000000000000000000000000ffffdaa48b96208d57fb8654010000000000000000000000000000000000ffff5f0080a9208d4e9a6d54010000000000000000000000000000000000ffff6d94e741208d7a418854010000000000000000000000000000000000ffff6d43b0c1208d5c098854010000000000000000000000000000000000ffff9c11e7ea208d442d8854010000000000000000000000000000000000ffffd0424482208db142fb53010000000000000000000000000000000000ffff54344a4a208d70158854010000000000000000000000000000000000ffff538f8201208d39288854010000000000000000000000000000000000ffff57daab71208d262f8854010000000000000000000000000000000000ffff57e045b1208d91430654010000000000000000000000000000000000ffff4212def5208d7c468854010000000000000000000000000000000000ffff62a4f53b208d9c3e8854010000000000000000000000000000000000ffff5b736bcc208d4d074f54010000000000000000000000000000000000ffff43af9d9b208deaca8754010000000000000000000000000000000000ffff4a8084a0208d74f68754010000000000000000000000000000000000ffff46304541208d5d098854010000000000000000000000000000000000ffff6eabb626208d08228854010000000000000000000000000000000000ffff1f07b030208d959a8254010000000000000000000000000000000000ffff4fa996b3208d4bac8754010000000000000000000000000000000000ffff43a0605b208de4038854010000000000000000000000000000000000ffff4cb41a5b208ddc308854010000000000000000000000000000000000ffffb72e6072208deac86f54010000000000000000000000000000000000ffffd5b815e2208d1b118854010000000000000000000000000000000000ffff3ff8d0a4208db1258854010000000000000000000000000000000000ffff5edd3a6a208d20268754010000000000000000000000000000000000ffff59ed3cfc208d83ed8754010000000000000000000000000000000000ffff4460baea208d71278854010000000000000000000000000000000000ffff4583b547208da7968754010000000000000000000000000000000000ffffd1c34463208d9d428854010000000000000000000000000000000000ffff43c15bc5208d33448854010000000000000000000000000000000000ffff2e0d8a5c208dfa2e7154010000000000000000000000000000000000ffffceff2bca208d47288854010000000000000000000000000000000000ffff5b8d0190208d0e847954010000000000000000000000000000000000ffff5501b8c2208d552f8854010000000000000000000000000000000000ffff5cf3b604208d8c2e8854010000000000000000000000000000000000ffff58666b0d208dcbdd8754010000000000000000000000000000000000ffff59a85cf9208d04208854010000000000000000000000000000000000ffff5f60abe0208dba238854010000000000000000000000000000000000ffff2e77ce67208d62c68754010000000000000000000000000000000000ffffcbae5658208d41108854010000000000000000000000000000000000ffff49329ec8208ddf1d8854010000000000000000000000000000000000ffff603ada12208df90c8854010000000000000000000000000000000000ffff51e0c21c208d5dff8754010000000000000000000000000000000000ffff904ca539208de0118854010000000000000000000000000000000000ffff5c0cecf7208d1b2d88540100000000000000200100005ef579fb18f317b2aba4edfc208dfaa27f54010000000000000000000000000000000000ffff54c65a7c208dc2db8754010000000000000000000000000000000000ffffad0b7981208d88a58754010000000000000000000000000000000000ffff188a1995208de0d78754010000000000000000000000000000000000ffff62a7a6bd208d18f66b54010000000000000000000000000000000000ffffdb4fbe80208dfcf78754010000000000000000000000000000000000ffff67145102208d3d3a8854010000000000000000000000000000000000ffff64259bd6208dcaa98654010000000000000000000000000000000000ffff32c737e1208d3a6a5c54010000000000000000000000000000000000ffff6d793f75208d22d38754010000000000000000000000000000000000ffff0595cc0d208da9ea8754010000000000000000000000000000000000ffff62ca37d3208d440e8854010000000000000000000000000000000000ffff123e1c11208dab428854010000000000000000000000000000000000ffff461df51f208d0f0b8854010000000000000000000000000000000000ffff59d36752208d631f8854010000000000000000000000000000000000ffff5ef8c640208dbc1d8854010000000000000000000000000000000000ffff5f5dc582208d04bf8754010000000000000000000000000000000000ffff0e6797e3208db8028854010000000000000000000000000000000000ffff3cf0c4a1208d6a0c8854010000000000000000000000000000000000ffff58bb5c55208d4f438854010000000000000000000000000000000000ffff5d326005208df6068854010000000000000000000000000000000000ffff5d5a5850208d40eb8754010000000000000000000000000000000000ffff5751ed86208dbad18754010000000000000000000000000000000000ffff63e51608208d99108854010000000000000000000000000000000000ffff36e299cd208d9a1e88540100000000000000200100005ef579fd38a43785a5d441b7208d13258854010000000000000000000000000000000000ffffb90de279208db3778754010000000000000000000000000000000000ffff67fcc80c208d3d358854010000000000000000000000000000000000ffffd00c40fc208dfd0d8854010000000000000000000000000000000000ffff5e89c2f3208dd6428854010000000000000000000000000000000000ffff1863e14a208d89e78754010000000000000000000000000000000000ffff43a11d76208d89ce8754010000000000000000000000000000000000ffff3edb6281208d03298854010000000000000000000000000000000000ffff6d5b26dd208d16df6e54010000000000000000000000000000000000ffffd9c3d176208d7c028854010000000000000000000000000000000000ffffbcc2db1f208d67fc8754010000000000000000000000000000000000ffff59910667208d86b18754010000000000000000000000000000000000ffff6c1482b9208d790b8854010000000000000000000000000000000000ffff0263150d208d89c44554010000000000000000000000000000000000ffff72fcd6b8208d331c8854010000000000000000000000000000000000ffff4c7dcfa8208d9fe98754010000000000000000000000000000000000ffffad08fd05208d0ecd8754010000000000000000000000000000000000ffff7c0fec89208d4af98754010000000000000000000000000000000000ffff2ea6a167208d270b8854010000000000000000000000000000000000ffff59d40fca208d11cf4054010000000000000000000000000000000000ffffb52ac058208d63358254010000000000000000000000000000000000ffff6bd9a130208dbde48754010000000000000000000000000000000000ffff4f915dc7208dece78754010000000000000000000000000000000000ffff5f8423ef208dba308854010000000000000000000000000000000000ffff904cba8c208d953d8854010000000000000000000000000000000000ffff8d1421e5208d5f188854010000000000000000000000000000000000ffff4e1bbfb6208d36fc8754010000000000000000000000000000000000ffff3205cfb6208d5e458854010000000000000000000000000000000000ffff493092c2208dd0878754010000000000000000000000000000000000ffff97caacde208dd99d8754010000000000000000000000000000000000ffffc05f3c38208da7018854010000000000000000000000000000000000ffffdcf5f82d208df0f42254010000000000000000000000000000000000ffff58bf997f208d94228854010000000000000000000000000000000000ffffbc8ee72d208de3448854010000000000000000000000000000000000ffff6d780f99208d32448854010000000000000000000000000000000000ffffbc64c76e208d0b3d8854010000000000000000000000000000000000ffff6c414312208d49138854010000000000000000000000000000000000ffff407e52c6208d2d128854010000000000000000000000000000000000ffff6dc987d8208d4acf8754010000000000000000000000000000000000ffffae151a25208de9dd8754010000000000000000000000000000000000ffff522d2d10208d17df8754010000000000000000000000000000000000ffff4d294737208ddbd48754010000000000000000000000000000000000ffff443703fd208d79108854010000000000000000000000000000000000ffff4bb5a154208d1df28753010000000000000000000000000000000000ffff4c44fc51208d5d496a53010000000000000000000000000000000000ffff530924b0208d180b8854010000000000000000000000000000000000ffffc15fced3208d53128854010000000000000000000000000000000000ffff5bc5b9e4208de21f8854010000000000000000000000000000000000ffff2e05fe1f208d31ab6554010000000000000000000000000000000000ffffae865915208d09248854010000000000000000000000000000000000ffff7d71a4b0208d120b8854010000000000000000000000000000000000ffff93e40150208d25d98754010000000000000000000000000000000000ffffc19f7a86208d99e78754010000000000000000000000000000000000ffff4d675993208d2b218854010000000000000000000000000000000000ffff5144776c208d5a208854010000000000000000000000000000000000ffff2e1cce5820f69e8f8154010000000000000000000000000000000000ffff58718848208d9edd6554010000000000000000000000000000000000ffff2ea758c5208d28c98754010000000000000000000000000000000000ffffc60bd694208d181d8854010000000000000000000000000000000000ffffba6b689e208d77868754010000000000000000000000000000000000ffff182016aa208de1698054010000000000000000000000000000000000ffff5cf5daa9208d823d8854010000000000000000000000000000000000ffffbe4d61c8208d2c3b8854010000000000000000000000000000000000ffff71647df2208da2248854010000000000000000000000000000000000ffff4ff359ca208da2dd8754010000000000000000000000000000000000ffff59f1e52b208da6e60d54010000000000000000000000000000000000ffff579596231159ad218854010000000000000000000000000000000000ffff5895f42d208d5ba78754010000000000000000000000000000000000ffff458ae8b0208ddc9b8754010000000000000000000000000000000000ffff18b507a5208d20eb5754010000000000000000000000000000000000ffff5181a537208daf1d8854010000000000000000000000000000000000ffffd5f51eba208d07f58754010000000000000000000000000000000000ffff6dec54bc208d4b3b8854010000000000000000000000000000000000ffff5c3e1991208d13b54054010000000000000000000000000000000000ffffb273845a208d4f338854010000000000000000000000000000000000ffffcfac797b208d4d898754010000000000000000000000000000000000ffffadaf880d208de72f8854010000000000000000000000000000000000ffffd956ef58208dc1e98754010000000000000000000000000000000000ffff980711cf208dfd8f7154010000000000000000000000000000000000ffff50aba98f208d59fe8754010000000000000000000000000000000000ffff5f2ae582208d3ffa8754010000000000000000000000000000000000ffffbca836db208d389b0054010000000000000000000000000000000000ffffded10925208deb154354010000000000000000000000000000000000ffff717532da208dadde7654010000000000000000000000000000000000ffff93afd0e5208d40458854010000000000000000000000000000000000ffff54ee8cb0208d08fa8754010000000000000000000000000000000000ffff3658eba9208d0df58754010000000000000000000000000000000000ffff72c6876e208d5d408854010000000000000000000000000000000000ffffa7582d7c208de8338854010000000000000000000000000000000000ffffad40d7ad208d6c2a8854010000000000000000000000000000000000ffffbc1833a3208d0fc28754010000000000000000000000000000000000ffffcbceb676208d98448854010000000000000000000000000000000000ffff0121ce6e208d77b58754010000000000000000000000000000000000ffff4b40d938208d853b8854010000000000000000000000000000000000ffff5648d643208d1c9c7854010000000000000000000000000000000000ffff6c3230db208d4e028754010000000000000000000000000000000000ffffd8e33c5d208daf738754010000000000000000000000000000000000ffffad4e9d56208dca438854010000000000000000000000000000000000ffff4f8a0353208d7b408854010000000000000000000000000000000000ffff0599e92a208dc62f8854010000000000000000000000000000000000ffff46236049208dc4d58754010000000000000000000000000000000000ffff4400384d208d0ddb4c54010000000000000000000000000000000000ffff71653b5a208d53388854010000000000000000000000000000000000ffff43bddf66208d7c388854010000000000000000000000000000000000ffff47edca96208d8c068854010000000000000000000000000000000000ffffdded3c2c208d89f60554010000000000000000000000000000000000ffff4e60d8d6208da5ff1154010000000000000000000000000000000000ffff55983c68208d72f58754010000000000000000000000000000000000ffffce47f56a208d7e2d8854010000000000000000000000000000000000ffff17e25c12208da7ca8754010000000000000000000000000000000000ffff051d0baa208d19af8754010000000000000000000000000000000000ffffad42d883208dffd68754010000000000000000000000000000000000ffff5418ff88208d87bf8754010000000000000000000000000000000000ffff4c1fe0dc208deef18754010000000000000000000000000000000000ffff4c71d406208d25868754010000000000000000000000000000000000ffffda67a475208d4d348854010000000000000000000000000000000000ffff5d561269208da5918754010000000000000000000000000000000000ffff42b163b3208dbfac3754010000000000000000000000000000000000ffffad4e01eb208d5c408854010000000000000000000000000000000000ffffcc0bb91e208d4a928754010000000000000000000000000000000000ffff531dba30208db9fd8754010000000000000000000000000000000000ffffa3f72b33208dade58754010000000000000000000000000000000000ffffd8b93aeb208db75d4d54010000000000000000000000000000000000ffffae1d5595208de8d18754010000000000000000000000000000000000ffff4405665c208d88e78754010000000000000000000000000000000000ffff6b96180a208dae667354010000000000000000000000000000000000ffff531f490a208d92f98754010000000000000000000000000000000000ffffd447e857208db1428854010000000000000000000000000000000000ffff36c6b4bb208dd42c8854010000000000000000000000000000000000ffff4b4aff14208df71acd53010000000000000000000000000000000000ffff62d17930208da0b88754010000000000000000000000000000000000ffff974bf913208d5faa7953010000000000000000000000000000000000ffff7419d269208d6c1e8854010000000000000000000000000000000000ffff48a72343208d9c2b8854010000000000000000000000000000000000ffff64431e87208de8908754010000000000000000000000000000000000ffff44660d45208d410b7d54010000000000000000000000000000000000ffff43a3340d208d5b298854010000000000000000000000000000000000ffff9ffda678208de7238854010000000000000000000000000000000000ffff189a3759208da5745354010000000000000000000000000000000000ffff57026e31208df23c885401000000000000002a010488006710000523fbe100000001208dddf48754010000000000000000000000000000000000ffffc1531c5b208d61888754010000000000000000000000000000000000ffff42cd8bc1208df92e8854010000000000000000000000000000000000ffff36e1e970208d0cf75754010000000000000000000000000000000000ffffad4e2420208d0f028854010000000000000000000000000000000000ffff6ec61b02208de6228854010000000000000000000000000000000000ffffdcaa807c208d1cac8754010000000000000000000000000000000000ffff6179416c208db6068854010000000000000000000000000000000000ffffd46121e4208d7ea58754010000000000000000000000000000000000ffff80a41679208d91216254010000000000000000000000000000000000ffff69ece091208d0bf78754010000000000000000000000000000000000ffff45320c0b208dd03c8854010000000000000000000000000000000000ffff4859a2a5208d8e308854010000000000000000000000000000000000ffff2e1ce15a208d30f36354010000000000000000000000000000000000ffff4b61ee15208d7aa05553010000000000000000000000000000000000ffffb129186b208dbb238854010000000000000000000000000000000000ffff581a7f6f208d41248754010000000000000000000000000000000000ffffb009055b208dee218854010000000000000000000000000000000000ffff2e7771f9208db4e78754010000000000000000000000000000000000ffff411bf6ee208db5178854010000000000000000000000000000000000ffffacff001b208dbcf487540100000000000000200100009d386ab83061cfabfe3513a3208d76048854010000000000000000000000000000000000ffff2e35dbc2208d83d28754010000000000000000000000000000000000ffffd91bb1d5208d5c3d8854010000000000000000000000000000000000ffff32a47969208df4bd875401000000000000002a0104f8012032250000000000000002208d1bfa8754010000000000000000000000000000000000ffff53a2f4b6208d141c4554010000000000000000000000000000000000ffffb27b8281208d580c7e54010000000000000000000000000000000000ffffc9ea1340208df7228854010000000000000000000000000000000000ffffd90a268d208d41e18754010000000000000000000000000000000000ffff555b8809208d66358854010000000000000000000000000000000000ffff5280ff23208deecd8754010000000000000000000000000000000000ffff84c6a102208df9bc8754010000000000000000000000000000000000ffffbbc96dae208d9d0a8854010000000000000000000000000000000000ffffb2a2d18a208da9458854010000000000000000000000000000000000ffffca16c30e208d2ca88754010000000000000000000000000000000000ffff6baab63e208d923b8854010000000000000000000000000000000000ffffd5b87bee208d12258854010000000000000000000000000000000000ffff59ee408b208d980e8854010000000000000000000000000000000000ffff2edfb0c4208d33378854010000000000000000000000000000000000ffff6caa7b42208d41176d53010000000000000000000000000000000000ffff1fa2df68208dd1c57f54010000000000000000000000000000000000ffffbeab679a208d17c78754010000000000000000000000000000000000ffff3f983f51208dbb278854010000000000000000000000000000000000ffff568dbc28208d5d5ad953010000000000000000000000000000000000ffff0ec112b7208da1b78754010000000000000000000000000000000000ffffbc287698208d99348854010000000000000000000000000000000000ffff5ff1a302208d23ef8454010000000000000000000000000000000000ffff7ba55d22208d90e98754010000000000000000000000000000000000ffff5ae14503208d58f48754010000000000000000000000000000000000ffffd45a3cae208d530c8854010000000000000000000000000000000000ffff18fb80c4208dc6138854010000000000000000000000000000000000ffff4e2fd6eb208d97208854010000000000000000000000000000000000ffff55ddd5b8208d74f88654010000000000000000000000000000000000ffff1809ad86208dc0278854010000000000000000000000000000000000ffff6ef2dfb6208d84338854010000000000000000000000000000000000ffff58d8114e208dcae78754010000000000000000000000000000000000ffffc21c474c208d61e78754010000000000000000000000000000000000ffffd5b3fc7a208d7a078854010000000000000000000000000000000000ffff32740193208de7547b54010000000000000000000000000000000000ffff8046aac3208db5328854010000000000000000000000000000000000ffff5b0c5366208d5f208854010000000000000000000000000000000000ffff6caa054a208d1d682854010000000000000000000000000000000000ffff69e3eb9d208d179e6b54010000000000000000000000000000000000ffff54aac628208ded2e8854010000000000000000000000000000000000ffff4166d226208d8e148854010000000000000000000000000000000000ffff54305af6208d1ed88754010000000000000000000000000000000000ffff3ed2b2a4208d78ec8554010000000000000000000000000000000000ffff6dd2e575208ddd3e7854010000000000000000000000000000000000ffff1b83a102208d421e8854010000000000000000000000000000000000ffff2eb51bf1208dc01f8854010000000000000000000000000000000000ffff58c66033208d08ce8754010000000000000000000000000000000000ffff5d57b84c208df22e8854010000000000000000000000000000000000ffffbf213e3d208d89cb8754010000000000000000000000000000000000ffff53d7ece1208da9d68754010000000000000000000000000000000000ffff71bef412208d38268854010000000000000000000000000000000000ffff84fc8a6f208d4f107254010000000000000000000000000000000000ffff57a072d9208d990f88540100000000000000200100009d3890d71029db21863020f9208df3c36854010000000000000000000000000000000000ffffbba6a6c4208d3ea71f54010000000000000000000000000000000000ffff3e61237b208d60a18754010000000000000000000000000000000000ffff53a56b4b208db2328854010000000000000000000000000000000000ffff44eef265208d2c0f8854010000000000000000000000000000000000ffff566553c0208dec268854010000000000000000000000000000000000ffff57a69ecd208d93148854010000000000000000000000000000000000ffff9b8f4433208d741b8854010000000000000000000000000000000000ffffae17c74c208ddab94f54010000000000000000000000000000000000ffffab19c63a208d5e886f54010000000000000000000000000000000000ffffbc67a037208d5c3ccc53010000000000000000000000000000000000ffff0e77c86e208d26fb8754010000000000000000000000000000000000ffffc1eae172208d61278854010000000000000000000000000000000000ffff5ce15439208d60df8754010000000000000000000000000000000000ffff2599fb3b208d52418854010000000000000000000000000000000000ffff028710e6208dae448854010000000000000000000000000000000000ffff18152eee208d6ff18754010000000000000000000000000000000000ffff542e396d208d8c248854010000000000000000000000000000000000ffff5519d6d8208d01e33e54010000000000000000000000000000000000ffff5027d563208d05cd8754010000000000000000000000000000000000ffff45a5a9c5208d7c1e8854010000000000000000000000000000000000ffff68c813c8208d38a48754010000000000000000000000000000000000ffff3a60a934208d73ec8754010000000000000000000000000000000000ffffae3db8f3208d096c8754010000000000000000000000000000000000ffff4cb88802208d55d38754010000000000000000000000000000000000ffffd31f082e208d0d8a8754010000000000000000000000000000000000ffff6c22c9bb208d81ba7754010000000000000000000000000000000000ffffca5f88da208d5df88754010000000000000000000000000000000000ffffc31abc05208db1d58754010000000000000000000000000000000000ffff5cf614c8208d2b257c54010000000000000000000000000000000000ffff45f9baa0208d38d78754010000000000000000000000000000000000ffff490e0608208d27e88754010000000000000000000000000000000000ffff17f1ccd0208d501c8854010000000000000000000000000000000000ffff5be834a7208d860b8854010000000000000000000000000000000000ffff640173bc208deada8754010000000000000000000000000000000000ffffdc98f8db208d983d3c54010000000000000000000000000000000000ffff021ab398208d99f28754010000000000000000000000000000000000ffff59a9e417208d19468854010000000000000000000000000000000000ffff91ff01a1208ddbf68754010000000000000000000000000000000000ffff50048949208d89118854010000000000000000000000000000000000ffffc8366923208dea3b8854010000000000000000000000000000000000ffffbcbbb5a9208d364a8854010000000000000000000000000000000000ffffc654bd58208dd52ef953010000000000000000000000000000000000ffff7cabb7bc208db086cc53010000000000000000000000000000000000ffff6c4004ea208d0ff48754010000000000000000000000000000000000ffff0536a3cb208d1c0b8854010000000000000000000000000000000000ffffd90bfef3208dbf188854010000000000000000000000000000000000ffff0252431f208dd1c78754010000000000000000000000000000000000ffff25732b19208dd6fa3954010000000000000000000000000000000000ffff6c1131dc208da6108854010000000000000000000000000000000000ffff1fb9b748208daf368854010000000000000000000000000000000000ffff1f2a2981208d9e2f8854010000000000000000000000000000000000ffffbc658482208d6a458854010000000000000000000000000000000000ffff568b843a208dcd428854010000000000000000000000000000000000ffff5d820794208d38258854010000000000000000000000000000000000ffff6440c630208d1cda8754010000000000000000000000000000000000ffff6e9f7be5208ddd388854010000000000000000000000000000000000ffff9f080244208d2e2d8854010000000000000000000000000000000000ffffbb70cf3d208d3e0c8854010000000000000000000000000000000000ffff3ec27a16208d89098854010000000000000000000000000000000000ffffb55fb2fb208d13468854010000000000000000000000000000000000ffff180ab1e5208dfc2a8854010000000000000000000000000000000000ffffd58a5c0e208db9188854010000000000000000000000000000000000ffff81ce808d208d03d06b54010000000000000000000000000000000000ffff4b496858208d319e8454010000000000000000000000000000000000ffff531fac9f208dc8d98754010000000000000000000000000000000000ffffc113e4ea208d06395754010000000000000000000000000000000000ffff7cabf0d6208d722b8854010000000000000000000000000000000000ffff545db4cd208dd91f8854010000000000000000000000000000000000ffff5f12a597208dfbd57054010000000000000000000000000000000000ffff3cf654e6208dd7358854010000000000000000000000000000000000ffffb4998e79208dd7018854010000000000000000000000000000000000ffffb45cc220208d86df5554010000000000000000000000000000000000ffff7660d462208decd28754010000000000000000000000000000000000ffff5b7bdfe2208dafe28754010000000000000000000000000000000000ffff2e76899e208d0c318854010000000000000000000000000000000000ffffc7bcb183208d35258854010000000000000000000000000000000000ffff3ab2d076208db5c38754010000000000000000000000000000000000ffff48b24d30208ddfd18754010000000000000000000000000000000000ffff904cb00c208d40478854010000000000000000000000000000000000ffff02a3b787208deb318854010000000000000000000000000000000000ffffd2564026208de63f8854010000000000000000000000000000000000ffff615d16c0208dbf1d8854010000000000000000000000000000000000ffffc6fff6f0208d4aee8754010000000000000000000000000000000000ffff56c74bc8208d68bc8754010000000000000000000000000000000000ffff31b581f9208ddcca8754010000000000000000000000000000000000ffff0e97397a208db2318854010000000000000000000000000000000000ffffc766348d208de1bd8754010000000000000000000000000000000000ffffd5927a3d208d2aff8754010000000000000000000000000000000000ffff5152d0a5208da7feb753010000000000000000000000000000000000ffff53fe1694208de7418854010000000000000000000000000000000000ffff189f3d99208de7b38754010000000000000000000000000000000000ffff64004655208dacabb653010000000000000000000000000000000000ffff55413231208d43b88754010000000000000000000000000000000000ffff796e1029208d03788754010000000000000000000000000000000000ffff49b90ff6208d04be8754010000000000000000000000000000000000ffffc327ce1c208d33648254010000000000000000000000000000000000ffff2e896478208d9e308854010000000000000000000000000000000000ffffd395d9bf208df13e8854010000000000000000000000000000000000ffff51bb88ed208dec8c5653010000000000000000000000000000000000ffff557f146e208df4538854010000000000000000000000000000000000ffff48d05928208d41bd8154010000000000000000000000000000000000ffff47384162208df6428854010000000000000000000000000000000000ffffc1566314208d753e8854010000000000000000000000000000000000ffff440c9b4f208d2f078854010000000000000000000000000000000000ffff56021a19208d7b0f4754010000000000000000000000000000000000ffff71653a84208dcee88754010000000000000000000000000000000000ffff5401a332208df4db8754010000000000000000000000000000000000ffff5a9db0e3208df8e38754010000000000000000000000000000000000ffff5d5208fa208d2e298854010000000000000000000000000000000000ffff4c61c0bc208d42ea8754010000000000000000000000000000000000ffff4c405ae7208deade8754010000000000000000000000000000000000ffffc009c823208d99358854010000000000000000000000000000000000ffff6cc2b493208df3fd8754010000000000000000000000000000000000ffff904c6007208d1fde8754010000000000000000000000000000000000ffff92732ae8208d666e8354010000000000000000000000000000000000ffff6daa9d16208d18f78754010000000000000000000000000000000000ffff4d6d8d8a208ddea9ce53010000000000000000000000000000000000ffff17e26f7d208d1ae48754010000000000000000000000000000000000ffffc32ebb89208dee258854010000000000000000000000000000000000ffff4a0f10e1208d290a8854010000000000000000000000000000000000ffff42731593208d7cb33354010000000000000000000000000000000000ffff532e8b97208dfd1e8854010000000000000000000000000000000000ffff6ee91680208d480a1354010000000000000000000000000000000000ffff60f220f6208d55838754010000000000000000000000000000000000ffff1f36d48f208d247e8754010000000000000000000000000000000000ffff44b5a49a208d0efa4954010000000000000000000000000000000000ffff63890597208d862e8854010000000000000000000000000000000000ffffc14d8751208d443c8854010000000000000000000000000000000000ffff70d16dba208d72fe8754010000000000000000000000000000000000ffff55983dd3208d236b6854010000000000000000000000000000000000ffff7aea27f9208d67e08754010000000000000000000000000000000000ffff1b20750d208df10a7154010000000000000000000000000000000000ffff7b9fe56e208db32d8854010000000000000000000000000000000000ffff7ba42d54208db3f58754010000000000000000000000000000000000ffff027b4eba208d70d68754010000000000000000000000000000000000ffffbc1b62b9208d97951454010000000000000000000000000000000000ffffb4b6af10208d251288540100000000000000200100009d386ab800773149c4d7e673208d7b168854010000000000000000000000000000000000ffff58969392208d91d18754010000000000000000000000000000000000ffff9ffd6d4e208d19008854010000000000000000000000000000000000ffff4e926cb8208dd1c98754010000000000000000000000000000000000ffff546cdb77208d6a0a8854010000000000000000000000000000000000ffff6caa8c15208d3a3a8854010000000000000000000000000000000000ffff62e28d6a208d3fe48754010000000000000000000000000000000000ffffd9850be7208dcb438854010000000000000000000000000000000000ffff6c2444b3208d78338854010000000000000000000000000000000000ffffb2df574a208d3b2d3054010000000000000000000000000000000000ffff4b529e67208d5b988754010000000000000000000000000000000000ffff36e152e6208d01ab8754010000000000000000000000000000000000ffff58b531bf208d7b038854010000000000000000000000000000000000ffff54717a6f208db0388854010000000000000000000000000000000000ffff4a694e98208d65418854010000000000000000000000000000000000ffffcef84b25208dcf218854010000000000000000000000000000000000ffff5364fed9208db6c68754010000000000000000000000000000000000ffff4d03decd208dc6158854010000000000000000000000000000000000ffffb9044c79208d65418854010000000000000000000000000000000000ffff56b2192f208d23308754010000000000000000000000000000000000ffffd973f7a4208d05158854010000000000000000000000000000000000ffff1b6d9975208d52cd8754010000000000000000000000000000000000ffffdf5b92ad208d3a128854010000000000000000000000000000000000ffff6d93787e208d351e8854010000000000000000000000000000000000ffffb6a4336f208d9bd58754010000000000000000000000000000000000ffff3ba7f521208dc3288854010000000000000000000000000000000000ffff6bbf20cc208d68998754010000000000000000000000000000000000ffff63b30032208d86848754010000000000000000000000000000000000ffffb52ef15c208dff108854010000000000000000000000000000000000ffff4d06718b208d226f0754010000000000000000000000000000000000ffff44248ba1208da3af7354010000000000000000000000000000000000ffff86f9d72c208d9fd68754010000000000000000000000000000000000ffff521f2444208dae428854010000000000000000000000000000000000ffffd445b025208dfafc8754010000000000000000000000000000000000ffffd447fa84208dbb358854010000000000000000000000000000000000ffff3ee2d196208da01a8854010000000000000000000000000000000000ffff45a615b2208d32edb053010000000000000000000000000000000000ffff6d6494da208d77ed8754010000000000000000000000000000000000ffff555dcc44208d09608754010000000000000000000000000000000000ffff45a5d222208d84558754010000000000000000000000000000000000ffffb01c30ab208d71fe8754010000000000000000000000000000000000ffffae5f68c2208de0acdf53010000000000000000000000000000000000ffffae737936208d29e18754010000000000000000000000000000000000ffffb00a63cb208d220b8854010000000000000000000000000000000000ffff9ec4d12f208db4408854010000000000000000000000000000000000ffff4c6d9bcc208d65a58754010000000000000000000000000000000000ffff5962c453208d2d628854010000000000000000000000000000000000ffff257191d50000", + "payload": "fdf5016816fa53010000000000000000000000000000000000ffff51403eea208ddb2a8854010000000000000000000000000000000000ffff707c60d9208d31413a54010000000000000000000000000000000000ffff5ed5fd13208d182c8854010000000000000000000000000000000000ffff505f3f81208d65ecb853010000000000000000000000000000000000ffff54d72104208dcca94054010000000000000000000000000000000000ffff40bbe1f2208d73238854010000000000000000000000000000000000ffff55d683cd208d5d258854010000000000000000000000000000000000ffffd523a66d208dcbea87540100000000000000200100005ef579fd2c9d47be4b56d671208db3e58754010000000000000000000000000000000000ffffae373156208d11e58754810000000000000000000000000000000000ffff51071276208d38f48754010000000000000000000000000000000000ffff6d4372e0208d4f448854010000000000000000000000000000000000ffffc556cbea208deb208854010000000000000000000000000000000000ffff450eb059208d97336054010000000000000000000000000000000000ffff4d60444a208dad608754010000000000000000000000000000000000ffff01abd3c3208d2cbe8754010000000000000000000000000000000000ffff7963d8b8208d9dfa8754010000000000000000000000000000000000ffffcebe862c208da7f66554010000000000000000000000000000000000ffff62f2a82e208d430d8854010000000000000000000000000000000000ffff6deb6956208d08148854010000000000000000000000000000000000ffff4b9804ef208d950e8854010000000000000000000000000000000000ffff6b8dd2e1208d1cfc8754010000000000000000000000000000000000ffffb2fe1dab208de7458754010000000000000000000000000000000000ffff32cccb82208d12625654010000000000000000000000000000000000ffff55e6f35a208dd7908354010000000000000000000000000000000000ffff4c642e6f208d17398854010000000000000000000000000000000000ffff45ea14df208dc72d8854010000000000000000000000000000000000ffffdaa48b96208d57fb8654010000000000000000000000000000000000ffff5f0080a9208d4e9a6d54010000000000000000000000000000000000ffff6d94e741208d7a418854010000000000000000000000000000000000ffff6d43b0c1208d5c098854010000000000000000000000000000000000ffff9c11e7ea208d442d8854010000000000000000000000000000000000ffffd0424482208db142fb53010000000000000000000000000000000000ffff54344a4a208d70158854010000000000000000000000000000000000ffff538f8201208d39288854010000000000000000000000000000000000ffff57daab71208d262f8854010000000000000000000000000000000000ffff57e045b1208d91430654010000000000000000000000000000000000ffff4212def5208d7c468854010000000000000000000000000000000000ffff62a4f53b208d9c3e8854010000000000000000000000000000000000ffff5b736bcc208d4d074f54010000000000000000000000000000000000ffff43af9d9b208deaca8754010000000000000000000000000000000000ffff4a8084a0208d74f68754010000000000000000000000000000000000ffff46304541208d5d098854010000000000000000000000000000000000ffff6eabb626208d08228854010000000000000000000000000000000000ffff1f07b030208d959a8254010000000000000000000000000000000000ffff4fa996b3208d4bac8754010000000000000000000000000000000000ffff43a0605b208de4038854010000000000000000000000000000000000ffff4cb41a5b208ddc308854010000000000000000000000000000000000ffffb72e6072208deac86f54010000000000000000000000000000000000ffffd5b815e2208d1b118854010000000000000000000000000000000000ffff3ff8d0a4208db1258854010000000000000000000000000000000000ffff5edd3a6a208d20268754010000000000000000000000000000000000ffff59ed3cfc208d83ed8754010000000000000000000000000000000000ffff4460baea208d71278854010000000000000000000000000000000000ffff4583b547208da7968754010000000000000000000000000000000000ffffd1c34463208d9d428854010000000000000000000000000000000000ffff43c15bc5208d33448854010000000000000000000000000000000000ffff2e0d8a5c208dfa2e7154010000000000000000000000000000000000ffffceff2bca208d47288854010000000000000000000000000000000000ffff5b8d0190208d0e847954010000000000000000000000000000000000ffff5501b8c2208d552f8854010000000000000000000000000000000000ffff5cf3b604208d8c2e8854010000000000000000000000000000000000ffff58666b0d208dcbdd8754010000000000000000000000000000000000ffff59a85cf9208d04208854010000000000000000000000000000000000ffff5f60abe0208dba238854010000000000000000000000000000000000ffff2e77ce67208d62c68754010000000000000000000000000000000000ffffcbae5658208d41108854010000000000000000000000000000000000ffff49329ec8208ddf1d8854010000000000000000000000000000000000ffff603ada12208df90c8854010000000000000000000000000000000000ffff51e0c21c208d5dff8754010000000000000000000000000000000000ffff904ca539208de0118854010000000000000000000000000000000000ffff5c0cecf7208d1b2d88540100000000000000200100005ef579fb18f317b2aba4edfc208dfaa27f54010000000000000000000000000000000000ffff54c65a7c208dc2db8754010000000000000000000000000000000000ffffad0b7981208d88a58754010000000000000000000000000000000000ffff188a1995208de0d78754010000000000000000000000000000000000ffff62a7a6bd208d18f66b54010000000000000000000000000000000000ffffdb4fbe80208dfcf78754010000000000000000000000000000000000ffff67145102208d3d3a8854010000000000000000000000000000000000ffff64259bd6208dcaa98654010000000000000000000000000000000000ffff32c737e1208d3a6a5c54010000000000000000000000000000000000ffff6d793f75208d22d38754010000000000000000000000000000000000ffff0595cc0d208da9ea8754010000000000000000000000000000000000ffff62ca37d3208d440e8854010000000000000000000000000000000000ffff123e1c11208dab428854010000000000000000000000000000000000ffff461df51f208d0f0b8854010000000000000000000000000000000000ffff59d36752208d631f8854010000000000000000000000000000000000ffff5ef8c640208dbc1d8854010000000000000000000000000000000000ffff5f5dc582208d04bf8754010000000000000000000000000000000000ffff0e6797e3208db8028854010000000000000000000000000000000000ffff3cf0c4a1208d6a0c8854010000000000000000000000000000000000ffff58bb5c55208d4f438854010000000000000000000000000000000000ffff5d326005208df6068854010000000000000000000000000000000000ffff5d5a5850208d40eb8754010000000000000000000000000000000000ffff5751ed86208dbad18754010000000000000000000000000000000000ffff63e51608208d99108854010000000000000000000000000000000000ffff36e299cd208d9a1e88540100000000000000200100005ef579fd38a43785a5d441b7208d13258854010000000000000000000000000000000000ffffb90de279208db3778754010000000000000000000000000000000000ffff67fcc80c208d3d358854010000000000000000000000000000000000ffffd00c40fc208dfd0d8854010000000000000000000000000000000000ffff5e89c2f3208dd6428854010000000000000000000000000000000000ffff1863e14a208d89e78754010000000000000000000000000000000000ffff43a11d76208d89ce8754010000000000000000000000000000000000ffff3edb6281208d03298854010000000000000000000000000000000000ffff6d5b26dd208d16df6e54010000000000000000000000000000000000ffffd9c3d176208d7c028854010000000000000000000000000000000000ffffbcc2db1f208d67fc8754010000000000000000000000000000000000ffff59910667208d86b18754010000000000000000000000000000000000ffff6c1482b9208d790b8854010000000000000000000000000000000000ffff0263150d208d89c44554010000000000000000000000000000000000ffff72fcd6b8208d331c8854010000000000000000000000000000000000ffff4c7dcfa8208d9fe98754010000000000000000000000000000000000ffffad08fd05208d0ecd8754010000000000000000000000000000000000ffff7c0fec89208d4af98754010000000000000000000000000000000000ffff2ea6a167208d270b8854010000000000000000000000000000000000ffff59d40fca208d11cf4054010000000000000000000000000000000000ffffb52ac058208d63358254010000000000000000000000000000000000ffff6bd9a130208dbde48754010000000000000000000000000000000000ffff4f915dc7208dece78754010000000000000000000000000000000000ffff5f8423ef208dba308854010000000000000000000000000000000000ffff904cba8c208d953d8854010000000000000000000000000000000000ffff8d1421e5208d5f188854010000000000000000000000000000000000ffff4e1bbfb6208d36fc8754010000000000000000000000000000000000ffff3205cfb6208d5e458854010000000000000000000000000000000000ffff493092c2208dd0878754010000000000000000000000000000000000ffff97caacde208dd99d8754010000000000000000000000000000000000ffffc05f3c38208da7018854010000000000000000000000000000000000ffffdcf5f82d208df0f42254010000000000000000000000000000000000ffff58bf997f208d94228854010000000000000000000000000000000000ffffbc8ee72d208de3448854010000000000000000000000000000000000ffff6d780f99208d32448854010000000000000000000000000000000000ffffbc64c76e208d0b3d8854010000000000000000000000000000000000ffff6c414312208d49138854010000000000000000000000000000000000ffff407e52c6208d2d128854010000000000000000000000000000000000ffff6dc987d8208d4acf8754010000000000000000000000000000000000ffffae151a25208de9dd8754010000000000000000000000000000000000ffff522d2d10208d17df8754010000000000000000000000000000000000ffff4d294737208ddbd48754010000000000000000000000000000000000ffff443703fd208d79108854010000000000000000000000000000000000ffff4bb5a154208d1df28753010000000000000000000000000000000000ffff4c44fc51208d5d496a53010000000000000000000000000000000000ffff530924b0208d180b8854010000000000000000000000000000000000ffffc15fced3208d53128854010000000000000000000000000000000000ffff5bc5b9e4208de21f8854010000000000000000000000000000000000ffff2e05fe1f208d31ab6554010000000000000000000000000000000000ffffae865915208d09248854010000000000000000000000000000000000ffff7d71a4b0208d120b8854010000000000000000000000000000000000ffff93e40150208d25d98754010000000000000000000000000000000000ffffc19f7a86208d99e78754010000000000000000000000000000000000ffff4d675993208d2b218854010000000000000000000000000000000000ffff5144776c208d5a208854010000000000000000000000000000000000ffff2e1cce5820f69e8f8154010000000000000000000000000000000000ffff58718848208d9edd6554010000000000000000000000000000000000ffff2ea758c5208d28c98754010000000000000000000000000000000000ffffc60bd694208d181d8854010000000000000000000000000000000000ffffba6b689e208d77868754010000000000000000000000000000000000ffff182016aa208de1698054010000000000000000000000000000000000ffff5cf5daa9208d823d8854010000000000000000000000000000000000ffffbe4d61c8208d2c3b8854010000000000000000000000000000000000ffff71647df2208da2248854010000000000000000000000000000000000ffff4ff359ca208da2dd8754010000000000000000000000000000000000ffff59f1e52b208da6e60d54010000000000000000000000000000000000ffff579596231159ad218854010000000000000000000000000000000000ffff5895f42d208d5ba78754010000000000000000000000000000000000ffff458ae8b0208ddc9b8754010000000000000000000000000000000000ffff18b507a5208d20eb5754010000000000000000000000000000000000ffff5181a537208daf1d8854010000000000000000000000000000000000ffffd5f51eba208d07f58754010000000000000000000000000000000000ffff6dec54bc208d4b3b8854010000000000000000000000000000000000ffff5c3e1991208d13b54054010000000000000000000000000000000000ffffb273845a208d4f338854010000000000000000000000000000000000ffffcfac797b208d4d898754010000000000000000000000000000000000ffffadaf880d208de72f8854010000000000000000000000000000000000ffffd956ef58208dc1e98754010000000000000000000000000000000000ffff980711cf208dfd8f7154010000000000000000000000000000000000ffff50aba98f208d59fe8754010000000000000000000000000000000000ffff5f2ae582208d3ffa8754010000000000000000000000000000000000ffffbca836db208d389b0054010000000000000000000000000000000000ffffded10925208deb154354010000000000000000000000000000000000ffff717532da208dadde7654010000000000000000000000000000000000ffff93afd0e5208d40458854010000000000000000000000000000000000ffff54ee8cb0208d08fa8754010000000000000000000000000000000000ffff3658eba9208d0df58754010000000000000000000000000000000000ffff72c6876e208d5d408854010000000000000000000000000000000000ffffa7582d7c208de8338854010000000000000000000000000000000000ffffad40d7ad208d6c2a8854010000000000000000000000000000000000ffffbc1833a3208d0fc28754010000000000000000000000000000000000ffffcbceb676208d98448854010000000000000000000000000000000000ffff0121ce6e208d77b58754010000000000000000000000000000000000ffff4b40d938208d853b8854010000000000000000000000000000000000ffff5648d643208d1c9c7854010000000000000000000000000000000000ffff6c3230db208d4e028754010000000000000000000000000000000000ffffd8e33c5d208daf738754010000000000000000000000000000000000ffffad4e9d56208dca438854010000000000000000000000000000000000ffff4f8a0353208d7b408854010000000000000000000000000000000000ffff0599e92a208dc62f8854010000000000000000000000000000000000ffff46236049208dc4d58754010000000000000000000000000000000000ffff4400384d208d0ddb4c54010000000000000000000000000000000000ffff71653b5a208d53388854010000000000000000000000000000000000ffff43bddf66208d7c388854010000000000000000000000000000000000ffff47edca96208d8c068854010000000000000000000000000000000000ffffdded3c2c208d89f60554010000000000000000000000000000000000ffff4e60d8d6208da5ff1154010000000000000000000000000000000000ffff55983c68208d72f58754010000000000000000000000000000000000ffffce47f56a208d7e2d8854010000000000000000000000000000000000ffff17e25c12208da7ca8754010000000000000000000000000000000000ffff051d0baa208d19af8754010000000000000000000000000000000000ffffad42d883208dffd68754010000000000000000000000000000000000ffff5418ff88208d87bf8754010000000000000000000000000000000000ffff4c1fe0dc208deef18754010000000000000000000000000000000000ffff4c71d406208d25868754010000000000000000000000000000000000ffffda67a475208d4d348854010000000000000000000000000000000000ffff5d561269208da5918754010000000000000000000000000000000000ffff42b163b3208dbfac3754010000000000000000000000000000000000ffffad4e01eb208d5c408854010000000000000000000000000000000000ffffcc0bb91e208d4a928754010000000000000000000000000000000000ffff531dba30208db9fd8754010000000000000000000000000000000000ffffa3f72b33208dade58754010000000000000000000000000000000000ffffd8b93aeb208db75d4d54010000000000000000000000000000000000ffffae1d5595208de8d18754010000000000000000000000000000000000ffff4405665c208d88e78754010000000000000000000000000000000000ffff6b96180a208dae667354010000000000000000000000000000000000ffff531f490a208d92f98754010000000000000000000000000000000000ffffd447e857208db1428854010000000000000000000000000000000000ffff36c6b4bb208dd42c8854010000000000000000000000000000000000ffff4b4aff14208df71acd53010000000000000000000000000000000000ffff62d17930208da0b88754010000000000000000000000000000000000ffff974bf913208d5faa7953010000000000000000000000000000000000ffff7419d269208d6c1e8854010000000000000000000000000000000000ffff48a72343208d9c2b8854010000000000000000000000000000000000ffff64431e87208de8908754010000000000000000000000000000000000ffff44660d45208d410b7d54010000000000000000000000000000000000ffff43a3340d208d5b298854010000000000000000000000000000000000ffff9ffda678208de7238854010000000000000000000000000000000000ffff189a3759208da5745354010000000000000000000000000000000000ffff57026e31208df23c885401000000000000002a010488006710000523fbe100000001208dddf48754010000000000000000000000000000000000ffffc1531c5b208d61888754010000000000000000000000000000000000ffff42cd8bc1208df92e8854010000000000000000000000000000000000ffff36e1e970208d0cf75754010000000000000000000000000000000000ffffad4e2420208d0f028854010000000000000000000000000000000000ffff6ec61b02208de6228854010000000000000000000000000000000000ffffdcaa807c208d1cac8754010000000000000000000000000000000000ffff6179416c208db6068854010000000000000000000000000000000000ffffd46121e4208d7ea58754010000000000000000000000000000000000ffff80a41679208d91216254010000000000000000000000000000000000ffff69ece091208d0bf78754010000000000000000000000000000000000ffff45320c0b208dd03c8854010000000000000000000000000000000000ffff4859a2a5208d8e308854010000000000000000000000000000000000ffff2e1ce15a208d30f36354010000000000000000000000000000000000ffff4b61ee15208d7aa05553010000000000000000000000000000000000ffffb129186b208dbb238854010000000000000000000000000000000000ffff581a7f6f208d41248754010000000000000000000000000000000000ffffb009055b208dee218854010000000000000000000000000000000000ffff2e7771f9208db4e78754010000000000000000000000000000000000ffff411bf6ee208db5178854010000000000000000000000000000000000ffffacff001b208dbcf487540100000000000000200100009d386ab83061cfabfe3513a3208d76048854010000000000000000000000000000000000ffff2e35dbc2208d83d28754010000000000000000000000000000000000ffffd91bb1d5208d5c3d8854010000000000000000000000000000000000ffff32a47969208df4bd875401000000000000002a0104f8012032250000000000000002208d1bfa8754010000000000000000000000000000000000ffff53a2f4b6208d141c4554010000000000000000000000000000000000ffffb27b8281208d580c7e54010000000000000000000000000000000000ffffc9ea1340208df7228854010000000000000000000000000000000000ffffd90a268d208d41e18754010000000000000000000000000000000000ffff555b8809208d66358854010000000000000000000000000000000000ffff5280ff23208deecd8754010000000000000000000000000000000000ffff84c6a102208df9bc8754010000000000000000000000000000000000ffffbbc96dae208d9d0a8854010000000000000000000000000000000000ffffb2a2d18a208da9458854010000000000000000000000000000000000ffffca16c30e208d2ca88754010000000000000000000000000000000000ffff6baab63e208d923b8854010000000000000000000000000000000000ffffd5b87bee208d12258854010000000000000000000000000000000000ffff59ee408b208d980e8854010000000000000000000000000000000000ffff2edfb0c4208d33378854010000000000000000000000000000000000ffff6caa7b42208d41176d53010000000000000000000000000000000000ffff1fa2df68208dd1c57f54010000000000000000000000000000000000ffffbeab679a208d17c78754010000000000000000000000000000000000ffff3f983f51208dbb278854010000000000000000000000000000000000ffff568dbc28208d5d5ad953010000000000000000000000000000000000ffff0ec112b7208da1b78754010000000000000000000000000000000000ffffbc287698208d99348854010000000000000000000000000000000000ffff5ff1a302208d23ef8454010000000000000000000000000000000000ffff7ba55d22208d90e98754010000000000000000000000000000000000ffff5ae14503208d58f48754010000000000000000000000000000000000ffffd45a3cae208d530c8854010000000000000000000000000000000000ffff18fb80c4208dc6138854010000000000000000000000000000000000ffff4e2fd6eb208d97208854010000000000000000000000000000000000ffff55ddd5b8208d74f88654010000000000000000000000000000000000ffff1809ad86208dc0278854010000000000000000000000000000000000ffff6ef2dfb6208d84338854010000000000000000000000000000000000ffff58d8114e208dcae78754010000000000000000000000000000000000ffffc21c474c208d61e78754010000000000000000000000000000000000ffffd5b3fc7a208d7a078854010000000000000000000000000000000000ffff32740193208de7547b54010000000000000000000000000000000000ffff8046aac3208db5328854010000000000000000000000000000000000ffff5b0c5366208d5f208854010000000000000000000000000000000000ffff6caa054a208d1d682854010000000000000000000000000000000000ffff69e3eb9d208d179e6b54010000000000000000000000000000000000ffff54aac628208ded2e8854010000000000000000000000000000000000ffff4166d226208d8e148854010000000000000000000000000000000000ffff54305af6208d1ed88754010000000000000000000000000000000000ffff3ed2b2a4208d78ec8554010000000000000000000000000000000000ffff6dd2e575208ddd3e7854010000000000000000000000000000000000ffff1b83a102208d421e8854010000000000000000000000000000000000ffff2eb51bf1208dc01f8854010000000000000000000000000000000000ffff58c66033208d08ce8754010000000000000000000000000000000000ffff5d57b84c208df22e8854010000000000000000000000000000000000ffffbf213e3d208d89cb8754010000000000000000000000000000000000ffff53d7ece1208da9d68754010000000000000000000000000000000000ffff71bef412208d38268854010000000000000000000000000000000000ffff84fc8a6f208d4f107254010000000000000000000000000000000000ffff57a072d9208d990f88540100000000000000200100009d3890d71029db21863020f9208df3c36854010000000000000000000000000000000000ffffbba6a6c4208d3ea71f54010000000000000000000000000000000000ffff3e61237b208d60a18754010000000000000000000000000000000000ffff53a56b4b208db2328854010000000000000000000000000000000000ffff44eef265208d2c0f8854010000000000000000000000000000000000ffff566553c0208dec268854010000000000000000000000000000000000ffff57a69ecd208d93148854010000000000000000000000000000000000ffff9b8f4433208d741b8854010000000000000000000000000000000000ffffae17c74c208ddab94f54010000000000000000000000000000000000ffffab19c63a208d5e886f54010000000000000000000000000000000000ffffbc67a037208d5c3ccc53010000000000000000000000000000000000ffff0e77c86e208d26fb8754010000000000000000000000000000000000ffffc1eae172208d61278854010000000000000000000000000000000000ffff5ce15439208d60df8754010000000000000000000000000000000000ffff2599fb3b208d52418854010000000000000000000000000000000000ffff028710e6208dae448854010000000000000000000000000000000000ffff18152eee208d6ff18754010000000000000000000000000000000000ffff542e396d208d8c248854010000000000000000000000000000000000ffff5519d6d8208d01e33e54010000000000000000000000000000000000ffff5027d563208d05cd8754010000000000000000000000000000000000ffff45a5a9c5208d7c1e8854010000000000000000000000000000000000ffff68c813c8208d38a48754010000000000000000000000000000000000ffff3a60a934208d73ec8754010000000000000000000000000000000000ffffae3db8f3208d096c8754010000000000000000000000000000000000ffff4cb88802208d55d38754010000000000000000000000000000000000ffffd31f082e208d0d8a8754010000000000000000000000000000000000ffff6c22c9bb208d81ba7754010000000000000000000000000000000000ffffca5f88da208d5df88754010000000000000000000000000000000000ffffc31abc05208db1d58754010000000000000000000000000000000000ffff5cf614c8208d2b257c54010000000000000000000000000000000000ffff45f9baa0208d38d78754010000000000000000000000000000000000ffff490e0608208d27e88754010000000000000000000000000000000000ffff17f1ccd0208d501c8854010000000000000000000000000000000000ffff5be834a7208d860b8854010000000000000000000000000000000000ffff640173bc208deada8754010000000000000000000000000000000000ffffdc98f8db208d983d3c54010000000000000000000000000000000000ffff021ab398208d99f28754010000000000000000000000000000000000ffff59a9e417208d19468854010000000000000000000000000000000000ffff91ff01a1208ddbf68754010000000000000000000000000000000000ffff50048949208d89118854010000000000000000000000000000000000ffffc8366923208dea3b8854010000000000000000000000000000000000ffffbcbbb5a9208d364a8854010000000000000000000000000000000000ffffc654bd58208dd52ef953010000000000000000000000000000000000ffff7cabb7bc208db086cc53010000000000000000000000000000000000ffff6c4004ea208d0ff48754010000000000000000000000000000000000ffff0536a3cb208d1c0b8854010000000000000000000000000000000000ffffd90bfef3208dbf188854010000000000000000000000000000000000ffff0252431f208dd1c78754010000000000000000000000000000000000ffff25732b19208dd6fa3954010000000000000000000000000000000000ffff6c1131dc208da6108854010000000000000000000000000000000000ffff1fb9b748208daf368854010000000000000000000000000000000000ffff1f2a2981208d9e2f8854010000000000000000000000000000000000ffffbc658482208d6a458854010000000000000000000000000000000000ffff568b843a208dcd428854010000000000000000000000000000000000ffff5d820794208d38258854010000000000000000000000000000000000ffff6440c630208d1cda8754010000000000000000000000000000000000ffff6e9f7be5208ddd388854010000000000000000000000000000000000ffff9f080244208d2e2d8854010000000000000000000000000000000000ffffbb70cf3d208d3e0c8854010000000000000000000000000000000000ffff3ec27a16208d89098854010000000000000000000000000000000000ffffb55fb2fb208d13468854010000000000000000000000000000000000ffff180ab1e5208dfc2a8854010000000000000000000000000000000000ffffd58a5c0e208db9188854010000000000000000000000000000000000ffff81ce808d208d03d06b54010000000000000000000000000000000000ffff4b496858208d319e8454010000000000000000000000000000000000ffff531fac9f208dc8d98754010000000000000000000000000000000000ffffc113e4ea208d06395754010000000000000000000000000000000000ffff7cabf0d6208d722b8854010000000000000000000000000000000000ffff545db4cd208dd91f8854010000000000000000000000000000000000ffff5f12a597208dfbd57054010000000000000000000000000000000000ffff3cf654e6208dd7358854010000000000000000000000000000000000ffffb4998e79208dd7018854010000000000000000000000000000000000ffffb45cc220208d86df5554010000000000000000000000000000000000ffff7660d462208decd28754010000000000000000000000000000000000ffff5b7bdfe2208dafe28754010000000000000000000000000000000000ffff2e76899e208d0c318854010000000000000000000000000000000000ffffc7bcb183208d35258854010000000000000000000000000000000000ffff3ab2d076208db5c38754010000000000000000000000000000000000ffff48b24d30208ddfd18754010000000000000000000000000000000000ffff904cb00c208d40478854010000000000000000000000000000000000ffff02a3b787208deb318854010000000000000000000000000000000000ffffd2564026208de63f8854010000000000000000000000000000000000ffff615d16c0208dbf1d8854010000000000000000000000000000000000ffffc6fff6f0208d4aee8754010000000000000000000000000000000000ffff56c74bc8208d68bc8754010000000000000000000000000000000000ffff31b581f9208ddcca8754010000000000000000000000000000000000ffff0e97397a208db2318854010000000000000000000000000000000000ffffc766348d208de1bd8754010000000000000000000000000000000000ffffd5927a3d208d2aff8754010000000000000000000000000000000000ffff5152d0a5208da7feb753010000000000000000000000000000000000ffff53fe1694208de7418854010000000000000000000000000000000000ffff189f3d99208de7b38754010000000000000000000000000000000000ffff64004655208dacabb653010000000000000000000000000000000000ffff55413231208d43b88754010000000000000000000000000000000000ffff796e1029208d03788754010000000000000000000000000000000000ffff49b90ff6208d04be8754010000000000000000000000000000000000ffffc327ce1c208d33648254010000000000000000000000000000000000ffff2e896478208d9e308854010000000000000000000000000000000000ffffd395d9bf208df13e8854010000000000000000000000000000000000ffff51bb88ed208dec8c5653010000000000000000000000000000000000ffff557f146e208df4538854010000000000000000000000000000000000ffff48d05928208d41bd8154010000000000000000000000000000000000ffff47384162208df6428854010000000000000000000000000000000000ffffc1566314208d753e8854010000000000000000000000000000000000ffff440c9b4f208d2f078854010000000000000000000000000000000000ffff56021a19208d7b0f4754010000000000000000000000000000000000ffff71653a84208dcee88754010000000000000000000000000000000000ffff5401a332208df4db8754010000000000000000000000000000000000ffff5a9db0e3208df8e38754010000000000000000000000000000000000ffff5d5208fa208d2e298854010000000000000000000000000000000000ffff4c61c0bc208d42ea8754010000000000000000000000000000000000ffff4c405ae7208deade8754010000000000000000000000000000000000ffffc009c823208d99358854010000000000000000000000000000000000ffff6cc2b493208df3fd8754010000000000000000000000000000000000ffff904c6007208d1fde8754010000000000000000000000000000000000ffff92732ae8208d666e8354010000000000000000000000000000000000ffff6daa9d16208d18f78754010000000000000000000000000000000000ffff4d6d8d8a208ddea9ce53010000000000000000000000000000000000ffff17e26f7d208d1ae48754010000000000000000000000000000000000ffffc32ebb89208dee258854010000000000000000000000000000000000ffff4a0f10e1208d290a8854010000000000000000000000000000000000ffff42731593208d7cb33354010000000000000000000000000000000000ffff532e8b97208dfd1e8854010000000000000000000000000000000000ffff6ee91680208d480a1354010000000000000000000000000000000000ffff60f220f6208d55838754010000000000000000000000000000000000ffff1f36d48f208d247e8754010000000000000000000000000000000000ffff44b5a49a208d0efa4954010000000000000000000000000000000000ffff63890597208d862e8854010000000000000000000000000000000000ffffc14d8751208d443c8854010000000000000000000000000000000000ffff70d16dba208d72fe8754010000000000000000000000000000000000ffff55983dd3208d236b6854010000000000000000000000000000000000ffff7aea27f9208d67e08754010000000000000000000000000000000000ffff1b20750d208df10a7154010000000000000000000000000000000000ffff7b9fe56e208db32d8854010000000000000000000000000000000000ffff7ba42d54208db3f58754010000000000000000000000000000000000ffff027b4eba208d70d68754010000000000000000000000000000000000ffffbc1b62b9208d97951454010000000000000000000000000000000000ffffb4b6af10208d251288540100000000000000200100009d386ab800773149c4d7e673208d7b168854010000000000000000000000000000000000ffff58969392208d91d18754010000000000000000000000000000000000ffff9ffd6d4e208d19008854010000000000000000000000000000000000ffff4e926cb8208dd1c98754010000000000000000000000000000000000ffff546cdb77208d6a0a8854010000000000000000000000000000000000ffff6caa8c15208d3a3a8854010000000000000000000000000000000000ffff62e28d6a208d3fe48754010000000000000000000000000000000000ffffd9850be7208dcb438854010000000000000000000000000000000000ffff6c2444b3208d78338854010000000000000000000000000000000000ffffb2df574a208d3b2d3054010000000000000000000000000000000000ffff4b529e67208d5b988754010000000000000000000000000000000000ffff36e152e6208d01ab8754010000000000000000000000000000000000ffff58b531bf208d7b038854010000000000000000000000000000000000ffff54717a6f208db0388854010000000000000000000000000000000000ffff4a694e98208d65418854010000000000000000000000000000000000ffffcef84b25208dcf218854010000000000000000000000000000000000ffff5364fed9208db6c68754010000000000000000000000000000000000ffff4d03decd208dc6158854010000000000000000000000000000000000ffffb9044c79208d65418854010000000000000000000000000000000000ffff56b2192f208d23308754010000000000000000000000000000000000ffffd973f7a4208d05158854010000000000000000000000000000000000ffff1b6d9975208d52cd8754010000000000000000000000000000000000ffffdf5b92ad208d3a128854010000000000000000000000000000000000ffff6d93787e208d351e8854010000000000000000000000000000000000ffffb6a4336f208d9bd58754010000000000000000000000000000000000ffff3ba7f521208dc3288854010000000000000000000000000000000000ffff6bbf20cc208d68998754010000000000000000000000000000000000ffff63b30032208d86848754010000000000000000000000000000000000ffffb52ef15c208dff108854010000000000000000000000000000000000ffff4d06718b208d226f0754010000000000000000000000000000000000ffff44248ba1208da3af7354010000000000000000000000000000000000ffff86f9d72c208d9fd68754010000000000000000000000000000000000ffff521f2444208dae428854010000000000000000000000000000000000ffffd445b025208dfafc8754010000000000000000000000000000000000ffffd447fa84208dbb358854010000000000000000000000000000000000ffff3ee2d196208da01a8854010000000000000000000000000000000000ffff45a615b2208d32edb053010000000000000000000000000000000000ffff6d6494da208d77ed8754010000000000000000000000000000000000ffff555dcc44208d09608754010000000000000000000000000000000000ffff45a5d222208d84558754010000000000000000000000000000000000ffffb01c30ab208d71fe8754010000000000000000000000000000000000ffffae5f68c2208de0acdf53010000000000000000000000000000000000ffffae737936208d29e18754010000000000000000000000000000000000ffffb00a63cb208d220b8854010000000000000000000000000000000000ffff9ec4d12f208db4408854010000000000000000000000000000000000ffff4c6d9bcc208d65a58754010000000000000000000000000000000000ffff5962c453208d2d628854010000000000000000000000000000000000ffff257191d50000" + }, + "PING": { + "message": "f9beb4d9706f6e67000000000000000008000000c6466f1e6b86480ae969867c", + "payload": "6b86480ae969867c" + } +} diff --git a/packages/kauri-bitcore-lib/test/data/sighash.json b/packages/kauri-bitcore-lib/test/data/sighash.json new file mode 100644 index 0000000..d66a56a --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/sighash.json @@ -0,0 +1,503 @@ +[ + ["raw_transaction, script, input_index, hashType, signature_hash (result)"], + ["907c2bc503ade11cc3b04eb2918b6f547b0630ab569273824748c87ea14b0696526c66ba740200000004ab65ababfd1f9bdd4ef073c7afc4ae00da8a66f429c917a0081ad1e1dabce28d373eab81d8628de802000000096aab5253ab52000052ad042b5f25efb33beec9f3364e8a9139e8439d9d7e26529c3c30b6c3fd89f8684cfd68ea0200000009ab53526500636a52ab599ac2fe02a526ed040000000008535300516352515164370e010000000003006300ab2ec229", "", 2, 1864164639, "31af167a6cf3f9d5f6875caa4d31704ceb0eba078d132b78dab52c3b8997317e"], + ["a0aa3126041621a6dea5b800141aa696daf28408959dfb2df96095db9fa425ad3f427f2f6103000000015360290e9c6063fa26912c2e7fb6a0ad80f1c5fea1771d42f12976092e7a85a4229fdb6e890000000001abc109f6e47688ac0e4682988785744602b8c87228fcef0695085edf19088af1a9db126e93000000000665516aac536affffffff8fe53e0806e12dfd05d67ac68f4768fdbe23fc48ace22a5aa8ba04c96d58e2750300000009ac51abac63ab5153650524aa680455ce7b000000000000499e50030000000008636a00ac526563ac5051ee030000000003abacabd2b6fe000000000003516563910fb6b5", "65", 0, -1391424484, "48d6a1bd2cd9eec54eb866fc71209418a950402b5d7e52363bfb75c98e141175"], + ["6e7e9d4b04ce17afa1e8546b627bb8d89a6a7fefd9d892ec8a192d79c2ceafc01694a6a7e7030000000953ac6a51006353636a33bced1544f797f08ceed02f108da22cd24c9e7809a446c61eb3895914508ac91f07053a01000000055163ab516affffffff11dc54eee8f9e4ff0bcf6b1a1a35b1cd10d63389571375501af7444073bcec3c02000000046aab53514a821f0ce3956e235f71e4c69d91abe1e93fb703bd33039ac567249ed339bf0ba0883ef300000000090063ab65000065ac654bec3cc504bcf499020000000005ab6a52abac64eb060100000000076a6a5351650053bbbc130100000000056a6aab53abd6e1380100000000026a51c4e509b8", "acab655151", 0, 479279909, "2a3d95b09237b72034b23f2d2bb29fa32a58ab5c6aa72f6aafdfa178ab1dd01c"], + ["73107cbd025c22ebc8c3e0a47b2a760739216a528de8d4dab5d45cbeb3051cebae73b01ca10200000007ab6353656a636affffffffe26816dffc670841e6a6c8c61c586da401df1261a330a6c6b3dd9f9a0789bc9e000000000800ac6552ac6aac51ffffffff0174a8f0010000000004ac52515100000000", "5163ac63635151ac", 1, 1190874345, "06e328de263a87b09beabe222a21627a6ea5c7f560030da31610c4611f4a46bc"], + ["e93bbf6902be872933cb987fc26ba0f914fcfc2f6ce555258554dd9939d12032a8536c8802030000000453ac5353eabb6451e074e6fef9de211347d6a45900ea5aaf2636ef7967f565dce66fa451805c5cd10000000003525253ffffffff047dc3e6020000000007516565ac656aabec9eea010000000001633e46e600000000000015080a030000000001ab00000000", "5300ac6a53ab6a", 1, -886562767, "f03aa4fc5f97e826323d0daa03343ebf8a34ed67a1ce18631f8b88e5c992e798"], + ["50818f4c01b464538b1e7e7f5ae4ed96ad23c68c830e78da9a845bc19b5c3b0b20bb82e5e9030000000763526a63655352ffffffff023b3f9c040000000008630051516a6a5163a83caf01000000000553ab65510000000000", "6aac", 0, 946795545, "746306f322de2b4b58ffe7faae83f6a72433c22f88062cdde881d4dd8a5a4e2d"], + ["a93e93440250f97012d466a6cc24839f572def241c814fe6ae94442cf58ea33eb0fdd9bcc1030000000600636a0065acffffffff5dee3a6e7e5ad6310dea3e5b3ddda1a56bf8de7d3b75889fc024b5e233ec10f80300000007ac53635253ab53ffffffff0160468b04000000000800526a5300ac526a00000000", "ac00636a53", 1, 1773442520, "5c9d3a2ce9365bb72cfabbaa4579c843bb8abf200944612cf8ae4b56a908bcbd"], + ["ce7d371f0476dda8b811d4bf3b64d5f86204725deeaa3937861869d5b2766ea7d17c57e40b0100000003535265ffffffff7e7e9188f76c34a46d0bbe856bde5cb32f089a07a70ea96e15e92abb37e479a10100000006ab6552ab655225bcab06d1c2896709f364b1e372814d842c9c671356a1aa5ca4e060462c65ae55acc02d0000000006abac0063ac5281b33e332f96beebdbc6a379ebe6aea36af115c067461eb99d22ba1afbf59462b59ae0bd0200000004ab635365be15c23801724a1704000000000965006a65ac00000052ca555572", "53ab530051ab", 1, 2030598449, "c336b2f7d3702fbbdeffc014d106c69e3413c7c71e436ba7562d8a7a2871f181"], + ["d3b7421e011f4de0f1cea9ba7458bf3486bee722519efab711a963fa8c100970cf7488b7bb0200000003525352dcd61b300148be5d05000000000000000000", "535251536aac536a", 0, -1960128125, "29aa6d2d752d3310eba20442770ad345b7f6a35f96161ede5f07b33e92053e2a"], + ["04bac8c5033460235919a9c63c42b2db884c7c8f2ed8fcd69ff683a0a2cccd9796346a04050200000003655351fcad3a2c5a7cbadeb4ec7acc9836c3f5c3e776e5c566220f7f965cf194f8ef98efb5e3530200000007526a006552526526a2f55ba5f69699ece76692552b399ba908301907c5763d28a15b08581b23179cb01eac03000000075363ab6a516351073942c2025aa98a05000000000765006aabac65abd7ffa6030000000004516a655200000000", "53ac6365ac526a", 1, 764174870, "bf5fdc314ded2372a0ad078568d76c5064bf2affbde0764c335009e56634481b"], + ["c363a70c01ab174230bbe4afe0c3efa2d7f2feaf179431359adedccf30d1f69efe0c86ed390200000002ab51558648fe0231318b04000000000151662170000000000008ac5300006a63acac00000000", "", 0, 2146479410, "191ab180b0d753763671717d051f138d4866b7cb0d1d4811472e64de595d2c70"], + ["8d437a7304d8772210a923fd81187c425fc28c17a5052571501db05c7e89b11448b36618cd02000000026a6340fec14ad2c9298fde1477f1e8325e5747b61b7e2ff2a549f3d132689560ab6c45dd43c3010000000963ac00ac000051516a447ed907a7efffebeb103988bf5f947fc688aab2c6a7914f48238cf92c337fad4a79348102000000085352ac526a5152517436edf2d80e3ef06725227c970a816b25d0b58d2cd3c187a7af2cea66d6b27ba69bf33a0300000007000063ab526553f3f0d6140386815d030000000003ab6300de138f00000000000900525153515265abac1f87040300000000036aac6500000000", "51", 3, -315779667, "b6632ac53578a741ae8c36d8b69e79f39b89913a2c781cdf1bf47a8c29d997a5"], + ["fd878840031e82fdbe1ad1d745d1185622b0060ac56638290ec4f66b1beef4450817114a2c0000000009516a63ab53650051abffffffff37b7a10322b5418bfd64fb09cd8a27ddf57731aeb1f1f920ffde7cb2dfb6cdb70300000008536a5365ac53515369ecc034f1594690dbe189094dc816d6d57ea75917de764cbf8eccce4632cbabe7e116cd0100000003515352ffffffff035777fc000000000003515200abe9140300000000050063005165bed6d10200000000076300536363ab65195e9110", "635265", 0, 1729787658, "6e3735d37a4b28c45919543aabcb732e7a3e1874db5315abb7cc6b143d62ff10"], + ["f40a750702af06efff3ea68e5d56e42bc41cdb8b6065c98f1221fe04a325a898cb61f3d7ee030000000363acacffffffffb5788174aef79788716f96af779d7959147a0c2e0e5bfb6c2dba2df5b4b97894030000000965510065535163ac6affffffff0445e6fd0200000000096aac536365526a526aa6546b000000000008acab656a6552535141a0fd010000000000c897ea030000000008526500ab526a6a631b39dba3", "00abab5163ac", 1, -1778064747, "d76d0fc0abfa72d646df888bce08db957e627f72962647016eeae5a8412354cf"], + ["a63bc673049c75211aa2c09ecc38e360eaa571435fedd2af1116b5c1fa3d0629c269ecccbf0000000008ac65ab516352ac52ffffffffbf1a76fdda7f451a5f0baff0f9ccd0fe9136444c094bb8c544b1af0fa2774b06010000000463535253ffffffff13d6b7c3ddceef255d680d87181e100864eeb11a5bb6a3528cb0d70d7ee2bbbc02000000056a0052abab951241809623313b198bb520645c15ec96bfcc74a2b0f3db7ad61d455cc32db04afc5cc702000000016309c9ae25014d9473020000000004abab6aac3bb1e803", "", 3, -232881718, "6e48f3da3a4ac07eb4043a232df9f84e110485d7c7669dd114f679c27d15b97e"], + ["4c565efe04e7d32bac03ae358d63140c1cfe95de15e30c5b84f31bb0b65bb542d637f49e0f010000000551abab536348ae32b31c7d3132030a510a1b1aacf7b7c3f19ce8dc49944ef93e5fa5fe2d356b4a73a00100000009abac635163ac00ab514c8bc57b6b844e04555c0a4f4fb426df139475cd2396ae418bc7015820e852f711519bc202000000086a00510000abac52488ff4aec72cbcfcc98759c58e20a8d2d9725aa4a80f83964e69bc4e793a4ff25cd75dc701000000086a52ac6aac5351532ec6b10802463e0200000000000553005265523e08680100000000002f39a6b0", "", 3, 70712784, "c6076b6a45e6fcfba14d3df47a34f6aadbacfba107e95621d8d7c9c0e40518ed"], + ["1233d5e703403b3b8b4dae84510ddfc126b4838dcb47d3b23df815c0b3a07b55bf3098110e010000000163c5c55528041f480f40cf68a8762d6ed3efe2bd402795d5233e5d94bf5ddee71665144898030000000965525165655151656affffffff6381667e78bb74d0880625993bec0ea3bd41396f2bcccc3cc097b240e5e92d6a01000000096363acac6a63536365ffffffff04610ad60200000000065251ab65ab52e90d680200000000046351516ae30e98010000000008abab52520063656a671856010000000004ac6aac514c84e383", "6aabab636300", 1, -114996813, "aeb8c5a62e8a0b572c28f2029db32854c0b614dbecef0eaa726abebb42eebb8d"], + ["0c69702103b25ceaed43122cc2672de84a3b9aa49872f2a5bb458e19a52f8cc75973abb9f102000000055365656aacffffffff3ffb1cf0f76d9e3397de0942038c856b0ebbea355dc9d8f2b06036e19044b0450100000000ffffffff4b7793f4169617c54b734f2cd905ed65f1ce3d396ecd15b6c426a677186ca0620200000008655263526551006a181a25b703240cce0100000000046352ab53dee22903000000000865526a6a516a51005e121602000000000852ab52ababac655200000000", "6a516aab63", 1, -2040012771, "a6e6cb69f409ec14e10dd476f39167c29e586e99bfac93a37ed2c230fcc1dbbe"], + ["fd22692802db8ae6ab095aeae3867305a954278f7c076c542f0344b2591789e7e33e4d29f4020000000151ffffffffb9409129cfed9d3226f3b6bab7a2c83f99f48d039100eeb5796f00903b0e5e5e0100000006656552ac63abd226abac0403e649000000000007abab51ac5100ac8035f10000000000095165006a63526a52510d42db030000000007635365ac6a63ab24ef5901000000000453ab6a0000000000", "536a52516aac6a", 1, 309309168, "7ca0f75e6530ec9f80d031fc3513ca4ecd67f20cb38b4dacc6a1d825c3cdbfdb"], + ["a43f85f701ffa54a3cc57177510f3ea28ecb6db0d4431fc79171cad708a6054f6e5b4f89170000000008ac6a006a536551652bebeaa2013e779c05000000000665ac5363635100000000", "ac", 0, 2028978692, "58294f0d7f2e68fe1fd30c01764fe1619bcc7961d68968944a0e263af6550437"], + ["c2b0b99001acfecf7da736de0ffaef8134a9676811602a6299ba5a2563a23bb09e8cbedf9300000000026300ffffffff042997c50300000000045252536a272437030000000007655353ab6363ac663752030000000002ab6a6d5c900000000000066a6a5265abab00000000", "52ac525163515251", 0, -894181723, "8b300032a1915a4ac05cea2f7d44c26f2a08d109a71602636f15866563eaafdc"], + ["82f9f10304c17a9d954cf3380db817814a8c738d2c811f0412284b2c791ec75515f38c4f8c020000000265ab5729ca7db1b79abee66c8a757221f29280d0681355cb522149525f36da760548dbd7080a0100000001510b477bd9ce9ad5bb81c0306273a3a7d051e053f04ecf3a1dbeda543e20601a5755c0cfae030000000451ac656affffffff71141a04134f6c292c2e0d415e6705dfd8dcee892b0d0807828d5aeb7d11f5ef0300000001520b6c6dc802a6f3dd0000000000056aab515163bfb6800300000000015300000000", "", 3, -635779440, "d55ed1e6c53510f2608716c12132a11fb5e662ec67421a513c074537eeccc34b"], + ["8edcf5a1014b604e53f0d12fe143cf4284f86dc79a634a9f17d7e9f8725f7beb95e8ffcd2403000000046aabac52ffffffff01c402b5040000000005ab6a63525100000000", "6351525251acabab6a", 0, 1520147826, "2765bbdcd3ebb8b1a316c04656b28d637f80bffbe9b040661481d3dc83eea6d6"], + ["2074bad5011847f14df5ea7b4afd80cd56b02b99634893c6e3d5aaad41ca7c8ee8e5098df003000000026a6affffffff018ad59700000000000900ac656a526551635300000000", "65635265", 0, -1804671183, "663c999a52288c9999bff36c9da2f8b78d5c61b8347538f76c164ccba9868d0a"], + ["7100b11302e554d4ef249ee416e7510a485e43b2ba4b8812d8fe5529fe33ea75f36d392c4403000000020000ffffffff3d01a37e075e9a7715a657ae1bdf1e44b46e236ad16fd2f4c74eb9bf370368810000000007636553ac536365ffffffff01db696a0400000000065200ac656aac00000000", "63005151", 0, -1210499507, "b9c3aee8515a4a3b439de1ffc9c156824bda12cb75bfe5bc863164e8fd31bd7a"], + ["02c1017802091d1cb08fec512db7b012fe4220d57a5f15f9e7676358b012786e1209bcff950100000004acab6352ffffffff799bc282724a970a6fea1828984d0aeb0f16b67776fa213cbdc4838a2f1961a3010000000951516a536552ab6aabffffffff016c7b4b03000000000865abac5253ac5352b70195ad", "65655200516a", 0, -241626954, "be567cb47170b34ff81c66c1142cb9d27f9b6898a384d6dfc4fce16b75b6cb14"], + ["cb3178520136cd294568b83bb2520f78fecc507898f4a2db2674560d72fd69b9858f75b3b502000000066aac00515100ffffffff03ab005a01000000000563526363006e3836030000000001abfbda3200000000000665ab0065006500000000", "ab516a0063006a5300", 0, 1182109299, "2149e79c3f4513da4e4378608e497dcfdfc7f27c21a826868f728abd2b8a637a"], + ["18a4b0c004702cf0e39686ac98aab78ad788308f1d484b1ddfe70dc1997148ba0e28515c310300000000ffffffff05275a52a23c59da91129093364e275da5616c4070d8a05b96df5a2080ef259500000000096aac51656a6aac53ab66e64966b3b36a07dd2bb40242dd4a3743d3026e7e1e0d9e9e18f11d068464b989661321030000000265ac383339c4fae63379cafb63b0bab2eca70e1f5fc7d857eb5c88ccd6c0465093924bba8b2a000000000300636ab5e0545402bc2c4c010000000000cd41c002000000000000000000", "abac635253656a00", 3, 2052372230, "32db877b6b1ca556c9e859442329406f0f8246706522369839979a9f7a235a32"], + ["1d9c5df20139904c582285e1ea63dec934251c0f9cf5c47e86abfb2b394ebc57417a81f67c010000000353515222ba722504800d3402000000000353656a3c0b4a0200000000000fb8d20500000000076300ab005200516462f30400000000015200000000", "ab65", 0, -210854112, "edf73e2396694e58f6b619f68595b0c1cdcb56a9b3147845b6d6afdb5a80b736"], + ["4504cb1904c7a4acf375ddae431a74de72d5436efc73312cf8e9921f431267ea6852f9714a01000000066a656a656553a2fbd587c098b3a1c5bd1d6480f730a0d6d9b537966e20efc0e352d971576d0f87df0d6d01000000016321aeec3c4dcc819f1290edb463a737118f39ab5765800547522708c425306ebfca3f396603000000055300ac656a1d09281d05bfac57b5eb17eb3fa81ffcedfbcd3a917f1be0985c944d473d2c34d245eb350300000007656a51525152ac263078d9032f470f0500000000066aac00000052e12da60200000000003488410200000000076365006300ab539981e432", "52536a52526a", 1, -31909119, "f0a2deee7fd8a3a9fad6927e763ded11c940ee47e9e6d410f94fda5001f82e0c"], + ["14bc7c3e03322ec0f1311f4327e93059c996275302554473104f3f7b46ca179bfac9ef753503000000016affffffff9d405eaeffa1ca54d9a05441a296e5cc3a3e32bb8307afaf167f7b57190b07e00300000008abab51ab5263abab45533aa242c61bca90dd15d46079a0ab0841d85df67b29ba87f2393cd764a6997c372b55030000000452005263ffffffff0250f40e02000000000651516a0063630e95ab0000000000046a5151ac00000000", "6a65005151", 0, -1460947095, "aa418d096929394c9147be8818d8c9dafe6d105945ab9cd7ec682df537b5dd79"], + ["2b3bd0dd04a1832f893bf49a776cd567ec4b43945934f4786b615d6cb850dfc0349b33301a000000000565ac000051cf80c670f6ddafab63411adb4d91a69c11d9ac588898cbfb4cb16061821cc104325c895103000000025163ffffffffa9e2d7506d2d7d53b882bd377bbcc941f7a0f23fd15d2edbef3cd9df8a4c39d10200000009ac63006a52526a5265ffffffff44c099cdf10b10ce87d4b38658d002fd6ea17ae4a970053c05401d86d6e75f99000000000963ab53526a5252ab63ffffffff035af69c01000000000100ba9b8b0400000000004cead10500000000026a520b77d667", "ab52abac526553", 3, -1955078165, "eb9ceecc3b401224cb79a44d23aa8f428e29f1405daf69b4e01910b848ef1523"], + ["35df11f004a48ba439aba878fe9df20cc935b4a761c262b1b707e6f2b33e2bb7565cd68b130000000000ffffffffb2a2f99abf64163bb57ca900500b863f40c02632dfd9ea2590854c5fb4811da90200000006ac006363636affffffffaf9d89b2a8d2670ca37c8f7c140600b81259f2e037cb4590578ec6e37af8bf200000000005abac6a655270a4751eb551f058a93301ffeda2e252b6614a1fdd0e283e1d9fe53c96c5bbaafaac57b8030000000153ffffffff020d9f3b02000000000100ed7008030000000004abac000000000000", "abac", 3, 593793071, "88fdee1c2d4aeead71d62396e28dc4d00e5a23498eea66844b9f5d26d1f21042"], + ["a08ff466049fb7619e25502ec22fedfb229eaa1fe275aa0b5a23154b318441bf547989d0510000000005ab5363636affffffff2b0e335cb5383886751cdbd993dc0720817745a6b1c9b8ab3d15547fc9aafd03000000000965656a536a52656a532b53d10584c290d3ac1ab74ab0a19201a4a039cb59dc58719821c024f6bf2eb26322b33f010000000965ac6aac0053ab6353ffffffff048decba6ebbd2db81e416e39dde1f821ba69329725e702bcdea20c5cc0ecc6402000000086363ab5351ac6551466e377b0468c0fa00000000000651ab53ac6a513461c6010000000008636a636365535100eeb3dc010000000006526a52ac516a43f362010000000005000063536500000000", "0063516a", 1, -1158911348, "f6a1ecb50bd7c2594ebecea5a1aa23c905087553e40486dade793c2f127fdfae"], + ["5ac2f17d03bc902e2bac2469907ec7d01a62b5729340bc58c343b7145b66e6b97d434b30fa000000000163ffffffff44028aa674192caa0d0b4ebfeb969c284cb16b80c312d096efd80c6c6b094cca000000000763acabac516a52ffffffff10c809106e04b10f9b43085855521270fb48ab579266e7474657c6c625062d2d030000000351636595a0a97004a1b69603000000000465ab005352ad68010000000008636a5263acac5100da7105010000000002acab90325200000000000000000000", "6a6aab516a63526353", 2, 1518400956, "f7efb74b1dcc49d316b49c632301bc46f98d333c427e55338be60c7ef0d953be"], + ["aeb2e11902dc3770c218b97f0b1960d6ee70459ecb6a95eff3f05295dc1ef4a0884f10ba460300000005516352526393e9b1b3e6ae834102d699ddd3845a1e159aa7cf7635edb5c02003f7830fee3788b795f20100000009ab006a526553ac006ad8809c570469290e0400000000050000abab00b10fd5040000000008ab655263abac53ab630b180300000000009d9993040000000002516300000000", "5351ababac6a65", 0, 1084852870, "f2286001af0b0170cbdad92693d0a5ebaa8262a4a9d66e002f6d79a8c94026d1"], + ["9860ca9a0294ff4812534def8c3a3e3db35b817e1a2ddb7f0bf673f70eab71bb79e90a2f3100000000086a636551acac5165ffffffffed4d6d3cd9ff9b2d490e0c089739121161a1445844c3e204296816ab06e0a83702000000035100ac88d0db5201c3b59a050000000005ac6a0051ab00000000", "535263ab006a526aab", 1, -962088116, "30df2473e1403e2b8e637e576825f785528d998af127d501556e5f7f5ed89a2a"], + ["4ddaa680026ec4d8060640304b86823f1ac760c260cef81d85bd847952863d629a3002b54b0200000008526365636a656aab65457861fc6c24bdc760c8b2e906b6656edaf9ed22b5f50e1fb29ec076ceadd9e8ebcb6b000000000152ffffffff033ff04f00000000000551526a00657a1d900300000000002153af040000000003006a6300000000", "ab526a53acabab", 0, 1055317633, "7f21b62267ed52462e371a917eb3542569a4049b9dfca2de3c75872b39510b26"], + ["01e76dcd02ad54cbc8c71d68eaf3fa7c883b65d74217b30ba81f1f5144ef80b706c0dc82ca000000000352ab6a078ec18bcd0514825feced2e8b8ea1ccb34429fae41c70cc0b73a2799e85603613c6870002000000086363ab6365536a53ffffffff043acea90000000000016ad20e1803000000000100fa00830200000000056352515351e864ee00000000000865535253ab6a6551d0c46672", "6a6365abacab", 0, -1420559003, "8af0b4cbdbc011be848edf4dbd2cde96f0578d662cfebc42252495387114224a"], + ["fa00b26402670b97906203434aa967ce1559d9bd097d56dbe760469e6032e7ab61accb54160100000006635163630052fffffffffe0d3f4f0f808fd9cfb162e9f0c004601acf725cd7ea5683bbdc9a9a433ef15a0200000005ab52536563d09c7bef049040f305000000000153a7c7b9020000000004ac63ab52847a2503000000000553ab00655390ed80010000000005006553ab52860671d4", "536565ab52", 0, 799022412, "40ed8e7bbbd893e15f3cce210ae02c97669818de5946ca37eefc7541116e2c78"], + ["cb5c06dc01b022ee6105ba410f0eb12b9ce5b5aa185b28532492d839a10cef33d06134b91b010000000153ffffffff02cec0530400000000005e1e4504000000000865656551acacac6a00000000", "ab53", 0, -1514251329, "136beb95459fe6b126cd6cefd54eb5d971524b0e883e41a292a78f78015cb8d5"], + ["f10a0356031cd569d652dbca8e7a4d36c8da33cdff428d003338602b7764fe2c96c505175b010000000465ac516affffffffbb54563c71136fa944ee20452d78dc87073ac2365ba07e638dce29a5d179da600000000003635152ffffffff9a411d8e2d421b1e6085540ee2809901e590940bbb41532fa38bd7a16b68cc350100000007535251635365636195df1603b61c45010000000002ab65bf6a310400000000026352fcbba10200000000016aa30b7ff0", "5351", 0, 1552495929, "9eb8adf2caecb4bf9ac59d7f46bd20e83258472db2f569ee91aba4cf5ee78e29"], + ["c3325c9b012f659466626ca8f3c61dfd36f34670abc054476b7516a1839ec43cd0870aa0c0000000000753525265005351e7e3f04b0112650500000000000363ac6300000000", "acac", 0, -68961433, "5ca70e727d91b1a42b78488af2ed551642c32d3de4712a51679f60f1456a8647"], + ["2333e54c044370a8af16b9750ac949b151522ea6029bacc9a34261599549581c7b4e5ece470000000007510052006563abffffffff80630fc0155c750ce20d0ca4a3d0c8e8d83b014a5b40f0b0be0dd4c63ac28126020000000465000000ffffffff1b5f1433d38cdc494093bb1d62d84b10abbdae57e3d04e82e600857ab3b1dc990300000003515100b76564be13e4890a908ea7508afdad92ec1b200a9a67939fadce6eb7a29eb4550a0a28cb0300000001acffffffff02926c930300000000016373800201000000000153d27ee740", "ab6365ab516a53", 3, 598653797, "2be27a686eb7940dd32c44ff3a97c1b28feb7ab9c5c0b1593b2d762361cfc2db"], + ["b500ca48011ec57c2e5252e5da6432089130603245ffbafb0e4c5ffe6090feb629207eeb0e010000000652ab6a636aab8302c9d2042b44f40500000000015278c05a050000000004ac5251524be080020000000007636aac63ac5252c93a9a04000000000965ab6553636aab5352d91f9ddb", "52005100", 0, -2024394677, "49c8a6940a461cc7225637f1e512cdd174c99f96ec05935a59637ededc77124c"], + ["f52ff64b02ee91adb01f3936cc42e41e1672778962b68cf013293d649536b519bc3271dd2c00000000020065afee11313784849a7c15f44a61cd5fd51ccfcdae707e5896d131b082dc9322a19e12858501000000036aac654e8ca882022deb7c020000000006006a515352abd3defc0000000000016300000000", "63520063", 0, 1130989496, "7f208df9a5507e98c62cebc5c1e2445eb632e95527594929b9577b53363e96f6"], + ["ab7d6f36027a7adc36a5cf7528fe4fb5d94b2c96803a4b38a83a675d7806dda62b380df86a0000000003000000ffffffff5bc00131e29e22057c04be854794b4877dda42e416a7a24706b802ff9da521b20000000007ac6a0065ac52ac957cf45501b9f06501000000000500ac6363ab25f1110b", "00526500536a635253", 0, 911316637, "5fa09d43c8aef6f6fa01c383a69a5a61a609cd06e37dce35a39dc9eae3ddfe6c"], + ["f940888f023dce6360263c850372eb145b864228fdbbb4c1186174fa83aab890ff38f8c9a90300000000ffffffff01e80ccdb081e7bbae1c776531adcbfb77f2e5a7d0e5d0d0e2e6c8758470e85f00000000020053ffffffff03b49088050000000004656a52ab428bd604000000000951630065ab63ac636a0cbacf0400000000070063ac5265ac53d6e16604", "ac63", 0, 39900215, "713ddeeefcfe04929e7b6593c792a4efbae88d2b5280d1f0835d2214eddcbad6"], + ["530ecd0b01ec302d97ef6f1b5a6420b9a239714013e20d39aa3789d191ef623fc215aa8b940200000005ac5351ab6a3823ab8202572eaa04000000000752ab6a51526563fd8a270100000000036a006581a798f0", "525153656a0063", 0, 1784562684, "fe42f73a8742676e640698222b1bd6b9c338ff1ccd766d3d88d7d3c6c6ac987e"], + ["5d781d9303acfcce964f50865ddfddab527ea971aee91234c88e184979985c00b4de15204b0100000003ab6352a009c8ab01f93c8ef2447386c434b4498538f061845862c3f9d5751ad0fce52af442b3a902000000045165ababb909c66b5a3e7c81b3c45396b944be13b8aacfc0204f3f3c105a66fa8fa6402f1b5efddb01000000096a65ac636aacab656ac3c677c402b79fa4050000000004006aab5133e35802000000000751ab635163ab0078c2e025", "6aac51636a6a005265", 0, -882306874, "551ce975d58647f10adefb3e529d9bf9cda34751627ec45e690f135ef0034b95"], + ["25ee54ef0187387564bb86e0af96baec54289ca8d15e81a507a2ed6668dc92683111dfb7a50100000004005263634cecf17d0429aa4d000000000007636a6aabab5263daa75601000000000251ab4df70a01000000000151980a890400000000065253ac6a006377fd24e3", "65ab", 0, 797877378, "069f38fd5d47abff46f04ee3ae27db03275e9aa4737fa0d2f5394779f9654845"], + ["a9c57b1a018551bcbc781b256642532bbc09967f1cbe30a227d352a19365d219d3f11649a3030000000451655352b140942203182894030000000006ab00ac6aab654add350400000000003d379505000000000553abacac00e1739d36", "5363", 0, -1069721025, "6da32416deb45a0d720a1dbe6d357886eabc44029dd5db74d50feaffbe763245"], + ["05c4fb94040f5119dc0b10aa9df054871ed23c98c890f1e931a98ffb0683dac45e98619fdc0200000007acab6a525263513e7495651c9794c4d60da835d303eb4ee6e871f8292f6ad0b32e85ef08c9dc7aa4e03c9c010000000500ab52acacfffffffffee953259cf14ced323fe8d567e4c57ba331021a1ef5ac2fa90f7789340d7c550100000007ac6aacac6a6a53ffffffff08d9dc820d00f18998af247319f9de5c0bbd52a475ea587f16101af3afab7c210100000003535363569bca7c0468e34f00000000000863536353ac51ac6584e319010000000006650052ab6a533debea030000000003ac0053ee7070020000000006ac52005253ac00000000", "6351005253", 2, 1386916157, "76c4013c40bfa1481badd9d342b6d4b8118de5ab497995fafbf73144469e5ff0"], + ["c95ab19104b63986d7303f4363ca8f5d2fa87c21e3c5d462b99f1ebcb7c402fc012f5034780000000009006aac63ac65655265ffffffffbe91afa68af40a8700fd579c86d4b706c24e47f7379dad6133de389f815ef7f501000000046aac00abffffffff1520db0d81be4c631878494668d258369f30b8f2b7a71e257764e9a27f24b48701000000076a515100535300b0a989e1164db9499845bac01d07a3a7d6d2c2a76e4c04abe68f808b6e2ef5068ce6540e0100000009ac53636a63ab65656affffffff0309aac6050000000005ab6563656a6067e8020000000003ac536aec91c8030000000009655251ab65ac6a53acc7a45bc5", "63526a65abac", 1, 512079270, "fb7eca81d816354b6aedec8cafc721d5b107336657acafd0d246049556f9e04b"], + ["ca66ae10049533c2b39f1449791bd6d3f039efe0a121ab7339d39ef05d6dcb200ec3fb2b3b020000000465006a53ffffffff534b8f97f15cc7fb4f4cea9bf798472dc93135cd5b809e4ca7fe4617a61895980100000000ddd83c1dc96f640929dd5e6f1151dab1aa669128591f153310d3993e562cc7725b6ae3d903000000046a52536582f8ccddb8086d8550f09128029e1782c3f2624419abdeaf74ecb24889cc45ac1a64492a0100000002516a4867b41502ee6ccf03000000000752acacab52ab6a4b7ba80000000000075151ab0052536300000000", "6553", 2, -62969257, "8085e904164ab9a8c20f58f0d387f6adb3df85532e11662c03b53c3df8c943cb"], + ["ba646d0b0453999f0c70cb0430d4cab0e2120457bb9128ed002b6e9500e9c7f8d7baa20abe0200000001652a4e42935b21db02b56bf6f08ef4be5adb13c38bc6a0c3187ed7f6197607ba6a2c47bc8a03000000040052516affffffffa55c3cbfc19b1667594ac8681ba5d159514b623d08ed4697f56ce8fcd9ca5b0b00000000096a6a5263ac655263ab66728c2720fdeabdfdf8d9fb2bfe88b295d3b87590e26a1e456bad5991964165f888c03a0200000006630051ac00acffffffff0176fafe0100000000070063acac65515200000000", "63", 1, 2002322280, "9db4e320208185ee70edb4764ee195deca00ba46412d5527d9700c1cf1c3d057"], + ["2ddb8f84039f983b45f64a7a79b74ff939e3b598b38f436def7edd57282d0803c7ef34968d02000000026a537eb00c4187de96e6e397c05f11915270bcc383959877868ba93bac417d9f6ed9f627a7930300000004516551abffffffffacc12f1bb67be3ae9f1d43e55fda8b885340a0df1175392a8bbd9f959ad3605003000000025163ffffffff02ff0f4700000000000070bd99040000000003ac53abf8440b42", "", 2, -393923011, "0133f1a161363b71dfb3a90065c7128c56bd0028b558b610142df79e055ab5c7"], + ["b21fc15403b4bdaa994204444b59323a7b8714dd471bd7f975a4e4b7b48787e720cbd1f5f00000000000ffffffff311533001cb85c98c1d58de0a5fbf27684a69af850d52e22197b0dc941bc6ca9030000000765ab6363ab5351a8ae2c2c7141ece9a4ff75c43b7ea9d94ec79b7e28f63e015ac584d984a526a73fe1e04e0100000007526352536a5365ffffffff02a0a9ea030000000002ab52cfc4f300000000000465525253e8e0f342", "000000", 1, 1305253970, "d1df1f4bba2484cff8a816012bb6ec91c693e8ca69fe85255e0031711081c46a"], + ["d1704d6601acf710b19fa753e307cfcee2735eada0d982b5df768573df690f460281aad12d0000000007656300005100acffffffff0232205505000000000351ab632ca1bc0300000000016300000000", "ac65ab65ab51", 0, 165179664, "40b4f03c68288bdc996011b0f0ddb4b48dc3be6762db7388bdc826113266cd6c"], + ["d2f6c096025cc909952c2400bd83ac3d532bfa8a1f8f3e73c69b1fd7b8913379793f3ce92202000000076a00ab6a53516ade5332d81d58b22ed47b2a249ab3a2cb3a6ce9a6b5a6810e18e3e1283c1a1b3bd73e3ab00300000002acabffffffff01a9b2d40500000000056352abab00dc4b7f69", "ab0065", 0, -78019184, "2ef025e907f0fa454a2b48a4f3b81346ba2b252769b5c35d742d0c8985e0bf5e"], + ["3e6db1a1019444dba461247224ad5933c997256d15c5d37ade3d700506a0ba0a57824930d7010000000852ab6500ab00ac00ffffffff03389242020000000001aba8465a0200000000086a6a636a5100ab52394e6003000000000953ac51526351000053d21d9800", "abababacab53ab65", 0, 1643661850, "1f8a3aca573a609f4aea0c69522a82fcb4e15835449da24a05886ddc601f4f6a"], + ["f821a042036ad43634d29913b77c0fc87b4af593ac86e9a816a9d83fd18dfcfc84e1e1d57102000000076a63ac52006351ffffffffbcdaf490fc75086109e2f832c8985716b3a624a422cf9412fe6227c10585d21203000000095252abab5352ac526affffffff2efed01a4b73ad46c7f7bc7fa3bc480f8e32d741252f389eaca889a2e9d2007e000000000353ac53ffffffff032ac8b3020000000009636300000063516300d3d9f2040000000006510065ac656aafa5de0000000000066352ab5300ac9042b57d", "525365", 1, 667065611, "0d17a92c8d5041ba09b506ddf9fd48993be389d000aad54f9cc2a44fcc70426b"], + ["58e3f0f704a186ef55d3919061459910df5406a9121f375e7502f3be872a449c3f2bb058380100000000f0e858da3ac57b6c973f889ad879ffb2bd645e91b774006dfa366c74e2794aafc8bbc871010000000751ac65516a515131a68f120fd88ca08687ceb4800e1e3fbfea7533d34c84fef70cc5a96b648d580369526d000000000600ac00515363f6191d5b3e460fa541a30a6e83345dedfa3ed31ad8574d46d7bbecd3c9074e6ba5287c24020000000151e3e19d6604162602010000000004005100ac71e17101000000000065b5e90300000000040053ab53f6b7d101000000000200ac00000000", "6563ab", 1, -669018604, "8221d5dfb75fc301a80e919e158e0b1d1e86ffb08870a326c89408d9bc17346b"], + ["efec1cce044a676c1a3d973f810edb5a9706eb4cf888a240f2b5fb08636bd2db482327cf500000000005ab51656a52ffffffff46ef019d7c03d9456e5134eb0a7b5408d274bd8e33e83df44fab94101f7c5b650200000009ac5100006353630051407aadf6f5aaffbd318fdbbc9cae4bd883e67d524df06bb006ce2f7c7e2725744afb76960100000005536aab53acec0d64eae09e2fa1a7c4960354230d51146cf6dc45ee8a51f489e20508a785cbe6ca86fc000000000651536a516300ffffffff014ef598020000000006636aac655265a6ae1b75", "53516a5363526563ab", 2, -1823982010, "13e8b5ab4e5b2ceeff0045c625e19898bda2d39fd7af682e2d1521303cfe1154"], + ["3c436c2501442a5b700cbc0622ee5143b34b1b8021ea7bbc29e4154ab1f5bdfb3dff9d640501000000086aab5251ac5252acffffffff0170b9a20300000000066aab6351525114b13791", "63acabab52ab51ac65", 0, -2140612788, "87ddf1f9acb6640448e955bd1968f738b4b3e073983af7b83394ab7557f5cd61"], + ["d62f183e037e0d52dcf73f9b31f70554bce4f693d36d17552d0e217041e01f15ad3840c838000000000963acac6a6a6a63ab63ffffffffabdfb395b6b4e63e02a763830f536fc09a35ff8a0cf604021c3c751fe4c88f4d0300000006ab63ab65ac53aa4d30de95a2327bccf9039fb1ad976f84e0b4a0936d82e67eafebc108993f1e57d8ae39000000000165ffffffff04364ad30500000000036a005179fd84010000000007ab636aac6363519b9023030000000008510065006563ac6acd2a4a02000000000000000000", "52", 1, 595020383, "da8405db28726dc4e0f82b61b2bfd82b1baa436b4e59300305cc3b090b157504"], + ["44c200a5021238de8de7d80e7cce905606001524e21c8d8627e279335554ca886454d692e6000000000500acac52abbb8d1dc876abb1f514e96b21c6e83f429c66accd961860dc3aed5071e153e556e6cf076d02000000056553526a51870a928d0360a580040000000004516a535290e1e302000000000851ab6a00510065acdd7fc5040000000007515363ab65636abb1ec182", "6363", 0, -785766894, "ed53cc766cf7cb8071cec9752460763b504b2183442328c5a9761eb005c69501"], + ["d682d52d034e9b062544e5f8c60f860c18f029df8b47716cabb6c1b4a4b310a0705e754556020000000400656a0016eeb88eef6924fed207fba7ddd321ff3d84f09902ff958c815a2bf2bb692eb52032c4d803000000076365ac516a520099788831f8c8eb2552389839cfb81a9dc55ecd25367acad4e03cfbb06530f8cccf82802701000000085253655300656a53ffffffff02d543200500000000056a510052ac03978b05000000000700ac51525363acfdc4f784", "", 2, -696035135, "e1a256854099907050cfee7778f2018082e735a1f1a3d91437584850a74c87bb"], + ["e8c0dec5026575ddf31343c20aeeca8770afb33d4e562aa8ee52eeda6b88806fdfd4fe0a97030000000953acabab65ab516552ffffffffdde122c2c3e9708874286465f8105f43019e837746686f442666629088a970e0010000000153ffffffff01f98eee0100000000025251fe87379a", "63", 1, 633826334, "abe441209165d25bc6d8368f2e7e7dc21019056719fef1ace45542aa2ef282e2"], + ["b288c331011c17569293c1e6448e33a64205fc9dc6e35bc756a1ac8b97d18e912ea88dc0770200000007635300ac6aacabfc3c890903a3ccf8040000000004656500ac9c65c9040000000009ab6a6aabab65abac63ac5f7702000000000365005200000000", "526a63", 0, 1574937329, "0dd1bd5c25533bf5f268aa316ce40f97452cca2061f0b126a59094ca5b65f7a0"], + ["fc0a092003cb275fa9a25a72cf85d69c19e4590bfde36c2b91cd2c9c56385f51cc545530210000000004ab530063ffffffff729b006eb6d14d6e5e32b1c376acf1c62830a5d9246da38dbdb4db9f51fd1c74020000000463636500ffffffff0ae695c6d12ab7dcb8d3d4b547b03f178c7268765d1de9af8523d244e3836b12030000000151ffffffff0115c1e20100000000066a6aabac6a6a1ff59aec", "ab0053ac", 0, 931831026, "73fe22099c826c34a74edf45591f5d7b3a888c8178cd08facdfd96a9a681261c"], + ["0fcae7e004a71a4a7c8f66e9450c0c1785268679f5f1a2ee0fb3e72413d70a9049ecff75de020000000452005251ffffffff99c8363c4b95e7ec13b8c017d7bb6e80f7c04b1187d6072961e1c2479b1dc0320200000000ffffffff7cf03b3d66ab53ed740a70c5c392b84f780fff5472aee82971ac3bfeeb09b2df0200000006ab5265636a0058e4fe9257d7c7c7e82ff187757c6eadc14cceb6664dba2de03a018095fd3006682a5b9600000000056353536a636de26b2303ff76de010000000001acdc0a2e020000000001ab0a53ed020000000007530063ab51510088417307", "ac6aacab5165535253", 2, -902160694, "eea96a48ee572aea33d75d0587ce954fcfb425531a7da39df26ef9a6635201be"], + ["612701500414271138e30a46b7a5d95c70c78cc45bf8e40491dac23a6a1b65a51af04e6b94020000000451655153ffffffffeb72dc0e49b2fad3075c19e1e6e4b387f1365dca43d510f6a02136318ddecb7f0200000003536352e115ffc4f9bae25ef5baf534a890d18106fb07055c4d7ec9553ba89ed1ac2101724e507303000000080063006563acabac2ff07f69a080cf61a9d19f868239e6a4817c0eeb6a4f33fe254045d8af2bca289a8695de0300000000430736c404d317840500000000086a00abac5351ab65306e0503000000000963ab0051536aabab6a6c8aca01000000000565516351ab5dcf960100000000016a00000000", "ab", 2, -604581431, "5ec805e74ee934aa815ca5f763425785ae390282d46b5f6ea076b6ad6255a842"], + ["6b68ba00023bb4f446365ea04d68d48539aae66f5b04e31e6b38b594d2723ab82d44512460000000000200acffffffff5dfc6febb484fff69c9eeb7c7eb972e91b6d949295571b8235b1da8955f3137b020000000851ac6352516a535325828c8a03365da801000000000800636aabac6551ab0f594d03000000000963ac536365ac63636a45329e010000000005abac53526a00000000", "005151", 0, 1317038910, "42f5ba6f5fe1e00e652a08c46715871dc4b40d89d9799fd7c0ea758f86eab6a7"], + ["aff5850c0168a67296cc790c1b04a9ed9ad1ba0469263a9432fcb53676d1bb4e0eea8ea1410100000005ac65526a537d5fcb1d01d9c26d0200000000065265ab5153acc0617ca1", "51ab650063", 0, 1712981774, "8449d5247071325e5f8edcc93cb9666c0fecabb130ce0e5bef050575488477eb"], + ["e6d6b9d8042c27aec99af8c12b6c1f7a80453e2252c02515e1f391da185df0874e133696b50300000006ac5165650065ffffffff6a4b60a5bfe7af72b198eaa3cde2e02aa5fa36bdf5f24ebce79f6ecb51f3b554000000000652656aababac2ec4c5a6cebf86866b1fcc4c5bd5f4b19785a8eea2cdfe58851febf87feacf6f355324a80100000001537100145149ac1e287cef62f6f5343579189fad849dd33f25c25bfca841cb696f10c5a34503000000046a636a63df9d7c4c018d96e20100000000015100000000", "53ab", 1, -1924777542, "f98f95d0c5ec3ac3e699d81f6c440d2e7843eab15393eb023bc5a62835d6dcea"], + ["046ac25e030a344116489cc48025659a363da60bc36b3a8784df137a93b9afeab91a04c1ed020000000951ab0000526a65ac51ffffffff6c094a03869fde55b9a8c4942a9906683f0a96e2d3e5a03c73614ea3223b2c29020000000500ab636a6affffffff3da7aa5ecef9071600866267674b54af1740c5aeb88a290c459caa257a2683cb0000000004ab6565ab7e2a1b900301b916030000000005abac63656308f4ed03000000000852ab53ac63ac51ac73d620020000000003ab00008deb1285", "6a", 2, 1299505108, "f79e6b776e2592bad45ca328c54abf14050c241d8f822d982c36ea890fd45757"], + ["bd515acd0130b0ac47c2d87f8d65953ec7d657af8d96af584fc13323d0c182a2e5f9a96573000000000652ac51acac65ffffffff0467aade000000000003655363dc577d050000000006515252ab5300137f60030000000007535163530065004cdc860500000000036a5265241bf53e", "acab", 0, 621090621, "771d4d87f1591a13d77e51858c16d78f1956712fe09a46ff1abcabbc1e7af711"], + ["ff1ae37103397245ac0fa1c115b079fa20930757f5b6623db3579cb7663313c2dc4a3ffdb300000000076353656a000053ffffffff83c59e38e5ad91216ee1a312d15b4267bae2dd2e57d1a3fd5c2f0f809eeb5d46010000000800abab6a6a53ab51ffffffff9d5e706c032c1e0ca75915f8c6686f64ec995ebcd2539508b7dd8abc3e4d7d2a01000000006b2bdcda02a8fe070500000000045253000019e31d04000000000700ab63acab526a00000000", "53656aab6a525251", 0, 881938872, "726bb88cdf3af2f7603a31f33d2612562306d08972a4412a55dbbc0e3363721c"], + ["ff5400dd02fec5beb9a396e1cbedc82bedae09ed44bae60ba9bef2ff375a6858212478844b03000000025253ffffffff01e46c203577a79d1172db715e9cc6316b9cfc59b5e5e4d9199fef201c6f9f0f000000000900ab6552656a5165acffffffff02e8ce62040000000002515312ce3e00000000000251513f119316", "", 0, 1541581667, "1e0da47eedbbb381b0e0debbb76e128d042e02e65b11125e17fd127305fc65cd"], + ["28e3daa603c03626ad91ffd0ff927a126e28d29db5012588b829a06a652ea4a8a5732407030200000004ab6552acffffffff8e643146d3d0568fc2ad854fd7864d43f6f16b84e395db82b739f6f5c84d97b40000000004515165526b01c2dc1469db0198bd884e95d8f29056c48d7e74ff9fd37a9dec53e44b8769a6c99c030200000009ab006a516a53630065eea8738901002398000000000007ac5363516a51abeaef12f5", "52ab52515253ab", 2, 1687390463, "55591346aec652980885a558cc5fc2e3f8d21cbd09f314a798e5a7ead5113ea6"], + ["b54bf5ac043b62e97817abb892892269231b9b220ba08bc8dbc570937cd1ea7cdc13d9676c010000000451ab5365a10adb7b35189e1e8c00b86250f769319668189b7993d6bdac012800f1749150415b2deb0200000003655300ffffffff60b9f4fb9a7e17069fd00416d421f804e2ef2f2c67de4ca04e0241b9f9c1cc5d0200000003ab6aacfffffffff048168461cce1d40601b42fbc5c4f904ace0d35654b7cc1937ccf53fe78505a0100000008526563525265abacffffffff01dbf4e6040000000007acac656553636500000000", "63", 2, 882302077, "f5b38b0f06e246e47ce622e5ee27d5512c509f8ac0e39651b3389815eff2ab93"], + ["ebf628b30360bab3fa4f47ce9e0dcbe9ceaf6675350e638baff0c2c197b2419f8e4fb17e16000000000452516365ac4d909a79be207c6e5fb44fbe348acc42fc7fe7ef1d0baa0e4771a3c4a6efdd7e2c118b0100000003acacacffffffffa6166e9101f03975721a3067f1636cc390d72617be72e5c3c4f73057004ee0ee010000000863636a6a516a5252c1b1e82102d8d54500000000000153324c900400000000015308384913", "0063516a51", 1, -1658428367, "eb2d8dea38e9175d4d33df41f4087c6fea038a71572e3bad1ea166353bf22184"], + ["d6a8500303f1507b1221a91adb6462fb62d741b3052e5e7684ea7cd061a5fc0b0e93549fa50100000004acab65acfffffffffdec79bf7e139c428c7cfd4b35435ae94336367c7b5e1f8e9826fcb0ebaaaea30300000000ffffffffd115fdc00713d52c35ea92805414bd57d1e59d0e6d3b79a77ee18a3228278ada020000000453005151ffffffff040231510300000000085100ac6a6a000063c6041c0400000000080000536a6563acac138a0b04000000000263abd25fbe03000000000900656a00656aac510000000000", "ac526aac6a00", 1, -2007972591, "13d12a51598b34851e7066cd93ab8c5212d60c6ed2dae09d91672c10ccd7f87c"], + ["658cb1c1049564e728291a56fa79987a4ed3146775fce078bd2e875d1a5ca83baf6166a82302000000056a656351ab2170e7d0826cbdb45fda0457ca7689745fd70541e2137bb4f52e7b432dcfe2112807bd720300000007006a0052536351ffffffff8715ca2977696abf86d433d5c920ef26974f50e9f4a20c584fecbb68e530af5101000000009e49d864155bf1d3c757186d29f3388fd89c7f55cc4d9158b4cf74ca27a35a1dd93f945502000000096a535353ac656351510d29fa870230b809040000000006ab6a6a526a633b41da050000000004ab6a6a65ed63bf62", "52acabac", 2, -1774073281, "53ab197fa7e27b8a3f99ff48305e67081eb90e95d89d7e92d80cee25a03a6689"], + ["e92492cc01aec4e62df67ea3bc645e2e3f603645b3c5b353e4ae967b562d23d6e043badecd0100000003acab65ffffffff02c7e5ea040000000002ab52e1e584010000000005536365515195d16047", "6551", 0, -424930556, "93c34627f526d73f4bea044392d1a99776b4409f7d3d835f23b03c358f5a61c2"], + ["02e242db04be2d8ced9179957e98cee395d4767966f71448dd084426844cbc6d15f2182e85030000000200650c8ffce3db9de9c3f9cdb9104c7cb26647a7531ad1ebf7591c259a9c9985503be50f8de30000000007ac6a51636a6353ffffffffa2e33e7ff06fd6469987ddf8a626853dbf30c01719efb259ae768f051f803cd30300000000fffffffffd69d8aead941683ca0b1ee235d09eade960e0b1df3cd99f850afc0af1b73e070300000001ab60bb602a011659670100000000076363526300acac00000000", "6353ab515251", 3, 1451100552, "bbc9069b8615f3a52ac8a77359098dcc6c1ba88c8372d5d5fe080b99eb781e55"], + ["b28d5f5e015a7f24d5f9e7b04a83cd07277d452e898f78b50aae45393dfb87f94a26ef57720200000008ababac630053ac52ffffffff046475ed040000000008ab5100526363ac65c9834a04000000000251abae26b30100000000040000ac65ceefb900000000000000000000", "ac6551ac6a536553", 0, -1756558188, "5848d93491044d7f21884eef7a244fe7d38886f8ae60df49ce0dfb2a342cd51a"], + ["efb8b09801f647553b91922a5874f8e4bb2ed8ddb3536ed2d2ed0698fac5e0e3a298012391030000000952ac005263ac52006affffffff04cdfa0f050000000007ac53ab51abac65b68d1b02000000000553ab65ac00d057d50000000000016a9e1fda010000000007ac63ac536552ac00000000", "6aac", 0, 1947322973, "603a9b61cd30fcea43ef0a5c18b88ca372690b971b379ee9e01909c336280511"], + ["68a59fb901c21946797e7d07a4a3ea86978ce43df0479860d7116ac514ba955460bae78fff0000000001abffffffff03979be80100000000036553639300bc040000000008006552006a656565cfa78d0000000000076552acab63ab5100000000", "ab65ab", 0, 995583673, "3b320dd47f2702452a49a1288bdc74a19a4b849b132b6cad9a1d945d87dfbb23"], + ["67761f2a014a16f3940dcb14a22ba5dc057fcffdcd2cf6150b01d516be00ef55ef7eb07a830100000004636a6a51ffffffff01af67bd050000000008526553526300510000000000", "6a00", 0, 1570943676, "079fa62e9d9d7654da8b74b065da3154f3e63c315f25751b4d896733a1d67807"], + ["e20fe96302496eb436eee98cd5a32e1c49f2a379ceb71ada8a48c5382df7c8cd88bdc47ced03000000016556aa0e180660925a841b457aed0aae47fca2a92fa1d7afeda647abf67198a3902a7c80dd00000000085152ac636a535265bd18335e01803c810100000000046500ac52f371025e", "6363ab", 1, -651254218, "2921a0e5e3ba83c57ba57c25569380c17986bf34c366ec216d4188d5ba8b0b47"], + ["4e1bd9fa011fe7aa14eee8e78f27c9fde5127f99f53d86bc67bdab23ca8901054ee8a8b6eb0300000009ac535153006a6a0063ffffffff044233670500000000000a667205000000000652ab636a51abe5bf35030000000003535351d579e505000000000700630065ab51ac3419ac30", "52abac52", 0, -1807563680, "4aae6648f856994bed252d319932d78db55da50d32b9008216d5366b44bfdf8a"], + ["ec02fbee03120d02fde12574649660c441b40d330439183430c6feb404064d4f507e704f3c0100000000ffffffffe108d99c7a4e5f75cc35c05debb615d52fac6e3240a6964a29c1704d98017fb60200000002ab63fffffffff726ec890038977adfc9dadbeaf5e486d5fcb65dc23acff0dd90b61b8e2773410000000002ac65e9dace55010f881b010000000005ac00ab650000000000", "51ac525152ac6552", 2, -1564046020, "3f988922d8cd11c7adff1a83ce9499019e5ab5f424752d8d361cf1762e04269b"], + ["23dbdcc1039c99bf11938d8e3ccec53b60c6c1d10c8eb6c31197d62c6c4e2af17f52115c3a0300000008636352000063ababffffffff17823880e1df93e63ad98c29bfac12e36efd60254346cac9d3f8ada020afc0620300000003ab63631c26f002ac66e86cd22a25e3ed3cb39d982f47c5118f03253054842daadc88a6c41a2e1500000000096a00ab636a53635163195314de015570fd0100000000096a5263acab5200005300000000", "ababac6a6553", 1, 11586329, "bd36a50e0e0a4ecbf2709e68daef41eddc1c0c9769efaee57910e99c0a1d1343"], + ["33b03bf00222c7ca35c2f8870bbdef2a543b70677e413ce50494ac9b22ea673287b6aa55c50000000005ab00006a52ee4d97b527eb0b427e4514ea4a76c81e68c34900a23838d3e57d0edb5410e62eeb8c92b6000000000553ac6aacac42e59e170326245c000000000009656553536aab516aabb1a10603000000000852ab52ab6a516500cc89c802000000000763ac6a63ac516300000000", "", 0, 557416556, "41bead1b073e1e9fee065dd612a617ca0689e8f9d3fed9d0acfa97398ebb404c"], + ["813eda1103ac8159850b4524ef65e4644e0fc30efe57a5db0c0365a30446d518d9b9aa8fdd0000000003656565c2f1e89448b374b8f12055557927d5b33339c52228f7108228149920e0b77ef0bcd69da60000000006abac00ab63ab82cdb7978d28630c5e1dc630f332c4245581f787936f0b1e84d38d33892141974c75b4750300000004ac53ab65ffffffff0137edfb02000000000000000000", "0063", 1, -1948560575, "71dfcd2eb7f2e6473aed47b16a6d5fcbd0af22813d892e9765023151e07771ec"], + ["9e45d9aa0248c16dbd7f435e8c54ae1ad086de50c7b25795a704f3d8e45e1886386c653fbf01000000025352fb4a1acefdd27747b60d1fb79b96d14fb88770c75e0da941b7803a513e6d4c908c6445c7010000000163ffffffff014069a8010000000001520a794fb3", "51ac005363", 1, -719113284, "0d31a221c69bd322ef7193dd7359ddfefec9e0a1521d4a8740326d46e44a5d6a"], + ["36e42018044652286b19a90e5dd4f8d9f361d0760d080c5c5add1970296ff0f1de630233c8010000000200ac39260c7606017d2246ee14ddb7611586178067e6a4be38e788e33f39a3a95a55a13a6775010000000352ac638bea784f7c2354ed02ea0b93f0240cdfb91796fa77649beee6f7027caa70778b091deee700000000066a65ac656363ffffffff4d9d77ab676d711267ef65363f2d192e1bd55d3cd37f2280a34c72e8b4c559d700000000056a006aab00001764e1020d30220100000000085252516aacab0053472097040000000009635353ab6a636a5100a56407a1", "006a536551ab53ab", 0, 827296034, "daec2af5622bbe220c762da77bab14dc75e7d28aa1ade9b7f100798f7f0fd97a"], + ["5e06159a02762b5f3a5edcdfc91fd88c3bff08b202e69eb5ba74743e9f4291c4059ab008200000000001ac348f5446bb069ef977f89dbe925795d59fb5d98562679bafd61f5f5f3150c3559582992d0000000008ab5165515353abac762fc67703847ec6010000000000e200cf040000000002abaca64b86010000000008520000515363acabb82b491b", "ab53525352ab6a", 0, -61819505, "75a7db0df41485a28bf6a77a37ca15fa8eccc95b5d6014a731fd8adb9ada0f12"], + ["a1948872013b543d6d902ccdeead231c585195214ccf5d39f136023855958436a43266911501000000086aac006a6a6a51514951c9b2038a538a04000000000452526563c0f345050000000007526a5252ac526af9be8e03000000000752acac51ab006306198db2", "ab6353", 0, -326384076, "ced7ef84aad4097e1eb96310e0d1c8e512cfcb392a01d9010713459b23bc0cf4"], + ["c3efabba03cb656f154d1e159aa4a1a4bf9423a50454ebcef07bc3c42a35fb8ad84014864d0000000000d1cc73d260980775650caa272e9103dc6408bdacaddada6b9c67c88ceba6abaa9caa2f7d020000000553536a5265ffffffff9f946e8176d9b11ff854b76efcca0a4c236d29b69fb645ba29d406480427438e01000000066a0065005300ffffffff040419c0010000000003ab6a63cdb5b6010000000009006300ab5352656a63f9fe5e050000000004acac5352611b980100000000086a00acac00006a512d7f0c40", "0053", 0, -59089911, "c503001c16fbff82a99a18d88fe18720af63656fccd8511bca1c3d0d69bd7fc0"], + ["efb55c2e04b21a0c25e0e29f6586be9ef09f2008389e5257ebf2f5251051cdc6a79fce2dac020000000351006affffffffaba73e5b6e6c62048ba5676d18c33ccbcb59866470bb7911ccafb2238cfd493802000000026563ffffffffe62d7cb8658a6eca8a8babeb0f1f4fa535b62f5fc0ec70eb0111174e72bbec5e0300000009abababac516365526affffffffbf568789e681032d3e3be761642f25e46c20322fa80346c1146cb47ac999cf1b0300000000b3dbd55902528828010000000001ab0aac7b0100000000015300000000", "acac52", 3, 1638140535, "e84444d91580da41c8a7dcf6d32229bb106f1be0c811b2292967ead5a96ce9d4"], + ["91d3b21903629209b877b3e1aef09cd59aca6a5a0db9b83e6b3472aceec3bc2109e64ab85a0200000003530065ffffffffca5f92de2f1b7d8478b8261eaf32e5656b9eabbc58dcb2345912e9079a33c4cd010000000700ab65ab00536ad530611da41bbd51a389788c46678a265fe85737b8d317a83a8ff7a839debd18892ae5c80300000007ab6aac65ab51008b86c501038b8a9a05000000000263525b3f7a040000000007ab535353ab00abd4e3ff04000000000665ac51ab65630b7b656f", "6551525151516a00", 2, 499657927, "ef4bd7622eb7b2bbbbdc48663c1bc90e01d5bde90ff4cb946596f781eb420a0c"], + ["5d5c41ad0317aa7e40a513f5141ad5fc6e17d3916eebee4ddb400ddab596175b41a111ead20100000005536a5265acffffffff900ecb5e355c5c9f278c2c6ea15ac1558b041738e4bffe5ae06a9346d66d5b2b00000000080000ab636a65ab6affffffff99f4e08305fa5bd8e38fb9ca18b73f7a33c61ff7b3c68e696b30a04fea87f3ca000000000163d3d1760d019fc13a00000000000000000000", "ab53acabab6aac6a52", 2, 1007461922, "4012f5ff2f1238a0eb84854074670b4703238ebc15bfcdcd47ffa8498105fcd9"], + ["ceecfa6c02b7e3345445b82226b15b7a097563fa7d15f3b0c979232b138124b62c0be007890200000009abac51536a63525253ffffffffbae481ccb4f15d94db5ec0d8854c24c1cc8642bd0c6300ede98a91ca13a4539a0200000001ac50b0813d023110f5020000000006acabac526563e2b0d0040000000009656aac0063516a536300000000", "0063526500", 0, -1862053821, "e1600e6df8a6160a79ac32aa40bb4644daa88b5f76c0d7d13bf003327223f70c"], + ["ae62d5fd0380c4083a26642159f51af24bf55dc69008e6b7769442b6a69a603edd980a33000000000005ab5100ab53ffffffff49d048324d899d4b8ed5e739d604f5806a1104fede4cb9f92cc825a7fa7b4bfe0200000005536a000053ffffffff42e5cea5673c650881d0b4005fa4550fd86de5f21509c4564a379a0b7252ac0e0000000007530000526a53525f26a68a03bfacc3010000000000e2496f000000000009ab5253acac52636563b11cc600000000000700510065526a6a00000000", "abab", 1, -1600104856, "05cf0ec9c61f1a15f651a0b3c5c221aa543553ce6c804593f43bb5c50bb91ffb"], + ["f06f64af04fdcb830464b5efdb3d5ee25869b0744005375481d7b9d7136a0eb8828ad1f0240200000003516563fffffffffd3ba192dabe9c4eb634a1e3079fca4f072ee5ceb4b57deb6ade5527053a92c5000000000165ffffffff39f43401a36ba13a5c6dd7f1190e793933ae32ee3bf3e7bfb967be51e681af760300000009650000536552636a528e34f50b21183952cad945a83d4d56294b55258183e1627d6e8fb3beb8457ec36cadb0630000000005abab530052334a7128014bbfd10100000000085352ab006a63656afc424a7c", "53650051635253ac00", 2, 313255000, "d309da5afd91b7afa257cfd62df3ca9df036b6a9f4b38f5697d1daa1f587312b"], + ["6dfd2f98046b08e7e2ef5fff153e00545faf7076699012993c7a30cb1a50ec528281a9022f030000000152ffffffff1f535e4851920b968e6c437d84d6ecf586984ebddb7d5db6ae035bd02ba222a8010000000651006a53ab51605072acb3e17939fa0737bc3ee43bc393b4acd58451fc4ffeeedc06df9fc649828822d5010000000253525a4955221715f27788d302382112cf60719be9ae159c51f394519bd5f7e70a4f9816c7020200000009526a6a51636aab656a36d3a5ff0445548e0100000000086a6a00516a52655167030b050000000004ac6a63525cfda8030000000000e158200000000000010000000000", "535263ac6a65515153", 3, 585774166, "72b7da10704c3ca7d1deb60c31b718ee12c70dc9dfb9ae3461edce50789fe2ba"], + ["187eafed01389a45e75e9dda526d3acbbd41e6414936b3356473d1f9793d161603efdb45670100000002ab00ffffffff04371c8202000000000563630063523b3bde02000000000753516563006300e9e765010000000005516aac656a373f9805000000000665525352acab08d46763", "ab", 0, 122457992, "393aa6c758e0eed15fa4af6d9e2d7c63f49057246dbb92b4268ec24fc87301ca"], + ["7d50b977035d50411d814d296da9f7965ddc56f3250961ca5ba805cadd0454e7c521e31b0300000000003d0416c2cf115a397bacf615339f0e54f6c35ffec95aa009284d38390bdde1595cc7aa7c0100000005ab52ac5365ffffffff4232c6e796544d5ac848c9dc8d25cfa74e32e847a5fc74c74d8f38ca51188562030000000653ac51006a51ffffffff016bd8bb00000000000465ab5253163526f3", "51ab526a00005353", 1, -1311316785, "60b7544319b42e4159976c35c32c2644f0adf42eff13be1dc2f726fc0b6bb492"], + ["2a45cd1001bf642a2315d4a427eddcc1e2b0209b1c6abd2db81a800c5f1af32812de42032702000000050051525200ffffffff032177db050000000005530051abac49186f000000000004ab6aab00645c0000000000000765655263acabac00000000", "6a65", 0, -1774715722, "6a9ac3f7da4c7735fbc91f728b52ecbd602233208f96ac5592656074a5db118a"], + ["479358c202427f3c8d19e2ea3def6d6d3ef2281b4a93cd76214f0c7d8f040aa042fe19f71f0300000001abffffffffa2709be556cf6ecaa5ef530df9e4d056d0ed57ce96de55a5b1f369fa40d4e74a020000000700006a51635365c426be3f02af578505000000000363ab63fd8f590500000000065153abac53632dfb14b3", "520063ab51", 1, -763226778, "cfe147982afacde044ce66008cbc5b1e9f0fd9b8ed52b59fc7c0fecf95a39b0e"], + ["76179a8e03bec40747ad65ab0f8a21bc0d125b5c3c17ad5565556d5cb03ade7c83b4f32d98030000000151ffffffff99b900504e0c02b97a65e24f3ad8435dfa54e3c368f4e654803b756d011d24150200000003ac5353617a04ac61bb6cf697cfa4726657ba35ed0031432da8c0ffb252a190278830f9bd54f0320100000006656551005153c8e8fc8803677c77020000000007ac6553535253ac70f442030000000001535be0f20200000000026300bf46cb3a", "6aab52", 1, -58495673, "35e94b3776a6729d20aa2f3ddeeb06d3aad1c14cc4cde52fd21a4efc212ea16c"], + ["75ae53c2042f7546223ce5d5f9e00a968ddc68d52e8932ef2013fa40ce4e8c6ed0b6195cde01000000056563ac630079da0452c20697382e3dba6f4fc300da5f52e95a9dca379bb792907db872ba751b8024ee0300000009655151536500005163ffffffffe091b6d43f51ff00eff0ccfbc99b72d3aff208e0f44b44dfa5e1c7322cfc0c5f01000000075200005363ab63ffffffff7e96c3b83443260ac5cfd18258574fbc4225c630d3950df812bf51dceaeb0f9103000000065365655165639a6bf70b01b3e14305000000000563530063ac00000000", "6300ab00ac", 2, 982422189, "ee4ea49d2aae0dbba05f0b9785172da54408eb1ec67d36759ff7ed25bfc28766"], + ["1cdfa01e01e1b8078e9c2b0ca5082249bd18fdb8b629ead659adedf9a0dd5a04031871ba120200000008525351536565ab6affffffff011e28430200000000076a5363636aac52b2febd4a", "abacac63656300", 0, 387396350, "299dcaac2bdaa627eba0dfd74767ee6c6f27c9200b49da8ff6270b1041669e7e"], + ["cc28c1810113dfa6f0fcd9c7d9c9a30fb6f1d774356abeb527a8651f24f4e6b25cf763c4e00300000003ab636affffffff02dfc6050000000000080053636351ab0052afd56903000000000453ab5265f6c90d99", "006551abacacac", 0, 1299280838, "a4c0773204ab418a939e23f493bd4b3e817375d133d307609e9782f2cc38dbcf"], + ["ca816e7802cd43d66b9374cd9bf99a8da09402d69c688d8dcc5283ace8f147e1672b757e020200000005516aabab5240fb06c95c922342279fcd88ba6cd915933e320d7becac03192e0941e0345b79223e89570300000004005151ac353ecb5d0264dfbd010000000005ac6aacababd5d70001000000000752ac53ac6a5151ec257f71", "63ac", 1, 774695685, "cc180c4f797c16a639962e7aec58ec4b209853d842010e4d090895b22e7a7863"], + ["b42b955303942fedd7dc77bbd9040aa0de858afa100f399d63c7f167b7986d6c2377f66a7403000000066aac00525100ffffffff0577d04b64880425a3174055f94191031ad6b4ca6f34f6da9be7c3411d8b51fc000000000300526a6391e1cf0f22e45ef1c44298523b516b3e1249df153590f592fcb5c5fc432dc66f3b57cb03000000046a6aac65ffffffff0393a6c9000000000004516a65aca674ac0400000000046a525352c82c370000000000030053538e577f89", "", 1, -1237094944, "566953eb806d40a9fb684d46c1bf8c69dea86273424d562bd407b9461c8509af"], + ["92c9fe210201e781b72554a0ed5e22507fb02434ddbaa69aff6e74ea8bad656071f1923f3f02000000056a63ac6a514470cef985ba83dcb8eee2044807bedbf0d983ae21286421506ae276142359c8c6a34d68020000000863ac63525265006aa796dd0102ca3f9d05000000000800abab52ab535353cd5c83010000000007ac00525252005322ac75ee", "5165", 0, 97879971, "6e6307cef4f3a9b386f751a6f40acebab12a0e7e17171d2989293cbec7fd45c2"], + ["ccca1d5b01e40fe2c6b3ee24c660252134601dab785b8f55bd6201ffaf2fddc7b3e2192325030000000365535100496d4703b4b66603000000000665535253ac633013240000000000015212d2a502000000000951abac636353636a5337b82426", "0052", 0, -1691630172, "577bf2b3520b40aef44899a20d37833f1cded6b167e4d648fc5abe203e43b649"], + ["bc1a7a3c01691e2d0c4266136f12e391422f93655c71831d90935fbda7e840e50770c61da20000000008635253abac516353ffffffff031f32aa020000000003636563786dbc0200000000003e950f00000000000563516a655184b8a1de", "51536a", 0, -1627072905, "730bc25699b46703d7718fd5f5c34c4b5f00f594a9968ddc247fa7d5175124ed"], + ["076d209e02d904a6c40713c7225d23e7c25d4133c3c3477828f98c7d6dbd68744023dbb66b030000000753ab00536565acffffffff10975f1b8db8861ca94c8cc7c7cff086ddcd83e10b5fffd4fc8f2bdb03f9463c0100000000ffffffff029dff76010000000006526365530051a3be6004000000000000000000", "515253ac65acacac", 1, -1207502445, "66c488603b2bc53f0d22994a1f0f66fb2958203102eba30fe1d37b27a55de7a5"], + ["690fd1f80476db1f9eebe91317f2f130a60cbc1f4feadd9d6474d438e9cb7f91e4994600af0300000004ab536a63a15ce9fa6622d0c4171d895b42bff884dc6e8a7452f827fdc68a29c3c88e6fdee364eaf50000000002ab52ffffffff022dc39d3c0956b24d7f410b1e387859e7a72955f45d6ffb1e884d77888d18fe0300000005ac6a63656afffffffff10b06bce1800f5c49153d24748fdefb0bf514c12863247d1042d56018c3e25c03000000086a63ac6365536a52ffffffff031f162f0500000000060000655265abffbcd40500000000045151ac001a9c8c05000000000652ac53656a6300000000", "ac51ab63acac", 0, -67986012, "051c0df7ac688c2c930808dabde1f50300aea115f2bb3334f4753d5169b51e46"], + ["49ac2af00216c0307a29e83aa5de19770e6b20845de329290bd69cf0e0db7aed61ae41b39002000000035163ac8b2558ef84635bfc59635150e90b61fc753d34acfd10d97531043053e229cd720133cd95000000000463516a51ffffffff02458471040000000008abab636a51ac0065545aa80000000000096a6553516a5263ac6a00000000", "51526300ab5363", 1, 1449668540, "ddfd902bba312a06197810da96a0ddccb595f96670b28ded7dba88d8cd0469b8"], + ["fa4d868b024b010bd5dce46576c2fb489aa60bb797dac3c72a4836f49812c5c564c258414f03000000007a9b3a585e05027bdd89edbadf3c85ac61f8c3a04c773fa746517ae600ff1a9d6b6c02fb0200000004515163abffffffff01b17d020500000000046a65520000000000", "536565ab65635363", 0, -1718953372, "96c2b32f0a00a5925db7ba72d0b5d39922f30ea0f7443b22bc1b734808513c47"], + ["cac6382d0462375e83b67c7a86c922b569a7473bfced67f17afd96c3cd2d896cf113febf9e0300000003006a53ffffffffaa4913b7eae6821487dd3ca43a514e94dcbbf350f8cc4cafff9c1a88720711b800000000096a6a525300acac6353ffffffff184fc4109c34ea27014cc2c1536ef7ed1821951797a7141ddacdd6e429fae6ff01000000055251655200ffffffff9e7b79b4e6836e290d7b489ead931cba65d1030ccc06f20bd4ca46a40195b33c030000000008f6bc8304a09a2704000000000563655353511dbc73050000000000cf34c500000000000091f76e0000000000085200ab00005100abd07208cb", "0063656a", 2, -1488731031, "bf078519fa87b79f40abc38f1831731422722c59f88d86775535f209cb41b9b1"], + ["1711146502c1a0b82eaa7893976fefe0fb758c3f0e560447cef6e1bde11e42de91a125f71c030000000015bd8c04703b4030496c7461482481f290c623be3e76ad23d57a955807c9e851aaaa20270300000000d04abaf20326dcb7030000000001632225350400000000075263ac00520063dddad9020000000000af23d148", "52520053510063", 0, 1852122830, "e33d5ee08c0f3c130a44d7ce29606450271b676f4a80c52ab9ffab00cecf67f8"], + ["8d5b124d0231fbfc640c706ddb1d57bb49a18ba8ca0e1101e32c7e6e65a0d4c7971d93ea360100000008acabac0000abac65ffffffff8fe0fd7696597b845c079c3e7b87d4a44110c445a330d70342a5501955e17dd70100000004ab525363ef22e8a90346629f030000000009516a00ac63acac51657bd57b05000000000200acfd4288050000000009acab5352ab00ab636300000000", "53ac526553ab65", 0, 1253152975, "8b57a7c3170c6c02dd14ae1d392ce3d828197b20e9145c89c1cfd5de050e1562"], + ["38146dc502c7430e92b6708e9e107b61cd38e5e773d9395e5c8ad8986e7e4c03ee1c1e1e760100000000c8962ce2ac1bb3b1285c0b9ba07f4d2e5ce87c738c42ac0548cd8cec1100e6928cd6b0b6010000000763ab636aab52527cccefbd04e5f6f8020000000006006aabacac65ab2c4a00000000000351635209a6f40100000000026aacce57dc040000000008ab5353ab516a516a00000000", "ab", 0, -1205978252, "3cb5b030e7da0b60ccce5b4a7f3793e6ca56f03e3799fe2d6c3cc22d6d841dcb"], + ["22d81c740469695a6a83a9a4824f77ecff8804d020df23713990afce2b72591ed7de98500502000000065352526a6a6affffffff90dc85e118379b1005d7bbc7d2b8b0bab104dad7eaa49ff5bead892f17d8c3ba010000000665656300ab51ffffffff965193879e1d5628b52005d8560a35a2ba57a7f19201a4045b7cbab85133311d0200000003ac005348af21a13f9b4e0ad90ed20bf84e4740c8a9d7129632590349afc03799414b76fd6e826200000000025353ffffffff04a0d40d04000000000060702700000000000652655151516ad31f1502000000000365ac0069a1ac0500000000095100655300ab53525100000000", "51636a52ac", 0, -1644680765, "add7f5da27262f13da6a1e2cc2feafdc809bd66a67fb8ae2a6f5e6be95373b6f"], + ["a27dcbc801e3475174a183586082e0914c314bc9d79d1570f29b54591e5e0dff07fbb45a7f0000000004ac53ab51ffffffff027347f5020000000005535351ab63d0e5c9030000000009ac65ab6a63515200ab7cd632ed", "ac63636553", 0, -686435306, "883a6ea3b2cc53fe8a803c229106366ca14d25ffbab9fef8367340f65b201da6"], + ["b123ed2204410d4e8aaaa8cdb95234ca86dad9ff77fb4ae0fd4c06ebed36794f0215ede0040100000002ac63ffffffff3b58b81b19b90d8f402701389b238c3a84ff9ba9aeea298bbf15b41a6766d27a01000000056a6553ab00151824d401786153b819831fb15926ff1944ea7b03d884935a8bde01ed069d5fd80220310200000000ffffffffa9c9d246f1eb8b7b382a9032b55567e9a93f86c77f4e32c092aa1738f7f756c30100000002ab65ffffffff011a2b48000000000000ed44d1fb", "630051ab63", 2, -1118263883, "b5dab912bcabedff5f63f6dd395fc2cf030d83eb4dd28214baba68a45b4bfff0"], + ["1339051503e196f730955c5a39acd6ed28dec89b4dadc3f7c79b203b344511270e5747fa9900000000045151636affffffff378c6090e08a3895cedf1d25453bbe955a274657172491fd2887ed5c9aceca7b0100000000ffffffffcf7cc3c36ddf9d4749edfa9cefed496d2f86e870deb814bfcd3b5637a5496461030000000451006300ffffffff04dcf3fa010000000008526a63005263acabb41d84040000000004abac5153800eff020000000005656a535365106c5e00000000000000000000", "abac5300", 2, 2013719928, "7fc74de39ce6ca46ca25d760d3cec7bb21fd14f7efe1c443b5aa294f2cb5f546"], + ["0728c606014c1fd6005ccf878196ba71a54e86cc8c53d6db500c3cc0ac369a26fac6fcbc210000000005ab53ac5365ba9668290182d7870100000000066a000053655100000000", "65", 0, 1789961588, "ab6baa6da3b2bc853868d166f8996ad31d63ef981179f9104f49968fd61c8427"], + ["a1134397034bf4067b6c81c581e2b73fb63835a08819ba24e4e92df73074bf773c94577df7000000000465525251ffffffff8b6608feaa3c1f35f49c6330a769716fa01c5c6f6e0cdc2eb10dfc99bbc21e77010000000952656aac005352655180a0bda4bc72002c2ea8262e26e03391536ec36867258cab968a6fd6ec7523b64fa1d8c001000000056a53ac6353ffffffff04dbeeed05000000000553650052abcd5d0e01000000000463abab51104b2e0500000000066aac53ac5165283ca7010000000004535252ab00000000", "ab515151516552ab", 1, -324598676, "91178482112f94d1c8e929de443e4b9c893e18682998d393ca9ca77950412586"], + ["bcdafbae04aa18eb75855aeb1f5124f30044741351b33794254a80070940cb10552fa4fa8e0300000001acd0423fe6e3f3f88ae606f2e8cfab7a5ef87caa2a8f0401765ff9a47d718afcfb40c0099b0000000008ac6565ab53ac6aac645308009d680202d600e492b31ee0ab77c7c5883ebad5065f1ce87e4dfe6453e54023a0010000000151ffffffffb9d818b14245899e1d440152827c95268a676f14c3389fc47f5a11a7b38b1bde03000000026300ffffffff03cda22102000000000751ac535263005100a4d20400000000045200536ac8bef405000000000700ab51ab6563ac00000000", "6553516a526aab", 1, -2111409753, "5e1849e7368cf4f042718586d9bd831d61479b775bab97aba9f450042bd9876a"], + ["ed3bb93802ddbd08cb030ef60a2247f715a0226de390c9c1a81d52e83f8674879065b5f87d0300000003ab6552ffffffff04d2c5e60a21fb6da8de20bf206db43b720e2a24ce26779bca25584c3f765d1e0200000008ab656a6aacab00ab6e946ded025a811d04000000000951abac6352ac00ab5143cfa3030000000005635200636a00000000", "5352ac650065535300", 1, -668727133, "e9995065e1fddef72a796eef5274de62012249660dc9d233a4f24e02a2979c87"], + ["59f4629d030fa5d115c33e8d55a79ea3cba8c209821f979ed0e285299a9c72a73c5bba00150200000002636affffffffd8aca2176df3f7a96d0dc4ee3d24e6cecde1582323eec2ebef9a11f8162f17ac0000000007ab6565acab6553ffffffffeebc10af4f99c7a21cbc1d1074bd9f0ee032482a71800f44f26ee67491208e0403000000065352ac656351ffffffff0434e955040000000004ab515152caf2b305000000000365ac007b1473030000000003ab530033da970500000000060051536a5253bb08ab51", "", 2, 396340944, "0e9c47973ef2c292b2252c623f465bbb92046fe0b893eebf4e1c9e02cb01c397"], + ["286e3eb7043902bae5173ac3b39b44c5950bc363f474386a50b98c7bdab26f98dc83449c4a020000000752ac6a00510051ffffffff4339cd6a07f5a5a2cb5815e5845da70300f5c7833788363bf7fe67595d3225520100000000fffffffff9c2dd8b06ad910365ffdee1a966f124378a2b8021065c8764f6138bb1e951380200000005ab5153ac6affffffff0370202aba7a68df85436ea7c945139513384ef391fa33d16020420b8ad40e9a000000000900ab5165526353abacffffffff020c1907000000000004abac526a1b490b040000000000df1528f7", "5353ab", 3, -1407529517, "32154c09174a9906183abf26538c39e78468344ca0848bbd0785e24a3565d932"], + ["2e245cf80179e2e95cd1b34995c2aff49fe4519cd7cee93ad7587f7f7e8105fc2dff206cd30200000009006a63516a6553ab52350435a201d5ed2d02000000000352ab6558552c89", "00ab53", 0, -233917810, "4605ae5fd3d50f9c45d37db7118a81a9ef6eb475d2333f59df5d3e216f150d49"], + ["33a98004029d262f951881b20a8d746c8c707ea802cd2c8b02a33b7e907c58699f97e42be80100000007ac53536552abacdee04cc01d205fd8a3687fdf265b064d42ab38046d76c736aad8865ca210824b7c622ecf02000000070065006a536a6affffffff01431c5d010000000000270d48ee", "", 1, 921554116, "ff9d7394002f3f196ea25472ea6c46f753bd879a7244795157bb7235c9322902"], + ["aac18f2b02b144ed481557c53f2146ae523f24fcde40f3445ab0193b6b276c315dc2894d2300000000075165650000636a233526947dbffc76aec7db1e1baa6868ad4799c76e14794dcbaaec9e713a83967f6a65170200000005abac6551ab27d518be01b652a30000000000015300000000", "52ac5353", 1, 1559377136, "59fc2959bb7bb24576cc8a237961ed95bbb900679d94da6567734c4390cb6ef5"], + ["5ab79881033555b65fe58c928883f70ce7057426fbdd5c67d7260da0fe8b1b9e6a2674cb850300000009ac516aac6aac006a6affffffffa5be9223b43c2b1a4d120b5c5b6ec0484f637952a3252181d0f8e813e76e11580200000000e4b5ceb8118cb77215bbeedc9a076a4d087bb9cd1473ea32368b71daeeeacc451ec209010000000005acac5153aced7dc34e02bc5d11030000000005ac5363006a54185803000000000552ab00636a00000000", "5100", 1, 1927062711, "e9f53d531c12cce1c50abed4ac521a372b4449b6a12f9327c80020df6bff66c0"], + ["6c2c8fac0124b0b7d4b610c3c5b91dee32b7c927ac71abdf2d008990ca1ac40de0dfd530660300000006ababac5253656bd7eada01d847ec000000000004ac52006af4232ec8", "6a6a6a0051", 0, -340809707, "fb51eb9d7e47d32ff2086205214f90c7c139e08c257a64829ae4d2b301071c6a"], + ["6e3880af031735a0059c0bb5180574a7dcc88e522c8b56746d130f8d45a52184045f96793e0100000008acabac6a526a6553fffffffffe05f14cdef7d12a9169ec0fd37524b5fcd3295f73f48ca35a36e671da4a2f560000000008006a526a6351ab63ffffffffdfbd869ac9e472640a84caf28bdd82e8c6797f42d03b99817a705a24fde2736600000000010090a090a503db956b04000000000952ac53ab6a536a63ab358390010000000009656a5200525153ac65353ee204000000000763530052526aaba6ad83fb", "535151ab6300", 2, 222014018, "57a34ddeb1bf36d28c7294dda0432e9228a9c9e5cc5c692db98b6ed2e218d825"], + ["8df1cd19027db4240718dcaf70cdee33b26ea3dece49ae6917331a028c85c5a1fb7ee3e475020000000865ab6a00510063636157988bc84d8d55a8ba93cdea001b9bf9d0fa65b5db42be6084b5b1e1556f3602f65d4d0100000005ac00ab0052206c852902b2fb54030000000008ac5252536aacac5378c4a5050000000007acabac535163532784439e", "acab6a", 0, 1105620132, "edb7c74223d1f10f9b3b9c1db8064bc487321ff7bb346f287c6bc2fad83682de"], + ["0e803682024f79337b25c98f276d412bc27e56a300aa422c42994004790cee213008ff1b8303000000080051ac65ac655165f421a331892b19a44c9f88413d057fea03c3c4a6c7de4911fe6fe79cf2e9b3b10184b1910200000005525163630096cb1c670398277204000000000253acf7d5d502000000000963536a6a636a5363ab381092020000000002ac6a911ccf32", "6565", 1, -1492094009, "f0672638a0e568a919e9d8a9cbd7c0189a3e132940beeb52f111a89dcc2daa2c"], + ["7d71669d03022f9dd90edac323cde9e56354c6804c6b8e687e9ae699f46805aafb8bcaa636000000000253abffffffff698a5fdd3d7f2b8b000c68333e4dd58fa8045b3e2f689b889beeb3156cecdb490300000009525353abab0051acabc53f0aa821cdd69b473ec6e6cf45cf9b38996e1c8f52c27878a01ec8bb02e8cb31ad24e500000000055353ab0052ffffffff0447a23401000000000565ab53ab5133aaa0030000000006515163656563057d110300000000056a6aacac52cf13b5000000000003526a5100000000", "6a6a51", 1, -1349253507, "722efdd69a7d51d3d77bed0ac5544502da67e475ea5857cd5af6bdf640a69945"], + ["9ff618e60136f8e6bb7eabaaac7d6e2535f5fba95854be6d2726f986eaa9537cb283c701ff02000000026a65ffffffff012d1c0905000000000865ab00ac6a516a652f9ad240", "51515253635351ac", 0, 1571304387, "659cd3203095d4a8672646add7d77831a1926fc5b66128801979939383695a79"], + ["9fbd43ac025e1462ecd10b1a9182a8e0c542f6d1089322a41822ab94361e214ed7e1dfdd8a020000000263519d0437581538e8e0b6aea765beff5b4f3a4a202fca6e5d19b34c141078c6688f71ba5b8e0100000003ac6552ffffffff02077774050000000009655153655263acab6a0ae4e10100000000035152524c97136b", "635152ab", 0, 1969622955, "d82d4ccd9b67810f26a378ad9592eb7a30935cbbd27e859b00981aefd0a72e08"], + ["0117c92004314b84ed228fc11e2999e657f953b6de3b233331b5f0d0cf40d5cc149b93c7b30300000005515263516a083e8af1bd540e54bf5b309d36ba80ed361d77bbf4a1805c7aa73667ad9df4f97e2da410020000000600ab6351ab524d04f2179455e794b2fcb3d214670001c885f0802e4b5e015ed13a917514a7618f5f332203000000086a536aab51000063ecf029e65a4a009a5d67796c9f1eb358b0d4bd2620c8ad7330fb98f5a802ab92d0038b1002000000036a6551a184a88804b04490000000000009ab6a5152535165526a33d1ab020000000001518e92320000000000002913df04000000000952abac6353525353ac8b19bfdf", "000051ab0000", 0, 489433059, "8eebac87e60da524bbccaf285a44043e2c9232868dda6c6271a53c153e7f3a55"], + ["e7f5482903f98f0299e0984b361efb2fddcd9979869102281e705d3001a9d283fe9f3f3a1e02000000025365ffffffffcc5c7fe82feebad32a22715fc30bc584efc9cd9cadd57e5bc4b6a265547e676e0000000001ab579d21235bc2281e08bf5e7f8f64d3afb552839b9aa5c77cf762ba2366fffd7ebb74e49400000000055263ab63633df82cf40100982e05000000000453ac535300000000", "acacab", 2, -1362931214, "046de666545330e50d53083eb78c9336416902f9b96c77cc8d8e543da6dfc7e4"], + ["09adb2e90175ca0e816326ae2dce7750c1b27941b16f6278023dbc294632ab97977852a09d030000000465ab006affffffff027739cf0100000000075151ab63ac65ab8a5bb601000000000653ac5151520011313cdc", "ac", 0, -76831756, "478ee06501b4965b40bdba6cbaad9b779b38555a970912bb791b86b7191c54bc"], + ["f973867602e30f857855cd0364b5bbb894c049f44abbfd661d7ae5dbfeaafca89fac8959c20100000005ab52536a51ffffffffbeceb68a4715f99ba50e131884d8d20f4a179313691150adf0ebf29d05f8770303000000066352ab00ac63ffffffff021fddb90000000000036a656322a177000000000008526500ac5100acac84839083", "52acab53ac", 0, 1407879325, "db0329439490efc64b7104d6d009b03fbc6fac597cf54fd786fbbb5fd73b92b4"], + ["fd22ebaa03bd588ad16795bea7d4aa7f7d48df163d75ea3afebe7017ce2f350f6a0c1cb0bb00000000086aabac5153526363ffffffff488e0bb22e26a565d77ba07178d17d8f85702630ee665ec35d152fa05af3bda10200000004515163abffffffffeb21035849e85ad84b2805e1069a91bb36c425dc9c212d9bae50a95b6bfde1200300000001ab5df262fd02b69848040000000008ab6363636a6363ace23bf2010000000007655263635253534348c1da", "006353526563516a00", 0, -1491036196, "92364ba3c7a85d4e88885b8cb9b520dd81fc29e9d2b750d0790690e9c1246673"], + ["130b462d01dd49fac019dc4442d0fb54eaa6b1c2d1ad0197590b7df26969a67abd7f3fbb4f0100000008ac65abac53ab6563ffffffff0345f825000000000004ac53acac9d5816020000000002ababeff8e90500000000086aab006552ac6a53a892dc55", "ab0065ac530052", 0, 944483412, "1f4209fd4ce7f13d175fdd522474ae9b34776fe11a5f17a27d0796c77a2a7a9d"], + ["f8e50c2604609be2a95f6d0f31553081f4e1a49a0a30777fe51eb1c596c1a9a92c053cf28c0300000009656a51ac5252630052fffffffff792ed0132ae2bd2f11d4a2aab9d0c4fbdf9a66d9ae2dc4108afccdc14d2b1700100000007ab6a6563ac636a7bfb2fa116122b539dd6a2ab089f88f3bc5923e5050c8262c112ff9ce0a3cd51c6e3e84f02000000066551ac5352650d5e687ddf4cc9a497087cabecf74d236aa4fc3081c3f67b6d323cba795e10e7a171b725000000000852635351ab635100ffffffff02df5409020000000008ac6a53acab5151004156990200000000045163655200000000", "ac53abac65005300", 0, -173065000, "b596f206d7eba22b7e2d1b7a4f4cf69c7c541b6c84dcc943f84e19a99a923310"], + ["18020dd1017f149eec65b2ec23300d8df0a7dd64fc8558b36907723c03cd1ba672bbb0f51d0300000005ab65ab6a63ffffffff037cd7ae000000000009ab516a65005352ac65f1e4360400000000056353530053f118f0040000000009536363ab006500abac00000000", "63ab51acab52ac", 0, -550412404, "e19b796c14a0373674968e342f2741d8b51092a5f8409e9bff7dcd52e56fcbcb"], + ["b04154610363fdade55ceb6942d5e5a723323863b48a0cb04fdcf56210717955763f56b08d0300000009ac526a525151635151ffffffff93a176e76151a9eabdd7af00ef2af72f9e7af5ecb0aa4d45d00618f394cdd03c030000000074d818b332ebe05dc24c44d776cf9d275c61f471cc01efce12fd5a16464157f1842c65cb00000000066a0000ac6352d3c4134f01d8a1c0030000000005520000005200000000", "5200656a656351", 2, -9757957, "6e3e5ba77f760b6b5b5557b13043f1262418f3dd2ce7f0298b012811fc8ad5bc"], + ["9794b3ce033df7b1e32db62d2f0906b589eacdacf5743963dc2255b6b9a6cba211fadd0d41020000000600ab00650065ffffffffaae00687a6a4131152bbcaafedfaed461c86754b0bde39e2bef720e6d1860a0302000000070065516aac6552ffffffff50e4ef784d6230df7486e972e8918d919f005025bc2d9aacba130f58bed7056703000000075265ab52656a52ffffffff02c6f1a9000000000006005251006363cf450c040000000008abab63510053abac00000000", "ac0063ababab515353", 1, 2063905082, "fad092fc98f17c2c20e10ba9a8eb44cc2bcc964b006f4da45cb9ceb249c69698"], + ["94533db7015e70e8df715066efa69dbb9c3a42ff733367c18c22ff070392f988f3b93920820000000006535363636300ce4dac3e03169af80300000000080065ac6a53ac65ac39c050020000000006abacab6aacac708a02050000000005ac5251520000000000", "6553", 0, -360458507, "5418cf059b5f15774836edd93571e0eed3855ba67b2b08c99dccab69dc87d3e9"], + ["c8597ada04f59836f06c224a2640b79f3a8a7b41ef3efa2602592ddda38e7597da6c639fee0300000009005251635351acabacffffffff4c518f347ee694884b9d4072c9e916b1a1f0a7fc74a1c90c63fdf8e5a185b6ae02000000007113af55afb41af7518ea6146786c7c726641c68c8829a52925e8d4afd07d8945f68e7230300000008ab00ab65ab650063ffffffffc28e46d7598312c420e11dfaae12add68b4d85adb182ae5b28f8340185394b63000000000165ffffffff04dbabb7010000000000ee2f6000000000000852ab6500ab6a51acb62a27000000000009ac53515300ac006a6345fb7505000000000752516a0051636a00000000", "", 3, 15199787, "0d66003aff5bf78cf492ecbc8fd40c92891acd58d0a271be9062e035897f317e"], + ["1a28c4f702c8efaad96d879b38ec65c5283b5c084b819ad7db1c086e85e32446c7818dc7a90300000008656351536a525165fa78cef86c982f1aac9c5eb8b707aee8366f74574c8f42ef240599c955ef4401cf578be30200000002ab518893292204c430eb0100000000016503138a0300000000040053abac60e0eb010000000005525200ab63567c2d030000000004abab52006cf81e85", "ab51525152", 1, 2118315905, "4e4c9a781f626b59b1d3ad8f2c488eb6dee8bb19b9bc138bf0dc33e7799210d4"], + ["c6c7a87003f772bcae9f3a0ac5e499000b68703e1804b9ddc3e73099663564d53ddc4e1c6e01000000076a536a6aac63636e3102122f4c30056ef8711a6bf11f641ddfa6984c25ac38c3b3e286e74e839198a80a34010000000165867195cd425821dfa2f279cb1390029834c06f018b1e6af73823c867bf3a0524d1d6923b0300000005acab53ab65ffffffff02fa4c49010000000008ab656a0052650053e001100400000000008836d972", "ac526351acab", 1, 978122815, "a869c18a0edf563d6e5eddd5d5ae8686f41d07f394f95c9feb8b7e52761531ca"], + ["0ea580ac04c9495ab6af3b8d59108bb4194fcb9af90b3511c83f7bb046d87aedbf8423218e02000000085152acac006363ab9063d7dc25704e0caa5edde1c6f2dd137ded379ff597e055b2977b9c559b07a7134fcef2000000000200aca89e50181f86e9854ae3b453f239e2847cf67300fff802707c8e3867ae421df69274449402000000056365abababffffffff47a4760c881a4d7e51c69b69977707bd2fb3bcdc300f0efc61f5840e1ac72cee0000000000ffffffff0460179a020000000004ab53ab52a5250c0500000000096565acac6365ab52ab6c281e02000000000952635100ac006563654e55070400000000046552526500000000", "ab526563acac53ab", 2, 1426964167, "b1c50d58b753e8f6c7513752158e9802cf0a729ebe432b99acc0fe5d9b4e9980"], + ["c33028b301d5093e1e8397270d75a0b009b2a6509a01861061ab022ca122a6ba935b8513320200000000ffffffff013bcf5a0500000000015200000000", "", 0, -513413204, "6b1459536f51482f5dbf42d7e561896557461e1e3b6bf67871e2b51faae2832c"], + ["43b2727901a7dd06dd2abf690a1ccedc0b0739cb551200796669d9a25f24f71d8d101379f50300000000ffffffff0418e031040000000000863d770000000000085352ac526563ac5174929e040000000004ac65ac00ec31ac0100000000066a51ababab5300000000", "65", 0, -492874289, "154ff7a9f0875edcfb9f8657a0b98dd9600fabee3c43eb88af37cf99286d516c"], + ["4763ed4401c3e6ab204bed280528e84d5288f9cac5fb8a2e7bd699c7b98d4df4ac0c40e55303000000066a6aacab5165ffffffff015b57f80400000000046a63535100000000", "ac51abab53", 0, -592611747, "849033a2321b5755e56ef4527ae6f51e30e3bca50149d5707368479723d744f8"], + ["d24f647b02f71708a880e6819a1dc929c1a50b16447e158f8ff62f9ccd644e0ca3c592593702000000050053536a00ffffffff67868cd5414b6ca792030b18d649de5450a456407242b296d936bcf3db79e07b02000000005af6319c016022f50100000000036a516300000000", "6aab526353516a6a", 0, 1350782301, "8556fe52d1d0782361dc28baaf8774b13f3ce5ed486ae0f124b665111e08e3e3"], + ["fe6ddf3a02657e42a7496ef170b4a8caf245b925b91c7840fd28e4a22c03cb459cb498b8d603000000065263656a650071ce6bf8d905106f9f1faf6488164f3decac65bf3c5afe1dcee20e6bc3cb6d052561985a030000000163295b117601343dbb0000000000026563dba521df", "", 1, -1696179931, "d9684685c99ce48f398fb467a91a1a59629a850c429046fb3071f1fa9a5fe816"], + ["c61523ef0129bb3952533cbf22ed797fa2088f307837dd0be1849f20decf709cf98c6f032f03000000026563c0f1d378044338310400000000066363516a5165a14fcb0400000000095163536a6a00ab53657271d60200000000001d953f0500000000010000000000", "53516353005153", 0, 1141615707, "7e975a72db5adaa3c48d525d9c28ac11cf116d0f8b16ce08f735ad75a80aec66"], + ["ba3dac6c0182562b0a26d475fe1e36315f0913b6869bdad0ecf21f1339a5fcbccd32056c840200000000ffffffff04300351050000000000220ed405000000000851abac636565ac53dbbd19020000000007636363ac6a52acbb005a0500000000016abd0c78a8", "63006a635151005352", 0, 1359658828, "47bc8ab070273e1f4a0789c37b45569a6e16f3f3092d1ce94dddc3c34a28f9f4"], + ["ac27e7f5025fc877d1d99f7fc18dd4cadbafa50e34e1676748cc89c202f93abf36ed46362101000000036300abffffffff958cd5381962b765e14d87fc9524d751e4752dd66471f973ed38b9d562e525620100000003006500ffffffff02b67120050000000004ac51516adc330c0300000000015200000000", "656352", 1, 15049991, "f3374253d64ac264055bdbcc32e27426416bd595b7c7915936c70f839e504010"], + ["edb30140029182b80c8c3255b888f7c7f061c4174d1db45879dca98c9aab8c8fed647a6ffc03000000086a53510052ab6300ffffffff82f65f261db62d517362c886c429c8fbbea250bcaad93356be6f86ba573e9d930100000000ffffffff04daaf150400000000016a86d1300100000000096a6353535252ac5165d4ddaf000000000002abab5f1c6201000000000000000000", "ab6a6a00ac", 0, -2058017816, "8d7794703dad18e2e40d83f3e65269834bb293e2d2b8525932d6921884b8f368"], + ["7e50207303146d1f7ad62843ae8017737a698498d4b9118c7a89bb02e8370307fa4fada41d000000000753006300005152b7afefc85674b1104ba33ef2bf37c6ed26316badbc0b4aa6cb8b00722da4f82ff3555a6c020000000900ac656363ac51ac52ffffffff93fab89973bd322c5d7ad7e2b929315453e5f7ada3072a36d8e33ca8bebee6e0020000000300acab930da52b04384b04000000000004650052ac435e380200000000076a6a515263ab6aa9494705000000000600ab6a525252af8ba90100000000096565acab526353536a279b17ad", "acac005263536aac63", 1, -34754133, "4e6357da0057fb7ff79da2cc0f20c5df27ff8b2f8af4c1709e6530459f7972b0"], + ["c05764f40244fb4ebe4c54f2c5298c7c798aa90e62c29709acca0b4c2c6ec08430b26167440100000008acab6a6565005253ffffffffc02c2418f398318e7f34a3cf669d034eef2111ea95b9f0978b01493293293a870100000000e563e2e00238ee8d040000000002acab03fb060200000000076500ac656a516aa37f5534", "52ab6a0065", 1, -2033176648, "83deef4a698b62a79d4877dd9afebc3011a5275dbe06e89567e9ef84e8a4ee19"], + ["5a59e0b9040654a3596d6dab8146462363cd6549898c26e2476b1f6ae42915f73fd9aedfda00000000036363abffffffff9ac9e9ca90be0187be2214251ff08ba118e6bf5e2fd1ba55229d24e50a510d53010000000165ffffffff41d42d799ac4104644969937522873c0834cc2fcdab7cdbecd84d213c0e96fd60000000000ffffffffd838db2c1a4f30e2eaa7876ef778470f8729fcf258ad228b388df2488709f8410300000000fdf2ace002ceb6d903000000000265654c1310040000000003ac00657e91c0ec", "536a63ac", 0, 82144555, "98ccde2dc14d14f5d8b1eeea5364bd18fc84560fec2fcea8de4d88b49c00695e"], + ["156ebc8202065d0b114984ee98c097600c75c859bfee13af75dc93f57c313a877efb09f230010000000463536a51ffffffff81114e8a697be3ead948b43b5005770dd87ffb1d5ccd4089fa6c8b33d3029e9c03000000066a5251656351ffffffff01a87f140000000000050000ac51ac00000000", "00", 0, -362221092, "a903c84d8c5e71134d1ab6dc1e21ac307c4c1a32c90c90f556f257b8a0ec1bf5"], + ["15e37793023c7cbf46e073428908fce0331e49550f2a42b92468827852693f0532a01c29f70200000007005353636351acffffffff38426d9cec036f00eb56ec1dcd193647e56a7577278417b8a86a78ac53199bc403000000056353006a53ffffffff04a25ce103000000000900ab5365656a526a63c8eff7030000000004526353537ab6db0200000000016a11a3fa02000000000651acacab526500000000", "53ac6aab6a6551", 0, 1117532791, "83c68b3c5a89260ce16ce8b4dbf02e1f573c532d9a72f5ea57ab419fa2630214"], + ["f7a09f10027250fc1b70398fb5c6bffd2be9718d3da727e841a73596fdd63810c9e4520a6a010000000963ac516a636a65acac1d2e2c57ab28d311edc4f858c1663972eebc3bbc93ed774801227fda65020a7ec1965f780200000005ac5252516a8299fddc01dcbf7200000000000463ac6551960fda03", "65acab51", 1, 2017321737, "9c5fa02abfd34d0f9dec32bf3edb1089fca70016debdb41f4f54affcb13a2a2a"], + ["6d97a9a5029220e04f4ccc342d8394c751282c328bf1c132167fc05551d4ca4da4795f6d4e02000000076a0052ab525165ffffffff9516a205e555fa2a16b73e6db6c223a9e759a7e09c9a149a8f376c0a7233fa1b0100000007acab51ab63ac6affffffff04868aed04000000000652ac65ac536a396edf01000000000044386c0000000000076aab5363655200894d48010000000001ab8ebefc23", "6351526aac51", 1, 1943666485, "f0bd4ca8e97203b9b4e86bc24bdc8a1a726db5e99b91000a14519dc83fc55c29"], + ["8e3fddfb028d9e566dfdda251cd874cd3ce72e9dde837f95343e90bd2a93fe21c5daeb5eed01000000045151525140517dc818181f1e7564b8b1013fd68a2f9a56bd89469686367a0e72c06be435cf99db750000000003635251ffffffff01c051780300000000096552ababac6a65acab099766eb", "5163ab6a52ababab51", 1, 1296295812, "5509eba029cc11d7dd2808b8c9eb47a19022b8d8b7778893459bbc19ab7ea820"], + ["a603f37b02a35e5f25aae73d0adc0b4b479e68a734cf722723fd4e0267a26644c36faefdab0200000000ffffffff43374ad26838bf733f8302585b0f9c22e5b8179888030de9bdda180160d770650200000001004c7309ce01379099040000000005526552536500000000", "abababab005153", 0, 1409936559, "4ca73da4fcd5f1b10da07998706ffe16408aa5dff7cec40b52081a6514e3827e"], + ["9eeedaa8034471a3a0e3165620d1743237986f060c4434f095c226114dcb4b4ec78274729f03000000086a5365510052ac6afb505af3736e347e3f299a58b1b968fce0d78f7457f4eab69240cbc40872fd61b5bf8b120200000002ac52df8247cf979b95a4c97ecb8edf26b3833f967020cd2fb25146a70e60f82c9ee4b14e88b103000000008459e2fa0125cbcd05000000000000000000", "52ab5352006353516a", 0, -1832576682, "fb018ae54206fdd20c83ae5873ec82b8e320a27ed0d0662db09cda8a071f9852"], + ["05921d7c048cf26f76c1219d0237c226454c2a713c18bf152acc83c8b0647a94b13477c07f0300000003ac526afffffffff2f494453afa0cabffd1ba0a626c56f90681087a5c1bd81d6adeb89184b27b7402000000036a6352ffffffff0ad10e2d3ce355481d1b215030820da411d3f571c3f15e8daf22fe15342fed04000000000095f29f7b93ff814a9836f54dc6852ec414e9c4e16a506636715f569151559100ccfec1d100000000055263656a53ffffffff04f4ffef010000000008ac6a6aabacabab6a0e6689040000000006ab536a5352abe364d005000000000965536363655251ab53807e00010000000004526aab63f18003e3", "6363ac51", 3, -375891099, "001b0b176f0451dfe2d9787b42097ceb62c70d324e925ead4c58b09eebdf7f67"], + ["b9b44d9f04b9f15e787d7704e6797d51bc46382190c36d8845ec68dfd63ee64cf7a467b21e00000000096aac00530052ab636aba1bcb110a80c5cbe073f12c739e3b20836aa217a4507648d133a8eedd3f02cb55c132b203000000076a000063526352b1c288e3a9ff1f2da603f230b32ef7c0d402bdcf652545e2322ac01d725d75f5024048ad0100000000ffffffffffd882d963be559569c94febc0ef241801d09dc69527c9490210f098ed8203c700000000056a006300ab9109298d01719d9a0300000000066a52ab006365d7894c5b", "ac6351650063636a", 3, -622355349, "ac87b1b93a6baab6b2c6624f10e8ebf6849b0378ef9660a3329073e8f5553c8d"], + ["ff60473b02574f46d3e49814c484081d1adb9b15367ba8487291fc6714fd6e3383d5b335f001000000026a6ae0b82da3dc77e5030db23d77b58c3c20fa0b70aa7d341a0f95f3f72912165d751afd57230300000008ac536563516a6363ffffffff04f86c0200000000000553acab636ab13111000000000003510065f0d3f305000000000951ab516a65516aabab730a3a010000000002515200000000", "ac6a", 1, 1895032314, "0767e09bba8cd66d55915677a1c781acd5054f530d5cf6de2d34320d6c467d80"], + ["f218026204f4f4fc3d3bd0eada07c57b88570d544a0436ae9f8b753792c0c239810bb30fbc0200000002536affffffff8a468928d6ec4cc10aa0f73047697970e99fa64ae8a3b4dca7551deb0b639149010000000851ab520052650051ffffffffa98dc5df357289c9f6873d0f5afcb5b030d629e8f23aa082cf06ec9a95f3b0cf0000000000ffffffffea2c2850c5107705fd380d6f29b03f533482fd036db88739122aac9eff04e0aa010000000365536a03bd37db034ac4c4020000000007515152655200ac33b27705000000000151efb71e0000000000007b65425b", "515151", 3, -1772252043, "de35c84a58f2458c33f564b9e58bc57c3e028d629f961ad1b3c10ee020166e5a"], + ["48e7d42103b260b27577b70530d1ac2fed2551e9dd607cbcf66dca34bb8c03862cf8f5fd5401000000075151526aacab00ffffffff1e3d3b841552f7c6a83ee379d9d66636836673ce0b0eda95af8f2d2523c91813030000000665acac006365ffffffff388b3c386cd8c9ef67c83f3eaddc79f1ff910342602c9152ffe8003bce51b28b0100000008636363006a636a52ffffffff04b8f67703000000000852005353ac6552520cef720200000000085151ab6352ab00ab5096d6030000000005516a005100662582020000000001ac6c137280", "6a65", 1, 1513618429, "e2fa3e1976aed82c0987ab30d4542da2cb1cffc2f73be13480132da8c8558d5c"], + ["91ebc4cf01bc1e068d958d72ee6e954b196f1d85b3faf75a521b88a78021c543a06e056279000000000265ab7c12df0503832121030000000000cc41a6010000000005ab5263516540a951050000000006ab63ab65acac00000000", "526a0065636a6a6aac", 0, -614046478, "7de4ba875b2e584a7b658818c112e51ee5e86226f5a80e5f6b15528c86400573"], + ["3cd4474201be7a6c25403bf00ca62e2aa8f8f4f700154e1bb4d18c66f7bb7f9b975649f0dc0100000006535151535153ffffffff01febbeb000000000006005151006aac00000000", "", 0, -1674687131, "6b77ca70cc452cc89acb83b69857cda98efbfc221688fe816ef4cb4faf152f86"], + ["92fc95f00307a6b3e2572e228011b9c9ed41e58ddbaefe3b139343dbfb3b34182e9fcdc3f50200000002acab847bf1935fde8bcfe41c7dd99683289292770e7f163ad09deff0e0665ed473cd2b56b0f40300000006516551ab6351294dab312dd87b9327ce2e95eb44b712cfae0e50fda15b07816c8282e8365b643390eaab01000000026aacffffffff016e0b6b040000000001ac00000000", "650065acac005300", 2, -1885164012, "bd7d26bb3a98fc8c90c972500618bf894cb1b4fe37bf5481ff60eef439d3b970"], + ["4db591ab018adcef5f4f3f2060e41f7829ce3a07ea41d681e8cb70a0e37685561e4767ac3b0000000005000052acabd280e63601ae6ef20000000000036a636326c908f7", "ac6a51526300630052", 0, 862877446, "355ccaf30697c9c5b966e619a554d3323d7494c3ea280a9b0dfb73f953f5c1cb"], + ["503fd5ef029e1beb7b242d10032ac2768f9a1aca0b0faffe51cec24770664ec707ef7ede4f01000000045253ac53375e350cc77741b8e96eb1ce2d3ca91858c052e5f5830a0193200ae2a45b413dda31541f0000000003516553ffffffff0175a5ba0500000000015200000000", "6aab65510053ab65", 1, 1603081205, "353ca9619ccb0210ae18b24d0e57efa7abf8e58fa6f7102738e51e8e72c9f0c4"], + ["c80abebd042cfec3f5c1958ee6970d2b4586e0abec8305e1d99eb9ee69ecc6c2cbd76374380000000007ac53006300ac510acee933b44817db79320df8094af039fd82111c7726da3b33269d3820123694d849ee5001000000056a65ab526562699bea8530dc916f5d61f0babea709dac578774e8a4dcd9c640ec3aceb6cb2443f24f302000000020063ea780e9e57d1e4245c1e5df19b4582f1bf704049c5654f426d783069bcc039f2d8fa659f030000000851ab53635200006a8d00de0b03654e8500000000000463ab635178ebbb0400000000055100636aab239f1d030000000006ab006300536500000000", "6565ac515100", 3, 1460851377, "b35bb1b72d02fab866ed6bbbea9726ab32d968d33a776686df3ac16aa445871e"], + ["0337b2d5043eb6949a76d6632b8bb393efc7fe26130d7409ef248576708e2d7f9d0ced9d3102000000075352636a5163007034384dfa200f52160690fea6ce6c82a475c0ef1caf5c9e5a39f8f9ddc1c8297a5aa0eb02000000026a51ffffffff38e536298799631550f793357795d432fb2d4231f4effa183c4e2f61a816bcf0030000000463ac5300706f1cd3454344e521fde05b59b96e875c8295294da5d81d6cc7efcfe8128f150aa54d6503000000008f4a98c704c1561600000000000072cfa6000000000000e43def01000000000100cf31cc0500000000066365526a6500cbaa8e2e", "", 3, 2029506437, "7615b4a7b3be865633a31e346bc3db0bcc410502c8358a65b8127089d81b01f8"], + ["59f6cffd034733f4616a20fe19ea6aaf6abddb30b408a3a6bd86cd343ab6fe90dc58300cc90200000000ffffffffc835430a04c3882066abe7deeb0fa1fdaef035d3233460c67d9eabdb05e95e5a02000000080065ac535353ab00ffffffff4b9a043e89ad1b4a129c8777b0e8d87a014a0ab6a3d03e131c27337bbdcb43b402000000066a5100abac6ad9e9bf62014bb118010000000001526cbe484f", "ab526352ab65", 0, 2103515652, "4f2ccf981598639bec57f885b4c3d8ea8db445ea6e61cfd45789c69374862e5e"], + ["cbc79b10020b15d605680a24ee11d8098ad94ae5203cb6b0589e432832e20c27b72a926af20300000006ab65516a53acbb854f3146e55c508ece25fa3d99dbfde641a58ed88c051a8a51f3dacdffb1afb827814b02000000026352c43e6ef30302410a020000000000ff4bd90100000000065100ab63000008aa8e0400000000095265526565ac5365abc52c8a77", "53526aac0051", 0, 202662340, "984efe0d8d12e43827b9e4b27e97b3777ece930fd1f589d616c6f9b71dab710e"], + ["7c07419202fa756d29288c57b5c2b83f3c847a807f4a9a651a3f6cd6c46034ae0aa3a7446b0200000004ab6a6365ffffffff9da83cf4219bb96c76f2d77d5df31c1411a421171d9b59ec02e5c1218f29935403000000008c13879002f8b1ac0400000000086a63536a636553653c584f02000000000000000000", "abac53ab656363", 1, -1038419525, "4a74f365a161bc6c9bddd249cbd70f5dadbe3de70ef4bd745dcb6ee1cd299fbd"], + ["351cbb57021346e076d2a2889d491e9bfa28c54388c91b46ee8695874ad9aa576f1241874d0200000008ab6563525300516affffffffe13e61b8880b8cd52be4a59e00f9723a4722ea58013ec579f5b3693b9e115b1100000000096363abac5252635351ffffffff027fee02040000000008ab6a5200ab006a65b85f130200000000086a52630053ab52ab00000000", "ab6aab65", 1, 586415826, "08bbb746a596991ab7f53a76e19acad087f19cf3e1db54054aab403c43682d09"], + ["a8252ea903f1e8ff953adb16c1d1455a5036222c6ea98207fc21818f0ece2e1fac310f9a0100000000095163ac635363ac0000be6619e9fffcde50a0413078821283ce3340b3993ad00b59950bae7a9f931a9b0a3a035f010000000463005300b8b0583fbd6049a1715e7adacf770162811989f2be20af33f5f60f26eba653dc26b024a00000000006525351636552ffffffff046d2acc030000000002636a9a2d430500000000080065005165ab53abecf63204000000000052b9ed050000000008acacac53ab65656500000000", "65ab53635253636a51", 2, 1442639059, "8ca11838775822f9a5beee57bdb352f4ee548f122de4a5ca61c21b01a1d50325"], + ["2f1a425c0471a5239068c4f38f9df135b1d24bf52d730d4461144b97ea637504495aec360801000000055300515365c71801dd1f49f376dd134a9f523e0b4ae611a4bb122d8b26de66d95203f181d09037974300000000025152ffffffff9bdcea7bc72b6e5262e242c94851e3a5bf8f314b3e5de0e389fc9e5b3eadac030000000009525265655151005153ffffffffdbb53ce99b5a2320a4e6e2d13b01e88ed885a0957d222e508e9ec8e4f83496cb0200000007635200abac63ac04c96237020cc5490100000000080000516a51ac6553074a360200000000025152225520ca", "6551ab65ac65516a", 1, -489869549, "9bc5bb772c553831fb40abe466074e59a469154679c7dee042b8ea3001c20393"], + ["ef3acfd4024defb48def411b8f8ba2dc408dc9ee97a4e8bde4d6cb8e10280f29c98a6e8e9103000000035100513d5389e3d67e075469dfd9f204a7d16175653a149bd7851619610d7ca6eece85a516b2df0300000005516aac6552ca678bdf02f477f003000000000057e45b0300000000055252525252af35c20a", "5165ac53ab", 1, -1900839569, "78eb6b24365ac1edc386aa4ffd15772f601059581c8776c34f92f8a7763c9ccf"], + ["ff4468dc0108475fc8d4959a9562879ce4ab4867a419664bf6e065f17ae25043e6016c70480100000000ffffffff02133c6f0400000000000bd0a8020000000004006a520035afa4f6", "51ac65ab", 0, -537664660, "f6da59b9deac63e83728850ac791de61f5dfcaeed384ebcbb20e44afcd8c8910"], + ["4e8594d803b1d0a26911a2bcdd46d7cbc987b7095a763885b1a97ca9cbb747d32c5ab9aa91030000000353ac53a0cc4b215e07f1d648b6eeb5cdbe9fa32b07400aa773b9696f582cebfd9930ade067b2b200000000060065abab6500fc99833216b8e27a02defd9be47fafae4e4a97f52a9d2a210d08148d2a4e5d02730bcd460100000004516351ac37ce3ae1033baa55040000000006006a636a63acc63c990400000000025265eb1919030000000005656a6a516a00000000", "", 1, -75217178, "04c5ee48514cd033b82a28e336c4d051074f477ef2675ce0ce4bafe565ee9049"], + ["a88830a7023f13ed19ab14fd757358eb6af10d6520f9a54923a6d613ac4f2c11e249cda8aa030000000851630065abababacffffffff8f5fe0bc04a33504c4b47e3991d25118947a0261a9fa520356731eeabd561dd3020000000363ababffffffff038404bd010000000008ab5153516aab6a63d33a5601000000000263004642dc020000000009655152acac636352004be6f3af", "5253536565006aab6a", 0, 1174417836, "2e42ead953c9f4f81b72c27557e6dc7d48c37ff2f5c46c1dbe9778fb0d79f5b2"], + ["44e1a2b4010762af23d2027864c784e34ef322b6e24c70308a28c8f2157d90d17b99cd94a401000000085163656565006300ffffffff0198233d020000000002000000000000", "52525153656365", 0, 1119696980, "d9096de94d70c6337da6202e6e588166f31bff5d51bb5adc9468594559d65695"], + ["44ca65b901259245abd50a745037b17eb51d9ce1f41aa7056b4888285f48c6f26cb97b7a25020000000552636363abffffffff047820350400000000040053acab14f3e603000000000652635100ab630ce66c03000000000001bdc704000000000765650065ac51ac3e886381", "51", 0, -263340864, "ed5622ac642d11f90e68c0feea6a2fe36d880ecae6b8c0d89c4ea4b3d162bd90"], + ["cfa147d2017fe84122122b4dda2f0d6318e59e60a7207a2d00737b5d89694d480a2c26324b0000000006006351526552ffffffff0456b5b804000000000800516aab525363ab166633000000000004655363ab254c0e02000000000952ab6a6a00ab525151097c1b020000000009656a52ac6300530065ad0d6e50", "6a535165ac6a536500", 0, -574683184, "f926d4036eac7f019a2b0b65356c4ee2fe50e089dd7a70f1843a9f7bc6997b35"], + ["91c5d5f6022fea6f230cc4ae446ce040d8313071c5ac1749c82982cc1988c94cb1738aa48503000000016a19e204f30cb45dd29e68ff4ae160da037e5fc93538e21a11b92d9dd51cf0b5efacba4dd70000000005656a6aac51ffffffff03db126905000000000953006a53ab6563636a36a273030000000006656a52656552b03ede00000000000352516500000000", "530052526a00", 1, 1437328441, "255c125b60ee85f4718b2972174c83588ee214958c3627f51f13b5fb56c8c317"], + ["03f20dc202c886907b607e278731ebc5d7373c348c8c66cac167560f19b341b782dfb634cb03000000076a51ac6aab63abea3e8de7adb9f599c9caba95aa3fa852e947fc88ed97ee50e0a0ec0d14d164f44c0115c10100000004ab5153516fdd679e0414edbd000000000005ac636a53512021f2040000000007006a0051536a52c73db2050000000005525265ac5369046e000000000003ab006a1ef7bd1e", "52656a", 0, 1360223035, "5a0a05e32ce4cd0558aabd5d79cd5fcbffa95c07137506e875a9afcba4bef5a2"], + ["d9611140036881b61e01627078512bc3378386e1d4761f959d480fdb9d9710bebddba2079d020000000763536aab5153ab819271b41e228f5b04daa1d4e72c8e1955230accd790640b81783cfc165116a9f535a74c000000000163ffffffffa2e7bb9a28e810624c251ff5ba6b0f07a356ac082048cf9f39ec036bba3d431a02000000076a000000ac65acffffffff01678a820000000000085363515153ac635100000000", "535353", 2, -82213851, "52b9e0778206af68998cbc4ebdaad5a9469e04d0a0a6cef251abfdbb74e2f031"], + ["98b3a0bf034233afdcf0df9d46ac65be84ef839e58ee9fa59f32daaa7d684b6bdac30081c60200000007636351acabababffffffffc71cf82ded4d1593e5825618dc1d5752ae30560ecfaa07f192731d68ea768d0f0100000006650052636563f3a2888deb5ddd161430177ce298242c1a86844619bc60ca2590d98243b5385bc52a5b8f00000000095365acacab520052ac50d4722801c3b8a60300000000035165517e563b65", "51", 1, -168940690, "b6b684e2d2ecec8a8dce4ed3fc1147f8b2e45732444222aa8f52d860c2a27a9d"], + ["97be4f7702dc20b087a1fdd533c7de762a3f2867a8f439bddf0dcec9a374dfd0276f9c55cc0300000000cdfb1dbe6582499569127bda6ca4aaff02c132dc73e15dcd91d73da77e92a32a13d1a0ba0200000002ab51ffffffff048cfbe202000000000900516351515363ac535128ce0100000000076aac5365ab6aabc84e8302000000000863536a53ab6a6552f051230500000000066aac535153510848d813", "ac51", 0, 229541474, "e5da9a416ea883be1f8b8b2d178463633f19de3fa82ae25d44ffb531e35bdbc8"], + ["085b6e04040b5bff81e29b646f0ed4a45e05890a8d32780c49d09643e69cdccb5bd81357670100000001abffffffffa5c981fe758307648e783217e3b4349e31a557602225e237f62b636ec26df1a80300000004650052ab4792e1da2930cc90822a8d2a0a91ea343317bce5356b6aa8aae6c3956076aa33a5351a9c0300000004abac5265e27ddbcd472a2f13325cc6be40049d53f3e266ac082172f17f6df817db1936d9ff48c02b000000000152ffffffff021aa7670500000000085353635163ab51ac14d584000000000001aca4d136cc", "6a525300536352536a", 0, -1398925877, "41ecca1e8152ec55074f4c39f8f2a7204dda48e9ec1e7f99d5e7e4044d159d43"], + ["eec32fff03c6a18b12cd7b60b7bdc2dd74a08977e53fdd756000af221228fe736bd9c42d870100000007005353ac515265ffffffff037929791a188e9980e8b9cc154ad1b0d05fb322932501698195ab5b219488fc02000000070063510065ab6a0bfc176aa7e84f771ea3d45a6b9c24887ceea715a0ff10ede63db8f089e97d927075b4f1000000000551abab63abffffffff02eb933c000000000000262c420000000000036563632549c2b6", "6352", 2, 1480445874, "ff8a4016dfdd918f53a45d3a1f62b12c407cd147d68ca5c92b7520e12c353ff5"], + ["98ea7eac0313d9fb03573fb2b8e718180c70ce647bebcf49b97a8403837a2556cb8c9377f30000000004ac53ac65ffffffff8caac77a5e52f0d8213ef6ce998bedbb50cfdf108954771031c0e0cd2a78423900000000010066e99a44937ebb37015be3693761078ad5c73aa73ec623ac7300b45375cc8eef36087eb80000000007515352acac5100ffffffff0114a51b02000000000000000000", "6aacab", 0, 243527074, "bad77967f98941af4dd52a8517d5ad1e32307c0d511e15461e86465e1b8b5273"], + ["3ab70f4604e8fc7f9de395ec3e4c3de0d560212e84a63f8d75333b604237aa52a10da17196000000000763526a6553ac63a25de6fd66563d71471716fe59087be0dde98e969e2b359282cf11f82f14b00f1c0ac70f02000000050052516aacdffed6bb6889a13e46956f4b8af20752f10185838fd4654e3191bf49579c961f5597c36c0100000005ac636363abc3a1785bae5b8a1b4be5d0cbfadc240b4f7acaa7dfed6a66e852835df5eb9ac3c553766801000000036a65630733b7530218569602000000000952006a6a6a51acab52777f06030000000007ac0063530052abc08267c9", "000000536aac0000", 1, 1919096509, "df1c87cf3ba70e754d19618a39fdbd2970def0c1bfc4576260cba5f025b87532"], + ["bdb6b4d704af0b7234ced671c04ba57421aba7ead0a117d925d7ebd6ca078ec6e7b93eea6600000000026565ffffffff3270f5ad8f46495d69b9d71d4ab0238cbf86cc4908927fbb70a71fa3043108e6010000000700516a65655152ffffffff6085a0fdc03ae8567d0562c584e8bfe13a1bd1094c518690ebcb2b7c6ce5f04502000000095251530052536a53aba576a37f2c516aad9911f687fe83d0ae7983686b6269b4dd54701cb5ce9ec91f0e6828390300000000ffffffff04cc76cc020000000002656a01ffb702000000000253ab534610040000000009acab006565516a00521f55f5040000000000389dfee9", "6a525165", 0, 1336204763, "71c294523c48fd7747eebefbf3ca06e25db7b36bff6d95b41c522fecb264a919"], + ["54258edd017d22b274fbf0317555aaf11318affef5a5f0ae45a43d9ca4aa652c6e85f8a040010000000953ac65ab5251656500ffffffff03321d450000000000085265526a51526a529ede8b030000000003635151ce6065020000000001534c56ec1b", "acac", 0, 2094130012, "110d90fea9470dfe6c5048f45c3af5e8cc0cb77dd58fd13d338268e1c24b1ccc"], + ["ce0d322e04f0ffc7774218b251530a7b64ebefca55c90db3d0624c0ff4b3f03f918e8cf6f60300000003656500ffffffff9cce943872da8d8af29022d0b6321af5fefc004a281d07b598b95f6dcc07b1830200000007abab515351acab8d926410e69d76b7e584aad1470a97b14b9c879c8b43f9a9238e52a2c2fefc2001c56af8010000000400ab5253cd2cd1fe192ce3a93b5478af82fa250c27064df82ba416dfb0debf4f0eb307a746b6928901000000096500abacac6a0063514214524502947efc0200000000035251652c40340100000000096a6aab52000052656a5231c54c", "51", 2, -2090320538, "0322ca570446869ec7ec6ad66d9838cff95405002d474c0d3c17708c7ee039c6"], + ["47ac54940313430712ebb32004679d3a512242c2b33d549bf5bbc8420ec1fd0850ed50eb6d0300000009536aac6a65acacab51ffffffffb843e44266ce2462f92e6bff54316661048c8c17ecb092cb493b39bfca9117850000000001519ab348c05e74ebc3f67423724a3371dd99e3bceb4f098f8860148f48ad70000313c4c223000000000653006565656512c2d8dc033f3c97010000000002636aa993aa010000000006526365ab526ab7cf560300000000076a0065ac6a526500000000", "005352535300ab6a", 2, 59531991, "8b5b3d00d9c658f062fe6c5298e54b1fe4ed3a3eab2a87af4f3119edc47b1691"], + ["233cd90b043916fc41eb870c64543f0111fb31f3c486dc72457689dea58f75c16ae59e9eb2000000000500536a6a6affffffff9ae30de76be7cd57fb81220fce78d74a13b2dbcad4d023f3cadb3c9a0e45a3ce000000000965ac6353ac5165515130834512dfb293f87cb1879d8d1b20ebad9d7d3d5c3e399a291ce86a3b4d30e4e32368a9020000000453005165ffffffff26d84ae93eb58c81158c9b3c3cbc24a84614d731094f38d0eea8686dec02824d0300000005636a65abacf02c784001a0bd5d03000000000900655351ab65ac516a416ef503", "", 1, -295106477, "b79f31c289e95d9dadec48ebf88e27c1d920661e50d090e422957f90ff94cb6e"], + ["9200e26b03ff36bc4bf908143de5f97d4d02358db642bd5a8541e6ff709c420d1482d471b70000000008abab65536a636553ffffffff61ba6d15f5453b5079fb494af4c48de713a0c3e7f6454d7450074a2a80cb6d880300000007ac6a00ab5165515dfb7574fbce822892c2acb5d978188b1d65f969e4fe874b08db4c791d176113272a5cc10100000000ffffffff0420958d000000000009ac63516a0063516353dd885505000000000465ac00007b79e901000000000066d8bf010000000005525252006a00000000", "ac5152", 0, 2089531339, "89ec7fab7cfe7d8d7d96956613c49dc48bf295269cfb4ea44f7333d88c170e62"], + ["45f335ba01ce2073a8b0273884eb5b48f56df474fc3dff310d9706a8ac7202cf5ac188272103000000025363ffffffff049d859502000000000365ab6a8e98b1030000000002ac51f3a80603000000000752535151ac00000306e30300000000020051b58b2b3a", "", 0, 1899564574, "78e01310a228f645c23a2ad0acbb8d91cedff4ecdf7ca997662c6031eb702b11"], + ["d8f652a6043b4faeada05e14b81756cd6920cfcf332e97f4086961d49232ad6ffb6bc6c097000000000453526563ffffffff1ea4d60e5e91193fbbc1a476c8785a79a4c11ec5e5d6c9950c668ceacfe07a15020000000352ab51fffffffffe029a374595c4edd382875a8dd3f20b9820abb3e93f877b622598d11d0b09e503000000095351000052ac515152ffffffff9d65fea491b979699ceb13caf2479cd42a354bd674ded3925e760758e85a756803000000046365acabffffffff0169001d00000000000651636a65656300000000", "ab0063630000ac", 3, 1050965951, "4cc85cbc2863ee7dbce15490d8ca2c5ded61998257b9eeaff968fe38e9f009ae"], + ["718662be026e1dcf672869ac658fd0c87d6835cfbb34bd854c44e577d5708a7faecda96e260300000004526a636a489493073353b678549adc7640281b9cbcb225037f84007c57e55b874366bb7b0fa03bdc00000000095165ababac65ac00008ab7f2a802eaa53d000000000007acac516aac526ae92f380100000000056aac00536500000000", "ab00", 1, 43296088, "2d642ceee910abff0af2116af75b2e117ffb7469b2f19ad8fef08f558416d8f7"], + ["94083c840288d40a6983faca876d452f7c52a07de9268ad892e70a81e150d602a773c175ad03000000007ec3637d7e1103e2e7e0c61896cbbf8d7e205b2ecc93dd0d6d7527d39cdbf6d335789f660300000000ffffffff019e1f7b03000000000800ac0051acac0053539cb363", "", 1, -183614058, "a17b66d6bb427f42653d08207a22b02353dd19ccf2c7de6a9a3a2bdb7c49c9e7"], + ["30e0d4d20493d0cd0e640b757c9c47a823120e012b3b64c9c1890f9a087ae4f2001ca22a61010000000152f8f05468303b8fcfaad1fb60534a08fe90daa79bff51675472528ebe1438b6f60e7f60c10100000009526aab6551ac510053ffffffffaaab73957ea2133e32329795221ed44548a0d3a54d1cf9c96827e7cffd1706df0200000009ab00526a005265526affffffffd19a6fe54352015bf170119742821696f64083b5f14fb5c7d1b5a721a3d7786801000000085265abababac53abffffffff020f39bd030000000004ab6aac52049f6c050000000004ab52516aba5b4c60", "6a6365516a6a655253", 0, -624256405, "8e221a6c4bf81ca0d8a0464562674dcd14a76a32a4b7baf99450dd9195d411e6"], + ["f9c69d940276ec00f65f9fe08120fc89385d7350388508fd80f4a6ba2b5d4597a9e21c884f010000000663ab63ababab15473ae6d82c744c07fc876ecd53bd0f3018b2dbedad77d757d5bdf3811b23d294e8c0170000000001abafababe00157ede2050000000006ac6a5263635300000000", "ab53", 1, 606547088, "714d8b14699835b26b2f94c58b6ea4c53da3f7adf0c62ea9966b1e1758272c47"], + ["5c0ac112032d6885b7a9071d3c5f493aa16c610a4a57228b2491258c38de8302014276e8be030000000300ab6a17468315215262ad5c7393bb5e0c5a6429fd1911f78f6f72dafbbbb78f3149a5073e24740300000003ac5100ffffffff33c7a14a062bdea1be3c9c8e973f54ade53fe4a69dcb5ab019df5f3345050be00100000008ac63655163526aab428defc0033ec36203000000000765516365536a00ae55b2000000000002ab53f4c0080400000000095265516a536563536a00000000", "6a005151006a", 2, 272749594, "91082410630337a5d89ff19145097090f25d4a20bdd657b4b953927b2f62c73b"], + ["e3683329026720010b08d4bec0faa244f159ae10aa582252dd0f3f80046a4e145207d54d31000000000852acac52656aacac3aaf2a5017438ad6adfa3f9d05f53ebed9ceb1b10d809d507bcf75e0604254a8259fc29c020000000653526552ab51f926e52c04b44918030000000000f7679c0100000000090000525152005365539e3f48050000000009516500ab635363ab008396c905000000000253650591024f", "6a6365", 0, 908746924, "458aec3b5089a585b6bad9f99fd37a2b443dc5a2eefac2b7e8c5b06705efc9db"], + ["48c4afb204204209e1df6805f0697edaa42c0450bbbd767941fe125b9bc40614d63d757e2203000000066a5363005152dc8b6a605a6d1088e631af3c94b8164e36e61445e2c60130292d81dabd30d15f54b355a802000000036a6353ffffffff1d05dcec4f3dedcfd02c042ce5d230587ee92cb22b52b1e59863f3717df2362f0300000005536552ac52ffffffffd4d71c4f0a7d53ba47bb0289ca79b1e33d4c569c1e951dd611fc9c9c1ca8bc6c030000000865536a65ab51abacffffffff042f9aa905000000000753655153656351ab93d8010000000002655337440e0300000000005d4c690000000000015278587acb", "ab006565526a51", 0, 1502064227, "bbed77ff0f808aa8abd946ba9e7ec1ddb003a969fa223dee0af779643cb841a9"], + ["00b20fd104dd59705b84d67441019fa26c4c3dec5fd3b50eca1aa549e750ef9ddb774dcabe000000000651ac656aac65ffffffff52d4246f2db568fc9eea143e4d260c698a319f0d0670f84c9c83341204fde48b0200000000ffffffffb8aeabb85d3bcbc67b132f1fd815b451ea12dcf7fc169c1bc2e2cf433eb6777a03000000086a51ac6aab6563acd510d209f413da2cf036a31b0def1e4dcd8115abf2e511afbcccb5ddf41d9702f28c52900100000006ac52ab6a0065ffffffff039c8276000000000008ab53655200656a52401561010000000003acab0082b7160100000000035100ab00000000", "535265", 1, -947367579, "3212c6d6dd8d9d3b2ac959dec11f4638ccde9be6ed5d36955769294e23343da0"], + ["455131860220abbaa72015519090a666faf137a0febce7edd49da1eada41feab1505a0028b02000000036365ab453ead4225724eb69beb590f2ec56a7693a608871e0ab0c34f5e96157f90e0a96148f3c502000000085251ab51535163acffffffff022d1249040000000009abac00acac6565630088b310040000000000e3920e59", "5152ab6a52ac5152", 0, 294375737, "c40fd7dfa72321ac79516502500478d09a35cc22cc264d652c7d18b14400b739"], + ["624d28cb02c8747915e9af2b13c79b417eb34d2fa2a73547897770ace08c6dd9de528848d3030000000651ab63abab533c69d3f9b75b6ef8ed2df50c2210fd0bf4e889c42477d58682f711cbaece1a626194bb85030000000765acab53ac5353ffffffff018cc280040000000009abacabac52636352ac6859409e", "ac51ac", 1, 1005144875, "919144aada50db8675b7f9a6849c9d263b86450570293a03c245bd1e3095e292"], + ["8f28471d02f7d41b2e70e9b4c804f2d90d23fb24d53426fa746bcdcfffea864925bdeabe3e0200000001acffffffff76d1d35d04db0e64d65810c808fe40168f8d1f2143902a1cc551034fd193be0e0000000001acffffffff048a5565000000000005005151516afafb610400000000045263ac53648bb30500000000086363516a6a5165513245de01000000000000000000", "6a0053510053", 1, -1525137460, "305fc8ff5dc04ebd9b6448b03c9a3d945a11567206c8d5214666b30ec6d0d6cc"], + ["10ec50d7046b8b40e4222a3c6449490ebe41513aad2eca7848284a08f3069f3352c2a9954f0000000009526aac656352acac53ffffffff0d979f236155aa972472d43ee6f8ce22a2d052c740f10b59211454ff22cb7fd00200000007acacacab63ab53ffffffffbbf97ebde8969b35725b2e240092a986a2cbfd58de48c4475fe077bdd493a20c010000000663ab5365ababffffffff4600722d33b8dba300d3ad037bcfc6038b1db8abfe8008a15a1de2da2264007302000000035351ac6dbdafaf020d0ccf04000000000663ab6a51ab6ae06e5e0200000000036aabab00000000", "", 0, -1658960232, "2420dd722e229eccafae8508e7b8d75c6920bfdb3b5bac7cb8e23419480637c2"], + ["fef98b7101bf99277b08a6eff17d08f3fcb862e20e13138a77d66fba55d54f26304143e5360100000006515365abab00ffffffff04265965030000000004655252ace2c775010000000001002b23b4040000000007516a5153ab53ac456a7a00000000000753ab525251acacba521291", "526aacacab00abab53", 0, -1614097109, "4370d05c07e231d6515c7e454a4e401000b99329d22ed7def323976fa1d2eeb5"], + ["34a2b8830253661b373b519546552a2c3bff7414ea0060df183b1052683d78d8f54e842442000000000152ffffffffd961a8e34cf374151058dfcddc86509b33832bc57267c63489f69ff01199697c0300000002abacba856cfb01b17c2f050000000008515365ac53ab000000000000", "5263ab656a", 1, -2104480987, "2f9993e0a84a6ca560d6d1cc2b63ffe7fd71236d9cfe7d809491cef62bbfad84"], + ["43559290038f32fda86580dd8a4bc4422db88dd22a626b8bd4f10f1c9dd325c8dc49bf479f01000000026351ffffffff401339530e1ed3ffe996578a17c3ec9d6fccb0723dd63e7b3f39e2c44b976b7b0300000006ab6a65656a51ffffffff6fb9ba041c96b886482009f56c09c22e7b0d33091f2ac5418d05708951816ce7000000000551ac525100ffffffff020921e40500000000035365533986f40500000000016a00000000", "52ac51", 0, 1769771809, "02040283ef2291d8e1f79bb71bdabe7c1546c40d7ed615c375643000a8b9600d"], + ["6878a6bd02e7e1c8082d5e3ee1b746cfebfac9e8b97e61caa9e0759d8a8ecb3743e36a30de0100000002ab532a911b0f12b73e0071f5d50b6bdaf783f4b9a6ce90ec0cad9eecca27d5abae188241ddec0200000001651c7758d803f7457b0500000000036551515f4e90000000000001007022080200000000035365acc86b6946", "6351ab", 0, -1929374995, "f24be499c58295f3a07f5f1c6e5084496ae160450bd61fdb2934e615289448f1"], + ["35b6fc06047ebad04783a5167ab5fc9878a00c4eb5e7d70ef297c33d5abd5137a2dea9912402000000036aacacffffffff21dc291763419a584bdb3ed4f6f8c60b218aaa5b99784e4ba8acfec04993e50c03000000046a00ac6affffffff69e04d77e4b662a82db71a68dd72ef0af48ca5bebdcb40f5edf0caf591bb41020200000000b5db78a16d93f5f24d7d932f93a29bb4b784febd0cbb1943f90216dc80bba15a0567684b000000000853ab52ab5100006a1be2208a02f6bdc103000000000265ab8550ea04000000000365636a00000000", "", 0, -1114114836, "1c8655969b241e717b841526f87e6bd68b2329905ba3fc9e9f72526c0b3ea20c"], + ["bebb90c302bf91fd4501d33555a5fc5f2e1be281d9b7743680979b65c3c919108cc2f517510100000003abab00ffffffff969c30053f1276550532d0aa33cfe80ca63758cd215b740448a9c08a84826f3303000000056565ab5153ffffffff04bf6f2a04000000000565ab5265ab903e760100000000026a6a7103fa020000000006526553525365b05b2c000000000006ab000000535300000000", "51510053ab63635153", 1, 1081291172, "94338cd47a4639be30a71e21a7103cee4c99ef7297e0edd56aaf57a068b004de"], + ["af48319f031b4eeb4319714a285f44244f283cbff30dcb9275b06f2348ccd0d7f015b54f8500000000066363ac65ac6affffffff2560a9817ebbc738ad01d0c9b9cf657b8f9179b1a7f073eb0b67517409d108180200000005ac6365ab52ffffffff0bdd67cd4ecae96249a2e2a96db1490ee645f042fd9d5579de945e22b799f4d003000000086552ab515153ab00cf187c8202e51abf0300000000066552006a00abadf37d000000000004ac6a535100000000", "63ab65", 1, -1855554446, "60caf46a7625f303c04706cec515a44b68ec319ee92273acb566cca4f66861c1"], + ["f35befbc03faf8c25cc4bc0b92f6239f477e663b44b83065c9cb7cf231243032cf367ce3130000000005ab65526a517c4c334149a9c9edc39e29276a4b3ffbbab337de7908ea6f88af331228bd90086a6900ba020000000151279d19950d2fe81979b72ce3a33c6d82ebb92f9a2e164b6471ac857f3bbd3c0ea213b542010000000953ab51635363520065052657c20300a9ba04000000000452636a6a0516ea020000000008535253656365ababcfdd3f01000000000865ac516aac00530000000000", "", 2, -99793521, "c834a5485e68dc13edb6c79948784712122440d7fa5bbaa5cd2fc3d4dac8185d"], + ["d3da18520216601acf885414538ce2fb4d910997eeb91582cac42eb6982c9381589587794f0300000000fffffffff1b1c9880356852e10cf41c02e928748dd8fae2e988be4e1c4cb32d0bfaea6f7000000000465ab6aabffffffff02fb0d69050000000002ababeda8580500000000085163526565ac52522b913c95", "ac", 1, -1247973017, "99b32b5679d91e0f9cdd6737afeb07459806e5acd7630c6a3b9ab5d550d0c003"], + ["8218eb740229c695c252e3630fc6257c42624f974bc856b7af8208df643a6c520ef681bfd00000000002510066f30f270a09b2b420e274c14d07430008e7886ec621ba45665057120afce58befca96010300000004525153ab84c380a9015d96100000000000076a5300acac526500000000", "ac005263", 0, -1855679695, "5071f8acf96aea41c7518bd1b5b6bbe16258b529df0c03f9e374b83c66b742c6"], + ["1123e7010240310013c74e5def60d8e14dd67aedff5a57d07a24abc84d933483431b8cf8ea0300000003530051fc6775ff1a23c627a2e605dd2560e84e27f4208300071e90f4589e762ad9c9fe8d0da95e020000000465655200ffffffff04251598030000000004ab65ab639d28d90400000000096563636aacac525153474df801000000000851525165ac51006a75e23b040000000000e5bd3a4a", "6363636565", 0, -467124448, "9cb0dd04e9fe287b112e94a1647590d27e8b164ca13c4fe70c610fd13f82c2fd"], + ["fd92fe1003083c5179f97e77bf7d71975788138147adbdb283306802e261c0aee080fa22630200000000860c643ba9a1816b9badf36077b4554d11720e284e395a1121bc45279e148b2064c65e49020000000651ab6a53636a2c713088d20f4bc4001264d972cce05b9fe004dc33376ad24d0d013e417b91a5f1b6734e000000000100ffffffff02e3064c0500000000066552006a5165b86e8705000000000665ab65ab53522052eadb", "00ab53525265", 0, 776203277, "47207b48777727532f62e09afcd4104ea6687e723c7657c30504fa2081331cc8"], + ["d1b6a703038f14d41fcc5cc45455faa135a5322be4bf0f5cbcd526578fc270a236cacb853f0200000001abffffffff135aeff902fa38f202ccf5bd34437ff89c9dc57a028b62447a0a38579383e8ef0000000000ffffffffadf398d2c818d0b90bc474f540c3618a4a643482eeab73d36101987e2ec0335900000000004bd3323504e69fc10000000000055151535251790ada02000000000563ab6aab521337a704000000000963ac63abacac52656a1e9862010000000007656500ac51ab6a8f4ee672", "ab5251656565ac63", 2, 82008394, "b8f3d255549909c07588ecba10a02e55a2d6f2206d831af9da1a7dae64cfbc8b"], + ["81dadaa7011556683db3fe95262f4fdb20391b7e75b7ffcee51b176af64d83c06f85545d620200000005ab5151ab52ffffffff044805ef0300000000065353516352639702c802000000000900516351515252ab5270db08040000000009ac516aab526553abac4aabc90500000000096365ab0052636a525100000000", "6565ab6a5152", 0, -2126294159, "ad01ec9d6dbae325ec3a8e1fd98e2d03b1188378210efef093dd8b0b0ef3f19d"], + ["3b937e05032b8895d2f4945cb7e3679be2fbd15311e2414f4184706dbfc0558cf7de7b4d000000000001638b91a12668a3c3ce349788c961c26aa893c862f1e630f18d80e7843686b6e1e6fc396310000000000852635353ab65ac51eeb09dd1c9605391258ee6f74b9ae17b5e8c2ef010dc721c5433dcdc6e93a1593e3b6d1700000000085365ac6553526351ffffffff0308b18e04000000000253acb6dd00040000000008536aac5153ac516ab0a88201000000000500ac006500804e3ff2", "", 0, 416167343, "595a3c02254564634e8085283ec4ea7c23808da97ce9c5da7aecd7b553e7fd7f"], + ["a48f27ca047997470da74c8ee086ddad82f36d9c22e790bd6f8603ee6e27ad4d3174ea875403000000095153ac636aab6aacabffffffffefc936294e468d2c9a99e09909ba599978a8c0891ad47dc00ba424761627cef202000000056a51630053ffffffff304cae7ed2d3dbb4f2fbd679da442aed06221ffda9aee460a28ceec5a9399f4e0200000000f5bddf82c9c25fc29c5729274c1ff0b43934303e5f595ce86316fc66ad263b96ca46ab8d0100000003536500d7cf226b0146b00c04000000000200ac5c2014ce", "515100636563", 0, 1991799059, "9c051a7092fe17fa62b1720bc2c4cb2ffc1527d9fb0b006d2e142bb8fe07bf3c"], + ["180cd53101c5074cf0b7f089d139e837fe49932791f73fa2342bd823c6df6a2f72fe6dba1303000000076a6a63ac53acabffffffff03853bc1020000000007ac526a6a6a6a003c4a8903000000000453515163a0fbbd030000000005ab656a5253253d64cf", "ac65", 0, -1548453970, "4d8efb3b99b9064d2f6be33b194a903ffabb9d0e7baa97a48fcec038072aac06"], + ["c21ec8b60376c47e057f2c71caa90269888d0ffd5c46a471649144a920d0b409e56f190b700000000008acac6a526a536365ffffffff5d315d9da8bf643a9ba11299450b1f87272e6030fdb0c8adc04e6c1bfc87de9a0000000000ea43a9a142e5830c96b0ce827663af36b23b0277244658f8f606e95384574b91750b8e940000000007516a63ac0063acffffffff023c61be0400000000055165ab5263313cc8020000000006006a53526551ed8c3d56", "6a", 1, 1160627414, "a638cc17fd91f4b1e77877e8d82448c84b2a4e100df1373f779de7ad32695112"], + ["128cd90f04b66a4cbc78bf48748f6eec0f08d5193ee8d0a6f2e8d3e5f138ed12c2c87d01a301000000085200ab6aac00ab00ffffffff09fc88bb1851e3dfb3d30179c38e15aeb1b39929c7c74f6acd071994ed4806490300000000e7fc5ea12ec56f56c0d758ecf4bb88aa95f3b08176b336db3b9bec2f6e27336dce28adbe030000000400530051fffffffffd6ff1adcf1fbe0d883451ee46904f1b7e8820243d395559b2d4ee8190a6e891000000000080fb1ae702f85b400000000000035200ab8d9651010000000006ab6a52536aab00000000", "ab", 1, 1667598199, "c10ccc9db8a92d7d4b133a2980782dab9d9d1d633d0dde9f9612ada57771fd89"], + ["da9695a403493d3511c10e1fe1286f954db0366b7667c91ef18ae4578056c1bf752114ac5901000000035351519788d91dd1f9c62dc005d80ea54eb13f7131ca5aace3d5d29f9b58ccc5fbc9a27e779950010000000453ac6a00ffffffffe2556ff29ebe83eb42a32c7a8d93bc598043578f491b5935805a33608538845a030000000252ab65d21b3b018f26c4030000000006acab51535352e1cbcb10", "006565ab52", 2, -1550927794, "0ca673a1ee66f9625ceb9ab278ebef772c113c188112b02824570c17fdf48194"], + ["b240517501334021240427adb0b413433641555424f6d24647211e3e6bfbb22a8045cbda2f000000000071bac8630112717802000000000000000000", "6a5165abac52656551", 0, 1790414254, "2c8be597620d95abd88f9c1cf4967c1ae3ca2309f3afec8928058c9598660e9e"], + ["96bac43903044a199b4b3efeeec5d196ee23fb05495541fa2cd6fb6405a9432d1723363660010000000151ffffffffe6ce2b66ce1488918a3e880bebb0e750123f007c7bcbac8fcd67ce75cb6fbae80300000000ffffffff9c0955aa07f506455834895c0c56be5a095398f47c62a3d431fe125b161d666a0200000005520000abac7ffdbc540216f2f004000000000165a26dce010000000001ab00000000", "5151ab656a656a6a63", 0, -707123065, "26b22e18d5d9081fde9631594a4f7c49069ed2e429f3d08caf9d834f685ccab2"], + ["b8fd394001ed255f49ad491fecc990b7f38688e9c837ccbc7714ddbbf5404f42524e68c18f0000000007ab6353535363ab081e15ee02706f7d050000000008515200535351526364c7ec040000000005636a53acac9206cbe1", "655352ac", 0, -1251578838, "8e0697d8cd8a9ccea837fd798cc6c5ed29f6fbd1892ee9bcb6c944772778af19"], + ["e42a76740264677829e30ed610864160c7f97232c16528fe5610fc08814b21c34eefcea69d010000000653006a6a0052ffffffff647046cf44f217d040e6a8ff3f295312ab4dd5a0df231c66968ad1c6d8f4428000000000025352ffffffff0199a7f900000000000000000000", "655263006a005163", 1, 1122505713, "7cda43f1ff9191c646c56a4e29b1a8c6cb3f7b331da6883ef2f0480a515d0861"], + ["0f034f32027a8e094119443aa9cfe11737c6d7dda9a52b839bc073dcc0235b847b28e0fab60200000006ac53ac536a63eee63447dfdad80476994b68706e916df1bd9d7cb4f3a4f6b14369de84564bea2e8688bd030000000565636a65acf8434663020b35fe01000000000800abab655163acabb3d6a103000000000353acab345eeda0", "526a51ac63ab51", 1, 66020215, "4435e62ff6531ac73529aac9cf878a7219e0b6e6cac79af8487c5355d1ad6d43"], + ["a2dfa4690214c1ab25331815a5128f143219de51a47abdc7ce2d367e683eeb93960a31af9f010000000363636affffffff8be0628abb1861b078fcc19c236bc4cc726fa49068b88ad170adb2a97862e7460200000004ac655363ffffffff0441f11103000000000153dbab0c000000000009ab53ac5365526aab63abbb95050000000004ab52516a29a029040000000003ac526a00000000", "6a52ac63", 1, -1302210567, "913060c7454e6c80f5ba3835454b54db2188e37dc4ce72a16b37d11a430b3d23"], + ["9dbc591f04521670af83fb3bb591c5d4da99206f5d38e020289f7db95414390dddbbeb56680100000004ac5100acffffffffb6a40b5e29d5e459f8e72d39f800089529f0889006cad3d734011991da8ef09d0100000009526a5100acab536a515fc427436df97cc51dc8497642ffc868857ee245314d28b356bd70adba671bd6071301fc0000000000ffffffff487efde2f620566a9b017b2e6e6d42525e4070f73a602f85c6dfd58304518db30000000005516353006a8d8090180244904a0200000000046a65656ab1e9c203000000000451ab63aba06a5449", "", 0, -1414953913, "bae189eb3d64aedbc28a6c28f6c0ccbd58472caaf0cf45a5aabae3e031dd1fea"], + ["1345fb2c04bb21a35ae33a3f9f295bece34650308a9d8984a989dfe4c977790b0c21ff9a7f0000000006ac52ac6a0053ffffffff7baee9e8717d81d375a43b691e91579be53875350dfe23ba0058ea950029fcb7020000000753ab53ab63ab52ffffffff684b6b3828dfb4c8a92043b49b8cb15dd3a7c98b978da1d314dce5b9570dadd202000000086353ab6a5200ac63d1a8647bf667ceb2eae7ec75569ca249fbfd5d1b582acfbd7e1fcf5886121fca699c011d0100000003ac006affffffff049b1eb00300000000001e46dc0100000000080065ab6a6a630065ca95b40300000000030051520c8499010000000006ab6aac526a6500000000", "53526aac636300", 2, 1809978100, "cfeaa36790bc398783d4ca45e6354e1ea52ee74e005df7f9ebd10a680e9607bf"], + ["7d75dc8f011e5f9f7313ba6aedef8dbe10d0a471aca88bbfc0c4a448ce424a2c5580cda1560300000003ab5152ffffffff01997f8e0200000000096552ac6a65656563530d93bbcc", "00656a6563", 0, 1414485913, "ec91eda1149f75bffb97612569a78855498c5d5386d473752a2c81454f297fa7"], + ["1459179504b69f01c066e8ade5e124c748ae5652566b34ed673eea38568c483a5a4c4836ca0100000008ac5352006563656affffffff5d4e037880ab1975ce95ea378d2874dcd49d5e01e1cdbfae3343a01f383fa35800000000095251ac52ac6aac6500ffffffff7de3ae7d97373b7f2aeb4c55137b5e947b2d5fb325e892530cb589bc4f92abd503000000086563ac53ab520052ffffffffb4db36a32d6e543ef49f4bafde46053cb85b2a6c4f0e19fa0860d9083901a1190300000003ab51531bbcfe5504a6dbda040000000008536a5365abac6500d660c80300000000096565abab6a53536a6a54e84e010000000003acac52df2ccf0500000000025351220c857e", "", 2, 1879181631, "3aad18a209fab8db44954eb55fd3cc7689b5ec9c77373a4d5f4dae8f7ae58d14"], + ["d98b777f04b1b3f4de16b07a05c31d79965579d0edda05600c118908d7cf642c9cd670093f020000000953005351ac65ab5363a268caad6733b7d1718008997f249e1375eb3ab9fe68ab0fe170d8e745ea24f54ce67f9b00000000066500516a5151ffffffff7ef8040dfcc86a0651f5907e8bfd1017c940f51cf8d57e3d3fe78d57e40b1e610200000003535263ffffffff39846cfed4babc098ff465256ba3820c30d710581316afcb67cd31c623b703360300000001acffffffff03d405120100000000056300006a5201a73d050000000004ab636a6a294c8c000000000006ac65536553ac00000000", "63525351abac", 1, 2018694761, "86970af23c89b72a4f9d6281e46b9ef5220816bed71ebf1ae20df53f38fe16ff"], + ["cabb1b06045a895e6dcfc0c1e971e94130c46feace286759f69a16d298c8b0f6fd0afef8f20300000004ac006352ffffffffa299f5edac903072bfb7d29b663c1dd1345c2a33546a508ba5cf17aab911234602000000056a65515365ffffffff89a20dc2ee0524b361231092a070ace03343b162e7162479c96b757739c8394a0300000002abab92ec524daf73fabee63f95c1b79fa8b84e92d0e8bac57295e1d0adc55dc7af5534ebea410200000001534d70e79b04674f6f00000000000600abacab53517d60cc0200000000035265ab96c51d040000000004ac6300ac62a787050000000008006a516563ab63639e2e7ff7", "6551ac6351ac", 3, 1942663262, "d0c4a780e4e0bc22e2f231e23f01c9d536b09f6e5be51c123d218e906ec518be"], + ["8b96d7a30132f6005b5bd33ea82aa325e2bcb441f46f63b5fca159ac7094499f380f6b7e2e00000000076aacabac6300acffffffff0158056700000000000465005100c319e6d0", "52006a", 0, -1100733473, "fb4bd26a91b5cf225dd3f170eb09bad0eac314bc1e74503cc2a3f376833f183e"], + ["112191b7013cfbe18a175eaf09af7a43cbac2c396f3695bbe050e1e5f4250603056d60910e02000000001c8a5bba03738a22010000000005525352656a77a149010000000002510003b52302000000000351ac52722be8e6", "65ac6565", 0, -1847972737, "8e795aeef18f510d117dfa2b9f4a2bd2e2847a343205276cedd2ba14548fd63f"], + ["ce6e1a9e04b4c746318424705ea69517e5e0343357d131ad55d071562d0b6ebfedafd6cb840100000003656553ffffffff67bd2fa78e2f52d9f8900c58b84c27ef9d7679f67a0a6f78645ce61b883fb8de000000000100d699a56b9861d99be2838e8504884af4d30b909b1911639dd0c5ad47c557a0773155d4d303000000046a5151abffffffff9fdb84b77c326921a8266854f7bbd5a71305b54385e747fe41af8a397e78b7fa010000000863acac6a51ab00ac0d2e9b9d049b8173010000000007ac53526a650063ba9b7e010000000008526a00525263acac0ab3fd030000000000ea8a0303000000000200aca61a97b9", "", 1, -1276952681, "b6ed4a3721be3c3c7305a5128c9d418efa58e419580cec0d83f133a93e3a22c5"], + ["a7721d94021652d90c79aaf5022d98219337d50f836382403ed313adb1116ba507ac28b0b0010000000551ac6300ab89e6d64a7aa81fb9595368f04d1b36d7020e7adf5807535c80d015f994cce29554fe869b01000000065353ab636500ffffffff024944c90100000000046300635369df9f01000000000000000000", "656a536551ab", 0, -1740151687, "935892c6f02948f3b08bcd463b6acb769b02c1912be4450126768b055e8f183a"], + ["2f7353dd02e395b0a4d16da0f7472db618857cd3de5b9e2789232952a9b154d249102245fd030000000151617fd88f103280b85b0a198198e438e7cab1a4c92ba58409709997cc7a65a619eb9eec3c0200000003636aabffffffff0397481c0200000000045300636a0dc97803000000000009d389030000000003ac6a53134007bb", "0000536552526a", 0, -1912746174, "30c4cd4bd6b291f7e9489cc4b4440a083f93a7664ea1f93e77a9597dab8ded9c"], + ["7d95473604fd5267d0e1bb8c9b8be06d7e83ff18ad597e7a568a0aa033fa5b4e1e2b6f1007020000000465006a6affffffffaee008503bfc5708bd557c7e78d2eab4878216a9f19daa87555f175490c40aaf000000000263abffffffffabd74f0cff6e7ceb9acc2ee25e65af1abcebb50c08306e6c78fa8171c37613dd010000000552acacababffffffff54a3069393f7930fa1b331cdff0cb945ec21c11d4605d8eedba1d3e094c6ae1f01000000026300ffffffff0182edeb050000000009526353ab5153530065a247e8cd", "51516aab00", 2, -426210430, "2707ca714af09494bb4cf0794abe33c6cba5f29891d619e76070269d1fa8e690"], + ["221d4718023d9ca9fe1af178dbfce02b2b369bf823ea3f43f00891b7fef98e215c06b94fdd000000000951005153ab000051acffffffffb1c7ad1c64b7441bf5e70cd0f6eb4ec96821d67fc4997d9e6dfdceadecd36dde01000000070051536a635153ffffffff04e883cd00000000000851ab536553ab0052bbb2f70400000000002f1b2e03000000000165259fcb00000000000010dbde99", "ab", 1, 665721280, "4abce77432a86dfe608e7c1646c18b5253a373392ff962e288e3ab96bba1ba1d"], + ["6f66c0b3013e6ae6aabae9382a4326df31c981eac169b6bc4f746edaa7fc1f8c796ef4e374000000000665ab6aabac6affffffff0191c8d6030000000002525300000000", "6a5352516a635352ab", 0, -1299629906, "48411efeb133c6b7fec4e7bdbe613f827093cb06ea0dbcc2ffcfde3a9ac4356c"], + ["89e7928c04363cb520eff4465251fd8e41550cbd0d2cdf18c456a0be3d634382abcfd4a2130200000006ac516a6a656355042a796061ed72db52ae47d1607b1ceef6ca6aea3b7eea48e7e02429f382b378c4e51901000000085351ab6352ab5252ffffffff53631cbda79b40183000d6ede011c778f70147dc6fa1aed3395d4ce9f7a8e69701000000096a6553ab52516a52abad0de418d80afe059aab5da73237e0beb60af4ac490c3394c12d66665d1bac13bdf29aa8000000000153f2b59ab6027a33eb040000000007005351ac5100ac88b941030000000003ab0052e1e8a143", "63656a", 0, 1258533326, "b575a04b0bb56e38bbf26e1a396a76b99fb09db01527651673a073a75f0a7a34"], + ["ca356e2004bea08ec2dd2df203dc275765dc3f6073f55c46513a588a7abcc4cbde2ff011c7020000000553525100003aefec4860ef5d6c1c6be93e13bd2d2a40c6fb7361694136a7620b020ecbaca9413bcd2a030000000965ac00536352535100ace4289e00e97caaea741f2b89c1143060011a1f93090dc230bee3f05e34fbd8d8b6c399010000000365526affffffff48fc444238bda7a757cb6a98cb89fb44338829d3e24e46a60a36d4e24ba05d9002000000026a53ffffffff03d70b440200000000056a6a526aac853c97010000000002515335552202000000000351635300000000", "0052", 3, -528192467, "fc93cc056c70d5e033933d730965f36ad81ef64f1762e57f0bc5506c5b507e24"], + ["82d4fa65017958d53e562fac073df233ab154bd0cf6e5a18f57f4badea8200b217975e31030200000004636aab51ac0891a204227cc9050000000006635200655365bfef8802000000000865650051635252acfc2d09050000000006ab65ac51516380195e030000000007ac52525352510063d50572", "53", 0, -713567171, "e095003ca82af89738c1863f0f5488ec56a96fb81ea7df334f9344fcb1d0cf40"], + ["75f6949503e0e47dd70426ef32002d6cdb564a45abedc1575425a18a8828bf385fa8e808e600000000036aabab82f9fd14e9647d7a1b5284e6c55169c8bd228a7ea335987cef0195841e83da45ec28aa2e0300000002516350dc6fe239d150efdb1b51aa288fe85f9b9f741c72956c11d9dcd176889963d699abd63f0000000001ab429a63f502777d20010000000007abac52ac516a53d081d9020000000003acac630c3cc3a8", "535152516551510000", 1, 973814968, "c6ec1b7cb5c16a1bfd8a3790db227d2acc836300534564252b57bd66acf95092"], + ["24f24cd90132b2162f938f1c22d3ca5e7daa83515883f31a61a5177aebf99d7db6bdfc398c010000000163ffffffff01d5562d0100000000016300000000", "5265ac5165ac5252ab", 0, 1055129103, "5eeb03e03806cd7bfd44bbba69c30f84c2c5120df9e68cd8facc605fcfbc9693"], + ["5ff2cac201423064a4d87a96b88f1669b33adddc6fa9acdc840c0d8a243671e0e6de49a5b00300000005ac6353655353b91db50180db5a03000000000663535151006a047a3aff", "52ab51ab5365005163", 0, -1336626596, "b8db8d57fe40ab3a99cf2f8ed57da7a65050fcc1d34d4280e25faf10108d3110"], + ["10011f150220ad76a50ccc7bb1a015eda0ff987e64cd447f84b0afb8dc3060bdae5b36a6900200000000ffffffff1e92dd814dfafa830187bc8e5b9258de2445ec07b02c420ee5181d0b203bb334000000000565ab536a65ffffffff0124e65401000000000800ab636553ab53ac00000000", "53abab0051", 0, 440222748, "c6675bf229737e005b5c8ffa6f81d9e2c4396840921b6151316f67c4315a4270"], + ["8b95ec900456648d820a9b8df1d8f816db647df8a8dc9f6e7151ebf6079d90ee3f6861352a02000000085200ab00ac535151ffffffff039b10b845f961225ac0bcaac4f5fe1991029a051aa3d06a3811b5762977a67403000000035252abffffffff8559d65f40d5e261f45aec8aad3d2c56c6114b22b26f7ee54a06f0881be3a7f5010000000765635252536363ffffffff38f8b003b50f6412feb2322b06b270197f81ad69c36af02ca5008b94eee5f650020000000165ffffffff01ae2b00010000000001638eb153a2", "0053ab5300ac53", 2, 1266056769, "205f3653f0142b35ce3ef39625442efebae98cde8cbf0516b97b51073bb0479f"], + ["babbb7ea01ab5d584727cb44393b17cf66521606dc81e25d85273be0d57bad43e8f6b6d43501000000036a656aba83a68803fb0f4a000000000005536353ab633fcfe4020000000009ac00acab6351006a65182a0c03000000000453ac5363bee74f44", "536a6a6a6365ac51ab", 0, -799187625, "3275e98dca37243b977525a07b5d8e369d6c3bdc08cb948029a635547d0d1a4e"], + ["e86a24bc03e4fae784cdf81b24d120348cb5e52d937cd9055402fdba7e43281e482e77a1c100000000046363006affffffffa5447e9bdcdab22bd20d88b19795d4c8fb263fbbf7ce8f4f9a85f865953a6325020000000663ac53535253ffffffff9f8b693bc84e0101fc73748e0513a8cecdc264270d8a4ee1a1b6717607ee1eaa00000000026a513417bf980158d82c020000000009005253005351acac5200000000", "6353516365536a6a", 2, -563792735, "508129278ef07b43112ac32faf00170ad38a500eed97615a860fd58baaad174b"], + ["53bd749603798ed78798ef0f1861b498fc61dcee2ee0f2b37cddb115b118e73bc6a5a47a0201000000096a63656a6aab6a000007ff674a0d74f8b4be9d2e8e654840e99d533263adbdd0cf083fa1d5dd38e44d2d163d900100000007abab5251ac6a51c8b6b63f744a9b9273ccfdd47ceb05d3be6400c1ed0f7283d32b34a7f4f0889cccf06be30000000009516a52636551ab516a9ac1fe63030c677e05000000000027bc610000000000086565636a635100526e2dc60200000000015300000000", "6552536a515351ab", 1, -1617066878, "fe516df92299e995b8e6489be824c6839543071ec5e9286060b2600935bf1f20"], + ["691bf9fc028ca3099020b79184e70039cf53b3c7b3fe695d661fd62d7b433e65feda2150610000000003ac63abffffffff2c814c15b142bc944192bddccb90a392cd05b968b599c1d8cd99a55a28a243fd0100000009ab5300526a5200abac98516a5803dfd3540500000000046552ac522838120100000000040053ab6a4409a903000000000665636a5300658759621b", "65ac5165ab", 0, -359941441, "d582c442e0ecc400c7ba33a56c93ad9c8cfd45af820350a13623594b793486f0"], + ["536bc5e60232eb60954587667d6bcdd19a49048d67a027383cc0c2a29a48b960dc38c5a0370300000005ac636300abffffffff8f1cfc102f39b1c9348a2195d496e602c77d9f57e0769dabde7eaaedf9c69e250100000006acabab6a6351ffffffff0432f56f0400000000046a5365517fd54b0400000000035265539484e4050000000003536a5376dc25020000000008ac536aab6aab536ab978e686", "ac0051006a006a006a", 0, -273074082, "f151f1ec305f698d9fdce18ea292b145a58d931f1518cf2a4c83484d9a429638"], + ["74606eba01c2f98b86c29ba5a32dc7a7807c2abe6ed8d89435b3da875d87c12ae05329e6070200000003510052ffffffff02a1e2c4020000000006516563526a63c68bae04000000000952ab6363ab00006363fe19ae4f", "63ababacac5365", 0, 112323400, "d1b1d79001b4a0324962607b739972d6f39c1493c4500ce814fd3bd72d32a5a0"], + ["2ed805e20399e52b5bcc9dc075dad5cf19049ff5d7f3de1a77aee9288e59c5f4986751483f020000000165ffffffff967531a5726e7a653a9db75bd3d5208fa3e2c5e6cd5970c4d3aba84eb644c72c0300000000ffffffffd79030d20c65e5f8d3c55b5692e5bdaa2ae78cfa1935a0282efb97515feac43f030000000400006365261ab88c02bdf66a000000000003ab6351d6ad8b000000000005525152abac00000000", "630053ab5265", 0, 2072814938, "1d25d16d84d5793be1ad5cda2de9c9cf70e04a66c3dae618f1a7ca4026198e7f"], + ["fab796ee03f737f07669160d1f1c8bf0800041157e3ac7961fea33a293f976d79ce49c02ab0200000003ac5252eb097ea1a6d1a7ae9dace338505ba559e579a1ee98a2e9ad96f30696d6337adcda5a85f403000000096500abab656a6a656396d5d41a9b11f571d91e4242ddc0cf2420eca796ad4882ef1251e84e42b930398ec69dd80100000005526551ac6a8e5d0de804f763bb0400000000015288271a010000000001acf2bf2905000000000300ab51c9641500000000000952655363636365ac5100000000", "00ac536552", 0, -1854521113, "f3bbab70b759fe6cfae1bf349ce10716dbc64f6e9b32916904be4386eb461f1f"], + ["f2b539a401e4e8402869d5e1502dbc3156dbce93583f516a4947b333260d5af1a34810c6a00200000003525363ffffffff01d305e2000000000005acab535200a265fe77", "", 0, -1435650456, "41617b27321a830c712638dbb156dae23d4ef181c7a06728ccbf3153ec53d7dd"], + ["9f10b1d8033aee81ac04d84ceee0c03416a784d1017a2af8f8a34d2f56b767aea28ff88c8f02000000025352ffffffff748cb29843bea8e9c44ed5ff258df1faf55fbb9146870b8d76454786c4549de100000000016a5ba089417305424d05112c0ca445bc7107339083e7da15e430050d578f034ec0c589223b0200000007abac53ac6565abffffffff025a4ecd010000000006636563ab65ab40d2700000000000056a6553526333fa296c", "", 0, -395044364, "20fd0eee5b5716d6cbc0ddf852614b686e7a1534693570809f6719b6fcb0a626"], + ["ab81755f02b325cbd2377acd416374806aa51482f9cc5c3b72991e64f459a25d0ddb52e66703000000036a00ab8727056d48c00cc6e6222be6608c721bc2b1e69d0ffbadd51d131f05ec54bcd83003aac5000000000003f2cdb60454630e020000000007526aac63000000e9e25c040000000003516a0088c97e0000000000076a535265655263771b5805000000000851ab00ac6565515100000000", "5151ab00ac", 0, -230931127, "ba0a2c987fcdd74b6915f6462f62c3f126a0750aa70048f7aa20f70726e6a20b"], + ["7a17e0ef0378dab4c601240639139335da3b7d684600fa682f59b7346ef39386fe9abd69350000000004ac5252ab807f26fb3249326813e18260a603b9ad66f41f05eaa8146f66bcca452162a502aac4aa8b02000000026a534ea460faa7e3d7854ec6c70d7e797025697b547ec500b2c09c873b4d5517767d3f3720660300000000ffffffff01b12e7a02000000000900ab006aab65656a63991c03e2", "6aab6a", 1, -1577994103, "62cd3413d9d819fb7355336365cf8a2a997f7436cc050a7143972044343b3281"], + ["ff2ecc09041b4cf5abb7b760e910b775268abee2792c7f21cc5301dd3fecc1b4233ee70a2c0200000009acac5300006a51526affffffffeb39c195a5426afff38379fc85369771e4933587218ef4968f3f05c51d6b7c92000000000165453a5f039b8dbef7c1ffdc70ac383b481f72f99f52b0b3a5903c825c45cfa5d2c0642cd50200000001654b5038e6c49daea8c0a9ac8611cfe904fc206dad03a41fb4e5b1d6d85b1ecad73ecd4c0102000000096a51000053ab656565bdb5548302cc719200000000000452655265214a3603000000000300ab6a00000000", "52516a006a63", 1, -2113289251, "37ed6fae36fcb3360c69cac8b359daa62230fc1419b2cf992a32d8f3e079dcff"], + ["70a8577804e553e462a859375957db68cfdf724d68caeacf08995e80d7fa93db7ebc04519d02000000045352ab53619f4f2a428109c5fcf9fee634a2ab92f4a09dc01a5015e8ecb3fc0d9279c4a77fb27e900000000006ab6a51006a6affffffff3ed1a0a0d03f25c5e8d279bb5d931b7eb7e99c8203306a6c310db113419a69ad010000000565516300abffffffff6bf668d4ff5005ef73a1b0c51f32e8235e67ab31fe019bf131e1382050b39a630000000004536a6563ffffffff02faf0bb00000000000163cf2b4b05000000000752ac635363acac15ab369f", "ac", 0, -1175809030, "1c9d6816c20865849078f9777544b5ddf37c8620fe7bd1618e4b72fb72dddca1"], + ["a3604e5304caa5a6ba3c257c20b45dcd468f2c732a8ca59016e77b6476ac741ce8b16ca8360200000004acac6553ffffffff695e7006495517e0b79bd4770f955040610e74d35f01e41c9932ab8ccfa3b55d0300000007ac5253515365acffffffff6153120efc5d73cd959d72566fc829a4eb00b3ef1a5bd3559677fb5aae116e38000000000400abab52c29e7abd06ff98372a3a06227386609adc7665a602e511cadcb06377cc6ac0b8f63d4fdb03000000055100acabacffffffff04209073050000000009ab5163ac525253ab6514462e05000000000952abacab636300656a20672c0400000000025153b276990000000000056565ab6a5300000000", "5351", 0, 1460890590, "249c4513a49076c6618aabf736dfd5ae2172be4311844a62cf313950b4ba94be"], + ["c6a72ed403313b7d027f6864e705ec6b5fa52eb99169f8ea7cd884f5cdb830a150cebade870100000009ac63ab516565ab6a51ffffffff398d5838735ff43c390ca418593dbe43f3445ba69394a6d665b5dc3b4769b5d700000000075265acab515365ffffffff7ee5616a1ee105fd18189806a477300e2a9cf836bf8035464e8192a0d785eea3030000000700ac6a51516a52ffffffff018075fd0000000000015100000000", "005251acac5252", 2, -656067295, "2cc1c7514fdc512fd45ca7ba4f7be8a9fe6d3318328bc1a61ae6e7675047e654"], + ["93c12cc30270fc4370c960665b8f774e07942a627c83e58e860e38bd6b0aa2cb7a2c1e060901000000036300abffffffff4d9b618035f9175f564837f733a2b108c0f462f28818093372eec070d9f0a5440300000001acffffffff039c2137020000000001525500990100000000055265ab636a07980e0300000000005ba0e9d1", "656a5100", 1, 18954182, "6beca0e0388f824ca33bf3589087a3c8ad0857f9fe7b7609ae3704bef0eb83e2"], + ["97bddc63015f1767619d56598ad0eb5c7e9f880b24a928fea1e040e95429c930c1dc653bdb0100000008ac53acac00005152aaa94eb90235ed10040000000000287bdd0400000000016a8077673a", "acac6a536352655252", 0, -813649781, "5990b139451847343c9bb89cdba0e6daee6850b60e5b7ea505b04efba15f5d92"], + ["cc3c9dd303637839fb727270261d8e9ddb8a21b7f6cbdcf07015ba1e5cf01dc3c3a327745d0300000000d2d7804fe20a9fca9659a0e49f258800304580499e8753046276062f69dbbde85d17cd2201000000096352536a520000acabffffffffbc75dfa9b5f81f3552e4143e08f485dfb97ae6187330e6cd6752de6c21bdfd21030000000600ab53650063ffffffff0313d0140400000000096565515253526aacac167f0a040000000008acab00535263536a9a52f8030000000006abab5151ab63f75b66f2", "6a635353636a65ac65", 1, 377286607, "dbc7935d718328d23d73f8a6dc4f53a267b8d4d9816d0091f33823bd1f0233e9"], + ["236f91b702b8ffea3b890700b6f91af713480769dda5a085ae219c8737ebae90ff25915a3203000000056300ac6300811a6a10230f12c9faa28dae5be2ebe93f37c06a79e76214feba49bb017fb25305ff84eb020000000100ffffffff041e351703000000000351ac004ff53e050000000003ab53636c1460010000000000cb55f701000000000651520051ab0000000000", "acac636a6aac5300", 0, 406448919, "793a3d3c37f6494fab79ff10c16702de002f63e34be25dd8561f424b0ea938c4"], + ["22e10d2003ab4ea9849a2801921113583b7c35c3710ff49a6003489395789a7cfb1e6051900100000006526a65535151ffffffff82f21e249ec60db33831d33b9ead0d56f6496db64337dcb7f1c3327c47729c4a020000000253abffffffff138f098f0e6a4cf51dc3e7a3b749f487d1ebde71b73b731d1d02ad1180ac7b8c02000000036563acda215011027a9484020000000007635165530000ac4bf6cb0400000000066aacabab65ab3ce3f32c", "ab0052ab", 2, 1136359457, "b5bd080bbcb8cd652f440484311d7a3cb6a973cd48f03c5c00fd6beb52dfc061"], + ["c47d5ad60485cb2f7a825587b95ea665a593769191382852f3514a486d7a7a11d220b62c54000000000663655253acab8c3cf32b0285b040e50dcf6987ddf7c385b3665048ad2f9317b9e0c5ba0405d8fde4129b00000000095251ab00ac65635300ffffffff549fe963ee410d6435bb2ed3042a7c294d0c7382a83edefba8582a2064af3265000000000152fffffffff7737a85e0e94c2d19cd1cde47328ece04b3e33cd60f24a8a345da7f2a96a6d0000000000865ab6a0051656aab28ff30d5049613ea020000000005ac51000063f06df1050000000008ac63516aabac5153afef5901000000000700656500655253688bc00000000000086aab5352526a53521ff1d5ff", "51ac52", 2, -1296011911, "0c1fd44476ff28bf603ad4f306e8b6c7f0135a441dc3194a6f227cb54598642a"], + ["0b43f122032f182366541e7ee18562eb5f39bc7a8e5e0d3c398f7e306e551cdef773941918030000000863006351ac51acabffffffffae586660c8ff43355b685dfa8676a370799865fbc4b641c5a962f0849a13d8250100000005abab63acabffffffff0b2b6b800d8e77807cf130de6286b237717957658443674df047a2ab18e413860100000008ab6aac655200ab63ffffffff04f1dbca03000000000800635253ab656a52a6eefd0300000000036365655d8ca90200000000005a0d530400000000015300000000", "65ac65acac", 0, 351448685, "86f26e23822afd1bdfc9fff92840fc1e60089f12f54439e3ab9e5167d0361dcf"], + ["4b0ecc0c03ba35700d2a30a71f28e432ff6ac7e357533b49f4e97cf28f1071119ad6b97f3e0300000008acab516363ac63acffffffffcd6a2019d99b5c2d639ddca0b1aa5ea7c1326a071255ea226960bd88f45ca57d00000000085253655363005353ffffffffba257635191c9f216de3277be548cb5a2313114cb1a4c563b03b4ef6c0f4f7040300000001abda542edf0495cdc40100000000026353c049e903000000000752516a53ab65512b0f9304000000000963ab516aac65516552fa9ece050000000009acab6500005152530000000000", "65ab51525352510052", 1, -1355414590, "3cd85f84aae6d702436f3f9b8980adcc1f8f202e957759540a27da0a32fc6c87"], + ["adaac0a803f66811346271c733036d6e0d45e15a9b602092e2e04ad93564f196e7f020b088000000000600526a636a00700ec3f9db07a3a6ce910bf318c7ec87a876e1f2a3366cc69f20cde09203b99c1cb9d15800000000050000ac636a4d0de554ebe95c6cc14faf5ff6361d1deba9474b8b0fd3b93c011cd96aec783abb3f36830200000005ab65005251ffffffff0464eb10050000000007520000ab6a65ab1beaa80300000000005a2f31050000000006526aab65ac52ba7db10000000000045251ab6a0cfb46e7", "ab0051ac52636a", 1, -184733716, "961ff413850336d3987c550404fc1d923266ca36cc9ffee7113edb3a9fea7f30"], + ["af1c4ab301ec462f76ee69ba419b1b2557b7ded639f3442a3522d4f9170b2d6859765c3df402000000016affffffff01a5ca6c000000000008ab52536aab00005300000000", "6a6351", 0, 110304602, "e88ed2eea9143f2517b15c03db00767eb01a5ce12193b99b964a35700607e5f4"], + ["0bfd34210451c92cdfa02125a62ba365448e11ff1db3fb8bc84f1c7e5615da40233a8cd368010000000252ac9a070cd88dec5cf9aed1eab10d19529720e12c52d3a21b92c6fdb589d056908e43ea910e0200000009ac516a52656a6a5165ffffffffc3edcca8d2f61f34a5296c405c5f6bc58276416c720c956ff277f1fb81541ddd00000000030063abffffffff811247905cdfc973d179c03014c01e37d44e78f087233444dfdce1d1389d97c302000000065163000063ab1724a26e02ca37c902000000000851ab53525352ac529012a90100000000085200525253535353fa32575b", "5352ac6351", 1, -1087700448, "b8f1e1f35e3e1368bd17008c756e59cced216b3c699bcd7bebdb5b6c8eec4697"], + ["2c84c0640487a4a695751d3e4be48019dbaea85a6e854f796881697383ea455347d2b2769001000000055265526500ffffffff6aac176d8aa00778d496a7231eeb7d3334f20c512d3db1683276402100d98de5030000000700536a5263526ac1ee9ceb171c0c984ebaf12c234fd1487fbf3b3d73aa0756907f26837efba78d1bed33200300000001ab4d9e8ec0bed837cb929bbed76ee848959cec59de44bd7667b7631a744f880d5c71a20cfd0100000007005363515300abffffffff023753fb0000000000036565532d3873050000000009005152ab6a63acab5200000000", "ab650053ab", 0, -877941183, "c49af297dffe2d80deddf10ceea84b99f8554bd2d55bbdc34e449728c31f0835"], + ["1f7e4b1b045d3efa6cd7a11d7873a8bab886c19bd11fcb6712f0948f2db3a7be76ff76c8f100000000095265ab6a0065ac5363ffffffffdaafcfa6029336c997680a541725190f09a6f6da21e54560eca4b5b8ae987da1000000000952ac52acac52515165ffffffff825a38d3b1e5bb4d10f33653ab3ab6882c7abdaec74460257d1528ce7be3f98e0100000007526a006a656a63c14adc8f04953a5d3d3f89237f38b857dd357713896d36215f7e8b77b11d98ea3cdc93df02000000015212484f6104bfafae0300000000025263a2b0120000000000056563ab00516c4d2605000000000653ac6500655301cc93030000000002acab14643b1f", "63acac53ab", 0, 333824258, "18da6ceb011cd36f15ad7dd6c55ef07e6f6ed48881ce3bb31416d3c290d9a0e9"], + ["467a3e7602e6d1a7a531106791845ec3908a29b833598e41f610ef83d02a7da3a1900bf2960000000005ab6a636353ffffffff031db6dac6f0bafafe723b9199420217ad2c94221b6880654f2b35114f44b1df010000000965ab52636a63ac6352ffffffff02b3b95c0100000000026300703216030000000001ab3261c0aa", "6a", 0, 2110869267, "3078b1d1a7713c6d101c64afe35adfae0977a5ab4c7e07a0b170b041258adbf2"], + ["8713bc4f01b411149d575ebae575f5dd7e456198d61d238695df459dd9b86c4e3b2734b62e0300000004abac6363ffffffff03b58049050000000002ac653c714c04000000000953656a005151526a527b5a9e03000000000652ac5100525300000000", "52", 0, -647281251, "0e0bed1bf2ff255aef6e5c587f879ae0be6222ab33bd75ee365ec6fbb8acbe38"], + ["f2ba8a8701b9c401efe3dd0695d655e20532b90ac0142768cee4a3bb0a89646758f544aa8102000000036a52527899f4e4040c6f0b030000000008636565ab530051ab52b60c000000000009515200ab630053ac53a49c5f040000000008ab53ab516300ab63fa27340300000000015100000000", "ac63abab5251", 0, -1328936437, "ab61497afd39e61fe06bc5677326919716f9b20083c9f3417dcea905090e0411"], + ["b5a7df6102107beded33ae7f1dec0531d4829dff7477260925aa2cba54119b7a07d92d5a1d02000000046a516a52803b625c334c1d2107a326538a3db92c6c6ae3f7c3516cd90a09b619ec6f58d10e77bd6703000000056563006a63ffffffff0117484b03000000000853acab52526a65abc1b548a1", "ac006a525100", 0, 2074359913, "680336db57347d8183b8898cd27a83f1ba5884155aeae5ce20b4840b75e12871"], + ["278cb16204b9dadf400266106392c4aa9df01ba03af988c8139dae4c1818ac009f13fc5f1a00000000065200ac656a52ffffffffd006bbebd8cbd7bdead24cddc9badfcc6bc0c2e63c037e5c29aa858f5d0f3e7d01000000046a0051acffffffffbc62a5f57e58da0b67956003ae81ac97cb4cbd1d694c914fc41515c008c4d8fd020000000165e329c844bcc16164be64b64a81cbf4ffd41ed2934e0daa0040ccb8365bab0b2a9e401c180300000003ab52abffffffff02588460030000000000a25a12030000000005535100005300000000", "6553ab6a5300acab51", 3, 989407546, "1c29f110576f4a3b257f67454d99dfc0dee62ef5517ca702848ce4bd2ea1a1d7"], + ["49eb2178020a04fca08612c34959fd41447319c190fb7ffed9f71c235aa77bec28703aa1820200000003ac6353abaff326071f07ec6b77fb651af06e8e8bd171068ec96b52ed584de1d71437fed186aecf0300000001acffffffff03da3dbe02000000000652ac63ac6aab8f3b680400000000096a536a65636a53516a5175470100000000016500000000", "6a536365", 0, 1283691249, "c670219a93234929f662ecb9aa148a85a2d281e83f4e53d10509461cdea47979"], + ["0f96cea9019b4b3233c0485d5b1bad770c246fe8d4a58fb24c3b7dfdb3b0fd90ea4e8e947f0300000006006a5163515303571e1e01906956030000000005ab635353abadc0fbbe", "acac", 0, -1491469027, "716a8180e417228f769dcb49e0491e3fda63badf3d5ea0ceeac7970d483dd7e2"], + ["9a7d858604577171f5fe3f3fd3e5e039c4b0a06717a5381e9977d80e9f53e025e0f16d2877020000000752636565536353ffffffff5862bd028e8276e63f044be1dddcbb8d0c3fa097678308abf2b0f45104a93dbd0100000001531200667ba8fdd3b28e98a35da73d3ddfe51e210303d8eb580f923de988ee632d77793892030000000752526363526563ffffffffe9744eb44db2658f120847c77f47786d268c302120d269e6004455aa3ea5f5e20200000009ab6300636aab656551ffffffff03c61a3c020000000009ab516a6aab6aab53ab737f1a05000000000853acabab655365ab92a4a00400000000016367edf6c8", "535352ab", 3, 659348595, "d36ee79fc80db2e63e05cdc50357d186181b40ae20e3720878284228a13ee8b3"], + ["148e68480196eb52529af8e83e14127cbfdbd4a174e60a86ac2d86eac9665f46f4447cf7aa01000000045200ac538f8f871401cf240c0300000000065252ab52656a5266cf61", "", 0, -344314825, "eacc47c5a53734d6ae3aedbc6a7c0a75a1565310851b29ef0342dc4745ceb607"], + ["e2bc29d4013660631ba14ecf75c60ec5e9bed7237524d8c10f66d0675daa66d1492cb834530200000004ac510065e42d0c9e04f2b26c01000000000951525152acac65ababa35b7504000000000953ac6aac00650053ab94688c0400000000056365526553a1bced0300000000016a00000000", "65ab0063655353", 0, -888431789, "59a34b3ed3a1cce0b104de8f7d733f2d386ffc7445efae67680cd90bc915f7e0"], + ["0c8a70d70494dca6ab05b2bc941b5b431c43a292bd8f2f02eab5e240a408ca73a676044a4103000000056a51ab006affffffff84496004e54836c035821f14439149f22e1db834f315b24588ba2f031511926c0100000000ffffffffbbc5e70ed1c3060ba1bfe99c1656a3158a7307c3ce8eb362ec32c668596d2bd30000000009636563635351abab00b039344c6fc4f9bec24322e45407af271b2d3dfec5f259ee2fc7227bc5285e22b3be85b40100000009ac00ab53abac6a5352e5ddfcff02d50231020000000005006a51536ab086d9020000000006ababac51ac6a00000000", "abab636565acac6a", 3, 241546088, "643a7b4c8d832e14d5c10762e74ec84f2c3f7ed96c03053157f1bed226614911"], + ["f98f79cf0274b745e1d6f36da7cbe205a79132a7ad462bdc434cfb1dcd62a6977c3d2a5dbc010000000553516a5365ffffffff4f89f485b53cdad7fb80cc1b7e314b9735b9383bc92c1248bb0e5c6173a55c0d010000000353655293f9b014045ad96d02000000000963ac526a53ac636365f4c27904000000000952536563635152526a2788f0030000000002516aff5add01000000000863530051655351abd04716ba", "ab6552536a53", 1, -2128899945, "56d29f5e300ddfed2cd8dcce5d79826e193981d0b70dc7487772c8a0b3b8d7b1"], + ["6c7913f902aa3f5f939dd1615114ce961beda7c1e0dd195be36a2f0d9d047c28ac62738c3a020000000453abac00ffffffff477bf2c5b5c6733881447ac1ecaff3a6f80d7016eee3513f382ad7f554015b970100000007ab6563acab5152ffffffff04e58fe1040000000009ab00526aabab526553e59790010000000002ab525a834b03000000000035fdaf0200000000086551ac65515200ab00000000", "63ac53", 1, 1285478169, "1536da582a0b6de017862445e91ba14181bd6bf953f4de2f46b040d351a747c9"], + ["4624aa9204584f06a8a325c84e3b108cafb97a387af62dc9eab9afd85ae5e2c71e593a3b690200000003636a005eb2b44eabbaeca6257c442fea00107c80e32e8715a1293cc164a42e62ce14fea146220c020000000090b9ee38106e3310037bfc519fd209bdbd21c588522a0e96df5fba4e979392bc993bfe9f01000000086363636a635353ab6f1907d218ef6f3c729d9200e23c1dbff2df58b8b1282c6717b26cf760ee4c880d23f4d100000000086a516a536a525163ffffffff01d6f162050000000000ebbab208", "525365ab0053", 1, -1515409325, "6cf9cd409b7185b1f118171f0a34217af5b612ea54195ea186505b667c19337f"], + ["16562fc503f1cf9113987040c408bfd4523f1512da699a2ca6ba122dc65677a4c9bf7763830000000003636552ffffffff1ec1fab5ff099d1c8e6b068156f4e39b5543286bab53c6d61e2582d1e07c96cf02000000045163656affffffffd0ef40003524d54c08cb4d13a5ee61c84fbb28cde9eca7a6d11ba3a9335d8c620100000007635153536a6300fbb84fc2012003a601000000000363ab6a00000000", "63636a006a6aab", 0, -1310262675, "1efbf3d37a92bc03d9eb950b792f307e95504f7c4998f668aa250707ebb752ac"], + ["531665d701f86bacbdb881c317ef60d9cd1baeffb2475e57d3b282cd9225e2a3bf9cbe0ded01000000086300ac515263acabffffffff0453a8500100000000086353acab516a6565e5e9200500000000026a52a44caa00000000000453ac000065e41b0500000000076500ac0065526ab4476f4d", "006563006aab00636a", 0, 1770013777, "0898b26dd3ca08632a5131fa48eb55b44386d0c5070c24d6e329673d5e3693b8"], + ["0f1227a20140655a3da36e413b9b5d108a866f6f147eb4940f032f5a89854eae6d7c3a91600100000009525363515153515253e37a79480161ab61020000000001ab00000000", "ab65005200", 0, -1996383599, "979782dc3f36d908d37d7e4046a38d306b4b08ddc60a5eba355fe3d6da1b29a9"], + ["063ff6eb01aff98d0d2a6db224475010edb634c2f3b46257084676adeb84165a4ff8558d7601000000066353006a5165deb3262c042d109c0000000000076363ab52ac005200b9c4050000000007516300ac510063cfffc800000000000200639e815501000000000700526a52ac6365ac7b07b8", "656552abac6500", 0, -1559847112, "674a4bcb04247f8dc98780f1792cac86b8aee41a800fc1e6f5032f6e1dccde65"], + ["3320f6730132f830c4681d0cae542188e4177cad5d526fae84565c60ceb5c0118e844f90bd030000000163ffffffff0257ec5a040000000005525251ac6538344d000000000002515200000000", "5352656a53ac516a65", 0, 788050308, "3afacaca0ef6be9d39e71d7b1b118994f99e4ea5973c9107ca687d28d8eba485"], + ["c13aa4b702eedd7cde09d0416e649a890d40e675aa9b5b6d6912686e20e9b9e10dbd40abb1000000000863ab6353515351ac11d24dc4cc22ded7cdbc13edd3f87bd4b226eda3e4408853a57bcd1becf2df2a1671fd1600000000045165516affffffff01baea300100000000076aab52ab53005300000000", "0065", 0, -1195908377, "241a23e7b1982d5f78917ed97a8678087acbbffe7f624b81df78a5fe5e41e754"], + ["d9a6f20e019dd1b5fae897fb472843903f9c3c2293a0ffb59cff2b413bae6eceab574aaf9d030000000663ab006a515102f54939032df5100100000000056a51ab65530ec28f010000000004ac5100007e874905000000000651005265ac6a00000000", "abacab63acacabab", 0, 271463254, "1326a46f4c21e7619f30a992719a905aa1632aaf481a57e1cbd7d7c22139b41e"], + ["157c81bf0490432b3fcb3f9a5b79e5f91f67f05efb89fa1c8740a3fe7e9bdc18d7cb6acd2203000000026351ffffffff912e48e72bbcf8a540b693cf8b028e532a950e6e63a28801f6eaad1afcc52ad00000000000b1a4b170a2b9e60e0cad88a0085137309f6807d25d5afb5c1e1d32aa10ba1cdf7df596dd0000000009525165656a51ab65ab3674fba32a76fe09b273618d5f14124465933f4190ba4e0fd09d838daafc6223b31642ac00000000086a53536551ac6565ffffffff01fe9fb6030000000008ab51656a5165636a00000000", "ab00ab6a6551", 3, -64357617, "1ddaab7f973551d71f16bd70c4c4edbf7225e64e784a6da0ee7f7a9fe4f12a0b"], + ["a2692fff03b2387f5bacd5640c86ba7df574a0ee9ed7f66f22c73cccaef3907eae791cbd230200000004536363abffffffff4d9fe7e5b375de88ba48925d9b2005447a69ea2e00495a96eafb2f144ad475b40000000008000053000052636537259bee3cedd3dcc07c8f423739690c590dc195274a7d398fa196af37f3e9b4a1413f810000000006ac63acac52abffffffff04c65fe60200000000075151536365ab657236fc020000000009005263ab00656a6a5195b8b6030000000007ac5165636aac6a7d7b66010000000002acab00000000", "51", 2, -826546582, "925037c7dc7625f3f12dc83904755a37016560de8e1cdd153c88270a7201cf15"], + ["2c5b003201b88654ac2d02ff6762446cb5a4af77586f05e65ee5d54680cea13291efcf930d0100000005ab536a006a37423d2504100367000000000004536a515335149800000000000152166aeb03000000000452510063226c8e03000000000000000000", "635251", 0, 1060344799, "7e058ca5dd07640e4aae7dea731cfb7d7fef1bfd0d6d7b6ce109d041f4ca2a31"], + ["f981b9e104acb93b9a7e2375080f3ea0e7a94ce54cd8fb25c57992fa8042bdf4378572859f0100000002630008604febba7e4837da77084d5d1b81965e0ea0deb6d61278b6be8627b0d9a2ecd7aeb06a0300000005ac5353536a42af3ef15ce7a2cd60482fc0d191c4236e66b4b48c9018d7dbe4db820f5925aad0e8b52a0300000008ab0063510052516301863715efc8608bf69c0343f18fb81a8b0c720898a3563eca8fe630736c0440a179129d03000000086aac6a52ac6a63ac44fec4c00408320a03000000000062c21c030000000007ac6a655263006553835f0100000000015303cd60000000000005535263536558b596e0", "00", 0, -2140385880, "49870a961263354c9baf108c6979b28261f99b374e97605baa532d9fa3848797"], + ["e7416df901269b7af14a13d9d0507709b3cd751f586ce9d5da8d16a121e1bd481f5a086e1103000000056aab005200ffffffff01aa269c040000000006acac6a6a5263ee718de6", "ab525363", 0, 1309186551, "eea7d2212bda2d408fff146f9ae5e85e6b640a93b9362622bb9d5e6e36798389"], + ["402a815902193073625ab13d876190d1bbb72aecb0ea733c3330f2a4c2fe6146f322d8843a0300000008656aab0000535363fffffffff9dccdec5d8509d9297d26dfcb1e789cf02236c77dc4b90ebccbf94d1b5821150300000001510bf1f96a03c5c145000000000002ac6ae11b1c0100000000055163516a5239c8a600000000000365636300000000", "63536aacab", 0, -1811424955, "0090803a20102a778ab967a74532faee13e03b702083b090b1497bc2267ee2fe"], + ["c4b702e502f1a54f235224f0e6de961d2e53b506ab45b9a40805d1dacd35148f0acf24ca5e00000000085200ac65ac53acabf34ba6099135658460de9d9b433b84a8562032723635baf21ca1db561dce1c13a06f4407000000000851ac006a63516aabffffffff02a853a603000000000163d17a67030000000005ab63006a5200000000", "ac5363515153", 1, 480734903, "5c46f7ac3d6460af0da28468fcc5b3c87f2b9093d0f837954b7c8174b4d7b6e7"], + ["9b83f78704f492b9b353a3faad8d93f688e885030c274856e4037818848b99e490afef27770200000000ffffffff36b60675a5888c0ef4d9e11744ecd90d9fe9e6d8abb4cff5666c898fdce98d9e00000000056aab656352596370fca7a7c139752971e169a1af3e67d7656fc4fc7fd3b98408e607c2f2c836c9f27c030000000653ac51ab6300a0761de7e158947f401b3595b7dc0fe7b75fa9c833d13f1af57b9206e4012de0c41b8124030000000953656a53ab53510052242e5f5601bf83b301000000000465516a6300000000", "63515200ac656365", 3, -150879312, "9cf05990421ea853782e4a2c67118e03434629e7d52ab3f1d55c37cf7d72cdc4"], + ["f492a9da04f80b679708c01224f68203d5ea2668b1f442ebba16b1aa4301d2fe5b4e2568f3010000000953005351525263ab65ffffffff93b34c3f37d4a66df255b514419105b56d7d60c24bf395415eda3d3d8aa5cd0101000000020065ffffffff9dba34dabdc4f1643b372b6b77fdf2b482b33ed425914bb4b1a61e4fad33cf390000000002ab52ffffffffbbf3dc82f397ef3ee902c5146c8a80d9a1344fa6e38b7abce0f157be7adaefae0000000009515351005365006a51ffffffff021359ba010000000000403fea0200000000095200ac6353abac635300000000", "00ac51acacac", 0, -2115078404, "fd44fc98639ca32c927929196fc3f3594578f4c4bd248156a25c04a65bf3a9f3"], + ["2f73e0b304f154d3a00fde2fdd40e791295e28d6cb76af9c0fd8547acf3771a02e3a92ba37030000000852ac6351ab6565639aa95467b065cec61b6e7dc4d6192b5536a7c569315fb43f470078b31ed22a55dab8265f02000000080065636a6aab6a53ffffffff9e3addbff52b2aaf9fe49c67017395198a9b71f0aa668c5cb354d06c295a691a0100000000ffffffff45c2b4019abaf05c5e484df982a4a07459204d1343a6ee5badade358141f8f990300000007ac516a6aacac6308655cd601f3bc2f0000000000015200000000", "", 0, -2082053939, "9a95e692e1f78efd3e46bb98f178a1e3a0ef60bd0301d9f064c0e5703dc879c2"], + ["5a60b9b503553f3c099f775db56af3456330f1e44e67355c4ab290d22764b9144a7b5f959003000000030052acbd63e0564decc8659aa53868be48c1bfcda0a8c9857b0db32a217bc8b46d9e7323fe9649020000000553ac6551abd0ecf806211db989bead96c09c7f3ec5f73c1411d3329d47d12f9e46678f09bac0dc383e0200000000ffffffff01494bb202000000000500516551ac00000000", "ac", 0, 1169947809, "62a36c6e8da037202fa8aeae03e533665376d5a4e0a854fc4624a75ec52e4eb1"], + ["7e98d353045569c52347ca0ff2fdba608829e744f61eb779ffdb5830aae0e6d6857ab2690e03000000075365acab656352ffffffffa890dd37818776d12da8dca53d02d243ef23b4535c67016f4c58103eed85360f030000000093dbacdc25ca65d2951e047d6102c4a7da5e37f3d5e3c8b87c29b489360725dcd117ee2003000000056a6300ac53c7e99fa1dc2b8b51733034e6555f6d6de47dbbf1026effac7db80cb2080678687380dc1e02000000075352005263516affffffff04423272040000000008ab6353ab65510051e0f53b0500000000086300516552635152f74a5f04000000000853acab0053ab52ab0e8e5f00000000000951ac5363516a6aabab00000000", "6a5163ab52", 3, 890006103, "476868cecd1763c91dade98f17defa42d31049547df45acffa1cc5ae5c3d75d6"], + ["e3649aa40405e6ffe377dbb1bbbb672a40d8424c430fa6512c6165273a2b9b6afa9949ec430200000007630052ab655153a365f62f2792fa90c784efe3f0981134d72aac0b1e1578097132c7f0406671457c332b84020000000353ab6ad780f40cf51be22bb4ff755434779c7f1def4999e4f289d2bd23d142f36b66fbe5cfbb4b01000000076a5252abac52ab1430ffdc67127c9c0fc97dcd4b578dab64f4fb9550d2b59d599773962077a563e8b6732c02000000016affffffff04cb2687000000000002ab636e320904000000000252acf70e9401000000000100dc3393050000000006ab0063536aacbc231765", "65520053", 3, -2016196547, "f64f805f0ff7f237359fa6b0e58085f3c766d1859003332223444fd29144112a"], + ["1d033569040700441686672832b531ab55db89b50dc1f9fc00fb72218b652da9dcfbc83be901000000066551ac526a632b390f9ad068e5fdee6563e88e2a8e4e09763c861072713dc069893dc6bbc9db3f00e26502000000096a5363526565525252ffffffff8a36bdd0aaf38f6707592d203e14476ca9f259021e487135c7e8324244057ed90300000000ed3fb2a3dfd4d46b5f3603fe0148653911988457bd0ed7f742b07c452f5476c228ff9f600200000007526aac00525152ffffffff04b88e48030000000000c753d602000000000853510000006553518fda2603000000000853ac52acac5263534839f1030000000006ac006aacac5300000000", "516553635300ab0052", 1, 2075958316, "c2cefaec2293134acbcf6d2a8bf2b3eb42e4ec04ee8f8bf30ff23e65680677c1"], + ["4c4be7540344050e3044f0f1d628039a334a7c1f7b4573469cfea46101d6888bb6161fe9710200000000ffffffffac85a4fdad641d8e28523f78cf5b0f4dc74e6c5d903c10b358dd13a5a1fd8a06000000000163e0ae75d05616b72467b691dc207fe2e65ea35e2eadb7e06ea442b2adb9715f212c0924f10200000000ffffffff0194ddfe02000000000265ac00000000", "00006500", 1, -479922562, "d66924d49f03a6960d3ca479f3415d638c45889ce9ab05e25b65ac260b51d634"], + ["202c18eb012bc0a987e69e205aea63f0f0c089f96dd8f0e9fcde199f2f37892b1d4e6da90302000000055352ac6565ffffffff0257e5450100000000025300ad257203000000000000000000", "520052ac6a005265", 0, 168054797, "502967a6f999f7ee25610a443caf8653dda288e6d644a77537bcc115a8a29894"], + ["32fa0b0804e6ea101e137665a041cc2350b794e59bf42d9b09088b01cde806ec1bbea077df0200000008515153650000006506a11c55904258fa418e57b88b12724b81153260d3f4c9f080439789a391ab147aabb0fa0000000007000052ac51ab510986f2a15c0d5e05d20dc876dd2dafa435276d53da7b47c393f20900e55f163b97ce0b800000000008ab526a520065636a8087df7d4d9c985fb42308fb09dce704650719140aa6050e8955fa5d2ea46b464a333f870000000009636300636a6565006affffffff01994a0d040000000002536500000000", "516563530065", 2, -163068286, "f58637277d2bc42e18358dc55f7e87e7043f5e33f4ce1fc974e715ef0d3d1c2a"], + ["ae23424d040cd884ebfb9a815d8f17176980ab8015285e03fdde899449f4ae71e04275e9a80100000007ab006553530053ffffffff018e06db6af519dadc5280c07791c0fd33251500955e43fe4ac747a4df5c54df020000000251ac330e977c0fec6149a1768e0d312fdb53ed9953a3737d7b5d06aad4d86e9970346a4feeb5030000000951ab51ac6563ab526a67cabc431ee3d8111224d5ecdbb7d717aa8fe82ce4a63842c9bd1aa848f111910e5ae1eb0100000004ac515300bfb7e0d7048acddc030000000009636a5253636a655363a3428e040000000001525b99c6050000000004655265ab717e6e020000000000d99011eb", "ac6a6a516565", 1, -716251549, "b098eb9aff1bbd375c70a0cbb9497882ab51f3abfebbf4e1f8d74c0739dc7717"], + ["030f44fc01b4a9267335a95677bd190c1c12655e64df74addc53b753641259af1a54146baa020000000152e004b56c04ba11780300000000026a53f125f001000000000251acd2cc7c03000000000763536563655363c9b9e50500000000015200000000", "ac", 0, -1351818298, "19dd32190ed2a37be22f0224a9b55b91e37290577c6c346d36d32774db0219a3"], + ["c05f448f02817740b30652c5681a3b128322f9dc97d166bd4402d39c37c0b14506d8adb5890300000003536353ffffffffa188b430357055ba291c648f951cd2f9b28a2e76353bef391b71a889ba68d5fc02000000056565526a6affffffff02745f73010000000001ab3ec34c0400000000036aac5200000000", "516551510053", 0, -267877178, "3a1c6742d4c374f061b1ebe330b1e169a113a19792a1fdde979b53e094cc4a3c"], + ["163ba45703dd8c2c5a1c1f8b806afdc710a2a8fc40c0138e2d83e329e0e02a9b6c837ff6b8000000000700655151ab6a522b48b8f134eb1a7e6f5a6fa319ce9d11b36327ba427b7d65ead3b4a6a69f85cda8bbcd22030000000563656552acffffffffdbcf4955232bd11eef0cc6954f3f6279675b2956b9bcc24f08c360894027a60201000000066500006500abffffffff04d0ce9d0200000000008380650000000000015233f360040000000003006aabedcf0801000000000000000000", "000065006500ac", 0, 216965323, "9afe3f4978df6a86e9a8ebd62ef6a9d48a2203f02629349f1864ef2b8b92fd55"], + ["07f7f5530453a12ad0c7eb8fbc3f140c7ab6818144d67d2d8752600ca5d9a9358e2dff87d4000000000663526aab526a9e599c379d455e2da36d0cde88d931a863a3e97e01e93b9edb65856f3d958dc08b92b720000000000165bbc8d66dae3b1b170a6e2457f5b161465cb8706e0e6ffc6af55deb918365f14c5f40d4890100000000a7bd77c069ee4b48638e2363fcf2a86b02bea022047bd9fcb16d2b94ad068308d19b31cb00000000066aab5300ab529672aa8f01dbd8a205000000000663536353006a02e99901", "ac006351006a63ab63", 1, 119789359, "6629a1e75c6ae8f4f9d5f734246b6a71682a5ea57246040ef0584f6b97916175"], + ["fe647f950311bf8f3a4d90afd7517df306e04a344d2b2a2fea368935faf11fa6882505890d0000000005ab5100516affffffff43c140947d9778718919c49c0535667fc6cc727f5876851cb8f7b6460710c7f60100000000ffffffffce4aa5d90d7ab93cbec2e9626a435afcf2a68dd693c15b0e1ece81a9fcbe025e0300000000ffffffff02f34806020000000002515262e54403000000000965635151ac655363636de5ce24", "6a005100ac516351", 2, 989643518, "818a7ceaf963f52b5c48a7f01681ac6653c26b63a9f491856f090d9d60f2ffe3"], + ["a1050f8604d0f9d2feefcdb5051ae0052f38e21bf39daf583fd0c3900faa3eab5d431c0bbe030000000653536a005151683d27e5c6e0da8f22125823f32d5d98477d8098ef36263b9694d61d4d85d3f2ac02b7570200000007000052005165abffffffff0cad981542bcb54a87d9400aa63e514c7c6fab7158c2b1fb37821ea755eb162a0200000000b94feb5100e5ef3bf8ed8d43356c8a8d5ac6c7e80d7ff6040f4f0aa19abbe783f4f461240200000007636500000052655686fd70042be3ad02000000000465ab636a15680b000000000004acac53511277c705000000000452635252d27a0102000000000000000000", "6a6aacab65655251", 1, -982144648, "dfcf484111801989eb6df8dc2bafb944d7365ffeb36a575a08f3270d3ef24c9f"], + ["cef7316804c3e77fe67fc6207a1ea6ae6eb06b3bf1b3a4010a45ae5c7ad677bb8a4ebd16d90200000009ac536a5152ac5263005301ab8a0da2b3e0654d31a30264f9356ba1851c820a403be2948d35cafc7f9fe67a06960300000006526a63636a53ffffffffbada0d85465199fa4232c6e4222df790470c5b7afd54704595a48eedd7a4916b030000000865ab63ac006a006ab28dba4ad55e58b5375053f78b8cdf4879f723ea4068aed3dd4138766cb4d80aab0aff3d0300000003ac6a00ffffffff010f5dd6010000000006ab006aab51ab00000000", "", 1, 889284257, "d0f32a6db43378af84b063a6706d614e2d647031cf066997c48c04de3b493a94"], + ["7b3ff28004ba3c7590ed6e36f45453ebb3f16636fe716acb2418bb2963df596a50ed954d2e03000000065251515265abffffffff706ee16e32e22179400c9841013971645dabf63a3a6d2d5feb42f83aa468983e030000000653ac51ac5152ffffffffa03a16e5e5de65dfa848b9a64ee8bf8656cc1f96b06a15d35bd5f3d32629876e020000000043c1a3965448b3b46f0f0689f1368f3b2981208a368ec5c30defb35595ef9cf95ffd10e902000000036aac65253a5bbe042e907204000000000800006565656352634203b4020000000002656336b3b7010000000001ab7a063f0100000000026500a233cb76", "006551636a53ac5251", 1, -1144216171, "68c7bd717b399b1ee33a6562a916825a2fed3019cdf4920418bb72ffd7403c8c"], + ["d5c1b16f0248c60a3ddccf7ebd1b3f260360bbdf2230577d1c236891a1993725e262e1b6cb000000000363636affffffff0a32362cfe68d25b243a015fc9aa172ea9c6b087c9e231474bb01824fd6bd8bc0300000005ab52ab516affffffff0420d9a70200000000045152656a45765d0000000000055252536a5277bad100000000000252ab3f3f3803000000000463acac5200000000", "52636a52ab65", 1, 1305123906, "978dc178ecd03d403b048213d904653979d11c51730381c96c4208e3ea24243a"], + ["1be8ee5604a9937ebecffc832155d9ba7860d0ca451eaced58ca3688945a31d93420c27c460100000006abac5300535288b65458af2f17cbbf7c5fbcdcfb334ffd84c1510d5500dc7d25a43c36679b702e850f7c0200000003005300ffffffff7c237281cb859653eb5bb0a66dbb7aeb2ac11d99ba9ed0f12c766a8ae2a2157203000000086aabac526365acabfffffffff09d3d6639849f442a6a52ad10a5d0e4cb1f4a6b22a98a8f442f60280c9e5be80200000007ab00ab6565ab52ffffffff0398fe83030000000005526aababacbdd6ec010000000005535252ab6a82c1e6040000000001652b71c40c", "6563526353656351", 2, -853634888, "0d936cceda2f56c7bb87d90a7b508f6208577014ff280910a710580357df25f3"], + ["9e0f99c504fbca858c209c6d9371ddd78985be1ab52845db0720af9ae5e2664d352f5037d4010000000552ac53636affffffff0e0ce866bc3f5b0a49748f597c18fa47a2483b8a94cef1d7295d9a5d36d31ae7030000000663515263ac635bb5d1698325164cdd3f7f3f7831635a3588f26d47cc30bf0fefd56cd87dc4e84f162ab702000000036a6365ffffffff85c2b1a61de4bcbd1d5332d5f59f338dd5e8accbc466fd860f96eef1f54c28ec030000000165ffffffff04f5cabd010000000007000052ac526563c18f1502000000000465510051dc9157050000000008655363ac525253ac506bb600000000000865656a53ab63006a00000000", "006a6a0052", 0, 1186324483, "2f9b7348600336512686e7271c53015d1cb096ab1a5e0bce49acd35bceb42bc8"], + ["11ce51f90164b4b54b9278f0337d95c50d16f6828fcb641df9c7a041a2b274aa70b1250f2b0000000008ab6a6a65006551524c9fe7f604af44be050000000005525365006521f79a0300000000015306bb4e04000000000265ac99611a05000000000765acab656500006dc866d0", "", 0, -1710478768, "cfa4b7573559b3b199478880c8013fa713ca81ca8754a3fd68a6d7ee6147dc5a"], + ["86bc233e02ba3c647e356558e7252481a7769491fb46e883dd547a4ce9898fc9a1ca1b77790000000006ab5351abab51f0c1d09c37696d5c7c257788f5dff5583f4700687bcb7d4acfb48521dc953659e325fa390300000003acac5280f29523027225af03000000000963abac0065ab65acab7e59d90400000000016549dac846", "53006aac52acac", 0, 711159875, "880330ccde00991503ea598a6dfd81135c6cda9d317820352781417f89134d85"], + ["beac155d03a853bf18cd5c490bb2a245b3b2a501a3ce5967945b0bf388fec2ba9f04c03d68030000000012fe96283aec4d3aafed8f888b0f1534bd903f9cd1af86a7e64006a2fa0d2d30711af770010000000163ffffffffd963a19d19a292104b9021c535d3e302925543fb3b5ed39fb2124ee23a9db00302000000056500ac63acffffffff01ad67f503000000000300ac5189f78db2", "53536a636500", 2, 748992863, "bde3dd0575164d7ece3b5783ce0783ffddb7df98f178fe6468683230314f285a"], + ["81dab34a039c9e225ba8ef421ec8e0e9d46b5172e892058a9ade579fe0eb239f7d9c97d45b0300000009ac65655351ab526363ffffffff10c0faaf7f597fc8b00bbc67c3fd4c6b70ca6b22718d15946bf6b032e62dae570000000005536a00ab6a02cddec3acf985bbe62c96fccf17012a87026ed63fc6756fa39e286eb4c2dd79b59d37400300000002516affffffff04f18b8d03000000000753abab5152636564411c02000000000400ab6300e965750300000000001bd2cf02000000000565ab526aab00000000", "006551ab", 0, -1488174485, "a3d65a8cd0c1eea8558d01396b929520a2221c29d9f25f29035b8abae874447f"], + ["489ebbf10478e260ba88c0168bd7509a651b36aaee983e400c7063da39c93bf28100011f280100000004abab63ab2fc856f05f59b257a4445253e0d91b6dffe32302d520ac8e7f6f2467f7f6b4b65f2f59e903000000096353abacab6351656affffffff0122d9480db6c45a2c6fd68b7bc57246edffbf6330c39ccd36aa3aa45ec108fc030000000265ab9a7e78a69aadd6b030b12602dff0739bbc346b466c7c0129b34f50ae1f61e634e11e9f3d0000000006516a53525100ffffffff011271070000000000086563ab6353536352c4dd0e2c", "", 0, -293358504, "4eba3055bc2b58765593ec6e11775cea4b6493d8f785e28d01e2d5470ea71575"], + ["6911195d04f449e8eade3bc49fd09b6fb4b7b7ec86529918b8593a9f6c34c2f2d301ec378b000000000263ab49162266af054643505b572c24ff6f8e4c920e601b23b3c42095881857d00caf56b28acd030000000565525200ac3ac4d24cb59ee8cfec0950312dcdcc14d1b360ab343e834004a5628d629642422f3c5acc02000000035100accf99b663e3c74787aba1272129a34130668a877cc6516bfb7574af9fa6d07f9b4197303400000000085351ab5152635252ffffffff042b3c95000000000000ff92330200000000046a5252ab884a2402000000000853530065520063000d78be03000000000953abab52ab53ac65aba72cb34b", "6a", 2, -637739405, "6b80d74eb0e7ee59d14f06f30ba7d72a48d3a8ff2d68d3b99e770dec23e9284f"], + ["746347cf03faa548f4c0b9d2bd96504d2e780292730f690bf0475b188493fb67ca58dcca4f0000000002005336e3521bfb94c254058e852a32fc4cf50d99f9cc7215f7c632b251922104f638aa0b9d080100000008656aac5351635251ffffffff4da22a678bb5bb3ad1a29f97f6f7e5b5de11bb80bcf2f7bb96b67b9f1ac44d09030000000365ababffffffff036f02b30000000000076353ab6aac63ac50b72a050000000002acaba8abf804000000000663006a6a6353797eb999", "acac5100", 1, -1484493812, "164c32a263f357e385bd744619b91c3f9e3ce6c256d6a827d6defcbdff38fa75"], + ["e17149010239dd33f847bf1f57896db60e955117d8cf013e7553fae6baa9acd3d0f1412ad90200000006516500516500cb7b32a8a67d58dddfb6ceb5897e75ef1c1ff812d8cd73875856487826dec4a4e2d2422a0100000004ac525365196dbb69039229270400000000070000535351636a8b7596020000000006ab51ac52655131e99d040000000003516551ee437f5c", "ac656a53", 1, 1102662601, "8858bb47a042243f369f27d9ab4a9cd6216adeac1c1ac413ed0890e46f23d3f3"], + ["144971940223597a2d1dec49c7d4ec557e4f4bd207428618bafa3c96c411752d494249e1fb0100000004526a5151ffffffff340a545b1080d4f7e2225ff1c9831f283a7d4ca4d3d0a29d12e07d86d6826f7f0200000003006553ffffffff03c36965000000000000dfa9af00000000000451636aac7f7d140300000000016300000000", "", 1, -108117779, "c84fcaf9d779df736a26cc3cabd04d0e61150d4d5472dd5358d6626e610be57f"], + ["b11b6752044e650b9c4744fb9c930819227d2ac4040d8c91a133080e090b042a142e93906e0000000003650053ffffffff6b9ce7e29550d3c1676b702e5e1537567354b002c8b7bb3d3535e63ad03b50ea01000000055100516300fffffffffcf7b252fea3ad5a108af3640a9bc2cd724a7a3ce22a760fba95496e88e2f2e801000000036a00ac7c58df5efba193d33d9549547f6ca839f93e14fa0e111f780c28c60cc938f785b363941b000000000863ab51516552ac5265e51fcd0308e9830400000000036a00abab72190300000000016a63d0710000000000050051ab6a6300000000", "53005165ac51ab65", 0, 229563932, "e562579d1a2b10d1c5e45c06513456002a6bec157d7eb42511d30b118103c052"], + ["2aee6b9a02172a8288e02fac654520c9dd9ab93cf514d73163701f4788b4caeeb9297d2e250300000004ab6363008fb36695528d7482710ea2926412f877a3b20acae31e9d3091406bfa6b62ebf9d9d2a6470100000009535165536a63520065ffffffff03f7b560050000000003acab6a9a8338050000000000206ce90000000000056552516a5100000000", "5252", 1, -1102319963, "fa4676c374ae3a417124b4c970d1ed3319dc3ac91fb36efca1aa9ed981a8aa1b"], + ["9554595203ad5d687f34474685425c1919e3d2cd05cf2dac89d5f33cd3963e5bb43f8706480100000000ffffffff9de2539c2fe3000d59afbd376cb46cefa8bd01dbc43938ff6089b63d68acdc2b02000000096553655251536a6500fffffffff9695e4016cd4dfeb5f7dadf00968e6a409ef048f81922cec231efed4ac78f5d010000000763abab6a5365006caaf0070162cc640200000000045163ab5100000000", "", 0, -1105256289, "e8e10ed162b1a43bfd23bd06b74a6c2f138b8dc1ab094ffb2fa11d5b22869bee"], + ["04f51f2a0484cba53d63de1cb0efdcb222999cdf2dd9d19b3542a896ca96e23a643dfc45f00200000007acac53510063002b091fd0bfc0cfb386edf7b9e694f1927d7a3cf4e1d2ce937c1e01610313729ef6419ae7030000000165a3372a913c59b8b3da458335dc1714805c0db98992fd0d93f16a7f28c55dc747fe66a5b503000000095351ab65ab52536351ffffffff5650b318b3e236802a4e41ed9bc0a19c32b7aa3f9b2cda1178f84499963a0cde000000000165ffffffff0383954f04000000000553ac536363a8fc90030000000000a2e315000000000005acab00ab5100000000", "0053", 2, -1424653648, "a5bc0356f56b2b41a2314ec05bee7b91ef57f1074bcd2efc4da442222269d1a3"], + ["5e4fab42024a27f0544fe11abc781f46596f75086730be9d16ce948b04cc36f86db7ad50fd01000000026a00613330f4916285b5305cc2d3de6f0293946aa6362fc087727e5203e558c676b314ef8dd401000000001af590d202ba496f040000000001009e3c9604000000000351ac51943d64d3", "51acabab5100ab52", 1, -129301207, "556c3f90aa81f9b4df5b92a23399fe6432cf8fecf7bba66fd8fdb0246440036c"], + ["a115284704b88b45a5f060af429a3a8eab10b26b7c15ed421258f5320fa22f4882817d6c2b0300000003005300ffffffff4162f4d738e973e5d26991452769b2e1be4b2b5b7e8cbeab79b9cf9df2882c040000000006636aac63ac5194abc8aa22f8ddc8a7ab102a58e39671683d1891799d19bd1308d24ea6d365e571172f1e030000000700515352515153ffffffff4da7ad75ce6d8541acbb0226e9818a1784e9c97c54b7d1ff82f791df1c6578f60000000000ffffffff01b1f265040000000009ab0051ac656a516a5300000000", "51abab6352535265", 0, -1269106800, "0ef7b6e87c782fa33fe109aab157a2d9cddc4472864f629510a1c92fa1fe7fc1"], + ["f3f771ae02939752bfe309d6c652c0d271b7cab14107e98032f269d92b2a8c8853ab057da8010000000563ab6a6365670c305c38f458e30a7c0ab45ee9abd9a8dc03bae1860f965ffced879cb2e5d0bb156821020000000153ffffffff025dc619050000000002ac51ec0d250100000000076a5200636a6363333aecd8", "650053ac515100ab", 1, 1812404608, "a7aa34bf8a5644f03c6dd8801f9b15ba2e07e07256dbf1e02dad59f0d3e17ea9"], + ["fd3e267203ae7d6d3975e738ca84f12540229bb237dd228d5f688e9d5ba53fce4302b0334d01000000026353ffffffff602a3ab75af7aa951d93093e345ef0037a2863f3f580a9b1a575fffe68e677450300000000239e476d1e8f81e8b6313880d8a49b27c1b00af467f29756e76f675f084a5676539636ab030000000765ab6351acac52d9217747044d773204000000000752ac51526353acc33e45050000000005516500005115d889040000000004ab5163510cbbbd0200000000016500000000", "65ac526aac6a53ab52", 2, -886179388, "bc46f3f83058ddf5bebd9e1f2c117a673847c4dc5e31cfb24bac91adf30877cf"], + ["f380ae23033646af5dfc186f6599098015139e961919aea28502ea2d69474413d94a555ea2000000000853635265abacac5314da394b99b07733341ddba9e86022637be3b76492992fb0f58f23c915098979250a96620300000003ab6300ffffffff4bb6d1c0a0d84eac7f770d3ad0fdc5369ae42a21bbe4c06e0b5060d5990776220300000000ffffffff0486fd70020000000007ac6500635252acf3fd72010000000005656a6a6551212de90500000000096365006a63635153000fa33100000000000600535151656300000000", "ab52", 2, -740890152, "f804fc4d81f039009ed1f2cccb5c91da797543f235ac71b214c20e763a6d86d7"], + ["5c45d09801bb4d8e7679d857b86b97697472d514f8b76d862460e7421e8617b15a2df217c6010000000863acacab6565006affffffff01156dbc03000000000952ac63516551ac6aac00000000", "6aabac", 0, 1310125891, "270445ab77258ced2e5e22a6d0d8c36ac7c30fff9beefa4b3e981867b03fa0ad"], + ["4ecc6bde030ca0f83c0ed3d4b777f94c0c88708c6c933fe1df6874f296d425cac95355c23d0000000006ac6a51536a52f286a0969d6170e20f2a8000193807f5bc556770e9d82341ef8e17b0035eace89c76edd50200000007ac65525100656affffffff5bade6e462fac1927f078d69d3a981f5b4c1e59311a38efcb9a910aa436afaa80000000007ac6a006352ab52ffffffff0331e58902000000000763ac53636352abb8b3ca000000000001637a1d26040000000009535263ac6a5352ab655ae34a39", "6a65ab", 2, 2142728517, "4a3415eb1677ae4e0c939644a4cfd5dc6299780b55cd0dc735967057b6b1526a"], + ["a59484b501eb50114be0fc79e72ab9bc9f4a5f7acdf274a56d6b68684eb68cf8b07ec5d1c2000000000765abab00ab00639e09aa940141e3530200000000046500ac6500000000", "00516565ab", 0, -1561622405, "d60bbadd2cc0674100baa08d0e0493ee4248f0304b3eb778da942041f503a896"], + ["53dc1a88046531c7b57a35f4d9adf101d068bf8d63fbbedaf4741dba8bc5e92c8725def571030000000453655251fcdf116a226b3ec240739c4c7493800e4edfe67275234e371a227721eac43d3d9ecaf1b50300000003ac0052ffffffff2c9279ffeea4718d167e9499bd067600715c14484e373ef93ae4a31d2f5671ab0000000009516553ac636a6a65001977752eeba95a8f16b88c571a459c2f2a204e23d48cc7090e4f4cc35846ca7fc0a455ce00000000055165ac0063188143f80205972902000000000765ac63ac516353c7b6a50000000000036a510000000000", "655351536a", 0, 103806788, "b276584d3514e5b4e058167c41dc02915b9d97f6795936a51f40e894ed8508bc"], + ["53f8959f01ddb36afdcd20167edcbb75a63d18654fdcf10bc0004c761ab450fe236d79cb2702000000065151650063653435003a033a5e34050000000009ac52516a630000516ab86db3030000000002006344ac090500000000046363ab00f3644537", "5263abab63ac656353", 0, -218513553, "f1f2a489682e42a6fc20025dfc89584d17f150b2d7ae3ddedd2bf43d5e24f37f"], + ["5a06cb4602dcfc85f49b8d14513f33c48f67146f2ee44959bbca092788e6823b2719f3160b0200000001ab3c013f2518035b9ea635f9a1c74ec1a3fb7496a160f46aae2e09bfc5cd5111a0f20969e003000000015158c89ab7049f20d6010000000008ac6a52abac53515349765e00000000000300ab638292630100000000045351ab0086da09010000000006656a6365525300000000", "526a63", 1, 1502936586, "bdfaff8a4e775379c5dc26e024968efa805f923de53fa8272dd53ec582afa0c5"], + ["ca9d84fa0129011e1bf27d7cb71819650b59fb292b053d625c6f02b0339249b498ff7fd4b601000000025352ffffffff032173a0040000000008525253abab5152639473bb030000000009005153526a53535151d085bd0000000000086a5365ab5165655300000000", "005152ac51", 0, 580353445, "c629d93b02037f40aa110e46d903edb34107f64806aa0c418d435926feef68b8"], + ["e3cdbfb4014d90ae6a4401e85f7ac717adc2c035858bf6ff48979dd399d155bce1f150daea0300000002ac51a67a0d39017f6c71040000000005535200535200000000", "", 0, -1899950911, "c1c7df8206e661d593f6455db1d61a364a249407f88e99ecad05346e495b38d7"], + ["b2b6b9ab0283d9d73eeae3d847f41439cd88279c166aa805e44f8243adeb3b09e584efb1df00000000026300ffffffff7dfe653bd67ca094f8dab51007c6adaced09de2af745e175b9714ca1f5c68d050000000003ac6500aa8e596903fd3f3204000000000553ac6a6a533a2e210500000000075253acabab526392d0ee020000000008520065635200ab5200000000", "65acacac65005365", 0, 28298553, "39c2aaa2496212b3ab120ab7d7f37c5e852bfe38d20f5226413a2268663eeae8"], + ["f30c5c3d01a6edb9e10fafaf7e85db14e7fec558b9dca4a80b05d7c3a2944d282c5018f4680200000003005263ffffffff04aac3530300000000026551bc2419010000000009005163acab6a5100658e7085050000000000c5e4ec050000000007656a6a635365ab2d8e8882", "abac53ab005251ac52", 0, -490287546, "877e347ec7487497769e2581142276d1a8d813b652e4483cf9cc993d16354417"], + ["4314339e01de40faabcb1b970245a7f19eedbc17c507dac86cf986c2973715035cf95736ae0200000007abababababab65bde67b900151510b04000000000853ac00655200535300000000", "52", 0, 399070095, "47585dc25469d04ff3a60939d0a03779e3e81a411bf0ca18b91bb925ebd30718"], + ["2d4cf4e9031b3e175b2ff18cd933151379d9cfac4713d8bd0e63b70bd4a92277aa7af901ab000000000565515353abffffffff557666c7f3be9cdecdad44c3df206eb63a2da4ed1f159d21193882a9f0340081020000000963ab53ab5252ac63abffffffff8a8c897bdb87e93886aad5ded9d82a13101d5476554386373646ca5e23612e450300000009006a526552abab6a635ac03fc00198bb02040000000009525100526a6563636a1d052834", "ab52ac00acac6a", 0, -1469882480, "09ed6563a454814ab7e3b4c28d56d8751162b77df1825b37ba66c6147750b2a3"], + ["f063171b03e1830fdc1d685a30a377537363ccafdc68b42bf2e3acb908dac61ee24b37595c020000000765ac5100ab6aacf447bc8e037b89d6cadd62d960cc442d5ced901d188867b5122b42a862929ce45e7b628d010000000253aba009a1ba42b00f1490b0b857052820976c675f335491cda838fb7934d5eea0257684a2a202000000001e83cf2401a7f777030000000008ab6553526a53526a00000000", "", 2, 1984790332, "c19caada8e71535e29a86fa29cfd9b74a0c7412003fc722a121005e461e01636"], + ["cf7bdc250249e22cbe23baf6b648328d31773ea0e771b3b76a48b4748d7fbd390e88a004d30000000003ac536a4ab8cce0e097136c90b2037f231b7fde2063017facd40ed4e5896da7ad00e9c71dd70ae600000000096a0063516352525365ffffffff01b71e3e00000000000300536a00000000", "", 1, 546970113, "6a815ba155270af102322c882f26d22da11c5330a751f520807936b320b9af5d"], + ["ac7a125a0269d35f5dbdab9948c48674616e7507413cd10e1acebeaf85b369cd8c88301b7c030000000963656aac6a530053abffffffffed94c39a582e1a46ce4c6bffda2ccdb16cda485f3a0d94b06206066da12aecfe010000000752abab63536363ef71dcfb02ee07fa0400000000016a6908c802000000000751656a6551abac688c2c2d", "6a6351526551", 0, 858400684, "552ff97d7924f51cda6d1b94be53483153ef725cc0a3a107adbef220c753f9a6"], + ["3a1f454a03a4591e46cf1f7605a3a130b631bf4dfd81bd2443dc4fac1e0a224e74112884fe0000000005516aac6a53a87e78b55548601ffc941f91d75eab263aa79cd498c88c37fdf275a64feff89fc1710efe03000000016a39d7ef6f2a52c00378b4f8f8301853b61c54792c0f1c4e2cd18a08cb97a7668caa008d970200000002656affffffff017642b20100000000096a63535253abac6a6528271998", "51", 2, 1459585400, "e9a7f21fc2d38be7be47095fbc8f1bf8923660aa4d71df6d797ae0ba5ca4d5b0"], + ["f59366cc0114c2a18e6bd1347ed9470f2522284e9e835dd5c5f7ef243639ebea95d9b232b6020000000153474b62eb045c00170500000000096352ab516352ab5200038a520400000000086aab5253656a63005b968904000000000963536353ac0053635387106002000000000000000000", "ab52526300ab51", 0, 1834116153, "cdf51f6e3a9dc2be5a59ea4c00f5aac1e1426a5202c325e6cf2567d07d8d8de4"], + ["6269e0fa0173e76e89657ca495913f1b86af5b8f1c1586bcd6c960aede9bc759718dfd5044000000000352ac530e2c7bd90219849b000000000007ab00ab6a53006319f281000000000007ab00515165ac5200000000", "6a", 0, -2039568300, "62094f98234a05bf1b9c7078c5275ed085656856fb5bdfd1b48090e86b53dd85"], + ["eb2bc00604815b9ced1c604960d54beea4a3a74b5c0035d4a8b6bfec5d0c9108f143c0e99a0000000000ffffffff22645b6e8da5f11d90e5130fd0a0df8cf79829b2647957471d881c2372c527d8010000000263acffffffff1179dbaf17404109f706ae27ad7ba61e860346f63f0c81cb235d2b05d14f2c1003000000025300264cb23aaffdc4d6fa8ec0bb94eff3a2e50a83418a8e9473a16aaa4ef8b855625ed77ef40100000003ac51acf8414ad404dd328901000000000652526500006ab6261c000000000002526a72a4c9020000000006ac526500656586d2e7000000000006656aac00ac5279cd8908", "51", 1, -399279379, "d37532e7b2b8e7db5c7c534197600397ebcc15a750e3af07a3e2d2e4f84b024f"], + ["dc9fe6a8038b84209bbdae5d848e8c040433237f415437592907aa798bf30d9dbbddf0ff85010000000153ffffffff23269a7ea29fcf788db483b8d4c4b35669e582608644259e950ce152b0fa6e050000000003acababffffffff65de94857897ae9ea3aa0b938ba6e5adf374d48469922d2b36dbb83d3b8c8261010000000452ac5200ffffffff02856e9b0300000000026a51980c8e02000000000365ab63d2648db4", "00ab0051ac526565", 2, 1562581941, "5cef9d8e18a2d5a70448f17b465d411a19dab78f0ddf1672ffd518b188f52433"], + ["eba8b0de04ac276293c272d0d3636e81400b1aaa60db5f11561480592f99e6f6fa13ad387002000000070053acab536563bebb23d66fd17d98271b182019864a90e60a54f5a615e40b643a54f8408fa8512cfac927030000000963ac6a6aabac65ababffffffff890a72192bc01255058314f376bab1dc72b5fea104c154a15d6faee75dfa5dba020000000100592b3559b0085387ac7575c05b29b1f35d9a2c26a0c27903cc0f43e7e6e37d5a60d8305a030000000252abffffffff0126518f05000000000000000000", "005300635252635351", 1, 664344756, "26dc2cba4bd5334e5c0b3a520b44cc1640c6b923d10e576062f1197171724097"], + ["91bd040802c92f6fe97411b159df2cd60fb9571764b001f31657f2d616964637605875c2a901000000055263006a65ffffffff3651df372645f50cf4e32fdf6e61c766e912e16335db2b40c5d52fe89eefe7cd00000000040065ab65ffffffff03ca8625030000000009ab51ac63530052ab52c6bf14020000000006ab00ab52005167d270000000000007ab53525351636a00000000", "5151ab63005252ac", 1, 1983087664, "3e5aa0200248d8d86ede3b315ca1b857018b89184a4bd023bd88ab12e499f6e1"], + ["185cda1a01ecf7a8a8c28466725b60431545fc7a3367ab68e34d486e8ea85ee3128e0d8384000000000465ac63abec88b7bb031c56eb04000000000965636a51005252006a7c78d5040000000007acac63abac51ac3024a40500000000086300526a51abac51464c0e8c", "0065535265515352", 0, 1594558917, "b5280b9610c0625a65b36a8c2402a95019a7bbb9dd3de77f7c3cb1d82c3263ba"], + ["a9531f07034091668b65fea8b1a79700d586ac9e2f42ca0455a26abe41f9e1805d009a0f5702000000096365516365ac5263ab3619bac643a9e28ee47855118cf80c3a74531cdf198835d206d0fe41804e325a4f9f105e03000000016a58e3ab0d46375d98994daf0fa7c600d2bb4669e726fca0e3a3f21ea0d9e777396740328f0100000008636a5363ab526a538d3ea7700304cb66030000000007515163ab52ab510184030500000000085353636565ac0051d9cff402000000000751ab52ab5352abf0e36254", "ab5353ac5365acab", 2, 1633101834, "04c9ef72f33668ca449c0415becf62cc0b8e0c75f9c8813852d42a58acf107c8"], + ["6b5ecc7903fe0ba37ea551df92a59e12bad0a3065846ba69179a8f4a741a2b4fcf679aac810200000004535263529a3d343293b99ab425e7ef8529549d84f480bcd92472bab972ea380a302128ae14dfcd0200000000025163ffffffff24636e4545cab9bf87009119b7fc3ec4d5ee9e206b90f35d1df8a563b6cd097a010000000852abac53005153abc64467860406e832020000000009526300006a53ac6352ac1395010000000002ac53b117f300000000000863655351acab00651edf02030000000008ab51ac6353535252628ef71d", "ab63ab6a52ac526563", 2, -1559697626, "8f07ece7d65e509f1e0780584ef8d271c1c61a13b10335d5faafc7afc8b5b8ec"], + ["92c9fb780138abc472e589d5b59489303f234acc838ca66ffcdf0164517a8679bb622a4267020000000153468e373d04de03fa020000000009ac006a5265ab5163006af649050000000007515153006a00658ceb59030000000001ac36afa0020000000009ab53006351ab51000000000000", "6a", 0, 2059357502, "e2358dfb51831ee81d7b0bc602a65287d6cd2dbfacf55106e2bf597e22a4b573"], + ["6f62138301436f33a00b84a26a0457ccbfc0f82403288b9cbae39986b34357cb2ff9b889b302000000045253655335a7ff6701bac9960400000000086552ab656352635200000000", "6aac51", 0, 1444414211, "502a2435fd02898d2ff3ab08a3c19078414b32ec9b73d64a944834efc9dae10c"], + ["9981143a040a88c2484ac3abe053849e72d04862120f424f373753161997dd40505dcb4783030000000700536365536565a2e10da3f4b1c1ad049d97b33f0ae0ea48c5d7c30cc8810e144ad93be97789706a5ead180100000003636a00ffffffffbdcbac84c4bcc87f03d0ad83fbe13b369d7e42ddb3aecf40870a37e814ad8bb5010000000963536a5100636a53abffffffff883609905a80e34202101544f69b58a0b4576fb7391e12a769f890eef90ffb72020000000651656352526affffffff04243660000000000004ab5352534a9ce001000000000863656363ab6a53652df19d030000000003ac65acedc51700000000000000000000", "ac6300acac", 2, 293672388, "7ba99b289c04718a7283f150d831175ed6303081e191a0608ea81f78926c5bdf"], + ["a2bb630b01989bc5d643f2da4fb9b55c0cdf846ba06d1dbe372893024dbbe5b9b8a1900af802000000055265ac63aca7a68d2f04916c74010000000003abac007077f0040000000001007d4127010000000005ac516aac000f31e8030000000000571079c9", "65ab0051ac", 0, -1103627693, "92d53b4390262e6b288e8a32e0cfc36cd5adfdfabfe96c7bfd4a19d65e233761"], + ["49f7d0b6037bba276e910ad3cd74966c7b3bc197ffbcfefd6108d6587006947e97789835ea0300000008526a52006a650053ffffffff8d7b6c07cd10f4c4010eac7946f61aff7fb5f3920bdf3467e939e58a1d4100ab03000000076aac63ac535351ffffffff8f48c3ba2d52ad67fbcdc90d8778f3c8a3894e3c35b9730562d7176b81af23c80100000003ab5265ffffffff0301e3ef0300000000046a525353e899ac0500000000075153ab6a65abac259bea0400000000007b739972", "53516aacac6aac", 1, 955403557, "5d366a7f4346ae18aeb7c9fc4dab5af71173184aa20ed22fcb4ea8511ad25449"], + ["58a4fed801fbd8d92db9dfcb2e26b6ff10b120204243fee954d7dcb3b4b9b53380e7bb8fb60100000003006351ffffffff02a0795b050000000006536351ac6aac2718d00200000000075151acabac515354d21ba1", "005363515351", 0, -1322430665, "bbee941bbad950424bf40e3623457db47f60ed29deaa43c99dec702317cb3326"], + ["32765a0b02e455793d9ce530e9f6a44bcbc612e893a875b5da61d822dc56d8245166c398b403000000085353abac6300006a6bdee2a78d0d0b6a5ea666eed70b9bfea99d1d612ba3878f615c4da10d4a521cba27155002000000035363abffffffff043cd42401000000000551656a53653685320100000000030000511881bc0500000000065165abab636a20169f010000000007acab656aac63acdb0706a8", "65ac53ab53", 0, 1936499176, "5c5a9c3a5de7dc7a82bc171c9d3505913b8bcc450bc8b2d11772c1a1d781210b"], + ["17fad0d303da0d764fedf9f2887a91ea625331b28704940f41e39adf3903d8e75683ef6d46020000000151ffffffffff376eea4e880bcf0f03d33999104aafed2b3daf4907950bb06496af6b51720a020000000900636a63525253525196521684f3b08497bad2c660b00b43a6a517edc58217876eb5e478aa3b5fda0f29ee1bea00000000046aacab6affffffff03dde8e2050000000007ac5365ac51516a14772e000000000005630000abacbbb360010000000006ab5251ab656a50f180f0", "0053", 0, -1043701251, "a3bdf8771c8990971bff9b4e7d59b7829b067ed0b8d3ac1ec203429811384668"], + ["236c32850300045e292c84ede2b9ab5733ba08315a2bb09ab234c4b4e8894808edbdac0d3b020000000653635363abacffffffffd3f696bb31fdd18a72f3fc2bb9ae54b416a253fc37c1a0f0180b52d35bad49440100000004650053abffffffffa85c75a2406d82a93b12e555b66641c1896a4e83ae41ef1038218311e38ace060200000006abab006a51ac104b5e6701e2842c04000000000800630051ac0000ab00000000", "ab63ac6a516a", 1, -1709887524, "8c29ea8ef60c5a927fccdba8ea385db6b6b84d98e891db45f5d4ee3148d3f5a7"], + ["b78d5fd601345f3100af494cdf447e7d4076179f940035b0ebe8962587d4d0c9c6c9fc34ee0300000003516a6affffffff03dc5c890100000000085353ac53ac6a52534ac941040000000007ac63656a51ab51d4266b0100000000036aacac70731f2d", "005351ab0053", 0, -1789071265, "d5f1c1cb35956a5711d67bfb4cedbc67e77c089b912d688ad440ff735adb390d"], + ["5a2257df03554550b774e677f348939b37f8e765a212e566ce6b60b4ea8fed4c9504b7f7d1000000000653655265ab5258b67bb931df15b041177cf9599b0604160b79e30f3d7a594e7826bae2c29700f6d8f8f40300000005515300ac6a159cf8808a41f504eb5c2e0e8a9279f3801a5b5d7bc6a70515fbf1c5edc875bb4c9ffac500000000050063510052ffffffff0422a90105000000000965006a650000516a006417d2020000000006526363ab00524d969d0100000000035153acc4f077040000000005ac5200636500000000", "6a52", 1, -1482463464, "37b794b05d0687c9b93d5917ab068f6b2f0e38406ff04e7154d104fc1fb14cdc"], + ["e0032ad601269154b3fa72d3888a3151da0aed32fb2e1a15b3ae7bee57c3ddcffff76a1321010000000100110d93ae03f5bd080100000000075263516a6551002871e60100000000046a005252eaa753040000000004ab6aab526e325c71", "630052", 0, -1857873018, "ea117348e94de86381bb8ad1c7f93b8c623f0272104341701bb54e6cb433596c"], + ["014b2a5304d46764817aca180dca50f5ab25f2e0d5749f21bb74a2f8bf6b8b7b3fa8189cb7030000000965ac5165ab6a51ac6360ecd91e8abc7e700a4c36c1a708a494c94bb20cbe695c408543146566ab22be43beae9103000000045163ab00ffffffffffa48066012829629a9ec06ccd4905a05df0e2b745b966f6a269c9c8e13451fc00000000026565ffffffffc40ccadc21e65fe8a4b1e072f4994738ccaf4881ae6fede2a2844d7da4d199ab02000000065152ab536aabffffffff01b6e054030000000004515352ab3e063432", "", 0, 1056459916, "a7aff48f3b8aeb7a4bfe2e6017c80a84168487a69b69e46681e0d0d8e63a84b6"], + ["c4ef04c103c5dde65410fced19bf6a569549ecf01ceb0db4867db11f2a3a3eef0320c9e8e001000000085100536a53516aabffffffff2a0354fa5bd96f1e28835ffe30f52e19bd7d5150c687d255021a6bec03cf4cfd03000000056a006300514900c5b01d3d4ae1b97370ff1155b9dd0510e198d266c356d6168109c54c11b4c283dca00300000002ababffffffff02e19e3003000000000451655351fa5c0003000000000163ef1fc64b", "51636a51ab630065", 1, -1754709177, "0a281172d306b6a32e166e6fb2a2cc52c505c5d60ea448e9ba7029aa0a2211e1"], + ["29083fe00398bd2bb76ceb178f22c51b49b5c029336a51357442ed1bac35b67e1ae6fdf13100000000066a6500acab51ffffffffe4ca45c9dc84fd2c9c47c7281575c2ba4bf33b0b45c7eca8a2a483f9e3ebe4b3010000000200abffffffffdf47ad2b8c263fafb1e3908158b18146357c3a6e0832f718cd464518a219d18303000000096352ac656351ac0052daddfb3b0231c36f00000000000400526a5275c7e0020000000001ab00000000", "acab536aac52", 2, 300802386, "82ebc07b16cff0077e9c1a279373185b3494e39d08fd3194aae6a4a019377509"], + ["1201ab5d04f89f07c0077abd009762e59db4bb0d86048383ba9e1dad2c9c2ad96ef660e6d00200000007ab6a65ac5200652466fa5143ab13d55886b6cdc3d0f226f47ec1c3020c1c6e32602cd3428aceab544ef43e00000000086a6a6a526a6a5263ffffffffd5be0b0be13ab75001243749c839d779716f46687e2e9978bd6c9e2fe457ee48020000000365abab1e1bac0f72005cf638f71a3df2e3bbc0fa35bf00f32d9c7dc9c39a5e8909f7d53170c8ae0200000008ab6a51516363516affffffff02f0a6210500000000036300ac867356010000000009acab65ac6353536a659356d367", "ac53535252", 0, 917543338, "418acc156c2bc76a5d7baa58db29f1b4cf6c266c9222ed167ef5b4d47f0e0f41"], + ["344fa11e01c19c4dd232c77742f0dd0aeb3695f18f76da627628741d0ee362b0ea1fb3a2180200000007635151005100529bab25af01937c1f0500000000055153ab53656e7630af", "6351005163ac51", 0, -629732125, "228ca52a0a376fe0527a61cfa8da6d7baf87486bba92d49dfd3899cac8a1034f"], + ["b2fda1950191358a2b855f5626a0ebc830ab625bea7480f09f9cd3b388102e35c0f303124c030000000565ac65ab53ffffffff03f9c5ec04000000000765ab51516551650e2b9f0500000000045365525284e8f6040000000001ac00000000", "ac51655253", 0, 1433027632, "d2fa7e13c34cecda5105156bd2424c9b84ee0a07162642b0706f83243ff811a8"], + ["a4a6bbd201aa5d882957ac94f2c74d4747ae32d69fdc765add4acc2b68abd1bdb8ee333d6e0300000008516a6552515152abffffffff02c353cb040000000007ac6351ab51536588bd320500000000066552525253ac00000000", "", 0, 1702060459, "499da7d74032388f820645191ac3c8d20f9dba8e8ded7fa3a5401ea2942392a1"], + ["584e8d6c035a6b2f9dac2791b980a485994bf38e876d9dda9b77ad156eee02fa39e19224a60300000003ab636529db326cc8686a339b79ab6b6e82794a18e0aabc19d9ad13f31dee9d7aad8eff38288588020000000452530052ffffffff09a41f07755c16cea1c7e193c765807d18cadddca6ec1c2ed7f5dcdca99e90e80000000001acffffffff01cba62305000000000451ac63acccdf1f67", "ab536a6363", 2, -27393461, "1125645b49202dca2df2d76dae51877387903a096a9d3f66b5ac80e042c95788"], + ["83a583d204d926f2ee587a83dd526cf1e25a44bb668e45370798f91a2907d184f7cddcbbc7030000000700ab6565536a539f71d3776300dffdfa0cdd1c3784c9a1f773e34041ca400193612341a9c42df64e3f550e01000000050052515251ffffffff52dab2034ab0648553a1bb8fc4e924b2c89ed97c18dfc8a63e248b454035564b01000000015139ab54708c7d4d2c2886290f08a5221cf69592a810fd1979d7b63d35c271961e710424fd0300000005ac65ac5251ffffffff01168f7c030000000000a85e5fb0", "6a536353656a00", 0, 179595345, "5350a31ac954a0b49931239d0ecafbf34d035a537fd0c545816b8fdc355e9961"], + ["ffd35d51042f290108fcb6ea49a560ba0a6560f9181da7453a55dfdbdfe672dc800b39e7320200000006630065516a65f2166db2e3827f44457e86dddfd27a8af3a19074e216348daa0204717d61825f198ec0030100000006ab51abab00abffffffffdf41807adb7dff7db9f14d95fd6dc4e65f8402c002d009a3f1ddedf6f4895fc8030000000500ab006a65a5a848345052f860620abd5fcd074195548ce3bd0839fa9ad8642ed80627bf43a0d47dbd010000000765ab006a656a53b38cdd6502a186da05000000000765ab00ab006a53527c0e0100000000085365ab51acacac52534bd1b1", "6a635253ac0000", 0, 1095082149, "3c05473a816621a3613f0e903faa1a1e44891dd40862b029e41fc520776350fa"], + ["6c9a4b98013c8f1cae1b1df9f0f2de518d0c50206a0ab871603ac682155504c0e0ce946f460100000000ffffffff04e9266305000000000753535100ac6aacded39e04000000000365ac6ab93ccd010000000002515397bf3d050000000003ab636300000000", "63520052ac656353", 0, -352633155, "936eff8cdfd771be24124da87c7b24feb48da7cbc2c25fb5ba13d1a23255d902"], + ["e01dc7f0021dc07928906b2946ca3e9ac95f14ad4026887101e2d722c26982c27dc2b59fdb0000000005ac5200516ab5a31ffadcbe74957a5a3f97d7f1475cc6423fc6dbc4f96471bd44c70cc736e7dec0d1ea020000000951636a526a52abac53ffffffff04bc2edd05000000000252ab528c7b02000000000952ac51526500525353324820040000000002005380c713000000000009630065ab00ac525252451bbb48", "53ab65ac", 0, -552384418, "69c0b30f4c630a6c878fde6ea6b74dae94f4eb3bcfbde2dc3649e1a9ada00757"], + ["009046a1023f266d0113556d604931374d7932b4d6a7952d08fbd9c9b87cbd83f4f4c178b4030000000452ac526346e73b438c4516c60edd5488023131f07acb5f9ea1540b3e84de92f4e3c432289781ea4900000000046500655357dfd6da02baef910100000000026a007d101703000000000800516500abacac5100000000", "6aab6553ac", 0, -802456605, "f8757fbb4448ca34e0cd41b997685b37238d331e70316659a9cc9087d116169d"], + ["df76ec0801a3fcf3d18862c5f686b878266dd5083f16cf655facab888b4cb3123b3ce5db7e01000000010010e7ac6a0233c83803000000000365ac51faf14a040000000004ac51655100000000", "6353acab", 0, 15705861, "e7d873aa079a19ec712b269a37d2670f60d8cb334c4f97e2e3fd10eeb8ee5f5e"], + ["828fd3e0031084051ccef9cfdd97fae4d9cc50c0dae36bd22a3ff332881f17e9756c3e288e0200000004ab535363961a2ccccaf0218ec6a16ba0c1d8b5e93cfd025c95b6e72bc629ec0a3f47da7a4c396dad01000000025353ffffffff19ad28747fb32b4caf7b5dbd9b2da5a264bedb6c86d3a4805cd294ae53a86ac40200000009ab53535351ab6551abffffffff04a41650030000000005656aab6aab8331a304000000000700516365ac516a0d2a47010000000007abac516353abacdebc19040000000006ab5300636a6300000000", "51ab52ab53ac52", 0, 1866105980, "311094b4d73e31aefc77e97859ef07ca2f07a7b7e4d7def80c69d3f5d58527e5"], + ["c4b80f850323022205b3e1582f1ed097911a81be593471a8dce93d5c3a7bded92ef6c7c1260100000002006affffffff70294d62f37c3da7c5eae5d67dce6e1b28fedd7316d03f4f48e1829f78a88ae801000000096a5200530000516351f6b7b544f7c39189d3a2106ca58ce4130605328ce7795204be592a90acd81bef517d6f170200000000ffffffff012ab8080000000000075100006365006335454c1e", "53ac6a536aacac", 0, -1124103895, "06277201504e6bf8b8c94136fad81b6e3dadacb9d4a2c21a8e10017bfa929e0e"], + ["8ab69ed50351b47b6e04ac05e12320984a63801716739ed7a940b3429c9c9fed44d3398ad40300000006536a516a52638171ef3a46a2adb8025a4884b453889bc457d63499971307a7e834b0e76eec69c943038a0300000000ffffffff566bb96f94904ed8d43d9d44a4a6301073cef2c011bf5a12a89bedbaa03e4724030000000265acb606affd01edea38050000000008515252516aacac6300000000", "65000000006365ac53", 0, -1338942849, "7912573937824058103cb921a59a7f910a854bf2682f4116a393a2045045a8c3"], + ["2484991e047f1cf3cfe38eab071f915fe86ebd45d111463b315217bf9481daf0e0d10902a402000000006e71a424eb1347ffa638363604c0d5eccbc90447ff371e000bf52fc743ec832851bb564a0100000001abffffffffef7d014fad3ae7927948edbbb3afe247c1bcbe7c4c8f5d6cf97c799696412612020000000851536a5353006a001dfee0d7a0dd46ada63b925709e141863f7338f34f7aebde85d39268ae21b77c3068c01d0000000008535151ab00636563ffffffff018478070200000000095200635365ac52ab5341b08cd3", "", 3, 265623923, "24cb420a53b4f8bb477f7cbb293caabfd2fc47cc400ce37dbbab07f92d3a9575"], + ["54839ef9026f65db30fc9cfcb71f5f84d7bb3c48731ab9d63351a1b3c7bc1e7da22bbd508e0300000000442ad138f170e446d427d1f64040016032f36d8325c3b2f7a4078766bdd8fb106e52e8d20000000003656500ffffffff02219aa101000000000851ababac52ab00659646bd02000000000552acacabac24c394a5", "ac", 0, 906807497, "69264faadcd1a581f7000570a239a0a26b82f2ad40374c5b9c1f58730514de96"], + ["5036d7080434eb4eef93efda86b9131b0b4c6a0c421e1e5feb099a28ff9dd8477728639f77030000000951516aab535152ab5391429be9cce85d9f3d358c5605cf8c3666f034af42740e94d495e28b9aaa1001ba0c87580300000008006552ab00ab006affffffffd838978e10c0c78f1cd0a0830d6815f38cdcc631408649c32a25170099669daa0000000002acab8984227e804ad268b5b367285edcdf102d382d027789250a2c0641892b480c21bf84e3fb0100000000b518041e023d8653010000000001004040fb0100000000080051ac5200636a6300000000", "52ac", 0, 366357656, "bd0e88829afa6bdc1e192bb8b2d9d14db69298a4d81d464cbd34df0302c634c6"], + ["9ad5ccf503fa4facf6a27b538bc910cce83c118d6dfd82f3fb1b8ae364a1aff4dcefabd38f03000000096365655263ac655300807c48130c5937190a996105a69a8eba585e0bd32fadfc57d24029cbed6446d30ebc1f100100000004000053650f0ccfca1356768df7f9210cbf078a53c72e0712736d9a7a238e0115faac0ca383f219d0010000000600ab536552002799982b0221b8280000000000000c41320000000000086552ac6365636a6595f233a3", "6a5152", 2, 553208588, "f99c29a79f1d73d2a69c59abbb5798e987639e36d4c44125d8dc78a94ddcfb13"], + ["669538a204047214ce058aed6a07ca5ad4866c821c41ac1642c7d63ed0054f84677077a84f030000000853abacab6a655353ffffffff70c2a071c115282924e3cb678b13800c1d29b6a028b3c989a598c491bc7c76c5030000000752ac52ac5163ac80420e8a6e43d39af0163271580df6b936237f15de998e9589ec39fe717553d415ac02a4030000000463635153184ad8a5a4e69a8969f71288c331aff3c2b7d1b677d2ebafad47234840454b624bf7ac1d03000000056a63abab63df38c24a02fbc63a040000000002ab535ec3dc050000000002536500000000", "635153", 3, -190399351, "9615541884dfb1feeb08073a6a6aa73ef694bc5076e52187fdf4138a369f94d9"], + ["a7f139e502af5894be88158853b7cbea49ba08417fbbca876ca6614b5a41432be34499987b000000000765635165abac63ffffffff8b8d70e96c7f54eb70da0229b548ced438e1ca2ba5ddd648a027f72277ee1efc0100000001abffffffff044f2c4204000000000165e93f550100000000050000526a6a94550304000000000365536aadc21c0300000000016300000000", "6aacac6363ab5265ac", 1, 2143189425, "6e3f97955490d93d6a107c18d7fe402f1cada79993bb0ff0d096357261b3a724"], + ["3b94438f0366f9f53579a9989b86a95d134256ce271da63ca7cd16f7dd5e4bffa17d35133f010000000100ffffffff1aaad0c721e06ec00d07e61a84fb6dc840b9a968002ce7e142f943f06fd143a10100000008535151ac51ab0053b68b8e9c672daf66041332163e04db3f6048534bd718e1940b3fc3811c4eef5b7a56888b01000000001d58e38c012e38e700000000000852ab53ac6365536a00000000", "ab655352", 1, -935223304, "b3b336de141d4f071313a2207b2a0c7cf54a070dd8d234a511b7f1d13e23b0c4"], + ["e5dca8a20456de0a67e185fa6ea94085ceae478d2c15c73cb931a500db3a1b6735dd1649ec0200000005ab536aabab32d11bbdcb81361202681df06a6b824b12b5cb40bb1a672cf9af8f2a836e4d95b7839327030000000951005365ab65abacabb345085932939eef0c724adef8a57f9e1bf5813852d957c039b6a12d9c2f201ea520fb030000000009ac5352005165acac6a5efc6072f1a421dc7dc714fc6368f6d763a5d76d0278b95fc0503b9268ccfadb48213a2500000000026a53ffffffff039ee1c4020000000009ac5353ab6353535163184018000000000005655265526a9a4a8a050000000001ac00000000", "65ab53ab6a00ab6553", 2, 1902561212, "7928ae8e86c0b0cad1b2c120ea313087437974382ee6d46443ca5ac3f5878b88"], + ["972128b904e7b673517e96e98d80c0c8ceceae76e2f5c126d63da77ffd7893fb53308bb2da0300000006ac6552ab52acffffffff4cac767c797d297c079a93d06dc8569f016b4bf7a7d79b605c526e1d36a40e2202000000095365ab636aac6a6a6a69928d2eddc836133a690cfb72ec2d3115bf50fb3b0d10708fa5d2ebb09b4810c426a1db01000000060052526300001e8e89585da7e77b2dd2e30625887f0660accdf29e53a614d23cf698e6fc8ab03310e87700000000076a520051acac6555231ddb0330ec2d03000000000200abfaf457040000000004ab6a6352bdc42400000000000153d6dd2f04", "", 0, 209234698, "4a92fec1eb03f5bd754ee9bfd70707dc4420cc13737374f4675f48529be518e4"], + ["1fb4085b022c6cfb848f8af7ba3ba8d21bd23ffa9f0bfd181cb68bcaaf2074e66d4974a31602000000090000006a6a6500acab6c12c07d9f3dbd2d93295c3a49e3757119767097e7fd5371f7d1ba9ba32f1a67a5a426f00000000000ffffffff018fd2fc04000000000363ac5100000000", "65ab006a6aab526a", 0, 1431502299, "8b7dd0ff12ca0d8f4dbf9abf0abba00e897c2f6fd3b92c79f5f6a534e0b33b32"], + ["5374f0c603d727f63006078bd6c3dce48bd5d0a4b6ea00a47e5832292d86af258ea0825c260000000009655353636352526a6af2221067297d42a9f8933dfe07f61a574048ff9d3a44a3535cd8eb7de79fb7c45b6f47320200000003ac006affffffff153d917c447d367e75693c5591e0abf4c94bbdd88a98ab8ad7f75bfe69a08c470200000005ac65516365ffffffff037b5b7b000000000001515dc4d904000000000004bb26010000000004536a6aac00000000", "516552516352ac", 2, 328538756, "8bb7a0129eaf4b8fc23e911c531b9b7637a21ab11a246352c6c053ff6e93fcb6"], + ["c441132102cc82101b6f31c1025066ab089f28108c95f18fa67db179610247086350c163bd010000000651525263ab00ffffffff9b8d56b1f16746f075249b215bdb3516cbbe190fef6292c75b1ad8a8988897c3000000000751ab6553abab00ffffffff02f9078b000000000009ab0053ac51ac00ab51c0422105000000000651006563525200000000", "ac51", 0, -197051790, "55acd8293ed0be6792150a3d7ced6c5ccd153ca7daf09cee035c1b0dac92bb96"], + ["ab82ad3b04545bd86b3bb937eb1af304d3ef1a6d1343ed809b4346cafb79b7297c09e1648202000000086351ac5200535353ffffffff95d32795bbaaf5977a81c2128a9ec0b3c7551b9b1c3d952876fcb423b2dfb9e80000000005515363acac47a7d050ec1a603627ce6cd606b3af314fa7964abcc579d92e19c7aba00cf6c3090d6d4601000000056a516551633e794768bfe39277ebc0db18b5afb5f0c8117dde9b4dfd5697e9027210eca76a9be20d63000000000700520063ab6aacffffffff01ec2ddc050000000008ac52ac65ac65ac5100000000", "536300abab", 1, -2070209841, "b362da5634f20be7267de78b545d81773d711b82fe9310f23cd0414a8280801d"], + ["8bff9d170419fa6d556c65fa227a185fe066efc1decf8a1c490bc5cbb9f742d68da2ab7f320100000007ab000053525365a7a43a80ab9593b9e8b6130a7849603b14b5c9397a190008d89d362250c3a2257504eb810200000007acabacac00ab51ee141be418f003e75b127fd3883dbf4e8c3f6cd05ca4afcaac52edd25dd3027ae70a62a00000000008ac52526a5200536affffffffb8058f4e1d7f220a1d1fa17e96d81dfb9a304a2de4e004250c9a576963a586ae0300000005abacac5363b9bc856c039c01d804000000000951656aac53005365acb0724e00000000000565abab63acea7c7a0000000000036a00ac00000000", "6565", 1, -1349282084, "2b822737c2affeefae13451d7c9db22ff98e06490005aba57013f6b9bbc97250"], + ["0e1633b4041c50f656e882a53fde964e7f0c853b0ada0964fc89ae124a2b7ffc5bc97ea6230100000006ac6aacacabacffffffff2e35f4dfcad2d53ea1c8ada8041d13ea6c65880860d96a14835b025f76b1fbd9000000000351515121270867ef6bf63a91adbaf790a43465c61a096acc5a776b8e5215d4e5cd1492e611f761000000000600ac6aab5265ffffffff63b5fc39bcac83ca80ac36124abafc5caee608f9f63a12479b68473bd4bae769000000000965ac52acac5263acabffffffff0163153e020000000008ab005165ab65515300000000", "6a6aac00", 0, -968477862, "20732d5073805419f275c53784e78db45e53332ee618a9fcf60a3417a6e2ca69"], + ["2b052c24022369e956a8d318e38780ef73b487ba6a8f674a56bdb80a9a63634c6110fb5154010000000251acffffffff48fe138fb7fdaa014d67044bc05940f4127e70c113c6744fbd13f8d51d45143e01000000005710db3804e01aa9030000000008acac6a516a5152abfd55aa01000000000751ab510000ac636d6026010000000000b97da9000000000000fddf3b53", "006552", 0, 595461670, "685d67d84755906d67a007a7d4fa311519467b9bdc6a351913246a41e082a29f"], + ["073bc856015245f03b2ea2da62ccedc44ecb99e4250c7042f596bcb23b294c9dc92cfceb6b02000000095163abab52abab636afe292fb303b7c3f001000000000352636af3c49502000000000400ac6a535851850100000000066aac6553ab6500000000", "ab6aab53006aab52", 0, 247114317, "123916c6485cf23bfea95654a8815fbf04ce4d21a3b7f862805c241472906658"], + ["7888b71403f6d522e414d4ca2e12786247acf3e78f1918f6d727d081a79813d129ee8befce0100000009ab516a6353ab6365abffffffff4a882791bf6400fda7a8209fb2c83c6eef51831bdf0f5dacde648859090797ec030000000153ffffffffbb08957d59fa15303b681bad19ccf670d7d913697a2f4f51584bf85fcf91f1f30200000008526565ac52ac63acffffffff0227c0e8050000000001ac361dc801000000000800515165ab00ab0000000000", "656a", 2, 1869281295, "f43378a0b7822ad672773944884e866d7a46579ee34f9afc17b20afc1f6cf197"], + ["cc4dda57047bd0ca6806243a6a4b108f7ced43d8042a1acaa28083c9160911cf47eab910c40200000007526a0000ab6a63e4154e581fcf52567836c9a455e8b41b162a78c85906ccc1c2b2b300b4c69caaaa2ba0230300000008ab5152ac5100ab65ffffffff69696b523ed4bd41ecd4d65b4af73c9cf77edf0e066138712a8e60a04614ea1c0300000004ab6a000016c9045c7df7836e05ac4b2e397e2dd72a5708f4a8bf6d2bc36adc5af3cacefcf074b8b403000000065352ac5252acffffffff01d7e380050000000000cf4e699a", "525163656351", 1, -776533694, "ff18c5bffd086e00917c2234f880034d24e7ea2d1e1933a28973d134ca9e35d2"], + ["b7877f82019c832707a60cf14fba44cfa254d787501fdd676bd58c744f6e951dbba0b3b77f0200000009ac515263ac53525300a5a36e500148f89c0500000000085265ac6a6a65acab00000000", "6563", 0, -1785108415, "cb6e4322955af12eb29613c70e1a00ddbb559c887ba844df0bcdebed736dffbd"], + ["aeb14046045a28cc59f244c2347134d3434faaf980961019a084f7547218785a2bd03916f3000000000165f852e6104304955bda5fa0b75826ee176211acc4a78209816bbb4419feff984377b2352200000000003a94a5032df1e0d60390715b4b188c330e4bb7b995f07cdef11ced9d17ee0f60bb7ffc8e0100000002516513e343a5c1dc1c80cd4561e9dddad22391a2dbf9c8d2b6048e519343ca1925a9c6f0800a020000000665516365ac513180144a0290db27000000000006ab655151ab5138b187010000000007ab5363abac516a9e5cd98a", "53ac", 0, 478591320, "e8d89a302ae626898d4775d103867a8d9e81f4fd387af07212adab99946311ef"], + ["c9270fe004c7911b791a00999d108ce42f9f1b19ec59143f7b7b04a67400888808487bd59103000000066a0052ac6565b905e76687be2dd7723b22c5e8269bc0f2000a332a289cfc40bc0d617cfe3214a61a85a30300000007ac63ac00635251560871209f21eb0268f175b8b4a06edd0b04162a974cf8b5dada43e499a1f22380d35ede0300000000792213fc58b6342cc8100079f9f5f046fb89f2d92cf0a2cb6d07304d32d9da858757037c0000000008abab51636565516affffffff02c72a8b03000000000452acac530dfb9f05000000000096f94307", "5253ab536351", 3, 543688436, "0278adbcc476d135493ae9bdcd7b3c2002df17f2d81c17d631c50c73e546c264"], + ["57a5a04c0278c8c8e243d2df4bb716f81d41ac41e2df153e7096f5682380c4f441888d9d260300000004ab63ab6afdbe4203525dff42a7b1e628fe22bccaa5edbb34d8ab02faff198e085580ea5fcdb0c61b0000000002ac6affffffff03375e6c05000000000663ab516a6a513cb6260400000000007ca328020000000006516a636a52ab94701cc7", "0053ac5152", 0, -550925626, "b7ca991ab2e20d0158168df2d3dd842a57ab4a3b67cca8f45b07c4b7d1d11126"], + ["072b75a504ad2550c2e9a02614bc9b2a2f50b5b553af7b87c0ef07c64ddc8d8934c96d216401000000036aabaca1387242a5bcd21099b016ad6045bed7dce603472757d9822cc5f602caa4ae20414d378b02000000026a63e4ac816734acdc969538d6f70b8ab43a2589f55e0177a4dc471bdd0eb61d59f0f46f6bb801000000065351526aab52d9f2977be76a492c3a7617b7a16dc29a3b0a7618f328c2f7d4fd9bafe760dc427a5066ef000000000465635165ffffffff02c5793600000000000165296820050000000002ac6300000000", "53006a6aac0052ab", 2, 66084636, "437e89bb6f70fd2ed2feef33350b6f6483b891305e574da03e580b3efd81ae13"], + ["7e27c42d0279c1a05eeb9b9faedcc9be0cab6303bde351a19e5cbb26dd0d594b9d74f40d2b020000000200518c8689a08a01e862d5c4dcb294a2331912ff11c13785be7dce3092f154a005624970f84e0200000000500cf5a601e74c1f0000000000076aab52636a6a5200000000", "6500006a5351", 0, 449533391, "535ba819d74770d4d613ee19369001576f98837e18e1777b8246238ff2381dd0"], + ["11414de403d7f6c0135a9df01cb108c1359b8d4e105be50a3dcba5e6be595c8817217490b20000000003005263ffffffff0c6becb9c3ad301c8dcd92f5cbc07c8bed7973573806d1489316fc77a829da03030000000700005253535352ffffffff2346d74ff9e12e5111aa8779a2025981850d4bf788a48de72baa2e321e4bc9ca00000000056352acab63cc585b64045e0385050000000009ab5253ab516aacac00efa9cf0300000000065200635151acbe80330400000000070063635100ab000be159050000000007525300655300ac00000000", "51656a0051ab", 0, 683137826, "d4737f3b58f3e5081b35f36f91acde89dda00a6a09d447e516b523e7a99264d5"], + ["1c6b5f29033fc139338658237a42456123727c8430019ca25bd71c6168a9e35a2bf54538d80100000008536aac52ac6a6a52ffffffff3fb36be74036ff0c940a0247c451d923c65f826793d0ac2bb3f01ecbec8033290100000007ab000051ab6363ffffffff5d9eca0cf711685105bd060bf7a67321eaef95367acffab36ce8dedddd632ee2000000000652ac6a63ac517167319e032d26de040000000003516363dc38fb010000000000b37b00000000000006ab520051ac534baba51f", "636300ababac6563", 0, -2049129935, "3282a2ec6b8c87c9303e6060c17b421687db1bd35fbfa0345b48f2490e15b6cc"], + ["978b9dad0214cfc7ce392d74d9dcc507350dc34007d72e4125861c63071ebf2cc0a6fd4856020000000651ac6a6aab52ffffffff47f20734e3370e733f87a6edab95a7a268ae44db7a8974e255614836b22938720200000008635265ac51516553ffffffff0137b2560100000000035252ac2f3363e9", "006aab6352", 1, 2014249801, "55611a5fb1483bce4c14c33ed15198130e788b72cd8929b2ceef4dd68b1806bf"], + ["442f1c8703ab39876153c241ab3d69f432ba6db4732bea5002be45c8ca10c3a2356fe0e9590300000001accb2b679cab7c58a660cb6d4b3452c21cd7251a1b77a52c300f655f5baeb6fa27ff5b79880300000003005252e5ccf55712bc8ed6179f6726f8a78f3018a7a0391594b7e286ef5ee99efdcde302a102cc0200000009006352526351536a63ffffffff04443f63030000000006536a63ab63651405fb020000000009ac535351525300ab6a9f172b000000000004ab535263ad5c50050000000008656a65ab630000ac00000000", "65636aab006552", 2, 2125838294, "b3ff10f21e71ebc8b25fe058c4074c42f08617e0dcc03f9e75d20539d3242644"], + ["2b3470dd028083910117f86614cdcfb459ee56d876572510be4df24c72e8f58c70d5f5948b03000000066aab65635265da2c3aac9d42c9baafd4b655c2f3efc181784d8cba5418e053482132ee798408ba43ccf90300000000ffffffff047dda4703000000000765516a52ac53009384a603000000000651636a63ab6a8cf57a03000000000352ab6a8cf6a405000000000952636a6a6565525100661e09cb", "ac520063ac6a6a52", 1, 1405647183, "9b360c3310d55c845ef537125662b9fe56840c72136891274e9fedfef56f9bb5"], + ["d74282b501be95d3c19a5d9da3d49c8a88a7049c573f3788f2c42fc6fa594f59715560b9b00000000009655353525265ac52ac9772121f028f8303030000000003510065af5f47040000000007ac516a6551630000000000", "acab53006363ac", 0, -1113209770, "2f482b97178f17286f693796a756f4d7bd2dfcdbecd4142528eec1c7a3e5101a"], + ["3a5644a9010f199f253f858d65782d3caec0ac64c3262b56893022b9796086275c9d4d097b02000000009d168f7603a67b30050000000007ac51536a0053acd9d88a050000000007655363535263ab3cf1f403000000000352ac6a00000000", "005363536565acac6a", 0, -1383947195, "6390ab0963cf611e0cea35a71dc958b494b084e6fd71d22217fdc5524787ade6"], + ["67b3cc43049d13007485a8133b90d94648bcf30e83ba174f5486ab42c9107c69c5530c5e1f0000000003005100ffffffff9870ebb65c14263282ea8d41e4f4f40df16b565c2cf86f1d22a9494cad03a67f01000000016a5a121bee5e359da548e808ae1ad6dfccae7c67cbb8898d811638a1f455a671e822f228ef030000000151c1fcc9f9825f27c0dde27ea709da62a80a2ff9f6b1b86a5874c50d6c37d39ae31fb6c8a0030000000163553b8786020ca74a00000000000665635153ab5275c0760000000000020052e659b05d", "636aab6a6a", 0, -342795451, "f77c3322c97b1681c17b1eba461fa27b07e04c1534e8aaf735a49cab72c7c2e2"], + ["bda1ff6804a3c228b7a12799a4c20917301dd501c67847d35da497533a606701ad31bf9d5e0300000001ac16a6c5d03cf516cd7364e4cbbf5aeccd62f8fd03cb6675883a0636a7daeb650423cb1291010000000500656553ac4a63c30b6a835606909c9efbae1b2597e9db020c5ecfc0642da6dc583fba4e84167539a8020000000865525353515200acffffffff990807720a5803c305b7da08a9f24b92abe343c42ac9e917a84e1f335aad785d00000000026a52ffffffff04981f20030000000001ab8c762200000000000253ab690b9605000000000151ce88b301000000000753526a6a51006500000000", "000052ac52530000", 1, -1809193140, "5299b0fb7fc16f40a5d6b337e71fcd1eb04d2600aefd22c06fe9c71fe0b0ba54"], + ["2ead28ff0243b3ab285e5d1067f0ec8724224402b21b9cef9be962a8b0d153d401be99bbee0000000004ac635153ffffffff6985987b7c1360c9fa8406dd6e0a61141709f0d5195f946da55ed83be4e3895301000000020053ffffffff016503d20500000000085251ac6a65656a6a00000000", "51abab", 1, 1723793403, "67483ee62516be17a2431a163e96fd88a08ff2ce8634a52e42c1bc04e30f3f8a"], + ["db4904e6026b6dd8d898f278c6428a176410d1ffbde75a4fa37cda12263108ccd4ca6137440100000007656a0000515263ffffffff1db7d5005c1c40da0ed17b74cf6b2a6ee2c33c9e0bacda76c0da2017dcac2fc70200000004abab6a53ffffffff0454cf2103000000000153463aef000000000009ab6a630065ab52636387e0ed050000000000e8d16f05000000000352ac63e4521b22", "", 1, 1027042424, "48315a95e49277ab6a2d561ee4626820b7bab919eea372b6bf4e9931ab221d04"], + ["dca31ad10461ead74751e83d9a81dcee08db778d3d79ad9a6d079cfdb93919ac1b0b61871102000000086500525365ab51ac7f7e9aed78e1ef8d213d40a1c50145403d196019985c837ffe83836222fe3e5955e177e70100000006525152525300ffffffff5e98482883cc08a6fe946f674cca479822f0576a43bf4113de9cbf414ca628060100000006ac53516a5253ffffffff07490b0b898198ec16c23b75d606e14fa16aa3107ef9818594f72d5776805ec502000000036a0052ffffffff01932a2803000000000865ab6551ac6a516a2687aa06", "635300ac", 2, -1880362326, "74d6a2fa7866fd8b74b2e34693e2d6fd690410384b7afdcd6461b1ae71d265ce"], + ["e14e1a9f0442ab44dfc5f6d945ad1ff8a376bc966aad5515421e96ddbe49e529614995cafc03000000055165515165fffffffff97582b8290e5a5cfeb2b0f018882dbe1b43f60b7f45e4dd21dbd3a8b0cfca3b0200000000daa267726fe075db282d694b9fee7d6216d17a8c1f00b2229085495c5dc5b260c8f8cd5d000000000363ac6affffffffaab083d22d0465471c896a438c6ac3abf4d383ae79420617a8e0ba8b9baa872b010000000963526563ac5363ababd948b5ce022113440200000000076a636552006a53229017040000000000e6f62ac8", "526353636a65", 3, -485265025, "1bc8ad76f9b7c366c5d052dc479d6a8a2015566d3a42e93ab12f727692c89d65"], + ["720d4693025ca3d347360e219e9bc746ef8f7bc88e8795162e5e2f0b0fc99dc17116fc937100000000046353520045cb1fd79824a100d30b6946eab9b219daea2b0cdca6c86367c0c36af98f19ac64f3575002000000008a1c881003ed16f3050000000008536a63630000abac45e0e704000000000151f6551a05000000000963536565515363abab00000000", "6553ab6a6a510000ab", 1, 1249091393, "a575fa4f59a8e90cd07de012c78fe8f981183bb170b9c50fcc292b8c164cbc3b"], + ["69df842a04c1410bfca10896467ce664cfa31c681a5dac10106b34d4b9d4d6d0dc1eac01c1000000000551536a5165269835ca4ad7268667b16d0a2df154ec81e304290d5ed69e0069b43f8c89e673328005e200000000076a5153006aacabffffffffc9314bd80b176488f3d634360fcba90c3a659e74a52e100ac91d3897072e3509010000000765abac51636363ffffffff0e0768b13f10f0fbd2fa3f68e4b4841809b3b5ba0e53987c3aaffcf09eee12bf0300000008ac535263526a53ac514f4c2402da8fab0400000000001ef15201000000000451526a52d0ec9aca", "525365ac52", 1, 313967049, "a72a760b361af41832d2c667c7488dc9702091918d11e344afc234a4aea3ec44"], + ["adf2340d03af5c589cb5d28c06635ac07dd0757b884d4777ba85a6a7c410408ad5efa8b19001000000045100ab00ffffffff808dc0231c96e6667c04786865727013922bcb7db20739b686f0c17f5ba70e8f0300000000fd2332a654b580881a5e2bfec8313f5aa878ae94312f37441bf2d226e7fc953dcf0c77ab000000000163aa73dc580412f8c2050000000005636aacac63da02d502000000000153e74b52020000000001536b293d030000000009636552ababacab526500000000", "000052ab52ababab", 0, -568651175, "2c45d021db545df7167ac03c9ee56473f2398d9b2b739cf3ff3e074501d324f8"], + ["e4fec9f10378a95199c1dd23c6228732c9de0d7997bf1c83918a5cfd36012476c0c3cba24002000000085165536500ac0000ad08ab93fb49d77d12a7ccdbb596bc5110876451b53a79fdce43104ff1c316ad63501de801000000046a6352ab76af9908463444aeecd32516a04dd5803e02680ed7f16307242a794024d93287595250f4000000000089807279041a82e603000000000200521429100200000000055253636a63f20b940400000000004049ed04000000000500ab5265ab43dfaf7d", "6563526aac", 2, -1923470368, "32f3c012eca9a823bebb9b282240aec40ca65df9f38da43b1dcfa0cac0c0df7e"], + ["4000d3600100b7a3ff5b41ec8d6ccdc8b2775ad034765bad505192f05d1f55d2bc39d0cbe10100000007ab5165ac6a5163ffffffff034949150100000000026a6a92c9f6000000000008ab6553ab6aab635200e697040000000007636a5353525365237ae7d2", "52000063", 0, -880046683, "c76146f68f43037289aaeb2bacf47408cddc0fb326b350eb4f5ef6f0f8564793"], + ["eabc0aa701fe489c0e4e6222d72b52f083166b49d63ad1410fb98caed027b6a71c02ab830c03000000075253ab63530065ffffffff01a5dc0b05000000000253533e820177", "", 0, 954499283, "1d849b92eedb9bf26bd4ced52ce9cb0595164295b0526842ab1096001fcd31b1"], + ["d48d55d304aad0139783b44789a771539d052db565379f668def5084daba0dfd348f7dcf6b00000000006826f59e5ffba0dd0ccbac89c1e2d69a346531d7f995dea2ca6d7e6d9225d81aec257c6003000000096a655200ac656552acffffffffa188ffbd5365cae844c8e0dea6213c4d1b2407274ae287b769ab0bf293e049eb0300000005ac6a6aab51ad1c407c5b116ca8f65ed496b476183f85f072c5f8a0193a4273e2015b1cc288bf03e9e2030000000252abffffffff04076f44040000000006655353abab53be6500050000000003ac65ac3c15040500000000095100ab536353516a52ed3aba04000000000900ac53ab53636aabac00000000", "5253526563acac", 2, -1506108646, "bbee17c8582514744bab5df50012c94b0db4aff5984d2e13a8d09421674404e2"], + ["9746f45b039bfe723258fdb6be77eb85917af808211eb9d43b15475ee0b01253d33fc3bfc502000000065163006a655312b12562dc9c54e11299210266428632a7d0ee31d04dfc7375dcad2da6e9c11947ced0e000000000009074095a5ac4df057554566dd04740c61490e1d3826000ad9d8f777a93373c8dddc4918a00000000025351ffffffff01287564030000000004636a00ab00000000", "52", 2, -1380411075, "84af1623366c4db68d81f452b86346832344734492b9c23fbb89015e516c60b2"], + ["8731b64903d735ba16da64af537eaf487b57d73977f390baac57c7b567cb2770dfa2ef65870100000001635aedd990c42645482340eacb0bfa4a0a9e888057389c728b5b6a8691cdeb1a6a67b45e140200000008ac53526a52516551ffffffff45c4f567c47b8d999916fd49642cbc5d10d43c304b99e32d044d35091679cb860100000003006a51ffffffff0176d6c200000000000000000000", "ab6a65ab53", 2, -1221546710, "ccfdba36d9445f4451fb7cbf0752cc89c23d4fc6fff0f3930d20e116f9db0b95"], + ["f5cfc52f016209ab1385e890c2865a74e93076595d1ca77cbe8fbf2022a2f2061a90fb0f3e010000000253acffffffff027de73f0200000000085252ac510052acac49cd6a020000000000e6c2cb56", "516552535300ab63", 0, -1195302704, "5532717402a2da01a1da912d824964024185ca7e8d4ad1748659dc393a14182b"], + ["df0a32ae01c4672fd1abd0b2623aae0a1a8256028df57e532f9a472d1a9ceb194267b6ee190200000009536a6a51516a525251b545f9e803469a2302000000000465526500810631040000000000441f5b050000000006530051006aaceb183c76", "536a635252ac6a", 0, 1601138113, "9a0435996cc58bdba09643927fe48c1fc908d491a050abbef8daec87f323c58f"], + ["d102d10c028b9c721abb259fe70bc68962f6cae384dabd77477c59cbeb1fb26266e091ba3e0100000002516affffffffe8d7305a74f43e30c772109849f4cd6fb867c7216e6d92e27605e69a0818899700000000026a65ecf82d58027db4620500000000026552c28ed3010000000001ab00000000", "0051ab515365", 1, -131815460, "1d1757a782cb5860302128bcbe9398243124a2f82d671a113f74f8e582c7a182"], + ["cef930ed01c36fcb1d62ceef931bef57098f27a77a4299904cc0cbb44504802d535fb11557010000000153ffffffff02c8657403000000000863ac655253520063d593380400000000046aab536a00000000", "656a0051ab6365ab53", 0, -351313308, "e69dba3efb5c02af2ab1087d0a990678784671f4744d01ca097d71aec14dd8e9"], + ["b1c0b71804dff30812b92eefb533ac77c4b9fdb9ab2f77120a76128d7da43ad70c20bbfb990200000002536392693e6001bc59411aebf15a3dc62a6566ec71a302141b0c730a3ecc8de5d76538b30f55010000000665535252ac514b740c6271fb9fe69fdf82bf98b459a7faa8a3b62f3af34943ad55df4881e0d93d3ce0ac0200000000c4158866eb9fb73da252102d1e64a3ce611b52e873533be43e6883137d0aaa0f63966f060000000001abffffffff04a605b604000000000851006a656a630052f49a0300000000000252515a94e1050000000009abac65ab0052abab00fd8dd002000000000651535163526a2566852d", "ac5363", 0, -1718831517, "b0dc030661783dd9939e4bf1a6dfcba809da2017e1b315a6312e5942d714cf05"], + ["6a270ee404ebc8d137cfd4bb6b92aa3702213a3139a579c1fc6f56fbc7edd9574ef17b13f30100000009ab00ab656565ababacffffffffaa65b1ab6c6d87260d9e27a472edceb7dd212483e72d90f08857abf1dbfd46d10100000000fffffffff93c4c9c84c4dbbe8a912b99a2830cfe3401aebc919041de063d660e585fc9f002000000096aabacab52ac6a53acfa6dcef3f28355a8d98eee53839455445eeee83eecd2c854e784efa53cee699dbfecaebd0100000003ab6a51ffffffff04f7d71b050000000009ac6a536aac6a6365513c37650500000000065265abab6a53fa742002000000000039ed82030000000009516aac635165ab51ab2fdabd17", "ab535252526563", 1, -1326210506, "1dec0d5eb921bf5b2df39c8576e19c38d0c17254a4a0b78ac4b5422bcc426258"], + ["3657e4260304ccdc19936e47bdf058d36167ee3d4eb145c52b224eff04c9eb5d1b4e434dfc0000000001ab58aefe57707c66328d3cceef2e6f56ab6b7465e587410c5f73555a513ace2b232793a74400000000036a006522e69d3a785b61ad41a635d59b3a06b2780a92173f85f8ed428491d0aaa436619baa9c4501000000046351abab2609629902eb7793050000000000a1b967040000000003525353a34d6192", "516a", 0, -1761874713, "0a2ff41f6d155d8d0e37cd9438f3b270df9f9214cda8e95c76d5a239ca189df2"], + ["a0eb6dc402994e493c787b45d1f946d267b09c596c5edde043e620ce3d59e95b2b5b93d43002000000096a5252526aac63ab6555694287a279e29ee491c177a801cd685b8744a2eab83824255a3bcd08fc0e3ea13fb8820000000009abab6365ab52ab0063ffffffff029e424a040000000008acab53ab516a636a23830f0400000000016adf49c1f9", "ac0065ac6500005252", 1, 669294500, "e05e3d383631a7ed1b78210c13c2eb26564e5577db7ddfcea2583c7c014091d4"], + ["6e67c0d3027701ef71082204c85ed63c700ef1400c65efb62ce3580d187fb348376a23e9710200000001655b91369d3155ba916a0bc6fe4f5d94cad461d899bb8aaac3699a755838bfc229d6828920010000000765536353526a52ffffffff04c0c792000000000005650052535372f79e000000000001527fc0ee010000000005ac5300ab65d1b3e902000000000251aba942b278", "6a5151", 0, 1741407676, "e657e2c8ec4ebc769ddd3198a83267b47d4f2a419fc737e813812acefad92ff7"], + ["8f53639901f1d643e01fc631f632b7a16e831d846a0184cdcda289b8fa7767f0c292eb221a00000000046a53abacffffffff037a2daa01000000000553ac6a6a51eac349020000000005ac526552638421b3040000000007006a005100ac63048a1492", "ac65", 0, 1033685559, "da86c260d42a692358f46893d6f91563985d86eeb9ea9e21cd38c2d8ffcfcc4d"], + ["491f99cb01bdfba1aa235e5538dac081fae9ce55f9622de483afe7e65105c2b0db75d360d200000000045251636340b60f0f041421330300000000096351ac000051636553ce2822040000000005516a00ac5180c8e40300000000025100caa8570400000000020000cfdc8da6", "6a5100516aab655365", 0, -953727341, "397c68803b7ce953666830b0221a5e2bcf897aa2ded8e36a6b76c497dcb1a2e1"], + ["b3cad3a7041c2c17d90a2cd994f6c37307753fa3635e9ef05ab8b1ff121ca11239a0902e700300000009ab635300006aac5163ffffffffcec91722c7468156dce4664f3c783afef147f0e6f80739c83b5f09d5a09a57040200000004516a6552ffffffff969d1c6daf8ef53a70b7cdf1b4102fb3240055a8eaeaed2489617cd84cfd56cf020000000352ab53ffffffff46598b6579494a77b593681c33422a99559b9993d77ca2fa97833508b0c169f80200000009655300655365516351ffffffff04d7ddf800000000000853536a65ac6351ab09f3420300000000056aab65abac33589d04000000000952656a65655151acac944d6f0400000000006a8004ba", "005165", 1, 1035865506, "fe1dc9e8554deecf8f50c417c670b839cc9d650722ebaaf36572418756075d58"], + ["e1cfd73b0125add9e9d699f5a45dca458355af175a7bd4486ebef28f1928d87864384d02df02000000036a0051ffffffff0357df030100000000036a5365777e2d04000000000763ab6a00005265f434a601000000000351655100000000", "ab53ab", 0, -1936500914, "950f4b4f72ccdf8a6a0f381265d6c8842fdb7e8b3df3e9742905f643b2432b69"], + ["cf781855040a755f5ba85eef93837236b34a5d3daeb2dbbdcf58bb811828d806ed05754ab8010000000351ac53ffffffffda1e264727cf55c67f06ebcc56dfe7fa12ac2a994fecd0180ce09ee15c480f7d00000000096351516a51acac00ab53dd49ff9f334befd6d6f87f1a832cddfd826a90b78fd8cf19a52cb8287788af94e939d6020000000700525251ac526310d54a7e8900ed633f0f6f0841145aae7ee0cbbb1e2a0cae724ee4558dbabfdc58ba6855010000000552536a53abfd1b101102c51f910500000000096300656a525252656a300bee010000000009ac52005263635151abe19235c9", "53005365", 2, 1422854188, "d5981bd4467817c1330da72ddb8760d6c2556cd809264b2d85e6d274609fc3a3"], + ["fea256ce01272d125e577c0a09570a71366898280dda279b021000db1325f27edda41a53460100000002ab53c752c21c013c2b3a01000000000000000000", "65", 0, 1145543262, "076b9f844f6ae429de228a2c337c704df1652c292b6c6494882190638dad9efd"] +] diff --git a/packages/kauri-bitcore-lib/test/data/tx_creation.json b/packages/kauri-bitcore-lib/test/data/tx_creation.json new file mode 100644 index 0000000..eb6bd30 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/data/tx_creation.json @@ -0,0 +1,85 @@ +[ + [ + "from", [{ + "address": "mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1", + "txId": "a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458", + "outputIndex": 0, + "script": "OP_DUP OP_HASH160 20 0x88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG", + "satoshis": 1020000 + }], + "to", ["mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc", 1010000], + "sign", ["cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY"], + "serialize", "01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006b4830450221009972100061da4a17a471ac1906c18bb5445c03da2a0be52c59aca6c58f1e342302202b7a19a22572cabb6e55c368ebdb5921541358fa969d5c76b5e0d6ad3f26a7d701210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff0150690f00000000001976a9147821c0a3768aa9d1a37e16cf76002aef5373f1a888ac00000000" + ], + [ + "from", [{ + "txid": "e42447187db5a29d6db161661e4bc66d61c3e499690fe5ea47f87b79ca573986", + "vout": 1, + "address": "mgBCJAsvzgT2qNNeXsoECg2uPKrUsZ76up", + "scriptPubKey": "76a914073b7eae2823efa349e3b9155b8a735526463a0f88ac", + "amount": 0.01080000 + }], + "to", ["mn9new5vPYWuVN5m3gUBujfKh1uPQvR9mf", 500000], + "to", ["mw5ctwgEaNRbxkM4JhXH3rp5AyGvTWDZCD", 570000], + "sign", ["cSQUuwwJBAg6tYQhzqqLWW115D1s5KFZDyhCF2ffrnukZxMK6rNZ"], + "serialize", "0100000001863957ca797bf847eae50f6999e4c3616dc64b1e6661b16d9da2b57d184724e4010000006b483045022100855691c90510edf83ab632f0a0b17f5202d2cf7071050dcf0c2778325ed403cd022014ee7a4e787da8bc088d2ece43108a7b8d7112eba89876a27bb44195a0715a910121039dd446bbc85db6917f39c0b4c295b0f8cce76d1926fa76d7b84e3f7ff1c5eec5ffffffff0220a10700000000001976a91448c819246ae5645ceecd41fbe1aa6202a0a9b5ca88ac90b20800000000001976a914aab76ba4877d696590d94ea3e02948b55294815188ac00000000" + ], + [ + "from", [ + [{ + "txid": "a9db84566e0fc9351e86337d2828ab281b25ddc06fab798f6d4b5baef48c02b3", + "vout": 0, + "address": "mn9new5vPYWuVN5m3gUBujfKh1uPQvR9mf", + "account": "", + "scriptPubKey": "76a91448c819246ae5645ceecd41fbe1aa6202a0a9b5ca88ac", + "amount": 0.00500000, + "confirmations": 0 + }, { + "txid": "a9db84566e0fc9351e86337d2828ab281b25ddc06fab798f6d4b5baef48c02b3", + "vout": 1, + "address": "mw5ctwgEaNRbxkM4JhXH3rp5AyGvTWDZCD", + "account": "", + "scriptPubKey": "76a914aab76ba4877d696590d94ea3e02948b55294815188ac", + "amount": 0.00570000, + "confirmations": 0 + }] + ], + "to", ["mtymcCX5KixPjT1zxtg59qewBGWptj9etH", 1060000], + "sign", [ + ["cPGbA2C54ZZ1sw4dc2ckBE1WqkdrNSbEV8Tkjhi2p1J15oErdgP2", "cSpyve5bXAuyHrNeV9MjTdFz3HLw739yUjjUAUSMe3ppf2qzj2hw"] + ], + "serialize", "0100000002b3028cf4ae5b4b6d8f79ab6fc0dd251b28ab28287d33861e35c90f6e5684dba9000000006a4730440220635e95e1981bbb360feaf4c232f626a0af8eb5c043a99749a21b0e37fd0048fd02201c5db8a93f1f5c268be6167da7c92f5030481acf65bef750c81ec9907aba3b170121030253c73236acf5ea9085d408220141197f6094de07426bd0d32c7a543614fdd7ffffffffb3028cf4ae5b4b6d8f79ab6fc0dd251b28ab28287d33861e35c90f6e5684dba9010000006a4730440220319a0b5ee9c67ccb7de4222234f31059354be4f239c99ca24bff30adfec8e8ec02204ad4c6dedebb20d100f9484b9ea6c5ba36712e9da155c24509e793c02e4805fd012102977a001a0a7bbfd1f8a647c7d46e13e8f6920635b328390b43b3303977101149ffffffff01a02c1000000000001976a91493abf1e9e4a20c125b93f93ee39efc16b6e4bc4688ac00000000" + ], + [ + "from", [{ + "address": "mgJT8iegL4f9NCgQFeFyfvnSw1Yj4M5Woi", + "txid": "f50e13cecda9a438ebd7df213a2899e42b2461a18d4630ee773d26b4f2688bdc", + "vout": 1, + "scriptPubKey": "76a914089acaba6af8b2b4fb4bed3b747ab1e4e60b496588ac", + "amount": 0.01 + }], + "to", ["n3riXZowrjGnY74rx7Hdi9wCyvgyJC28zZ", 990000], + "sign", ["cPwWtDztEgRCMCU8pMQp4HgphvyadrAsYBrCjXUZuDSmnZkyoyNF"], + "serialize", "0100000001dc8b68f2b4263d77ee30468da161242be499283a21dfd7eb38a4a9cdce130ef5010000006a473044022012610834051e6af8594dd5d9c47123d6ce03537d321f9fe3f6ff244b23f47dd5022034901bb0d83688758a9248fdef48bd2000b55cf70111cbef8f206e72a31aaf61012103e26b47e7c0d8946954bf9dd4bc7f9e415437eb98271d05f69e78cef8fc6c9a54ffffffff01301b0f00000000001976a914f50f9826ef186074c6fe206cca6b71472ff07ba888ac00000000" + ], + [ + "from", [{ + "address":"38nw4sTs3fCH1YiBjYeQAX1t9eWMxpek8Z","txid":"073281b2cc94e879aaf30ea2e92947d9827b270015849d3a5b96a89ee15bfa66","vout":0,"ts":1418877950,"scriptPubKey":"a9144de752833233fe69a20064f29b2ca0f6399c8af387","amount":0.00318512,"confirmationsFromCache":false + }, ["03411e021210a933c247ea9c8dad4bbead281597d508ad84e899de13e4ce98b4ba", "03bda2c3cc11a391b36e3d695b03ab42b96fe04086b2349056108d858983e60dab", "03c16e6ecf4e02bf9db23d3247ab92db8881f0866133ffb530c3470f6d8dea7330"], 2], + "to", ["3BazTqvkvEBcWk7J4sbgRnxUw6rjYrogf9", 300299], + "sign", [["L3y1PAXfjayeB3w6NP7qfNxPbuPpQFA6hd6gj4BUKa2xSdLwoVSZ", "L3a57fiNjqfbXBdYvvGYPQ1HiDX463mwA2xFGTYVkXYdooaz9Z2u"]], + "serialize", "010000000166fa5be19ea8965b3a9d841500277b82d94729e9a20ef3aa79e894ccb281320700000000fc0047304402202f66fcfc0d5bff109ec12327ca37e0bc7722d08da9538f12468994799534bed602203a0b374f3a6810b0ee26028c390e14f5b6bada8fa390f4364d70d04aee240d350147304402206757f710f25937cd846fd8c56687c463a4561e9e0421fc173c78eaf2de9b9a7d02204995db6b81513b67a42b09dabab6ed4cb90901c52f6f945b768827a9390bda60014c69522103411e021210a933c247ea9c8dad4bbead281597d508ad84e899de13e4ce98b4ba2103bda2c3cc11a391b36e3d695b03ab42b96fe04086b2349056108d858983e60dab2103c16e6ecf4e02bf9db23d3247ab92db8881f0866133ffb530c3470f6d8dea733053aeffffffff010b9504000000000017a9146c8d8b04c6a1e664b1ec20ec932760760c97688e8700000000" + ], + [ + "from", [{"address":"3BazTqvkvEBcWk7J4sbgRnxUw6rjYrogf9","txid":"afbf98ca4a43db8915d75184b5204fbe71d916482adfe85cb0ed3635764fc220","vout":0,"ts":1418878108,"scriptPubKey":"a9146c8d8b04c6a1e664b1ec20ec932760760c97688e87","amount":0.00318512,"confirmationsFromCache":false}, ["020483ebb834d91d494a3b649cf0e8f5c9c4fcec5f194ab94341cc99bb440007f2", "0271ebaeef1c2bf0c1a4772d1391eab03e4d96a6e9b48551ab4e4b0d2983eb452b", "03a659828aabe443e2dedabb1db5a22335c5ace5b5b7126998a288d63c99516dd8"], 2 + ], + "from", [ + {"address":"3BazTqvkvEBcWk7J4sbgRnxUw6rjYrogf9","txid":"dc2e197ab72f71912c39bc23a42d823a3aa8d469fe65eb591c086e60d14c64a0","vout":0,"ts":1418878014,"scriptPubKey":"a9146c8d8b04c6a1e664b1ec20ec932760760c97688e87","amount":0.00300299,"confirmationsFromCache":false}, ["020483ebb834d91d494a3b649cf0e8f5c9c4fcec5f194ab94341cc99bb440007f2", "0271ebaeef1c2bf0c1a4772d1391eab03e4d96a6e9b48551ab4e4b0d2983eb452b", "03a659828aabe443e2dedabb1db5a22335c5ace5b5b7126998a288d63c99516dd8"], 2], + "to", ["38nw4sTs3fCH1YiBjYeQAX1t9eWMxpek8Z", 150000], + "to", ["38nw4sTs3fCH1YiBjYeQAX1t9eWMxpek8Z", 160000], + "change", ["3BazTqvkvEBcWk7J4sbgRnxUw6rjYrogf9"], + "sign", ["L2U9m5My3cdyN5qX1PH4B7XstGDZFWwyukdX8gj8vsJ3fkrqArQo"], + "sign", ["L4jFVcDaqZCkknP5KQWjCBgiLFxKxRxywNGTucm3jC3ozByZcbZv"], + "serialize", "010000000220c24f763536edb05ce8df2a4816d971be4f20b58451d71589db434aca98bfaf00000000fdfd0000473044022024b955f8bf6aaf0741da011e3214eaec7040cd12694303471cefc6ba0cc4ec290220124738015033a465636dec1524a6f956a229e69d31aef6c7a98b2a291f3cfc6701483045022100e6ae6c43240e8a11a6de2d034501c2a366c0ccdf069c7828de0791f05e68e787022028b80bd36c2b2ae63fe7afb491da6c0ce23fbbb982450962c817b20f0bb24075014c695221020483ebb834d91d494a3b649cf0e8f5c9c4fcec5f194ab94341cc99bb440007f2210271ebaeef1c2bf0c1a4772d1391eab03e4d96a6e9b48551ab4e4b0d2983eb452b2103a659828aabe443e2dedabb1db5a22335c5ace5b5b7126998a288d63c99516dd853aeffffffffa0644cd1606e081c59eb65fe69d4a83a3a822da423bc392c91712fb77a192edc00000000fc00483045022100ae7f136cf906dc37d34d5035b8d2001c6a783773b74507ba83080e73e903623f0220023baf7738395268f7097e5586130f682b911fd49b83b265f8fa481f2a6b1ee90146304302201d60f512a8b37663d85c123933053e0354f13d89daf699ca600defa03d4a1dab021f41042b6e4ba30311fc3a68c228c3725f3b0f05a4453ef19408e6a4ae30a2b0014c695221020483ebb834d91d494a3b649cf0e8f5c9c4fcec5f194ab94341cc99bb440007f2210271ebaeef1c2bf0c1a4772d1391eab03e4d96a6e9b48551ab4e4b0d2983eb452b2103a659828aabe443e2dedabb1db5a22335c5ace5b5b7126998a288d63c99516dd853aeffffffff03f04902000000000017a9144de752833233fe69a20064f29b2ca0f6399c8af387007102000000000017a9144de752833233fe69a20064f29b2ca0f6399c8af387ab2f03000000000017a9146c8d8b04c6a1e664b1ec20ec932760760c97688e8700000000" + ] +] diff --git a/packages/kauri-bitcore-lib/test/docs.js b/packages/kauri-bitcore-lib/test/docs.js new file mode 100644 index 0000000..5ef532f --- /dev/null +++ b/packages/kauri-bitcore-lib/test/docs.js @@ -0,0 +1,17 @@ +'use strict'; + +var chai = require('chai'); +var should = chai.should(); + +var bitcore = require('..'); +var fs = require('fs'); + +describe('Documentation', function() { + + it('major and minor versions should match', function() { + var versionRE = /v[0-9]+\.[0-9]+/; + var docIndex = fs.readFileSync('./docs/index.md', 'ascii'); + var docVersion = docIndex.match(versionRE)[0]; + bitcore.version.indexOf(docVersion).should.equal(0); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/encoding/base58.js b/packages/kauri-bitcore-lib/test/encoding/base58.js new file mode 100644 index 0000000..fc0a7e8 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/encoding/base58.js @@ -0,0 +1,123 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../..'); +var buffer = require('buffer'); +var Base58 = bitcore.encoding.Base58; + +describe('Base58', function() { + var buf = new buffer.Buffer([0, 1, 2, 3, 253, 254, 255]); + var enc = '1W7N4RuG'; + + it('should make an instance with "new"', function() { + var b58 = new Base58(); + should.exist(b58); + }); + + it('validates characters with no false negatives', function() { + Base58.validCharacters( + '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' + ).should.equal(true); + }); + it('validates characters from buffer', function() { + Base58.validCharacters( + new buffer.Buffer('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz') + ).should.equal(true); + }); + + it('some characters are invalid (no false positives)', function() { + Base58.validCharacters('!@#%^$&*()\\').should.equal(false); + }); + + it('should make an instance without "new"', function() { + var b58 = Base58(); + should.exist(b58); + }); + + it('should allow this handy syntax', function() { + Base58(buf).toString().should.equal(enc); + Base58(enc).toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + describe('#set', function() { + + it('should set a blank buffer', function() { + Base58().set({ + buf: new buffer.Buffer([]) + }); + }); + + }); + + describe('@encode', function() { + + it('should encode the buffer accurately', function() { + Base58.encode(buf).should.equal(enc); + }); + + it('should throw an error when the Input is not a buffer', function() { + (function() { + Base58.encode('string'); + }).should.throw('Input should be a buffer'); + }); + + }); + + describe('@decode', function() { + + it('should decode this encoded value correctly', function() { + Base58.decode(enc).toString('hex').should.equal(buf.toString('hex')); + }); + + it('should throw an error when Input is not a string', function() { + (function() { + Base58.decode(5); + }).should.throw('Input should be a string'); + }); + + }); + + describe('#fromBuffer', function() { + + it('should not fail', function() { + should.exist(Base58().fromBuffer(buf)); + }); + + it('should set buffer', function() { + var b58 = Base58().fromBuffer(buf); + b58.buf.toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#fromString', function() { + + it('should convert this known string to a buffer', function() { + Base58().fromString(enc).toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#toBuffer', function() { + + it('should return the buffer', function() { + var b58 = Base58({ + buf: buf + }); + b58.buf.toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#toString', function() { + + it('should return the buffer', function() { + var b58 = Base58({ + buf: buf + }); + b58.toString().should.equal(enc); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/encoding/base58check.js b/packages/kauri-bitcore-lib/test/encoding/base58check.js new file mode 100644 index 0000000..c2cc622 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/encoding/base58check.js @@ -0,0 +1,124 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../..'); +var Base58Check = bitcore.encoding.Base58Check; +var Base58 = bitcore.encoding.Base58; + +describe('Base58Check', function() { + var buf = new Buffer([0, 1, 2, 3, 253, 254, 255]); + var enc = '14HV44ipwoaqfg'; + + it('should make an instance with "new"', function() { + var b58 = new Base58Check(); + should.exist(b58); + }); + + it('can validate a serialized string', function() { + var address = '3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy'; + Base58Check.validChecksum(address).should.equal(true); + address = address + 'a'; + Base58Check.validChecksum(address).should.equal(false); + }); + + it('should make an instance without "new"', function() { + var b58 = Base58Check(); + should.exist(b58); + }); + + it('should allow this handy syntax', function() { + Base58Check(buf).toString().should.equal(enc); + Base58Check(enc).toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + describe('#set', function() { + + it('should set a buf', function() { + should.exist(Base58Check().set({buf: buf}).buf); + }); + + }); + + describe('@encode', function() { + + it('should encode the buffer accurately', function() { + Base58Check.encode(buf).should.equal(enc); + }); + + it('should throw an error when the input is not a buffer', function() { + (function() { + Base58Check.encode('string'); + }).should.throw('Input must be a buffer'); + }); + + }); + + describe('@decode', function() { + + it('should decode this encoded value correctly', function() { + Base58Check.decode(enc).toString('hex').should.equal(buf.toString('hex')); + }); + + it('should throw an error when input is not a string', function() { + (function() { + Base58Check.decode(5); + }).should.throw('Input must be a string'); + }); + + it('should throw an error when input is too short', function() { + (function() { + Base58Check.decode(enc.slice(0, 1)); + }).should.throw('Input string too short'); + }); + + it('should throw an error when there is a checksum mismatch', function() { + var buf2 = Base58.decode(enc); + buf2[0] = buf2[0] + 1; + var enc2 = Base58.encode(buf2); + (function() { + Base58Check.decode(enc2); + }).should.throw('Checksum mismatch'); + }); + + }); + + describe('#fromBuffer', function() { + + it('should not fail', function() { + should.exist(Base58Check().fromBuffer(buf)); + }); + + it('should set buffer', function() { + var b58 = Base58Check().fromBuffer(buf); + b58.buf.toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#fromString', function() { + + it('should convert this known string to a buffer', function() { + Base58Check().fromString(enc).toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#toBuffer', function() { + + it('should return the buffer', function() { + var b58 = Base58Check({buf: buf}); + b58.buf.toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#toString', function() { + + it('should return the buffer', function() { + var b58 = Base58Check({buf: buf}); + b58.toString().should.equal(enc); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/encoding/bufferreader.js b/packages/kauri-bitcore-lib/test/encoding/bufferreader.js new file mode 100644 index 0000000..78e4c76 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/encoding/bufferreader.js @@ -0,0 +1,360 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../..'); +var BufferWriter = bitcore.encoding.BufferWriter; +var BufferReader = bitcore.encoding.BufferReader; +var BN = bitcore.crypto.BN; + +describe('BufferReader', function() { + + it('should make a new BufferReader', function() { + var br = new BufferReader(); + should.exist(br); + br = BufferReader(); + should.exist(br); + }); + + it('should create a new bufferreader with a buffer', function() { + var buf = new Buffer(0); + var br = new BufferReader(buf); + should.exist(br); + Buffer.isBuffer(br.buf).should.equal(true); + }); + it('should fail for invalid object', function() { + var fail = function() { + return new BufferReader(5); + }; + fail.should.throw('Unrecognized argument for BufferReader'); + }); + + describe('#set', function() { + + it('should set pos', function() { + should.exist(BufferReader().set({ + pos: 1 + }).pos); + }); + + }); + + describe('#eof', function() { + + it('should return true for a blank br', function() { + var br = new BufferReader(new Buffer([])); + br.finished().should.equal(true); + }); + + }); + + describe('read', function() { + + it('should return the same buffer', function() { + var buf = new Buffer([0]); + var br = new BufferReader(buf); + br.readAll().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should return a buffer of this length', function() { + var buf = new Buffer(10); + buf.fill(0); + var br = new BufferReader(buf); + var buf2 = br.read(2); + buf2.length.should.equal(2); + br.finished().should.equal(false); + br.pos.should.equal(2); + }); + + it('should work with 0 length', function() { + var buf = new Buffer(10); + buf.fill(1); + var br = new BufferReader(buf); + var buf2 = br.read(0); + buf2.length.should.equal(0); + br.finished().should.equal(false); + buf2.toString('hex').should.equal(''); + }); + + }); + + describe('readVarLengthBuffer', function() { + + it('returns correct buffer', function() { + var buf = new Buffer('73010000003766404f00000000b305434f00000000f203' + + '0000f1030000001027000048ee00000064000000004653656520626974636f696' + + 'e2e6f72672f666562323020696620796f7520686176652074726f75626c652063' + + '6f6e6e656374696e6720616674657220323020466562727561727900473045022' + + '1008389df45f0703f39ec8c1cc42c13810ffcae14995bb648340219e353b63b53' + + 'eb022009ec65e1c1aaeec1fd334c6b684bde2b3f573060d5b70c3a46723326e4e' + + '8a4f1', 'hex'); + var br = new BufferReader(buf); + var b1 = br.readVarLengthBuffer(); + b1.toString('hex').should.equal('010000003766404f00000000b305434f000' + + '00000f2030000f1030000001027000048ee000000640000000046536565206269' + + '74636f696e2e6f72672f666562323020696620796f7520686176652074726f756' + + '26c6520636f6e6e656374696e6720616674657220323020466562727561727900'); + var b2 = br.readVarLengthBuffer(); + b2.toString('hex').should.equal('30450221008389df45f0703f39ec8c1cc42' + + 'c13810ffcae14995bb648340219e353b63b53eb022009ec65e1c1aaeec1fd334c' + + '6b684bde2b3f573060d5b70c3a46723326e4e8a4f1'); + }); + it('fails on length too big', function() { + var buf = new Buffer('0a00', 'hex'); + var br = new BufferReader(buf); + br.readVarLengthBuffer.bind(br).should.throw('Invalid length while reading varlength buffer'); + }); + + }); + + describe('#readUInt8', function() { + + it('should return 1', function() { + var buf = new Buffer(1); + buf.writeUInt8(1, 0); + var br = new BufferReader(buf); + br.readUInt8().should.equal(1); + }); + + }); + + describe('#readUInt16BE', function() { + + it('should return 1', function() { + var buf = new Buffer(2); + buf.writeUInt16BE(1, 0); + var br = new BufferReader(buf); + br.readUInt16BE().should.equal(1); + }); + + }); + + describe('#readUInt16LE', function() { + + it('should return 1', function() { + var buf = new Buffer(2); + buf.writeUInt16LE(1, 0); + var br = new BufferReader(buf); + br.readUInt16LE().should.equal(1); + }); + + }); + + describe('#readUInt32BE', function() { + + it('should return 1', function() { + var buf = new Buffer(4); + buf.writeUInt32BE(1, 0); + var br = new BufferReader(buf); + br.readUInt32BE().should.equal(1); + }); + + }); + + describe('#readUInt32LE', function() { + + it('should return 1', function() { + var buf = new Buffer(4); + buf.writeUInt32LE(1, 0); + var br = new BufferReader(buf); + br.readUInt32LE().should.equal(1); + }); + + }); + + describe('#readUInt64BEBN', function() { + + it('should return 1', function() { + var buf = new Buffer(8); + buf.fill(0); + buf.writeUInt32BE(1, 4); + var br = new BufferReader(buf); + br.readUInt64BEBN().toNumber().should.equal(1); + }); + + it('should return 2^64', function() { + var buf = new Buffer(8); + buf.fill(0xff); + var br = new BufferReader(buf); + br.readUInt64BEBN().toNumber().should.equal(Math.pow(2, 64)); + }); + + }); + + describe('#readUInt64LEBN', function() { + + it('should return 1', function() { + var buf = new Buffer(8); + buf.fill(0); + buf.writeUInt32LE(1, 0); + var br = new BufferReader(buf); + br.readUInt64LEBN().toNumber().should.equal(1); + }); + + it('should return 10BTC', function() { + var tenbtc = 10 * 1e8; + var tenbtcBuffer = new Buffer('00ca9a3b00000000', 'hex'); + var br = new BufferReader(tenbtcBuffer); + br.readUInt64LEBN().toNumber().should.equal(tenbtc); + }); + + it('should return 2^30', function() { + var buf = new Buffer(8); + buf.fill(0); + buf.writeUInt32LE(Math.pow(2, 30), 0); + var br = new BufferReader(buf); + br.readUInt64LEBN().toNumber().should.equal(Math.pow(2, 30)); + }); + + it('should return 2^32 + 1', function() { + var num = Math.pow(2, 32) + 1; + var numBuffer = new Buffer('0100000001000000', 'hex'); + var br = new BufferReader(numBuffer); + br.readUInt64LEBN().toNumber().should.equal(num); + }); + + it('should return max number of satoshis', function() { + var maxSatoshis = 21000000 * 1e8; + var maxSatoshisBuffer = new Buffer('0040075af0750700', 'hex'); + var br = new BufferReader(maxSatoshisBuffer); + br.readUInt64LEBN().toNumber().should.equal(maxSatoshis); + }); + + it('should return 2^53 - 1', function() { + var maxSafe = Math.pow(2, 53) - 1; + var maxSafeBuffer = new Buffer('ffffffffffff1f00', 'hex'); + var br = new BufferReader(maxSafeBuffer); + br.readUInt64LEBN().toNumber().should.equal(maxSafe); + }); + + it('should return 2^53', function() { + var bn = new BN('20000000000000', 16); + var bnBuffer = new Buffer('0000000000002000', 'hex'); + var br = new BufferReader(bnBuffer); + var readbn = br.readUInt64LEBN(); + readbn.cmp(bn).should.equal(0); + }); + + it('should return 0', function() { + var buf = new Buffer(8); + buf.fill(0); + var br = new BufferReader(buf); + br.readUInt64LEBN().toNumber().should.equal(0); + }); + + it('should return 2^64', function() { + var buf = new Buffer(8); + buf.fill(0xff); + var br = new BufferReader(buf); + br.readUInt64LEBN().toNumber().should.equal(Math.pow(2, 64)); + }); + + }); + + describe('#readVarintBuf', function() { + + it('should read a 1 byte varint', function() { + var buf = new Buffer([50]); + var br = new BufferReader(buf); + br.readVarintBuf().length.should.equal(1); + }); + + it('should read a 3 byte varint', function() { + var buf = new Buffer([253, 253, 0]); + var br = new BufferReader(buf); + br.readVarintBuf().length.should.equal(3); + }); + + it('should read a 5 byte varint', function() { + var buf = new Buffer([254, 0, 0, 0, 0]); + buf.writeUInt32LE(50000, 1); + var br = new BufferReader(buf); + br.readVarintBuf().length.should.equal(5); + }); + + it('should read a 9 byte varint', function() { + var buf = BufferWriter().writeVarintBN(new BN(Math.pow(2, 54).toString())).concat(); + var br = new BufferReader(buf); + br.readVarintBuf().length.should.equal(9); + }); + + }); + + describe('#readVarintNum', function() { + + it('should read a 1 byte varint', function() { + var buf = new Buffer([50]); + var br = new BufferReader(buf); + br.readVarintNum().should.equal(50); + }); + + it('should read a 3 byte varint', function() { + var buf = new Buffer([253, 253, 0]); + var br = new BufferReader(buf); + br.readVarintNum().should.equal(253); + }); + + it('should read a 5 byte varint', function() { + var buf = new Buffer([254, 0, 0, 0, 0]); + buf.writeUInt32LE(50000, 1); + var br = new BufferReader(buf); + br.readVarintNum().should.equal(50000); + }); + + it('should throw an error on a 9 byte varint over the javascript uint precision limit', function() { + var buf = BufferWriter().writeVarintBN(new BN(Math.pow(2, 54).toString())).concat(); + var br = new BufferReader(buf); + (function() { + br.readVarintNum(); + }).should.throw('number too large to retain precision - use readVarintBN'); + }); + + it('should not throw an error on a 9 byte varint not over the javascript uint precision limit', function() { + var buf = BufferWriter().writeVarintBN(new BN(Math.pow(2, 53).toString())).concat(); + var br = new BufferReader(buf); + (function() { + br.readVarintNum(); + }).should.not.throw('number too large to retain precision - use readVarintBN'); + }); + + }); + + describe('#readVarintBN', function() { + + it('should read a 1 byte varint', function() { + var buf = new Buffer([50]); + var br = new BufferReader(buf); + br.readVarintBN().toNumber().should.equal(50); + }); + + it('should read a 3 byte varint', function() { + var buf = new Buffer([253, 253, 0]); + var br = new BufferReader(buf); + br.readVarintBN().toNumber().should.equal(253); + }); + + it('should read a 5 byte varint', function() { + var buf = new Buffer([254, 0, 0, 0, 0]); + buf.writeUInt32LE(50000, 1); + var br = new BufferReader(buf); + br.readVarintBN().toNumber().should.equal(50000); + }); + + it('should read a 9 byte varint', function() { + var buf = Buffer.concat([new Buffer([255]), new Buffer('ffffffffffffffff', 'hex')]); + var br = new BufferReader(buf); + br.readVarintBN().toNumber().should.equal(Math.pow(2, 64)); + }); + + }); + + describe('#reverse', function() { + + it('should reverse this [0, 1]', function() { + var buf = new Buffer([0, 1]); + var br = new BufferReader(buf); + br.reverse().readAll().toString('hex').should.equal('0100'); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/encoding/bufferwriter.js b/packages/kauri-bitcore-lib/test/encoding/bufferwriter.js new file mode 100644 index 0000000..85ed3c1 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/encoding/bufferwriter.js @@ -0,0 +1,188 @@ +'use strict'; + +var bitcore = require('../..'); +var should = require('chai').should(); +var BufferWriter = bitcore.encoding.BufferWriter; +var BufferReader = bitcore.encoding.BufferReader; +var BN = bitcore.crypto.BN; + +describe('BufferWriter', function() { + + it('should create a new buffer writer', function() { + var bw = new BufferWriter(); + should.exist(bw); + }); + + describe('#set', function() { + + it('set bufs', function() { + var buf1 = new Buffer([0]); + var buf2 = new Buffer([1]); + var bw = new BufferWriter().set({bufs: [buf1, buf2]}); + bw.concat().toString('hex').should.equal('0001'); + }); + + }); + + describe('#toBuffer', function() { + + it('should concat these two bufs', function() { + var buf1 = new Buffer([0]); + var buf2 = new Buffer([1]); + var bw = new BufferWriter({bufs: [buf1, buf2]}); + bw.toBuffer().toString('hex').should.equal('0001'); + }); + + }); + + describe('#concat', function() { + + it('should concat these two bufs', function() { + var buf1 = new Buffer([0]); + var buf2 = new Buffer([1]); + var bw = new BufferWriter({bufs: [buf1, buf2]}); + bw.concat().toString('hex').should.equal('0001'); + }); + + }); + + describe('#write', function() { + + it('should write a buffer', function() { + var buf = new Buffer([0]); + var bw = new BufferWriter(); + bw.write(buf); + bw.concat().toString('hex').should.equal('00'); + }); + + }); + + describe('#writeUInt8', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt8(1).concat().toString('hex').should.equal('01'); + }); + + }); + + describe('#writeUInt16BE', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt16BE(1).concat().toString('hex').should.equal('0001'); + }); + + }); + + describe('#writeUInt16LE', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt16LE(1).concat().toString('hex').should.equal('0100'); + }); + + }); + + describe('#writeUInt32BE', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt32BE(1).concat().toString('hex').should.equal('00000001'); + }); + + }); + + describe('#writeUInt32LE', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt32LE(1).concat().toString('hex').should.equal('01000000'); + }); + + }); + + describe('#writeUInt64BEBN', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt64BEBN(new BN(1)).concat().toString('hex').should.equal('0000000000000001'); + }); + + }); + + describe('#writeUInt64LEBN', function() { + + it('should write 1', function() { + var bw = new BufferWriter(); + bw.writeUInt64LEBN(new BN(1)).concat().toString('hex').should.equal('0100000000000000'); + }); + + }); + + describe('#writeVarint', function() { + + it('should write a 1 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintNum(1); + bw.concat().length.should.equal(1); + }); + + it('should write a 3 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintNum(1000); + bw.concat().length.should.equal(3); + }); + + it('should write a 5 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintNum(Math.pow(2, 16 + 1)); + bw.concat().length.should.equal(5); + }); + + it('should write a 9 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintNum(Math.pow(2, 32 + 1)); + bw.concat().length.should.equal(9); + }); + + it('should read back the same value it wrote for a 9 byte varint', function() { + var bw = new BufferWriter(); + var n = Math.pow(2, 53); + n.should.equal(n + 1); //javascript number precision limit + bw.writeVarintNum(n); + var br = new BufferReader({buf: bw.concat()}); + br.readVarintBN().toNumber().should.equal(n); + }); + + }); + + describe('#writeVarintBN', function() { + + it('should write a 1 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintBN(new BN(1)); + bw.concat().length.should.equal(1); + }); + + it('should write a 3 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintBN(new BN(1000)); + bw.concat().length.should.equal(3); + }); + + it('should write a 5 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintBN(new BN(Math.pow(2, 16 + 1))); + bw.concat().length.should.equal(5); + }); + + it('should write a 9 byte varint', function() { + var bw = new BufferWriter(); + bw.writeVarintBN(new BN(Math.pow(2, 32 + 1))); + bw.concat().length.should.equal(9); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/encoding/varint.js b/packages/kauri-bitcore-lib/test/encoding/varint.js new file mode 100644 index 0000000..47e722c --- /dev/null +++ b/packages/kauri-bitcore-lib/test/encoding/varint.js @@ -0,0 +1,126 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../..'); +var BN = bitcore.crypto.BN; +var BufferReader = bitcore.encoding.BufferReader; +var BufferWriter = bitcore.encoding.BufferWriter; +var Varint = bitcore.encoding.Varint; + +describe('Varint', function() { + + it('should make a new varint', function() { + var buf = new Buffer('00', 'hex'); + var varint = new Varint(buf); + should.exist(varint); + varint.buf.toString('hex').should.equal('00'); + varint = Varint(buf); + should.exist(varint); + varint.buf.toString('hex').should.equal('00'); + + //various ways to use the constructor + Varint(Varint(0).toBuffer()).toNumber().should.equal(0); + Varint(0).toNumber().should.equal(0); + Varint(new BN(0)).toNumber().should.equal(0); + }); + + describe('#set', function() { + + it('should set a buffer', function() { + var buf = new Buffer('00', 'hex'); + var varint = Varint().set({buf: buf}); + varint.buf.toString('hex').should.equal('00'); + varint.set({}); + varint.buf.toString('hex').should.equal('00'); + }); + + }); + + describe('#fromString', function() { + + it('should set a buffer', function() { + var buf = BufferWriter().writeVarintNum(5).concat(); + var varint = Varint().fromString(buf.toString('hex')); + varint.toNumber().should.equal(5); + }); + + }); + + describe('#toString', function() { + + it('should return a buffer', function() { + var buf = BufferWriter().writeVarintNum(5).concat(); + var varint = Varint().fromString(buf.toString('hex')); + varint.toString().should.equal('05'); + }); + + }); + + describe('#fromBuffer', function() { + + it('should set a buffer', function() { + var buf = BufferWriter().writeVarintNum(5).concat(); + var varint = Varint().fromBuffer(buf); + varint.toNumber().should.equal(5); + }); + + }); + + describe('#fromBufferReader', function() { + + it('should set a buffer reader', function() { + var buf = BufferWriter().writeVarintNum(5).concat(); + var br = BufferReader(buf); + var varint = Varint().fromBufferReader(br); + varint.toNumber().should.equal(5); + }); + + }); + + describe('#fromBN', function() { + + it('should set a number', function() { + var varint = Varint().fromBN(new BN(5)); + varint.toNumber().should.equal(5); + }); + + }); + + describe('#fromNumber', function() { + + it('should set a number', function() { + var varint = Varint().fromNumber(5); + varint.toNumber().should.equal(5); + }); + + }); + + describe('#toBuffer', function() { + + it('should return a buffer', function() { + var buf = BufferWriter().writeVarintNum(5).concat(); + var varint = Varint(buf); + varint.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#toBN', function() { + + it('should return a buffer', function() { + var varint = Varint(5); + varint.toBN().toString().should.equal(new BN(5).toString()); + }); + + }); + + describe('#toNumber', function() { + + it('should return a buffer', function() { + var varint = Varint(5); + varint.toNumber().should.equal(5); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/hdkeys.js b/packages/kauri-bitcore-lib/test/hdkeys.js new file mode 100644 index 0000000..ec680d7 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/hdkeys.js @@ -0,0 +1,372 @@ +'use strict'; + +// Relax some linter options: +// * quote marks so "m/0'/1/2'/" doesn't need to be scaped +// * too many tests, maxstatements -> 100 +// * store test vectors at the end, latedef: false +// * should call is never defined +/* jshint quotmark: false */ +/* jshint latedef: false */ +/* jshint maxstatements: 100 */ +/* jshint unused: false */ + +var _ = require('lodash'); +var should = require('chai').should(); +var expect = require('chai').expect; +var sinon = require('sinon'); +var bitcore = require('..'); +var Networks = bitcore.Networks; +var HDPrivateKey = bitcore.HDPrivateKey; +var HDPublicKey = bitcore.HDPublicKey; + +describe('HDKeys building with static methods', function() { + var classes = [HDPublicKey, HDPrivateKey]; + var clazz, index; + + _.each(classes, function(clazz) { + var expectStaticMethodFail = function(staticMethod, argument, message) { + expect(clazz[staticMethod].bind(null, argument)).to.throw(message); + }; + it(clazz.name + ' fromJSON checks that a valid JSON is provided', function() { + var errorMessage = 'Invalid Argument: No valid argument was provided'; + var method = 'fromObject'; + expectStaticMethodFail(method, undefined, errorMessage); + expectStaticMethodFail(method, null, errorMessage); + expectStaticMethodFail(method, 'invalid JSON', errorMessage); + expectStaticMethodFail(method, '{\'singlequotes\': true}', errorMessage); + }); + it(clazz.name + ' fromString checks that a string is provided', function() { + var errorMessage = 'No valid string was provided'; + var method = 'fromString'; + expectStaticMethodFail(method, undefined, errorMessage); + expectStaticMethodFail(method, null, errorMessage); + expectStaticMethodFail(method, {}, errorMessage); + }); + it(clazz.name + ' fromObject checks that an object is provided', function() { + var errorMessage = 'No valid argument was provided'; + var method = 'fromObject'; + expectStaticMethodFail(method, undefined, errorMessage); + expectStaticMethodFail(method, null, errorMessage); + expectStaticMethodFail(method, '', errorMessage); + }); + }); +}); + +describe('BIP32 compliance', function() { + + it('should initialize test vector 1 from the extended public key', function() { + new HDPublicKey(vector1_m_public).xpubkey.should.equal(vector1_m_public); + }); + + it('should initialize test vector 1 from the extended private key', function() { + new HDPrivateKey(vector1_m_private).xprivkey.should.equal(vector1_m_private); + }); + + it('can initialize a public key from an extended private key', function() { + new HDPublicKey(vector1_m_private).xpubkey.should.equal(vector1_m_public); + }); + + it('toString should be equal to the `xpubkey` member', function() { + var privateKey = new HDPrivateKey(vector1_m_private); + privateKey.toString().should.equal(privateKey.xprivkey); + }); + + it('toString should be equal to the `xpubkey` member', function() { + var publicKey = new HDPublicKey(vector1_m_public); + publicKey.toString().should.equal(publicKey.xpubkey); + }); + + it('should get the extended public key from the extended private key for test vector 1', function() { + HDPrivateKey(vector1_m_private).xpubkey.should.equal(vector1_m_public); + }); + + it("should get m/0' ext. private key from test vector 1", function() { + var privateKey = new HDPrivateKey(vector1_m_private).derive("m/0'"); + privateKey.xprivkey.should.equal(vector1_m0h_private); + }); + + it("should get m/0' ext. public key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'") + .xpubkey.should.equal(vector1_m0h_public); + }); + + it("should get m/0'/1 ext. private key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1") + .xprivkey.should.equal(vector1_m0h1_private); + }); + + it("should get m/0'/1 ext. public key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1") + .xpubkey.should.equal(vector1_m0h1_public); + }); + + it("should get m/0'/1 ext. public key from m/0' public key from test vector 1", function() { + var derivedPublic = HDPrivateKey(vector1_m_private).derive("m/0'").hdPublicKey.derive("m/1"); + derivedPublic.xpubkey.should.equal(vector1_m0h1_public); + }); + + it("should get m/0'/1/2' ext. private key from test vector 1", function() { + var privateKey = new HDPrivateKey(vector1_m_private); + var derived = privateKey.derive("m/0'/1/2'"); + derived.xprivkey.should.equal(vector1_m0h12h_private); + }); + + it("should get m/0'/1/2' ext. public key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1/2'") + .xpubkey.should.equal(vector1_m0h12h_public); + }); + + it("should get m/0'/1/2'/2 ext. private key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1/2'/2") + .xprivkey.should.equal(vector1_m0h12h2_private); + }); + + it("should get m/0'/1/2'/2 ext. public key from m/0'/1/2' public key from test vector 1", function() { + var derived = HDPrivateKey(vector1_m_private).derive("m/0'/1/2'").hdPublicKey; + derived.derive("m/2").xpubkey.should.equal(vector1_m0h12h2_public); + }); + + it("should get m/0'/1/2h/2 ext. public key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1/2'/2") + .xpubkey.should.equal(vector1_m0h12h2_public); + }); + + it("should get m/0'/1/2h/2/1000000000 ext. private key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1/2'/2/1000000000") + .xprivkey.should.equal(vector1_m0h12h21000000000_private); + }); + + it("should get m/0'/1/2h/2/1000000000 ext. public key from test vector 1", function() { + HDPrivateKey(vector1_m_private).derive("m/0'/1/2'/2/1000000000") + .xpubkey.should.equal(vector1_m0h12h21000000000_public); + }); + + it("should get m/0'/1/2'/2/1000000000 ext. public key from m/0'/1/2'/2 public key from test vector 1", function() { + var derived = HDPrivateKey(vector1_m_private).derive("m/0'/1/2'/2").hdPublicKey; + derived.derive("m/1000000000").xpubkey.should.equal(vector1_m0h12h21000000000_public); + }); + + it('should initialize test vector 2 from the extended public key', function() { + HDPublicKey(vector2_m_public).xpubkey.should.equal(vector2_m_public); + }); + + it('should initialize test vector 2 from the extended private key', function() { + HDPrivateKey(vector2_m_private).xprivkey.should.equal(vector2_m_private); + }); + + it('should get the extended public key from the extended private key for test vector 2', function() { + HDPrivateKey(vector2_m_private).xpubkey.should.equal(vector2_m_public); + }); + + it("should get m/0 ext. private key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive(0).xprivkey.should.equal(vector2_m0_private); + }); + + it("should get m/0 ext. public key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive(0).xpubkey.should.equal(vector2_m0_public); + }); + + it("should get m/0 ext. public key from m public key from test vector 2", function() { + HDPrivateKey(vector2_m_private).hdPublicKey.derive(0).xpubkey.should.equal(vector2_m0_public); + }); + + it("should get m/0/2147483647h ext. private key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'") + .xprivkey.should.equal(vector2_m02147483647h_private); + }); + + it("should get m/0/2147483647h ext. public key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'") + .xpubkey.should.equal(vector2_m02147483647h_public); + }); + + it("should get m/0/2147483647h/1 ext. private key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'/1") + .xprivkey.should.equal(vector2_m02147483647h1_private); + }); + + it("should get m/0/2147483647h/1 ext. public key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'/1") + .xpubkey.should.equal(vector2_m02147483647h1_public); + }); + + it("should get m/0/2147483647h/1 ext. public key from m/0/2147483647h public key from test vector 2", function() { + var derived = HDPrivateKey(vector2_m_private).derive("m/0/2147483647'").hdPublicKey; + derived.derive(1).xpubkey.should.equal(vector2_m02147483647h1_public); + }); + + it("should get m/0/2147483647h/1/2147483646h ext. private key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'/1/2147483646'") + .xprivkey.should.equal(vector2_m02147483647h12147483646h_private); + }); + + it("should get m/0/2147483647h/1/2147483646h ext. public key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'/1/2147483646'") + .xpubkey.should.equal(vector2_m02147483647h12147483646h_public); + }); + + it("should get m/0/2147483647h/1/2147483646h/2 ext. private key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'/1/2147483646'/2") + .xprivkey.should.equal(vector2_m02147483647h12147483646h2_private); + }); + + it("should get m/0/2147483647h/1/2147483646h/2 ext. public key from test vector 2", function() { + HDPrivateKey(vector2_m_private).derive("m/0/2147483647'/1/2147483646'/2") + .xpubkey.should.equal(vector2_m02147483647h12147483646h2_public); + }); + + it("should get m/0/2147483647h/1/2147483646h/2 ext. public key from m/0/2147483647h/2147483646h public key from test vector 2", function() { + var derivedPublic = HDPrivateKey(vector2_m_private) + .derive("m/0/2147483647'/1/2147483646'").hdPublicKey; + derivedPublic.derive("m/2") + .xpubkey.should.equal(vector2_m02147483647h12147483646h2_public); + }); + + it('should use full 32 bytes for private key data that is hashed (as per bip32)', function() { + // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki + var privateKeyBuffer = new Buffer('00000055378cf5fafb56c711c674143f9b0ee82ab0ba2924f19b64f5ae7cdbfd', 'hex'); + var chainCodeBuffer = new Buffer('9c8a5c863e5941f3d99453e6ba66b328bb17cf0b8dec89ed4fc5ace397a1c089', 'hex'); + var key = HDPrivateKey.fromObject({ + network: 'testnet', + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + privateKey: privateKeyBuffer, + chainCode: chainCodeBuffer + }); + var derived = key.deriveChild("m/44'/0'/0'/0/0'"); + derived.privateKey.toString().should.equal('3348069561d2a0fb925e74bf198762acc47dce7db27372257d2d959a9e6f8aeb'); + }); + + it('should NOT use full 32 bytes for private key data that is hashed with nonCompliant flag', function() { + // This is to test that the previously implemented non-compliant to BIP32 + var privateKeyBuffer = new Buffer('00000055378cf5fafb56c711c674143f9b0ee82ab0ba2924f19b64f5ae7cdbfd', 'hex'); + var chainCodeBuffer = new Buffer('9c8a5c863e5941f3d99453e6ba66b328bb17cf0b8dec89ed4fc5ace397a1c089', 'hex'); + var key = HDPrivateKey.fromObject({ + network: 'testnet', + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + privateKey: privateKeyBuffer, + chainCode: chainCodeBuffer + }); + var derived = key.deriveNonCompliantChild("m/44'/0'/0'/0/0'"); + derived.privateKey.toString().should.equal('4811a079bab267bfdca855b3bddff20231ff7044e648514fa099158472df2836'); + }); + + it('should NOT use full 32 bytes for private key data that is hashed with the nonCompliant derive method', function() { + // This is to test that the previously implemented non-compliant to BIP32 + var privateKeyBuffer = new Buffer('00000055378cf5fafb56c711c674143f9b0ee82ab0ba2924f19b64f5ae7cdbfd', 'hex'); + var chainCodeBuffer = new Buffer('9c8a5c863e5941f3d99453e6ba66b328bb17cf0b8dec89ed4fc5ace397a1c089', 'hex'); + var key = HDPrivateKey.fromObject({ + network: 'testnet', + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + privateKey: privateKeyBuffer, + chainCode: chainCodeBuffer + }); + var derived = key.derive("m/44'/0'/0'/0/0'"); + derived.privateKey.toString().should.equal('4811a079bab267bfdca855b3bddff20231ff7044e648514fa099158472df2836'); + }); + + describe('edge cases', function() { + var sandbox = sinon.sandbox.create(); + afterEach(function() { + sandbox.restore(); + }); + it('will handle edge case that derived private key is invalid', function() { + var invalid = new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'); + var privateKeyBuffer = new Buffer('5f72914c48581fc7ddeb944a9616389200a9560177d24f458258e5b04527bcd1', 'hex'); + var chainCodeBuffer = new Buffer('39816057bba9d952fe87fe998b7fd4d690a1bb58c2ff69141469e4d1dffb4b91', 'hex'); + var unstubbed = bitcore.crypto.BN.prototype.toBuffer; + var count = 0; + var stub = sandbox.stub(bitcore.crypto.BN.prototype, 'toBuffer', function(args) { + // On the fourth call to the function give back an invalid private key + // otherwise use the normal behavior. + count++; + if (count === 4) { + return invalid; + } + var ret = unstubbed.apply(this, arguments); + return ret; + }); + sandbox.spy(bitcore.PrivateKey, 'isValid'); + var key = HDPrivateKey.fromObject({ + network: 'testnet', + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + privateKey: privateKeyBuffer, + chainCode: chainCodeBuffer + }); + var derived = key.derive("m/44'"); + derived.privateKey.toString().should.equal('b15bce3608d607ee3a49069197732c656bca942ee59f3e29b4d56914c1de6825'); + bitcore.PrivateKey.isValid.callCount.should.equal(2); + }); + it('will handle edge case that a derive public key is invalid', function() { + var publicKeyBuffer = new Buffer('029e58b241790284ef56502667b15157b3fc58c567f044ddc35653860f9455d099', 'hex'); + var chainCodeBuffer = new Buffer('39816057bba9d952fe87fe998b7fd4d690a1bb58c2ff69141469e4d1dffb4b91', 'hex'); + var key = new HDPublicKey({ + network: 'testnet', + depth: 0, + parentFingerPrint: 0, + childIndex: 0, + chainCode: chainCodeBuffer, + publicKey: publicKeyBuffer + }); + var unstubbed = bitcore.PublicKey.fromPoint; + bitcore.PublicKey.fromPoint = function() { + bitcore.PublicKey.fromPoint = unstubbed; + throw new Error('Point cannot be equal to Infinity'); + }; + sandbox.spy(key, '_deriveWithNumber'); + var derived = key.derive("m/44"); + key._deriveWithNumber.callCount.should.equal(2); + key.publicKey.toString().should.equal('029e58b241790284ef56502667b15157b3fc58c567f044ddc35653860f9455d099'); + }); + }); + + describe('seed', function() { + + it('should initialize a new BIP32 correctly from test vector 1 seed', function() { + var seededKey = HDPrivateKey.fromSeed(vector1_master, Networks.livenet); + seededKey.xprivkey.should.equal(vector1_m_private); + seededKey.xpubkey.should.equal(vector1_m_public); + }); + + it('should initialize a new BIP32 correctly from test vector 2 seed', function() { + var seededKey = HDPrivateKey.fromSeed(vector2_master, Networks.livenet); + seededKey.xprivkey.should.equal(vector2_m_private); + seededKey.xpubkey.should.equal(vector2_m_public); + }); + }); +}); + +//test vectors: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki +var vector1_master = '000102030405060708090a0b0c0d0e0f'; +var vector1_m_public = 'xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8'; +var vector1_m_private = 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'; +var vector1_m0h_public = 'xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw'; +var vector1_m0h_private = 'xprv9uHRZZhk6KAJC1avXpDAp4MDc3sQKNxDiPvvkX8Br5ngLNv1TxvUxt4cV1rGL5hj6KCesnDYUhd7oWgT11eZG7XnxHrnYeSvkzY7d2bhkJ7'; +var vector1_m0h1_public = 'xpub6ASuArnXKPbfEwhqN6e3mwBcDTgzisQN1wXN9BJcM47sSikHjJf3UFHKkNAWbWMiGj7Wf5uMash7SyYq527Hqck2AxYysAA7xmALppuCkwQ'; +var vector1_m0h1_private = 'xprv9wTYmMFdV23N2TdNG573QoEsfRrWKQgWeibmLntzniatZvR9BmLnvSxqu53Kw1UmYPxLgboyZQaXwTCg8MSY3H2EU4pWcQDnRnrVA1xe8fs'; +var vector1_m0h12h_public = 'xpub6D4BDPcP2GT577Vvch3R8wDkScZWzQzMMUm3PWbmWvVJrZwQY4VUNgqFJPMM3No2dFDFGTsxxpG5uJh7n7epu4trkrX7x7DogT5Uv6fcLW5'; +var vector1_m0h12h_private = 'xprv9z4pot5VBttmtdRTWfWQmoH1taj2axGVzFqSb8C9xaxKymcFzXBDptWmT7FwuEzG3ryjH4ktypQSAewRiNMjANTtpgP4mLTj34bhnZX7UiM'; +var vector1_m0h12h2_public = 'xpub6FHa3pjLCk84BayeJxFW2SP4XRrFd1JYnxeLeU8EqN3vDfZmbqBqaGJAyiLjTAwm6ZLRQUMv1ZACTj37sR62cfN7fe5JnJ7dh8zL4fiyLHV'; +var vector1_m0h12h2_private = 'xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334'; +var vector1_m0h12h21000000000_public = 'xpub6H1LXWLaKsWFhvm6RVpEL9P4KfRZSW7abD2ttkWP3SSQvnyA8FSVqNTEcYFgJS2UaFcxupHiYkro49S8yGasTvXEYBVPamhGW6cFJodrTHy'; +var vector1_m0h12h21000000000_private = 'xprvA41z7zogVVwxVSgdKUHDy1SKmdb533PjDz7J6N6mV6uS3ze1ai8FHa8kmHScGpWmj4WggLyQjgPie1rFSruoUihUZREPSL39UNdE3BBDu76'; +var vector2_master = 'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542'; +var vector2_m_public = 'xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB'; +var vector2_m_private = 'xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U'; +var vector2_m0_public = 'xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH'; +var vector2_m0_private = 'xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt'; +var vector2_m02147483647h_public = 'xpub6ASAVgeehLbnwdqV6UKMHVzgqAG8Gr6riv3Fxxpj8ksbH9ebxaEyBLZ85ySDhKiLDBrQSARLq1uNRts8RuJiHjaDMBU4Zn9h8LZNnBC5y4a'; +var vector2_m02147483647h_private = 'xprv9wSp6B7kry3Vj9m1zSnLvN3xH8RdsPP1Mh7fAaR7aRLcQMKTR2vidYEeEg2mUCTAwCd6vnxVrcjfy2kRgVsFawNzmjuHc2YmYRmagcEPdU9'; +var vector2_m02147483647h1_public = 'xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon'; +var vector2_m02147483647h1_private = 'xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef'; +var vector2_m02147483647h12147483646h_public = 'xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL'; +var vector2_m02147483647h12147483646h_private = 'xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc'; +var vector2_m02147483647h12147483646h2_public = 'xpub6FnCn6nSzZAw5Tw7cgR9bi15UV96gLZhjDstkXXxvCLsUXBGXPdSnLFbdpq8p9HmGsApME5hQTZ3emM2rnY5agb9rXpVGyy3bdW6EEgAtqt'; +var vector2_m02147483647h12147483646h2_private = 'xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j'; diff --git a/packages/kauri-bitcore-lib/test/hdprivatekey.js b/packages/kauri-bitcore-lib/test/hdprivatekey.js new file mode 100644 index 0000000..6b63e62 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/hdprivatekey.js @@ -0,0 +1,311 @@ +'use strict'; +/* jshint unused: false */ +var _ = require('lodash'); +var assert = require('assert'); +var should = require('chai').should(); +var expect = require('chai').expect; +var bitcore = require('..'); +var errors = bitcore.errors; +var hdErrors = errors.HDPrivateKey; +var buffer = require('buffer'); +var Networks = bitcore.Networks; +var BufferUtil = bitcore.util.buffer; +var HDPrivateKey = bitcore.HDPrivateKey; +var Base58Check = bitcore.encoding.Base58Check; + +var xprivkey = 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'; +var json = '{"network":"livenet","depth":0,"fingerPrint":876747070,"parentFingerPrint":0,"childIndex":0,"chainCode":"873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508","privateKey":"e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35","checksum":-411132559,"xprivkey":"xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi"}'; +describe('HDPrivate key interface', function() { + /* jshint maxstatements: 50 */ + var expectFail = function(func, error) { + var got = null; + try { + func(); + } catch (e) { + got = e instanceof error; + } + expect(got).to.equal(true); + }; + + var expectDerivationFail = function(argument, error) { + return expectFail(function() { + var privateKey = new HDPrivateKey(xprivkey); + privateKey.derive(argument); + }, error); + }; + + var expectFailBuilding = function(argument, error) { + return expectFail(function() { + return new HDPrivateKey(argument); + }, error); + }; + + var expectSeedFail = function(argument, error) { + return expectFail(function() { + return HDPrivateKey.fromSeed(argument); + }, error); + }; + + it('should make a new private key from random', function() { + should.exist(new HDPrivateKey().xprivkey); + }); + + it('should make a new private key from random for testnet', function() { + var key = new HDPrivateKey('testnet'); + should.exist(key.xprivkey); + key.network.name.should.equal('testnet'); + }); + + it('should not be able to change read-only properties', function() { + var hdkey = new HDPrivateKey(); + expect(function() { + hdkey.fingerPrint = 'notafingerprint'; + }).to.throw(TypeError); + }); + + it('should error with an invalid checksum', function() { + expectFailBuilding(xprivkey + '1', errors.InvalidB58Checksum); + }); + + it('can be rebuilt from a json generated by itself', function() { + var regenerate = new HDPrivateKey(json); + regenerate.xprivkey.should.equal(xprivkey); + }); + + it('builds a json keeping the structure and same members', function() { + assert(_.isEqual( + new HDPrivateKey(json).toJSON(), + new HDPrivateKey(xprivkey).toJSON() + )); + }); + + describe('instantiation', function() { + it('invalid argument: can not instantiate from a number', function() { + expectFailBuilding(1, hdErrors.UnrecognizedArgument); + }); + it('allows no-new calling', function() { + HDPrivateKey(xprivkey).toString().should.equal(xprivkey); + }); + it('allows the use of a copy constructor', function() { + HDPrivateKey(HDPrivateKey(xprivkey)) + .xprivkey.should.equal(xprivkey); + }); + }); + + describe('public key', function() { + var testnetKey = new HDPrivateKey('tprv8ZgxMBicQKsPdEeU2KiGFnUgRGriMnQxrwrg6FWCBg4jeiidHRyCCdA357kfkZiGaXEapWZsGDKikeeEbvgXo3UmEdbEKNdQH9VXESmGuUK'); + var livenetKey = new HDPrivateKey('xprv9s21ZrQH143K3e39bnn1vyS7YFa1EAJAFGDoeHaSBsgBxgAkTEXeSx7xLvhNQNJxJwhzziWcK3znUFKRPRwWBPkKZ8ijUBa5YYpYPQmeBDX'); + + it('matches the network', function() { + testnetKey.publicKey.network.should.equal(Networks.testnet); + livenetKey.publicKey.network.should.equal(Networks.livenet); + }); + + it('cache for xpubkey works', function() { + var privateKey = new HDPrivateKey(xprivkey); + should.not.exist(privateKey._hdPublicKey); + privateKey.xpubkey.should.equal(privateKey.xpubkey); + should.exist(privateKey._hdPublicKey); + }); + + }); + + it('inspect() displays correctly', function() { + HDPrivateKey(xprivkey).inspect().should.equal(''); + }); + it('fails when trying to derive with an invalid argument', function() { + expectDerivationFail([], hdErrors.InvalidDerivationArgument); + }); + + it('catches early invalid paths', function() { + expectDerivationFail('s', hdErrors.InvalidPath); + }); + + it('allows derivation of hardened keys by passing a very big number', function() { + var privateKey = new HDPrivateKey(xprivkey); + var derivedByNumber = privateKey.derive(0x80000000); + var derivedByArgument = privateKey.derive(0, true); + derivedByNumber.xprivkey.should.equal(derivedByArgument.xprivkey); + }); + + it('returns itself with \'m\' parameter', function() { + var privateKey = new HDPrivateKey(xprivkey); + privateKey.should.equal(privateKey.derive('m')); + }); + + it('returns InvalidArgument if invalid data is given to getSerializedError', function() { + expect( + HDPrivateKey.getSerializedError(1) instanceof hdErrors.UnrecognizedArgument + ).to.equal(true); + }); + + it('returns InvalidLength if data of invalid length is given to getSerializedError', function() { + var b58s = Base58Check.encode(new buffer.Buffer('onestring')); + expect( + HDPrivateKey.getSerializedError(b58s) instanceof hdErrors.InvalidLength + ).to.equal(true); + }); + + it('returns InvalidNetworkArgument if an invalid network is provided', function() { + expect( + HDPrivateKey.getSerializedError(xprivkey, 'invalidNetwork') instanceof errors.InvalidNetworkArgument + ).to.equal(true); + }); + + it('recognizes that the wrong network was asked for', function() { + expect( + HDPrivateKey.getSerializedError(xprivkey, 'testnet') instanceof errors.InvalidNetwork + ).to.equal(true); + }); + + it('recognizes the correct network', function() { + expect(HDPrivateKey.getSerializedError(xprivkey, 'livenet')).to.equal(null); + }); + + describe('on creation from seed', function() { + it('converts correctly from an hexa string', function() { + should.exist(HDPrivateKey.fromSeed('01234567890abcdef01234567890abcdef').xprivkey); + }); + it('fails when argument is not a buffer or string', function() { + expectSeedFail(1, hdErrors.InvalidEntropyArgument); + }); + it('fails when argument doesn\'t provide enough entropy', function() { + expectSeedFail('01', hdErrors.InvalidEntropyArgument.NotEnoughEntropy); + }); + it('fails when argument provides too much entropy', function() { + var entropy = '0'; + for (var i = 0; i < 129; i++) { + entropy += '1'; + } + expectSeedFail(entropy, hdErrors.InvalidEntropyArgument.TooMuchEntropy); + }); + }); + + it('correctly errors if an invalid checksum is provided', function() { + var privKey = new HDPrivateKey(xprivkey); + var error = null; + try { + var buffers = privKey._buffers; + buffers.checksum = BufferUtil.integerAsBuffer(0); + var privateKey = new HDPrivateKey(buffers); + } catch (e) { + error = e; + } + expect(error instanceof errors.InvalidB58Checksum).to.equal(true); + }); + it('correctly validates the checksum', function() { + var privKey = new HDPrivateKey(xprivkey); + expect(function() { + var buffers = privKey._buffers; + return new HDPrivateKey(buffers); + }).to.not.throw(); + }); + + it('shouldn\'t matter if derivations are made with strings or numbers', function() { + var privateKey = new HDPrivateKey(xprivkey); + var derivedByString = privateKey.derive('m/0\'/1/2\''); + var derivedByNumber = privateKey.derive(0, true).derive(1).derive(2, true); + derivedByNumber.xprivkey.should.equal(derivedByString.xprivkey); + }); + + describe('validates paths', function() { + it('validates correct paths', function() { + var valid; + + valid = HDPrivateKey.isValidPath('m/0\'/1/2\''); + valid.should.equal(true); + + valid = HDPrivateKey.isValidPath('m'); + valid.should.equal(true); + + valid = HDPrivateKey.isValidPath(123, true); + valid.should.equal(true); + + valid = HDPrivateKey.isValidPath(123); + valid.should.equal(true); + + valid = HDPrivateKey.isValidPath(HDPrivateKey.Hardened + 123); + valid.should.equal(true); + + valid = HDPrivateKey.isValidPath(HDPrivateKey.Hardened + 123, true); + valid.should.equal(true); + }); + + + var invalid = [ + 'm/-1/12', + 'bad path', + 'K', + 'm/', + 'm/12asd', + 'm/1/2//3' + ]; + + invalid.forEach(function(datum) { + it('rejects illegal path ' + datum, function() { + HDPrivateKey.isValidPath(datum).should.equal(false); + expect(HDPrivateKey._getDerivationIndexes(datum)).to.equal(null); + }); + }); + + it('generates deriving indexes correctly', function() { + var indexes; + + indexes = HDPrivateKey._getDerivationIndexes('m/-1/12'); + expect(indexes).to.equal(null); + + indexes = HDPrivateKey._getDerivationIndexes('m/0/12/12\''); + indexes.should.eql([0, 12, HDPrivateKey.Hardened + 12]); + + indexes = HDPrivateKey._getDerivationIndexes('m/0/12/12\''); + indexes.should.eql([0, 12, HDPrivateKey.Hardened + 12]); + }); + + }); + + describe('conversion to/from buffer', function() { + var str = 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'; + it('should roundtrip to/from a buffer', function() { + var priv = new HDPrivateKey(str); + var toBuffer = priv.toBuffer(); + var fromBuffer = HDPrivateKey.fromBuffer(toBuffer); + var roundTrip = new HDPrivateKey(fromBuffer.toBuffer()); + roundTrip.xprivkey.should.equal(str); + }); + }); + + describe('conversion to plain object/json', function() { + var plainObject = { + 'network': 'livenet', + 'depth': 0, + 'fingerPrint': 876747070, + 'parentFingerPrint': 0, + 'childIndex': 0, + 'chainCode': '873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508', + 'privateKey': 'e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35', + 'checksum': -411132559, + 'xprivkey': 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvN' + + 'KmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi' + }; + it('toObject leaves no Buffer instances', function() { + var privKey = new HDPrivateKey(xprivkey); + var object = privKey.toObject(); + _.each(_.values(object), function(value) { + expect(BufferUtil.isBuffer(value)).to.equal(false); + }); + }); + it('roundtrips toObject', function() { + expect(HDPrivateKey.fromObject(new HDPrivateKey(xprivkey).toObject()).xprivkey).to.equal(xprivkey); + }); + it('roundtrips to JSON and to Object', function() { + var privkey = new HDPrivateKey(xprivkey); + expect(HDPrivateKey.fromObject(privkey.toJSON()).xprivkey).to.equal(xprivkey); + }); + it('recovers state from JSON', function() { + new HDPrivateKey(JSON.stringify(plainObject)).xprivkey.should.equal(xprivkey); + }); + it('recovers state from Object', function() { + new HDPrivateKey(plainObject).xprivkey.should.equal(xprivkey); + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/hdpublickey.js b/packages/kauri-bitcore-lib/test/hdpublickey.js new file mode 100644 index 0000000..d51ee35 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/hdpublickey.js @@ -0,0 +1,275 @@ +'use strict'; + +/* jshint unused: false */ +var _ = require('lodash'); +var assert = require('assert'); +var should = require('chai').should(); +var expect = require('chai').expect; +var bitcore = require('..'); +var buffer = require('buffer'); +var errors = bitcore.errors; +var hdErrors = bitcore.errors.HDPublicKey; +var BufferUtil = bitcore.util.buffer; +var HDPrivateKey = bitcore.HDPrivateKey; +var HDPublicKey = bitcore.HDPublicKey; +var Base58Check = bitcore.encoding.Base58Check; +var Networks = bitcore.Networks; + +var xprivkey = 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'; +var xpubkey = 'xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8'; +var xpubkeyTestnet = 'tpubD6NzVbkrYhZ4WZaiWHz59q5EQ61bd6dUYfU4ggRWAtNAyyYRNWT6ktJ7UHJEXURvTfTfskFQmK7Ff4FRkiRN5wQH8nkGAb6aKB4Yyeqsw5m'; +var json = '{"network":"livenet","depth":0,"fingerPrint":876747070,"parentFingerPrint":0,"childIndex":0,"chainCode":"873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508","publicKey":"0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2","checksum":-1421395167,"xpubkey":"xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"}'; +var derived_0_1_200000 = 'xpub6BqyndF6rkBNTV6LXwiY8Pco8aqctqq7tGEUdA8fmGDTnDJphn2fmxr3eM8Lm3m8TrNUsLbEjHvpa3adBU18YpEx4tp2Zp6nqax3mQkudhX'; + +describe('HDPublicKey interface', function() { + + var expectFail = function(func, errorType) { + (function() { + func(); + }).should.throw(errorType); + }; + + var expectDerivationFail = function(argument, error) { + (function() { + var pubkey = new HDPublicKey(xpubkey); + pubkey.derive(argument); + }).should.throw(error); + }; + + var expectFailBuilding = function(argument, error) { + (function() { + return new HDPublicKey(argument); + }).should.throw(error); + }; + + describe('creation formats', function() { + + it('returns same argument if already an instance of HDPublicKey', function() { + var publicKey = new HDPublicKey(xpubkey); + publicKey.should.equal(new HDPublicKey(publicKey)); + }); + + it('returns the correct xpubkey for a xprivkey', function() { + var publicKey = new HDPublicKey(xprivkey); + publicKey.xpubkey.should.equal(xpubkey); + }); + + it('allows to call the argument with no "new" keyword', function() { + HDPublicKey(xpubkey).xpubkey.should.equal(new HDPublicKey(xpubkey).xpubkey); + }); + + it('fails when user doesn\'t supply an argument', function() { + expectFailBuilding(null, hdErrors.MustSupplyArgument); + }); + + it('should not be able to change read-only properties', function() { + var publicKey = new HDPublicKey(xprivkey); + expect(function() { + publicKey.fingerPrint = 'notafingerprint'; + }).to.throw(TypeError); + }); + + it('doesn\'t recognize an invalid argument', function() { + expectFailBuilding(1, hdErrors.UnrecognizedArgument); + expectFailBuilding(true, hdErrors.UnrecognizedArgument); + }); + + + describe('xpubkey string serialization errors', function() { + it('fails on invalid length', function() { + expectFailBuilding( + Base58Check.encode(new buffer.Buffer([1, 2, 3])), + hdErrors.InvalidLength + ); + }); + it('fails on invalid base58 encoding', function() { + expectFailBuilding( + xpubkey + '1', + errors.InvalidB58Checksum + ); + }); + it('user can ask if a string is valid', function() { + (HDPublicKey.isValidSerialized(xpubkey)).should.equal(true); + }); + }); + + it('can be generated from a json', function() { + expect(new HDPublicKey(JSON.parse(json)).xpubkey).to.equal(xpubkey); + }); + + it('can generate a json that has a particular structure', function() { + assert(_.isEqual( + new HDPublicKey(JSON.parse(json)).toJSON(), + new HDPublicKey(xpubkey).toJSON() + )); + }); + + it('builds from a buffer object', function() { + (new HDPublicKey(new HDPublicKey(xpubkey)._buffers)).xpubkey.should.equal(xpubkey); + }); + + it('checks the checksum', function() { + var buffers = new HDPublicKey(xpubkey)._buffers; + buffers.checksum = BufferUtil.integerAsBuffer(1); + expectFail(function() { + return new HDPublicKey(buffers); + }, errors.InvalidB58Checksum); + }); + }); + + describe('error checking on serialization', function() { + var compareType = function(a, b) { + expect(a instanceof b).to.equal(true); + }; + it('throws invalid argument when argument is not a string or buffer', function() { + compareType(HDPublicKey.getSerializedError(1), hdErrors.UnrecognizedArgument); + }); + it('if a network is provided, validates that data corresponds to it', function() { + compareType(HDPublicKey.getSerializedError(xpubkey, 'testnet'), errors.InvalidNetwork); + }); + it('recognizes invalid network arguments', function() { + compareType(HDPublicKey.getSerializedError(xpubkey, 'invalid'), errors.InvalidNetworkArgument); + }); + it('recognizes a valid network', function() { + expect(HDPublicKey.getSerializedError(xpubkey, 'livenet')).to.equal(null); + }); + }); + + it('toString() returns the same value as .xpubkey', function() { + var pubKey = new HDPublicKey(xpubkey); + pubKey.toString().should.equal(pubKey.xpubkey); + }); + + it('publicKey property matches network', function() { + var livenet = new HDPublicKey(xpubkey); + var testnet = new HDPublicKey(xpubkeyTestnet); + + livenet.publicKey.network.should.equal(Networks.livenet); + testnet.publicKey.network.should.equal(Networks.testnet); + }); + + it('inspect() displays correctly', function() { + var pubKey = new HDPublicKey(xpubkey); + pubKey.inspect().should.equal(''); + }); + + describe('conversion to/from buffer', function() { + + it('should roundtrip to an equivalent object', function() { + var pubKey = new HDPublicKey(xpubkey); + var toBuffer = pubKey.toBuffer(); + var fromBuffer = HDPublicKey.fromBuffer(toBuffer); + var roundTrip = new HDPublicKey(fromBuffer.toBuffer()); + roundTrip.xpubkey.should.equal(xpubkey); + }); + }); + + describe('conversion to different formats', function() { + var plainObject = { + 'network':'livenet', + 'depth':0, + 'fingerPrint':876747070, + 'parentFingerPrint':0, + 'childIndex':0, + 'chainCode':'873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508', + 'publicKey':'0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2', + 'checksum':-1421395167, + 'xpubkey':'xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8' + }; + it('roundtrips to JSON and to Object', function() { + var pubkey = new HDPublicKey(xpubkey); + expect(HDPublicKey.fromObject(pubkey.toJSON()).xpubkey).to.equal(xpubkey); + }); + it('recovers state from Object', function() { + new HDPublicKey(plainObject).xpubkey.should.equal(xpubkey); + }); + }); + + describe('derivation', function() { + it('derivation is the same whether deriving with number or string', function() { + var pubkey = new HDPublicKey(xpubkey); + var derived1 = pubkey.derive(0).derive(1).derive(200000); + var derived2 = pubkey.derive('m/0/1/200000'); + derived1.xpubkey.should.equal(derived_0_1_200000); + derived2.xpubkey.should.equal(derived_0_1_200000); + }); + + it('allows special parameters m, M', function() { + var expectDerivationSuccess = function(argument) { + new HDPublicKey(xpubkey).derive(argument).xpubkey.should.equal(xpubkey); + }; + expectDerivationSuccess('m'); + expectDerivationSuccess('M'); + }); + + it('doesn\'t allow object arguments for derivation', function() { + expectFail(function() { + return new HDPublicKey(xpubkey).derive({}); + }, hdErrors.InvalidDerivationArgument); + }); + + it('needs first argument for derivation', function() { + expectFail(function() { + return new HDPublicKey(xpubkey).derive('s'); + }, hdErrors.InvalidPath); + }); + + it('doesn\'t allow other parameters like m\' or M\' or "s"', function() { + /* jshint quotmark: double */ + expectDerivationFail("m'", hdErrors.InvalidIndexCantDeriveHardened); + expectDerivationFail("M'", hdErrors.InvalidIndexCantDeriveHardened); + expectDerivationFail("1", hdErrors.InvalidPath); + expectDerivationFail("S", hdErrors.InvalidPath); + }); + + it('can\'t derive hardened keys', function() { + expectFail(function() { + return new HDPublicKey(xpubkey).derive(HDPublicKey.Hardened); + }, hdErrors.InvalidIndexCantDeriveHardened); + }); + + it('can\'t derive hardened keys via second argument', function() { + expectFail(function() { + return new HDPublicKey(xpubkey).derive(5, true); + }, hdErrors.InvalidIndexCantDeriveHardened); + }); + + it('validates correct paths', function() { + var valid; + + valid = HDPublicKey.isValidPath('m/123/12'); + valid.should.equal(true); + + valid = HDPublicKey.isValidPath('m'); + valid.should.equal(true); + + valid = HDPublicKey.isValidPath(123); + valid.should.equal(true); + }); + + it('rejects illegal paths', function() { + var valid; + + valid = HDPublicKey.isValidPath('m/-1/12'); + valid.should.equal(false); + + valid = HDPublicKey.isValidPath("m/0'/12"); + valid.should.equal(false); + + valid = HDPublicKey.isValidPath("m/8000000000/12"); + valid.should.equal(false); + + valid = HDPublicKey.isValidPath('bad path'); + valid.should.equal(false); + + valid = HDPublicKey.isValidPath(-1); + valid.should.equal(false); + + valid = HDPublicKey.isValidPath(8000000000); + valid.should.equal(false); + + valid = HDPublicKey.isValidPath(HDPublicKey.Hardened); + valid.should.equal(false); + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/index.html b/packages/kauri-bitcore-lib/test/index.html new file mode 100644 index 0000000..87c0cf3 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/index.html @@ -0,0 +1,18 @@ + + + + Mocha + + + + + +
+ + + + + + diff --git a/packages/kauri-bitcore-lib/test/index.js b/packages/kauri-bitcore-lib/test/index.js new file mode 100644 index 0000000..47bad73 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/index.js @@ -0,0 +1,16 @@ +"use strict"; + +var should = require("chai").should(); +var bitcore = require("../"); + +describe('#versionGuard', function() { + it('global._bitcore should be defined', function() { + should.equal(global._bitcore, bitcore.version); + }); + + it('throw an error if version is already defined', function() { + (function() { + bitcore.versionGuard('version'); + }).should.throw('More than one instance of bitcore'); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/mocha.opts b/packages/kauri-bitcore-lib/test/mocha.opts new file mode 100644 index 0000000..9409cf5 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/mocha.opts @@ -0,0 +1,2 @@ +--recursive +--timeout 5000 diff --git a/packages/kauri-bitcore-lib/test/networks.js b/packages/kauri-bitcore-lib/test/networks.js new file mode 100644 index 0000000..ea265cf --- /dev/null +++ b/packages/kauri-bitcore-lib/test/networks.js @@ -0,0 +1,128 @@ +'use strict'; + +var expect = require('chai').expect; +var should = require('chai').should(); +var bitcore = require('..'); +var networks = bitcore.Networks; + +describe('Networks', function() { + + var customnet; + + it('should contain all Networks', function() { + should.exist(networks.livenet); + should.exist(networks.testnet); + should.exist(networks.defaultNetwork); + }); + + it('will enable/disable regtest Network', function() { + networks.enableRegtest(); + networks.testnet.networkMagic.should.deep.equal(new Buffer('fabfb5da', 'hex')); + networks.testnet.port.should.equal(18444); + networks.testnet.dnsSeeds.should.deep.equal([]); + networks.testnet.regtestEnabled.should.equal(true); + + networks.disableRegtest(); + networks.testnet.networkMagic.should.deep.equal(new Buffer('0b110907', 'hex')); + networks.testnet.port.should.equal(18333); + networks.testnet.dnsSeeds.should.deep.equal([ + 'testnet-seed.bitcoin.petertodd.org', + 'testnet-seed.bluematt.me', + 'testnet-seed.alexykot.me', + 'testnet-seed.bitcoin.schildbach.de' + ]); + }); + + it('will get network based on string "regtest" value', function() { + var network = networks.get('regtest'); + network.should.equal(networks.testnet); + }); + + it('should be able to define a custom Network', function() { + var custom = { + name: 'customnet', + alias: 'mynet', + pubkeyhash: 0x10, + privatekey: 0x90, + scripthash: 0x08, + xpubkey: 0x0278b20e, + xprivkey: 0x0278ade4, + networkMagic: 0xe7beb4d4, + port: 20001, + dnsSeeds: [ + 'localhost', + 'mynet.localhost' + ] + }; + networks.add(custom); + customnet = networks.get('customnet'); + for (var key in custom) { + if (key !== 'networkMagic') { + customnet[key].should.equal(custom[key]); + } else { + var expected = new Buffer('e7beb4d4', 'hex'); + customnet[key].should.deep.equal(expected); + } + } + }); + + it('can remove a custom network', function() { + networks.remove(customnet); + var net = networks.get('customnet'); + should.equal(net, undefined); + }); + + it('should not set a network map for an undefined value', function() { + var custom = { + name: 'somenet', + pubkeyhash: 0x13, + privatekey: 0x93, + scripthash: 0x11, + xpubkey: 0x0278b20f, + xprivkey: 0x0278ade5, + networkMagic: 0xe7beb4d5, + port: 20008, + dnsSeeds: [ + 'somenet.localhost' + ] + }; + networks.add(custom); + var network = networks.get(undefined); + should.not.exist(network); + var somenet = networks.get('somenet'); + should.exist(somenet); + somenet.name.should.equal('somenet'); + networks.remove(somenet); + }); + + var constants = ['name', 'alias', 'pubkeyhash', 'scripthash', 'xpubkey', 'xprivkey']; + + constants.forEach(function(key){ + it('should have constant '+key+' for livenet and testnet', function(){ + networks.testnet.hasOwnProperty(key).should.equal(true); + networks.livenet.hasOwnProperty(key).should.equal(true); + }); + }); + + it('tests only for the specified key', function() { + expect(networks.get(0x6f, 'pubkeyhash')).to.equal(networks.testnet); + expect(networks.get(0x6f, 'privatekey')).to.equal(undefined); + }); + + it('can test for multiple keys', function() { + expect(networks.get(0x6f, ['pubkeyhash', 'scripthash'])).to.equal(networks.testnet); + expect(networks.get(0xc4, ['pubkeyhash', 'scripthash'])).to.equal(networks.testnet); + expect(networks.get(0x6f, ['privatekey', 'port'])).to.equal(undefined); + }); + + it('converts to string using the "name" property', function() { + networks.livenet.toString().should.equal('livenet'); + }); + + it('network object should be immutable', function() { + expect(networks.testnet.name).to.equal('testnet') + var fn = function() { networks.testnet.name = 'livenet' } + expect(fn).to.throw(TypeError) + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/opcode.js b/packages/kauri-bitcore-lib/test/opcode.js new file mode 100644 index 0000000..5de57bd --- /dev/null +++ b/packages/kauri-bitcore-lib/test/opcode.js @@ -0,0 +1,165 @@ +'use strict'; + +var _ = require('lodash'); +var chai = require('chai'); +var should = chai.should(); +var expect = chai.expect; +var bitcore = require('..'); +var Opcode = bitcore.Opcode; + +describe('Opcode', function() { + + it('should create a new Opcode', function() { + var opcode = new Opcode(5); + should.exist(opcode); + }); + + it('should convert to a string with this handy syntax', function() { + Opcode(0).toString().should.equal('OP_0'); + Opcode(96).toString().should.equal('OP_16'); + Opcode(97).toString().should.equal('OP_NOP'); + }); + + it('should convert to a number with this handy syntax', function() { + Opcode('OP_0').toNumber().should.equal(0); + Opcode('OP_16').toNumber().should.equal(96); + Opcode('OP_NOP').toNumber().should.equal(97); + }); + + describe('#fromNumber', function() { + it('should work for 0', function() { + Opcode.fromNumber(0).num.should.equal(0); + }); + it('should fail for non-number', function() { + Opcode.fromNumber.bind(null, 'a string').should.throw('Invalid Argument'); + }); + }); + + describe('#set', function() { + it('should work for object', function() { + Opcode(42).num.should.equal(42); + }); + it('should fail for empty-object', function() { + expect(function() { + Opcode(); + }).to.throw(TypeError); + }); + }); + + describe('#toNumber', function() { + it('should work for 0', function() { + Opcode.fromNumber(0).toNumber().should.equal(0); + }); + }); + + describe('#buffer', function() { + it('should correctly input/output a buffer', function() { + var buf = new Buffer('a6', 'hex'); + Opcode.fromBuffer(buf).toBuffer().should.deep.equal(buf); + }); + }); + + describe('#fromString', function() { + it('should work for OP_0', function() { + Opcode.fromString('OP_0').num.should.equal(0); + }); + it('should fail for invalid string', function() { + Opcode.fromString.bind(null, 'OP_SATOSHI').should.throw('Invalid opcodestr'); + Opcode.fromString.bind(null, 'BANANA').should.throw('Invalid opcodestr'); + }); + it('should fail for non-string', function() { + Opcode.fromString.bind(null, 123).should.throw('Invalid Argument'); + }); + }); + + describe('#toString', function() { + it('should work for OP_0', function() { + Opcode.fromString('OP_0').toString().should.equal('OP_0'); + }); + + it('should not work for non-opcode', function() { + expect(function(){ + Opcode('OP_NOTACODE').toString(); + }).to.throw('Opcode does not have a string representation'); + }); + }); + + describe('@map', function() { + it('should have a map containing 117 elements', function() { + _.size(Opcode.map).should.equal(117); + }); + }); + + describe('@reverseMap', function() { + it('should exist and have op 185', function() { + should.exist(Opcode.reverseMap); + Opcode.reverseMap[185].should.equal('OP_NOP10'); + }); + }); + var smallints = [ + Opcode('OP_0'), + Opcode('OP_1'), + Opcode('OP_2'), + Opcode('OP_3'), + Opcode('OP_4'), + Opcode('OP_5'), + Opcode('OP_6'), + Opcode('OP_7'), + Opcode('OP_8'), + Opcode('OP_9'), + Opcode('OP_10'), + Opcode('OP_11'), + Opcode('OP_12'), + Opcode('OP_13'), + Opcode('OP_14'), + Opcode('OP_15'), + Opcode('OP_16') + ]; + + describe('@smallInt', function() { + var testSmallInt = function(n, op) { + Opcode.smallInt(n).toString().should.equal(op.toString()); + }; + + for (var i = 0; i < smallints.length; i++) { + var op = smallints[i]; + it('should work for small int ' + op, testSmallInt.bind(null, i, op)); + } + + it('with not number', function () { + Opcode.smallInt.bind(null, '2').should.throw('Invalid Argument'); + }); + + it('with n equal -1', function () { + Opcode.smallInt.bind(null, -1).should.throw('Invalid Argument'); + }); + + it('with n equal 17', function () { + Opcode.smallInt.bind(null, 17).should.throw('Invalid Argument'); + }); + }); + describe('@isSmallIntOp', function() { + var testIsSmallInt = function(op) { + Opcode.isSmallIntOp(op).should.equal(true); + }; + for (var i = 0; i < smallints.length; i++) { + var op = smallints[i]; + it('should work for small int ' + op, testIsSmallInt.bind(null, op)); + } + + it('should work for non-small ints', function() { + Opcode.isSmallIntOp(Opcode('OP_RETURN')).should.equal(false); + Opcode.isSmallIntOp(Opcode('OP_CHECKSIG')).should.equal(false); + Opcode.isSmallIntOp(Opcode('OP_IF')).should.equal(false); + Opcode.isSmallIntOp(Opcode('OP_NOP')).should.equal(false); + }); + + }); + + describe('#inspect', function() { + it('should output opcode by name, hex, and decimal', function() { + Opcode.fromString('OP_NOP').inspect().should.equal(''); + }); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/privatekey.js b/packages/kauri-bitcore-lib/test/privatekey.js new file mode 100644 index 0000000..db45f60 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/privatekey.js @@ -0,0 +1,457 @@ +'use strict'; + +var chai = require('chai'); +var should = chai.should(); +var expect = chai.expect; + +var bitcore = require('..'); +var BN = bitcore.crypto.BN; +var Point = bitcore.crypto.Point; +var PrivateKey = bitcore.PrivateKey; +var Networks = bitcore.Networks; +var Base58Check = bitcore.encoding.Base58Check; + +var validbase58 = require('./data/bitcoind/base58_keys_valid.json'); +var invalidbase58 = require('./data/bitcoind/base58_keys_invalid.json'); + +describe('PrivateKey', function() { + var hex = '96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a'; + var hex2 = '8080808080808080808080808080808080808080808080808080808080808080'; + var buf = new Buffer(hex, 'hex'); + var wifTestnet = 'cSdkPxkAjA4HDr5VHgsebAPDEh9Gyub4HK8UJr2DFGGqKKy4K5sG'; + var wifTestnetUncompressed = '92jJzK4tbURm1C7udQXxeCBvXHoHJstDXRxAMouPG1k1XUaXdsu'; + var wifLivenet = 'L2Gkw3kKJ6N24QcDuH4XDqt9cTqsKTVNDGz1CRZhk9cq4auDUbJy'; + var wifLivenetUncompressed = '5JxgQaFM1FMd38cd14e3mbdxsdSa9iM2BV6DHBYsvGzxkTNQ7Un'; + var wifNamecoin = '74pxNKNpByQ2kMow4d9kF6Z77BYeKztQNLq3dSyU4ES1K5KLNiz'; + + it('should create a new random private key', function() { + var a = new PrivateKey(); + should.exist(a); + should.exist(a.bn); + var b = PrivateKey(); + should.exist(b); + should.exist(b.bn); + }); + + it('should create a privatekey from hexa string', function() { + var a = new PrivateKey(hex2); + should.exist(a); + should.exist(a.bn); + }); + + it('should create a new random testnet private key with only one argument', function() { + var a = new PrivateKey(Networks.testnet); + should.exist(a); + should.exist(a.bn); + }); + + it('should create a private key from a custom network WIF string', function() { + var nmc = { + name: 'namecoin', + alias: 'namecoin', + pubkeyhash: 0x34, + privatekey: 0xB4, + // these below aren't the real NMC version numbers + scripthash: 0x08, + xpubkey: 0x0278b20e, + xprivkey: 0x0278ade4, + networkMagic: 0xf9beb4fe, + port: 20001, + dnsSeeds: [ + 'localhost', + 'mynet.localhost' + ] + }; + Networks.add(nmc); + var nmcNet = Networks.get('namecoin'); + var a = new PrivateKey(wifNamecoin, nmcNet); + should.exist(a); + should.exist(a.bn); + Networks.remove(nmcNet); + }); + + it('should create a new random testnet private key with empty data', function() { + var a = new PrivateKey(null, Networks.testnet); + should.exist(a); + should.exist(a.bn); + }); + + it('should create a private key from WIF string', function() { + var a = new PrivateKey('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + should.exist(a); + should.exist(a.bn); + }); + + it('should create a private key from WIF buffer', function() { + var a = new PrivateKey(Base58Check.decode('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m')); + should.exist(a); + should.exist(a.bn); + }); + + describe('bitcoind compliance', function() { + validbase58.map(function(d){ + if (d[2].isPrivkey) { + it('should instantiate WIF private key ' + d[0] + ' with correct properties', function() { + var network = Networks.livenet; + if (d[2].isTestnet) { + network = Networks.testnet; + } + var key = new PrivateKey(d[0]); + key.compressed.should.equal(d[2].isCompressed); + key.network.should.equal(network); + }); + } + }); + invalidbase58.map(function(d){ + it('should describe input ' + d[0].slice(0,10) + '... as invalid', function() { + expect(function() { + return new PrivateKey(d[0]); + }).to.throw(Error); + }); + }); + }); + + describe('instantiation', function() { + it('should not be able to instantiate private key greater than N', function() { + expect(function() { + return new PrivateKey(Point.getN()); + }).to.throw('Number must be less than N'); + }); + + it('should not be able to instantiate private key because of network mismatch', function() { + expect(function() { + return new PrivateKey('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m', 'testnet'); + }).to.throw('Private key network mismatch'); + }); + + it('should not be able to instantiate private key WIF is too long', function() { + expect(function() { + var buf = Base58Check.decode('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + var buf2 = Buffer.concat([buf, new Buffer(0x01)]); + return new PrivateKey(buf2); + }).to.throw('Length of buffer must be 33 (uncompressed) or 34 (compressed'); + }); + + it('should not be able to instantiate private key WIF because of unknown network byte', function() { + expect(function() { + var buf = Base58Check.decode('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + var buf2 = Buffer.concat([new Buffer('ff', 'hex'), buf.slice(1, 33)]); + return new PrivateKey(buf2); + }).to.throw('Invalid network'); + }); + + it('should not be able to instantiate private key WIF because of network mismatch', function() { + expect(function(){ + var a = new PrivateKey(wifNamecoin, 'testnet'); + }).to.throw('Invalid network'); + }); + + it('can be instantiated from a hex string', function() { + var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; + var pubhex = '02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc'; + var privkey = new PrivateKey(privhex); + privkey.publicKey.toString().should.equal(pubhex); + }); + + it('should not be able to instantiate because of unrecognized data', function() { + expect(function() { + return new PrivateKey(new Error()); + }).to.throw('First argument is an unrecognized data type.'); + }); + + it('should not be able to instantiate with unknown network', function() { + expect(function() { + return new PrivateKey(new BN(2), 'unknown'); + }).to.throw('Must specify the network ("livenet" or "testnet")'); + }); + + it('should not create a zero private key', function() { + expect(function() { + var bn = new BN(0); + return new PrivateKey(bn); + }).to.throw(TypeError); + }); + + it('should create a livenet private key', function() { + var privkey = new PrivateKey(BN.fromBuffer(buf), 'livenet'); + privkey.toWIF().should.equal(wifLivenet); + }); + + it('should create a default network private key', function() { + // keep the original + var network = Networks.defaultNetwork; + Networks.defaultNetwork = Networks.livenet; + var a = new PrivateKey(BN.fromBuffer(buf)); + a.network.should.equal(Networks.livenet); + // change the default + Networks.defaultNetwork = Networks.testnet; + var b = new PrivateKey(BN.fromBuffer(buf)); + b.network.should.equal(Networks.testnet); + // restore the default + Networks.defaultNetwork = network; + }); + + it('returns the same instance if a PrivateKey is provided (immutable)', function() { + var privkey = new PrivateKey(); + new PrivateKey(privkey).should.equal(privkey); + }); + + }); + + describe('#json/object', function() { + + it('should input/output json', function() { + var json = JSON.stringify({ + bn: '96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a', + compressed: false, + network: 'livenet' + }); + var key = PrivateKey.fromObject(JSON.parse(json)); + JSON.stringify(key).should.equal(json); + }); + + it('input json should correctly initialize network field', function() { + ['livenet', 'testnet', 'mainnet'].forEach(function (net) { + var pk = PrivateKey.fromObject({ + bn: '96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a', + compressed: false, + network: net + }); + pk.network.should.be.deep.equal(Networks.get(net)); + }); + }); + + it('fails on invalid argument', function() { + expect(function() { + return PrivateKey.fromJSON('¹'); + }).to.throw(); + }); + + it('also accepts an object as argument', function() { + expect(function() { + return PrivateKey.fromObject(new PrivateKey().toObject()); + }).to.not.throw(); + }); + }); + + it('coverage: public key cache', function() { + expect(function() { + var privateKey = new PrivateKey(); + /* jshint unused: false */ + var publicKey = privateKey.publicKey; + return privateKey.publicKey; + }).to.not.throw(); + }); + + describe('#toString', function() { + + it('should output this address correctly', function() { + var privkey = PrivateKey.fromWIF(wifLivenetUncompressed); + privkey.toWIF().should.equal(wifLivenetUncompressed); + }); + + }); + + describe('#toAddress', function() { + it('should output this known livenet address correctly', function() { + var privkey = PrivateKey.fromWIF('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + var address = privkey.toAddress(); + address.toString().should.equal('1A6ut1tWnUq1SEQLMr4ttDh24wcbJ5o9TT'); + }); + + it('should output this known testnet address correctly', function() { + var privkey = PrivateKey.fromWIF('cR4qogdN9UxLZJXCNFNwDRRZNeLRWuds9TTSuLNweFVjiaE4gPaq'); + var address = privkey.toAddress(); + address.toString().should.equal('mtX8nPZZdJ8d3QNLRJ1oJTiEi26Sj6LQXS'); + }); + + it('creates network specific address', function() { + var pk = PrivateKey.fromWIF('cR4qogdN9UxLZJXCNFNwDRRZNeLRWuds9TTSuLNweFVjiaE4gPaq'); + pk.toAddress(Networks.livenet).network.name.should.equal(Networks.livenet.name); + pk.toAddress(Networks.testnet).network.name.should.equal(Networks.testnet.name); + }); + + }); + + describe('#inspect', function() { + it('should output known livenet address for console', function() { + var privkey = PrivateKey.fromWIF('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + privkey.inspect().should.equal( + '' + ); + }); + + it('should output known testnet address for console', function() { + var privkey = PrivateKey.fromWIF('cR4qogdN9UxLZJXCNFNwDRRZNeLRWuds9TTSuLNweFVjiaE4gPaq'); + privkey.inspect().should.equal( + '' + ); + }); + + it('outputs "uncompressed" for uncompressed imported WIFs', function() { + var privkey = PrivateKey.fromWIF(wifLivenetUncompressed); + privkey.inspect().should.equal(''); + }); + }); + + describe('#getValidationError', function(){ + it('should get an error because private key greater than N', function() { + var n = Point.getN(); + var a = PrivateKey.getValidationError(n); + a.message.should.equal('Number must be less than N'); + }); + + it('should validate as false because private key greater than N', function() { + var n = Point.getN(); + var a = PrivateKey.isValid(n); + a.should.equal(false); + }); + + it('should recognize that undefined is an invalid private key', function() { + PrivateKey.isValid().should.equal(false); + }); + + it('should validate as true', function() { + var a = PrivateKey.isValid('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + a.should.equal(true); + }); + + }); + + describe('buffer serialization', function() { + it('returns an expected value when creating a PrivateKey from a buffer', function() { + var privkey = new PrivateKey(BN.fromBuffer(buf), 'livenet'); + privkey.toString().should.equal(buf.toString('hex')); + }); + + it('roundtrips correctly when using toBuffer/fromBuffer', function() { + var privkey = new PrivateKey(BN.fromBuffer(buf)); + var toBuffer = new PrivateKey(privkey.toBuffer()); + var fromBuffer = PrivateKey.fromBuffer(toBuffer.toBuffer()); + fromBuffer.toString().should.equal(privkey.toString()); + }); + + it('will output a 31 byte buffer', function() { + var bn = BN.fromBuffer(new Buffer('9b5a0e8fee1835e21170ce1431f9b6f19b487e67748ed70d8a4462bc031915', 'hex')); + var privkey = new PrivateKey(bn); + var buffer = privkey.toBufferNoPadding(); + buffer.length.should.equal(31); + }); + + // TODO: enable for v1.0.0 when toBuffer is changed to always be 32 bytes long + // it('will output a 32 byte buffer', function() { + // var bn = BN.fromBuffer(new Buffer('9b5a0e8fee1835e21170ce1431f9b6f19b487e67748ed70d8a4462bc031915', 'hex')); + // var privkey = new PrivateKey(bn); + // var buffer = privkey.toBuffer(); + // buffer.length.should.equal(32); + // }); + + // TODO: enable for v1.0.0 when toBuffer is changed to always be 32 bytes long + // it('should return buffer with length equal 32', function() { + // var bn = BN.fromBuffer(buf.slice(0, 31)); + // var privkey = new PrivateKey(bn, 'livenet'); + // var expected = Buffer.concat([ new Buffer([0]), buf.slice(0, 31) ]); + // privkey.toBuffer().toString('hex').should.equal(expected.toString('hex')); + // }); + }); + + describe('#toBigNumber', function() { + it('should output known BN', function() { + var a = BN.fromBuffer(buf); + var privkey = new PrivateKey(a, 'livenet'); + var b = privkey.toBigNumber(); + b.toString('hex').should.equal(a.toString('hex')); + }); + }); + + describe('#fromRandom', function() { + + it('should set bn gt 0 and lt n, and should be compressed', function() { + var privkey = PrivateKey.fromRandom(); + privkey.bn.gt(new BN(0)).should.equal(true); + privkey.bn.lt(Point.getN()).should.equal(true); + privkey.compressed.should.equal(true); + }); + + }); + + describe('#fromWIF', function() { + + it('should parse this compressed testnet address correctly', function() { + var privkey = PrivateKey.fromWIF(wifLivenet); + privkey.toWIF().should.equal(wifLivenet); + }); + + }); + + describe('#toWIF', function() { + + it('should parse this compressed testnet address correctly', function() { + var privkey = PrivateKey.fromWIF(wifTestnet); + privkey.toWIF().should.equal(wifTestnet); + }); + + }); + + describe('#fromString', function() { + + it('should parse this uncompressed testnet address correctly', function() { + var privkey = PrivateKey.fromString(wifTestnetUncompressed); + privkey.toWIF().should.equal(wifTestnetUncompressed); + }); + + }); + + describe('#toString', function() { + + it('should parse this uncompressed livenet address correctly', function() { + var privkey = PrivateKey.fromString(wifLivenetUncompressed); + privkey.toString().should.equal("96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a"); + }); + + }); + + describe('#toPublicKey', function() { + + it('should convert this known PrivateKey to known PublicKey', function() { + var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; + var pubhex = '02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc'; + var privkey = new PrivateKey(new BN(new Buffer(privhex, 'hex'))); + var pubkey = privkey.toPublicKey(); + pubkey.toString().should.equal(pubhex); + }); + + it('should have a "publicKey" property', function() { + var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; + var pubhex = '02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc'; + var privkey = new PrivateKey(new BN(new Buffer(privhex, 'hex'))); + privkey.publicKey.toString().should.equal(pubhex); + }); + + it('should convert this known PrivateKey to known PublicKey and preserve compressed=true', function() { + var privwif = 'L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'; + var privkey = new PrivateKey(privwif, 'livenet'); + var pubkey = privkey.toPublicKey(); + pubkey.compressed.should.equal(true); + }); + + it('should convert this known PrivateKey to known PublicKey and preserve compressed=false', function() { + var privwif = '92jJzK4tbURm1C7udQXxeCBvXHoHJstDXRxAMouPG1k1XUaXdsu'; + var privkey = new PrivateKey(privwif, 'testnet'); + var pubkey = privkey.toPublicKey(); + pubkey.compressed.should.equal(false); + }); + + }); + + it('creates an address as expected from WIF, livenet', function() { + var privkey = new PrivateKey('5J2NYGstJg7aJQEqNwYp4enG5BSfFdKXVTtBLvHicnRGD5kjxi6'); + privkey.publicKey.toAddress().toString().should.equal('135bwugFCmhmNU3SeCsJeTqvo5ViymgwZ9'); + }); + + it('creates an address as expected from WIF, testnet', function() { + var privkey = new PrivateKey('92VYMmwFLXRwXn5688edGxYYgMFsc3fUXYhGp17WocQhU6zG1kd'); + privkey.publicKey.toAddress().toString().should.equal('moiAvLUw16qgrwhFGo1eDnXHC2wPMYiv7Y'); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/publickey.js b/packages/kauri-bitcore-lib/test/publickey.js new file mode 100644 index 0000000..d0a52a6 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/publickey.js @@ -0,0 +1,430 @@ +'use strict'; + +var should = require('chai').should(); +var expect = require('chai').expect; + +var bitcore = require('..'); +var Point = bitcore.crypto.Point; +var BN = bitcore.crypto.BN; +var PublicKey = bitcore.PublicKey; +var PrivateKey = bitcore.PrivateKey; +var Address = bitcore.Address; +var Networks = bitcore.Networks; + +/* jshint maxlen: 200 */ + +describe('PublicKey', function() { + /* jshint maxstatements: 30 */ + + var invalidPoint = '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'; + + describe('validating errors on creation', function() { + it('errors if data is missing', function() { + (function() { + return new PublicKey(); + }).should.throw('First argument is required, please include public key data.'); + }); + + it('errors if an invalid point is provided', function() { + (function() { + return new PublicKey(invalidPoint); + }).should.throw('Point does not lie on the curve'); + }); + + it('errors if a point not on the secp256k1 curve is provided', function() { + (function() { + return new PublicKey(new Point(1000, 1000)); + }).should.throw('Point does not lie on the curve'); + }); + + it('errors if the argument is of an unrecognized type', function() { + (function() { + return new PublicKey(new Error()); + }).should.throw('First argument is an unrecognized data format.'); + }); + }); + + describe('instantiation', function() { + + it('from a private key', function() { + var privhex = '906977a061af29276e40bf377042ffbde414e496ae2260bbf1fa9d085637bfff'; + var pubhex = '02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc'; + var privkey = new PrivateKey(new BN(new Buffer(privhex, 'hex'))); + var pk = new PublicKey(privkey); + pk.toString().should.equal(pubhex); + }); + + it('problematic secp256k1 public keys', function() { + + var knownKeys = [ + { + wif: 'KzsjKq2FVqVuQv2ueHVFuB65A9uEZ6S1L6F8NuokCrE3V3kE3Ack', + priv: '6d1229a6b24c2e775c062870ad26bc261051e0198c67203167273c7c62538846', + pub: '03d6106302d2698d6a41e9c9a114269e7be7c6a0081317de444bb2980bf9265a01', + pubx: 'd6106302d2698d6a41e9c9a114269e7be7c6a0081317de444bb2980bf9265a01', + puby: 'e05fb262e64b108991a29979809fcef9d3e70cafceb3248c922c17d83d66bc9d' + }, + { + wif: 'L5MgSwNB2R76xBGorofRSTuQFd1bm3hQMFVf3u2CneFom8u1Yt7G', + priv: 'f2cc9d2b008927db94b89e04e2f6e70c180e547b3e5e564b06b8215d1c264b53', + pub: '03e275faa35bd1e88f5df6e8f9f6edb93bdf1d65f4915efc79fd7a726ec0c21700', + pubx: 'e275faa35bd1e88f5df6e8f9f6edb93bdf1d65f4915efc79fd7a726ec0c21700', + puby: '367216cb35b086e6686d69dddd822a8f4d52eb82ac5d9de18fdcd9bf44fa7df7' + } + ]; + + for(var i = 0; i < knownKeys.length; i++) { + var privkey = new PrivateKey(knownKeys[i].wif); + var pubkey = privkey.toPublicKey(); + pubkey.toString().should.equal(knownKeys[i].pub); + pubkey.point.x.toString('hex').should.equal(knownKeys[i].pubx); + pubkey.point.y.toString('hex').should.equal(knownKeys[i].puby); + } + + }); + + it('from a compressed public key', function() { + var publicKeyHex = '031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'; + var publicKey = new PublicKey(publicKeyHex); + publicKey.toString().should.equal(publicKeyHex); + }); + + it('from another publicKey', function() { + var publicKeyHex = '031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'; + var publicKey = new PublicKey(publicKeyHex); + var publicKey2 = new PublicKey(publicKey); + publicKey.should.equal(publicKey2); + }); + + it('sets the network to defaultNetwork if none provided', function() { + var publicKeyHex = '031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'; + var publicKey = new PublicKey(publicKeyHex); + publicKey.network.should.equal(Networks.defaultNetwork); + }); + + it('from a hex encoded DER string', function() { + var pk = new PublicKey('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + should.exist(pk.point); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + }); + + it('from a hex encoded DER buffer', function() { + var pk = new PublicKey(new Buffer('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341', 'hex')); + should.exist(pk.point); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + }); + + it('from a point', function() { + var p = new Point('86a80a5a2bfc48dddde2b0bd88bd56b0b6ddc4e6811445b175b90268924d7d48', + '3b402dfc89712cfe50963e670a0598e6b152b3cd94735001cdac6794975d3afd'); + var a = new PublicKey(p); + should.exist(a.point); + a.point.toString().should.equal(p.toString()); + var c = new PublicKey(p); + should.exist(c.point); + c.point.toString().should.equal(p.toString()); + }); + }); + + + describe('#getValidationError', function(){ + + it('should recieve an invalid point error', function() { + var error = PublicKey.getValidationError(invalidPoint); + should.exist(error); + error.message.should.equal('Point does not lie on the curve'); + }); + + it('should recieve a boolean as false', function() { + var valid = PublicKey.isValid(invalidPoint); + valid.should.equal(false); + }); + + it('should recieve a boolean as true for uncompressed', function() { + var valid = PublicKey.isValid('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + valid.should.equal(true); + }); + + it('should recieve a boolean as true for compressed', function() { + var valid = PublicKey.isValid('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + valid.should.equal(true); + }); + + }); + + describe('#fromPoint', function() { + + it('should instantiate from a point', function() { + var p = new Point('86a80a5a2bfc48dddde2b0bd88bd56b0b6ddc4e6811445b175b90268924d7d48', + '3b402dfc89712cfe50963e670a0598e6b152b3cd94735001cdac6794975d3afd'); + var b = PublicKey.fromPoint(p); + should.exist(b.point); + b.point.toString().should.equal(p.toString()); + }); + + it('should error because paramater is not a point', function() { + (function() { + PublicKey.fromPoint(new Error()); + }).should.throw('First argument must be an instance of Point.'); + }); + }); + + describe('#json/object', function() { + + it('should input/ouput json', function() { + var json = JSON.stringify({ + x: '1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', + y: '7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341', + compressed: false + }); + var pubkey = new PublicKey(JSON.parse(json)); + JSON.stringify(pubkey).should.deep.equal(json); + }); + + it('fails if "y" is not provided', function() { + expect(function() { + return new PublicKey({ + x: '1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a' + }); + }).to.throw(); + }); + + it('fails if invalid JSON is provided', function() { + expect(function() { + return PublicKey._transformJSON('¹'); + }).to.throw(); + }); + + it('works for X starting with 0x00', function() { + var a = new PublicKey('030589ee559348bd6a7325994f9c8eff12bd5d73cc683142bd0dd1a17abc99b0dc'); + var b = new PublicKey('03'+a.toObject().x); + b.toString().should.equal(a.toString()); + }); + + }); + + describe('#fromPrivateKey', function() { + + it('should make a public key from a privkey', function() { + should.exist(PublicKey.fromPrivateKey(PrivateKey.fromRandom())); + }); + + it('should error because not an instance of privkey', function() { + (function() { + PublicKey.fromPrivateKey(new Error()); + }).should.throw('Must be an instance of PrivateKey'); + }); + + }); + + describe('#fromBuffer', function() { + + it('should parse this uncompressed public key', function() { + var pk = PublicKey.fromBuffer(new Buffer('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341', 'hex')); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pk.point.getY().toString(16).should.equal('7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + + it('should parse this compressed public key', function() { + var pk = PublicKey.fromBuffer(new Buffer('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pk.point.getY().toString(16).should.equal('7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + + it('should throw an error on this invalid public key', function() { + (function() { + PublicKey.fromBuffer(new Buffer('091ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + }).should.throw(); + }); + + it('should throw error because not a buffer', function() { + (function() { + PublicKey.fromBuffer('091ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + }).should.throw('Must be a hex buffer of DER encoded public key'); + }); + + it('should throw error because buffer is the incorrect length', function() { + (function() { + PublicKey.fromBuffer(new Buffer('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a34112', 'hex')); + }).should.throw('Length of x and y must be 32 bytes'); + }); + + }); + + describe('#fromDER', function() { + + it('should parse this uncompressed public key', function() { + var pk = PublicKey.fromDER(new Buffer('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341', 'hex')); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pk.point.getY().toString(16).should.equal('7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + + it('should parse this compressed public key', function() { + var pk = PublicKey.fromDER(new Buffer('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pk.point.getY().toString(16).should.equal('7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + + it('should throw an error on this invalid public key', function() { + (function() { + PublicKey.fromDER(new Buffer('091ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + }).should.throw(); + }); + + }); + + describe('#fromString', function() { + + it('should parse this known valid public key', function() { + var pk = PublicKey.fromString('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pk.point.getY().toString(16).should.equal('7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + + }); + + describe('#fromX', function() { + + it('should create this known public key', function() { + var x = BN.fromBuffer(new Buffer('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + var pk = PublicKey.fromX(true, x); + pk.point.getX().toString(16).should.equal('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pk.point.getY().toString(16).should.equal('7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + + + it('should error because odd was not included as a param', function() { + var x = BN.fromBuffer(new Buffer('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + (function() { + return PublicKey.fromX(null, x); + }).should.throw('Must specify whether y is odd or not (true or false)'); + }); + + }); + + describe('#toBuffer', function() { + + it('should return this compressed DER format', function() { + var x = BN.fromBuffer(new Buffer('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + var pk = PublicKey.fromX(true, x); + pk.toBuffer().toString('hex').should.equal('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + }); + + it('should return this uncompressed DER format', function() { + var x = BN.fromBuffer(new Buffer('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + var pk = PublicKey.fromX(true, x); + pk.toBuffer().toString('hex').should.equal('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + }); + + }); + + describe('#toDER', function() { + + it('should return this compressed DER format', function() { + var x = BN.fromBuffer(new Buffer('1ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a', 'hex')); + var pk = PublicKey.fromX(true, x); + pk.toDER().toString('hex').should.equal('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + }); + + it('should return this uncompressed DER format', function() { + var pk = PublicKey.fromString('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + pk.toDER().toString('hex').should.equal('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + }); + }); + + describe('#toAddress', function() { + + it('should output this known mainnet address correctly', function() { + var pk = new PublicKey('03c87bd0e162f26969da8509cafcb7b8c8d202af30b928c582e263dd13ee9a9781'); + var address = pk.toAddress('livenet'); + address.toString().should.equal('1A6ut1tWnUq1SEQLMr4ttDh24wcbJ5o9TT'); + }); + + it('should output this known testnet address correctly', function() { + var pk = new PublicKey('0293126ccc927c111b88a0fe09baa0eca719e2a3e087e8a5d1059163f5c566feef'); + var address = pk.toAddress('testnet'); + address.toString().should.equal('mtX8nPZZdJ8d3QNLRJ1oJTiEi26Sj6LQXS'); + }); + + }); + + describe('hashes', function() { + + // wif private key, address + // see: https://github.com/bitcoin/bitcoin/blob/master/src/test/key_tests.cpp#L20 + var data = [ + ['5HxWvvfubhXpYYpS3tJkw6fq9jE9j18THftkZjHHfmFiWtmAbrj', '1QFqqMUD55ZV3PJEJZtaKCsQmjLT6JkjvJ'], + ['5KC4ejrDjv152FGwP386VD1i2NYc5KkfSMyv1nGy1VGDxGHqVY3', '1F5y5E5FMc5YzdJtB9hLaUe43GDxEKXENJ'], + ['Kwr371tjA9u2rFSMZjTNun2PXXP3WPZu2afRHTcta6KxEUdm1vEw', '1NoJrossxPBKfCHuJXT4HadJrXRE9Fxiqs'], + ['L3Hq7a8FEQwJkW1M2GNKDW28546Vp5miewcCzSqUD9kCAXrJdS3g', '1CRj2HyM1CXWzHAXLQtiGLyggNT9WQqsDs'] + ]; + + data.forEach(function(d){ + var publicKey = PrivateKey.fromWIF(d[0]).toPublicKey(); + var address = Address.fromString(d[1]); + address.hashBuffer.should.deep.equal(publicKey._getID()); + }); + + }); + + describe('#toString', function() { + + it('should print this known public key', function() { + var hex = '031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'; + var pk = PublicKey.fromString(hex); + pk.toString().should.equal(hex); + }); + + }); + + describe('#inspect', function() { + it('should output known uncompressed pubkey for console', function() { + var pubkey = PublicKey.fromString('041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a7baad41d04514751e6851f5304fd243751703bed21b914f6be218c0fa354a341'); + pubkey.inspect().should.equal(''); + }); + + it('should output known compressed pubkey for console', function() { + var pubkey = PublicKey.fromString('031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'); + pubkey.inspect().should.equal(''); + }); + + it('should output known compressed pubkey with network for console', function() { + var privkey = PrivateKey.fromWIF('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + var pubkey = new PublicKey(privkey); + pubkey.inspect().should.equal(''); + }); + + }); + + describe('#validate', function() { + + it('should not have an error if pubkey is valid', function() { + var hex = '031ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a'; + expect(function() { + return PublicKey.fromString(hex); + }).to.not.throw(); + }); + + it('should throw an error if pubkey is invalid', function() { + var hex = '041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a0000000000000000000000000000000000000000000000000000000000000000'; + (function() { + return PublicKey.fromString(hex); + }).should.throw('Invalid y value for curve.'); + }); + + it('should throw an error if pubkey is invalid', function() { + var hex = '041ff0fe0f7b15ffaa85ff9f4744d539139c252a49710fb053bb9f2b933173ff9a00000000000000000000000000000000000000000000000000000000000000FF'; + (function() { + return PublicKey.fromString(hex); + }).should.throw('Invalid y value for curve.'); + }); + + it('should throw an error if pubkey is infinity', function() { + (function() { + return new PublicKey(Point.getG().mul(Point.getN())); + }).should.throw('Point cannot be equal to Infinity'); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/script/interpreter.js b/packages/kauri-bitcore-lib/test/script/interpreter.js new file mode 100644 index 0000000..70b9519 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/script/interpreter.js @@ -0,0 +1,417 @@ +'use strict'; + +var should = require('chai').should(); +var sinon = require('sinon'); +var bitcore = require('../..'); +var Interpreter = bitcore.Script.Interpreter; +var Transaction = bitcore.Transaction; +var PrivateKey = bitcore.PrivateKey; +var Script = bitcore.Script; +var BN = bitcore.crypto.BN; +var BufferWriter = bitcore.encoding.BufferWriter; +var Opcode = bitcore.Opcode; +var _ = require('lodash'); + +var script_valid = require('../data/bitcoind/script_valid'); +var script_invalid = require('../data/bitcoind/script_invalid'); +var tx_valid = require('../data/bitcoind/tx_valid'); +var tx_invalid = require('../data/bitcoind/tx_invalid'); + +//the script string format used in bitcoind data tests +Script.fromBitcoindString = function(str) { + var bw = new BufferWriter(); + var tokens = str.split(' '); + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token === '') { + continue; + } + + var opstr; + var opcodenum; + var tbuf; + if (token[0] === '0' && token[1] === 'x') { + var hex = token.slice(2); + bw.write(new Buffer(hex, 'hex')); + } else if (token[0] === '\'') { + var tstr = token.slice(1, token.length - 1); + var cbuf = new Buffer(tstr); + tbuf = Script().add(cbuf).toBuffer(); + bw.write(tbuf); + } else if (typeof Opcode['OP_' + token] !== 'undefined') { + opstr = 'OP_' + token; + opcodenum = Opcode[opstr]; + bw.writeUInt8(opcodenum); + } else if (typeof Opcode[token] === 'number') { + opstr = token; + opcodenum = Opcode[opstr]; + bw.writeUInt8(opcodenum); + } else if (!isNaN(parseInt(token))) { + var script = Script().add(new BN(token).toScriptNumBuffer()); + tbuf = script.toBuffer(); + bw.write(tbuf); + } else { + throw new Error('Could not determine type of script value'); + } + } + var buf = bw.concat(); + return this.fromBuffer(buf); +}; + + + +describe('Interpreter', function() { + + it('should make a new interp', function() { + var interp = new Interpreter(); + (interp instanceof Interpreter).should.equal(true); + interp.stack.length.should.equal(0); + interp.altstack.length.should.equal(0); + interp.pc.should.equal(0); + interp.pbegincodehash.should.equal(0); + interp.nOpCount.should.equal(0); + interp.vfExec.length.should.equal(0); + interp.errstr.should.equal(''); + interp.flags.should.equal(0); + }); + + describe('@castToBool', function() { + + it('should cast these bufs to bool correctly', function() { + Interpreter.castToBool(new BN(0).toSM({ + endian: 'little' + })).should.equal(false); + Interpreter.castToBool(new Buffer('0080', 'hex')).should.equal(false); //negative 0 + Interpreter.castToBool(new BN(1).toSM({ + endian: 'little' + })).should.equal(true); + Interpreter.castToBool(new BN(-1).toSM({ + endian: 'little' + })).should.equal(true); + + var buf = new Buffer('00', 'hex'); + var bool = BN.fromSM(buf, { + endian: 'little' + }).cmp(BN.Zero) !== 0; + Interpreter.castToBool(buf).should.equal(bool); + }); + + }); + + describe('#verifyWitnessProgram', function() { + it('will return true if witness program greater than 0', function() { + var si = Interpreter(); + var version = 1; + var program = new Buffer('bcbd1db07ce89d1f4050645c26c90ce78b67eff78460002a4d5c10410958e064', 'hex'); + var witness = [new Buffer('bda0eeeb166c8bfeaee88dedc8efa82d3bea35aac5be253902f59d52908bfe25', 'hex')]; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(true); + }); + it('will return false with error if witness length is 0', function() { + var si = Interpreter(); + var version = 0; + var program = new Buffer('bcbd1db07ce89d1f4050645c26c90ce78b67eff78460002a4d5c10410958e064', 'hex'); + var witness = []; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY'); + }); + it('will return false if program hash mismatch (version 0, 32 byte program)', function() { + var si = Interpreter(); + var version = 0; + var program = new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'); + var witness = [ + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') + ]; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH'); + }); + it('will return false if witness stack doesn\'t have two items (version 0, 20 byte program)', function() { + var si = Interpreter(); + var version = 0; + var program = new Buffer('b8bcb07f6344b42ab04250c86a6e8b75d3fdbbc6', 'hex'); + var witness = [ + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') + ]; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH'); + }); + it('will return false if program wrong length for version 0', function() { + var si = Interpreter(); + var version = 0; + var program = new Buffer('b8bcb07f6344b42ab04250c86a6e8b75d3', 'hex'); + var witness = [ + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') + ]; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH'); + }); + it('will return false with discourage upgradable witness program', function() { + var si = Interpreter(); + var version = 1; + var program = new Buffer('b8bcb07f6344b42ab04250c86a6e8b75d3fdbbc6', 'hex'); + var witness = [ + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') + ]; + var satoshis = 1; + var flags = Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM'); + }); + it('will return false with error if stack doesn\'t have exactly one item', function() { + var si = Interpreter(); + si.evaluate = sinon.stub().returns(true); + var version = 0; + var program = new Buffer('b8bcb07f6344b42ab04250c86a6e8b75d3fdbbc6', 'hex'); + var witness = [ + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') + ]; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_EVAL_FALSE'); + }); + it('will return false if last item in stack casts to false', function() { + var si = Interpreter(); + si.evaluate = function() { + si.stack = [new Buffer('00', 'hex')]; + return true; + }; + var version = 0; + var program = new Buffer('b8bcb07f6344b42ab04250c86a6e8b75d3fdbbc6', 'hex'); + var witness = [ + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex') + ]; + var satoshis = 1; + var flags = 0; + si.verifyWitnessProgram(version, program, witness, satoshis, flags).should.equal(false); + si.errstr.should.equal('SCRIPT_ERR_EVAL_FALSE_IN_STACK'); + }); + }); + + describe('#verify', function() { + + it('should verify these trivial scripts', function() { + var verified; + var si = Interpreter(); + verified = si.verify(Script('OP_1'), Script('OP_1')); + verified.should.equal(true); + verified = Interpreter().verify(Script('OP_1'), Script('OP_0')); + verified.should.equal(false); + verified = Interpreter().verify(Script('OP_0'), Script('OP_1')); + verified.should.equal(true); + verified = Interpreter().verify(Script('OP_CODESEPARATOR'), Script('OP_1')); + verified.should.equal(true); + verified = Interpreter().verify(Script(''), Script('OP_DEPTH OP_0 OP_EQUAL')); + verified.should.equal(true); + verified = Interpreter().verify(Script('OP_1 OP_2'), Script('OP_2 OP_EQUALVERIFY OP_1 OP_EQUAL')); + verified.should.equal(true); + verified = Interpreter().verify(Script('9 0x000000000000000010'), Script('')); + verified.should.equal(true); + verified = Interpreter().verify(Script('OP_1'), Script('OP_15 OP_ADD OP_16 OP_EQUAL')); + verified.should.equal(true); + verified = Interpreter().verify(Script('OP_0'), Script('OP_IF OP_VER OP_ELSE OP_1 OP_ENDIF')); + verified.should.equal(true); + }); + + it('should verify these simple transaction', function() { + // first we create a transaction + var privateKey = new PrivateKey('cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY'); + var publicKey = privateKey.publicKey; + var fromAddress = publicKey.toAddress(); + var toAddress = 'mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc'; + var scriptPubkey = Script.buildPublicKeyHashOut(fromAddress); + var utxo = { + address: fromAddress, + txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + outputIndex: 0, + script: scriptPubkey, + satoshis: 100000 + }; + var tx = new Transaction() + .from(utxo) + .to(toAddress, 100000) + .sign(privateKey); + + // we then extract the signature from the first input + var inputIndex = 0; + var signature = tx.getSignatures(privateKey)[inputIndex].signature; + + var scriptSig = Script.buildPublicKeyHashIn(publicKey, signature); + var flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_STRICTENC; + var verified = Interpreter().verify(scriptSig, scriptPubkey, tx, inputIndex, flags); + verified.should.equal(true); + }); + }); + + + var getFlags = function getFlags(flagstr) { + var flags = 0; + if (flagstr.indexOf('NONE') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_NONE; + } + if (flagstr.indexOf('P2SH') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_P2SH; + } + if (flagstr.indexOf('STRICTENC') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_STRICTENC; + } + if (flagstr.indexOf('DERSIG') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_DERSIG; + } + if (flagstr.indexOf('LOW_S') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_LOW_S; + } + if (flagstr.indexOf('NULLDUMMY') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_NULLDUMMY; + } + if (flagstr.indexOf('SIGPUSHONLY') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_SIGPUSHONLY; + } + if (flagstr.indexOf('MINIMALDATA') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_MINIMALDATA; + } + if (flagstr.indexOf('DISCOURAGE_UPGRADABLE_NOPS') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS; + } + if (flagstr.indexOf('CHECKLOCKTIMEVERIFY') !== -1) { + flags = flags | Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY; + } + return flags; + }; + + + var testToFromString = function(script) { + var s = script.toString(); + Script.fromString(s).toString().should.equal(s); + }; + + var testFixture = function(vector, expected) { + var scriptSig = Script.fromBitcoindString(vector[0]); + var scriptPubkey = Script.fromBitcoindString(vector[1]); + var flags = getFlags(vector[2]); + + var hashbuf = new Buffer(32); + hashbuf.fill(0); + var credtx = new Transaction(); + credtx.uncheckedAddInput(new Transaction.Input({ + prevTxId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 0xffffffff, + sequenceNumber: 0xffffffff, + script: Script('OP_0 OP_0') + })); + credtx.addOutput(new Transaction.Output({ + script: scriptPubkey, + satoshis: 0 + })); + var idbuf = credtx.id; + + var spendtx = new Transaction(); + spendtx.uncheckedAddInput(new Transaction.Input({ + prevTxId: idbuf.toString('hex'), + outputIndex: 0, + sequenceNumber: 0xffffffff, + script: scriptSig + })); + spendtx.addOutput(new Transaction.Output({ + script: new Script(), + satoshis: 0 + })); + + var interp = new Interpreter(); + var verified = interp.verify(scriptSig, scriptPubkey, spendtx, 0, flags); + verified.should.equal(expected); + }; + describe('bitcoind script evaluation fixtures', function() { + var testAllFixtures = function(set, expected) { + var c = 0; + set.forEach(function(vector) { + if (vector.length === 1) { + return; + } + c++; + var descstr = vector[3]; + var fullScriptString = vector[0] + ' ' + vector[1]; + var comment = descstr ? (' (' + descstr + ')') : ''; + it('should pass script_' + (expected ? '' : 'in') + 'valid ' + + 'vector #' + c + ': ' + fullScriptString + comment, + function() { + testFixture(vector, expected); + }); + }); + }; + testAllFixtures(script_valid, true); + testAllFixtures(script_invalid, false); + + }); + describe('bitcoind transaction evaluation fixtures', function() { + var test_txs = function(set, expected) { + var c = 0; + set.forEach(function(vector) { + if (vector.length === 1) { + return; + } + c++; + var cc = c; //copy to local + it('should pass tx_' + (expected ? '' : 'in') + 'valid vector ' + cc, function() { + var inputs = vector[0]; + var txhex = vector[1]; + var flags = getFlags(vector[2]); + + var map = {}; + inputs.forEach(function(input) { + var txid = input[0]; + var txoutnum = input[1]; + var scriptPubKeyStr = input[2]; + if (txoutnum === -1) { + txoutnum = 0xffffffff; //bitcoind casts -1 to an unsigned int + } + map[txid + ':' + txoutnum] = Script.fromBitcoindString(scriptPubKeyStr); + }); + + var tx = new Transaction(txhex); + var allInputsVerified = true; + tx.inputs.forEach(function(txin, j) { + if (txin.isNull()) { + return; + } + var scriptSig = txin.script; + var txidhex = txin.prevTxId.toString('hex'); + var txoutnum = txin.outputIndex; + var scriptPubkey = map[txidhex + ':' + txoutnum]; + should.exist(scriptPubkey); + (scriptSig !== undefined).should.equal(true); + var interp = new Interpreter(); + var verified = interp.verify(scriptSig, scriptPubkey, tx, j, flags); + if (!verified) { + allInputsVerified = false; + } + }); + var txVerified = tx.verify(); + txVerified = (txVerified === true) ? true : false; + allInputsVerified = allInputsVerified && txVerified; + allInputsVerified.should.equal(expected); + + }); + }); + }; + test_txs(tx_valid, true); + test_txs(tx_invalid, false); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/script/script.js b/packages/kauri-bitcore-lib/test/script/script.js new file mode 100644 index 0000000..e1ff03f --- /dev/null +++ b/packages/kauri-bitcore-lib/test/script/script.js @@ -0,0 +1,1079 @@ +'use strict'; + +var should = require('chai').should(); +var expect = require('chai').expect; +var bitcore = require('../..'); + +var BufferUtil = bitcore.util.buffer; +var Script = bitcore.Script; +var Networks = bitcore.Networks; +var Opcode = bitcore.Opcode; +var PublicKey = bitcore.PublicKey; +var Address = bitcore.Address; + +describe('Script', function() { + + it('should make a new script', function() { + var script = new Script(); + expect(script).to.be.instanceof(Script); + expect(script.chunks).to.deep.equal([]); + }); + + it('should make a new script when from is null', function() { + var script = new Script(null); + expect(script).to.be.instanceof(Script); + expect(script.chunks).to.deep.equal([]); + }); + + describe('#set', function() { + var script = new Script(); + + it('should be object', function() { + expect(function() { + script.set(null); + }).to.throw(/^Invalid Argument$/) + }); + + it('chunks should be array', function() { + expect(function() { + script.set({chunks: 1}); + }).to.throw(/^Invalid Argument$/); + }); + + it('set chunks', function() { + script.set({chunks: [1]}); + expect(script.chunks).to.deep.equal([1]); + }); + }); + + describe('#fromBuffer', function() { + + it('should parse this buffer containing an OP code', function() { + var buf = new Buffer(1); + buf[0] = Opcode.OP_0; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].opcodenum.should.equal(buf[0]); + }); + + it('should parse this buffer containing another OP code', function() { + var buf = new Buffer(1); + buf[0] = Opcode.OP_CHECKMULTISIG; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].opcodenum.should.equal(buf[0]); + }); + + it('should parse this buffer containing three bytes of data', function() { + var buf = new Buffer([3, 1, 2, 3]); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + }); + + it('should parse this buffer containing OP_PUSHDATA1 and three bytes of data', function() { + var buf = new Buffer([0, 0, 1, 2, 3]); + buf[0] = Opcode.OP_PUSHDATA1; + buf.writeUInt8(3, 1); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + }); + + it('should parse this buffer containing OP_PUSHDATA2 and three bytes of data', function() { + var buf = new Buffer([0, 0, 0, 1, 2, 3]); + buf[0] = Opcode.OP_PUSHDATA2; + buf.writeUInt16LE(3, 1); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + }); + + it('should parse this buffer containing OP_PUSHDATA4 and three bytes of data', function() { + var buf = new Buffer([0, 0, 0, 0, 0, 1, 2, 3]); + buf[0] = Opcode.OP_PUSHDATA4; + buf.writeUInt16LE(3, 1); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + }); + + it('should parse this buffer an OP code, data, and another OP code', function() { + var buf = new Buffer([0, 0, 0, 0, 0, 0, 1, 2, 3, 0]); + buf[0] = Opcode.OP_0; + buf[1] = Opcode.OP_PUSHDATA4; + buf.writeUInt16LE(3, 2); + buf[buf.length - 1] = Opcode.OP_0; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(3); + script.chunks[0].opcodenum.should.equal(buf[0]); + script.chunks[1].buf.toString('hex').should.equal('010203'); + script.chunks[2].opcodenum.should.equal(buf[buf.length - 1]); + }); + + }); + + describe('#toBuffer', function() { + + it('should output this buffer containing an OP code', function() { + var buf = new Buffer(1); + buf[0] = Opcode.OP_0; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].opcodenum.should.equal(buf[0]); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should output this buffer containing another OP code', function() { + var buf = new Buffer(1); + buf[0] = Opcode.OP_CHECKMULTISIG; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].opcodenum.should.equal(buf[0]); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should output this buffer containing three bytes of data', function() { + var buf = new Buffer([3, 1, 2, 3]); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should output this buffer containing OP_PUSHDATA1 and three bytes of data', function() { + var buf = new Buffer([0, 0, 1, 2, 3]); + buf[0] = Opcode.OP_PUSHDATA1; + buf.writeUInt8(3, 1); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should output this buffer containing OP_PUSHDATA2 and three bytes of data', function() { + var buf = new Buffer([0, 0, 0, 1, 2, 3]); + buf[0] = Opcode.OP_PUSHDATA2; + buf.writeUInt16LE(3, 1); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should output this buffer containing OP_PUSHDATA4 and three bytes of data', function() { + var buf = new Buffer([0, 0, 0, 0, 0, 1, 2, 3]); + buf[0] = Opcode.OP_PUSHDATA4; + buf.writeUInt16LE(3, 1); + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(1); + script.chunks[0].buf.toString('hex').should.equal('010203'); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + it('should output this buffer an OP code, data, and another OP code', function() { + var buf = new Buffer([0, 0, 0, 0, 0, 0, 1, 2, 3, 0]); + buf[0] = Opcode.OP_0; + buf[1] = Opcode.OP_PUSHDATA4; + buf.writeUInt16LE(3, 2); + buf[buf.length - 1] = Opcode.OP_0; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(3); + script.chunks[0].opcodenum.should.equal(buf[0]); + script.chunks[1].buf.toString('hex').should.equal('010203'); + script.chunks[2].opcodenum.should.equal(buf[buf.length - 1]); + script.toBuffer().toString('hex').should.equal(buf.toString('hex')); + }); + + }); + + describe('#fromASM', function() { + it('should parse this known script in ASM', function() { + var asm = 'OP_DUP OP_HASH160 f4c03610e60ad15100929cc23da2f3a799af1725 OP_EQUALVERIFY OP_CHECKSIG'; + var script = Script.fromASM(asm); + script.chunks[0].opcodenum.should.equal(Opcode.OP_DUP); + script.chunks[1].opcodenum.should.equal(Opcode.OP_HASH160); + script.chunks[2].opcodenum.should.equal(20); + script.chunks[2].buf.toString('hex').should.equal('f4c03610e60ad15100929cc23da2f3a799af1725'); + script.chunks[3].opcodenum.should.equal(Opcode.OP_EQUALVERIFY); + script.chunks[4].opcodenum.should.equal(Opcode.OP_CHECKSIG); + }); + }); + + describe('#fromString', function() { + + it('should parse these known scripts', function() { + Script.fromString('OP_0 OP_PUSHDATA4 3 0x010203 OP_0').toString().should.equal('OP_0 OP_PUSHDATA4 3 0x010203 OP_0'); + Script.fromString('OP_0 OP_PUSHDATA2 3 0x010203 OP_0').toString().should.equal('OP_0 OP_PUSHDATA2 3 0x010203 OP_0'); + Script.fromString('OP_0 OP_PUSHDATA1 3 0x010203 OP_0').toString().should.equal('OP_0 OP_PUSHDATA1 3 0x010203 OP_0'); + Script.fromString('OP_0 3 0x010203 OP_0').toString().should.equal('OP_0 3 0x010203 OP_0'); + }); + + }); + + describe('#toString', function() { + + it('should work with an empty script', function() { + var script = new Script(); + script.toString().should.equal(''); + }); + + it('should output this buffer an OP code, data, and another OP code', function() { + var buf = new Buffer([0, 0, 0, 0, 0, 0, 1, 2, 3, 0]); + buf[0] = Opcode.OP_0; + buf[1] = Opcode.OP_PUSHDATA4; + buf.writeUInt16LE(3, 2); + buf[buf.length - 1] = Opcode.OP_0; + var script = Script.fromBuffer(buf); + script.chunks.length.should.equal(3); + script.chunks[0].opcodenum.should.equal(buf[0]); + script.chunks[1].buf.toString('hex').should.equal('010203'); + script.chunks[2].opcodenum.should.equal(buf[buf.length - 1]); + script.toString().toString('hex').should.equal('OP_0 OP_PUSHDATA4 3 0x010203 OP_0'); + }); + + it('should output this known script as ASM', function() { + var script = Script.fromHex('76a914f4c03610e60ad15100929cc23da2f3a799af172588ac'); + script.toASM().should.equal('OP_DUP OP_HASH160 f4c03610e60ad15100929cc23da2f3a799af1725 OP_EQUALVERIFY OP_CHECKSIG'); + }); + + it('should output this known script with pushdata1 opcode as ASM', function() { + // network: livenet + // txid: dd6fabd2d879be7b8394ad170ff908e9a36b5d5d0b394508df0cca36d2931589 + var script = Script.fromHex('00483045022100beb1d83771c04faaeb40bded4f031ed0e0730aaab77cf70102ecd05734a1762002206f168fb00f3b9d7c04b8c78e1fc11e81b9caa49885a904bf22780a7e14a8373101483045022100a319839e37828bf164ff45de34a3fe22d542ebc8297c5d87dbc56fc3068ff9d5022077081a877b6e7f104d8a2fe0985bf2eb7de2e08edbac9499fc3710a353f65461014c69522103a70ae7bde64333461fb88aaafe12ad6c67ca17c8213642469ae191e0aabc7251210344a62338c8ddf138771516d38187146242db50853aa588bcb10a5e49c86421a52102b52a1aed304c4d6cedcf82911f90ca6e1ffed0a5b8f7f19c68213d6fcbde677e53ae'); + script.toASM().should.equal('0 3045022100beb1d83771c04faaeb40bded4f031ed0e0730aaab77cf70102ecd05734a1762002206f168fb00f3b9d7c04b8c78e1fc11e81b9caa49885a904bf22780a7e14a8373101 3045022100a319839e37828bf164ff45de34a3fe22d542ebc8297c5d87dbc56fc3068ff9d5022077081a877b6e7f104d8a2fe0985bf2eb7de2e08edbac9499fc3710a353f6546101 522103a70ae7bde64333461fb88aaafe12ad6c67ca17c8213642469ae191e0aabc7251210344a62338c8ddf138771516d38187146242db50853aa588bcb10a5e49c86421a52102b52a1aed304c4d6cedcf82911f90ca6e1ffed0a5b8f7f19c68213d6fcbde677e53ae'); + }); + + it('should OP_1NEGATE opcode as -1 with ASM', function() { + var script = Script.fromString('OP_1NEGATE'); + script.toASM().should.equal('-1'); + }); + + }); + + describe('toHex', function() { + it('should return an hexa string "03010203" as expected from [3, 1, 2, 3]', function() { + var buf = new Buffer([3, 1, 2, 3]); + var script = Script.fromBuffer(buf); + script.toHex().should.equal('03010203'); + }); + }); + + describe('#isDataOut', function() { + + it('should know this is a (blank) OP_RETURN script', function() { + Script('OP_RETURN').isDataOut().should.equal(true); + }); + + it('validates that this 40-byte OP_RETURN is standard', function() { + var buf = new Buffer(40); + buf.fill(0); + Script('OP_RETURN 40 0x' + buf.toString('hex')).isDataOut().should.equal(true); + }); + it('validates that this 80-byte OP_RETURN is standard', function() { + var buf = new Buffer(80); + buf.fill(0); + Script('OP_RETURN OP_PUSHDATA1 80 0x' + buf.toString('hex')).isDataOut().should.equal(true); + }); + + it('validates that this 40-byte long OP_CHECKMULTISIG is not standard op_return', function() { + var buf = new Buffer(40); + buf.fill(0); + Script('OP_CHECKMULTISIG 40 0x' + buf.toString('hex')).isDataOut().should.equal(false); + }); + + it('validates that this 81-byte OP_RETURN is not a valid standard OP_RETURN', function() { + var buf = new Buffer(81); + buf.fill(0); + Script('OP_RETURN OP_PUSHDATA1 81 0x' + buf.toString('hex')).isDataOut().should.equal(false); + }); + }); + + describe('#isPublicKeyIn', function() { + it('correctly identify scriptSig as a public key in', function() { + // from txid: 5c85ed63469aa9971b5d01063dbb8bcdafd412b2f51a3d24abf2e310c028bbf8 + // and input index: 5 + var scriptBuffer = new Buffer('483045022050eb59c79435c051f45003d9f82865c8e4df5699d7722e77113ef8cadbd92109022100d4ab233e070070eb8e0e62e3d2d2eb9474a5bf135c9eda32755acb0875a6c20601', 'hex'); + var script = bitcore.Script.fromBuffer(scriptBuffer); + script.isPublicKeyIn().should.equal(true); + }); + }); + + describe('#isPublicKeyHashIn', function() { + + it('should identify this known pubkeyhashin (uncompressed pubkey version)', function() { + Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 65 0x04e365859b3c78a8b7c202412b949ebca58e147dba297be29eee53cd3e1d300a6419bc780cc9aec0dc94ed194e91c8f6433f1b781ee00eac0ead2aae1e8e0712c6').isPublicKeyHashIn().should.equal(true); + }); + + it('should identify this known pubkeyhashin (hybrid pubkey version w/06)', function() { + Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 65 0x06e365859b3c78a8b7c202412b949ebca58e147dba297be29eee53cd3e1d300a6419bc780cc9aec0dc94ed194e91c8f6433f1b781ee00eac0ead2aae1e8e0712c6').isPublicKeyHashIn().should.equal(true); + }); + + it('should identify this known pubkeyhashin (hybrid pubkey version w/07)', function() { + Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 65 0x07e365859b3c78a8b7c202412b949ebca58e147dba297be29eee53cd3e1d300a6419bc780cc9aec0dc94ed194e91c8f6433f1b781ee00eac0ead2aae1e8e0712c6').isPublicKeyHashIn().should.equal(true); + }); + + it('should identify this known pubkeyhashin (compressed pubkey w/ 0x02)', function() { + Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 21 0x02aec6b86621e7fef63747fbfd6a6e7d54c8e1052044ef2dd2c5e46656ef1194d4').isPublicKeyHashIn().should.equal(true); + }); + + it('should identify this known pubkeyhashin (compressed pubkey w/ 0x03)', function() { + Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 21 0x03e724d93c4fda5f1236c525de7ffac6c5f1f72b0f5cdd1fc4b4f5642b6d055fcc').isPublicKeyHashIn().should.equal(true); + }); + + it('should identify this known non-pubkeyhashin (bad ops length)', function() { + Script('73 0x3046022100bb3c194a30e460d81d34be0a230179c043a656f67e3c5c8bf47eceae7c4042ee0221008bf54ca11b2985285be0fd7a212873d243e6e73f5fad57e8eb14c4f39728b8c601 65 0x04e365859b3c78a8b7c202412b949ebca58e147dba297be29eee53cd3e1d300a6419bc780cc9aec0dc94ed194e91c8f6433f1b781ee00eac0ead2aae1e8e0712c6 OP_CHECKSIG').isPublicKeyHashIn().should.equal(false); + }); + + it('should identify this known pubkey', function() { + Script('70 0x3043021f336721e4343f67c835cbfd465477db09073dc38a936f9c445d573c1c8a7fdf022064b0e3cb6892a9ecf870030e3066bc259e1f24841c9471d97f9be08b73f6530701 33 0x0370b2e1dcaa8f51cb0ead1221dd8cb31721502b3b5b7d4b374d263dfec63a4369').isPublicKeyHashIn().should.equal(true); + }); + + it('should identify this known non-pubkeyhashin (bad version)', function() { + Script('70 0x3043021f336721e4343f67c835cbfd465477db09073dc38a936f9c445d573c1c8a7fdf022064b0e3cb6892a9ecf870030e3066bc259e1f24841c9471d97f9be08b73f6530701 33 0x1270b2e1dcaa8f51cb0ead1221dd8cb31721502b3b5b7d4b374d263dfec63a4369').isPublicKeyHashIn().should.equal(false); + }); + + it('should identify this known non-pubkeyhashin (bad signature version)', function() { + Script('70 0x4043021f336721e4343f67c835cbfd465477db09073dc38a936f9c445d573c1c8a7fdf022064b0e3cb6892a9ecf870030e3066bc259e1f24841c9471d97f9be08b73f6530701 33 0x0370b2e1dcaa8f51cb0ead1221dd8cb31721502b3b5b7d4b374d263dfec63a4369').isPublicKeyHashIn().should.equal(false); + }); + + it('should identify this known non-pubkeyhashin (no public key)', function() { + Script('70 0x3043021f336721e4343f67c835cbfd465477db09073dc38a936f9c445d573c1c8a7fdf022064b0e3cb6892a9ecf870030e3066bc259e1f24841c9471d97f9be08b73f6530701 OP_CHECKSIG').isPublicKeyHashIn().should.equal(false); + }); + + it('should identify this known non-pubkeyhashin (no signature)', function() { + Script('OP_DROP OP_CHECKSIG').isPublicKeyHashIn().should.equal(false); + }); + + }); + + describe('#isPublicKeyHashOut', function() { + + it('should identify this known pubkeyhashout as pubkeyhashout', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG').isPublicKeyHashOut().should.equal(true); + }); + + it('should identify this known non-pubkeyhashout as not pubkeyhashout 1', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000').isPublicKeyHashOut().should.equal(false); + }); + + it('should identify this known non-pubkeyhashout as not pubkeyhashout 2', function() { + Script('OP_DUP OP_HASH160 2 0x0000 OP_EQUALVERIFY OP_CHECKSIG').isPublicKeyHashOut().should.equal(false); + }); + + }); + + describe('#isMultisigOut', function() { + it('should identify known multisig out 1', function() { + Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG').isMultisigOut().should.equal(true); + }); + it('should identify known multisig out 2', function() { + Script('OP_1 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG').isMultisigOut().should.equal(true); + }); + it('should identify known multisig out 3', function() { + Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 OP_3 OP_CHECKMULTISIG').isMultisigOut().should.equal(true); + }); + + it('should identify non-multisig out 1', function() { + Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG OP_EQUAL').isMultisigOut().should.equal(false); + }); + it('should identify non-multisig out 2', function() { + Script('OP_2').isMultisigOut().should.equal(false); + }); + }); + + describe('#isMultisigIn', function() { + it('should identify multisig in 1', function() { + Script('OP_0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01').isMultisigIn().should.equal(true); + }); + it('should identify multisig in 2', function() { + Script('OP_0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01 0x48 0x30450220357011fd3b3ad2b8f2f2d01e05dc6108b51d2a245b4ef40c112d6004596f0475022100a8208c93a39e0c366b983f9a80bfaf89237fcd64ca543568badd2d18ee2e1d7501').isMultisigIn().should.equal(true); + }); + it('should identify non-multisig in 1', function() { + Script('0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01').isMultisigIn().should.equal(false); + }); + it('should identify non-multisig in 2', function() { + Script('OP_0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01 OP_0').isMultisigIn().should.equal(false); + }); + }); + + describe('#isScriptHashIn', function() { + it('should identify this known scripthashin', function() { + var sstr = 'OP_0 73 0x30460221008ca148504190c10eea7f5f9c283c719a37be58c3ad617928011a1bb9570901d2022100ced371a23e86af6f55ff4ce705c57d2721a09c4d192ca39d82c4239825f75a9801 72 0x30450220357011fd3b3ad2b8f2f2d01e05dc6108b51d2a245b4ef40c112d6004596f0475022100a8208c93a39e0c366b983f9a80bfaf89237fcd64ca543568badd2d18ee2e1d7501 OP_PUSHDATA1 105 0x5221024c02dff2f0b8263a562a69ec875b2c95ffad860f428acf2f9e8c6492bd067d362103546324a1351a6b601c623b463e33b6103ca444707d5b278ece1692f1aa7724a42103b1ad3b328429450069cc3f9fa80d537ee66ba1120e93f3f185a5bf686fb51e0a53ae'; + var s = Script(sstr); + s.toString().should.equal(sstr); + s.isScriptHashIn().should.equal(true); + }); + + it('should identify this known non-scripthashin', function() { + Script('20 0000000000000000000000000000000000000000 OP_CHECKSIG').isScriptHashIn().should.equal(false); + }); + + it('should identify this problematic non-scripthashin scripts', function() { + var s = new Script('71 0x3044022017053dad84aa06213749df50a03330cfd24d6' + + 'b8e7ddbb6de66c03697b78a752a022053bc0faca8b4049fb3944a05fcf7c93b2861' + + '734d39a89b73108f605f70f5ed3401 33 0x0225386e988b84248dc9c30f784b06e' + + '02fdec57bbdbd443768eb5744a75ce44a4c'); + var s2 = new Script('OP_RETURN 32 0x19fdb20634911b6459e6086658b3a6ad2dc6576bd6826c73ee86a5f9aec14ed9'); + s.isScriptHashIn().should.equal(false); + s2.isScriptHashIn().should.equal(false); + }); + it('identifies this other problematic non-p2sh in', function() { + var s = Script.fromString('73 0x3046022100dc7a0a812de14acc479d98ae209402cc9b5e0692bc74b9fe0a2f083e2f9964b002210087caf04a711bebe5339fd7554c4f7940dc37be216a3ae082424a5e164faf549401'); + s.isScriptHashIn().should.equal(false); + }); + }); + + describe('#isScripthashOut', function() { + + it('should identify this known p2shout as p2shout', function() { + Script('OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUAL').isScriptHashOut().should.equal(true); + }); + + it('should identify result of .isScriptHashOut() as p2sh', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG') + .toScriptHashOut().isScriptHashOut().should.equal(true); + }); + + it('should identify these known non-p2shout as not p2shout', function() { + Script('OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUAL OP_EQUAL').isScriptHashOut().should.equal(false); + Script('OP_HASH160 21 0x000000000000000000000000000000000000000000 OP_EQUAL').isScriptHashOut().should.equal(false); + }); + + }); + + describe('#isWitnessScriptHashOut', function() { + it('should recognize this script as p2wsh', function() { + Script('OP_0 32 0xa99d08fbec6958f4d4a3776c3728ec448934d25fe1142054b8b68bac866dfc3a') + .isWitnessScriptHashOut().should.equal(true); + Script('0020a99d08fbec6958f4d4a3776c3728ec448934d25fe1142054b8b68bac866dfc3a') + .isWitnessScriptHashOut().should.equal(true); + }); + it('should NOT identify as p2wsh', function() { + Script('OP_0 20 0x799d283e7f92af1dd242bf4eea513c6efd117de2') + .isWitnessScriptHashOut().should.equal(false); + }); + }); + + describe('#isWitnessPublicKeyHashOut', function() { + it('should identify as p2wpkh', function() { + Script('OP_0 20 0x799d283e7f92af1dd242bf4eea513c6efd117de2') + .isWitnessPublicKeyHashOut().should.equal(true); + Script('0014799d283e7f92af1dd242bf4eea513c6efd117de2').isWitnessPublicKeyHashOut().should.equal(true); + }); + it('should NOT identify as p2wpkh', function() { + Script('OP_0 32 0xa99d08fbec6958f4d4a3776c3728ec448934d25fe1142054b8b68bac866dfc3a') + .isWitnessPublicKeyHashOut().should.equal(false); + }); + }); + + describe('#isWitnessProgram', function() { + it('will default values to empty object', function() { + Script('OP_0 20 0x799d283e7f92af1dd242bf4eea513c6efd117de2') + .isWitnessProgram().should.equal(true); + }); + it('will return false if script is data push longer than 40 bytes', function() { + Script('OP_0 42 0xd06863c385592423903682926825c495b6cf88fd7cd6159ffd72f778ca475d3046e7b87835d3b457cd') + .isWitnessProgram().should.equal(false); + }); + it('will return false if first byte op_code is greater than OP_16', function() { + Script('OP_NOP 20 0x799d283e7f92af1dd242bf4eea513c6efd117de2') + .isWitnessProgram().should.equal(false); + }); + it('will return true with datapush of 20', function() { + var values = {}; + Script('OP_0 20 0x799d283e7f92af1dd242bf4eea513c6efd117de2') + .isWitnessProgram(values).should.equal(true); + values.version.should.equal(0); + values.program.toString('hex').should.equal('799d283e7f92af1dd242bf4eea513c6efd117de2'); + }); + it('will return true with datapush of 32', function() { + var values = {}; + Script('OP_0 32 0xc756f6d660d4aaad55534cac599a0d9bf5c7e8f70363d22926291811a168c620') + .isWitnessProgram(values).should.equal(true); + values.version.should.equal(0); + values.program.toString('hex').should.equal('c756f6d660d4aaad55534cac599a0d9bf5c7e8f70363d22926291811a168c620'); + }); + }); + + describe('#isPushOnly', function() { + it('should know these scripts are or aren\'t push only', function() { + Script('OP_NOP 1 0x01').isPushOnly().should.equal(false); + Script('OP_0').isPushOnly().should.equal(true); + Script('OP_0 OP_RETURN').isPushOnly().should.equal(false); + Script('OP_PUSHDATA1 5 0x1010101010').isPushOnly().should.equal(true); + // like bitcoind, we regard OP_RESERVED as being "push only" + Script('OP_RESERVED').isPushOnly().should.equal(true); + }); + }); + + describe('#classifyInput', function() { + it('shouldn\'t classify public key hash out', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG').classifyInput().should.equal(Script.types.UNKNOWN); + }); + it('should classify public key hash in', function() { + Script('47 0x3044022077a8d81e656c4a1c1721e68ce35fa0b27f13c342998e75854858c12396a15ffa02206378a8c6959283c008c87a14a9c0ada5cf3934ac5ee29f1fef9cac6969783e9801 21 0x03993c230da7dabb956292851ae755f971c50532efc095a16bee07f83ab9d262df').classifyInput().should.equal(Script.types.PUBKEYHASH_IN); + }); + it('shouldn\'t classify script hash out', function() { + Script('OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUAL').classifyInput().should.equal(Script.types.UNKNOWN); + }); + it('should classify script hash in', function() { + Script('OP_0 73 0x30460221008ca148504190c10eea7f5f9c283c719a37be58c3ad617928011a1bb9570901d2022100ced371a23e86af6f55ff4ce705c57d2721a09c4d192ca39d82c4239825f75a9801 72 0x30450220357011fd3b3ad2b8f2f2d01e05dc6108b51d2a245b4ef40c112d6004596f0475022100a8208c93a39e0c366b983f9a80bfaf89237fcd64ca543568badd2d18ee2e1d7501 OP_PUSHDATA1 105 0x5221024c02dff2f0b8263a562a69ec875b2c95ffad860f428acf2f9e8c6492bd067d362103546324a1351a6b601c623b463e33b6103ca444707d5b278ece1692f1aa7724a42103b1ad3b328429450069cc3f9fa80d537ee66ba1120e93f3f185a5bf686fb51e0a53ae').classifyInput().should.equal(Script.types.SCRIPTHASH_IN); + }); + it('shouldn\'t classify MULTISIG out', function() { + Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG').classifyInput().should.equal(Script.types.UNKNOWN); + }); + it('should classify MULTISIG in', function() { + Script('OP_0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01').classifyInput().should.equal(Script.types.MULTISIG_IN); + }); + it('shouldn\'t classify OP_RETURN data out', function() { + Script('OP_RETURN 1 0x01').classifyInput().should.equal(Script.types.UNKNOWN); + }); + it('shouldn\'t classify public key out', function() { + Script('41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 OP_CHECKSIG').classifyInput().should.equal(Script.types.UNKNOWN); + }); + it('should classify public key in', function() { + Script('47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501').classifyInput().should.equal(Script.types.PUBKEY_IN); + }); + it('should classify unknown', function() { + Script('OP_TRUE OP_FALSE').classifyInput().should.equal(Script.types.UNKNOWN); + }); + it('should classify scriptHashIn, eventhough it\'s opreturn', function() { + Script('6a1c3630fd3792f7e847ae5e27985dfb127542ef37ac2a5147c3b9cec7ba').classifyInput().should.equal(Script.types.SCRIPTHASH_IN); + }); + }); + + describe('#classifyOutput', function() { + it('should classify public key hash out', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG').classifyOutput().should.equal(Script.types.PUBKEYHASH_OUT); + }); + it('shouldn\'t classify public key hash in', function() { + Script('47 0x3044022077a8d81e656c4a1c1721e68ce35fa0b27f13c342998e75854858c12396a15ffa02206378a8c6959283c008c87a14a9c0ada5cf3934ac5ee29f1fef9cac6969783e9801 21 0x03993c230da7dabb956292851ae755f971c50532efc095a16bee07f83ab9d262df').classifyOutput().should.equal(Script.types.UNKNOWN); + }); + it('should classify script hash out', function() { + Script('OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUAL').classifyOutput().should.equal(Script.types.SCRIPTHASH_OUT); + }); + it('shouldn\'t classify script hash in', function() { + Script('OP_0 73 0x30460221008ca148504190c10eea7f5f9c283c719a37be58c3ad617928011a1bb9570901d2022100ced371a23e86af6f55ff4ce705c57d2721a09c4d192ca39d82c4239825f75a9801 72 0x30450220357011fd3b3ad2b8f2f2d01e05dc6108b51d2a245b4ef40c112d6004596f0475022100a8208c93a39e0c366b983f9a80bfaf89237fcd64ca543568badd2d18ee2e1d7501 OP_PUSHDATA1 105 0x5221024c02dff2f0b8263a562a69ec875b2c95ffad860f428acf2f9e8c6492bd067d362103546324a1351a6b601c623b463e33b6103ca444707d5b278ece1692f1aa7724a42103b1ad3b328429450069cc3f9fa80d537ee66ba1120e93f3f185a5bf686fb51e0a53ae').classifyOutput().should.equal(Script.types.UNKNOWN); + }); + it('should classify MULTISIG out', function() { + Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG').classifyOutput().should.equal(Script.types.MULTISIG_OUT); + }); + it('shouldn\'t classify MULTISIG in', function() { + Script('OP_0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01').classifyOutput().should.equal(Script.types.UNKNOWN); + }); + it('should classify OP_RETURN data out', function() { + Script('OP_RETURN 1 0x01').classifyOutput().should.equal(Script.types.DATA_OUT); + }); + it('should classify public key out', function() { + Script('41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 OP_CHECKSIG').classifyOutput().should.equal(Script.types.PUBKEY_OUT); + }); + it('shouldn\'t classify public key in', function() { + Script('47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501').classifyOutput().should.equal(Script.types.UNKNOWN); + }); + it('should classify unknown', function() { + Script('OP_TRUE OP_FALSE').classifyOutput().should.equal(Script.types.UNKNOWN); + }); + it('should classify opreturn eventhough it also looks like a scriptHashIn', function() { + Script('6a1c3630fd3792f7e847ae5e27985dfb127542ef37ac2a5147c3b9cec7ba').classifyOutput().should.equal(Script.types.DATA_OUT); + }); + }); + + describe('#classify', function() { + it('should classify public key hash out', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG').classify().should.equal(Script.types.PUBKEYHASH_OUT); + }); + it('should classify public key hash in', function() { + Script('47 0x3044022077a8d81e656c4a1c1721e68ce35fa0b27f13c342998e75854858c12396a15ffa02206378a8c6959283c008c87a14a9c0ada5cf3934ac5ee29f1fef9cac6969783e9801 21 0x03993c230da7dabb956292851ae755f971c50532efc095a16bee07f83ab9d262df').classify().should.equal(Script.types.PUBKEYHASH_IN); + }); + it('should classify script hash out', function() { + Script('OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUAL').classify().should.equal(Script.types.SCRIPTHASH_OUT); + }); + it('should classify script hash in', function() { + Script('OP_0 73 0x30460221008ca148504190c10eea7f5f9c283c719a37be58c3ad617928011a1bb9570901d2022100ced371a23e86af6f55ff4ce705c57d2721a09c4d192ca39d82c4239825f75a9801 72 0x30450220357011fd3b3ad2b8f2f2d01e05dc6108b51d2a245b4ef40c112d6004596f0475022100a8208c93a39e0c366b983f9a80bfaf89237fcd64ca543568badd2d18ee2e1d7501 OP_PUSHDATA1 105 0x5221024c02dff2f0b8263a562a69ec875b2c95ffad860f428acf2f9e8c6492bd067d362103546324a1351a6b601c623b463e33b6103ca444707d5b278ece1692f1aa7724a42103b1ad3b328429450069cc3f9fa80d537ee66ba1120e93f3f185a5bf686fb51e0a53ae').classify().should.equal(Script.types.SCRIPTHASH_IN); + }); + it('should classify MULTISIG out', function() { + Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG').classify().should.equal(Script.types.MULTISIG_OUT); + }); + it('should classify MULTISIG in', function() { + Script('OP_0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01').classify().should.equal(Script.types.MULTISIG_IN); + }); + it('should classify OP_RETURN data out', function() { + Script('OP_RETURN 1 0x01').classify().should.equal(Script.types.DATA_OUT); + }); + it('should classify public key out', function() { + Script('41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 OP_CHECKSIG').classify().should.equal(Script.types.PUBKEY_OUT); + }); + it('should classify public key in', function() { + Script('47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501').classify().should.equal(Script.types.PUBKEY_IN); + }); + it('should classify unknown', function() { + Script('OP_TRUE OP_FALSE').classify().should.equal(Script.types.UNKNOWN); + }); + it('should classify opreturn eventhough it also looks like a scriptHashIn', function() { + Script('6a1c3630fd3792f7e847ae5e27985dfb127542ef37ac2a5147c3b9cec7ba').classifyInput().should.equal(Script.types.SCRIPTHASH_IN); + Script('6a1c3630fd3792f7e847ae5e27985dfb127542ef37ac2a5147c3b9cec7ba').classify().should.equal(Script.types.DATA_OUT); + }); + it('should classify scriptHashIn eventhough it is opreturn when script is marked is input', function() { + Script('6a1c3630fd3792f7e847ae5e27985dfb127542ef37ac2a5147c3b9cec7ba').classify().should.equal(Script.types.DATA_OUT); + var s = Script('6a1c3630fd3792f7e847ae5e27985dfb127542ef37ac2a5147c3b9cec7ba'); + s._isInput = true; // this is normally set by when Script is initiated as part if Input or Output objects + s.classify().should.equal(Script.types.SCRIPTHASH_IN); + }); + it('should classify unknown eventhough it is public key hash when marked as input', function() { + Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG').classify().should.equal(Script.types.PUBKEYHASH_OUT); + var s = Script('OP_DUP OP_HASH160 20 0x0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG'); + s._isInput = true; // this is normally set by when Script is initiated as part if Input or Output objects + s.classify().should.equal(Script.types.UNKNOWN); + }); + it('should classify unknown eventhough it is public key hash in when marked as output', function() { + var s = Script('47 0x3044022077a8d81e656c4a1c1721e68ce35fa0b27f13c342998e75854858c12396a15ffa02206378a8c6959283c008c87a14a9c0ada5cf3934ac5ee29f1fef9cac6969783e9801 21 0x03993c230da7dabb956292851ae755f971c50532efc095a16bee07f83ab9d262df'); + s.classify().should.equal(Script.types.PUBKEYHASH_IN); + s._isOutput = true; // this is normally set by when Script is initiated as part if Input or Output objects + s.classify().should.equal(Script.types.UNKNOWN); + }); + }); + + describe('#add and #prepend', function() { + + it('should add these ops', function() { + Script().add(1).add(10).add(186).toString().should.equal('0x01 0x0a 0xba'); + Script().add(1000).toString().should.equal('0x03e8'); + Script().add('OP_CHECKMULTISIG').toString().should.equal('OP_CHECKMULTISIG'); + Script().add('OP_1').add('OP_2').toString().should.equal('OP_1 OP_2'); + Script().add(Opcode.OP_CHECKMULTISIG).toString().should.equal('OP_CHECKMULTISIG'); + Script().add(Opcode.map.OP_CHECKMULTISIG).toString().should.equal('OP_CHECKMULTISIG'); + }); + + it('should prepend these ops', function() { + Script().prepend('OP_CHECKMULTISIG').toString().should.equal('OP_CHECKMULTISIG'); + Script().prepend('OP_1').prepend('OP_2').toString().should.equal('OP_2 OP_1'); + }); + + it('should add and prepend correctly', function() { + Script().add('OP_1').prepend('OP_2').add('OP_3').prepend('OP_4').toString() + .should.equal('OP_4 OP_2 OP_1 OP_3'); + }); + + it('should add these push data', function() { + var buf = new Buffer(1); + buf.fill(0); + Script().add(buf).toString().should.equal('1 0x00'); + buf = new Buffer(255); + buf.fill(0); + Script().add(buf).toString().should.equal('OP_PUSHDATA1 255 0x' + buf.toString('hex')); + buf = new Buffer(256); + buf.fill(0); + Script().add(buf).toString().should.equal('OP_PUSHDATA2 256 0x' + buf.toString('hex')); + buf = new Buffer(Math.pow(2, 16)); + buf.fill(0); + Script().add(buf).toString().should.equal('OP_PUSHDATA4 ' + Math.pow(2, 16) + ' 0x' + buf.toString('hex')); + }); + + it('should add both pushdata and non-pushdata chunks', function() { + Script().add('OP_CHECKMULTISIG').toString().should.equal('OP_CHECKMULTISIG'); + Script().add(Opcode.map.OP_CHECKMULTISIG).toString().should.equal('OP_CHECKMULTISIG'); + var buf = new Buffer(1); + buf.fill(0); + Script().add(buf).toString().should.equal('1 0x00'); + }); + + it('should work for no data OP_RETURN', function() { + Script().add(Opcode.OP_RETURN).add(new Buffer('')).toString().should.equal('OP_RETURN'); + }); + it('works with objects', function() { + Script().add({ + opcodenum: 106 + }).toString().should.equal('OP_RETURN'); + }); + it('works with another script', function() { + var someScript = Script('OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 ' + + '21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG'); + var s = new Script().add(someScript); + s.toString() + .should.equal(someScript.toString()); + }); + it('fails with wrong type', function() { + var fails = function() { + return new Script().add(true); + }; + fails.should.throw('Invalid script chunk'); + }); + }); + + describe('#isStandard', function() { + it('should classify correctly standard script', function() { + Script('OP_RETURN 1 0x00').isStandard().should.equal(true); + }); + it('should classify correctly non standard script', function() { + Script('OP_TRUE OP_FALSE').isStandard().should.equal(false); + }); + }); + + describe('#buildMultisigOut', function() { + var pubKeyHexes = [ + '022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da', + '03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9', + '021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18', + '02bf97f572a02a8900246d72c2e8fa3d3798a6e59c4e17de2d131d9c60d0d9b574', + '036a98a36aa7665874b1ba9130bc6d318e52fd3bdb5969532d7fc09bf2476ff842', + '033aafcbead78c08b0e0aacc1b0cdb40702a7c709b660bebd286e973242127e15b', + ]; + var sortkeys = pubKeyHexes.slice(0, 3).map(PublicKey); + it('should create sorted script by default', function() { + var s = Script.buildMultisigOut(sortkeys, 2); + s.toString().should.equal('OP_2 33 0x021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18 33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da 33 0x03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9 OP_3 OP_CHECKMULTISIG'); + s.isMultisigOut().should.equal(true); + }); + it('should fail when number of required signatures is greater than number of pubkeys', function() { + expect(sortkeys.length).to.equal(3); + expect(function() { + return Script.buildMultisigOut(sortkeys, 4); + }).to.throw('Number of required signatures must be less than or equal to the number of public keys'); + }); + it('should create unsorted script if specified', function() { + var s = Script.buildMultisigOut(sortkeys, 2); + var u = Script.buildMultisigOut(sortkeys, 2, { + noSorting: true + }); + s.toString().should.not.equal(u.toString()); + u.toString().should.equal('OP_2 33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da 33 0x03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9 33 0x021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18 OP_3 OP_CHECKMULTISIG'); + s.isMultisigOut().should.equal(true); + }); + var test_mn = function(m, n) { + var pubkeys = pubKeyHexes.slice(0, n).map(PublicKey); + var s = Script.buildMultisigOut(pubkeys, m); + s.isMultisigOut().should.equal(true); + }; + for (var n = 1; n < 6; n++) { + for (var m = 1; m <= n; m++) { + it('should create ' + m + '-of-' + n, test_mn.bind(null, m, n)); + } + } + }); + + describe('#buildWitnessMultisigOutFromScript', function() { + it('it will build nested witness scriptSig', function() { + var redeemScript = bitcore.Script(); + var redeemHash = bitcore.crypto.Hash.sha256(redeemScript.toBuffer()); + var s = Script.buildWitnessMultisigOutFromScript(redeemScript); + var buf = s.toBuffer(); + buf[0].should.equal(0); + buf.slice(2, 34).toString('hex').should.equal(redeemHash.toString('hex')); + }); + }); + + describe('#buildPublicKeyHashOut', function() { + it('should create script from livenet address', function() { + var address = Address.fromString('1NaTVwXDDUJaXDQajoa9MqHhz4uTxtgK14'); + var s = Script.buildPublicKeyHashOut(address); + should.exist(s); + s.toString().should.equal('OP_DUP OP_HASH160 20 0xecae7d092947b7ee4998e254aa48900d26d2ce1d OP_EQUALVERIFY OP_CHECKSIG'); + s.isPublicKeyHashOut().should.equal(true); + s.toAddress().toString().should.equal('1NaTVwXDDUJaXDQajoa9MqHhz4uTxtgK14'); + }); + it('should create script from testnet address', function() { + var address = Address.fromString('mxRN6AQJaDi5R6KmvMaEmZGe3n5ScV9u33'); + var s = Script.buildPublicKeyHashOut(address); + should.exist(s); + s.toString().should.equal('OP_DUP OP_HASH160 20 0xb96b816f378babb1fe585b7be7a2cd16eb99b3e4 OP_EQUALVERIFY OP_CHECKSIG'); + s.isPublicKeyHashOut().should.equal(true); + s.toAddress().toString().should.equal('mxRN6AQJaDi5R6KmvMaEmZGe3n5ScV9u33'); + }); + it('should create script from public key', function() { + var pubkey = new PublicKey('022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'); + var s = Script.buildPublicKeyHashOut(pubkey); + should.exist(s); + s.toString().should.equal('OP_DUP OP_HASH160 20 0x9674af7395592ec5d91573aa8d6557de55f60147 OP_EQUALVERIFY OP_CHECKSIG'); + s.isPublicKeyHashOut().should.equal(true); + should.exist(s._network); + s._network.should.equal(pubkey.network); + }); + }); + describe('#buildPublicKeyOut', function() { + it('should create script from public key', function() { + var pubkey = new PublicKey('022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'); + var s = Script.buildPublicKeyOut(pubkey); + should.exist(s); + s.toString().should.equal('33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da OP_CHECKSIG'); + s.isPublicKeyOut().should.equal(true); + }); + }); + describe('#buildDataOut', function() { + it('should create script from no data', function() { + var s = Script.buildDataOut(); + should.exist(s); + s.toString().should.equal('OP_RETURN'); + s.isDataOut().should.equal(true); + }); + it('should create script from empty data', function() { + var data = new Buffer(''); + var s = Script.buildDataOut(data); + should.exist(s); + s.toString().should.equal('OP_RETURN'); + s.isDataOut().should.equal(true); + }); + it('should create script from some data', function() { + var data = new Buffer('bacacafe0102030405', 'hex'); + var s = Script.buildDataOut(data); + should.exist(s); + s.toString().should.equal('OP_RETURN 9 0xbacacafe0102030405'); + s.isDataOut().should.equal(true); + }); + it('should create script from string', function() { + var data = 'hello world!!!'; + var s = Script.buildDataOut(data); + should.exist(s); + s.toString().should.equal('OP_RETURN 14 0x68656c6c6f20776f726c64212121'); + s.isDataOut().should.equal(true); + }); + it('should create script from a hex string', function() { + var hexString = 'abcdef0123456789'; + var s = Script.buildDataOut(hexString, 'hex'); + should.exist(s); + s.toString().should.equal('OP_RETURN 8 0xabcdef0123456789'); + s.isDataOut().should.equal(true); + }); + }); + describe('#buildScriptHashOut', function() { + it('should create script from another script', function() { + var inner = new Script('OP_DUP OP_HASH160 20 0x06c06f6d931d7bfba2b5bd5ad0d19a8f257af3e3 OP_EQUALVERIFY OP_CHECKSIG'); + var s = Script.buildScriptHashOut(inner); + should.exist(s); + s.toString().should.equal('OP_HASH160 20 0x45ea3f9133e7b1cef30ba606f8433f993e41e159 OP_EQUAL'); + s.isScriptHashOut().should.equal(true); + }); + + it('inherits network property from other script', function() { + var s1 = new Script.fromAddress(new Address('1FSMWkjVPAxzUNjbxT52p3mVKC971rfW3S')); + var s2 = Script.buildScriptHashOut(s1); + should.exist(s1._network); + s1._network.should.equal(s2._network); + }); + + it('inherits network property form an address', function() { + var address = new Address('34Nn91aTGaULqWsZiunrBPHzFBDrZ3B8XS'); + var script = Script.buildScriptHashOut(address); + should.exist(script._network); + script._network.should.equal(address.network); + }); + }); + describe('#toScriptHashOut', function() { + it('should create script from another script', function() { + var s = new Script('OP_DUP OP_HASH160 20 0x06c06f6d931d7bfba2b5bd5ad0d19a8f257af3e3 OP_EQUALVERIFY OP_CHECKSIG'); + var sho = s.toScriptHashOut(); + sho.toString().should.equal('OP_HASH160 20 0x45ea3f9133e7b1cef30ba606f8433f993e41e159 OP_EQUAL'); + sho.isScriptHashOut().should.equal(true); + }); + }); + + describe('#removeCodeseparators', function() { + it('should remove any OP_CODESEPARATORs', function() { + Script('OP_CODESEPARATOR OP_0 OP_CODESEPARATOR').removeCodeseparators().toString().should.equal('OP_0'); + }); + }); + + + describe('#findAndDelete', function() { + it('should find and delete this buffer', function() { + Script('OP_RETURN 2 0xf0f0') + .findAndDelete(Script('2 0xf0f0')) + .toString() + .should.equal('OP_RETURN'); + }); + it('should do nothing', function() { + Script('OP_RETURN 2 0xf0f0') + .findAndDelete(Script('2 0xffff')) + .toString() + .should.equal('OP_RETURN 2 0xf0f0'); + }); + }); + + + describe('#checkMinimalPush', function() { + + it('should check these minimal pushes', function() { + Script().add(1).checkMinimalPush(0).should.equal(true); + Script().add(0).checkMinimalPush(0).should.equal(true); + Script().add(-1).checkMinimalPush(0).should.equal(true); + Script().add(1000).checkMinimalPush(0).should.equal(true); + Script().add(0xffffffff).checkMinimalPush(0).should.equal(true); + Script().add(0xffffffffffffffff).checkMinimalPush(0).should.equal(true); + Script().add(new Buffer([0])).checkMinimalPush(0).should.equal(true); + + var buf = new Buffer(75); + buf.fill(1); + Script().add(buf).checkMinimalPush(0).should.equal(true); + + buf = new Buffer(76); + buf.fill(1); + Script().add(buf).checkMinimalPush(0).should.equal(true); + + buf = new Buffer(256); + buf.fill(1); + Script().add(buf).checkMinimalPush(0).should.equal(true); + }); + + }); + + describe('getData returns associated data', function() { + it('works with this testnet transaction', function() { + // testnet block: 00000000a36400fc06440512354515964bc36ecb0020bd0b0fd48ae201965f54 + // txhash: e362e21ff1d2ef78379d401d89b42ce3e0ce3e245f74b1f4cb624a8baa5d53ad (output 0); + var script = Script.fromBuffer(new Buffer('6a', 'hex')); + var dataout = script.isDataOut(); + dataout.should.equal(true); + var data = script.getData(); + data.should.deep.equal(new Buffer(0)); + }); + it('for a P2PKH address', function() { + var address = Address.fromString('1NaTVwXDDUJaXDQajoa9MqHhz4uTxtgK14'); + var script = Script.buildPublicKeyHashOut(address); + expect(BufferUtil.equal(script.getData(), address.hashBuffer)).to.be.true(); + }); + it('for a P2SH address', function() { + var address = Address.fromString('3GhtMmAbWrUf6Y8vDxn9ETB14R6V7Br3mt'); + var script = new Script(address); + expect(BufferUtil.equal(script.getData(), address.hashBuffer)).to.be.true(); + }); + it('for a standard opreturn output', function() { + expect(BufferUtil.equal(Script('OP_RETURN 1 0xFF').getData(), new Buffer([255]))).to.be.true(); + }); + it('fails if content is not recognized', function() { + expect(function() { + return Script('1 0xFF').getData(); + }).to.throw(); + }); + }); + + describe('toAddress', function() { + var pubkey = new PublicKey('027ffeb8c7795d529ee9cd96512d472cefe398a0597623438ac5d066a64af50072'); + var liveAddress = pubkey.toAddress(Networks.livenet); + var testAddress = pubkey.toAddress(Networks.testnet); + + it('priorize the network argument', function() { + var script = new Script(liveAddress); + script.toAddress(Networks.testnet).toString().should.equal(testAddress.toString()); + script.toAddress(Networks.testnet).network.should.equal(Networks.testnet); + }); + it('use the inherited network', function() { + var script = new Script(liveAddress); + script.toAddress().toString().should.equal(liveAddress.toString()); + script = new Script(testAddress); + script.toAddress().toString().should.equal(testAddress.toString()); + }); + it('uses default network', function() { + var script = new Script('OP_DUP OP_HASH160 20 ' + + '0x06c06f6d931d7bfba2b5bd5ad0d19a8f257af3e3 OP_EQUALVERIFY OP_CHECKSIG'); + script.toAddress().network.should.equal(Networks.defaultNetwork); + }); + it('for a P2PKH address', function() { + var stringAddress = '1NaTVwXDDUJaXDQajoa9MqHhz4uTxtgK14'; + var address = new Address(stringAddress); + var script = new Script(address); + script.toAddress().toString().should.equal(stringAddress); + }); + it('for a P2SH address', function() { + var stringAddress = '3GhtMmAbWrUf6Y8vDxn9ETB14R6V7Br3mt'; + var address = new Address(stringAddress); + var script = new Script(address); + script.toAddress().toString().should.equal(stringAddress); + }); + it('fails if content is not recognized', function() { + Script().toAddress(Networks.livenet).should.equal(false); + }); + + it('works for p2pkh output', function() { + // taken from tx 7e519caca256423320b92e3e17be5701f87afecbdb3f53af598032bfd8d164f5 + var script = new Script('OP_DUP OP_HASH160 20 ' + + '0xc8e11b0eb0d2ad5362d894f048908341fa61b6e1 OP_EQUALVERIFY OP_CHECKSIG'); + script.toAddress().toString().should.equal('1KK9oz4bFH8c1t6LmighHaoSEGx3P3FEmc'); + }); + it('works for p2pkh input', function() { + // taken from tx 7e519caca256423320b92e3e17be5701f87afecbdb3f53af598032bfd8d164f5 + var script = new Script('72 0x3045022100eff96230ca0f55b1e8c7a63e014f48611ff1af40875ecd33dee9062d7a6f5e2002206320405b5f6992c756e03e66b21a05a812b60996464ac6af815c2638b930dd7a01 65 0x04150defa035a2c7d826d7d5fc8ab2154bd1bb832f1a5c8ecb338f436362ad232e428b57db44677c5a8bd42c5ed9e2d7e04e742c59bee1b40080cfd57dec64b23a'); + script.toAddress().toString().should.equal('1KK9oz4bFH8c1t6LmighHaoSEGx3P3FEmc'); + // taken from tx 7f8f95752a59d715dae9e0008a42e7968d2736741591bbfc6685f6e1649c21ed + var s2 = new Script('71 0x3044022017053dad84aa06213749df50a03330cfd24d6b8e7ddbb6de66c03697b78a752a022053bc0faca8b4049fb3944a05fcf7c93b2861734d39a89b73108f605f70f5ed3401 33 0x0225386e988b84248dc9c30f784b06e02fdec57bbdbd443768eb5744a75ce44a4c'); + s2.toAddress().toString().should.equal('17VArX6GRE6i6MVscBUZoXwi6NhnHa68B7'); + }); + + it('works for p2sh output', function() { + // taken from tx fe1f764299dc7f3b5a8fae912050df2b633bf99554c68bf1c456edb9c2b63585 + var script = new Script('OP_HASH160 20 0x99d29051af0c29adcb9040034752bba7dde33e35 OP_EQUAL'); + script.toAddress().toString().should.equal('3FiMZ7stbfH2WG5JQ7CiuzrFo7CEnGUcAP'); + }); + it('works for p2sh input', function() { + // taken from tx fe1f764299dc7f3b5a8fae912050df2b633bf99554c68bf1c456edb9c2b63585 + var script = new Script('OP_FALSE 72 0x3045022100e824fbe979fac5834d0062dd5a4e82a898e00ac454bd254cd708ad28530816f202206251ff0fa4dd70c0524c690d4e4deb2bd167297e7bbdf6743b4a8050d681555001 37 0x512102ff3ae0aaa4679ea156d5581dbe6695cc0c311df0aa42af76670d0debbd8f672951ae'); + script.toAddress().toString().should.equal('3GYicPxCvsKvbJmZNBBeWkC3cLuGFhtrQi'); + }); + + // no address scripts + it('works for OP_RETURN script', function() { + var script = new Script('OP_RETURN 20 0x99d29051af0c29adcb9040034752bba7dde33e35'); + script.toAddress().should.equal(false); + }); + + }); + describe('equals', function() { + it('returns true for same script', function() { + Script('OP_TRUE').equals(Script('OP_TRUE')).should.equal(true); + }); + it('returns false for different chunks sizes', function() { + Script('OP_TRUE').equals(Script('OP_TRUE OP_TRUE')).should.equal(false); + }); + it('returns false for different opcodes', function() { + Script('OP_TRUE OP_TRUE').equals(Script('OP_TRUE OP_FALSE')).should.equal(false); + }); + it('returns false for different data', function() { + Script().add(new Buffer('a')).equals(Script('OP_TRUE')).should.equal(false); + }); + it('returns false for different data', function() { + Script().add(new Buffer('a')).equals(Script().add(new Buffer('b'))).should.equal(false); + }); + }); + + describe('#getSignatureOperationsCount', function() { + // comes from bitcoind src/test/sigopcount_tests + // only test calls to function with boolean param, not signature ref param + var pubKeyHexes = [ + '022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da', + '03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9', + '021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18', + ]; + it('should return zero for empty scripts', function() { + Script().getSignatureOperationsCount(false).should.equal(0); + Script().getSignatureOperationsCount(true).should.equal(0); + }); + it('should handle multi-sig multisig scripts from string', function() { + var s1 = 'OP_1 01 FF OP_2 OP_CHECKMULTISIG'; + Script(s1).getSignatureOperationsCount(true).should.equal(2); + s1 += ' OP_IF OP_CHECKSIG OP_ENDIF'; + Script(s1).getSignatureOperationsCount(true).should.equal(3); + Script(s1).getSignatureOperationsCount(false).should.equal(21); + }); + it('should handle multi-sig-out scripts from utility function', function() { + var sortKeys = pubKeyHexes.slice(0, 3).map(PublicKey); + var s2 = Script.buildMultisigOut(sortKeys, 1); + Script(s2).getSignatureOperationsCount(true).should.equal(3); + Script(s2).getSignatureOperationsCount(false).should.equal(20); + }); + it('should handle P2SH-multisig-in scripts from utility', function() { + // create a well-formed signature, does not need to match pubkeys + var signature = bitcore.crypto.Signature.fromString('30060201FF0201FF'); + var signatures = [ signature.toBuffer() ]; + var p2sh = Script.buildP2SHMultisigIn(pubKeyHexes, 1, signatures, {}); + p2sh.getSignatureOperationsCount(true).should.equal(0); + p2sh.getSignatureOperationsCount(false).should.equal(0); + }); + it('should default the one and only argument to true', function() { + var s1 = 'OP_1 01 FF OP_2 OP_CHECKMULTISIG'; + var trueCount = Script(s1).getSignatureOperationsCount(true); + var falseCount = Script(s1).getSignatureOperationsCount(false); + var defaultCount = Script(s1).getSignatureOperationsCount(); + trueCount.should.not.equal(falseCount); + trueCount.should.equal(defaultCount); + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/deserialize.js b/packages/kauri-bitcore-lib/test/transaction/deserialize.js new file mode 100644 index 0000000..e9f43b8 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/deserialize.js @@ -0,0 +1,34 @@ +'use strict'; + +var Transaction = require('../../lib/transaction'); + +var vectors_valid = require('../data/bitcoind/tx_valid.json'); +var vectors_invalid = require('../data/bitcoind/tx_invalid.json'); + +describe('Transaction deserialization', function() { + + describe('valid transaction test case', function() { + var index = 0; + vectors_valid.forEach(function(vector) { + it('vector #' + index, function() { + if (vector.length > 1) { + var hexa = vector[1]; + Transaction(hexa).serialize(true).should.equal(hexa); + index++; + } + }); + }); + }); + describe('invalid transaction test case', function() { + var index = 0; + vectors_invalid.forEach(function(vector) { + it('invalid vector #' + index, function() { + if (vector.length > 1) { + var hexa = vector[1]; + Transaction(hexa).serialize(true).should.equal(hexa); + index++; + } + }); + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/input/input.js b/packages/kauri-bitcore-lib/test/transaction/input/input.js new file mode 100644 index 0000000..ff2e8fb --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/input/input.js @@ -0,0 +1,99 @@ +'use strict'; + +var should = require('chai').should(); +var expect = require('chai').expect; +var _ = require('lodash'); + +var bitcore = require('../../..'); +var errors = bitcore.errors; +var PrivateKey = bitcore.PrivateKey; +var Address = bitcore.Address; +var Script = bitcore.Script; +var Networks = bitcore.Networks; +var Input = bitcore.Transaction.Input; + +describe('Transaction.Input', function() { + + var privateKey = new PrivateKey('KwF9LjRraetZuEjR8VqEq539z137LW5anYDUnVK11vM3mNMHTWb4'); + var publicKey = privateKey.publicKey; + var address = new Address(publicKey, Networks.livenet); + var output = { + address: '33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb', + prevTxId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140', + outputIndex: 0, + script: new Script(address), + satoshis: 1000000 + }; + var coinbase = { + prevTxId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 0xFFFFFFFF, + script: new Script(), + satoshis: 1000000 + }; + + var coinbaseJSON = JSON.stringify({ + prevTxId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 4294967295, + script:'' + }); + + var otherJSON = JSON.stringify({ + txidbuf: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + txoutnum: 0, + seqnum:4294967295, + script: '71 0x3044022006553276ec5b885ddf5cc1d79e1e3dadbb404b60ad4cc00318e21565' + + '4f13242102200757c17b36e3d0492fb9cf597032e5afbea67a59274e64af5a05d12e5ea2303901 ' + + '33 0x0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e', + output: { + 'satoshis':100000, + 'script':'OP_DUP OP_HASH160 20 0x88d9931ea73d60eaf7e5671efc0552b912911f2a ' + + 'OP_EQUALVERIFY OP_CHECKSIG' + } + }); + + it('has abstract methods: "getSignatures", "isFullySigned", "addSignature", "clearSignatures"', function() { + var input = new Input(output); + _.each(['getSignatures', 'isFullySigned', 'addSignature', 'clearSignatures'], function(method) { + expect(function() { + return input[method](); + }).to.throw(errors.AbstractMethodInvoked); + }); + }); + it('detects coinbase transactions', function() { + new Input(output).isNull().should.equal(false); + var ci = new Input(coinbase); + ci.isNull().should.equal(true); + }); + + describe('instantiation', function() { + it('works without new', function() { + var input = Input(); + should.exist(input); + }); + it('fails with no script info', function() { + expect(function() { + var input = new Input({}); + input.toString(); + }).to.throw('Need a script to create an input'); + }); + it('fromObject should work', function() { + var jsonData = JSON.parse(coinbaseJSON); + var input = Input.fromObject(jsonData); + should.exist(input); + input.prevTxId.toString('hex').should.equal(jsonData.prevTxId); + input.outputIndex.should.equal(jsonData.outputIndex); + }); + it('fromObject should work', function() { + var input = Input.fromObject(JSON.parse(coinbaseJSON)); + var obj = input.toObject(); + Input.fromObject(obj).should.deep.equal(input); + obj.script = 42; + Input.fromObject.bind(null, obj).should.throw('Invalid argument type: script'); + }); + }); + + it('_estimateSize returns correct size', function() { + var input = new Input(output); + input._estimateSize().should.equal(66); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/input/multisig.js b/packages/kauri-bitcore-lib/test/transaction/input/multisig.js new file mode 100644 index 0000000..16a63b0 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/input/multisig.js @@ -0,0 +1,177 @@ +'use strict'; +/* jshint unused: false */ + +var should = require('chai').should(); +var expect = require('chai').expect; +var _ = require('lodash'); + +var bitcore = require('../../..'); +var Transaction = bitcore.Transaction; +var PrivateKey = bitcore.PrivateKey; +var Address = bitcore.Address; +var Script = bitcore.Script; +var Signature = bitcore.crypto.Signature; +var MultiSigInput = bitcore.Transaction.Input.MultiSig; + +describe('MultiSigInput', function() { + + var privateKey1 = new PrivateKey('KwF9LjRraetZuEjR8VqEq539z137LW5anYDUnVK11vM3mNMHTWb4'); + var privateKey2 = new PrivateKey('L4PqnaPTCkYhAqH3YQmefjxQP6zRcF4EJbdGqR8v6adtG9XSsadY'); + var privateKey3 = new PrivateKey('L4CTX79zFeksZTyyoFuPQAySfmP7fL3R41gWKTuepuN7hxuNuJwV'); + var public1 = privateKey1.publicKey; + var public2 = privateKey2.publicKey; + var public3 = privateKey3.publicKey; + var address = new Address('33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb'); + + var output = { + txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140', + outputIndex: 0, + script: new Script("5221025c95ec627038e85b5688a9b3d84d28c5ebe66e8c8d697d498e20fe96e3b1ab1d2102cdddfc974d41a62f1f80081deee70592feb7d6e6cf6739d6592edbe7946720e72103c95924e02c240b5545089c69c6432447412b58be43fd671918bd184a5009834353ae"), + satoshis: 1000000 + }; + it('can count missing signatures', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + + input.countSignatures().should.equal(0); + + transaction.sign(privateKey1); + input.countSignatures().should.equal(1); + input.countMissingSignatures().should.equal(1); + input.isFullySigned().should.equal(false); + + transaction.sign(privateKey2); + input.countSignatures().should.equal(2); + input.countMissingSignatures().should.equal(0); + input.isFullySigned().should.equal(true); + }); + it('can count missing signatures, signed with key 3 and 1', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + + input.countSignatures().should.equal(0); + + transaction.sign(privateKey3); + input.countSignatures().should.equal(1); + input.countMissingSignatures().should.equal(1); + input.isFullySigned().should.equal(false); + + transaction.sign(privateKey1); + input.countSignatures().should.equal(2); + input.countMissingSignatures().should.equal(0); + input.isFullySigned().should.equal(true); + }); + it('returns a list of public keys with missing signatures', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + + _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) { + var serialized = publicKeyMissing.toString(); + return serialized === public1.toString() || + serialized === public2.toString() || + serialized === public3.toString(); + }).should.equal(true); + transaction.sign(privateKey1); + _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) { + var serialized = publicKeyMissing.toString(); + return serialized === public2.toString() || + serialized === public3.toString(); + }).should.equal(true); + }); + it('can clear all signatures', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000) + .sign(privateKey1) + .sign(privateKey2); + + var input = transaction.inputs[0]; + input.isFullySigned().should.equal(true); + input.clearSignatures(); + input.isFullySigned().should.equal(false); + }); + it('can estimate how heavy is the output going to be', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + input._estimateSize().should.equal(147); + }); + it('uses SIGHASH_ALL by default', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + var sigs = input.getSignatures(transaction, privateKey1, 0); + sigs[0].sigtype.should.equal(Signature.SIGHASH_ALL); + }); + it('roundtrips to/from object', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000) + .sign(privateKey1); + var input = transaction.inputs[0]; + var roundtrip = new MultiSigInput(input.toObject()); + roundtrip.toObject().should.deep.equal(input.toObject()); + }); + it('roundtrips to/from object when not signed', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + var roundtrip = new MultiSigInput(input.toObject()); + roundtrip.toObject().should.deep.equal(input.toObject()); + }); + it('can parse list of signature buffers, from TX signed with key 1 and 2', function() { + var transaction = new Transaction("010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009200473044022012bd2f15e56ab1b63d5ee23e194ed995ad4b81a21bcb8e0d913e5e791c07f7280220278bdb6b54cdc608193c869affe28dc2f700902218122770faff25c56142102b01483045022100e74e9955e042aca36f4f3ad907a0926c5b85e5d9608b0678a78a9cbc0259c7a2022053ff761e5f9a80558db7023e45c4979ac3c19a423f0184fb0596d3da308cc4b501ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a78700000000"); + + var inputObj = transaction.inputs[0].toObject(); + inputObj.output = output; + transaction.inputs[0] = new Transaction.Input(inputObj); + + inputObj.signatures = MultiSigInput.normalizeSignatures( + transaction, + transaction.inputs[0], + 0, + transaction.inputs[0].script.chunks.slice(1).map(function(s) { return s.buf; }), + [public1, public2, public3] + ); + + transaction.inputs[0] = new MultiSigInput(inputObj, [public1, public2, public3], 2); + + transaction.inputs[0].signatures[0].publicKey.should.deep.equal(public1); + transaction.inputs[0].signatures[1].publicKey.should.deep.equal(public2); + should.equal(transaction.inputs[0].signatures[2], undefined); + transaction.inputs[0].isValidSignature(transaction, transaction.inputs[0].signatures[0]).should.be.true; + transaction.inputs[0].isValidSignature(transaction, transaction.inputs[0].signatures[1]).should.be.true; + }); + it('can parse list of signature buffers, from TX signed with key 3 and 1', function() { + var transaction = new Transaction("010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009300483045022100fc39ce4f51b2766ec8e978296e0594ea4578a3eb2543722fd4053e92bf16e6b1022030f739868397a881b019508b9c725a5c69a3652cb8928027748e93e67dfaef5501483045022100e74e9955e042aca36f4f3ad907a0926c5b85e5d9608b0678a78a9cbc0259c7a2022053ff761e5f9a80558db7023e45c4979ac3c19a423f0184fb0596d3da308cc4b501ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a78700000000"); + + var inputObj = transaction.inputs[0].toObject(); + inputObj.output = output; + transaction.inputs[0] = new Transaction.Input(inputObj); + + inputObj.signatures = MultiSigInput.normalizeSignatures( + transaction, + transaction.inputs[0], + 0, + transaction.inputs[0].script.chunks.slice(1).map(function(s) { return s.buf; }), + [public1, public2, public3] + ); + + transaction.inputs[0] = new MultiSigInput(inputObj, [public1, public2, public3], 2); + + transaction.inputs[0].signatures[0].publicKey.should.deep.equal(public1); + should.equal(transaction.inputs[0].signatures[1], undefined); + transaction.inputs[0].signatures[2].publicKey.should.deep.equal(public3); + transaction.inputs[0].isValidSignature(transaction, transaction.inputs[0].signatures[0]).should.be.true; + transaction.inputs[0].isValidSignature(transaction, transaction.inputs[0].signatures[2]).should.be.true; + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/input/multisigscripthash.js b/packages/kauri-bitcore-lib/test/transaction/input/multisigscripthash.js new file mode 100644 index 0000000..b3bcd83 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/input/multisigscripthash.js @@ -0,0 +1,147 @@ +'use strict'; +/* jshint unused: false */ + +var should = require('chai').should(); +var expect = require('chai').expect; +var _ = require('lodash'); + +var bitcore = require('../../..'); +var Transaction = bitcore.Transaction; +var PrivateKey = bitcore.PrivateKey; +var Address = bitcore.Address; +var Script = bitcore.Script; +var Signature = bitcore.crypto.Signature; +var MultiSigScriptHashInput = bitcore.Transaction.Input.MultiSigScriptHash; + +describe('MultiSigScriptHashInput', function() { + + var privateKey1 = new PrivateKey('KwF9LjRraetZuEjR8VqEq539z137LW5anYDUnVK11vM3mNMHTWb4'); + var privateKey2 = new PrivateKey('L4PqnaPTCkYhAqH3YQmefjxQP6zRcF4EJbdGqR8v6adtG9XSsadY'); + var privateKey3 = new PrivateKey('L4CTX79zFeksZTyyoFuPQAySfmP7fL3R41gWKTuepuN7hxuNuJwV'); + var public1 = privateKey1.publicKey; + var public2 = privateKey2.publicKey; + var public3 = privateKey3.publicKey; + var address = new Address('33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb'); + + var output = { + address: '33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb', + txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140', + outputIndex: 0, + script: new Script(address), + satoshis: 1000000 + }; + it('can count missing signatures', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + + input.countSignatures().should.equal(0); + + transaction.sign(privateKey1); + input.countSignatures().should.equal(1); + input.countMissingSignatures().should.equal(1); + input.isFullySigned().should.equal(false); + + transaction.sign(privateKey2); + input.countSignatures().should.equal(2); + input.countMissingSignatures().should.equal(0); + input.isFullySigned().should.equal(true); + }); + it('returns a list of public keys with missing signatures', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + + _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) { + var serialized = publicKeyMissing.toString(); + return serialized === public1.toString() || + serialized === public2.toString() || + serialized === public3.toString(); + }).should.equal(true); + transaction.sign(privateKey1); + _.every(input.publicKeysWithoutSignature(), function(publicKeyMissing) { + var serialized = publicKeyMissing.toString(); + return serialized === public2.toString() || + serialized === public3.toString(); + }).should.equal(true); + }); + it('can clear all signatures', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000) + .sign(privateKey1) + .sign(privateKey2); + + var input = transaction.inputs[0]; + input.isFullySigned().should.equal(true); + input.clearSignatures(); + input.isFullySigned().should.equal(false); + }); + it('can estimate how heavy is the output going to be', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + input._estimateSize().should.equal(257); + }); + it('uses SIGHASH_ALL by default', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + var sigs = input.getSignatures(transaction, privateKey1, 0); + sigs[0].sigtype.should.equal(Signature.SIGHASH_ALL); + }); + it('roundtrips to/from object', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000) + .sign(privateKey1); + var input = transaction.inputs[0]; + var roundtrip = new MultiSigScriptHashInput(input.toObject()); + roundtrip.toObject().should.deep.equal(input.toObject()); + }); + it('roundtrips to/from object when not signed', function() { + var transaction = new Transaction() + .from(output, [public1, public2, public3], 2) + .to(address, 1000000); + var input = transaction.inputs[0]; + var roundtrip = new MultiSigScriptHashInput(input.toObject()); + roundtrip.toObject().should.deep.equal(input.toObject()); + }); + it('will get the scriptCode for nested witness', function() { + var address = Address.createMultisig([public1, public2, public3], 2, 'testnet', true); + var utxo = { + address: address.toString(), + txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140', + outputIndex: 0, + script: new Script(address), + satoshis: 1000000 + }; + var transaction = new Transaction() + .from(utxo, [public1, public2, public3], 2, true) + .to(address, 1000000); + var input = transaction.inputs[0]; + var scriptCode = input.getScriptCode(); + scriptCode.toString('hex').should.equal('695221025c95ec627038e85b5688a9b3d84d28c5ebe66e8c8d697d498e20fe96e3b1ab1d2102cdddfc974d41a62f1f80081deee70592feb7d6e6cf6739d6592edbe7946720e72103c95924e02c240b5545089c69c6432447412b58be43fd671918bd184a5009834353ae'); + }); + it('will get the satoshis buffer for nested witness', function() { + var address = Address.createMultisig([public1, public2, public3], 2, 'testnet', true); + var utxo = { + address: address.toString(), + txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140', + outputIndex: 0, + script: new Script(address), + satoshis: 1000000 + }; + var transaction = new Transaction() + .from(utxo, [public1, public2, public3], 2, true) + .to(address, 1000000); + var input = transaction.inputs[0]; + var satoshisBuffer = input.getSatoshisBuffer(); + satoshisBuffer.toString('hex').should.equal('40420f0000000000'); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/input/publickey.js b/packages/kauri-bitcore-lib/test/transaction/input/publickey.js new file mode 100644 index 0000000..5d6b366 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/input/publickey.js @@ -0,0 +1,71 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../../..'); +var Transaction = bitcore.Transaction; +var PrivateKey = bitcore.PrivateKey; + +describe('PublicKeyInput', function() { + + var utxo = { + txid: '7f3b688cb224ed83e12d9454145c26ac913687086a0a62f2ae0bc10934a4030f', + vout: 0, + address: 'n4McBrSkw42eYGX5YMACGpkGUJKL3jVSbo', + scriptPubKey: '2103c9594cb2ebfebcb0cfd29eacd40ba012606a197beef76f0269ed8c101e56ceddac', + amount: 50, + confirmations: 104, + spendable: true + }; + var privateKey = PrivateKey.fromWIF('cQ7tSSQDEwaxg9usnnP1Aztqvm9nCQVfNWz9kU2rdocDjknF2vd6'); + var address = privateKey.toAddress(); + utxo.address.should.equal(address.toString()); + + var destKey = new PrivateKey(); + + it('will correctly sign a publickey out transaction', function() { + var tx = new Transaction(); + tx.from(utxo); + tx.to(destKey.toAddress(), 10000); + tx.sign(privateKey); + tx.inputs[0].script.toBuffer().length.should.be.above(0); + }); + + it('count can count missing signatures', function() { + var tx = new Transaction(); + tx.from(utxo); + tx.to(destKey.toAddress(), 10000); + var input = tx.inputs[0]; + input.isFullySigned().should.equal(false); + tx.sign(privateKey); + input.isFullySigned().should.equal(true); + }); + + it('it\'s size can be estimated', function() { + var tx = new Transaction(); + tx.from(utxo); + tx.to(destKey.toAddress(), 10000); + var input = tx.inputs[0]; + input._estimateSize().should.equal(73); + }); + + it('it\'s signature can be removed', function() { + var tx = new Transaction(); + tx.from(utxo); + tx.to(destKey.toAddress(), 10000); + var input = tx.inputs[0]; + tx.sign(privateKey); + input.isFullySigned().should.equal(true); + input.clearSignatures(); + input.isFullySigned().should.equal(false); + }); + + it('returns an empty array if private key mismatches', function() { + var tx = new Transaction(); + tx.from(utxo); + tx.to(destKey.toAddress(), 10000); + var input = tx.inputs[0]; + var signatures = input.getSignatures(tx, new PrivateKey(), 0); + signatures.length.should.equal(0); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/input/publickeyhash.js b/packages/kauri-bitcore-lib/test/transaction/input/publickeyhash.js new file mode 100644 index 0000000..d0ae623 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/input/publickeyhash.js @@ -0,0 +1,64 @@ +'use strict'; +/* jshint unused: false */ + +var should = require('chai').should(); +var expect = require('chai').expect; +var _ = require('lodash'); + +var bitcore = require('../../..'); +var Transaction = bitcore.Transaction; +var PrivateKey = bitcore.PrivateKey; +var Address = bitcore.Address; +var Script = bitcore.Script; +var Networks = bitcore.Networks; +var Signature = bitcore.crypto.Signature; + +describe('PublicKeyHashInput', function() { + + var privateKey = new PrivateKey('KwF9LjRraetZuEjR8VqEq539z137LW5anYDUnVK11vM3mNMHTWb4'); + var publicKey = privateKey.publicKey; + var address = new Address(publicKey, Networks.livenet); + + var output = { + address: '33zbk2aSZYdNbRsMPPt6jgy6Kq1kQreqeb', + txId: '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140', + outputIndex: 0, + script: new Script(address), + satoshis: 1000000 + }; + it('can count missing signatures', function() { + var transaction = new Transaction() + .from(output) + .to(address, 1000000); + var input = transaction.inputs[0]; + + input.isFullySigned().should.equal(false); + transaction.sign(privateKey); + input.isFullySigned().should.equal(true); + }); + it('it\'s size can be estimated', function() { + var transaction = new Transaction() + .from(output) + .to(address, 1000000); + var input = transaction.inputs[0]; + input._estimateSize().should.equal(107); + }); + it('it\'s signature can be removed', function() { + var transaction = new Transaction() + .from(output) + .to(address, 1000000); + var input = transaction.inputs[0]; + + transaction.sign(privateKey); + input.clearSignatures(); + input.isFullySigned().should.equal(false); + }); + it('returns an empty array if private key mismatches', function() { + var transaction = new Transaction() + .from(output) + .to(address, 1000000); + var input = transaction.inputs[0]; + var signatures = input.getSignatures(transaction, new PrivateKey(), 0); + signatures.length.should.equal(0); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/output.js b/packages/kauri-bitcore-lib/test/transaction/output.js new file mode 100644 index 0000000..de5d920 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/output.js @@ -0,0 +1,191 @@ +"use strict"; + +/* jshint unused: false */ +/* jshint latedef: false */ +var should = require("chai").should(); +var expect = require("chai").expect; +var _ = require("lodash"); + +var bitcore = require("../.."); +var BN = bitcore.crypto.BN; +var BufferWriter = bitcore.encoding.BufferWriter; +var BufferReader = bitcore.encoding.BufferReader; +var Output = bitcore.Transaction.Output; +var Script = bitcore.Script; + +var errors = bitcore.errors; + +describe("Output", function() { + var output = new Output({ + satoshis: 0, + script: Script.empty() + }); + + it("throws error with unrecognized argument", function() { + (function() { + var out = new Output(12345); + }.should.throw(TypeError)); + }); + + it("can be assigned a satoshi amount in big number", function() { + var newOutput = new Output({ + satoshis: new BN(100), + script: Script.empty() + }); + newOutput.satoshis.should.equal(100); + }); + + it("can be assigned a satoshi amount with a string", function() { + var newOutput = new Output({ + satoshis: "100", + script: Script.empty() + }); + newOutput.satoshis.should.equal(100); + }); + + describe("will error if output is not a positive integer", function() { + it("-100", function() { + (function() { + var newOutput = new Output({ + satoshis: -100, + script: Script.empty() + }); + }.should.throw("Output satoshis is not a natural number")); + }); + + it("1.1", function() { + (function() { + var newOutput = new Output({ + satoshis: 1.1, + script: Script.empty() + }); + }.should.throw("Output satoshis is not a natural number")); + }); + + it("NaN", function() { + (function() { + var newOutput = new Output({ + satoshis: NaN, + script: Script.empty() + }); + }.should.throw("Output satoshis is not a natural number")); + }); + + it("Infinity", function() { + (function() { + var newOutput = new Output({ + satoshis: Infinity, + script: Script.empty() + }); + }.should.throw("Output satoshis is not a natural number")); + }); + }); + + var expectEqualOutputs = function(a, b) { + a.satoshis.should.equal(b.satoshis); + a.script.toString().should.equal(b.script.toString()); + }; + + it("deserializes correctly a simple output", function() { + var writer = new BufferWriter(); + output.toBufferWriter(writer); + var deserialized = Output.fromBufferReader( + new BufferReader(writer.toBuffer()) + ); + expectEqualOutputs(output, deserialized); + }); + + it("can instantiate from an object", function() { + var out = new Output(output.toObject()); + should.exist(out); + }); + + it("can set a script from a buffer", function() { + var newOutput = new Output(output.toObject()); + newOutput.setScript(Script().add(0).toBuffer()); + newOutput.inspect().should.equal(">"); + }); + + it("has a inspect property", function() { + output.inspect().should.equal(">"); + }); + + var output2 = new Output({ + satoshis: 1100000000, + script: new Script( + "OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39" + + "cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de23" + + "8d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG OP_EQUAL" + ) + }); + + it("toBufferWriter", function() { + output2 + .toBufferWriter() + .toBuffer() + .toString("hex") + .should.equal( + "00ab904100000000485215038282263212c609d9ea2a6e3e172de2" + + "38d8c39cabd5ac1ca10646e23fd5f5150815038282263212c609d9ea2a6e3e172d" + + "e238d8c39cabd5ac1ca10646e23fd5f5150852ae87" + ); + }); + + it("roundtrips to/from object", function() { + var newOutput = new Output({ + satoshis: 50, + script: new Script().add(0) + }); + var otherOutput = new Output(newOutput.toObject()); + expectEqualOutputs(newOutput, otherOutput); + }); + + it("toObject will handle an invalid (null) script", function() { + // block 000000000000000b7e48f88e86ceee3e97b4df7c139f5411d14735c1b3c36791 (livenet) + // transaction index 2 + // txid ebc9fa1196a59e192352d76c0f6e73167046b9d37b8302b6bb6968dfd279b767 + var transaction = bitcore.Transaction(); + transaction.fromString( + "01000000019ac03d5ae6a875d970128ef9086cef276a1919684a6988023cc7254691d97e6d010000006b4830450221009d41dc793ba24e65f571473d40b299b6459087cea1509f0d381740b1ac863cb6022039c425906fcaf51b2b84d8092569fb3213de43abaff2180e2a799d4fcb4dd0aa012102d5ede09a8ae667d0f855ef90325e27f6ce35bbe60a1e6e87af7f5b3c652140fdffffffff080100000000000000010101000000000000000202010100000000000000014c0100000000000000034c02010100000000000000014d0100000000000000044dffff010100000000000000014e0100000000000000064effffffff0100000000" + ); + var obj = transaction.toObject(); + obj.outputs[2].script.should.equal("4c"); + obj.outputs[4].script.should.equal("4d"); + obj.outputs[6].script.should.equal("4e"); + }); + + it("#toObject roundtrip will handle an invalid (null) script", function() { + var invalidOutputScript = new Buffer("0100000000000000014c", "hex"); + var br = new bitcore.encoding.BufferReader(invalidOutputScript); + var output = Output.fromBufferReader(br); + var output2 = new Output(output.toObject()); + should.equal(output2.script, null); + should.equal(output2._scriptBuffer.toString("hex"), "4c"); + }); + + it("inspect will work with an invalid (null) script", function() { + var invalidOutputScript = new Buffer("0100000000000000014c", "hex"); + var br = new bitcore.encoding.BufferReader(invalidOutputScript); + var output = Output.fromBufferReader(br); + output.inspect().should.equal(""); + }); + + it("roundtrips to/from JSON", function() { + var json = JSON.stringify(output2); + var o3 = new Output(JSON.parse(json)); + JSON.stringify(o3).should.equal(json); + }); + + it("setScript fails with invalid input", function() { + var out = new Output(output2.toJSON()); + out.setScript.bind(out, 45).should.throw("Invalid argument type: script"); + }); + + it("sets script to null if it is an InvalidBuffer", function() { + var output = new Output({ + satoshis: 1000, + script: new Buffer("4c", "hex") + }); + should.equal(output.script, null); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/sighash.js b/packages/kauri-bitcore-lib/test/transaction/sighash.js new file mode 100644 index 0000000..d5fbc16 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/sighash.js @@ -0,0 +1,37 @@ +'use strict'; + +var buffer = require('buffer'); + +var chai = require('chai'); +var should = chai.should(); +var bitcore = require('../../'); +var Script = bitcore.Script; +var Transaction = bitcore.Transaction; +var sighash = Transaction.sighash; + +var vectors_sighash = require('../data/sighash.json'); + +describe('sighash', function() { + + vectors_sighash.forEach(function(vector, i) { + if (i === 0) { + // First element is just a row describing the next ones + return; + } + it('test vector from bitcoind #' + i + ' (' + vector[4].substring(0, 16) + ')', function() { + var txbuf = new buffer.Buffer(vector[0], 'hex'); + var scriptbuf = new buffer.Buffer(vector[1], 'hex'); + var subscript = Script(scriptbuf); + var nin = vector[2]; + var nhashtype = vector[3]; + var sighashbuf = new buffer.Buffer(vector[4], 'hex'); + var tx = new Transaction(txbuf); + + //make sure transacion to/from buffer is isomorphic + tx.uncheckedSerialize().should.equal(txbuf.toString('hex')); + + //sighash ought to be correct + sighash.sighash(tx, nhashtype, nin, subscript).toString('hex').should.equal(sighashbuf.toString('hex')); + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/sighashwitness.js b/packages/kauri-bitcore-lib/test/transaction/sighashwitness.js new file mode 100644 index 0000000..4ea76f3 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/sighashwitness.js @@ -0,0 +1,24 @@ +'use strict'; + +var chai = require('chai'); +var should = chai.should(); +var bitcore = require('../../'); +var Transaction = bitcore.Transaction; +var Signature = bitcore.crypto.Signature; +var SighashWitness = Transaction.SighashWitness; + +describe('Sighash Witness Program Version 0', function() { + + it('should create hash for sighash all', function() { + // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki + var unsignedTx = bitcore.Transaction('0100000002fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f0000000000eeffffffef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a0100000000ffffffff02202cb206000000001976a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac9093510d000000001976a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac11000000'); + + var scriptCode = new Buffer('1976a9141d0f172a0ecb48aee1be1f2687d2963ae33f71a188ac', 'hex'); + var satoshisBuffer = new Buffer('0046c32300000000', 'hex'); + + var hash = SighashWitness.sighash(unsignedTx, Signature.SIGHASH_ALL, 1, scriptCode, satoshisBuffer); + + hash.toString('hex').should.equal('c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670'); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/signature.js b/packages/kauri-bitcore-lib/test/transaction/signature.js new file mode 100644 index 0000000..51727e0 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/signature.js @@ -0,0 +1,133 @@ +'use strict'; + +/* jshint unused: false */ +/* jshint latedef: false */ +var should = require('chai').should(); +var expect = require('chai').expect; +var _ = require('lodash'); + +var bitcore = require('../..'); +var Transaction = bitcore.Transaction; +var TransactionSignature = bitcore.Transaction.Signature; +var Script = bitcore.Script; +var PrivateKey = bitcore.PrivateKey; +var errors = bitcore.errors; + +describe('TransactionSignature', function() { + + var fromAddress = 'mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1'; + var privateKey = 'cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY'; + var simpleUtxoWith100000Satoshis = { + address: fromAddress, + txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + outputIndex: 0, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 100000 + }; + + var getSignatureFromTransaction = function() { + var transaction = new Transaction(); + transaction.from(simpleUtxoWith100000Satoshis); + return transaction.getSignatures(privateKey)[0]; + }; + + it('can be created without the `new` keyword', function() { + var signature = getSignatureFromTransaction(); + var serialized = signature.toObject(); + var nonew = TransactionSignature(serialized); + expect(nonew.toObject()).to.deep.equal(serialized); + }); + + it('can be retrieved from Transaction#getSignatures', function() { + var signature = getSignatureFromTransaction(); + expect(signature instanceof TransactionSignature).to.equal(true); + }); + + it('fails when trying to create from invalid arguments', function() { + expect(function() { + return new TransactionSignature(); + }).to.throw(errors.InvalidArgument); + expect(function() { + return new TransactionSignature(1); + }).to.throw(errors.InvalidArgument); + expect(function() { + return new TransactionSignature('hello world'); + }).to.throw(errors.InvalidArgument); + }); + it('returns the same object if called with a TransactionSignature', function() { + var signature = getSignatureFromTransaction(); + expect(new TransactionSignature(signature)).to.equal(signature); + }); + + it('gets returned by a P2SH multisig output', function() { + var private1 = new PrivateKey('6ce7e97e317d2af16c33db0b9270ec047a91bff3eff8558afb5014afb2bb5976'); + var private2 = new PrivateKey('c9b26b0f771a0d2dad88a44de90f05f416b3b385ff1d989343005546a0032890'); + var public1 = private1.publicKey; + var public2 = private2.publicKey; + var utxo = { + txId: '0000000000000000000000000000000000000000000000000000000000000000', // Not relevant + outputIndex: 0, + script: Script.buildMultisigOut([public1, public2], 2).toScriptHashOut(), + satoshis: 100000 + }; + var transaction = new Transaction().from(utxo, [public1, public2], 2); + var signatures = transaction.getSignatures(private1); + expect(signatures[0] instanceof TransactionSignature).to.equal(true); + signatures = transaction.getSignatures(private2); + expect(signatures[0] instanceof TransactionSignature).to.equal(true); + }); + + it('can be aplied to a Transaction with Transaction#addSignature', function() { + var transaction = new Transaction(); + transaction.from(simpleUtxoWith100000Satoshis); + var signature = transaction.getSignatures(privateKey)[0]; + var addSignature = function() { + return transaction.applySignature(signature); + }; + expect(signature instanceof TransactionSignature).to.equal(true); + expect(addSignature).to.not.throw(); + }); + + describe('serialization', function() { + it('serializes to an object and roundtrips correctly', function() { + var signature = getSignatureFromTransaction(); + var serialized = signature.toObject(); + expect(new TransactionSignature(serialized).toObject()).to.deep.equal(serialized); + }); + + it('can be deserialized with fromObject', function() { + var signature = getSignatureFromTransaction(); + var serialized = signature.toObject(); + expect(TransactionSignature.fromObject(serialized).toObject()).to.deep.equal(serialized); + }); + + it('can deserialize when signature is a buffer', function() { + var signature = getSignatureFromTransaction(); + var serialized = signature.toObject(); + serialized.signature = new Buffer(serialized.signature, 'hex'); + expect(TransactionSignature.fromObject(serialized).toObject()).to.deep.equal(signature.toObject()); + }); + + it('can roundtrip to/from json', function() { + var signature = getSignatureFromTransaction(); + var serialized = signature.toObject(); + var json = JSON.stringify(signature); + expect(TransactionSignature(JSON.parse(json)).toObject()).to.deep.equal(serialized); + expect(TransactionSignature.fromObject(JSON.parse(json)).toObject()).to.deep.equal(serialized); + }); + + it('can parse a previously known json string', function() { + var str = JSON.stringify(TransactionSignature(JSON.parse(testJSON))); + expect(JSON.parse(str)).to.deep.equal(JSON.parse(testJSON)); + }); + + it('can deserialize a previously known object', function() { + expect(TransactionSignature(testObject).toObject()).to.deep.equal(testObject); + }); + }); + + /* jshint maxlen: 500 */ + var testJSON = '{"publicKey":"0223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5e","prevTxId":"a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458","outputIndex":0,"inputIndex":0,"signature":"3045022100c728eac064154edba15d4f3e6cbd9be6da3498f80a783ab3391f992b4d9d71ca0220729eff4564dc06aa1d80ab73100540fe5ebb6f280b4a87bc32399f861a7b2563","sigtype":1}'; + var testObject = JSON.parse(testJSON); + +}); diff --git a/packages/kauri-bitcore-lib/test/transaction/transaction.js b/packages/kauri-bitcore-lib/test/transaction/transaction.js new file mode 100644 index 0000000..b553d36 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/transaction.js @@ -0,0 +1,1677 @@ +'use strict'; + +/* jshint unused: false */ +/* jshint latedef: false */ +var should = require('chai').should(); +var expect = require('chai').expect; +var _ = require('lodash'); +var sinon = require('sinon'); + +var bitcore = require('../..'); +var BN = bitcore.crypto.BN; +var Transaction = bitcore.Transaction; +var Input = bitcore.Transaction.Input; +var Output = bitcore.Transaction.Output; +var PrivateKey = bitcore.PrivateKey; +var Script = bitcore.Script; +var Interpreter = bitcore.Script.Interpreter; +var Address = bitcore.Address; +var Networks = bitcore.Networks; +var Opcode = bitcore.Opcode; +var errors = bitcore.errors; + +var transactionVector = require('../data/tx_creation'); + +describe('Transaction', function() { + + it('should serialize and deserialize correctly a given transaction', function() { + var transaction = new Transaction(tx_1_hex); + transaction.uncheckedSerialize().should.equal(tx_1_hex); + }); + + it('should parse the version as a signed integer', function () { + var transaction = Transaction('ffffffff0000ffffffff') + transaction.version.should.equal(-1); + transaction.nLockTime.should.equal(0xffffffff); + }); + + it('fails if an invalid parameter is passed to constructor', function() { + expect(function() { + return new Transaction(1); + }).to.throw(errors.InvalidArgument); + }); + + var testScript = 'OP_DUP OP_HASH160 20 0x88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG'; + var testScriptHex = '76a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac'; + var testPrevTx = 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458'; + var testAmount = 1020000; + var testTransaction = new Transaction() + .from({ + 'txId': testPrevTx, + 'outputIndex': 0, + 'script': testScript, + 'satoshis': testAmount + }) + .to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', testAmount - 10000); + + it('can serialize to a plain javascript object', function() { + var object = testTransaction.toObject(); + object.inputs[0].output.satoshis.should.equal(testAmount); + object.inputs[0].output.script.should.equal(testScriptHex); + object.inputs[0].prevTxId.should.equal(testPrevTx); + object.inputs[0].outputIndex.should.equal(0); + object.outputs[0].satoshis.should.equal(testAmount - 10000); + }); + + it('will not accept NaN as an amount', function() { + (function() { + var stringTx = new Transaction().to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', NaN); + }).should.throw('Amount is expected to be a positive integer'); + }); + + it('returns the fee correctly', function() { + testTransaction.getFee().should.equal(10000); + }); + + it('will return zero as the fee for a coinbase', function() { + // block #2: 0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098 + var coinbaseTransaction = new Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000'); + coinbaseTransaction.getFee().should.equal(0); + }); + + it('serialize to Object roundtrip', function() { + var a = testTransaction.toObject(); + var newTransaction = new Transaction(a); + var b = newTransaction.toObject(); + a.should.deep.equal(b); + }); + + it('toObject/fromObject with signatures and custom fee', function() { + var tx = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + + var txData = JSON.stringify(tx); + var tx2 = new Transaction(JSON.parse(txData)); + var txData2 = JSON.stringify(tx2); + txData.should.equal(txData2); + }); + + it('toObject/fromObject with p2sh signatures and custom fee', function() { + var tx = new Transaction() + .from(p2shUtxoWith1BTC, [p2shPublicKey1, p2shPublicKey2, p2shPublicKey3], 2) + .to([{address: toAddress, satoshis: 50000}]) + .fee(15000) + .change(changeAddress) + .sign(p2shPrivateKey1) + .sign(p2shPrivateKey2); + + var txData = JSON.stringify(tx); + var tx2 = new Transaction(JSON.parse(txData)); + var tx2Data = JSON.stringify(tx2); + txData.should.equal(tx2Data); + }); + + it('fromObject with pay-to-public-key previous outputs', function() { + var tx = bitcore.Transaction({ + hash: '132856bf03d6415562a556437d22ac63c37a4595fd986c796eb8e02dc031aa25', + version: 1, + inputs: [ + { + prevTxId: 'e30ac3db24ef28500f023775d8eb06ad8a26241690080260308208a4020012a4', + outputIndex: 0, + sequenceNumber: 4294967294, + script: '473044022024dbcf41ccd4f3fe325bebb7a87d0bf359eefa03826482008e0fe7795586ad440220676f5f211ebbc311cfa631f14a8223a343cbadc6fa97d6d17f8d2531308b533201', + scriptString: '71 0x3044022024dbcf41ccd4f3fe325bebb7a87d0bf359eefa03826482008e0fe7795586ad440220676f5f211ebbc311cfa631f14a8223a343cbadc6fa97d6d17f8d2531308b533201', + output: { + satoshis: 5000000000, + script: '2103b1c65d65f1ff3fe145a4ede692460ae0606671d04e8449e99dd11c66ab55a7feac' + } + } + ], + outputs: [ + { + satoshis: 3999999040, + script: '76a914fa1e0abfb8d26e494375f47e04b4883c44dd44d988ac' + }, + { + satoshis: 1000000000, + script: '76a9140b2f0a0c31bfe0406b0ccc1381fdbe311946dadc88ac' + } + ], + nLockTime: 139 + }); + tx.inputs[0].should.be.instanceof(bitcore.Transaction.Input.PublicKey); + tx.inputs[0].output.satoshis.should.equal(5000000000); + tx.inputs[0].output.script.toHex().should.equal('2103b1c65d65f1ff3fe145a4ede692460ae0606671d04e8449e99dd11c66ab55a7feac'); + }); + + it('constructor returns a shallow copy of another transaction', function() { + var transaction = new Transaction(tx_1_hex); + var copy = new Transaction(transaction); + copy.uncheckedSerialize().should.equal(transaction.uncheckedSerialize()); + }); + + it('should display correctly in console', function() { + var transaction = new Transaction(tx_1_hex); + transaction.inspect().should.equal(''); + }); + + it('standard hash of transaction should be decoded correctly', function() { + var transaction = new Transaction(tx_1_hex); + transaction.id.should.equal(tx_1_id); + }); + + it('serializes an empty transaction', function() { + var transaction = new Transaction(); + transaction.uncheckedSerialize().should.equal(tx_empty_hex); + }); + + it('serializes and deserializes correctly', function() { + var transaction = new Transaction(tx_1_hex); + transaction.uncheckedSerialize().should.equal(tx_1_hex); + }); + + describe('transaction creation test vector', function() { + this.timeout(5000); + var index = 0; + transactionVector.forEach(function(vector) { + index++; + it('case ' + index, function() { + var i = 0; + var transaction = new Transaction(); + while (i < vector.length) { + var command = vector[i]; + var args = vector[i + 1]; + if (command === 'serialize') { + transaction.serialize().should.equal(args); + } else { + transaction[command].apply(transaction, args); + } + i += 2; + } + }); + }); + }); + + // TODO: Migrate this into a test for inputs + + var fromAddress = 'mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1'; + var simpleUtxoWith100000Satoshis = { + address: fromAddress, + txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + outputIndex: 0, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 100000 + }; + + var simpleUtxoWith1000000Satoshis = { + address: fromAddress, + txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + outputIndex: 0, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 1000000 + }; + var anyoneCanSpendUTXO = JSON.parse(JSON.stringify(simpleUtxoWith100000Satoshis)); + anyoneCanSpendUTXO.script = new Script().add('OP_TRUE'); + var toAddress = 'mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc'; + var changeAddress = 'mgBCJAsvzgT2qNNeXsoECg2uPKrUsZ76up'; + var changeAddressP2SH = '2N7T3TAetJrSCruQ39aNrJvYLhG1LJosujf'; + var privateKey = 'cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY'; + var private1 = '6ce7e97e317d2af16c33db0b9270ec047a91bff3eff8558afb5014afb2bb5976'; + var private2 = 'c9b26b0f771a0d2dad88a44de90f05f416b3b385ff1d989343005546a0032890'; + var public1 = new PrivateKey(private1).publicKey; + var public2 = new PrivateKey(private2).publicKey; + + var simpleUtxoWith1BTC = { + address: fromAddress, + txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + outputIndex: 1, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 1e8 + }; + + var tenth = 1e7; + var fourth = 25e6; + var half = 5e7; + + var p2shPrivateKey1 = PrivateKey.fromWIF('cNuW8LX2oeQXfKKCGxajGvqwhCgBtacwTQqiCGHzzKfmpHGY4TE9'); + var p2shPublicKey1 = p2shPrivateKey1.toPublicKey(); + var p2shPrivateKey2 = PrivateKey.fromWIF('cTtLHt4mv6zuJytSnM7Vd6NLxyNauYLMxD818sBC8PJ1UPiVTRSs'); + var p2shPublicKey2 = p2shPrivateKey2.toPublicKey(); + var p2shPrivateKey3 = PrivateKey.fromWIF('cQFMZ5gP9CJtUZPc9X3yFae89qaiQLspnftyxxLGvVNvM6tS6mYY'); + var p2shPublicKey3 = p2shPrivateKey3.toPublicKey(); + + var p2shAddress = Address.createMultisig([ + p2shPublicKey1, + p2shPublicKey2, + p2shPublicKey3 + ], 2, 'testnet'); + var p2shUtxoWith1BTC = { + address: p2shAddress.toString(), + txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + outputIndex: 0, + script: Script(p2shAddress).toString(), + satoshis: 1e8 + }; + + describe('adding inputs', function() { + + it('adds just once one utxo', function() { + var tx = new Transaction(); + tx.from(simpleUtxoWith1BTC); + tx.from(simpleUtxoWith1BTC); + tx.inputs.length.should.equal(1); + }); + + describe('isFullySigned', function() { + it('works for normal p2pkh', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000}]) + .change(changeAddress) + .sign(privateKey); + transaction.isFullySigned().should.equal(true); + }); + it('fails when Inputs are not subclassed and isFullySigned is called', function() { + var tx = new Transaction(tx_1_hex); + expect(function() { + return tx.isFullySigned(); + }).to.throw(errors.Transaction.UnableToVerifySignature); + }); + it('fails when Inputs are not subclassed and verifySignature is called', function() { + var tx = new Transaction(tx_1_hex); + expect(function() { + return tx.isValidSignature({ + inputIndex: 0 + }); + }).to.throw(errors.Transaction.UnableToVerifySignature); + }); + it('passes result of input.isValidSignature', function() { + var tx = new Transaction(tx_1_hex); + tx.from(simpleUtxoWith1BTC); + tx.inputs[0].isValidSignature = sinon.stub().returns(true); + var sig = { + inputIndex: 0 + }; + tx.isValidSignature(sig).should.equal(true); + }); + }); + }); + + describe('change address', function() { + it('can calculate simply the output amount', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1000000Satoshis) + .to(toAddress, 500000) + .change(changeAddress) + .sign(privateKey); + transaction.outputs.length.should.equal(2); + transaction.outputs[1].satoshis.should.equal(400000); + transaction.outputs[1].script.toString() + .should.equal(Script.fromAddress(changeAddress).toString()); + var actual = transaction.getChangeOutput().script.toString(); + var expected = Script.fromAddress(changeAddress).toString(); + actual.should.equal(expected); + }); + it('accepts a P2SH address for change', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1000000Satoshis) + .to(toAddress, 500000) + .change(changeAddressP2SH) + .sign(privateKey); + transaction.outputs.length.should.equal(2); + transaction.outputs[1].script.isScriptHashOut().should.equal(true); + }); + it('can recalculate the change amount', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 50000) + .change(changeAddress) + .fee(0) + .sign(privateKey); + + transaction.getChangeOutput().satoshis.should.equal(50000); + + transaction = transaction + .to(toAddress, 20000) + .sign(privateKey); + + transaction.outputs.length.should.equal(3); + transaction.outputs[2].satoshis.should.equal(30000); + transaction.outputs[2].script.toString() + .should.equal(Script.fromAddress(changeAddress).toString()); + }); + it('adds no fee if no change is available', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 99000) + .sign(privateKey); + transaction.outputs.length.should.equal(1); + }); + it('adds no fee if no money is available', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 100000) + .change(changeAddress) + .sign(privateKey); + transaction.outputs.length.should.equal(1); + }); + it('fee can be set up manually', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 80000) + .fee(10000) + .change(changeAddress) + .sign(privateKey); + transaction.outputs.length.should.equal(2); + transaction.outputs[1].satoshis.should.equal(10000); + }); + it('fee per kb can be set up manually', function() { + var inputs = _.map(_.range(10), function(i) { + var utxo = _.clone(simpleUtxoWith100000Satoshis); + utxo.outputIndex = i; + return utxo; + }); + var transaction = new Transaction() + .from(inputs) + .to(toAddress, 950000) + .feePerKb(8000) + .change(changeAddress) + .sign(privateKey); + transaction._estimateSize().should.be.within(1000, 1999); + transaction.outputs.length.should.equal(2); + transaction.outputs[1].satoshis.should.equal(34000); + }); + it('if satoshis are invalid', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 99999) + .change(changeAddress) + .sign(privateKey); + transaction.outputs[0]._satoshis = 100; + transaction.outputs[0]._satoshisBN = new BN(101, 10); + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.InvalidSatoshis); + }); + it('if fee is too small, fail serialization', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 99999) + .change(changeAddress) + .sign(privateKey); + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.FeeError.TooSmall); + }); + it('on second call to sign, change is not recalculated', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 100000) + .change(changeAddress) + .sign(privateKey) + .sign(privateKey); + transaction.outputs.length.should.equal(1); + }); + it('getFee() returns the difference between inputs and outputs if no change address set', function() { + var transaction = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 1000); + transaction.getFee().should.equal(99000); + }); + }); + + describe('serialization', function() { + it('stores the change address correctly', function() { + var serialized = new Transaction() + .change(changeAddress) + .toObject(); + var deserialized = new Transaction(serialized); + expect(deserialized._changeScript.toString()).to.equal(Script.fromAddress(changeAddress).toString()); + expect(deserialized.getChangeOutput()).to.equal(null); + }); + it('can avoid checked serialize', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to(fromAddress, 1); + expect(function() { + return transaction.serialize(); + }).to.throw(); + expect(function() { + return transaction.serialize(true); + }).to.not.throw(); + }); + it('stores the fee set by the user', function() { + var fee = 1000000; + var serialized = new Transaction() + .fee(fee) + .toObject(); + var deserialized = new Transaction(serialized); + expect(deserialized._fee).to.equal(fee); + }); + }); + + describe('checked serialize', function() { + it('fails if no change address was set', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to(toAddress, 1); + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.ChangeAddressMissing); + }); + it('fails if a high fee was set', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .change(changeAddress) + .fee(50000000) + .to(toAddress, 40000000); + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.FeeError.TooLarge); + }); + it('fails if a dust output is created', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to(toAddress, 545) + .change(changeAddress) + .sign(privateKey); + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.DustOutputs); + }); + it('doesn\'t fail if a dust output is not dust', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to(toAddress, 546) + .change(changeAddress) + .sign(privateKey); + expect(function() { + return transaction.serialize(); + }).to.not.throw(errors.Transaction.DustOutputs); + }); + it('doesn\'t fail if a dust output is an op_return', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .addData('not dust!') + .change(changeAddress) + .sign(privateKey); + expect(function() { + return transaction.serialize(); + }).to.not.throw(errors.Transaction.DustOutputs); + }); + it('fails when outputs and fee don\'t add to total input', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to(toAddress, 99900000) + .fee(99999) + .sign(privateKey); + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.FeeError.Different); + }); + it('checks output amount before fee errors', function() { + var transaction = new Transaction(); + transaction.from(simpleUtxoWith1BTC); + transaction + .to(toAddress, 10000000000000) + .change(changeAddress) + .fee(5); + + expect(function() { + return transaction.serialize(); + }).to.throw(errors.Transaction.InvalidOutputAmountSum); + }); + it('will throw fee error with disableMoreOutputThanInput enabled (but not triggered)', function() { + var transaction = new Transaction(); + transaction.from(simpleUtxoWith1BTC); + transaction + .to(toAddress, 84000000) + .change(changeAddress) + .fee(16000000); + + expect(function() { + return transaction.serialize({ + disableMoreOutputThanInput: true + }); + }).to.throw(errors.Transaction.FeeError.TooLarge); + }); + describe('skipping checks', function() { + var buildSkipTest = function(builder, check, expectedError) { + return function() { + var transaction = new Transaction(); + transaction.from(simpleUtxoWith1BTC); + builder(transaction); + + var options = {}; + options[check] = true; + + expect(function() { + return transaction.serialize(options); + }).not.to.throw(); + expect(function() { + return transaction.serialize(); + }).to.throw(expectedError); + }; + }; + it('can skip the check for too much fee', buildSkipTest( + function(transaction) { + return transaction + .fee(50000000) + .change(changeAddress) + .sign(privateKey); + }, 'disableLargeFees', errors.Transaction.FeeError.TooLarge + )); + it('can skip the check for a fee that is too small', buildSkipTest( + function(transaction) { + return transaction + .fee(1) + .change(changeAddress) + .sign(privateKey); + }, 'disableSmallFees', errors.Transaction.FeeError.TooSmall + )); + it('can skip the check that prevents dust outputs', buildSkipTest( + function(transaction) { + return transaction + .to(toAddress, 100) + .change(changeAddress) + .sign(privateKey); + }, 'disableDustOutputs', errors.Transaction.DustOutputs + )); + it('can skip the check that prevents unsigned outputs', buildSkipTest( + function(transaction) { + return transaction + .to(toAddress, 10000) + .change(changeAddress); + }, 'disableIsFullySigned', errors.Transaction.MissingSignatures + )); + it('can skip the check that avoids spending more bitcoins than the inputs for a transaction', buildSkipTest( + function(transaction) { + return transaction + .to(toAddress, 10000000000000) + .change(changeAddress) + .sign(privateKey); + }, 'disableMoreOutputThanInput', errors.Transaction.InvalidOutputAmountSum + )); + }); + }); + + describe('#verify', function() { + + it('not if _satoshis and _satoshisBN have different values', function() { + var tx = new Transaction() + .from({ + 'txId': testPrevTx, + 'outputIndex': 0, + 'script': testScript, + 'satoshis': testAmount + }) + .to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', testAmount - 10000); + + tx.outputs[0]._satoshis = 100; + tx.outputs[0]._satoshisBN = new BN('fffffffffffffff', 16); + var verify = tx.verify(); + verify.should.equal('transaction txout 0 satoshis is invalid'); + }); + + it('not if _satoshis is negative', function() { + var tx = new Transaction() + .from({ + 'txId': testPrevTx, + 'outputIndex': 0, + 'script': testScript, + 'satoshis': testAmount + }) + .to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', testAmount - 10000); + + tx.outputs[0]._satoshis = -100; + tx.outputs[0]._satoshisBN = new BN(-100, 10); + var verify = tx.verify(); + verify.should.equal('transaction txout 0 satoshis is invalid'); + }); + + it('not if transaction is greater than max block size', function() { + + var tx = new Transaction() + .from({ + 'txId': testPrevTx, + 'outputIndex': 0, + 'script': testScript, + 'satoshis': testAmount + }) + .to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', testAmount - 10000); + + tx.toBuffer = sinon.stub().returns({ + length: 10000000 + }); + + var verify = tx.verify(); + verify.should.equal('transaction over the maximum block size'); + + }); + + it('not if has null input (and not coinbase)', function() { + + var tx = new Transaction() + .from({ + 'txId': testPrevTx, + 'outputIndex': 0, + 'script': testScript, + 'satoshis': testAmount + }) + .to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', testAmount - 10000); + + tx.isCoinbase = sinon.stub().returns(false); + tx.inputs[0].isNull = sinon.stub().returns(true); + var verify = tx.verify(); + verify.should.equal('transaction input 0 has null input'); + + }); + + }); + + describe('to and from JSON', function() { + it('takes a string that is a valid JSON and deserializes from it', function() { + var simple = new Transaction(); + expect(new Transaction(simple.toJSON()).uncheckedSerialize()).to.equal(simple.uncheckedSerialize()); + var complex = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to(toAddress, 50000) + .change(changeAddress) + .sign(privateKey); + var cj = complex.toJSON(); + var ctx = new Transaction(cj); + expect(ctx.uncheckedSerialize()).to.equal(complex.uncheckedSerialize()); + + }); + it('serializes the `change` information', function() { + var transaction = new Transaction(); + transaction.change(changeAddress); + expect(transaction.toJSON().changeScript).to.equal(Script.fromAddress(changeAddress).toString()); + expect(new Transaction(transaction.toJSON()).uncheckedSerialize()).to.equal(transaction.uncheckedSerialize()); + }); + it('serializes correctly p2sh multisig signed tx', function() { + var t = new Transaction(tx2hex); + expect(t.toString()).to.equal(tx2hex); + var r = new Transaction(t); + expect(r.toString()).to.equal(tx2hex); + var j = new Transaction(t.toObject()); + expect(j.toString()).to.equal(tx2hex); + }); + }); + + describe('serialization of inputs', function() { + it('can serialize and deserialize a P2PKH input', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC); + var deserialized = new Transaction(transaction.toObject()); + expect(deserialized.inputs[0] instanceof Transaction.Input.PublicKeyHash).to.equal(true); + }); + it('can serialize and deserialize a P2SH input', function() { + var transaction = new Transaction() + .from({ + txId: '0000', // Not relevant + outputIndex: 0, + script: Script.buildMultisigOut([public1, public2], 2).toScriptHashOut(), + satoshis: 10000 + }, [public1, public2], 2); + var deserialized = new Transaction(transaction.toObject()); + expect(deserialized.inputs[0] instanceof Transaction.Input.MultiSigScriptHash).to.equal(true); + }); + }); + + describe('checks on adding inputs', function() { + var transaction = new Transaction(); + it('fails if no output script is provided', function() { + expect(function() { + transaction.addInput(new Transaction.Input()); + }).to.throw(errors.Transaction.NeedMoreInfo); + }); + it('fails if no satoshi amount is provided', function() { + var input = new Transaction.Input(); + expect(function() { + transaction.addInput(input); + }).to.throw(errors.Transaction.NeedMoreInfo); + expect(function() { + transaction.addInput(new Transaction.Input(), Script.empty()); + }).to.throw(errors.Transaction.NeedMoreInfo); + }); + it('allows output and transaction to be feed as arguments', function() { + expect(function() { + transaction.addInput(new Transaction.Input(), Script.empty(), 0); + }).to.not.throw(); + }); + it('does not allow a threshold number greater than the amount of public keys', function() { + expect(function() { + transaction = new Transaction(); + return transaction.from({ + txId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 0, + script: Script(), + satoshis: 10000 + }, [], 1); + }).to.throw('Number of required signatures must be greater than the number of public keys'); + }); + it('will add an empty script if not supplied', function() { + transaction = new Transaction(); + var outputScriptString = 'OP_2 21 0x038282263212c609d9ea2a6e3e172de238d8c39' + + 'cabd5ac1ca10646e23fd5f51508 21 0x038282263212c609d9ea2a6e3e172de23' + + '8d8c39cabd5ac1ca10646e23fd5f51508 OP_2 OP_CHECKMULTISIG OP_EQUAL'; + transaction.addInput(new Transaction.Input({ + prevTxId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 0, + script: new Script() + }), outputScriptString, 10000); + transaction.inputs[0].output.script.should.be.instanceof(bitcore.Script); + transaction.inputs[0].output.script.toString().should.equal(outputScriptString); + }); + }); + + describe('removeInput and removeOutput', function() { + it('can remove an input by index', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC); + transaction.inputs.length.should.equal(1); + transaction.inputAmount.should.equal(simpleUtxoWith1BTC.satoshis); + transaction.removeInput(0); + transaction.inputs.length.should.equal(0); + transaction.inputAmount.should.equal(0); + }); + it('can remove an input by transaction id', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC); + transaction.inputs.length.should.equal(1); + transaction.inputAmount.should.equal(simpleUtxoWith1BTC.satoshis); + transaction.removeInput(simpleUtxoWith1BTC.txId, simpleUtxoWith1BTC.outputIndex); + transaction.inputs.length.should.equal(0); + transaction.inputAmount.should.equal(0); + }); + it('fails if the index provided is invalid', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC); + expect(function() { + transaction.removeInput(2); + }).to.throw(errors.Transaction.InvalidIndex); + }); + it('an output can be removed by index', function() { + var transaction = new Transaction() + .to([ + {address: toAddress, satoshis: 40000000}, + {address: toAddress, satoshis: 40000000} + ]) + transaction.outputs.length.should.equal(2); + transaction.outputAmount.should.equal(80000000); + transaction.removeOutput(0); + transaction.outputs.length.should.equal(1); + transaction.outputAmount.should.equal(40000000); + }); + }); + + describe('handling the nLockTime', function() { + var MILLIS_IN_SECOND = 1000; + var timestamp = 1423504946; + var blockHeight = 342734; + var date = new Date(timestamp * MILLIS_IN_SECOND); + it('handles a null locktime', function() { + var transaction = new Transaction(); + expect(transaction.getLockTime()).to.equal(null); + }); + it('handles a simple example', function() { + var future = new Date(2025, 10, 30); // Sun Nov 30 2025 + var transaction = new Transaction() + .lockUntilDate(future); + transaction.nLockTime.should.equal(future.getTime() / 1000); + transaction.getLockTime().should.deep.equal(future); + }); + it('accepts a date instance', function() { + var transaction = new Transaction() + .lockUntilDate(date); + transaction.nLockTime.should.equal(timestamp); + transaction.getLockTime().should.deep.equal(date); + }); + it('accepts a number instance with a timestamp', function() { + var transaction = new Transaction() + .lockUntilDate(timestamp); + transaction.nLockTime.should.equal(timestamp); + transaction.getLockTime().should.deep.equal(new Date(timestamp * 1000)); + }); + it('accepts a block height', function() { + var transaction = new Transaction() + .lockUntilBlockHeight(blockHeight); + transaction.nLockTime.should.equal(blockHeight); + transaction.getLockTime().should.deep.equal(blockHeight); + }); + it('fails if the block height is too high', function() { + expect(function() { + return new Transaction().lockUntilBlockHeight(5e8); + }).to.throw(errors.Transaction.BlockHeightTooHigh); + }); + it('fails if the date is too early', function() { + expect(function() { + return new Transaction().lockUntilDate(1); + }).to.throw(errors.Transaction.LockTimeTooEarly); + expect(function() { + return new Transaction().lockUntilDate(499999999); + }).to.throw(errors.Transaction.LockTimeTooEarly); + }); + it('fails if the block height is negative', function() { + expect(function() { + return new Transaction().lockUntilBlockHeight(-1); + }).to.throw(errors.Transaction.NLockTimeOutOfRange); + }); + it('has a non-max sequenceNumber for effective date locktime tx', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .lockUntilDate(date); + transaction.inputs[0].sequenceNumber + .should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER); + }); + it('has a non-max sequenceNumber for effective blockheight locktime tx', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .lockUntilBlockHeight(blockHeight); + transaction.inputs[0].sequenceNumber + .should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER); + }); + it('should serialize correctly for date locktime ', function() { + var transaction= new Transaction() + .from(simpleUtxoWith1BTC) + .lockUntilDate(date); + var serialized_tx = transaction.uncheckedSerialize(); + var copy = new Transaction(serialized_tx); + serialized_tx.should.equal(copy.uncheckedSerialize()); + copy.inputs[0].sequenceNumber + .should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER) + }); + it('should serialize correctly for a block height locktime', function() { + var transaction= new Transaction() + .from(simpleUtxoWith1BTC) + .lockUntilBlockHeight(blockHeight); + var serialized_tx = transaction.uncheckedSerialize(); + var copy = new Transaction(serialized_tx); + serialized_tx.should.equal(copy.uncheckedSerialize()); + copy.inputs[0].sequenceNumber + .should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER) + }); + }); + + it('handles anyone-can-spend utxo', function() { + var transaction = new Transaction() + .from(anyoneCanSpendUTXO) + .to(toAddress, 50000); + should.exist(transaction); + }); + + it('handles unsupported utxo in tx object', function() { + var transaction = new Transaction(); + transaction.fromObject.bind(transaction, JSON.parse(unsupportedTxObj)) + .should.throw('Unsupported input script type: OP_1 OP_ADD OP_2 OP_EQUAL'); + }); + + it('will error if object hash does not match transaction hash', function() { + var tx = new Transaction(tx_1_hex); + var txObj = tx.toObject(); + txObj.hash = 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458'; + (function() { + var tx2 = new Transaction(txObj); + }).should.throw('Hash in object does not match transaction hash'); + }); + + describe('inputAmount + outputAmount', function() { + it('returns correct values for simple transaction', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to(toAddress, 40000000); + transaction.inputAmount.should.equal(100000000); + transaction.outputAmount.should.equal(40000000); + }); + it('returns correct values for transaction with change', function() { + var transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .change(changeAddress) + .to(toAddress, 1000); + transaction.inputAmount.should.equal(100000000); + transaction.outputAmount.should.equal(99900000); + }); + it('returns correct values for coinjoin transaction', function() { + // see livenet tx c16467eea05f1f30d50ed6dbc06a38539d9bb15110e4b7dc6653046a3678a718 + var transaction = new Transaction(txCoinJoinHex); + transaction.outputAmount.should.equal(4191290961); + expect(function() { + var ia = transaction.inputAmount; + }).to.throw('No previous output information'); + }); + }); + + describe('output ordering', function() { + + var transaction, out1, out2, out3, out4; + + beforeEach(function() { + transaction = new Transaction() + .from(simpleUtxoWith1BTC) + .to([ + {address: toAddress, satoshis: tenth}, + {address: toAddress, satoshis: fourth} + ]) + .to(toAddress, half) + .change(changeAddress); + out1 = transaction.outputs[0]; + out2 = transaction.outputs[1]; + out3 = transaction.outputs[2]; + out4 = transaction.outputs[3]; + }); + + it('allows the user to sort outputs according to a criteria', function() { + var sorting = function(array) { + return [array[3], array[2], array[1], array[0]]; + }; + transaction.sortOutputs(sorting); + transaction.outputs[0].should.equal(out4); + transaction.outputs[1].should.equal(out3); + transaction.outputs[2].should.equal(out2); + transaction.outputs[3].should.equal(out1); + }); + + it('allows the user to randomize the output order', function() { + var shuffle = sinon.stub(_, 'shuffle'); + shuffle.onFirstCall().returns([out2, out1, out4, out3]); + + transaction._changeIndex.should.equal(3); + transaction.shuffleOutputs(); + transaction.outputs[0].should.equal(out2); + transaction.outputs[1].should.equal(out1); + transaction.outputs[2].should.equal(out4); + transaction.outputs[3].should.equal(out3); + transaction._changeIndex.should.equal(2); + + _.shuffle.restore(); + }); + + it('fails if the provided function does not work as expected', function() { + var sorting = function(array) { + return [array[0], array[1], array[2]]; + }; + expect(function() { + transaction.sortOutputs(sorting); + }).to.throw(errors.Transaction.InvalidSorting); + }); + + it('shuffle without change', function() { + var tx = new Transaction(transaction.toObject()).to(toAddress, half); + expect(tx.getChangeOutput()).to.be.null; + expect(function() { + tx.shuffleOutputs(); + }).to.not.throw(errors.Transaction.InvalidSorting); + }) + }); + + describe('clearOutputs', function() { + + it('removes all outputs and maintains the transaction in order', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .to(toAddress, tenth) + .to([ + {address: toAddress, satoshis: fourth}, + {address: toAddress, satoshis: half} + ]) + .change(changeAddress); + tx.clearOutputs(); + tx.outputs.length.should.equal(1); + tx.to(toAddress, tenth); + tx.outputs.length.should.equal(2); + tx.outputs[0].satoshis.should.equal(10000000); + tx.outputs[0].script.toAddress().toString().should.equal(toAddress); + tx.outputs[1].satoshis.should.equal(89900000); + tx.outputs[1].script.toAddress().toString().should.equal(changeAddress); + }); + + }); + + describe('BIP69 Sorting', function() { + + it('sorts inputs correctly', function() { + var from1 = { + txId: '0000000000000000000000000000000000000000000000000000000000000000', + outputIndex: 0, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 100000 + }; + var from2 = { + txId: '0000000000000000000000000000000000000000000000000000000000000001', + outputIndex: 0, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 100000 + }; + var from3 = { + txId: '0000000000000000000000000000000000000000000000000000000000000001', + outputIndex: 1, + script: Script.buildPublicKeyHashOut(fromAddress).toString(), + satoshis: 100000 + }; + var tx = new Transaction() + .from(from3) + .from(from2) + .from(from1); + tx.sort(); + tx.inputs[0].prevTxId.toString('hex').should.equal(from1.txId); + tx.inputs[1].prevTxId.toString('hex').should.equal(from2.txId); + tx.inputs[2].prevTxId.toString('hex').should.equal(from3.txId); + tx.inputs[0].outputIndex.should.equal(from1.outputIndex); + tx.inputs[1].outputIndex.should.equal(from2.outputIndex); + tx.inputs[2].outputIndex.should.equal(from3.outputIndex); + }); + + it('sorts outputs correctly', function() { + var tx = new Transaction() + .addOutput(new Transaction.Output({ + script: new Script().add(Opcode(0)), + satoshis: 2 + })) + .addOutput(new Transaction.Output({ + script: new Script().add(Opcode(1)), + satoshis: 2 + })) + .addOutput(new Transaction.Output({ + script: new Script().add(Opcode(0)), + satoshis: 1 + })); + tx.sort(); + tx.outputs[0].satoshis.should.equal(1); + tx.outputs[1].satoshis.should.equal(2); + tx.outputs[2].satoshis.should.equal(2); + tx.outputs[0].script.toString().should.equal('OP_0'); + tx.outputs[1].script.toString().should.equal('OP_0'); + tx.outputs[2].script.toString().should.equal('0x01'); + }); + + describe('bitcoinjs fixtures', function() { + + var fixture = require('../data/bip69.json'); + + // returns index-based order of sorted against original + var getIndexOrder = function(original, sorted) { + return sorted.map(function (value) { + return original.indexOf(value); + }); + }; + + fixture.inputs.forEach(function(inputSet) { + it(inputSet.description, function() { + var tx = new Transaction(); + inputSet.inputs = inputSet.inputs.map(function(input) { + var input = new Input({ + prevTxId: input.txId, + outputIndex: input.vout, + script: new Script(), + output: new Output({ script: new Script(), satoshis: 0 }) + }); + input.clearSignatures = function () {}; + return input; + }); + tx.inputs = inputSet.inputs; + tx.sort(); + getIndexOrder(inputSet.inputs, tx.inputs).should.deep.equal(inputSet.expected); + }); + }); + fixture.outputs.forEach(function(outputSet) { + it(outputSet.description, function() { + var tx = new Transaction(); + outputSet.outputs = outputSet.outputs.map(function(output) { + return new Output({ + script: new Script(output.script), + satoshis: output.value + }); + }); + tx.outputs = outputSet.outputs; + tx.sort(); + getIndexOrder(outputSet.outputs, tx.outputs).should.deep.equal(outputSet.expected); + }); + }); + + }); + }); + describe('Replace-by-fee', function() { + describe('#enableRBF', function() { + it('only enable inputs not already enabled (0xffffffff)', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.inputs[0].sequenceNumber = 0x00000000; + tx.enableRBF(); + tx.inputs[0].sequenceNumber.should.equal(0x00000000); + tx.inputs[1].sequenceNumber.should.equal(0xfffffffd); + }); + it('enable for inputs with 0xffffffff and 0xfffffffe', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.inputs[0].sequenceNumber = 0xffffffff; + tx.inputs[1].sequenceNumber = 0xfffffffe; + tx.enableRBF(); + tx.inputs[0].sequenceNumber.should.equal(0xfffffffd); + tx.inputs[1].sequenceNumber.should.equal(0xfffffffd); + }); + }); + describe('#isRBF', function() { + it('enable and determine opt-in', function() { + var tx = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000}]) + .fee(15000) + .change(changeAddress) + .enableRBF() + .sign(privateKey); + tx.isRBF().should.equal(true); + }); + it('determine opt-out with default sequence number', function() { + var tx = new Transaction() + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.isRBF().should.equal(false); + }); + it('determine opt-out with 0xfffffffe', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000 + 1e8}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.inputs[0].sequenceNumber = 0xfffffffe; + tx.inputs[1].sequenceNumber = 0xfffffffe; + tx.isRBF().should.equal(false); + }); + it('determine opt-out with 0xffffffff', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000 + 1e8}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.inputs[0].sequenceNumber = 0xffffffff; + tx.inputs[1].sequenceNumber = 0xffffffff; + tx.isRBF().should.equal(false); + }); + it('determine opt-in with 0xfffffffd (first input)', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000 + 1e8}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.inputs[0].sequenceNumber = 0xfffffffd; + tx.inputs[1].sequenceNumber = 0xffffffff; + tx.isRBF().should.equal(true); + }); + it('determine opt-in with 0xfffffffd (second input)', function() { + var tx = new Transaction() + .from(simpleUtxoWith1BTC) + .from(simpleUtxoWith100000Satoshis) + .to([{address: toAddress, satoshis: 50000 + 1e8}]) + .fee(15000) + .change(changeAddress) + .sign(privateKey); + tx.inputs[0].sequenceNumber = 0xffffffff; + tx.inputs[1].sequenceNumber = 0xfffffffd; + tx.isRBF().should.equal(true); + }); + }); + }); + + describe('Segregated Witness', function() { + it('identify as segwit transaction', function() { + // https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki + var version = new Buffer('01000000', 'hex'); + var marker = new Buffer('00', 'hex'); //always zero + var flag = new Buffer('01', 'hex'); //non zero + var inputCount = new Buffer('01', 'hex'); + var inputDummy = new Buffer('2052cda8bc0c2cb743f154881fc85cb675527dcf2f7a5938241020c33341b3f70000000000ffffffff', 'hex'); + var outputCount = new Buffer('00', 'hex'); + var witness = new Buffer('01', 'hex'); + var witnessItems = new Buffer('00', 'hex'); + var locktime = new Buffer('00000000', 'hex'); + var txBuffer = Buffer.concat([version, marker, flag, inputCount, inputDummy, outputCount, witness, + witnessItems, locktime]); + var tx = bitcore.Transaction().fromBuffer(txBuffer); + tx.hasWitnesses().should.equal(true); + }); + it('correctly calculate hash for segwit transaction', function() { + var txBuffer = new Buffer('01000000000101b0e5caa7e37d4b8530c3e1071a36dd5e05d1065cf7224ddff42c69e3387689870000000000ffffffff017b911100000000001600144ff831574da8bef07f8bc97244a1666147b071570247304402203fcbcfddbd6ca3a90252610dd63f1be50b2d926b8d87c912da0a3e42bb03fba002202a90c8aad75da22b0549c72618b754114583e934c0b0d2ccd6c13fcd859ba4ed01210363f3f47f4555779de405eab8d0dc8c2a4f3e09f4171a3fa47c7a77715795319800000000', 'hex'); + var tx = bitcore.Transaction().fromBuffer(txBuffer); + tx.hash.should.equal('7f1a2d46746f1bfbb22ab797d5aad1fd9723477b417fa34dff73d8a7dbb14570'); + tx.witnessHash.should.equal('3c26fc8b5cfe65f96d955cecfe4d11db2659d052171f9f31af043e9f5073e46b'); + }); + it('round trip nested witness p2sh', function() { + var txBuffer = new Buffer('010000000001010894bb2bbfd5249b1c55f7bc64352bb64894938bc6439f43f28a58bfa7c73205000000002322002077b16b966ee6a4b8a0901351221d279afd31d3f90df52a3fc53436ea9abde5b0ffffffff01010000000000000000030047304402200fa23efa9a8d6ae285cfc82f81e6c2196d14167553b10da1845abd2c9fe38dc502207a40a58ee5b739e902b275018dfa1bee0d608736ff4317b028fbc29391f4554f01475221037b8dc5861a0ef7b0a97b41d2d1e27186f019d4834dbc99f24952b6f5080f5cce21027152378182102b68b5fce42f9f365ec272c48afda6b0816e735c1dc4b96dd45a52ae00000000', 'hex'); + var tx = bitcore.Transaction().fromBuffer(txBuffer); + tx.toBuffer().toString('hex').should.equal(txBuffer.toString('hex')); + }); + describe('verifying', function() { + it('will verify these signatures', function() { + var signedTxBuffer = new Buffer('0100000000010103752b9d2baadb95480e2571a4854a68ffd8264462168346461b7cdda76beac20000000023220020fde78ea47ae10cc93c6a850d8a86d8575ddacff38ee9b0bc6535dc016a197068ffffffff010100000000000000000400483045022100ea1508225a6d37c0545d22acaee88d29d1675696953f93d657a419613bcee9b802207b8d80ca8176586878f51e001cb9e92f7640b8c9dc530fabf9087142c752de89014830450221008c6f4a9ebdee89968ec00ecc12fda67442b589296e86bf3e9bde19f4ba923406022048c3409831a55bf61f2d5defffd3b91767643b6c5981cb32338dd7e9f02821b1014752210236c8204d62fd70e7ca206a36d39f9674fa832964d787c60d44250624242bada4210266cd5a3507d6df5346aa42bd23d4c44c079aef0d7a59534758a0dabb82345c2052ae00000000', 'hex'); + var unsignedBuffer = new Buffer('0100000000010103752b9d2baadb95480e2571a4854a68ffd8264462168346461b7cdda76beac20000000023220020fde78ea47ae10cc93c6a850d8a86d8575ddacff38ee9b0bc6535dc016a197068ffffffff010100000000000000000300483045022100ea1508225a6d37c0545d22acaee88d29d1675696953f93d657a419613bcee9b802207b8d80ca8176586878f51e001cb9e92f7640b8c9dc530fabf9087142c752de89014752210236c8204d62fd70e7ca206a36d39f9674fa832964d787c60d44250624242bada4210266cd5a3507d6df5346aa42bd23d4c44c079aef0d7a59534758a0dabb82345c2052ae00000000', 'hex'); + var signedTx = bitcore.Transaction().fromBuffer(signedTxBuffer); + + var signatures = [ + { + publicKey: '0236c8204d62fd70e7ca206a36d39f9674fa832964d787c60d44250624242bada4', + prevTxId: 'c2ea6ba7dd7c1b46468316624426d8ff684a85a471250e4895dbaa2b9d2b7503', + outputIndex: 0, + inputIndex: 0, + signature: '3045022100ea1508225a6d37c0545d22acaee88d29d1675696953f93d657a419613bcee9b802207b8d80ca8176586878f51e001cb9e92f7640b8c9dc530fabf9087142c752de89', + sigtype: bitcore.crypto.Signature.SIGHASH_ALL + }, + { + publicKey: '0266cd5a3507d6df5346aa42bd23d4c44c079aef0d7a59534758a0dabb82345c20', + prevTxId: 'c2ea6ba7dd7c1b46468316624426d8ff684a85a471250e4895dbaa2b9d2b7503', + outputIndex: 0, + inputIndex: 0, + signature: '30450221008c6f4a9ebdee89968ec00ecc12fda67442b589296e86bf3e9bde19f4ba923406022048c3409831a55bf61f2d5defffd3b91767643b6c5981cb32338dd7e9f02821b1', + sigtype: bitcore.crypto.Signature.SIGHASH_ALL + } + ]; + + var pubkey1 = bitcore.PublicKey('0236c8204d62fd70e7ca206a36d39f9674fa832964d787c60d44250624242bada4'); + var pubkey3 = bitcore.PublicKey('0266cd5a3507d6df5346aa42bd23d4c44c079aef0d7a59534758a0dabb82345c20'); + var expectedDestScript = bitcore.Script('a914382ead50307554bcdda12e1238368e9f0e10b11787'); + var expectedMultiSigString = '52210236c8204d62fd70e7ca206a36d39f9674fa832964d787c60d44250624242bada4210266cd5a3507d6df5346aa42bd23d4c44c079aef0d7a59534758a0dabb82345c2052ae'; + var expectedMultiSig = bitcore.Script(expectedMultiSigString); + var multiSig = bitcore.Script.buildMultisigOut([pubkey1, pubkey3], 2, { + noSorting: true + }); + multiSig.toBuffer().toString('hex').should.equal(expectedMultiSigString); + var wits = bitcore.Script.buildWitnessMultisigOutFromScript(multiSig); + + var expectedWits = bitcore.Script('0020fde78ea47ae10cc93c6a850d8a86d8575ddacff38ee9b0bc6535dc016a197068'); + wits.toBuffer().toString('hex').should.equal('0020fde78ea47ae10cc93c6a850d8a86d8575ddacff38ee9b0bc6535dc016a197068'); + + var address = Address.payingTo(wits); + address.hashBuffer.toString('hex').should.equal('382ead50307554bcdda12e1238368e9f0e10b117'); + + var destScript = Script.buildScriptHashOut(wits); + destScript.toBuffer().toString('hex').should.equal('a914382ead50307554bcdda12e1238368e9f0e10b11787'); + + var signedamount = 1; + var input = new Transaction.Input.MultiSigScriptHash({ + output: new Output({ + script: destScript, + satoshis: signedamount + }), + prevTxId: 'c2ea6ba7dd7c1b46468316624426d8ff684a85a471250e4895dbaa2b9d2b7503', + outputIndex: 0, + script: Script('220020fde78ea47ae10cc93c6a850d8a86d8575ddacff38ee9b0bc6535dc016a197068') + }, [pubkey1, pubkey3], 2, signatures, true); + + signedTx.inputs[0] = input; + signedTx.inputs[0]._updateScript(); + signedTx.toBuffer().toString('hex').should.equal(signedTxBuffer.toString('hex')); + + var interpreter = new Interpreter(); + var flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + + var check = interpreter.verify(signedTx.inputs[0].script, destScript, signedTx, 0, flags, input.getWitnesses(), signedamount); + check.should.equal(true); + + check = interpreter.verify(signedTx.inputs[0].script, destScript, signedTx, 0, flags, input.getWitnesses(), 1999199); + check.should.equal(false); + + var valid1 = signedTx.inputs[0].isValidSignature(signedTx, signedTx.inputs[0].signatures[1]); + valid1.should.equal(true); + + var valid = signedTx.inputs[0].isValidSignature(signedTx, signedTx.inputs[0].signatures[0]); + valid.should.equal(true); + }); + describe('Bitcoin Core tests', function() { + // from bitcoin core tests at src/test/transaction_tests.cpp + it('will verify pay-to-compressed publickey (v0) part 1', function() { + var check; + var flags; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000016001457d5e8f4701ae218576e4fdbcf702e4716808f5f00000000'); + var input1 = bitcore.Transaction('01000000000101da3ca8fe74ee2f6cc6ed02927a5fc8e9832f4ff6ad10521598f7985dcd5d17740000000000ffffffff010100000000000000000247304402202eee148a880846e3ebf9b61b5875a0c5121428d272a8336d10bae745ec401042022063b65baea1adc0e7a15801922242ab89d103143071680cfd4ba6072f8685a76c0121031fa0febd51842888a36c43873d1520c5b186894c5ac04520b096f8a3b49f8a5b00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + }); + it('will verify pay-to-compressed publickey (v0) part 2', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000016001457d5e8f4701ae218576e4fdbcf702e4716808f5f00000000'); + var input2 = bitcore.Transaction('01000000000101cdc27b7132dc20e463d20458aa9d5c38e664ff114ddab8277af4ed859f2b90e20000000000ffffffff0101000000000000000002483045022100db56d1a70244f478a345478be51891b38b9a46140402cddf85b3024ca1652b4b02202c00aaa41ac941ce426ae358aa8372b63aeba945372002c47dc3725d9dca8343012103585c9f7105e09a0abbc60dc72d9d0a456030d0f10f7c47c0616e71c325085cbd00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input2.inputs[0].script; + var witnesses = input2.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify p2sh witness pay-to-compressed pubkey (v0) part 1', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a914ca8abcc57aff5ba3fb36f76fe8e260ce6a08e0bf8700000000'); + var input1 = bitcore.Transaction('01000000000101b85d4c861b00d31ac95ae0b2cad8635d8310fb7ca86b44fefcbe2b98c4e905bd000000001716001469f84dbc7f9ae8626aa2d4aee6c73ef726b53ac2ffffffff0101000000000000000002483045022100c0237a5743c684642b26347cf82df0f3b3e91c76aff171f7d065cea305f059a502205c168682630ea4e6bd42627c237207be3d43aeba5c1b8078f3043455bdb6a2270121036240793eedd7e6e53a7c236d069e4d8558f4c6e5950114d7e3d5e1579c93fdf100000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + }); + it('will verify p2sh witness pay-to-compressed pubkey (v0) part 2', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a9145675f64cbe03b43fb6d9d42debd207e4be3337db8700000000'); + var input2 = bitcore.Transaction('0100000000010104410fc0d228780b20ff790212aef558df008421a110d56d9c9a9b6e5eeb1a680000000017160014b9c556bc9c34cf70d4c253ff86a9eac64e355a25ffffffff0101000000000000000002483045022100dd41426f5eb82ef2b72a0b4e5112022c80045ae4919b2fdef7f438f7ed3c59ee022043494b6f9a9f28d7e5a5c221f92d5325d941722c0ffd00f8be335592015a44d2012103587155d2618b140244799f7a408a85836403f447d51778bdb832088c4a9dd1e300000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input2.inputs[0].script; + var witnesses = input2.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify witness 2-of-2 multisig (part 1)', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff0101000000000000002200204cd0c4dc1a95d8909396d0c1648793fa673518849e1b25259c581ede30e61b7900000000'); + var input1 = bitcore.Transaction('010000000001010d81757bb9f141a2d002138e86e54e8cb92b72201b38480a50377913e918612f0000000000ffffffff010100000000000000000300483045022100aa92d26d830b7529d906f7e72c1015b96b067664b68abae2d960a501e76f07780220694f4850e0003cb7e0d08bd4c67ee5fcb604c42684eb805540db5723c4383f780147522102f30bb0258f12a3bbf4fe0b5ada99974d6dbdd06876cb2687a59fa2ea7c7268aa2103d74fd4c6f08e3a4d32dde8e1404d00b2a3d323f94f5c43b4edda962b1f4cb55852ae00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = 0; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify witness 2-of-2 multisig (part 2)', function() { + var flags; + var check; + var interpreter; + var output2 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000022002067b786a598572a1a0fad2f8f48e90c3f2cc89ef110f029f35323b15ba6e9b2f900000000'); + var input2 = bitcore.Transaction('01000000000101812d39aa60f01c994c43bc160c87420b6b93bf8db2fe658df45f152250fae9100000000000ffffffff010100000000000000000300483045022100ae56c6d646656366601835e6bc2d151a9974cb1b7cbdeba27cc51ef8c59d2e3f022041e95e80d3e068eb278e31b07f984800869115111c647e2ca32718d26d8e8cd401475221032ac79a7160a0af81d59ffeb914537b1d126a3629271ac1393090c6c9a94bc81e2103eb8129ad88864e7702604ae5b36bad74dbb0f5abfd8ee9ee5def3869756b6c4152ae00000000'); + var scriptPubkey = output2.outputs[0].script; + var scriptSig = input2.inputs[0].script; + var witnesses = input2.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = 0; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify witness 2-of-2 multisig (part 3)', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff0101000000000000002200207780f1145ef7ba4e703388c155d94bc399e24345e11c4559e683d5070feeb27400000000'); + var input1 = bitcore.Transaction('01000000000101791890e3effa9d4061a984812a90675418d0eb141655c106cce9b4bbbf9a3be00000000000ffffffff010100000000000000000400483045022100db977a31834033466eb103131b1ef9c57d6cea17f9a7eb3f3bafde1d7c1ddff502205ad84c9ca9c4139dce6e8e7850cc09a49ad57197b266814e79a78527ab4a9f950147304402205bd26da7dab9e379019ffd5e76fa77e161090bf577ed875e8e969f06cd66ba0a0220082cf7315ff7dc7aa8f6cebf7e70af1ffa45e63581c08e6fbc4e964035e6326b0147522102f86e3dc39cf9cd6c0eeb5fe25e3abe34273b8e79cc888dd5512001c7dac31b9921032e16a3c764fb6485345d91b39fb6da52c7026b8819e1e7d2f838a0df1445851a52ae00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + }); + it('will verify p2sh witness 2-of-2 multisig (part 1)', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a914d0e24dc9fac5cfc616b364797de40f100086e9d58700000000'); + var input1 = bitcore.Transaction('010000000001015865ee582f91c2ac646114493c3c39a3b2b08607cd96ba573f4525a01d1f85da000000002322002055423059d7eb9252d1abd6e85a4710c0bb8fabcd48cf9ddd811377557a77fc0dffffffff010100000000000000000300473044022031f9630a8ed776d6cef9ecab58cc9ee384338f4304152d93ac19482ac1ccbc030220616f194c7228484af208433b734b59ec82e21530408ed7a61e896cfefb5c4d6b014752210361424173f5b273fc134ce02a5009b07422b3f4ee63edc82cfd5bba7f72e530732102014ba09ca8cc68720bdf565f55a28b7b845be8ef6a17188b0fddcd55c16d450652ae00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = 0; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify p2sh witness 2-of-2 multisig (part 2)', function() { + var flags; + var check; + var interpreter; + var output2 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a914294b319a1c23951902e25e0147527c8eac3009c68700000000'); + var input2 = bitcore.Transaction('01000000000101d93fa44db148929eada630dd419142935c75a72d3678291327ab35d0983b37500000000023220020786e2abd1a684f8337c637f54f6ba3da75b5d75ef96cc7e7369cc69d8ca80417ffffffff010100000000000000000300483045022100b36be4297f2e1d115aba5a5fbb19f6882c61016ba9d6fa01ebb517d14109ec6602207de237433c7534d766ec36d9bddf839b961805e336e42fae574e209b1dc8e30701475221029569b67a4c695502aa31c8a7992b975aa591f2d7de61a4def63771213792288c2103ad3b7eeedf4cba17836ff9a29044a782889cd74ca8f426e83112fa199611676652ae00000000'); + var scriptPubkey = output2.outputs[0].script; + var scriptSig = input2.inputs[0].script; + var witnesses = input2.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = 0; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify p2sh witness 2-of-2 multisig (part 3)', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a9143f588990832299c654d8032bc6c5d181427a321e8700000000'); + var input1 = bitcore.Transaction('01000000000101ef6f782539d100d563d736339c4a57485b562f9705b28680b08b3efe9dd815870000000023220020a51db581b721c64132415f985ac3086bcf7817f1bbf45be984718b41f4189b39ffffffff01010000000000000000040047304402203202c4c3b40c091a051707421def9adb0d101076672ab220db36a3f87bbecad402205f976ff87af9149e83c87c94ec3b308c1abe4b8c5b3f43c842ebffc22885fc530147304402203c0a50f199774f6393e42ee29d3540cf868441b47efccb11139a357ecd45c5b702205e8442ff34f6f836cd9ad96c158504469db178d63a309d813ba68b86c7293f66014752210334f22ecf25636ba18f8c89e90d38f05036094fe0be48187fb9842374a237b1062102993d85ece51cec8c4d841fce02faa6130f57c811078c5f2a48c204caf12853b552ae00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + }); + it('will verify witness pay-to-uncompressed-pubkey (v1) part 1', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000016001449ca7f5980799857e4cc236a288b95dc7e647de200000000'); + var input1 = bitcore.Transaction('010000000001014cc98b43a012d8cb56cee7e2011e041c23a622a69a8b97d6f53144e5eb319d1c0000000000ffffffff010100000000000000000248304502210085fb71eecc4b65fd31102bc93f46ec564fce6d22f749ad2d9b4adf4d9477c52602204c4fb00a48bafb4f1c0d7a397d3e0ae12bb8ae394d8b5632e894eafccabf4b160141047dc77183e8fef00c7839a272c4dc2c9b25fb109c0eebe74b27fa98cfd6fa83c76c44a145827bf880162ff7ae48574b5d42595601eee5b8733f1507f028ba401000000000'); + var input2 = bitcore.Transaction('0100000000010170ccaf8888099cee3cb869e768f6f24a85838a936cfda787186b179392144cbc0000000000ffffffff010100000000000000000247304402206667f8681ecdc66ad160ff4916c6f3e2946a1eda9e031535475f834c11d5e07c022064360fce49477fa0898b3928eb4503ca71043c67df9229266316961a6bbcc2ef014104a8288183cc741b814a286414ee5fe81ab189ecae5bb1c42794b270c33ac9702ab279fd97a5ed87437659b45197bbd3a87a449fa5b244a6941303683aa68bd11e00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + }); + it('will verify witness pay-to-uncompressed-pubkey (v1) part 2', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000016001449ca7f5980799857e4cc236a288b95dc7e647de200000000'); + var input2 = bitcore.Transaction('0100000000010170ccaf8888099cee3cb869e768f6f24a85838a936cfda787186b179392144cbc0000000000ffffffff010100000000000000000247304402206667f8681ecdc66ad160ff4916c6f3e2946a1eda9e031535475f834c11d5e07c022064360fce49477fa0898b3928eb4503ca71043c67df9229266316961a6bbcc2ef014104a8288183cc741b814a286414ee5fe81ab189ecae5bb1c42794b270c33ac9702ab279fd97a5ed87437659b45197bbd3a87a449fa5b244a6941303683aa68bd11e00000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input2.inputs[0].script; + var witnesses = input2.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS;; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + it('will verify p2sh witness pay-to-uncompressed-pubkey (v1) part 1', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a9147b615f35c476c8f3c555b4d52e54760b2873742f8700000000'); + var input1 = bitcore.Transaction('01000000000101160aa337bd325875674904f80d706b4d02cec9888eb2dbae788e18ed01f7712d0000000017160014eff6eebd0dcd3923ca3ab3ea57071fa82ea1faa5ffffffff010100000000000000000247304402205c87348896d3a9de62b1a646c29c4728bec62e384fa16167e302357883c04134022024a98e0fbfde9c24528fbe8f36e05a19a6f37dea16822b80259fcfc8ab2358fb0141048b4e234c057e32d2304697b4d2273679417355bb6bf2d946add731de9719d6801892b6154291ce2cf45c106a6d754c76f81e4316187aa54938af224d9eddb36400000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input1.inputs[0].script; + var witnesses = input1.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS;; + check = interpreter.verify(scriptSig, scriptPubkey, input1, 0, flags, witnesses, satoshis); + check.should.equal(true); + }); + it('will verify p2sh witness pay-to-uncompressed-pubkey (v1) part 2', function() { + var flags; + var check; + var interpreter; + var output1 = bitcore.Transaction('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff01010000000000000017a9147b615f35c476c8f3c555b4d52e54760b2873742f8700000000'); + var input2 = bitcore.Transaction('01000000000101eefb67109c118e958d81f3f98638d48bc6c14eae97cedfce7c397eabb92b4e320000000017160014eff6eebd0dcd3923ca3ab3ea57071fa82ea1faa5ffffffff010100000000000000000247304402200ed4fa4bc8fbae2d1e88bbe8691b21233c23770e5eebf9767853de8579f5790a022015cb3f3dc88720199ee1ed5a9f4cf3186a29a0c361512f03b648c9998b3da7b4014104dfaee8168fe5d1ead2e0c8bb12e2d3ba500ade4f6c4983f3dbe5b70ffeaca1551d43c6c962b69fb8d2f4c02faaf1d4571aae7bbd209df5f3b8cd153e60e1627300000000'); + var scriptPubkey = output1.outputs[0].script; + var scriptSig = input2.inputs[0].script; + var witnesses = input2.inputs[0].getWitnesses(); + var satoshis = 1; + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(true); + + interpreter = new Interpreter(); + flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_WITNESS;; + check = interpreter.verify(scriptSig, scriptPubkey, input2, 0, flags, witnesses, satoshis); + check.should.equal(false); + }); + }); + }); + describe('signing', function() { + var privateKey1 = PrivateKey.fromWIF('cNuW8LX2oeQXfKKCGxajGvqwhCgBtacwTQqiCGHzzKfmpHGY4TE9'); + var publicKey1 = p2shPrivateKey1.toPublicKey(); + var privateKey2 = PrivateKey.fromWIF('cTtLHt4mv6zuJytSnM7Vd6NLxyNauYLMxD818sBC8PJ1UPiVTRSs'); + var publicKey2 = p2shPrivateKey2.toPublicKey(); + var privateKey3 = PrivateKey.fromWIF('cQFMZ5gP9CJtUZPc9X3yFae89qaiQLspnftyxxLGvVNvM6tS6mYY'); + var publicKey3 = p2shPrivateKey3.toPublicKey(); + var address = Address.createMultisig([ + publicKey1 + ], 1, 'testnet', true); + var utxo = { + address: address.toString(), + txId: '1d732950d99f821b8a8d11972ea56000b0666e4d31fa71861ffd80a83797dc61', + outputIndex: 1, + script: Script.buildScriptHashOut(address).toHex(), + satoshis: 1e8 + }; + it('will sign with nested p2sh witness program', function() { + var tx = new Transaction() + .from(utxo, [publicKey1], 1, true) + .to([{address: 'n3LsXgyStG2CkS2CnWZtDqxTfCnXB8PvD9', satoshis: 50000}]) + .fee(150000) + .change('mqWDcnW3jMzthB8qdB9SnFam6N96GDqM4W') + .sign(privateKey1); + var sighash = tx.inputs[0].getSighash(tx, privateKey1, 0, bitcore.crypto.Signature.SIGHASH_ALL); + sighash.toString('hex').should.equal('51b7c5271ae04071a6d3d4c4cde28003d8e9a09e51931ebae4003539767a4955'); + tx.toBuffer().toString('hex').should.equal('0100000000010161dc9737a880fd1f8671fa314d6e66b00060a52e97118d8a1b829fd95029731d010000002322002028ba8620c84df12e3283de37d02cfa7bcae3894e118388d6b3ae50f9aeb38798ffffffff0250c30000000000001976a914ef6aa14d8f5ba65a12c327a9659681c44cd821b088acc0d3f205000000001976a9146d8da2015c6d2890896485edd5897b3b2ec9ebb188ac030047304402203fdbd6604939ed9b46bd07bea993b102336a6fbc0a0c987f05b8522a2079037f022064466db4b0c6cc6697a28e0ba9b28c9738ecba56033a60aab7f04d5da2a8241e0125512102feab7deafbdb39885ef92a285dfa0f4ada0feefce43685e6551c95e71496d98051ae00000000'); + }); + }); + }); + +}); + + +var tx_empty_hex = '01000000000000000000'; + +/* jshint maxlen: 1000 */ +var tx_1_hex = '01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006a473044022013fa3089327b50263029265572ae1b022a91d10ac80eb4f32f291c914533670b02200d8a5ed5f62634a7e1a0dc9188a3cc460a986267ae4d58faf50c79105431327501210223078d2942df62c45621d209fab84ea9a7a23346201b7727b9b45a29c4e76f5effffffff0150690f00000000001976a9147821c0a3768aa9d1a37e16cf76002aef5373f1a888ac00000000'; +var tx_1_id = '779a3e5b3c2c452c85333d8521f804c1a52800e60f4b7c3bbe36f4bab350b72c'; + + +var tx2hex = '0100000001e07d8090f4d4e6fcba6a2819e805805517eb19e669e9d2f856b41d4277953d640000000091004730440220248bc60bb309dd0215fbde830b6371e3fdc55685d11daa9a3c43828892e26ce202205f10cd4011f3a43657260a211f6c4d1fa81b6b6bdd6577263ed097cc22f4e5b50147522102fa38420cec94843ba963684b771ba3ca7ce1728dc2c7e7cade0bf298324d6b942103f948a83c20b2e7228ca9f3b71a96c2f079d9c32164cd07f08fbfdb483427d2ee52aeffffffff01180fe200000000001976a914ccee7ce8e8b91ec0bc23e1cfb6324461429e6b0488ac00000000'; + +var unsupportedTxObj = '{"version":1,"inputs":[{"prevTxId":"a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458","outputIndex":0,"sequenceNumber":4294967295,"script":"OP_1","output":{"satoshis":1020000,"script":"OP_1 OP_ADD OP_2 OP_EQUAL"}}],"outputs":[{"satoshis":1010000,"script":"OP_DUP OP_HASH160 20 0x7821c0a3768aa9d1a37e16cf76002aef5373f1a8 OP_EQUALVERIFY OP_CHECKSIG"}],"nLockTime":0}'; + +var txCoinJoinHex = '0100000013440a4e2471a0afd66c9db54db7d414507981eb3db35970dadf722453f08bdc8d0c0000006a47304402200098a7f838ff267969971f5d9d4b2c1db11b8e39c81eebf3c8fe22dd7bf0018302203fa16f0aa3559752462c20ddd8a601620eb176b4511507d11a361a7bb595c57c01210343ead2c0e2303d880bf72dfc04fc9c20d921fc53949c471e22b3c68c0690b828ffffffff0295eef5ad85c9b6b91a3d77bce015065dc64dab526b2f27fbe56f51149bb67f100000006b483045022100c46d6226167e6023e5a058b1ae541c5ca4baf4a69afb65adbfce2cc276535a6a022006320fdc8a438009bbfebfe4ab63e415ee231456a0137d167ee2113677f8e3130121032e38a3e15bee5ef272eaf71033a054637f7b74a51882e659b0eacb8db3e417a9ffffffffee0a35737ab56a0fdb84172c985f1597cffeb33c1d8e4adf3b3b4cc6d430d9b50a0000006b483045022100d02737479b676a35a5572bfd027ef9713b2ef34c87aabe2a2939a448d06c0569022018b262f34191dd2dcf5cbf1ecae8126b35aeb4afcb0426922e1d3dfc86e4dc970121022056d76bd198504c05350c415a80900aaf1174ad95ef42105c2c7976c7094425ffffffffee0a35737ab56a0fdb84172c985f1597cffeb33c1d8e4adf3b3b4cc6d430d9b5100000006a47304402207f541994740dd1aff3dbf633b7d7681c5251f2aa1f48735370dd4694ebdb049802205f4c92f3c9d8e3e758b462a5e0487c471cf7e58757815200c869801403c5ed57012102778e7fe0fc66a2746a058bbe25029ee32bfbed75a6853455ffab7c2bf764f1aeffffffff0295eef5ad85c9b6b91a3d77bce015065dc64dab526b2f27fbe56f51149bb67f050000006a473044022050304b69e695bdba599379c52d872410ae5d78804d3f3c60fb887fd0d95f617b02205f0e27fd566849f7be7d1965219cd63484cc0f37b77b62be6fdbf48f5887ae01012103c8ac0d519ba794b2e3fe7b85717d48b8b47f0e6f94015d0cb8b2ca84bce93e22ffffffff490673d994be7c9be1a39c2d45b3c3738fde5e4b54af91740a442e1cde947114110000006b48304502210085f6b6285d30a5ea3ee6b6f0e73c39e5919d5254bc09ff57b11a7909a9f3f6b7022023ffc24406384c3ee574b836f57446980d5e79c1cd795136a2160782544037a9012103152a37a23618dcc6c41dbb0d003c027215c4ce467bffc29821e067d97fa052e7ffffffffc1365292b95156f7d68ad6dfa031910f3284d9d2e9c267670c5cfa7d97bae482010000006b483045022100e59095f9bbb1daeb04c8105f6f0cf123fcf59c80d319a0e2012326d12bb0e02702206d67b31b24ed60b3f3866755ce122abb09200f9bb331d7be214edfd74733bb830121026db18f5b27ce4e60417364ce35571096927339c6e1e9d0a9f489be6a4bc03252ffffffff0295eef5ad85c9b6b91a3d77bce015065dc64dab526b2f27fbe56f51149bb67f0d0000006b483045022100ec5f0ef35f931fa047bb0ada3f23476fded62d8f114fa547093d3b5fbabf6dbe0220127d6d28388ffeaf2a282ec5f6a7b1b7cc2cb8e35778c2f7c3be834f160f1ff8012102b38aca3954870b28403cae22139004e0756ae325208b3e692200e9ddc6e33b54ffffffff73675af13a01c64ee60339613debf81b9e1dd8d9a3515a25f947353459d3af3c0c0000006b483045022100ff17593d4bff4874aa556c5f8f649d4135ea26b37baf355e793f30303d7bfb9102200f51704d8faccbaa22f58488cb2bebe523e00a436ce4d58179d0570e55785daa0121022a0c75b75739d182076c16d3525e83b1bc7362bfa855959c0cd48e5005140166ffffffff73675af13a01c64ee60339613debf81b9e1dd8d9a3515a25f947353459d3af3c0e0000006b483045022100c7d5a379e2870d03a0f3a5bdd4054a653b29804913f8720380a448f4e1f19865022051501eae29ba44a13ddd3780bc97ac5ec86e881462d0e08d9cc4bd2b29bcc815012103abe21a9dc0e9f995e3c58d6c60971e6d54559afe222bca04c2b331f42b38c0f3ffffffff6f70aeaa54516863e16fa2082cb5471e0f66b4c7dac25d9da4969e70532f6da00d0000006b483045022100afbeaf9fe032fd77c4e46442b178bdc37c7d6409985caad2463b7ab28befccfd0220779783a9b898d94827ff210c9183ff66bfb56223b0e0118cbba66c48090a4f700121036385f64e18f00d6e56417aa33ad3243356cc5879342865ee06f3b2c17552fe7efffffffffae31df57ccb4216853c0f3cc5af1f8ad7a99fc8de6bc6d80e7b1c81f4baf1e4140000006a473044022076c7bb674a88d9c6581e9c26eac236f6dd9cb38b5ffa2a3860d8083a1751302e022033297ccaaab0a6425c2afbfb6525b75e6f27cd0c9f23202bea28f8fa8a7996b40121031066fb64bd605b8f9d07c45d0d5c42485325b9289213921736bf7b048dec1df3ffffffff909d6efb9e08780c8b8e0fccff74f3e21c5dd12d86dcf5cbea494e18bbb9995c120000006a47304402205c945293257a266f8d575020fa409c1ba28742ff3c6d66f33059675bd6ba676a02204ca582141345a161726bd4ec5f53a6d50b2afbb1aa811acbad44fd295d01948501210316a04c4b9dc5035bc9fc3ec386896dcba281366e8a8a67b4904e4e4307820f56ffffffff90ac0c55af47a073de7c3f98ac5a59cd10409a8069806c8afb9ebbbf0c232436020000006a47304402200e05f3a9db10a3936ede2f64844ebcbdeeef069f4fd7e34b18d66b185217d5e30220479b734d591ea6412ded39665463f0ae90b0b21028905dd8586f74b4eaa9d6980121030e9ba4601ae3c95ce90e01aaa33b2d0426d39940f278325023d9383350923477ffffffff3e2f391615f885e626f70940bc7daf71bcdc0a7c6bf5a5eaece5b2e08d10317c000000006b4830450221009b675247b064079c32b8e632e9ee8bd62b11b5c89f1e0b37068fe9be16ae9653022044bff9be38966d3eae77eb9adb46c20758bc106f91cd022400999226b3cd6064012103239b99cadf5350746d675d267966e9597b7f5dd5a6f0f829b7bc6e5802152abcffffffffe1ce8f7faf221c2bcab3aa74e6b1c77a73d1a5399a9d401ddb4b45dc1bdc4636090000006b483045022100a891ee2286649763b1ff45b5a3ef66ce037e86e11b559d15270e8a61cfa0365302200c1e7aa62080af45ba18c8345b5f37a94e661f6fb1d62fd2f3917aa2897ae4af012102fa6980f47e0fdc80fb94bed1afebec70eb5734308cd30f850042cd9ddf01aebcffffffffe1ce8f7faf221c2bcab3aa74e6b1c77a73d1a5399a9d401ddb4b45dc1bdc4636010000006a4730440220296dbfacd2d3f3bd4224a40b7685dad8d60292a38be994a0804bdd1d1e84edef022000f30139285e6da863bf6821d46b8799a582d453e696589233769ad9810c9f6a01210314936e7118052ac5c4ba2b44cb5b7b577346a5e6377b97291e1207cf5dae47afffffffff0295eef5ad85c9b6b91a3d77bce015065dc64dab526b2f27fbe56f51149bb67f120000006b483045022100b21b2413eb7de91cab6416efd2504b15a12b34c11e6906f44649827f9c343b4702205691ab43b72862ea0ef60279f03b77d364aa843cb8fcb16d736368e432d44698012103f520fb1a59111b3d294861d3ac498537216d4a71d25391d1b3538ccbd8b023f6ffffffff5a7eaeadd2570dd5b9189eb825d6b1876266940789ebb05deeeac954ab520d060c0000006b483045022100949c7c91ae9addf549d828ed51e0ef42255149e29293a34fb8f81dc194c2f4b902202612d2d6251ef13ed936597f979a26b38916ed844a1c3fded0b3b0ea18b54380012103eda1fa3051306238c35d83e8ff8f97aa724d175dede4c0783926c98f106fb194ffffffff15620f5723000000001976a91406595e074efdd41ef65b0c3dba3d69dd3c6e494b88ac58a3fb03000000001976a914b037b0650a691c56c1f98e274e9752e2157d970288ac18c0f702000000001976a914b68642906bca6bb6c883772f35caaeed9f7a1b7888ac83bd5723000000001976a9148729016d0c88ac01d110e7d75006811f283f119788ace41f3823000000001976a9147acd2478d13395a64a0b8eadb62d501c2b41a90c88ac31d50000000000001976a91400d2a28bc7a4486248fab573d72ef6db46f777ea88aca09c0306000000001976a914d43c27ffb4a76590c245cd55447550ffe99f346a88ac80412005000000001976a914997efabe5dce8a24d4a1f3c0f9236bf2f6a2087588ac99bb0000000000001976a914593f550a3f8afe8e90b7bae14f0f0b2c31c4826688ace2c71500000000001976a914ee85450df9ca44a4e330fd0b7d681ec6fbad6fb488acb0eb4a00000000001976a914e7a48c6f7079d95e1505b45f8307197e6191f13888acea015723000000001976a9149537e8f15a7f8ef2d9ff9c674da57a376cf4369b88ac2002c504000000001976a9141821265cd111aafae46ac62f60eed21d1544128388acb0c94f0e000000001976a914a7aef50f0868fe30389b02af4fae7dda0ec5e2e988ac40b3d509000000001976a9140f9ac28f8890318c50cffe1ec77c05afe5bb036888ac9f9d1f00000000001976a914e70288cab4379092b2d694809d555c79ae59223688ac52e85623000000001976a914a947ce2aca9c6e654e213376d8d35db9e36398d788ac21ae0000000000001976a914ff3bc00eac7ec252cd5fb3318a87ac2a86d229e188ace0737a09000000001976a9146189be3daa18cb1b1fa86859f7ed79cc5c8f2b3388acf051a707000000001976a914453b1289f3f8a0248d8d914d7ad3200c6be0d28888acc0189708000000001976a914a5e2e6e7b740cef68eb374313d53a7fab1a8a3cd88ac00000000'; diff --git a/packages/kauri-bitcore-lib/test/transaction/unspentoutput.js b/packages/kauri-bitcore-lib/test/transaction/unspentoutput.js new file mode 100644 index 0000000..b9c707a --- /dev/null +++ b/packages/kauri-bitcore-lib/test/transaction/unspentoutput.js @@ -0,0 +1,94 @@ +'use strict'; + +var _ = require('lodash'); +var chai = require('chai'); +var should = chai.should(); +var expect = chai.expect; + +var bitcore = require('../..'); +var UnspentOutput = bitcore.Transaction.UnspentOutput; + +describe('UnspentOutput', function() { + + var sampleData1 = { + 'address': 'mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1', + 'txId': 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + 'outputIndex': 0, + 'script': 'OP_DUP OP_HASH160 20 0x88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG', + 'satoshis': 1020000 + }; + var sampleData2 = { + 'txid': 'e42447187db5a29d6db161661e4bc66d61c3e499690fe5ea47f87b79ca573986', + 'vout': 1, + 'address': 'mgBCJAsvzgT2qNNeXsoECg2uPKrUsZ76up', + 'scriptPubKey': '76a914073b7eae2823efa349e3b9155b8a735526463a0f88ac', + 'amount': 0.01080000 + }; + + it('roundtrip from raw data', function() { + expect(UnspentOutput(sampleData2).toObject()).to.deep.equal(sampleData2); + }); + + it('can be created without "new" operand', function() { + expect(UnspentOutput(sampleData1) instanceof UnspentOutput).to.equal(true); + }); + + it('fails if no tx id is provided', function() { + expect(function() { + return new UnspentOutput({}); + }).to.throw(); + }); + + it('fails if vout is not a number', function() { + var sample = _.cloneDeep(sampleData2); + sample.vout = '1'; + expect(function() { + return new UnspentOutput(sample); + }).to.throw(); + }); + + it('displays nicely on the console', function() { + var expected = ''; + expect(new UnspentOutput(sampleData1).inspect()).to.equal(expected); + }); + + describe('checking the constructor parameters', function() { + var notDefined = { + 'txId': 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + 'outputIndex': 0, + 'script': 'OP_DUP OP_HASH160 20 0x88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG', + }; + var zero = { + 'txId': 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458', + 'outputIndex': 0, + 'script': 'OP_DUP OP_HASH160 20 0x88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG', + 'amount': 0 + }; + it('fails when no amount is defined', function() { + expect(function() { + return new UnspentOutput(notDefined); + }).to.throw('Must provide an amount for the output'); + }); + it('does not fail when amount is zero', function() { + expect(function() { + return new UnspentOutput(zero); + }).to.not.throw(); + }); + }); + + it('toString returns txid:vout', function() { + var expected = 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458:0'; + expect(new UnspentOutput(sampleData1).toString()).to.equal(expected); + }); + + it('to/from JSON roundtrip', function() { + var utxo = new UnspentOutput(sampleData2); + var obj = UnspentOutput.fromObject(utxo.toJSON()).toObject(); + expect(obj).to.deep.equal(sampleData2); + var str = JSON.stringify(UnspentOutput.fromObject(obj)); + expect(JSON.parse(str)).to.deep.equal(sampleData2); + var str2 = JSON.stringify(new UnspentOutput(JSON.parse(str))); + expect(JSON.parse(str2)).to.deep.equal(sampleData2); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/unit.js b/packages/kauri-bitcore-lib/test/unit.js new file mode 100644 index 0000000..5668e45 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/unit.js @@ -0,0 +1,197 @@ +'use strict'; + +var should = require('chai').should(); +var expect = require('chai').expect; + +var bitcore = require('..'); +var errors = bitcore.errors; +var Unit = bitcore.Unit; + +describe('Unit', function() { + + it('can be created from a number and unit', function() { + expect(function() { + return new Unit(1.2, 'BTC'); + }).to.not.throw(); + }); + + it('can be created from a number and exchange rate', function() { + expect(function() { + return new Unit(1.2, 350); + }).to.not.throw(); + }); + + it('no "new" is required for creating an instance', function() { + expect(function() { + return Unit(1.2, 'BTC'); + }).to.not.throw(); + + expect(function() { + return Unit(1.2, 350); + }).to.not.throw(); + }); + + it('has property accesors "BTC", "mBTC", "uBTC", "bits", and "satoshis"', function() { + var unit = new Unit(1.2, 'BTC'); + unit.BTC.should.equal(1.2); + unit.mBTC.should.equal(1200); + unit.uBTC.should.equal(1200000); + unit.bits.should.equal(1200000); + unit.satoshis.should.equal(120000000); + }); + + it('a string amount is allowed', function() { + var unit; + + unit = Unit.fromBTC('1.00001'); + unit.BTC.should.equal(1.00001); + + unit = Unit.fromMilis('1.00001'); + unit.mBTC.should.equal(1.00001); + + unit = Unit.fromMillis('1.00001'); + unit.mBTC.should.equal(1.00001); + + unit = Unit.fromBits('100'); + unit.bits.should.equal(100); + + unit = Unit.fromSatoshis('8999'); + unit.satoshis.should.equal(8999); + + unit = Unit.fromFiat('43', 350); + unit.BTC.should.equal(0.12285714); + }); + + it('should have constructor helpers', function() { + var unit; + + unit = Unit.fromBTC(1.00001); + unit.BTC.should.equal(1.00001); + + unit = Unit.fromMilis(1.00001); + unit.mBTC.should.equal(1.00001); + + unit = Unit.fromBits(100); + unit.bits.should.equal(100); + + unit = Unit.fromSatoshis(8999); + unit.satoshis.should.equal(8999); + + unit = Unit.fromFiat(43, 350); + unit.BTC.should.equal(0.12285714); + }); + + it('converts to satoshis correctly', function() { + /* jshint maxstatements: 25 */ + var unit; + + unit = Unit.fromBTC(1.3); + unit.mBTC.should.equal(1300); + unit.bits.should.equal(1300000); + unit.satoshis.should.equal(130000000); + + unit = Unit.fromMilis(1.3); + unit.BTC.should.equal(0.0013); + unit.bits.should.equal(1300); + unit.satoshis.should.equal(130000); + + unit = Unit.fromBits(1.3); + unit.BTC.should.equal(0.0000013); + unit.mBTC.should.equal(0.0013); + unit.satoshis.should.equal(130); + + unit = Unit.fromSatoshis(3); + unit.BTC.should.equal(0.00000003); + unit.mBTC.should.equal(0.00003); + unit.bits.should.equal(0.03); + }); + + it('takes into account floating point problems', function() { + var unit = Unit.fromBTC(0.00000003); + unit.mBTC.should.equal(0.00003); + unit.bits.should.equal(0.03); + unit.satoshis.should.equal(3); + }); + + it('exposes unit codes', function() { + should.exist(Unit.BTC); + Unit.BTC.should.equal('BTC'); + + should.exist(Unit.mBTC); + Unit.mBTC.should.equal('mBTC'); + + should.exist(Unit.bits); + Unit.bits.should.equal('bits'); + + should.exist(Unit.satoshis); + Unit.satoshis.should.equal('satoshis'); + }); + + it('exposes a method that converts to different units', function() { + var unit = new Unit(1.3, 'BTC'); + unit.to(Unit.BTC).should.equal(unit.BTC); + unit.to(Unit.mBTC).should.equal(unit.mBTC); + unit.to(Unit.bits).should.equal(unit.bits); + unit.to(Unit.satoshis).should.equal(unit.satoshis); + }); + + it('exposes shorthand conversion methods', function() { + var unit = new Unit(1.3, 'BTC'); + unit.toBTC().should.equal(unit.BTC); + unit.toMilis().should.equal(unit.mBTC); + unit.toMillis().should.equal(unit.mBTC); + unit.toBits().should.equal(unit.bits); + unit.toSatoshis().should.equal(unit.satoshis); + }); + + it('can convert to fiat', function() { + var unit = new Unit(1.3, 350); + unit.atRate(350).should.equal(1.3); + unit.to(350).should.equal(1.3); + + unit = Unit.fromBTC(0.0123); + unit.atRate(10).should.equal(0.12); + }); + + it('toString works as expected', function() { + var unit = new Unit(1.3, 'BTC'); + should.exist(unit.toString); + unit.toString().should.be.a('string'); + }); + + it('can be imported and exported from/to JSON', function() { + var json = JSON.stringify({amount:1.3, code:'BTC'}); + var unit = Unit.fromObject(JSON.parse(json)); + JSON.stringify(unit).should.deep.equal(json); + }); + + it('importing from invalid JSON fails quickly', function() { + expect(function() { + return Unit.fromJSON('¹'); + }).to.throw(); + }); + + it('inspect method displays nicely', function() { + var unit = new Unit(1.3, 'BTC'); + unit.inspect().should.equal(''); + }); + + it('fails when the unit is not recognized', function() { + expect(function() { + return new Unit(100, 'USD'); + }).to.throw(errors.Unit.UnknownCode); + expect(function() { + return new Unit(100, 'BTC').to('USD'); + }).to.throw(errors.Unit.UnknownCode); + }); + + it('fails when the exchange rate is invalid', function() { + expect(function() { + return new Unit(100, -123); + }).to.throw(errors.Unit.InvalidRate); + expect(function() { + return new Unit(100, 'BTC').atRate(-123); + }).to.throw(errors.Unit.InvalidRate); + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/uri.js b/packages/kauri-bitcore-lib/test/uri.js new file mode 100644 index 0000000..01694b2 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/uri.js @@ -0,0 +1,257 @@ +'use strict'; + +var chai = chai || require('chai'); +var bitcore = require('..'); +var expect = chai.expect; +var Networks = bitcore.Networks; +var should = chai.should(); +var URI = bitcore.URI; + +describe('URI', function() { + /* jshint maxstatements: 30 */ + + // TODO: Split this and explain tests + it('parses uri strings correctly (test vector)', function() { + var uri; + + URI.parse.bind(URI, 'badURI').should.throw(TypeError); + + uri = URI.parse('bitcoin:'); + expect(uri.address).to.be.undefined(); + expect(uri.amount).to.be.undefined(); + expect(uri.otherParam).to.be.undefined(); + + uri = URI.parse('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.address.should.equal('1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + expect(uri.amount).to.be.undefined(); + expect(uri.otherParam).to.be.undefined(); + + uri = URI.parse('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=123.22'); + uri.address.should.equal('1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.amount.should.equal('123.22'); + expect(uri.otherParam).to.be.undefined(); + + uri = URI.parse('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=123.22' + + '&other-param=something&req-extra=param'); + uri.address.should.equal('1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.amount.should.equal('123.22'); + uri['other-param'].should.equal('something'); + uri['req-extra'].should.equal('param'); + }); + + // TODO: Split this and explain tests + it('URIs can be validated statically (test vector)', function() { + URI.isValid('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj').should.equal(true); + URI.isValid('bitcoin:mkYY5NRvikVBY1EPtaq9fAFgquesdjqECw').should.equal(true); + + URI.isValid('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.2') + .should.equal(true); + URI.isValid('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.2&other=param') + .should.equal(true); + URI.isValid('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.2&req-other=param', + ['req-other']).should.equal(true); + URI.isValid('bitcoin:mmrqEBJxUCf42vdb3oozZtyz5mKr3Vb2Em?amount=0.1&' + + 'r=https%3A%2F%2Ftest.bitpay.com%2Fi%2F6DKgf8cnJC388irbXk5hHu').should.equal(true); + + URI.isValid('bitcoin:').should.equal(false); + URI.isValid('bitcoin:badUri').should.equal(false); + URI.isValid('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfk?amount=bad').should.equal(false); + URI.isValid('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfk?amount=1.2&req-other=param') + .should.equal(false); + URI.isValid('bitcoin:?r=https%3A%2F%2Ftest.bitpay.com%2Fi%2F6DKgf8cnJC388irbXk5hHu') + .should.equal(false); + }); + + it('fails on creation with no params', function() { + (function(){ + return new URI(); + }).should.throw(TypeError); + }); + + it('do not need new keyword', function() { + var uri = URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.should.be.instanceof(URI); + }); + + describe('instantiation from bitcoin uri', function() { + /* jshint maxstatements: 25 */ + var uri; + + it('parses address', function() { + uri = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.address.should.be.instanceof(bitcore.Address); + uri.network.should.equal(Networks.livenet); + }); + + it('parses amount', function() { + uri = URI.fromString('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=123.22'); + uri.address.toString().should.equal('1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.amount.should.equal(12322000000); + expect(uri.otherParam).to.be.undefined(); + }); + + it('parses a testnet address', function() { + uri = new URI('bitcoin:mkYY5NRvikVBY1EPtaq9fAFgquesdjqECw'); + uri.address.should.be.instanceof(bitcore.Address); + uri.network.should.equal(Networks.testnet); + }); + + it('stores unknown parameters as "extras"', function() { + uri = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.2&other=param'); + uri.address.should.be.instanceof(bitcore.Address); + expect(uri.other).to.be.undefined(); + uri.extras.other.should.equal('param'); + }); + + it('throws error when a required feature is not supported', function() { + (function() { + return new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.2&other=param&req-required=param'); + }).should.throw(Error); + }); + + it('has no false negative when checking supported features', function() { + uri = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.2&other=param&' + + 'req-required=param', ['req-required']); + uri.address.should.be.instanceof(bitcore.Address); + uri.amount.should.equal(120000000); + uri.extras.other.should.equal('param'); + uri.extras['req-required'].should.equal('param'); + }); + }); + + // TODO: Split this and explain tests + it('should create instance from object', function() { + /* jshint maxstatements: 25 */ + var uri; + + uri = new URI({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj' + }); + uri.address.should.be.instanceof(bitcore.Address); + uri.network.should.equal(Networks.livenet); + + uri = new URI({ + address: 'mkYY5NRvikVBY1EPtaq9fAFgquesdjqECw' + }); + uri.address.should.be.instanceof(bitcore.Address); + uri.network.should.equal(Networks.testnet); + + uri = new URI({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj', + amount: 120000000, + other: 'param' + }); + uri.address.should.be.instanceof(bitcore.Address); + uri.amount.should.equal(120000000); + expect(uri.other).to.be.undefined(); + uri.extras.other.should.equal('param'); + + (function() { + return new URI({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj', + 'req-required': 'param' + }); + }).should.throw(Error); + + uri = new URI({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj', + amount: 120000000, + other: 'param', + 'req-required': 'param' + }, ['req-required']); + uri.address.should.be.instanceof(bitcore.Address); + uri.amount.should.equal(120000000); + uri.extras.other.should.equal('param'); + uri.extras['req-required'].should.equal('param'); + }); + + it('should support double slash scheme', function() { + var uri = new URI('bitcoin://1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + uri.address.toString().should.equal('1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + }); + + it('should input/output String', function() { + var str = 'bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?' + + 'message=Donation%20for%20project%20xyz&label=myLabel&other=xD'; + URI.fromString(str).toString().should.equal(str); + }); + + it('should input/output JSON', function() { + var json = JSON.stringify({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj', + message: 'Donation for project xyz', + label: 'myLabel', + other: 'xD' + }); + JSON.stringify(URI.fromObject(JSON.parse(json))).should.equal(json); + }); + + it('should support numeric amounts', function() { + var uri = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=12.10001'); + expect(uri.amount).to.be.equal(1210001000); + }); + + it('should support extra arguments', function() { + var uri = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?' + + 'message=Donation%20for%20project%20xyz&label=myLabel&other=xD'); + + should.exist(uri.message); + uri.message.should.equal('Donation for project xyz'); + + should.exist(uri.label); + uri.label.should.equal('myLabel'); + + should.exist(uri.extras.other); + uri.extras.other.should.equal('xD'); + }); + + it('should generate a valid URI', function() { + new URI({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj', + }).toString().should.equal( + 'bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj' + ); + + new URI({ + address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj', + amount: 110001000, + message: 'Hello World', + something: 'else' + }).toString().should.equal( + 'bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj?amount=1.10001&message=Hello%20World&something=else' + ); + + }); + + it('should be case insensitive to protocol', function() { + var uri1 = new URI('bItcOin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + var uri2 = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'); + + uri1.address.toString().should.equal(uri2.address.toString()); + }); + + it('writes correctly the "r" parameter on string serialization', function() { + var originalString = 'bitcoin:mmrqEBJxUCf42vdb3oozZtyz5mKr3Vb2Em?amount=0.1&' + + 'r=https%3A%2F%2Ftest.bitpay.com%2Fi%2F6DKgf8cnJC388irbXk5hHu'; + var uri = new URI(originalString); + uri.toString().should.equal(originalString); + }); + + it('displays nicely on the console (#inspect)', function() { + var uri = 'bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'; + var instance = new URI(uri); + instance.inspect().should.equal(''); + }); + + it('fails early when fromString isn\'t provided a string', function() { + expect(function() { + return URI.fromString(1); + }).to.throw(); + }); + + it('fails early when fromJSON isn\'t provided a valid JSON string', function() { + expect(function() { + return URI.fromJSON('¹'); + }).to.throw(); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/util/buffer.js b/packages/kauri-bitcore-lib/test/util/buffer.js new file mode 100644 index 0000000..bbc1e26 --- /dev/null +++ b/packages/kauri-bitcore-lib/test/util/buffer.js @@ -0,0 +1,156 @@ +'use strict'; +/* jshint unused: false */ + +var should = require('chai').should(); +var expect = require('chai').expect; + +var bitcore = require('../..'); +var errors = bitcore.errors; +var BufferUtil = bitcore.util.buffer; + +describe('buffer utils', function() { + + describe('equals', function() { + it('recognizes these two equal buffers', function() { + var bufferA = new Buffer([1, 2, 3]); + var bufferB = new Buffer('010203', 'hex'); + BufferUtil.equal(bufferA, bufferB).should.equal(true); + }); + it('no false positive: returns false with two different buffers', function() { + var bufferA = new Buffer([1, 2, 3]); + var bufferB = new Buffer('010204', 'hex'); + BufferUtil.equal(bufferA, bufferB).should.equal(false); + }); + it('coverage: quickly realizes a difference in size and returns false', function() { + var bufferA = new Buffer([1, 2, 3]); + var bufferB = new Buffer([]); + BufferUtil.equal(bufferA, bufferB).should.equal(false); + }); + it('"equals" is an an alias for "equal"', function() { + var bufferA = new Buffer([1, 2, 3]); + var bufferB = new Buffer([1, 2, 3]); + BufferUtil.equal(bufferA, bufferB).should.equal(true); + BufferUtil.equals(bufferA, bufferB).should.equal(true); + }); + }); + + describe('fill', function() { + it('checks arguments', function() { + expect(function() { + BufferUtil.fill('something'); + }).to.throw(errors.InvalidArgumentType); + expect(function() { + BufferUtil.fill(new Buffer([0, 0, 0]), 'invalid'); + }).to.throw(errors.InvalidArgumentType); + }); + it('works correctly for a small buffer', function() { + var buffer = BufferUtil.fill(new Buffer(10), 6); + for (var i = 0; i < 10; i++) { + buffer[i].should.equal(6); + } + }); + }); + + describe('isBuffer', function() { + it('has no false positive', function() { + expect(BufferUtil.isBuffer(1)).to.equal(false); + }); + it('has no false negative', function() { + expect(BufferUtil.isBuffer(new Buffer(0))).to.equal(true); + }); + }); + + describe('emptyBuffer', function() { + it('creates a buffer filled with zeros', function() { + var buffer = BufferUtil.emptyBuffer(10); + expect(buffer.length).to.equal(10); + for (var i = 0; i < 10; i++) { + expect(buffer[i]).to.equal(0); + } + }); + it('checks arguments', function() { + expect(function() { + BufferUtil.emptyBuffer('invalid'); + }).to.throw(errors.InvalidArgumentType); + }); + }); + + describe('single byte buffer <=> integer', function() { + it('integerAsSingleByteBuffer should return a buffer of length 1', function() { + expect(BufferUtil.integerAsSingleByteBuffer(100)[0]).to.equal(100); + }); + it('should check the type', function() { + expect(function() { + BufferUtil.integerAsSingleByteBuffer('invalid'); + }).to.throw(errors.InvalidArgumentType); + expect(function() { + BufferUtil.integerFromSingleByteBuffer('invalid'); + }).to.throw(errors.InvalidArgumentType); + }); + it('works correctly for edge cases', function() { + expect(BufferUtil.integerAsSingleByteBuffer(255)[0]).to.equal(255); + expect(BufferUtil.integerAsSingleByteBuffer(-1)[0]).to.equal(255); + }); + it('does a round trip', function() { + expect(BufferUtil.integerAsSingleByteBuffer( + BufferUtil.integerFromSingleByteBuffer(new Buffer([255])) + )[0]).to.equal(255); + }); + }); + + describe('4byte buffer integer <=> integer', function() { + it('integerAsBuffer should return a buffer of length 4', function() { + expect(BufferUtil.integerAsBuffer(100).length).to.equal(4); + }); + it('is little endian', function() { + expect(BufferUtil.integerAsBuffer(100)[3]).to.equal(100); + }); + it('should check the type', function() { + expect(function() { + BufferUtil.integerAsBuffer('invalid'); + }).to.throw(errors.InvalidArgumentType); + expect(function() { + BufferUtil.integerFromBuffer('invalid'); + }).to.throw(errors.InvalidArgumentType); + }); + it('works correctly for edge cases', function() { + expect(BufferUtil.integerAsBuffer(4294967295)[0]).to.equal(255); + expect(BufferUtil.integerAsBuffer(4294967295)[3]).to.equal(255); + expect(BufferUtil.integerAsBuffer(-1)[0]).to.equal(255); + expect(BufferUtil.integerAsBuffer(-1)[3]).to.equal(255); + }); + it('does a round trip', function() { + expect(BufferUtil.integerFromBuffer( + BufferUtil.integerAsBuffer(10000) + )).to.equal(10000); + }); + }); + + describe('buffer to hex', function() { + it('returns an expected value in hexa', function() { + expect(BufferUtil.bufferToHex(new Buffer([255, 0, 128]))).to.equal('ff0080'); + }); + it('checks the argument type', function() { + expect(function() { + BufferUtil.bufferToHex('invalid'); + }).to.throw(errors.InvalidArgumentType); + }); + it('round trips', function() { + var original = new Buffer([255, 0, 128]); + var hexa = BufferUtil.bufferToHex(original); + var back = BufferUtil.hexToBuffer(hexa); + expect(BufferUtil.equal(original, back)).to.equal(true); + }); + }); + + describe('reverse', function() { + it('reverses a buffer', function() { + // http://bit.ly/1J2Ai4x + var original = new Buffer([255, 0, 128]); + var reversed = BufferUtil.reverse(original); + original[0].should.equal(reversed[2]); + original[1].should.equal(reversed[1]); + original[2].should.equal(reversed[0]); + }); + }); +}); diff --git a/packages/kauri-bitcore-lib/test/util/js.js b/packages/kauri-bitcore-lib/test/util/js.js new file mode 100644 index 0000000..0928b8d --- /dev/null +++ b/packages/kauri-bitcore-lib/test/util/js.js @@ -0,0 +1,83 @@ +'use strict'; +/* jshint unused: false */ + +var should = require('chai').should(); +var expect = require('chai').expect; + +var bitcore = require('../..'); +var JSUtil = bitcore.util.js; + +describe('js utils', function() { + + describe('isValidJSON', function() { + + var hexa = '8080808080808080808080808080808080808080808080808080808080808080'; + var json = '{"key": ["value", "value2"]}'; + var json2 = '["value", "value2", {"key": "value"}]'; + + it('does not mistake an integer as valid json object', function() { + var valid = JSUtil.isValidJSON(hexa); + valid.should.equal(false); + }); + + it('correctly validates a json object', function() { + var valid = JSUtil.isValidJSON(json); + valid.should.equal(true); + }); + + it('correctly validates an array json object', function() { + var valid = JSUtil.isValidJSON(json); + valid.should.equal(true); + }); + + }); + + describe('isNaturalNumber', function() { + it('false for float', function() { + var a = JSUtil.isNaturalNumber(0.1); + a.should.equal(false); + }); + + it('false for string float', function() { + var a = JSUtil.isNaturalNumber('0.1'); + a.should.equal(false); + }); + + it('false for string integer', function() { + var a = JSUtil.isNaturalNumber('1'); + a.should.equal(false); + }); + + it('false for negative integer', function() { + var a = JSUtil.isNaturalNumber(-1); + a.should.equal(false); + }); + + it('false for negative integer string', function() { + var a = JSUtil.isNaturalNumber('-1'); + a.should.equal(false); + }); + + it('false for infinity', function() { + var a = JSUtil.isNaturalNumber(Infinity); + a.should.equal(false); + }); + + it('false for NaN', function() { + var a = JSUtil.isNaturalNumber(NaN); + a.should.equal(false); + }); + + it('true for zero', function() { + var a = JSUtil.isNaturalNumber(0); + a.should.equal(true); + }); + + it('true for positive integer', function() { + var a = JSUtil.isNaturalNumber(1000); + a.should.equal(true); + }); + + }); + +}); diff --git a/packages/kauri-bitcore-lib/test/util/preconditions.js b/packages/kauri-bitcore-lib/test/util/preconditions.js new file mode 100644 index 0000000..74a727f --- /dev/null +++ b/packages/kauri-bitcore-lib/test/util/preconditions.js @@ -0,0 +1,80 @@ +'use strict'; + +var should = require('chai').should(); + +var bitcore = require('../..'); +var errors = bitcore.errors; +var $ = bitcore.util.preconditions; +var PrivateKey = bitcore.PrivateKey; + +describe('preconditions', function() { + + it('can be used to assert state', function() { + (function() { + $.checkState(false, 'testing'); + }).should.throw(errors.InvalidState); + }); + it('throws no false negative', function() { + (function() { + $.checkState(true, 'testing'); + }).should.not.throw(); + }); + + it('can be used to check an argument', function() { + (function() { + $.checkArgument(false, 'testing'); + }).should.throw(errors.InvalidArgument); + + (function() { + $.checkArgument(true, 'testing'); + }).should.not.throw(errors.InvalidArgument); + }); + + it('can be used to check an argument type', function() { + var error; + try { + $.checkArgumentType(1, 'string', 'argumentName'); + } catch (e) { + error = e; + e.message.should.equal('Invalid Argument for argumentName, expected string but got number'); + } + should.exist(error); + }); + it('has no false negatives when used to check an argument type', function() { + (function() { + $.checkArgumentType('a String', 'string', 'argumentName'); + }).should.not.throw(); + }); + + it('can be used to check an argument type for a class', function() { + var error; + try { + $.checkArgumentType(1, PrivateKey); + } catch (e) { + error = e; + var fail = !(~e.message.indexOf('Invalid Argument for (unknown name)')); + fail.should.equal(false); + } + should.exist(error); + }); + it('has no false negatives when checking a type for a class', function() { + (function() { + $.checkArgumentType(new PrivateKey(), PrivateKey); + }).should.not.throw(); + }); + + it('formats correctly a message on InvalidArgument()', function() { + var error = new errors.InvalidArgument(); + error.message.should.equal('Invalid Argument'); + }); + + it('formats correctly a message on checkArgument', function() { + var error; + try { + $.checkArgument(null, 'parameter must be provided'); + } catch (e) { + error = e; + } + error.message.should.equal('Invalid Argument: parameter must be provided'); + }); +}); From ee650a5b3f131adde53ce4478161c39d1e008234 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 20:41:39 +0200 Subject: [PATCH 03/10] wrap networks to allow additional networks to be added --- .../kauri-bitcore-lib/lib/networks-bitcore.js | 269 +++++++++++++++++ packages/kauri-bitcore-lib/lib/networks.js | 270 +----------------- 2 files changed, 272 insertions(+), 267 deletions(-) create mode 100644 packages/kauri-bitcore-lib/lib/networks-bitcore.js diff --git a/packages/kauri-bitcore-lib/lib/networks-bitcore.js b/packages/kauri-bitcore-lib/lib/networks-bitcore.js new file mode 100644 index 0000000..affe678 --- /dev/null +++ b/packages/kauri-bitcore-lib/lib/networks-bitcore.js @@ -0,0 +1,269 @@ +'use strict'; +var _ = require('lodash'); + +var BufferUtil = require('./util/buffer'); +var JSUtil = require('./util/js'); +var networks = []; +var networkMaps = {}; + +/** + * A network is merely a map containing values that correspond to version + * numbers for each bitcoin network. Currently only supporting "livenet" + * (a.k.a. "mainnet") and "testnet". + * @constructor + */ +function Network() {} + +Network.prototype.toString = function toString() { + return this.name; +}; + +/** + * @function + * @member Networks#get + * Retrieves the network associated with a magic number or string. + * @param {string|number|Network} arg + * @param {string|Array} keys - if set, only check if the magic number associated with this name matches + * @return Network + */ +function get(arg, keys) { + if (~networks.indexOf(arg)) { + return arg; + } + if (keys) { + if (!_.isArray(keys)) { + keys = [keys]; + } + var containsArg = function(key) { + return networks[index][key] === arg; + }; + for (var index in networks) { + if (_.some(keys, containsArg)) { + return networks[index]; + } + } + return undefined; + } + return networkMaps[arg]; +} + +/** + * @function + * @member Networks#add + * Will add a custom Network + * @param {Object} data + * @param {string} data.name - The name of the network + * @param {string} data.alias - The aliased name of the network + * @param {Number} data.pubkeyhash - The publickey hash prefix + * @param {Number} data.privatekey - The privatekey prefix + * @param {Number} data.scripthash - The scripthash prefix + * @param {Number} data.xpubkey - The extended public key magic + * @param {Number} data.xprivkey - The extended private key magic + * @param {Number} data.networkMagic - The network magic number + * @param {Number} data.port - The network port + * @param {Array} data.dnsSeeds - An array of dns seeds + * @return Network + */ +function addNetwork(data) { + + var network = new Network(); + + JSUtil.defineImmutable(network, { + name: data.name, + alias: data.alias, + pubkeyhash: data.pubkeyhash, + privatekey: data.privatekey, + scripthash: data.scripthash, + xpubkey: data.xpubkey, + xprivkey: data.xprivkey + }); + + if (data.networkMagic) { + JSUtil.defineImmutable(network, { + networkMagic: BufferUtil.integerAsBuffer(data.networkMagic) + }); + } + + if (data.port) { + JSUtil.defineImmutable(network, { + port: data.port + }); + } + + if (data.dnsSeeds) { + JSUtil.defineImmutable(network, { + dnsSeeds: data.dnsSeeds + }); + } + _.each(network, function(value) { + if (!_.isUndefined(value) && !_.isObject(value)) { + networkMaps[value] = network; + } + }); + + networks.push(network); + + return network; + +} + +/** + * @function + * @member Networks#remove + * Will remove a custom network + * @param {Network} network + */ +function removeNetwork(network) { + for (var i = 0; i < networks.length; i++) { + if (networks[i] === network) { + networks.splice(i, 1); + } + } + for (var key in networkMaps) { + if (networkMaps[key] === network) { + delete networkMaps[key]; + } + } +} + +addNetwork({ + name: 'livenet', + alias: 'mainnet', + pubkeyhash: 0x00, + privatekey: 0x80, + scripthash: 0x05, + xpubkey: 0x0488b21e, + xprivkey: 0x0488ade4, + networkMagic: 0xf9beb4d9, + port: 8333, + dnsSeeds: [ + 'seed.bitcoin.sipa.be', + 'dnsseed.bluematt.me', + 'dnsseed.bitcoin.dashjr.org', + 'seed.bitcoinstats.com', + 'seed.bitnodes.io', + 'bitseed.xf2.org' + ] +}); + +/** + * @instance + * @member Networks#livenet + */ +var livenet = get('livenet'); + +addNetwork({ + name: 'testnet', + alias: 'regtest', + pubkeyhash: 0x6f, + privatekey: 0xef, + scripthash: 0xc4, + xpubkey: 0x043587cf, + xprivkey: 0x04358394 +}); + +/** + * @instance + * @member Networks#testnet + */ +var testnet = get('testnet'); + +// Add configurable values for testnet/regtest + +var TESTNET = { + PORT: 18333, + NETWORK_MAGIC: BufferUtil.integerAsBuffer(0x0b110907), + DNS_SEEDS: [ + 'testnet-seed.bitcoin.petertodd.org', + 'testnet-seed.bluematt.me', + 'testnet-seed.alexykot.me', + 'testnet-seed.bitcoin.schildbach.de' + ] +}; + +for (var key in TESTNET) { + if (!_.isObject(TESTNET[key])) { + networkMaps[TESTNET[key]] = testnet; + } +} + +var REGTEST = { + PORT: 18444, + NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfabfb5da), + DNS_SEEDS: [] +}; + +for (var key in REGTEST) { + if (!_.isObject(REGTEST[key])) { + networkMaps[REGTEST[key]] = testnet; + } +} + +Object.defineProperty(testnet, 'port', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.PORT; + } else { + return TESTNET.PORT; + } + } +}); + +Object.defineProperty(testnet, 'networkMagic', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.NETWORK_MAGIC; + } else { + return TESTNET.NETWORK_MAGIC; + } + } +}); + +Object.defineProperty(testnet, 'dnsSeeds', { + enumerable: true, + configurable: false, + get: function() { + if (this.regtestEnabled) { + return REGTEST.DNS_SEEDS; + } else { + return TESTNET.DNS_SEEDS; + } + } +}); + +/** + * @function + * @member Networks#enableRegtest + * Will enable regtest features for testnet + */ +function enableRegtest() { + testnet.regtestEnabled = true; +} + +/** + * @function + * @member Networks#disableRegtest + * Will disable regtest features for testnet + */ +function disableRegtest() { + testnet.regtestEnabled = false; +} + +/** + * @namespace Networks + */ +module.exports = { + add: addNetwork, + remove: removeNetwork, + defaultNetwork: livenet, + livenet: livenet, + mainnet: livenet, + testnet: testnet, + get: get, + enableRegtest: enableRegtest, + disableRegtest: disableRegtest +}; diff --git a/packages/kauri-bitcore-lib/lib/networks.js b/packages/kauri-bitcore-lib/lib/networks.js index affe678..164334c 100644 --- a/packages/kauri-bitcore-lib/lib/networks.js +++ b/packages/kauri-bitcore-lib/lib/networks.js @@ -1,269 +1,5 @@ -'use strict'; -var _ = require('lodash'); +const networks = require('./networks-bitcore'); -var BufferUtil = require('./util/buffer'); -var JSUtil = require('./util/js'); -var networks = []; -var networkMaps = {}; - -/** - * A network is merely a map containing values that correspond to version - * numbers for each bitcoin network. Currently only supporting "livenet" - * (a.k.a. "mainnet") and "testnet". - * @constructor - */ -function Network() {} - -Network.prototype.toString = function toString() { - return this.name; -}; - -/** - * @function - * @member Networks#get - * Retrieves the network associated with a magic number or string. - * @param {string|number|Network} arg - * @param {string|Array} keys - if set, only check if the magic number associated with this name matches - * @return Network - */ -function get(arg, keys) { - if (~networks.indexOf(arg)) { - return arg; - } - if (keys) { - if (!_.isArray(keys)) { - keys = [keys]; - } - var containsArg = function(key) { - return networks[index][key] === arg; - }; - for (var index in networks) { - if (_.some(keys, containsArg)) { - return networks[index]; - } - } - return undefined; - } - return networkMaps[arg]; -} - -/** - * @function - * @member Networks#add - * Will add a custom Network - * @param {Object} data - * @param {string} data.name - The name of the network - * @param {string} data.alias - The aliased name of the network - * @param {Number} data.pubkeyhash - The publickey hash prefix - * @param {Number} data.privatekey - The privatekey prefix - * @param {Number} data.scripthash - The scripthash prefix - * @param {Number} data.xpubkey - The extended public key magic - * @param {Number} data.xprivkey - The extended private key magic - * @param {Number} data.networkMagic - The network magic number - * @param {Number} data.port - The network port - * @param {Array} data.dnsSeeds - An array of dns seeds - * @return Network - */ -function addNetwork(data) { - - var network = new Network(); - - JSUtil.defineImmutable(network, { - name: data.name, - alias: data.alias, - pubkeyhash: data.pubkeyhash, - privatekey: data.privatekey, - scripthash: data.scripthash, - xpubkey: data.xpubkey, - xprivkey: data.xprivkey - }); - - if (data.networkMagic) { - JSUtil.defineImmutable(network, { - networkMagic: BufferUtil.integerAsBuffer(data.networkMagic) - }); - } - - if (data.port) { - JSUtil.defineImmutable(network, { - port: data.port - }); - } - - if (data.dnsSeeds) { - JSUtil.defineImmutable(network, { - dnsSeeds: data.dnsSeeds - }); - } - _.each(network, function(value) { - if (!_.isUndefined(value) && !_.isObject(value)) { - networkMaps[value] = network; - } - }); - - networks.push(network); - - return network; - -} - -/** - * @function - * @member Networks#remove - * Will remove a custom network - * @param {Network} network - */ -function removeNetwork(network) { - for (var i = 0; i < networks.length; i++) { - if (networks[i] === network) { - networks.splice(i, 1); - } - } - for (var key in networkMaps) { - if (networkMaps[key] === network) { - delete networkMaps[key]; - } - } -} - -addNetwork({ - name: 'livenet', - alias: 'mainnet', - pubkeyhash: 0x00, - privatekey: 0x80, - scripthash: 0x05, - xpubkey: 0x0488b21e, - xprivkey: 0x0488ade4, - networkMagic: 0xf9beb4d9, - port: 8333, - dnsSeeds: [ - 'seed.bitcoin.sipa.be', - 'dnsseed.bluematt.me', - 'dnsseed.bitcoin.dashjr.org', - 'seed.bitcoinstats.com', - 'seed.bitnodes.io', - 'bitseed.xf2.org' - ] -}); - -/** - * @instance - * @member Networks#livenet - */ -var livenet = get('livenet'); - -addNetwork({ - name: 'testnet', - alias: 'regtest', - pubkeyhash: 0x6f, - privatekey: 0xef, - scripthash: 0xc4, - xpubkey: 0x043587cf, - xprivkey: 0x04358394 -}); - -/** - * @instance - * @member Networks#testnet - */ -var testnet = get('testnet'); - -// Add configurable values for testnet/regtest - -var TESTNET = { - PORT: 18333, - NETWORK_MAGIC: BufferUtil.integerAsBuffer(0x0b110907), - DNS_SEEDS: [ - 'testnet-seed.bitcoin.petertodd.org', - 'testnet-seed.bluematt.me', - 'testnet-seed.alexykot.me', - 'testnet-seed.bitcoin.schildbach.de' - ] -}; - -for (var key in TESTNET) { - if (!_.isObject(TESTNET[key])) { - networkMaps[TESTNET[key]] = testnet; - } -} - -var REGTEST = { - PORT: 18444, - NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xfabfb5da), - DNS_SEEDS: [] -}; - -for (var key in REGTEST) { - if (!_.isObject(REGTEST[key])) { - networkMaps[REGTEST[key]] = testnet; - } -} - -Object.defineProperty(testnet, 'port', { - enumerable: true, - configurable: false, - get: function() { - if (this.regtestEnabled) { - return REGTEST.PORT; - } else { - return TESTNET.PORT; - } - } -}); - -Object.defineProperty(testnet, 'networkMagic', { - enumerable: true, - configurable: false, - get: function() { - if (this.regtestEnabled) { - return REGTEST.NETWORK_MAGIC; - } else { - return TESTNET.NETWORK_MAGIC; - } - } -}); - -Object.defineProperty(testnet, 'dnsSeeds', { - enumerable: true, - configurable: false, - get: function() { - if (this.regtestEnabled) { - return REGTEST.DNS_SEEDS; - } else { - return TESTNET.DNS_SEEDS; - } - } -}); - -/** - * @function - * @member Networks#enableRegtest - * Will enable regtest features for testnet - */ -function enableRegtest() { - testnet.regtestEnabled = true; -} - -/** - * @function - * @member Networks#disableRegtest - * Will disable regtest features for testnet - */ -function disableRegtest() { - testnet.regtestEnabled = false; -} - -/** - * @namespace Networks - */ module.exports = { - add: addNetwork, - remove: removeNetwork, - defaultNetwork: livenet, - livenet: livenet, - mainnet: livenet, - testnet: testnet, - get: get, - enableRegtest: enableRegtest, - disableRegtest: disableRegtest -}; + ...networks, +} From 10ab25eab4d80a48ec159fa94e858eb8bb5ffd81 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 20:42:10 +0200 Subject: [PATCH 04/10] Add NAVlivenet and BTClivenet to supported networks --- packages/kauri-bitcore-lib/lib/networks.js | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/packages/kauri-bitcore-lib/lib/networks.js b/packages/kauri-bitcore-lib/lib/networks.js index 164334c..5a80fa8 100644 --- a/packages/kauri-bitcore-lib/lib/networks.js +++ b/packages/kauri-bitcore-lib/lib/networks.js @@ -1,5 +1,54 @@ const networks = require('./networks-bitcore'); +networks.add({ + name: 'NAVlivenet', + alias: 'NAVmainnet', + pubkeyhash: 0x35, + privatekey: 0x96, + scripthash: 0x55, + xpubkey: 0x0488B21E, + xprivkey: 0x0488ADE4, + networkMagic: 0xdb4775248b80fb57, + port: 44444, + dnsSeeds: [ + 'supernode.navcoin.org' + ] +}); + +networks.add({ + name: 'BTClivenet', + alias: 'BTCmainnet', + pubkeyhash: 0x00, + privatekey: 0x80, + scripthash: 0x05, + xpubkey: 0x0488b21e, + xprivkey: 0x0488ade4, + networkMagic: 0xf9beb4d9, + port: 8333, + dnsSeeds: [ + 'seed.bitcoin.sipa.be', + 'dnsseed.bluematt.me', + 'dnsseed.bitcoin.dashjr.org', + 'seed.bitcoinstats.com', + 'seed.bitnodes.io', + 'bitseed.xf2.org' + ] +}); + +/** + * @instance + * @member Networks#livenet + */ +var BTClivenet = networks.get('BTClivenet'); + +/** + * @instance + * @member Networks#livenet + */ +var NAVlivenet = networks.get('NAVlivenet'); + module.exports = { ...networks, + NAVlivenet: NAVlivenet, + BTClivenet: BTClivenet, } From 59e9262049d3aab9ba5729645a16191e521ff696 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 20:54:53 +0200 Subject: [PATCH 05/10] Add script to modify angular cli to allow crypto module --- packages/kauri-wallet/package.json | 1 + packages/kauri-wallet/updateAngularCli.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 packages/kauri-wallet/updateAngularCli.js diff --git a/packages/kauri-wallet/package.json b/packages/kauri-wallet/package.json index 69984f5..4f5acdd 100644 --- a/packages/kauri-wallet/package.json +++ b/packages/kauri-wallet/package.json @@ -8,6 +8,7 @@ "url": "git@github.com:Encrypt-S/kauri-wallet.git" }, "scripts": { + "postinstall": "node updateAngularCli.js", "ng": "ng", "start": "ng serve", "start:ja": "ng serve --configuration=ja", diff --git a/packages/kauri-wallet/updateAngularCli.js b/packages/kauri-wallet/updateAngularCli.js new file mode 100644 index 0000000..a97eaaa --- /dev/null +++ b/packages/kauri-wallet/updateAngularCli.js @@ -0,0 +1,21 @@ +/* + Because many crypto libs use crypto, global and some other builtin node modules + we have to make sure we can use the browserify version during dev + Angular disabled this in there webpack builds, this script fixes it for angular v6 + More details: + https://gist.github.com/niespodd/1fa82da6f8c901d1c33d2fcbb762947d + https://github.com/angular/angular-cli/issues/1548 + */ +const fs = require('fs'); +const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; + +fs.readFile(f, 'utf8', function (err,data) { + if (err) { + return console.log(err); + } + var result = data.replace(/node: false/g, 'node: node: { fs: \'empty\', global: true, crypto: true, tls: \'empty\', net: \'empty\', process: true, module: false, clearImmediate: false, setImmediate: false }'); + + fs.writeFile(f, result, 'utf8', function (err) { + if (err) return console.log(err); + }); +}); From 1bd9898837e4657f7799b25fb1b51cc2e23ce754 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 21:05:10 +0200 Subject: [PATCH 06/10] Hide Circular Dep warnings --- packages/kauri-wallet/angular.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/kauri-wallet/angular.json b/packages/kauri-wallet/angular.json index 32bd008..d562b3f 100644 --- a/packages/kauri-wallet/angular.json +++ b/packages/kauri-wallet/angular.json @@ -30,7 +30,8 @@ "styles": [ "src/styles.scss" ], - "scripts": [] + "scripts": [], + "showCircularDependencies": false }, "configurations": { "production": { From c484f59c9c83b05b1425af902ce78a7e730f9327 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 21:14:14 +0200 Subject: [PATCH 07/10] Add bip39 and kauri-bitcore-lib to kauri-wallet project --- packages/kauri-bitcore-lib/package-lock.json | 3851 +++++++++--------- packages/kauri-wallet/package-lock.json | 84 +- packages/kauri-wallet/package.json | 2 + 3 files changed, 1980 insertions(+), 1957 deletions(-) diff --git a/packages/kauri-bitcore-lib/package-lock.json b/packages/kauri-bitcore-lib/package-lock.json index 1264a3d..e40bcfa 100644 --- a/packages/kauri-bitcore-lib/package-lock.json +++ b/packages/kauri-bitcore-lib/package-lock.json @@ -12,8 +12,8 @@ "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, "abbrev": { @@ -26,7 +26,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", "requires": { - "mime-types": "2.1.18", + "mime-types": "~2.1.11", "negotiator": "0.6.1" } }, @@ -40,7 +40,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "requires": { - "acorn": "3.3.0" + "acorn": "^3.0.4" }, "dependencies": { "acorn": { @@ -55,8 +55,8 @@ "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.3.0.tgz", "integrity": "sha512-efP54n3d1aLfjL2UMdaXa6DsswwzJeI5rqhbFvXMrKiJ6eJFpf+7R0zN7t8IC+XKn2YOAFAv6xbBNgHUkoHWLw==", "requires": { - "acorn": "5.5.3", - "xtend": "4.0.1" + "acorn": "^5.4.1", + "xtend": "^4.0.1" } }, "adm-zip": { @@ -74,10 +74,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "ajv-keywords": { @@ -90,9 +90,9 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" }, "dependencies": { "kind-of": { @@ -100,7 +100,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -164,8 +164,8 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "requires": { - "micromatch": "2.3.11", - "normalize-path": "2.1.1" + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" }, "dependencies": { "arr-diff": { @@ -173,7 +173,7 @@ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "array-unique": { @@ -186,9 +186,9 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "expand-brackets": { @@ -196,7 +196,7 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "extglob": { @@ -204,7 +204,7 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-extglob": { @@ -217,7 +217,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "kind-of": { @@ -225,7 +225,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "micromatch": { @@ -233,19 +233,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } } } @@ -255,11 +255,11 @@ "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.7.1.tgz", "integrity": "sha1-zxUteU+Gu9k/mFjaYNNqrqutm78=", "requires": { - "file-utils": "0.1.5", - "lazystream": "0.1.0", - "lodash": "2.4.2", - "readable-stream": "1.0.34", - "zip-stream": "0.2.3" + "file-utils": "~0.1.5", + "lazystream": "~0.1.0", + "lodash": "~2.4.1", + "readable-stream": "~1.0.24", + "zip-stream": "~0.2.0" }, "dependencies": { "isarray": { @@ -277,10 +277,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -300,7 +300,7 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { @@ -363,7 +363,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -396,9 +396,9 @@ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.1", - "minimalistic-assert": "1.0.0" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "assert": { @@ -429,7 +429,7 @@ "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", "requires": { - "acorn": "4.0.13" + "acorn": "^4.0.3" }, "dependencies": { "acorn": { @@ -444,7 +444,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { - "lodash": "4.17.4" + "lodash": "^4.14.0" } }, "async-each": { @@ -462,7 +462,7 @@ "resolved": "https://registry.npmjs.org/asyncreduce/-/asyncreduce-0.1.4.tgz", "integrity": "sha1-GCEOAZeL/cugQ5VUl6XNMVwKakE=", "requires": { - "runnel": "0.5.3" + "runnel": "~0.5.0" } }, "atob": { @@ -500,13 +500,13 @@ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -514,7 +514,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } } } @@ -524,7 +524,7 @@ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "base64-arraybuffer": { @@ -553,7 +553,7 @@ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "beeper": { @@ -576,30 +576,31 @@ }, "bitcore-build": { "version": "git+https://github.com/bitpay/bitcore-build.git#d4e8b2b2f1e2c065c3a807dcb6a6250f61d67ab3", - "requires": { - "brfs": "1.5.0", - "browserify": "13.3.0", - "chai": "3.5.0", - "gulp": "3.9.1", - "gulp-bump": "2.9.0", - "gulp-coveralls": "0.1.4", - "gulp-git": "2.5.2", - "gulp-jshint": "2.1.0", - "gulp-mocha": "4.3.1", - "gulp-rename": "1.2.2", - "gulp-shell": "0.6.5", - "gulp-uglify": "2.1.2", - "gulp-util": "3.0.8", - "istanbul": "0.4.5", - "karma": "1.7.1", - "karma-detect-browsers": "2.3.2", - "karma-mocha": "1.3.0", - "karma-phantomjs-launcher": "1.0.4", - "lodash": "4.17.4", - "mocha": "3.5.3", - "plato": "1.7.0", - "run-sequence": "1.2.2", - "zuul": "3.11.1" + "from": "bitcore-build@git+https://github.com/bitpay/bitcore-build.git#d4e8b2b2f1e2c065c3a807dcb6a6250f61d67ab3", + "requires": { + "brfs": "^1.4.3", + "browserify": "^13.1.1", + "chai": "^3.5.0", + "gulp": "^3.9.1", + "gulp-bump": "^2.7.0", + "gulp-coveralls": "^0.1.4", + "gulp-git": "^2.0.1", + "gulp-jshint": "^2.0.4", + "gulp-mocha": "^4.1.0", + "gulp-rename": "^1.2.2", + "gulp-shell": "^0.6.3", + "gulp-uglify": "^2.1.0", + "gulp-util": "^3.0.8", + "istanbul": "^0.4.5", + "karma": "^1.7.1", + "karma-detect-browsers": "^2.2.4", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.4", + "lodash": "^4.17.4", + "mocha": "^3.2.0", + "plato": "^1.7.0", + "run-sequence": "^1.2.2", + "zuul": "^3.11.1" }, "dependencies": { "chai": { @@ -607,9 +608,9 @@ "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", "requires": { - "assertion-error": "1.1.0", - "deep-eql": "0.1.3", - "type-detect": "1.0.0" + "assertion-error": "^1.0.1", + "deep-eql": "^0.1.3", + "type-detect": "^1.0.0" } } } @@ -619,7 +620,7 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", "requires": { - "readable-stream": "1.0.34" + "readable-stream": "~1.0.26" }, "dependencies": { "isarray": { @@ -632,10 +633,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -666,15 +667,15 @@ "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", + "depd": "~1.1.1", + "http-errors": "~1.6.2", "iconv-lite": "0.4.19", - "on-finished": "2.3.0", + "on-finished": "~2.3.0", "qs": "6.5.1", "raw-body": "2.3.2", - "type-is": "1.6.16" + "type-is": "~1.6.15" }, "dependencies": { "qs": { @@ -689,7 +690,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "brace-expansion": { @@ -697,7 +698,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -706,18 +707,18 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "define-property": "1.0.0", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "kind-of": "6.0.2", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "kind-of": "^6.0.2", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -725,7 +726,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -733,7 +734,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -743,10 +744,10 @@ "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.5.0.tgz", "integrity": "sha512-PscWJn5IGjcK5g5lqEeRPYJ5efZk93YbopLu6UXZcb9dPZUfMN/UMyyT/tddpi7A9yIDM9TEdCOA3A4WGST1hg==", "requires": { - "quote-stream": "1.0.2", - "resolve": "1.6.0", - "static-module": "2.2.3", - "through2": "2.0.3" + "quote-stream": "^1.0.1", + "resolve": "^1.1.5", + "static-module": "^2.2.0", + "through2": "^2.0.0" } }, "brorand": { @@ -759,12 +760,12 @@ "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "requires": { - "JSONStream": "1.3.2", - "combine-source-map": "0.8.0", - "defined": "1.0.0", - "safe-buffer": "5.1.1", - "through2": "2.0.3", - "umd": "3.0.3" + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" } }, "browser-resolve": { @@ -792,53 +793,53 @@ "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", "requires": { - "JSONStream": "1.3.2", - "assert": "1.4.1", - "browser-pack": "6.1.0", - "browser-resolve": "1.11.2", - "browserify-zlib": "0.1.4", - "buffer": "4.9.1", - "cached-path-relative": "1.0.1", - "concat-stream": "1.5.2", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.1.7", - "duplexer2": "0.1.4", - "events": "1.1.1", - "glob": "7.1.2", - "has": "1.0.1", - "htmlescape": "1.1.1", - "https-browserify": "0.0.1", - "inherits": "2.0.1", - "insert-module-globals": "7.0.5", - "labeled-stream-splicer": "2.0.1", - "module-deps": "4.1.1", - "os-browserify": "0.1.2", - "parents": "1.0.1", - "path-browserify": "0.0.0", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.6", - "resolve": "1.6.0", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.1", - "string_decoder": "0.10.31", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", - "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.3", - "vm-browserify": "0.0.4", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.1.2", + "buffer": "^4.1.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.5.1", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "~1.1.0", + "duplexer2": "~0.1.2", + "events": "~1.1.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "~0.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "module-deps": "^4.0.8", + "os-browserify": "~0.1.1", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "~0.10.0", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "~0.0.0", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "~0.0.1", + "xtend": "^4.0.0" }, "dependencies": { "concat-stream": { @@ -846,9 +847,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "requires": { - "inherits": "2.0.1", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" }, "dependencies": { "readable-stream": { @@ -856,12 +857,12 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" } } } @@ -883,12 +884,12 @@ "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.1", - "safe-buffer": "5.1.1" + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "browserify-cipher": { @@ -896,9 +897,9 @@ "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", "requires": { - "browserify-aes": "1.2.0", - "browserify-des": "1.0.0", - "evp_bytestokey": "1.0.3" + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" } }, "browserify-des": { @@ -906,9 +907,9 @@ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.1" + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" } }, "browserify-istanbul": { @@ -916,9 +917,9 @@ "resolved": "https://registry.npmjs.org/browserify-istanbul/-/browserify-istanbul-0.1.5.tgz", "integrity": "sha1-AcjjHWo1juUVD0Mhw/KJlalkw58=", "requires": { - "istanbul": "0.2.16", - "minimatch": "0.2.14", - "through": "2.3.8" + "istanbul": "^0.2.8", + "minimatch": "^0.2.14", + "through": "^2.3.4" }, "dependencies": { "async": { @@ -931,10 +932,10 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", "integrity": "sha1-8CQBb1qI4Eb9EgBQVek5gC5sXyM=", "requires": { - "esprima": "1.1.1", - "estraverse": "1.5.1", - "esutils": "1.0.0", - "source-map": "0.1.43" + "esprima": "~1.1.1", + "estraverse": "~1.5.0", + "esutils": "~1.0.0", + "source-map": "~0.1.33" }, "dependencies": { "esprima": { @@ -964,8 +965,8 @@ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-1.3.0.tgz", "integrity": "sha1-npsTCpPjiUkTItl1zz7BgYw3zjQ=", "requires": { - "optimist": "0.3.7", - "uglify-js": "2.3.6" + "optimist": "~0.3", + "uglify-js": "~2.3" } }, "istanbul": { @@ -973,18 +974,18 @@ "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.2.16.tgz", "integrity": "sha1-hwVFoNT0tM4WEDnp6AWpjCxwC9k=", "requires": { - "abbrev": "1.0.9", - "async": "0.9.2", - "escodegen": "1.3.3", - "esprima": "1.2.5", - "fileset": "0.1.8", - "handlebars": "1.3.0", - "js-yaml": "3.6.1", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "resolve": "0.7.4", - "which": "1.0.9", - "wordwrap": "0.0.3" + "abbrev": "1.0.x", + "async": "0.9.x", + "escodegen": "1.3.x", + "esprima": "1.2.x", + "fileset": "0.1.x", + "handlebars": "1.3.x", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "resolve": "0.7.x", + "which": "1.0.x", + "wordwrap": "0.0.x" } }, "minimatch": { @@ -992,8 +993,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "optimist": { @@ -1001,7 +1002,7 @@ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", "requires": { - "wordwrap": "0.0.3" + "wordwrap": "~0.0.2" } }, "resolve": { @@ -1015,7 +1016,7 @@ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, "uglify-js": { @@ -1024,9 +1025,9 @@ "integrity": "sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo=", "optional": true, "requires": { - "async": "0.2.10", - "optimist": "0.3.7", - "source-map": "0.1.43" + "async": "~0.2.6", + "optimist": "~0.3.5", + "source-map": "~0.1.7" }, "dependencies": { "async": { @@ -1054,8 +1055,8 @@ "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" } }, "browserify-sign": { @@ -1063,13 +1064,13 @@ "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "elliptic": "6.4.0", - "inherits": "2.0.1", - "parse-asn1": "5.1.0" + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" } }, "browserify-zlib": { @@ -1077,7 +1078,7 @@ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", "requires": { - "pako": "0.2.9" + "pako": "~0.2.0" } }, "bs58": { @@ -1085,7 +1086,7 @@ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", "requires": { - "base-x": "3.0.4" + "base-x": "^3.0.2" } }, "buffer": { @@ -1093,9 +1094,9 @@ "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "requires": { - "base64-js": "1.2.3", - "ieee754": "1.1.11", - "isarray": "1.0.0" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" } }, "buffer-compare": { @@ -1138,8 +1139,8 @@ "resolved": "https://registry.npmjs.org/bump-regex/-/bump-regex-2.9.0.tgz", "integrity": "sha512-o4WC1mKw/kM0zScuOxZKi243lc+/h09b41u2A7HlWbxHsEDsTTZtqDZYkQj65l24J8+9Saahn5ep+EyeqpQoCg==", "requires": { - "semver": "5.5.0", - "xtend": "4.0.1" + "semver": "^5.1.0", + "xtend": "^4.0.1" }, "dependencies": { "semver": { @@ -1159,15 +1160,15 @@ "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "cached-path-relative": { @@ -1180,7 +1181,7 @@ "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "requires": { - "callsites": "0.2.0" + "callsites": "^0.2.0" } }, "callsite": { @@ -1203,8 +1204,8 @@ "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" } }, "caseless": { @@ -1217,8 +1218,8 @@ "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chai": { @@ -1242,11 +1243,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "char-split": { @@ -1269,15 +1270,15 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "requires": { - "anymatch": "1.3.2", - "async-each": "1.0.1", - "fsevents": "1.1.3", - "glob-parent": "2.0.0", - "inherits": "2.0.1", - "is-binary-path": "1.0.1", - "is-glob": "2.0.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" }, "dependencies": { "is-extglob": { @@ -1290,7 +1291,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -1300,8 +1301,8 @@ "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "requires": { - "inherits": "2.0.1", - "safe-buffer": "5.1.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "circular-json": { @@ -1314,10 +1315,10 @@ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -1325,7 +1326,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "is-accessor-descriptor": { @@ -1333,7 +1334,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -1341,7 +1342,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -1351,7 +1352,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -1359,7 +1360,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -1369,9 +1370,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { @@ -1387,7 +1388,7 @@ "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", "requires": { "exit": "0.1.2", - "glob": "7.1.2" + "glob": "^7.1.1" } }, "cli-cursor": { @@ -1395,7 +1396,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "requires": { - "restore-cursor": "1.0.1" + "restore-cursor": "^1.0.1" } }, "cli-width": { @@ -1408,8 +1409,8 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -1440,9 +1441,9 @@ "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", "requires": { - "inherits": "2.0.1", - "process-nextick-args": "2.0.0", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" } }, "co": { @@ -1460,8 +1461,8 @@ "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { @@ -1469,7 +1470,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "requires": { - "color-name": "1.1.3" + "color-name": "^1.1.1" } }, "color-name": { @@ -1492,7 +1493,7 @@ "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", "requires": { - "lodash": "4.17.4" + "lodash": "^4.5.0" } }, "combine-source-map": { @@ -1500,10 +1501,10 @@ "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", "requires": { - "convert-source-map": "1.1.3", - "inline-source-map": "0.6.2", - "lodash.memoize": "3.0.4", - "source-map": "0.5.7" + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" }, "dependencies": { "convert-source-map": { @@ -1523,7 +1524,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -1551,10 +1552,10 @@ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.2.9.tgz", "integrity": "sha1-Qi2SdDDAGr0GzUVbbfwEy0z4ADw=", "requires": { - "buffer-crc32": "0.2.1", - "crc32-stream": "0.3.4", - "node-int64": "0.3.3", - "readable-stream": "1.0.34" + "buffer-crc32": "~0.2.1", + "crc32-stream": "~0.3.1", + "node-int64": "~0.3.0", + "readable-stream": "~1.0.26" }, "dependencies": { "isarray": { @@ -1567,10 +1568,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -1585,7 +1586,7 @@ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.13.tgz", "integrity": "sha1-DRAgq5JLL9tNYnmHXH1tq6a6p6k=", "requires": { - "mime-db": "1.33.0" + "mime-db": ">= 1.33.0 < 2" } }, "compression": { @@ -1593,12 +1594,12 @@ "resolved": "http://registry.npmjs.org/compression/-/compression-1.5.0.tgz", "integrity": "sha1-zMGlR4jaGzrXcpxJ9qALOsmt9H8=", "requires": { - "accepts": "1.2.13", + "accepts": "~1.2.9", "bytes": "2.1.0", - "compressible": "2.0.13", - "debug": "2.2.0", - "on-headers": "1.0.1", - "vary": "1.0.1" + "compressible": "~2.0.3", + "debug": "~2.2.0", + "on-headers": "~1.0.0", + "vary": "~1.0.0" }, "dependencies": { "accepts": { @@ -1606,7 +1607,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", "integrity": "sha1-5fHzkoxtlf2WVYw27D2dDeSm7Oo=", "requires": { - "mime-types": "2.1.18", + "mime-types": "~2.1.6", "negotiator": "0.5.3" } }, @@ -1645,10 +1646,10 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "requires": { - "buffer-from": "1.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" }, "dependencies": { "inherits": { @@ -1665,7 +1666,7 @@ "requires": { "debug": "2.6.9", "finalhandler": "1.1.0", - "parseurl": "1.3.2", + "parseurl": "~1.3.2", "utils-merge": "1.0.1" } }, @@ -1674,7 +1675,7 @@ "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "requires": { - "date-now": "0.1.4" + "date-now": "^0.1.4" } }, "constants-browserify": { @@ -1744,8 +1745,8 @@ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.4.tgz", "integrity": "sha1-c7wltF+sHbZjIjGnv86JJ+nwZVI=", "requires": { - "buffer-crc32": "0.2.1", - "readable-stream": "1.0.34" + "buffer-crc32": "~0.2.1", + "readable-stream": "~1.0.24" }, "dependencies": { "isarray": { @@ -1758,10 +1759,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -1776,8 +1777,8 @@ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0" + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" } }, "create-hash": { @@ -1785,10 +1786,10 @@ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.1", - "ripemd160": "2.0.1", - "sha.js": "2.4.11" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "sha.js": "^2.4.0" } }, "create-hmac": { @@ -1796,12 +1797,12 @@ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "inherits": "2.0.1", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.11" + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "cross-spawn": { @@ -1809,9 +1810,9 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "requires": { - "lru-cache": "4.1.2", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" }, "dependencies": { "lru-cache": { @@ -1819,8 +1820,8 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } } } @@ -1830,7 +1831,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "requires": { - "boom": "2.10.1" + "boom": "2.x.x" } }, "crypto-browserify": { @@ -1838,17 +1839,17 @@ "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "requires": { - "browserify-cipher": "1.0.0", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.0", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "diffie-hellman": "5.0.2", - "inherits": "2.0.1", - "pbkdf2": "3.0.14", - "public-encrypt": "4.0.0", - "randombytes": "2.0.6", - "randomfill": "1.0.4" + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" } }, "ctype": { @@ -1861,7 +1862,7 @@ "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "requires": { - "array-find-index": "1.0.2" + "array-find-index": "^1.0.1" } }, "custom-event": { @@ -1874,7 +1875,7 @@ "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "requires": { - "es5-ext": "0.10.42" + "es5-ext": "^0.10.9" } }, "dargs": { @@ -1887,7 +1888,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -1950,7 +1951,7 @@ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "requires": { - "clone": "1.0.4" + "clone": "^1.0.2" } }, "define-property": { @@ -1958,8 +1959,8 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" } }, "defined": { @@ -1972,13 +1973,13 @@ "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "2.6.2" + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" }, "dependencies": { "object-assign": { @@ -2008,10 +2009,10 @@ "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", "requires": { - "JSONStream": "1.3.2", - "shasum": "1.0.2", - "subarg": "1.0.0", - "through2": "2.0.3" + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" } }, "des.js": { @@ -2019,8 +2020,8 @@ "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "requires": { - "inherits": "2.0.1", - "minimalistic-assert": "1.0.0" + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "destroy": { @@ -2038,8 +2039,8 @@ "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", "requires": { - "acorn": "5.5.3", - "defined": "1.0.0" + "acorn": "^5.2.1", + "defined": "^1.0.0" } }, "di": { @@ -2057,9 +2058,9 @@ "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" } }, "doctrine": { @@ -2067,8 +2068,8 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "^2.0.2", + "isarray": "^1.0.0" } }, "dom-serialize": { @@ -2076,10 +2077,10 @@ "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", "requires": { - "custom-event": "1.0.1", - "ent": "2.2.0", - "extend": "3.0.1", - "void-elements": "2.0.1" + "custom-event": "~1.0.0", + "ent": "~2.2.0", + "extend": "^3.0.0", + "void-elements": "^2.0.0" } }, "dom-serializer": { @@ -2087,8 +2088,8 @@ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" + "domelementtype": "~1.1.1", + "entities": "~1.1.1" }, "dependencies": { "domelementtype": { @@ -2118,7 +2119,7 @@ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", "requires": { - "domelementtype": "1.3.0" + "domelementtype": "1" } }, "domutils": { @@ -2126,8 +2127,8 @@ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" } }, "duplexer2": { @@ -2135,7 +2136,7 @@ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } }, "ecc-jsbn": { @@ -2144,7 +2145,7 @@ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "ee-first": { @@ -2157,13 +2158,13 @@ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.1", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "emitter-component": { @@ -2181,7 +2182,7 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", "requires": { - "once": "1.3.3" + "once": "~1.3.0" }, "dependencies": { "once": { @@ -2189,7 +2190,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } } } @@ -2284,7 +2285,7 @@ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es5-ext": { @@ -2292,9 +2293,9 @@ "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz", "integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==", "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1", - "next-tick": "1.0.0" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" } }, "es6-iterator": { @@ -2302,9 +2303,9 @@ "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" } }, "es6-map": { @@ -2312,12 +2313,12 @@ "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-iterator": "2.0.3", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" } }, "es6-promise": { @@ -2330,11 +2331,11 @@ "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-iterator": "2.0.3", + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "event-emitter": "~0.3.5" } }, "es6-symbol": { @@ -2342,8 +2343,8 @@ "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42" + "d": "1", + "es5-ext": "~0.10.14" } }, "es6-weak-map": { @@ -2351,10 +2352,10 @@ "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" } }, "escape-html": { @@ -2372,11 +2373,11 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", "requires": { - "esprima": "3.1.3", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.6.1" + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" } }, "escomplex-plugin-metrics-module": { @@ -2384,7 +2385,7 @@ "resolved": "https://registry.npmjs.org/escomplex-plugin-metrics-module/-/escomplex-plugin-metrics-module-0.0.10.tgz", "integrity": "sha1-6pZ8sSwSOCDSTnrATkJ4oZvPzoM=", "requires": { - "typhonjs-escomplex-commons": "0.0.14" + "typhonjs-escomplex-commons": "^0.0.14" } }, "escomplex-plugin-metrics-project": { @@ -2392,7 +2393,7 @@ "resolved": "https://registry.npmjs.org/escomplex-plugin-metrics-project/-/escomplex-plugin-metrics-project-0.0.10.tgz", "integrity": "sha1-Z6Y1wctV4vO+y3dO/mpANOYjiqg=", "requires": { - "typhonjs-escomplex-commons": "0.0.14" + "typhonjs-escomplex-commons": "^0.0.14" } }, "escomplex-plugin-syntax-babylon": { @@ -2400,8 +2401,8 @@ "resolved": "https://registry.npmjs.org/escomplex-plugin-syntax-babylon/-/escomplex-plugin-syntax-babylon-0.0.10.tgz", "integrity": "sha1-sUcBSYHP57yKK0NJfmsyiRqD5yA=", "requires": { - "escomplex-plugin-syntax-estree": "0.0.10", - "typhonjs-escomplex-commons": "0.0.14" + "escomplex-plugin-syntax-estree": "^0.0.10", + "typhonjs-escomplex-commons": "^0.0.14" } }, "escomplex-plugin-syntax-estree": { @@ -2409,7 +2410,7 @@ "resolved": "https://registry.npmjs.org/escomplex-plugin-syntax-estree/-/escomplex-plugin-syntax-estree-0.0.10.tgz", "integrity": "sha1-b1MfnZM/vB68lDjpwQGxtGNs/Gg=", "requires": { - "typhonjs-escomplex-commons": "0.0.14" + "typhonjs-escomplex-commons": "^0.0.14" } }, "escope": { @@ -2417,10 +2418,10 @@ "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "es6-map": "^0.1.3", + "es6-weak-map": "^2.0.1", + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "eslint": { @@ -2428,39 +2429,39 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.0.1.tgz", "integrity": "sha1-/xLq/cBOpx0XOgmdRlihNucVeTQ=", "requires": { - "chalk": "1.1.3", - "concat-stream": "1.6.2", - "debug": "2.6.9", - "doctrine": "1.5.0", - "es6-map": "0.1.5", - "escope": "3.6.0", - "espree": "3.5.4", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "file-entry-cache": "1.3.1", - "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.7", - "imurmurhash": "0.1.4", - "inquirer": "0.12.0", - "is-my-json-valid": "2.17.2", - "is-resolvable": "1.1.0", - "js-yaml": "3.6.1", - "json-stable-stringify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.4", - "mkdirp": "0.5.1", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "1.2.1", - "progress": "1.1.8", - "require-uncached": "1.0.3", - "shelljs": "0.6.1", - "strip-bom": "3.0.0", - "strip-json-comments": "1.0.4", - "table": "3.8.3", - "text-table": "0.2.0", - "user-home": "2.0.0" + "chalk": "^1.1.3", + "concat-stream": "^1.4.6", + "debug": "^2.1.1", + "doctrine": "^1.2.2", + "es6-map": "^0.1.3", + "escope": "^3.6.0", + "espree": "^3.1.6", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^1.1.1", + "glob": "^7.0.3", + "globals": "^9.2.0", + "ignore": "^3.1.2", + "imurmurhash": "^0.1.4", + "inquirer": "^0.12.0", + "is-my-json-valid": "^2.10.0", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.5.1", + "json-stable-stringify": "^1.0.0", + "levn": "^0.3.0", + "lodash": "^4.0.0", + "mkdirp": "^0.5.0", + "optionator": "^0.8.1", + "path-is-inside": "^1.0.1", + "pluralize": "^1.2.1", + "progress": "^1.1.8", + "require-uncached": "^1.0.2", + "shelljs": "^0.6.0", + "strip-bom": "^3.0.0", + "strip-json-comments": "~1.0.1", + "table": "^3.7.8", + "text-table": "~0.2.0", + "user-home": "^2.0.0" }, "dependencies": { "json-stable-stringify": { @@ -2468,7 +2469,7 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "strip-bom": { @@ -2481,7 +2482,7 @@ "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", "requires": { - "os-homedir": "1.0.2" + "os-homedir": "^1.0.0" } } } @@ -2491,8 +2492,8 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "requires": { - "acorn": "5.5.3", - "acorn-jsx": "3.0.1" + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" } }, "esprima": { @@ -2505,7 +2506,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.1.0" } }, "estraverse": { @@ -2528,8 +2529,8 @@ "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42" + "d": "1", + "es5-ext": "~0.10.14" } }, "eventemitter3": { @@ -2547,8 +2548,8 @@ "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.1" + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" } }, "execa": { @@ -2556,13 +2557,13 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz", "integrity": "sha1-V7aaWU8IF1nGnlNw8NF7nLEWWP4=", "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "exit": { @@ -2580,9 +2581,9 @@ "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", "requires": { - "array-slice": "0.2.3", - "array-unique": "0.2.1", - "braces": "0.1.5" + "array-slice": "^0.2.3", + "array-unique": "^0.2.1", + "braces": "^0.1.2" }, "dependencies": { "array-slice": { @@ -2600,7 +2601,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", "requires": { - "expand-range": "0.1.1" + "expand-range": "^0.1.0" } }, "expand-range": { @@ -2608,8 +2609,8 @@ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", "requires": { - "is-number": "0.1.1", - "repeat-string": "0.2.2" + "is-number": "^0.1.1", + "repeat-string": "^0.2.2" } }, "is-number": { @@ -2629,13 +2630,13 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2643,7 +2644,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -2651,7 +2652,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -2659,7 +2660,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -2667,7 +2668,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -2677,7 +2678,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -2685,7 +2686,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -2695,9 +2696,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { @@ -2712,7 +2713,7 @@ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "requires": { - "fill-range": "2.2.3" + "fill-range": "^2.1.0" }, "dependencies": { "fill-range": { @@ -2720,11 +2721,11 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" } }, "is-number": { @@ -2732,7 +2733,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "isobject": { @@ -2748,7 +2749,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -2758,7 +2759,7 @@ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "requires": { - "homedir-polyfill": "1.0.1" + "homedir-polyfill": "^1.0.1" } }, "express": { @@ -2771,7 +2772,7 @@ "connect": "2.12.0", "cookie": "0.1.0", "cookie-signature": "1.0.1", - "debug": "0.8.1", + "debug": ">= 0.7.3 < 1", "fresh": "0.2.0", "merge-descriptors": "0.0.1", "methods": "0.1.0", @@ -2790,7 +2791,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-1.3.2.tgz", "integrity": "sha1-io8w7GcKb91kr1LxkUuQfXnq1bU=", "requires": { - "keypress": "0.1.0" + "keypress": "0.1.x" } }, "connect": { @@ -2803,7 +2804,7 @@ "bytes": "0.2.1", "cookie": "0.1.0", "cookie-signature": "1.0.1", - "debug": "0.8.1", + "debug": ">= 0.7.3 < 1", "fresh": "0.2.0", "methods": "0.1.0", "multiparty": "2.2.0", @@ -2850,7 +2851,7 @@ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.2.tgz", "integrity": "sha1-x0swBN6l3v0WlhcRBqx0DsMdYr4=", "requires": { - "bytes": "0.2.1" + "bytes": "~0.2.1" } } } @@ -2870,8 +2871,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -2879,7 +2880,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -2889,14 +2890,14 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2904,7 +2905,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -2912,7 +2913,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2933,9 +2934,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "inherits": { @@ -2968,10 +2969,10 @@ "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz", "integrity": "sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw=", "requires": { - "acorn": "5.5.3", - "foreach": "2.0.5", + "acorn": "^5.0.0", + "foreach": "^2.0.5", "isarray": "0.0.1", - "object-keys": "1.0.11" + "object-keys": "^1.0.6" }, "dependencies": { "isarray": { @@ -2986,9 +2987,9 @@ "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", "requires": { - "ansi-gray": "0.1.1", - "color-support": "1.1.3", - "time-stamp": "1.1.0" + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "time-stamp": "^1.0.0" } }, "fast-deep-equal": { @@ -3011,7 +3012,7 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "requires": { - "pend": "1.2.0" + "pend": "~1.2.0" } }, "figures": { @@ -3019,8 +3020,8 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" }, "dependencies": { "object-assign": { @@ -3035,8 +3036,8 @@ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", "integrity": "sha1-RMYepgeuS+nBQC9B9EJwy/4zT/g=", "requires": { - "flat-cache": "1.3.0", - "object-assign": "4.1.1" + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" }, "dependencies": { "object-assign": { @@ -3051,13 +3052,13 @@ "resolved": "https://registry.npmjs.org/file-utils/-/file-utils-0.1.5.tgz", "integrity": "sha1-3IFTyFU4fLTaywoXJVMfpESmtIw=", "requires": { - "findup-sync": "0.1.3", - "glob": "3.2.11", - "iconv-lite": "0.2.11", - "isbinaryfile": "0.1.9", - "lodash": "2.1.0", - "minimatch": "0.2.14", - "rimraf": "2.2.8" + "findup-sync": "~0.1.2", + "glob": "~3.2.6", + "iconv-lite": "~0.2.11", + "isbinaryfile": "~0.1.9", + "lodash": "~2.1.0", + "minimatch": "~0.2.12", + "rimraf": "~2.2.2" }, "dependencies": { "findup-sync": { @@ -3065,8 +3066,8 @@ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=", "requires": { - "glob": "3.2.11", - "lodash": "2.4.2" + "glob": "~3.2.9", + "lodash": "~2.4.1" }, "dependencies": { "lodash": { @@ -3081,8 +3082,8 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "requires": { - "inherits": "2.0.1", - "minimatch": "0.3.0" + "inherits": "2", + "minimatch": "0.3" }, "dependencies": { "minimatch": { @@ -3090,8 +3091,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } } } @@ -3116,8 +3117,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "rimraf": { @@ -3137,8 +3138,8 @@ "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", "integrity": "sha1-UGuRqTluqn4y+0KoQHfHoMc2t0E=", "requires": { - "glob": "3.2.11", - "minimatch": "0.4.0" + "glob": "3.x", + "minimatch": "0.x" }, "dependencies": { "glob": { @@ -3146,8 +3147,8 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "requires": { - "inherits": "2.0.1", - "minimatch": "0.3.0" + "inherits": "2", + "minimatch": "0.3" }, "dependencies": { "minimatch": { @@ -3155,8 +3156,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } } } @@ -3166,8 +3167,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.4.0.tgz", "integrity": "sha1-vSx9Bg0sjI/Xzefx8u0tWycP2xs=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } } } @@ -3177,10 +3178,10 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -3188,7 +3189,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -3199,12 +3200,12 @@ "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" }, "dependencies": { "statuses": { @@ -3229,8 +3230,8 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "findup-sync": { @@ -3238,10 +3239,10 @@ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "requires": { - "detect-file": "1.0.0", - "is-glob": "3.1.0", - "micromatch": "3.1.10", - "resolve-dir": "1.0.1" + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, "fined": { @@ -3249,11 +3250,11 @@ "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", "requires": { - "expand-tilde": "2.0.2", - "is-plain-object": "2.0.4", - "object.defaults": "1.1.0", - "object.pick": "1.3.0", - "parse-filepath": "1.0.2" + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" } }, "firefox-profile": { @@ -3261,14 +3262,14 @@ "resolved": "https://registry.npmjs.org/firefox-profile/-/firefox-profile-0.2.7.tgz", "integrity": "sha1-/kavwu1qlvYsXDvURvoln2AUqQk=", "requires": { - "adm-zip": "0.4.7", - "archiver": "0.7.1", - "async": "0.2.10", - "fs-extra": "0.8.1", - "lazystream": "0.1.0", - "node-uuid": "1.4.8", - "wrench": "1.5.9", - "xml2js": "0.4.19" + "adm-zip": "~0.4.3", + "archiver": "~0.7.1", + "async": "~0.2.9", + "fs-extra": "~0.8.1", + "lazystream": "~0.1.0", + "node-uuid": "~1.4.1", + "wrench": "~1.5.1", + "xml2js": "~0.4.0" }, "dependencies": { "async": { @@ -3281,10 +3282,10 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.8.1.tgz", "integrity": "sha1-Dld5/7/t9RG8dVWVx/A8BtS0Po0=", "requires": { - "jsonfile": "1.1.1", - "mkdirp": "0.3.5", - "ncp": "0.4.2", - "rimraf": "2.2.8" + "jsonfile": "~1.1.0", + "mkdirp": "0.3.x", + "ncp": "~0.4.2", + "rimraf": "~2.2.0" } }, "jsonfile": { @@ -3324,10 +3325,10 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "requires": { - "circular-json": "0.3.3", - "del": "2.2.2", - "graceful-fs": "4.1.11", - "write": "0.2.1" + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" }, "dependencies": { "graceful-fs": { @@ -3347,7 +3348,7 @@ "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "forEachAsync": { @@ -3355,7 +3356,7 @@ "resolved": "https://registry.npmjs.org/forEachAsync/-/forEachAsync-2.2.1.tgz", "integrity": "sha1-43I/AJA5EOHrSx2zrVG1xkoxn+w=", "requires": { - "sequence": "2.2.1" + "sequence": "2.x" } }, "foreach": { @@ -3378,9 +3379,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" } }, "formatio": { @@ -3388,7 +3389,7 @@ "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.1.1.tgz", "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", "requires": { - "samsam": "1.1.2" + "samsam": "~1.1" } }, "formidable": { @@ -3406,7 +3407,7 @@ "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fresh": { @@ -3419,9 +3420,9 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" }, "dependencies": { "graceful-fs": { @@ -3442,8 +3443,8 @@ "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", "optional": true, "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.6.39" + "nan": "^2.3.0", + "node-pre-gyp": "^0.6.39" }, "dependencies": { "abbrev": { @@ -3456,8 +3457,8 @@ "bundled": true, "optional": true, "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" } }, "ansi-regex": { @@ -3474,8 +3475,8 @@ "bundled": true, "optional": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "asn1": { @@ -3512,28 +3513,28 @@ "bundled": true, "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "block-stream": { "version": "0.0.9", "bundled": true, "requires": { - "inherits": "2.0.3" + "inherits": "~2.0.0" } }, "boom": { "version": "2.10.1", "bundled": true, "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "brace-expansion": { "version": "1.1.7", "bundled": true, "requires": { - "balanced-match": "0.4.2", + "balanced-match": "^0.4.1", "concat-map": "0.0.1" } }, @@ -3559,7 +3560,7 @@ "version": "1.0.5", "bundled": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "concat-map": { @@ -3578,7 +3579,7 @@ "version": "2.0.5", "bundled": true, "requires": { - "boom": "2.10.1" + "boom": "2.x.x" } }, "dashdash": { @@ -3586,7 +3587,7 @@ "bundled": true, "optional": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -3628,7 +3629,7 @@ "bundled": true, "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "extend": { @@ -3650,9 +3651,9 @@ "bundled": true, "optional": true, "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" } }, "fs.realpath": { @@ -3663,10 +3664,10 @@ "version": "1.0.11", "bundled": true, "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" } }, "fstream-ignore": { @@ -3674,9 +3675,9 @@ "bundled": true, "optional": true, "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" + "fstream": "^1.0.0", + "inherits": "2", + "minimatch": "^3.0.0" } }, "gauge": { @@ -3684,14 +3685,14 @@ "bundled": true, "optional": true, "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "getpass": { @@ -3699,7 +3700,7 @@ "bundled": true, "optional": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -3713,12 +3714,12 @@ "version": "7.1.2", "bundled": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "graceful-fs": { @@ -3735,8 +3736,8 @@ "bundled": true, "optional": true, "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "ajv": "^4.9.1", + "har-schema": "^1.0.5" } }, "has-unicode": { @@ -3748,10 +3749,10 @@ "version": "3.1.3", "bundled": true, "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" } }, "hoek": { @@ -3763,17 +3764,17 @@ "bundled": true, "optional": true, "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "inflight": { "version": "1.0.6", "bundled": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -3789,7 +3790,7 @@ "version": "1.0.0", "bundled": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-typedarray": { @@ -3811,7 +3812,7 @@ "bundled": true, "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "jsbn": { @@ -3829,7 +3830,7 @@ "bundled": true, "optional": true, "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "json-stringify-safe": { @@ -3868,14 +3869,14 @@ "version": "2.1.15", "bundled": true, "requires": { - "mime-db": "1.27.0" + "mime-db": "~1.27.0" } }, "minimatch": { "version": "3.0.4", "bundled": true, "requires": { - "brace-expansion": "1.1.7" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -3899,17 +3900,17 @@ "bundled": true, "optional": true, "requires": { - "detect-libc": "1.0.2", + "detect-libc": "^1.0.2", "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.0.2", + "rc": "^1.1.7", "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^2.2.1", + "tar-pack": "^3.4.0" } }, "nopt": { @@ -3917,8 +3918,8 @@ "bundled": true, "optional": true, "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" + "abbrev": "1", + "osenv": "^0.1.4" } }, "npmlog": { @@ -3926,10 +3927,10 @@ "bundled": true, "optional": true, "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { @@ -3950,7 +3951,7 @@ "version": "1.4.0", "bundled": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "os-homedir": { @@ -3968,8 +3969,8 @@ "bundled": true, "optional": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "path-is-absolute": { @@ -4000,10 +4001,10 @@ "bundled": true, "optional": true, "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "~0.4.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -4017,13 +4018,13 @@ "version": "2.2.9", "bundled": true, "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" } }, "request": { @@ -4031,35 +4032,35 @@ "bundled": true, "optional": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" } }, "rimraf": { "version": "2.6.1", "bundled": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "safe-buffer": { @@ -4085,7 +4086,7 @@ "version": "1.0.9", "bundled": true, "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "sshpk": { @@ -4093,15 +4094,15 @@ "bundled": true, "optional": true, "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" }, "dependencies": { "assert-plus": { @@ -4115,16 +4116,16 @@ "version": "1.0.2", "bundled": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { "version": "1.0.1", "bundled": true, "requires": { - "safe-buffer": "5.0.1" + "safe-buffer": "^5.0.1" } }, "stringstream": { @@ -4136,7 +4137,7 @@ "version": "3.0.1", "bundled": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-json-comments": { @@ -4148,9 +4149,9 @@ "version": "2.2.1", "bundled": true, "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" } }, "tar-pack": { @@ -4158,14 +4159,14 @@ "bundled": true, "optional": true, "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" + "debug": "^2.2.0", + "fstream": "^1.0.10", + "fstream-ignore": "^1.0.5", + "once": "^1.3.3", + "readable-stream": "^2.1.4", + "rimraf": "^2.5.1", + "tar": "^2.2.1", + "uid-number": "^0.0.6" } }, "tough-cookie": { @@ -4173,7 +4174,7 @@ "bundled": true, "optional": true, "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "tunnel-agent": { @@ -4181,7 +4182,7 @@ "bundled": true, "optional": true, "requires": { - "safe-buffer": "5.0.1" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -4216,7 +4217,7 @@ "bundled": true, "optional": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2" } }, "wrappy": { @@ -4235,7 +4236,7 @@ "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", "requires": { - "globule": "0.1.0" + "globule": "~0.1.0" } }, "generate-function": { @@ -4248,7 +4249,7 @@ "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "requires": { - "is-property": "1.0.2" + "is-property": "^1.0.0" } }, "get-stdin": { @@ -4271,7 +4272,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -4286,12 +4287,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-base": { @@ -4299,8 +4300,8 @@ "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" }, "dependencies": { "is-extglob": { @@ -4313,7 +4314,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -4323,7 +4324,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" }, "dependencies": { "is-extglob": { @@ -4336,7 +4337,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -4346,12 +4347,12 @@ "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", "requires": { - "glob": "4.5.3", - "glob2base": "0.0.12", - "minimatch": "2.0.10", - "ordered-read-streams": "0.1.0", - "through2": "0.6.5", - "unique-stream": "1.0.0" + "glob": "^4.3.1", + "glob2base": "^0.0.12", + "minimatch": "^2.0.1", + "ordered-read-streams": "^0.1.0", + "through2": "^0.6.1", + "unique-stream": "^1.0.0" }, "dependencies": { "glob": { @@ -4359,10 +4360,10 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", "requires": { - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "2.0.10", - "once": "1.4.0" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^2.0.1", + "once": "^1.3.0" } }, "isarray": { @@ -4375,7 +4376,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.0.0" } }, "readable-stream": { @@ -4383,10 +4384,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -4399,8 +4400,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } } } @@ -4410,7 +4411,7 @@ "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", "requires": { - "gaze": "0.5.2" + "gaze": "^0.5.1" } }, "glob2base": { @@ -4418,7 +4419,7 @@ "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", "requires": { - "find-index": "0.1.1" + "find-index": "^0.1.1" } }, "global-modules": { @@ -4426,9 +4427,9 @@ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "requires": { - "global-prefix": "1.0.2", - "is-windows": "1.0.2", - "resolve-dir": "1.0.1" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, "global-prefix": { @@ -4436,11 +4437,11 @@ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "requires": { - "expand-tilde": "2.0.2", - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "1.0.2", - "which": "1.3.0" + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, "globals": { @@ -4453,12 +4454,12 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "object-assign": { @@ -4473,10 +4474,10 @@ "resolved": "https://registry.npmjs.org/globs-to-files/-/globs-to-files-1.0.0.tgz", "integrity": "sha1-VEkPbR9Ln9LenZlEUUb/s3VQOA0=", "requires": { - "array-uniq": "1.0.3", - "asyncreduce": "0.1.4", - "glob": "5.0.15", - "xtend": "4.0.1" + "array-uniq": "~1.0.2", + "asyncreduce": "~0.1.4", + "glob": "^5.0.10", + "xtend": "^4.0.0" }, "dependencies": { "glob": { @@ -4484,11 +4485,11 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "requires": { - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -4498,9 +4499,9 @@ "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", "requires": { - "glob": "3.1.21", - "lodash": "1.0.2", - "minimatch": "0.2.14" + "glob": "~3.1.21", + "lodash": "~1.0.1", + "minimatch": "~0.2.11" }, "dependencies": { "glob": { @@ -4508,9 +4509,9 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" + "graceful-fs": "~1.2.0", + "inherits": "1", + "minimatch": "~0.2.11" } }, "graceful-fs": { @@ -4533,8 +4534,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } } } @@ -4544,7 +4545,7 @@ "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", "requires": { - "sparkles": "1.0.0" + "sparkles": "^1.0.0" } }, "graceful-fs": { @@ -4552,7 +4553,7 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", "requires": { - "natives": "1.1.3" + "natives": "^1.1.0" } }, "graceful-readlink": { @@ -4570,19 +4571,19 @@ "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", "requires": { - "archy": "1.0.0", - "chalk": "1.1.3", - "deprecated": "0.0.1", - "gulp-util": "3.0.8", - "interpret": "1.1.0", - "liftoff": "2.5.0", - "minimist": "1.2.0", - "orchestrator": "0.3.8", - "pretty-hrtime": "1.0.3", - "semver": "4.3.6", - "tildify": "1.2.0", - "v8flags": "2.1.1", - "vinyl-fs": "0.3.14" + "archy": "^1.0.0", + "chalk": "^1.0.0", + "deprecated": "^0.0.1", + "gulp-util": "^3.0.0", + "interpret": "^1.0.0", + "liftoff": "^2.1.0", + "minimist": "^1.1.0", + "orchestrator": "^0.3.0", + "pretty-hrtime": "^1.0.0", + "semver": "^4.1.0", + "tildify": "^1.0.0", + "v8flags": "^2.0.2", + "vinyl-fs": "^0.3.0" } }, "gulp-bump": { @@ -4590,11 +4591,11 @@ "resolved": "https://registry.npmjs.org/gulp-bump/-/gulp-bump-2.9.0.tgz", "integrity": "sha512-Cu+QOhwb2Jr2K6yo2u2mh4GWQRpSAMZD/z0v8FStlrOGaqML9u1On7XcyR1pS/PN3HQ9wsd/Ks6AcCQb+j3BgA==", "requires": { - "bump-regex": "2.9.0", - "plugin-error": "0.1.2", - "plugin-log": "0.1.0", - "semver": "5.5.0", - "through2": "2.0.3" + "bump-regex": "^2.9.0", + "plugin-error": "^0.1.2", + "plugin-log": "^0.1.0", + "semver": "^5.3.0", + "through2": "^2.0.1" }, "dependencies": { "semver": { @@ -4609,9 +4610,9 @@ "resolved": "https://registry.npmjs.org/gulp-coveralls/-/gulp-coveralls-0.1.4.tgz", "integrity": "sha1-L2IKyN9i0LhrS73mTaNnzEGhkMk=", "requires": { - "coveralls": "2.13.3", - "gulp-util": "3.0.8", - "through2": "1.1.1" + "coveralls": "^2.11.2", + "gulp-util": "^3.0.4", + "through2": "^1.1.1" }, "dependencies": { "isarray": { @@ -4624,10 +4625,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -4640,8 +4641,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", "requires": { - "readable-stream": "1.1.14", - "xtend": "4.0.1" + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } } } @@ -4651,14 +4652,14 @@ "resolved": "https://registry.npmjs.org/gulp-git/-/gulp-git-2.5.2.tgz", "integrity": "sha512-rMbJ7W7ucHEPUkcia3eVrvSvQMB+WF80GfkfWEQMJPh6vUgr6f6AuCzNhj0m3xHS/2aaFzumhlt2RzD5EWFkug==", "requires": { - "any-shell-escape": "0.1.1", - "fancy-log": "1.3.2", - "lodash.template": "4.4.0", - "plugin-error": "0.1.2", - "require-dir": "1.0.0", - "strip-bom-stream": "3.0.0", - "through2": "2.0.3", - "vinyl": "2.1.0" + "any-shell-escape": "^0.1.1", + "fancy-log": "^1.3.2", + "lodash.template": "^4.4.0", + "plugin-error": "^0.1.2", + "require-dir": "^1.0.0", + "strip-bom-stream": "^3.0.0", + "through2": "^2.0.3", + "vinyl": "^2.0.1" }, "dependencies": { "clone": { @@ -4676,8 +4677,8 @@ "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.templatesettings": "4.1.0" + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" } }, "lodash.templatesettings": { @@ -4685,7 +4686,7 @@ "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", "requires": { - "lodash._reinterpolate": "3.0.0" + "lodash._reinterpolate": "~3.0.0" } }, "replace-ext": { @@ -4698,12 +4699,12 @@ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", "requires": { - "clone": "2.1.2", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.1.2", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" } } } @@ -4713,11 +4714,11 @@ "resolved": "https://registry.npmjs.org/gulp-jshint/-/gulp-jshint-2.1.0.tgz", "integrity": "sha512-sP3NK8Y/1e58O0PH9t6s7DAr/lKDSUbIY207oWSeufM6/VclB7jJrIBcPCsyhrFTCDUl9DauePbt6VqP2vPM5w==", "requires": { - "lodash": "4.17.4", - "minimatch": "3.0.4", - "plugin-error": "0.1.2", - "rcloader": "0.2.2", - "through2": "2.0.3" + "lodash": "^4.12.0", + "minimatch": "^3.0.3", + "plugin-error": "^0.1.2", + "rcloader": "^0.2.2", + "through2": "^2.0.0" } }, "gulp-mocha": { @@ -4725,12 +4726,12 @@ "resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-4.3.1.tgz", "integrity": "sha1-d5ULQ7z/gWWVdnwHNOD9p9Fz3Nk=", "requires": { - "dargs": "5.1.0", - "execa": "0.6.3", - "gulp-util": "3.0.8", - "mocha": "3.5.3", - "npm-run-path": "2.0.2", - "through2": "2.0.3" + "dargs": "^5.1.0", + "execa": "^0.6.0", + "gulp-util": "^3.0.0", + "mocha": "^3.0.0", + "npm-run-path": "^2.0.2", + "through2": "^2.0.3" } }, "gulp-rename": { @@ -4743,13 +4744,13 @@ "resolved": "https://registry.npmjs.org/gulp-shell/-/gulp-shell-0.6.5.tgz", "integrity": "sha512-f3m1WcS0o2B72/PGj1Jbv9zYR9rynBh/EQJv64n01xQUo7j7anols0eww9GG/WtDTzGVQLrupVDYkifRFnj5Zg==", "requires": { - "async": "2.6.0", - "chalk": "2.3.2", - "fancy-log": "1.3.2", - "lodash": "4.17.4", - "lodash.template": "4.4.0", - "plugin-error": "0.1.2", - "through2": "2.0.3" + "async": "^2.1.5", + "chalk": "^2.3.0", + "fancy-log": "^1.3.2", + "lodash": "^4.17.4", + "lodash.template": "^4.4.0", + "plugin-error": "^0.1.2", + "through2": "^2.0.3" }, "dependencies": { "ansi-styles": { @@ -4757,7 +4758,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "chalk": { @@ -4765,9 +4766,9 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.3.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "has-flag": { @@ -4780,8 +4781,8 @@ "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.templatesettings": "4.1.0" + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" } }, "lodash.templatesettings": { @@ -4789,7 +4790,7 @@ "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", "requires": { - "lodash._reinterpolate": "3.0.0" + "lodash._reinterpolate": "~3.0.0" } }, "supports-color": { @@ -4797,7 +4798,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -4807,14 +4808,14 @@ "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-2.1.2.tgz", "integrity": "sha1-bbhbHQ7mPRgFhZK2WGSdZcLsRUE=", "requires": { - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash": "4.17.4", - "make-error-cause": "1.2.2", - "through2": "2.0.3", - "uglify-js": "2.8.29", - "uglify-save-license": "0.4.1", - "vinyl-sourcemaps-apply": "0.2.1" + "gulplog": "^1.0.0", + "has-gulplog": "^0.1.0", + "lodash": "^4.13.1", + "make-error-cause": "^1.1.1", + "through2": "^2.0.0", + "uglify-js": "~2.8.10", + "uglify-save-license": "^0.4.1", + "vinyl-sourcemaps-apply": "^0.2.0" } }, "gulp-util": { @@ -4822,24 +4823,24 @@ "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.2.0", - "fancy-log": "1.3.2", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", + "array-differ": "^1.0.0", + "array-uniq": "^1.0.2", + "beeper": "^1.0.0", + "chalk": "^1.0.0", + "dateformat": "^2.0.0", + "fancy-log": "^1.1.0", + "gulplog": "^1.0.0", + "has-gulplog": "^0.1.0", + "lodash._reescape": "^3.0.0", + "lodash._reevaluate": "^3.0.0", + "lodash._reinterpolate": "^3.0.0", + "lodash.template": "^3.0.0", + "minimist": "^1.1.0", + "multipipe": "^0.1.2", + "object-assign": "^3.0.0", "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" + "through2": "^2.0.0", + "vinyl": "^0.5.0" } }, "gulplog": { @@ -4847,7 +4848,7 @@ "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", "requires": { - "glogg": "1.0.1" + "glogg": "^1.0.0" } }, "handlebars": { @@ -4855,10 +4856,10 @@ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "async": { @@ -4871,7 +4872,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -4886,10 +4887,10 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", "requires": { - "chalk": "1.1.3", - "commander": "2.15.1", - "is-my-json-valid": "2.17.2", - "pinkie-promise": "2.0.1" + "chalk": "^1.1.1", + "commander": "^2.9.0", + "is-my-json-valid": "^2.12.4", + "pinkie-promise": "^2.0.0" } }, "has": { @@ -4897,7 +4898,7 @@ "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.0.2" } }, "has-ansi": { @@ -4905,7 +4906,7 @@ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-binary": { @@ -4938,7 +4939,7 @@ "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", "requires": { - "sparkles": "1.0.0" + "sparkles": "^1.0.0" } }, "has-value": { @@ -4946,9 +4947,9 @@ "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" } }, "has-values": { @@ -4956,8 +4957,8 @@ "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -4965,7 +4966,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4975,7 +4976,7 @@ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", "requires": { - "inherits": "2.0.1" + "inherits": "^2.0.1" } }, "hash.js": { @@ -4983,8 +4984,8 @@ "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" }, "dependencies": { "inherits": { @@ -4999,8 +5000,8 @@ "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", "requires": { - "is-stream": "1.1.0", - "pinkie-promise": "2.0.1" + "is-stream": "^1.0.1", + "pinkie-promise": "^2.0.0" } }, "hawk": { @@ -5008,10 +5009,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" } }, "hbs": { @@ -5033,8 +5034,8 @@ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-1.0.12.tgz", "integrity": "sha1-GMbTRAw16RsZs/9YK5FRq0mF1Pw=", "requires": { - "optimist": "0.3.7", - "uglify-js": "2.3.6" + "optimist": "~0.3", + "uglify-js": "~2.3" } }, "optimist": { @@ -5042,7 +5043,7 @@ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", "requires": { - "wordwrap": "0.0.3" + "wordwrap": "~0.0.2" } }, "source-map": { @@ -5050,7 +5051,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, "uglify-js": { @@ -5058,9 +5059,9 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz", "integrity": "sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo=", "requires": { - "async": "0.2.10", - "optimist": "0.3.7", - "source-map": "0.1.43" + "async": "~0.2.6", + "optimist": "~0.3.5", + "source-map": "~0.1.7" } }, "wordwrap": { @@ -5085,9 +5086,9 @@ "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "hoek": { @@ -5100,7 +5101,7 @@ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", "requires": { - "parse-passwd": "1.0.0" + "parse-passwd": "^1.0.0" } }, "hosted-git-info": { @@ -5118,11 +5119,11 @@ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" }, "dependencies": { "isarray": { @@ -5135,10 +5136,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -5153,10 +5154,10 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "depd": "1.1.2", + "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": "1.5.0" + "statuses": ">= 1.4.0 < 2" }, "dependencies": { "inherits": { @@ -5171,8 +5172,8 @@ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=", "requires": { - "eventemitter3": "1.2.0", - "requires-port": "1.0.0" + "eventemitter3": "1.x.x", + "requires-port": "1.x.x" } }, "http-signature": { @@ -5180,9 +5181,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "https-browserify": { @@ -5220,7 +5221,7 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "indexof": { @@ -5233,8 +5234,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -5252,7 +5253,7 @@ "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", "requires": { - "source-map": "0.5.7" + "source-map": "~0.5.3" }, "dependencies": { "source-map": { @@ -5267,19 +5268,19 @@ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "cli-width": "2.2.0", - "figures": "1.7.0", - "lodash": "4.17.4", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "through": "2.3.8" + "ansi-escapes": "^1.1.0", + "ansi-regex": "^2.0.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "readline2": "^1.0.1", + "run-async": "^0.1.0", + "rx-lite": "^3.1.2", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" } }, "insert-module-globals": { @@ -5287,14 +5288,14 @@ "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.5.tgz", "integrity": "sha512-wgRtrCpMm0ruH2hgLUIx+9YfJsgJQmU1KkPUzTuatW9dbH19yPRqAQhFX1HJU6zbmg2IMmt80BgSE5MWuksw3Q==", "requires": { - "JSONStream": "1.3.2", - "combine-source-map": "0.8.0", - "concat-stream": "1.6.2", - "is-buffer": "1.1.6", - "lexical-scope": "1.2.0", - "process": "0.11.10", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "lexical-scope": "^1.2.0", + "process": "~0.11.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" } }, "interpret": { @@ -5312,8 +5313,8 @@ "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "requires": { - "is-relative": "1.0.0", - "is-windows": "1.0.2" + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" } }, "is-accessor-descriptor": { @@ -5321,7 +5322,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-arrayish": { @@ -5334,7 +5335,7 @@ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "requires": { - "binary-extensions": "1.11.0" + "binary-extensions": "^1.0.0" } }, "is-buffer": { @@ -5347,7 +5348,7 @@ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-data-descriptor": { @@ -5355,7 +5356,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -5363,9 +5364,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-dotfile": { @@ -5378,7 +5379,7 @@ "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -5396,7 +5397,7 @@ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -5404,7 +5405,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-glob": { @@ -5412,7 +5413,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.0" } }, "is-my-ip-valid": { @@ -5425,11 +5426,11 @@ "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "is-my-ip-valid": "1.0.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" + "generate-function": "^2.0.0", + "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", + "jsonpointer": "^4.0.0", + "xtend": "^4.0.0" } }, "is-number": { @@ -5437,7 +5438,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -5445,7 +5446,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5455,7 +5456,7 @@ "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", "requires": { - "is-number": "4.0.0" + "is-number": "^4.0.0" }, "dependencies": { "is-number": { @@ -5475,7 +5476,7 @@ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "requires": { - "is-path-inside": "1.0.1" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -5483,7 +5484,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-plain-object": { @@ -5491,7 +5492,7 @@ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "is-posix-bracket": { @@ -5514,7 +5515,7 @@ "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "requires": { - "is-unc-path": "1.0.0" + "is-unc-path": "^1.0.0" } }, "is-resolvable": { @@ -5537,7 +5538,7 @@ "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "requires": { - "unc-path-regex": "0.1.2" + "unc-path-regex": "^0.1.2" } }, "is-utf8": { @@ -5580,20 +5581,20 @@ "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.11", - "js-yaml": "3.6.1", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.3.0", - "wordwrap": "1.0.0" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" }, "dependencies": { "async": { @@ -5606,11 +5607,11 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" } }, "esprima": { @@ -5628,11 +5629,11 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "requires": { - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "resolve": { @@ -5646,7 +5647,7 @@ "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, "supports-color": { @@ -5654,7 +5655,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } @@ -5664,10 +5665,10 @@ "resolved": "https://registry.npmjs.org/istanbul-middleware/-/istanbul-middleware-0.2.2.tgz", "integrity": "sha1-g8TBPBKOGg1qFHeSORrzwVqKuOA=", "requires": { - "archiver": "0.14.4", - "body-parser": "1.12.4", - "express": "4.16.3", - "istanbul": "0.4.5" + "archiver": "0.14.x", + "body-parser": "~1.12.3", + "express": "4.x", + "istanbul": "0.4.x" }, "dependencies": { "accepts": { @@ -5675,7 +5676,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "requires": { - "mime-types": "2.1.18", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -5684,14 +5685,14 @@ "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.14.4.tgz", "integrity": "sha1-W53bn17hzu8hy487Ag5iQOy0MVw=", "requires": { - "async": "0.9.2", - "buffer-crc32": "0.2.1", - "glob": "4.3.5", - "lazystream": "0.1.0", - "lodash": "3.2.0", - "readable-stream": "1.0.34", - "tar-stream": "1.1.5", - "zip-stream": "0.5.2" + "async": "~0.9.0", + "buffer-crc32": "~0.2.1", + "glob": "~4.3.0", + "lazystream": "~0.1.0", + "lodash": "~3.2.0", + "readable-stream": "~1.0.26", + "tar-stream": "~1.1.0", + "zip-stream": "~0.5.0" } }, "async": { @@ -5705,14 +5706,14 @@ "integrity": "sha1-CQcAxLoohiqFIO83g5X97l9hwik=", "requires": { "bytes": "1.0.0", - "content-type": "1.0.4", - "debug": "2.2.0", - "depd": "1.0.1", + "content-type": "~1.0.1", + "debug": "~2.2.0", + "depd": "~1.0.1", "iconv-lite": "0.4.8", - "on-finished": "2.2.1", + "on-finished": "~2.2.1", "qs": "2.4.2", - "raw-body": "2.0.2", - "type-is": "1.6.16" + "raw-body": "~2.0.1", + "type-is": "~1.6.2" } }, "bytes": { @@ -5748,36 +5749,36 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", - "content-type": "1.0.4", + "content-type": "~1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "1.1.2", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.3", + "proxy-addr": "~2.0.3", "qs": "6.5.1", - "range-parser": "1.2.0", + "range-parser": "~1.2.0", "safe-buffer": "5.1.1", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", - "statuses": "1.4.0", - "type-is": "1.6.16", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", - "vary": "1.1.2" + "vary": "~1.1.2" }, "dependencies": { "body-parser": { @@ -5786,15 +5787,15 @@ "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", + "depd": "~1.1.1", + "http-errors": "~1.6.2", "iconv-lite": "0.4.19", - "on-finished": "2.3.0", + "on-finished": "~2.3.0", "qs": "6.5.1", "raw-body": "2.3.2", - "type-is": "1.6.16" + "type-is": "~1.6.15" } }, "bytes": { @@ -5872,7 +5873,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": "1.4.0" + "statuses": ">= 1.3.1 < 2" } }, "setprototypeof": { @@ -5890,12 +5891,12 @@ "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.4.0", - "unpipe": "1.0.0" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" }, "dependencies": { "debug": { @@ -5936,10 +5937,10 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", "integrity": "sha1-gPuwjKVA8jiszl0R0em8QedRc9M=", "requires": { - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "2.0.10", - "once": "1.4.0" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^2.0.1", + "once": "^1.3.0" } }, "iconv-lite": { @@ -5977,7 +5978,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.0.0" } }, "ms": { @@ -6019,10 +6020,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "send": { @@ -6031,18 +6032,18 @@ "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "debug": { @@ -6098,9 +6099,9 @@ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.5.2.tgz", "integrity": "sha1-Mty8UG0Nq00hNyYlvX66rDwv/1Y=", "requires": { - "compress-commons": "0.2.9", - "lodash": "3.2.0", - "readable-stream": "1.0.34" + "compress-commons": "~0.2.0", + "lodash": "~3.2.0", + "readable-stream": "~1.0.26" } } } @@ -6110,8 +6111,8 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", "requires": { - "argparse": "1.0.10", - "esprima": "2.7.3" + "argparse": "^1.0.7", + "esprima": "^2.6.0" }, "dependencies": { "esprima": { @@ -6132,14 +6133,14 @@ "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "3.7.x", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" }, "dependencies": { "lodash": { @@ -6169,7 +6170,7 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "json-stringify-safe": { @@ -6187,7 +6188,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" }, "dependencies": { "graceful-fs": { @@ -6236,33 +6237,33 @@ "resolved": "https://registry.npmjs.org/karma/-/karma-1.7.1.tgz", "integrity": "sha512-k5pBjHDhmkdaUccnC7gE3mBzZjcxyxYsYVaqiL2G5AqlfLyBO5nw2VdNK+O16cveEPd/gIOWULH7gkiYYwVNHg==", "requires": { - "bluebird": "3.5.1", - "body-parser": "1.18.2", - "chokidar": "1.7.0", - "colors": "1.2.1", - "combine-lists": "1.0.1", - "connect": "3.6.6", - "core-js": "2.5.4", - "di": "0.0.1", - "dom-serialize": "2.2.1", - "expand-braces": "0.1.2", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "http-proxy": "1.16.2", - "isbinaryfile": "3.0.2", - "lodash": "3.10.1", - "log4js": "0.6.38", - "mime": "1.6.0", - "minimatch": "3.0.4", - "optimist": "0.6.1", - "qjobs": "1.2.0", - "range-parser": "1.2.0", - "rimraf": "2.6.2", - "safe-buffer": "5.1.1", + "bluebird": "^3.3.0", + "body-parser": "^1.16.1", + "chokidar": "^1.4.1", + "colors": "^1.1.0", + "combine-lists": "^1.0.0", + "connect": "^3.6.0", + "core-js": "^2.2.0", + "di": "^0.0.1", + "dom-serialize": "^2.2.0", + "expand-braces": "^0.1.1", + "glob": "^7.1.1", + "graceful-fs": "^4.1.2", + "http-proxy": "^1.13.0", + "isbinaryfile": "^3.0.0", + "lodash": "^3.8.0", + "log4js": "^0.6.31", + "mime": "^1.3.4", + "minimatch": "^3.0.2", + "optimist": "^0.6.1", + "qjobs": "^1.1.4", + "range-parser": "^1.2.0", + "rimraf": "^2.6.0", + "safe-buffer": "^5.0.1", "socket.io": "1.7.3", - "source-map": "0.5.7", + "source-map": "^0.5.3", "tmp": "0.0.31", - "useragent": "2.3.0" + "useragent": "^2.1.12" }, "dependencies": { "graceful-fs": { @@ -6287,7 +6288,7 @@ "resolved": "https://registry.npmjs.org/karma-detect-browsers/-/karma-detect-browsers-2.3.2.tgz", "integrity": "sha512-EFku2S5IpUEpJR2XxJa/onW6tIuapa3kYWJDD7Tk6LqhhIxfKWvJ+vnleLop6utXT28204hZptnfH7PGSmk4Nw==", "requires": { - "which": "1.3.0" + "which": "^1.2.4" } }, "karma-mocha": { @@ -6303,8 +6304,8 @@ "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", "integrity": "sha1-0jyjSAG9qYY60xjju0vUBisTrNI=", "requires": { - "lodash": "4.17.4", - "phantomjs-prebuilt": "2.1.16" + "lodash": "^4.0.1", + "phantomjs-prebuilt": "^2.1.7" } }, "kew": { @@ -6327,7 +6328,7 @@ "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" }, "dependencies": { "graceful-fs": { @@ -6343,9 +6344,9 @@ "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", "requires": { - "inherits": "2.0.1", - "isarray": "2.0.4", - "stream-splicer": "2.0.0" + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" }, "dependencies": { "isarray": { @@ -6365,7 +6366,7 @@ "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", "integrity": "sha1-GyXWPHcqTCDwpe0KnXf0hLbhaSA=", "requires": { - "readable-stream": "1.0.34" + "readable-stream": "~1.0.2" }, "dependencies": { "isarray": { @@ -6378,10 +6379,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -6401,8 +6402,8 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "lexical-scope": { @@ -6410,7 +6411,7 @@ "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", "requires": { - "astw": "2.2.0" + "astw": "^2.0.0" } }, "liftoff": { @@ -6418,14 +6419,14 @@ "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", "requires": { - "extend": "3.0.1", - "findup-sync": "2.0.0", - "fined": "1.1.0", - "flagged-respawn": "1.0.0", - "is-plain-object": "2.0.4", - "object.map": "1.0.1", - "rechoir": "0.6.2", - "resolve": "1.6.0" + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" } }, "load-json-file": { @@ -6433,11 +6434,11 @@ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" }, "dependencies": { "graceful-fs": { @@ -6450,7 +6451,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } } } @@ -6480,7 +6481,7 @@ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.4.tgz", "integrity": "sha1-TW0L1x/60NpLpPbYdtXusE4HSAs=", "requires": { - "wordwrap": "0.0.3" + "wordwrap": "~0.0.2" } }, "request": { @@ -6488,17 +6489,17 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.11.4.tgz", "integrity": "sha1-Y0fX1E5S3FiBCMwc5c7pdfyJJt4=", "requires": { - "form-data": "0.0.3", - "mime": "1.2.7" + "form-data": "~0.0.3", + "mime": "~1.2.7" }, "dependencies": { "form-data": { "version": "0.0.3", "bundled": true, "requires": { - "async": "0.1.9", + "async": "~0.1.9", "combined-stream": "0.0.3", - "mime": "1.2.7" + "mime": "~1.2.2" }, "dependencies": { "async": { @@ -6543,8 +6544,8 @@ "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" + "lodash._basecopy": "^3.0.0", + "lodash.keys": "^3.0.0" } }, "lodash._basecopy": { @@ -6612,7 +6613,7 @@ "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", "requires": { - "lodash._objecttypes": "2.4.1" + "lodash._objecttypes": "~2.4.1" } }, "lodash.assign": { @@ -6630,9 +6631,9 @@ "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", "requires": { - "lodash._baseassign": "3.2.0", - "lodash._basecreate": "3.0.3", - "lodash._isiterateecall": "3.0.9" + "lodash._baseassign": "^3.0.0", + "lodash._basecreate": "^3.0.0", + "lodash._isiterateecall": "^3.0.0" } }, "lodash.defaults": { @@ -6640,8 +6641,8 @@ "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", "integrity": "sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ=", "requires": { - "lodash._objecttypes": "2.4.1", - "lodash.keys": "2.4.1" + "lodash._objecttypes": "~2.4.1", + "lodash.keys": "~2.4.1" }, "dependencies": { "lodash.isobject": { @@ -6649,7 +6650,7 @@ "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", "requires": { - "lodash._objecttypes": "2.4.1" + "lodash._objecttypes": "~2.4.1" } }, "lodash.keys": { @@ -6657,9 +6658,9 @@ "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" + "lodash._isnative": "~2.4.1", + "lodash._shimkeys": "~2.4.1", + "lodash.isobject": "~2.4.1" } } } @@ -6669,7 +6670,7 @@ "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", "requires": { - "lodash._root": "3.0.1" + "lodash._root": "^3.0.0" } }, "lodash.isarguments": { @@ -6692,9 +6693,9 @@ "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" } }, "lodash.memoize": { @@ -6717,15 +6718,15 @@ "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" + "lodash._basecopy": "^3.0.0", + "lodash._basetostring": "^3.0.0", + "lodash._basevalues": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash._reinterpolate": "^3.0.0", + "lodash.escape": "^3.0.0", + "lodash.keys": "^3.0.0", + "lodash.restparam": "^3.0.0", + "lodash.templatesettings": "^3.0.0" } }, "lodash.templatesettings": { @@ -6733,8 +6734,8 @@ "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" + "lodash._reinterpolate": "^3.0.0", + "lodash.escape": "^3.0.0" } }, "log-driver": { @@ -6747,8 +6748,8 @@ "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", "requires": { - "readable-stream": "1.0.34", - "semver": "4.3.6" + "readable-stream": "~1.0.2", + "semver": "~4.3.3" }, "dependencies": { "isarray": { @@ -6761,10 +6762,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -6789,8 +6790,8 @@ "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" } }, "lru-cache": { @@ -6803,7 +6804,7 @@ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", "requires": { - "vlq": "0.2.3" + "vlq": "^0.2.2" } }, "make-error": { @@ -6816,7 +6817,7 @@ "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", "requires": { - "make-error": "1.3.4" + "make-error": "^1.2.0" } }, "make-iterator": { @@ -6824,7 +6825,7 @@ "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.0.tgz", "integrity": "sha1-V7713IXSOSO6I3ZzJNjo+PPZaUs=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.1.0" }, "dependencies": { "kind-of": { @@ -6832,7 +6833,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -6852,7 +6853,7 @@ "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "md5.js": { @@ -6860,8 +6861,8 @@ "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.1" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" }, "dependencies": { "hash-base": { @@ -6869,8 +6870,8 @@ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "requires": { - "inherits": "2.0.1", - "safe-buffer": "5.1.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } } } @@ -6885,16 +6886,16 @@ "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" }, "dependencies": { "object-assign": { @@ -6914,7 +6915,7 @@ "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" }, "dependencies": { "source-map": { @@ -6934,19 +6935,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.1", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "miller-rabin": { @@ -6954,8 +6955,8 @@ "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, "mime": { @@ -6973,7 +6974,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "requires": { - "mime-db": "1.33.0" + "mime-db": "~1.33.0" } }, "minimalistic-assert": { @@ -6991,7 +6992,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -7004,8 +7005,8 @@ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -7013,7 +7014,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -7057,7 +7058,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", "requires": { - "graceful-readlink": "1.0.1" + "graceful-readlink": ">= 1.0.0" } }, "debug": { @@ -7073,12 +7074,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "supports-color": { @@ -7086,7 +7087,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } @@ -7096,21 +7097,21 @@ "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", "requires": { - "JSONStream": "1.3.2", - "browser-resolve": "1.11.2", - "cached-path-relative": "1.0.1", - "concat-stream": "1.5.2", - "defined": "1.0.0", - "detective": "4.7.1", - "duplexer2": "0.1.4", - "inherits": "2.0.1", - "parents": "1.0.1", - "readable-stream": "2.3.6", - "resolve": "1.6.0", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.5.0", + "defined": "^1.0.0", + "detective": "^4.0.0", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.3", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" }, "dependencies": { "concat-stream": { @@ -7118,9 +7119,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "requires": { - "inherits": "2.0.1", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" }, "dependencies": { "readable-stream": { @@ -7128,12 +7129,12 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" } } } @@ -7160,8 +7161,8 @@ "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-2.2.0.tgz", "integrity": "sha1-pWfCrwAK0i3I8qZT2Rl4rh9TFvQ=", "requires": { - "readable-stream": "1.1.14", - "stream-counter": "0.2.0" + "readable-stream": "~1.1.9", + "stream-counter": "~0.2.0" }, "dependencies": { "isarray": { @@ -7174,10 +7175,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -7200,7 +7201,7 @@ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.9" } }, "isarray": { @@ -7213,10 +7214,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -7242,18 +7243,18 @@ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" } }, "natives": { @@ -7286,7 +7287,7 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "requires": { - "abbrev": "1.0.9" + "abbrev": "1" } }, "normalize-package-data": { @@ -7294,10 +7295,10 @@ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "4.3.6", - "validate-npm-package-license": "3.0.3" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -7305,7 +7306,7 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "npm-run-path": { @@ -7313,7 +7314,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -7341,9 +7342,9 @@ "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -7351,7 +7352,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "is-accessor-descriptor": { @@ -7359,7 +7360,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-data-descriptor": { @@ -7367,7 +7368,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-descriptor": { @@ -7375,9 +7376,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -7392,7 +7393,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7412,7 +7413,7 @@ "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" } }, "object.defaults": { @@ -7420,10 +7421,10 @@ "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", "requires": { - "array-each": "1.0.1", - "array-slice": "1.1.0", - "for-own": "1.0.0", - "isobject": "3.0.1" + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" } }, "object.map": { @@ -7431,8 +7432,8 @@ "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", "requires": { - "for-own": "1.0.0", - "make-iterator": "1.0.0" + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" } }, "object.omit": { @@ -7440,8 +7441,8 @@ "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" }, "dependencies": { "for-own": { @@ -7449,7 +7450,7 @@ "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } } } @@ -7459,7 +7460,7 @@ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "on-finished": { @@ -7480,7 +7481,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -7498,8 +7499,8 @@ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "minimist": { @@ -7519,12 +7520,12 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "options": { @@ -7537,9 +7538,9 @@ "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", "requires": { - "end-of-stream": "0.1.5", - "sequencify": "0.0.7", - "stream-consume": "0.1.1" + "end-of-stream": "~0.1.5", + "sequencify": "~0.0.7", + "stream-consume": "~0.1.0" } }, "ordered-read-streams": { @@ -7572,7 +7573,7 @@ "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", "requires": { - "shell-quote": "1.6.1" + "shell-quote": "^1.4.2" } }, "p-finally": { @@ -7590,7 +7591,7 @@ "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "requires": { - "path-platform": "0.11.15" + "path-platform": "~0.11.15" } }, "parse-asn1": { @@ -7598,11 +7599,11 @@ "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.2.0", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.14" + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" } }, "parse-filepath": { @@ -7610,9 +7611,9 @@ "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", "requires": { - "is-absolute": "1.0.0", - "map-cache": "0.2.2", - "path-root": "0.1.1" + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" } }, "parse-glob": { @@ -7620,10 +7621,10 @@ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" }, "dependencies": { "is-extglob": { @@ -7636,7 +7637,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -7646,7 +7647,7 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "parse-passwd": { @@ -7659,7 +7660,7 @@ "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseqs": { @@ -7667,7 +7668,7 @@ "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseuri": { @@ -7675,7 +7676,7 @@ "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseurl": { @@ -7698,7 +7699,7 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { @@ -7731,7 +7732,7 @@ "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "requires": { - "path-root-regex": "0.1.2" + "path-root-regex": "^0.1.0" } }, "path-root-regex": { @@ -7749,9 +7750,9 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "graceful-fs": { @@ -7771,11 +7772,11 @@ "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", "requires": { - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.11" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "pend": { @@ -7793,15 +7794,15 @@ "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", "requires": { - "es6-promise": "4.2.4", - "extract-zip": "1.6.6", - "fs-extra": "1.0.0", - "hasha": "2.2.0", - "kew": "0.7.0", - "progress": "1.1.8", - "request": "2.85.0", - "request-progress": "2.0.1", - "which": "1.3.0" + "es6-promise": "^4.0.3", + "extract-zip": "^1.6.5", + "fs-extra": "^1.0.0", + "hasha": "^2.2.0", + "kew": "^0.7.0", + "progress": "^1.1.8", + "request": "^2.81.0", + "request-progress": "^2.0.1", + "which": "^1.2.10" }, "dependencies": { "assert-plus": { @@ -7819,7 +7820,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "caseless": { @@ -7832,7 +7833,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", "requires": { - "boom": "5.2.0" + "boom": "5.x.x" }, "dependencies": { "boom": { @@ -7840,7 +7841,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } } } @@ -7850,9 +7851,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "mime-types": "^2.1.12" } }, "har-validator": { @@ -7860,8 +7861,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" } }, "hawk": { @@ -7869,10 +7870,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" + "boom": "4.x.x", + "cryptiles": "3.x.x", + "hoek": "4.x.x", + "sntp": "2.x.x" } }, "hoek": { @@ -7885,9 +7886,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "qs": { @@ -7900,28 +7901,28 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "hawk": "~6.0.2", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "stringstream": "~0.0.5", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" } }, "sntp": { @@ -7929,7 +7930,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "tunnel-agent": { @@ -7937,7 +7938,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } } } @@ -7957,7 +7958,7 @@ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "plato": { @@ -7965,12 +7966,12 @@ "resolved": "https://registry.npmjs.org/plato/-/plato-1.7.0.tgz", "integrity": "sha1-mQCltJEKoZDeCKRbrmF1M0/WRqc=", "requires": { - "eslint": "3.0.1", - "fs-extra": "0.30.0", - "glob": "7.0.6", - "jshint": "2.9.5", - "lodash": "4.13.1", - "posix-getopt": "1.2.0", + "eslint": "~3.0.1", + "fs-extra": "~0.30.0", + "glob": "~7.0.5", + "jshint": "~2.9.2", + "lodash": "~4.13.1", + "posix-getopt": "~1.2.0", "typhonjs-escomplex": "0.0.9" }, "dependencies": { @@ -7979,11 +7980,11 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" } }, "glob": { @@ -7991,12 +7992,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "graceful-fs": { @@ -8016,11 +8017,11 @@ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", "requires": { - "ansi-cyan": "0.1.1", - "ansi-red": "0.1.1", - "arr-diff": "1.1.0", - "arr-union": "2.1.0", - "extend-shallow": "1.1.4" + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" }, "dependencies": { "arr-diff": { @@ -8028,8 +8029,8 @@ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", "requires": { - "arr-flatten": "1.1.0", - "array-slice": "0.2.3" + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" } }, "arr-union": { @@ -8047,7 +8048,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", "requires": { - "kind-of": "1.1.0" + "kind-of": "^1.1.0" } }, "kind-of": { @@ -8062,8 +8063,8 @@ "resolved": "https://registry.npmjs.org/plugin-log/-/plugin-log-0.1.0.tgz", "integrity": "sha1-hgSc9qsQgzOYqTHzaJy67nteEzM=", "requires": { - "chalk": "1.1.3", - "dateformat": "1.0.12" + "chalk": "^1.1.1", + "dateformat": "^1.0.11" }, "dependencies": { "dateformat": { @@ -8071,8 +8072,8 @@ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" + "get-stdin": "^4.0.1", + "meow": "^3.3.0" } } } @@ -8127,7 +8128,7 @@ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", "requires": { - "forwarded": "0.1.2", + "forwarded": "~0.1.2", "ipaddr.js": "1.6.0" } }, @@ -8141,11 +8142,11 @@ "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "parse-asn1": "5.1.0", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" } }, "punycode": { @@ -8184,8 +8185,8 @@ "integrity": "sha1-hJY/jJwmuULhU/7rU6rnRlK34LI=", "requires": { "buffer-equal": "0.0.1", - "minimist": "1.2.0", - "through2": "2.0.3" + "minimist": "^1.1.3", + "through2": "^2.0.0" } }, "randomatic": { @@ -8193,8 +8194,8 @@ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -8202,7 +8203,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -8212,7 +8213,7 @@ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.1.0" } }, "randomfill": { @@ -8220,8 +8221,8 @@ "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.1" + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" } }, "range-parser": { @@ -8253,7 +8254,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": "1.5.0" + "statuses": ">= 1.3.1 < 2" } }, "inherits": { @@ -8273,7 +8274,7 @@ "resolved": "https://registry.npmjs.org/rcfinder/-/rcfinder-0.1.9.tgz", "integrity": "sha1-8+gPOH3fmugK4wpBADKWQuroERU=", "requires": { - "lodash.clonedeep": "4.5.0" + "lodash.clonedeep": "^4.3.2" } }, "rcloader": { @@ -8281,10 +8282,10 @@ "resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.2.2.tgz", "integrity": "sha1-WNIpi0YtC5v9ITPSoex0+9cFxxc=", "requires": { - "lodash.assign": "4.2.0", - "lodash.isobject": "3.0.2", - "lodash.merge": "4.6.1", - "rcfinder": "0.1.9" + "lodash.assign": "^4.2.0", + "lodash.isobject": "^3.0.2", + "lodash.merge": "^4.6.0", + "rcfinder": "^0.1.6" } }, "read-only-stream": { @@ -8292,7 +8293,7 @@ "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } }, "read-pkg": { @@ -8300,9 +8301,9 @@ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -8310,8 +8311,8 @@ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "readable-stream": { @@ -8319,13 +8320,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, "dependencies": { "inherits": { @@ -8340,10 +8341,10 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.3.6", - "set-immediate-shim": "1.0.1" + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" }, "dependencies": { "graceful-fs": { @@ -8358,8 +8359,8 @@ "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", "mute-stream": "0.0.5" } }, @@ -8368,7 +8369,7 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "1.6.0" + "resolve": "^1.1.6" } }, "redent": { @@ -8376,8 +8377,8 @@ "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" } }, "reduce-component": { @@ -8390,7 +8391,7 @@ "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "regex-not": { @@ -8398,8 +8399,8 @@ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "remove-trailing-separator": { @@ -8422,7 +8423,7 @@ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "replace-ext": { @@ -8435,26 +8436,26 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.11.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "2.0.6", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "qs": "6.3.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.4.3", - "uuid": "3.2.1" + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.11.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~2.0.6", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "qs": "~6.3.0", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "~0.4.1", + "uuid": "^3.0.0" } }, "request-progress": { @@ -8462,7 +8463,7 @@ "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", "requires": { - "throttleit": "1.0.0" + "throttleit": "^1.0.0" } }, "require-dir": { @@ -8475,8 +8476,8 @@ "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "requires": { - "caller-path": "0.1.0", - "resolve-from": "1.0.1" + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" } }, "requires-port": { @@ -8489,7 +8490,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "resolve-dir": { @@ -8497,8 +8498,8 @@ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "requires": { - "expand-tilde": "2.0.2", - "global-modules": "1.0.0" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, "resolve-from": { @@ -8516,8 +8517,8 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" } }, "ret": { @@ -8530,7 +8531,7 @@ "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { @@ -8538,7 +8539,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "ripemd160": { @@ -8546,8 +8547,8 @@ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", "requires": { - "hash-base": "2.0.2", - "inherits": "2.0.1" + "hash-base": "^2.0.0", + "inherits": "^2.0.1" } }, "run-async": { @@ -8555,7 +8556,7 @@ "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", "requires": { - "once": "1.4.0" + "once": "^1.3.0" } }, "run-sequence": { @@ -8563,8 +8564,8 @@ "resolved": "https://registry.npmjs.org/run-sequence/-/run-sequence-1.2.2.tgz", "integrity": "sha1-UJWgvr6YczsBQL0I3YDsAw3azes=", "requires": { - "chalk": "1.1.3", - "gulp-util": "3.0.8" + "chalk": "*", + "gulp-util": "*" } }, "runnel": { @@ -8587,7 +8588,7 @@ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "samsam": { @@ -8610,9 +8611,9 @@ "resolved": "https://registry.npmjs.org/send/-/send-0.1.4.tgz", "integrity": "sha1-vnDY0b4B3mGCGvE3gLUDRaT3Gr0=", "requires": { - "debug": "2.6.9", + "debug": "*", "fresh": "0.2.0", - "mime": "1.2.11", + "mime": "~1.2.9", "range-parser": "0.0.4" }, "dependencies": { @@ -8643,9 +8644,9 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", "send": "0.16.2" }, "dependencies": { @@ -8665,18 +8666,18 @@ "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" } }, "statuses": { @@ -8696,10 +8697,10 @@ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -8707,7 +8708,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -8722,8 +8723,8 @@ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "requires": { - "inherits": "2.0.1", - "safe-buffer": "5.1.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "shallow-copy": { @@ -8736,8 +8737,8 @@ "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "requires": { - "json-stable-stringify": "0.0.1", - "sha.js": "2.4.11" + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" } }, "shebang-command": { @@ -8745,7 +8746,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -8758,10 +8759,10 @@ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" } }, "shelljs": { @@ -8787,7 +8788,7 @@ "formatio": "1.1.1", "lolex": "1.3.2", "samsam": "1.1.2", - "util": "0.10.3" + "util": ">=0.10.3 <1" } }, "slice-ansi": { @@ -8800,14 +8801,14 @@ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { "define-property": { @@ -8815,7 +8816,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -8823,7 +8824,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -8831,7 +8832,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -8839,7 +8840,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -8849,7 +8850,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -8857,7 +8858,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -8867,9 +8868,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { @@ -8889,9 +8890,9 @@ "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -8899,7 +8900,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } } } @@ -8909,7 +8910,7 @@ "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" }, "dependencies": { "kind-of": { @@ -8917,7 +8918,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -8927,7 +8928,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "socket.io": { @@ -9073,11 +9074,11 @@ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", "requires": { - "atob": "2.1.0", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.0.0", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-url": { @@ -9095,8 +9096,8 @@ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -9109,8 +9110,8 @@ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -9123,7 +9124,7 @@ "resolved": "https://registry.npmjs.org/split/-/split-0.1.2.tgz", "integrity": "sha1-8HEHRMRT1VH8cUPq2YPaYBTjNsw=", "requires": { - "through": "1.1.2" + "through": "1" }, "dependencies": { "through": { @@ -9138,7 +9139,7 @@ "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "sprintf-js": { @@ -9151,14 +9152,14 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" }, "dependencies": { "assert-plus": { @@ -9174,9 +9175,9 @@ "integrity": "sha1-eJApBUk3t9R8G1tnYSy7Hnz+cHE=", "requires": { "array-map": "0.0.0", - "foreach-shim": "0.1.1", + "foreach-shim": "~0.1.1", "isarray": "0.0.1", - "source-map-cjs": "0.1.32" + "source-map-cjs": "~0.1.31" }, "dependencies": { "isarray": { @@ -9195,7 +9196,7 @@ "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.0.tgz", "integrity": "sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw==", "requires": { - "escodegen": "1.9.1" + "escodegen": "^1.8.1" } }, "static-extend": { @@ -9203,8 +9204,8 @@ "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -9212,7 +9213,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "is-accessor-descriptor": { @@ -9220,7 +9221,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -9228,7 +9229,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -9238,7 +9239,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -9246,7 +9247,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -9256,9 +9257,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { @@ -9273,20 +9274,20 @@ "resolved": "https://registry.npmjs.org/static-module/-/static-module-2.2.3.tgz", "integrity": "sha512-OdNOIoJGjYH2OW9KZoGg4RfiBmtKkGijUFTH8w9oCRe8Q+CfVUuY/nlPZmqdsCFWMz2Ho0euzaJA/a6pUpCmZA==", "requires": { - "concat-stream": "1.6.2", - "convert-source-map": "1.5.1", - "duplexer2": "0.1.4", - "escodegen": "1.9.1", - "falafel": "2.1.0", - "has": "1.0.1", - "magic-string": "0.22.5", + "concat-stream": "~1.6.0", + "convert-source-map": "^1.5.1", + "duplexer2": "~0.1.4", + "escodegen": "~1.9.0", + "falafel": "^2.1.0", + "has": "^1.0.1", + "magic-string": "^0.22.4", "merge-source-map": "1.0.4", - "object-inspect": "1.4.1", - "quote-stream": "1.0.2", - "readable-stream": "2.3.6", - "shallow-copy": "0.0.1", - "static-eval": "2.0.0", - "through2": "2.0.3" + "object-inspect": "~1.4.0", + "quote-stream": "~1.0.2", + "readable-stream": "~2.3.3", + "shallow-copy": "~0.0.1", + "static-eval": "^2.0.0", + "through2": "~2.0.3" } }, "statuses": { @@ -9299,8 +9300,8 @@ "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "requires": { - "inherits": "2.0.1", - "readable-stream": "2.3.6" + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" } }, "stream-combiner2": { @@ -9308,8 +9309,8 @@ "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "requires": { - "duplexer2": "0.1.4", - "readable-stream": "2.3.6" + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" } }, "stream-consume": { @@ -9322,7 +9323,7 @@ "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz", "integrity": "sha1-3tJmVWMZyLDiIoErnPOyb6fZR94=", "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.8" }, "dependencies": { "isarray": { @@ -9335,10 +9336,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -9353,11 +9354,11 @@ "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz", "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==", "requires": { - "builtin-status-codes": "3.0.0", - "inherits": "2.0.1", - "readable-stream": "2.3.6", - "to-arraybuffer": "1.0.1", - "xtend": "4.0.1" + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.3", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" } }, "stream-splicer": { @@ -9365,8 +9366,8 @@ "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", "requires": { - "inherits": "2.0.1", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" } }, "string-width": { @@ -9374,9 +9375,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -9384,7 +9385,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "stringstream": { @@ -9397,7 +9398,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -9405,8 +9406,8 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", "requires": { - "first-chunk-stream": "1.0.0", - "is-utf8": "0.2.1" + "first-chunk-stream": "^1.0.0", + "is-utf8": "^0.2.0" } }, "strip-bom-buf": { @@ -9414,7 +9415,7 @@ "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.1" } }, "strip-bom-stream": { @@ -9422,8 +9423,8 @@ "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-3.0.0.tgz", "integrity": "sha1-lWvMXYRDD2klapDtgjdlzYWOFZw=", "requires": { - "first-chunk-stream": "2.0.0", - "strip-bom-buf": "1.0.0" + "first-chunk-stream": "^2.0.0", + "strip-bom-buf": "^1.0.0" }, "dependencies": { "first-chunk-stream": { @@ -9431,7 +9432,7 @@ "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } } } @@ -9446,7 +9447,7 @@ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "requires": { - "get-stdin": "4.0.1" + "get-stdin": "^4.0.1" } }, "strip-json-comments": { @@ -9459,7 +9460,7 @@ "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "requires": { - "minimist": "1.2.0" + "minimist": "^1.1.0" } }, "superagent": { @@ -9468,7 +9469,7 @@ "integrity": "sha1-CVxwuK//vAcvFFjzloTUhU1jM6M=", "requires": { "cookiejar": "1.3.0", - "debug": "0.7.4", + "debug": "~0.7.2", "emitter-component": "1.0.0", "formidable": "1.0.14", "methods": "0.0.1", @@ -9509,7 +9510,7 @@ "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", "requires": { - "acorn-node": "1.3.0" + "acorn-node": "^1.2.0" } }, "table": { @@ -9517,12 +9518,12 @@ "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", - "lodash": "4.17.4", + "ajv": "^4.7.0", + "ajv-keywords": "^1.0.0", + "chalk": "^1.1.1", + "lodash": "^4.0.0", "slice-ansi": "0.0.4", - "string-width": "2.1.1" + "string-width": "^2.0.0" }, "dependencies": { "ajv": { @@ -9530,8 +9531,8 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" } }, "ansi-regex": { @@ -9549,7 +9550,7 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "string-width": { @@ -9557,8 +9558,8 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -9566,7 +9567,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -9576,8 +9577,8 @@ "resolved": "https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz", "integrity": "sha1-CLW1Q/3ASDApDGxWEnlVLnHEvWc=", "requires": { - "tap-parser": "0.2.1", - "through": "2.3.8" + "tap-parser": "~0.2.0", + "through": "~2.3.4" }, "dependencies": { "tap-parser": { @@ -9585,7 +9586,7 @@ "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.2.1.tgz", "integrity": "sha1-jh6CPyEU7iHQMuLzHk+2QqKW9Qs=", "requires": { - "split": "0.1.2" + "split": "~0.1.2" } } } @@ -9595,9 +9596,9 @@ "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.7.0.tgz", "integrity": "sha1-coph1kaApbSNXb2dvQpNSPXDW8s=", "requires": { - "inherits": "2.0.1", - "minimist": "0.2.0", - "readable-stream": "1.1.14" + "inherits": "~2.0.1", + "minimist": "^0.2.0", + "readable-stream": "~1.1.11" }, "dependencies": { "isarray": { @@ -9615,10 +9616,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -9633,10 +9634,10 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.1.5.tgz", "integrity": "sha1-vpIYwTDCACnhB7D5Z/sj3gV50Tw=", "requires": { - "bl": "0.9.5", - "end-of-stream": "1.4.1", - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "bl": "^0.9.0", + "end-of-stream": "^1.0.0", + "readable-stream": "~1.0.33", + "xtend": "^4.0.0" }, "dependencies": { "end-of-stream": { @@ -9644,7 +9645,7 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "isarray": { @@ -9657,10 +9658,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -9690,8 +9691,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "tildify": { @@ -9699,7 +9700,7 @@ "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", "requires": { - "os-homedir": "1.0.2" + "os-homedir": "^1.0.0" } }, "time-stamp": { @@ -9712,7 +9713,7 @@ "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", "requires": { - "process": "0.11.10" + "process": "~0.11.0" } }, "tmp": { @@ -9720,7 +9721,7 @@ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.1" } }, "to-array": { @@ -9738,7 +9739,7 @@ "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -9746,7 +9747,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -9756,10 +9757,10 @@ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -9767,8 +9768,8 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tough-cookie": { @@ -9776,7 +9777,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "trim-newlines": { @@ -9805,7 +9806,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -9819,7 +9820,7 @@ "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.18" + "mime-types": "~2.1.18" } }, "typedarray": { @@ -9837,10 +9838,10 @@ "resolved": "https://registry.npmjs.org/typhonjs-escomplex/-/typhonjs-escomplex-0.0.9.tgz", "integrity": "sha1-1Phd0oOOeiioVNnyVhbLxyo/Dg8=", "requires": { - "babylon": "6.18.0", - "commander": "2.15.1", - "typhonjs-escomplex-module": "0.0.9", - "typhonjs-escomplex-project": "0.0.9" + "babylon": "^6.0.0", + "commander": "^2.0.0", + "typhonjs-escomplex-module": "^0.0.9", + "typhonjs-escomplex-project": "^0.0.9" } }, "typhonjs-escomplex-commons": { @@ -9853,11 +9854,11 @@ "resolved": "https://registry.npmjs.org/typhonjs-escomplex-module/-/typhonjs-escomplex-module-0.0.9.tgz", "integrity": "sha1-31vDYLJg/zbi1pvFu0O3PvPzNlw=", "requires": { - "escomplex-plugin-metrics-module": "0.0.10", - "escomplex-plugin-syntax-babylon": "0.0.10", - "typhonjs-ast-walker": "0.1.1", - "typhonjs-escomplex-commons": "0.0.14", - "typhonjs-plugin-manager": "0.0.3" + "escomplex-plugin-metrics-module": "^0.0.10", + "escomplex-plugin-syntax-babylon": "^0.0.10", + "typhonjs-ast-walker": "^0.1.0", + "typhonjs-escomplex-commons": "^0.0.14", + "typhonjs-plugin-manager": "^0.0.3" } }, "typhonjs-escomplex-project": { @@ -9865,10 +9866,10 @@ "resolved": "https://registry.npmjs.org/typhonjs-escomplex-project/-/typhonjs-escomplex-project-0.0.9.tgz", "integrity": "sha1-C6bwzDq6hiwjqXGpCa6rQR6+G/Q=", "requires": { - "escomplex-plugin-metrics-project": "0.0.10", - "typhonjs-escomplex-commons": "0.0.14", - "typhonjs-escomplex-module": "0.0.9", - "typhonjs-plugin-manager": "0.0.3" + "escomplex-plugin-metrics-project": "^0.0.10", + "typhonjs-escomplex-commons": "^0.0.14", + "typhonjs-escomplex-module": "^0.0.9", + "typhonjs-plugin-manager": "^0.0.3" } }, "typhonjs-plugin-manager": { @@ -9881,9 +9882,9 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "source-map": { @@ -9939,10 +9940,10 @@ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -9950,7 +9951,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -9958,10 +9959,10 @@ "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -9981,8 +9982,8 @@ "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -9990,9 +9991,9 @@ "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -10038,7 +10039,7 @@ "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.2" } }, "user-home": { @@ -10051,8 +10052,8 @@ "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", "requires": { - "lru-cache": "4.1.2", - "tmp": "0.0.31" + "lru-cache": "4.1.x", + "tmp": "0.0.x" }, "dependencies": { "lru-cache": { @@ -10060,8 +10061,8 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } } } @@ -10094,7 +10095,7 @@ "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", "requires": { - "user-home": "1.1.1" + "user-home": "^1.1.1" } }, "validate-npm-package-license": { @@ -10102,8 +10103,8 @@ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "vargs": { @@ -10121,9 +10122,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" }, "dependencies": { "assert-plus": { @@ -10138,8 +10139,8 @@ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", "requires": { - "clone": "1.0.4", - "clone-stats": "0.0.1", + "clone": "^1.0.0", + "clone-stats": "^0.0.1", "replace-ext": "0.0.1" } }, @@ -10148,14 +10149,14 @@ "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", "requires": { - "defaults": "1.0.3", - "glob-stream": "3.1.18", - "glob-watcher": "0.0.6", - "graceful-fs": "3.0.11", - "mkdirp": "0.5.1", - "strip-bom": "1.0.0", - "through2": "0.6.5", - "vinyl": "0.4.6" + "defaults": "^1.0.0", + "glob-stream": "^3.1.5", + "glob-watcher": "^0.0.6", + "graceful-fs": "^3.0.0", + "mkdirp": "^0.5.0", + "strip-bom": "^1.0.0", + "through2": "^0.6.1", + "vinyl": "^0.4.0" }, "dependencies": { "clone": { @@ -10173,10 +10174,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -10189,8 +10190,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } }, "vinyl": { @@ -10198,8 +10199,8 @@ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" + "clone": "^0.2.0", + "clone-stats": "^0.0.1" } } } @@ -10209,7 +10210,7 @@ "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.1" }, "dependencies": { "source-map": { @@ -10242,7 +10243,7 @@ "resolved": "https://registry.npmjs.org/walk/-/walk-2.2.1.tgz", "integrity": "sha1-WtofjknkfUt0Rdi+ei4eYxq0MBY=", "requires": { - "forEachAsync": "2.2.1" + "forEachAsync": "~2.2" } }, "watchify": { @@ -10250,13 +10251,13 @@ "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.7.0.tgz", "integrity": "sha1-7i8sXIw3MSMD+Zi4GLKzRQ7v5kg=", "requires": { - "anymatch": "1.3.2", - "browserify": "13.3.0", - "chokidar": "1.7.0", - "defined": "1.0.0", - "outpipe": "1.1.1", - "through2": "2.0.3", - "xtend": "4.0.1" + "anymatch": "^1.3.0", + "browserify": "^13.0.0", + "chokidar": "^1.0.0", + "defined": "^1.0.0", + "outpipe": "^1.1.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" } }, "wd": { @@ -10264,13 +10265,13 @@ "resolved": "https://registry.npmjs.org/wd/-/wd-0.3.11.tgz", "integrity": "sha1-UicWx5p6EOeBrLssbK/liPcB/MA=", "requires": { - "archiver": "0.12.0", - "async": "0.9.2", - "lodash": "2.4.2", - "q": "1.0.1", - "request": "2.46.0", - "underscore.string": "2.3.3", - "vargs": "0.1.0" + "archiver": "~0.12.0", + "async": "~0.9.0", + "lodash": "~2.4.1", + "q": "~1.0.1", + "request": "~2.46.0", + "underscore.string": "~2.3.3", + "vargs": "~0.1.0" }, "dependencies": { "archiver": { @@ -10278,14 +10279,14 @@ "resolved": "https://registry.npmjs.org/archiver/-/archiver-0.12.0.tgz", "integrity": "sha1-uMzeJQjKuQkrtxBmMBOcDzmigMw=", "requires": { - "async": "0.9.2", - "buffer-crc32": "0.2.1", - "glob": "4.0.6", - "lazystream": "0.1.0", - "lodash": "2.4.2", - "readable-stream": "1.0.34", - "tar-stream": "1.0.2", - "zip-stream": "0.4.1" + "async": "~0.9.0", + "buffer-crc32": "~0.2.1", + "glob": "~4.0.6", + "lazystream": "~0.1.0", + "lodash": "~2.4.1", + "readable-stream": "~1.0.26", + "tar-stream": "~1.0.0", + "zip-stream": "~0.4.0" } }, "asn1": { @@ -10313,7 +10314,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", "requires": { - "hoek": "0.9.1" + "hoek": "0.9.x" } }, "caseless": { @@ -10334,9 +10335,9 @@ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.1.6.tgz", "integrity": "sha1-DHQIcP3ljLpRbwrAyCLjOguF36M=", "requires": { - "buffer-crc32": "0.2.1", - "crc32-stream": "0.3.4", - "readable-stream": "1.0.34" + "buffer-crc32": "~0.2.1", + "crc32-stream": "~0.3.1", + "readable-stream": "~1.0.26" } }, "cryptiles": { @@ -10344,7 +10345,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", "requires": { - "boom": "0.4.2" + "boom": "0.4.x" } }, "delayed-stream": { @@ -10357,7 +10358,7 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "forever-agent": { @@ -10370,9 +10371,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", "requires": { - "async": "0.9.2", - "combined-stream": "0.0.7", - "mime": "1.2.11" + "async": "~0.9.0", + "combined-stream": "~0.0.4", + "mime": "~1.2.11" } }, "glob": { @@ -10380,10 +10381,10 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", "integrity": "sha1-aVxQvdTi+1xdNwsJHziNNwfikac=", "requires": { - "graceful-fs": "3.0.11", - "inherits": "2.0.1", - "minimatch": "1.0.0", - "once": "1.4.0" + "graceful-fs": "^3.0.2", + "inherits": "2", + "minimatch": "^1.0.0", + "once": "^1.3.0" } }, "hawk": { @@ -10391,10 +10392,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", "integrity": "sha1-h81JH5tG5OKurKM1QWdmiF0tHtk=", "requires": { - "boom": "0.4.2", - "cryptiles": "0.2.2", - "hoek": "0.9.1", - "sntp": "0.2.4" + "boom": "0.4.x", + "cryptiles": "0.2.x", + "hoek": "0.9.x", + "sntp": "0.2.x" } }, "hoek": { @@ -10408,7 +10409,7 @@ "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", "requires": { "asn1": "0.1.11", - "assert-plus": "0.1.5", + "assert-plus": "^0.1.5", "ctype": "0.5.3" } }, @@ -10437,8 +10438,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "node-uuid": { @@ -10461,10 +10462,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "request": { @@ -10472,21 +10473,21 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.46.0.tgz", "integrity": "sha1-NZGV1S6vcgvGl0JXnQStbSZagnQ=", "requires": { - "aws-sign2": "0.5.0", - "bl": "0.9.5", - "caseless": "0.6.0", - "forever-agent": "0.5.2", - "form-data": "0.1.4", + "aws-sign2": "~0.5.0", + "bl": "~0.9.0", + "caseless": "~0.6.0", + "forever-agent": "~0.5.0", + "form-data": "~0.1.0", "hawk": "1.1.1", - "http-signature": "0.10.1", - "json-stringify-safe": "5.0.1", - "mime-types": "1.0.2", - "node-uuid": "1.4.8", - "oauth-sign": "0.4.0", - "qs": "1.2.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.4.3" + "http-signature": "~0.10.0", + "json-stringify-safe": "~5.0.0", + "mime-types": "~1.0.1", + "node-uuid": "~1.4.0", + "oauth-sign": "~0.4.0", + "qs": "~1.2.0", + "stringstream": "~0.0.4", + "tough-cookie": ">=0.12.0", + "tunnel-agent": "~0.4.0" } }, "sntp": { @@ -10494,7 +10495,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", "requires": { - "hoek": "0.9.1" + "hoek": "0.9.x" } }, "string_decoder": { @@ -10507,10 +10508,10 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.0.2.tgz", "integrity": "sha1-/Rm0oXkA+nBPahM+MEWurQViq5U=", "requires": { - "bl": "0.9.5", - "end-of-stream": "1.4.1", - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "bl": "^0.9.0", + "end-of-stream": "^1.0.0", + "readable-stream": "^1.0.27-1", + "xtend": "^4.0.0" } }, "zip-stream": { @@ -10518,9 +10519,9 @@ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.4.1.tgz", "integrity": "sha1-TqeVqM4Z6fq0mjHR0IdyFBWfA6M=", "requires": { - "compress-commons": "0.1.6", - "lodash": "2.4.2", - "readable-stream": "1.0.34" + "compress-commons": "~0.1.0", + "lodash": "~2.4.1", + "readable-stream": "~1.0.26" } } } @@ -10530,7 +10531,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "window-size": { @@ -10558,7 +10559,7 @@ "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "requires": { - "mkdirp": "0.5.1" + "mkdirp": "^0.5.1" } }, "ws": { @@ -10566,8 +10567,8 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", "requires": { - "options": "0.0.6", - "ultron": "1.0.2" + "options": ">=0.0.5", + "ultron": "1.0.x" } }, "wtf-8": { @@ -10580,8 +10581,8 @@ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", "requires": { - "sax": "1.2.4", - "xmlbuilder": "9.0.7" + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" } }, "xmlbuilder": { @@ -10609,8 +10610,8 @@ "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.1.4.tgz", "integrity": "sha1-ZleJr8KtS5Ar9APwDoW2Q04PMwA=", "requires": { - "argparse": "0.1.16", - "glob": "3.1.21" + "argparse": "~0.1.4", + "glob": "~3.1.11" }, "dependencies": { "argparse": { @@ -10618,8 +10619,8 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", "requires": { - "underscore": "1.7.0", - "underscore.string": "2.4.0" + "underscore": "~1.7.0", + "underscore.string": "~2.4.0" } }, "glob": { @@ -10627,9 +10628,9 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" + "graceful-fs": "~1.2.0", + "inherits": "1", + "minimatch": "~0.2.11" } }, "graceful-fs": { @@ -10647,8 +10648,8 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "underscore.string": { @@ -10663,9 +10664,9 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" }, "dependencies": { @@ -10681,7 +10682,7 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", "requires": { - "fd-slicer": "1.0.1" + "fd-slicer": "~1.0.1" } }, "yeast": { @@ -10694,9 +10695,9 @@ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.2.3.tgz", "integrity": "sha1-rvCVN2z+E4lZqBNBmB0mM4tG2NM=", "requires": { - "debug": "0.7.4", - "lodash.defaults": "2.4.1", - "readable-stream": "1.0.34" + "debug": "~0.7.4", + "lodash.defaults": "~2.4.1", + "readable-stream": "~1.0.24" }, "dependencies": { "debug": { @@ -10714,10 +10715,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -10783,53 +10784,53 @@ "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.0.0.tgz", "integrity": "sha1-jyI7sk/07kM15r6pZx3ilOQ7pqM=", "requires": { - "JSONStream": "1.3.2", - "assert": "1.3.0", - "browser-pack": "6.1.0", - "browser-resolve": "1.11.2", - "browserify-zlib": "0.1.4", - "buffer": "4.9.1", - "concat-stream": "1.5.2", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.1.7", - "duplexer2": "0.1.4", - "events": "1.1.1", - "glob": "5.0.15", - "has": "1.0.1", - "htmlescape": "1.1.1", - "https-browserify": "0.0.1", - "inherits": "2.0.1", - "insert-module-globals": "7.0.5", + "JSONStream": "^1.0.3", + "assert": "~1.3.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.1.2", + "buffer": "^4.1.0", + "concat-stream": "~1.5.1", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "~1.1.0", + "duplexer2": "~0.1.2", + "events": "~1.1.0", + "glob": "^5.0.15", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "~0.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", "isarray": "0.0.1", - "labeled-stream-splicer": "2.0.1", - "module-deps": "4.1.1", - "os-browserify": "0.1.2", - "parents": "1.0.1", - "path-browserify": "0.0.0", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.6", - "resolve": "1.6.0", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.1", - "string_decoder": "0.10.31", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", - "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.3", - "vm-browserify": "0.0.4", - "xtend": "4.0.1" + "labeled-stream-splicer": "^2.0.0", + "module-deps": "^4.0.2", + "os-browserify": "~0.1.1", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.4.3", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "~0.10.0", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "~0.0.0", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "~0.0.1", + "xtend": "^4.0.0" }, "dependencies": { "shell-quote": { @@ -10837,10 +10838,10 @@ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" } }, "xtend": { @@ -10865,9 +10866,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "requires": { - "inherits": "2.0.1", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" }, "dependencies": { "isarray": { @@ -10880,12 +10881,12 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" } } } @@ -10908,11 +10909,11 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "requires": { - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "http-proxy": { @@ -10920,8 +10921,8 @@ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.11.2.tgz", "integrity": "sha1-xQ0vsG7KedQjjmb9lDk9LkHmN0A=", "requires": { - "eventemitter3": "1.2.0", - "requires-port": "0.0.1" + "eventemitter3": "1.x.x", + "requires-port": "0.x.x" } }, "isarray": { @@ -10959,10 +10960,10 @@ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.4.1.tgz", "integrity": "sha1-rhhEK1NqCMcgI5sHnS8iisvt7kA=", "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" } }, "string_decoder": { @@ -10975,7 +10976,7 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "requires": { - "object-keys": "0.4.0" + "object-keys": "~0.4.0" } } } diff --git a/packages/kauri-wallet/package-lock.json b/packages/kauri-wallet/package-lock.json index 93ca5e6..dc68ece 100644 --- a/packages/kauri-wallet/package-lock.json +++ b/packages/kauri-wallet/package-lock.json @@ -1507,6 +1507,18 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" }, + "bip39": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.5.0.tgz", + "integrity": "sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA==", + "requires": { + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1", + "safe-buffer": "^5.0.1", + "unorm": "^1.3.3" + } + }, "bitsyntax": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/bitsyntax/-/bitsyntax-0.0.4.tgz", @@ -2333,6 +2345,40 @@ "sprintf-js": "^1.0.3" } }, + "cogent": { + "version": "git://github.com/timaschew/cogent.git#2246bd071392f5053a3a110024fd608a40a593ba", + "from": "git://github.com/timaschew/cogent.git#fix-redirects", + "requires": { + "debug": "*", + "generator-supported": "~0.0.1", + "netrc": "~0.1.3", + "proxy-agent": "^1.1.0", + "raw-body": "^1.1.2", + "statuses": "^1.0.2", + "write-to": "^1.0.0" + }, + "dependencies": { + "bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=" + }, + "iconv-lite": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.8.tgz", + "integrity": "sha1-xgGadZXyzvynAuq2lKAQvNkpjSA=" + }, + "raw-body": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.4.tgz", + "integrity": "sha1-zMfd/Ea3KGHN1btDPIQLcLbyf1Q=", + "requires": { + "bytes": "1.0.0", + "iconv-lite": "0.4.8" + } + } + } + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -2723,6 +2769,7 @@ "integrity": "sha1-PQeYpR5ziZxs5VnZN2Olb8eh2IM=", "requires": { "co": "^3", + "cogent": "git://github.com/timaschew/cogent.git#2246bd071392f5053a3a110024fd608a40a593ba", "component-consoler": "^2.0.0", "component-validator": "^1.0.0", "debug": "*", @@ -2731,48 +2778,16 @@ "semver": "^2.2.1" }, "dependencies": { - "bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", - "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=" - }, "co": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=" }, - "cogent": { - "version": "git://github.com/timaschew/cogent.git#2246bd071392f5053a3a110024fd608a40a593ba", - "from": "git://github.com/timaschew/cogent.git#2246bd071392f5053a3a110024fd608a40a593ba", - "requires": { - "debug": "*", - "generator-supported": "~0.0.1", - "netrc": "~0.1.3", - "proxy-agent": "^1.1.0", - "raw-body": "^1.1.2", - "statuses": "^1.0.2", - "write-to": "^1.0.0" - } - }, "graceful-fs": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=" }, - "iconv-lite": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.8.tgz", - "integrity": "sha1-xgGadZXyzvynAuq2lKAQvNkpjSA=" - }, - "raw-body": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.4.tgz", - "integrity": "sha1-zMfd/Ea3KGHN1btDPIQLcLbyf1Q=", - "requires": { - "bytes": "1.0.0", - "iconv-lite": "0.4.8" - } - }, "semver": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz", @@ -15024,6 +15039,11 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "unorm": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz", + "integrity": "sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA=" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/packages/kauri-wallet/package.json b/packages/kauri-wallet/package.json index 4f5acdd..10d6b1d 100644 --- a/packages/kauri-wallet/package.json +++ b/packages/kauri-wallet/package.json @@ -54,8 +54,10 @@ "@angular/pwa": "^0.6.8", "@angular/router": "^6.0.2", "@angular/service-worker": "^6.0.2", + "bip39": "^2.5.0", "component": "^1.1.0", "core-js": "^2.5.4", + "kauri-bitcore-lib": "^0.1.0", "rxjs": "^6.0.0", "zone.js": "^0.8.26" }, From d07691812399c25abcf085499497cfb6d4c8635f Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 21:15:37 +0200 Subject: [PATCH 08/10] Add node playground --- packages/kauri-wallet/node-playground.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/kauri-wallet/node-playground.js diff --git a/packages/kauri-wallet/node-playground.js b/packages/kauri-wallet/node-playground.js new file mode 100644 index 0000000..16243e6 --- /dev/null +++ b/packages/kauri-wallet/node-playground.js @@ -0,0 +1,19 @@ +const Bitcore = require('kauri-bitcore-lib') +const bip39 = require('bip39'); + +const seed = "buffalo attract habit cement moral high soul dentist prevent juice because vivid" +console.log('seed -->', seed) + +// Bitcore +const BTCxprivkey = Bitcore.HDPrivateKey.fromSeed(bip39.mnemonicToSeedHex(seed), 'BTCmainnet') +const NAVxprivkey = Bitcore.HDPrivateKey.fromSeed(bip39.mnemonicToSeedHex(seed), 'NAVmainnet') +const BTCaddress = BTCxprivkey.deriveChild("m/0'/0'/0'").privateKey.toAddress('BTCmainnet'); +const NAVAddress = BTCxprivkey.deriveChild("m/0'/0'/0'").privateKey.toAddress('NAVmainnet'); +const NAVAddress2 = NAVxprivkey.deriveChild("m/0'/0'/0'").privateKey.toAddress('NAVmainnet'); + +console.log('*** From bitcore ***') +console.log('BTCmasterPK -->', BTCxprivkey.toString()) +console.log('NAVxprivkey -->', NAVxprivkey.toString()) +console.log('btc address -->', BTCaddress.toString()) +console.log('nav address -->', NAVAddress.toString()) +console.log('na2 address -->', NAVAddress2.toString()) From 23bb3fbe8e220de5cbc38763a1c210b6c7608361 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 21:25:01 +0200 Subject: [PATCH 09/10] Fix bug in updateAngularCli.js --- packages/kauri-wallet/updateAngularCli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kauri-wallet/updateAngularCli.js b/packages/kauri-wallet/updateAngularCli.js index a97eaaa..2d6024e 100644 --- a/packages/kauri-wallet/updateAngularCli.js +++ b/packages/kauri-wallet/updateAngularCli.js @@ -13,7 +13,7 @@ fs.readFile(f, 'utf8', function (err,data) { if (err) { return console.log(err); } - var result = data.replace(/node: false/g, 'node: node: { fs: \'empty\', global: true, crypto: true, tls: \'empty\', net: \'empty\', process: true, module: false, clearImmediate: false, setImmediate: false }'); + var result = data.replace(/node: false/g, 'node: { fs: \'empty\', global: true, crypto: true, tls: \'empty\', net: \'empty\', process: true, module: false, clearImmediate: false, setImmediate: false }'); fs.writeFile(f, result, 'utf8', function (err) { if (err) return console.log(err); From c23242408d903339815941ea753533c789d2b8e3 Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Fri, 29 Jun 2018 22:05:03 +0200 Subject: [PATCH 10/10] Create basic component to generate seeds, keys and addresses --- .../kauri-wallet/src/app/app.component.html | 2 +- packages/kauri-wallet/src/app/app.module.ts | 4 +- .../generate-master-xpriv-key.component.html | 31 ++++++++++ .../generate-master-xpriv-key.component.scss | 0 ...enerate-master-xpriv-key.component.spec.ts | 25 ++++++++ .../generate-master-xpriv-key.component.ts | 58 +++++++++++++++++++ 6 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.html create mode 100644 packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.scss create mode 100644 packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.spec.ts create mode 100644 packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.ts diff --git a/packages/kauri-wallet/src/app/app.component.html b/packages/kauri-wallet/src/app/app.component.html index 634a65b..7dc5359 100644 --- a/packages/kauri-wallet/src/app/app.component.html +++ b/packages/kauri-wallet/src/app/app.component.html @@ -2,7 +2,7 @@

{{ title }}

- + diff --git a/packages/kauri-wallet/src/app/app.module.ts b/packages/kauri-wallet/src/app/app.module.ts index cda958e..d5339f6 100644 --- a/packages/kauri-wallet/src/app/app.module.ts +++ b/packages/kauri-wallet/src/app/app.module.ts @@ -12,13 +12,15 @@ import { ApiService } from './services/api/api.service'; import { WalletComponent } from './wallet/wallet.component'; import { HttpClientModule } from '@angular/common/http'; import { DataService } from './services/data/data.service'; +import { GenerateMasterXPrivKeyComponent } from './features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component'; @NgModule({ declarations: [ AppComponent, TranslationSampleComponent, SwUpdatePromptComponent, - WalletComponent + WalletComponent, + GenerateMasterXPrivKeyComponent ], imports: [ BrowserModule, diff --git a/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.html b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.html new file mode 100644 index 0000000..3a9ab72 --- /dev/null +++ b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.html @@ -0,0 +1,31 @@ +
+

Seed Phrase

+

This is a demo. It is insecure. Not not enter your real seed phrase!!!

+

+ Seed:
+ {{seed}} +

+ Enter seed: +
+ + +

Master Private Keys

+ BTC
+ {{masterkeys.btc}}

+ NAV
+ {{masterkeys.nav}}

+ +

Addresses

+

btc

+
    +
  • + {{ address.toString() }} +
  • +
+

nav

+
    +
  • + {{ address.toString() }} +
  • +
+
diff --git a/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.scss b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.spec.ts b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.spec.ts new file mode 100644 index 0000000..5327892 --- /dev/null +++ b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GenerateMasterXPrivKeyComponent } from './generate-master-xpriv-key.component'; + +describe('GenerateMasterXPrivKeyComponent', () => { + let component: GenerateMasterXPrivKeyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GenerateMasterXPrivKeyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GenerateMasterXPrivKeyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.ts b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.ts new file mode 100644 index 0000000..73de956 --- /dev/null +++ b/packages/kauri-wallet/src/app/features/addresses/generate-master-xpriv-key/generate-master-xpriv-key.component.ts @@ -0,0 +1,58 @@ +import { Component, OnInit } from '@angular/core'; +import * as bip39 from 'bip39'; +import * as Bitcore from 'kauri-bitcore-lib'; + +@Component({ + selector: 'app-generate-master-xpriv-key', + templateUrl: './generate-master-xpriv-key.component.html', + styleUrls: ['./generate-master-xpriv-key.component.scss'] +}) +export class GenerateMasterXPrivKeyComponent implements OnInit { + + seed = ''; + masterkeys = { + btc: undefined, + nav: undefined, + }; + addresses = { + btc: [], + nav: [], + }; + + constructor() { } + + ngOnInit() { + } + + generateSeed() { + this.seed = bip39.generateMnemonic(256); + this.createMasterKeys(); + } + + updateSeed(userSeed) { + this.seed = userSeed; + this.createMasterKeys(); + } + + createMasterKeys() { + this.masterkeys.btc = Bitcore.HDPrivateKey.fromSeed(bip39.mnemonicToSeedHex(this.seed), 'BTCmainnet'); + this.masterkeys.nav = Bitcore.HDPrivateKey.fromSeed(bip39.mnemonicToSeedHex(this.seed), 'NAVmainnet'); + this.removeOldAddresss(); + this.generateAddresses(); + } + + removeOldAddresss() { + this.addresses.btc = []; + this.addresses.nav = []; + } + + generateAddresses() { + // BIP 44 - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki + // SLIP 44 (coin codes) - https://github.com/satoshilabs/slips/blob/master/slip-0044.md + for (let i = 0; i < 5; i++) { + // m / purpose' / coin_type' / account' / change / address_index + this.addresses.btc.push(this.masterkeys.btc.deriveChild(`m/44'/0'/0'/0/${i}`).privateKey.toAddress('BTCmainnet')); + this.addresses.nav.push(this.masterkeys.nav.deriveChild(`m/44'/130'/0'/0/${i}`).privateKey.toAddress('NAVmainnet')); + } + } +}