bsv2 2.0.14 → 2.0.16

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/lib/bip-39.js CHANGED
@@ -26,13 +26,20 @@ import { Workers } from './workers'
26
26
 
27
27
  class Bip39 extends Struct {
28
28
  constructor (mnemonic, seed, wordlist ) {
29
- super({ mnemonic, seed,wordlist})
29
+ super({ mnemonic, seed, wordlist })
30
30
  this.Wordlist = en
31
- this.en = en
32
- this.es = es
31
+ this.es = es
33
32
  this.jp = jp
33
+
34
34
  }
35
35
 
36
+ setLang (lang){
37
+ switch(lang){
38
+ default: case "en": this.Wordlist = en; break;
39
+ case "es": this.Wordlist = es; break;
40
+ case "jp": this.Wordlist = jp; break;
41
+ }
42
+ }
36
43
  toBw (bw) {
37
44
  if (!bw) {
38
45
  bw = new Bw()
@@ -132,7 +139,7 @@ class Bip39 extends Struct {
132
139
  }
133
140
 
134
141
  fromString (mnemonic) {
135
- this.mnemonic = mnemonic
142
+ this.mnemonic = mnemonic.trim()
136
143
  return this
137
144
  }
138
145
 
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Test</title>
7
+ <script type="text/javascript" src="../dist/bsv2.bundle.js"></script>
8
+ <script type="text/javascript">
9
+ console.log(bsv2)
10
+ </script>
11
+ </head>
12
+ <body>
13
+
14
+ </body>
15
+ </html>
package/mtest/test.js ADDED
@@ -0,0 +1,2 @@
1
+ let bsv2 =require ('../dist/bsv.cjs.js');
2
+ console.log(bsv2)
package/mtest/test.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { Address } from '../dist/bsv2.mjs';
2
+ console.log(Address)
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "bsv2",
3
3
  "description": "Javascript library for Bitcoin SV (BSV).",
4
- "version": "2.0.14",
4
+ "version": "2.0.16",
5
5
  "author": "Tomás Díaz",
6
6
  "homepage": "https://github.com/samooth/bsv",
7
7
  "source": "entry.js",
8
- "main": "dist/bsv.cjs.js",
9
- "module": "dist/bsv.module.js",
10
- "unpkg": "dist/bsv.bundle.js",
11
- "library": "bsv",
8
+ "main": "dist/bsv2.cjs.js",
9
+ "module": "dist/bsv2.mjs",
10
+ "unpkg": "dist/bsv2.bundle.js",
11
+ "library": "bsv2",
12
12
  "scripts": {
13
13
  "clean": "rm -rf node_modules/* yarn.lock",
14
14
  "lint": "standard *.js lib/**/*.js bin/**/*.js test/**/*.js",
@@ -79,6 +79,8 @@
79
79
  "bsv",
80
80
  "blockchain",
81
81
  "bip32",
82
+ "bip38",
83
+ "bip44",
82
84
  "bip39",
83
85
  "bip68",
84
86
  "multisig",
package/webpack.config.js CHANGED
@@ -8,9 +8,9 @@ module.exports = [
8
8
  target: 'web',
9
9
  output: {
10
10
  path: path.resolve(__dirname, 'dist'),
11
- filename: 'bsv.bundle.js',
11
+ filename: 'bsv2.bundle.js',
12
12
  library: {
13
- name: 'bsv',
13
+ name: 'bsv2',
14
14
  type: 'umd2'
15
15
  }
16
16
  },
@@ -25,7 +25,9 @@ module.exports = [
25
25
  plugins: [
26
26
  new webpack.ProvidePlugin({
27
27
  process: 'process/browser',
28
- Buffer: [ "buffer", "Buffer"],
28
+ }),
29
+ new webpack.ProvidePlugin({
30
+ Buffer: ['buffer', 'Buffer']
29
31
  })
30
32
  ],
31
33
  devtool: 'source-map',
@@ -36,21 +38,36 @@ module.exports = [
36
38
  target: 'node',
37
39
  output: {
38
40
  path: path.resolve(__dirname, 'dist'),
39
- filename: 'bsv.module.js',
41
+ filename: 'bsv2.module.js',
40
42
  library: {
43
+ name: 'bsv2',
41
44
  type: 'commonjs-module'
42
45
  }
43
46
  },
44
47
  devtool: 'source-map',
45
48
  mode: 'production'
46
49
  },
50
+ {
51
+ entry: './entry.js',
52
+ experiments:{outputModule:true},
53
+ output: {
54
+ path: path.resolve(__dirname, 'dist'),
55
+ filename: 'bsv2.mjs',
56
+ library: {
57
+ type: 'module'
58
+ }
59
+ },
60
+ devtool: 'source-map',
61
+ mode: 'production'
62
+ },
47
63
  {
48
64
  entry: './entry.js',
49
65
  target: 'node',
50
66
  output: {
51
67
  path: path.resolve(__dirname, 'dist'),
52
- filename: 'bsv.cjs.js',
68
+ filename: 'bsv2.cjs.js',
53
69
  library: {
70
+ name: 'bsv2',
54
71
  type: 'commonjs2'
55
72
  }
56
73
  },