@btc-vision/bitcoin 6.3.6 → 6.4.1

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.
Files changed (71) hide show
  1. package/.mocharc.json +13 -0
  2. package/browser/address.d.ts +1 -1
  3. package/browser/index.js +1 -1
  4. package/browser/index.js.LICENSE.txt +3 -3
  5. package/browser/networks.d.ts +1 -0
  6. package/build/address.d.ts +2 -1
  7. package/build/address.js +68 -13
  8. package/build/block.js +2 -2
  9. package/build/bufferutils.js +5 -5
  10. package/build/networks.d.ts +1 -0
  11. package/build/networks.js +11 -0
  12. package/build/psbt/psbtutils.js +2 -2
  13. package/build/psbt.js +3 -7
  14. package/package.json +26 -26
  15. package/src/address.ts +91 -15
  16. package/src/block.ts +2 -2
  17. package/src/bufferutils.ts +15 -7
  18. package/src/index.ts +86 -86
  19. package/src/networks.ts +12 -0
  20. package/src/psbt/bip371.ts +441 -441
  21. package/src/psbt/psbtutils.ts +320 -319
  22. package/src/psbt.ts +8 -8
  23. package/test/address.spec.ts +55 -77
  24. package/test/bitcoin.core.spec.ts +47 -69
  25. package/test/block.spec.ts +23 -46
  26. package/test/bufferutils.spec.ts +32 -95
  27. package/test/crypto.spec.ts +9 -15
  28. package/test/fixtures/address.json +3 -3
  29. package/test/integration/addresses.spec.ts +12 -24
  30. package/test/integration/bip32.spec.ts +10 -31
  31. package/test/integration/blocks.spec.ts +2 -2
  32. package/test/integration/cltv.spec.ts +21 -63
  33. package/test/integration/csv.spec.ts +30 -105
  34. package/test/integration/payments.spec.ts +16 -41
  35. package/test/integration/taproot.spec.ts +31 -75
  36. package/test/integration/transactions.spec.ts +37 -138
  37. package/test/payments.spec.ts +95 -106
  38. package/test/payments.utils.ts +20 -63
  39. package/test/psbt.spec.ts +100 -229
  40. package/test/script.spec.ts +26 -50
  41. package/test/script_number.spec.ts +6 -9
  42. package/test/script_signature.spec.ts +7 -7
  43. package/test/transaction.spec.ts +46 -96
  44. package/test/ts-node-register.js +3 -1
  45. package/test/tsconfig.json +4 -1
  46. package/test/types.spec.ts +7 -12
  47. package/.nyc_output/6368a5b2-daa5-4821-8ed0-b742d6fc7eab.json +0 -1
  48. package/.nyc_output/processinfo/6368a5b2-daa5-4821-8ed0-b742d6fc7eab.json +0 -1
  49. package/.nyc_output/processinfo/index.json +0 -1
  50. package/test/address.spec.js +0 -124
  51. package/test/bitcoin.core.spec.js +0 -170
  52. package/test/block.spec.js +0 -141
  53. package/test/bufferutils.spec.js +0 -427
  54. package/test/crypto.spec.js +0 -41
  55. package/test/integration/_regtest.js +0 -7
  56. package/test/integration/addresses.spec.js +0 -116
  57. package/test/integration/bip32.spec.js +0 -85
  58. package/test/integration/blocks.spec.js +0 -26
  59. package/test/integration/cltv.spec.js +0 -199
  60. package/test/integration/csv.spec.js +0 -362
  61. package/test/integration/payments.spec.js +0 -98
  62. package/test/integration/taproot.spec.js +0 -532
  63. package/test/integration/transactions.spec.js +0 -561
  64. package/test/payments.spec.js +0 -97
  65. package/test/payments.utils.js +0 -190
  66. package/test/psbt.spec.js +0 -1044
  67. package/test/script.spec.js +0 -151
  68. package/test/script_number.spec.js +0 -24
  69. package/test/script_signature.spec.js +0 -52
  70. package/test/transaction.spec.js +0 -269
  71. package/test/types.spec.js +0 -46
