@opcat-labs/opcat 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cjs2esm.json +18 -0
- package/.mocharc.yaml +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +6 -0
- package/{lib/address.js → cjs/address.cjs} +77 -72
- package/cjs/block/block.cjs +332 -0
- package/{lib/block/blockheader.js → cjs/block/blockheader.cjs} +8 -7
- package/cjs/block/index.cjs +2 -0
- package/{lib/block/merkleblock.js → cjs/block/merkleblock.cjs} +23 -15
- package/cjs/bn.cjs +3411 -0
- package/{lib/crypto/bn.js → cjs/crypto/bn.cjs} +3 -3
- package/{lib/crypto/ecdsa.js → cjs/crypto/ecdsa.cjs} +150 -14
- package/{lib/crypto/hash.node.js → cjs/crypto/hash.cjs} +13 -2
- package/cjs/crypto/index.cjs +16 -0
- package/{lib/crypto/point.js → cjs/crypto/point.cjs} +11 -4
- package/cjs/crypto/random.cjs +18 -0
- package/{lib/crypto/signature.js → cjs/crypto/signature.cjs} +158 -8
- package/{lib/encoding/base58.js → cjs/encoding/base58.cjs} +58 -2
- package/cjs/encoding/base58check.cjs +192 -0
- package/cjs/encoding/bufferreader.cjs +333 -0
- package/cjs/encoding/bufferwriter.cjs +244 -0
- package/{lib/encoding/decode-asm.js → cjs/encoding/decode-asm.cjs} +4 -4
- package/{lib/encoding/decode-hex.js → cjs/encoding/decode-hex.cjs} +1 -1
- package/cjs/encoding/index.cjs +14 -0
- package/cjs/encoding/varint.cjs +116 -0
- package/{lib/errors/index.js → cjs/errors/index.cjs} +9 -9
- package/{lib/errors/spec.js → cjs/errors/spec.cjs} +2 -2
- package/cjs/hash-cache.cjs +98 -0
- package/{lib/hdprivatekey.js → cjs/hdprivatekey.cjs} +232 -140
- package/{lib/hdpublickey.js → cjs/hdpublickey.cjs} +120 -93
- package/cjs/index.cjs +94 -0
- package/cjs/interpreter/index.cjs +2 -0
- package/cjs/interpreter/interpreter.cjs +1988 -0
- package/{lib/script/stack.js → cjs/interpreter/stack.cjs} +9 -2
- package/{lib/message/message.js → cjs/message/message.cjs} +62 -25
- package/cjs/mnemonic/index.cjs +3 -0
- package/{lib/mnemonic/mnemonic.js → cjs/mnemonic/mnemonic.cjs} +44 -13
- package/{lib/mnemonic/pbkdf2.node.js → cjs/mnemonic/pbkdf2.cjs} +9 -2
- package/cjs/mnemonic/words/index.cjs +66 -0
- package/cjs/network.cjs +13 -0
- package/cjs/networks.cjs +321 -0
- package/{lib/opcode.js → cjs/opcode.cjs} +69 -5
- package/cjs/privatekey.cjs +422 -0
- package/{lib/publickey.js → cjs/publickey.cjs} +14 -16
- package/cjs/script/index.cjs +2 -0
- package/{lib/script/script.js → cjs/script/script.cjs} +322 -67
- package/cjs/transaction/index.cjs +5 -0
- package/cjs/transaction/input/index.cjs +34 -0
- package/cjs/transaction/input/input.cjs +396 -0
- package/{lib/transaction/input/multisig.js → cjs/transaction/input/multisig.cjs} +112 -18
- package/{lib/transaction/input/publickey.js → cjs/transaction/input/publickey.cjs} +29 -19
- package/{lib/transaction/input/publickeyhash.js → cjs/transaction/input/publickeyhash.cjs} +25 -17
- package/{lib/transaction/output.js → cjs/transaction/output.cjs} +100 -15
- package/cjs/transaction/sighash.cjs +187 -0
- package/{lib/transaction/signature.js → cjs/transaction/signature.cjs} +30 -6
- package/cjs/transaction/transaction.cjs +2000 -0
- package/{lib/transaction/unspentoutput.js → cjs/transaction/unspentoutput.cjs} +5 -5
- package/cjs/util/derivation.cjs +53 -0
- package/cjs/util/index.cjs +11 -0
- package/cjs/util/js.cjs +95 -0
- package/{lib/util/preconditions.js → cjs/util/preconditions.cjs} +2 -2
- package/esm/address.js +483 -0
- package/{lib → esm}/block/block.js +82 -27
- package/esm/block/blockheader.js +296 -0
- package/esm/block/index.js +2 -0
- package/esm/block/merkleblock.js +331 -0
- package/esm/bn.js +3411 -0
- package/esm/crypto/bn.js +278 -0
- package/esm/crypto/ecdsa.js +475 -0
- package/{lib/crypto/hash.browser.js → esm/crypto/hash.js} +18 -7
- package/esm/crypto/index.js +16 -0
- package/esm/crypto/point.js +228 -0
- package/esm/crypto/random.js +18 -0
- package/esm/crypto/signature.js +475 -0
- package/esm/encoding/base58.js +167 -0
- package/esm/encoding/base58check.js +192 -0
- package/esm/encoding/bufferreader.js +333 -0
- package/esm/encoding/bufferwriter.js +243 -0
- package/esm/encoding/decode-asm.js +24 -0
- package/esm/encoding/decode-hex.js +32 -0
- package/esm/encoding/decode-script-chunks.js +43 -0
- package/esm/encoding/encode-hex.js +284 -0
- package/esm/encoding/index.js +14 -0
- package/esm/encoding/is-hex.js +7 -0
- package/esm/encoding/varint.js +116 -0
- package/esm/errors/index.js +54 -0
- package/esm/errors/spec.js +314 -0
- package/esm/hash-cache.js +98 -0
- package/esm/hdprivatekey.js +768 -0
- package/esm/hdpublickey.js +549 -0
- package/esm/index.js +66 -0
- package/esm/interpreter/index.js +2 -0
- package/{lib/script → esm/interpreter}/interpreter.js +219 -66
- package/esm/interpreter/stack.js +116 -0
- package/esm/message/message.js +228 -0
- package/esm/mnemonic/index.js +3 -0
- package/esm/mnemonic/mnemonic.js +332 -0
- package/{lib/mnemonic/pbkdf2.browser.js → esm/mnemonic/pbkdf2.js} +13 -6
- package/esm/mnemonic/words/chinese.js +2054 -0
- package/esm/mnemonic/words/english.js +2054 -0
- package/esm/mnemonic/words/french.js +2054 -0
- package/esm/mnemonic/words/index.js +66 -0
- package/esm/mnemonic/words/italian.js +2054 -0
- package/esm/mnemonic/words/japanese.js +2054 -0
- package/esm/mnemonic/words/spanish.js +2054 -0
- package/esm/network.js +13 -0
- package/{lib → esm}/networks.js +61 -120
- package/esm/opcode.js +319 -0
- package/{lib → esm}/privatekey.js +76 -28
- package/esm/publickey.js +384 -0
- package/esm/script/index.js +2 -0
- package/esm/script/script.js +1329 -0
- package/esm/script/write-i32-le.js +17 -0
- package/esm/script/write-push-data.js +35 -0
- package/esm/script/write-u16-le.js +12 -0
- package/esm/script/write-u32-le.js +16 -0
- package/esm/script/write-u64-le.js +24 -0
- package/esm/script/write-u8-le.js +8 -0
- package/esm/script/write-varint.js +46 -0
- package/esm/transaction/index.js +5 -0
- package/esm/transaction/input/index.js +33 -0
- package/{lib → esm}/transaction/input/input.js +132 -90
- package/esm/transaction/input/multisig.js +335 -0
- package/esm/transaction/input/publickey.js +108 -0
- package/esm/transaction/input/publickeyhash.js +124 -0
- package/esm/transaction/output.js +316 -0
- package/{lib → esm}/transaction/sighash.js +42 -22
- package/esm/transaction/signature.js +120 -0
- package/{lib → esm}/transaction/transaction.js +522 -163
- package/esm/transaction/unspentoutput.js +112 -0
- package/esm/util/_.js +47 -0
- package/esm/util/derivation.js +53 -0
- package/esm/util/index.js +12 -0
- package/esm/util/js.js +95 -0
- package/esm/util/preconditions.js +33 -0
- package/fixup.cjs +17 -0
- package/package.json +18 -4
- package/test/{address.js → address.cjs} +14 -43
- package/test/block/{block.js → block.cjs} +3 -5
- package/test/block/{blockheader.js → blockheader.cjs} +2 -2
- package/test/block/{merklebloack.js → merklebloack.cjs} +2 -2
- package/test/crypto/{ecdsa.js → ecdsa.cjs} +9 -9
- package/test/crypto/{hash.browser.js → hash.browser.cjs} +2 -1
- package/test/crypto/{signature.js → signature.cjs} +2 -2
- package/test/data/bitcoind/script_tests.json +5 -5
- package/test/{hashCache.js → hashCache.cjs} +2 -1
- package/test/{hdkeys.js → hdkeys.cjs} +4 -2
- package/test/{hdprivatekey.js → hdprivatekey.cjs} +7 -6
- package/test/{hdpublickey.js → hdpublickey.cjs} +2 -7
- package/test/mnemonic/{pbkdf2.test.js → pbkdf2.test.cjs} +2 -2
- package/test/{networks.js → networks.cjs} +12 -31
- package/test/{publickey.js → publickey.cjs} +2 -2
- package/test/script/{interpreter.js → interpreter.cjs} +5 -5
- package/test/script/{script.js → script.cjs} +8 -2
- package/test/transaction/{deserialize.js → deserialize.cjs} +2 -2
- package/test/transaction/input/{input.js → input.cjs} +1 -1
- package/test/transaction/input/{multisig.js → multisig.cjs} +2 -1
- package/test/transaction/input/{publickeyhash.js → publickeyhash.cjs} +1 -1
- package/test/transaction/{sighash.js → sighash.cjs} +1 -1
- package/test/transaction/{transaction.js → transaction.cjs} +2 -2
- package/tsconfig.json +13 -0
- package/types/address.d.cts +252 -0
- package/types/block/block.d.cts +139 -0
- package/types/block/blockheader.d.cts +125 -0
- package/types/block/index.d.cts +2 -0
- package/types/block/merkleblock.d.cts +95 -0
- package/types/bn.d.cts +202 -0
- package/types/crypto/bn.d.cts +2 -0
- package/types/crypto/ecdsa.d.cts +187 -0
- package/types/crypto/hash.d.cts +118 -0
- package/types/crypto/index.d.cts +7 -0
- package/types/crypto/point.d.cts +134 -0
- package/types/crypto/random.d.cts +13 -0
- package/types/crypto/signature.d.cts +160 -0
- package/types/encoding/base58.d.cts +106 -0
- package/types/encoding/base58check.d.cts +107 -0
- package/types/encoding/bufferreader.d.cts +164 -0
- package/types/encoding/bufferwriter.d.cts +126 -0
- package/types/encoding/decode-asm.d.cts +2 -0
- package/types/encoding/decode-hex.d.cts +2 -0
- package/types/encoding/decode-script-chunks.d.cts +14 -0
- package/types/encoding/encode-hex.d.cts +2 -0
- package/types/encoding/index.d.cts +6 -0
- package/types/encoding/is-hex.d.cts +2 -0
- package/types/encoding/varint.d.cts +66 -0
- package/types/errors/index.d.cts +4 -0
- package/types/errors/spec.d.cts +22 -0
- package/types/hash-cache.d.cts +65 -0
- package/types/hdprivatekey.d.cts +281 -0
- package/types/hdpublickey.d.cts +240 -0
- package/types/index.d.cts +26 -0
- package/types/interpreter/index.d.cts +2 -0
- package/types/interpreter/interpreter.d.cts +228 -0
- package/types/interpreter/stack.d.cts +35 -0
- package/types/message/message.d.cts +110 -0
- package/types/mnemonic/index.d.cts +2 -0
- package/types/mnemonic/mnemonic.d.cts +171 -0
- package/types/mnemonic/pbkdf2.d.cts +14 -0
- package/types/mnemonic/words/chinese.d.cts +2 -0
- package/types/mnemonic/words/english.d.cts +2 -0
- package/types/mnemonic/words/french.d.cts +2 -0
- package/types/mnemonic/words/index.d.cts +22 -0
- package/types/mnemonic/words/italian.d.cts +2 -0
- package/types/mnemonic/words/japanese.d.cts +2 -0
- package/types/mnemonic/words/spanish.d.cts +2 -0
- package/types/network.d.cts +11 -0
- package/types/networks.d.cts +76 -0
- package/types/opcode.d.cts +93 -0
- package/types/privatekey.d.cts +169 -0
- package/types/publickey.d.cts +202 -0
- package/types/script/index.d.cts +2 -0
- package/types/script/script.d.cts +449 -0
- package/types/script/write-i32-le.d.cts +2 -0
- package/types/script/write-push-data.d.cts +2 -0
- package/types/script/write-u16-le.d.cts +2 -0
- package/types/script/write-u32-le.d.cts +2 -0
- package/types/script/write-u64-le.d.cts +2 -0
- package/types/script/write-u8-le.d.cts +2 -0
- package/types/script/write-varint.d.cts +2 -0
- package/types/transaction/index.d.cts +2 -0
- package/types/transaction/input/index.d.cts +2 -0
- package/types/transaction/input/input.d.cts +178 -0
- package/types/transaction/input/multisig.d.cts +127 -0
- package/types/transaction/input/publickey.d.cts +44 -0
- package/types/transaction/input/publickeyhash.d.cts +45 -0
- package/types/transaction/output.d.cts +118 -0
- package/types/transaction/sighash.d.cts +61 -0
- package/types/transaction/signature.d.cts +43 -0
- package/types/transaction/transaction.d.cts +716 -0
- package/types/transaction/unspentoutput.d.cts +83 -0
- package/types/util/_.d.cts +26 -0
- package/types/util/derivation.d.cts +21 -0
- package/types/util/index.d.cts +5 -0
- package/types/util/js.d.cts +50 -0
- package/types/util/preconditions.d.cts +3 -0
- package/index.d.ts +0 -1541
- package/index.js +0 -74
- package/lib/block/index.js +0 -4
- package/lib/bn.js +0 -3423
- package/lib/crypto/hash.js +0 -2
- package/lib/crypto/random.browser.js +0 -28
- package/lib/crypto/random.js +0 -2
- package/lib/crypto/random.node.js +0 -11
- package/lib/encoding/base58check.js +0 -121
- package/lib/encoding/bufferreader.js +0 -212
- package/lib/encoding/bufferwriter.js +0 -140
- package/lib/encoding/varint.js +0 -75
- package/lib/hash-cache.js +0 -50
- package/lib/mnemonic/pbkdf2.js +0 -2
- package/lib/mnemonic/words/index.js +0 -8
- package/lib/script/index.js +0 -5
- package/lib/transaction/index.js +0 -7
- package/lib/transaction/input/index.js +0 -5
- package/lib/util/js.js +0 -90
- /package/{lib/encoding/decode-script-chunks.js → cjs/encoding/decode-script-chunks.cjs} +0 -0
- /package/{lib/encoding/encode-hex.js → cjs/encoding/encode-hex.cjs} +0 -0
- /package/{lib/encoding/is-hex.js → cjs/encoding/is-hex.cjs} +0 -0
- /package/{lib/mnemonic/words/chinese.js → cjs/mnemonic/words/chinese.cjs} +0 -0
- /package/{lib/mnemonic/words/english.js → cjs/mnemonic/words/english.cjs} +0 -0
- /package/{lib/mnemonic/words/french.js → cjs/mnemonic/words/french.cjs} +0 -0
- /package/{lib/mnemonic/words/italian.js → cjs/mnemonic/words/italian.cjs} +0 -0
- /package/{lib/mnemonic/words/japanese.js → cjs/mnemonic/words/japanese.cjs} +0 -0
- /package/{lib/mnemonic/words/spanish.js → cjs/mnemonic/words/spanish.cjs} +0 -0
- /package/{lib/script/write-i32-le.js → cjs/script/write-i32-le.cjs} +0 -0
- /package/{lib/script/write-push-data.js → cjs/script/write-push-data.cjs} +0 -0
- /package/{lib/script/write-u16-le.js → cjs/script/write-u16-le.cjs} +0 -0
- /package/{lib/script/write-u32-le.js → cjs/script/write-u32-le.cjs} +0 -0
- /package/{lib/script/write-u64-le.js → cjs/script/write-u64-le.cjs} +0 -0
- /package/{lib/script/write-u8-le.js → cjs/script/write-u8-le.cjs} +0 -0
- /package/{lib/script/write-varint.js → cjs/script/write-varint.cjs} +0 -0
- /package/{lib/util/_.js → cjs/util/_.cjs} +0 -0
- /package/test/crypto/{bn.js → bn.cjs} +0 -0
- /package/test/crypto/{hash.js → hash.cjs} +0 -0
- /package/test/crypto/{point.js → point.cjs} +0 -0
- /package/test/crypto/{random.js → random.cjs} +0 -0
- /package/test/data/{blk86756-testnet.js → blk86756-testnet.cjs} +0 -0
- /package/test/data/{merkleblocks.js → merkleblocks.cjs} +0 -0
- /package/test/encoding/{base58.js → base58.cjs} +0 -0
- /package/test/encoding/{base58check.js → base58check.cjs} +0 -0
- /package/test/encoding/{bufferreader.js → bufferreader.cjs} +0 -0
- /package/test/encoding/{bufferwriter.js → bufferwriter.cjs} +0 -0
- /package/test/encoding/{varint.js → varint.cjs} +0 -0
- /package/test/{index.js → index.cjs} +0 -0
- /package/test/message/{message.js → message.cjs} +0 -0
- /package/test/mnemonic/{mnemonic.js → mnemonic.cjs} +0 -0
- /package/test/{opcode.js → opcode.cjs} +0 -0
- /package/test/{privatekey.js → privatekey.cjs} +0 -0
- /package/test/transaction/input/{publickey.js → publickey.cjs} +0 -0
- /package/test/transaction/{output.js → output.cjs} +0 -0
- /package/test/transaction/{signature.js → signature.cjs} +0 -0
- /package/test/transaction/{unspentoutput.js → unspentoutput.cjs} +0 -0
- /package/test/util/{js.js → js.cjs} +0 -0
- /package/test/util/{preconditions.js → preconditions.cjs} +0 -0
package/lib/crypto/hash.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function Random() {}
|
|
4
|
-
|
|
5
|
-
/* secure random bytes that sometimes throws an error due to lack of entropy */
|
|
6
|
-
Random.getRandomBuffer = function (size) {
|
|
7
|
-
if (!window.crypto && !window.msCrypto) {
|
|
8
|
-
throw new Error('window.crypto not available');
|
|
9
|
-
}
|
|
10
|
-
var crypto;
|
|
11
|
-
|
|
12
|
-
if (window.crypto && window.crypto.getRandomValues) {
|
|
13
|
-
crypto = window.crypto;
|
|
14
|
-
} else if (window.msCrypto && window.msCrypto.getRandomValues) {
|
|
15
|
-
// internet explorer
|
|
16
|
-
crypto = window.msCrypto;
|
|
17
|
-
} else {
|
|
18
|
-
throw new Error('window.crypto.getRandomValues not available');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var bbuf = new Uint8Array(size);
|
|
22
|
-
crypto.getRandomValues(bbuf);
|
|
23
|
-
var buf = Buffer.from(bbuf);
|
|
24
|
-
|
|
25
|
-
return buf;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
module.exports = Random;
|
package/lib/crypto/random.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function Random() {}
|
|
4
|
-
|
|
5
|
-
/* secure random bytes that sometimes throws an error due to lack of entropy */
|
|
6
|
-
Random.getRandomBuffer = function (size) {
|
|
7
|
-
var crypto = require('crypto');
|
|
8
|
-
return crypto.randomBytes(size);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
module.exports = Random;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _ = require('../util/_');
|
|
4
|
-
var Base58 = require('./base58');
|
|
5
|
-
var sha256sha256 = require('../crypto/hash').sha256sha256;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A Base58check object can encode/decodd Base 58, which is used primarily for
|
|
9
|
-
* string-formatted Bitcoin addresses and private keys. This is the same as
|
|
10
|
-
* Base58, except that it includes a checksum to prevent accidental mistypings.
|
|
11
|
-
*
|
|
12
|
-
* @param {object} obj Can be a string or buffer.
|
|
13
|
-
*/
|
|
14
|
-
var Base58Check = function Base58Check(obj) {
|
|
15
|
-
if (!(this instanceof Base58Check)) {
|
|
16
|
-
return new Base58Check(obj);
|
|
17
|
-
}
|
|
18
|
-
if (Buffer.isBuffer(obj)) {
|
|
19
|
-
var buf = obj;
|
|
20
|
-
this.fromBuffer(buf);
|
|
21
|
-
} else if (typeof obj === 'string') {
|
|
22
|
-
var str = obj;
|
|
23
|
-
this.fromString(str);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
Base58Check.prototype.set = function (obj) {
|
|
28
|
-
this.buf = obj.buf || this.buf || undefined;
|
|
29
|
-
return this;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
Base58Check.validChecksum = function validChecksum(data, checksum) {
|
|
33
|
-
if (_.isString(data)) {
|
|
34
|
-
data = Buffer.from(Base58.decode(data));
|
|
35
|
-
}
|
|
36
|
-
if (_.isString(checksum)) {
|
|
37
|
-
checksum = Buffer.from(Base58.decode(checksum));
|
|
38
|
-
}
|
|
39
|
-
if (!checksum) {
|
|
40
|
-
checksum = data.slice(-4);
|
|
41
|
-
data = data.slice(0, -4);
|
|
42
|
-
}
|
|
43
|
-
return Base58Check.checksum(data).toString('hex') === checksum.toString('hex');
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
Base58Check.decode = function (s) {
|
|
47
|
-
if (typeof s !== 'string') {
|
|
48
|
-
throw new Error('Input must be a string');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var buf = Buffer.from(Base58.decode(s));
|
|
52
|
-
|
|
53
|
-
if (buf.length < 4) {
|
|
54
|
-
throw new Error('Input string too short');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var data = buf.slice(0, -4);
|
|
58
|
-
var csum = buf.slice(-4);
|
|
59
|
-
|
|
60
|
-
var hash = sha256sha256(data);
|
|
61
|
-
var hash4 = hash.slice(0, 4);
|
|
62
|
-
|
|
63
|
-
if (csum.toString('hex') !== hash4.toString('hex')) {
|
|
64
|
-
throw new Error('Checksum mismatch');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return data;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
Base58Check.checksum = function (buffer) {
|
|
71
|
-
return sha256sha256(buffer).slice(0, 4);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
Base58Check.encode = function (buf) {
|
|
75
|
-
if (!Buffer.isBuffer(buf)) {
|
|
76
|
-
throw new Error('Input must be a buffer');
|
|
77
|
-
}
|
|
78
|
-
var checkedBuf = Buffer.alloc(buf.length + 4);
|
|
79
|
-
var hash = Base58Check.checksum(buf);
|
|
80
|
-
buf.copy(checkedBuf);
|
|
81
|
-
hash.copy(checkedBuf, buf.length);
|
|
82
|
-
return Base58.encode(checkedBuf);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
Base58Check.prototype.fromBuffer = function (buf) {
|
|
86
|
-
this.buf = buf;
|
|
87
|
-
return this;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
Base58Check.fromBuffer = function (buf) {
|
|
91
|
-
return new Base58Check().fromBuffer(buf);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
Base58Check.fromHex = function (hex) {
|
|
95
|
-
return Base58Check.fromBuffer(Buffer.from(hex, 'hex'));
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
Base58Check.prototype.fromString = function (str) {
|
|
99
|
-
var buf = Base58Check.decode(str);
|
|
100
|
-
this.buf = buf;
|
|
101
|
-
return this;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
Base58Check.fromString = function (str) {
|
|
105
|
-
var buf = Base58Check.decode(str);
|
|
106
|
-
return new Base58(buf);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
Base58Check.prototype.toBuffer = function () {
|
|
110
|
-
return this.buf;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
Base58Check.prototype.toHex = function () {
|
|
114
|
-
return this.toBuffer().toString('hex');
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
Base58Check.prototype.toString = function () {
|
|
118
|
-
return Base58Check.encode(this.buf);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
module.exports = Base58Check;
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _ = require('../util/_');
|
|
4
|
-
var $ = require('../util/preconditions');
|
|
5
|
-
var BN = require('../crypto/bn');
|
|
6
|
-
|
|
7
|
-
var BufferReader = function BufferReader(buf) {
|
|
8
|
-
if (!(this instanceof BufferReader)) {
|
|
9
|
-
return new BufferReader(buf);
|
|
10
|
-
}
|
|
11
|
-
if (_.isUndefined(buf)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
if (Buffer.isBuffer(buf)) {
|
|
15
|
-
this.set({
|
|
16
|
-
buf: buf,
|
|
17
|
-
});
|
|
18
|
-
} else if (_.isString(buf)) {
|
|
19
|
-
var b = Buffer.from(buf, 'hex');
|
|
20
|
-
if (b.length * 2 !== buf.length) {
|
|
21
|
-
throw new TypeError('Invalid hex string');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
this.set({
|
|
25
|
-
buf: b,
|
|
26
|
-
});
|
|
27
|
-
} else if (_.isObject(buf)) {
|
|
28
|
-
var obj = buf;
|
|
29
|
-
this.set(obj);
|
|
30
|
-
} else {
|
|
31
|
-
throw new TypeError('Unrecognized argument for BufferReader');
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
BufferReader.prototype.set = function (obj) {
|
|
36
|
-
this.buf = obj.buf || this.buf || undefined;
|
|
37
|
-
this.pos = obj.pos || this.pos || 0;
|
|
38
|
-
return this;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
BufferReader.prototype.eof = function () {
|
|
42
|
-
return this.pos >= this.buf.length;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
BufferReader.prototype.finished = BufferReader.prototype.eof;
|
|
46
|
-
|
|
47
|
-
BufferReader.prototype.read = function (len) {
|
|
48
|
-
$.checkArgument(!_.isUndefined(len), 'Must specify a length');
|
|
49
|
-
var buf = this.buf.slice(this.pos, this.pos + len);
|
|
50
|
-
this.pos = this.pos + len;
|
|
51
|
-
return buf;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
BufferReader.prototype.readAll = function () {
|
|
55
|
-
var buf = this.buf.slice(this.pos, this.buf.length);
|
|
56
|
-
this.pos = this.buf.length;
|
|
57
|
-
return buf;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
BufferReader.prototype.readUInt8 = function () {
|
|
61
|
-
var val = this.buf.readUInt8(this.pos);
|
|
62
|
-
this.pos = this.pos + 1;
|
|
63
|
-
return val;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
BufferReader.prototype.readUInt16BE = function () {
|
|
67
|
-
var val = this.buf.readUInt16BE(this.pos);
|
|
68
|
-
this.pos = this.pos + 2;
|
|
69
|
-
return val;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
BufferReader.prototype.readUInt16LE = function () {
|
|
73
|
-
var val = this.buf.readUInt16LE(this.pos);
|
|
74
|
-
this.pos = this.pos + 2;
|
|
75
|
-
return val;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
BufferReader.prototype.readUInt32BE = function () {
|
|
79
|
-
var val = this.buf.readUInt32BE(this.pos);
|
|
80
|
-
this.pos = this.pos + 4;
|
|
81
|
-
return val;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
BufferReader.prototype.readUInt32LE = function () {
|
|
85
|
-
var val = this.buf.readUInt32LE(this.pos);
|
|
86
|
-
this.pos = this.pos + 4;
|
|
87
|
-
return val;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
BufferReader.prototype.readInt32LE = function () {
|
|
91
|
-
var val = this.buf.readInt32LE(this.pos);
|
|
92
|
-
this.pos = this.pos + 4;
|
|
93
|
-
return val;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
BufferReader.prototype.readUInt64BEBN = function () {
|
|
97
|
-
var buf = this.buf.slice(this.pos, this.pos + 8);
|
|
98
|
-
var bn = BN.fromBuffer(buf);
|
|
99
|
-
this.pos = this.pos + 8;
|
|
100
|
-
return bn;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
BufferReader.prototype.readUInt64LEBN = function () {
|
|
104
|
-
var second = this.buf.readUInt32LE(this.pos);
|
|
105
|
-
var first = this.buf.readUInt32LE(this.pos + 4);
|
|
106
|
-
var combined = first * 0x100000000 + second;
|
|
107
|
-
// Instantiating an instance of BN with a number is faster than with an
|
|
108
|
-
// array or string. However, the maximum safe number for a double precision
|
|
109
|
-
// floating point is 2 ^ 52 - 1 (0x1fffffffffffff), thus we can safely use
|
|
110
|
-
// non-floating point numbers less than this amount (52 bits). And in the case
|
|
111
|
-
// that the number is larger, we can instatiate an instance of BN by passing
|
|
112
|
-
// an array from the buffer (slower) and specifying the endianness.
|
|
113
|
-
var bn;
|
|
114
|
-
if (combined <= 0x1fffffffffffff) {
|
|
115
|
-
bn = new BN(combined);
|
|
116
|
-
} else {
|
|
117
|
-
var data = Array.prototype.slice.call(this.buf, this.pos, this.pos + 8);
|
|
118
|
-
bn = new BN(data, 10, 'le');
|
|
119
|
-
}
|
|
120
|
-
this.pos = this.pos + 8;
|
|
121
|
-
return bn;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
BufferReader.prototype.readVarintNum = function () {
|
|
125
|
-
var first = this.readUInt8();
|
|
126
|
-
switch (first) {
|
|
127
|
-
case 0xfd:
|
|
128
|
-
return this.readUInt16LE();
|
|
129
|
-
case 0xfe:
|
|
130
|
-
return this.readUInt32LE();
|
|
131
|
-
case 0xff:
|
|
132
|
-
var bn = this.readUInt64LEBN();
|
|
133
|
-
var n = bn.toNumber();
|
|
134
|
-
if (n <= Math.pow(2, 53)) {
|
|
135
|
-
return n;
|
|
136
|
-
} else {
|
|
137
|
-
throw new Error('number too large to retain precision - use readVarintBN');
|
|
138
|
-
}
|
|
139
|
-
// break // unreachable
|
|
140
|
-
default:
|
|
141
|
-
return first;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* reads a length prepended buffer
|
|
147
|
-
*/
|
|
148
|
-
BufferReader.prototype.readVarLengthBuffer = function () {
|
|
149
|
-
var len = this.readVarintNum();
|
|
150
|
-
var buf = this.read(len);
|
|
151
|
-
$.checkState(
|
|
152
|
-
buf.length === len,
|
|
153
|
-
'Invalid length while reading varlength buffer. ' +
|
|
154
|
-
'Expected to read: ' +
|
|
155
|
-
len +
|
|
156
|
-
' and read ' +
|
|
157
|
-
buf.length,
|
|
158
|
-
);
|
|
159
|
-
return buf;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
BufferReader.prototype.readVarintBuf = function () {
|
|
163
|
-
var first = this.buf.readUInt8(this.pos);
|
|
164
|
-
switch (first) {
|
|
165
|
-
case 0xfd:
|
|
166
|
-
return this.read(1 + 2);
|
|
167
|
-
case 0xfe:
|
|
168
|
-
return this.read(1 + 4);
|
|
169
|
-
case 0xff:
|
|
170
|
-
return this.read(1 + 8);
|
|
171
|
-
default:
|
|
172
|
-
return this.read(1);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
BufferReader.prototype.readVarintBN = function () {
|
|
177
|
-
var first = this.readUInt8();
|
|
178
|
-
switch (first) {
|
|
179
|
-
case 0xfd:
|
|
180
|
-
return new BN(this.readUInt16LE());
|
|
181
|
-
case 0xfe:
|
|
182
|
-
return new BN(this.readUInt32LE());
|
|
183
|
-
case 0xff:
|
|
184
|
-
return this.readUInt64LEBN();
|
|
185
|
-
default:
|
|
186
|
-
return new BN(first);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
BufferReader.prototype.reverse = function () {
|
|
191
|
-
var buf = Buffer.alloc(this.buf.length);
|
|
192
|
-
for (var i = 0; i < buf.length; i++) {
|
|
193
|
-
buf[i] = this.buf[this.buf.length - 1 - i];
|
|
194
|
-
}
|
|
195
|
-
this.buf = buf;
|
|
196
|
-
return this;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
BufferReader.prototype.readReverse = function (len) {
|
|
200
|
-
if (_.isUndefined(len)) {
|
|
201
|
-
len = this.buf.length;
|
|
202
|
-
}
|
|
203
|
-
var buf = this.buf.slice(this.pos, this.pos + len);
|
|
204
|
-
this.pos = this.pos + len;
|
|
205
|
-
return Buffer.from(buf).reverse();
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
BufferReader.prototype.remaining = function () {
|
|
209
|
-
return this.buf.length - this.pos;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
module.exports = BufferReader;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var assert = require('assert');
|
|
4
|
-
|
|
5
|
-
const writeU8LE = require('../script/write-u8-le');
|
|
6
|
-
const writeU16LE = require('../script/write-u16-le');
|
|
7
|
-
const writeU32LE = require('../script/write-u32-le');
|
|
8
|
-
const writeI32LE = require('../script/write-i32-le');
|
|
9
|
-
const writeVarint = require('../script/write-varint');
|
|
10
|
-
|
|
11
|
-
class BufferWriter {
|
|
12
|
-
constructor(obj) {
|
|
13
|
-
if (obj) {
|
|
14
|
-
this.set(obj);
|
|
15
|
-
} else {
|
|
16
|
-
this.buffers = [];
|
|
17
|
-
this.length = 0;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
write(buffer) {
|
|
22
|
-
this.buffers.push(buffer);
|
|
23
|
-
this.length += buffer.length;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
set(obj) {
|
|
28
|
-
this.buffers = obj.buffers || obj.bufs || this.buffers || [];
|
|
29
|
-
this.length = this.buffers.reduce(function (prev, buf) {
|
|
30
|
-
return prev + buf.length;
|
|
31
|
-
}, 0);
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
concat() {
|
|
36
|
-
return this.toBuffer();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
toBuffer() {
|
|
40
|
-
if (this.buffers.length === 1) {
|
|
41
|
-
return Buffer.from(this.buffers[0]);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const whole = new Uint8Array(this.length);
|
|
45
|
-
|
|
46
|
-
let offset = 0;
|
|
47
|
-
this.buffers.forEach((part) => {
|
|
48
|
-
whole.set(part, offset);
|
|
49
|
-
offset += part.length;
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return Buffer.from(whole);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
writeReverse(buf) {
|
|
56
|
-
assert(Buffer.isBuffer(buf));
|
|
57
|
-
this.write(Buffer.from(buf).reverse());
|
|
58
|
-
return this;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
writeUInt16LE(n) {
|
|
62
|
-
writeU16LE(this, n);
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
writeUInt16BE(n) {
|
|
67
|
-
var bw = new BufferWriter();
|
|
68
|
-
bw.writeUInt16LE(n);
|
|
69
|
-
this.writeReverse(bw.toBuffer());
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
writeUInt32LE(n) {
|
|
74
|
-
writeU32LE(this, n);
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
writeUInt32BE(n) {
|
|
79
|
-
var bw = new BufferWriter();
|
|
80
|
-
bw.writeUInt32LE(n);
|
|
81
|
-
this.writeReverse(bw.toBuffer());
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
writeUInt8(n) {
|
|
86
|
-
writeU8LE(this, n);
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
writeUInt64LEBN(bn) {
|
|
91
|
-
var buf = bn.toBuffer({ size: 8 });
|
|
92
|
-
this.writeReverse(buf);
|
|
93
|
-
return this;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
writeUInt64BEBN(bn) {
|
|
97
|
-
var bw = new BufferWriter();
|
|
98
|
-
bw.writeUInt64LEBN(bn);
|
|
99
|
-
this.writeReverse(bw.toBuffer());
|
|
100
|
-
return this;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
writeVarintNum(n) {
|
|
104
|
-
writeVarint(this, n);
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
writeInt32LE(n) {
|
|
109
|
-
writeI32LE(this, n);
|
|
110
|
-
return this;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
static varintBufNum(n) {
|
|
114
|
-
var bw = new BufferWriter();
|
|
115
|
-
bw.writeVarintNum(n);
|
|
116
|
-
return bw.toBuffer();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
writeVarintBN(bn) {
|
|
120
|
-
var n = bn.toNumber();
|
|
121
|
-
if (n < 253) {
|
|
122
|
-
writeU8LE(this, n);
|
|
123
|
-
} else if (n < 0x10000) {
|
|
124
|
-
writeU8LE(this, 253);
|
|
125
|
-
writeU16LE(this, n);
|
|
126
|
-
} else if (n < 0x100000000) {
|
|
127
|
-
writeU8LE(this, 254);
|
|
128
|
-
writeU32LE(this, n);
|
|
129
|
-
} else {
|
|
130
|
-
var bw = new BufferWriter();
|
|
131
|
-
bw.writeUInt8(255);
|
|
132
|
-
bw.writeUInt64LEBN(bn);
|
|
133
|
-
var buf = bw.toBuffer();
|
|
134
|
-
this.write(buf);
|
|
135
|
-
}
|
|
136
|
-
return this;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
module.exports = BufferWriter;
|
package/lib/encoding/varint.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var BufferWriter = require('./bufferwriter');
|
|
4
|
-
var BufferReader = require('./bufferreader');
|
|
5
|
-
var BN = require('../crypto/bn');
|
|
6
|
-
|
|
7
|
-
var Varint = function Varint(buf) {
|
|
8
|
-
if (!(this instanceof Varint)) {
|
|
9
|
-
return new Varint(buf);
|
|
10
|
-
}
|
|
11
|
-
if (Buffer.isBuffer(buf)) {
|
|
12
|
-
this.buf = buf;
|
|
13
|
-
} else if (typeof buf === 'number') {
|
|
14
|
-
var num = buf;
|
|
15
|
-
this.fromNumber(num);
|
|
16
|
-
} else if (buf instanceof BN) {
|
|
17
|
-
var bn = buf;
|
|
18
|
-
this.fromBN(bn);
|
|
19
|
-
} else if (buf) {
|
|
20
|
-
var obj = buf;
|
|
21
|
-
this.set(obj);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
Varint.prototype.set = function (obj) {
|
|
26
|
-
this.buf = obj.buf || this.buf;
|
|
27
|
-
return this;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
Varint.prototype.fromString = function (str) {
|
|
31
|
-
this.set({
|
|
32
|
-
buf: Buffer.from(str, 'hex'),
|
|
33
|
-
});
|
|
34
|
-
return this;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
Varint.prototype.toString = function () {
|
|
38
|
-
return this.buf.toString('hex');
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
Varint.prototype.fromBuffer = function (buf) {
|
|
42
|
-
this.buf = buf;
|
|
43
|
-
return this;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
Varint.prototype.fromBufferReader = function (br) {
|
|
47
|
-
this.buf = br.readVarintBuf();
|
|
48
|
-
return this;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
Varint.prototype.fromBN = function (bn) {
|
|
52
|
-
var bw = new BufferWriter();
|
|
53
|
-
this.buf = bw.writeVarintBN(bn).toBuffer();
|
|
54
|
-
return this;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
Varint.prototype.fromNumber = function (num) {
|
|
58
|
-
var bw = new BufferWriter();
|
|
59
|
-
this.buf = bw.writeVarintNum(num).toBuffer();
|
|
60
|
-
return this;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
Varint.prototype.toBuffer = function () {
|
|
64
|
-
return this.buf;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
Varint.prototype.toBN = function () {
|
|
68
|
-
return BufferReader(this.buf).readVarintBN();
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
Varint.prototype.toNumber = function () {
|
|
72
|
-
return BufferReader(this.buf).readVarintNum();
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
module.exports = Varint;
|
package/lib/hash-cache.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hash Cache
|
|
3
|
-
* ==========
|
|
4
|
-
*
|
|
5
|
-
* For use in sighash.
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
class HashCache {
|
|
10
|
-
constructor(prevoutsHashBuf, sequenceHashBuf, outputsHashBuf) {
|
|
11
|
-
this.prevoutsHashBuf = prevoutsHashBuf;
|
|
12
|
-
this.sequenceHashBuf = sequenceHashBuf;
|
|
13
|
-
this.outputsHashBuf = outputsHashBuf;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
static fromBuffer(buf) {
|
|
17
|
-
return HashCache.fromJSON(JSON.parse(buf.toString()));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
toBuffer() {
|
|
21
|
-
return Buffer.from(JSON.stringify(this.toJSON()));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static fromJSON(json) {
|
|
25
|
-
return new HashCache(
|
|
26
|
-
json.prevoutsHashBuf ? Buffer.from(json.prevoutsHashBuf, 'hex') : undefined,
|
|
27
|
-
json.sequenceHashBuf ? Buffer.from(json.sequenceHashBuf, 'hex') : undefined,
|
|
28
|
-
json.outputsHashBuf ? Buffer.from(json.outputsHashBuf, 'hex') : undefined,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
toJSON() {
|
|
33
|
-
return {
|
|
34
|
-
prevoutsHashBuf: this.prevoutsHashBuf ? this.prevoutsHashBuf.toString('hex') : undefined,
|
|
35
|
-
sequenceHashBuf: this.sequenceHashBuf ? this.sequenceHashBuf.toString('hex') : undefined,
|
|
36
|
-
outputsHashBuf: this.outputsHashBuf ? this.outputsHashBuf.toString('hex') : undefined,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
toHex() {
|
|
41
|
-
return this.toBuffer().toString('hex');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static fromHex(hex) {
|
|
45
|
-
const buf = Buffer.from(hex, 'hex');
|
|
46
|
-
return HashCache.fromBuffer(buf);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
module.exports = HashCache;
|
package/lib/mnemonic/pbkdf2.js
DELETED
package/lib/script/index.js
DELETED
package/lib/transaction/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
module.exports = require('./transaction');
|
|
2
|
-
|
|
3
|
-
module.exports.Input = require('./input');
|
|
4
|
-
module.exports.Output = require('./output');
|
|
5
|
-
module.exports.UnspentOutput = require('./unspentoutput');
|
|
6
|
-
module.exports.Signature = require('./signature');
|
|
7
|
-
module.exports.Sighash = require('./sighash');
|