@btc-vision/btc-runtime 1.10.0 → 1.10.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btc-vision/btc-runtime",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "scripts": {
@@ -24,8 +24,8 @@ export class Segwit {
24
24
  * @returns The Bech32-encoded address
25
25
  */
26
26
  public static p2wsh(hrp: string, witnessScript: Uint8Array): string {
27
- if (BitcoinCodec.isValidWitnessScriptSize(witnessScript)) {
28
- throw new Revert('Witness script size is invalid');
27
+ if (!BitcoinCodec.isValidWitnessScriptSize(witnessScript)) {
28
+ throw new Revert(`Witness script size is invalid`);
29
29
  }
30
30
 
31
31
  // P2WSH uses SHA256 of the script as the witness program
@@ -38,7 +38,7 @@ export class Segwit {
38
38
  * This is useful when you need to handle encoding failures gracefully
39
39
  */
40
40
  public static p2wshOrNull(hrp: string, witnessScript: Uint8Array): string | null {
41
- if (BitcoinCodec.isValidWitnessScriptSize(witnessScript)) {
41
+ if (!BitcoinCodec.isValidWitnessScriptSize(witnessScript)) {
42
42
  throw new Revert('Witness script size is invalid');
43
43
  }
44
44
 
@@ -44,7 +44,7 @@ export class ExtendedAddress extends Address {
44
44
  * The 32-byte tweaked Schnorr public key for taproot compatibility.
45
45
  * This key is used for P2TR address generation and Schnorr signature verification.
46
46
  */
47
- private readonly tweakedPublicKey: Uint8Array;
47
+ public readonly tweakedPublicKey: Uint8Array;
48
48
 
49
49
  /**
50
50
  * Creates a new ExtendedAddress instance.