@@ -7,8 +7,8 @@
7
7
 
8
8
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
9
9
 
10
- /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
10
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11
11
 
12
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
12
+ /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
13
13
 
14
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
14
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
@@ -7,6 +7,7 @@ export interface Network {
7
7
  bip32: Bip32;
8
8
  messagePrefix: string;
9
9
  bech32: string;
10
+ bech32Opnet?: string;
10
11
  pubKeyHash: number;
11
12
  scriptHash: number;
12
13
  }
@@ -8,9 +8,10 @@ export interface Bech32Result {
8
8
  prefix: string;
9
9
  data: Buffer;
10
10
  }
11
+ export declare function toFutureOPNetAddress(output: Buffer, network: Network): string;
11
12
  export declare function fromBase58Check(address: string): Base58CheckResult;
12
13
  export declare function fromBech32(address: string): Bech32Result;
13
14
  export declare function toBase58Check(hash: Buffer, version: number): string;
14
- export declare function toBech32(data: Buffer, version: number, prefix: string): string;
15
+ export declare function toBech32(data: Buffer, version: number, prefix: string, prefixOpnet?: string): string;
15
16
  export declare function fromOutputScript(output: Buffer, network?: Network): string;
16
17
  export declare function toOutputScript(address: string, network?: Network): Buffer;
package/build/address.js CHANGED
@@ -1,29 +1,64 @@
1
1
  import { bech32, bech32m } from 'bech32';
2
2
  import * as bs58check from 'bs58check';
3
- import { payments } from './index.js';
3
+ import { opcodes, payments } from './index.js';
4
4
  import * as networks from './networks.js';
5
5
  import * as bscript from './script.js';
6
6
  import { Hash160bit, tuple, typeforce, UInt8 } from './types.js';
7
7
  const FUTURE_SEGWIT_MAX_SIZE = 40;
8
8
  const FUTURE_SEGWIT_MIN_SIZE = 2;
9
- const FUTURE_SEGWIT_MAX_VERSION = 16;
9
+ const FUTURE_SEGWIT_MAX_VERSION = 15;
10
+ const FUTURE_MAX_VERSION = 16;
11
+ const FUTURE_OPNET_VERSION = 16;
10
12
  const FUTURE_SEGWIT_MIN_VERSION = 2;
11
13
  const FUTURE_SEGWIT_VERSION_DIFF = 0x50;
12
14
  const FUTURE_SEGWIT_VERSION_WARNING = 'WARNING: Sending to a future segwit version address can lead to loss of funds. ' +
13
15
  'End users MUST be warned carefully in the GUI and asked if they wish to proceed ' +
14
16
  'with caution. Wallets should verify the segwit version from the output of fromBech32, ' +
15
17
  'then decide when it is safe to use which version of segwit.';
