Browse Source

initial push

master
peter 2 years ago
parent
commit
7ec7384c11
100 changed files with 2 additions and 17733 deletions
  1. 2
    0
      .gitignore
  2. 0
    1
      node_modules/.bin/sha.js
  3. 0
    1
      node_modules/.bin/tsc
  4. 0
    1
      node_modules/.bin/tsserver
  5. 0
    21
      node_modules/@types/node/LICENSE
  6. 0
    16
      node_modules/@types/node/README.md
  7. 0
    9219
      node_modules/@types/node/index.d.ts
  8. 0
    3163
      node_modules/@types/node/inspector.d.ts
  9. 0
    177
      node_modules/@types/node/package.json
  10. 0
    22
      node_modules/base-x/LICENSE.md
  11. 0
    67
      node_modules/base-x/README.md
  12. 0
    76
      node_modules/base-x/package.json
  13. 0
    7
      node_modules/base-x/src/index.d.ts
  14. 0
    120
      node_modules/base-x/src/index.js
  15. 0
    34
      node_modules/bech32/README.md
  16. 0
    147
      node_modules/bech32/index.js
  17. 0
    66
      node_modules/bech32/package.json
  18. 0
    22
      node_modules/bindings/LICENSE.md
  19. 0
    98
      node_modules/bindings/README.md
  20. 0
    221
      node_modules/bindings/bindings.js
  21. 0
    57
      node_modules/bindings/package.json
  22. 0
    21
      node_modules/bip174/LICENSE
  23. 0
    109
      node_modules/bip174/README.md
  24. 0
    77
      node_modules/bip174/package.json
  25. 0
    2
      node_modules/bip174/src/lib/combiner/index.d.ts
  26. 0
    89
      node_modules/bip174/src/lib/combiner/index.js
  27. 0
    6
      node_modules/bip174/src/lib/converter/global/globalXpub.d.ts
  28. 0
    83
      node_modules/bip174/src/lib/converter/global/globalXpub.js
  29. 0
    2
      node_modules/bip174/src/lib/converter/global/unsignedTx.d.ts
  30. 0
    10
      node_modules/bip174/src/lib/converter/global/unsignedTx.js
  31. 0
    71
      node_modules/bip174/src/lib/converter/index.d.ts
  32. 0
    61
      node_modules/bip174/src/lib/converter/index.js
  33. 0
    6
      node_modules/bip174/src/lib/converter/input/finalScriptSig.d.ts
  34. 0
    30
      node_modules/bip174/src/lib/converter/input/finalScriptSig.js
  35. 0
    6
      node_modules/bip174/src/lib/converter/input/finalScriptWitness.d.ts
  36. 0
    32
      node_modules/bip174/src/lib/converter/input/finalScriptWitness.js
  37. 0
    6
      node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.d.ts
  38. 0
    34
      node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.js
  39. 0
    6
      node_modules/bip174/src/lib/converter/input/partialSig.d.ts
  40. 0
    65
      node_modules/bip174/src/lib/converter/input/partialSig.js
  41. 0
    6
      node_modules/bip174/src/lib/converter/input/porCommitment.d.ts
  42. 0
    30
      node_modules/bip174/src/lib/converter/input/porCommitment.js
  43. 0
    6
      node_modules/bip174/src/lib/converter/input/sighashType.d.ts
  44. 0
    32
      node_modules/bip174/src/lib/converter/input/sighashType.js
  45. 0
    6
      node_modules/bip174/src/lib/converter/input/witnessUtxo.d.ts
  46. 0
    53
      node_modules/bip174/src/lib/converter/input/witnessUtxo.js
  47. 0
    8
      node_modules/bip174/src/lib/converter/shared/bip32Derivation.d.ts
  48. 0
    85
      node_modules/bip174/src/lib/converter/shared/bip32Derivation.js
  49. 0
    3
      node_modules/bip174/src/lib/converter/shared/checkPubkey.d.ts
  50. 0
    21
      node_modules/bip174/src/lib/converter/shared/checkPubkey.js
  51. 0
    8
      node_modules/bip174/src/lib/converter/shared/redeemScript.d.ts
  52. 0
    35
      node_modules/bip174/src/lib/converter/shared/redeemScript.js
  53. 0
    8
      node_modules/bip174/src/lib/converter/shared/witnessScript.d.ts
  54. 0
    37
      node_modules/bip174/src/lib/converter/shared/witnessScript.js
  55. 0
    8
      node_modules/bip174/src/lib/converter/tools.d.ts
  56. 0
    63
      node_modules/bip174/src/lib/converter/tools.js
  57. 0
    4
      node_modules/bip174/src/lib/converter/varint.d.ts
  58. 0
    77
      node_modules/bip174/src/lib/converter/varint.js
  59. 0
    93
      node_modules/bip174/src/lib/interfaces.d.ts
  60. 0
    2
      node_modules/bip174/src/lib/interfaces.js
  61. 0
    12
      node_modules/bip174/src/lib/parser/fromBuffer.d.ts
  62. 0
    336
      node_modules/bip174/src/lib/parser/fromBuffer.js
  63. 0
    8
      node_modules/bip174/src/lib/parser/index.d.ts
  64. 0
    7
      node_modules/bip174/src/lib/parser/index.js
  65. 0
    9
      node_modules/bip174/src/lib/parser/toBuffer.d.ts
  66. 0
    88
      node_modules/bip174/src/lib/parser/toBuffer.js
  67. 0
    25
      node_modules/bip174/src/lib/psbt.d.ts
  68. 0
    148
      node_modules/bip174/src/lib/psbt.js
  69. 0
    24
      node_modules/bip174/src/lib/typeFields.d.ts
  70. 0
    44
      node_modules/bip174/src/lib/typeFields.js
  71. 0
    14
      node_modules/bip174/src/lib/utils.d.ts
  72. 0
    141
      node_modules/bip174/src/lib/utils.js
  73. 0
    21
      node_modules/bip32/LICENSE
  74. 0
    35
      node_modules/bip32/README.md
  75. 0
    88
      node_modules/bip32/package.json
  76. 0
    290
      node_modules/bip32/src/bip32.js
  77. 0
    26
      node_modules/bip32/src/crypto.js
  78. 0
    7
      node_modules/bip32/src/index.js
  79. 0
    38
      node_modules/bip32/types/bip32.d.ts
  80. 0
    3
      node_modules/bip32/types/crypto.d.ts
  81. 0
    1
      node_modules/bip32/types/index.d.ts
  82. 0
    21
      node_modules/bip66/LICENSE
  83. 0
    40
      node_modules/bip66/README.md
  84. 0
    113
      node_modules/bip66/index.js
  85. 0
    64
      node_modules/bip66/package.json
  86. 0
    21
      node_modules/bitcoin-ops/LICENSE
  87. 0
    7
      node_modules/bitcoin-ops/README.md
  88. 0
    133
      node_modules/bitcoin-ops/index.json
  89. 0
    9
      node_modules/bitcoin-ops/map.js
  90. 0
    58
      node_modules/bitcoin-ops/package.json
  91. 0
    294
      node_modules/bitcoinjs-lib/CHANGELOG.md
  92. 0
    21
      node_modules/bitcoinjs-lib/LICENSE
  93. 0
    169
      node_modules/bitcoinjs-lib/README.md
  94. 0
    114
      node_modules/bitcoinjs-lib/package.json
  95. 0
    91
      node_modules/bitcoinjs-lib/src/address.js
  96. 0
    242
      node_modules/bitcoinjs-lib/src/block.js
  97. 0
    40
      node_modules/bitcoinjs-lib/src/bufferutils.js
  98. 0
    59
      node_modules/bitcoinjs-lib/src/classify.js
  99. 0
    35
      node_modules/bitcoinjs-lib/src/crypto.js
  100. 0
    0
      node_modules/bitcoinjs-lib/src/ecpair.js

node_modules/buffer-xor/.npmignore → .gitignore View File

@@ -1 +1,3 @@
1 1
 node_modules
2
+*.d.ts
3
+*.js

+ 0
- 1
node_modules/.bin/sha.js View File

@@ -1 +0,0 @@
1
-../sha.js/bin.js

+ 0
- 1
node_modules/.bin/tsc View File

@@ -1 +0,0 @@
1
-../typescript/bin/tsc

+ 0
- 1
node_modules/.bin/tsserver View File

@@ -1 +0,0 @@
1
-../typescript/bin/tsserver

+ 0
- 21
node_modules/@types/node/LICENSE View File

@@ -1,21 +0,0 @@
1
-    MIT License
2
-
3
-    Copyright (c) Microsoft Corporation. All rights reserved.
4
-
5
-    Permission is hereby granted, free of charge, to any person obtaining a copy
6
-    of this software and associated documentation files (the "Software"), to deal
7
-    in the Software without restriction, including without limitation the rights
8
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
-    copies of the Software, and to permit persons to whom the Software is
10
-    furnished to do so, subject to the following conditions:
11
-
12
-    The above copyright notice and this permission notice shall be included in all
13
-    copies or substantial portions of the Software.
14
-
15
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
-    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
-    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
-    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
-    SOFTWARE

+ 0
- 16
node_modules/@types/node/README.md View File

@@ -1,16 +0,0 @@
1
-# Installation
2
-> `npm install --save @types/node`
3
-
4
-# Summary
5
-This package contains type definitions for Node.js (http://nodejs.org/).
6
-
7
-# Details
8
-Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
9
-
10
-Additional Details
11
- * Last updated: Wed, 19 Dec 2018 18:17:49 GMT
12
- * Dependencies: none
13
- * Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout
14
-
15
-# Credits
16
-These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Jeremie Rodriguez <https://github.com/jeremiergz>, Samuel Ainsworth <https://github.com/samuela>.

+ 0
- 9219
node_modules/@types/node/index.d.ts
File diff suppressed because it is too large
View File


+ 0
- 3163
node_modules/@types/node/inspector.d.ts
File diff suppressed because it is too large
View File


+ 0
- 177
node_modules/@types/node/package.json View File

@@ -1,177 +0,0 @@
1
-{
2
-  "_from": "@types/node@10.12.18",
3
-  "_id": "@types/node@10.12.18",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==",
6
-  "_location": "/@types/node",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "version",
10
-    "registry": true,
11
-    "raw": "@types/node@10.12.18",
12
-    "name": "@types/node",
13
-    "escapedName": "@types%2fnode",
14
-    "scope": "@types",
15
-    "rawSpec": "10.12.18",
16
-    "saveSpec": null,
17
-    "fetchSpec": "10.12.18"
18
-  },
19
-  "_requiredBy": [
20
-    "/bip32",
21
-    "/bitcoinjs-lib"
22
-  ],
23
-  "_resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz",
24
-  "_shasum": "1d3ca764718915584fcd9f6344621b7672665c67",
25
-  "_spec": "@types/node@10.12.18",
26
-  "_where": "/home/cake/development/fb/vendor/btc-hdkey/node_modules/bitcoinjs-lib",
27
-  "bugs": {
28
-    "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
29
-  },
30
-  "bundleDependencies": false,
31
-  "contributors": [
32
-    {
33
-      "name": "Microsoft TypeScript",
34
-      "url": "https://github.com/Microsoft"
35
-    },
36
-    {
37
-      "name": "DefinitelyTyped",
38
-      "url": "https://github.com/DefinitelyTyped"
39
-    },
40
-    {
41
-      "name": "Alberto Schiabel",
42
-      "url": "https://github.com/jkomyno"
43
-    },
44
-    {
45
-      "name": "Alexander T.",
46
-      "url": "https://github.com/a-tarasyuk"
47
-    },
48
-    {
49
-      "name": "Alvis HT Tang",
50
-      "url": "https://github.com/alvis"
51
-    },
52
-    {
53
-      "name": "Andrew Makarov",
54
-      "url": "https://github.com/r3nya"
55
-    },
56
-    {
57
-      "name": "Bruno Scheufler",
58
-      "url": "https://github.com/brunoscheufler"
59
-    },
60
-    {
61
-      "name": "Chigozirim C.",
62
-      "url": "https://github.com/smac89"
63
-    },
64
-    {
65
-      "name": "Christian Vaagland Tellnes",
66
-      "url": "https://github.com/tellnes"
67
-    },
68
-    {
69
-      "name": "Deividas Bakanas",
70
-      "url": "https://github.com/DeividasBakanas"
71
-    },
72
-    {
73
-      "name": "Eugene Y. Q. Shen",
74
-      "url": "https://github.com/eyqs"
75
-    },
76
-    {
77
-      "name": "Flarna",
78
-      "url": "https://github.com/Flarna"
79
-    },
80
-    {
81
-      "name": "Hannes Magnusson",
82
-      "url": "https://github.com/Hannes-Magnusson-CK"
83
-    },
84
-    {
85
-      "name": "Hoàng Văn Khải",
86
-      "url": "https://github.com/KSXGitHub"
87
-    },
88
-    {
89
-      "name": "Huw",
90
-      "url": "https://github.com/hoo29"
91
-    },
92
-    {
93
-      "name": "Kelvin Jin",
94
-      "url": "https://github.com/kjin"
95
-    },
96
-    {
97
-      "name": "Klaus Meinhardt",
98
-      "url": "https://github.com/ajafff"
99
-    },
100
-    {
101
-      "name": "Lishude",
102
-      "url": "https://github.com/islishude"
103
-    },
104
-    {
105
-      "name": "Mariusz Wiktorczyk",
106
-      "url": "https://github.com/mwiktorczyk"
107
-    },
108
-    {
109
-      "name": "Matthieu Sieben",
110
-      "url": "https://github.com/matthieusieben"
111
-    },
112
-    {
113
-      "name": "Mohsen Azimi",
114
-      "url": "https://github.com/mohsen1"
115
-    },
116
-    {
117
-      "name": "Nicolas Even",
118
-      "url": "https://github.com/n-e"
119
-    },
120
-    {
121
-      "name": "Nicolas Voigt",
122
-      "url": "https://github.com/octo-sniffle"
123
-    },
124
-    {
125
-      "name": "Parambir Singh",
126
-      "url": "https://github.com/parambirs"
127
-    },
128
-    {
129
-      "name": "Sebastian Silbermann",
130
-      "url": "https://github.com/eps1lon"
131
-    },
132
-    {
133
-      "name": "Simon Schick",
134
-      "url": "https://github.com/SimonSchick"
135
-    },
136
-    {
137
-      "name": "Thomas den Hollander",
138
-      "url": "https://github.com/ThomasdenH"
139
-    },
140
-    {
141
-      "name": "Wilco Bakker",
142
-      "url": "https://github.com/WilcoBakker"
143
-    },
144
-    {
145
-      "name": "wwwy3y3",
146
-      "url": "https://github.com/wwwy3y3"
147
-    },
148
-    {
149
-      "name": "Zane Hannan AU",
150
-      "url": "https://github.com/ZaneHannanAU"
151
-    },
152
-    {
153
-      "name": "Jeremie Rodriguez",
154
-      "url": "https://github.com/jeremiergz"
155
-    },
156
-    {
157
-      "name": "Samuel Ainsworth",
158
-      "url": "https://github.com/samuela"
159
-    }
160
-  ],
161
-  "dependencies": {},
162
-  "deprecated": false,
163
-  "description": "TypeScript definitions for Node.js",
164
-  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
165
-  "license": "MIT",
166
-  "main": "",
167
-  "name": "@types/node",
168
-  "repository": {
169
-    "type": "git",
170
-    "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
171
-  },
172
-  "scripts": {},
173
-  "typeScriptVersion": "2.0",
174
-  "types": "index",
175
-  "typesPublisherContentHash": "2ab4e2583634afae0837756aa0330daeca55b67e8b9947d540c0efdd33becf3d",
176
-  "version": "10.12.18"
177
-}

