@vbyte/btc-dev 1.0.12 → 1.0.13
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/lib/tx/create.d.ts +6 -6
- package/dist/lib/tx/create.js +2 -2
- package/dist/main.cjs +2 -2
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +2 -2
- 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/txdata.d.ts +5 -12
- package/package.json +1 -1
- package/src/lib/tx/create.ts +8 -8
- package/src/types/txdata.ts +5 -13
package/dist/lib/tx/create.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TxData, TxInput, TxOutput, TxTemplate, TxSpendInput, TxCoinbaseInput, TxOutputTemplate, TxVirtualInput,
|
|
2
|
-
export declare function create_coinbase_input(config:
|
|
3
|
-
export declare function create_virtual_input(config:
|
|
4
|
-
export declare function create_spend_input(config:
|
|
5
|
-
export declare function create_tx_input(config:
|
|
1
|
+
import type { TxData, TxInput, TxOutput, TxTemplate, TxSpendInput, TxCoinbaseInput, TxOutputTemplate, TxVirtualInput, TxInputTemplate } from '../../types/index.js';
|
|
2
|
+
export declare function create_coinbase_input(config: TxInputTemplate): TxCoinbaseInput;
|
|
3
|
+
export declare function create_virtual_input(config: TxInputTemplate): TxVirtualInput;
|
|
4
|
+
export declare function create_spend_input(config: TxInputTemplate): TxSpendInput;
|
|
5
|
+
export declare function create_tx_input(config: TxInputTemplate): TxInput;
|
|
6
6
|
export declare function create_tx_output(config: TxOutputTemplate): TxOutput;
|
|
7
|
-
export declare function create_tx(config?:
|
|
7
|
+
export declare function create_tx(config?: TxTemplate): TxData;
|
package/dist/lib/tx/create.js
CHANGED
|
@@ -41,9 +41,9 @@ export function create_tx_output(config) {
|
|
|
41
41
|
const value = normalize_value(config.value);
|
|
42
42
|
return { script_pk, value };
|
|
43
43
|
}
|
|
44
|
-
export function create_tx(config
|
|
44
|
+
export function create_tx(config) {
|
|
45
45
|
assert_tx_template(config);
|
|
46
|
-
const { vin = [], vout = [] } = config;
|
|
46
|
+
const { vin = [], vout = [] } = config ?? { vin: [], vout: [] };
|
|
47
47
|
const locktime = config.locktime ?? DEFAULT.LOCKTIME;
|
|
48
48
|
const version = config.version ?? DEFAULT.VERSION;
|
|
49
49
|
const inputs = vin.map(txin => create_tx_input(txin));
|
package/dist/main.cjs
CHANGED
|
@@ -13719,9 +13719,9 @@ function create_tx_output(config) {
|
|
|
13719
13719
|
const value = normalize_value(config.value);
|
|
13720
13720
|
return { script_pk, value };
|
|
13721
13721
|
}
|
|
13722
|
-
function create_tx(config
|
|
13722
|
+
function create_tx(config) {
|
|
13723
13723
|
assert_tx_template(config);
|
|
13724
|
-
const { vin = [], vout = [] } = config;
|
|
13724
|
+
const { vin = [], vout = [] } = config ?? { vin: [], vout: [] };
|
|
13725
13725
|
const locktime = config.locktime ?? DEFAULT.LOCKTIME;
|
|
13726
13726
|
const version = config.version ?? DEFAULT.VERSION;
|
|
13727
13727
|
const inputs = vin.map(txin => create_tx_input(txin));
|