bsv2 2.0.24 → 2.1.0
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/{.babelrc.test → .babel.test} +1 -1
- package/.husky/pre-commit +1 -1
- package/.mocharc.yml +1 -1
- package/.travis.yml +1 -1
- package/babel.config.cjs +44 -0
- package/benchmark.js +10 -18
- package/bin/bsv.js +1 -1
- package/bin/network.js +2 -1
- package/dist/bsv2.mjs +36061 -4
- package/dist/bsv2.umd.js +28 -0
- package/doc/assets/anchor.js +350 -0
- package/doc/assets/bass-addons.css +12 -0
- package/doc/assets/bass.css +544 -0
- package/doc/assets/fonts/EOT/SourceCodePro-Bold.eot +0 -0
- package/doc/assets/fonts/EOT/SourceCodePro-Regular.eot +0 -0
- package/doc/assets/fonts/LICENSE.txt +93 -0
- package/doc/assets/fonts/OTF/SourceCodePro-Bold.otf +0 -0
- package/doc/assets/fonts/OTF/SourceCodePro-Regular.otf +0 -0
- package/doc/assets/fonts/TTF/SourceCodePro-Bold.ttf +0 -0
- package/doc/assets/fonts/TTF/SourceCodePro-Regular.ttf +0 -0
- package/doc/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff +0 -0
- package/doc/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff +0 -0
- package/doc/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff +0 -0
- package/doc/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff +0 -0
- package/doc/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 +0 -0
- package/doc/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 +0 -0
- package/doc/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 +0 -0
- package/doc/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 +0 -0
- package/doc/assets/fonts/source-code-pro.css +23 -0
- package/doc/assets/github.css +123 -0
- package/doc/assets/site.js +168 -0
- package/doc/assets/split.css +15 -0
- package/doc/assets/split.js +782 -0
- package/doc/assets/style.css +147 -0
- package/doc/index.html +9461 -0
- package/entry.js +2 -3
- package/eslint.config.mjs +8 -0
- package/index.js +1 -5
- package/{karma.conf.js → karma.conf.ts} +2 -3
- package/lib/ach.js +5 -5
- package/lib/address.js +11 -9
- package/lib/aescbc.js +3 -3
- package/lib/bip-39.js +12 -11
- package/lib/block.js +2 -2
- package/lib/bn.js +12 -17
- package/lib/bsm.js +1 -1
- package/lib/config.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/ecdsa.js +24 -23
- package/lib/interp.js +18 -14
- package/lib/merkle.js +1 -1
- package/lib/op-code.js +137 -135
- package/lib/priv-key.js +1 -1
- package/lib/script.js +44 -42
- package/lib/sig.js +12 -12
- package/lib/struct.js +9 -6
- package/lib/tx.js +6 -6
- package/load-babel.js +3 -1
- package/mtest/test.html +6 -4
- package/mtest/test.js +1 -1
- package/out/Sig.html +541 -0
- package/out/bip-32.js.html +523 -0
- package/out/bip-39.js.html +336 -0
- package/out/block.js.html +183 -0
- package/out/bn.js.html +512 -0
- package/out/ecdsa.js.html +546 -0
- package/out/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/out/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/out/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/out/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/out/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/out/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/out/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/out/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/out/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/out/fonts/OpenSans-Light-webfont.eot +0 -0
- package/out/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/out/fonts/OpenSans-Light-webfont.woff +0 -0
- package/out/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/out/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/out/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/out/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/out/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/out/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/out/global.html +220 -0
- package/out/index.html +128 -0
- package/out/interp.js.html +2064 -0
- package/out/merkle.js.html +143 -0
- package/out/msg.js.html +235 -0
- package/out/priv-key.js.html +208 -0
- package/out/pub-key.js.html +281 -0
- package/out/script.js.html +876 -0
- package/out/scripts/linenumber.js +25 -0
- package/out/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/out/scripts/prettify/lang-css.js +2 -0
- package/out/scripts/prettify/prettify.js +28 -0
- package/out/sig-operations.js.html +171 -0
- package/out/sig.js.html +450 -0
- package/out/struct.js.html +440 -0
- package/out/styles/jsdoc-default.css +358 -0
- package/out/styles/prettify-jsdoc.css +111 -0
- package/out/styles/prettify-tomorrow.css +132 -0
- package/out/tx-builder.js.html +644 -0
- package/out/tx-in.js.html +223 -0
- package/out/tx-verifier.js.html +260 -0
- package/out/tx.js.html +481 -0
- package/package.json +34 -39
- package/vite.config.js +36 -0
- package/dist/bsv2.bundle.js +0 -8
- package/dist/bsv2.cjs.js +0 -2
- package/dist/bsv2.cjs.js.LICENSE.txt +0 -1
- package/dist/bsv2.module.js +0 -2
- /package/{webpack.config.js → mtest/webpack.config.js} +0 -0
package/.husky/pre-commit
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
npm test
|
|
1
|
+
#npm test
|
package/.mocharc.yml
CHANGED
package/.travis.yml
CHANGED
package/babel.config.cjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module.exports = function(api) {
|
|
2
|
+
api.cache(true)
|
|
3
|
+
let presets = []
|
|
4
|
+
let plugins = []
|
|
5
|
+
|
|
6
|
+
switch ( process.env['NODE_ENV'] ) {
|
|
7
|
+
case 'test':
|
|
8
|
+
presets = [
|
|
9
|
+
[
|
|
10
|
+
'@babel/preset-env',
|
|
11
|
+
{
|
|
12
|
+
targets: {
|
|
13
|
+
node: 'current',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
]
|
|
18
|
+
plugins = [
|
|
19
|
+
'babel-plugin-transform-import-meta',
|
|
20
|
+
'@babel/plugin-proposal-export-default-from',
|
|
21
|
+
'@babel/plugin-syntax-import-assertions'
|
|
22
|
+
]
|
|
23
|
+
break
|
|
24
|
+
default:
|
|
25
|
+
presets = [
|
|
26
|
+
[
|
|
27
|
+
'@babel/preset-env',
|
|
28
|
+
{
|
|
29
|
+
modules: false, //Setting this to false will preserve ES services
|
|
30
|
+
targets: {
|
|
31
|
+
node: 'current',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
]
|
|
36
|
+
plugins = ['@babel/plugin-syntax-import-assertions']
|
|
37
|
+
break
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
presets,
|
|
42
|
+
plugins,
|
|
43
|
+
}
|
|
44
|
+
}
|
package/benchmark.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const bsv2 = require('./dist/bsv2.umd.js')
|
|
2
|
+
const { Address, PrivKey, PubKey, TxBuilder, TxOut, Random, Bn, KeyPair } = bsv2
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
var randhex = 'adf4953b2e679fdc453d9cec93ba26c3bd9f0fb875975f3d72ed0c6c6835e26e'
|
|
13
|
-
var randbn = new Bn().fromHex(randhex)
|
|
14
|
-
var privateKey = PrivKey.fromBn(randbn)
|
|
15
|
-
var publicKey = PubKey.fromPrivKey(privateKey)
|
|
16
|
-
var keyPair = new KeyPair(privateKey, publicKey)
|
|
17
|
-
var fromAddress = Address.fromPrivKey(privateKey)
|
|
18
|
-
var toAddress = fromAddress
|
|
19
|
-
var changeAddress = toAddress
|
|
4
|
+
const randhex = 'adf4953b2e679fdc453d9cec93ba26c3bd9f0fb875975f3d72ed0c6c6835e26e'
|
|
5
|
+
const randbn = new Bn().fromHex(randhex)
|
|
6
|
+
const privateKey = PrivKey.fromBn(randbn)
|
|
7
|
+
const publicKey = PubKey.fromPrivKey(privateKey)
|
|
8
|
+
const keyPair = new KeyPair(privateKey, publicKey)
|
|
9
|
+
const fromAddress = Address.fromPrivKey(privateKey)
|
|
10
|
+
const toAddress = fromAddress
|
|
11
|
+
const changeAddress = toAddress
|
|
20
12
|
|
|
21
13
|
const n = 10000
|
|
22
14
|
const satoshis = 1e3
|
package/bin/bsv.js
CHANGED