+ 0
- 22
node_modules/base-x/LICENSE.md View File

@@ -1,22 +0,0 @@
1
-The MIT License (MIT)
2
-
3
-Copyright (c) 2018 base-x contributors
4
-Copyright (c) 2014-2018 The Bitcoin Core developers
5
-
6
-Permission is hereby granted, free of charge, to any person obtaining a copy
7
-of this software and associated documentation files (the "Software"), to deal
8
-in the Software without restriction, including without limitation the rights
9
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
-copies of the Software, and to permit persons to whom the Software is
11
-furnished to do so, subject to the following conditions:
12
-
13
-The above copyright notice and this permission notice shall be included in all
14
-copies or substantial portions of the Software.
15
-
16
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
-SOFTWARE.

+ 0
- 67
node_modules/base-x/README.md View File

@@ -1,67 +0,0 @@
1
-# base-x
2
-
3
-[![NPM Package](https://img.shields.io/npm/v/base-x.svg?style=flat-square)](https://www.npmjs.org/package/base-x)
4
-[![Build Status](https://img.shields.io/travis/cryptocoinjs/base-x.svg?branch=master&style=flat-square)](https://travis-ci.org/cryptocoinjs/base-x)
5
-
6
-[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
7
-
8
-Fast base encoding / decoding of any given alphabet using bitcoin style leading
9
-zero compression.
10
-
11
-**WARNING:** This module is **NOT RFC3548** compliant,  it cannot be used for base16 (hex), base32, or base64 encoding in a standards compliant manner. 
12
-
13
-## Example
14
-
15
-Base58
16
-
17
-``` javascript
18
-var BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
19
-var bs58 = require('base-x')(BASE58)
20
-
21
-var decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')
22
-
23
-console.log(decoded)
24
-// => <Buffer 80 ed db dc 11 68 f1 da ea db d3 e4 4c 1e 3f 8f 5a 28 4c 20 29 f7 8a d2 6a f9 85 83 a4 99 de 5b 19>
25
-
26
-console.log(bs58.encode(decoded))
27
-// => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr
28
-```
29
-
30
-### Alphabets
31
-
32
-See below for a list of commonly recognized alphabets, and their respective base.
33
-
34
-Base | Alphabet
35
-------------- | -------------
36
-2 | `01`
37
-8 | `01234567`
38
-11 | `0123456789a`
39
-16 | `0123456789abcdef`
40
-32 | `0123456789ABCDEFGHJKMNPQRSTVWXYZ`
41
-32 | `ybndrfg8ejkmcpqxot1uwisza345h769` (z-base-32)
42
-36 | `0123456789abcdefghijklmnopqrstuvwxyz`
43
-58 | `123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`
44
-62 | `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`
45
-64 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`
46
-66 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~`
47
-
48
-
49
-## How it works
50
-
51
-It encodes octet arrays by doing long divisions on all significant digits in the
52
-array, creating a representation of that number in the new base. Then for every
53
-leading zero in the input (not significant as a number) it will encode as a
54
-single leader character. This is the first in the alphabet and will decode as 8
55
-bits. The other characters depend upon the base. For example, a base58 alphabet
56
-packs roughly 5.858 bits per character.
57
-
58
-This means the encoded string 000f (using a base16, 0-f alphabet) will actually decode
59
-to 4 bytes unlike a canonical hex encoding which uniformly packs 4 bits into each
60
-character.
61
-
62
-While unusual, this does mean that no padding is required and it works for bases
63
-like 43. 
64
-
65
-
66
-## LICENSE [MIT](LICENSE)
67
-A direct derivation of the base58 implementation from [`bitcoin/bitcoin`](https://github.com/bitcoin/bitcoin/blob/f1e2f2a85962c1664e4e55471061af0eaa798d40/src/base58.cpp),  generalized for variable length alphabets.

+ 0
- 76
node_modules/base-x/package.json View File

@@ -1,76 +0,0 @@
1
-{
2
-  "_from": "base-x@^3.0.2",
3
-  "_id": "base-x@3.0.6",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-4PaF8u2+AlViJxRVjurkLTxpp7CaFRD/jo5rPT9ONnKxyhQ8f59yzamEvq7EkriG56yn5On4ONyaG75HLqr46w==",
6
-  "_location": "/base-x",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "base-x@^3.0.2",
12
-    "name": "base-x",
13
-    "escapedName": "base-x",
14
-    "rawSpec": "^3.0.2",
15
-    "saveSpec": null,
16
-    "fetchSpec": "^3.0.2"
17
-  },
18
-  "_requiredBy": [
19
-    "/bs58check/bs58"
20
-  ],
21
-  "_resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.6.tgz",
22
-  "_shasum": "de047ec95f5f7b99ae63d830a2a894c96538b2cd",
23
-  "_spec": "base-x@^3.0.2",
24
-  "_where": "/home/cake/development/fb/vendor/btc-hdkey/node_modules/bs58check/node_modules/bs58",
25
-  "author": {
26
-    "name": "Daniel Cousens"
27
-  },
28
-  "bugs": {
29
-    "url": "https://github.com/cryptocoinjs/base-x/issues"
30
-  },
31
-  "bundleDependencies": false,
32
-  "dependencies": {
33
-    "safe-buffer": "^5.0.1"
34
-  },
35
-  "deprecated": false,
36
-  "description": "Fast base encoding / decoding of any given alphabet",
37
-  "devDependencies": {
38
-    "@types/node": "12.0.10",
39
-    "standard": "^10.0.3",
40
-    "tape": "^4.5.1",
41
-    "typescript": "3.5.2"
42
-  },
43
-  "files": [
44
-    "src"
45
-  ],
46
-  "homepage": "https://github.com/cryptocoinjs/base-x",
47
-  "keywords": [
48
-    "base-x",
49
-    "base58",
50
-    "base62",
51
-    "base64",
52
-    "crypto",
53
-    "crytography",
54
-    "decode",
55
-    "decoding",
56
-    "encode",
57
-    "encoding"
58
-  ],
59
-  "license": "MIT",
60
-  "main": "src/index.js",
61
-  "name": "base-x",
62
-  "repository": {
63
-    "type": "git",
64
-    "url": "git+https://github.com/cryptocoinjs/base-x.git"
65
-  },
66
-  "scripts": {
67
-    "build": "tsc -p ./tsconfig.json ; standard --fix",
68
-    "gitdiff": "npm run build && git diff --exit-code",
69
-    "prepublish": "npm run gitdiff",
70
-    "standard": "standard",
71
-    "test": "npm run unit && npm run standard",
72
-    "unit": "tape test/*.js"
73
-  },
74
-  "types": "src/index.d.ts",
75
-  "version": "3.0.6"
76
-}

+ 0
- 7
node_modules/base-x/src/index.d.ts View File

@@ -1,7 +0,0 @@
1
-/// <reference types="node" />
2
-declare function base(ALPHABET: string): {
3
-    encode: (source: Buffer) => string;
4
-    decodeUnsafe: (source: string) => Buffer | undefined;
5
-    decode: (string: string) => Buffer;
6
-};
7
-export = base;

+ 0
- 120
node_modules/base-x/src/index.js View File

@@ -1,120 +0,0 @@
1
-'use strict'
2
-// base-x encoding / decoding
3
-// Copyright (c) 2018 base-x contributors
4
-// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
5
-// Distributed under the MIT software license, see the accompanying
6
-// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
7
-// @ts-ignore
8
-var _Buffer = require('safe-buffer').Buffer
9
-function base (ALPHABET) {
10
-  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
11
-  var BASE_MAP = new Uint8Array(256)
12
-  BASE_MAP.fill(255)
13
-  for (var i = 0; i < ALPHABET.length; i++) {
14
-    var x = ALPHABET.charAt(i)
15
-    var xc = x.charCodeAt(0)
16
-    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
17
-    BASE_MAP[xc] = i
18
-  }
19
-  var BASE = ALPHABET.length
20
-  var LEADER = ALPHABET.charAt(0)
21
-  var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
22
-  var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
23
-  function encode (source) {
24
-    if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') }
25
-    if (source.length === 0) { return '' }
26
-        // Skip & count leading zeroes.
27
-    var zeroes = 0
28
-    var length = 0
29
-    var pbegin = 0
30
-    var pend = source.length
31
-    while (pbegin !== pend && source[pbegin] === 0) {
32
-      pbegin++
33
-      zeroes++
34
-    }
35
-        // Allocate enough space in big-endian base58 representation.
36
-    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0
37
-    var b58 = new Uint8Array(size)
38
-        // Process the bytes.
39
-    while (pbegin !== pend) {
40
-      var carry = source[pbegin]
41
-            // Apply "b58 = b58 * 256 + ch".
42
-      var i = 0
43
-      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
44
-        carry += (256 * b58[it1]) >>> 0
45
-        b58[it1] = (carry % BASE) >>> 0
46
-        carry = (carry / BASE) >>> 0
47
-      }
48
-      if (carry !== 0) { throw new Error('Non-zero carry') }
49
-      length = i
50
-      pbegin++
51
-    }
52
-        // Skip leading zeroes in base58 result.
53
-    var it2 = size - length
54
-    while (it2 !== size && b58[it2] === 0) {
55
-      it2++
56
-    }
57
-        // Translate the result into a string.
58
-    var str = LEADER.repeat(zeroes)
59
-    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
60
-    return str
61
-  }
62
-  function decodeUnsafe (source) {
63
-    if (typeof source !== 'string') { throw new TypeError('Expected String') }
64
-    if (source.length === 0) { return _Buffer.alloc(0) }
65
-    var psz = 0
66
-        // Skip leading spaces.
67
-    if (source[psz] === ' ') { return }
68
-        // Skip and count leading '1's.
69
-    var zeroes = 0
70
-    var length = 0
71
-    while (source[psz] === LEADER) {
72
-      zeroes++
73
-      psz++
74
-    }
75
-        // Allocate enough space in big-endian base256 representation.
76
-    var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
77
-    var b256 = new Uint8Array(size)
78
-        // Process the characters.
79
-    while (source[psz]) {
80
-            // Decode character
81
-      var carry = BASE_MAP[source.charCodeAt(psz)]
82
-            // Invalid character
83
-      if (carry === 255) { return }
84
-      var i = 0
85
-      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
86
-        carry += (BASE * b256[it3]) >>> 0
87
-        b256[it3] = (carry % 256) >>> 0
88
-        carry = (carry / 256) >>> 0
89
-      }
90
-      if (carry !== 0) { throw new Error('Non-zero carry') }
91
-      length = i
92
-      psz++
93
-    }
94
-        // Skip trailing spaces.
95
-    if (source[psz] === ' ') { return }
96
-        // Skip leading zeroes in b256.
97
-    var it4 = size - length
98
-    while (it4 !== size && b256[it4] === 0) {
99
-      it4++
100
-    }
101
-    var vch = _Buffer.allocUnsafe(zeroes + (size - it4))
102
-    vch.fill(0x00, 0, zeroes)
103
-    var j = zeroes
104
-    while (it4 !== size) {
105
-      vch[j++] = b256[it4++]
106
-    }
107
-    return vch
108
-  }
109
-  function decode (string) {
110
-    var buffer = decodeUnsafe(string)
111
-    if (buffer) { return buffer }
112
-    throw new Error('Non-base' + BASE + ' character')
113
-  }
114
-  return {
115
-    encode: encode,
116
-    decodeUnsafe: decodeUnsafe,
117
-    decode: decode
118
-  }
119
-}
120
-module.exports = base

+ 0
- 34
node_modules/bech32/README.md View File

@@ -1,34 +0,0 @@
1
-# bech32
2
-[![build status](https://secure.travis-ci.org/bitcoinjs/bech32.png)](http://travis-ci.org/bitcoinjs/bech32)
3
-[![Version](http://img.shields.io/npm/v/bech32.svg)](https://www.npmjs.org/package/bech32)
4
-
5
-A [BIP173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) compatible Bech32 encoding/decoding library.
6
-
7
-
8
-## Example
9
-``` javascript
10
-let bech32 = require('bech32')
11
-
12
-bech32.decode('abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw')
13
-// => {
14
-// 	 prefix: 'abcdef',
15
-// 	 words: [0,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]
16
-// }
17
-
18
-let words = bech32.toWords(Buffer.from('foobar', 'utf8'))
19
-bech32.encode('foo', words)
20
-// => 'foo1vehk7cnpwgry9h96'
21
-```
22
-
23
-
24
-### Advanced
25
-BIP173 enforces a limitation of 90 characters,  if extend the `LIMIT` parameter beyond this,  be aware that the [effectiveness of checksum decreases as the length increases](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#checksum-design).
26
-
27
-It is highly recommended **NOT** exceed 1023 characters, as the module could only guarantee detecting 1 error.
28
-
29
-
30
-## Credits
31
-- [Peter Wuille](https://github.com/sipa/bech32) for the reference JavaScript implementation, and for authoring the Bech32 [BIP173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).
32
-
33
-
34
-## License [MIT](LICENSE)

+ 0
- 147
node_modules/bech32/index.js View File

@@ -1,147 +0,0 @@
1
-'use strict'
2
-var ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'
3
-
4
-// pre-compute lookup table
5
-var ALPHABET_MAP = {}
6
-for (var z = 0; z < ALPHABET.length; z++) {
7
-  var x = ALPHABET.charAt(z)
8
-
9
-  if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
10
-  ALPHABET_MAP[x] = z
11
-}
12
-
13
-function polymodStep (pre) {
14
-  var b = pre >> 25
15
-  return ((pre & 0x1FFFFFF) << 5) ^
16
-    (-((b >> 0) & 1) & 0x3b6a57b2) ^
17
-    (-((b >> 1) & 1) & 0x26508e6d) ^
18
-    (-((b >> 2) & 1) & 0x1ea119fa) ^
19
-    (-((b >> 3) & 1) & 0x3d4233dd) ^
20
-    (-((b >> 4) & 1) & 0x2a1462b3)
21
-}
22
-
23
-function prefixChk (prefix) {
24
-  var chk = 1
25
-  for (var i = 0; i < prefix.length; ++i) {
26
-    var c = prefix.charCodeAt(i)
27
-    if (c < 33 || c > 126) throw new Error('Invalid prefix (' + prefix + ')')
28
-
29
-    chk = polymodStep(chk) ^ (c >> 5)
30
-  }
31
-  chk = polymodStep(chk)
32
-
33
-  for (i = 0; i < prefix.length; ++i) {
34
-    var v = prefix.charCodeAt(i)
35
-    chk = polymodStep(chk) ^ (v & 0x1f)
36
-  }
37
-  return chk
38
-}
39
-
40
-function encode (prefix, words, LIMIT) {
41
-  LIMIT = LIMIT || 90
42
-  if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')
43
-
44
-  prefix = prefix.toLowerCase()
45
-
46
-  // determine chk mod
47
-  var chk = prefixChk(prefix)
48
-  var result = prefix + '1'
49
-  for (var i = 0; i < words.length; ++i) {
50
-    var x = words[i]
51
-    if ((x >> 5) !== 0) throw new Error('Non 5-bit word')
52
-
53
-    chk = polymodStep(chk) ^ x
54
-    result += ALPHABET.charAt(x)
55
-  }
56
-
57
-  for (i = 0; i < 6; ++i) {
58
-    chk = polymodStep(chk)
59
-  }
60
-  chk ^= 1
61
-
62
-  for (i = 0; i < 6; ++i) {
63
-    var v = (chk >> ((5 - i) * 5)) & 0x1f
64
-    result += ALPHABET.charAt(v)
65
-  }
66
-
67
-  return result
68
-}
69
-
70
-function decode (str, LIMIT) {
71
-  LIMIT = LIMIT || 90
72
-  if (str.length < 8) throw new TypeError(str + ' too short')
73
-  if (str.length > LIMIT) throw new TypeError('Exceeds length limit')
74
-
75
-  // don't allow mixed case
76
-  var lowered = str.toLowerCase()
77
-  var uppered = str.toUpperCase()
78
-  if (str !== lowered && str !== uppered) throw new Error('Mixed-case string ' + str)
79
-  str = lowered
80
-
81
-  var split = str.lastIndexOf('1')
82
-  if (split === -1) throw new Error('No separator character for ' + str)
83
-  if (split === 0) throw new Error('Missing prefix for ' + str)
84
-
85
-  var prefix = str.slice(0, split)
86
-  var wordChars = str.slice(split + 1)
87
-  if (wordChars.length < 6) throw new Error('Data too short')
88
-
89
-  var chk = prefixChk(prefix)
90
-  var words = []
91
-  for (var i = 0; i < wordChars.length; ++i) {
92
-    var c = wordChars.charAt(i)
93
-    var v = ALPHABET_MAP[c]
94
-    if (v === undefined) throw new Error('Unknown character ' + c)
95
-    chk = polymodStep(chk) ^ v
96
-
97
-    // not in the checksum?
98
-    if (i + 6 >= wordChars.length) continue
99
-    words.push(v)
100
-  }
101
-
102
-  if (chk !== 1) throw new Error('Invalid checksum for ' + str)
103
-  return { prefix: prefix, words: words }
104
-}
105
-
106
-function convert (data, inBits, outBits, pad) {
107
-  var value = 0
108
-  var bits = 0
109
-  var maxV = (1 << outBits) - 1
110
-
111
-  var result = []
112
-  for (var i = 0; i < data.length; ++i) {
113
-    value = (value << inBits) | data[i]
114
-    bits += inBits
115
-
116
-    while (bits >= outBits) {
117
-      bits -= outBits
118
-      result.push((value >> bits) & maxV)
119
-    }
120
-  }
121
-
122
-  if (pad) {
123
-    if (bits > 0) {
124
-      result.push((value << (outBits - bits)) & maxV)
125
-    }
126
-  } else {
127
-    if (bits >= inBits) throw new Error('Excess padding')
128
-    if ((value << (outBits - bits)) & maxV) throw new Error('Non-zero padding')
129
-  }
130
-
131
-  return result
132
-}
133
-
134
-function toWords (bytes) {
135
-  return convert(bytes, 8, 5, true)
136
-}
137
-
138
-function fromWords (words) {
139
-  return convert(words, 5, 8, false)
140
-}
141
-
142
-module.exports = {
143
-  decode: decode,
144
-  encode: encode,
145
-  toWords: toWords,
146
-  fromWords: fromWords
147
-}

+ 0
- 66
node_modules/bech32/package.json View File

@@ -1,66 +0,0 @@
1
-{
2
-  "_from": "bech32@^1.1.2",
3
-  "_id": "bech32@1.1.3",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-yuVFUvrNcoJi0sv5phmqc6P+Fl1HjRDRNOOkHY2X/3LBy2bIGNSFx4fZ95HMaXHupuS7cZR15AsvtmCIF4UEyg==",
6
-  "_location": "/bech32",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "bech32@^1.1.2",
12
-    "name": "bech32",
13
-    "escapedName": "bech32",
14
-    "rawSpec": "^1.1.2",
15
-    "saveSpec": null,
16
-    "fetchSpec": "^1.1.2"
17
-  },
18
-  "_requiredBy": [
19
-    "/bitcoinjs-lib"
20
-  ],
21
-  "_resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.3.tgz",
22
-  "_shasum": "bd47a8986bbb3eec34a56a097a84b8d3e9a2dfcd",
23
-  "_spec": "bech32@^1.1.2",
24
-  "_where": "/home/cake/development/fb/vendor/btc-hdkey/node_modules/bitcoinjs-lib",
25
-  "bugs": {
26
-    "url": "https://github.com/bitcoinjs/bech32/issues"
27
-  },
28
-  "bundleDependencies": false,
29
-  "dependencies": {},
30
-  "deprecated": false,
31
-  "description": "Bech32 encoding / decoding",
32
-  "devDependencies": {
33
-    "nyc": "^10.2.0",
34
-    "standard": "*",
35
-    "tap-dot": "*",
36
-    "tape": "^4.6.3"
37
-  },
38
-  "files": [
39
-    "index.js"
40
-  ],
41
-  "homepage": "https://github.com/bitcoinjs/bech32#readme",
42
-  "keywords": [
43
-    "base32",
44
-    "bech32",
45
-    "bitcoin",
46
-    "crypto",
47
-    "crytography",
48
-    "decode",
49
-    "decoding",
50
-    "encode",
51
-    "encoding"
52
-  ],
53
-  "license": "MIT",
54
-  "main": "index.js",
55
-  "name": "bech32",
56
-  "repository": {
57
-    "url": "git+ssh://git@github.com/bitcoinjs/bech32.git",
58
-    "type": "git"
59
-  },
60
-  "scripts": {
61
-    "coverage": "nyc --check-coverage --branches 90 --functions 90 tape test/*.js",
62
-    "standard": "standard",
63
-    "test": "tape test/*.js | tap-dot"
64
-  },
65
-  "version": "1.1.3"
66
-}

+ 0
- 22
node_modules/bindings/LICENSE.md View File

@@ -1,22 +0,0 @@
1
-(The MIT License)
2
-
3
-Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining
6
-a copy of this software and associated documentation files (the
7
-'Software'), to deal in the Software without restriction, including
8
-without limitation the rights to use, copy, modify, merge, publish,
9
-distribute, sublicense, and/or sell copies of the Software, and to
10
-permit persons to whom the Software is furnished to do so, subject to
11
-the following conditions:
12
-
13
-The above copyright notice and this permission notice shall be
14
-included in all copies or substantial portions of the Software.
15
-
16
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 98
node_modules/bindings/README.md View File

@@ -1,98 +0,0 @@
1
-node-bindings
2
-=============
3
-### Helper module for loading your native module's `.node` file
4
-
5
-This is a helper module for authors of Node.js native addon modules.
6
-It is basically the "swiss army knife" of `require()`ing your native module's
7
-`.node` file.
8
-
9
-Throughout the course of Node's native addon history, addons have ended up being
10
-compiled in a variety of different places, depending on which build tool and which
11
-version of node was used. To make matters worse, now the `gyp` build tool can
12
-produce either a __Release__ or __Debug__ build, each being built into different
13
-locations.
14
-
15
-This module checks _all_ the possible locations that a native addon would be built
16
-at, and returns the first one that loads successfully.
17
-
18
-
19
-Installation
20
-------------
21
-
22
-Install with `npm`:
23
-
24
-``` bash
25
-$ npm install --save bindings
26
-```
27
-
28
-Or add it to the `"dependencies"` section of your `package.json` file.
29
-
30
-
31
-Example
32
--------
33
-
34
-`require()`ing the proper bindings file for the current node version, platform
35
-and architecture is as simple as:
36
-
37
-``` js
38
-var bindings = require('bindings')('binding.node')
39
-
40
-// Use your bindings defined in your C files
41
-bindings.your_c_function()
42
-```
43
-
44
-
45
-Nice Error Output
46
------------------
47
-
48
-When the `.node` file could not be loaded, `node-bindings` throws an Error with
49
-a nice error message telling you exactly what was tried. You can also check the
50
-`err.tries` Array property.
51
-
52
-```
53
-Error: Could not load the bindings file. Tried:
54
- → /Users/nrajlich/ref/build/binding.node
55
- → /Users/nrajlich/ref/build/Debug/binding.node
56
- → /Users/nrajlich/ref/build/Release/binding.node
57
- → /Users/nrajlich/ref/out/Debug/binding.node
58
- → /Users/nrajlich/ref/Debug/binding.node
59
- → /Users/nrajlich/ref/out/Release/binding.node
60
- → /Users/nrajlich/ref/Release/binding.node
61
- → /Users/nrajlich/ref/build/default/binding.node
62
- → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node
63
-    at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13)
64
-    at Object.<anonymous> (/Users/nrajlich/ref/lib/ref.js:5:47)
65
-    at Module._compile (module.js:449:26)
66
-    at Object.Module._extensions..js (module.js:467:10)
67
-    at Module.load (module.js:356:32)
68
-    at Function.Module._load (module.js:312:12)
69
-    ...
70
-```
71
-
72
-The searching for the `.node` file will originate from the first directory in which has a `package.json` file is found.
73
-
74
-License
75
--------
76
-
77
-(The MIT License)
78
-
79
-Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
80
-
81
-Permission is hereby granted, free of charge, to any person obtaining
82
-a copy of this software and associated documentation files (the
83
-'Software'), to deal in the Software without restriction, including
84
-without limitation the rights to use, copy, modify, merge, publish,
85
-distribute, sublicense, and/or sell copies of the Software, and to
86
-permit persons to whom the Software is furnished to do so, subject to
87
-the following conditions:
88
-
89
-The above copyright notice and this permission notice shall be
90
-included in all copies or substantial portions of the Software.
91
-
92
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
93
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
94
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
95
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
96
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
97
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
98
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 221
node_modules/bindings/bindings.js View File

@@ -1,221 +0,0 @@
1
-/**
2
- * Module dependencies.
3
- */
4
-
5
-var fs = require('fs'),
6
-  path = require('path'),
7
-  fileURLToPath = require('file-uri-to-path'),
8
-  join = path.join,
9
-  dirname = path.dirname,
10
-  exists =
11
-    (fs.accessSync &&
12
-      function(path) {
13
-        try {
14
-          fs.accessSync(path);
15
-        } catch (e) {
16
-          return false;
17
-        }
18
-        return true;
19
-      }) ||
20
-    fs.existsSync ||
21
-    path.existsSync,
22
-  defaults = {
23
-    arrow: process.env.NODE_BINDINGS_ARROW || ' → ',
24
-    compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',
25
-    platform: process.platform,
26
-    arch: process.arch,
27
-    nodePreGyp:
28
-      'node-v' +
29
-      process.versions.modules +
30
-      '-' +
31
-      process.platform +
32
-      '-' +
33
-      process.arch,
34
-    version: process.versions.node,
35
-    bindings: 'bindings.node',
36
-    try: [
37
-      // node-gyp's linked version in the "build" dir
38
-      ['module_root', 'build', 'bindings'],
39
-      // node-waf and gyp_addon (a.k.a node-gyp)
40
-      ['module_root', 'build', 'Debug', 'bindings'],
41
-      ['module_root', 'build', 'Release', 'bindings'],
42
-      // Debug files, for development (legacy behavior, remove for node v0.9)
43
-      ['module_root', 'out', 'Debug', 'bindings'],
44
-      ['module_root', 'Debug', 'bindings'],
45
-      // Release files, but manually compiled (legacy behavior, remove for node v0.9)
46
-      ['module_root', 'out', 'Release', 'bindings'],
47
-      ['module_root', 'Release', 'bindings'],
48
-      // Legacy from node-waf, node <= 0.4.x
49
-      ['module_root', 'build', 'default', 'bindings'],
50
-      // Production "Release" buildtype binary (meh...)
51
-      ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],
52
-      // node-qbs builds
53
-      ['module_root', 'addon-build', 'release', 'install-root', 'bindings'],
54
-      ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'],
55
-      ['module_root', 'addon-build', 'default', 'install-root', 'bindings'],
56
-      // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
57
-      ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']
58
-    ]
59
-  };
60
-
61
-/**
62
- * The main `bindings()` function loads the compiled bindings for a given module.
63
- * It uses V8's Error API to determine the parent filename that this function is
64
- * being invoked from, which is then used to find the root directory.
65
- */
66
-
67
-function bindings(opts) {
68
-  // Argument surgery
69
-  if (typeof opts == 'string') {
70
-    opts = { bindings: opts };
71
-  } else if (!opts) {
72
-    opts = {};
73
-  }
74
-
75
-  // maps `defaults` onto `opts` object
76
-  Object.keys(defaults).map(function(i) {
77
-    if (!(i in opts)) opts[i] = defaults[i];
78
-  });
79
-
80
-  // Get the module root
81
-  if (!opts.module_root) {
82
-    opts.module_root = exports.getRoot(exports.getFileName());
83
-  }
84
-
85
-  // Ensure the given bindings name ends with .node
86
-  if (path.extname(opts.bindings) != '.node') {
87
-    opts.bindings += '.node';
88
-  }
89
-
90
-  // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
91
-  var requireFunc =
92
-    typeof __webpack_require__ === 'function'
93
-      ? __non_webpack_require__
94
-      : require;
95
-
96
-  var tries = [],
97
-    i = 0,
98
-    l = opts.try.length,
99
-    n,
100
-    b,
101
-    err;
102
-
103
-  for (; i < l; i++) {
104
-    n = join.apply(
105
-      null,
106
-      opts.try[i].map(function(p) {
107
-        return opts[p] || p;
108
-      })
109
-    );
110
-    tries.push(n);
111
-    try {
112
-      b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
113
-      if (!opts.path) {
114
-        b.path = n;
115
-      }
116
-      return b;
117
-    } catch (e) {
118
-      if (e.code !== 'MODULE_NOT_FOUND' &&
119
-          e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&
120
-          !/not find/i.test(e.message)) {
121
-        throw e;
122
-      }
123
-    }
124
-  }
125
-
126
-  err = new Error(
127
-    'Could not locate the bindings file. Tried:\n' +
128
-      tries
129
-        .map(function(a) {
130
-          return opts.arrow + a;
131
-        })
132
-        .join('\n')
133
-  );
134
-  err.tries = tries;
135
-  throw err;
136
-}
137
-module.exports = exports = bindings;
138
-
139
-/**
140
- * Gets the filename of the JavaScript file that invokes this function.
141
- * Used to help find the root directory of a module.
142
- * Optionally accepts an filename argument to skip when searching for the invoking filename
143
- */
144
-
145
-exports.getFileName = function getFileName(calling_file) {
146
-  var origPST = Error.prepareStackTrace,
147
-    origSTL = Error.stackTraceLimit,
148
-    dummy = {},
149
-    fileName;
150
-
151
-  Error.stackTraceLimit = 10;
152
-
153
-  Error.prepareStackTrace = function(e, st) {
154
-    for (var i = 0, l = st.length; i < l; i++) {
155
-      fileName = st[i].getFileName();
156
-      if (fileName !== __filename) {
157
-        if (calling_file) {
158
-          if (fileName !== calling_file) {
159
-            return;
160
-          }
161
-        } else {
162
-          return;
163
-        }
164
-      }
165
-    }
166
-  };
167
-
168
-  // run the 'prepareStackTrace' function above
169
-  Error.captureStackTrace(dummy);
170
-  dummy.stack;
171
-
172
-  // cleanup
173
-  Error.prepareStackTrace = origPST;
174
-  Error.stackTraceLimit = origSTL;
175
-
176
-  // handle filename that starts with "file://"
177
-  var fileSchema = 'file://';
178
-  if (fileName.indexOf(fileSchema) === 0) {
179
-    fileName = fileURLToPath(fileName);
180
-  }
181
-
182
-  return fileName;
183
-};
184
-
185
-/**
186
- * Gets the root directory of a module, given an arbitrary filename
187
- * somewhere in the module tree. The "root directory" is the directory
188
- * containing the `package.json` file.
189
- *
190
- *   In:  /home/nate/node-native-module/lib/index.js
191
- *   Out: /home/nate/node-native-module
192
- */
193
-
194
-exports.getRoot = function getRoot(file) {
195
-  var dir = dirname(file),
196
-    prev;
197
-  while (true) {
198
-    if (dir === '.') {
199
-      // Avoids an infinite loop in rare cases, like the REPL
200
-      dir = process.cwd();
201
-    }
202
-    if (
203
-      exists(join(dir, 'package.json')) ||
204
-      exists(join(dir, 'node_modules'))
205
-    ) {
206
-      // Found the 'package.json' file or 'node_modules' dir; we're done
207
-      return dir;
208
-    }
209
-    if (prev === dir) {
210
-      // Got to the top
211
-      throw new Error(
212
-        'Could not find module root given file: "' +
213
-          file +
214
-          '". Do you have a `package.json` file? '
215
-      );
216
-    }
217
-    // Try the parent dir next
218
-    prev = dir;
219
-    dir = join(dir, '..');
220
-  }
221
-};

+ 0
- 57
node_modules/bindings/package.json View File

@@ -1,57 +0,0 @@
1
-{
2
-  "_from": "bindings@^1.5.0",
3
-  "_id": "bindings@1.5.0",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
6
-  "_location": "/bindings",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "bindings@^1.5.0",
12
-    "name": "bindings",
13
-    "escapedName": "bindings",
14
-    "rawSpec": "^1.5.0",
15
-    "saveSpec": null,
16
-    "fetchSpec": "^1.5.0"
17
-  },
18
-  "_requiredBy": [
19
-    "/secp256k1"
20
-  ],
21
-  "_resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
22
-  "_shasum": "10353c9e945334bc0511a6d90b38fbc7c9c504df",
23
-  "_spec": "bindings@^1.5.0",
24
-  "_where": "/home/cake/development/fb/vendor/btc-hdkey/node_modules/secp256k1",
25
-  "author": {
26
-    "name": "Nathan Rajlich",
27
-    "email": "nathan@tootallnate.net",
28
-    "url": "http://tootallnate.net"
29
-  },
30
-  "bugs": {
31
-    "url": "https://github.com/TooTallNate/node-bindings/issues"
32
-  },
33
-  "bundleDependencies": false,
34
-  "dependencies": {
35
-    "file-uri-to-path": "1.0.0"
36
-  },
37
-  "deprecated": false,
38
-  "description": "Helper module for loading your native module's .node file",
39
-  "homepage": "https://github.com/TooTallNate/node-bindings",
40
-  "keywords": [
41
-    "native",
42
-    "addon",
43
-    "bindings",
44
-    "gyp",
45
-    "waf",
46
-    "c",
47
-    "c++"
48
-  ],
49
-  "license": "MIT",
50
-  "main": "./bindings.js",
51
-  "name": "bindings",
52
-  "repository": {
53
-    "type": "git",
54
-    "url": "git://github.com/TooTallNate/node-bindings.git"
55
-  },
56
-  "version": "1.5.0"
57
-}

+ 0
- 21
node_modules/bip174/LICENSE View File

@@ -1,21 +0,0 @@
1
-MIT License
2
-
3
-Copyright (c) 2019 Jonathan Underwood and BitcoinJS team
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy
6
-of this software and associated documentation files (the "Software"), to deal
7
-in the Software without restriction, including without limitation the rights
8
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
-copies of the Software, and to permit persons to whom the Software is
10
-furnished to do so, subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in all
13
-copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
-SOFTWARE.

+ 0
- 109
node_modules/bip174/README.md View File

@@ -1,109 +0,0 @@
1
-# bip174
2
-[![Build Status](https://travis-ci.org/bitcoinjs/bip174.png?branch=master)](https://travis-ci.org/bitcoinjs/bip174)
3
-[![NPM](https://img.shields.io/npm/v/bip174.svg)](https://www.npmjs.org/package/bip174)
4
-
5
-[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
-
7
-A [BIP174](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki) compatible partial Transaction encoding library.
8
-
9
-## Bitcoin users, use bitcoinjs-lib's Psbt class.
10
-
11
-This library is separate as an attempt to separate Bitcoin specific logic from the encoding format.
12
-
13
-I apologize if this library is hard to use. Removing Bitcoin specific logic from "Partially Signed BITCOIN Transaction" format was kind of hard.
14
-
15
-## Responsibilities Covered
16
-
17
-1. Creator: You can create a new psbt and add inputs and outputs, then add extra info to the inputs using each individual method.
18
-  (Note: Psbt.fromTransaction can create a PSBT from a serialized transaction, but all scriptSigs and witnessStacks must be empty,
19
-    and the transaction should not have the segwit marker and flagbyte.)
20
-2. Updater: You can add one of all types of the input and output information. Each function has strict type checking at runtime.
21
-3. Combiner: using Psbt.combine(...Psbt[]), it will do a dumb merge gathering all the new key value pairs from the subsequent PSBTs into itself. The psbt calling `combine` has highest priority.
22
-
23
-## Responsibilities NOT Covered
24
-
25
-In order to keep this library as separate from Bitcoin logic as possible, This library will not implement the following responsibilities. But rather, down the road bitcoinjs-lib will adopt this class and extend it internally to allow for the following:
26
-
27
-1. Signer: This class has no way to sign. You may add a PartialSig object though.
28
-2. Extractor: This class has minimal knowledge of Bitcoin transactions, so creating a full transaction from a PSBT must be done with a bitcoin aware extended class.
29
-3. Input Finalizer: This class, again, has no knowledge of whether an input is finished.
30
-
31
-## Static methods and addInput / addOutput require an abstract Transaction object
32
-
33
-* Static methods: You must pass a `TransactionFromBuffer` typed function. See `ts_src/lib/interfaces.ts` for info on the `Transaction` interface and the `TransactionFromBuffer` function.
34
-* addInput/addOutput methods: The constructor takes a `Transaction` abstract interface that has an addInput/addOutput method which will be called.
35
-
36
-## Example
37
-```javascript
38
-const { Psbt } = require('bip174')
39
-const { PsbtTransaction , pTxFromBuffer } = require('./someImplementation')
40
-// Psbt requires a Transaction interface to create an instance, as well as
41
-// A function that turns a buffer into that interface. See Transaction and TransactionFromBuffer
42
-// in ts_src/lib/interfaces.ts ...
43
-
44
-// See tests/utils/txTools file for an example of a simple Bitcoin Transaction.
45
-// Also see BitcoinJS-lib for an extended class that uses the Transaction class internally.
46
-// Anyone using this library for Bitcoin specifically should use bitcoinjs-lib
47
-
48
-// Your PsbtTransaction will have a toBuffer function to allow for serialization
49
-const tx = pTxFromBuffer(someTransactionBuffer);
50
-const psbt = new Psbt(tx)
51
-
52
-// OR
53
-
54
-// This will parse the PSBT, and use the function you pass to parse the Transaction part
55
-// the function should throw if the scriptSig section is not empty
56
-const psbt = Psbt.fromBuffer(somePsbtBuffer, pTxFromBuffer)
57
-
58
-psbt.addInput({
59
-  hash: '865dce988413971fd812d0e81a3395ed916a87ea533e1a16c0f4e15df96fa7d4',
60
-  index: 3,
61
-})
62
-psbt.addInput({
63
-  hash: 'ff5dce988413971fd812d0e81a3395ed916a87ea533e1a16c0f4e15df96fa7d4',
64
-  index: 1,
65
-})
66
-psbt.addOutput({
67
-  script: Buffer.from(
68
-    'a914e18870f2c297fbfca54c5c6f645c7745a5b66eda87',
69
-    'hex',
70
-  ),
71
-  value: 1234567890,
72
-})
73
-psbt.addOutput({
74
-  script: Buffer.from(
75
-    'a914e18870f2c297fbfca54c5c6f645c7745a5b66eda87',
76
-    'hex',
77
-  ),
78
-  value: 987654321,
79
-})
80
-psbt.addRedeemScriptToInput(0, Buffer.from(
81
-  '00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903',
82
-  'hex',
83
-))
84
-psbt.addWitnessScriptToInput(0, Buffer.from(
85
-  '522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b9903' +
86
-    '0b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e861519268' +
87
-    '60221f0e7352ae',
88
-  'hex',
89
-))
90
-psbt.addBip32DerivationToInput(0, {
91
-  masterFingerprint: Buffer.from('d90c6a4f', 'hex'),
92
-  pubkey: Buffer.from(
93
-    '023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73',
94
-    'hex',
95
-  ),
96
-  path: "m/0'/0'/3'",
97
-})
98
-psbt.addBip32DerivationToInput(0, {
99
-  masterFingerprint: Buffer.from('d90c6a4f', 'hex'),
100
-  pubkey: Buffer.from(
101
-    '03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc',
102
-    'hex',
103
-  ),
104
-  path: "m/0'/0'/2'",
105
-})
106
-const b64 = psbt.toBase64();
107
-```
108
-
109
-## LICENSE [MIT](LICENSE)

+ 0
- 77
node_modules/bip174/package.json View File

@@ -1,77 +0,0 @@
1
-{
2
-  "_from": "bip174@^1.0.0",
3
-  "_id": "bip174@1.0.0",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-AaoWrkYtv6A2y8H+qzs6NvRWypzNbADT8PQGpM9rnP+jLzeol+uzhe3Myeuq/dwrHYtmsW8V71HmX2oXhQGagw==",
6
-  "_location": "/bip174",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "bip174@^1.0.0",
12
-    "name": "bip174",
13
-    "escapedName": "bip174",
14
-    "rawSpec": "^1.0.0",
15
-    "saveSpec": null,
16
-    "fetchSpec": "^1.0.0"
17
-  },
18
-  "_requiredBy": [
19
-    "/bitcoinjs-lib"
20
-  ],
21
-  "_resolved": "https://registry.npmjs.org/bip174/-/bip174-1.0.0.tgz",
22
-  "_shasum": "c2061ae192064a419498d57a96a47287f75f0343",
23
-  "_spec": "bip174@^1.0.0",
24
-  "_where": "/home/cake/development/fb/vendor/btc-hdkey/node_modules/bitcoinjs-lib",
25
-  "author": {
26
-    "name": "Jonathan Underwood"
27
-  },
28
-  "bugs": {
29
-    "url": "https://github.com/bitcoinjs/bip174/issues"
30
-  },
31
-  "bundleDependencies": false,
32
-  "deprecated": false,
33
-  "description": "[![Build Status](https://travis-ci.org/bitcoinjs/bip174.png?branch=master)](https://travis-ci.org/bitcoinjs/bip174) [![NPM](https://img.shields.io/npm/v/bip174.svg)](https://www.npmjs.org/package/bip174)",
34
-  "devDependencies": {
35
-    "@types/node": "12.0.8",
36
-    "@types/tape": "4.2.33",
37
-    "bitcoinjs-lib": "^5.0.5",
38
-    "buffer-json": "^2.0.0",
39
-    "nyc": "^14.1.1",
40
-    "prettier": "^1.18.2",
41
-    "rimraf": "^2.6.3",
42
-    "tape": "^4.10.2",
43
-    "tslint": "5.17.0",
44
-    "typescript": "3.5.2"
45
-  },
46
-  "engines": {
47
-    "node": ">=8.0.0"
48
-  },
49
-  "files": [
50
-    "src/lib"
51
-  ],
52
-  "homepage": "https://github.com/bitcoinjs/bip174#readme",
53
-  "license": "MIT",
54
-  "main": "src/lib/psbt.js",
55
-  "name": "bip174",
56
-  "repository": {
57
-    "type": "git",
58
-    "url": "git+https://github.com/bitcoinjs/bip174.git"
59
-  },
60
-  "scripts": {
61
-    "build": "npm run clean && tsc -p ./tsconfig.json && rimraf 'src/tests/**/*.d.ts' && npm run formatjs",
62
-    "clean": "rimraf src types",
63
-    "coverage": "nyc --check-coverage --exclude='src/tests/**/*.js' --reporter=lcov --reporter=text --branches 90 --functions 90 --lines 90 npm run unit",
64
-    "flb": "npm run format && npm run lint && npm run build",
65
-    "format": "npm run prettier -- --write",
66
-    "format:ci": "npm run prettier -- --check && npm run prettierjs -- --check",
67
-    "formatjs": "npm run prettierjs -- --write > /dev/null 2>&1",
68
-    "gitdiff:ci": "npm run build && git diff --exit-code",
69
-    "lint": "tslint -p tsconfig.json -c tslint.json",
70
-    "prettier": "prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore",
71
-    "prettierjs": "prettier 'src/**/*.js' --ignore-path ./.prettierignore",
72
-    "test": "npm run format:ci && npm run lint && npm run build && npm run unit",
73
-    "unit": "tape src/tests/*.js src/tests/fromBIP/*.js"
74
-  },
75
-  "types": "src/lib/psbt.d.ts",
76
-  "version": "1.0.0"
77
-}

+ 0
- 2
node_modules/bip174/src/lib/combiner/index.d.ts View File

@@ -1,2 +0,0 @@
1
-import { PsbtAttributes } from '../parser';
2
-export declare function combine(psbts: PsbtAttributes[]): PsbtAttributes;

+ 0
- 89
node_modules/bip174/src/lib/combiner/index.js View File

@@ -1,89 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const parser_1 = require('../parser');
4
-function combine(psbts) {
5
-  const self = psbts[0];
6
-  const selfKeyVals = parser_1.psbtToKeyVals(self);
7
-  const others = psbts.slice(1);
8
-  if (others.length === 0) throw new Error('Combine: Nothing to combine');
9
-  const selfTx = getTx(self);
10
-  if (selfTx === undefined) {
11
-    throw new Error('Combine: Self missing transaction');
12
-  }
13
-  const selfGlobalSet = getKeySet(selfKeyVals.globalKeyVals);
14
-  const selfInputSets = selfKeyVals.inputKeyVals.map(input => getKeySet(input));
15
-  const selfOutputSets = selfKeyVals.outputKeyVals.map(output =>
16
-    getKeySet(output),
17
-  );
18
-  for (const other of others) {
19
-    const otherTx = getTx(other);
20
-    if (
21
-      otherTx === undefined ||
22
-      !otherTx.toBuffer().equals(selfTx.toBuffer())
23
-    ) {
24
-      throw new Error(
25
-        'Combine: One of the Psbts does not have the same transaction.',
26
-      );
27
-    }
28
-    const otherKeyVals = parser_1.psbtToKeyVals(other);
29
-    const otherGlobalSet = getKeySet(otherKeyVals.globalKeyVals);
30
-    otherGlobalSet.forEach(
31
-      keyPusher(
32
-        selfGlobalSet,
33
-        selfKeyVals.globalKeyVals,
34
-        otherKeyVals.globalKeyVals,
35
-      ),
36
-    );
37
-    const otherInputSets = otherKeyVals.inputKeyVals.map(input =>
38
-      getKeySet(input),
39
-    );
40
-    otherInputSets.forEach((inputSet, idx) =>
41
-      inputSet.forEach(
42
-        keyPusher(
43
-          selfInputSets[idx],
44
-          selfKeyVals.inputKeyVals[idx],
45
-          otherKeyVals.inputKeyVals[idx],
46
-        ),
47
-      ),
48
-    );
49
-    const otherOutputSets = otherKeyVals.outputKeyVals.map(output =>
50
-      getKeySet(output),
51
-    );
52
-    otherOutputSets.forEach((outputSet, idx) =>
53
-      outputSet.forEach(
54
-        keyPusher(
55
-          selfOutputSets[idx],
56
-          selfKeyVals.outputKeyVals[idx],
57
-          otherKeyVals.outputKeyVals[idx],
58
-        ),
59
-      ),
60
-    );
61
-  }
62
-  return parser_1.psbtFromKeyVals(selfTx, {
63
-    globalMapKeyVals: selfKeyVals.globalKeyVals,
64
-    inputKeyVals: selfKeyVals.inputKeyVals,
65
-    outputKeyVals: selfKeyVals.outputKeyVals,
66
-  });
67
-}
68
-exports.combine = combine;
69
-function keyPusher(selfSet, selfKeyVals, otherKeyVals) {
70
-  return key => {
71
-    if (selfSet.has(key)) return;
72
-    const newKv = otherKeyVals.filter(kv => kv.key.toString('hex') === key)[0];
73
-    selfKeyVals.push(newKv);
74
-    selfSet.add(key);
75
-  };
76
-}
77
-function getTx(psbt) {
78
-  return psbt.globalMap.unsignedTx;
79
-}
80
-function getKeySet(keyVals) {
81
-  const set = new Set();
82
-  keyVals.forEach(keyVal => {
83
-    const hex = keyVal.key.toString('hex');
84
-    if (set.has(hex))
85
-      throw new Error('Combine: KeyValue Map keys should be unique');
86
-    set.add(hex);
87
-  });
88
-  return set;
89
-}

+ 0
- 6
node_modules/bip174/src/lib/converter/global/globalXpub.d.ts View File

@@ -1,6 +0,0 @@
1
-import { GlobalXpub, KeyValue } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): GlobalXpub;
3
-export declare function encode(data: GlobalXpub): KeyValue;
4
-export declare const expected = "{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }";
5
-export declare function check(data: any): data is GlobalXpub;
6
-export declare function canAddToArray(array: GlobalXpub[], item: GlobalXpub, dupeSet: Set<string>): boolean;

+ 0
- 83
node_modules/bip174/src/lib/converter/global/globalXpub.js View File

@@ -1,83 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-const range = n => [...Array(n).keys()];
5
-function decode(keyVal) {
6
-  if (keyVal.key[0] !== typeFields_1.GlobalTypes.GLOBAL_XPUB) {
7
-    throw new Error(
8
-      'Decode Error: could not decode globalXpub with key 0x' +
9
-        keyVal.key.toString('hex'),
10
-    );
11
-  }
12
-  if (keyVal.key.length !== 79 || ![2, 3].includes(keyVal.key[46])) {
13
-    throw new Error(
14
-      'Decode Error: globalXpub has invalid extended pubkey in key 0x' +
15
-        keyVal.key.toString('hex'),
16
-    );
17
-  }
18
-  if ((keyVal.value.length / 4) % 1 !== 0) {
19
-    throw new Error(
20
-      'Decode Error: Global GLOBAL_XPUB value length should be multiple of 4',
21
-    );
22
-  }
23
-  const extendedPubkey = keyVal.key.slice(1);
24
-  const data = {
25
-    masterFingerprint: keyVal.value.slice(0, 4),
26
-    extendedPubkey,
27
-    path: 'm',
28
-  };
29
-  for (const i of range(keyVal.value.length / 4 - 1)) {
30
-    const val = keyVal.value.readUInt32LE(i * 4 + 4);
31
-    const isHard = !!(val & 0x80000000);
32
-    const idx = val & 0x7fffffff;
33
-    data.path += '/' + idx.toString(10) + (isHard ? "'" : '');
34
-  }
35
-  return data;
36
-}
37
-exports.decode = decode;
38
-function encode(data) {
39
-  const head = Buffer.from([typeFields_1.GlobalTypes.GLOBAL_XPUB]);
40
-  const key = Buffer.concat([head, data.extendedPubkey]);
41
-  const splitPath = data.path.split('/');
42
-  const value = Buffer.allocUnsafe(splitPath.length * 4);
43
-  data.masterFingerprint.copy(value, 0);
44
-  let offset = 4;
45
-  splitPath.slice(1).forEach(level => {
46
-    const isHard = level.slice(-1) === "'";
47
-    let num = 0x7fffffff & parseInt(isHard ? level.slice(0, -1) : level, 10);
48
-    if (isHard) num += 0x80000000;
49
-    value.writeUInt32LE(num, offset);
50
-    offset += 4;
51
-  });
52
-  return {
53
-    key,
54
-    value,
55
-  };
56
-}
57
-exports.encode = encode;
58
-exports.expected =
59
-  '{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }';
60
-function check(data) {
61
-  const epk = data.extendedPubkey;
62
-  const mfp = data.masterFingerprint;
63
-  const p = data.path;
64
-  return (
65
-    Buffer.isBuffer(epk) &&
66
-    epk.length === 78 &&
67
-    [2, 3].indexOf(epk[45]) > -1 &&
68
-    Buffer.isBuffer(mfp) &&
69
-    mfp.length === 4 &&
70
-    typeof p === 'string' &&
71
-    !!p.match(/^m(\/\d+'?)+$/)
72
-  );
73
-}
74
-exports.check = check;
75
-function canAddToArray(array, item, dupeSet) {
76
-  const dupeString = item.extendedPubkey.toString('hex');
77
-  if (dupeSet.has(dupeString)) return false;
78
-  dupeSet.add(dupeString);
79
-  return (
80
-    array.filter(v => v.extendedPubkey.equals(item.extendedPubkey)).length === 0
81
-  );
82
-}
83
-exports.canAddToArray = canAddToArray;

+ 0
- 2
node_modules/bip174/src/lib/converter/global/unsignedTx.d.ts View File

@@ -1,2 +0,0 @@
1
-import { KeyValue, Transaction } from '../../interfaces';
2
-export declare function encode(data: Transaction): KeyValue;

+ 0
- 10
node_modules/bip174/src/lib/converter/global/unsignedTx.js View File

@@ -1,10 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function encode(data) {
5
-  return {
6
-    key: Buffer.from([typeFields_1.GlobalTypes.UNSIGNED_TX]),
7
-    value: data.toBuffer(),
8
-  };
9
-}
10
-exports.encode = encode;

+ 0
- 71
node_modules/bip174/src/lib/converter/index.d.ts View File

@@ -1,71 +0,0 @@
1
-/// <reference types="node" />
2
-import * as globalXpub from './global/globalXpub';
3
-import * as unsignedTx from './global/unsignedTx';
4
-import * as finalScriptSig from './input/finalScriptSig';
5
-import * as finalScriptWitness from './input/finalScriptWitness';
6
-import * as nonWitnessUtxo from './input/nonWitnessUtxo';
7
-import * as partialSig from './input/partialSig';
8
-import * as porCommitment from './input/porCommitment';
9
-import * as sighashType from './input/sighashType';
10
-import * as witnessUtxo from './input/witnessUtxo';
11
-declare const globals: {
12
-    unsignedTx: typeof unsignedTx;
13
-    globalXpub: typeof globalXpub;
14
-    checkPubkey: (keyVal: import("../interfaces").KeyValue) => Buffer | undefined;
15
-};
16
-declare const inputs: {
17
-    nonWitnessUtxo: typeof nonWitnessUtxo;
18
-    partialSig: typeof partialSig;
19
-    sighashType: typeof sighashType;
20
-    finalScriptSig: typeof finalScriptSig;
21
-    finalScriptWitness: typeof finalScriptWitness;
22
-    porCommitment: typeof porCommitment;
23
-    witnessUtxo: typeof witnessUtxo;
24
-    bip32Derivation: {
25
-        decode: (keyVal: import("../interfaces").KeyValue) => import("../interfaces").Bip32Derivation;
26
-        encode: (data: import("../interfaces").Bip32Derivation) => import("../interfaces").KeyValue;
27
-        check: (data: any) => data is import("../interfaces").Bip32Derivation;
28
-        expected: string;
29
-        canAddToArray: (array: import("../interfaces").Bip32Derivation[], item: import("../interfaces").Bip32Derivation, dupeSet: Set<string>) => boolean;
30
-    };
31
-    redeemScript: {
32
-        decode: (keyVal: import("../interfaces").KeyValue) => Buffer;
33
-        encode: (data: Buffer) => import("../interfaces").KeyValue;
34
-        check: (data: any) => data is Buffer;
35
-        expected: string;
36
-        canAdd: (currentData: any, newData: any) => boolean;
37
-    };
38
-    witnessScript: {
39
-        decode: (keyVal: import("../interfaces").KeyValue) => Buffer;
40
-        encode: (data: Buffer) => import("../interfaces").KeyValue;
41
-        check: (data: any) => data is Buffer;
42
-        expected: string;
43
-        canAdd: (currentData: any, newData: any) => boolean;
44
-    };
45
-    checkPubkey: (keyVal: import("../interfaces").KeyValue) => Buffer | undefined;
46
-};
47
-declare const outputs: {
48
-    bip32Derivation: {
49
-        decode: (keyVal: import("../interfaces").KeyValue) => import("../interfaces").Bip32Derivation;
50
-        encode: (data: import("../interfaces").Bip32Derivation) => import("../interfaces").KeyValue;
51
-        check: (data: any) => data is import("../interfaces").Bip32Derivation;
52
-        expected: string;
53
-        canAddToArray: (array: import("../interfaces").Bip32Derivation[], item: import("../interfaces").Bip32Derivation, dupeSet: Set<string>) => boolean;
54
-    };
55
-    redeemScript: {
56
-        decode: (keyVal: import("../interfaces").KeyValue) => Buffer;
57
-        encode: (data: Buffer) => import("../interfaces").KeyValue;
58
-        check: (data: any) => data is Buffer;
59
-        expected: string;
60
-        canAdd: (currentData: any, newData: any) => boolean;
61
-    };
62
-    witnessScript: {
63
-        decode: (keyVal: import("../interfaces").KeyValue) => Buffer;
64
-        encode: (data: Buffer) => import("../interfaces").KeyValue;
65
-        check: (data: any) => data is Buffer;
66
-        expected: string;
67
-        canAdd: (currentData: any, newData: any) => boolean;
68
-    };
69
-    checkPubkey: (keyVal: import("../interfaces").KeyValue) => Buffer | undefined;
70
-};
71
-export { globals, inputs, outputs };

+ 0
- 61
node_modules/bip174/src/lib/converter/index.js View File

@@ -1,61 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../typeFields');
4
-const globalXpub = require('./global/globalXpub');
5
-const unsignedTx = require('./global/unsignedTx');
6
-const finalScriptSig = require('./input/finalScriptSig');
7
-const finalScriptWitness = require('./input/finalScriptWitness');
8
-const nonWitnessUtxo = require('./input/nonWitnessUtxo');
9
-const partialSig = require('./input/partialSig');
10
-const porCommitment = require('./input/porCommitment');
11
-const sighashType = require('./input/sighashType');
12
-const witnessUtxo = require('./input/witnessUtxo');
13
-const bip32Derivation = require('./shared/bip32Derivation');
14
-const checkPubkey = require('./shared/checkPubkey');
15
-const redeemScript = require('./shared/redeemScript');
16
-const witnessScript = require('./shared/witnessScript');
17
-const globals = {
18
-  unsignedTx,
19
-  globalXpub,
20
-  // pass an Array of key bytes that require pubkey beside the key
21
-  checkPubkey: checkPubkey.makeChecker([]),
22
-};
23
-exports.globals = globals;
24
-const inputs = {
25
-  nonWitnessUtxo,
26
-  partialSig,
27
-  sighashType,
28
-  finalScriptSig,
29
-  finalScriptWitness,
30
-  porCommitment,
31
-  witnessUtxo,
32
-  bip32Derivation: bip32Derivation.makeConverter(
33
-    typeFields_1.InputTypes.BIP32_DERIVATION,
34
-  ),
35
-  redeemScript: redeemScript.makeConverter(
36
-    typeFields_1.InputTypes.REDEEM_SCRIPT,
37
-  ),
38
-  witnessScript: witnessScript.makeConverter(
39
-    typeFields_1.InputTypes.WITNESS_SCRIPT,
40
-  ),
41
-  checkPubkey: checkPubkey.makeChecker([
42
-    typeFields_1.InputTypes.PARTIAL_SIG,
43
-    typeFields_1.InputTypes.BIP32_DERIVATION,
44
-  ]),
45
-};
46
-exports.inputs = inputs;
47
-const outputs = {
48
-  bip32Derivation: bip32Derivation.makeConverter(
49
-    typeFields_1.OutputTypes.BIP32_DERIVATION,
50
-  ),
51
-  redeemScript: redeemScript.makeConverter(
52
-    typeFields_1.OutputTypes.REDEEM_SCRIPT,
53
-  ),
54
-  witnessScript: witnessScript.makeConverter(
55
-    typeFields_1.OutputTypes.WITNESS_SCRIPT,
56
-  ),
57
-  checkPubkey: checkPubkey.makeChecker([
58
-    typeFields_1.OutputTypes.BIP32_DERIVATION,
59
-  ]),
60
-};
61
-exports.outputs = outputs;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/finalScriptSig.d.ts View File

@@ -1,6 +0,0 @@
1
-import { FinalScriptSig, KeyValue } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): FinalScriptSig;
3
-export declare function encode(data: FinalScriptSig): KeyValue;
4
-export declare const expected = "Buffer";
5
-export declare function check(data: any): data is FinalScriptSig;
6
-export declare function canAdd(currentData: any, newData: any): boolean;

+ 0
- 30
node_modules/bip174/src/lib/converter/input/finalScriptSig.js View File

@@ -1,30 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function decode(keyVal) {
5
-  if (keyVal.key[0] !== typeFields_1.InputTypes.FINAL_SCRIPTSIG) {
6
-    throw new Error(
7
-      'Decode Error: could not decode finalScriptSig with key 0x' +
8
-        keyVal.key.toString('hex'),
9
-    );
10
-  }
11
-  return keyVal.value;
12
-}
13
-exports.decode = decode;
14
-function encode(data) {
15
-  const key = Buffer.from([typeFields_1.InputTypes.FINAL_SCRIPTSIG]);
16
-  return {
17
-    key,
18
-    value: data,
19
-  };
20
-}
21
-exports.encode = encode;
22
-exports.expected = 'Buffer';
23
-function check(data) {
24
-  return Buffer.isBuffer(data);
25
-}
26
-exports.check = check;
27
-function canAdd(currentData, newData) {
28
-  return !!currentData && !!newData && currentData.finalScriptSig === undefined;
29
-}
30
-exports.canAdd = canAdd;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/finalScriptWitness.d.ts View File

@@ -1,6 +0,0 @@
1
-import { FinalScriptWitness, KeyValue } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): FinalScriptWitness;
3
-export declare function encode(data: FinalScriptWitness): KeyValue;
4
-export declare const expected = "Buffer";
5
-export declare function check(data: any): data is FinalScriptWitness;
6
-export declare function canAdd(currentData: any, newData: any): boolean;

+ 0
- 32
node_modules/bip174/src/lib/converter/input/finalScriptWitness.js View File

@@ -1,32 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function decode(keyVal) {
5
-  if (keyVal.key[0] !== typeFields_1.InputTypes.FINAL_SCRIPTWITNESS) {
6
-    throw new Error(
7
-      'Decode Error: could not decode finalScriptWitness with key 0x' +
8
-        keyVal.key.toString('hex'),
9
-    );
10
-  }
11
-  return keyVal.value;
12
-}
13
-exports.decode = decode;
14
-function encode(data) {
15
-  const key = Buffer.from([typeFields_1.InputTypes.FINAL_SCRIPTWITNESS]);
16
-  return {
17
-    key,
18
-    value: data,
19
-  };
20
-}
21
-exports.encode = encode;
22
-exports.expected = 'Buffer';
23
-function check(data) {
24
-  return Buffer.isBuffer(data);
25
-}
26
-exports.check = check;
27
-function canAdd(currentData, newData) {
28
-  return (
29
-    !!currentData && !!newData && currentData.finalScriptWitness === undefined
30
-  );
31
-}
32
-exports.canAdd = canAdd;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.d.ts View File

@@ -1,6 +0,0 @@
1
-import { KeyValue, NonWitnessUtxo } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): NonWitnessUtxo;
3
-export declare function encode(data: NonWitnessUtxo): KeyValue;
4
-export declare const expected = "Buffer";
5
-export declare function check(data: any): data is NonWitnessUtxo;
6
-export declare function canAdd(currentData: any, newData: any): boolean;

+ 0
- 34
node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.js View File

@@ -1,34 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function decode(keyVal) {
5
-  if (keyVal.key[0] !== typeFields_1.InputTypes.NON_WITNESS_UTXO) {
6
-    throw new Error(
7
-      'Decode Error: could not decode nonWitnessUtxo with key 0x' +
8
-        keyVal.key.toString('hex'),
9
-    );
10
-  }
11
-  return keyVal.value;
12
-}
13
-exports.decode = decode;
14
-function encode(data) {
15
-  return {
16
-    key: Buffer.from([typeFields_1.InputTypes.NON_WITNESS_UTXO]),
17
-    value: data,
18
-  };
19
-}
20
-exports.encode = encode;
21
-exports.expected = 'Buffer';
22
-function check(data) {
23
-  return Buffer.isBuffer(data);
24
-}
25
-exports.check = check;
26
-function canAdd(currentData, newData) {
27
-  return (
28
-    !!currentData &&
29
-    !!newData &&
30
-    currentData.witnessUtxo === undefined &&
31
-    currentData.nonWitnessUtxo === undefined
32
-  );
33
-}
34
-exports.canAdd = canAdd;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/partialSig.d.ts View File

@@ -1,6 +0,0 @@
1
-import { KeyValue, PartialSig } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): PartialSig;
3
-export declare function encode(pSig: PartialSig): KeyValue;
4
-export declare const expected = "{ pubkey: Buffer; signature: Buffer; }";
5
-export declare function check(data: any): data is PartialSig;
6
-export declare function canAddToArray(array: PartialSig[], item: PartialSig, dupeSet: Set<string>): boolean;

+ 0
- 65
node_modules/bip174/src/lib/converter/input/partialSig.js View File

@@ -1,65 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function decode(keyVal) {
5
-  if (keyVal.key[0] !== typeFields_1.InputTypes.PARTIAL_SIG) {
6
-    throw new Error(
7
-      'Decode Error: could not decode partialSig with key 0x' +
8
-        keyVal.key.toString('hex'),
9
-    );
10
-  }
11
-  if (
12
-    !(keyVal.key.length === 34 || keyVal.key.length === 66) ||
13
-    ![2, 3, 4].includes(keyVal.key[1])
14
-  ) {
15
-    throw new Error(
16
-      'Decode Error: partialSig has invalid pubkey in key 0x' +
17
-        keyVal.key.toString('hex'),
18
-    );
19
-  }
20
-  const pubkey = keyVal.key.slice(1);
21
-  return {
22
-    pubkey,
23
-    signature: keyVal.value,
24
-  };
25
-}
26
-exports.decode = decode;
27
-function encode(pSig) {
28
-  const head = Buffer.from([typeFields_1.InputTypes.PARTIAL_SIG]);
29
-  return {
30
-    key: Buffer.concat([head, pSig.pubkey]),
31
-    value: pSig.signature,
32
-  };
33
-}
34
-exports.encode = encode;
35
-exports.expected = '{ pubkey: Buffer; signature: Buffer; }';
36
-function check(data) {
37
-  return (
38
-    Buffer.isBuffer(data.pubkey) &&
39
-    Buffer.isBuffer(data.signature) &&
40
-    [33, 65].includes(data.pubkey.length) &&
41
-    [2, 3, 4].includes(data.pubkey[0]) &&
42
-    isDerSigWithSighash(data.signature)
43
-  );
44
-}
45
-exports.check = check;
46
-function isDerSigWithSighash(buf) {
47
-  if (!Buffer.isBuffer(buf) || buf.length < 9) return false;
48
-  if (buf[0] !== 0x30) return false;
49
-  if (buf.length !== buf[1] + 3) return false;
50
-  if (buf[2] !== 0x02) return false;
51
-  const rLen = buf[3];
52
-  if (rLen > 33 || rLen < 1) return false;
53
-  if (buf[3 + rLen + 1] !== 0x02) return false;
54
-  const sLen = buf[3 + rLen + 2];
55
-  if (sLen > 33 || sLen < 1) return false;
56
-  if (buf.length !== 3 + rLen + 2 + sLen + 2) return false;
57
-  return true;
58
-}
59
-function canAddToArray(array, item, dupeSet) {
60
-  const dupeString = item.pubkey.toString('hex');
61
-  if (dupeSet.has(dupeString)) return false;
62
-  dupeSet.add(dupeString);
63
-  return array.filter(v => v.pubkey.equals(item.pubkey)).length === 0;
64
-}
65
-exports.canAddToArray = canAddToArray;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/porCommitment.d.ts View File

@@ -1,6 +0,0 @@
1
-import { KeyValue, PorCommitment } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): PorCommitment;
3
-export declare function encode(data: PorCommitment): KeyValue;
4
-export declare const expected = "string";
5
-export declare function check(data: any): data is PorCommitment;
6
-export declare function canAdd(currentData: any, newData: any): boolean;

+ 0
- 30
node_modules/bip174/src/lib/converter/input/porCommitment.js View File

@@ -1,30 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function decode(keyVal) {
5
-  if (keyVal.key[0] !== typeFields_1.InputTypes.POR_COMMITMENT) {
6
-    throw new Error(
7
-      'Decode Error: could not decode porCommitment with key 0x' +
8
-        keyVal.key.toString('hex'),
9
-    );
10
-  }
11
-  return keyVal.value.toString('utf8');
12
-}
13
-exports.decode = decode;
14
-function encode(data) {
15
-  const key = Buffer.from([typeFields_1.InputTypes.POR_COMMITMENT]);
16
-  return {
17
-    key,
18
-    value: Buffer.from(data, 'utf8'),
19
-  };
20
-}
21
-exports.encode = encode;
22
-exports.expected = 'string';
23
-function check(data) {
24
-  return typeof data === 'string';
25
-}
26
-exports.check = check;
27
-function canAdd(currentData, newData) {
28
-  return !!currentData && !!newData && currentData.porCommitment === undefined;
29
-}
30
-exports.canAdd = canAdd;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/sighashType.d.ts View File

@@ -1,6 +0,0 @@
1
-import { KeyValue, SighashType } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): SighashType;
3
-export declare function encode(data: SighashType): KeyValue;
4
-export declare const expected = "number";
5
-export declare function check(data: any): data is SighashType;
6
-export declare function canAdd(currentData: any, newData: any): boolean;

+ 0
- 32
node_modules/bip174/src/lib/converter/input/sighashType.js View File

@@ -1,32 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-function decode(keyVal) {
5
-  if (keyVal.key[0] !== typeFields_1.InputTypes.SIGHASH_TYPE) {
6
-    throw new Error(
7
-      'Decode Error: could not decode sighashType with key 0x' +
8
-        keyVal.key.toString('hex'),
9
-    );
10
-  }
11
-  return keyVal.value.readUInt32LE(0);
12
-}
13
-exports.decode = decode;
14
-function encode(data) {
15
-  const key = Buffer.from([typeFields_1.InputTypes.SIGHASH_TYPE]);
16
-  const value = Buffer.allocUnsafe(4);
17
-  value.writeUInt32LE(data, 0);
18
-  return {
19
-    key,
20
-    value,
21
-  };
22
-}
23
-exports.encode = encode;
24
-exports.expected = 'number';
25
-function check(data) {
26
-  return typeof data === 'number';
27
-}
28
-exports.check = check;
29
-function canAdd(currentData, newData) {
30
-  return !!currentData && !!newData && currentData.sighashType === undefined;
31
-}
32
-exports.canAdd = canAdd;

+ 0
- 6
node_modules/bip174/src/lib/converter/input/witnessUtxo.d.ts View File

@@ -1,6 +0,0 @@
1
-import { KeyValue, WitnessUtxo } from '../../interfaces';
2
-export declare function decode(keyVal: KeyValue): WitnessUtxo;
3
-export declare function encode(data: WitnessUtxo): KeyValue;
4
-export declare const expected = "{ script: Buffer; value: number; }";
5
-export declare function check(data: any): data is WitnessUtxo;
6
-export declare function canAdd(currentData: any, newData: any): boolean;

+ 0
- 53
node_modules/bip174/src/lib/converter/input/witnessUtxo.js View File

@@ -1,53 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const typeFields_1 = require('../../typeFields');
4
-const tools_1 = require('../tools');
5
-const varuint = require('../varint');
6
-function decode(keyVal) {
7
-  if (keyVal.key[0] !== typeFields_1.InputTypes.WITNESS_UTXO) {
8
-    throw new Error(
9
-      'Decode Error: could not decode witnessUtxo with key 0x' +
10
-        keyVal.key.toString('hex'),
11
-    );
12
-  }
13
-  const value = tools_1.readUInt64LE(keyVal.value, 0);
14
-  let _offset = 8;
15
-  const scriptLen = varuint.decode(keyVal.value, _offset);
16
-  _offset += varuint.encodingLength(scriptLen);
17
-  const script = keyVal.value.slice(_offset);
18
-  if (script.length !== scriptLen) {
19
-    throw new Error('Decode Error: WITNESS_UTXO script is not proper length');
20
-  }
21
-  return {
22
-    script,
23
-    value,
24
-  };
25
-}
26
-exports.decode = decode;
27
-function encode(data) {
28
-  const { script, value } = data;
29
-  const varintLen = varuint.encodingLength(script.length);
30
-  const result = Buffer.allocUnsafe(8 + varintLen + script.length);
31
-  tools_1.writeUInt64LE(result, value, 0);
32
-  varuint.encode(script.length, result, 8);
33
-  script.copy(result, 8 + varintLen);
34
-  return {
35
-    key: Buffer.from([typeFields_1.InputTypes.WITNESS_UTXO]),
36
-    value: result,
37
-  };
38
-}
39
-exports.encode = encode;
40
-exports.expected = '{ script: Buffer; value: number; }';
41
-function check(data) {
42
-  return Buffer.isBuffer(data.script) && typeof data.value === 'number';
43
-}
44
-exports.check = check;
45
-function canAdd(currentData, newData) {
46
-  return (
47
-    !!currentData &&
48
-    !!newData &&
49
-    currentData.witnessUtxo === undefined &&
50
-    currentData.nonWitnessUtxo === undefined
51
-  );
52
-}
53
-exports.canAdd = canAdd;

+ 0
- 8
node_modules/bip174/src/lib/converter/shared/bip32Derivation.d.ts View File

@@ -1,8 +0,0 @@
1
-import { Bip32Derivation, KeyValue } from '../../interfaces';
2
-export declare function makeConverter(TYPE_BYTE: number): {
3
-    decode: (keyVal: KeyValue) => Bip32Derivation;
4
-    encode: (data: Bip32Derivation) => KeyValue;
5
-    check: (data: any) => data is Bip32Derivation;
6
-    expected: string;
7
-    canAddToArray: (array: Bip32Derivation[], item: Bip32Derivation, dupeSet: Set<string>) => boolean;
8
-};

+ 0
- 85
node_modules/bip174/src/lib/converter/shared/bip32Derivation.js View File

@@ -1,85 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const range = n => [...Array(n).keys()];
4
-function makeConverter(TYPE_BYTE) {
5
-  function decode(keyVal) {
6
-    if (keyVal.key[0] !== TYPE_BYTE) {
7
-      throw new Error(
8
-        'Decode Error: could not decode bip32Derivation with key 0x' +
9
-          keyVal.key.toString('hex'),
10
-      );
11
-    }
12
-    if (
13
-      !(keyVal.key.length === 34 || keyVal.key.length === 66) ||
14
-      ![2, 3, 4].includes(keyVal.key[1])
15
-    ) {
16
-      throw new Error(
17
-        'Decode Error: bip32Derivation has invalid pubkey in key 0x' +
18
-          keyVal.key.toString('hex'),
19
-      );
20
-    }
21
-    if ((keyVal.value.length / 4) % 1 !== 0) {
22
-      throw new Error(
23
-        'Decode Error: Input BIP32_DERIVATION value length should be multiple of 4',
24
-      );
25
-    }
26
-    const pubkey = keyVal.key.slice(1);
27
-    const data = {
28
-      masterFingerprint: keyVal.value.slice(0, 4),
29
-      pubkey,
30
-      path: 'm',
31
-    };
32
-    for (const i of range(keyVal.value.length / 4 - 1)) {
33
-      const val = keyVal.value.readUInt32LE(i * 4 + 4);
34
-      const isHard = !!(val & 0x80000000);
35
-      const idx = val & 0x7fffffff;
36
-      data.path += '/' + idx.toString(10) + (isHard ? "'" : '');
37
-    }
38
-    return data;
39
-  }
40
-  function encode(data) {
41
-    const head = Buffer.from([TYPE_BYTE]);
42
-    const key = Buffer.concat([head, data.pubkey]);
43
-    const splitPath = data.path.split('/');
44
-    const value = Buffer.allocUnsafe(splitPath.length * 4);
45
-    data.masterFingerprint.copy(value, 0);
46
-    let offset = 4;
47
-    splitPath.slice(1).forEach(level => {
48
-      const isHard = level.slice(-1) === "'";
49
-      let num = 0x7fffffff & parseInt(isHard ? level.slice(0, -1) : level, 10);
50
-      if (isHard) num += 0x80000000;
51
-      value.writeUInt32LE(num, offset);
52
-      offset += 4;
53
-    });
54
-    return {
55
-      key,
56
-      value,
57
-    };
58
-  }
59
-  const expected =
60
-    '{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }';
61
-  function check(data) {
62
-    return (
63
-      Buffer.isBuffer(data.pubkey) &&
64
-      Buffer.isBuffer(data.masterFingerprint) &&
65
-      typeof data.path === 'string' &&
66
-      [33, 65].includes(data.pubkey.length) &&
67
-      [2, 3, 4].includes(data.pubkey[0]) &&
68
-      data.masterFingerprint.length === 4
69
-    );
70
-  }
71
-  function canAddToArray(array, item, dupeSet) {
72
-    const dupeString = item.pubkey.toString('hex');
73
-    if (dupeSet.has(dupeString)) return false;
74
-    dupeSet.add(dupeString);
75
-    return array.filter(v => v.pubkey.equals(item.pubkey)).length === 0;
76
-  }
77
-  return {
78
-    decode,
79
-    encode,
80
-    check,
81
-    expected,
82
-    canAddToArray,
83
-  };
84
-}
85
-exports.makeConverter = makeConverter;

+ 0
- 3
node_modules/bip174/src/lib/converter/shared/checkPubkey.d.ts View File

@@ -1,3 +0,0 @@
1
-/// <reference types="node" />
2
-import { KeyValue } from '../../interfaces';
3
-export declare function makeChecker(pubkeyTypes: number[]): (keyVal: KeyValue) => Buffer | undefined;

+ 0
- 21
node_modules/bip174/src/lib/converter/shared/checkPubkey.js View File

@@ -1,21 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-function makeChecker(pubkeyTypes) {
4
-  return checkPubkey;
5
-  function checkPubkey(keyVal) {
6
-    let pubkey;
7
-    if (pubkeyTypes.includes(keyVal.key[0])) {
8
-      pubkey = keyVal.key.slice(1);
9
-      if (
10
-        !(pubkey.length === 33 || pubkey.length === 65) ||
11
-        ![2, 3, 4].includes(pubkey[0])
12
-      ) {
13
-        throw new Error(
14
-          'Format Error: invalid pubkey in key 0x' + keyVal.key.toString('hex'),
15
-        );
16
-      }
17
-    }
18
-    return pubkey;
19
-  }
20
-}
21
-exports.makeChecker = makeChecker;

+ 0
- 8
node_modules/bip174/src/lib/converter/shared/redeemScript.d.ts View File

@@ -1,8 +0,0 @@
1
-import { KeyValue, RedeemScript } from '../../interfaces';
2
-export declare function makeConverter(TYPE_BYTE: number): {
3
-    decode: (keyVal: KeyValue) => RedeemScript;
4
-    encode: (data: RedeemScript) => KeyValue;
5
-    check: (data: any) => data is RedeemScript;
6
-    expected: string;
7
-    canAdd: (currentData: any, newData: any) => boolean;
8
-};

+ 0
- 35
node_modules/bip174/src/lib/converter/shared/redeemScript.js View File

@@ -1,35 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-function makeConverter(TYPE_BYTE) {
4
-  function decode(keyVal) {
5
-    if (keyVal.key[0] !== TYPE_BYTE) {
6
-      throw new Error(
7
-        'Decode Error: could not decode redeemScript with key 0x' +
8
-          keyVal.key.toString('hex'),
9
-      );
10
-    }
11
-    return keyVal.value;
12
-  }
13
-  function encode(data) {
14
-    const key = Buffer.from([TYPE_BYTE]);
15
-    return {
16
-      key,
17
-      value: data,
18
-    };
19
-  }
20
-  const expected = 'Buffer';
21
-  function check(data) {
22
-    return Buffer.isBuffer(data);
23
-  }
24
-  function canAdd(currentData, newData) {
25
-    return !!currentData && !!newData && currentData.redeemScript === undefined;
26
-  }
27
-  return {
28
-    decode,
29
-    encode,
30
-    check,
31
-    expected,
32
-    canAdd,
33
-  };
34
-}
35
-exports.makeConverter = makeConverter;

+ 0
- 8
node_modules/bip174/src/lib/converter/shared/witnessScript.d.ts View File

@@ -1,8 +0,0 @@
1
-import { KeyValue, WitnessScript } from '../../interfaces';
2
-export declare function makeConverter(TYPE_BYTE: number): {
3
-    decode: (keyVal: KeyValue) => WitnessScript;
4
-    encode: (data: WitnessScript) => KeyValue;
5
-    check: (data: any) => data is WitnessScript;
6
-    expected: string;
7
-    canAdd: (currentData: any, newData: any) => boolean;
8
-};

+ 0
- 37
node_modules/bip174/src/lib/converter/shared/witnessScript.js View File

@@ -1,37 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-function makeConverter(TYPE_BYTE) {
4
-  function decode(keyVal) {
5
-    if (keyVal.key[0] !== TYPE_BYTE) {
6
-      throw new Error(
7
-        'Decode Error: could not decode witnessScript with key 0x' +
8
-          keyVal.key.toString('hex'),
9
-      );
10
-    }
11
-    return keyVal.value;
12
-  }
13
-  function encode(data) {
14
-    const key = Buffer.from([TYPE_BYTE]);
15
-    return {
16
-      key,
17
-      value: data,
18
-    };
19
-  }
20
-  const expected = 'Buffer';
21
-  function check(data) {
22
-    return Buffer.isBuffer(data);
23
-  }
24
-  function canAdd(currentData, newData) {
25
-    return (
26
-      !!currentData && !!newData && currentData.witnessScript === undefined
27
-    );
28
-  }
29
-  return {
30
-    decode,
31
-    encode,
32
-    check,
33
-    expected,
34
-    canAdd,
35
-  };
36
-}
37
-exports.makeConverter = makeConverter;

+ 0
- 8
node_modules/bip174/src/lib/converter/tools.d.ts View File

@@ -1,8 +0,0 @@
1
-/// <reference types="node" />
2
-import { KeyValue } from '../interfaces';
3
-export declare const range: (n: number) => number[];
4
-export declare function reverseBuffer(buffer: Buffer): Buffer;
5
-export declare function keyValsToBuffer(keyVals: KeyValue[]): Buffer;
6
-export declare function keyValToBuffer(keyVal: KeyValue): Buffer;
7
-export declare function readUInt64LE(buffer: Buffer, offset: number): number;
8
-export declare function writeUInt64LE(buffer: Buffer, value: number, offset: number): number;

+ 0
- 63
node_modules/bip174/src/lib/converter/tools.js View File

@@ -1,63 +0,0 @@
1
-'use strict';
2
-Object.defineProperty(exports, '__esModule', { value: true });
3
-const varuint = require('./varint');
4
-exports.range = n => [...Array(n).keys()];
5
-function reverseBuffer(buffer) {
6
-  if (buffer.length < 1) return buffer;
7
-  let j = buffer.length - 1;
8
-  let tmp = 0;
9
-  for (let i = 0; i < buffer.length / 2; i++) {
10
-    tmp = buffer[i];
11
-    buffer[i] = buffer[j];
12
-    buffer[j] = tmp;
13
-    j--;
14
-  }
15
-  return buffer;
16
-}
17
-exports.reverseBuffer = reverseBuffer;
18
-function keyValsToBuffer(keyVals) {
19
-  const buffers = keyVals.map(keyVal => keyValToBuffer(keyVal));
20
-  buffers.push(Buffer.from([0]));
21
-  return Buffer.concat(buffers);
22
-}
23
-exports.keyValsToBuffer = keyValsToBuffer;
24
-function keyValToBuffer(keyVal) {
25
-  const keyLen = keyVal.key.length;
26
-  const valLen = keyVal.value.length;
27
-  const keyVarIntLen = varuint.encodingLength(keyLen);
28
-  const valVarIntLen = varuint.encodingLength(valLen);
29
-  const buffer = Buffer.allocUnsafe(
30
-    keyVarIntLen + keyLen + valVarIntLen + valLen,
31
-  );
32
-  varuint.encode(keyLen, buffer, 0);
33
-  keyVal.key.copy(buffer, keyVarIntLen);
34
-  varuint.encode(valLen, buffer, keyVarIntLen + keyLen);
35
-  keyVal.value.copy(buffer, keyVarIntLen + keyLen + valVarIntLen);
36
-  return buffer;
37
-}
38
-exports.keyValToBuffer = keyValToBuffer;
39
-// https://github.com/feross/buffer/blob/master/index.js#L1127
40
-function verifuint(value, max) {
41
-  if (typeof value !== 'number')
42
-    throw new Error('cannot write a non-number as a number');
43
-  if (value < 0)
44
-    throw new Error('specified a negative value for writing an unsigned value');
45
-  if (value > max) throw new Error('RangeError: value out of range');
46
-  if (Math.floor(value) !== value)
47
-    throw new Error('value has a fractional component');
48
-}
49
-function readUInt64LE(buffer, offset) {
50
-  const a = buffe