forked from bitpay/bitcore-lib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
69 lines (60 loc) · 2.56 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict';
var vertcore = module.exports;
// module information
vertcore.version = 'v' + require('./package.json').version;
vertcore.versionGuard = function(version) {
if (version !== undefined) {
var message = 'More than one instance of vertcore-lib found. ' +
'Please make sure to require vertcore-lib and check that submodules do' +
' not also include their own vertcore-lib dependency.';
throw new Error(message);
}
};
vertcore.versionGuard(global._vertcore);
global._vertcore = vertcore.version;
// crypto
vertcore.crypto = {};
vertcore.crypto.BN = require('./lib/crypto/bn');
vertcore.crypto.ECDSA = require('./lib/crypto/ecdsa');
vertcore.crypto.Hash = require('./lib/crypto/hash');
vertcore.crypto.Random = require('./lib/crypto/random');
vertcore.crypto.Point = require('./lib/crypto/point');
vertcore.crypto.Signature = require('./lib/crypto/signature');
// encoding
vertcore.encoding = {};
vertcore.encoding.Base58 = require('./lib/encoding/base58');
vertcore.encoding.Base58Check = require('./lib/encoding/base58check');
vertcore.encoding.BufferReader = require('./lib/encoding/bufferreader');
vertcore.encoding.BufferWriter = require('./lib/encoding/bufferwriter');
vertcore.encoding.Varint = require('./lib/encoding/varint');
// utilities
vertcore.util = {};
vertcore.util.buffer = require('./lib/util/buffer');
vertcore.util.js = require('./lib/util/js');
vertcore.util.preconditions = require('./lib/util/preconditions');
// errors thrown by the library
vertcore.errors = require('./lib/errors');
// main bitcoin library
vertcore.Address = require('./lib/address');
vertcore.Block = require('./lib/block');
vertcore.MerkleBlock = require('./lib/block/merkleblock');
vertcore.BlockHeader = require('./lib/block/blockheader');
vertcore.HDPrivateKey = require('./lib/hdprivatekey.js');
vertcore.HDPublicKey = require('./lib/hdpublickey.js');
vertcore.Networks = require('./lib/networks');
vertcore.Opcode = require('./lib/opcode');
vertcore.PrivateKey = require('./lib/privatekey');
vertcore.PublicKey = require('./lib/publickey');
vertcore.Script = require('./lib/script');
vertcore.Transaction = require('./lib/transaction');
vertcore.URI = require('./lib/uri');
vertcore.Unit = require('./lib/unit');
// dependencies, subject to change
vertcore.deps = {};
vertcore.deps.bnjs = require('bn.js');
vertcore.deps.bs58 = require('bs58');
vertcore.deps.Buffer = Buffer;
vertcore.deps.elliptic = require('elliptic');
vertcore.deps._ = require('lodash');
// Internal usage, exposed for testing/advanced tweaking
vertcore.Transaction.sighash = require('./lib/transaction/sighash');