@vbyte/btc-dev 1.0.8 → 1.0.9

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.
@@ -1,6 +1,6 @@
1
1
  import { TransactionInput } from './txin.js';
2
2
  import { TransactionOutput } from './txout.js';
3
- import type { TxData, TxTemplate, TransactionData, TxOutput, TxSize, TxValue, TxInputTemplate } from '../types/index.js';
3
+ import type { TxData, TxTemplate, TxOutput, TxSize, TxValue, TxInputTemplate } from '../types/index.js';
4
4
  export declare class Transaction {
5
5
  private readonly _tx;
6
6
  private _size;
@@ -10,7 +10,7 @@ export declare class Transaction {
10
10
  private _vin;
11
11
  private _vout;
12
12
  constructor(txdata?: string | TxData | TxTemplate);
13
- get data(): TransactionData;
13
+ get data(): TxData;
14
14
  get hash(): string;
15
15
  get locktime(): {
16
16
  hex: string;
@@ -40,12 +40,12 @@ export declare class Transaction {
40
40
  witness: number;
41
41
  base: number;
42
42
  total: number;
43
- weight: number;
44
43
  vsize: number;
44
+ weight: number;
45
45
  };
46
46
  _update_tx(): void;
47
47
  _update_vin(): void;
48
48
  _update_vout(): void;
49
- toJSON(): TransactionData;
49
+ toJSON(): TxData;
50
50
  toString(): string;
51
51
  }
package/dist/class/tx.js CHANGED
@@ -16,18 +16,7 @@ export class Transaction {
16
16
  this._vout = this._tx.vout.map(txout => new TransactionOutput(txout));
17
17
  }
18
18
  get data() {
19
- return {
20
- hash: this.hash,
21
- locktime: this.locktime,
22
- return: this.return,
23
- size: this.size,
24
- spends: this.spends,
25
- txid: this.txid,
26
- value: this.value,
27
- version: this.version,
28
- vin: this.vin.map(txin => txin.data),
29
- vout: this.vout.map(txout => txout.data)
30
- };
19
+ return this._tx;
31
20
  }
32
21
  get hash() {
33
22
  return this._hash;
@@ -1,11 +1,11 @@
1
1
  import { TransactionOutput } from './txout.js';
2
2
  import { TransactionWitness } from './witness.js';
3
- import type { TxInput, TransactionInputData } from '../types/index.js';
3
+ import type { TxInput } from '../types/index.js';
4
4
  export declare class TransactionInput {
5
5
  private readonly _txin;
6
6
  constructor(txin: TxInput);
7
7
  get coinbase(): string | null;
8
- get data(): TransactionInputData;
8
+ get data(): TxInput;
9
9
  get has_prevout(): boolean;
10
10
  get is_coinbase(): boolean;
11
11
  get prevout(): TransactionOutput | null;
@@ -22,6 +22,6 @@ export declare class TransactionInput {
22
22
  get txid(): string;
23
23
  get vout(): number;
24
24
  get witness(): TransactionWitness | null;
25
- toJSON(): TransactionInputData;
25
+ toJSON(): TxInput;
26
26
  toString(): string;
27
27
  }
@@ -11,16 +11,7 @@ export class TransactionInput {
11
11
  return this._txin.coinbase;
12
12
  }
13
13
  get data() {
14
- return {
15
- coinbase: this.coinbase,
16
- prevout: this.prevout?.data ?? null,
17
- script_sig: this.script_sig,
18
- sequence: this.sequence,
19
- size: this.size,
20
- txid: this.txid,
21
- vout: this.vout,
22
- witness: this.witness?.data ?? null
23
- };
14
+ return this._txin;
24
15
  }
25
16
  get has_prevout() {
26
17
  return this._txin.prevout !== null;
@@ -1,8 +1,8 @@
1
- import type { TxOutput, TransactionOutputData } from '../types/index.js';
1
+ import type { TxOutput } from '../types/index.js';
2
2
  export declare class TransactionOutput {
3
3
  private readonly _txout;
4
4
  constructor(txout: TxOutput);
5
- get data(): TransactionOutputData;
5
+ get data(): TxOutput;
6
6
  get script_pk(): {
7
7
  hex: string;
8
8
  asm: string[];
@@ -11,6 +11,6 @@ export declare class TransactionOutput {
11
11
  get type(): import("../types/index.js").TxOutputType;
12
12
  get value(): bigint;
13
13
  get version(): import("../types/index.js").WitnessVersion;
14
- toJSON(): TransactionOutputData;
14
+ toJSON(): TxOutput;
15
15
  toString(): string;
16
16
  }
@@ -5,13 +5,7 @@ export class TransactionOutput {
5
5
  this._txout = txout;
6
6
  }
7
7
  get data() {
8
- return {
9
- script_pk: this.script_pk,
10
- size: this.size,
11
- type: this.type,
12
- value: this.value,
13
- version: this.version
14
- };
8
+ return this._txout;
15
9
  }
16
10
  get script_pk() {
17
11
  return {
package/dist/main.cjs CHANGED
@@ -9882,13 +9882,7 @@ class TransactionOutput {
9882
9882
  this._txout = txout;
9883
9883
  }
9884
9884
  get data() {
9885
- return {
9886
- script_pk: this.script_pk,
9887
- size: this.size,
9888
- type: this.type,
9889
- value: this.value,
9890
- version: this.version
9891
- };
9885
+ return this._txout;
9892
9886
  }
9893
9887
  get script_pk() {
9894
9888
  return {
@@ -10082,16 +10076,7 @@ class TransactionInput {
10082
10076
  return this._txin.coinbase;
10083
10077
  }
10084
10078
  get data() {
10085
- return {
10086
- coinbase: this.coinbase,
10087
- prevout: this.prevout?.data ?? null,
10088
- script_sig: this.script_sig,
10089
- sequence: this.sequence,
10090
- size: this.size,
10091
- txid: this.txid,
10092
- vout: this.vout,
10093
- witness: this.witness?.data ?? null
10094
- };
10079
+ return this._txin;
10095
10080
  }
10096
10081
  get has_prevout() {
10097
10082
  return this._txin.prevout !== null;
@@ -10150,18 +10135,7 @@ let Transaction$1 = class Transaction {
10150
10135
  this._vout = this._tx.vout.map(txout => new TransactionOutput(txout));
10151
10136
  }
10152
10137
  get data() {
10153
- return {
10154
- hash: this.hash,
10155
- locktime: this.locktime,
10156
- return: this.return,
10157
- size: this.size,
10158
- spends: this.spends,
10159
- txid: this.txid,
10160
- value: this.value,
10161
- version: this.version,
10162
- vin: this.vin.map(txin => txin.data),
10163
- vout: this.vout.map(txout => txout.data)
10164
- };
10138
+ return this._tx;
10165
10139
  }
10166
10140
  get hash() {
10167
10141
  return this._hash;