@vbyte/btc-dev 1.1.1 → 1.1.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/dist/lib/tx/util.d.ts +5 -4
- package/dist/lib/tx/util.js +14 -12
- package/dist/main.cjs +17 -15
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +17 -15
- 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/meta.d.ts +3 -3
- package/package.json +1 -1
- package/src/lib/tx/util.ts +21 -19
- package/src/types/meta.ts +3 -3
package/dist/module.mjs
CHANGED
|
@@ -9677,26 +9677,28 @@ function encode_script_data(script) {
|
|
|
9677
9677
|
}
|
|
9678
9678
|
|
|
9679
9679
|
function is_return_script(script) {
|
|
9680
|
-
|
|
9680
|
+
const bytes = Buff.bytes(script);
|
|
9681
|
+
return bytes.at(0) === 0x6a;
|
|
9681
9682
|
}
|
|
9682
|
-
function
|
|
9683
|
+
function get_vout_script_info(script) {
|
|
9683
9684
|
return {
|
|
9684
|
-
type:
|
|
9685
|
-
version:
|
|
9685
|
+
type: get_vout_script_type(script),
|
|
9686
|
+
version: get_vout_script_version(script)
|
|
9686
9687
|
};
|
|
9687
9688
|
}
|
|
9688
|
-
function
|
|
9689
|
+
function get_vout_script_type(script) {
|
|
9690
|
+
const hex = Buff.bytes(script).hex;
|
|
9689
9691
|
for (const [type, regex] of Object.entries(LOCK_SCRIPT_REGEX)) {
|
|
9690
|
-
if (regex.test(
|
|
9692
|
+
if (regex.test(hex))
|
|
9691
9693
|
return type;
|
|
9692
9694
|
}
|
|
9693
|
-
return
|
|
9695
|
+
return null;
|
|
9694
9696
|
}
|
|
9695
|
-
function
|
|
9696
|
-
const
|
|
9697
|
-
switch (
|
|
9698
|
-
case
|
|
9699
|
-
case
|
|
9697
|
+
function get_vout_script_version(script) {
|
|
9698
|
+
const version = Buff.bytes(script);
|
|
9699
|
+
switch (version.at(0)) {
|
|
9700
|
+
case 0x00: return 0;
|
|
9701
|
+
case 0x51: return 1;
|
|
9700
9702
|
default: return null;
|
|
9701
9703
|
}
|
|
9702
9704
|
}
|
|
@@ -10005,10 +10007,10 @@ var index$4 = /*#__PURE__*/Object.freeze({
|
|
|
10005
10007
|
get_txout_size: get_txout_size,
|
|
10006
10008
|
get_txsize: get_txsize,
|
|
10007
10009
|
get_vin_size: get_vin_size,
|
|
10008
|
-
|
|
10010
|
+
get_vout_script_info: get_vout_script_info,
|
|
10011
|
+
get_vout_script_type: get_vout_script_type,
|
|
10012
|
+
get_vout_script_version: get_vout_script_version,
|
|
10009
10013
|
get_vout_size: get_vout_size,
|
|
10010
|
-
get_vout_type: get_vout_type,
|
|
10011
|
-
get_vout_version: get_vout_version,
|
|
10012
10014
|
get_vsize: get_vsize,
|
|
10013
10015
|
is_return_script: is_return_script,
|
|
10014
10016
|
normalize_prevout: normalize_prevout,
|