@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.
- package/dist/class/tx.d.ts +4 -4
- package/dist/class/tx.js +1 -12
- package/dist/class/txin.d.ts +3 -3
- package/dist/class/txin.js +1 -10
- package/dist/class/txout.d.ts +3 -3
- package/dist/class/txout.js +1 -7
- package/dist/main.cjs +3 -29
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +3 -29
- package/dist/module.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/script.js +1 -1
- package/dist/script.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/meta.d.ts +24 -0
- package/dist/types/txdata.d.ts +1 -11
- package/package.json +1 -1
- package/src/class/tx.ts +2 -14
- package/src/class/txin.ts +3 -15
- package/src/class/txout.ts +3 -9
- package/src/types/index.ts +0 -1
- package/src/types/meta.ts +30 -0
- package/src/types/txdata.ts +2 -15
- package/dist/types/class.d.ts +0 -46
- package/dist/types/class.js +0 -1
- package/src/types/class.ts +0 -52
package/dist/class/tx.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionInput } from './txin.js';
|
|
2
2
|
import { TransactionOutput } from './txout.js';
|
|
3
|
-
import type { TxData, TxTemplate,
|
|
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():
|
|
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():
|
|
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;
|
package/dist/class/txin.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TransactionOutput } from './txout.js';
|
|
2
2
|
import { TransactionWitness } from './witness.js';
|
|
3
|
-
import type { TxInput
|
|
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():
|
|
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():
|
|
25
|
+
toJSON(): TxInput;
|
|
26
26
|
toString(): string;
|
|
27
27
|
}
|
package/dist/class/txin.js
CHANGED
|
@@ -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;
|
package/dist/class/txout.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { TxOutput
|
|
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():
|
|
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():
|
|
14
|
+
toJSON(): TxOutput;
|
|
15
15
|
toString(): string;
|
|
16
16
|
}
|
package/dist/class/txout.js
CHANGED
|
@@ -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;
|