@opcat-labs/bip174 1.0.0 → 1.0.1
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/package.json +1 -1
- package/src/cjs/lib/combiner/{index.js → index.cjs} +1 -1
- package/src/cjs/lib/converter/global/{globalXpub.js → globalXpub.cjs} +1 -1
- package/src/cjs/lib/converter/global/{unsignedTx.js → unsignedTx.cjs} +1 -1
- package/src/cjs/lib/converter/{index.js → index.cjs} +22 -22
- package/src/cjs/lib/converter/input/{finalScriptSig.js → finalScriptSig.cjs} +1 -1
- package/src/cjs/lib/converter/input/{finalScriptWitness.js → finalScriptWitness.cjs} +1 -1
- package/src/cjs/lib/converter/input/{nonWitnessUtxo.js → nonWitnessUtxo.cjs} +1 -1
- package/src/cjs/lib/converter/input/{opcatUtxo.js → opcatUtxo.cjs} +1 -1
- package/src/cjs/lib/converter/input/{partialSig.js → partialSig.cjs} +1 -1
- package/src/cjs/lib/converter/input/{porCommitment.js → porCommitment.cjs} +1 -1
- package/src/cjs/lib/converter/input/{sighashType.js → sighashType.cjs} +1 -1
- package/src/cjs/lib/converter/input/{tapKeySig.js → tapKeySig.cjs} +1 -1
- package/src/cjs/lib/converter/input/{tapLeafScript.js → tapLeafScript.cjs} +1 -1
- package/src/cjs/lib/converter/input/{tapMerkleRoot.js → tapMerkleRoot.cjs} +1 -1
- package/src/cjs/lib/converter/input/{tapScriptSig.js → tapScriptSig.cjs} +1 -1
- package/src/cjs/lib/converter/input/{witnessUtxo.js → witnessUtxo.cjs} +1 -1
- package/src/cjs/lib/converter/output/{tapTree.js → tapTree.cjs} +1 -1
- package/src/cjs/lib/converter/shared/{tapBip32Derivation.js → tapBip32Derivation.cjs} +1 -1
- package/src/cjs/lib/parser/{fromBuffer.js → fromBuffer.cjs} +3 -3
- package/src/cjs/lib/parser/{index.js → index.cjs} +2 -2
- package/src/cjs/lib/parser/{toBuffer.js → toBuffer.cjs} +2 -2
- package/src/cjs/lib/{psbt.js → psbt.cjs} +5 -5
- package/src/cjs/lib/{utils.js → utils.cjs} +1 -1
- /package/src/cjs/lib/converter/shared/{bip32Derivation.js → bip32Derivation.cjs} +0 -0
- /package/src/cjs/lib/converter/shared/{checkPubkey.js → checkPubkey.cjs} +0 -0
- /package/src/cjs/lib/converter/shared/{redeemScript.js → redeemScript.cjs} +0 -0
- /package/src/cjs/lib/converter/shared/{tapInternalKey.js → tapInternalKey.cjs} +0 -0
- /package/src/cjs/lib/converter/shared/{witnessScript.js → witnessScript.cjs} +0 -0
- /package/src/cjs/lib/converter/{tools.js → tools.cjs} +0 -0
- /package/src/cjs/lib/{interfaces.js → interfaces.cjs} +0 -0
- /package/src/cjs/lib/{typeFields.js → typeFields.cjs} +0 -0
package/package.json
CHANGED
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const index_js_1 = require(
|
10
|
+
const index_js_1 = require('../parser/index.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function combine(psbts) {
|
13
13
|
const self = psbts[0];
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
const range = (n) => [...Array(n).keys()];
|
13
13
|
function decode(keyVal) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const typeFields_js_1 = require(
|
3
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
4
4
|
function encode(data) {
|
5
5
|
return {
|
6
6
|
key: new Uint8Array([typeFields_js_1.GlobalTypes.UNSIGNED_TX]),
|
@@ -7,28 +7,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
11
|
-
const globalXpub = __importStar(require(
|
12
|
-
const unsignedTx = __importStar(require(
|
13
|
-
const finalScriptSig = __importStar(require(
|
14
|
-
const finalScriptWitness = __importStar(require(
|
15
|
-
const nonWitnessUtxo = __importStar(require(
|
16
|
-
const partialSig = __importStar(require(
|
17
|
-
const porCommitment = __importStar(require(
|
18
|
-
const sighashType = __importStar(require(
|
19
|
-
const tapKeySig = __importStar(require(
|
20
|
-
const tapLeafScript = __importStar(require(
|
21
|
-
const tapMerkleRoot = __importStar(require(
|
22
|
-
const tapScriptSig = __importStar(require(
|
23
|
-
const witnessUtxo = __importStar(require(
|
24
|
-
const opcatUtxo = __importStar(require(
|
25
|
-
const tapTree = __importStar(require(
|
26
|
-
const bip32Derivation = __importStar(require(
|
27
|
-
const checkPubkey = __importStar(require(
|
28
|
-
const redeemScript = __importStar(require(
|
29
|
-
const tapBip32Derivation = __importStar(require(
|
30
|
-
const tapInternalKey = __importStar(require(
|
31
|
-
const witnessScript = __importStar(require(
|
10
|
+
const typeFields_js_1 = require('../typeFields.cjs');
|
11
|
+
const globalXpub = __importStar(require('./global/globalXpub.cjs'));
|
12
|
+
const unsignedTx = __importStar(require('./global/unsignedTx.cjs'));
|
13
|
+
const finalScriptSig = __importStar(require('./input/finalScriptSig.cjs'));
|
14
|
+
const finalScriptWitness = __importStar(require('./input/finalScriptWitness.cjs'));
|
15
|
+
const nonWitnessUtxo = __importStar(require('./input/nonWitnessUtxo.cjs'));
|
16
|
+
const partialSig = __importStar(require('./input/partialSig.cjs'));
|
17
|
+
const porCommitment = __importStar(require('./input/porCommitment.cjs'));
|
18
|
+
const sighashType = __importStar(require('./input/sighashType.cjs'));
|
19
|
+
const tapKeySig = __importStar(require('./input/tapKeySig.cjs'));
|
20
|
+
const tapLeafScript = __importStar(require('./input/tapLeafScript.cjs'));
|
21
|
+
const tapMerkleRoot = __importStar(require('./input/tapMerkleRoot.cjs'));
|
22
|
+
const tapScriptSig = __importStar(require('./input/tapScriptSig.cjs'));
|
23
|
+
const witnessUtxo = __importStar(require('./input/witnessUtxo.cjs'));
|
24
|
+
const opcatUtxo = __importStar(require('./input/opcatUtxo.cjs'));
|
25
|
+
const tapTree = __importStar(require('./output/tapTree.cjs'));
|
26
|
+
const bip32Derivation = __importStar(require('./shared/bip32Derivation.cjs'));
|
27
|
+
const checkPubkey = __importStar(require('./shared/checkPubkey.cjs'));
|
28
|
+
const redeemScript = __importStar(require('./shared/redeemScript.cjs'));
|
29
|
+
const tapBip32Derivation = __importStar(require('./shared/tapBip32Derivation.cjs'));
|
30
|
+
const tapInternalKey = __importStar(require('./shared/tapInternalKey.cjs'));
|
31
|
+
const witnessScript = __importStar(require('./shared/witnessScript.cjs'));
|
32
32
|
const globals = {
|
33
33
|
unsignedTx,
|
34
34
|
globalXpub,
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.FINAL_SCRIPTSIG) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.FINAL_SCRIPTWITNESS) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.NON_WITNESS_UTXO) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
const varuint = __importStar(require("varuint-bitcoin"));
|
13
13
|
function decode(keyVal) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.PARTIAL_SIG) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.POR_COMMITMENT) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.SIGHASH_TYPE) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.TAP_KEY_SIG || keyVal.key.length !== 1) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.TAP_LEAF_SCRIPT) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.TAP_MERKLE_ROOT || keyVal.key.length !== 1) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function decode(keyVal) {
|
13
13
|
if (keyVal.key[0] !== typeFields_js_1.InputTypes.TAP_SCRIPT_SIG) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
const varuint = __importStar(require("varuint-bitcoin"));
|
13
13
|
function decode(keyVal) {
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const typeFields_js_1 = require(
|
10
|
+
const typeFields_js_1 = require('../../typeFields.cjs');
|
11
11
|
const varuint = __importStar(require("varuint-bitcoin"));
|
12
12
|
const tools = __importStar(require("uint8array-tools"));
|
13
13
|
function decode(keyVal) {
|
@@ -9,7 +9,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
10
|
const varuint = __importStar(require("varuint-bitcoin"));
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
|
-
const bip32Derivation = __importStar(require(
|
12
|
+
const bip32Derivation = __importStar(require('./bip32Derivation.cjs'));
|
13
13
|
const isValidBIP340Key = (pubkey) => pubkey.length === 32;
|
14
14
|
function makeConverter(TYPE_BYTE) {
|
15
15
|
const parent = bip32Derivation.makeConverter(TYPE_BYTE, isValidBIP340Key);
|
@@ -7,11 +7,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const convert = __importStar(require(
|
11
|
-
const tools_js_1 = require(
|
10
|
+
const convert = __importStar(require('../converter/index.cjs'));
|
11
|
+
const tools_js_1 = require('../converter/tools.cjs');
|
12
12
|
const varuint = __importStar(require("varuint-bitcoin"));
|
13
13
|
const tools = __importStar(require("uint8array-tools"));
|
14
|
-
const typeFields_js_1 = require(
|
14
|
+
const typeFields_js_1 = require('../typeFields.cjs');
|
15
15
|
function psbtFromBuffer(buffer, txGetter) {
|
16
16
|
let offset = 0;
|
17
17
|
function varSlice() {
|
@@ -3,5 +3,5 @@ function __export(m) {
|
|
3
3
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
4
4
|
}
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
__export(require(
|
7
|
-
__export(require(
|
6
|
+
__export(require('./fromBuffer.cjs'));
|
7
|
+
__export(require('./toBuffer.cjs'));
|
@@ -7,8 +7,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const convert = __importStar(require(
|
11
|
-
const tools_js_1 = require(
|
10
|
+
const convert = __importStar(require('../converter/index.cjs'));
|
11
|
+
const tools_js_1 = require('../converter/tools.cjs');
|
12
12
|
const tools = __importStar(require("uint8array-tools"));
|
13
13
|
function psbtToBuffer({ globalMap, inputs, outputs, }) {
|
14
14
|
const { globalKeyVals, inputKeyVals, outputKeyVals } = psbtToKeyVals({
|
@@ -7,10 +7,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const index_js_1 = require(
|
11
|
-
const index_js_2 = require(
|
12
|
-
const typeFields_js_1 = require(
|
13
|
-
const utils_js_1 = require(
|
10
|
+
const index_js_1 = require('./combiner/index.cjs');
|
11
|
+
const index_js_2 = require('./parser/index.cjs');
|
12
|
+
const typeFields_js_1 = require('./typeFields.cjs');
|
13
|
+
const utils_js_1 = require('./utils.cjs');
|
14
14
|
const tools = __importStar(require("uint8array-tools"));
|
15
15
|
class Psbt {
|
16
16
|
constructor(tx) {
|
@@ -140,6 +140,6 @@ class Psbt {
|
|
140
140
|
}
|
141
141
|
}
|
142
142
|
exports.Psbt = Psbt;
|
143
|
-
var utils_js_2 = require(
|
143
|
+
var utils_js_2 = require('./utils.cjs');
|
144
144
|
exports.checkForInput = utils_js_2.checkForInput;
|
145
145
|
exports.checkForOutput = utils_js_2.checkForOutput;
|
@@ -7,7 +7,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
7
|
return result;
|
8
8
|
};
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const converter = __importStar(require(
|
10
|
+
const converter = __importStar(require('./converter/index.cjs'));
|
11
11
|
const tools = __importStar(require("uint8array-tools"));
|
12
12
|
function checkForInput(inputs, inputIndex) {
|
13
13
|
const input = inputs[inputIndex];
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|