@btc-vision/transaction 1.7.24 → 1.7.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/btc-vision-bitcoin.js +12 -13
- package/browser/index.js +410 -397
- package/browser/noble-curves.js +1045 -1016
- package/browser/noble-hashes.js +918 -728
- package/browser/vendors.js +11492 -12407
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.js +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +20 -18
- package/src/crypto/crypto-browser.js +9 -16
- package/src/shims/vm-browser.js +19 -0
- package/src/shims/zlib-browser.js +24 -0
- package/tsconfig.build.json +5 -0
- package/vite.config.browser.ts +32 -29
- package/browser/bip39.js +0 -204
- package/browser/bitcoin-utils.js +0 -3172
- package/browser/btc-vision-bip32.js +0 -805
- package/browser/btc-vision-logger.js +0 -273
- package/browser/btc-vision-post-quantum.js +0 -542
- package/browser/polyfills.js +0 -4590
- package/browser/scure-base.js +0 -410
- package/build/crypto/crypto-browser.d.ts +0 -11
- package/build/crypto/crypto-browser.js +0 -56
- package/gulpfile.js +0 -42
- package/webpack.config.js +0 -220
package/webpack.config.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import webpack from 'webpack';
|
|
2
|
-
import TerserPlugin from 'terser-webpack-plugin';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
mode: 'production',
|
|
6
|
-
target: 'web',
|
|
7
|
-
entry: {
|
|
8
|
-
index: {
|
|
9
|
-
import: './src/index.ts',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
watch: false,
|
|
13
|
-
output: {
|
|
14
|
-
filename: '[name].js',
|
|
15
|
-
chunkFilename: 'chunks/[name].js',
|
|
16
|
-
path: import.meta.dirname + '/browser',
|
|
17
|
-
libraryTarget: 'module',
|
|
18
|
-
chunkFormat: 'module',
|
|
19
|
-
chunkLoading: 'import',
|
|
20
|
-
},
|
|
21
|
-
node: {
|
|
22
|
-
__dirname: false,
|
|
23
|
-
},
|
|
24
|
-
experiments: {
|
|
25
|
-
outputModule: true,
|
|
26
|
-
asyncWebAssembly: false,
|
|
27
|
-
syncWebAssembly: true,
|
|
28
|
-
},
|
|
29
|
-
resolve: {
|
|
30
|
-
extensionAlias: {
|
|
31
|
-
'.js': ['.js', '.ts'],
|
|
32
|
-
},
|
|
33
|
-
modules: ['.', 'node_modules'],
|
|
34
|
-
extensions: ['.*', '.js', '.jsx', '.tsx', '.ts', '.wasm'],
|
|
35
|
-
alias: {
|
|
36
|
-
// Dedupe noble/curves to single version
|
|
37
|
-
'@noble/curves': import.meta.dirname + '/node_modules/@noble/curves',
|
|
38
|
-
},
|
|
39
|
-
fallback: {
|
|
40
|
-
buffer: import.meta.resolve('buffer/'),
|
|
41
|
-
assert: import.meta.resolve('assert/'),
|
|
42
|
-
crypto: import.meta.resolve('./src/crypto/crypto-browser.js'),
|
|
43
|
-
http: import.meta.resolve('stream-http/'),
|
|
44
|
-
https: import.meta.resolve('https-browserify/'),
|
|
45
|
-
os: import.meta.resolve('os-browserify/browser/'),
|
|
46
|
-
stream: import.meta.resolve('stream-browserify'),
|
|
47
|
-
process: import.meta.resolve('process/browser'),
|
|
48
|
-
zlib: import.meta.resolve('browserify-zlib'),
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
cache: false,
|
|
52
|
-
module: {
|
|
53
|
-
rules: [
|
|
54
|
-
{
|
|
55
|
-
test: /\.(js|jsx|tsx|ts)$/,
|
|
56
|
-
exclude: [/node_modules/, /test/, /__tests__/],
|
|
57
|
-
resolve: {
|
|
58
|
-
fullySpecified: false,
|
|
59
|
-
},
|
|
60
|
-
use: [
|
|
61
|
-
{
|
|
62
|
-
loader: 'babel-loader',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
loader: 'ts-loader',
|
|
66
|
-
options: {
|
|
67
|
-
configFile: 'tsconfig.webpack.json',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
optimization: {
|
|
75
|
-
usedExports: true,
|
|
76
|
-
minimize: true,
|
|
77
|
-
minimizer: [
|
|
78
|
-
new TerserPlugin({
|
|
79
|
-
terserOptions: {
|
|
80
|
-
compress: {
|
|
81
|
-
drop_console: false,
|
|
82
|
-
drop_debugger: true,
|
|
83
|
-
passes: 3,
|
|
84
|
-
pure_funcs: ['console.debug'],
|
|
85
|
-
dead_code: true,
|
|
86
|
-
unused: true,
|
|
87
|
-
},
|
|
88
|
-
mangle: {
|
|
89
|
-
safari10: true,
|
|
90
|
-
},
|
|
91
|
-
format: {
|
|
92
|
-
comments: false,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
extractComments: false,
|
|
96
|
-
}),
|
|
97
|
-
],
|
|
98
|
-
concatenateModules: true,
|
|
99
|
-
sideEffects: true,
|
|
100
|
-
providedExports: true,
|
|
101
|
-
innerGraph: true,
|
|
102
|
-
splitChunks: {
|
|
103
|
-
chunks: 'all',
|
|
104
|
-
minSize: 1000,
|
|
105
|
-
maxInitialRequests: Infinity,
|
|
106
|
-
cacheGroups: {
|
|
107
|
-
// Noble cryptographic libraries (curves + hashes)
|
|
108
|
-
nobleCurves: {
|
|
109
|
-
test: /[\\/]node_modules[\\/]@noble[\\/]curves[\\/]/,
|
|
110
|
-
name: 'noble-curves',
|
|
111
|
-
priority: 50,
|
|
112
|
-
reuseExistingChunk: true,
|
|
113
|
-
},
|
|
114
|
-
nobleHashes: {
|
|
115
|
-
test: /[\\/]node_modules[\\/]@noble[\\/]hashes[\\/]/,
|
|
116
|
-
name: 'noble-hashes',
|
|
117
|
-
priority: 49,
|
|
118
|
-
reuseExistingChunk: true,
|
|
119
|
-
},
|
|
120
|
-
nobleSecp: {
|
|
121
|
-
test: /[\\/]node_modules[\\/]@noble[\\/]secp256k1[\\/]/,
|
|
122
|
-
name: 'noble-secp256k1',
|
|
123
|
-
priority: 48,
|
|
124
|
-
reuseExistingChunk: true,
|
|
125
|
-
},
|
|
126
|
-
// Separate @btc-vision packages
|
|
127
|
-
btcBitcoin: {
|
|
128
|
-
test: /[\\/]node_modules[\\/]@btc-vision[\\/]bitcoin[\\/]/,
|
|
129
|
-
name: 'btc-vision-bitcoin',
|
|
130
|
-
priority: 45,
|
|
131
|
-
reuseExistingChunk: true,
|
|
132
|
-
},
|
|
133
|
-
btcBip32: {
|
|
134
|
-
test: /[\\/]node_modules[\\/]@btc-vision[\\/]bip32[\\/]/,
|
|
135
|
-
name: 'btc-vision-bip32',
|
|
136
|
-
priority: 44,
|
|
137
|
-
reuseExistingChunk: true,
|
|
138
|
-
},
|
|
139
|
-
btcPostQuantum: {
|
|
140
|
-
test: /[\\/]node_modules[\\/]@btc-vision[\\/]post-quantum[\\/]/,
|
|
141
|
-
name: 'btc-vision-post-quantum',
|
|
142
|
-
priority: 43,
|
|
143
|
-
reuseExistingChunk: true,
|
|
144
|
-
},
|
|
145
|
-
btcLogger: {
|
|
146
|
-
test: /[\\/]node_modules[\\/]@btc-vision[\\/]logger[\\/]/,
|
|
147
|
-
name: 'btc-vision-logger',
|
|
148
|
-
priority: 42,
|
|
149
|
-
reuseExistingChunk: true,
|
|
150
|
-
},
|
|
151
|
-
// Valibot validation library
|
|
152
|
-
valibot: {
|
|
153
|
-
test: /[\\/]node_modules[\\/]valibot[\\/]/,
|
|
154
|
-
name: 'valibot',
|
|
155
|
-
priority: 40,
|
|
156
|
-
reuseExistingChunk: true,
|
|
157
|
-
},
|
|
158
|
-
// Pako compression
|
|
159
|
-
pako: {
|
|
160
|
-
test: /[\\/]node_modules[\\/]pako[\\/]/,
|
|
161
|
-
name: 'pako',
|
|
162
|
-
priority: 39,
|
|
163
|
-
reuseExistingChunk: true,
|
|
164
|
-
},
|
|
165
|
-
// BIP39 mnemonic (wordlists are stripped via IgnorePlugin)
|
|
166
|
-
bip39: {
|
|
167
|
-
test: /[\\/]node_modules[\\/]bip39[\\/]/,
|
|
168
|
-
name: 'bip39',
|
|
169
|
-
priority: 38,
|
|
170
|
-
reuseExistingChunk: true,
|
|
171
|
-
},
|
|
172
|
-
// Bitcoin utilities
|
|
173
|
-
bitcoin: {
|
|
174
|
-
test: /[\\/]node_modules[\\/](bip174|bech32|ecpair|@bitcoinerlab)[\\/]/,
|
|
175
|
-
name: 'bitcoin-utils',
|
|
176
|
-
priority: 35,
|
|
177
|
-
reuseExistingChunk: true,
|
|
178
|
-
},
|
|
179
|
-
// Scure base encoding
|
|
180
|
-
scure: {
|
|
181
|
-
test: /[\\/]node_modules[\\/]@scure[\\/]/,
|
|
182
|
-
name: 'scure-base',
|
|
183
|
-
priority: 34,
|
|
184
|
-
reuseExistingChunk: true,
|
|
185
|
-
},
|
|
186
|
-
// Buffer and stream polyfills
|
|
187
|
-
polyfills: {
|
|
188
|
-
test: /[\\/]node_modules[\\/](buffer|stream-browserify|browserify-zlib|process|assert|os-browserify|https-browserify|stream-http)[\\/]/,
|
|
189
|
-
name: 'polyfills',
|
|
190
|
-
priority: 25,
|
|
191
|
-
reuseExistingChunk: true,
|
|
192
|
-
},
|
|
193
|
-
// Remaining vendor code
|
|
194
|
-
vendors: {
|
|
195
|
-
test: /[\\/]node_modules[\\/]/,
|
|
196
|
-
name: 'vendors',
|
|
197
|
-
priority: 10,
|
|
198
|
-
reuseExistingChunk: true,
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
plugins: [
|
|
204
|
-
new webpack.ProvidePlugin({
|
|
205
|
-
Buffer: ['buffer', 'Buffer'],
|
|
206
|
-
process: 'process/browser',
|
|
207
|
-
stream: 'stream-browserify',
|
|
208
|
-
zlib: 'browserify-zlib',
|
|
209
|
-
bitcoin: '@btc-vision/bitcoin',
|
|
210
|
-
}),
|
|
211
|
-
// Strip unused bip39 wordlists (keep only English) - saves ~150KB
|
|
212
|
-
new webpack.IgnorePlugin({
|
|
213
|
-
resourceRegExp: /^\.\/wordlists\/(?!english)/,
|
|
214
|
-
contextRegExp: /bip39/,
|
|
215
|
-
}),
|
|
216
|
-
],
|
|
217
|
-
// Externals config for dependent packages to avoid duplication
|
|
218
|
-
// Other packages can set these externals and import chunks from @btc-vision/transaction
|
|
219
|
-
externalsType: 'module',
|
|
220
|
-
};
|