-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
75 lines (64 loc) · 2.41 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
70
71
72
73
74
75
'use strict'
var bsv = {}
// module information
bsv.version = 'v' + require('./package.json').version
bsv.versionGuard = function (version) {
if (version !== undefined) {
var message = `
More than one instance of scrypt bsv found. other version: ${version}
Please make sure to require bsv and check that submodules do
not also include their own bsv dependency.`
console.warn(message)
}
}
bsv.versionGuard(global._scrypt_bsv)
global._scrypt_bsv = bsv.version
// crypto
bsv.crypto = {}
bsv.crypto.BN = require('./lib/crypto/bn')
bsv.crypto.ECDSA = require('./lib/crypto/ecdsa')
bsv.crypto.Hash = require('./lib/crypto/hash')
bsv.crypto.Random = require('./lib/crypto/random')
bsv.crypto.Point = require('./lib/crypto/point')
bsv.crypto.Signature = require('./lib/crypto/signature')
// encoding
bsv.encoding = {}
bsv.encoding.Base58 = require('./lib/encoding/base58')
bsv.encoding.Base58Check = require('./lib/encoding/base58check')
bsv.encoding.BufferReader = require('./lib/encoding/bufferreader')
bsv.encoding.BufferWriter = require('./lib/encoding/bufferwriter')
bsv.encoding.Varint = require('./lib/encoding/varint')
// utilities
bsv.util = {}
bsv.util.js = require('./lib/util/js')
bsv.util.preconditions = require('./lib/util/preconditions')
// errors thrown by the library
bsv.errors = require('./lib/errors')
// main bitcoin library
bsv.Address = require('./lib/address')
bsv.Block = require('./lib/block')
bsv.MerkleBlock = require('./lib/block/merkleblock')
bsv.BlockHeader = require('./lib/block/blockheader')
bsv.HDPrivateKey = require('./lib/hdprivatekey.js')
bsv.HDPublicKey = require('./lib/hdpublickey.js')
bsv.Networks = require('./lib/networks')
bsv.Opcode = require('./lib/opcode')
bsv.PrivateKey = require('./lib/privatekey')
bsv.PublicKey = require('./lib/publickey')
bsv.Script = require('./lib/script')
bsv.Transaction = require('./lib/transaction')
bsv.ECIES = require('./lib/ecies')
bsv.HashCache = require('./lib/hash-cache')
// dependencies, subject to change
bsv.deps = {}
bsv.deps.bnjs = require('bn.js')
bsv.deps.bs58 = require('bs58')
bsv.deps.Buffer = Buffer
bsv.deps.elliptic = require('elliptic')
bsv.deps._ = require('./lib/util/_')
// Internal usage, exposed for testing/advanced tweaking
bsv.Transaction.sighash = require('./lib/transaction/sighash')
bsv.Message = require('./lib/message/message')
bsv.Mnemonic = require('./lib/mnemonic/mnemonic')
module.exports = bsv
// export default bsv