18
+ export function toFutureOPNetAddress(output, network) {
19
+ if (!Buffer.isBuffer(output))
20
+ throw new TypeError('output must be a Buffer');
21
+ if (!network.bech32Opnet)
22
+ throw new Error('Network does not support opnet');
23
+ const opcode = output[0];
24
+ let pushPos = 1, progLen;
25
+ if (output[1] < 0x4c) {
26
+ progLen = output[1];
27
+ pushPos = 2;
28
+ }
29
+ else if (output[1] === 0x4c) {
30
+ progLen = output[2];
31
+ pushPos = 3;
32
+ }
33
+ else {
34
+ throw new TypeError('Unsupported push opcode in script');
35
+ }
36
+ const program = output.subarray(pushPos, pushPos + progLen);
37
+ if (program.length < FUTURE_SEGWIT_MIN_SIZE || program.length > FUTURE_SEGWIT_MAX_SIZE)
38
+ throw new TypeError('Invalid program length for segwit address');
39
+ const version = opcode === opcodes.OP_0
40
+ ? 0
41
+ : opcode >= opcodes.OP_1 && opcode <= opcodes.OP_16
42
+ ? opcode - (opcodes.OP_1 - 1)
43
+ : -1;
44
+ if (version < FUTURE_SEGWIT_MAX_VERSION || version > FUTURE_MAX_VERSION)
45
+ throw new TypeError(`Invalid segwit version ${version}`);
46
+ const words = [version, ...bech32m.toWords(program)];
47
+ return bech32m.encode(network.bech32Opnet, words);
48
+ }
16
49
  function _toFutureSegwitAddress(output, network) {
17
- const data = output.slice(2);
18
- if (data.length < FUTURE_SEGWIT_MIN_SIZE || data.length > FUTURE_SEGWIT_MAX_SIZE)
50
+ const data = output.subarray(2);
51
+ if (data.length < FUTURE_SEGWIT_MIN_SIZE || data.length > FUTURE_SEGWIT_MAX_SIZE) {
19
52
  throw new TypeError('Invalid program length for segwit address');
53
+ }
20
54
  const version = output[0] - FUTURE_SEGWIT_VERSION_DIFF;
21
- if (version < FUTURE_SEGWIT_MIN_VERSION || version > FUTURE_SEGWIT_MAX_VERSION)
55
+ if (version < FUTURE_SEGWIT_MIN_VERSION || version > FUTURE_SEGWIT_MAX_VERSION) {
22
56
  throw new TypeError('Invalid version for segwit address');
23
- if (output[1] !== data.length)
24
- throw new TypeError('Invalid script for segwit address');
25
- console.warn(FUTURE_SEGWIT_VERSION_WARNING);
26
- return toBech32(data, version, network.bech32);
57
+ }
58
+ if (output[1] !== data.length) {
59
+ throw new TypeError(`Invalid script for segwit address ${output[1]} !== ${data.length}`);
60
+ }
61
+ return toBech32(data, version, network.bech32, network.bech32Opnet);
27
62
  }
