@btc-vision/bitcoin 6.4.6 → 6.4.7

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/psbt.d.ts CHANGED
@@ -43,6 +43,7 @@ export declare class Psbt {
43
43
  clone(): Psbt;
44
44
  setMaximumFeeRate(satoshiPerByte: number): void;
45
45
  setVersion(version: number): this;
46
+ setVersionTRUC(): this;
46
47
  setLocktime(locktime: number): this;
47
48
  setInputSequence(inputIndex: number, sequence: number): this;
48
49
  addInputs(inputDatas: PsbtInputExtended[], checkPartialSigs?: boolean): this;
@@ -98,6 +99,7 @@ export declare class Psbt {
98
99
  export interface PsbtOptsOptional {
99
100
  network?: Network;
100
101
  maximumFeeRate?: number;
102
+ version?: 1 | 2 | 3;
101
103
  }
102
104
  export interface PsbtOpts {
103
105
  network: Network;
@@ -20,6 +20,9 @@ export declare class Transaction {
20
20
  static readonly SIGHASH_INPUT_MASK = 128;
21
21
  static readonly ADVANCED_TRANSACTION_MARKER = 0;
22
22
  static readonly ADVANCED_TRANSACTION_FLAG = 1;
23
+ static readonly TRUC_VERSION = 3;
24
+ static readonly TRUC_MAX_VSIZE = 10000;
25
+ static readonly TRUC_CHILD_MAX_VSIZE = 1000;
23
26
  version: number;
24
27
  locktime: number;
25
28
  ins: Input[];
package/build/psbt.d.ts CHANGED
@@ -43,6 +43,7 @@ export declare class Psbt {
43
43
  clone(): Psbt;
44
44
  setMaximumFeeRate(satoshiPerByte: number): void;
45
45
  setVersion(version: number): this;
46
+ setVersionTRUC(): this;
46
47
  setLocktime(locktime: number): this;
47
48
  setInputSequence(inputIndex: number, sequence: number): this;
48
49
  addInputs(inputDatas: PsbtInputExtended[], checkPartialSigs?: boolean): this;
@@ -98,6 +99,7 @@ export declare class Psbt {
98
99
  export interface PsbtOptsOptional {
99
100
  network?: Network;
100
101
  maximumFeeRate?: number;
102
+ version?: 1 | 2 | 3;
101
103
  }
102
104
  export interface PsbtOpts {
103
105
  network: Network;
package/build/psbt.js CHANGED
@@ -25,7 +25,10 @@ export class Psbt {
25
25
  __TX: this.data.globalMap.unsignedTx.tx,
26
26
  __UNSAFE_SIGN_NONSEGWIT: false,
27
27
  };
28
- if (this.data.inputs.length === 0)
28
+ if (opts.version === 3) {
29
+ this.setVersionTRUC();
30
+ }
31
+ else if (this.data.inputs.length === 0)
29
32
  this.setVersion(2);
30
33
  const dpew = (obj, attr, enumerable, writable) => {
31
34
  Object.defineProperty(obj, attr, {
@@ -105,6 +108,9 @@ export class Psbt {
105
108
  c.__EXTRACTED_TX = undefined;
106
109
  return this;
107
110
  }
111
+ setVersionTRUC() {
112
+ return this.setVersion(Transaction.TRUC_VERSION);
113
+ }
108
114
  setLocktime(locktime) {
109
115
  check32Bit(locktime);
110
116
  checkInputsForPartialSig(this.data.inputs, 'setLocktime');
@@ -20,6 +20,9 @@ export declare class Transaction {
20
20
  static readonly SIGHASH_INPUT_MASK = 128;
21
21
  static readonly ADVANCED_TRANSACTION_MARKER = 0;
22
22
  static readonly ADVANCED_TRANSACTION_FLAG = 1;
23
+ static readonly TRUC_VERSION = 3;
24
+ static readonly TRUC_MAX_VSIZE = 10000;
25
+ static readonly TRUC_CHILD_MAX_VSIZE = 1000;
23
26
  version: number;
24
27
  locktime: number;
25
28
  ins: Input[];
@@ -443,3 +443,6 @@ Transaction.SIGHASH_OUTPUT_MASK = 0x03;
443
443
  Transaction.SIGHASH_INPUT_MASK = 0x80;
444
444
  Transaction.ADVANCED_TRANSACTION_MARKER = 0x00;
445
445
  Transaction.ADVANCED_TRANSACTION_FLAG = 0x01;
446
+ Transaction.TRUC_VERSION = 3;
447
+ Transaction.TRUC_MAX_VSIZE = 10000;
448
+ Transaction.TRUC_CHILD_MAX_VSIZE = 1000;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/bitcoin",
3
3
  "type": "module",
4
- "version": "6.4.6",
4
+ "version": "6.4.7",
5
5
  "description": "Client-side Bitcoin JavaScript library",
6
6
  "engines": {
7
7
  "node": ">=16.0.0"