28
63
  export function fromBase58Check(address) {
29
64
  const payload = Buffer.from(bs58check.default.decode(address));
@@ -32,7 +67,7 @@ export function fromBase58Check(address) {
32
67
  if (payload.length > 21)
33
68
  throw new TypeError(address + ' is too long');
34
69
  const version = payload.readUInt8(0);
35
- const hash = payload.slice(1);
70
+ const hash = payload.subarray(1);
36
71
  return { version, hash };
37
72
  }
38
73
  export function fromBech32(address) {
@@ -67,9 +102,12 @@ export function toBase58Check(hash, version) {
67
102
  hash.copy(payload, 1);
68
103
  return bs58check.default.encode(payload);
69
104
  }
70
- export function toBech32(data, version, prefix) {
105
+ export function toBech32(data, version, prefix, prefixOpnet) {
71
106
  const words = bech32.toWords(data);
72
107
  words.unshift(version);
108
+ if (version === FUTURE_OPNET_VERSION && prefixOpnet) {
109
+ return bech32m.encode(prefixOpnet, words);
110
+ }
73
111
  return version === 0 ? bech32.encode(prefix, words) : bech32m.encode(prefix, words);
74
112
  }
75
113
  export function fromOutputScript(output, network) {
@@ -94,6 +132,10 @@ export function fromOutputScript(output, network) {
94
132
  return payments.p2tr({ output, network }).address;
95
133
  }
96
134
  catch (e) { }
135
+ try {
136
+ return toFutureOPNetAddress(output, network);
137
+ }
138
+ catch (e) { }
97
139
  try {
98
140
  return _toFutureSegwitAddress(output, network);
99
141
  }
@@ -120,7 +162,9 @@ export function toOutputScript(address, network) {
120
162
  }
121
163
  catch (e) { }
122
164
  if (decodeBech32) {
123
- if (decodeBech32.prefix !== network.bech32)
165
+ if (decodeBech32.prefix !== network.bech32 &&
166
+ network.bech32Opnet &&
167
+ decodeBech32.prefix !== network.bech32Opnet)
124
168
  throw new Error(address + ' has an invalid prefix');
125
169
  if (decodeBech32.version === 0) {
126
170
  if (decodeBech32.data.length === 20)
@@ -132,11 +176,22 @@ export function toOutputScript(address, network) {
132
176
  if (decodeBech32.data.length === 32)
133
177
  return payments.p2tr({ pubkey: decodeBech32.data }).output;
134
178
  }
179
+ else if (decodeBech32.version === FUTURE_OPNET_VERSION) {
180
+ if (!network.bech32Opnet)
181
+ throw new Error(address + ' has an invalid prefix');
182
+ if (decodeBech32.data.length < FUTURE_SEGWIT_MIN_SIZE ||
183
+ decodeBech32.data.length > FUTURE_SEGWIT_MAX_SIZE) {
184
+ throw new Error('Invalid program length for opnet address');
185
+ }
186
+ return bscript.compile([opcodes.OP_16, decodeBech32.data]);
187
+ }
135
188
  else if (decodeBech32.version >= FUTURE_SEGWIT_MIN_VERSION &&
136
189
  decodeBech32.version <= FUTURE_SEGWIT_MAX_VERSION &&
137
190
  decodeBech32.data.length >= FUTURE_SEGWIT_MIN_SIZE &&
138
191
  decodeBech32.data.length <= FUTURE_SEGWIT_MAX_SIZE) {
139
- console.warn(FUTURE_SEGWIT_VERSION_WARNING);
192
+ if (decodeBech32.version !== FUTURE_OPNET_VERSION) {
193
+ console.warn(FUTURE_SEGWIT_VERSION_WARNING);
194
+ }
140
195
  return bscript.compile([
141
196
  decodeBech32.version + FUTURE_SEGWIT_VERSION_DIFF,
142
197
  decodeBech32.data,
package/build/block.js CHANGED
@@ -123,8 +123,8 @@ export class Block {
123
123
  bufferWriter.writeUInt32(this.nonce);
124
124
  if (headersOnly || !this.transactions)
125
125
  return buffer;
126
- varuint.encode(this.transactions.length, buffer, bufferWriter.offset);
127
- bufferWriter.offset += varuint.encode.bytes;
126
+ const encoded = varuint.encode(this.transactions.length, buffer, bufferWriter.offset);
127
+ bufferWriter.offset += encoded.bytes;
128
128
  this.transactions.forEach((tx) => {
129
129
  const txSize = tx.byteLength();
130
130
  tx.toBuffer(buffer, bufferWriter.offset);
@@ -65,8 +65,8 @@ export class BufferWriter {
65
65
  this.offset = writeUInt64LE(this.buffer, i, this.offset);
66
66
  }
67
67
  writeVarInt(i) {
68
- varuint.encode(i, this.buffer, this.offset);
69
- this.offset += varuint.encode.bytes;
68
+ const encode = varuint.encode(i, this.buffer, this.offset);
69
+ this.offset += encode.bytes;
70
70
  }
71
71
  writeSlice(slice) {
72
72
  if (this.buffer.length < this.offset + slice.length) {
@@ -117,14 +117,14 @@ export class BufferReader {
117
117
  }
118
118
  readVarInt() {
119
119
  const vi = varuint.decode(this.buffer, this.offset);
120
- this.offset += varuint.decode.bytes;
121
- return vi;
120
+ this.offset += vi.bytes;
121
+ return vi.numberValue || 0;
122
122
  }
123
123
  readSlice(n) {
124
124
  if (this.buffer.length < this.offset + n) {
125
125
  throw new Error('Cannot read slice out of bounds');
126
126
  }
127
- const result = this.buffer.slice(this.offset, this.offset + n);
127
+ const result = this.buffer.subarray(this.offset, this.offset + n);
128
128
  this.offset += n;
129
129
  return result;
130
130
  }
@@ -7,6 +7,7 @@ export interface Network {
7
7
  bip32: Bip32;
8
8
  messagePrefix: string;
9
9
  bech32: string;
10
+ bech32Opnet?: string;
10
11
  pubKeyHash: number;
11
12
  scriptHash: number;
12
13
  }
package/build/networks.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export const bitcoin = {
2
2
  messagePrefix: '\x18Bitcoin Signed Message:\n',
3
3
  bech32: 'bc',
4
+ bech32Opnet: 'op',
4
5
  bip32: {
5
6
  public: 0x0488b21e,
6
7
  private: 0x0488ade4,
@@ -12,6 +13,7 @@ export const bitcoin = {
12
13
  export const regtest = {
13
14
  messagePrefix: '\x18Bitcoin Signed Message:\n',
14
15
  bech32: 'bcrt',
16
+ bech32Opnet: 'opr',
15
17
  bip32: {
16
18
  public: 0x043587cf,
17
19
  private: 0x04358394,
@@ -23,6 +25,7 @@ export const regtest = {
23
25
  export const testnet = {
24
26
  messagePrefix: '\x18Bitcoin Signed Message:\n',
25
27
  bech32: 'tb',
28
+ bech32Opnet: 'opt',
26
29
  bip32: {
27
30
  public: 0x043587cf,
28
31
  private: 0x04358394,
@@ -34,6 +37,7 @@ export const testnet = {
34
37
  export const dogecoin = {
35
38
  messagePrefix: '\x19Dogecoin Signed Message:\n',
36
39
  bech32: '',
40
+ bech32Opnet: '',
37
41
  bip32: {
38
42
  public: 0x02facafd,
39
43
  private: 0x02fac398,
@@ -45,6 +49,7 @@ export const dogecoin = {
45
49
  export const dogecoinTestnet = {
46
50
  messagePrefix: '\x19Dogecoin Signed Message:\n',
47
51
  bech32: '',
52
+ bech32Opnet: '',
48
53
  bip32: {
49
54
  public: 0x0432a9a8,
50
55
  private: 0x0432a243,
@@ -56,6 +61,7 @@ export const dogecoinTestnet = {
56
61
  export const litecoin = {
57
62
  messagePrefix: '\x19Litecoin Signed Message:\n',
58
63
  bech32: 'ltc',
64
+ bech32Opnet: 'opl',
59
65
  bip32: {
60
66
  public: 0x019da462,
61
67
  private: 0x019d9cfe,
@@ -67,6 +73,7 @@ export const litecoin = {
67
73
  export const litecoinTestnet = {
68
74
  messagePrefix: '\x19Litecoin Signed Message:\n',
69
75
  bech32: 'tltc',
76
+ bech32Opnet: 'oplt',
70
77
  bip32: {
71
78
  public: 0x0436ef7d,
72
79
  private: 0x0436f6e1,
@@ -78,6 +85,7 @@ export const litecoinTestnet = {
78
85
  export const bitcoinCash = {
79
86
  messagePrefix: '\x18Bitcoin Signed Message:\n',
80
87
  bech32: 'bitcoincash',
88
+ bech32Opnet: 'opbch',
81
89
  bip32: {
82
90
  public: 0x0488b21e,
83
91
  private: 0x0488ade4,
@@ -89,6 +97,7 @@ export const bitcoinCash = {
89
97
  export const bitcoinCashTestnet = {
90
98
  messagePrefix: '\x18Bitcoin Signed Message:\n',
91
99
  bech32: 'bchtest',
100
+ bech32Opnet: 'opbcht',
92
101
  bip32: {
93
102
  public: 0x043587cf,
94
103
  private: 0x04358394,
@@ -100,6 +109,7 @@ export const bitcoinCashTestnet = {
100
109
  export const dash = {
101
110
  messagePrefix: '\x19DarkCoin Signed Message:\n',
102
111
  bech32: '',
112
+ bech32Opnet: '',
103
113
  bip32: {
104
114
  public: 0x02fe52cc,
105
115
  private: 0x02fe52f8,
@@ -111,6 +121,7 @@ export const dash = {
111
121
  export const dashTestnet = {
112
122
  messagePrefix: '\x19DarkCoin Signed Message:\n',
113
123
  bech32: '',
124
+ bech32Opnet: '',
114
125
  bip32: {
115
126
  public: 0x3a8061a0,
116
127
  private: 0x3a805837,
@@ -56,8 +56,8 @@ export function decompressPublicKey(realPubKey) {
56
56
  return;
57
57
  }
58
58
  if (![33, 65].includes(realPubKey.length)) {
59
- console.trace(`Unsupported key length=${realPubKey.length}. Must be 33 (compressed) or 65 (uncompressed).`);
60
- throw new Error(`Unsupported key length=${realPubKey.length}. Must be 33 (compressed) or 65 (uncompressed).`);
59
+ console.warn(`Unsupported key length=${realPubKey.length}. Must be 33 (compressed) or 65 (uncompressed).`);
60
+ return;
61
61
  }
62
62
  let point;
63
63
  try {
package/build/psbt.js CHANGED
@@ -3,7 +3,6 @@ import * as varuint from 'bip174/src/lib/converter/varint.js';
3
3
  import { checkForInput, checkForOutput } from 'bip174/src/lib/utils.js';
4
4
  import { fromOutputScript, toOutputScript } from './address.js';
5
5
  import { cloneBuffer, reverseBuffer } from './bufferutils.js';
6
- import { hookSigner } from './hooks/HookedSigner.js';
7
6
  import { payments } from './index.js';
8
7
  import { bitcoin as btcNetwork } from './networks.js';
9
8
  import { tapleafHash } from './payments/bip341.js';
@@ -92,8 +91,7 @@ export class Psbt {
92
91
  return this;
93
92
  }
94
93
  clone() {
95
- const res = Psbt.fromBuffer(this.data.toBuffer(), JSON.parse(JSON.stringify(this.opts)));
96
- return res;
94
+ return Psbt.fromBuffer(this.data.toBuffer(), JSON.parse(JSON.stringify(this.opts)));
97
95
  }
98
96
  setMaximumFeeRate(satoshiPerByte) {
99
97
  check32Bit(satoshiPerByte);
@@ -555,7 +553,6 @@ export class Psbt {
555
553
  return validationResultCount > 0;
556
554
  }
557
555
  _signInput(inputIndex, keyPair, sighashTypes = [Transaction.SIGHASH_ALL]) {
558
- hookSigner(keyPair);
559
556
  const { hash, sighashType } = getHashAndSighashType(this.data.inputs, inputIndex, keyPair.publicKey, this.__CACHE, sighashTypes);
560
557
  const partialSig = [
561
558
  {
@@ -567,7 +564,6 @@ export class Psbt {
567
564
  return this;
568
565
  }
569
566
  _signTaprootInput(inputIndex, input, keyPair, tapLeafHashToSign, allowedSighashTypes = [Transaction.SIGHASH_DEFAULT]) {
570
- hookSigner(keyPair);
571
567
  const hashesForSig = this.checkTaprootHashesForSig(inputIndex, input, keyPair, tapLeafHashToSign, allowedSighashTypes);
572
568
  const tapKeySig = hashesForSig
573
569
  .filter((h) => !h.leafHash)
@@ -588,7 +584,6 @@ export class Psbt {
588
584
  return this;
589
585
  }
590
586
  _signInputAsync(inputIndex, keyPair, sighashTypes = [Transaction.SIGHASH_ALL]) {
591
- hookSigner(keyPair);
592
587
  const { hash, sighashType } = getHashAndSighashType(this.data.inputs, inputIndex, keyPair.publicKey, this.__CACHE, sighashTypes);
593
588
  return Promise.resolve(keyPair.sign(hash)).then((signature) => {
594
589
  const partialSig = [
@@ -601,7 +596,6 @@ export class Psbt {
601
596
  });
602
597
  }
603
598
  async _signTaprootInputAsync(inputIndex, input, keyPair, tapLeafHash, sighashTypes = [Transaction.SIGHASH_DEFAULT]) {
604
- hookSigner(keyPair);
605
599
  const hashesForSig = this.checkTaprootHashesForSig(inputIndex, input, keyPair, tapLeafHash, sighashTypes);
606
600
  const signaturePromises = [];
607
601
  const tapKeyHash = hashesForSig.filter((h) => !h.leafHash)[0];
@@ -684,6 +678,8 @@ function canFinalize(input, script, scriptType) {
684
678
  case 'multisig':
685
679
  const p2ms = payments.p2ms({ output: script });
686
680
  return hasSigs(p2ms.m, input.partialSig, p2ms.pubkeys);
681
+ case 'nonstandard':
682
+ return true;
687
683
  default:
688
684
  return false;
689
685
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/bitcoin",
3
3
  "type": "module",
4
- "version": "6.3.6",
4
+ "version": "6.4.1",
5
5
  "description": "Client-side Bitcoin JavaScript library",
6
6
  "engines": {
7
7
  "node": ">=16.0.0"
@@ -55,7 +55,7 @@
55
55
  "audit": "better-npm-audit audit -l high",
56
56
  "build:tests": "npm run clean:jstests && tsc -p ./test/tsconfig.json",
57
57
  "clean": "rimraf build",
58
- "clean:jstests": "rimraf 'test/**/!(ts-node-register)*.js'",
58
+ "clean:jstests": "rimraf --glob \"test/**/!(ts-node-register).js\"",
59
59
  "coverage-report": "npm run build && npm run nobuild:coverage-report",
60
60
  "coverage-html": "npm run build && npm run nobuild:coverage-html",
61
61
  "coverage": "npm run build && npm run nobuild:coverage",
@@ -65,29 +65,29 @@
65
65
  "format:ci": "npm run prettier -- --check && npm run prettierjs -- --check",
66
66
  "gitdiff:ci": "npm run build && git diff --exit-code",
67
67
  "integration": "npm run build && npm run nobuild:integration",
68
- "lint": "eslint ts_src/**",
68
+ "lint": "eslint src/**",
69
69
  "lint:tests": "eslint test/**/*.spec.ts",
70
- "mocha:ts": "mocha --recursive --require test/ts-node-register",
70
+ "mocha:ts": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha -n loader=ts-node/esm -n experimental-specifier-resolution=node --extension ts --timeout 10000 --recursive \"test/**/*.spec.ts\"",
71
71
  "nobuild:coverage-report": "nyc report --reporter=lcov",
72
72
  "nobuild:coverage-html": "nyc report --reporter=html",
73
73
  "nobuild:coverage": "npm run build:tests && nyc --check-coverage --branches 85 --functions 90 --lines 90 mocha && npm run clean:jstests",
74
74
  "nobuild:integration": "npm run mocha:ts -- --timeout 50000 'test/integration/*.ts'",
75
75
  "nobuild:unit": "npm run mocha:ts -- 'test/*.ts'",
76
- "prettier": "prettier \"ts_src/**/*.ts\" \"test/**/*.ts\" --ignore-path ./.prettierignore",
76
+ "prettier": "prettier \"src/**/*.ts\" \"test/**/*.ts\" --ignore-path ./.prettierignore",
77
77
  "test": "npm run build && npm run format:ci && npm run lint && npm run nobuild:coverage",
78
78
  "unit": "npm run build && npm run nobuild:unit"
79
79
  },
80
80
  "devDependencies": {
81
- "@babel/core": "^7.26.0",
81
+ "@babel/core": "^7.27.1",
82
82
  "@babel/plugin-proposal-class-properties": "^7.18.6",
83
- "@babel/plugin-transform-runtime": "^7.25.9",
84
- "@babel/preset-env": "^7.26.0",
85
- "@babel/preset-flow": "^7.25.9",
86
- "@babel/preset-react": "^7.26.3",
87
- "@babel/preset-typescript": "^7.26.0",
83
+ "@babel/plugin-transform-runtime": "^7.27.1",
84
+ "@babel/preset-env": "^7.27.2",
85
+ "@babel/preset-flow": "^7.27.1",
86
+ "@babel/preset-react": "^7.27.1",
87
+ "@babel/preset-typescript": "^7.27.1",
88
88
  "@types/bs58check": "^2.1.2",
89
89
  "@types/mocha": "^10.0.10",
90
- "@types/node": "^20.17.10",
90
+ "@types/node": "^22.15.21",
91
91
  "@types/proxyquire": "^1.3.31",
92
92
  "@types/randombytes": "^2.0.3",
93
93
  "better-npm-audit": "^3.11.0",
@@ -97,17 +97,17 @@
97
97
  "bs58": "^6.0.0",
98
98
  "dhttp": "^3.0.3",
99
99
  "ecpair": "^2.0.1",
100
- "eslint": "^9.17.0",
100
+ "eslint": "^9.27.0",
101
101
  "gulp": "^5.0.0",
102
102
  "gulp-cached": "^1.1.1",
103
103
  "gulp-typescript": "^6.0.0-alpha.1",
104
104
  "hoodwink": "^2.0.0",
105
105
  "https-browserify": "^1.0.0",
106
106
  "minimaldata": "^1.0.2",
107
- "mocha": "^11.0.1",
107
+ "mocha": "^11.5.0",
108
108
  "nyc": "^17.1.0",
109
109
  "os-browserify": "^0.3.0",
110
- "prettier": "^3.4.2",
110
+ "prettier": "^3.5.3",
111
111
  "proxyquire": "^2.1.3",
112
112
  "randombytes": "^2.1.0",
113
113
  "regtest-client": "0.2.1",
@@ -115,23 +115,23 @@
115
115
  "stream-browserify": "^3.0.0",
116
116
  "stream-http": "^3.2.0",
117
117
  "tiny-secp256k1": "^2.2.3",
118
- "ts-loader": "^9.5.1",
118
+ "ts-loader": "^9.5.2",
119
119
  "ts-node": "^10.9.2",
120
- "typedoc": "^0.27.6",
121
- "typescript": "^5.7.2",
122
- "typescript-eslint": "^8.19.0",
123
- "webpack": "^5.97.1",
120
+ "typedoc": "^0.28.5",
121
+ "typescript": "^5.8.3",
122
+ "typescript-eslint": "^8.32.1",
123
+ "webpack": "^5.99.9",
124
124
  "webpack-cli": "^6.0.1"
125
125
  },
126
126
  "dependencies": {
127
127
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
128
128
  "@btc-vision/logger": "^1.0.6",
129
- "@eslint/js": "^9.17.0",
130
- "@noble/hashes": "^1.6.1",
131
- "@noble/secp256k1": "^2.1.0",
129
+ "@eslint/js": "^9.27.0",
130
+ "@noble/hashes": "^1.8.0",
131
+ "@noble/secp256k1": "^2.2.3",
132
132
  "assert": "^2.1.0",
133
- "babel-loader": "^9.2.1",
134
- "babel-plugin-transform-import-meta": "^2.2.1",
133
+ "babel-loader": "^10.0.0",
134
+ "babel-plugin-transform-import-meta": "^2.3.2",
135
135
  "babel-preset-react": "^6.24.1",
136
136
  "babelify": "^10.0.0",
137
137
  "bip32": "^4.0.0",
@@ -145,6 +145,6 @@
145
145
  "gulp-logger-new": "^1.0.1",
146
146
  "process": "^0.11.10",
147
147
  "typeforce": "^1.18.0",
148
- "varuint-bitcoin": "^1.1.2"
148
+ "varuint-bitcoin": "^2.0.0"
149
149
  }
150
150
  }